comparison mercurial/cmdutil.py @ 18198:9b4adaef0db9 stable

amend: prevent loss of bookmark on failed amend The active bookmark were moved to the temporary commit. When the transaction were rollbacked, the bookmark were lost. We now temporarly disable the bookmark to prevent this effect.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 30 Dec 2012 03:49:15 +0100
parents 153659e86a5f
children 2c1276825e93
comparison
equal deleted inserted replaced
18197:153659e86a5f 18198:9b4adaef0db9
1633 # `logmessage` anyway. 1633 # `logmessage` anyway.
1634 opts.pop('logfile') 1634 opts.pop('logfile')
1635 # First, do a regular commit to record all changes in the working 1635 # First, do a regular commit to record all changes in the working
1636 # directory (if there are any) 1636 # directory (if there are any)
1637 ui.callhooks = False 1637 ui.callhooks = False
1638 currentbookmark = repo._bookmarkcurrent
1638 try: 1639 try:
1640 repo._bookmarkcurrent = None
1639 opts['message'] = 'temporary amend commit for %s' % old 1641 opts['message'] = 'temporary amend commit for %s' % old
1640 node = commit(ui, repo, commitfunc, pats, opts) 1642 node = commit(ui, repo, commitfunc, pats, opts)
1641 finally: 1643 finally:
1644 repo._bookmarkcurrent = currentbookmark
1642 ui.callhooks = True 1645 ui.callhooks = True
1643 ctx = repo[node] 1646 ctx = repo[node]
1644 1647
1645 # Participating changesets: 1648 # Participating changesets:
1646 # 1649 #