Mercurial > hg
comparison mercurial/commands.py @ 37251:7c0f40f4f7bf
scmutil: introduce deprecated alias for revpair()
revsingle() returns a context object, revpair() returns nodeids,
revrange() returns integer revisions (in a revset). I'm going to
reduce this inconsistency by making revpair() return context
objects. Changing the return type is not nice to extensions, so this
patch introduces a nodeid-returning version of revpair() that they can
detect and use. Update callers to the new function so we can change
revpair() itself and then migrate them back one by one.
Differential Revision: https://phab.mercurial-scm.org/D3005
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Sat, 31 Mar 2018 23:37:25 -0700 |
parents | 6c7a6b04b274 |
children | ddf50e82e21a |
comparison
equal
deleted
inserted
replaced
37250:9640ccf44ac0 | 37251:7c0f40f4f7bf |
---|---|
1876 repo = scmutil.unhidehashlikerevs(repo, [change], 'nowarn') | 1876 repo = scmutil.unhidehashlikerevs(repo, [change], 'nowarn') |
1877 node2 = scmutil.revsingle(repo, change, None).node() | 1877 node2 = scmutil.revsingle(repo, change, None).node() |
1878 node1 = repo[node2].p1().node() | 1878 node1 = repo[node2].p1().node() |
1879 else: | 1879 else: |
1880 repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') | 1880 repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') |
1881 node1, node2 = scmutil.revpair(repo, revs) | 1881 node1, node2 = scmutil.revpairnodes(repo, revs) |
1882 | 1882 |
1883 if reverse: | 1883 if reverse: |
1884 node1, node2 = node2, node1 | 1884 node1, node2 = node2, node1 |
1885 | 1885 |
1886 diffopts = patch.diffallopts(ui, opts) | 1886 diffopts = patch.diffallopts(ui, opts) |
4878 repo = scmutil.unhidehashlikerevs(repo, [change], 'nowarn') | 4878 repo = scmutil.unhidehashlikerevs(repo, [change], 'nowarn') |
4879 node2 = scmutil.revsingle(repo, change, None).node() | 4879 node2 = scmutil.revsingle(repo, change, None).node() |
4880 node1 = repo[node2].p1().node() | 4880 node1 = repo[node2].p1().node() |
4881 else: | 4881 else: |
4882 repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') | 4882 repo = scmutil.unhidehashlikerevs(repo, revs, 'nowarn') |
4883 node1, node2 = scmutil.revpair(repo, revs) | 4883 node1, node2 = scmutil.revpairnodes(repo, revs) |
4884 | 4884 |
4885 if pats or ui.configbool('commands', 'status.relative'): | 4885 if pats or ui.configbool('commands', 'status.relative'): |
4886 cwd = repo.getcwd() | 4886 cwd = repo.getcwd() |
4887 else: | 4887 else: |
4888 cwd = '' | 4888 cwd = '' |