Skip to content
Snippets Groups Projects
  1. Apr 14, 2015
  2. Apr 15, 2015
  3. Jan 14, 2015
    • Mads Kiilerich's avatar
      branchcache: stay silent if failing to read cache files · 75688a6f
      Mads Kiilerich authored
      The warning has in some cases incorrectly attributed unrelated problems to rbc.
      
      Instead, just do like the branch head cache does and stay quiet when reading
      fails. The cache will be missing the first time a repo is used. It is a normal
      situation and there is no reason to make a note of that.
      75688a6f
  4. Mar 19, 2015
  5. Apr 11, 2015
    • Katsunori FUJIWARA's avatar
      subrepo: use vfs.walk instead of os.walk · 74774876
      Katsunori FUJIWARA authored
      "dirpath" in the tuple yielded by "vfs.walk()" is relative one from
      the root of specified vfs, and absolute path in the warning message is
      composed by "vfs.join()".
      
      On the other hand, target file "f" exists in "dirpath", and
      "reljoin()" is needed to unlink "f" by "vfs.unlink()".
      74774876
    • Katsunori FUJIWARA's avatar
      vfs: add walk · ee751d47
      Katsunori FUJIWARA authored
      To eliminate "path prefix" (= "the root of vfs") part from "dirpath"
      yielded by "os.walk()" correctly, "path prefix" should have "os.sep"
      at the end of own string, but it isn't easy to ensure it, because:
      
        - examination by "path.endswith(os.sep)" isn't portable
      
          Some problematic encodings use 0x5c (= "os.sep" on Windows) as the
          tail byte of some multi-byte characters.
      
        - "os.path.join(path, '')" isn't portable
      
          With Python 2.7.9, this invocation doesn't add "os.sep" at the end
          of UNC path (see issue4557 for detail).
      
      Python 2.7.9 changed also behavior of "os.path.normpath()" (see *) and
      "os.path.splitdrive()" for UNC path.
      
          vfs root        normpath       splitdrive          os.sep required
          =============== ============== =================== ============
          z:\             z:\            z: + \              no
          z:\foo          z:\foo         z: + \foo           yes
          z:\foo\         z:\foo         z: + \foo           yes
      
          [before Python 2.7.9]
          \\foo\bar       \\foo\bar      '' + \\foo\bar      yes
          \\foo\bar\      \\foo\bar  (*) '' + \\foo\bar      yes
          \\foo\bar\baz   \\foo\bar\baz  '' + \\foo\bar\baz  yes
          \\foo\bar\baz\  \\foo\bar\baz  '' + \\foo\bar\baz  yes
      
          [Python 2.7.9]
          \\foo\bar       \\foo\bar      \\foo\bar + ''      yes
          \\foo\bar\      \\foo\bar\ (*) \\foo\bar + \       no
          \\foo\bar\baz   \\foo\bar\baz  \\foo\bar + \baz    yes
          \\foo\bar\baz\  \\foo\bar\baz  \\foo\bar + \baz    yes
      
      If it is ensured that "normpath()"-ed vfs root is passed to
      "splitdrive()", adding "os.sep" is required only when "path" part of
      "splitdrive()" result isn't "os.sep" itself. This is just what
      "pathutil.nameasprefix()" examines.
      
      This patch applies "os.path.normpath()" on "self.join(None)"
      explicitly, because it isn't ensured that vfs root is already
      normalized: vfs itself is constructed with "realpath=False" (= avoid
      normalizing in "vfs.__init__()") in many code paths.
      
      This normalization should be much cheaper than subsequent file I/O for
      directory traversal.
      ee751d47
    • Katsunori FUJIWARA's avatar
      subrepo: pass wvfs to _sanitize instead of absolute path to a subrepository · 95eb067b
      Katsunori FUJIWARA authored
      As a preparation for vfs migration of "_sanitize()", this patch passes
      "wvfs" to "_sanitize()" and use "wvfs.base" instead of absolute path
      to a subrepository.
      95eb067b
  6. Apr 02, 2015
    • Gregory Szorc's avatar
      repoview: move function for computing filtered hash · 467a3314
      Gregory Szorc authored
      An upcoming patch will establish per-filter tags caches. We'll want
      to use the same cache validation logic as the branch cache. Prepare
      for that by moving the logic for computing a filtered view hash
      to somewhere central.
      467a3314
  7. Apr 14, 2015
  8. Apr 05, 2015
  9. Apr 09, 2015
  10. Apr 11, 2015
    • Yuya Nishihara's avatar
    • Matt Harbison's avatar
      changegroup: flush the ui stdio buffers after adding a changegroup · 90f2b9de
      Matt Harbison authored
      This eliminates the following test failure on Windows, as well as a similar one
      in evolve's test-wireproto.t.  See the previous patch for details on the
      problem.
      
        --- e:/Projects/hg/tests/test-init.t
        +++ e:/Projects/hg/tests/test-init.t.err
        @@ -216,10 +216,10 @@
            * test                      0:08b9e9f63b32
           $ hg clone -e "python \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
           searching for changes
        +  exporting bookmark test
           remote: adding changesets
           remote: adding manifests
           remote: adding file changes
           remote: added 1 changesets with 1 changes to 1 files
        -  exporting bookmark test
           $ hg -R remote-bookmarks bookmarks
              test                      0:08b9e9f63b32
      90f2b9de
    • Matt Harbison's avatar
      hook: forcibly flush stderr for Windows test stability · 2abbf475
      Matt Harbison authored
      There are a handful of SSH related test failures on Windows.
      
        --- c:/Users/Matt/Projects/hg/tests/test-bundle2-exchange.t
        +++ c:/Users/Matt/Projects/hg/tests/test-bundle2-exchange.t.err
        @@ -305,16 +305,16 @@
           remote: added 1 changesets with 1 changes to 1 files
           remote: 1 new obsolescence markers
           updating bookmark book_5fdd
        +  pre-close-tip:02de42196ebe draft book_02de
        +  postclose-tip:02de42196ebe draft book_02de
        +  txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
        +  ssh://user@dummy/other HG_URL=ssh://user@dummy/other
           remote: pre-close-tip:5fddd98957c8 draft book_5fdd
           remote: pushkey: lock state after "bookmarks"
           remote: lock:  free
           remote: wlock: free
           remote: postclose-tip:5fddd98957c8 draft book_5fdd
           remote: txnclose hook: (env vars truncated)
        -  pre-close-tip:02de42196ebe draft book_02de
        -  postclose-tip:02de42196ebe draft book_02de
        -  txnclose hook: HG_SOURCE=push-response HG_TXNNAME=push-response
        -  ssh://user@dummy/other HG_URL=ssh://user@dummy/other
           $ hg -R other log -G
           o  6:5fddd98957c8 draft Nicolas Dumazet <...> book_5fdd C
           |
      
        --- c:/Users/Matt/Projects/hg/tests/test-ssh.t
        +++ c:/Users/Matt/Projects/hg/tests/test-ssh.t.err
        @@ -438,12 +438,12 @@
           $ hg push
           pushing to ssh://user@dummy/remote
           searching for changes
        +  local stdout
           remote: adding changesets
           remote: adding manifests
           remote: adding file changes
           remote: added 1 changesets with 1 changes to 1 files
        -  remote: KABOOM
        -  local stdout
        +  remote: KABOOM\r (esc)
      
           $ cd ..
      
      
      What is happening is that no data is available in 'sshpeer.pipee' while the
      command is executing.  As the command completes, local output is printed, and
      then sshpeer.cleanup() is called.  When it calls 'self.pipeo.close()', the child
      process is shutdown, flushing stderr.
      
      As an experiment, I printed a line to stdout and another to stderr instead this
      flush().  The stdout data was immediately available to the hg client, and none
      of the stderr data was until the child exited.  At that point, pipee has all of
      the buffered data, and it is read out and printed before the pipe is closed in
      sshpeer.cleanup().  This is probably a known issue, since ui.write_err()
      mentions that stderr may be buffered, and also flushes stderr.
      
      It would be nice if there was a more general fix (there is one more test that
      fails), but I'm not sure what it is.  I've seen (ancient) references [1] to
      setvbuf() "crashing spectacularly" on some systems if any I/O has been done
      already, so it seems worth avoiding.
      
      
      https://sourceware.org/ml/gdb-patches/2013-08/msg00422.html
      
      [1] https://groups.google.com/forum/#!msg/comp.lang.python/JT8LiYzYDEY/Qg9d1HwyjScJ
      2abbf475
    • Gregory Szorc's avatar
      json: implement {fileannotate} template · 1439bacf
      Gregory Szorc authored
      1439bacf
    • Gregory Szorc's avatar
      json: implement {comparison} template · 84859415
      Gregory Szorc authored
      Similar to {filediff}, we abbreviate some property names to cut down on
      string bloat.
      84859415
    • Gregory Szorc's avatar
      json: implement {filediff} template · 2f43f8cf
      Gregory Szorc authored
      Single letter properties are used to keep payload size down, as diff
      representation can be quite large and longer property names can create a
      lot of extra work for parsers.
      
      Rename is not yet captured. This can be done in a follow-up.
      2f43f8cf
    • Gregory Szorc's avatar
      hgweb: expose raw line numbers to templates · bbf1ae6b
      Gregory Szorc authored
      Surpringly, the templates didn't receive an unmodified version of the
      line numbers. Expose it to make implementing the JSON templates easier.
      
      In theory, we could post-process an existing template variable. But
      extra string manipulation seems quite wasteful, especially on items that
      could occur hundreds or even thousands of times in output.
      bbf1ae6b
    • Pierre-Yves David's avatar
      revert: stop marking files clean after interactive revert (issue4592) · ab6e3729
      Pierre-Yves David authored
      The goal of 'hg revert --interactive' is usually to keep some change in the
      revert file, so the files -must-not- be marked as clean. We want the status
      logic to do its usual job here.
      
      For unclear reasons (probably timing related), I was unable to build an automated
      test that reproduced issue4592 but manual testing shows this is fixed.
      ab6e3729
    • Augie Fackler's avatar
      lazymanifest: prevent leak when updating an entry more than once · 909ee6b2
      Augie Fackler authored
      __setitem__ on the lazymanifest C type wasn't checking to see if a
      line had previously been malloced before replacing it, leading to
      leaks if files got updated multiple times in the course of a task.
      
      I was able to reproduce the leak with this change to test-manifest.py:
      
      diff --git a/tests/test-manifest.py b/tests/test-manifest.py
      --- a/tests/test-manifest.py
      +++ b/tests/test-manifest.py
      @@ -456,6 +456,16 @@ class basemanifesttests(object):
                       ['a/b/c/bar.txt', 'a/b/c/foo.txt', 'a/b/d/ten.txt'],
                       m2.keys())
      
      +    def testManifestSetItem(self):
      +        m = self.parsemanifest('')
      +        for x in range(3):
      +            m['file%d' % x] = BIN_HASH_1
      +        for x in range(3):
      +            m['file%d' % x] = BIN_HASH_2
      +        import time
      +        time.sleep(4)
      +
      +
      
      along with the commands:
      
       $ make local
       $ PYTHONPATH=. SILENT_BE_NOISY=1 python tests/test-manifest.py testmanifestdict.testManifestSetItem &
       $ sleep 4
       $ leaks $(jobs -p | tee /dev/stderr | awk '{print $3}')
       $ wait
      
      in an interactive shell on OS X. As far as I can tell, it had to be an
      interactive shell so that I could get the pid of the test run using
      the jobs builtin. Prior to this change, I was leaking several strings,
      and after this change leaks reports no leaks.
      
      I thought there was a bug filed for this in bugzilla, but I can't find
      it either in bugzilla or by searching my email.
      909ee6b2
  11. Apr 13, 2015
  12. Apr 14, 2015
  13. Apr 13, 2015
  14. Apr 12, 2015
  15. Apr 13, 2015
  16. Apr 11, 2015
  17. Apr 12, 2015
  18. Apr 11, 2015
  19. Apr 09, 2015
  20. Apr 10, 2015
    • Pierre-Yves David's avatar
      bundle2: advertise bundle2 by default · 553dc2b0
      Pierre-Yves David authored
      That way, any new server will be ready to accept bundle2 payload. The decision
      for the client to use it is still off by default so this is not turning bundle2
      everywhere.
      
      We introduce a new kill switch for this in case stuff goes wrong.
      553dc2b0
  21. Feb 07, 2015
  22. Apr 10, 2015
Loading