##// END OF EJS Templates
obsutil: move 'getmarkers' to the new modules...
marmoute -
r33150:a14e2e7f default
parent child Browse files
Show More
@@ -1429,16 +1429,16 b' def debugobsolete(ui, repo, precursor=No'
1429 1429 if opts['rev']:
1430 1430 revs = scmutil.revrange(repo, opts['rev'])
1431 1431 nodes = [repo[r].node() for r in revs]
1432 markers = list(obsolete.getmarkers(repo, nodes=nodes,
1432 markers = list(obsutil.getmarkers(repo, nodes=nodes,
1433 1433 exclusive=opts['exclusive']))
1434 1434 markers.sort(key=lambda x: x._data)
1435 1435 else:
1436 markers = obsolete.getmarkers(repo)
1436 markers = obsutil.getmarkers(repo)
1437 1437
1438 1438 markerstoiter = markers
1439 1439 isrelevant = lambda m: True
1440 1440 if opts.get('rev') and opts.get('index'):
1441 markerstoiter = obsolete.getmarkers(repo)
1441 markerstoiter = obsutil.getmarkers(repo)
1442 1442 markerset = set(markers)
1443 1443 isrelevant = lambda m: m in markerset
1444 1444
@@ -796,21 +796,6 b' def pushmarker(repo, key, old, new):'
796 796 finally:
797 797 lock.release()
798 798
799 def getmarkers(repo, nodes=None, exclusive=False):
800 """returns markers known in a repository
801
802 If <nodes> is specified, only markers "relevant" to those nodes are are
803 returned"""
804 if nodes is None:
805 rawmarkers = repo.obsstore
806 elif exclusive:
807 rawmarkers = obsutil.exclusivemarkers(repo, nodes)
808 else:
809 rawmarkers = repo.obsstore.relevantmarkers(nodes)
810
811 for markerdata in rawmarkers:
812 yield obsutil.marker(repo, markerdata)
813
814 799 # keep compatibility for the 4.3 cycle
815 800 def allprecursors(obsstore, nodes, ignoreflags=0):
816 801 movemsg = 'obsolete.allprecursors moved to obsutil.allprecursors'
@@ -827,6 +812,11 b' def marker(repo, data):'
827 812 repo.ui.deprecwarn(movemsg, '4.3')
828 813 return obsutil.marker(repo, data)
829 814
815 def getmarkers(repo, nodes=None, exclusive=False):
816 movemsg = 'obsolete.getmarkers moved to obsutil.getmarkers'
817 repo.ui.deprecwarn(movemsg, '4.3')
818 return obsutil.getmarkers(repo, nodes=nodes, exclusive=exclusive)
819
830 820 def exclusivemarkers(repo, nodes):
831 821 movemsg = 'obsolete.exclusivemarkers moved to obsutil.exclusivemarkers'
832 822 repo.ui.deprecwarn(movemsg, '4.3')
@@ -48,6 +48,21 b' class marker(object):'
48 48 """The flags field of the marker"""
49 49 return self._data[2]
50 50
51 def getmarkers(repo, nodes=None, exclusive=False):
52 """returns markers known in a repository
53
54 If <nodes> is specified, only markers "relevant" to those nodes are are
55 returned"""
56 if nodes is None:
57 rawmarkers = repo.obsstore
58 elif exclusive:
59 rawmarkers = exclusivemarkers(repo, nodes)
60 else:
61 rawmarkers = repo.obsstore.relevantmarkers(nodes)
62
63 for markerdata in rawmarkers:
64 yield marker(repo, markerdata)
65
51 66 def closestpredecessors(repo, nodeid):
52 67 """yield the list of next predecessors pointing on visible changectx nodes
53 68
General Comments 0
You need to be logged in to leave comments. Login now