Show More
@@ -684,6 +684,14 class changectx(basectx): | |||||
684 | """Return a list of byte bookmark names.""" |
|
684 | """Return a list of byte bookmark names.""" | |
685 | return self._repo.nodebookmarks(self._node) |
|
685 | return self._repo.nodebookmarks(self._node) | |
686 |
|
686 | |||
|
687 | def fast_rank(self): | |||
|
688 | repo = self._repo | |||
|
689 | if self._maybe_filtered: | |||
|
690 | cl = repo.changelog | |||
|
691 | else: | |||
|
692 | cl = repo.unfiltered().changelog | |||
|
693 | return cl.fast_rank(self._rev) | |||
|
694 | ||||
687 | def phase(self): |
|
695 | def phase(self): | |
688 | return self._repo._phasecache.phase(self._repo, self._rev) |
|
696 | return self._repo._phasecache.phase(self._repo, self._rev) | |
689 |
|
697 |
@@ -304,6 +304,21 def showextras(context, mapping): | |||||
304 | ) |
|
304 | ) | |
305 |
|
305 | |||
306 |
|
306 | |||
|
307 | @templatekeyword(b'_fast_rank', requires={b'ctx'}) | |||
|
308 | def fast_rank(context, mapping): | |||
|
309 | """the rank of a changeset if cached | |||
|
310 | ||||
|
311 | The rank of a revision is the size of the sub-graph it defines as a head. | |||
|
312 | Equivalently, the rank of a revision `r` is the size of the set | |||
|
313 | `ancestors(r)`, `r` included. | |||
|
314 | """ | |||
|
315 | ctx = context.resource(mapping, b'ctx') | |||
|
316 | rank = ctx.fast_rank() | |||
|
317 | if rank is None: | |||
|
318 | return None | |||
|
319 | return b"%d" % rank | |||
|
320 | ||||
|
321 | ||||
307 | def _getfilestatus(context, mapping, listall=False): |
|
322 | def _getfilestatus(context, mapping, listall=False): | |
308 | ctx = context.resource(mapping, b'ctx') |
|
323 | ctx = context.resource(mapping, b'ctx') | |
309 | revcache = context.resource(mapping, b'revcache') |
|
324 | revcache = context.resource(mapping, b'revcache') |
General Comments 0
You need to be logged in to leave comments.
Login now