Skip to content
Snippets Groups Projects
  1. Jan 28, 2016
  2. Jan 29, 2016
    • Siddharth Agarwal's avatar
      merge: don't try to merge subrepos twice (issue4988) · 6bce6d925e45
      Siddharth Agarwal authored
      In my patch series ending with rev 25e4b2f000c5 I switched most change/delete
      conflicts to be handled at the resolve layer. .hgsubstate was the one file that
      we weren't able to handle, so we kept the old code path around for it.
      
      The old code path added .hgsubstate to one of the other lists as the user
      specifies, including possibly the 'g' list.
      
      Now since we did this check after converting the actions from being keyed by
      file to being keyed by action type, there was nothing that actually removed
      .hgsubstate from the 'cd' or 'dc' lists. This meant that the file would
      eventually make its way into the 'mergeactions' list, now freshly augmented
      with 'cd' and 'dc' actions.
      
      We call subrepo.submerge for both 'g' actions and merge actions.
      
      This means that if the resolution to an .hgsubstate change/delete conflict was
      to add it to the 'g' list, subrepo.submerge would be called twice. It turns out
      that this doesn't cause any adverse effects on Linux due to caching, but
      apparently breaks on other operating systems including Windows.
      
      The fix here moves this to before we convert the actions over. This ensures
      that it .hgsubstate doesn't make its way into multiple lists.
      
      The real fix here is going to be:
      (1) move .hgsubstate conflict resolution into the resolve layer, and
      (2) use a real data structure for the actions rather than shuffling data around
          between lists and dictionaries: we need a hash (or prefix-based) index by
          file and a list index by action type.
      
      There's a very tiny behavior change here: collision detection on
      case-insensitive systems will happen after this is resolved, not before. I think
      this is the right change -- .hgsubstate could theoretically collide with other
      files -- but in any case it makes no practical difference.
      
      Thanks to Yuya Nishihara for investigating this.
      6bce6d925e45
  3. Jan 27, 2016
    • Nathan Goldbaum's avatar
      f0d3c5794380
    • Siddharth Agarwal's avatar
      merge: undocument checkunknown and checkignored configs for 3.7 · 7b7e16158c35
      Siddharth Agarwal authored
      We've discovered an issue with this flag during certain kinds of rebases. When:
      
      (1) we're rebasing while currently on the destination commit, and
      (2) an untracked or ignored file F is currently in the working copy, and
      (3) the same file F is in a source commit, and
      (4) F has different contents in the source commit,
      
      then we'll try to merge the file rather than overwrite it.
      
      An earlier patch I sent honored the options for these situations as well.
      Unfortunately, rebases go through the same flow as the old, deprecated 'hg
      merge --force'. We'd rather not make any changes to 'hg merge --force'
      behavior, and there's no way from this point in the code to figure out whether
      we're in 'hg rebase' or 'hg merge --force'.
      
      Pierre-Yves David and I came up with the idea to split the 'force' flag up into
      'force' for rebases, and 'forcemerge' for merge. Since this is a very
      disruptive change and we're in freeze mode, simply undocument the options for
      this release so that our hands aren't tied by BC concerns. We'll redocument
      them in the next release.
      7b7e16158c35
  4. Jan 28, 2016
    • Katsunori FUJIWARA's avatar
      commands: advance current active bookmark at pull --update correctly · 7cb7264cfd52
      Katsunori FUJIWARA authored
      Before this patch, "hg pull --update" doesn't advance current active
      bookmark correctly, if pulling itself doesn't advance it, even though
      "hg pull" + "hg update" does so.
      
      Existing test for "pull --update works the same as pull && update" in
      test-bookmarks.t doesn't examine this case, because pulling itself
      advance current active bookmark before actual updating the working
      directory in that test case.
      
      To advance current active bookmark at "hg pull --update" correctly,
      this patch examines 'movemarkfrom' instead of 'not checkout'.
      
      Even if 'not checkout' at the invocation of postincoming(), 'checkout'
      is overwritten by "the revision to update to" value returned by
      destutil.destupdate() in such case. Therefore, 'not checkout'
      condition means "update destination is revision #0", and isn't
      suitable for examining whether active bookmark should be advanced.
      
      Even though examination around "movemarkfrom == repo['.'].node()" may
      seem a little redundant just for this issue, this makes it easier to
      compare (and unify in the future, maybe) with the same logic to update
      bookmark at "hg update" below.
      
              if not ret and movemarkfrom:
                  if movemarkfrom == repo['.'].node():
                      pass # no-op update
                  elif bookmarks.update(repo, [movemarkfrom], repo['.'].node()):
                      ui.status(_("updating bookmark %s\n") % repo._activebookmark)
                  else:
                      # this can happen with a non-linear update
                      ui.status(_("(leaving bookmark %s)\n") %
                                repo._activebookmark)
                      bookmarks.deactivate(repo)
      7cb7264cfd52
  5. Jan 24, 2016
    • Matt Harbison's avatar
      largefiles: prevent committing a missing largefile · 571ba161f6be
      Matt Harbison authored
      Previously, if the largefile was deleted at the time of a commit, the standin
      was silently not updated and its current state (possibly garbage) was recorded.
      The test makes it look like this is somewhat of an edge case, but the same thing
      happens when an `hg revert` followed by `rm` changes the standin.
      
      Aside from the second invocation of this in lfutil.updatestandinsbymatch()
      (which is what triggers this test case), the three other uses are guarded by
      dirstate checks for added or modified, or an existence check in the filesystem.
      So aborting in lfutil.updatestandins() should be safe, and will avoid silent
      skips in the future if this is used elsewhere.
      571ba161f6be
  6. Jan 27, 2016
    • Augie Fackler's avatar
      changegroup: fix treemanifest exchange code (issue5061) · ca8d2b73155d
      Augie Fackler authored
      There were two mistakes: one was accidental reuse of the fclnode
      variable from the loop gathering file nodes, and the other (masked by
      that bug) was not correctly handling deleted directories. Both cases
      are now fixed and the test passes.
      ca8d2b73155d
  7. Jan 22, 2016
    • Matt Mackall's avatar
      log: speed up single file log with hidden revs (issue4747) · 4186d359046a
      Matt Mackall authored
      On repos with lots of heads, the filelog() code could spend several
      minutes decompressing manifests. This change instead tries to
      efficiently scan the changelog for candidates and decompress as few
      manifests as possible. This is a regression introduced in 3.3 by the
      linkrev adjustment code. Prior to that, filelog was nearly instant.
      
      For the repo in the bug report, this improves time of a simple log
      command from ~3 minutes to ~.5 seconds, a 360x speedup.
      
      For the main Mercurial repo, a log of commands.py slows down from
      1.14s to 1.45s, a 27% slowdown. This is still faster than the file()
      revset, which takes 2.1 seconds.
      4186d359046a
  8. Jan 24, 2016
  9. Jan 25, 2016
    • Martin von Zweigbergk's avatar
      context: back out sneaky code change in documentation change · 75fa75d31495
      Martin von Zweigbergk authored
      In 81b391a45264 (context: clarify why we don't compare file contents
      when nodeid differs, 2016-01-12), I also changed "node2 != _newnode"
      into "self.rev() is not None". I don't remember why. They are similar,
      but the former also catches the case where the file is clean in the
      dirstate (so node2 is not _newnode), but different from the "other"
      context. This resulted in unnecessary file content comparison a few
      lines further down in the code. Let's just back out the code change.
      
      Thanks to Durham Goode for spotting this.
      75fa75d31495
  10. Jul 23, 2015
    • Yuya Nishihara's avatar
      templater: abort if infinite recursion detected while compiling · cfe7da66f555
      Yuya Nishihara authored
      In this case, a template is parsed recursively with no thunk for lazy
      evaluation. This patch prevents recursion by putting a dummy of the same name
      into a cache that will be referenced while parsing if there's a recursion.
      
        changeset = {files % changeset}\n
                             ~~~~~~~~~
                              = [(_runrecursivesymbol, 'changeset')]
      cfe7da66f555
  11. Jul 22, 2015
  12. Jan 23, 2016
  13. Jan 25, 2016
    • Laurent Charignon's avatar
      crecord: fix help bar display issue (issue5063) · 3d3b4ac369f2
      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.
      3d3b4ac369f2
    • Laurent Charignon's avatar
      crecord: fix typo in the help text · fedd81659643
      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.
      fedd81659643
  14. Jan 18, 2016
    • Mason Malone's avatar
      subrepo: better error messages in _ensuregit · 594bdc380aa2
      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.
      594bdc380aa2
  15. Jan 23, 2016
    • Anton Shestakov's avatar
      hgweb: update canvas.width before dynamically redrawing graph (issue2683) · 1779ff7426c9
      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.
      1779ff7426c9
  16. Jan 22, 2016
  17. Jan 19, 2016
    • Martin von Zweigbergk's avatar
      shelve: use cg3 for treemanifests · 1289a122cf3f
      Martin von Zweigbergk authored
      Similar to previous change, this teaches shelve to pick the right
      changegroup version for repos that use treemanifests.
      1289a122cf3f
    • Martin von Zweigbergk's avatar
      repair: use cg3 for treemanifests · 7cbb3a01fa38
      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.
      7cbb3a01fa38
    • Martin von Zweigbergk's avatar
      changegroup: introduce safeversion() · 3b2ac2115464
      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.
      3b2ac2115464
    • Martin von Zweigbergk's avatar
      changegroup: don't support versions 01 and 02 with treemanifests · c0f11347b107
      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.
      c0f11347b107
    • Laurent Charignon's avatar
      run-tests: fix crash when --json and --blacklist are both used (issue5050) · 0de4dfc9af0c
      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.
      0de4dfc9af0c
  18. Jan 21, 2016
    • Laurent Charignon's avatar
      run-tests: fix race condition · 4c6053a6b17d
      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.
      4c6053a6b17d
    • timeless's avatar
      copyright: update to 2016 · f6d73c8756e2
      timeless authored
      f6d73c8756e2
  19. Jan 19, 2016
    • Durham Goode's avatar
      transaction: abort transaction during hook exception · 24361fb68cba
      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.
      24361fb68cba
  20. Jan 21, 2016
  21. Jan 20, 2016
    • Martin von Zweigbergk's avatar
      changegroup: cg3 has two empty groups *after* manifests · da5f23362517
      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".
      da5f23362517
  22. Jan 19, 2016
  23. Jan 20, 2016
  24. Jan 19, 2016
    • Yuya Nishihara's avatar
      commandserver: drop tell() and seek() from channels (issue5049) · 5f2a308bac94
      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.
      5f2a308bac94
  25. Jan 20, 2016
    • Laurent Charignon's avatar
      crecord: edit during hg crecord should preserve cursor position (issue5041) · 505a10b504ed
      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.
      505a10b504ed
    • Katsunori FUJIWARA's avatar
      templates: use canvaswidth instead of fixed width for canvas (issue2683) · 91ac8cb79125
      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.
      91ac8cb79125
Loading