Mercurial > public > mercurial-scm > hg
comparison mercurial/revlog.py @ 41275:1421d0487a61
revlog: accept a revs argument in `headrevs`
Computing the heads of an arbitrary set of revision is useful, we make it
possible to do so through the `headrevs` method of the revlog.
Right now, this is just calling dagop's implementation. However, we expect to
plug a native implementation soon.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Mon, 14 Jan 2019 17:06:00 +0100 |
parents | a89b20a49c13 |
children | 00b314c42094 |
comparison
equal
deleted
inserted
replaced
41274:4c6fdc7e2e7d | 41275:1421d0487a61 |
---|---|
1100 assert orderedout | 1100 assert orderedout |
1101 assert roots | 1101 assert roots |
1102 assert heads | 1102 assert heads |
1103 return (orderedout, roots, heads) | 1103 return (orderedout, roots, heads) |
1104 | 1104 |
1105 def headrevs(self): | 1105 def headrevs(self, revs=None): |
1106 try: | 1106 if revs is None: |
1107 return self.index.headrevs() | 1107 try: |
1108 except AttributeError: | 1108 return self.index.headrevs() |
1109 return self._headrevs() | 1109 except AttributeError: |
1110 return self._headrevs() | |
1111 return dagop.headrevs(revs, self.parentrevs) | |
1110 | 1112 |
1111 def computephases(self, roots): | 1113 def computephases(self, roots): |
1112 return self.index.computephasesmapsets(roots) | 1114 return self.index.computephasesmapsets(roots) |
1113 | 1115 |
1114 def _headrevs(self): | 1116 def _headrevs(self): |