Skip to content
Snippets Groups Projects
  1. Mar 29, 2016
  2. Mar 23, 2016
  3. Mar 21, 2016
    • Mateusz Kwapich's avatar
      subrepo: set GIT_ALLOW_PROTOCOL to limit git clone protocols (SEC) · 34d43cb85de8
      Mateusz Kwapich authored
      CVE-2016-3068 (1/1)
      
      Git's git-remote-ext remote helper provides an ext:: URL scheme that
      allows running arbitrary shell commands. This feature allows
      implementing simple git smart transports with a single shell shell
      command. However, git submodules could clone arbitrary URLs specified
      in the .gitmodules file. This was reported as CVE-2015-7545 and fixed
      in git v2.6.1.
      
      However, if a user directly clones a malicious ext URL, the git client
      will still run arbitrary shell commands.
      
      Mercurial is similarly effected. Mercurial allows specifying git
      repositories as subrepositories. Git ext:: URLs can be specified as
      Mercurial subrepositories allowing arbitrary shell commands to be run
      on `hg clone ...`.
      
      
      The Mercurial community would like to thank Blake Burkhart for
      reporting this issue. The description of the issue is copied from
      Blake's report.
      
      This commit changes submodules to pass the GIT_ALLOW_PROTOCOL env
      variable to git commands  with the same list of allowed protocols that
      git submodule is using.
      
      When the GIT_ALLOW_PROTOCOL env variable is already set, we just pass it
      to git without modifications.
      34d43cb85de8
  4. Mar 17, 2016
  5. Mar 25, 2016
  6. Mar 24, 2016
    • Martin von Zweigbergk's avatar
      subrepo: adapt to git's recent renames-by-default · 7dab4caf11bc
      Martin von Zweigbergk authored
      Git turned on renames by default in commit 5404c11 (diff: activate
      diff.renames by default, 2016-02-25). The change is destined for
      release in git 2.8.0. The change breaks test-subrepo-git, which test
      specifically that a moved file is reported as a removal and an
      addition. Fix by passing --no-renames (available in git since mid
      2006) to the diff commands that don't use --quiet (should make no
      difference for those).
      7dab4caf11bc
  7. Mar 13, 2016
  8. Feb 04, 2016
    • Durham Goode's avatar
      obsolete: fix n^2 marker computation behavior · 48e1a641765d
      Durham Goode authored
      Previously, if you ran obsolete.createmarkers with a bunch of markers that did
      not have successors (like when you do a prune), it encountered a n^2 computation
      behavior because the loop would read the changelog (to get ctx.parents()), then
      add a marker, in a loop.  Adding a marker invalidated the computehidden cache,
      and reading the changelog recomputed it.
      
      This resulted in pruning 150 commits taking 150+ seconds in a large repo.
      
      The fix is to break the reading part of the loop to be separate from the writing
      part.
      48e1a641765d
  9. Mar 08, 2016
  10. Mar 09, 2016
    • Pierre-Yves David's avatar
      mq: restrict generated patch name to 75 characters (issue5117) · b1d35e2e1af6
      Pierre-Yves David authored
      Super long first line in description lead to very long file name that
      windows is unhappy about. We restrict the name to 75 char to avoid the
      issue.
      
      75 seems fine and leave some extra room for '__#' suffix in case of conflict.
      
      I does not seems worthwhile to add a dedicated config option to configure the
      length. It can be done in the future if there is an actual user demand for it.
      b1d35e2e1af6
  11. Mar 06, 2016
    • Matt Harbison's avatar
      files: don't recurse into subrepos without a path or -S (issue5127) · 97175d9bf7cf
      Matt Harbison authored
      The 'm.always()' check was needed for when a path to 'sub1' is given, and 'sub1'
      contains a subrepo itself.  But that also caused the automatic recursion when no
      path was given.  Instead, force -S when printing a subrepo if the subpath is an
      exact match (which will unconditionally recurse once in the nested subrepo).
      97175d9bf7cf
  12. Jan 26, 2016
  13. Mar 02, 2016
  14. Feb 28, 2016
    • Gregory Szorc's avatar
      hg: obtain lock when creating share from pooled repo (issue5104) · d493d64757eb
      Gregory Szorc authored
      There are race conditions between clients performing a shared clone
      to pooled storage:
      
      1) Clients race to create the new shared repo in the pool directory
      2) 1 client is seeding the repo in the pool directory and another goes
         to share it before it is fully cloned
      
      We prevent these race conditions by obtaining a lock in the pool
      directory that is derived from the name of the repo we will be
      accessing.
      
      To test this, a simple generic "lockdelay" extension has been added.
      The extension inserts an optional, configurable delay before or after
      lock acquisition. In the test, we delay 2 seconds after lock acquisition
      in the first process and 1 second before lock acquisition in the 2nd
      process. This means the first process has 1s to obtain the lock. There
      is a race condition here. If we encounter it in the wild, we could
      change the dummy extension to wait on the lock file to appear instead
      of relying on timing. But that's more complicated. Let's see what
      happens first.
      3.7.2
      d493d64757eb
  15. Feb 29, 2016
  16. Mar 01, 2016
  17. Feb 29, 2016
  18. Feb 15, 2016
    • Yuya Nishihara's avatar
      log: fix order of revisions filtered by multiple OR options (issue5100) · c407583cf5f6
      Yuya Nishihara authored
      This is the simplest workaround for the issue of the ordering of revset, which
      is that the expression "x or y" takes over the ordering specified by the input
      set (or the left-hand-side expression.) For example, the following expression
      
        A & (x | y)
      
      will be evaluated as if
      
        (A & x) | (A & y)
      
      That's wrong because revset has ordering. I'm going to fix this problem in
      the revset module, but that wouldn't fit to stable. So, this patch just works
      around the common log cases.
      
      Since this change might have some impact on performance, it is enabled only
      if the expression built from log options has ' or ' operation.
      c407583cf5f6
  19. Feb 26, 2016
    • Gregory Szorc's avatar
      demandimport: add _imp to ignore list · f5b2b358b8b7
      Gregory Szorc authored
      Mozilla is seeing an issue with demand importing of _imp
      failing in pkg_resources/__init__.py:fixup_namespace_packages.
      It strangely only reproduces when using a modern version of
      setuptools/pip in certain scenarios. Adding _imp to the demand import
      ignore list seems to make the problem go away.
      f5b2b358b8b7
  20. Feb 22, 2016
  21. Feb 23, 2016
    • Pierre-Yves David's avatar
      revert: properly revert to ancestor of p2 during merge (issue5052) · cb6a952efbf4
      Pierre-Yves David authored
      During merge, added (from one perspective) file can be reported as "modified".
      To work around that, revert was testing if modified file were present in the
      parent manifest and marking them as "added" in this case. However, we should be
      checking against the target revision manifest instead. Otherwise see file as
      "newly added" even if they exist in the target revision.
      
      That revert behavior regressed in 06fbd9518bc5.
      cb6a952efbf4
  22. Feb 01, 2016
  23. Feb 20, 2016
    • Rainer Woitok's avatar
      doc: correct example concerning "hg purge" alias in man page "hgrc.5" · 1bcb4f34b9f9
      Rainer Woitok authored
      The "hg purge" alias as currently described in "hgrc.5" only works, if
      the caller's current working directory is identical to the repository's
      root directory.
      
      This patch slightly modifies the example by adding an empty pattern as a
      file argument to the "hg status" command, thus forcing this command to
      list the affected files relative to the current directory.
      1bcb4f34b9f9
  24. Feb 19, 2016
  25. Feb 08, 2016
    • Katsunori FUJIWARA's avatar
      setup: avoid procedure related to hg.exe at setup.py --pure · 8da94662afe5
      Katsunori FUJIWARA authored
      Before this patch, "setup.py --pure" fails on Windows, because
      hgbuildscripts.run() tries to copy "hg.exe", which doesn't generated
      at "setup.py --pure".
      
      At that time, run_command('build_hgexe') invoked in
      hgbuildscripts.run() does nothing and returns successfully. Therefore,
      subsequent procedure assuming existence of "hg.exe" fails.
      
      This patch avoids procedure related to "hg.exe" (= all of
      hgbuildscripts.run() except for build_scripts.run() invocation) at
      "setup.py --pure".
      8da94662afe5
  26. Feb 05, 2016
  27. Feb 06, 2016
    • Yuya Nishihara's avatar
      ui: fix crash by non-interactive prompt echo for user name · 89003c49315c
      Yuya Nishihara authored
      Since we've dropped a str cast at write() by f04bd381e8c0, ui.prompt() should
      convert default to '' if it is None. Otherwise, write() would fail with
      "TypeError: object of type 'NoneType' has no len()".
      
      This patch includes the tests for both interactive and non-interactive cases
      because "ui.askusername" was never tested.
      89003c49315c
  28. Feb 10, 2016
    • Yuya Nishihara's avatar
      zeroconf: forward all arguments passed to ui.configitems() wrapper · 72f2a19c5f88
      Yuya Nishihara authored
      f43988e5954c added 'ignoresub' argument to ui.configitems(), but zeroconf
      wrapper wasn't updated. It caused the following crash:
      
        Traceback (most recent call last):
          File "bin/hg", line 43, in <module>
            mercurial.dispatch.run()
          File "lib/python/mercurial/dispatch.py", line 54, in run
            sys.exit((dispatch(request(sys.argv[1:])) or 0) & 255)
          File "lib/python/mercurial/dispatch.py", line 120, in dispatch
            ret = _runcatch(req)
          File "lib/python/mercurial/dispatch.py", line 191, in _runcatch
            return _dispatch(req)
          File "lib/python/mercurial/dispatch.py", line 924, in _dispatch
            cmdpats, cmdoptions)
          File "lib/python/mercurial/dispatch.py", line 681, in runcommand
            ret = _runcommand(ui, options, cmd, d)
          File "lib/python/mercurial/extensions.py", line 195, in closure
            return func(*(args + a), **kw)
          File "lib/python/hgext/zeroconf/__init__.py", line 180, in cleanupafterdispatch
            return orig(ui, options, cmd, cmdfunc)
          File "lib/python/mercurial/dispatch.py", line 1055, in _runcommand
            return checkargs()
          File "lib/python/mercurial/dispatch.py", line 1015, in checkargs
            return cmdfunc()
          File "lib/python/mercurial/dispatch.py", line 921, in <lambda>
            d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
          File "lib/python/mercurial/util.py", line 991, in check
            return func(*args, **kwargs)
          File "lib/python/mercurial/commands.py", line 5405, in paths
            pathitems = sorted(ui.paths.iteritems())
          File "lib/python/mercurial/util.py", line 723, in __get__
            result = self.func(obj)
          File "lib/python/mercurial/ui.py", line 619, in paths
            return paths(self)
          File "lib/python/mercurial/ui.py", line 1099, in __init__
            for name, loc in ui.configitems('paths', ignoresub=True):
          File "lib/python/mercurial/extensions.py", line 195, in closure
            return func(*(args + a), **kw)
        TypeError: configitems() got an unexpected keyword argument 'ignoresub'
      
      We have no test coverage for zeroconf, so I've added a minimal test that
      could reproduce this problem.
      72f2a19c5f88
  29. Feb 05, 2016
  30. Feb 02, 2016
    • Yuya Nishihara's avatar
      revset: flatten chained 'list' operations (aka function args) (issue5072) · b19d8d5d6b51
      Yuya Nishihara authored
      Internal _matchfiles() function can take bunch of arguments, which would
      lead to a maximum recursion depth error. This patch avoids the excessive
      stack use by flattening 'list' nodes beforehand.
      
      Since getlist() no longer takes a nested 'list' nodes, _parsealiasdecl()
      also needs to flatten argument list, "aliasname($1, $2, ...)".
      b19d8d5d6b51
Loading