rebase: do not consider extincts for divergence detection (
issue5782)
Extinct obsolete changesets cannot cause divergence upon rebase. We
compute these obsoletes without a non-obsolete successor (extincts) in
_computeobsoletenotrebased() and then filter them out from the set of
obsolete revisions to rebase before getting into _checkobsrebase() to
check for divergence candidates.
rebase: add a test case for
issue5782
Issue 5782 reports that rebase incorrectly aborts when trying to rebase
an extinct revision (an obsolete revision with only obsolete successor).
We add a test to demonstrate this: the first "hg rebase" command aborts
with the divergence warning while, when allowing divergence, the rebase
completes and does not actually produce any divergence.
test: glob the temporary directory out of temporary file path
The temporary directory used by python might be outside of '/tmp/' (eg:
/dev/shm/) so we glob that part out.
tests: raise a better error when patterns are wrongly formatted
It is fairly easy to make mistakes when merging conflict in the pattern file.
A common mistake is to forget adding an extra trailing comma changing the
length of the tuple.
We now detect such error and raise a better error message that helps to find
it.
lfs: add a fileset for detecting lfs files
This currently has the same limitation as {lfs_files}, namely it doesn't report
removed files.
We may want a dedicated 'lfs()' revset for efficiency, but combining this with
the 'contains()' revset should be equivalent for now. Combining with
'set:added()' or 'set:modified()' inside 'files()' should be equivalent to a
hypothetical lfs_adds() and lfs_modifies(). I wonder if there's a way to tweak
the filesets to evaluate lazily, to close the efficiency gap.
It would also be interesting to come up with a template filter for '{files}'
that looked at the pattern to 'files()', and filtered appropriately. While
passing a fileset as the pattern to `hg log` does filter '{files}', the set is
evaluated against the working directory, so there's no way to list all non-lfs
files above a certain size in all revisions, for example.
tests: stabilize ssh tests on Windows
This seems like a somewhat common type of failure (double vs single quote), so
I'm interested in ideas about how to avoid this. I doubt that we should
automatically fall back from single quote to double quote, like with '/' vs '\'.
wireprotoserver: rename abstractserverproto and improve docstring
The docstring isn't completely accurate for the current state
of the world. But it does describe the direction future patches
will be taking things.
Differential Revision: https://phab.mercurial-scm.org/D2065
wireprotoserver: document and improve the httplib workaround
This workaround dates all the way back to
a42d27bc809d in 2008.
The code is esoteric enough to warrant an inline explanation.
So I've added one.
At the time the code was written, the only wire protocol command
that accepted an HTTP request body was "unbundle." In the years
since, we've grown the ability to accept command arguments via
HTTP POST requests. So, the code has been changed to apply the
httplib workaround to all HTTP POST requests.
While staring at this code, I realized that the HTTP response
body in case of error is always the same. And, it appears to
mimic the behavior of a failed call to the "unbundle" command.
Since we can hit this code path on theoretically any protocol
request (since self.check_perm accepts custom auth checking
functions which may raise), I'm having a hard time believing
that clients react well to an "unbundle" response payload on
any wire protocol command. I wouldn't be surprised if our test
coverage for this feature only covers HTTP POST calls to
"unbundle." In other words, the experimental support for sending
arguments via HTTP POST request bodies may result in badness on
the client. Something to investigate another time perhaps...
Differential Revision: https://phab.mercurial-scm.org/D2064