tests/test-issue6642.t
author Anton Shestakov <av6@dwimlabs.net>
Thu, 12 May 2022 13:53:50 +0400
branchstable
changeset 49315 2f326ea19fbc
parent 49314 ec3f88480dbf
child 50725 7e5be4a7cda7
permissions -rw-r--r--
logcmdutil: use the same data as {file*} template keywords (issue6642) Since 0c72eddb4be5 template keywords that show files use a different source of data than ctx.p1().status(ctx). These two functions in logcmdutil also show file lists when needed (e.g. log with --debug flag), but previously they used the old way of just looking at status compared to p1 and it resulted in differences between e.g. hg log --debug and hg log -T '{file*}'. test-phases.t needs an adjustment because 7 is a merge commit of two topological branches and one of them introduces files C, D and E.

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 | egrep '(added|removed|modified)'
    "added": [],
    "modified": [],
    "removed": [],
  $ hg log -r . --debug -T xml | grep path
  <paths>
  </paths>