shelve: let cmdutil.revert() take care of backing up untracked files
cmdutil.revert() backs up untracked files, so I don't see a reason to
do it shelve.mergefiles(). We have tests for this and they still pass.
Differential Revision: https://phab.mercurial-scm.org/D6174
shelve: stop passing list of files to revert
It seems to work just fine to not specify any files here. I suspect it
looked the way it did for historical reasons. It apparently used to
use merge instead of rebase until
1d7a36ff2615 (shelve: use rebase
instead of merge (
issue4068), 2013-10-23) and it makes sense to want
to restrict the set of files then.
I noticed this because of the files.extend(shelvectx.p1().files()). If
the working copy was clean before, then shelvectx.p1() will be the
working copy parent and that ended up adding all the files in that
set. In our Google-internal Mercurial setup (including a FUSE) that
was very noticeably slow when the working copy parent happened to have
many files in large directories.
This patch doesn't yet remove the call to shelvectx.p1().files(). We
also use that set for deciding what to back up. I'm pretty sure it's
safe to back up only the set of files we already back even if we no
longer restrict the set of files to revert, so this patch should be
safe on its own. Regardless, the next patch will delegate the
backing-up to cmdutil.revert().
Incidentally, this also gets rid of a repo.pathto() that I had earlier
wanted to get rid of.
Differential Revision: https://phab.mercurial-scm.org/D6173
remotefilelog: prefetch files in deterministic order
I have been troubleshooting some slowness in this area (it's unclear
if it's the client or server that's to blame, but that's beside the
point) and it's a lot easier to do troubleshoot if the files are
prefetched in the same order each time.
Differential Revision: https://phab.mercurial-scm.org/D6172
debugdiscovery: display time elapsed during the discovery step
This is a useful information. Now that we perform more analysing after the
discovery is done, it is worth have a more precise measurement. For serious
timing analysis use `hg perfdiscovery`.
debugdiscovery: only list common heads on verbose
The list of common heads is only part of the useful information. In addition on
repository with many heads, the information is very not helpful (just fill a
couple of screen with hash). As a result we hide it behind a --verbose flag.
debugdiscovery: drop duplicated information
The old line informing about the local being a superset or subset of the remote
is redundant with the newly introduced data. So we drop it.
debugdiscovery: display more statistic about the common set
We display a lot more information now. Especially, we display the overlap
between the common heads and the local/remote heads. There are various
optimization geared toward heads, as a result, the less common the heads the
more complex the discovery. Having this information easily accessible help when
working on discovery.
debugdiscovery: small internal refactoring
The part of the code displaying statistic is made independant from the one
running the discovery. In the same do, the declaration of the discovery
function is a bit simplified.