keep branch on amend
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Mon, 23 Jan 2012 18:22:10 +0100
changeset 131 3124889cad55
parent 130 b70fadbccc2a
child 132 64d16f07d67f
keep branch on amend
hgext/evolution.py
hgext/obsolete.py
--- a/hgext/evolution.py	Wed Jan 11 17:01:06 2012 +0100
+++ b/hgext/evolution.py	Mon Jan 23 18:22:10 2012 +0100
@@ -307,6 +307,9 @@
     branch = opts.get('branch')
     if branch:
         opts.setdefault('extra', {})['branch'] = branch
+    else:
+        if old.branch() != 'default':
+            opts.setdefault('extra', {})['branch'] = old.branch()
 
     lock = repo.lock()
     try:
--- a/hgext/obsolete.py	Wed Jan 11 17:01:06 2012 +0100
+++ b/hgext/obsolete.py	Mon Jan 23 18:22:10 2012 +0100
@@ -302,6 +302,8 @@
                 sub = None
             if obj in self._obssubrels.get(sub, set()):
                 return 0
+            if sub == obj:
+                return 0
             self._obssubrels.setdefault(sub, set()).add(obj)
             self._obsobjrels.setdefault(obj, set()).add(sub)
             try: