Skip to content
Snippets Groups Projects
  1. Apr 02, 2018
    • Gregory Szorc's avatar
      tests: don't use revlog paths in tests · 435481393198
      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
      435481393198
  2. Mar 17, 2018
  3. Mar 23, 2018
  4. Mar 18, 2018
  5. Mar 17, 2018
    • Yuya Nishihara's avatar
      templater: drop unneeded generator from mappable object · b4630e332a99
      Yuya Nishihara authored
      Per the definition of the show() interface, it can return a bytes.
      b4630e332a99
    • Yuya Nishihara's avatar
      templater: mark .gen as a private attribute · 8c84dc8264dc
      Yuya Nishihara authored
      8c84dc8264dc
    • Yuya Nishihara's avatar
      templatekw: do not directly call .gen · 45987e2b64f0
      Yuya Nishihara authored
      45987e2b64f0
    • Yuya Nishihara's avatar
      templater: define interface for objects requiring unwraphybrid() · 83e1bbd48991
      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)
      83e1bbd48991
    • Yuya Nishihara's avatar
      templater: pass (context, mapping) down to unwraphybrid() · 7d3bc1d4e871
      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.
      7d3bc1d4e871
  6. Apr 02, 2018
    • Martin von Zweigbergk's avatar
      scmutil: add method for looking up a context given a revision symbol · 0194dac77c93
      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
      0194dac77c93
  7. Apr 03, 2018
    • Martin von Zweigbergk's avatar
      narrow: add trailing slash to dir earlier for debug{revlog,index,data} · 6ff8bd691fb8
      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
      6ff8bd691fb8
  8. Mar 31, 2018
  9. Apr 03, 2018
  10. Apr 02, 2018
  11. Apr 01, 2018
  12. Mar 31, 2018
    • Matt Harbison's avatar
      lfs: add an experimental knob to disable blob serving · dfb38c4850a9
      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.
      dfb38c4850a9
    • Connor Sheehan's avatar
      stringutil: edit comment to reflect actual data type name · 2ed180117f76
      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
      2ed180117f76
    • Connor Sheehan's avatar
      stringutil: improve check for failed mailmap line parsing · 0e7550b0964c
      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
      0e7550b0964c
    • Connor Sheehan's avatar
      stringutil: rename local email/names variables to their plural forms · 54b896f195d1
      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
      54b896f195d1
    • Connor Sheehan's avatar
  13. Feb 25, 2018
  14. Feb 26, 2018
    • Matt Harbison's avatar
      lfs: improve the client message when the server signals an object error · 67db84842356
      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.
      67db84842356
  15. Mar 31, 2018
Loading