Details
Details
- Reviewers
- None
- Group Reviewers
hg-reviewers - Commits
- rHG6089ef933ab5: extdiff: use context-returning revpair()
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/extdiff.py (14 lines) |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
revs = opts.get('rev') | revs = opts.get('rev') | ||||
change = opts.get('change') | change = opts.get('change') | ||||
do3way = '$parent2' in cmdline | do3way = '$parent2' in cmdline | ||||
if revs and change: | if revs and change: | ||||
msg = _('cannot specify --rev and --change at the same time') | msg = _('cannot specify --rev and --change at the same time') | ||||
raise error.Abort(msg) | raise error.Abort(msg) | ||||
elif change: | elif change: | ||||
node2 = scmutil.revsingle(repo, change, None).node() | ctx2 = scmutil.revsingle(repo, change, None) | ||||
node1a, node1b = repo.changelog.parents(node2) | ctx1a, ctx1b = ctx2.p1(), ctx2.p2() | ||||
else: | else: | ||||
node1a, node2 = scmutil.revpairnodes(repo, revs) | ctx1a, ctx2 = scmutil.revpair(repo, revs) | ||||
if not revs: | if not revs: | ||||
node1b = repo.dirstate.p2() | ctx1b = repo[None].p2() | ||||
else: | else: | ||||
node1b = nullid | ctx1b = repo[nullid] | ||||
node1a = ctx1a.node() | |||||
node1b = ctx1b.node() | |||||
node2 = ctx2.node() | |||||
# Disable 3-way merge if there is only one parent | # Disable 3-way merge if there is only one parent | ||||
if do3way: | if do3way: | ||||
if node1b == nullid: | if node1b == nullid: | ||||
do3way = False | do3way = False | ||||
subrepos=opts.get('subrepos') | subrepos=opts.get('subrepos') | ||||