Skip to content
Snippets Groups Projects
  1. Nov 01, 2016
  2. Oct 31, 2016
  3. Nov 01, 2016
    • Katsunori FUJIWARA's avatar
      contrib: check reference to old selenic.com domain · b4c0f8d5
      Katsunori FUJIWARA authored
      Now, all URL in Mercurial source tree should refer mercurial-scm.org
      domain instead of selenic.com.
      
      *.po files are ignored in this patch, because they might contain
      msgid/msgstr coming from old source files.
      
      This ignorance seems safe enough, because such msgstr should be
      ignored at runtime, because:
      
        - msgid corresponded to it should be invalid, or
        - msgstr itself should be marked as fuzzy at synchronized to recent hg.pot
      
      If any additional examination for *.po files is needed in the future,
      let i18n/check-translation.py achieve such examination.
      
      BTW, some binary files (e.g. *.png) are meaningless for checking
      reference to old domain in this patch, but aren't ignored like as *.po
      files, because excluding multiple suffixes is difficult for regexp
      matching.
      b4c0f8d5
    • Katsunori FUJIWARA's avatar
      check-code: discard filtering result of previous check for independence · 01703a8b
      Katsunori FUJIWARA authored
      Before this patch, check-code.py applies filtering on the file
      content, to which filtering of previous check is already applied.
      
      This might hide issues, which should be detected by a subsequent check
      in "checks" list.
      
      Fortunately, this problem hasn't appeared, because there is no
      overlapping of filename matching (examined in the order below).
      
        1. *.py or *.cgi
        2. test-* (not *.t suffix)
        3. *.c or *.h
        4. *.t
        5. *.txt
        6. *.tmpl
      
      For example, adding a test, which wants to examine raw comment text in
      *.py files, at the end of current "checks" list doesn't work as
      expected, because a filter for *.py files normalizes comment text in
      them.
      
      Putting such test at the beginning of "checks" list also resolves this
      problem, but such dependence on the order decreases maintainability of
      check-code.py itself.
      
      This patch discards filtering result of previous check at the
      beginning of each checks, for independence of each checks.
      01703a8b
    • Katsunori FUJIWARA's avatar
      help: replace selenic.com by mercurial-scm.org in man pages · 4e934804
      Katsunori FUJIWARA authored
      Source code repository and mailing list services have been already
      migrated to mercurial-scm.org domain.
      4e934804
    • Katsunori FUJIWARA's avatar
      help: replace selenic.com by mercurial-scm.org in command examples · 7b7bd704
      Katsunori FUJIWARA authored
      Source code repository service of Mercurial itself has been already
      migrated to mercurial-scm.org domain.
      7b7bd704
    • Yuya Nishihara's avatar
      hghave: fix 'rmcwd' to ensure temporary directory is removed · 389cbfe6
      Yuya Nishihara authored
      On platforms where cwd can't be removed, it should try rmdir() after chdir
      to the original cwd.
      389cbfe6
  4. Oct 31, 2016
    • Mads Kiilerich's avatar
      httppeer: make __del__ access to self.urlopener more safe · cac4ca03
      Mads Kiilerich authored
      Some errors could in some cases show unfortunate scary and confusing warnings
      from the httppeer delstructors:
      
        abort: nodename nor servname provided, or not known
        Exception AttributeError: "'httpspeer' object has no attribute 'urlopener'" in <bound method httpspeer.__del__ of <mercurial.httppeer.httpspeer object at 0x106e1f5d0>> ignored```
      
      To mute that, take 7b15dd9125b3 to the next level and use getattr in __del__.
      cac4ca03
  5. Oct 29, 2016
  6. Oct 28, 2016
    • Katsunori FUJIWARA's avatar
      tests: add test-commit-interactive-curses.t "require tic" for test portability · 141cb12c
      Katsunori FUJIWARA authored
      Standard library of Python on Windows doesn't have curses module.
      141cb12c
    • Katsunori FUJIWARA's avatar
      tests: use "?" to glob both ":" and ";" in output for test portability · fe612ab5
      Katsunori FUJIWARA authored
      If environment variable looks like PATH or so (e.g. any of components
      joined by ":" contains "/"), ":" in it is replaced with ";" by MinGW
      at spawning Windows native process, to follow path concatenation style
      of Windows.
      
      Therefore, "bundle:../full.hg" is converted into "bundle;..\full.hg"
      on MinGW.
      
      Difference between "/" and "\" is automatically ignored by "(glob)",
      but difference between ":" and ";" should be globed explicitly.
      fe612ab5
    • Katsunori FUJIWARA's avatar
      tests: invoke printenv.py via sh -c for test portability · 34a5f6c6
      Katsunori FUJIWARA authored
      On Windows platform, invoking printenv.py directly via hook is
      problematic, because:
      
        - unless binding between *.py suffix and python runtime, application
          selector dialog is displayed, and running test is blocked at each
          printenv.py invocations
      
        - it isn't safe to assume binding between *.py suffix and python
          runtime, because application binding is easily broken
      
          For example, installing IDE (VisualStudio with Python Tools, or
          so) often requires binding between source files and IDE itself.
      
      This patch invokes printenv.py via sh -c for test portability. This is
      a kind of follow up for d19787db6fe0, which eliminated explicit
      "python" for printenv.py. There are already other 'sh -c "printenv.py"'
      in *.t files, and this fix should be reasonable.
      
      This changes were confirmed in cases below:
      
        - without any application binding for *.py suffix
        - with binding between *.py suffix and VisualStudio
      
      This patch also replaces "echo + redirection" style with "heredoc"
      style, because:
      
        - hook command line is parsed by cmd.exe as shell at first, and
        - single quotation can't quote arguments on cmd.exe, therefore,
        - "printenv.py foobar" should be quoted by double quotation, but
        - nested quoting (or tricky escaping) isn't readable
      34a5f6c6
  7. Oct 27, 2016
    • Mads Kiilerich's avatar
      largefiles: handle that a found standin file doesn't exist when removing it · 3afde791
      Mads Kiilerich authored
      I somehow ended up in a situation where hg crashed on an unlink I introduced in
      328545c7d8a1.
      
      I don't know how it happened and can't reproduce it. It seems like it only can
      happen when the file is removed between the time of check in a working
      directory context walk that finds a standin file, and the time of use when we
      try to remove it because the corresponding largefile doesn't exist.
      
      But better safe than sorry: replace the plain unlink with unlinkpath with
      ignoremissing=True. That will also remove remaining empty directories, which
      arguably is more correct.
      3afde791
  8. Oct 25, 2016
    • Yuya Nishihara's avatar
      templater: use unfiltered changelog to calculate shortest() at constant time · 362740e0
      Yuya Nishihara authored
      cl._partialmatch() can be pretty slow if hidden revisions are involved. This
      patch cancels the slowdown introduced by the previous patch by using an
      unfiltered changelog, which means shortest(node) isn't always the shortest.
      
      The result isn't perfect, but seems okay as long as shortest(node) is short
      enough to type and can be used as an identifier.
      
        (with hidden revisions)
        % hg log -R hg-committed -r0:20000 -T '{node|shortest}\n' --time > /dev/null
        (.^^) time: real 1.530 secs (user 1.480+0.000 sys 0.040+0.000)
        (.^)  time: real 43.080 secs (user 43.060+0.000 sys 0.030+0.000)
        (.)   time: real 1.680 secs (user 1.650+0.000 sys 0.020+0.000)
      362740e0
  9. Oct 23, 2016
    • Yuya Nishihara's avatar
      templater: do not use index.partialmatch() directly to calculate shortest() · 741e5d7f
      Yuya Nishihara authored
      cl.index.partialmatch() isn't a drop-in replacement for cl._partialmatch().
      It has no knowledge about hidden revisions, and it raises ValueError if a node
      shorter than 4 chars is given. Instead, use index.partialmatch() through
      cl._partialmatch(), which has no such problems and gives the identical result
      with/without --pure.
      
      The test output was sampled with --pure without this patch, which shows the
      most correct result. However, we'll need to switch to using an unfiltered
      changelog because _partialmatch() of a filtered changelog can be an order of
      magnitude slower.
      
        (with hidden revisions)
        % hg log -R hg-committed -r0:20000 -T '{node|shortest}\n' --time > /dev/null
        (.^)  time: real 1.530 secs (user 1.480+0.000 sys 0.040+0.000)
        (.)   time: real 43.080 secs (user 43.060+0.000 sys 0.030+0.000)
      741e5d7f
  10. Oct 26, 2016
  11. Oct 25, 2016
    • Gábor Stefanik's avatar
      merge: avoid superfluous filemerges when grafting through renames (issue5407) · 69ffbbe7
      Gábor Stefanik authored
      This is a fix for a regression introduced by the patches for issue4028.
      
      The test changes are due to us doing fewer _checkcopies searches now, which
      makes some test outputs revert to the pre-issue4028 behavior. That issue itself
      remains fixed, we only skip copy tracing for files where it isn't relevant.
      As a nice side effect, this makes copy detection much faster when tracing
      backwards through lots of renames.
      69ffbbe7
  12. Oct 19, 2016
    • Gábor Stefanik's avatar
      sslutil: guard against broken certifi installations (issue5406) · b9f7b0c1
      Gábor Stefanik authored
      Certifi is currently incompatible with py2exe; the Python code for certifi gets
      included in library.zip, but not the cacert.pem file - and even if it were
      included, SSLContext can't load a cacert.pem file from library.zip.
      This currently makes it impossible to build a standalone Windows version of
      Mercurial.
      
      Guard against this, and possibly other situations where a module with the name
      "certifi" exists, but is not usable.
      b9f7b0c1
  13. Oct 25, 2016
    • Mads Kiilerich's avatar
      revset: don't cache abstractsmartset min/max invocations infinitely · 5ee944b9
      Mads Kiilerich authored
      There was a "leak", apparently introduced in ab66c1dee405. When running:
      
          hg = hglib.open('repo')
          while True:
              hg.log("max(branch('default'))")
      
      all filteredset instances from branch() would be cached indefinitely by the
      @util.cachefunc annotation on the max() implementation.
      
      util.cachefunc seems dangerous as method decorator and is barely used elsewhere
      in the code base. Instead, just open code caching by having the min/max
      methods replace themselves with a plain lambda returning the result.
      5ee944b9
  14. Oct 24, 2016
  15. Oct 23, 2016
  16. Oct 18, 2016
    • Mads Kiilerich's avatar
      dirstate: fix debug.dirstate.delaywrite to use the new "now" after sleeping · ad56071b
      Mads Kiilerich authored
      It seems like the a regression has sneaked into debug.dirstate.delaywrite in
      6c6b48aca328. It would sleep until no files were modified "now" any more, but
      when writing the dirstate it would use the old "now" and still mark files as
      'unset' instead of recording the timestamp that would make the file show up as
      clean instead of unknown.
      
      Instead of getting a new "now" from the file system, we trust the computed end
      time as the new "now" and thus cause the actual modification time to be
      writiten to the dirstate.
      
      debug.dirstate.delaywrite is undocumented and only used in
      test-largefiles-update.t . All tests seems to work fine for me without
      debug.dirstate.delaywrite . Perhaps because it not really worked as intended
      without the fix in this patch, and code and tests thus have evolved to do fine
      without it? It could thus perhaps make sense to drop usage of this setting in
      the tests. That could speed the test up a bit.
      
      This functionality (or something very similar) can however apparently be very
      convenient in setups where checking dirty-ness is expensive - such as when
      using large files and have slow file filesystems or are CPU constrained. Now it
      works and we can try it. (But ideally, for the largefile use case, it should
      probably only delay lfdirstate writes - not ordinary dirstate.)
      ad56071b
  17. Oct 21, 2016
  18. Oct 19, 2016
    • Gregory Szorc's avatar
      commands: print security protocol support in debuginstall · 7b428b00
      Gregory Szorc authored
      Over the past week I've had to instruct multiple people to run
      Python code to query the ssl module to see what TLS protocol support
      is present. I think it would be useful for `hg debuginstall` to print
      this info to make it easier to access and debug why Mercurial is
      complaining about using an insecure TLS 1.0 protocol.
      
      Ideally we'd also print the path to the CA cert bundle. But the APIs
      for querying that in sslutil can emit warnings, making it slightly
      more difficult to integrate into `hg debuginstall`. That work will
      have to wait for another day.
      7b428b00
    • Durham Goode's avatar
      manifest: make treemanifestctx store the repo · f2c5b9d4
      Durham Goode authored
      Same as in the last commit, the old treemanifestctx stored a reference to the
      revlog.  If the inmemory revlog became invalid, the ctx now held an old copy and
      would be incorrect. To fix this, we need the ctx to go through the manifestlog
      for each access.
      
      This is the same pattern that changectx already uses (it stores the repo, and
      accesses commit data through self._repo.changelog).
      f2c5b9d4
    • Durham Goode's avatar
      manifest: make manifestctx store the repo · acc8885a
      Durham Goode authored
      The old manifestctx stored a reference to the revlog. If the inmemory revlog
      became invalid, the ctx now held an old copy and would be incorrect. To fix
      this, we need the ctx to go through the manifestlog for each access.
      
      This is the same pattern that changectx already uses (it stores the repo, and
      accesses commit data through self._repo.changelog).
      acc8885a
    • Durham Goode's avatar
      manifest: make manifestlog a storecache · 3c8811ef
      Durham Goode authored
      The old @property on manifestlog was broken. It meant that we would always
      recreate the manifestlog instance, which meant the cache was never hit. Since
      we'll eventually remove repo.manifest and make manifestlog the only property,
      let's go ahead and make manifestlog the @storecache property, have manifestlog
      own the manifest instance, and have repo.manifest refer to it via manifestlog.
      
      This means all accesses go through repo.manifestlog, which is now invalidated
      correctly.
      3c8811ef
    • Durham Goode's avatar
      manifest: move manifest creation to a helper function · 1767723f
      Durham Goode authored
      A future patch will be moving manifest creation to be inside manifestlog as part
      of improving our cache guarantees. bundlerepo and unionrepo currently rely on
      being able to hook into manifest creation, so let's temporarily move the actual
      manifest creation to a helper function for them to intercept.
      
      In the future manifest.manifest() will disappear entirely and this can
      disappear.
      1767723f
  19. Oct 18, 2016
  20. Oct 11, 2016
  21. Oct 16, 2016
    • Gregory Szorc's avatar
      changegroup: increase write buffer size to 128k · 260af198
      Gregory Szorc authored
      By default, Python defers to the operating system for choosing the
      default buffer size on opened files. On my Linux machine, the default
      is 4k, which is really small for 2016.
      
      This patch bumps the write buffer size when writing
      changegroups/bundles to 128k. This matches the 128k read buffer
      we already use on revlogs.
      
      It's worth noting that this only impacts when writing to an explicit
      file (such as during `hg bundle`). Buffers when writing to bundle
      files via the repo vfs or to a temporary file are not impacted.
      
      When producing a none-v2 bundle file of the mozilla-unified repository,
      this change caused the number of write() system calls to drop from
      952,449 to 29,788. After this change, the most frequent system
      calls are fstat(), read(), lseek(), and open(). There were
      2,523,672 system calls after this patch (so a net decrease of
      ~950k is statistically significant).
      
      This change shows no performance change on my system. But I have a
      high-end system with a fast SSD. It is quite possible this change
      will have a significant impact on network file systems, where
      extra network round trips due to excessive I/O system calls could
      introduce significant latency.
      260af198
  22. Oct 13, 2016
    • Pierre-Yves David's avatar
      changegroup: skip delta when the underlying revlog do not use them · 6b0741d6
      Pierre-Yves David authored
      Revlog can now be configured to store full snapshot only. This is used on the
      changelog. However, the changegroup packing was still recomputing deltas to be
      sent over the wire.
      
      We now just reuse the full snapshot directly in this case, skipping delta
      computation. This provides use with a large speed up(-30%):
      
      # perfchangegroupchangelog on mercurial
      ! wall 2.010326 comb 2.020000 user 2.000000 sys 0.020000 (best of 5)
      ! wall 1.382039 comb 1.380000 user 1.370000 sys 0.010000 (best of 8)
      
      # perfchangegroupchangelog on pypy
      ! wall 5.792589 comb 5.780000 user 5.780000 sys 0.000000 (best of 3)
      ! wall 3.911158 comb 3.920000 user 3.900000 sys 0.020000 (best of 3)
      
      # perfchangegroupchangelog on mozilla central
      ! wall 20.683727 comb 20.680000 user 20.630000 sys 0.050000 (best of 3)
      ! wall 14.190204 comb 14.190000 user 14.150000 sys 0.040000 (best of 3)
      
      Many tests have to be updated because of the change in bundle content. All
      theses update have been verified.  Because diffing changelog was not very
      valuable, the resulting bundle have similar size (often a bit smaller):
      
      # full bundle of mozilla central
      with delta:    1142740533B
      without delta: 1142173300B
      
      So this is a win all over the board.
      6b0741d6
  23. Oct 14, 2016
Loading