Mercurial > hg
comparison mercurial/rewriteutil.py @ 47016:8ad2f43fe37b
rewriteutil: add devel warning if precheck is called with contexts
I'm trying to upstream parts from the evolve extension. This check
exists there.
Differential Revision: https://phab.mercurial-scm.org/D10515
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Thu, 11 Feb 2021 15:02:57 -0800 |
parents | 7001f92e0ee9 |
children | 7a90fddb13b0 |
comparison
equal
deleted
inserted
replaced
47015:7001f92e0ee9 | 47016:8ad2f43fe37b |
---|---|
19 error, | 19 error, |
20 obsolete, | 20 obsolete, |
21 obsutil, | 21 obsutil, |
22 revset, | 22 revset, |
23 scmutil, | 23 scmutil, |
24 util, | |
24 ) | 25 ) |
25 | 26 |
26 | 27 |
27 NODE_RE = re.compile(br'\b[0-9a-f]{6,64}\b') | 28 NODE_RE = re.compile(br'\b[0-9a-f]{6,64}\b') |
28 | 29 |
35 """ | 36 """ |
36 if nullrev in revs: | 37 if nullrev in revs: |
37 msg = _(b"cannot %s the null revision") % action | 38 msg = _(b"cannot %s the null revision") % action |
38 hint = _(b"no changeset checked out") | 39 hint = _(b"no changeset checked out") |
39 raise error.InputError(msg, hint=hint) | 40 raise error.InputError(msg, hint=hint) |
41 | |
42 if any(util.safehasattr(r, 'rev') for r in revs): | |
43 repo.ui.develwarn(b"rewriteutil.precheck called with ctx not revs") | |
44 revs = (r.rev() for r in revs) | |
40 | 45 |
41 if len(repo[None].parents()) > 1: | 46 if len(repo[None].parents()) > 1: |
42 raise error.StateError(_(b"cannot %s while merging") % action) | 47 raise error.StateError(_(b"cannot %s while merging") % action) |
43 | 48 |
44 publicrevs = repo.revs(b'%ld and public()', revs) | 49 publicrevs = repo.revs(b'%ld and public()', revs) |