changegroup: use any node, not min(), in treemanifest's generatemanifests
This is fixing quadratic behavior, which is probably not noticeable in the
common case, but if a very large directory gets added here, it can get pretty
bad. This was noticed because we had some pushes that spent >25s in changegroup
generation calling min() here, according to profiling.
The original reasoning for min() being used in
829d369fc5a8 was that, at that
point in the series, we were adding almost everything to tmfnodes during the
first iteration through the loop , so we needed to avoid sending child
directories before parents. Later changes made it so that the child directories
were added only when we visited the parent directory (not all of them on the
first iteration), so this is no longer necessary - there won't be any child
directories in tmfnodes before the parents have been sent.
This does mean that the manifests are now exchanged unordered, whereas
previously we would essentially do [a, b, b/c, b/c/d, e], we now can send a, b,
and e in any order; b/c must still follow b, and b/c/d must still follow b/c.
Differential Revision: https://phab.mercurial-scm.org/D1351
bundle: allow bundlerepo to support alternative manifest implementations
With our treemanifest logic, the manifests are no longer transported as part of
the changegroup and are no longer stored in a revlog. This means the
self.manifestlog line in bundlerepo.filestart no longer calls
_constructmanifest, and therefore does not consume the manifest portion of the
changegroup, which means filestart is not populated and we result in an infinite
loop.
The fix is to make filestart aware that self.manifestlog might not consume the
changegroup part, and consume it manually if necessary.
There's currently no way to test this in core, but our treemanifest extension
has tests to cover this.
Differential Revision: https://phab.mercurial-scm.org/D1329
obsfate: makes successorsetverb takes the markers as argument
Right now, successorsetverb only needs successors to compute the verb. But we
will want use additional information (effect-flags and operation) in the near
future to compute a better verb.
Add the markers parameter now so extensions (like Evolve) could wrap the
function and start experimenting around better obsfate verbs.
As successorsetverb now takes both successorset and markers parameters, rename
it to obsfateverb, successorsetandmarkersverb was too long.
Differential Revision: https://phab.mercurial-scm.org/D1191
scmutil: don't try to delete origbackup symlinks to directories (
issue5731)
When origbackuppath is set, when looking to see if a file we are backing up
conflicts with a directory in the origbackuppath, we incorrectly match on
symlinks to directories. This means we try to call vfs.rmtree on the
symlink, which fails.
Differential Revision: https://phab.mercurial-scm.org/D1311
tests: add a test demonstrating
issue5731
If origbackups are in use, a symlink to a valid directory is backed up, and an
update is made that attempts to backup a file or link over that symlink, we
abort with a bad error message instead of successfully updating.
Differential Revision: https://phab.mercurial-scm.org/D1310
cmdutil: create dirs for templated cat file output
Previously, the caller was responsible for creating the directory structure of
files written out using a path template. This is onerous, especially if the
exact filenames are not known upfront, but are being accessed via a matcher.
This patch changes things so that hg will attempt to create the appropriate
directories before writing the output file.
Differential Revision: https://phab.mercurial-scm.org/D1332
cat: test output path behvaior when target path does not exist
In the next patch, we will change the behavior of the cat command to create
output file parent directories before attempting to write the output file.
This patch documents the current unfortunate behavior.
Differential Revision: https://phab.mercurial-scm.org/D1331
py3: handle keyword arguments in hgext/shelve.py
Differential Revision: https://phab.mercurial-scm.org/D1324
py3: handle keyword arguments in hgext/uncommit.py
Differential Revision: https://phab.mercurial-scm.org/D1323
py3: handle keyword arguments in hgext/releasenotes.py
Differential Revision: https://phab.mercurial-scm.org/D1322
py3: handle keyword arguments in hgext/rebase.py
Differential Revision: https://phab.mercurial-scm.org/D1321