changeset 25710:68c83b8d407a

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sun, 28 Sep 2014 01:09:16 -0700
parents c87373179ff3
children 26579a91f4fb
files mercurial/cmdutil.py
diffstat 1 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- 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()