comparison mercurial/commands.py @ 25694:5ede49f4383a

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.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 30 Jun 2015 22:39:28 -0700
parents 0f894d2203c8
children 3948cb4d0ae7
comparison
equal deleted inserted replaced
25693:a6c1eac2fb1e 25694:5ede49f4383a
1521 opts.get('user') or old.user(), 1521 opts.get('user') or old.user(),
1522 opts.get('date') or old.date(), 1522 opts.get('date') or old.date(),
1523 match, 1523 match,
1524 extra=extra) 1524 extra=extra)
1525 1525
1526 active = repo._activebookmark
1527 marks = old.bookmarks()
1528 node = cmdutil.amend(ui, repo, commitfunc, old, extra, pats, opts) 1526 node = cmdutil.amend(ui, repo, commitfunc, old, extra, pats, opts)
1529 if node == old.node(): 1527 if node == old.node():
1530 ui.status(_("nothing changed\n")) 1528 ui.status(_("nothing changed\n"))
1531 return 1 1529 return 1
1532 elif marks:
1533 ui.debug('moving bookmarks %r from %s to %s\n' %
1534 (marks, old.hex(), hex(node)))
1535 newmarks = repo._bookmarks
1536 for bm in marks:
1537 newmarks[bm] = node
1538 if bm == active:
1539 bookmarks.activate(repo, bm)
1540 newmarks.write()
1541 else: 1530 else:
1542 def commitfunc(ui, repo, message, match, opts): 1531 def commitfunc(ui, repo, message, match, opts):
1543 backup = ui.backupconfig('phases', 'new-commit') 1532 backup = ui.backupconfig('phases', 'new-commit')
1544 baseui = repo.baseui 1533 baseui = repo.baseui
1545 basebackup = baseui.backupconfig('phases', 'new-commit') 1534 basebackup = baseui.backupconfig('phases', 'new-commit')