- Apr 02, 2018
-
-
Gregory Szorc authored
Debug commands operating on revlogs don't need the full revlog path: they can accept the relative path to a tracked file or use -c/-m to specify a changelog or manifest. Not using the revlog path makes tests more resilient to cases where revlogs aren't being used for storage. Differential Revision: https://phab.mercurial-scm.org/D3025
-
- Mar 17, 2018
-
-
Yuya Nishihara authored
unwrapvalue() is changed to not return a lazy bytes generator for "wrapped" types because I want to define the tovalue() interface as such. It's a baby step to unify unwrapvalue() and _unwrapvalue().
-
- Mar 23, 2018
-
-
Yuya Nishihara authored
-
- Mar 18, 2018
-
-
Yuya Nishihara authored
The same reason as why I made unwraphybrid() take a (context, mapping) pair.
-
- Mar 17, 2018
-
-
Yuya Nishihara authored
Per the definition of the show() interface, it can return a bytes.
-
Yuya Nishihara authored
-
Yuya Nishihara authored
-
Yuya Nishihara authored
Prepares for introducing another hybrid-like data type. show() takes context as an argument so a wrapper class may render its items by pre-configured template: def show(self, context, mapping): return (context.expand(self._tmpl, mapping + lm) for lm in self._mappings)
-
Yuya Nishihara authored
See the subsequent patches for why. I initially thought it would be wrong to pass a mapping to flatten() and stringify() since these functions may be applied to a tree of generators, where each node should be bound to the mapping when it was evaluated. But, actually that isn't a problem. If an intermediate node has to override a mapping dict, it can do on unwraphybrid() and yield "unwrapped" generator of byte strings: "{f(g(v))}" # literal template example. ^^^^ # g() want to override a mapping, so it returns a wrapped # object 'G{V}' with partial mapping 'lm' attached. ^^^^^^^ # f() stringifies 'G{V}', starting from a mapping 'm'. # when unwrapping 'G{}', it updates 'm' with 'lm', and # passes it to 'V'. This structure is important for the formatter (and the hgweb) to build a static template keyword, which can't access a mapping dict until evaluation phase.
-
- Apr 02, 2018
-
-
Martin von Zweigbergk authored
changectx's constructor currently supports a mix if inputs: * integer revnums * binary nodeids * '.', 'tip', 'null' * stringified revnums * namespaced identifiers (e.g. bookmarks and tags) * hex nodeids * partial hex nodeids The first two are always internal [1]. The other five can be specified by the user. The third type ('.', 'tip', 'null') often comes from either the user or internal callers. We probably have some internal callers that pass hex nodeids too, perhaps even partial ones (histedit?). There are only a few callers that pass user-supplied strings: revsets.stringset, peer.lookup, webutil.changeidctx, and maybe one or two more. Supporting this mix of things in the constructor is convenient, but a bit strange, IMO. For example, if repo[node] is given a node that's not in the repo, it will first check if it's bookmark etc before raising an exception. Of course, the risk of it being a bookmark is extremely small, but it just feels ugly. Also, a problem with having this code in the constructor (whether it supports a mix of types or not) is that it's harder to override (I'd like to override it, and that's how this series started). This patch starts moving out the handling of user-supplied strings by introducing scmutil.revsymbol(). So far, that just checks that the input is indeed a string, and then delegates to repo[symbol]. The patch also calls it from revsets.stringset to prove that it works. [1] Well, you probably can enter a 20-byte binary nodeid on the command line, but I don't think we should care to preserve support for that. Differential Revision: https://phab.mercurial-scm.org/D3024
-
- Apr 03, 2018
-
-
Martin von Zweigbergk authored
The treemanifest code internally uses trailing slashes on directories (except for the root directory, which is an empty string). We should make sure we pass in directories with trailing slashes when we work with the treemanifest code. For some reason, I seem to have decided to be nice to the callers instead in 49c583ca48c4 (treemanifest: add --dir option to debug{revlog,data,index}, 2015-04-12). Let's fix that and pay the cost of fixing up the directory name close close to where we get it from the user. Differential Revision: https://phab.mercurial-scm.org/D3032
-
- Mar 31, 2018
-
-
Sushil Khanchi authored
Differential Revision: https://phab.mercurial-scm.org/D3000
-
- Apr 03, 2018
-
-
Sangeet Kumar Mishra authored
This is a follow up patch to https://phab.mercurial-scm.org/D2394 As suggested by Yuya, this patch makes the error message translatable Differential Revision: https://phab.mercurial-scm.org/D3031
-
- Apr 02, 2018
-
-
Martin von Zweigbergk authored
Since the previous commit, there seem to be no users who pass '' to repo.__getitem__, so let's drop support for it. It may seem like a small cost to keep support for it, but I've spent time being confused by it twice already. Differential Revision: https://phab.mercurial-scm.org/D3021
-
Martin von Zweigbergk authored
The "state" value (a revision) passed to abstractsubrepo.phase() can be '' to represent the currently checked out revisions. Let's convert that to the more common '.'. I think this is the last of use of repo['.'] in core. Differential Revision: https://phab.mercurial-scm.org/D3019
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3020
-
Martin von Zweigbergk authored
Not marked BC because I think support for using '' on the CLI was there by accident, and we don't seem to have documented it. Differential Revision: https://phab.mercurial-scm.org/D3018
-
Martin von Zweigbergk authored
We support e.g. parents(""), but I think that's by accident and I'll change it soon. Differential Revision: https://phab.mercurial-scm.org/D3017
-
Martin von Zweigbergk authored
It was a little tricky in hg.clone(), since there was a local "revs" variable defined there, but "rev" was never used after "revs", so I just overwrote it. Note that clonewithshare() should also have its "rev" argument renamed to "revs", but I'll leave that to someone else. Differential Revision: https://phab.mercurial-scm.org/D3016
-
- Apr 01, 2018
-
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3015
-
Yuya Nishihara authored
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3012
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3013
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3011
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3010
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3009
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3008
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3007
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D3006
-
Martin von Zweigbergk authored
revsingle() returns a context object, revpair() returns nodeids, revrange() returns integer revisions (in a revset). I'm going to reduce this inconsistency by making revpair() return context objects. Changing the return type is not nice to extensions, so this patch introduces a nodeid-returning version of revpair() that they can detect and use. Update callers to the new function so we can change revpair() itself and then migrate them back one by one. Differential Revision: https://phab.mercurial-scm.org/D3005
-
Matt Harbison authored
Since the dispatching code only checks the beginning of the string, this enforces that there's only one more path component.
-
Matt Harbison authored
-
- Mar 31, 2018
-
-
Matt Harbison authored
The use case here is the server admin may want to store the blobs elsewhere. As it stands now, the `lfs.url` config on the client side is all that enforces this (the web.allow-* permissions aren't able to block LFS blobs without also blocking normal hg traffic). The real solution to this is to implement the 'verify' action on the client and server, but that's not a near term goal. Whether this is useful in its own right, and should be promoted out of experimental at some point is TBD. Since the other two tests that deal with LFS and `hg serve` are already complex and have #testcases, this seems like a good time to start a new test dedicated to access checks against the server. Instead of conditionally wrapping the wire protocol handler, I put this in the handler because I'd still like to bring the annotations in from the evolve extension in order to set up the wrapping. The 400 status probably isn't great, but that's what it would be for existing `hg serve` instances without support for serving blobs.
-
Connor Sheehan authored
In development the data type used to hold an email/name pair was called a "mailmaptup" since it was implemented as a namedtuple. The implementation has since been changed to use an @attr.s decorated class named mailmapping. This commit changes a comment to reflect this change. Differential Revision: https://phab.mercurial-scm.org/D3004
-
Connor Sheehan authored
The existing check for a bad mailmap file entry fails with inputs like b'>@<'. This commit adds a function to check if a sufficient amount of information has been parsed from a mailmap file entry. At minimum, one email must be found (assumed to be the commit email). If email is not empty and no names are found, then there must be two emails. If there are at least one email and name, the mapping is valid. Differential Revision: https://phab.mercurial-scm.org/D3003
-
Connor Sheehan authored
email and name variables are renamed to emails and names (respectively). This is because the email variable name shadows the email function within the stringutil module. Since we are renaming email, we also rename name for consistency. Differential Revision: https://phab.mercurial-scm.org/D3002
-
Connor Sheehan authored
Differential Revision: https://phab.mercurial-scm.org/D3001
-
- Feb 25, 2018
-
- Feb 26, 2018
-
-
Matt Harbison authored
Two things here. First, the previous message included a snippet of JSON, which tends to be long (and in the case of lfs-test-server, has no error message). Instead, give a concise message where possible, and leave the JSON to a debug output. Second, the server can signal issues other than a missing individual file. This change shows a corrupt file, but I'm debating letting the corrupt file get downloaded, because 1) the error code doesn't really fit, and 2) having it locally makes forensics easier. Maybe need a config knob for that.
-
- Mar 31, 2018
-
-
Matt Harbison authored
Otherwise, this was flagging `... lfs.serve=False -R server ...` in the tests.
-