Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG99ed6e2f6606: rebase: reduce scope of a variable
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | hgext/rebase.py (2 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | Jul 11 2018, 6:03 PM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
obsoleteextinctsuccessors = set([]) | obsoleteextinctsuccessors = set([]) | ||||
assert repo.filtername is None | assert repo.filtername is None | ||||
cl = repo.changelog | cl = repo.changelog | ||||
nodemap = cl.nodemap | nodemap = cl.nodemap | ||||
extinctnodes = set(cl.node(r) for r in repo.revs('extinct()')) | extinctnodes = set(cl.node(r) for r in repo.revs('extinct()')) | ||||
for srcrev in rebaseobsrevs: | for srcrev in rebaseobsrevs: | ||||
srcnode = cl.node(srcrev) | srcnode = cl.node(srcrev) | ||||
destnode = cl.node(destmap[srcrev]) | |||||
# XXX: more advanced APIs are required to handle split correctly | # XXX: more advanced APIs are required to handle split correctly | ||||
successors = set(obsutil.allsuccessors(repo.obsstore, [srcnode])) | successors = set(obsutil.allsuccessors(repo.obsstore, [srcnode])) | ||||
# obsutil.allsuccessors includes node itself | # obsutil.allsuccessors includes node itself | ||||
successors.remove(srcnode) | successors.remove(srcnode) | ||||
if successors.issubset(extinctnodes): | if successors.issubset(extinctnodes): | ||||
# all successors are extinct | # all successors are extinct | ||||
obsoleteextinctsuccessors.add(srcrev) | obsoleteextinctsuccessors.add(srcrev) | ||||
if not successors: | if not successors: | ||||
# no successor | # no successor | ||||
obsoletenotrebased[srcrev] = None | obsoletenotrebased[srcrev] = None | ||||
else: | else: | ||||
destnode = cl.node(destmap[srcrev]) | |||||
for succnode in successors: | for succnode in successors: | ||||
if succnode not in nodemap: | if succnode not in nodemap: | ||||
continue | continue | ||||
if cl.isancestor(succnode, destnode): | if cl.isancestor(succnode, destnode): | ||||
obsoletenotrebased[srcrev] = nodemap[succnode] | obsoletenotrebased[srcrev] = nodemap[succnode] | ||||
break | break | ||||
else: | else: | ||||
# If 'srcrev' has a successor in rebase set but none in | # If 'srcrev' has a successor in rebase set but none in |