Skip to content
Snippets Groups Projects
  1. May 17, 2014
  2. May 27, 2014
  3. May 17, 2014
    • Yuya Nishihara's avatar
      alias: handle shlex error in command aliases · c5afb07c
      Yuya Nishihara authored
      No command should fail with ValueError just because there is unparseable
      alias definition.
      
      It returns 1 like other badalias handlers, but should be changed to 255 in
      a later version because we use 255 for general command error.
      c5afb07c
  4. May 08, 2014
    • Katsunori FUJIWARA's avatar
      subrepo: normalize path in the specific way for problematic encodings · 8dd17b19
      Katsunori FUJIWARA authored
      Before this patch, "reporelpath()" uses "rstrip(os.sep)" to trim
      "os.sep" at the end of "parent.root" path.
      
      But it doesn't work correctly with some problematic encodings on
      Windows, because some multi-byte characters in such encodings contain
      '\\' (0x5c) as the tail byte of them.
      
      In such cases, "reporelpath()" leaves unexpected '\\' at the beginning
      of the path returned to callers.
      
      "lcalrepository.root" seems not to have tail "os.sep", because it is
      always normalized by "os.path.realpath()" in "vfs.__init__()", but in
      fact it has tail "os.sep", if it is a root (of the drive): path
      normalization trims tail "os.sep" off "/foo/bar/", but doesn't trim
      one off "/".
      
      So, just avoiding "rstrip(os.sep)" in "reporelpath()" causes
      regression around issue3033 fixed by fccd350acf79.
      
      This patch introduces "pathutil.normasprefix" to normalize specified
      path in the specific way for problematic encodings without regression
      around issue3033.
      8dd17b19
    • Katsunori FUJIWARA's avatar
      subrepo: avoid sanitizing ".hg/hgrc" in meta data area for non-hg subrepos · 5900bc09
      Katsunori FUJIWARA authored
      Before this patch, sanitizing ".hg/hgrc" scans directories and files
      also in meta data area for non-hg subrepos: under ".svn" for
      Subversion subrepo, for example.
      
      This may cause not only performance impact (especially in large scale
      subrepos) but also unexpected removing meta data files.
      
      This patch avoids sanitizing ".hg/hgrc" in meta data area for non-hg
      subrepos.
      
      This patch stops checking "ignore" target at the first
      (case-insensitive) appearance of it, because continuation of scanning
      is meaningless in almost all cases.
      5900bc09
    • Katsunori FUJIWARA's avatar
      subrepo: make "_sanitize()" take absolute path to the root of subrepo · a01988cd
      Katsunori FUJIWARA authored
      Before this patch, "hg update" doesn't sanitize ".hg/hgrc" in non-hg
      subrepos correctly, if "hg update" is executed not at the root of the
      parent repository.
      
      "_sanitize()" takes relative path to subrepo from the root of the
      parent repository, and passes it to "os.walk()". In this case,
      "os.walk()" expects CWD to be equal to the root of the parent
      repository.
      
      So, "os.walk()" can't find specified path (or may scan unexpected
      path), if CWD isn't equal to the root of the parent repository.
      
      Non-hg subrepo under nested hg-subrepos may cause same problem, too:
      CWD may be equal to the root of the outer most repository, or so.
      
      This patch makes "_sanitize()" take absolute path to the root of
      subrepo to sanitize correctly in such cases.
      
      This patch doesn't normalize the path to hostile files as the one
      relative to CWD (or the root of the outer most repository), to fix the
      problem in the simple way suitable for "stable".
      
      Normalizing should be done in the future: maybe as a part of the
      migration to vfs.
      a01988cd
    • Katsunori FUJIWARA's avatar
      subrepo: invoke "_sanitize()" also after "git merge --ff" · 7f7f634d
      Katsunori FUJIWARA authored
      Before this patch, sanitizing ".hg/hgrc" in git subrepo doesn't work,
      when the working directory is updated by "git merge --ff".
      
      "_sanitize()" is not invoked after checking target revision out into
      the working directory in this case, even though it is invoked
      indirectly via "checkout" (or "rawcheckout") in other cases.
      
      This patch invokes "_sanitize()" explicitly also after "git merge
      --ff" execution.
      7f7f634d
    • Katsunori FUJIWARA's avatar
      subrepo: make "_sanitize()" work · 2e91d496
      Katsunori FUJIWARA authored
      "_sanitize()" was introduced by 224e96078708 on "stable" branch, but
      it has done nothing for sanitizing since 224e96078708.
      
      "_sanitize()" assumes "Visitor" design pattern:
      
          "os.walk()" should invoke specified function ("v" in this case)
          for each directory elements under specified path
      
      but "os.walk()" assumes "Iterator" design pattern:
      
          callers of it should drive loop to scan each directory elements
          under specified path by themselves with the returned generator
          object
      
      Because of this mismatching, "_sanitize()" just discards the generator
      object returned by "os.walk()" and does nothing for sanitizing.
      
      This patch makes "_sanitize()" work.
      
      This patch also changes the format of warning message to show each
      unlinked files, for multiple appearances of "potentially hostile
      .hg/hgrc".
      2e91d496
  5. May 17, 2014
  6. May 16, 2014
  7. May 20, 2014
    • Pierre-Yves David's avatar
      changelog: ensure changelog._delaybuf is initialized · 667df8f4
      Pierre-Yves David authored
      The ``localrepo.writepending`` method is using the ``changelog._delaybuff``
      attribute to know if it has anything to do. However the ``changelog._delaybuff``
      is never initialised at ``__init__`` time. This can lead to crash when using
      bundle2 for part that never touch the changelog.
      
      We simply initialize it to its base value. This is scheduled for stable as it
      both trivial and blocking for experimenting with bundle2.
      667df8f4
  8. May 22, 2014
    • Yuya Nishihara's avatar
      proxy: remove unneeded _set_hostport for compatibility with Python 2.7.7rc1 · 21b3513d
      Yuya Nishihara authored
      With Python 2.7.7rc1, "hg pull" through HTTP CONNECT tunnel fails due to the
      removal of _set_hostport [1].
      
            ...
            File "mercurial/url.py", line 372, in https_open
              return self.do_open(self._makeconnection, req)
            ...
            File "mercurial/url.py", line 342, in connect
              _generic_proxytunnel(self)
            File "mercurial/url.py", line 228, in _generic_proxytunnel
              self._set_hostport(self.host, self.port)
          AttributeError: httpsconnection instance has no attribute '_set_hostport'
      
      self._set_hostport(self.host, self.port) should be noop and can be removed
      because:
      
       - _set_hostport() [2] was the function to parse "host:port" string and
         set them to self.host and self.port,
       - and (self.host, self.port) pair should be valid since connect() is called
         prior to _generic_proxytunnel().
      
       [1]: http://hg.python.org/cpython/rev/568041fd8090
       [2]: http://hg.python.org/cpython/file/3a1db0d2747e/Lib/httplib.py#l721
      21b3513d
  9. May 23, 2014
    • Jim Hague's avatar
      bugzilla: support Bugzilla 4.4.3+ API login token authentication (issue4257) · d12d8d41
      Jim Hague authored
      Bugzilla 4.4.3 and later remove the old cookie based session authentication
      from the Web Services API and replace it with a login token. The session
      can now also be restricted to the originating IP.
      
      Add the necessary to the extension so it works with 4.4.3 and later.
      d12d8d41
    • Durham Goode's avatar
      templates: fix ifcontains against sets with length > 1 (issue4259) · d8fb8353
      Durham Goode authored
      Previously the ifcontains revset was checking against the set using a pure
      __contains__ check.  It turns out the set was actually a list of
      formatted strings meant for ui output, which meant the contains check failed if
      the formatted string wasn't significantly different from the raw value.
      
      This change makes it check against the raw data, prior to it being formatted.
      d8fb8353
  10. May 05, 2014
    • Thomas Arendsen Hein's avatar
      setup.py, make: avoid problems with outdated, existing hgext/__index__.py* · 54d7657d
      Thomas Arendsen Hein authored
      "make clean" already removed __index__.py[cdo], but not the __index__.py
      (automatically generated by "python setup.py build_hgextindex").
      
      "setup.py build_hgextindex" did not generate a new index if file
      __index__.py[cdo] already existed, because if __index__.py was removed,
      the compiled file containing the old information was imported and used.
      Generate an empty file (with a new timestamp to generate a new .py[cdo])
      instead and make mercurial.extensions ignore the unset docs attribute.
      
      One of the problems was a failed test-help.t, to reproduce:
      
      $ rm hgext/__index__.py*
      $ echo 'docs = {"mq": "dummy"}' > hgext/__index__.py
      $ make test-help.t
      
      With this a "make clean" or "python setup.py build_hgextindex" helps.
      54d7657d
  11. May 03, 2014
    • Mads Kiilerich's avatar
      color: don't fail on error messages when no curses (issue4237) · 75aaae8a
      Mads Kiilerich authored
      The error only occured when Python didn't have curses - such as on Windows and
      when Python was built without curses support.
      
      No curses can also be emulated by (re)moving .../lib/python2.7/curses/ from the
      Python installation.
      
      It is left as an exercise to figure out exactly what changed in Mercurial that
      triggered this error.
      75aaae8a
    • Steve Borho's avatar
      win32: backout 1a9ebc83a74c · 4898c37e
      Steve Borho authored
      This change conflicted with TortoiseHg's use of QFileSystemWatcher. Files which
      were being monitored (for file-system events) were unable to be reliably updated
      using util.atomictempfile.  Often the update would error out in the middle of
      the process leaving neither the old or the new file in place.
      
      My guess is that _kernel32.CreateFileA() is triggering an exception that is
      not handled correctly within unlink()
      4898c37e
  12. May 01, 2014
  13. Apr 30, 2014
  14. May 01, 2014
  15. Apr 26, 2014
    • Pierre-Yves David's avatar
      spanset: directly use __contains__ instead of a lambda · b9defeeb
      Pierre-Yves David authored
      Spanset are massively used in revset. First because the initial subset itself is
      a repo wide spanset. We speed up the __and__ operation by getting rid of a
      gratuitous lambda call. A more long terms solution would be to:
      
      1. speed up operation between spansets,
      2. have a special smartset for `all` revisions.
      
      In the mean time, this is a very simple fix that buyback some of the performance
      regression.
      
      Below is performance benchmark for trival `and` operation between two spansets.
      (Run on an unspecified fairly large repository.)
      
      revset tip:0
      2.9.2)  wall 0.282543 comb 0.280000 user 0.260000 sys 0.020000 (best of 35)
      before) wall 0.819181 comb 0.820000 user 0.820000 sys 0.000000 (best of 12)
      after)  wall 0.645358 comb 0.650000 user 0.650000 sys 0.000000 (best of 16)
      
      Proof of concept implementation of an `all` smartset brings this to 0.10 but it's
      too invasive for stable.
      b9defeeb
  16. Apr 30, 2014
  17. Apr 26, 2014
  18. Apr 28, 2014
    • Pierre-Yves David's avatar
      revset: inline spanset containment check (fix perf regression) · 1d7a2771
      Pierre-Yves David authored
      Calling a function is super expensive in python. We inline the trivial range
      comparison to get back to more sensible performance on common revset operation.
      
      Benchmark result below:
      
      Revision mapping:
      0) 3f83fc5cfe71 2.9.2 release
      1) bcfd44abad93 current @
      2) This revision
      
      
      revset #0: public()
      0) wall 0.010890 comb 0.010000 user 0.010000 sys 0.000000 (best of 201)
      1) wall 0.012109 comb 0.010000 user 0.010000 sys 0.000000 (best of 199)
      2) wall 0.012211 comb 0.020000 user 0.020000 sys 0.000000 (best of 197)
      
      revset #1: :10000 and public()
      0) wall 0.007141 comb 0.010000 user 0.010000 sys 0.000000 (best of 361)
      1) wall 0.014139 comb 0.010000 user 0.010000 sys 0.000000 (best of 186)
      2) wall 0.008334 comb 0.010000 user 0.010000 sys 0.000000 (best of 308)
      
      revset #2: draft()
      0) wall 0.009610 comb 0.010000 user 0.010000 sys 0.000000 (best of 279)
      1) wall 0.010942 comb 0.010000 user 0.010000 sys 0.000000 (best of 243)
      2) wall 0.011036 comb 0.010000 user 0.010000 sys 0.000000 (best of 239)
      
      revset #3: :10000 and draft()
      0) wall 0.006852 comb 0.010000 user 0.010000 sys 0.000000 (best of 383)
      1) wall 0.014641 comb 0.010000 user 0.010000 sys 0.000000 (best of 183)
      2) wall 0.008314 comb 0.010000 user 0.010000 sys 0.000000 (best of 299)
      
      We can see this changeset gains back the regression for `and` operation on
      spanset.  We are still a bit slowerfor the `public()` and `draft()`. Predicates
      not touched by this changeset.
      1d7a2771
  19. Apr 30, 2014
    • Matt Mackall's avatar
      ancestor: silence multiple ancestor warning outside of merge (issue4234) · 9f12d866
      Matt Mackall authored
      The current situation is a bit of a layering violation as
      merge-specific knowledge is pushed down to lower layers and leaks
      merge assumptions into other code paths.
      
      Here, we simply silence the warning with a hack. Both the warning and
      the hack will probably go away in the near future when bid merge is
      made the default.
      9f12d866
  20. Apr 25, 2014
  21. Apr 28, 2014
  22. Apr 29, 2014
    • Pierre-Yves David's avatar
      graft: do not use `.remove` on a smart set (regression) · a1381eea
      Pierre-Yves David authored
      Revset calls use to return a list. Graft use to mutate that list. We cannot do
      this anymore leading to a crash when grafting multiple changeset with a revset.
      
          File ".../mercurial/commands.py", line 3117, in graft
            revs.remove(rev)
          AttributeError: '_addset' object has no attribute 'remove'
      
      We are late in code-freeze so we make the shortest possible fix by turning it
      back to a list.
      a1381eea
  23. Apr 28, 2014
    • Greg Hurrell's avatar
      help: clarify distinction among `contains`/`file`/`filelog` · e9c2f76b
      Greg Hurrell authored
      For a Mercurial new-comer, the distinction between `contains(x)`,
      `file(x)`, and `filelog(x)` in the "revsets" help page may not be
      obvious. This commit tries to make things more obvious (text based on
      an explanation from Matt in an FB group thread).
      e9c2f76b
  24. Apr 24, 2014
Loading