comparison relnotes/next @ 42405:0c72eddb4be5

templatekw: make {file_*} compare to both merge parents (issue4292) This redefines the {file_adds}, {file_dels}, {file_mods} template keywords by getting the lists from the recently introduced context methods instead of getting them from status compared to p1. As mentioned before, these are better defined on merge commits. The total number of files from the three lists now always add up to the number of files in {files}. I timed this command: hg log -r 4.0::5.0 -T '{rev}\n {file_mods}\n {file_adds}\n {file_dels}\n' It went from 7.6s to 5.6s with this patch. So it's actually faster than before. Note that the "files:" field in the bazaar test log output was using "{file_mods}" (not "{files}" as one might think based on the label). Differential Revision: https://phab.mercurial-scm.org/D6369
author Martin von Zweigbergk <martinvonz@google.com>
date Thu, 18 Apr 2019 13:35:02 -0700
parents ba6ca4e80607
children 089f14dd7df3
comparison
equal deleted inserted replaced
42404:0c0a22f5b0b5 42405:0c72eddb4be5
13 topo)` revset). 13 topo)` revset).
14 14
15 15
16 == Bug Fixes == 16 == Bug Fixes ==
17 17
18 * issue4292: "hg log and {files} {file_adds} {file_mods} {file_dels}
19 in template show wrong files on merged revision". See details in
20 "Backwards Compatibility Changes".
21
18 22
19 == Backwards Compatibility Changes == 23 == Backwards Compatibility Changes ==
20 24
21 * Removed (experimental) support for log graph lines mixing 25 * Removed (experimental) support for log graph lines mixing
22 parent/grandparent styles. Setting 26 parent/grandparent styles. Setting
29 to a file, we will now replace that file by a directory and put 33 to a file, we will now replace that file by a directory and put
30 backups in that directory. This is similar to how we would 34 backups in that directory. This is similar to how we would
31 previously replace files *in* the configured directory by 35 previously replace files *in* the configured directory by
32 subdirectories. 36 subdirectories.
33 37
38 * Template keyword `{file_mods}`, `{file_adds}`, and `{file_dels}`
39 have changed behavior on merge commits. They used to be relative to
40 the first parent, but they now consider both parents. `{file_adds}`
41 shows files that exists in the commit but did not exist in either
42 parent. `{file_dels}` shows files that do not exist in the commit
43 but existed in either parent. `{file_mods}` show the remaining
44 files from `{files}` that were not in the other two
45 sets.
46
47
34 == Internal API Changes == 48 == Internal API Changes ==
35 49
36 * Matchers are no longer iterable. Use `match.files()` instead. 50 * Matchers are no longer iterable. Use `match.files()` instead.
37 51
38 * `match.visitdir()` and `match.visitchildrenset()` now expect the 52 * `match.visitdir()` and `match.visitchildrenset()` now expect the