tests/test-issue6642.t
author Arseniy Alekseyev <aalekseyev@janestreet.com>
Mon, 15 Apr 2024 16:33:37 +0100
branchstable
changeset 51571 74230abb2504
parent 50725 7e5be4a7cda7
permissions -rw-r--r--
match: strengthen visit_children_set invariant, Recursive means "all files" My previous interpretation of "Recursive" was too relaxed: I thought it instructed the caller to do something like this: > you can stop calling `visit_children_set` because you'll need to descend into > every directory recursively, but you should still check every file if it > matches or not Whereas the real instruction seems to be: > I guarantee that everything in this subtree matches, you can stop > querying the matcher for all files and dirs altogether. The evidence to support this: - the test actually passes with the stronger invariant, revealing no exceptions from this rule - the implementation of `visit_children_set` for `DifferenceMatcher` clearly relies on this requirement, so it must hold for that not to lead to bugs.

hg log --debug shouldn't show different data than {file_*} template keywords
https://bz.mercurial-scm.org/show_bug.cgi?id=6642

  $ hg init issue6642
  $ cd issue6642

  $ echo a > a
  $ hg ci -qAm a
  $ echo b > b
  $ hg ci -qAm b
  $ hg up 0 -q
  $ echo c > c
  $ hg ci -qAm c
  $ hg merge -q
  $ hg ci -m merge

  $ hg log -GT '{rev} {desc} file_adds: [{file_adds}], file_mods: [{file_mods}], file_dels: [{file_dels}], files: [{files}]\n'
  @    3 merge file_adds: [], file_mods: [], file_dels: [], files: []
  |\
  | o  2 c file_adds: [c], file_mods: [], file_dels: [], files: [c]
  | |
  o |  1 b file_adds: [b], file_mods: [], file_dels: [], files: [b]
  |/
  o  0 a file_adds: [a], file_mods: [], file_dels: [], files: [a]
  

  $ hg log -r . --debug | grep files
  [1]
  $ hg log -r . --debug -T json | grep -E '(added|removed|modified)'
    "added": [],
    "modified": [],
    "removed": [],
  $ hg log -r . --debug -T xml | grep path
  <paths>
  </paths>