Commit Graph

29 Commits

Author SHA1 Message Date
Mike Hommey
14669879bf changegroup: use a copy of hookargs when invoking the changegroup hook
addchangegroup creates a runhook function that is used to invoke the
changegroup and incoming hooks, but at the time the function is called,
the contents of hookargs associated with the transaction may have been
modified externally. For instance, bundle2 code affects it with
obsolescence markers and bookmarks info.

It also creates problems when a single transaction is used with multiple
changegroups added (as per an upcoming change), whereby the contents
of hookargs are that of after adding a latter changegroup when invoking
the hook for the first changegroup.
2014-10-16 15:54:53 +09:00
Pierre-Yves David
578b6cd317 phases: inform transaction-related hooks that a phase was moved
We do not have enough information to provide finer data, but this is still
useful information.
2014-10-12 08:03:20 -07:00
Matt Mackall
11be5cc27c tests: replace exit 80 with #require 2014-08-06 11:43:59 -05:00
Pierre-Yves David
fddf556ac8 phase: apply publishing enforcement for "serve" source
When a changegroup is added by a push on a publishing server, we ensure they
are added as public. This is used to enforce publishing on server when the
client is not aware of phases. It also prevents race conditions where a reader
could see the changesets as draft before they get turned public by the client.
Finally, this save rounds trip as the client does not need additional request to
turn them public.

However, this logic was only enforced when the changegroup was from a "push"
source. And "push" is used for local pushes only. Wireprotocol push uses "serve"
as source since Mercurial 1.9. We now enforce this logic for both "push" and
"serve" sources.

One could note that this logic was mainly useful during wireprotocol exchanges.
So this code is finally put into good use, 9 versions after its introduction.
2014-04-07 18:10:50 -07:00
Adrian Buehlmann
41c078fbbd test-push-http: fix failing test on Windows
The test failed due to problems with escaping. Fixes 838a7784dd04.
2012-10-19 15:03:35 +02:00
Wagner Bruna
795c3947e9 wireproto: fix pushkey hook failure and output on remote http repo
Over http, a failed pushkey hook simply crashed the server, and
successful hook output was never sent to the client.
2012-10-15 18:37:34 -03:00
Patrick Mezard
a4c03168e1 tests: enable even more Windows server tests 2012-09-14 21:05:24 +02:00
Patrick Mezard
7d8680da1f killdaemons: take file argument explicitely
It makes it easier to use as a generic replacement for kill utility,
mostly for Windows tests.
2012-08-20 22:36:51 +02:00
Yuya Nishihara
ee6b575238 hgweb: respond 403 forbidden for ssl required error
It's preferable to report "ssl required" as an error, so that the client
can detect error and exit with 255. Currently hg exits with 1, which is
"nothing to push."
2012-09-05 23:59:27 +09:00
Yuya Nishihara
9a2a603424 test-push-http: include exit status of hg push 2012-09-05 23:58:43 +09:00
Mads Kiilerich
a8107f523f tests: consistently use printenv.py the same MSYS/Windows-compatible way
This will remove some reasons some tests are disabled on Windows.
2012-06-21 03:05:02 +02:00
Adrian Buehlmann
b761076e81 tests/printenv.py: eliminate trailing spaces on output 2012-06-17 00:27:31 +02:00
Mads Kiilerich
fa1c4e5ebe tests: add missing trailing 'cd ..'
Many tests didn't change back from subdirectories at the end of the tests ...
and they don't have to. The missing 'cd ..' could always be added when another
test case is added to the test file.

This change do that tests (99.5%) consistently end up in $TESTDIR where they
started, thus making it simpler to extend them or move them around.
2012-06-11 01:40:51 +02:00
Pierre-Yves David
78c5d64e2e phases: only synchronize on common changeset when push fails
If push failed we should not expect the pushed changeset to exist on remote.
The common set before the push is used for phase related operation instead of
common + missing.

Note:
  * We still pull phase data even if push fails
  * We still try to push data even if push fails (same than bookmark)
2012-01-19 16:09:43 +01:00
Pierre-Yves David
387f9b40ba phases: simplify phase exchange and movement over pushkey
The code now only exchange draft root and only care about movement related to
public//draft boundary.

There is multiple reason to simplify this code:
    * Secret are never discovered anymore
    * We decided to not support more the three existing phase

Removing phase index from pushkey (if ever decided) will be made in another commit.
2012-01-13 02:04:16 +01:00
Pierre-Yves David
074b67eb86 phases: fix phase synchronization on push
The bugs seemed to show up when element not in future common changeset should
hold new hold phase data.

The whole phase push machinery was rewritten in the process.
2012-01-04 01:12:31 +01:00
Pierre-Yves David
0d9927b223 phases: exchange phase boundaries on push
For now phase sync is tried even if push fails with some know pathological
case. The exact behavior is to be discussed and implemented later.
2011-12-15 11:45:01 +01:00
Mads Kiilerich
8415df7277 tests: use 'hghave serve' to guard tests that requires serve daemon management 2011-11-07 03:24:53 +01:00
Greg Ward
cf0ea44613 rollback: only restore dirstate and branch when appropriate.
If the working dir parent was destroyed by rollback, then the old
behaviour is perfectly reasonable: restore dirstate, branch, and
bookmarks. That way the working dir moves back to an existing
changeset rather than becoming an orphan.

But if the working dir parent was unaffected -- say, you updated to an
older changeset and then did rollback -- then it's silly to restore
dirstate and branch. So don't do that. Leave the status of the working
dir alone. (But always restore bookmarks, because that file refers to
changeset IDs that may have been destroyed.)
2011-09-18 19:59:33 -04:00
Steven Brown
c1075f3880 httprepo: long arguments support (issue2126)
Send the command arguments in the HTTP headers. The command is still part
of the URL. If the server does not have the 'httpheader' capability, the
client will send the command arguments in the URL as it did previously.

Web servers typically allow more data to be placed within the headers than
in the URL, so this approach will:
- Avoid HTTP errors due to using a URL that is too large.
- Allow Mercurial to implement a more efficient wire protocol.

An alternate approach is to send the arguments as part of the request body.
This approach has been rejected because it requires the use of POST
requests, so it would break any existing configuration that relies on the
request type for authentication or caching.

Extensibility:
- The header size is provided by the server, which makes it possible to
  introduce an hgrc setting for it.
- The client ignores the capability value after the first comma, which
  allows more information to be included in the future.
2011-05-01 01:04:37 +08:00
Steven Brown
069a003fff tests: add script to disable a selected wire protocol capability
This can be used to test that the client and server both fall back to the
previous wire protocol when the capability is not supported.

It is currently used by test-push-http.t and I plan to use it for the HTTP
long argument support tests.
2011-04-25 18:00:30 +08:00
Steven Brown
80071fec77 tests: new test cases for the unbundlehash capability 2011-04-17 02:15:47 +08:00
Gilles Moris
b544e1360b test-push-http: use killdaemons.py instead of kill to avoid test unreliability 2011-02-20 18:06:05 +01:00
Gilles Moris
dcdc58f0a5 rollback: clarifies the message about the reverted state (issue2628)
Previously, when rolling back a transaction, some users could be confused
between the level to which the store is rolled back, and the new parents
of the working directory.

  $ hg rollback
  rolling back to revision 4 (undo commit)

With this change:
  $ hg rollback
  repository tip rolled back to tip revision 4 (undo commit)
  working directory now based on revision 2 and 1

So now the user can realize that the store has been rolled back to an older
tip, but also that the working directory may not on the tip (here we are
rolling back the merge of the heads 2 and 1)
2011-02-10 09:03:06 +01:00
Mads Kiilerich
3e84017cf0 tests: use printenv.py where it is - don't copy it around 2011-02-15 02:17:43 +01:00
Mads Kiilerich
43329863bd tests: let printenv.py show the real values
Test paths are now hidden by the test framework, so HG_URL no longer needs
mangling.
2011-02-15 01:05:32 +01:00
Adrian Buehlmann
758fc721d8 check-code: add 'no tab indent' check for unified tests
and fix the offending tests accordingly
2010-10-16 18:09:01 +02:00
Mads Kiilerich
e490eeec3f tests: reintroduce ":$HGPORT" in test output
This reduces the number of patterns that must be adjusted when writing tests.
2010-10-08 22:36:11 -05:00
Matt Mackall
835ef7f5b6 tests: unify test-push-http 2010-09-26 13:44:49 -05:00