bookmarks: rename unsetcurrent to deactivate (API)
Today, the terms 'active' and 'current' are interchangeably used throughout the
codebase in reference to the active bookmark (the bookmark that will be updated
with the next commit). This leads to confusion among developers and users.
This patch is part of a series to standardize the usage to 'active' throughout
the mercurial codebase and user interface.
subrepo: correctly handle git subdirectory status change
'git diff-index' by default does not recurse into subdirectories
when changes are found. As a result, the directory is shown as changed,
rather than the files in this directory.
Adding '-r' results in recursing until the blobs themselves are checked.
setup: hide octal literals inside strings so they're portable (
issue4554)
revset: avoid returning duplicates when returning ancestors
Before this patch, _revancestors were giving false result when a revision was
duplicated in the input. Duplicated entry are rare but may happen when using the
`%lx` notation internally.
This series has no visible impact on the performance of the function according
to benchmark.
revset: use an iterator instead of a dequeue in ancestors()
The dequeue was actually just used to be able to pop value one at a time.
Building the dequeue means we are reading all the input value at once at the
beginning of the evaluation. This defeat the lazyness of revset.
We replace the deque with iterator usage for the sake of simplicity and
lazyness.
This provide massive speedup to get the first result if the input set is big
max(::all())
before) wall 0.001917 comb 0.000000 user 0.000000 sys 0.000000 (best of 1115)
after) wall 0.000107 comb 0.000000 user 0.000000 sys 0.000000 (best of 22222)
revset: return early when revs is empty
By introducing an early return in _revancestors() when revs is empty,
we make it so inputrev is never None, which simplifies the subsequent
code.
revset: rename 'revsnode' to 'inputrev' in ancestors
We usually use 'node' for variable containing 20 bytes hash. There is nothing
nodish in this variable, so we rename it to "inputrev" as it old the next entry
of the iteration.
revset: make generatorset.__nonzero__ lazy
The 'for r in self:' call could trigger full consumption of the generator while
we only need a single value. We also fast path if a single value got already
computed. See inline comment for more details.
This provide massive speedup for lazy operation using boolean testing.
max(::tip)
e5b507efb36e) wall 0.055609 comb 0.060000 user 0.060000 sys 0.000000 (best of 100)
after change) wall 0.000109 comb 0.000000 user 0.000000 sys 0.000000 (best of 19146)
tests: test that we can convert to manifestv2 with clone
This just adds a test to ensure that we can convert a manifestv1 repo to a
manifestv2 repo (for future commits only) by means of a local clone.