comparison mercurial/cmdutil.py @ 27698:dad6404ccddb

bmstore: add handling of the active bookmark This further centralizes the handling of bookmark storage, and will help get some lingering bookmarks business out of localrepo. Right now, this change implies reading of the active bookmark to also imply reading all bookmarks from disk - for users with many many bookmarks this may be a measurable performance hit. In that case, we should migrate bmstore to be able to lazy-read its properties from disk rather than having to eagerly read them, but I decided to avoid doing that to try and avoid some potentially complicated filecache decorator issues. This doesn't move the logic for writing the active bookmark into a transaction, though that is probably the correct next step. Since the API probably needs to morph a little more, I didn't bother marking bookmarks.{activate,deactivate} as deprecated yet.
author Augie Fackler <augie@google.com>
date Wed, 11 Nov 2015 21:18:02 -0500
parents 07fc2f2134ba
children 7be6371c732e
comparison
equal deleted inserted replaced
27697:0ce0cfee497f 27698:dad6404ccddb
2528 # `logmessage` anyway. 2528 # `logmessage` anyway.
2529 opts.pop('logfile') 2529 opts.pop('logfile')
2530 # First, do a regular commit to record all changes in the working 2530 # First, do a regular commit to record all changes in the working
2531 # directory (if there are any) 2531 # directory (if there are any)
2532 ui.callhooks = False 2532 ui.callhooks = False
2533 activebookmark = repo._activebookmark 2533 activebookmark = repo._bookmarks.active
2534 try: 2534 try:
2535 repo._activebookmark = None 2535 repo._bookmarks.active = None
2536 opts['message'] = 'temporary amend commit for %s' % old 2536 opts['message'] = 'temporary amend commit for %s' % old
2537 node = commit(ui, repo, commitfunc, pats, opts) 2537 node = commit(ui, repo, commitfunc, pats, opts)
2538 finally: 2538 finally:
2539 repo._activebookmark = activebookmark 2539 repo._bookmarks.active = activebookmark
2540 repo._bookmarks.recordchange(tr)
2540 ui.callhooks = True 2541 ui.callhooks = True
2541 ctx = repo[node] 2542 ctx = repo[node]
2542 2543
2543 # Participating changesets: 2544 # Participating changesets:
2544 # 2545 #