- Oct 09, 2018
-
-
Gregory Szorc authored
Right now, we have a handful of arguments for specifying the revisions whose data should be returned. Defining how all these arguments interact when various combinations are present is difficult. This commit establishes a new, generic mechanism for specifying revisions. Instead of a hodgepodge of arguments defining things, we have a list of dicts that specify revision selectors. The final set of revisions is a union of all these selectors. We implement support for specifying revisions based on: * An explicit list of changeset revisions * An explicit list of changeset revisions plus ancestry depth * A DAG range between changeset roots and heads If you squint hard enough, this problem has already been solved by revsets. But I'm reluctant to expose revsets to the wire protocol because that would require servers to implement a revset parser. Plus there are security and performance implications: the set of revision selectors needs to be narrowly and specifically tailored for what is appropriate to be executing on a server. Perhaps there would be a way for us to express the "parse tree" of a revset query, for example. I'm not sure. We can explore this space another time. For now, the new mechanism should bring sufficient flexibility while remaining relatively simple. The selector "types" are prefixed with "changeset" because I plan to add manifest and file-flavored selectors as well. This will enable us to e.g. select file revisions based on a range of changeset revisions. Differential Revision: https://phab.mercurial-scm.org/D4979
-
Gregory Szorc authored
This feature is broken and doesn't work properly in all scenarios. e.g. if we have the following DAGs: client server D draft C draft C draft B draft B public A public A public The current code would only send the phase data for C. The client wouldn't see that B moved from draft to public. This feature will be restored in a future commit. For now, it is making refactoring of how revisions are specified in the wire protocol a bit difficult... Differential Revision: https://phab.mercurial-scm.org/D4978
-
- Oct 11, 2018
-
-
Gregory Szorc authored
If a line within a block is indented more than the line that came before, we automatically concatenate it with the previous line. This allows us to pretty format data. This will make tests easier to read. At some point we may just want to evaluate entire blocks as Python code or something, as even with this change, things aren't perfect, as we can't e.g. have formatting like: foo eval:[ True ] But this is strictly better than before, where we couldn't wrap long lines. Differential Revision: https://phab.mercurial-scm.org/D4977
-
- Oct 03, 2018
-
-
Gregory Szorc authored
Let's plug the client up to the server-advertised recommended batch size for manifestdata requests. Differential Revision: https://phab.mercurial-scm.org/D4976
-
- Oct 09, 2018
-
-
Gregory Szorc authored
Currently, exchangev2 hardcodes the batch size for how many revisions to fetch per command request. A single value is not appropriate for every repository because some repositories may have a drastically different "shape" from other repositories. e.g. a repo with lots of small files may benefit from larger batch sizes than a repo with lots of large files. And depending on caching used by the server, the server may wish to control the number of commands (to e.g. mitigate overhead of following content redirects). This commit teaches wireprotov2 commands to declare extra metadata which is advertised as part of the command descriptor. The manifestdata command has been taught to advertise a recommended batch size for requests. Differential Revision: https://phab.mercurial-scm.org/D4975
-
- Oct 03, 2018
-
-
Gregory Szorc authored
The API descriptor in wireprotov2 is much more expressive than space-delimited tokens and it will be difficult to define methods to query it in all of the ways we'll want to query it. So let's just declare defeat and expose the API descriptor on the peer instance. As part of this, we define a new interface for version 2 peers, fulfilling a TODO in the process. Differential Revision: https://phab.mercurial-scm.org/D4974
-
- Oct 11, 2018
-
-
Gregory Szorc authored
The distinction matters for e.g. hosts behind load balancers. But for the test environment, it doesn't matter. For whatever reason, advertisedbaseurl is resolving to http://1.0.0.127.in-addr.arpa:$HGPORT on my MBP. This hostname fails to resolve, causing the test to fail. No clue what's up with that behavior. Differential Revision: https://phab.mercurial-scm.org/D4973
-
- Oct 12, 2018
-
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D4990
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D4989
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D4988
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D4987
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D4986
-
Augie Fackler authored
This should be okay because we're just %-formatting a hash into a localized string. Differential Revision: https://phab.mercurial-scm.org/D4985
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D4984
-
Augie Fackler authored
Differential Revision: https://phab.mercurial-scm.org/D4983
-
- Oct 11, 2018
-
-
Gregory Szorc authored
We want to write bytes for convenience. This requires sys.stdout.buffer. But using sys.stdout.buffer introducing buffered output. So we sprinkle code with sys.stdout.flush() to force immediate writes. After all that, Python 3 was emitting b'' prefixed output for errors. So we only print errors if there were some. There aren't, so b'' don't come into play and output is identical in Python 2 and 3. Differential Revision: https://phab.mercurial-scm.org/D4972
-
Gregory Szorc authored
Python 3.7 changed the behavior of re.sub(). See https://bugs.python.org/issue33585. The new code should work on old and new Pythons. Differential Revision: https://phab.mercurial-scm.org/D4971
-
Gregory Szorc authored
Differential Revision: https://phab.mercurial-scm.org/D4969
-
Gregory Szorc authored
This function wants a str (which represents a path) and returns a str. We normalize input to str and output to bytes. Differential Revision: https://phab.mercurial-scm.org/D4967
-
Gregory Szorc authored
# skip-blame just b'' prefix Differential Revision: https://phab.mercurial-scm.org/D4970
-
Gregory Szorc authored
Differential Revision: https://phab.mercurial-scm.org/D4968
-
Gregory Szorc authored
# skip-blame just b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D4966
-
Gregory Szorc authored
json.dumps() will emit UTF-8 str on Python 2 and 3. Use sysbytes to force the .encode('utf-8') on Python 3 and no-op on Python 2. Differential Revision: https://phab.mercurial-scm.org/D4965
-
Gregory Szorc authored
# skip-blame just b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D4964
-
- Oct 12, 2018
-
-
Yuya Nishihara authored
While reviewing the Rust implementation, I noticed iter(ancestors) doesn't need to check filtering state for each parent revision. And doing that appears to have some measurable perf win. $ hg perfancestors -R mercurial (orig) wall 0.038093 comb 0.040000 user 0.040000 sys 0.000000 (best of 100) (this) wall 0.024795 comb 0.020000 user 0.020000 sys 0.000000 (best of 117)
-
Matt Harbison authored
The test for this broke in dc82ad1b7f77 when statistics started being tracked. It wasn't noticed because none of the bots have the vcr module installed. It looks like the custom_patches argument should patch in the custom httpconnection, and I can't figure out what is going on.
-
Matt Harbison authored
I don't see a sane way to print the summary to identify the changed commit, but this at least makes it a bit easier to identify a commit when a group of them changes.
-
- Oct 11, 2018
-
-
muxator authored
Without this change, make centos{5,6,7} fails with error: cp: cannot stat '<basedir>/rpmbuild/RPMS/*/*': No such file or directory This change is the exact equivalent of bc4bbc42899a (which applied to Fedora).
-
- Oct 10, 2018
-
-
Pulkit Goyal authored
This is similar to waht getbundle() does and also explicitly specifies that we should get a compressed bundle2 in normal cases when not sending 'error:abort'. Differential Revision: https://phab.mercurial-scm.org/D4934
-
Taapas Agrawal authored
Differential Revision: https://phab.mercurial-scm.org/D4933
-
- Oct 11, 2018
-
-
Augie Fackler authored
Right now the fuzzer is crashing trying to look up the home dir for uid 0, which is breaking in the fuzz environment. Differential Revision: https://phab.mercurial-scm.org/D4936
-
- Oct 03, 2018
-
-
Boris Feld authored
This will make it easier to reuse in another changesets.
-
- Oct 02, 2018
-
-
Boris Feld authored
This makes it easier to reuse it in other (future) part of the code that requires their own time management.
-
- Oct 01, 2018
-
-
Boris Feld authored
This is useful to check for a consistent final slice in multiple different repositories.
-
Boris Feld authored
-
Boris Feld authored
The previous code was mixing formatting and data, breaking `-T json` with unexpected data. We fix the issue and add a test to prevent future regression.
-
Boris Feld authored
This is useful when the assertion fails.
-
- Oct 11, 2018
-
-
Gregory Szorc authored
Suggested by @durin42 in review of D4923. Differential Revision: https://phab.mercurial-scm.org/D4935
-
- Oct 09, 2018
-
-
Gregory Szorc authored
Now that we have support for negotiating encodings and configuring an encoder, we can start sending content encoded frames from the server. This commit teaches the wireprotov2 server code to send content encoded frames. On the mozilla-unified repository with zstd enabled peers, this change reduces the total amount of data transferred from server to client drastically: befor: 7,190,995,812 bytes after: 1,605,508,691 bytes Differential Revision: https://phab.mercurial-scm.org/D4927
-
- Oct 08, 2018
-
-
Gregory Szorc authored
Differential Revision: https://phab.mercurial-scm.org/D4926
-