Mercurial > public > mercurial-scm > hg
comparison hgext/extdiff.py @ 37253:6089ef933ab5
extdiff: use context-returning revpair()
Differential Revision: https://phab.mercurial-scm.org/D3007
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 31 Mar 2018 23:38:53 -0700 |
parents | 7c0f40f4f7bf |
children | daafaff4e5be |
comparison
equal
deleted
inserted
replaced
37252:e9ee540af434 | 37253:6089ef933ab5 |
---|---|
166 | 166 |
167 if revs and change: | 167 if revs and change: |
168 msg = _('cannot specify --rev and --change at the same time') | 168 msg = _('cannot specify --rev and --change at the same time') |
169 raise error.Abort(msg) | 169 raise error.Abort(msg) |
170 elif change: | 170 elif change: |
171 node2 = scmutil.revsingle(repo, change, None).node() | 171 ctx2 = scmutil.revsingle(repo, change, None) |
172 node1a, node1b = repo.changelog.parents(node2) | 172 ctx1a, ctx1b = ctx2.p1(), ctx2.p2() |
173 else: | 173 else: |
174 node1a, node2 = scmutil.revpairnodes(repo, revs) | 174 ctx1a, ctx2 = scmutil.revpair(repo, revs) |
175 if not revs: | 175 if not revs: |
176 node1b = repo.dirstate.p2() | 176 ctx1b = repo[None].p2() |
177 else: | 177 else: |
178 node1b = nullid | 178 ctx1b = repo[nullid] |
179 | |
180 node1a = ctx1a.node() | |
181 node1b = ctx1b.node() | |
182 node2 = ctx2.node() | |
179 | 183 |
180 # Disable 3-way merge if there is only one parent | 184 # Disable 3-way merge if there is only one parent |
181 if do3way: | 185 if do3way: |
182 if node1b == nullid: | 186 if node1b == nullid: |
183 do3way = False | 187 do3way = False |