Commit Graph

41 Commits

Author SHA1 Message Date
Alexander Solovyov
0eb3836642 remove unused imports and variables 2011-04-30 13:59:14 +02:00
Peter Arrenbrecht
9855dca4f8 wireproto: add test for new optional arg missing on server
New argument is silently ignored by both HTTP and SSH servers.
This means we can, for instance, add new flags to getbundle()
to request advanced features (like lightweight-copy-aware bundles),
and older servers will silently ignore this request and send back
a plain bundle.
2011-04-29 14:54:01 +02:00
Shuhei Takahashi
ae68689a32 wireproto: allow unbundle with hashed heads parameter (issue2126)
Current wire protocol of unbundle sends the list of all heads in the remote
repository to avoid race condition.  This causes "URL too long" error on HTTP
server when the repository has many heads.

This change allows clients to send SHA1 hash of sorted head hashes instead.
Also, this introduces "unbundlehash" capability to inform them that the server
accepts hashed heads parameter.
2011-04-16 01:05:56 +09:00
Peter Arrenbrecht
6646f48826 wireproto: add getbundle() function
getbundle(common, heads) -> bundle

Returns the changegroup for all ancestors of heads which are not ancestors of common. For both
sets, the heads are included in the set.

Intended to eventually supercede changegroupsubset and changegroup. Uses heads of common region
to exclude unwanted changesets instead of bases of desired region, which is more useful and
easier to implement.

Designed to be extensible with new optional arguments (which will have to be guarded by
corresponding capabilities).
2011-03-23 16:02:11 +01:00
Matt Mackall
eec1a7b126 wireproto: avoid naked excepts 2011-03-22 21:26:19 -05:00
Peter Arrenbrecht
d542bac8c7 wireproto: add known([id]) function
known([Node]) -> [1/0]

Returns 1/0 for each node, indicating whether it's known by the server.
Needed for new discovery protocols introduced in later patches.
2011-03-22 09:22:21 +01:00
Peter Arrenbrecht
54d1d4736b wireproto: fix decodelist to properly return empty list
Needed by tests for next patch introducing known().
2011-03-22 07:40:02 +01:00
Peter Arrenbrecht
5925b26799 wireproto: fix handling of '*' args for HTTP and SSH 2011-03-22 07:38:32 +01:00
Peter Arrenbrecht
375ab88b9f debug: add debugwireargs to test argument passing over the wire
Tests argument passing locally, via HTTP, and via SSH. This is mainly preparation
for the next patch.
2011-03-22 07:38:32 +01:00
David Soria Parra
d4d13da65d wireproto: catch possible cast error in pushkey
The server can return an unexpected answer like 'ssl required'. We catch those
possible cast errors and abort the operation.
2011-02-21 00:37:55 +01:00
Matt Mackall
776084cff3 pushkey: use UTF-8 2010-11-28 18:21:47 -06:00
Matt Mackall
0d5b6162e5 wireproto: use proper UTF-8 handling for key lookup
Lookups happen in the local encoding space, but the wire protocol
should be using UTF-8 for interoperability.
2010-11-24 16:10:37 -06:00
Matt Mackall
8b31da4540 branch: operate on branch names in local string space where possible
Previously, branch names were ideally manipulated as UTF-8 strings,
because they were stored as UTF-8 in the dirstate and the changelog
and could not be safely converted to the local encoding and back.

However, only about 80% of branch name code was actually using the
right encoding conventions. This patch uses the localstr addition to
allow working on branch names as local strings, which simplifies
handling so that the previously incorrect code becomes correct.
2010-11-24 15:56:32 -06:00
Benoit Boissinot
16e11c728a wireproto: introduce pusherr() to deal with "unsynced changes" error
The behaviour between http and ssh still differ:
- the "unsynced changes" is seen as a remote output in the http cases
- but it is correctly seen as a push error for ssh
2010-10-11 12:45:36 -05:00
Benoit Boissinot
d2a82b6bc1 wireproto: redirect the output earlier 2010-10-11 12:44:33 -05:00
Benoit Boissinot
2a6248535c wireproto: return in finally was messing with the return inside the block 2010-10-11 12:44:11 -05:00
Matt Mackall
c2f36f74bb bundle: encapsulate all bundle streams in unbundle class 2010-09-20 14:32:21 -05:00
Sune Foldager
aca3a53bf9 clone: only use stream when we understand the revlog format
This patch fixes issues with stream cloning in the presense of parentdelta,
lwcopy and similar additions that change the interpretation of the revlog
format, or the format itself.

Currently, the stream capability is sent like this:
stream=<version of changelog>

But the client doesn't actually check the version number; also, it only checks
the changelog and it doesn't capture the interpretation-changes and
flag-changes in parentdelta and lwcopy.

This patch removes the 'stream' capability whenever we use a non-basic revlog
format, to prevent old clients from receiving incorrect data. In those cases,
a new capability called 'streamreqs' is added instead. Instead of a revlog
version, it comes with a list of revlog-format relevant requirements, which
are a subset of the repository requirements, excluding things that are not
relevant for stream.

New clients use this to determine whether or not they can stream. Old clients
only look for the 'stream' capability, as always. New servers will still send
this when serving old repositories.
2010-09-15 11:06:22 +02:00
Martin Geisler
80db87965d Consistently import foo as foomod when foo to avoid shadowing
This is in the style of 1aaceccaf1dc.
2010-08-30 14:38:24 +02:00
Brodie Rao
0f9d940cb9 cleanup: remove unused variables 2010-08-27 13:32:40 -04:00
Matt Mackall
ee35426eda bundle: unify/refactor unbundle/readbundle 2010-08-25 15:33:06 -05:00
Benoit Boissinot
15d634f7a0 fix undefined variables, spotted by pylint 2010-08-15 11:05:04 +02:00
Dirkjan Ochtman
2c0f8ea6a7 protocol: move the streamclone implementation into wireproto 2010-07-20 20:52:23 +02:00
Dirkjan Ochtman
bfec66d497 protocol: wrap non-string protocol responses in classes 2010-07-20 20:53:33 +02:00
Dirkjan Ochtman
d80015833d protocol: extract compression from streaming mechanics 2010-07-16 22:20:10 +02:00
Dirkjan Ochtman
3e08fe969b protocol: rename send methods to get grouping by prefix 2010-07-16 18:18:35 +02:00
Dirkjan Ochtman
3f725ce532 protocol: do not translate error messages on the remote side 2010-07-16 23:02:46 +02:00
Dirkjan Ochtman
05df6236b1 protocol: use return shortcut instead of respond function 2010-07-16 19:02:30 +02:00
Dirkjan Ochtman
1a4105fea1 protocol: command must be checked before passing in 2010-07-16 19:01:34 +02:00
Benoit Boissinot
9f2b90070b wireproto: refactor list of nodeid encoding / decoding 2010-07-16 00:52:13 +02:00
Matt Mackall
0cc5d56580 protocol: unify server-side capabilities functions 2010-07-15 13:56:52 -05:00
Matt Mackall
a6024ca63a protocol: unify unbundle on the server side 2010-07-15 11:24:42 -05:00
Matt Mackall
d46a89387f protocol: unify client unbundle support
- introduce _callpush helper
- factor out differences in result handling into helpers
- unify
2010-07-14 17:12:18 -05:00
Matt Mackall
8c936882a2 protocol: unify client changegroup methods 2010-07-14 17:09:31 -05:00
Matt Mackall
60b140435c protocol: unify stream_out client code 2010-07-14 16:55:44 -05:00
Matt Mackall
fcb8f496e2 protocol: unify basic http client requests 2010-07-14 16:35:51 -05:00
Matt Mackall
0b86557977 protocol: move basic ssh client commands to wirerepository 2010-07-14 16:34:57 -05:00
Matt Mackall
47c6d08427 protocol: unify stream_out command 2010-07-14 16:19:27 -05:00
Matt Mackall
050367f581 protocol: unify changegroup commands
- add sendchangegroup protocol helpers
- handle commands with None results
- move changegroup commands into wireproto.py
2010-07-14 15:43:20 -05:00
Matt Mackall
76d9ad7fea protocol: add proto to method prototypes 2010-07-14 15:33:21 -05:00
Matt Mackall
224bed3afd protocol: introduce wireproto.py
- add a protocol-independent dispatcher
- move most of the basic commands from sshserver to wireproto
- dispatch through wireproto first
2010-07-14 15:25:15 -05:00