[PATCH 2 of 2] amend: move obsmarkers creation in the "new changeset" conditional
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Wed Jul 1 14:24:54 CDT 2015
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at fb.com>
# Date 1411891756 25200
# Sun Sep 28 01:09:16 2014 -0700
# Node ID 4bb0ed0dc02d2bf7391cc6c7422c747b02ba1539
# Parent 4a71f50572264b319960b78a4630b8ddef8b929c
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.
diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
--- a/mercurial/cmdutil.py
+++ b/mercurial/cmdutil.py
@@ -2617,19 +2617,19 @@ def amend(ui, repo, commitfunc, old, ext
for bm in bms:
ui.debug('moving bookmarks %r from %s to %s\n' %
(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()
dsguard.close()
if not createmarkers and newid != old.node():
More information about the Mercurial-devel
mailing list