Commit Graph

20863 Commits

Author SHA1 Message Date
Mads Kiilerich
0e8795ccd6 spelling: fixes from spell checker 2014-04-13 19:01:00 +02:00
Mads Kiilerich
56bd029861 tests: warn on invalid #if directive 2014-04-13 19:01:00 +02:00
Simon Heimberg
584b6544fe run-tests: test result shows when a failed test could not start a server
Failing to start a server happens regularly, at least on windows buildbot.
Such a failure often has nothing to do with the test, but with the environment.
But half the test output can change because some data is missing. Therefore this
is worth an extended error message.

Detect the server failure in the diff output because it is most reliable
there. Checking the output only does not show if the server failure was
expected.

 Old failure message when server start failed:
Failed test-serve.t: output changed

 New message:
Failed test-serve.t: serve failed and output changed
2013-11-25 22:00:46 +01:00
Bradley M. Kuhn
4cd8c219ba commit: --edit/-e to force edit of otherwise-supplied commit message
The --edit/-e option for the 'commit' command forces editor, even when a
commit message has been provided already by other means, such as by the -m or
-l options.
2013-09-08 19:02:08 -04:00
Pierre-Yves David
75b8e03941 bundle2: directly feed part to readbundle
Now that part payload can be read like a stream, we can directly use it to feed
the unbundle10 process.
2014-04-12 00:38:15 -04:00
Pierre-Yves David
acbb6d4494 bundle2: lazy unbundle of part payload
The `unbundle` part gains a `read` method to retrieve payload content.
This method behaves as a python file-like read method.

The bundle-processing code is updated to make sure a part is fully consumed before
another one is extracted.

Test output changes because the debug output is even more interleaved now.
2014-04-11 16:05:22 -04:00
Pierre-Yves David
a04ebd710a util: support None size in chunkbuffer.read()
When no size is provided, read the whole buffer. This aligns with the usual
behavior of `read()` in python.
2014-04-10 22:10:26 -07:00
Pierre-Yves David
2bab08d8ec bundle2: lazily iterate over bundle parts in the test
We used to create a list to know the number of parts in the bundle. This prevents
any lazy reading as planned for real usage.

The list creation is dropped. Some test output changed as debug output is
now interleaved with command output.
2014-04-11 15:02:26 -04:00
Pierre-Yves David
1726c7ed72 bundle2: move unpackheader closure into the class
With the same argument as the other one, we move this closure into the
`unbundlepart` class.
2014-04-11 15:47:38 -04:00
Pierre-Yves David
a5bcb69da6 bundle2: move the fromheader closure into the class itself
The class is now directly related to this header data. We can sanely move it on
the class.

I do not like closures very much...
2014-04-11 15:46:09 -04:00
Pierre-Yves David
0819f89a04 bundle2: add an unbundle part responsible from unbundling part
We have a new unbundle class and it is now responsible from extracting its own
data. The top level bundler only extracts the header (to detect an end of stream
marker) then leaves everything else to the `unbundlepart` class. The ultimate
goal is to have `unbundlepart` responsible for lazily extracting its payload.

This is mostly code movement.
2014-04-11 15:43:16 -04:00
Pierre-Yves David
10657d6382 bundle2: extract stream/unpack logic in an unpackermixin
The coming `unbundlepart` will need the same kind of method than `unbundle20`
for unpacking data from the stream. We extract them into a mixin class before
the creation of `unbundlepart`.
2014-04-11 15:19:54 -04:00
Pierre-Yves David
9498b02a99 exchange: restore truncated comment
The old version of this comment appeared to have been trunca
2014-04-13 12:21:09 -04:00
Takumi IINO
108a15e83e grep: highlight all matched words
"hg grep" highlights first matched word only.
This behavior is different from GNU grep.

This patch makes highlight all matched words.
2014-03-31 01:00:05 +09:00
Pierre-Yves David
e0a65c1ada phase: add a passing test for (issue3575)
Apparently this issue was fixed along the way (If it ever existed at all…)
2014-01-23 14:09:53 -08:00
Gregory Szorc
a283450c0f run-tests: allow test paths in other directories
Previously, test paths were assumed to be in the same directory and
wouldn't have a directory component. If a path with a directory
component was specified, it would be filtered out. This change allow
paths to contain directories. This in turn allows tests from other
directories to be executed.

Executing tests in other directories may break assumptions elsewhere in
the testing code. However, on initial glance, things appear to "just
work." This approach of running tests from other directories is
successfully being used at
https://hg.mozilla.org/hgcustom/version-control-tools/file/7085790ff3af/run-mercurial-tests.py
2014-03-24 22:12:37 -07:00
Gregory Szorc
c299dbb10c run-tests: allow option parser to be extended
This patch moves the OptionParser population into its own function so
consumers may modify the OptionParser before arguments are evaluated.
This will allow consumers to add custom options, set different defaults,
etc.
2014-03-24 21:52:28 -07:00
Gregory Szorc
f33d6c4e65 run-tests: use return values instead of sys.exit 2014-03-24 21:41:56 -07:00
Gregory Szorc
2ae9bd8d6c run-tests: Pass arguments into argument parser
Before, arguments were not passed into the optparse.OptionParser
instance and were coming from sys.argv. This patch enables consumers to
define the list of arguments to parse without having to adjust sys.argv.
2014-03-24 21:37:33 -07:00
Pierre-Yves David
e5b4ced868 bundle2: rename part to bundlepart
We are going to introduce an `unbundlepart` dedicated to reading bundle. So we
need to rename the one used to create bundle. Even if dedicated to creation, this
is still used for unbundling until we get the new class.
2014-04-11 07:36:14 -07:00
Pierre-Yves David
ef4a1b021a bundle2: comment to clarify why the handler call is where it is
The reason why it is here is not obvious. I'm the one who wrote it there in the
first place and almost moved it 2 weeks later.
2014-04-11 16:43:01 -04:00
Pierre-Yves David
f1960c11a4 bundle2: use chunkbuffer for exchange.getbundle
We can use `util.chunkbuffer` instead.
2014-04-12 00:53:15 -04:00
Pierre-Yves David
a90efe54ad bundle2: lazily generate the changegroup part in exchange.getbundle
Now that we have lazy generation of parts, let's use it.
2014-04-12 14:56:55 -04:00
Pierre-Yves David
be93303ad1 bundle2: support chunk iterator as part data
When the `part.data` attribute is an iterator, we assume it is an iterator of
chunks and use it.

We use a chunkbuffer to yield chunks of 4096 bytes.

The tests are updated to use this feature.
2014-04-11 08:04:16 -07:00
Pierre-Yves David
2cfe67ddd2 bundle2: extract a _payloadchunks method for part
We are preparing streaming capability for part. So the generation of payload
chunk will becomes more complex. We extract this part in its own function before
any changes.
2014-04-10 12:33:20 -07:00
Pierre-Yves David
a8e05fc7b8 changegroup: move chunk extraction into a getchunks method of unbundle10
This code used to be in `writebundle` only. We needs to make it more broadly
available for bundle2. The "changegroup" bundle2 part has to retrieve the
binary content of changegroup stream. We moved the chunks retrieving code into
the `unbundle10` object directly and the `writebundle` code is now using that.

This split is useful for bundle2 purpose, we want to be able to easily stream
changegroup content in a part.

To keep thing simples, we kept compression out of the new methods. If it make
more sense in the future, compression may get included in this function too.
2014-04-10 13:19:00 -07:00
Pierre-Yves David
c4bb78d90c bundle2: use reply part to return result of addchangegroup
We now have an official way to return the result of addchangegroup. The tests are
updated to check that the return bundle is properly created. It will be used
when push is bundle2 enabled.
2014-03-25 15:05:11 -07:00
Pierre-Yves David
e46e61d8b1 bundle2: produce a bundle2 reply
We do not know yet what kind of data future features and extensions will need to
exchange. To handle that, bundle2 allows to send arbitrary content to the
server. As a consequence, we need to be able to reply arbitrary content to the
client. And, we can use bundle2 to transmit those arbitrary data.

When a client will push a bundle2 to the server, the server will reply with a
bundle2 itself.

This changeset installs the first stone of this logic and test it.
2014-04-04 14:24:11 -07:00
Pierre-Yves David
90cfb42a5c bundle2: add reply awareness to unbundlerecords
We need an efficient way to handle bundle replies. The unbundle records class is
extended to carry such data.
2014-04-11 08:24:59 -07:00
Pierre-Yves David
311fe283fd bundle2: add an integer id to part
For sending response to a pushed bundle, we need to link reply parts to request
part. We introduce a part id for this purpose. This is a 32 bit unique
integer stored in the header.
2014-04-01 00:07:17 -07:00
Mads Kiilerich
a723522899 largefiles: don't prompt when one side of merge was changed but didn't change
This can happen after backout or grafts or criss cross merges. We already do
the same (but slightly different) thing in manifestmerge and filemerge.
2014-04-07 23:10:20 +02:00
Sean Farley
7e42d683fc color: fallback and test label as an effect
With this changeset, we can now send a color name directly to the label
function, e.g.

$ hg log -r . -T "{label('red', node|short)}\n"
2014-04-07 15:37:27 -05:00
Sean Farley
cd91f87125 color: extract method for determining a valid effect
This patch is just setup work so that we can reduce code duplication and have
one place to define a valid effect.
2014-04-07 15:33:46 -05:00
Mads Kiilerich
b117005b7c revlog: use context ancestor instead of changelog ancestor
We want to move in this direction.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
c55887b864 copies: guard debug section with ui.debugflag 2014-02-25 20:31:53 +01:00
Mads Kiilerich
210347bb4f copies: remove _checkcopies wrapper - it does no good
mergecopies might be doomed but it is not dead yet ...
2014-02-25 20:31:51 +01:00
Mads Kiilerich
d164c93242 transplant: use context ancestor instead of changelog ancestor
We want to move in this direction. ctx.ancestor is in a better position for
handling a situation with multiple ancestors.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
861f191408 commit: use revlog.commonancestors instead of .ancestor
This do probably not make any real difference but is slightly more correct and
we would like to get rid of flog.ancestor.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
723c536d44 backout: don't limit heritage check to a single ancestor
This do probably not make any real difference but is slightly more correct and
we would like to get rid of changelog.ancestor.
2014-04-07 23:17:51 +02:00
Mads Kiilerich
421298c7fe ancestor: remove unused genericancestor 2014-03-20 01:35:07 +01:00
Mads Kiilerich
c951e7f8b6 context: remove unused filectx.ancestor 2014-04-07 23:17:48 +02:00
FUJIWARA Katsunori
37e6e5e754 shelve: add "writebundle()" to invoke "writebundle()" with relative path and vfs 2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
893cc677a8 shelve: add "applybundle()" to invoke "readbundle()" with relative path and vfs
"applybundle()" also includes "addchangegroup()" invocation to
encapsulate "vfs.join()" inside it.
2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
a40858d014 bundlerepo: treat temporarily extracted bundle file via vfs 2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
4956966646 vfs: add "mkstemp()" 2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
1a5bc49ece repair: make "strip()" treat bundle files via vfs
This patch makes "repair.strip()" treat bundle files via vfs.

This patch also avoids applying "vfs.join()" on the value returned by
"changegroup.writebundle()", to get relative path from "_bundle()".
2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
535cdba175 changegroup: add "vfs" argument to "readbundle()" to pass relative filename 2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
e26cca0dd1 repair: make paths in "_bundle()" relative to ".hg"
This patch makes paths below in "_bundle()" relative to ".hg":

  - backup directory ("strip-backup"), and
  - bundle file under backup directory

"vfs" is passed to "changegroup.writebundle()" to use relative path
directly.

This patch applies "vfs.join()" on the value returned by "_bundle()",
because the caller expect it to return absolute path.

This will be changed by succeeding patch changing the caller side.
2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
01e064edbb changegroup: add "vfs" argument to "writebundle()" for relative access via vfs
Before this patch, filename specified to "changegroup.writebundle()"
should be absolute one.

In some cases, they should be relative to repository root, store and
so on (backup before strip, for example).

This patch adds "vfs" argument to "writebundle()", and makes
"writebundle()" open (and unlink) "filename" via vfs for relative
access, if both filename and vfs are specified.
2014-03-09 01:03:28 +09:00
FUJIWARA Katsunori
836e13a2f2 localrepo: make "undofiles()" return list of tuples "(vfs, relative filename)"
Before this patch, "localrepository.undofiles()" returns list of
absolute filename of undo files.

This patch makes it return list of tuples "(vfs, relative filename)"
to access undo files via vfs.

This patch also changes "repair.strip()", which is the only user of
"localrepository.undofiles()".
2014-03-09 01:03:28 +09:00