Mercurial > hg
comparison tests/autodiff.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 | 154754d1f137 |
children | f654105f1517 |
comparison
equal
deleted
inserted
replaced
37250:9640ccf44ac0 | 37251:7c0f40f4f7bf |
---|---|
38 def losedatafn(fn=None, **kwargs): | 38 def losedatafn(fn=None, **kwargs): |
39 raise error.Abort(b'losing data for %s' % fn) | 39 raise error.Abort(b'losing data for %s' % fn) |
40 else: | 40 else: |
41 raise error.Abort(b'--git must be yes, no or auto') | 41 raise error.Abort(b'--git must be yes, no or auto') |
42 | 42 |
43 node1, node2 = scmutil.revpair(repo, []) | 43 node1, node2 = scmutil.revpairnodes(repo, []) |
44 m = scmutil.match(repo[node2], pats, opts) | 44 m = scmutil.match(repo[node2], pats, opts) |
45 it = patch.diff(repo, node1, node2, match=m, opts=diffopts, | 45 it = patch.diff(repo, node1, node2, match=m, opts=diffopts, |
46 losedatafn=losedatafn) | 46 losedatafn=losedatafn) |
47 for chunk in it: | 47 for chunk in it: |
48 ui.write(chunk) | 48 ui.write(chunk) |