Commit Graph

35 Commits

Author SHA1 Message Date
Pierre-Yves David
790b968ac9 test: enforce v1 type in 'test-bundle2-format.t'
This bundle command is meant to generate a bundle1, we enforce that to avoid
test's misbehavior when moving to general-delta by default.
2015-10-16 02:51:34 +01:00
Pierre-Yves David
30913031d4 error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.

For great justice.
2015-10-08 12:55:45 -07:00
Pierre-Yves David
96f8937e86 unbundle: properly read head modification result from bundle2
We were reading the wrong key...
2015-10-04 21:48:19 -07:00
Matt Mackall
5e1b4ad958 urls: bulk-change primary website URLs 2015-09-30 15:43:49 -05:00
Pierre-Yves David
508568fbbd unbundle: test and fix for clean abort on unknown bundle2 feature
This introduce a test for the feature and fix the exception name that is
different on default.
2015-09-24 17:52:21 -07:00
Matt Mackall
aa8bafdf33 tests: fix test-bundle2-format output
Forgot to amend.
2015-09-29 14:08:37 -05:00
Pierre-Yves David
c4198a6645 bundle2: allow compressed bundle
This changeset adds support for a 'compression' parameter in bundle2 streams.
When set, it controls the compression algorithm used for the payload part of the
bundle2.

There is currently no usage of this except in tests.
2015-09-23 12:56:12 -07:00
Pierre-Yves David
7b56b0a80e test-bundle2: dump bundle content using f --hexdump
Thanks to Greg Szorc for pointing this out.
2015-09-28 15:01:20 -07:00
Augie Fackler
b9db4815ce bundle2: don't try to recover from a GeneratorExit (issue4785)
GeneratorExit means the other end of the conversation has already
stopped listening, so don't try and yield out error
information. Instead, just let the GeneratorExit propagate normally.

This should resolve esoteric issues observed with servers that have
aggressive timeouts waiting for data to send to clients logging
internal Python errors[0]. This has been observed with both gunicorn's
gevent worker model and with scm-manager's built-in webserver (which
itself is something sitting inside jetty.)


0: Exception RuntimeError: 'generator ignored GeneratorExit' in <generator object getchunks at 0x7fd2f6c586e0> ignored
2015-09-01 15:47:33 -04:00
Matt Harbison
de473412b1 tests: restore 'python' and '$TESTDIR/' for dummyssh invocation
This is a backout of 93589179c542, and a partial backout of 9b1628b91e74.

Windows won't execute 'dummyssh' directly, presumably because CreateProcess()
doesn't know how to execute a bash script:

   $ hg clone -e "dummyssh" ssh://user@dummy/cloned sshclone
   remote: 'dummyssh' is not recognized as an internal or external command,
   remote: operable program or batch file.
   abort: no suitable response from remote hg!
   [255]

With the restoration of python as the executable, $TESTDIR needs to be restored
for these invocations, because python won't search $PATH for 'dummyssh':

   $ hg clone -e "python dummyssh" ssh://user@dummy/cloned sshclone
   remote: python: can't open file 'dummyssh': [Errno 2] No such file or directory
   abort: no suitable response from remote hg!
   [255]
2015-06-09 21:39:33 -04:00
Matt Mackall
c64d336faa tests: simplify calls to dummyssh
dummyssh is marked executable and is in the path, no need for python,
TESTDIR, or quotes.
2015-06-08 15:02:49 -05:00
Pierre-Yves David
d0e8796a75 bundle2: hide bundle2 stream debug under a config flag
The old output is very verbose and unsuitable for general debug level. It is
however very useful for debugging bundle2 generation or consumption issues. All
this verbose ouput is hidden under a 'devel.bundle2.debug' flag.
2015-05-26 23:06:17 -07:00
Pierre-Yves David
397fb0efd5 bundle2: add generic debug output regarding processed part payload
If we are about to hide the detailed debug output, we need some generic debug
message to replace it in a concise way.
2015-05-26 23:58:38 -07:00
Pierre-Yves David
977711b858 bundle2: add generic debug output regarding processed part
If we are about to hide the detailed debug output, we need some generic debug
message to replace it.
2015-05-26 23:36:31 -07:00
Pierre-Yves David
f4b0d8312f bundle2: add generic debug output at the end of bundle processing
If we are about to hide the detailed debug output, we need some generic debug
message to replace it in a concise way.
2015-05-27 00:02:49 -07:00
Pierre-Yves David
2d056781e3 bundle2: add generic debug output regarding processed bundle
If we are about to hide the detailed debug output, we need some generic debug
message to replace it in a concise way.
2015-05-27 00:00:35 -07:00
Pierre-Yves David
aca59375f8 bundle2: add generic debug output regarding generated parts
If we are about to hide the detailed debug output, we need some generic debug
message to replace it in a concise way.
2015-05-27 00:19:16 -07:00
Pierre-Yves David
2aa990e3f6 bundle2: add generic debug output regarding generated bundle
If we are about to hide the detailed debug output, we need some generic debug
message to replace it in a more compact way.
2015-05-27 00:10:30 -07:00
Pierre-Yves David
669aff65a4 bundle2: add debug output for part generation
The part generation process was lacking a ui object and could not produce debug
output. It seems valuable to have some debug output on this part too, especially
now that we are planning to be able to hide it in the default --debug output.
2015-05-27 00:52:01 -07:00
Pierre-Yves David
91f110738d bundle2: prefix all unbundling debug message with 'bundle2-input:'
This make the origin of the message more explicit.
2015-05-26 20:40:21 -07:00
Pierre-Yves David
106d2910c2 bundle2: prefix all bundling debug messages with 'bundle2-ouput:'
This makes the origin of the message more explicit.
2015-05-26 22:57:35 -07:00
Pierre-Yves David
281365197e progress: get the extremely verbose output out of default debug
When the progress extension is not enabled, each call to 'ui.progress' used to
issue a debug message. This results is a very verbose output and often redundant
in tests. Dropping it makes tests less volatile to factor they do not meant to
test.

We had to alter the sed trick in 'test-rename-merge2.t'. Sed is used to drop all
output from a certain point and hidding the progress output remove its anchor.
So we anchor on something else.
2015-05-09 23:40:40 -07:00
Pierre-Yves David
af7d20b000 bundle2: rename format, parts and config to final names
It is finally time to freeze the bundle2 format! To do so we:
- rename HG2Y to HG20,
- drop "b2x:" prefix from all part names,
- rename capability to "bundle2-exp" to "bundle2"
- rename the hook flag from 'bundle2-exp' to 'bundle2'
2015-04-09 16:25:48 -04:00
Pierre-Yves David
9dd801717e unbundle20: retrieve unbundler instances through a factory function
To support multiple bundle2 formats, we will need a function returning
the proper unbundler according to the header. We introduce such aa
function and change the usage in the code base. The function will get
smarter in later changesets.

This is somewhat similar to the dispatching we do for 'HG10' and 'HG11'.

The main target is to allow HG2Y support in an extension to ease transition of
companies using the experimental protocol in production (yeah...) But I've no
doubt this will be useful when playing with a future HG21.
2015-04-06 16:04:33 -07:00
Eric Sumner
9e907c2f00 unbundle: support bundle2 files
This adds support for bundle2 files to the unbundle command.
2015-01-14 17:09:55 -08:00
Eric Sumner
676662b804 commands.debugbundle: bundle2 support
This enables debugbundle to print supporting info for bundle2 files.
2015-01-15 15:35:26 -08:00
Eric Sumner
9823f2cb56 bundle2: lowercase part types
Since the capitalization no longer carries any meaning (previous diff), this
patch normalizes all of the bundle2 part type strings to lower case.
2014-12-17 15:11:26 -08:00
Eric Sumner
688d023c87 bundle2.bundlepart: make mandatory part flag explicit in API
This makes all bundle2 parts mandatory unless they are expressly made advisory
via the keyword parameter or the bundlepart.mandatory property.
2014-12-17 21:14:19 -08:00
Mads Kiilerich
b420dd92b1 spelling: fixes from proofreading of spell checker issues 2014-04-17 22:47:38 +02:00
Mads Kiilerich
523c87c1fe spelling: fixes from proofreading of spell checker issues 2014-04-17 22:47:38 +02:00
Pierre-Yves David
ad1ec3399d bundle2: transmit exception during part generation
If an exception is raised during a bundle2 part payload generation it is now
recorded in the bundle. If such exception occurs, we capture it, transmit an
abort exception through the bundle, cleanly close the current part payload and
raise it again. This allow to generate valid bundle even in case of exception so
that the consumer does not wait forever for a dead producer. This also allow to
raise the exception during unbundling at the exact point it happened during
bundling make debugging easier.
2014-10-15 03:52:20 -07:00
Pierre-Yves David
15397993b6 bundle2: change header size and make them signed (new format)
We are changing all integers that denote the size of a chunk to read to int32.
There are two main motivations for that.

First, we change everything to the same width (32 bits) to make it possible for
a reasonably agnostic actor to forward a bundle2 without any extra processing.
With this change, this could be achieved by just reading int32s and forwarding
chunks of the size read. A bit a smartness would be logic to detect the end of
stream but nothing too complicated.

Second, we need some capacity to transmit special information during the bundle
processing. For example we would like to be able to raise an exception while a
part is being read if this exception happend while this part was generated.
Having signed integer let us use negative numbers to trigger special events
during the parsing of the bundle.

The format is renamed for B2X to B2Y because this breaks binary
compatibility. The B2X format support is dropped. It was experimental to
allow this kind of things. All elements not directly related to the binary
format remain flagged "b2x" because they are still compatible.
2014-10-01 23:40:23 -05:00
Pierre-Yves David
9fbd0c37ca bundle2: add a test for exceptions raised during the generation process
We would like exceptions raised during the generation process to be gracefully
handled on the receiver side. We add a test for it. It shows that we are not
doing it yet.
2014-10-14 13:23:03 -07:00
Durham Goode
312ed291dd obsolete: update tests to use obsolete options
The obsolete._enabled flag has become a config option. This updates all but one
of the tests to use the minimal number of flags necessary for them to pass.  For
most tests this is just 'createmarkers', for a couple tests it's
'allowunstable', and for even fewer it's 'exchange'.
2014-10-14 13:34:25 -07:00
Pierre-Yves David
ba05aeb114 bundle2: split test in two
We split the test between the one dedicated to the binary format and the one
dedicated to checking the exchange of data using pull and push.
2014-10-01 23:55:22 -05:00