comparison mercurial/obsutil.py @ 33149:a14e2e7f7d1f

obsutil: move 'getmarkers' to the new modules We have a new 'obsutil' module now. We move the high level utility there to bring 'obsolete.py' back to a more reasonable size.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 27 Jun 2017 02:06:15 +0200
parents 4e30168d7939
children 53b3a1968aa6
comparison
equal deleted inserted replaced
33148:4e30168d7939 33149:a14e2e7f7d1f
45 return self._data[4] 45 return self._data[4]
46 46
47 def flags(self): 47 def flags(self):
48 """The flags field of the marker""" 48 """The flags field of the marker"""
49 return self._data[2] 49 return self._data[2]
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)
50 65
51 def closestpredecessors(repo, nodeid): 66 def closestpredecessors(repo, nodeid):
52 """yield the list of next predecessors pointing on visible changectx nodes 67 """yield the list of next predecessors pointing on visible changectx nodes
53 68
54 This function respect the repoview filtering, filtered revision will be 69 This function respect the repoview filtering, filtered revision will be