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.
--- 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()