Skip to content
Snippets Groups Projects
  1. Jun 18, 2015
  2. Jun 19, 2015
  3. Jun 18, 2015
  4. Jun 19, 2015
  5. Jun 18, 2015
  6. Jun 11, 2015
    • Pierre-Yves David's avatar
      revset: make use of natively-computed set for 'draft()' and 'secret()' · 85294076adce
      Pierre-Yves David authored
      If the computation of a set for each phase (done in C) is available,
      we use it directly instead of applying a simple filter. This give a
      massive speed-up in the vast majority of cases.
      
      On my mercurial repo with about 15000 out of 40000 draft changesets:
      
      revset: draft()
         plain         min           first         last
      0) 0.011201      0.019950      0.009844      0.000074
      1) 0.000284   2% 0.000312   1% 0.000314   3% 0.000315 x4.3
      
      Bad performance for "last" come from the handling of the 15000 elements set
      (memory allocation, filtering hidden changesets (99% of it) etc. compared to
      applying the filter only on a handfuld of revisions (the first draft changesets
      being close of tip).
      
      This is not seen as an issue since:
      
      * Timing is still pretty good and in line with all the other one,
      * Current user of Vanilla Mercurial will not have 1/3 of their repo draft,
      
      This bad effect disappears when phase's set is smaller. (about 200 secrets):
      
      revset: secret()
         plain         min           first         last
      0) 0.011181      0.022228      0.010851      0.000452
      1) 0.000058   0% 0.000084   0% 0.000087   0% 0.000087  19%
      85294076adce
  7. Jun 18, 2015
    • Pierre-Yves David's avatar
      revset: refactor the non-public phase code · 21a874693619
      Pierre-Yves David authored
      Code for draft and secret are the same. We'll make it more complex to
      take advantages of the set recomputed in C, so we first refactor the
      code to only have one place to update (and make sure all behave
      properly).
      
      We do not refactor the 'public()' code because it does not have a natively
      computed set.
      21a874693619
  8. Jun 17, 2015
    • Pierre-Yves David's avatar
      revset: translate node directly with changelog in 'head' · 5f87f2305ad0
      Pierre-Yves David authored
      Using 'repo[X]' is much slower because it creates a 'changectx' object and goes
      though multiple layers of code to do so. It is also error prone if there is
      tags, bookmarks, branch or other names that could map to a node hash and take
      precedence (user are wicked).
      
      This provides a significant performance boost on repository with a lot of
      heads.  Benchmark result for a repo with 1181 heads.
      
      revset: head()
         plain         min           last          reverse
      0) 0.014853      0.014371      0.014350      0.015161
      1) 0.001402   9% 0.000975   6% 0.000874   6% 0.001415   9%
      
      revset: head() - public()
         plain         min           last          reverse
      0) 0.015121      0.014420      0.014560      0.015028
      1) 0.001674  11% 0.001109   7% 0.000980   6% 0.001693  11%
      
      revset: draft() and head()
         plain         min           last          reverse
      0) 0.015976      0.014490      0.014214      0.015892
      1) 0.002335  14% 0.001018   7% 0.000887   6% 0.002340  14%
      
      The speed up is visible even when other more costly revset are in use
      
      revset: head() and author("mpm")
         plain         min           last          reverse
      0) 0.105419      0.090046      0.017169      0.108180
      1) 0.090721  86% 0.077602  86% 0.003556  20% 0.093324  86%
      5f87f2305ad0
  9. Jun 11, 2015
    • Pierre-Yves David's avatar
      revset: use a baseset in _notpublic() · 833fa28cd949
      Pierre-Yves David authored
      The '_notpublic()' internal revset was "returning" a set. That was wrong. We now
      return a 'baseset' as appropriate. This has no effect on performance in most case,
      because we do the exact same operation than what the combination with a
      'fullreposet' was doing. This as a small effect on some operation when combined
      with other set, because we now apply the filtering in all cases. I think the
      correctness is worth the impact on some corner cases. The optimizer should take
      care of these corner cases anyway.
      
      revset #0: not public()
         plain         min           max           first         last          reverse
      0) 0.000465      0.000491      0.000495      0.000500      0.000494      0.000479
      1) 0.000484      0.000503      0.000498      0.000505      0.000504      0.000491
      
      revset #1: (tip~1000::) - public()
         plain         min           max           first         last          reverse
      0) 0.002765      0.001742      0.002767      0.001730      0.002761      0.002782
      1) 0.002847      0.001777      0.002776      0.001741      0.002764      0.002858
      
      revset #2: not public() and branch("default")
         plain         min           max           first         last          reverse
      0) 0.012104      0.011138      0.011189      0.011138      0.011166      0.011578
      1) 0.011387  94% 0.011738 105% 0.014220 127% 0.011223      0.011184      0.012077
      
      revset #3: (not public() - obsolete())
         plain         min           max           first         last          reverse
      0) 0.000583      0.000556      0.000552      0.000555      0.000552      0.000610
      1) 0.000613 105% 0.000559      0.000557      0.000573      0.000558      0.000613
      
      revset #4: head() - public()
         plain         min           max           first         last          reverse
      0) 0.010869      0.010800      0.011547      0.010843      0.010891      0.010891
      1) 0.011031      0.011497 106% 0.011087      0.011100      0.011100      0.011085
      833fa28cd949
  10. Jun 17, 2015
  11. Jun 18, 2015
  12. Jun 17, 2015
  13. Jun 15, 2015
  14. Jun 17, 2015
    • Matt Harbison's avatar
      test-subrepo-recursion: more aggressively regex 'unzip -l' output for 10.10 · 37876ca00c0a
      Matt Harbison authored
      The output on 10.10 looks like this:
      
          Length     Date   Time    Name
         --------    ----   ----    ----
              172  01-01-80 00:00   .hg_archival.txt
               10  01-01-80 00:00   .hgsub
               45  01-01-80 00:00   .hgsubstate
                3  01-01-80 00:00   x.txt
               10  01-01-80 00:00   foo/.hgsub
               45  01-01-80 00:00   foo/.hgsubstate
                9  01-01-80 00:00   foo/y.txt
                9  01-01-80 00:00   foo/bar/z.txt
         --------                   -------
              303                   8 files
      
      (2 digit year, shorter -- separators and closer columns).  We don't care about
      any of that, so ignore it.
      37876ca00c0a
    • Pierre-Yves David's avatar
      contrib: introduce an all-revsets.txt file · 67a2192dcb64
      Pierre-Yves David authored
      This file should gather all revsets ever thought interesting by
      anyone. That way one can check the impact of a change when touching
      something revset-ish. See inline comments for details.
      
      This file have been refilled with all the entry I could automatically
      find from changeset descriptions. I assume we missed some not using
      'revsetbenchmarks.py' output.
      67a2192dcb64
    • Pierre-Yves David's avatar
      contrib: rename revsetbenchmarks.txt to 'base-revsets.txt' · 2fea23d035d8
      Pierre-Yves David authored
      We rename the file and document its purpose. We'll be introducing another file
      gathering revsets useful for benchmark of the predicate themsleves in a coming
      changesets.
      2fea23d035d8
    • Pierre-Yves David's avatar
      revsetbenchmarks: add main documention for the script · ddb2a648fdbd
      Pierre-Yves David authored
      This allow us to document the fact we can use comment in the file listing revsets.
      ddb2a648fdbd
  15. Jun 16, 2015
    • Anton Shestakov's avatar
      hgweb: don't dereference symbolic revision in paper & coal style (issue2296) · 3bb6f5f478a7
      Anton Shestakov authored
      Let's make paper (and coal, since it borrows so much from paper) templates use
      symbolic revision in navigation links.
      
      The majority of links (log, filelog, annotate, etc) still use node hashes.
      
      Some pages don't have permanent links to current node hash (so it's not very
      easy to go from /rev/tip to /rev/<tip hash>), this will be addressed in future
      patches.
      3bb6f5f478a7
    • Anton Shestakov's avatar
      hgweb: don't dereference symbolic revision in gitweb style · dd89304687a3
      Anton Shestakov authored
      Let's make gitweb templates use symbolic revision in navigation links.
      
      The majority of links (log, filelog, annotate, etc) still use node hashes.
      
      Some pages don't have permanent links to current node hash (so it's not very
      easy to go from /rev/tip to /rev/<tip hash>), this will be addressed in future
      patches.
      dd89304687a3
    • Anton Shestakov's avatar
      hgweb: don't dereference symbolic revision in monoblue style · 0cdcbc477cac
      Anton Shestakov authored
      Let's make monoblue templates use symbolic revision in navigation links.
      
      The majority of links (log, filelog, annotate, etc) still use node hashes.
      
      Some pages don't have permanent links to current node hash (so it's not very
      easy to go from /rev/tip to /rev/<tip hash>), this will be addressed in future
      patches.
      0cdcbc477cac
    • Anton Shestakov's avatar
      hgweb: don't dereference symbolic revision in spartan style · 1cac419ab831
      Anton Shestakov authored
      Let's make spartan templates use symbolic revision in navigation links.
      
      The majority of links (log, filelog, annotate, etc) still use node hashes, and
      many pages also have permanent link to current node hash (i.e. you can go from
      /rev/tip to /rev/<tip hash> without manual url editing), so it's safe to
      update navigation.
      1cac419ab831
  16. Jun 15, 2015
    • Anton Shestakov's avatar
      hgweb: provide symrev (symbolic revision) property to the templates · 85fb416f2fa7
      Anton Shestakov authored
      One of the features of hgweb is that current position in repo history is
      remembered between separate requests. That is, links from /rev/<node_hash> lead
      to /file/<node_hash> or /log/<node_hash>, so it's easy to dig deep into the
      history. However, such links could only use node hashes and local revision
      numbers, so while staying at one exact revision is easy, staying on top of the
      changes is not, because hashes presumably can't change (local revision numbers
      can, but probably not in a way you'd find useful for navigating).
      
      So while you could use 'tip' or 'default' in a url, links on that page would be
      permanent. This is not always desired (think /rev/tip or /graph/stable or
      /log/@) and is sometimes just confusing (i.e. /log/<not the tip hash>, when
      recent history is not displayed). And if user changed url deliberately to say
      default instead of <some node hash>, the page ignores that fact and uses node
      hash in its links, which means that navigation is, in a way, broken.
      
      This new property, symrev, is used for storing current revision the way it was
      specified, so then templates can use it in links and thus "not dereference" the
      symbolic revision. It is an additional way to produce links, so not every link
      needs to drop {node|short} in favor of {symrev}, many will still use node hash
      (log and filelog entries, annotate lines, etc).
      
      Some pages (e.g. summary, tags) always use the tip changeset for their context,
      in such cases symrev is set to 'tip'. This is needed in case the pages want to
      provide archive links.
      
      highlight extension needs to be updated, since _filerevision now takes an
      additional positional argument (signature "web, req, tmpl" is used by most of
      webcommands.py functions).
      
      More references to symbolic revisions and related gripes: issue2296, issue2826,
      issue3594, issue3634.
      85fb416f2fa7
  17. Jun 17, 2015
    • Matt Harbison's avatar
      archive: support 'wdir()' · 3ec8351fa6ed
      Matt Harbison authored
      This is a step toward replacing the extdiff internals with archive, in order to
      support 'extdiff -S'.  Only Mercurial subrepos are supported for now.
      
      If a file is missing from the filesystem, it is silently skipped.  Perhaps it
      should warn, but it cannot abort when working with extdiff because deleting a
      file is a legitimate diff.
      3ec8351fa6ed
    • Matt Harbison's avatar
      subrepo: allow a representation of the working directory subrepo · 70ac1868b707
      Matt Harbison authored
      Some code cannot handle a subrepo based on the working directory (e.g.
      sub.dirty()), so the caller must opt in.  This will be useful for archive, and
      perhaps some other commands.  The git and svn methods where this is used may
      need to be fixed up on a case by case basis.
      70ac1868b707
  18. Jun 16, 2015
    • Yuya Nishihara's avatar
      templater: comment that gettemplate() has different name resolution order · 695b93a79d17
      Yuya Nishihara authored
      I've tried to unify gettemplate() with buildtemplate(), but it didn't go well
      because gettemplate() have to bypass mapping dict.
      
      For example, web templates have '{tags%changelogtag}' and 'changelogtag' is
      defined in both mapping, the default, and context.cache, sourced from map file.
      In general, mapping shadows context variables, but gettemplate() have to pick
      it from context.cache.
      695b93a79d17
  19. Jun 13, 2015
  20. Jun 10, 2015
  21. Jun 13, 2015
    • Yuya Nishihara's avatar
      templater: take any string literals as template, but not for rawstring (BC) · c1975809a6b5
      Yuya Nishihara authored
      This patch series is intended to unify the interpretation of string literals.
      It is breaking change that boldly assumes
      
       a. string literal "..." never contains template-like fragment or it is
          intended to be a template
       b. we tend to use raw string literal r"..." for regexp pattern in which "{"
          should have different meaning
      
      Currently, we don't have a comprehensible rule how string literals are
      evaluated in template functions. For example, fill() takes "initialindent"
      and "hangindent" as templates, but not for "text", whereas "text" is a
      template in pad() function.
      
        date(date, fmt)
        diff(includepattern, excludepattern)
        fill(text, width, initialident: T, hangindent: T)
        get(dict, key)
        if(expr, then: T, else: T)
        ifcontains(search, thing, then: T, else: T)
        ifeq(expr1, expr2, then: T, else: T)
        indent(text, indentchars, firstline)
        join(list, sep)
        label(label: T, expr: T)
        pad(text: T, width, fillchar, right)
        revset(query, formatargs...])
        rstdoc(text, style)
        shortest(node, minlength)
        startswith(pattern, text)
        strip(text, chars)
        sub(pattern, replacement, expression: T)
        word(number, text, separator)
        expr % template: T
      
        T: interpret "string" or r"rawstring" as template
      
      This patch series adjusts the rule as follows:
      
       a. string literal, '' or "", starts template processing (BC)
       b. raw string literal, r'' or r"", disables both \-escape and template
          processing (BC, done by subsequent patches)
       c. fragment not surrounded by {} is non-templated string
      
        "ccc{'aaa'}{r'bbb'}"
         ------------------  *: template
         ---                 c: string
              ---            a: template
                      ---    b: rawstring
      
      Because this can eliminate the compilation of template arguments from the
      evaluation phase, "hg log -Tdefault" gets faster.
      
        % cd mozilla-central
        % LANG=C HGRCPATH=/dev/null hg log -Tdefault -r0:10000 --time > /dev/null
        before: real 4.870 secs (user 4.860+0.000 sys 0.010+0.000)
        after:  real 3.480 secs (user 3.440+0.000 sys 0.030+0.000)
      
      Also, this will allow us to parse nested templates at once for better error
      indication.
      c1975809a6b5
  22. Jun 12, 2015
  23. Jun 15, 2015
Loading