Skip to content
Snippets Groups Projects
  1. Sep 04, 2018
  2. Sep 05, 2018
    • Gregory Szorc's avatar
      wireprotov2peer: properly format errors · 43d92d68
      Gregory Szorc authored
      formatrichmessage() expects an iterable containing dicts with
      well-defined keys. We were passing in something else. This caused
      an exception.
      
      Change the code to call formatrichmessage() with the proper argument.
      
      And add a TODO to potentially emit the proper data structure from
      the server in the first place.
      
      Differential Revision: https://phab.mercurial-scm.org/D4441
      43d92d68
  3. Aug 23, 2018
  4. Sep 08, 2018
    • Anton Shestakov's avatar
      httppeer: use util.readexactly() to abort on incomplete responses · 98995b68
      Anton Shestakov authored
      Plain resp.read(n) may not return exactly n bytes when we need, and to detect
      such cases before trying to interpret whatever has been read, we can use
      util.readexactly(), which raises an Abort when stream ends unexpectedly. In the
      first case here, readexactly() prevents a traceback with struct.error, in the
      second it avoids looking for invalid compression engines.
      
      In this test case, _wraphttpresponse doesn't catch the problem (presumably
      because it doesn't know transfer encoding), and the code continues reading the
      response until it gets to compression engine data. Maybe there should be checks
      before the execution gets there, but I'm not sure where (httplib?)
      98995b68
    • Anton Shestakov's avatar
      httppeer: calculate total expected bytes correctly · 1fc39367
      Anton Shestakov authored
      User-facing error messages that handled httplib.IncompleteRead errors in
      Mercurial used to look like this:
      
        abort: HTTP request error (incomplete response; expected 3 bytes got 1)
      
      But the errors that are being handled underneath the UI look like this:
      
        IncompleteRead(1 bytes read, 3 more expected)
      
      I.e. the error actually counts total number of expected bytes minus bytes
      already received.
      
      Before, users could see weird messages like "expected 10 bytes got 10", while
      in reality httplib expected 10 _more_ bytes (20 in total).
      1fc39367
    • Martin von Zweigbergk's avatar
      lazyancestors: reuse __iter__ implementation in __contains__ · 77a2f6d8
      Martin von Zweigbergk authored
      There was a comment in the code that said "Trying to do both __iter__
      and __contains__ using the same visit heap and seen set is complex
      enough that it slows down both. Keep them separate.". However, it
      seems easy and efficient to make __contains__ keep an iterator across
      calls.
      
      I couldn't measure any slowdown from `hg bundle --all` (which seem to
      call lazyancestors.__contains__ frequently).
      
      Differential Revision: https://phab.mercurial-scm.org/D4508
      77a2f6d8
  5. Sep 10, 2018
  6. Aug 29, 2018
    • Boris Feld's avatar
      phase: report number of non-public changeset alongside the new range · 89630d0b
      Boris Feld authored
      When interacting with non-publishing repository or bundle, it is useful to
      have some information about the phase of the changeset we just pulled.
      
      This changeset updates the "new changesets MIN:MAX" output to also includes
      phases information for non-public changesets. Displaying extra data about
      non-public changesets means the output for exchange with publishing repository
      (the default) is unaffected.
      89630d0b
  7. Sep 08, 2018
    • Matt Harbison's avatar
      tests: disable test-nointerrupt on Windows · 3ba87d5b
      Matt Harbison authored
      Per the followup discussion[1].  proc.send_signal(INT) in timeout.py raises a
      ValueError because of an unsupported signal.  I don't like missing test coverage
      for this on Windows.  But this is the last test failing on Windows, and red all
      the time hides new failures.
      
      [1] https://phab.mercurial-scm.org/D3716
      3ba87d5b
    • Matt Harbison's avatar
      tests: conditionalize an error message about unlinking a non empty directory · c4a7ba10
      Matt Harbison authored
      The message on Windows comes from win32.unlink().  It looks like os.unlink() on
      posix platforms is a simple call to unlink(3), which turns into unlinkat(2).
      Since there's a comment in one of the tests that the message should be improved,
      I don't think it's worth adding a check in win32.unlink() to see if it's empty,
      if that function is always going to fail on a directory.  (It seems like the
      POSIX spec allows unlinking directories though.)
      c4a7ba10
  8. Sep 07, 2018
  9. Sep 08, 2018
  10. Sep 06, 2018
    • Boris Feld's avatar
      ancestors: ensure a consistent order even in the "inclusive" case · a60dae06
      Boris Feld authored
      It seems odds to first issue the "source" revs and then the other ancestors.
      In addition, doing so can break the other contract of always issuing a child
      before its parent. We update the code to apply the same logic to all yielded
      revision. No tests break so we seem in the clear except where we explicitly
      test the order.
      a60dae06
    • Boris Feld's avatar
      ancestors: actually iterate over ancestors in topological order (issue5979) · b6db2e80
      Boris Feld authored
      This code previously used a dequeue logic, the first ancestors seen were the
      first ancestors to be emitted. In branching/merging situations, it can result
      in ancestors being yielded before their descendants, breaking the object
      contract.
      
      We got affected by this issue while working on the copy tracing code. At about
      the same time, Axel Hecht <axel@mozilla.com> reported the issue and provided
      the test case used in this changeset. Thanks Axel.
      
      Running `hg perfancestors` does not show a significant difference between the
      old and the new version.
      b6db2e80
    • Yuya Nishihara's avatar
      doc: use modern import style in runrst · 4e4fae1d
      Yuya Nishihara authored
      4e4fae1d
  11. Aug 26, 2018
    • Yuya Nishihara's avatar
      hgweb: do not audit URL path as working-directory path · 15e8250a
      Yuya Nishihara authored
      Since hgweb is an interface to repository data, we don't need to prohibit
      any paths conflicting within the filesystem. Still an access to working
      files is audited by filectx.
      15e8250a
    • Yuya Nishihara's avatar
      hgweb: map Abort to 403 error to report inaccessible path for example · 17ca967e
      Yuya Nishihara authored
      Abort is so common in our codebase. We could instead introduce a dedicated
      type for path auditing errors, but we'll probably have to catch error.Abort
      anyway.
      
      As you can see, an abort message may include a full path to the repository,
      which might be considered information leak. If that matters, we should hide
      the message and send it to the server log instead.
      17ca967e
  12. Sep 07, 2018
  13. Sep 04, 2018
  14. Sep 07, 2018
  15. Sep 06, 2018
  16. Aug 18, 2018
    • Kyle Lippincott's avatar
      match: improve includematcher.visitchildrenset to be much faster and cached · 35ecaa99
      Kyle Lippincott authored
      This improves the speed of visitchildrenset considerably, especially when there
      are complicated matchers involved that may have many entries in _dirs or
      _parents.
      
      Unfortunately the benchmark isn't easily upstreamed due to its reliance on
      https://github.com/vstinner/perf (primarily due to the conflict when importing
      it if I were to contribute the benchmark as contrib/matcherbenchmarks.py)
      instead of asv or some other perf measurement system.
      
      To describe the benchmark briefly: I generated an includematcher of either 5 or
      3500 "rootfilesin:prefix1/prefix2/prefix3/<randomsubdirs, 1-8 levels deep>"
      items in the 'setup' function, and then called
      `im.visitchildrenset('prefix1/prefix2')` in the 'stmt' function in perf.timeit.
      
      For the set of 5:
       - before: 15.3  us +- 2.9  us
       -  after:  1.59 us +- 0.02 us
      
      For the set of 3500:
       - before: 3.90 ms +- 0.10 ms
       -  after: 3.15 us +- 0.09 us  (note the m->u change)
      
      Differential Revision: https://phab.mercurial-scm.org/D4351
      35ecaa99
  17. Sep 05, 2018
  18. Sep 06, 2018
    • Matt Harbison's avatar
      lfs: ensure the blob is linked to the remote store on skipped uploads · a913d289
      Matt Harbison authored
      I noticed a "missing" blob when pushing two repositories with common blobs to a
      fresh server, and then running `hg verify` as a user different from the one
      running the web server.  When pushing the second repo, several of the blobs
      already existed in the user cache, so the server indicated to the client that it
      doesn't need to upload the blobs.  That's good enough for the web server process
      to serve up in the future.  But a different user has a different cache by
      default, so verify complains that `lfs.url` needs to be set, because it wants to
      fetch the missing blobs.
      
      Aside from that corner case, it's better to keep all of the blobs in the repo
      whenever possible.  Especially since the largefiles wiki says the user cache can
      be deleted at any time to reclaim disk space- users switching over may have the
      same expectations.
      a913d289
  19. Sep 05, 2018
  20. Sep 04, 2018
  21. Aug 28, 2018
Loading