Skip to content
Snippets Groups Projects
  1. Apr 18, 2014
  2. Aug 15, 2014
    • Mads Kiilerich's avatar
      bundle: when verbose, show what takes up the space in the generated bundle · 4ab66de4
      Mads Kiilerich authored
      This is kind of similar to the debugbundle command but gives summarized actual
      uncompressed number of bytes when creating the bundle. The numbers are as
      usable as the bundle format is efficient. Hopefully bundle2 will make it a
      better indicator of actual entropy.
      
      This is useful when accepting pull requests to assess whether the repo size
      increase seems reasonable for the diff before pushing stuff upstream, It has
      helped me catching large files that should have been committed as largefiles
      but was committed as regular files in intermediate changesets.
      
      This output doesn't combine well with debug output so we only enable it when
      verbose without debug.
      4ab66de4
  3. Jan 07, 2015
    • Pierre-Yves David's avatar
      setdiscovery: factorize similar sampling code · f82173a9
      Pierre-Yves David authored
      We are using full sampling of 'fullsamplesize' in both case. The only
      difference is the debug message. So we factorise the sampling code and put the
      message in an extra conditional.
      
      This is going to help making changes around the sampling logic. Such changes are
      needed to improve discovery performance on highly headed repository.
      f82173a9
    • Pierre-Yves David's avatar
      setdiscovery: drop shadowed 'undecided' assignment · 4ef2f2fa
      Pierre-Yves David authored
      The 'undecided' variable was never used before being overwritten a few lines
      later.
      4ef2f2fa
    • Gregory Szorc's avatar
      hgweb: extract changelist entry generation into own function · 513d4790
      Gregory Szorc authored
      I want to supplement changelist entries (used by shortlog and changelog
      endpoints) with custom metadata from an extension. i.e. I have extra
      per-changeset metadata that I wish to make available to templates so it
      can be rendered on hgweb.
      
      To facilitate this, I've extracted the logic for creating a changeset
      data structure into its own function, where it can be wrapped by
      extensions.
      
      Ideally, hgweb would use the same templater as the command line and have
      full access to templatekw.keywords. But that's a lot of work. This patch
      gets us some of the benefit without all the work.
      
      Many other hgweb commands could benefit from similar refactorings. I'm
      going to wait to see how this patch is received before I go crazy on
      extracting inline functions.
      513d4790
  4. Jan 06, 2015
    • Gregory Szorc's avatar
      templates: use CSS classes for diff styling · d1933c2e
      Gregory Szorc authored
      Use of inline style for diff styling led to significant browser memory
      usage on large diffs. Moving the styling into CSS classes corrects this.
      
      This patch is based on work from
      https://bugzilla.mozilla.org/show_bug.cgi?id=766952
      and
      https://hg.mozilla.org/hgcustom/version-control-tools/rev/2c355a580af6
      d1933c2e
    • Gregory Szorc's avatar
      templates: remove unnecessary <span> · 606a3bf8
      Gregory Szorc authored
      The <span> on diffline was useless. It was only making browsers work
      harder. Remove it.
      606a3bf8
    • Katsunori FUJIWARA's avatar
      revset: introduce new operator "##" to concatenate strings/symbols at runtime · 3a4d8a6c
      Katsunori FUJIWARA authored
      Before this patch, there is no way to concatenate strings at runtime.
      
      For example, to search for the issue ID "1234" in descriptions against
      all of "issue 1234", "issue:1234", issue1234" and "bug(1234)"
      patterns, the revset below should be written fully from scratch for
      each issue ID.
      
          grep(r"\bissue[ :]?1234\b|\bbug\(1234\)")
      
      This patch introduces new infix operator "##" to concatenate
      strings/symbols at runtime. Operator symbol "##" comes from the same
      one of C pre-processor. This concatenation allows parametrizing a part
      of strings in revset queries.
      
      In the case of example above, the definition of the revset alias using
      operator "##" below can search issue ID "1234" in complicated patterns
      by "issue(1234)" simply:
      
          issue($1) = grep(r"\bissue[ :]?" ## $1 ## r"\b|\bbug\(" ## $1 ## r"\)")
      
      "##" operator does:
      
        - concatenate not only strings but also symbols into the string
      
          Exact distinction between strings and symbols seems not to be
          convenience, because it is tiresome for users (and
          "revset.getstring" treats both similarly)
      
          For example of revset alias "issue()", "issue(1234)" is easier
          than "issue('1234')".
      
        - have higher priority than any other prefix, infix and postfix
          operators (like as "##" of C pre-processor)
      
          This patch (re-)assigns the priority 20 to "##", and 21 to "(",
          because priority 19 is already assigned to "-" as prefix "negate".
      3a4d8a6c
  5. Nov 29, 2014
    • Matt Harbison's avatar
      largefiles: pass a matcher instead of a raw file list to removelargefiles() · f2893cd8
      Matt Harbison authored
      This is consistent with addlargefiles(), and will make it easier to get the
      paths that are printed correct when recursing into subrepos or invoking from
      outside the repository.  It also now restricts the path that the addremove is
      performed on if a path is given, as is done with normal files.
      
      The repo.status() call needs to exclude clean files when performing an
      addremove, because the addremove override method calling this used to pass the
      list of files to delete, which caused the matcher to only consider those files
      in building the status list.  Now the matcher is restricted only to the extent
      that the caller requested- usually directories if at all.  There's no reason for
      addremove to care about clean files anyway- we don't want them deleted.
      f2893cd8
  6. Jan 03, 2015
    • Anton Shestakov's avatar
      hgweb: allow viewing diffs against p1 or p2 for merge commits (issue3904) · 9e1f4c65
      Anton Shestakov authored
      This adds UI portion of the feature that has resided in mercurial since 2012.
      Back then the interface was added together with the code, but was shortly
      backed out because it was deemed "not ready". Code, however, stayed.
      
      For the original feature and its implementation, see issue2810 and
      d605a82cf189.
      
      In short, the backed-out interface had two outstanding issues:
      1. it was introducing an entirely new term (baseline) and
      2. it was present on every changeset's page, even for changesets with 1 parent
         (or no parents), which didn't make sense
      
      This patch implements a hopefully better interface because:
      1. it uses the usual terms (diff) and
      2. it only shows up when there actually are 2 parents.
      9e1f4c65
  7. Dec 21, 2014
  8. Jan 07, 2015
  9. Jan 06, 2015
  10. Dec 31, 2014
  11. Jan 04, 2015
    • Mads Kiilerich's avatar
      rebase: clarify comment about merge ancestor when rebasing merges · c51d6c04
      Mads Kiilerich authored
      The code for picking a merge ancestor when rebasing merges had a long and
      incorrect comment.
      
      The comment would perhaps have been fine as commit message but does
      not make the code more readable or maintainable and is a bad
      substitute for correct and readable code.
      
      The correct essense of the comment is quite trivial: a merge of an ancestor of
      the rebase destination and an 'outside' revision can be rebased as if it was a
      linear change, using 'destination ancestor parent' as base and pretty much
      ignoring the 'outside' revision.
      
      The code path where the comment is placed is however also used for other kinds
      of merge rebases. The comment is thus not really correct and not helpful. I
      think it would be better to drop the comment and rewrite the code.
      c51d6c04
  12. Jan 06, 2015
    • Martin von Zweigbergk's avatar
      status: don't list files as both clean and deleted · ccbaa2ed
      Martin von Zweigbergk authored
      Tracked files that are deleted should always be reported as such, no
      matter what their state was in earlier revisions. This is encoded in
      in two conditions in the loop in basectx._buildstatus() for modified
      and added files, but the check is missing for clean files. We should
      check for clean files too, but instead of adding the check in a third
      place, move it earlier and skip most of the loop body for deleted
      files.
      ccbaa2ed
    • Martin von Zweigbergk's avatar
      status: don't list files as both removed and deleted · 4b56219a
      Martin von Zweigbergk authored
      When calculating status involving the working copy and a revision
      other than the parent of the working copy, the files that are not in
      the working context manifest ('mf2' in the basectx._buildstatus())
      will be reported as removed (note that deleted files _are_ in the
      working context manifest). However, if the file is reported as deleted
      in the dirstate, it will get that status too (as shown by failing
      tests).
      
      Fix by removing deleted files from the 'removed' list after the main
      loop in _buildstatus().
      4b56219a
    • Pierre-Yves David's avatar
      revset-filelog: handle hidden linkrev for file missing for head (issue4490) · 07a6faf9
      Pierre-Yves David authored
      The fix for linkrev pointing to hidden revision was crashing when the file was
      missing from head's manifest. We now properly handle this case.
      
      (yes I feel silly)
      07a6faf9
  13. Nov 27, 2014
    • Mads Kiilerich's avatar
      run-tests: automatically add (glob) to "saved backup bundle to" lines · 31d3f973
      Mads Kiilerich authored
      Avoid spending too much time adding (glob) after running run-tests -i. This
      doesn't handle all cases but it helps.
      
      The run-tests tests add a bit of escaping of trailing (glob) in the output to
      avoid interference from the outer test runner.
      
      The regexp for matching the output lines contains a group for making multiline
      substitute in a way that works with Python before 2.7.
      31d3f973
  14. Jan 05, 2015
    • Pierre-Yves David's avatar
      transaction: use the right location when cleaning up backup file (issue4479) · 987ef74d
      Pierre-Yves David authored
      The location variable fetch from the loop and the one used to actually fetch it
      mismatched. We fix the name to ensure file outside of store are cleaned up.
      987ef74d
    • Matt Mackall's avatar
      merge with stable · d9444924
      Matt Mackall authored
      d9444924
    • Katsunori FUJIWARA's avatar
      revset: delay showing parse error for the revset alias until it is referred · 6a81f887
      Katsunori FUJIWARA authored
      Before this patch, a problematic revset alias aborts execution
      immediately, even if it isn't referred in the specified revset.
      
      If old "hg" may be used too (for example, bisecting Mercurial itself),
      it is also difficult to write alias definitions using features newly
      introduced by newer "hg" into configuration files, because such alias
      definitions cause unexpected abortion at parsing revset aliases with
      old "hg".
      
      This patch delays showing parse error for the revset alias until it is
      actually referred at runtime.
      
      This patch detects referring problematic aliases in "_expandaliases"
      by examination of "revsetalias.error", which is initialized with the
      error message only when parsing fails.
      
      For usability, this patch also warns about problematic aliases, even
      if they aren't referred at runtime. This should help users to know
      potential problems in their alias definitions earlier.
      6a81f887
  15. Jan 03, 2015
  16. Jan 04, 2015
    • Matt Harbison's avatar
      largefiles: properly sync lfdirstate after removing largefiles · 1b3df5ef
      Matt Harbison authored
      The more aggressive synchronization of lfdirstate that was backed out in
      1265a3a71d75 masked the problem where lfdirstate would hold an 'R' for a
      largefile that was added and then removed without a commit between.  We could
      just conditionally call lfdirstate.drop() or lfdirstate.remove() here, but this
      also properly updates lfdirstate if the standin doesn't exist for the file
      somehow (i.e. call drop instead of remove).
      
      Without this change, the precommit status in the commit command immediately
      after the test change lists the removed (and never committed) largefile as 'R'.
      It can also lead to situations where the status command reports the same, long
      after the commit [1].
      
      [1] http://www.selenic.com/pipermail/mercurial-devel/2015-January/065153.html
      1b3df5ef
  17. Dec 30, 2014
    • Pierre-Yves David's avatar
      linkrev-filelog: handle filtered linkrev with no visible children (issue4307) · 8ec03e0e
      Pierre-Yves David authored
      If the file revision with a filtered linkrev does not have any
      (unfiltered) children, we cannot use it to bound the search for
      another introduction. Instead, we have to look at the file revision
      used by each head changeset. If one of them uses this file revision, we
      know there is another occurrence and we have a starting point. See
      inline comments for details.
      
      Adding some kind of permanent reference of all the introductions of a
      file revision instead of just the first one would be much better. But
      this is more difficult. I hope to take that into account in the next
      repository format.
      8ec03e0e
    • Pierre-Yves David's avatar
      linkrev: work around linkrev to filtered entry in 'filelog' revset · 34364a4b
      Pierre-Yves David authored
      This revset is used by 'hg log FILENAME'. This prevent bugs when used on
      a repository with hidden revisions.
      
      Instead of just discarding file revisions whose linkrevs point to filtered
      revisions, we put them aside and post-process them trying to find a non-filtered
      introduction. See inline documentation for details about how it works.
      
      This only fixes some of the problems. Once again, more will be needed when we can
      cannot rely on child revisions of a file to find linkrev-shadowned revisions.
      
      A test is added for 'hg log' catching such cases.
      34364a4b
  18. Dec 21, 2014
  19. Dec 20, 2014
  20. Jan 02, 2015
  21. Nov 27, 2014
    • Matt Harbison's avatar
      largefiles: drop a redundant check for patterns when removing without --after · 5f846957
      Matt Harbison authored
      This is in the way of passing a matcher to removelargefiles().  This method is
      called in exactly two places- first in overrides.addremove() (but only if the
      pattern list passed to it is not empty), and second in the commands.remove()
      override.  But since the latter calls commands.remove() first, which also does
      this check, it isn't needed here.
      5f846957
  22. Dec 31, 2014
    • Katsunori FUJIWARA's avatar
      context: override _dirstatestatus in workingcommitctx for correct matching · bfce25d2
      Katsunori FUJIWARA authored
      Before this patch, the result of "status()" on "workingcommitctx" may
      incorrectly contain files other than ones to be committed, because
      "workingctx._dirstatestatus()" returns the result of
      "dirstate.status()" directly.
      
      For correct matching, this patch overrides "_dirstatestatus" in
      "workingcommitctx" and makes it return matched files only in
      "self._status".
      
      This patch uses empty list for "deleted", "unknown" and "ignored" of
      status, because status between "changectx"s also makes them empty.
      bfce25d2
    • Katsunori FUJIWARA's avatar
      context: avoid breaking already fixed self._status at ctx.status() · 1e6fb8db
      Katsunori FUJIWARA authored
      Before this patch, "status()" on "workingcommitctx" with "always
      match" object causes breaking "self._status" in
      "workingctx._buildstatus()", because "workingctx._buildstatus()"
      caches the result of "dirstate.status()" into "self._status" for
      efficiency, even though it should be fixed at construction for
      committing.
      
      For example, template function "diff()" without any patterns in
      "committemplate" implies "status()" on "workingcommitctx" with "always
      match" object, via "basectx.diff()" and "patch.diff()".
      
      Then, broken "self._status" causes committing unexpected files.
      
      To avoid breaking already fixed "self._status" at "ctx.status()", this
      patch overrides "_buildstatus" in "workingcommitctx".
      
      This patch doesn't write out the result of template function "diff()"
      in "committemplate" in "test-commit.t", because matching against files
      to be committed still has an issue fixed in subsequent patch.
      1e6fb8db
    • Katsunori FUJIWARA's avatar
      context: add workingcommitctx for exact context to be committed · 745e3b48
      Katsunori FUJIWARA authored
      Before this patch, "workingctx" is also used for the context to be
      committed. But "workingctx" works incorrectly in some cases.
      
      For example, even when only some of changed files in the working
      directory are committed, "status()" on "workingctx" object for
      committing recognizes files not to be committed as changed, too.
      
      As the preparation for fixing these issues, this patch chooses adding
      new class "workingcommitctx" for exact context to be committed,
      because switching by the flag (like "self._fixedstatus" or so) in some
      code paths of "workingctx" is less readable and maintenancable.
      745e3b48
Loading