Mercurial > evolve
annotate hgext3rd/topic/compat.py @ 6889:a66cf9008781
obslog: also display patch for rebased changesets
This applies the same logic that is used for "merge-diff" to rebased
changesets. The successors' content is compared to the content of the
predecessors rebased in-memory on the new parents.
This highlights the changes that were actually introduced while rebasing (like
conflict resolution or API adjustment).
As a side effect, obslog now also outputs slightly more diffs for splits,
showing what parts of the original big changeset were moved to the smaller
split components (but for now it only works for the first few changesets).
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 22 Sep 2024 02:58:54 +0200 |
parents | 71c4b6c2bcdc |
children |
rev | line source |
---|---|
2922
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
1 # Copyright 2017 FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
2 # |
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
3 # This software may be used and distributed according to the terms of the |
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
4 # GNU General Public License version 2 or any later version. |
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
5 """ |
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
6 Compatibility module |
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
7 """ |
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
8 from __future__ import absolute_import |
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
9 |
6320
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
10 from mercurial.i18n import _ |
3094
e11e018e8338
compat: add an abstraction for 'scmutil.cleanupnodes'
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3064
diff
changeset
|
11 from mercurial import ( |
5665
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
12 cmdutil, |
6318
3e488afe62f5
topic: use compat.InputError for conflicting CLI flags
Anton Shestakov <av6@dwimlabs.net>
parents:
6305
diff
changeset
|
13 error, |
5665
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
14 extensions, |
4743
92e3db149d7d
py3: call branchmap.items() on py3 and continue to call iteritems() on py2
Martin von Zweigbergk <martinvonz@google.com>
parents:
3701
diff
changeset
|
15 pycompat, |
4957
e8302f760a54
compat: compatibility for cl.nodemap.get vs cl.index.get_rev
Anton Shestakov <av6@dwimlabs.net>
parents:
4810
diff
changeset
|
16 util, |
3094
e11e018e8338
compat: add an abstraction for 'scmutil.cleanupnodes'
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
3064
diff
changeset
|
17 ) |
2922
66357d4d03b2
topic: centralize compatibility logic between hg versions into compat module
FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
parents:
diff
changeset
|
18 |
4743
92e3db149d7d
py3: call branchmap.items() on py3 and continue to call iteritems() on py2
Martin von Zweigbergk <martinvonz@google.com>
parents:
3701
diff
changeset
|
19 if pycompat.ispy3: |
92e3db149d7d
py3: call branchmap.items() on py3 and continue to call iteritems() on py2
Martin von Zweigbergk <martinvonz@google.com>
parents:
3701
diff
changeset
|
20 def branchmapitems(branchmap): |
92e3db149d7d
py3: call branchmap.items() on py3 and continue to call iteritems() on py2
Martin von Zweigbergk <martinvonz@google.com>
parents:
3701
diff
changeset
|
21 return branchmap.items() |
92e3db149d7d
py3: call branchmap.items() on py3 and continue to call iteritems() on py2
Martin von Zweigbergk <martinvonz@google.com>
parents:
3701
diff
changeset
|
22 else: |
4810
03690f8d2b0a
python3: add ignore block around python 2 compatibility if branch
Raphaël Gomès <rgomes@octobus.net>
parents:
4743
diff
changeset
|
23 # py3-transform: off |
4743
92e3db149d7d
py3: call branchmap.items() on py3 and continue to call iteritems() on py2
Martin von Zweigbergk <martinvonz@google.com>
parents:
3701
diff
changeset
|
24 def branchmapitems(branchmap): |
92e3db149d7d
py3: call branchmap.items() on py3 and continue to call iteritems() on py2
Martin von Zweigbergk <martinvonz@google.com>
parents:
3701
diff
changeset
|
25 return branchmap.iteritems() |
4810
03690f8d2b0a
python3: add ignore block around python 2 compatibility if branch
Raphaël Gomès <rgomes@octobus.net>
parents:
4743
diff
changeset
|
26 # py3-transform: on |
4957
e8302f760a54
compat: compatibility for cl.nodemap.get vs cl.index.get_rev
Anton Shestakov <av6@dwimlabs.net>
parents:
4810
diff
changeset
|
27 |
e8302f760a54
compat: compatibility for cl.nodemap.get vs cl.index.get_rev
Anton Shestakov <av6@dwimlabs.net>
parents:
4810
diff
changeset
|
28 # nodemap.get and index.[has_node|rev|get_rev] |
5193
a4d081923c81
compat: update hg-X.Y compat comments and test them
Anton Shestakov <av6@dwimlabs.net>
parents:
4963
diff
changeset
|
29 # hg <= 5.2 (02802fa87b74) |
4957
e8302f760a54
compat: compatibility for cl.nodemap.get vs cl.index.get_rev
Anton Shestakov <av6@dwimlabs.net>
parents:
4810
diff
changeset
|
30 def getgetrev(cl): |
e8302f760a54
compat: compatibility for cl.nodemap.get vs cl.index.get_rev
Anton Shestakov <av6@dwimlabs.net>
parents:
4810
diff
changeset
|
31 """Returns index.get_rev or nodemap.get (for pre-5.3 Mercurial).""" |
e8302f760a54
compat: compatibility for cl.nodemap.get vs cl.index.get_rev
Anton Shestakov <av6@dwimlabs.net>
parents:
4810
diff
changeset
|
32 if util.safehasattr(cl.index, 'get_rev'): |
e8302f760a54
compat: compatibility for cl.nodemap.get vs cl.index.get_rev
Anton Shestakov <av6@dwimlabs.net>
parents:
4810
diff
changeset
|
33 return cl.index.get_rev |
e8302f760a54
compat: compatibility for cl.nodemap.get vs cl.index.get_rev
Anton Shestakov <av6@dwimlabs.net>
parents:
4810
diff
changeset
|
34 return cl.nodemap.get |
5426
86736040b0ec
topic: compatibility with sparse phaseroots and phasesets in 5.5
Joerg Sonnenberger <joerg@bec.de>
parents:
5193
diff
changeset
|
35 |
86736040b0ec
topic: compatibility with sparse phaseroots and phasesets in 5.5
Joerg Sonnenberger <joerg@bec.de>
parents:
5193
diff
changeset
|
36 # hg <= 5.4 (e2d17974a869) |
86736040b0ec
topic: compatibility with sparse phaseroots and phasesets in 5.5
Joerg Sonnenberger <joerg@bec.de>
parents:
5193
diff
changeset
|
37 def nonpublicphaseroots(repo): |
86736040b0ec
topic: compatibility with sparse phaseroots and phasesets in 5.5
Joerg Sonnenberger <joerg@bec.de>
parents:
5193
diff
changeset
|
38 if util.safehasattr(repo._phasecache, 'nonpublicphaseroots'): |
86736040b0ec
topic: compatibility with sparse phaseroots and phasesets in 5.5
Joerg Sonnenberger <joerg@bec.de>
parents:
5193
diff
changeset
|
39 return repo._phasecache.nonpublicphaseroots(repo) |
86736040b0ec
topic: compatibility with sparse phaseroots and phasesets in 5.5
Joerg Sonnenberger <joerg@bec.de>
parents:
5193
diff
changeset
|
40 return set().union( |
86736040b0ec
topic: compatibility with sparse phaseroots and phasesets in 5.5
Joerg Sonnenberger <joerg@bec.de>
parents:
5193
diff
changeset
|
41 *[roots for roots in repo._phasecache.phaseroots[1:] if roots] |
86736040b0ec
topic: compatibility with sparse phaseroots and phasesets in 5.5
Joerg Sonnenberger <joerg@bec.de>
parents:
5193
diff
changeset
|
42 ) |
5665
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
43 |
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
44 def overridecommitstatus(overridefn): |
6547
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
45 code = cmdutil.commitstatus.__code__ |
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
46 if r'opts' in code.co_varnames[code.co_argcount:]: |
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
47 # commitstatus(..., **opts) |
5665
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
48 extensions.wrapfunction(cmdutil, 'commitstatus', overridefn) |
6547
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
49 elif r'tip' in code.co_varnames: |
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
50 # hg <= 6.5 (489268c8ee7e) |
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
51 def _override(orig, repo, node, branch, bheads=None, tip=None, opts=None): |
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
52 def _orig(repo, node, branch, bheads=None, tip=None, **opts): |
6571
40875ca5e724
compat: older hg versions need byteskwargs in commitstatus()
Anton Shestakov <av6@dwimlabs.net>
parents:
6570
diff
changeset
|
53 opts = pycompat.byteskwargs(opts) |
6569
9a55b007faf6
compat: make sure to actually pass tip to commitstatus()
Anton Shestakov <av6@dwimlabs.net>
parents:
6547
diff
changeset
|
54 return orig(repo, node, branch, bheads=bheads, tip=tip, opts=opts) |
6697
4c6d35f92469
topic: handle commitstatus() with opts=None for hg <= 6.5 too
Zeger Van de Vannet <zeger@vandevan.net>
parents:
6571
diff
changeset
|
55 if opts is None: |
4c6d35f92469
topic: handle commitstatus() with opts=None for hg <= 6.5 too
Zeger Van de Vannet <zeger@vandevan.net>
parents:
6571
diff
changeset
|
56 opts = {} |
6547
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
57 opts = pycompat.strkwargs(opts) |
6569
9a55b007faf6
compat: make sure to actually pass tip to commitstatus()
Anton Shestakov <av6@dwimlabs.net>
parents:
6547
diff
changeset
|
58 return overridefn(_orig, repo, node, branch, bheads=bheads, tip=tip, **opts) |
6547
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
59 extensions.wrapfunction(cmdutil, 'commitstatus', _override) |
5665
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
60 else: |
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
61 # hg <= 5.6 (976b26bdd0d8) |
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
62 def _override(orig, repo, node, branch, bheads=None, opts=None): |
6570
5b23394b03aa
compat: hg 5.6 doesn't have tip as an argument to commitstatus() at all
Anton Shestakov <av6@dwimlabs.net>
parents:
6569
diff
changeset
|
63 def _orig(repo, node, branch, bheads=None, **opts): |
6571
40875ca5e724
compat: older hg versions need byteskwargs in commitstatus()
Anton Shestakov <av6@dwimlabs.net>
parents:
6570
diff
changeset
|
64 opts = pycompat.byteskwargs(opts) |
5665
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
65 return orig(repo, node, branch, bheads=bheads, opts=opts) |
6547
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
66 if opts is None: |
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
67 opts = {} |
d13cfd9eb6c0
topic: compatibility for commitstatus(..., **opts)
Anton Shestakov <av6@dwimlabs.net>
parents:
6333
diff
changeset
|
68 opts = pycompat.strkwargs(opts) |
6570
5b23394b03aa
compat: hg 5.6 doesn't have tip as an argument to commitstatus() at all
Anton Shestakov <av6@dwimlabs.net>
parents:
6569
diff
changeset
|
69 return overridefn(_orig, repo, node, branch, bheads=bheads, **opts) |
5665
dd9dba7c1d00
compat: make topics compatible across change to cmdutil.commitstatus()
Martin von Zweigbergk <martinvonz@google.com>
parents:
5426
diff
changeset
|
70 extensions.wrapfunction(cmdutil, 'commitstatus', _override) |
6318
3e488afe62f5
topic: use compat.InputError for conflicting CLI flags
Anton Shestakov <av6@dwimlabs.net>
parents:
6305
diff
changeset
|
71 |
3e488afe62f5
topic: use compat.InputError for conflicting CLI flags
Anton Shestakov <av6@dwimlabs.net>
parents:
6305
diff
changeset
|
72 if util.safehasattr(error, 'InputError'): |
3e488afe62f5
topic: use compat.InputError for conflicting CLI flags
Anton Shestakov <av6@dwimlabs.net>
parents:
6305
diff
changeset
|
73 InputError = error.InputError |
3e488afe62f5
topic: use compat.InputError for conflicting CLI flags
Anton Shestakov <av6@dwimlabs.net>
parents:
6305
diff
changeset
|
74 else: |
3e488afe62f5
topic: use compat.InputError for conflicting CLI flags
Anton Shestakov <av6@dwimlabs.net>
parents:
6305
diff
changeset
|
75 # hg <= 5.6 (8d72e29ad1e0) |
3e488afe62f5
topic: use compat.InputError for conflicting CLI flags
Anton Shestakov <av6@dwimlabs.net>
parents:
6305
diff
changeset
|
76 InputError = error.Abort |
6320
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
77 |
6321
58b856416d2e
topic: use compat.StateError for aborting pushes that create new heads
Anton Shestakov <av6@dwimlabs.net>
parents:
6320
diff
changeset
|
78 if util.safehasattr(error, 'StateError'): |
58b856416d2e
topic: use compat.StateError for aborting pushes that create new heads
Anton Shestakov <av6@dwimlabs.net>
parents:
6320
diff
changeset
|
79 StateError = error.StateError |
58b856416d2e
topic: use compat.StateError for aborting pushes that create new heads
Anton Shestakov <av6@dwimlabs.net>
parents:
6320
diff
changeset
|
80 else: |
58b856416d2e
topic: use compat.StateError for aborting pushes that create new heads
Anton Shestakov <av6@dwimlabs.net>
parents:
6320
diff
changeset
|
81 # hg <= 5.6 (527ce85c2e60) |
58b856416d2e
topic: use compat.StateError for aborting pushes that create new heads
Anton Shestakov <av6@dwimlabs.net>
parents:
6320
diff
changeset
|
82 StateError = error.Abort |
58b856416d2e
topic: use compat.StateError for aborting pushes that create new heads
Anton Shestakov <av6@dwimlabs.net>
parents:
6320
diff
changeset
|
83 |
6322
57f9cdbf6a99
topic: use compat.CanceledError for user quit situations
Anton Shestakov <av6@dwimlabs.net>
parents:
6321
diff
changeset
|
84 if util.safehasattr(error, 'CanceledError'): |
57f9cdbf6a99
topic: use compat.CanceledError for user quit situations
Anton Shestakov <av6@dwimlabs.net>
parents:
6321
diff
changeset
|
85 CanceledError = error.CanceledError |
57f9cdbf6a99
topic: use compat.CanceledError for user quit situations
Anton Shestakov <av6@dwimlabs.net>
parents:
6321
diff
changeset
|
86 else: |
57f9cdbf6a99
topic: use compat.CanceledError for user quit situations
Anton Shestakov <av6@dwimlabs.net>
parents:
6321
diff
changeset
|
87 # hg <= 5.6 (ac362d5a7893) |
57f9cdbf6a99
topic: use compat.CanceledError for user quit situations
Anton Shestakov <av6@dwimlabs.net>
parents:
6321
diff
changeset
|
88 CanceledError = error.Abort |
57f9cdbf6a99
topic: use compat.CanceledError for user quit situations
Anton Shestakov <av6@dwimlabs.net>
parents:
6321
diff
changeset
|
89 |
6320
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
90 if util.safehasattr(cmdutil, 'check_at_most_one_arg'): |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
91 def check_at_most_one_arg(opts, *args): |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
92 return cmdutil.check_at_most_one_arg(opts, *args) |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
93 else: |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
94 # hg <= 5.2 (d587937600be) |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
95 def check_at_most_one_arg(opts, *args): |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
96 def to_display(name): |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
97 return pycompat.sysbytes(name).replace(b'_', b'-') |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
98 |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
99 previous = None |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
100 for x in args: |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
101 if opts.get(x): |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
102 if previous: |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
103 raise InputError(_(b'cannot specify both --%s and --%s') |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
104 % (to_display(previous), to_display(x))) |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
105 previous = x |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
106 return previous |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
107 |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
108 if util.safehasattr(cmdutil, 'check_incompatible_arguments'): |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
109 code = cmdutil.check_incompatible_arguments.__code__ |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
110 if r'others' in code.co_varnames[:code.co_argcount]: |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
111 def check_incompatible_arguments(opts, first, others): |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
112 return cmdutil.check_incompatible_arguments(opts, first, others) |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
113 else: |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
114 # hg <= 5.3 (d4c1501225c4) |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
115 def check_incompatible_arguments(opts, first, others): |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
116 return cmdutil.check_incompatible_arguments(opts, first, *others) |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
117 else: |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
118 # hg <= 5.2 (023ad45e2fd2) |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
119 def check_incompatible_arguments(opts, first, others): |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
120 for other in others: |
0c780d972350
topic: use check_incompatible_arguments() for --list with --clear or --rev
Anton Shestakov <av6@dwimlabs.net>
parents:
6318
diff
changeset
|
121 check_at_most_one_arg(opts, first, other) |