view tests/test-hgk.t @ 35816:f6ca1e11d8b4 stable

revset: evaluate filesets against each revision for 'file()' (issue5778) After f2aeff8a87b6, the fileset was evaluated to a set of files against the working directory, and then those files were applied against each revision. The result was nonsense. For example, `hg log -r 'file("set:exec()")'` on the Mercurial repo listed revision 0 because it has the `hg` script, which is currently +x. But that bit wasn't applied until revision 280 (which 'contains()' properly indicates). This technique was borrowed from checkstatus(), which services adds(), modifies(), and removes(), so it seems safe enough. The 'r:' case is explicitly assigned to wdirrev, freeing up rev=None to mean "re-evaluate at each revision". The distinction is important to avoid behavior changes with `hg log set:...` (test-largefiles-misc.t and test-fileset-generated.t drop current log output without this). I'm not sure what the right behavior for that is (1fd352aa08fc explicitly enabled this behavior for graphlog), but the day before the release isn't the time to experiment.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 28 Jan 2018 14:08:59 -0500
parents 5fb1fc2e1281
children
line wrap: on
line source

Minimal hgk check

  $ echo "[extensions]" >> $HGRCPATH
  $ echo "hgk=" >> $HGRCPATH
  $ hg init repo
  $ cd repo
  $ echo a > a
  $ hg ci -Am adda
  adding a
  $ hg debug-cat-file commit 0
  tree a0c8bcbbb45c
  parent 000000000000
  author test 0 0
  revision 0
  branch default
  phase draft
  
  adda
  $ echo b > b
  $ hg ci -Am addb
  adding b
  $ hg log -T '{node}\n'
  102a90ea7b4a3361e4082ed620918c261189a36a
  07f4944404050f47db2e5c5071e0e84e7a27bba9

  $ hg debug-diff-tree 07f494440405 102a90ea7b4a
  :000000 100664 000000000000 1e88685f5dde N	b	b
  $ hg debug-diff-tree 07f494440405 102a90ea7b4a --patch
  diff --git a/b b/b
  new file mode 100644
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +b

Ensure that diff-tree output isn't affected by diffopts
  $ hg --config diff.noprefix=True debug-diff-tree 07f494440405 102a90ea7b4a
  :000000 100664 000000000000 1e88685f5dde N	b	b
  $ hg --config diff.noprefix=True debug-diff-tree --patch 07f494440405 102a90ea7b4a
  diff --git a/b b/b
  new file mode 100644
  --- /dev/null
  +++ b/b
  @@ -0,0 +1,1 @@
  +b

  $ cd ..