amend: move obsmarkers creation in the "new changeset" conditional
authorPierre-Yves David <pierre-yves.david@fb.com>
Sun, 28 Sep 2014 01:09:16 -0700
changeset 25710 68c83b8d407a
parent 25709 c87373179ff3
child 25711 26579a91f4fb
amend: move obsmarkers creation in the "new changeset" conditional We already check if we created a new changesets right above this piece of code, so we can just drop the condition and indent the markers creation.
mercurial/cmdutil.py
--- a/mercurial/cmdutil.py	Tue Jun 30 22:28:40 2015 -0700
+++ b/mercurial/cmdutil.py	Sun Sep 28 01:09:16 2014 -0700
@@ -2619,15 +2619,15 @@
                                  (marks, old.hex(), hex(newid)))
                         marks[bm] = newid
                     marks.recordchange(tr)
-            #commit the whole amend process
-            if createmarkers and newid != old.node():
-                # mark the new changeset as successor of the rewritten one
-                new = repo[newid]
-                obs = [(old, (new,))]
-                if node:
-                    obs.append((ctx, ()))
-
-                obsolete.createmarkers(repo, obs)
+                #commit the whole amend process
+                if createmarkers:
+                    # mark the new changeset as successor of the rewritten one
+                    new = repo[newid]
+                    obs = [(old, (new,))]
+                    if node:
+                        obs.append((ctx, ()))
+
+                    obsolete.createmarkers(repo, obs)
             tr.close()
         finally:
             tr.release()