Martin von Zweigbergk <martinvonz@google.com> [Sat, 31 Mar 2018 23:37:25 -0700] rev 37251
scmutil: introduce deprecated alias for revpair()
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 <matt_harbison@yahoo.com> [Sat, 31 Mar 2018 23:58:08 -0400] rev 37250
lfs: ensure the transfer request is for a known URI
Since the dispatching code only checks the beginning of the string, this
enforces that there's only one more path component.
Matt Harbison <matt_harbison@yahoo.com> [Sat, 31 Mar 2018 23:47:56 -0400] rev 37249
lfs: avoid an improper usage of os.path.basename() to parse a URI
Matt Harbison <matt_harbison@yahoo.com> [Sat, 31 Mar 2018 15:20:43 -0400] rev 37248
lfs: add an experimental knob to disable blob serving
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 <sheehan@mozilla.com> [Sat, 31 Mar 2018 13:01:20 -0400] rev 37247
stringutil: edit comment to reflect actual data type name
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 <sheehan@mozilla.com> [Sat, 31 Mar 2018 11:36:55 -0400] rev 37246
stringutil: improve check for failed mailmap line parsing
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 <sheehan@mozilla.com> [Sat, 31 Mar 2018 10:21:39 -0400] rev 37245
stringutil: rename local email/names variables to their plural forms
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 <sheehan@mozilla.com> [Sat, 31 Mar 2018 10:13:42 -0400] rev 37244
templatefuncs: remove redundant "or author" from mailmap return statement
Differential Revision: https://phab.mercurial-scm.org/D3001