Skip to content
Snippets Groups Projects
  1. May 27, 2015
    • Pierre-Yves David's avatar
      pull: only prefetch bookmarks when using bundle1 · 02defdb1
      Pierre-Yves David authored
      All bundle2 servers now support the 'listkeys' part(1), so we'll
      always be able to fetch bookmarks data at the same time as the
      changeset. This should be enough to avoid the one race condition that
      this bookmark prefetching is trying to work around. It even allows
      future server to make sure everything is generated from the same
      "transaction" if they become capable of such. The current code was
      already overwriting the prefetched value with the one in bundle2
      anyway.  Note that this is not preventing all race conditions in
      related to bookmark in 'hg pull' it makes nothing better and nothing
      worse.
      
      Reducing the number of listkeys calls will reduce the latency on pull.
      
      The pre-fetch is also moved into a discovery step because it seems to belong
      there.
      
      (1) Because all servers not speaking 'pushkey' parts are compatible with the
      'HG2X' protocol only.
      02defdb1
  2. May 28, 2015
  3. May 30, 2015
    • Yuya Nishihara's avatar
      hg: explicitly check that peer lookup object has instance() if call failed · 4cc3fb23
      Yuya Nishihara authored
      If a "thing" is callable but raises TypeError for some reason, a callable
      object would be returned. Thereafter, unfriendly traceback would be displayed:
      
        Traceback (most recent call last):
          ...
          File "mercurial/hg.pyc", line 119, in _peerorrepo
            obj = _peerlookup(path).instance(ui, path, create)
        AttributeError: 'function' object has no attribute 'instance'
      
      Instead, we should show the reason why "thing(path)" didn't work:
      
        Traceback (most recent call last):
          ...
          File "hggit/__init__.py", line 89, in _local
            p = urlcls(path).localpath()
        TypeError: 'NoneType' object is not callable
      
      If a "thing" is not callable, it must be a module or an object that implements
      instance(). If that module didn't have instance(), the error message would be
      "<unloaded module 'foo'> object is not callable". It doesn't make perfect sense,
      but it isn't so bad as it can blame which module went wrong.
      4cc3fb23
  4. Mar 30, 2015
  5. May 31, 2015
  6. May 27, 2015
    • Martin von Zweigbergk's avatar
      treemanifest: visit directory 'foo' when given e.g. '-X foo/ba?' · 20ad936a
      Martin von Zweigbergk authored
      For globs like 'foo/ba?', match._roots() will return 'foo'. Since
      visitdir(), excludes directories in the excluded roots, it would skip
      the entire foo directory. This is incorrect, since 'foo/ba?' doesn't
      mean that everything in foo/ should be exluded. Note that visitdir()
      is called only from the treemanifest class, so this only affects tree
      manifests. Fix by adding roots to the set of excluded roots only if
      there are no excluded patterns.
      
      Since 'glob' is the default pattern type for globs, we also need to
      update some -X patterns in the tests to be of 'path' type to take
      advantage of the visitdir tricks. For consistency, also update the -I
      patterns.
      
      It seems a little unfortunate that 'foo' in 'hg files -X foo' is
      considered a pattern because of the implied 'glob' type, but improving
      that is left for another day.
      20ad936a
  7. May 29, 2015
  8. May 27, 2015
    • Laurent Charignon's avatar
      record: add default value for operation argument · 724421cb
      Laurent Charignon authored
      This patch is part of a series of patches to change the recording ui to reflect
      the operation currently running (commit, shelve, revert ...).
      This patch adds the default value of the operation argument for record's
      standard and curses interface to match what is displayed in the interface
      as of today.
      724421cb
  9. May 28, 2015
  10. May 27, 2015
  11. May 29, 2015
    • Laurent Charignon's avatar
      revert: remove unused debug code in the test file · 48b1d894
      Laurent Charignon authored
      I left a test environment variable in a previous commit and it is doing nothing
      useful. This patch removes it.
      48b1d894
    • Ryan McElroy's avatar
      commands: rename current to active in variables and comments · 62da2d77
      Ryan McElroy authored
      Today, the terms 'active' and 'current' are interchangeably used throughout the
      codebase in reference to the active bookmark (the bookmark that will be updated
      with the next commit). This leads to confusion among developers and users.
      This patch is part of a series to standardize the usage to 'active' throughout
      the mercurial codebase and user interface.
      62da2d77
    • Ryan McElroy's avatar
      templatekw: introduce active subkeyword from bookmarks keyword · f26efa4f
      Ryan McElroy authored
      Today, the terms 'active' and 'current' are interchangeably used throughout the
      codebase in reference to the active bookmark (the bookmark that will be updated
      with the next commit). This leads to confusion among developers and users.
      This patch is part of a series to standardize the usage to 'active' throughout
      the mercurial codebase and user interface.
      f26efa4f
  12. Apr 16, 2015
    • Ryan McElroy's avatar
      bookmarks: name label for active bookmark correctly · ceec79b5
      Ryan McElroy authored
      Retain old label as well for backwards compatibility.
      
      Today, the terms 'active' and 'current' are interchangeably used throughout the
      codebase in reference to the active bookmark (the bookmark that will be updated
      with the next commit). This leads to confusion among developers and users.
      This patch is part of a series to standardize the usage to 'active' throughout
      the mercurial codebase and user interface.
      ceec79b5
  13. May 29, 2015
  14. May 17, 2015
    • Yuya Nishihara's avatar
      revset: add fast path for _list() of integer revisions · ceaf04bb
      Yuya Nishihara authored
      This can greatly speed up chained 'or' of integer revisions.
      
      1) reduce nesting of chained 'or' operations
      2) optimize to a list
      3) fast path for integer revisions (this patch)
      
      revset #0: 0 + 1 + 2 + ... + 1000
      1) wall 0.483341 comb 0.480000 user 0.480000 sys 0.000000 (best of 20)
      2) wall 0.025393 comb 0.020000 user 0.020000 sys 0.000000 (best of 107)
      3) wall 0.008371 comb 0.000000 user 0.000000 sys 0.000000 (best of 317)
      
      revset #1: sort(0 + 1 + 2 + ... + 1000)
      1) wall 0.035240 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
      2) wall 0.026432 comb 0.030000 user 0.030000 sys 0.000000 (best of 102)
      3) wall 0.008418 comb 0.000000 user 0.000000 sys 0.000000 (best of 322)
      
      revset #2: first(0 + 1 + 2 + ... + 1000)
      1) wall 0.028949 comb 0.030000 user 0.030000 sys 0.000000 (best of 100)
      2) wall 0.025503 comb 0.030000 user 0.030000 sys 0.000000 (best of 106)
      3) wall 0.008423 comb 0.010000 user 0.010000 sys 0.000000 (best of 319)
      
      But I admit that it is still slower than the spanset.
      
      revset #3: 0:1000
      3) wall 0.000132 comb 0.000000 user 0.000000 sys 0.000000 (best of 19010)
      ceaf04bb
    • Yuya Nishihara's avatar
      revset: optimize 'or' operation of trivial revisions to a list · 7fbef793
      Yuya Nishihara authored
      As seen in issue4565 and issue4624, GUI wrappers and automated scripts are
      likely to generate a long query that just has numeric revisions joined by 'or'.
      One reason why is that they allows users to choose arbitrary revisions from
      a list. Because this use case isn't handled well by smartset, let's optimize
      it to a plain old list.
      
      Benchmarks:
      
      1) reduce nesting of chained 'or' operations
      2) optimize to a list (this patch)
      
      revset #0: 0 + 1 + 2 + ... + 1000
      1) wall 0.483341 comb 0.480000 user 0.480000 sys 0.000000 (best of 20)
      2) wall 0.025393 comb 0.020000 user 0.020000 sys 0.000000 (best of 107)
      
      revset #1: sort(0 + 1 + 2 + ... + 1000)
      1) wall 0.035240 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
      2) wall 0.026432 comb 0.030000 user 0.030000 sys 0.000000 (best of 102)
      
      revset #2: first(0 + 1 + 2 + ... + 1000)
      1) wall 0.028949 comb 0.030000 user 0.030000 sys 0.000000 (best of 100)
      2) wall 0.025503 comb 0.030000 user 0.030000 sys 0.000000 (best of 106)
      7fbef793
  15. May 29, 2015
  16. May 24, 2015
  17. May 29, 2015
  18. May 27, 2015
  19. May 29, 2015
  20. May 28, 2015
    • Jordi Gutiérrez Hermoso's avatar
      dispatch: disable demandimport for the --debugger option · 101e8412
      Jordi Gutiérrez Hermoso authored
      Something in Python 2.7.9 or so broke the --debugger option with
      ui.debugger = ipdb. I get the traceback below. There is some apparent
      confusion with demandimport. This should be disabled anyway for the
      --debugger option. The debugger must be imported right away, before
      any other dispatch. There's no benefit in delaying the debugger
      import.
      
      This patch uses the demandimport.deactivated() context manager.
      
        Traceback (most recent call last):
          File "/usr/lib/python2.7/dist-packages/mercurial/dispatch.py", line 121, in _runcatch
            debugmod = __import__(debugger)
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 115, in _demandimport
            return _hgextimport(_import, name, globals, locals, fromlist, level)
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 47, in _hgextimport
            return importfunc(name, globals, *args)
          File "/usr/lib/python2.7/dist-packages/ipdb/__init__.py", line 16, in <module>
            from ipdb.__main__ import set_trace, post_mortem, pm, run, runcall, runeval, launch_ipdb_on_exception
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 134, in _demandimport
            mod = _hgextimport(_origimport, name, globals, locals)
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 47, in _hgextimport
            return importfunc(name, globals, *args)
          File "/usr/lib/python2.7/dist-packages/ipdb/__main__.py", line 29, in <module>
            if IPython.__version__ > '0.10.2':
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 106, in __getattribute__
            self._load()
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 78, in _load
            mod = _hgextimport(_import, head, globals, locals, None, level)
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 47, in _hgextimport
            return importfunc(name, globals, *args)
          File "/usr/lib/python2.7/dist-packages/IPython/__init__.py", line 45, in <module>
            from .config.loader import Config
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 132, in _demandimport
            return _origimport(name, globals, locals, fromlist, level)
          File "/usr/lib/python2.7/dist-packages/IPython/config/__init__.py", line 16, in <module>
            from .application import *
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 115, in _demandimport
            return _hgextimport(_import, name, globals, locals, fromlist, level)
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 47, in _hgextimport
            return importfunc(name, globals, *args)
          File "/usr/lib/python2.7/dist-packages/IPython/config/application.py", line 30, in <module>
            from IPython.external.decorator import decorator
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 134, in _demandimport
            mod = _hgextimport(_origimport, name, globals, locals)
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 47, in _hgextimport
            return importfunc(name, globals, *args)
          File "/usr/lib/python2.7/dist-packages/IPython/external/decorator/__init__.py", line 2, in <module>
            from decorator import *
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 115, in _demandimport
            return _hgextimport(_import, name, globals, locals, fromlist, level)
          File "/usr/lib/python2.7/dist-packages/mercurial/demandimport.py", line 47, in _hgextimport
            return importfunc(name, globals, *args)
          File "/usr/lib/python2.7/dist-packages/decorator.py", line 240, in <module>
            'ContextManager', (_GeneratorContextManager,), dict(__call__=__call__))
      101e8412
Loading