reorganise code
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Thu, 08 Sep 2011 17:46:54 +0200
changeset 53 0bcbf690dfca
parent 52 62bdc2567099
child 54 ad1a4fb0fc49
reorganise code
hgext/obsolete.py
--- 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