Commit Graph

26721 Commits

Author SHA1 Message Date
Pierre-Yves David
c6a4fdf34b test: use generaldelta in 'test-ssh-bundle1.t'
This has effect on the capabilities string.
2015-10-20 13:14:31 +02:00
Pierre-Yves David
82c3577531 test: use generaldelta in 'test-strip.t'
This has minor effects on test output.
2015-10-20 13:09:43 +02:00
Pierre-Yves David
bd379a5170 test: use generaldelta in 'test-rebase-newancestors.t'
This has some minor effects on test output.
2015-10-20 12:39:49 +02:00
Pierre-Yves David
456e3170dd test: use general delta for 'test-commit-amend.t'
Using general delta introduces harmless changes to some of the test output.
2015-10-20 12:09:18 +02:00
Pierre-Yves David
703f43489d test: wider matching in 'test-clone-r.t'
The test is already somewhat resistant to changes from general delta. We make
it wider to catch expected differences.
2015-10-20 11:50:55 +02:00
Pierre-Yves David
0341332573 test: use generaldelta in 'test-bundle-type.t'
Generaldelta changes some of the default targets for 'hg bundle'. All cases are
already properly tested but some ambiguous specifications are affected.
2015-10-20 11:48:49 +02:00
Pierre-Yves David
4a2ed14f46 test: use generaldelta in 'test-patchbomb.t'
Using generaldelta changes the default type of bombed bundle.
2015-10-20 10:46:59 +02:00
Pierre-Yves David
65b414182f test: use generaldelta for test-bundle.t
This impacts tests of the 'packed' feature. We can safely accept the new output
because the 'v1' format is not restricted to old revlog format, the requirements
are properly advertised to the client.
2015-10-20 10:37:07 +02:00
Pierre-Yves David
364c4ad695 test: use generaldelta in 'test-rebase-conflict.t'
Doing this has some minor impacts on test output since the rebase
backup bundle moves to bundle2.
2015-10-20 03:14:36 +02:00
Pierre-Yves David
2bc70a167a tests: test generaldelta configuration in test-init.t
We turn the feature on for the whole test and test that it can properly be
disabled through the config.
2015-10-19 15:25:58 +02:00
Pierre-Yves David
2d40bbaa65 test: enable generaldelta early in 'test-treemanifest.t'
Having generaldelta on results in minor test output changes (as we are staring
at the revlog).
2015-10-19 11:28:31 +02:00
Pierre-Yves David
e262e3a0ad test: enable generaldelta in 'test-copy.t'
Doing so has a minimal impact on the test.
2015-10-19 10:48:02 +02:00
Pierre-Yves David
6cef7fc5e0 test: enable generaldelta in 'test-debugcommand.t'
The test logic is not affected by generaldelta, so we move it to
generaldelta early. Some of the fuzzy matching had to be extended to
cover "delta".
2015-10-18 19:04:29 +02:00
Pierre-Yves David
4eb2c3e502 test: use generaldelta in test-manifestv2.t
Generaldelta and bundle2 have no real influence on this test. So we can safely
switch it early.
2015-10-18 18:55:32 +02:00
Pierre-Yves David
b8578f0ea9 test: explicitly use generaldelta in 'test-rebase-mq-skip.t'
This induces some trivial changes in the tests. This happen in its own changeset
for clarity purposes.
2015-10-18 18:36:39 +02:00
Pierre-Yves David
79d327f47c test: using generaldelta in 'test-lfconvert.t'
This leads to a harmless test change.
2015-10-16 02:54:52 +01:00
Pierre-Yves David
0275dd97e2 test: enforce generaldelta format with the right option
The option that will become true by default is now 'usegeneraldelta' We have to
adjust the change made in b75fed55f6dc to actually achieve its goal.
2015-11-12 02:52:19 -08:00
Pierre-Yves David
e6cf76f023 test: enforce non-generaldelta base repository in 'test-generaldelta'
This test check the difference between various configurations we have to pin the
type of some repositories to ensure the test is still correct when we change the
default.
2015-11-07 13:53:11 -05:00
Pierre-Yves David
06a0758e02 test: use generaldelta in 'test-hgweb-command.t'
Using generaldelta has a meaningless impact on the capabilities string.
2015-10-20 12:25:51 +02:00
Pierre-Yves David
2e9e629297 stream: sort stream capability before serialisation
We want that capability to be stable in our testing. This is currently not an
issue because the set is size 1, but this will be once generaldelta related
data gets in there.
2015-10-20 12:28:42 +02:00
Pierre-Yves David
3ff0d38161 test: spread capabilities replies in 'test-hgweb-commands'
Any changes to the capabilities string was very hard to review. So we introduce two
tests. A small one that validates the format and a second one to validate the
content, where each capability is on its own line to make changes simpler to
review.
2015-10-20 12:25:09 +02:00
Durham Goode
d0bab13283 phase: improve retractboundary perf
The existing retractboundary implementation computed the new boundary by walking
all descendants of all existing roots and computing the new roots. This is
O(commits since first root), which on long repos can be hundreds of thousands of
commits.

The new algorithm only updates roots that are greater than the new root
locations. For common operations like commit on a repo with the earliest root
several hundred thousand commits ago, this makes retractboundary go from
1 second to 0.008 seconds.

I tested it by running the test suite with both implementations and checking
that the root results were always the identical.

There was some discussion on IRC about the safety of this (i.e. what if the new
nodes are already part of the phase, etc).  I've looked into it and believe this
patch is safe:

1) The old existing code already filters the input nodes to only contain nodes
   that require retracting (i.e. we only make node X a new root if the old phase
   is less than the target phase), so there's no chance of us adding a
   unnecessary root to the phase (unless the input root is made unnecessary by
   another root in the same input, but see point #3).

2) Another way of thinking about this is:  the only way the new algorithm would
   be different from the old algorithm is if it added a root that is a
   descendant of an old root (since the old algorithm would've caught this in
   the big "roots(%ln::)".  At the beginning of the function, when we filter out
   roots that already meet the phase criteria, the *definition* of meeting the
   phase criteria is "not being a descendant of an existing root".  Therefore,
   by definition none of the new roots we are processing are descendants of an
   existing root.

3) If two nodes are passed in as input, and one node is an ancestor of the other
   (and therefore the later node should not be a root), this is still caught by
   the 'roots(%ln::)' revset. So there's no chance of an extra root being
   introduced that way either.
2015-11-07 16:11:49 -08:00
Matt Mackall
da9630bff1 merge with stable 2015-11-12 13:51:09 -06:00
Danek Duvall
d23d8113a8 test: test-bundle-type.t needs to work more universally
The cut and head utilities on Solaris have weird differences from the GNU
versions.  The f helper script does a dump more nicely than those tools,
anyway.
2015-11-10 09:58:10 -08:00
Matt Mackall
9b4fd50e2e Added signature for changeset ec7a5e1a55ed 2015-11-09 16:24:13 -06:00
Matt Mackall
2dd39095d7 posix: fix test-permissions regression 2015-11-09 15:53:11 -06:00
Anton Shestakov
169417da80 dockerlib: allow non-unique uid and gid of $DBUILDUSER (issue4657)
There are make targets for building mercurial packages for various
distributions using docker. One of the preparation steps before building is to
create inside the docker image a user with the same uid/gid as the current user
on the host system, so that the resulting files have appropriate
ownership/permissions.

It's possible to run `make docker-<distro>` as a user with uid or gid that is
already present in a vanilla docker container of that distibution. For example,
issue4657 is about failing to build fedora packages as a user with uid=999 and
gid=999 because these ids are already used in fedora, and groupadd fails.
useradd would fail too, if the flow ever got to it (and there was a user with
such uid already).

A straightforward (maybe too much) way to fix this is to allow non-unique uid
and gid for the new user and group that get created inside the image. I'm not
sure of the implications of this, but marmoute encouraged me to try and send
this patch for stable.
2015-11-08 01:10:52 +08:00
Mateusz Kwapich
266a6f869e dirstate: fix filefoldmap incosistency on file delete
The _filefoldmap is not updated in when files are deleted from dirstate. In the
case where the file with the same but differently cased name is added afterwards
it renders _filefoldmap incorrect.  Those steps must occur to for a problem to
reproduce:
 - call status (with listunknown=True),
 - update working rectory to a commit which does a casefolding change (A -> a)
 - call status again (it will show the file "a" as deleted)

Unfortunately I'm unable to write a test for it because I don't know any
core-mercurial command able to reproduce those steps.

The bug was originally spotted when hgwatchman was enabled. It caused the
changeset contents change during hg rebase (one file unrelarted to changeset
was deleted in it after rebase).

The hgwatchman is able to hit it because when hgignore changes the hgwatchmans
overridestatus is calling original status with listunknown=True.
2015-11-09 10:43:23 -08:00
Steve Borho
e04f287b5a wix: style-coal.css has been renamed 2015-11-09 09:41:20 -06:00
Javi Merino
65fb643f36 clonebundles: fix typo s/comand/command/ 2015-11-05 10:31:20 +00:00
Matt Mackall
8b9a3d960f posix: retry on symlink race in checklink
Multiple threads might attempt to check links with the same temporary
name. This would cause one side to get an EEXIST error and wrongly
fail the support check. Here, we simply retry if our temporary name
exists.
2015-11-06 15:23:10 -06:00
Pierre-Yves David
f89772113f changegroup: back code change of b5988e1d3dcb out
The previous changeset is a simpler way of fixing issue4934 without changing the
spirit of the code. We can remove the dual call to 'delayupdate' but we keep the
tests to show that the issue is still fixed.
2015-11-06 13:01:15 -05:00
Pierre-Yves David
dfd6e44ebe changegroup: call 'prechangegroup' hook before setting up write delay
The 'prechangegroup' interfere with 'delayupdate' logic because it trigger the
one time call of 'changelog._writepending' (see issure4934). There is no reason
not to call that hook before setting up 'delayupdate' so we move the call a bit
earlier to avoid interference.
2015-11-06 12:59:09 -05:00
Pierre-Yves David
107254a73d changegroup: fix the scope of a try finally
The try finally is here to ensure we release the just-created transaction.
Therefore we should not do half a dozen operations before actually entry the try
scope.
2015-11-06 12:39:06 -05:00
Pierre-Yves David
c8b7676e04 format: introduce 'format.usegeneraldelta`
This option will make repositories created as general delta by default but will
not make Mercurial aggressively recompute deltas for all incoming bundle.
Instead, the delta contained in the bundle will be used. This will allow us to
start having general delta repositories created everywhere without triggering
massive recomputation costs for all new clients cloning from old servers.
2015-11-02 15:59:12 +00:00
Pierre-Yves David
474dfeda7e scmutil: extract general delta config handling in a function
General delta is currently controlled by a single option, we will introduce a
new one in the next changeset.

We extract the logic in a function while it is simple.
2015-11-02 16:52:34 +00:00
Anton Shestakov
60499c65e3 bash_completion: add -p|--patch|--stat support for shelve 2015-11-10 19:52:30 +08:00
Matt Harbison
c83af7a9ec test-convert-git: silence commit output for stablity
When running the tests with 1.7.7.6, I get 'files' and 'insertions' instead of
the singular forms, and there is also an additional '0 deletions(-)' at the end.
Since this doesn't seem important to the test, silence it.
2015-11-08 18:34:36 -05:00
Matt Harbison
09960eddd1 rebase: preserve the 'intermediate-source' attribute of grafts
Preserving the 'source' attribute of grafts started with 091a7dd3c7d0, which
predates the introduction of 'intermediate-source' in 7fbf0ef28408 by a year and
a half.  It looks like not preserving this was an oversight.

On a related note, notice how the source value of 32af76 is no longer visible in
the graph above this test.  Is it reasonable to import the sha1 translation from
evolve.py:relocate() into scmutil or similar, and use that to fixup these
attributes as well as the commit message?  (I realize that evolve is still
experimental, but I don't see a way to do this from the evolve extension.)
2015-11-08 17:56:48 -05:00
Matt Mackall
0a9df707c8 merge with stable 2015-11-11 15:08:08 -06:00
Augie Fackler
578db94dcb verify: add a hook that can let extensions manipulate file lists
Without a hook of this nature, narrowhg[0] clones always result in 'hg
verify' reporting terrible damage to the entire repository
history. With this hook, we can ignore files that aren't supposed to
be in the clone, and then get an accurate report of any damage present
(or not) in the repo.

0: https://bitbucket.org/Google/narrowhg
2015-11-04 12:14:18 -05:00
Siddharth Agarwal
85a4c599d3 resolve: don't abort when file is missing
A file being missing is a completely valid situation in which the user may want
to re-resolve merge conflicts. Mercurial already maintains backups of local
data, so this turns out to be easy to handle.
2015-11-10 17:16:59 -08:00
Siddharth Agarwal
32de813627 filemerge: treat EOF at prompt as fail, not abort
Previously we'd abort the merge entirely if there was an EOF at the prompt.
This is unnecessary -- it's much better to simply fail and treat the file as
unresolved instead.
2015-11-10 17:13:16 -08:00
Siddharth Agarwal
fefb3388c3 test-merge-tools.t: add 'hg resolve --list' output to tests
In upcoming patches we're going to be making some improvements to the ':prompt'
merge tool, and one of them is recovering appropriately from exceptions. It is
important in such cases to make sure that the merge state is written out
properly.

I went through the output and verified that it all makes sense.
2015-11-10 17:10:47 -08:00
Siddharth Agarwal
6e6f3927e3 error: add structured exception for EOF at prompt
We'll catch this exception for promptchoice queries to provide better error
handling.
2015-11-10 00:46:45 -08:00
Siddharth Agarwal
c1dff75209 test-merge-prompt.t: unset HGMERGE
We're going to test behavior with and without HGMERGE, so disable it for the
test.
2015-11-09 22:37:32 -08:00
Anton Shestakov
90da27730e hgweb: compute changeset parents and children for log pages lazily
Log pages, i.e. changelog, filelog and search results page computed children
and parents for each changeset shown, because spartan hgweb style shows this
info. Turns out, computing all this is heavy and also unnecessary for log pages
in all other hgweb styles.

Luckily, templates allow an easy way to do computations on demand: just pass
the heavy part of code as a callable and it will be only called when needed.

Here are some benchmarks on the mercurial repository (best of 3):

time wget http://127.0.0.1:8021/

before: 0m0.050s
after:  0m0.040s

time wget http://127.0.0.1:8021/?revcount=960

before: 0m1.164s
after:  0m0.389s

time wget http://127.0.0.1:8021/log/tip/mercurial/commands.py

before: 0m0.047s
after:  0m0.042s

time wget http://127.0.0.1:8021/log/tip/mercurial/commands.py?revcount=960

before: 0m0.830s
after:  0m0.434s
2015-11-10 23:02:59 +08:00
Siddharth Agarwal
ddc0857ff8 filemerge: move :merge-local/other symlink check to precheck
In upcoming patches we're going to add more checks to the function currently
named _symlinkcheck. This consolidates all those checks.
2015-11-08 23:42:44 -08:00
Siddharth Agarwal
6c70d533e7 test-merge-types.t: add tests for :merge-local/:merge-other with symlinks
This had no test coverage.
2015-11-08 23:47:20 -08:00
Matt Mackall
14c5bb7714 merge with stable 2015-11-09 12:49:21 -06:00