Skip to content
Snippets Groups Projects
  1. Apr 12, 2021
  2. Apr 06, 2021
  3. Mar 25, 2021
  4. Apr 06, 2021
    • Kyle Lippincott's avatar
      remotefilelog: include file contents in bundles produced during strip · 47a9527731c3
      Kyle Lippincott authored
      `hg strip` and other things that use repair.strip (such as the narrow
      extension's `hg tracked --removeinclude`) will "save" some commits that have a
      higher revision number than the oldest commit we're stripping, but aren't
      actually descended from any of the commits that we're stripping. It saves them
      in a bundle, and then reapplies them to the repo.
      
      Remotefilelog doesn't generally participate in strip, it doesn't contribute
      files to either the backup bundle or the "saved" bundle, and doesn't adjust
      linknodes when commits are stripped. This can break things like push, which
      rely on the linknodes.
      
      This change makes it so that remotefilelog includes files in these bundles
      during strip operations. During reapplication, the files are reapplied from the
      bundle, and the linknode is properly updated.
      
      Differential Revision: https://phab.mercurial-scm.org/D10320
      47a9527731c3
  5. Mar 30, 2021
    • Jörg Sonnenberger's avatar
      refactor: prefer checks against nullrev over nullid · 728d89f6f9b1
      Jörg Sonnenberger authored
      A common pattern is using a changeset context and obtaining the node to
      compare against nullid. Change this to obtain the nullrev instead. In
      the future, the nullid becomes a property of the repository and is no
      longer a global constant, so using nullrev is much easier to reason
      about. Python function call overhead makes the difference moot, but
      future changes will result in more dictionary lookups otherwise, so
      prefer the simpler pattern.
      
      Differential Revision: https://phab.mercurial-scm.org/D10290
      728d89f6f9b1
  6. Mar 28, 2021
  7. Mar 24, 2021
  8. Mar 23, 2021
    • Martin von Zweigbergk's avatar
      reabase: call rewriteutil.precheck() a bit later · 80cac9936324
      Martin von Zweigbergk authored
      We now filter out descendants of divergence-causing commits in
      `_handleskippingobsolete()`. The filtered-out commits are removed from
      the rebase set (`destmap` and `state`). We should therefore call
      `rewriteutil.precheck()` after `_handleskippingobsolete()`. This patch
      does that. It hasn't mattered so far because `rewriteutil.precheck()`
      doesn't yet check for divergence, but it will soon.
      
      This affects one test where we now fail because the user is trying to
      rebase an ancestor instead of failing because they tried to rebase a
      public commit. We have several similar tests just after, where we
      still fail because of the phase, so that seems fine. The difference in
      behavior also seems fine to me.
      
      Differential Revision: https://phab.mercurial-scm.org/D10258
      80cac9936324
    • Martin von Zweigbergk's avatar
      rebase: set `prepared = True` at very end of `_preparenewrebase()` · c2438f2f635c
      Martin von Zweigbergk authored
      Once we've set `rebaseruntime.prepared = True`, `rebaseruntime.repo`
      starts returning the unfiltered repo. That will make my next patch
      break, because that patch moves the call to `rewriteutil.precheck()`
      after the call to `_handleskippingobsolete()`, which current happens
      after `prepared = True`. We therefore need to prepare by moving
      `prepared = True` a bit later, after `_handleskippingobsolete()`. I
      don't think that matters for that call.
      
      Differential Revision: https://phab.mercurial-scm.org/D10257
      c2438f2f635c
  9. Mar 20, 2021
    • Martin von Zweigbergk's avatar
      rebase: filter out descendants of divergence-causing commits earlier · 535de0e34a79
      Martin von Zweigbergk authored
      `hg rebase` treats obsolete commits differently depending what has
      happened to the commit:
      
       1) Obsolete commit without non-obsolete successors: Skipped, and a
       note is printed ("it has no successor").
      
       2) Obsolete commit with a successor in the destination (ancestor of
       it): Skipped, and a note is printed ("already in destination").
      
       3) Obsolete commit with a successor in the rebase set: The commit and
       its descendants are skipped, and a note is printed ("not rebasing
       <commit> and its descendants as this would cause divergence"), unless
       `allowdivergence` config set.
      
       4) Obsolete commit with a successor elsewhere: Error ("this rebase
       will cause divergences"), unless `allowdivergence` config set.
      
      Before this patch, we did all those checks up front, except for (3),
      which was checked later. The later check consisted of two parts: 1)
      filtering out of descendants, and 2) conditionally printing message if
      the `allowdivergence` config was not set. This patch makes it so we do
      the filtering early.
      
      A consequence of filtering out divergence-causing commits earlier is
      that we rebase commits in slightly different order, which has some
      impact on tests.
      
      Differential Revision: https://phab.mercurial-scm.org/D10249
      535de0e34a79
  10. Mar 19, 2021
  11. Feb 13, 2021
  12. Mar 25, 2021
  13. Mar 19, 2021
  14. Jan 13, 2021
    • Jörg Sonnenberger's avatar
      node: introduce nodeconstants class · 6266d19556ad
      Jörg Sonnenberger authored
      In preparing for moving from SHA1 hashes to a modern hash function,
      place nullid and other constant magic vules in a class. Provide the
      active set of constants in the repository and push it down. Provide
      nullid directly in strategic places like the repository as it is
      accessed very often. This changeset introduces the API change, but not
      the mechanical replacement of the node.py attributes itself.
      
      Differential Revision: https://phab.mercurial-scm.org/D9750
      6266d19556ad
  15. Mar 12, 2021
    • Martin von Zweigbergk's avatar
      split: close transaction in the unlikely event of a conflict while rebasing · 7f6c002d7c0a
      Martin von Zweigbergk authored
      `hg split` *should* never result in conflicts, but in case there are
      bugs, we should at least commit the transaction so they can continue
      the rebase. One of our users ran into the regression fixed by
      D10120. They fixed the conflict and the tried to continue the rebase,
      but it failed with "abort: cannot continue inconsistent rebase"
      because the rebase state referred to commits written in a transaction
      that was never committed.
      
      Side note: `hg split` should probably turn off copy tracing to reduce
      the impact of such bugs, and to speed it up as well. Copies made in
      the rebased commits should still be respected because `hg rebase`
      calls `copies.graftcopies()`.
      
      Differential Revision: https://phab.mercurial-scm.org/D10164
      7f6c002d7c0a
  16. Mar 11, 2021
  17. Feb 19, 2021
  18. Feb 18, 2021
  19. Jan 18, 2021
    • Raphaël Gomès's avatar
      sidedata: move to new sidedata storage in revlogv2 · 3d740058b467
      Raphaël Gomès authored
      The current (experimental) sidedata system uses flagprocessors to signify the
      presence and store/retrieve sidedata from the raw revlog data. This proved to be
      quite fragile from an exchange perspective and a lot more complex than simply
      having a dedicated space in the new revlog format.
      
      This change does not handle exchange (ironically), so the test for amend - that
      uses a bundle - is broken. This functionality is split into the next patches.
      
      Differential Revision: https://phab.mercurial-scm.org/D9993
      3d740058b467
  20. Feb 13, 2021
  21. Mar 10, 2021
  22. Feb 15, 2021
  23. Mar 06, 2021
  24. Jan 30, 2021
  25. Feb 04, 2021
    • Kyle Lippincott's avatar
      revlog: add a mechanism to verify expected file position before appending · e9901d01d135
      Kyle Lippincott authored
      If someone uses `hg debuglocks`, or some non-hg process writes to the .hg
      directory without respecting the locks, or if the repo's on a networked
      filesystem, it's possible for the revlog code to write out corrupted data.
      
      The form of this corruption can vary depending on what data was written and how
      that happened. We are in the "networked filesystem" case (though I've had users
      also do this to themselves with the "`hg debuglocks`" scenario), and most often
      see this with the changelog. What ends up happening is we produce two items
      (let's call them rev1 and rev2) in the .i file that have the same linkrev,
      baserev, and offset into the .d file, while the data in the .d file is appended
      properly. rev2's compressed_size is accurate for rev2, but when we go to
      decompress the data in the .d file, we use the offset that's recorded in the
      index file, which is the same as rev1, and attempt to decompress
      rev2.compressed_size bytes of rev1's data. This usually does not succeed. :)
      
      When using inline data, this also fails, though I haven't investigated why too
      closely. This shows up as a "patch decode" error. I believe what's happening
      there is that we're basically ignoring the offset field, getting the data
      properly, but since baserev != rev, it thinks this is a delta based on rev
      (instead of a full text) and can't actually apply it as such.
      
      For now, I'm going to make this an optional component and default it to entirely
      off. I may increase the default severity of this in the future, once I've
      enabled it for my users and we gain more experience with it. Luckily, most of my
      users have a versioned filesystem and can roll back to before the corruption has
      been written, it's just a hassle to do so and not everyone knows how (so it's a
      support burden). Users on other filesystems will not have that luxury, and this
      can cause them to have a corrupted repository that they are unlikely to know how
      to resolve, and they'll see this as a data-loss event. Refusing to create the
      corruption is a much better user experience.
      
      This mechanism is not perfect. There may be false-negatives (racy writes that
      are not detected). There should not be any false-positives (non-racy writes that
      are detected as such). This is not a mechanism that makes putting a repo on a
      networked filesystem "safe" or "supported", just *less* likely to cause
      corruption.
      
      Differential Revision: https://phab.mercurial-scm.org/D9952
      e9901d01d135
  26. Feb 17, 2021
    • Simon Sapin's avatar
      blackbox: Remove misleading quotes in config example · 36f3a64846c8
      Simon Sapin authored
      This example previously looked like quotes were part of configuration file
      syntax, and the parsed `date-format` value was the part inside of them.
      This is not the case: config syntax only parses quotes in list values.
      Instead using that config would result in literal quotes being written to
      `.hg/blackbox.log` as part of the date format.
      
      This changes the example to what was probably intended.
      
      Differential Revision: https://phab.mercurial-scm.org/D10011
      36f3a64846c8
  27. Jan 27, 2021
  28. Feb 12, 2021
  29. Feb 03, 2021
    • Martin von Zweigbergk's avatar
      narrow: add --no-backup option for narrowing · 3c360ab2688d
      Martin von Zweigbergk authored
      Most of our users at Google use Mercurial on a file system that keeps
      backups of previous versions of all files, including those in
      `.hg/`. They therefore don't need a separate backup in the file system
      when narrowing their repo (which they typically do by running `hg
      tracked --auto-remove-includes`). Backups can be very slow. `hg strip`
      already has a `--no-backup` option. This patch adds the same option to
      `hg tracked --removeinclude/--addexclude`.
      
      Differential Revision: https://phab.mercurial-scm.org/D9951
      3c360ab2688d
  30. Feb 04, 2021
    • Jordi Gutiérrez Hermoso's avatar
      largefiles: properly pass kwargs into url.open · 32da58916fd0
      Jordi Gutiérrez Hermoso authored
      The url.open function has acquired a lot of kwargs over the years.
      When running `hg import http://example.com/hg/diff/1`, since at least
      a708e1e4d7a8 in March, 2018, the calling sites for url.open try to
      pass a `sendaccept` parameter that largefiles' override doesn't accept.
      
      Currently that stack traces something like this:
      
        Traceback (most recent call last):
          File "/tmp/hgtests.sv744r5t/install/bin/hg", line 59, in <module>
            dispatch.run()
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 143, in run
            status = dispatch(req)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 245, in dispatch
            status = _rundispatch(req)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 289, in _rundispatch
            ret = _runcatch(req) or 0
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 465, in _runcatch
            return _callcatch(ui, _runcatchfunc)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 475, in _callcatch
            return scmutil.callcatch(ui, func)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/scmutil.py", line 155, in callcatch
            return func()
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 455, in _runcatchfunc
            return _dispatch(req)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 1259, in _dispatch
            lui, repo, cmd, fullargs, ui, options, d, cmdpats, cmdoptions
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 913, in runcommand
            ret = _runcommand(ui, options, cmd, d)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 1270, in _runcommand
            return cmdfunc()
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/dispatch.py", line 1256, in <lambda>
            d = lambda: util.checksignature(func)(ui, *args, **strcmdopt)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/util.py", line 1867, in check
            return func(*args, **kwargs)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/commands.py", line 4184, in import_
            patchfile = hg.openpath(ui, patchurl, sendaccept=False)
          File "/tmp/hgtests.sv744r5t/install/lib/python/mercurial/hg.py", line 181, in openpath
            return url.open(ui, path, sendaccept=sendaccept)
        TypeError: openlargefile() got an unexpected keyword argument 'sendaccept'
      
      So, just accept and pass along any kwargs of the overridden function.
      32da58916fd0
  31. Jan 29, 2021
  32. Jan 30, 2021
Loading