Commit Graph

24 Commits

Author SHA1 Message Date
Durham Goode
a9c8623638 clone: fix copying bookmarks in uncompressed clones (issue4430)
8a92e6790099 broke bookmarks getting copied during uncompressed clones. Since
most of the pull logic has been moved into exchange.py, lets just call
exchange.pull to fix up the repo with the latest bits after the streaming clone
has bootstrapped the repo. This keeps us from having to duplicate the bookmark
logic.
2014-10-31 12:56:25 -07:00
Pierre-Yves David
f84dab4656 clone: remove duplicated bookmark pulling
Now that all clone methods (copy, pull and push) also transport bookmarks, we can
safely drop the manual pulling that was performed during clone.
2014-09-26 13:56:20 -07:00
Pierre-Yves David
627b3886af pull: move bookmark movements inside the exchange.pull
There is no reason for bookmarks to get a special treatment. As a first step we
move the code as is in the `exchange.pull` function. Integration with the rest
of the flow will come later.

Adding bookmarks to pull means that most clone paths are now pulling bookmarks
through pull. We ensure that bookmark-update messages are properly suppressed in
that case.

In test-pull-http.t the 'requesting all changes' message disappear because we
now get the authentication error on the `listkeys`command before such message
is printed.
2014-09-26 17:44:00 -07:00
Matt Mackall
11be5cc27c tests: replace exit 80 with #require 2014-08-06 11:43:59 -05:00
Tomasz Kleczek
8b2ac179dd branchcache: fetch source branchcache during clone (issue3378)
Recomputing branch cache on clone may be expensive,
therefore if possible we fetch it along with the data.

- If the clone is performed by copying, we just copy branchcache file.
- If we localrepo.clone and streaming then we follow the procedure:
  1. Fetch branchmap from the remote
  2. Fetch the actual data.
  3. Find the latest rev within branch heads (tip at the time of
     branchmap fetch)
  4. Update the cache for the revs in [remotetip+1, tip]

This way we ensure that the branchcache is correct even in case
of races with commits.
2012-10-03 13:19:53 -07:00
Pierre-Yves David
fd393b84f3 pushkey: do not exchange obsole markers if feature is disabled
This apply to both push and pull both when client or server.
2012-07-28 13:33:06 +02:00
Pierre-Yves.David@ens-lyon.org
d60eedc2d6 obsolete: exchange obsolete marker over pushkey
For a version of the exchange, all markers are exchange. This won't
scale and we will need a better protocol later.
2012-06-07 19:21:59 +02:00
Mads Kiilerich
f64bae7ea3 tests: use 'do sleep 0' instead of 'do true', also on first line of command
2cd44a791e66 established that '... do true ...' shouldn't be used, but that was
only enforced on continued lines.
2012-04-23 01:56:48 +02:00
Matt Mackall
76e8b41818 tests: fix startup race in test-http-proxy 2012-03-28 19:24:11 -05:00
Pierre-Yves David
c8f1983f55 phases: exchange phase boundaries on pull
Add an extra argument to addchangegroup to all phase code to execute before the
lock is released.
2011-12-15 11:28:42 +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
Peter Arrenbrecht
9a2d2f747c setdiscovery: batch heads and known(ownheads)
This means that we now discover both subset conditions (local<remote and
remote<local) in a single roundtrip without ever constructing an actual
sample (which takes a bit of client CPU).
2011-06-14 22:58:00 +02:00
Matt Mackall
89ec131e91 http: minor tweaks to long arg handling
x-arg -> x-hgarg
replace itertools.count(1)
2011-05-01 03:51:04 -05: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
Thomas Arendsen Hein
e6dcc5994e merge with stable 2011-04-29 11:10:11 +02:00
Thomas Arendsen Hein
f0eec1822c tests: check for (*/sec) instead of (*B/sec) to match (X bytes/sec)
I just had: transferred 606 bytes in 2.9 seconds (211 bytes/sec)
2011-04-29 11:04:39 +02:00
Matt Mackall
fea21bd858 bookmarks: merge low-level push/pull support into core 2011-02-10 13:46:28 -06: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
ba3e09fa61 tests: unify test-http-proxy 2010-09-26 13:43:21 -05:00
Peter Arrenbrecht
8f2d068a05 discovery: avoid discovery when local graph is a subset of remote
Immediately sends local's heads to the server to check whether the server knows them all.
If it does, we can call getbundle immediately.

Interesting test output changes are:

-  added 1 changesets with 0 changes to 1 files (+1 heads)
+  added 1 changesets with 0 changes to 0 files (+1 heads)

-> The new getbundle() actually fixes a bug vs. changegroupsubset() in that it no longer
returns unnecessary files when file revs are reused.

warning: repository is unrelated
+  requesting all changes

-> The new use of common instead of bases correctly indicates that an unrelated pull
gets all changes from the server.
2011-03-23 16:06:55 +01:00
David Soria Parra
4e5087c547 bookmarks: separate bookmarks update code from localrepo's pull.
We explicitly want to update bookmarks from a remote. This will avoid
duplicate calls to listkeys if we clone (which calls pull) and keep
bookmark related code together.
2011-03-14 00:10:43 +01:00
David Soria Parra
cdf3407b1a tests: respect new hg clone listkey queries in http-proxy test 2011-03-14 00:10:43 +01:00
Peter Arrenbrecht
fec6de2003 httprepo: use caps instead of between for compat check
We usually query the capabilities at some point anyway so this way the first roundtrip
actually does useful work.
2011-03-12 18:29:02 +01:00
Steven Brown
41ef0052ee httprepo: order URL query string fields for readability
- cmd is always first, since the other fields are arguments to that command.
- The other fields are in alphabetical order, rather than random order.

example "hg serve" output
BEFORE
127.0.0.1 - - [26/Feb/2011 14:20:07] "GET /?bases=fa5962be1d87fe9a57244a14033550e192e57521+1a38f137b190482eaf0986594cd6e6b486c76fec&cmd=changegroupsubset&heads=1a38f137b190482eaf0986594cd6e6b486c76fec+fa5962be1d87fe9a57244a14033550e192e57521 HTTP/1.1" 200 -
127.0.0.1 - - [26/Feb/2011 14:00:50] "GET /?pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000&cmd=between HTTP/1.1" 200 -
127.0.0.1 - - [26/Feb/2011 14:17:28] "GET /?nodes=1a38f137b190482eaf0986594cd6e6b486c76fec+fa5962be1d87fe9a57244a14033550e192e57521&cmd=branches HTTP/1.1" 200 -

AFTER
127.0.0.1 - - [26/Feb/2011 14:21:28] "GET /?cmd=changegroupsubset&bases=fa5962be1d87fe9a57244a14033550e192e57521+1a38f137b190482eaf0986594cd6e6b486c76fec&heads=1a38f137b190482eaf0986594cd6e6b486c76fec+fa5962be1d87fe9a57244a14033550e192e57521 HTTP/1.1" 200 -
127.0.0.1 - - [26/Feb/2011 13:48:13] "GET /?cmd=between&pairs=0000000000000000000000000000000000000000-0000000000000000000000000000000000000000 HTTP/1.1" 200 -
127.0.0.1 - - [26/Feb/2011 14:19:17] "GET /?cmd=branches&nodes=1a38f137b190482eaf0986594cd6e6b486c76fec+fa5962be1d87fe9a57244a14033550e192e57521 HTTP/1.1" 200 -
2011-03-07 15:37:11 +08:00