Commits

Pierre-Yves David committed 0bcbf69

reorganise code

Comments (0)

Files changed (1)

hgext/obsolete.py

 
     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
             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