Skip to content
Snippets Groups Projects
  1. Mar 19, 2019
  2. Mar 16, 2019
    • Matt Harbison's avatar
      record: prevent commits that don't pick up dirty subrepo changes (issue6102) · 4ea21df312ec
      Matt Harbison authored
      This path covers interactive mode for commit, amend, and shelve, as well as the
      deprecated record extension.  Since shelf creation uses commit without -S in the
      non-interactive case, aborting here should be OK.  (I didn't check what happens
      to non interactive shelve creation if `ui.commitsubrepos=True` is set.)
      
      subrepoutil.precommit() will abort on a dirty subrepo if the config option isn't
      set, but the hint recommends using --subrepos to commit.  Since only the commit
      command currently supports that option, the error has to be raised here to omit
      the hint.
      
      Doing the check before asking about all of the hunks in the MQ test seems like
      an improvement on its own.  There's probably an additional check on this path
      that can be removed.
      4.9.1
      4ea21df312ec
  3. Mar 17, 2019
  4. Feb 23, 2019
  5. Feb 24, 2019
    • Pierre-Yves David's avatar
      test: stabilize bundle generation for test-sparse-revlog.t · b59676077654
      Pierre-Yves David authored
      To reduce the instability in the bundle binary content, we force it to contains
      delta against p1 in all cases.
      
      In the previous changeset, we already stabilized the processing of the bundle.
      So we don't see any output change in the test itself.
      b59676077654
    • Pierre-Yves David's avatar
      test: don't trust delta bases from the bundle in test-sparse-revlog.t · c59987ab96b4
      Pierre-Yves David authored
      The point of the test is to check the strategy sparse-revlog uses to pick delta
      base. If we trust the bases used in the bundle, we no longer fully test this
      logic.
      
      In order to force this computation we have to use the side effect of a legacy
      format configuration `format.generaldelta`.  The lack of a more official way to
      do so will be fixed in a later changeset.
      c59987ab96b4
    • Pierre-Yves David's avatar
      test: update test-sparse-revlog.t output · 2e92624c3613
      Pierre-Yves David authored
      This test is skipped unless a large artefact is pre-build. It seems like nobody
      ran it in a while. Changeset 3764330f76a6 changed the expected output but
      nobody noticed.
      
      This changeset focus on the first and simpler step: putting the expected output
      back to what one would get by running this test.
      
      However this test changes highlight a couple of deeper issues:
      
      1) Even if the revision content did not changed, a change in the delta
      contained in the bundle affected the delta stored in the final revlog, changing
      the test result. Since we are testing the delta computation strategy with
      sparse, we should not blindly reuse the delta-base from the bundled delta.
      
      2) A change in the format of the repository used to generate the bundle changed
      the delta stored in the bundle. We should get a more stable output to avoid
      future instabilities of this test.
      
      3) The test is it not run by CI or developer.
      
      We'll try to address all this issues in the coming changesets.
      2e92624c3613
  6. Feb 21, 2019
  7. Feb 07, 2019
  8. Feb 06, 2019
    • Matt Harbison's avatar
      subrepo: avoid false unsafe path detection on Windows · 87a6e3c953e0
      Matt Harbison authored
      Subrepo paths are not normalized for the OS, so what was happening in the
      subsequent root path check was:
      
          root                  -> $TESTTMP\issue1852a\sub/repo
          util.expandpath(...)  -> $TESTTMP\issue1852a\sub/repo
          os.path.realpath(...) -> $TESTTMP\issue1852a\sub\repo
      87a6e3c953e0
  9. Feb 01, 2019
  10. Jan 08, 2019
    • Yuya Nishihara's avatar
      subrepo: reject potentially unsafe subrepo paths (BC) (SEC) · 83377b4b4ae0
      Yuya Nishihara authored
      In addition to the previous patch, this prohibits '~', '$nonexistent', etc.
      for any subrepo types. I think this is safer, and real-world subrepos wouldn't
      use such (local) paths.
      4.9
      83377b4b4ae0
    • Yuya Nishihara's avatar
      subrepo: prohibit variable expansion on creation of hg subrepo (SEC) · 6c10eba6b9cd
      Yuya Nishihara authored
      It's probably wrong to expand path at localrepo.*repository() layer, but
      fixing the layering issue would require careful inspection of call paths.
      So, this patch adds add a validation to the subrepo constructor.
      
      os.path.realpath(util.expandpath(root)) is what vfsmod.vfs() would do.
      6c10eba6b9cd
    • Yuya Nishihara's avatar
      subrepo: extend path auditing test to include more weird patterns (SEC) · 31286c9282df
      Yuya Nishihara authored
      While reviewing patches for the issue 5739, "$foo in repository path
      expanded", I realized that subrepo paths can also be cheated. This patch
      includes various subrepo paths which are potentially unsafe.
      
      Since an expanded subrepo path isn't audited, this bug allows symlink check
      bypass. As a result, a malicious subrepository could be checked out to a
      sub tree of e.g. $HOME directory. The good news is that the destination
      directory must be empty or nonexistent, so the existing ~/.bashrc wouldn't
      be overwritten. See the last part of the tests for details.
      31286c9282df
  11. Jan 31, 2019
  12. Jan 24, 2019
    • Boris Feld's avatar
      revlog: make sure we never use sparserevlog without general delta (issue6056) · 189e06b2d719
      Boris Feld authored
      We are getting user report where the delta code tries to use `sparse-revlog`
      logic on repository where `generaldelta` is disabled. This can't work so we
      ensure the two booleans have a consistent value.
      
      Creating this kind of repository is not expected to be possible the current bug
      report point at a clonebundle related bug that is still to be properly isolated
      (Yuya Nishihara seems to a have done it).
      
      Corrupting a repository to reproduce the issue is possible. A test using this
      method is included in this fix.
      189e06b2d719
  13. Jan 30, 2019
  14. Jan 23, 2019
  15. Jan 24, 2019
  16. Nov 28, 2018
    • Yuya Nishihara's avatar
      ui: optimize buffered write with no label · ff927ecb12f9
      Yuya Nishihara authored
      This was spotted while making fastannotate faster again after ditching its
      own formatter. Since I'm going to inline _write() into ui.write(), I decided
      to include this patch in this series.
      
      Here, the cost of '(self.label(a, label) for a in args)' was significant
      in hot loops.
      ff927ecb12f9
  17. Jan 23, 2019
    • Boris Feld's avatar
      partialdiscovery: avoid `undecided` related computation sooner than necessary · 76873548b051
      Boris Feld authored
      Changeset 1d30be90c9dc move the update of the `undecided` set within the
      `partialdiscovery` object in order to clarify the API.
      
      The update to the `undecided` set was unconditional in 1d30be90c9dc and the first
      access to the `self.undecided` property triggered the initial computation of
      the set of undecided revisions. As a result, the set was computed much
      earlier, at a time where less information is available, immediately followed
      by an update of this set to remove common revisions.
      
      To fix this regression, we ignore the `undecided` related logic in
      `addcommons` when that `undecided` set has not been computed yet. Code that
      actually needs to know the `undecided` set will trigger its computation later.
      The change has no effects on semantic because the initial computation
      `undecided` set takes all knowns `common` into account.
      
      Example performance running `hg debugdiscovery` from a pypy repo missing 10
      changesets:
      
      870a89c6909d: 52.3ms (regression parent)
      1d30be90c9dc: 72.0ms (regression)
      5a5f504a7175: 64.8ms (this fix parent)
      this fix:     52.6ms
      76873548b051
  18. Jan 21, 2019
    • Yuya Nishihara's avatar
      revlog: fix resolution of revlog version 0 · c953c2a94d68
      Yuya Nishihara authored
      This partially backs out cecf3f8bccd3, "revlog: always process opener options."
      
      My understanding is that if there's no "revlog1" nor "revlog2" in .hg/requires,
      the repository should stick to the v0 format. The reasoning is briefly
      described in 31a5973fcf96, "revlog: get rid of defversion."
      
      Maybe we can drop support for missing opener options, but I didn't do that
      in this patch.
      c953c2a94d68
  19. Jan 20, 2019
  20. Jan 19, 2019
    • Martin von Zweigbergk's avatar
      narrow: fix crash when restoring backup in legacy repo · 88a7c211b21e
      Martin von Zweigbergk authored
      Using --addremove when committing in an old repo (before we started
      keeping .hg/narrowspec.dirstate) results in a crash. The test
      case modified in this patch would crash like this:
      
        abort: $ENOENT$
      
      The issue is that when the dirstateguard is aborted, it tries to
      restore the backup of .hg/narrowspec.dirstate. However, since we were
      in an old repo, that file did not get created when the dirstateguard
      was created. Note that the dirstateguard is not used unless
      --addremove is passed.
      
      This patch fixes the bug by making restorewcbackup() not fail if the
      backup doesn't exist. I also made clearwcbackup() safe, just in case.
      
      Differential Revision: https://phab.mercurial-scm.org/D5634
      88a7c211b21e
  21. Jan 18, 2019
  22. Jan 19, 2019
Loading