commands: move activebookmarklabel to bookmarks module
This is going to be used in an upcoming patch that moves more methods to
bookmarks.py.
commands: replace locking code with a context manager
Note that this means that we're unnecessarily creating a transaction
in the pure "--inactive" (i.e. when deactivating the current
bookmark), but that should be harmless.
bookmarks: factor out adding a list of bookmarks logic from commands
We keep the lock in the caller so that future devs are aware of the
locking implications.
bookmarks: factor out rename logic from commands
We keep the lock in the caller so that future devs are aware of the
locking implications.
bookmarks: factor out delete logic from commands
We keep the lock in the caller so that future devs are aware of the
locking implications.
revset: add startdepth limit to ancestors() as internal option
This is necessary to implement the set{gen} (set subscript) operator. For
example, set{-n} will be translated to ancestors(set, depth=n, startdepth=n).
https://www.mercurial-scm.org/wiki/RevsetOperatorPlan#ideas_from_mpm
The UI is undecided and I doubt if the startdepth option would be actually
useful, so the option is hidden for now. 'depth' could be extended to take
min:max range, in which case, integer depth should select a single generation.
ancestors(set, depth=:y) # scan up to y-th generation
ancestors(set, depth=x:) # skip until (x-1)-th generation
ancestors(set, depth=x) # select only x-th generation
Any ideas are welcomed.
# reverse(ancestors(tip)) using hg repo
3) 0.075951
4) 0.076175
revset: add depth limit to ancestors()
This is proposed by the
issue5374, and will be a building block of set{gen}
(set subscript) operator.
https://www.mercurial-scm.org/wiki/RevsetOperatorPlan#ideas_from_mpm
# reverse(ancestors(tip)) using hg repo
2) 0.075408
3) 0.075951