Skip to content
Snippets Groups Projects
  1. Sep 16, 2017
  2. Aug 24, 2017
    • Pulkit Goyal's avatar
      uncommit: move fb-extension to core which uncommits a changeset · da2f5f19
      Pulkit Goyal authored
      uncommit extension in fb-hgext adds a uncommit command which by default
      uncommits a changeset and move all the changes to the working directory. If
      file names are passed, uncommit moves the changes from those files to the
      working directory and left the changeset with remaining committed files.
      
      The uncommit extension in fb-hgext does not creates an empty commit like the one
      in evolve extension unless user has specified ui.alllowemptycommit to True.
      
      The test file added is a combination of tests from test-uncommit.t,
      test-uncommit-merge.t and test-uncommit-bookmark.t from fb-hgext.
      
      .. feature::
      
         A new uncommit extension which provides `hg uncommit` using which one can
         uncommit part or all of the changeset. This command undoes the effect of a
         local commit, returning the affected files to their uncommitted state.
      
      Differential Revision: https://phab.mercurial-scm.org/D529
      da2f5f19
  3. Sep 14, 2017
    • Gregory Szorc's avatar
      show: use consistent (and possibly shorter) node lengths · e6b5e732
      Gregory Szorc authored
      `hg show` makes heavy use of shortest() to limit the length of the node
      hash.
      
      For the "stack" and "work" views, you are often looking at multiple
      lines of similar output for "lines" of work. It is visually appeasing
      for things to vertically align. A naive use of {shortest(node, N)}
      could result in variable length nodes and for the first character of
      the description to vary by a column or two.
      
      We implement a function to determine the longest shortest prefix for
      a set of revisions. The new function is used to determine the printed
      node length for all `hg show` views.
      
      .. feature::
      
         show: use consistent node length in views
      
      Our previous shortest node length of 5 was arbitrarily chosen.
      
      shortest() already does the work of ensuring that a partial node
      isn't ambiguous with an integer revision, which is our primary risk
      of a collision for very short nodes. It should be safe to go with the
      shortest node possible.
      
      Existing code is also optimized to handle nodes as short as 4.
      
      So, we decrease the minimum hash length from 5 to 4.
      
      We also add a test demonstrating that prefix collisions increase the
      node length.
      
      .. feature::
      
         show: decrease minimum displayed hash length from 5 to 4
      
      Differential Revision: https://phab.mercurial-scm.org/D558
      e6b5e732
  4. Aug 04, 2017
  5. Sep 04, 2017
    • Boris Feld's avatar
      extensions: factor extra data loading out · f7c9c5d8
      Boris Feld authored
      Some of the extra data need to be registered earlier than they currently are
      (eg: config items). We first factor out the logic to registered them in a small
      function before reusing it in the next changeset.
      f7c9c5d8
  6. Sep 02, 2017
    • Pulkit Goyal's avatar
      copytrace: move fast heuristic copytracing algorithm to core · 036d47d7
      Pulkit Goyal authored
      copytrace extension in fb-hgext has a heuristic implementation of copy tracing
      which is faster than the current copy tracing. The heuristic limits the search
      of copies to just files that are either:
      
      1) Renames in the same directory
      2) Moved to other directory with same name
      
      The default copytrace implementation is very slow as it finds all the new files
      that were added from merge base up to the head commit and for each file it
      checks whether it this was copied or moved version of a different file.
      
      Stash@fb did analysis for the above heuristics on the fb repo and found that
      among 2,443,768 moves/copies there are only 32,234 moves/copies which does not
      fall under the above heuristics which is approx. 0.013 of total copies.
      
      This patch moves the heuristics algorithm under config
      `experimental.copytrace=heuristics`.
      
      While moving fbext to core, this patch removes couple of less useful config
      options named `sourcecommitlimit` and `maxmovescandidatestocheck`.
      
      Tests are also added for the heuristics algorithm, which are basically copied
      from fbext/tests/test-copytrace.t. The tests follow a pattern creating a server
      repo and then cloning to a local repo to create public and draft changesets, the
      distinction which will be useful in upcoming patches.
      
      After this patch `experimental.copytrace` has the following behaviour:
      
      1) `off`: turns off copytracing
      2) `heuristics`: use the heuristic algorithm added in this patch.
      3) everything else: use the full copytracing algorithm
      
      .. feature::
      
         A new fast heuristic algorithm for copytracing which assumes that the files
         moves are either::
         1) Renames in the same directory
         2) Moves in other directories with same names
         You can use this algorithm by setting `experimental.copytrace=heuristics`.
      
      Differential Revision: https://phab.mercurial-scm.org/D623
      036d47d7
  7. Sep 13, 2017
    • Durham Goode's avatar
      changegroup: remove changegroup dependency from revlog.addgroup · c8b6ed51
      Durham Goode authored
      Previously revlog.addgroup would accept a changegroup and a linkmapper and use
      it to iterate of the deltas. As part of untangling the revlog-changegroup
      interdependency, let's move the changegroup delta iteration logic to it's own
      function and pass the simple iterator to the revlog instead.
      
      This will make it easier to introduce non-revlogs stores in the future, without
      reinventing any changegroup specific logic.
      
      Differential Revision: https://phab.mercurial-scm.org/D688
      c8b6ed51
  8. Sep 11, 2017
    • Mark Thomas's avatar
      scmutil: don't append .orig to backups in origbackuppath (BC) · 9e4f82bc
      Mark Thomas authored
      When ui.origbackuppath is set, .orig files are stored outside of the working
      copy, however they still have a .orig suffix appended to them.  This can cause
      unexpected conflicts, particularly when tracked files or directories have .orig
      at the end.
      
      This change removes the .orig suffix from files stored in an out-of-tree
      origbackuppath.
      
      Test Plan:
      Update and run unit tests.
      
      Differential Revision: https://phab.mercurial-scm.org/D679
      9e4f82bc
  9. Sep 03, 2017
  10. Aug 24, 2017
  11. Sep 07, 2017
  12. Sep 10, 2017
  13. Sep 12, 2017
  14. Sep 11, 2017
  15. Sep 07, 2017
    • Jun Wu's avatar
      blackbox: fix rotation with chg · 4f60720c
      Jun Wu authored
      The added test will show:
      
        $ $PYTHON showsize.py .hg/blackbox*
        .hg/blackbox.log: < 500
        .hg/blackbox.log.1: < 500
        .hg/blackbox.log.2: < 500
        .hg/blackbox.log.3: < 500
        .hg/blackbox.log.4: < 500
        .hg/blackbox.log.5: >= 500
      
      with previous code.
      
      The issue is caused by blackbox caching file objects *by path*, and the
      rotation size check could run on a wrong file object (i.e. it should check
      "blackbox.log", but `filehandles["blackbox.log"]` contains a file object
      that has been renamed to "blackbox.log.5").
      
      This patch removes the "filehandlers" global cache added by 45313f5a3a8c to
      solve the issue.
      
      I think the original patch was trying to make different ui objects use a same
      file object if their blackbox.log path is the same. In theory it could also
      be problematic in the rotation case. Anyway, that should become unnecessary
      after D650.
      
      Differential Revision: https://phab.mercurial-scm.org/D648
      4f60720c
    • Jun Wu's avatar
      test-blackbox: make it compatible with chg · 06eb3de4
      Jun Wu authored
      Differential Revision: https://phab.mercurial-scm.org/D647
      06eb3de4
  16. Sep 11, 2017
  17. Sep 06, 2017
  18. Sep 10, 2017
    • kiilerix's avatar
      mq: create non-lossy patches, also with custom global diff configuration · 987a85c4
      kiilerix authored
      Users with custom [diff] configuration most certainly didn't intend it to make
      mq lose changes. It could:
      
       * git is handled perfectly fine.
      
       * nobinary could make mq leave some files out from the patches.
      
       * noprefix could make mq itself (and probably also other tools) fail to apply
         patches without the usual a/b prefix.
      
       * ignorews, ignorewsamount, or ignoreblanklines could create patches with
         missing whitespace that could fail to apply correctly.
      
      Thus, when refreshing patches, use patch.difffeatureopts, optionally with git
      as before, but without the config options for whitespace and format changing
      that most likely will cause loss or problems.
      
      (patch.diffopts is just patch.difffeatureopts with all options enabled and can
      be replaced with that.)
      987a85c4
    • kiilerix's avatar
  19. Sep 01, 2017
    • Saurabh Singh's avatar
      cmdutil: remove redundant commitfunc parameter in amend (API) · a39dce4a
      Saurabh Singh authored
      Since the redundant commit during the amend has been been removed, there is no
      need for commit callback function in amend now. Therefore, this commit removes
      the unused parameter "commmitfunc" which was being used for this purpose.
      
      Test Plan:
      Ensured that all the tests pass
      
      Differential Revision: https://phab.mercurial-scm.org/D635
      a39dce4a
    • Saurabh Singh's avatar
      cmdutil: remove the redundant commit during amend · e8a7c1a0
      Saurabh Singh authored
      There was an extra commit made during the amend operation to track the
      changes to the working copy. However, this logic was written a long time back
      and newer API's make this extra commit redundant. Therefore, I am removing the
      extra commit. After this change, I noticed that
      
        - Execution time of the cmdutil.amend improved by over 40%.
        - Execution time of "hg commit --amend" improved by over 20%.
      
      Test Plan:
      I ensured that the all the hg tests passed after the change. I had
      to fix a few tests which were aware of the extra commit made during the amend.
      
      Differential Revision: https://phab.mercurial-scm.org/D636
      e8a7c1a0
  20. Sep 02, 2017
    • Pulkit Goyal's avatar
      copytrace: move the default copytracing algorithm in a new function · b4b19609
      Pulkit Goyal authored
      We are going to introduce a new fast heuristic based copytracing algorithm, so
      lets make mergecopies the function which decides which algorithm to go with and
      then calls the related function.
      
      While I was here, I add a line in test-copy-move-merge.t saying its a test
      related to the full copytracing algorithm.
      
      Differential Revision: https://phab.mercurial-scm.org/D622
      b4b19609
    • Pulkit Goyal's avatar
      copytrace: replace experimental.disablecopytrace config with copytrace (BC) · 26531db4
      Pulkit Goyal authored
      This patch replaces experimental.disablecopytrace with experimental.copytrace.
      Since the words does not means the same, the default value is also changed. Now
      experimental.copytrace defaults to 'on'. The new value is not boolean value as
      we will be now having two different algorithms (current one and heuristics one
      to be imported from fbext) so we need this to be have more options than
      booleans.
      
      The old config option is not kept is completely replaced as that was under
      experimental and we don't gurantee BC to experimental things.
      
      .. bc::
      
         The config option for copytrace `experimental.disablecopytrace` is now
         replaced with `experimental.copytrace` which defaults to `on`. If you need to
         turn off copytracing, add `[experimental] copytrace = off` to your config.
      
      Differential Revision: https://phab.mercurial-scm.org/D621
      26531db4
  21. Aug 31, 2017
    • the31k's avatar
      branches: correctly show inactive multiheaded branches · abf91c4f
      the31k authored
      Issue being fixed here: `hg branches` incorrectly renders inactive multiheaded
      branches as active if they have closed heads.
      
      Example:
      
      ```
      $ hg log --template '{rev}:{node|short} "{desc}" ({branch}) [parents: {parents}]\n'
      4:2e2fa7af8357 "merge" (default) [parents: 0:c94e548c8c7d 3:7be622ae5832 ]
      3:7be622ae5832 "2" (somebranch) [parents: 1:81c1d9458987 ]
      2:be82cf30409c "close" (somebranch) [parents: ]
      1:81c1d9458987 "1" (somebranch) [parents: ]
      0:c94e548c8c7d "initial" (default) [parents: ]
      
      $ hg branches
      default                        4:2e2fa7af8357
      somebranch                     3:7be622ae5832
      ```
      
      Branch `somebranch` have two heads, the 1st one being closed (rev 2) and
      the other one being merged into default (rev 3). This branch should be shown as
      inactive one.
      
      This happens because we intersect branch heads with repo heads to check branch
      activity. In this case intersection in a set with one node (rev 2). This head
      is closed but the branch is marked as active nevertheless.
      
      Fix is to check branch activity by intersecting only open heads set.
      
      Fixed output:
      
      ```
      $ hg branches
      default                        4:2e2fa7af8357
      somebranch                     3:7be622ae5832 (inactive)
      ```
      
      Relevant tests for multihead branches added to test-branches suite.
      
      Implentation note about adding `iteropen` method:
      
      At first I have tried to modify `iterbranches` is such a way that it would
      filter out closed heads itself. For example it could have `closed=False`
      parameter. But in this case we would have to filter closed tips as well.
      Reasoning in terms of `hg branches` we actually are not allowed to do this.
      
      Also, we need to do heads filtering only if tip is not closed itself. But if it
      is - we are ok to skip filtering, because branch is already known to be inactive.
      
      So we can't implement heads filtering in `iterbranches` in elegant way, because
      we will end up with something like `closed_heads=False` or even
      `closed_heads_is_tip_is_open`. Finally I decided to move this logic to the
      `branches` function, adding `iteropen` helper method.
      
      Differential Revision: https://phab.mercurial-scm.org/D583
      abf91c4f
  22. Sep 03, 2017
  23. Aug 28, 2017
    • Jun Wu's avatar
      revset: optimize "draft() & ::x" pattern · c6c8a52e
      Jun Wu authored
      The `draft() & ::x` type query could be common for selecting one or more
      draft feature branches being worked on.
      
      Before this patch, `::x` may travel through the changelog DAG for a long
      distance until it gets a smaller revision number than `min(draft())`. It
      could be very slow on long changelog with distant (in terms of revision
      numbers) drafts.
      
      This patch adds a fast path for this situation, and will stop traveling the
      changelog DAG once `::x` hits a non-draft revision.
      
      The fast path also works for `secret()` and `not public()`.
      
      To measure the performance difference, I used drawdag to create a repo that
      emulates distant drafts:
      
                DRAFT4
                 |
                DRAFT3 # draft
                /
        PUBLIC9999 # public
            |
        PUBLIC9998
            |
            .   DRAFT2
            .    |
            .   DRAFT1 # draft
            |   /
        PUBLIC0001 # public
      
      And measured the performance using the repo:
      
        (BEFORE)
        $ hg perfrevset 'draft() & ::(DRAFT2+DRAFT4)'
        ! wall 0.017132 comb 0.010000 user 0.010000 sys 0.000000 (best of 156)
        $ hg perfrevset 'draft() & ::(all())'
        ! wall 0.024221 comb 0.030000 user 0.030000 sys 0.000000 (best of 113)
        (AFTER)
        $ hg perfrevset 'draft() & ::(DRAFT2+DRAFT4)'
        ! wall 0.000243 comb 0.000000 user 0.000000 sys 0.000000 (best of 9303)
        $ hg perfrevset 'draft() & ::(all())'
        ! wall 0.004319 comb 0.000000 user 0.000000 sys 0.000000 (best of 655)
      
      Differential Revision: https://phab.mercurial-scm.org/D441
      c6c8a52e
  24. Sep 01, 2017
  25. Sep 02, 2017
  26. Sep 01, 2017
  27. Aug 29, 2017
    • Christophe de Vienne's avatar
      extensions: prohibit unicode defaults · 0e0ac8f0
      Christophe de Vienne authored
      If the default value of an option is a unicode string (something
      than happen easily when using a 'from __future__ import unicode_literals'),
      any value passed on the command line will be ignored because the fancyopts
      module only checks for byte strings and not unicode strings.
      
      Changing fancyopts behavior is easy but would make assumptions on how
      the python3 port should be done, which is outside the scope of this patch.
      
      The chosen approach is to stop an extension from being loaded when a unicode
      default value is detected, with a hint for the developer.
      0e0ac8f0
  28. Aug 03, 2017
  29. Aug 28, 2017
    • Jun Wu's avatar
      import-checker: allow relative import a module being checked · bc253523
      Jun Wu authored
      This would make the checker more friendly for 3rd-party code. For example,
      
      In remotefilelog/x.py, it may have:
      
          from . import shallowutils
      
      That could trigger "relative import of stdlib module" if
      "remotefilelog" was installed in the system. If the module being checked
      conflicts with the system module, it makes sense to not treat that module as
      system module. This patch makes it so.
      
      Differential Revision: https://phab.mercurial-scm.org/D552
      bc253523
Loading