view tests/test-diffdir.t @ 26306:d157e1f18e3f

revset: speed up existence checks for ordered filtered sets Previously, calling 'if foo:' on a ordered filtered set would start iterating in whatever the current direction was and return if a value was available. If the current direction was ascending, but the set had a fastdesc available, this meant we did a lot more work than necessary. If this was applied without my previous max/min fixes, it would improve max() performance (this was my first attempt at fixing the issue). Since those previous fixes went in though, this doesn't have a visible benefit in the benchmarks, but it does seem clearly better than it was before so I think it should still go in.
author Durham Goode <durham@fb.com>
date Sun, 20 Sep 2015 16:53:42 -0700
parents 2063d36b406e
children 29c8e35d3283
line wrap: on
line source

  $ hg init
  $ touch a
  $ hg add a
  $ hg ci -m "a"

  $ echo 123 > b
  $ hg add b
  $ hg diff --nodates
  diff -r 3903775176ed b
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +123

  $ hg diff --nodates -r tip
  diff -r 3903775176ed b
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +123

  $ echo foo > a
  $ hg diff --nodates
  diff -r 3903775176ed a
  --- a/a
  +++ b/a
  @@ -0,0 +1,1 @@
  +foo
  diff -r 3903775176ed b
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +123

  $ hg diff -r ""
  hg: parse error: empty query
  [255]
  $ hg diff -r tip -r ""
  hg: parse error: empty query
  [255]