- Sep 25, 2018
-
-
Gregory Szorc authored
This was raising a TypeError on Python 3 and preventing most (all?) wireprotov2 commands from working. Differential Revision: https://phab.mercurial-scm.org/D4731
-
- Sep 26, 2018
-
-
Matt Harbison authored
These places can only be strings.
-
Matt Harbison authored
# skip-blame for b'' prefixing
-
Matt Harbison authored
This is no longer exported on platforms that don't support forking, as of 3.6. https://github.com/python/cpython/commit/aadff9bea61a2fc9f4cf0f213f0ee50fc54d6574
-
Matt Harbison authored
test-check-code flagged this after I changed this line for something unrelated.
-
Yuya Nishihara authored
-
- Sep 25, 2018
-
-
Yuya Nishihara authored
Since revlog._partialmatch() catches RevlogError coming from cext and re-raises AmbiguousPrefixLookupError, catching RevlogError here seems less correct. Differential Revision: https://phab.mercurial-scm.org/D4735
-
Matt Harbison authored
-
Gregory Szorc authored
Otherwise the CBOR encoder fails on Python 3 due to lacking support for encoding str/unicode. # skip-blame just some b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D4734
-
Gregory Szorc authored
Otherwise we get an error attempting to dispatch a command with arguments because we're passing a dict with bytes keys. Differential Revision: https://phab.mercurial-scm.org/D4732
-
Gregory Szorc authored
This was preventing HTTP 500's from being sent in Python 3. Differential Revision: https://phab.mercurial-scm.org/D4730
-
- Sep 23, 2018
-
-
Matt Harbison authored
This keeps Windows happy.
-
- Sep 22, 2018
-
-
Matt Harbison authored
-
Matt Harbison authored
-
Matt Harbison authored
-
Matt Harbison authored
-
Matt Harbison authored
-
Matt Harbison authored
This file object is used in the vfs layer, so there are many errors like this: ... File "mercurial\localrepo.py", line 2569, in savecommitmessage return self.pathto(fp.name[len(self.root) + 1:]) TypeError: 'int' object is not subscriptable It looks like the 'name' value is actually the fileno() value, and the documentation says the name parameter to PyFile_FromFd() is ignored. [1] I tried just assigning the attribute after osutil.posixfile() returns, but that crashes saying that it's read-only. [1] https://docs.python.org/3.6/c-api/file.html
-
- Sep 24, 2018
-
-
Matt Harbison authored
See also ac32685011a3.
-
- Sep 21, 2018
-
-
Matt Harbison authored
We need to avoid os.getcwdb() on Windows to avoid DeprecationWarnings, and we need encoding.strtolocal() to encode the result of os.getcwd().
-
- Sep 25, 2018
-
-
Augie Fackler authored
Caught by the ratchet, but initially only the non-legacy path of test-clone-uncompressed.t was passing. That required the preceding patch. Differential Revision: https://phab.mercurial-scm.org/D4729
-
Augie Fackler authored
In Python 3, HTTPResponse implements read() in terms of readinto(), which was calling back into our readinto(), which duplicates self._rbuf if it's not empty. Before calling into super's read(), ensure self._rbuf is empty. Inheritance is bad, and undocumented self-use of your public API is one of many reasons. Differential Revision: https://phab.mercurial-scm.org/D4728
-
- Sep 17, 2018
-
-
Gregory Szorc authored
For shallow clone, it is useful to specify a starting node and tell the server to send up to N ancestors from that starting point. This enables the server to perform the DAG walk without the client having to discover the base/stop node(s) first. This commit implements support for said queries on the changesetdata command. Differential Revision: https://phab.mercurial-scm.org/D4621
-
- Sep 20, 2018
-
-
Gregory Szorc authored
The *data wire protocol commands emit a series of CBOR values. Because revision/delta data may be large, their data is emitted outside the map as a top-level bytestring value. Before this commit, we'd emit a single optional bytestring value after the revision descriptor map. This got the job done. But it was limiting in that we could only send a single field. And, it required the consumer to know that the presence of a key in the map implied the existence of a following bytestring value. This commit changes the encoding strategy so top-level bytestring values in the stream are explicitly denoted in a "fieldsfollowing" key. This key contains an array defining what fields that follow and the expected size of each field. By defining things this way, we can easily send N bytestring values without any ambiguity about their order. In addition, clients only need to know how to parse ``fieldsfollowing`` to know if extra values are present. Because this breaks backwards compatibility, we've bumped the version number of the wire protocol version 2 API endpoint. Differential Revision: https://phab.mercurial-scm.org/D4620
-
- Sep 17, 2018
-
-
Gregory Szorc authored
changesetdata, manifestdata, and filedata all allow the caller to specify what data fields to request. Data fields are extensible and may evolve over time. In order to prevent clients from making requests for fields that are not available, the client needs to know what fields are available. This commit teaches the server to declare a set of "valid values" for wire protocol command arguments. That set of values is exposed in the command's capabilities descriptor. The changesetdata, manifestdata, and filedata commands all declare their set of available "fields." Differential Revision: https://phab.mercurial-scm.org/D4619
-
Gregory Szorc authored
Now that we internally store rich metadata about arguments, it makes sense to make that metadata available to the client. This will allow clients to validate outgoing command requests before they are sent over the wire. Strictly speaking, we should bump the wire protocol version for this change since it is backwards incompatible. But no client-side code touches the arguments map and I don't want to incur the work. Differential Revision: https://phab.mercurial-scm.org/D4618
-
Gregory Szorc authored
While the wire protocol doesn't yet support it, we'll eventually have commands that accept narrow patterns to specify the set of files relevant to a command. For security and performance reasons, only specific filter types are allowed. This commit teaches the server to advertise the set of allowed filter types. By doing so, clients can e.g. validate user-specified patterns against the server's abilities without having to send a command to retrieve data. Having the data in the capabilities data structure will also serve as a check against unwanted BC. Differential Revision: https://phab.mercurial-scm.org/D4616
-
- Aug 31, 2018
-
-
Gregory Szorc authored
Previously, we declared command arguments with an example of their value. After this commit, we declare command arguments as a dict of metadata. This allows us to define the value type, whether the argument is required, and provide default values. This in turn allows us to have nice things, such as less boilerplate code in individual commands for validating input and assigning default values. It should also make command behavior more consistent as a result. Test output changed slightly because I realized that the "fields" argument wasn't being consistently defined as a set. Oops! Other test output changed because of slight differences in code performing type validation. Differential Revision: https://phab.mercurial-scm.org/D4615
-
- Sep 25, 2018
-
-
Valentin Gatien-Baron authored
Differential Revision: https://phab.mercurial-scm.org/D4742
-
Valentin Gatien-Baron authored
The second-to-last one shows the same bug as commonancestors(..): the result should be 8, not 9. Differential Revision: https://phab.mercurial-scm.org/D4741
-
Valentin Gatien-Baron authored
The new version seems a bit more consistent with other doc comments, and feels clearer to me (doesn't explain "commonancestors(set)" as "common ancestors of set"). Differential Revision: https://phab.mercurial-scm.org/D4740
-
Valentin Gatien-Baron authored
The reason is that: - it shows up in "hg help revset", but it doesn't look like documentation targeted at users - it doesn't make sense to me: it doesn't say what happens with < 2 revisions, and is not quite right because my understanding is that this revset was created precisely because "::x and ::y" was not quite the same (when x and y don't evaluate to singletons). Differential Revision: https://phab.mercurial-scm.org/D4739
-
Valentin Gatien-Baron authored
Differential Revision: https://phab.mercurial-scm.org/D4738
-
Valentin Gatien-Baron authored
Specifically, 9 is clearly not in "::8 and ::9". Differential Revision: https://phab.mercurial-scm.org/D4737
-
Valentin Gatien-Baron authored
The problem is that hg log -r 'head()' is every changeset in the repository, because in this test repository, every changeset has a different branch. The author probably assumed all commits were on the default branch, and that they were getting topological heads, 7 and 9. As a result, this test was showing that the common ancestors of 0:9 are 0+1+2+4, which is not correct (next commit will test this). Differential Revision: https://phab.mercurial-scm.org/D4736
-
- Sep 15, 2018
-
-
Yuya Nishihara authored
This is a part of the unification series. The 'ff..' hash is preferred over None as it is a valid revision specifier. https://www.mercurial-scm.org/wiki/GenericTemplatingPlan#Sanity_check_output
-
Yuya Nishihara authored
In short, this patch moves h[:12] from hexfn() to formathex() so that formathex() can test if h is the wdirhex or not. This helps switching the wdir value to wdirrev/wdirhex. See the next patch.
-
Yuya Nishihara authored
While we'll never support such identifiers to look up the manifest, this behavior seems more consistent.
-
Yuya Nishihara authored
This matches the behavior of the default template keywords. wdir() support is still experimental so we can change the output.
-
- Sep 23, 2018
-
-
Yuya Nishihara authored
I left some of ctx.node() calls unchanged as they seemed unlikely to be workingctx, or passed to diff functions where None is the default value. Note that a None revision can also cause a similar problem, but I'm not sure if we can simply bulk-replace ctx.rev() with scmutil.intrev(ctx) as there's large hole between tip revision and wdir revision. If such pair were passed in to xrange() for example, we would waste CPU time.
-