# HG changeset patch # User Pierre-Yves David # Date 2015-07-01 05:28:40 # Node ID c87373179ff3258f69e2583bbc170f904e5cfa72 # Parent d3d32643c0609e0e918aeaffa1fc03fd74c87cbe amend: move createmarkers evaluation earlier The value is used at multiple points in the function. Retrieving the value in the middle of the transaction scope gives the false impression that it has a single user. We move it at the start of the function to clarify this. diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -2454,6 +2454,7 @@ def amend(ui, repo, commitfunc, old, ext ui.note(_('amending changeset %s\n') % old) base = old.p1() + createmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt) wlock = dsguard = lock = newid = None try: @@ -2619,7 +2620,6 @@ def amend(ui, repo, commitfunc, old, ext marks[bm] = newid marks.recordchange(tr) #commit the whole amend process - createmarkers = obsolete.isenabled(repo, obsolete.createmarkersopt) if createmarkers and newid != old.node(): # mark the new changeset as successor of the rewritten one new = repo[newid]