Mercurial > evolve
changeset 53:0bcbf690dfca
reorganise code
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Thu, 08 Sep 2011 17:46:54 +0200 |
parents | 62bdc2567099 |
children | ad1a4fb0fc49 |
files | hgext/obsolete.py |
diffstat | 1 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/obsolete.py Thu Sep 08 17:32:51 2011 +0200 +++ b/hgext/obsolete.py Thu Sep 08 17:46:54 2011 +0200 @@ -126,6 +126,24 @@ class obsoletingrepo(repo.__class__): + ### Public method + def obsoletedby(self, node): + """return the set of node that make <node> obsolete (obj)""" + return self._obsobjrels.get(node, set()) + + def obsolete(self, node): + """return the set of node that <node> make obsolete (sub)""" + return self._obssubrels.get(node, set()) + + def addobsolete(self, sub, obj): + """Add a relation marking that node <sub> is a new version of <obj>""" + self._obssubrels.setdefault(sub, set()).add(obj) + self._obsobjrels.setdefault(obj, set()).add(sub) + try: + self.changelog.hiddenrevs.add(repo[obj].rev()) + except error.RepoLookupError: + pass #unknow revision (but keep propagating the data + self._writeobsrels() ### Hidden revision support @util.propertycache @@ -207,24 +225,6 @@ return result - ### Public method - def obsoletedby(self, node): - """return the set of node that make <node> obsolete (obj)""" - return self._obsobjrels.get(node, set()) - - def obsolete(self, node): - """return the set of node that <node> make obsolete (sub)""" - return self._obssubrels.get(node, set()) - - def addobsolete(self, sub, obj): - """Add a relation marking that node <sub> is a new version of <obj>""" - self._obssubrels.setdefault(sub, set()).add(obj) - self._obsobjrels.setdefault(obj, set()).add(sub) - try: - self.changelog.hiddenrevs.add(repo[obj].rev()) - except error.RepoLookupError: - pass #unknow revision (but keep propagating the data - self._writeobsrels() ### rollback support