Skip to content
Snippets Groups Projects
  1. Nov 07, 2017
  2. Nov 06, 2017
  3. Nov 05, 2017
    • Yuya Nishihara's avatar
      subrepo: disable git and svn subrepos by default (BC) (SEC) · 846942fd6d15
      Yuya Nishihara authored
      We have a security issue with git subrepos. I'm not sure if svn subrepo is
      vulnerable, but it seems not 100% safe to allow writing arbitrary data into
      a metadata directory. So for now, only hg subrepo is enabled by default.
      
      Maybe we should improve the help to describe why git/svn subrepos are
      disabled.
      846942fd6d15
    • Yuya Nishihara's avatar
      subrepo: extend config option to disable subrepos by type (SEC) · 828cf35f1de6
      Yuya Nishihara authored
      This allows us to minimize the behavior change introduced by the next patch.
      
      I have no idea which config style is preferred in UX POV, but I decided to
      get things done.
      
       a) list: 'allowed = hg, git, svn'
       b) sub option: 'allowed.hg = True' or 'allowed:hg = True'
       c) per-type action: 'hg = allow', 'git = abort'
      828cf35f1de6
    • Yuya Nishihara's avatar
      subrepo: add config option to reject any subrepo operations (SEC) · 5e27afeddaee
      Yuya Nishihara authored
      This is an alternative workaround for the issue5730.
      
      Perhaps this is the simplest way of disabling subrepo operations. It does
      nothing clever, but just aborts if Mercurial starts accessing to a subrepo.
      
      I think Greg's patch is more useful since it allows us to at least check
      out the parent repository. However, that would be confusing if the default
      is flipped to checkout=False and subrepos are silently ignored.
      
      I don't like the config name 'allowed', but I couldn't get any better name.
      5e27afeddaee
  4. Nov 03, 2017
  5. Nov 06, 2017
    • Gregory Szorc's avatar
      share: move config item declarations into core · 0f5521e56b77
      Gregory Szorc authored
      These config items control share behavior that is implemented in core.
      Since the functionality is implemented in core, extensions may
      leverage it.
      
      Mozilla has one such extension. And, it needs to access share.pool.
      Before this patch, a devel warning regarding accessing an unregistered
      config option would be issued unless the share extension were loaded.
      Moving the registration of the config options to core fixes this.
      0f5521e56b77
  6. Nov 05, 2017
  7. Nov 04, 2017
    • Matt Harbison's avatar
      pathutil: add doctests for canonpath() · 705d0f2bb677
      Matt Harbison authored
      This is a followup to f445b10dc7fb.  Since there's no way to ensure that more
      drive letters than C: exist, this seems like the only way to test it.  This is
      enough to catch the f445b10dc7fb scenario, as well as CWD outside of the repo
      when the path isn't prefixed with path/to/repo.
      705d0f2bb677
  8. Nov 03, 2017
    • Matt Harbison's avatar
      share: handle --relative shares to a different drive letter gracefully · b64ea7fb9599
      Matt Harbison authored
      This had the same problem as f445b10dc7fb.  Banning os.path.relpath() is
      tempting, but the hint it provides is useful here.
      b64ea7fb9599
    • Matt Harbison's avatar
      pathutil: use util.pathto() to calculate relative cwd in canonpath() · f445b10dc7fb
      Matt Harbison authored
      os.path.relpath() exploded if the 'root' and 'cwd' directories had different
      drive letters.  I noticed this in TortoiseHg when typing a fileset into the
      filter, and it kept complaining until the closing '()' was typed.  This was
      reproducible on the command line with:
      
        $ cd /d
        $ hg -R /c/Users/Matt/Projects/hg files 'set:e'
        Traceback (most recent call last):
        ...
        File "mercurial\pathutil.pyc", line 182, in canonpath
        File "ntpath.pyc", line 529, in relpath
        ValueError: path is on drive c:, start on drive d:
      f445b10dc7fb
  9. Nov 01, 2017
  10. Oct 31, 2017
    • Yuya Nishihara's avatar
      configitems: relax warning about unwanted default value · ff2110eadbfa
      Yuya Nishihara authored
      The original condition was a bit harsh for extension authors since third-party
      extensions need to preserve compatibility with older Mercurial versions, where
      no defaults would be loaded from the configtable. So let's silence the warning
      if the given default value matches, which should be harmless.
      ff2110eadbfa
  11. Oct 26, 2017
  12. Oct 31, 2017
  13. Oct 29, 2017
  14. Oct 28, 2017
  15. Oct 24, 2017
  16. Oct 20, 2017
  17. Oct 21, 2017
    • Matt Harbison's avatar
      tests: adjust hooks for Windows · aa05b95949fe
      Matt Harbison authored
      I'm not sure why these weren't working on Windows.  The failures were generally
      in the style of:
      
        -  remote: phase-move: cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b:  1 -> 0
        +  remote: "phase-move: $HG_NODE:  $HG_OLDPHASE -> $HG_PHASE"
      
      and
      
        -  abort: pretxnclose-bookmark.force-forward hook exited with status 1
        -  [255]
        +  abort: pretxnclose-bookmark.force-public hook exited with status 255
        +  [255]
      
      These failures originated in ee5f0d047b41::f6d17075608f.
      aa05b95949fe
    • Matt Harbison's avatar
      test-log-linerange: open binary file in binary mode · af924308110a
      Matt Harbison authored
      The '\n' characters were being translated on Windows, throwing off hg and git
      hashes, as well as the file content in the diff.
      af924308110a
  18. Oct 20, 2017
    • Matt Harbison's avatar
      test-arbitraryfilectx: stabilize for Windows · 9645c2a2bc2a
      Matt Harbison authored
      Previously, the second last test (context.arbitraryfilectx(..)) returned True on
      Windows.  I changed the repo setup sequence to import a patch, so that way the
      repo would have a proper symlink.  That made the last test fail, since it is
      comparing files in wdir(), one of which is not the expected symlink.
      
      Apparently the (feature !) line matching doesn't work well with (no-eol), so I
      had to conditionalize the test instead of the output.
      9645c2a2bc2a
  19. Oct 28, 2017
    • Durham Goode's avatar
      dirstate: remove excess attribute lookups for dirstate.status (issue5714) · ffeea2406276
      Durham Goode authored
      A recent refactor added a layer of abstraction to the dirstate which makes doing
      things like 'foo in dirstate' now require some extra Python attribute lookups.
      This is causing a 100ms slow down in hg status for mozilla-central.
      
      The fix is to hoist the inner dict's functions onto the main class once the lazy
      loading it complete, as well as store the actual functions before doing the
      status loop (as is done for other such functions).
      
      In my testing, it seems to address the performance regression, but we'll
      need to see the perf run results to know for sure.
      
      Differential Revision: https://phab.mercurial-scm.org/D1257
      ffeea2406276
  20. Oct 26, 2017
    • Durham Goode's avatar
      dirstate: avoid reading the map when possible (issue5713) (issue5717) · 6e66033f91cc
      Durham Goode authored
      Before the recent refactor, we would not load the entire map until it was
      accessed. As part of the refactor, that got lost and even just trying to load
      the dirstate parents would load the whole map. This caused a perf regression
      (issue5713) and a regression with static http serving (issue5717).
      
      Making it lazy loaded again fixes both.
      
      Differential Revision: https://phab.mercurial-scm.org/D1253
      6e66033f91cc
    • Durham Goode's avatar
      dirstate: move clear onto dirstatemap class · 0217f75b6e59
      Durham Goode authored
      A future diff will move the lazy loading aspect of dirstate to the dirstatemap
      class. This means it requires a slightly different strategy of clearing than
      just reinstantiating the object (since just reinstantiating the object will
      lazily load the on disk data again later instead of remaining permanently
      empty).
      
      So let's give it it's own clear function.
      
      Differential Revision: https://phab.mercurial-scm.org/D1252
      0217f75b6e59
  21. Oct 27, 2017
  22. Oct 28, 2017
Loading