Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 13384:caa561759538
context: add method to return all bookmarks pointing to a node
author | David Soria Parra <dsp@php.net> |
---|---|
date | Fri, 11 Feb 2011 19:36:15 +0100 |
parents | f1c5294e9119 |
children | d012d95499f7 |
comparison
equal
deleted
inserted
replaced
13383:70ef5b610222 | 13384:caa561759538 |
---|---|
396 for t, n in self.tags().iteritems(): | 396 for t, n in self.tags().iteritems(): |
397 self.nodetagscache.setdefault(n, []).append(t) | 397 self.nodetagscache.setdefault(n, []).append(t) |
398 for tags in self.nodetagscache.itervalues(): | 398 for tags in self.nodetagscache.itervalues(): |
399 tags.sort() | 399 tags.sort() |
400 return self.nodetagscache.get(node, []) | 400 return self.nodetagscache.get(node, []) |
401 | |
402 def nodebookmarks(self, node): | |
403 marks = [] | |
404 for bookmark, n in self._bookmarks.iteritems(): | |
405 if n == node: | |
406 marks.append(bookmark) | |
407 return sorted(marks) | |
401 | 408 |
402 def _branchtags(self, partial, lrev): | 409 def _branchtags(self, partial, lrev): |
403 # TODO: rename this function? | 410 # TODO: rename this function? |
404 tiprev = len(self) - 1 | 411 tiprev = len(self) - 1 |
405 if lrev != tiprev: | 412 if lrev != tiprev: |