Summary:
When failing due to attempting to rebase already-public commits, include the
public commit node IDs in the error message.
Test Plan: Included new tests.
Reviewers: durham, quark, #fbhgext
Reviewed By: durham, quark, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D1496
D1410 added support for treedirstate when collecting dirstate_size for
sampling. However, it also changed from querying the inner dirstate map (which
is not available with treedirstate) to the outer map. This breaks Eden, which
prevents calls to `__len__` on the outer map.
Revert the change for non-treedirstate dirstates, and handle treedirstate
explicitly.
Differential Revision: https://phab.mercurial-scm.org/D1530
To avoid problems when other dirstate implementations are in use (sqldirstate
or eden), prevent upgrade of repos with those implementations active to
treedirstate.
Automatic upgrades are silently prevented. Attempts to manually upgrade fail
with an explanatory message.
Differential Revision: https://phab.mercurial-scm.org/D1528
The treedirstate and rusttreedirstate packages are only built if a suitable
version of Cargo is available.
Differential Revision: https://phab.mercurial-scm.org/D1412
Treedirstate maps won't have an inner _map, so will never be logged by
perftweaks. The maps have an efficient size lookup, so it's OK to always
obtain their size.
Differential Revision: https://phab.mercurial-scm.org/D1410
Previously fastannotate was creating filectx's by doing commitctx[path]. This
invokes logic that resovles the filenode immediately, which require loading the
manifest for that commit. In a repo where manifests are downloaded lazily, this
can result in a lot of time spent downloading manifests.
Since commands like hg blame -u only need the filectx so they can resolve the
commitctx for commit information, let's just pass the commitctx straight to the
filectx. It can later derive the filenode if it needs to.
Differential Revision: https://phab.mercurial-scm.org/D1488
Currently, normal LFS uploads are completely disabled during a p4fastimport,
and users must run an external SQLite-reading uploader app after the import.
Instead, allow normal LFS functionality to work, but users may override it to
do the SQLite thing.
Differential Revision: https://phab.mercurial-scm.org/D1307
Summary:
Didn't work when --to wasn't specified as a 12 char
short hash, and since no errors were raised
due to the missing "raise" before error.abort
also effectively deleted changes in the working copy.
Now should work with anything repo[input] accepts
as a valid commit.
Also checks for predicatable error conditions before
the repo is modified to avoid changing working copy
on error.
Test Plan: TBD
Reviewers: #sourcecontrol
Subscribers: #sourcecontrol
Differential Revision: https://phabricator.intern.facebook.com/D6379590
Tasks: T22281996
In `branchmap.updatecache`, there is an assertion:
assert partial.validfor(repo)
That will break if `partial` (branchcache) does not have correct tiprev or
tipnode.
The long term fix will be probably reviving D1450.
Summary:
D1451 changed _branchmapupdate() so that it no longer updates self.filteredhash
when changing self.tiprev. This causes branchcache.validfor() to report that
the cache is no longer valid, causing an assertion failure at the end of
updatecache().
Test Plan: Running hg commands no longer crash.
Reviewers: quark, durham, #fbhgext
Reviewed By: quark, #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D1495
Summary:
The tests `test-check-pyflakes-hg.t` and `test-check-code-hg.t` are
currently failing because of this.
Test Plan: Ran all the tests.
Reviewers: #fbhgext, quark
Reviewed By: #fbhgext, quark
Differential Revision: https://phab.mercurial-scm.org/D1489
This patch did two micro optimizations:
- Avoid sorting `headrevs` since it's already sorted.
- Inline `cl.node` so there is no `node` hash table lookups inside the loop.
These are good practices. Although practically we don't have that many
headrevs to notice a difference.
Differential Revision: https://phab.mercurial-scm.org/D1452
filteredhash, tiprev, tipnode are only used for detecting whether the
on-disk cache is up-to-date or not. Since we don't have on-disk cache, it's
unnecessary to calculate them.
Differential Revision: https://phab.mercurial-scm.org/D1451
The statefile-not-set case was not tested. Previously the code will make
`ui._progbar` return None, which means no progress bar.
Also move the docstring to the header so it shows up in `hg help -e`, and
use modern config registrar to avoid devel warnings.
Test Plan:
Added a test
Differential Revision: https://phab.mercurial-scm.org/D1486
The manifestctx constructor changed at some point in the past to take a
manifestlog and a node instead of a repo and a node. The pushrebase cache code
wasn't adjusted for this. Luckily the manifestctx object only ever uses the
manifestlog to look at the revlog, and the revlog is only ever used to look at
the delta as a fastpath, so most code paths weren't affected.
We encountered this issue on our server, despite it being in there for several
months. Unfortunately I wasn't able to repro it in a test, but I did insert
manual manifestctx._revlog() lines after the construction to ensure that the
revlog can now be created, versus crashing before.
Differential Revision: https://phab.mercurial-scm.org/D1439
remotefilelog and fastannotate already use a connection pool to share and reuse
connections. Treemanifest often does ondemand downloading of trees, such as
during hg log -p, and would greatly benefit from reusing connections as well.
This patch makes the connectionpool and attribute of the repo object, instead of
the fileserverclient object, which allows treemanifest to make use of it easily.
Differential Revision: https://phab.mercurial-scm.org/D1454
Summary:
This allows us to worry less about deadlocks and be more efficient in our
piped communications (like in fileserverclient.py, for example).
We can also make sure that deadlocks just plainly can't
happen by only writing a known amount of bytes to the pipe.
Test Plan:
- does not seem to break any additional tests on Linux
Reviewers: #fbhgext
Differential Revision: https://phab.mercurial-scm.org/D1436
Previously sparse will resolve working file context via its parent
unconditionally if the file is outside sparsematch (introduced by D788).
That could be problematic if the file only exists in working copy.
This patch changes it to always try working copy first (fast), then fallback
to parent commit if the file is outside sparse.
Differential Revision: https://phab.mercurial-scm.org/D1464
Computing the hidden commits was showing up as a hot spot in hg status because
hg sparse was accessing the changelog through a filtered repo. This probably
affects many other commands since sparse touches so many places. Since it has no
need to use a filtered repo, let's just have it use unfiltered.
This shaved off 25-30% of the hg status time in some circumstances.
Differential Revision: https://phab.mercurial-scm.org/D1437
This extension is a thin wrapper around the native `changelog.index` object
that allows us to incrementally replace its methods. Since some index
methods (ex. `nodemap.__getitem__`) are called very frequently, Cython
features are used intentionally to avoid overhead. This also makes it easier
to integrate logic with C interface in the future.
As a side effect, this patch enforce `index` to be conceptually separate
from `nodemap`. So `changelog.index[node]` could be made illegal in the
future, which seems to be a good thing.
Test Plan:
Run `hg sl` with and without the extension in a large repo. Check traceprof
outputs. Notice the performance difference around index methods are roughly
10%, which seems acceptable:
Without the extension:
25 \ node (4823 times) changelog.py:361
18 | node (4931 times) revlog.py:631
With the extension:
27 \ node (4823 times) changelog.py:361
19 | node (4931 times) revlog.py:631
Also run `rt --extra-config-opt=extensions.clindex=` from core hg and make
sure changes are all caused by having an extra extension enabled.
Differential Revision: https://phab.mercurial-scm.org/D1353
Added workers in lfs.
I had to remove the fine progress tracking because between processes in *nix and threads in windows (diffs will appear soon) the tracking of 1MB progress is quite tricky.
With our network tracking progress per file is way enough to see things moving.
This change gives close to 50% speedup on hg sparse --enable-profile when prefetch is run. My current understanding is that prefetch is ran when profile is enabled for the first time.
Test Plan:
Enable profile:
time hg sprase --enable-profile SparseProfiles/TestProfile.sparse
The profile contains 42k files including 9GB of lfs files
On my machine the time improves by 47% while still being dominated by lfs
download time
# Tip: In Git and Mercurial, use a branch like "T123" to automatically associate
# changes with the corresponding task.
Differential Revision: https://phab.mercurial-scm.org/D1424
A very minor change, but we should probably explain that local rebasing is
needed. (You might be forgiven for thinking that `pushrebase` would have
done that for you.)
Differential Revision: https://phab.mercurial-scm.org/D1352
Print which bad characters were found on what line, so that users can
fix the problem just from the hook message.
Differential Revision: https://phab.mercurial-scm.org/D1419
When we changed the treemanifest {manifest} template output it broke the ability
to specifically ask for the node. This is important for tools migrating between
the old and new format. Let's add that back in.
Let's also make tweakdefaults change the '{manifest}' default template for all
repo's, not just tree repos.
Differential Revision: https://phab.mercurial-scm.org/D1418
This lets you list your currently active profiles, as well as let you discover
new profiles, provided sparse.profile_directory is set.
Includes JSON output. Future revisions can build on this to provide richer
metadata (parsed from the profile files).
Differential Revision: https://phab.mercurial-scm.org/D1250
Advice using `hg uncommit` when a command to prune (like `hg strip`) but keeping the changes (with `--keep` option)
Test Plan:
Run `hg strip -k\--keep` a "'hg uncommit' provides a better UI for undoing commits while keeping the changes" should show up.
Run `hg strip` w/o `--keep` option, "'hg hide' provides a better UI for hiding commits" should be shown
Differential Revision: https://phab.mercurial-scm.org/D1335
When the dirstate got refactored, we lost the check that only logged the
dirstate size if the dictionary was already populated. This caused a regression
in hg bookmark times (since it normally doesn't populate the dirstate map).
Adds information that is useful for debugging infinitepush backup to the rage
output. In particular:
- Full node hashes in the unfiltered smartlog, so that they can be looked up
in infinitepush.
- The contents of infinitepushbackupstate.
- The last 100 lines of the infinitepush backup logs for this repo.
Differential Revision: https://phab.mercurial-scm.org/D1264
I wasn't 100% sure this is side effect-free if you enable the extension but
don't specify a progressfile, so let's be extra safe.
Differential Revision: https://phab.mercurial-scm.org/D1308
This patch adds support to histedit command to take input from json. The JSON
should be of following format:
{ "histedit": [
{"action": "...", "node": "..."},
{"action": "...", "command": "..."},
{...}
]
}
For actions except "exec" and "execr", "node" is required and for "exec" and
"execr", "command" should be there.
The support is plugged in directly and is not hidden behind a config flag. After
this support, the parser which parses the commands file will assume that JSON is
given and will fallback to original parsing if it fails to convert the data in
the file to JSON.
In case where input is JSON but a key is missing, status message is shown and we
fallback to normal parsing.
Both small and large verbs are supported for the action part in JSON.
Differential Revision: https://phab.mercurial-scm.org/D1263
It looks like the devel warning detection complains about reading
extensions.fbsparse with a default value. Let's just suppress it.
Differential Revision: https://phab.mercurial-scm.org/D1294
With the multidest rebase (D470), restack could be implemented as specifying
the source (`orphan() - obsolete()`) and a revset specifying destination for
each source revision.
This patch changes restack implementation to use that. The revset is
implemented as a private function `_destrestack`, like `_destrebase` in
`rebase.py`.
Most test changes are because the topo-sort in `rebase.py` removes some
unnecessary steps. So the resulting revision numbers are smaller.
There is one interesting test case that gets changed:
```
D
| # amend: B1 -> B2 -> B1
B2 B1 B3 # amend: B1 -> B3
\ | /
A
```
Previously, restack will move D to be on top of B3. Now restack will not
move it because `D` is considered stable (not orphaned) since none of its
ancestors are obsoleted. The new behavior seems to be more desirable.
More tests are added to test restack source revisions (should be in a same
stack) and some "prune" cases.
The transaction logic is also made more robust so `test-copytrace-amend.t`
does not cause a broken rebase state.
Since the rebase operation runs in a same rebase state, restack can be
continued via `rebase --continue` correctly after resolving merge conflicts.
This is reflected in a newly added test.
Test Plan:
With hg-dev, run `./script/unit.py`
Differential Revision: https://phab.mercurial-scm.org/D1139
Previously we were relying on config values to determine when to send or not
send tree and flat manifests. This resulted in complicated permutations to test.
Let's remove these config values and always send trees if we have them. A future
patch will do the same for flat manifests.
Differential Revision: https://phab.mercurial-scm.org/D1265