Skip to content
Snippets Groups Projects
  1. Dec 27, 2019
  2. Dec 26, 2019
    • Matt Harbison's avatar
      match: don't util.normpath() cwd · 8a81fa44f7bb
      Matt Harbison authored
      The problem here is that `util.normpath()` calls `util.pconvert()`, which
      switches to Unix style separators.  That results in two test failures like this
      since 5685ce2ea3bf:
      
          --- c:/Users/Matt/hg/tests/test-globalopts.t
          +++ c:/Users/Matt/hg/tests/test-globalopts.t.err
          @@ -89,7 +89,7 @@
             [255]
             $ hg -R b ann a/a
             abort: a/a not under root '$TESTTMP/b'
          -  (consider using '--cwd b')
          +  (consider using '--cwd ..\$TESTTMP\b')
             [255]
             $ hg log
             abort: no repository found in '$TESTTMP' (.hg not found)!
      
          ERROR: test-globalopts.t output changed
      
      Martin originally had `os.path.normpath()` (which *would* work here too), but
      changed it during review.  He didn't remember why he thought any form is needed
      here.  Most uses simply pass '' or `repo.getcwd()`, so these should generally be
      in local format anyway.  It seems better if `cwd` and `root` use consistent
      styles here.
      
      Differential Revision: https://phab.mercurial-scm.org/D7725
      8a81fa44f7bb
    • Matt Harbison's avatar
      tests: convert the `root` arg of matchmod.match() to local path separators · 8f67735344ae
      Matt Harbison authored
      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
      8f67735344ae
  3. Dec 27, 2019
  4. Dec 18, 2019
    • Kyle Lippincott's avatar
      fix: fix handling of merge commits by using overlayworkingctx · eebdd6709868
      Kyle Lippincott authored
      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
      eebdd6709868
  5. Dec 23, 2019
    • Georges Racinet's avatar
      rust-index: add a struct wrapping the C index · b69d5f3a41d0
      Georges Racinet authored
      Implementing the full index logic in one go is journey larger than we would
      like.
      
      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
      b69d5f3a41d0
  6. Dec 12, 2019
  7. Nov 27, 2019
    • Georges Racinet's avatar
      revlog: made C Capsule an array of function pointers · f384d68d8ea8
      Georges Racinet authored
      Although it's perfectly valid to put a function pointer in
      a capsule, as we've been doing since the start of rust/hg-cpython,
      an array of function pointers has several advantages:
      
      - it can hold several functions. That's our main motivation here.
        We plan to expose index_length() and index_node(), which will
        be needed for a Rust implementation of nodemap.
      - it could also have data
      - (probably minor in the case of Mercurial) proper support for
        architectures for which data and code pointers don't have the
        same size.
      
      Differential Revision: https://phab.mercurial-scm.org/D7543
      f384d68d8ea8
  8. Dec 23, 2019
  9. Dec 22, 2019
    • Matt Harbison's avatar
      revlog: split the content verification of a node into a separate method · 7c3118b9a9db
      Matt Harbison authored
      This will be used by LFS to tune what is skipped.
      
      In the future, this could also be used by LFS to indicate which nodes tagged
      with `skipread` are simply in need of a blob fetch, so that they can be done in
      a batch later.  (Currently, `skipread` also indicates censored data and errors.)
      Additionally, it could be used to cache the sha1 hash value for each blob so
      that large blobs don't need to be re-read and re-hashed if they are used by
      multiple nodes.
      
      Differential Revision: https://phab.mercurial-scm.org/D7710
      7c3118b9a9db
    • Matt Harbison's avatar
      verify: update comment to say that lfs doesn't need fulltext to check renames · a447efd991b9
      Matt Harbison authored
      The reason is that `filelog.renamed()` indirectly calls `filelog.revision()`,
      which is what accesses the full text.  However, LFS wraps `filelog.renamed()`
      and completely handles the case where an LFS blob is in play by using rawdata.
      
      I've got a test to demonstrate that this is the case, and prevent regressions.
      But the `skipread` flag is set on all lfs revisions when using `--no-lfs`,
      regardless of whether or not the blobs are local.  Just above this, that flag is
      consulted, causing the rename checks to be skipped.  That will need to be
      loosened up first.
      
      Differential Revision: https://phab.mercurial-scm.org/D7709
      a447efd991b9
  10. Dec 18, 2019
  11. Dec 13, 2019
  12. Dec 07, 2019
  13. Dec 20, 2019
    • Georges Racinet's avatar
      tests-pure: fixing test-parseindex2 · ac627ed8a911
      Georges Racinet authored
      This is a followup to D7603 (49fa0b31ee1d) which broke
      the tests for pure Python implementation. There are two
      divergences between pure and C implementations:
      
      - the pure implementation would accept only -1 as slice end,
        whereas C accepts both -1 and len(index)
      - in pure Python, `headrevs` is provided by revlog.py, not
        by the index.
      
      Differential Revision: https://phab.mercurial-scm.org/D7707
      ac627ed8a911
  14. Dec 13, 2019
    • Pierre-Yves David's avatar
      rust-index: add a function to convert PyObject index for hg-core · f98f0e3ddaa1
      Pierre-Yves David authored
      Function in hg-core need something implementing the `Graph` trait. Right now,
      the `hg-cpython` entry points directly turn the PyObject passed as argument
      into a `cindex::Index`. However, if we start having the option to use an Index
      in Rust, we need to dispatch between the different possible PyObject we could
      receive.
      
      So move the "duplicate" call into a unified function. When time come. It will be
      easy to update the logic of all interface when the time come.
      
      Differential Revision: https://phab.mercurial-scm.org/D7653
      f98f0e3ddaa1
  15. Dec 11, 2019
  16. Dec 18, 2019
  17. Dec 19, 2019
Loading