# HG changeset patch # User Pierre-Yves David # Date 1435729168 25200 # Node ID 5ede49f4383a885de174fab7665cce27bde7509e # Parent a6c1eac2fb1e587f1f4e5ceaa18f041f9d56bedf amend: stop updating the bookmarks twice There was code to move the bookmarks around both in the 'cmdutil' help and in the main 'commit' function. We kill the 'commit' version as it is performed outside the transaction. The debug note is moved into cmdutil. diff -r a6c1eac2fb1e -r 5ede49f4383a mercurial/cmdutil.py --- a/mercurial/cmdutil.py Tue Jun 30 22:36:49 2015 -0700 +++ b/mercurial/cmdutil.py Tue Jun 30 22:39:28 2015 -0700 @@ -2614,6 +2614,8 @@ if bms: marks = repo._bookmarks 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 diff -r a6c1eac2fb1e -r 5ede49f4383a mercurial/commands.py --- a/mercurial/commands.py Tue Jun 30 22:36:49 2015 -0700 +++ b/mercurial/commands.py Tue Jun 30 22:39:28 2015 -0700 @@ -1523,21 +1523,10 @@ match, extra=extra) - active = repo._activebookmark - marks = old.bookmarks() node = cmdutil.amend(ui, repo, commitfunc, old, extra, pats, opts) if node == old.node(): ui.status(_("nothing changed\n")) return 1 - elif marks: - ui.debug('moving bookmarks %r from %s to %s\n' % - (marks, old.hex(), hex(node))) - newmarks = repo._bookmarks - for bm in marks: - newmarks[bm] = node - if bm == active: - bookmarks.activate(repo, bm) - newmarks.write() else: def commitfunc(ui, repo, message, match, opts): backup = ui.backupconfig('phases', 'new-commit')