Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 32381:b9942bc6b292
localrepo: extract bookmarkheads method to bookmarks.py
This method is only used internally by destutil, and it's obscure
enough I'm willing to just move it without a deprecation warning,
especially since the new method has more constrained functionality.
Design-wise I'd also like to get active bookmark handling folded into
the bookmark store, so that we don't squirrel away an extra attribute
for the active bookmark on the repository object.
author | Augie Fackler <augie@google.com> |
---|---|
date | Thu, 18 May 2017 16:43:56 -0400 |
parents | 7cd1fa9dfd74 |
children | b647b923486f |
comparison
equal
deleted
inserted
replaced
32380:5db6d70fd30b | 32381:b9942bc6b292 |
---|---|
504 return bookmarks.bmstore(self) | 504 return bookmarks.bmstore(self) |
505 | 505 |
506 @property | 506 @property |
507 def _activebookmark(self): | 507 def _activebookmark(self): |
508 return self._bookmarks.active | 508 return self._bookmarks.active |
509 | |
510 def bookmarkheads(self, bookmark): | |
511 name = bookmark.split('@', 1)[0] | |
512 heads = [] | |
513 for mark, n in self._bookmarks.iteritems(): | |
514 if mark.split('@', 1)[0] == name: | |
515 heads.append(n) | |
516 return heads | |
517 | 509 |
518 # _phaserevs and _phasesets depend on changelog. what we need is to | 510 # _phaserevs and _phasesets depend on changelog. what we need is to |
519 # call _phasecache.invalidate() if '00changelog.i' was changed, but it | 511 # call _phasecache.invalidate() if '00changelog.i' was changed, but it |
520 # can't be easily expressed in filecache mechanism. | 512 # can't be easily expressed in filecache mechanism. |
521 @storecache('phaseroots', '00changelog.i') | 513 @storecache('phaseroots', '00changelog.i') |