Skip to content
Snippets Groups Projects
  1. Oct 08, 2014
    • Matt Mackall's avatar
      rebase: attempt to clarify --base · 5f4934487382
      Matt Mackall authored
      5f4934487382
    • durin42's avatar
      manifest: rearrange add() method and add comments for clarity · 160efd225b24
      durin42 authored
      Omit the check of bool(p1) since it's always true in practice: it will
      either be nullid or some valid manifest sha, and we know nullid won't
      ever be in the cache so we can simplify understanding of this code.
      160efd225b24
    • durin42's avatar
      manifest: simplify manifest.add() by making args required · 4a13849ca359
      durin42 authored
      I verified that changed was never false (it was always a 2-tuple) by
      adding
      
      @@ -220,6 +225,8 @@ class manifest(revlog.revlog):
      
           def add(self, map, transaction, link, p1=None, p2=None,
                   changed=None):
      +        if not changed:
      +            assert False, 'changed was %r' % changed
               # if we're using the cache, make sure it is valid and
               # parented by the same node we're diffing against
               if not (changed and p1 and (p1 in self._mancache)):
      
      and observing that the test suite still passed. Making all the
      arguments required should help future readers understand what's going
      on here.
      4a13849ca359
  2. Sep 25, 2014
  3. Sep 24, 2014
    • durin42's avatar
      revlog: move references to revlog.hash to inside the revlog class · abc44fcc9c57
      durin42 authored
      This will make it possible for subclasses to have different hashing
      schemes when appropriate. I anticipate using this in manifests.
      
      Note that there's still one client of mercurial.revlog.hash() outside
      of revlog: mercurial.context.memctx uses it to construct the file
      entries in an in-memory manifest. I don't think this will be a problem
      in the immediate future, so I've left it as-is.
      abc44fcc9c57
    • durin42's avatar
      revlog: mark nullhash as module-private · 0f4e655136ef
      durin42 authored
      No other module should ever need this, so mark it with _ so nobody
      tries to use it.
      0f4e655136ef
  4. Oct 08, 2014
  5. Oct 04, 2014
    • Siddharth Agarwal's avatar
      dirstate: cache util.normcase while constructing the foldmap · a1eb21f5caea
      Siddharth Agarwal authored
      This is a small win on OS X. hg perfdirstatefoldmap:
      
      before: wall 0.399708 comb 0.410000 user 0.390000 sys 0.020000 (best of 25)
      after:  wall 0.386331 comb 0.390000 user 0.370000 sys 0.020000 (best of 25)
      a1eb21f5caea
    • Siddharth Agarwal's avatar
      normcase: for darwin, use fast ASCII lower · 70624fda193d
      Siddharth Agarwal authored
      Constructing the foldmap is much faster on OS X now. For a large real-world
      repo, hg perfdirstatefoldmap:
      
      before: wall 0.805278 comb 0.800000 user 0.790000 sys 0.010000 (best of 13)
      after:  wall 0.399708 comb 0.410000 user 0.390000 sys 0.020000 (best of 25)
      
      This is a nice boost to 'hg status', especially with the third-party hgwatchman
      extension enabled (which eliminates stat calls). For the above repo, 'hg
      status' goes from 1.17 seconds to 0.74.
      70624fda193d
    • Siddharth Agarwal's avatar
      perf: add a way to measure the perf of constructing the foldmap · d8ff1f671aed
      Siddharth Agarwal authored
      Constructing the foldmap is a necessary part of operations like 'hg status' on
      OS X. This command allows us to measure the perf of constructing it.
      d8ff1f671aed
    • Siddharth Agarwal's avatar
      encoding.lower: use fast ASCII lower · d9585dda63c3
      Siddharth Agarwal authored
      This benefits, among other things, the case collision auditor.
      
      On a Linux system with a large real-world repo where all filenames are ASCII,
      hg perfcca:
      
      before: wall 0.260157 comb 0.270000 user 0.230000 sys 0.040000 (best of 38)
      after:  wall 0.164616 comb 0.160000 user 0.160000 sys 0.000000 (best of 54)
      d9585dda63c3
    • Siddharth Agarwal's avatar
      parsers: add a function to efficiently lowercase ASCII strings · 80f2b63dd83a
      Siddharth Agarwal authored
      We need a way to efficiently lowercase ASCII strings. For example, 'hg status'
      needs to build up the fold map -- a map from a canonical case (for OS X,
      lowercase) to the actual case of each file and directory in the dirstate.
      
      The current way we do that is to try decoding to ASCII and then calling
      lower() on the string, labeled 'orig' below:
      
          str.decode('ascii')
          return str.lower()
      
      This is pretty inefficient, and it turns out we can do much better.
      
      I also tested out a condition-based approach, labeled 'cond' below:
      
          (c >= 'A' && c <= 'Z') ? (c + ('a' - 'A')) : c
      
      'cond' turned out to be slower in all cases. A 256-byte lookup table with
      invalid values for everything past 127 performed similarly, but this was less
      verbose.
      
      On OS X 10.9 with LLVM version 6.0 (clang-600.0.51), the asciilower function
      was run against two corpuses.
      
      Corpus 1 (list of files from real-world repo, > 100k files):
      orig:   wall 0.428567 comb 0.430000 user 0.430000 sys 0.000000 (best of 24)
      cond:   wall 0.077204 comb 0.070000 user 0.070000 sys 0.000000 (best of 100)
      lookup: wall 0.060714 comb 0.060000 user 0.060000 sys 0.000000 (best of 100)
      
      Corpus 2 (mozilla-central, 113k files):
      orig:   wall 0.238406 comb 0.240000 user 0.240000 sys 0.000000 (best of 42)
      cond:   wall 0.040779 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
      lookup: wall 0.037623 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
      
      On a Linux server-class machine with GCC 4.4.6 20120305 (Red Hat 4.4.6-4):
      
      Corpus 1 (real-world repo, > 100k files):
      orig:   wall 0.260899 comb 0.260000 user 0.260000 sys 0.000000 (best of 38)
      cond:   wall 0.054818 comb 0.060000 user 0.060000 sys 0.000000 (best of 100)
      lookup: wall 0.048489 comb 0.050000 user 0.050000 sys 0.000000 (best of 100)
      
      Corpus 2 (mozilla-central, 113k files):
      orig:   wall 0.153082 comb 0.150000 user 0.150000 sys 0.000000 (best of 65)
      cond:   wall 0.031007 comb 0.040000 user 0.040000 sys 0.000000 (best of 100)
      lookup: wall 0.028793 comb 0.030000 user 0.030000 sys 0.000000 (best of 100)
      
      SSE instructions might help even more, but I didn't experiment with those.
      80f2b63dd83a
  6. Sep 30, 2014
    • Martin von Zweigbergk's avatar
      match: remove unnecessary setting of self._always · bbb2f8b0459e
      Martin von Zweigbergk authored
      The 'always' class calls its parent constructor with an empty list of
      patterns, which will result in a matcher that always matches. The
      parent constructor will set self._always to True in such cases, so
      there is no need to set it again.
      bbb2f8b0459e
  7. Oct 02, 2014
  8. Oct 06, 2014
  9. Oct 04, 2014
  10. Oct 03, 2014
    • Jordi Gutiérrez Hermoso's avatar
      log: rewrite default template to use labels (issue2866) · 0ded0f0b1c04
      Jordi Gutiérrez Hermoso authored
      This is a complete rewrite of the default template to use labels. This
      seems ultimately useless to me in most cases. The biggest benefit of
      this patch to me seems to be a fairly complicated example of the
      templating engine. It was a lot of hard work to figure out the precise
      acceptable syntax, since it's almost undocumented. Hat tip to Steve
      Losh's smartlog template, which helped me figure out a lot of the
      syntax. Hopefully later I can use the present default log template
      as an example for documenting the templating engine.
      
      A test is attached. My goal was to match the --color=debug output,
      which may differ slightly in newlines from the actual ANSI escape
      codes output. I consider this an acceptable invisible deviation.
      
      There seems to be a considerable slowdown with this rewrite.
      
      Before:
      
          $ time hg log -T default -r .~100::. > /dev/null
          real  0m0.882s
          user  0m0.812s
          sys   0m0.064s
          $ time hg log -T default -r .~100::. > /dev/null
          real  0m0.872s
          user  0m0.796s
          sys   0m0.068s
          $ time hg log -T default -r .~100::. > /dev/null
          real  0m0.917s
          user  0m0.836s
          sys   0m0.076s
      
      After:
      
          $ time hg log -T default -r .~100::. > /dev/null
          real  0m1.480s
          user  0m1.392s
          sys   0m0.072s
          $ time hg log -T default -r .~100::. > /dev/null
          real  0m1.500s
          user  0m1.400s
          sys   0m0.088s
          $ time hg log -T default -r .~100::. > /dev/null
          real  0m1.462s
          user  0m1.364s
          sys   0m0.092s
      
      Following the maxim, "make it work, profile, make it faster, in that
      order", I deem this slowdown acceptable for now.
      
      I suspect but have not confirmed that a big slowdown comes from
      calling keywords twice in the file templates, once to test the
      existence of output and again to actually list the output. If so, a
      simple speedup might be to improve the templating engine to cache
      keywords when called more than once on the same revision.
      
      TODO: I found a bug while working on this. The following stack traces:
      
          hg log -r . -T '{ifcontains(phase, "secret public", "lol", "omg")}\n'
      0ded0f0b1c04
  11. Oct 04, 2014
    • Jordi Gutiérrez Hermoso's avatar
      log: do not hide the public phase in debug mode (BC) · 55dcc7fb731c
      Jordi Gutiérrez Hermoso authored
      When 51fc43253a52 introduced phases to the `hg log --debug` output, it
      also disabled outputting public phase. At the same time, it always
      shows phases in the default template, `hg log --debug -T default`.
      Those two should produce the same output, but they don't.
      
      I think it makes a lot more sense to always show all phases. There's
      already loss of backwards compatibility in this case when using a
      newer hg on an old hg repo, since draft commits will show up in the
      output of `hg log --debug`.
      
      Finally, I just don't think that any sort of information should be
      hidden with --debug. This flag should be about showing as much
      information as possible.
      55dcc7fb731c
    • Jordi Gutiérrez Hermoso's avatar
      templater: set the correct phase for parents · 1e2f54a149e8
      Jordi Gutiérrez Hermoso authored
      Akin to f6371cc62d2a which did this for `hg log`, the following sets
      the correct phase for the {phase} keyword when the context is a parent
      of the current cset. This allows templates such as the following to be
      defined,
      
          parent = '{label("log.parent changeset.{phase}",
                            "parent:      {rev}:{node|formatnode}")}\n'
      
      which when called on a parent (e.g. with the `parents` template
      keyword), will produce the correct phase.
      1e2f54a149e8
  12. Oct 03, 2014
  13. Oct 04, 2014
  14. Oct 03, 2014
Loading