equal
deleted
inserted
replaced
7 """ |
7 """ |
8 from __future__ import absolute_import |
8 from __future__ import absolute_import |
9 |
9 |
10 from mercurial import ( |
10 from mercurial import ( |
11 obsolete, |
11 obsolete, |
12 scmutil, |
|
13 util, |
|
14 ) |
12 ) |
15 |
13 |
16 getmarkers = None |
14 getmarkers = None |
17 successorssets = None |
15 successorssets = None |
18 try: |
16 try: |
31 """function to start a pager in case ui.pager() exists""" |
29 """function to start a pager in case ui.pager() exists""" |
32 try: |
30 try: |
33 ui.pager(cmd) |
31 ui.pager(cmd) |
34 except AttributeError: |
32 except AttributeError: |
35 pass |
33 pass |
36 |
|
37 def cleanupnodes(repo, replacements, operation, moves=None): |
|
38 # create obsmarkers and move bookmarks |
|
39 # XXX we should be creating marker as we go instead of only at the end, |
|
40 # this makes the operations more modulars |
|
41 if util.safehasattr(scmutil, 'cleanupnodes'): |
|
42 scmutil.cleanupnodes(repo, replacements, 'changetopics', |
|
43 moves=moves) |
|
44 else: |
|
45 relations = [(repo[o], tuple(repo[n] for n in new)) |
|
46 for (o, new) in replacements.iteritems()] |
|
47 obsolete.createmarkers(repo, relations, operation=operation) |
|