Skip to content
Snippets Groups Projects
  1. Jan 25, 2016
    • Laurent Charignon's avatar
      crecord: fix help bar display issue (issue5063) · 3d3b4ac3
      Laurent Charignon authored
      Before this patch, the help bar in crecord wouldn't be printed correctly when
      the terminal window didn't have enough column to display it. This patch adds
      logic to make sure that the help bar message is always displayed. We use an
      ellipsis when it is not possible to display the complete message.
      3d3b4ac3
    • Laurent Charignon's avatar
      crecord: fix typo in the help text · fedd8165
      Laurent Charignon authored
      In the crecord help dialog, the toggle all option was wrongfully documented.
      Instead of using 'a', one must use 'A' to toggle all the hunks. The crecord
      header that is always displayed on the screen contains the right shortcut and
      does not need to be changed.
      fedd8165
  2. Jan 18, 2016
    • Mason Malone's avatar
      subrepo: better error messages in _ensuregit · 594bdc38
      Mason Malone authored
      This patch improves the error messages raised when an OSError occurs, since
      simply re-raising the exception can be both confusing and misleading. For
      example, if "hg identify" is run inside a repository that contains a Git
      subrepository and the git binary could not be found, it'll exit with the message
      "abort: No such file or directory". That implies "identify" has a problem
      reading the repository itself. There's no way for the user to know what the
      real problem is unless they dive into the Mercurial source, which is what I
      ended up doing after spending hours debugging errors while provisioning a VM
      with Ansible (turns out I forgot to install Git on it).
      
      Descriptive errors are especially important on Windows, since it's common for
      Windows users to forget to set the "Path" system variable after installing Git.
      594bdc38
  3. Jan 23, 2016
    • Anton Shestakov's avatar
      hgweb: update canvas.width before dynamically redrawing graph (issue2683) · 1779ff74
      Anton Shestakov authored
      After 91ac8cb79125 graph canvas width is decided once on the initial rendering.
      However, after graph page gets scrolled down to load more, it might need more
      horizontal space to draw, so it needs to resize the canvas dynamically.
      
      The exact problem that this patch solves can be seen using:
      
          hg init testfork
          cd testfork
          echo 0 > foo
          hg ci -Am0
          echo 1 > foo
          hg ci -m1
          hg up 0
          echo 2 > foo
          hg ci -m2
          hg gl -T '{rev}\n'
      
          @  2
          |
          | o  1
          |/
          o  0
      
          hg serve
      
      And then by navigating to http://127.0.0.1:8000/graph/tip?revcount=1
      
      "revcount=1" makes sure the initial graph contains only revision 2. And because
      the initial canvas width takes only that one revision into count, after the
      (immediate) AJAX update revision 1 will be cut off from the graph.
      
      We can safely set canvas width to the new value we get from the AJAX request
      because every time graph is updated, it is completely redrawn using all the
      requested nodes (in the case above it will use /graph/2?revcount=61), so the
      value is guaranteed not to decrease.
      
      P.S.: Sorry for parsing HTML with regexes, but I didn't start it.
      1779ff74
  4. Jan 22, 2016
  5. Jan 19, 2016
    • Martin von Zweigbergk's avatar
      shelve: use cg3 for treemanifests · 1289a122
      Martin von Zweigbergk authored
      Similar to previous change, this teaches shelve to pick the right
      changegroup version for repos that use treemanifests.
      1289a122
    • Martin von Zweigbergk's avatar
      repair: use cg3 for treemanifests · 7cbb3a01
      Martin von Zweigbergk authored
      The newly created helper changegroup.safeversion() knows to pick
      version 03 if the repo uses treemanifests, so just using that means we
      pick the right changegroup version.
      7cbb3a01
    • Martin von Zweigbergk's avatar
      changegroup: introduce safeversion() · 3b2ac211
      Martin von Zweigbergk authored
      In a few places (at least repair.py and shelve.py), we want to find
      the best changegroup version that we can assume users of the repo will
      understand. For example, we choose version 01 by default, but if it's
      a generaldelta repo, we expect clients to support version 02 anyway,
      so we choose that for new bundles (for e.g. "hg strip"). Let's create
      a helper for this functionality in changegroup, so we can reuse it
      elsewhere later.
      3b2ac211
    • Martin von Zweigbergk's avatar
      changegroup: don't support versions 01 and 02 with treemanifests · c0f11347
      Martin von Zweigbergk authored
      Since it would be terribly expensive to convert between flat manifests
      and treemanifests, we have decided to simply not support changegroup
      version 01 and 02 with treemanifests. Therefore, let's stop announcing
      that we support these versions on treemanifest repos.
      
      Note that this means that older clients that try to clone from a
      treemanifest repo will fail. What happens is that the server, after
      this patch, finds that there are no common versions and raises
      "ValueError: no common changegroup version". This results in "abort:
      HTTP Error 500: Internal Server Error" on the client.
      
      Before this patch, it was no better: The server would instead find
      that there were directory manifest nodes to put in the changegroup 01
      or 02 and raise an AssertionError on changegroup.py#668 (assert not
      tmfnodes), which would also appear as a 500 to the client.
      c0f11347
    • Laurent Charignon's avatar
      run-tests: fix crash when --json and --blacklist are both used (issue5050) · 0de4dfc9
      Laurent Charignon authored
      This patch fixes a crash when both --json and --blacklist were given as
      arguments of run-tests.py. Now, instead of crashing, we add an entry for
      blacklisted tests in the json output to show that the tests were skipped.
      0de4dfc9
  6. Jan 21, 2016
    • Laurent Charignon's avatar
      run-tests: fix race condition · 4c6053a6
      Laurent Charignon authored
      Before this patch, it was possible for run-tests to crash on a race condition.
      The race condition happens in the following case:
      - the last test finishes and calls: done.put(None)
      - the context switches to the main thread that clears the channels list
      - the context switches to the last test mentioned above, it tries to access
      channels[channel] and crashes
      This happened to me while running run-tests.
      
      This patch fixes the issue by clearing the channel before considering that the
      test is done.
      4c6053a6
    • timeless's avatar
      copyright: update to 2016 · f6d73c87
      timeless authored
      f6d73c87
  7. Jan 19, 2016
    • Durham Goode's avatar
      transaction: abort transaction during hook exception · 24361fb6
      Durham Goode authored
      The new transaction context did not handle the case where an exception during
      close should still call release. This cause pretxnclose hooks that failed to
      cause the transaction to fail without aborting, thus requiring a hg recover.
      
      I've added a test.
      24361fb6
  8. Jan 21, 2016
  9. Jan 20, 2016
    • Martin von Zweigbergk's avatar
      changegroup: cg3 has two empty groups *after* manifests · da5f2336
      Martin von Zweigbergk authored
      changegroup.getchunks() determines the end of the stream by looking
      for an empty chunk group (two consecutive empty chunks). It ignores
      empty groups in the first two groups. Changegroup 3 introduced an
      empty chunk between the manifests and the files, which confuses
      getchunks(). Since it comes after the first two, getchunks() will stop
      there.
      
      Fix by rewriting getchunks so it first counts two groups (empty or
      not) and then keeps antostarts counting empty groups. With this counting,
      changegroup 1 and 2 have exactly one empty group after the first two
      groups, while changegroup 3 has two (one for directories and one for
      files).
      
      It's a little hard to test this at this point, but I have verified
      that this patch fixes narrowhg (which was broken before this
      patch). Also, future patches will fix "hg strip" with treemanifests,
      and once that's done, getchunks() will be tested through tests of "hg
      strip".
      da5f2336
  10. Jan 19, 2016
  11. Jan 20, 2016
  12. Jan 19, 2016
    • Yuya Nishihara's avatar
      commandserver: drop tell() and seek() from channels (issue5049) · 5f2a308b
      Yuya Nishihara authored
      These operations are obviously invalid for file-like channels because they
      will read or write protocol headers.
      
      This patch works around the issue that "hg archive" generates a corrupted
      zip file on Windows commandserver because of unusable tell() implementation.
      But the problem still occurs without using a commandserver.
      
        $ hg archive -R not-small-repo -t zip - | cat > invalid.zip
      
      So, this patch cannot fix the issue5049 completely.
      5f2a308b
  13. Jan 20, 2016
    • Laurent Charignon's avatar
      crecord: edit during hg crecord should preserve cursor position (issue5041) · 505a10b5
      Laurent Charignon authored
      This patch adds a variable to keep track of what hunk was selected
      before the edit. We use that variable to select the hunk or its
      replacement after the edit.
      505a10b5
    • Katsunori FUJIWARA's avatar
      templates: use canvaswidth instead of fixed width for canvas (issue2683) · 91ac8cb7
      Katsunori FUJIWARA authored
      Before this patch, template files for "graph" web page use fixed width
      size "480" for canvas element.
      
      This causes pruned lanes and invisible vertexes, if there are 16 or
      more vertical lanes at once. In such case, part of graph in right side
      area over 480 is invisible, even though corresponded summary text
      blocks are visible correctly.
      
      This limitation isn't reasonable for workflow using many branches at
      once (e.g. "one branch per issue" workflow).
      
      There were changes below related to width of canvas:
      
        - 7359cb753a54 (templates: widen the graph canvas (issue2683)),
          released as a part of Mercurial 1.8.2
      
          According to the description, this assumed that 15 parallel
          branches was enough for ordinary workflow, and bumped width of
          canvas up from 224 to 480.
      
        - d490edc71146 (hgweb: make graph data suitable for template usage),
          released as a part of Mercurial 2.3
      
          This introduced "canvaswidth" template keyword as a part of
          refactoring around graph rendering.
      
          But 'width="480"' of canvas element in template files wasn't
          replaced by 'width="{canvaswidth}"' in it (or subsequent one).
      
      This patch uses dynamic value "{canvaswidth}" instead of fixed width
      size "480" for canvas element.
      
      This is posted for "stable", because:
      
        - this is re-fixing issue2683
      
        - this is simple enough for stable
      
        - using "{canvaswidth}" doesn't require any additional cost
      
          Calculation of canvaswidth is already implied as a part of "graph"
          web command.
      91ac8cb7
    • Ruslan Sayfutdinov's avatar
      ae4e6b80
  14. Jan 19, 2016
    • Durham Goode's avatar
      bundle: exit early when there are no commits to bundle · 645e7884
      Durham Goode authored
      Previously, if you passed a revset that resolved to no nodes, it would get
      interpreted by the changegroup discovery logic as 'bundle all my heads', which
      is not what the user asked.
      
      Let's exit early when we notice this case.
      
      It could be argued that the changeset discovery logic should be smarter and only
      assume 'all heads' if the incoming heads parameter is None, but that's a much
      riskier change.
      645e7884
  15. Jan 18, 2016
  16. Jan 14, 2016
    • Simon Farnsworth's avatar
      shelve: permit shelves to contain unknown files · d73a5ab1
      Simon Farnsworth authored
      If an emergency comes in while you're in the middle of an experimental
      change, it can be useful to shelve not just files hg already tracks but
      also your unknown files while you handle the emergency. This is
      especially true if you have hooks intended to prevent you from
      forgetting to add new code before you push.
      
      Teach "hg shelve" to optionally shelve unknown files, not just tracked
      files. This is functionally similar to --addremove, but with two
      differences:
      
       1) Deleted files are not removed.
       2) Files added during shelve creation are tracked in extra so that they
          can be forgotten by "hg unshelve".
      
      When unshelving, we take care to only forget files if they've been
      created during the unshelve operation; if you add a file that's being
      tracked in a shelve as an unknown file, it should not become unknown
      again when the shelve is unshelved.
      d73a5ab1
  17. Jan 17, 2016
    • Gregory Szorc's avatar
      localrepo: don't reference transaction from hook closure (issue5043) · e219dbfd
      Gregory Szorc authored
      Before, the hook() closure (which is called as part of locking hooks)
      would maintain a reference to a transaction instance (which should be
      finalized by the time lock hooks are called). Because we accumulate
      hook() instances when there are multiple transactions per lock, this
      would result in holding references to the transaction instances which
      would lead to higher memory utilization.
      
      Creating a reference to the hook arguments dict minimizes the number
      of objects that are kept alive until the lock release hook runs,
      minimizing memory "leaks."
      e219dbfd
    • Gregory Szorc's avatar
      context: don't use util.cachefunc due to cycle creation (issue5043) · c183f7b7
      Gregory Szorc authored
      util.cachefunc stores all arguments as the cache key. For filectxfn
      functions, the arguments include the memctx instance. This creates a
      cycle where memctx._filectxfn references self. This causes a memory
      leak.
      
      We break the cycle by implementing our own memoizing function that
      only uses the path as the cache key. Since each memctx has its own
      cache instance, there is no concern about invalid cache hits.
      c183f7b7
    • Mads Kiilerich's avatar
    • Mads Kiilerich's avatar
      largefiles: make prompt order deterministic · ee3123e1
      Mads Kiilerich authored
      42ae1b1f048f introduced iteration of a set. Make it stable.
      ee3123e1
    • Mads Kiilerich's avatar
      largefiles: fix commit of missing largefiles · 512a814c
      Mads Kiilerich authored
      832c98d79587 improved merging of standin files referencing missing largefiles.
      It did however not test or fix commits of such merges; it would abort.
      
      To fix that, change copytostore to skip and warn about missing largefiles
      with a message similar the one for failing get from remote filestores. (It
      would perhaps in both cases be better to emit a more helpful warning like
      "warning: standin file for large1 references 58e24f733a which can't be found in
      the local store".)
      
      To test this, make sure commit doesn't find the "missing" largefile in the global
      usercache. For further testing, verify that update and status works as expected
      after this.
      
      This will also effectively backout 63116d47cc3f.
      512a814c
  18. Jan 14, 2016
    • Martin von Zweigbergk's avatar
      diff: don't crash when merged-in addition is copied · 51b6ce25
      Martin von Zweigbergk authored
      Similar to what was explained in the previous commit, the diff code
      expected copy source to be in "ctx1", which is not always the case
      during a merge. This has been broken since before hg 2.0.
      
      Also similar to the previous commit, we fix the problem by fixing up
      the copy dict.
      51b6ce25
    • Martin von Zweigbergk's avatar
      diff: don't crash when merged-in addition was removed (issue4786) · 29c8e35d
      Martin von Zweigbergk authored
      During a merge, if the user removes a file that came from parent 2 and
      did not exist in parent 1, the file's status will be "removed". This
      surprises the diff code, which crashes because it expects removed
      files exist in parent 1. This has been broken since 377124ba6b10
      (trydiff: use 'not in addedset' for symmetry with 'not in removedset',
      2014-12-23).
      
      Fix by fixing up the list of removed file, similar to how we currently
      fix up the list of modified and added files during a merge.
      29c8e35d
    • Martin von Zweigbergk's avatar
      diff: move status fixup earlier, out of _filepairs() · 27572a5c
      Martin von Zweigbergk authored
      This prepares for future patches, and it also lets us remove the ugly
      "ctx1" argument to _filepairs() (ugly because of its assymmetry --
      there's no "ctx2" argument).
      27572a5c
  19. Jan 17, 2016
    • Mads Kiilerich's avatar
      graft: warn when -r is combined with revisions as positional arguments · 78b9fdb8
      Mads Kiilerich authored
      The behaviour in this case is undefined. Instead of silently doing something
      "random" and surprising, at least issue a warning.
      
      (This should perhaps be considered a "deprecation" and turned into an error in
      a future release.)
      78b9fdb8
    • Mads Kiilerich's avatar
      graft: clarify in help that `-r` is not just optional · 2cc44efc
      Mads Kiilerich authored
      Positional parameters are also treated as revisions, but the order of revisions
      matters and it will often be wrong if the user understands it as `-r` taking
      multiple revisions as `-r REV1 REV2`.
      
      (Alternatively, `-r` could be turned into a no-op flag as the documentation
      suggests. That would however be less "semantic markup" and I agree with the
      implementation in 55e7f352b1d3 but not the documentation.)
      2cc44efc
Loading