Skip to content

Commit

Permalink
debug: fix the redefinition warning
Browse files Browse the repository at this point in the history
Summary:
This diff is to fix the following `redefinition` warning:

```
redefinition of unused 'ctx2str' from line 3183
```

Reviewed By: lmvasquezg

Differential Revision: D64572515

fbshipit-source-id: ff7aca636beafc3f7b3fd5f0e516d5ecee1fc32d
  • Loading branch information
zzl0 authored and facebook-github-bot committed Oct 18, 2024
1 parent 82e38c0 commit 7bde91a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions eden/scm/sapling/commands/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -3180,18 +3180,16 @@ def debugsuccessorssets(ui, repo, *revs, **opts) -> None:
"""
# passed to successorssets caching computation from one call to another
cache = {}
ctx2str = str
node2str = short
if mutation.enabled(repo):
successorssets = mutation.successorssets
else:
successorssets = []
if ui.debug():

def ctx2str(ctx):
return ctx.hex()

ctx2str = lambda ctx: ctx.hex()
node2str = hex
else:
ctx2str = str
node2str = short
for rev in scmutil.revrange(repo, revs):
ctx = repo[rev]
ui.write("%s\n" % ctx2str(ctx))
Expand Down

0 comments on commit 7bde91a

Please sign in to comment.