Skip to content
Snippets Groups Projects
  1. Mar 31, 2018
    • Matt Harbison's avatar
      lfs: add an experimental knob to disable blob serving · dfb38c48
      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.
      dfb38c48
    • Connor Sheehan's avatar
      stringutil: edit comment to reflect actual data type name · 2ed18011
      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
      2ed18011
    • Connor Sheehan's avatar
      stringutil: improve check for failed mailmap line parsing · 0e7550b0
      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
      0e7550b0
    • Connor Sheehan's avatar
      stringutil: rename local email/names variables to their plural forms · 54b896f1
      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
      54b896f1
    • Connor Sheehan's avatar
  2. Feb 25, 2018
  3. Feb 26, 2018
    • Matt Harbison's avatar
      lfs: improve the client message when the server signals an object error · 67db8484
      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.
      67db8484
  4. Mar 31, 2018
  5. Mar 18, 2018
  6. Mar 20, 2018
  7. Mar 18, 2018
  8. Mar 19, 2018
  9. Mar 25, 2018
  10. Mar 31, 2018
  11. Mar 28, 2018
  12. Mar 31, 2018
  13. Mar 28, 2018
    • Matt Harbison's avatar
      server: add an error feedback mechanism for when the daemon fails to launch · f09a2eab
      Matt Harbison authored
      There's a recurring problem on Windows where `hg serve -d` will randomly fail to
      spawn a detached process.  The reason for the failure is completely hidden, and
      it takes hours to get a single failure on my laptop.  All this does is redirect
      stdout/stderr of the child to a file until the lock file is freed, and then the
      parent dumps it out if it fails to spawn.
      
      I chose to put the output into the lock file because that is always cleaned up.
      There's no way to report errors after that anyway.  On Windows, killdaemons.py
      is roughly `kill -9`, so this ensures that junk won't pile up.
      
      This may end up being a case of EADDRINUSE.  At least that's what I saw spit out
      a few times (among other odd errors and missing output on Windows).  But I also
      managed to get the same thing on Fedora 26 by running test-hgwebdir.t with
      --loop -j10 for several hours.  Running `netstat` immediately after killing that
      run printed a wall of sockets in the TIME_WAIT state, which were gone a couple
      seconds later.  I couldn't match up ports that failed, because --loop doesn't
      print out the message about the port that was used.  So maybe the fix is to
      rotate the use of HGPORT[12] in the tests.  But, let's collect some more data
      first.
      f09a2eab
  14. Mar 31, 2018
  15. Mar 19, 2018
    • Connor Sheehan's avatar
      templatefuncs: add mailmap template function · 2a2ce93e
      Connor Sheehan authored
      This commit adds a template function to support the .mailmap file
      in Mercurial repositories. The .mailmap file comes from git, and
      can be used to map new emails and names for old commits. The general
      use case is that someone may change their name or author commits
      under different emails and aliases, which would make these
      commits appear as though they came from different persons. The
      file allows you to specify the correct name that should be used
      in place of the author field specified in the commit.
      
      The mailmap file has 4 possible formats used to map old "commit"
      names to new "proper" names:
      
      1. <proper@email.com> <commit@email.com>
      2. Proper Name <commit@email.com>
      3. Proper Name <proper@email.com> <commit@email.com>
      4. Proper Name <proper@email.com> Commit Name <commit@email.com>
      
      Essentially there is a commit email present in each mailmap entry,
      that maps to either an updated name, email, or both. The final
      possible format allows commits authored by a person who used
      both an old name and an old email to map to a new name and email.
      
      To parse the file, we split by spaces and build a name out
      of every element that does not start with "<". Once we find an element
      that does start with "<" we concatenate all the name elements that preceded
      and add that as a parsed name. We then add the email as the first
      parsed email. We repeat the process until the end of the line, or
      a comment is found. We will be left with all parsed names in a list,
      and all parsed emails in a list, with the 0 index being the proper
      values and the 1 index being the commit values (if they were specified
      in the entry).
      
      The commit values are added as the keys to a dict, and with the proper
      fields as the values. The mapname function takes the mapping object and
      the commit author field and attempts to look for a corresponding entry.
      To do so we try (commit name, commit email) first, and if no results are
      returned then (None, commit email) is also looked up. This is due to
      format 4 from above, where someone may have a mailmap entry with both
      name and email, and if they don't it is possible they have an entry that
      uses only the commit email.
      
      Differential Revision: https://phab.mercurial-scm.org/D2904
      2a2ce93e
  16. Mar 30, 2018
Loading