1. 28 Dec, 2019 1 commit
  2. 13 Jan, 2020 1 commit
  3. 27 Dec, 2019 1 commit
    • graftcopies: use _filter() for filtering out invalid copies · 3df0bd706c4
      `graftcopies()` (formerly called `duplicatecopies()`) checked that the
      copy destination existed in the working copy, but it didn't check that
      copy source existed in the parent of the working copy. In
      `test-graft.t` we can see that as warnings about not finding ancestors
      of the copied files, and also empty commits getting created.
      This patch uses the existing `_filter()` function for filtering out
      invalid copies. In addition to the aforementioned types, that also
      includes copies where source and destination is the same.
      Differential Revision: https://phab.mercurial-scm.org/D7859
      Martin von Zweigbergk authored
  4. 15 Jan, 2020 2 commits
    • sha1dc: use buffer protocol when parsing arguments · dc9b5348268
      Without this, functions won't accept bytearray, memoryview,
      or other types that can be exposed as bytes to the C API.
      The most resilient way to obtain a bytes-like object from
      the C API is using the Py_buffer interface.
      This commit converts use of s#/y# to s*/y* and uses
      Py_buffer for accessing the underlying bytes array.
      I checked how hashlib is implemented in CPython and the
      the implementation agrees with its use of the Py_buffer
      interface as well as using BufferError in cases of bad
      buffer types. Sadly, there's no good way to test for
      ndim > 1 without writing our own C-backed Python type.
      Differential Revision: https://phab.mercurial-scm.org/D7879
      Gregory Szorc authored
    • lfs: check content length after downloading content · 0ee0a3f6a99
      Adapted from the Facebook repo[1].  The intent is to distinguish between the
      connection dying and getting served a corrupt blob.
      The original message:
      HTTP makes no provision to tell your client that you failed halfway through
      producing your response and won't have the answer they're looking for. So, if a
      LFS server fails while producing a response, then we'll report an OID mismatch.
      We can do a little better and disambiguate between "the server sent us the
      wrong blob" (very scary) and "the server crashed" (merely annoying) by looking
      at the content length of the response we got back. If it's not what was
      advertised, we can reasonably safely assume the server crashed.
      [1] https://github.com/facebookexperimental/eden/commit/2a4a6fab4e882ed89b948bfc1e7d56d7c3c99dd2
      Differential Revision: https://phab.mercurial-scm.org/D7881
      Matt Harbison authored
  5. 23 Dec, 2019 2 commits
    • verify: allow the storage to signal when renames can be tested on `skipread` · b9e174d4ed1
      This applies the new marker in the lfs handler to show it in action, and adds
      the test mentioned at the beginning of the series to show that fulltext isn't
      necessary in the LFS case.
      The existing `skipread` isn't enough, because it is also set if an error occurs
      reading the revlog data, or the data is censored.  It could probably be cleared,
      but then it technically violates the interface contract.  That wouldn't matter
      for the existing verify algorithm, but it isn't clear how that will change as
      alternate storage support is added.
      The flag is probably pretty revlog specific, given the comments in verify.py.
      But there's already filelog specific stuff in there and I'm not sure what future
      storage will bring, so I don't want to over-engineer this.  Likewise, I'm not
      sure that we want the verify method for each storage type to completely drive
      the bus when it comes to detecting renames, so I don't want to go down the
      rabbithole of having verifyintegrity() return metadata hints at this point.
      Differential Revision: https://phab.mercurial-scm.org/D7713
      Matt Harbison authored
    • lfs: don't skip locally available blobs when verifying · 1a6dd50cd0d
      The `skipflags` config was introduced in a2ab9ebcd85b, which specifically calls
      out downloading and storing all blobs as potentially too expensive.  But I don't
      see any reason to skip blobs that are already available locally.  Hashing the
      blob is the only way to indirectly verify the rawdata content stored in the
      (The note in that commit about skipping renamed is still correct, but the reason
      given about needing fulltext isn't.)
      Differential Revision: https://phab.mercurial-scm.org/D7712
      Matt Harbison authored
  6. 20 Dec, 2019 1 commit
  7. 08 Jan, 2020 1 commit
  8. 28 Dec, 2019 1 commit
    • tests: avoid grafting the same change over and over · f3ad014b6a5
      The test case added in a1381eea7c7d (graft: do not use `.remove` on a
      smart set (regression), 2014-04-28) added a test case that grafted the
      same change (renaming 'a' to 'b') three times over. It had description
      "graft works on complex revset", but AFACT, all that it cared about
      was that some ancestor of the working copy was in the set of revisions
      to graft. So this patch changes the test to do that instead.
      (I plan to later make it so that grafting these renames on top of each
      won't create the empty commits they currently create.)
      Differential Revision: https://phab.mercurial-scm.org/D7804
      Martin von Zweigbergk authored
  9. 27 Dec, 2019 2 commits
  10. 30 Dec, 2019 2 commits
  11. 24 Dec, 2019 1 commit
  12. 28 Dec, 2019 1 commit
  13. 08 Jan, 2020 1 commit
  14. 12 Dec, 2019 2 commits
  15. 07 Dec, 2019 1 commit
  16. 19 Dec, 2019 1 commit
  17. 03 Jan, 2020 1 commit
  18. 27 Dec, 2019 4 commits
  19. 26 Dec, 2019 1 commit
    • tests: convert the `root` arg of matchmod.match() to local path separators · 8f67735344a
      This fixes tests that broke with 8b1a9ba375e5, complaining that "X not under
      root /repo".  The vast majority of real uses are to pass `repo.root`, which is
      normalized by `wdirvfs.base` being set to the result of `os.path.realpath()`.
      Failure to convert looks like this:
        --- c:/Users/Matt/hg/tests/test-match.py.out
        +++ c:/Users/Matt/hg/tests/test-match.py.err
        @@ -0,0 +1,48 @@
        +ERROR: testVisitchildrensetGlob (__main__.IncludeMatcherTests)
        +Traceback (most recent call last):
        +  File "c:\Users\Matt\hg\tests\test-match.py", line 180, in testVisitchildrensetGlob
        +    m = matchmod.match(b'/repo', b'', include=[b'glob:dir/z*'])
        +  File "c:\Users\Matt\hg\mercurial\match.py", line 271, in match
        +    kindpats = normalize(include, b'glob', root, cwd, auditor, warn)
        +  File "c:\Users\Matt\hg\mercurial\match.py", line 322, in _donormalize
        +    pat = pathutil.canonpath(root, cwd, pat, auditor=auditor)
        +  File "c:\Users\Matt\hg\mercurial\pathutil.py", line 251, in canonpath
        +    _(b"%s not under root '%s'") % (myname, root), hint=hint
        +Abort: dir/z* not under root '/repo'
        +ERROR: testVisitdirGlob (__main__.IncludeMatcherTests)
      Differential Revision: https://phab.mercurial-scm.org/D7724
      Matt Harbison authored
  20. 18 Dec, 2019 1 commit
    • fix: fix handling of merge commits by using overlayworkingctx · eebdd670986
      Most of this code was conceptually copied from what rebase does, with one small
      difference: hgext.rebaserev.rebase uses branchmerge=True, while I had to use
      branchmerge=False, or else it got really confused about updating to the same
      revision in some situations. I believe that the difference is that rebase is
      always dealing with *some* form of update - it never gets to mergemod.update if
      the source and destination are the same, while we can encounter that situation
      with fix. This may imply that this code has some issues with named branches that
      should be investigated.
      Differential Revision: https://phab.mercurial-scm.org/D7703
      Kyle Lippincott authored
  21. 23 Dec, 2019 1 commit
    • rust-index: add a struct wrapping the C index · b69d5f3a41d
      Implementing the full index logic in one go is journey larger than we would
      To achieve a smoother transition, we start with a simple Rust wrapper that delegates
      allwork to the current C implementation. Once we will have a fully working index
      object in Rust, we can easily start using more and more Rust Code with it.
      The object in this patch is functional and tested. However, multiple of the
      currently existing rust (in the `hg-cpython` crate) requires a `Graph`. Right
      now we build this `Graph` (as cindex::Index) using the C index passed as
      a PyObject. They will have to be updated to be made compatible.
      Differential Revision: https://phab.mercurial-scm.org/D7655
      Georges Racinet authored
  22. 18 Dec, 2019 2 commits
  23. 13 Dec, 2019 1 commit
  24. 07 Dec, 2019 1 commit
  25. 20 Dec, 2019 1 commit
  26. 11 Dec, 2019 1 commit
  27. 19 Dec, 2019 2 commits
  28. 17 Dec, 2019 2 commits
  29. 18 Dec, 2019 1 commit