Show More
@@ -290,11 +290,6 b' def _getfilestatusmap(context, mapping, ' | |||
|
290 | 290 | statmap.update((f, char) for f in files) |
|
291 | 291 | return revcache['filestatusmap'] # {path: statchar} |
|
292 | 292 | |
|
293 | def _showfilesbystat(context, mapping, name, index): | |
|
294 | stat = _getfilestatus(context, mapping) | |
|
295 | files = stat[index] | |
|
296 | return templateutil.compatfileslist(context, mapping, name, files) | |
|
297 | ||
|
298 | 293 | @templatekeyword('file_copies', |
|
299 | 294 | requires={'repo', 'ctx', 'cache', 'revcache'}) |
|
300 | 295 | def showfilecopies(context, mapping): |
@@ -332,17 +327,23 b' def showfilecopiesswitch(context, mappin' | |||
|
332 | 327 | @templatekeyword('file_adds', requires={'ctx', 'revcache'}) |
|
333 | 328 | def showfileadds(context, mapping): |
|
334 | 329 | """List of strings. Files added by this changeset.""" |
|
335 | return _showfilesbystat(context, mapping, 'file_add', 1) | |
|
330 | ctx = context.resource(mapping, 'ctx') | |
|
331 | return templateutil.compatfileslist(context, mapping, 'file_add', | |
|
332 | ctx.filesadded()) | |
|
336 | 333 | |
|
337 | 334 | @templatekeyword('file_dels', requires={'ctx', 'revcache'}) |
|
338 | 335 | def showfiledels(context, mapping): |
|
339 | 336 | """List of strings. Files removed by this changeset.""" |
|
340 | return _showfilesbystat(context, mapping, 'file_del', 2) | |
|
337 | ctx = context.resource(mapping, 'ctx') | |
|
338 | return templateutil.compatfileslist(context, mapping, 'file_del', | |
|
339 | ctx.filesremoved()) | |
|
341 | 340 | |
|
342 | 341 | @templatekeyword('file_mods', requires={'ctx', 'revcache'}) |
|
343 | 342 | def showfilemods(context, mapping): |
|
344 | 343 | """List of strings. Files modified by this changeset.""" |
|
345 | return _showfilesbystat(context, mapping, 'file_mod', 0) | |
|
344 | ctx = context.resource(mapping, 'ctx') | |
|
345 | return templateutil.compatfileslist(context, mapping, 'file_mod', | |
|
346 | ctx.filesmodified()) | |
|
346 | 347 | |
|
347 | 348 | @templatekeyword('files', requires={'ctx'}) |
|
348 | 349 | def showfiles(context, mapping): |
@@ -15,6 +15,10 b'' | |||
|
15 | 15 | |
|
16 | 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 | 23 | == Backwards Compatibility Changes == |
|
20 | 24 | |
@@ -31,6 +35,16 b'' | |||
|
31 | 35 | previously replace files *in* the configured directory by |
|
32 | 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 | 48 | == Internal API Changes == |
|
35 | 49 | |
|
36 | 50 | * Matchers are no longer iterable. Use `match.files()` instead. |
@@ -59,7 +59,7 b' move should be recorded in the fixup mer' | |||
|
59 | 59 | $ glog -R source-hg |
|
60 | 60 | o 5@source "(octopus merge fixup)" files+: [], files-: [], files: [renamed] |
|
61 | 61 | |\ |
|
62 |
| o 4@source "Merged branches" files+: [file-branch |
|
|
62 | | o 4@source "Merged branches" files+: [file-branch2 renamed], files-: [rename_me], files: [] | |
|
63 | 63 | | |\ |
|
64 | 64 | o---+ 3@source-branch2 "Added brach2 file" files+: [file-branch2 renamed], files-: [rename_me], files: [] |
|
65 | 65 | / / |
@@ -154,7 +154,7 b" there. It's not recorded as a move in r" | |||
|
154 | 154 | $ glog -R hg2hg |
|
155 | 155 | @ 5@source "(octopus merge fixup)" files+: [], files-: [], files: [] |
|
156 | 156 | |\ |
|
157 |
| o 4@source "Merged branches" files+: [ |
|
|
157 | | o 4@source "Merged branches" files+: [file-branch2 renamed], files-: [rename_me], files: [] | |
|
158 | 158 | | |\ |
|
159 | 159 | o---+ 3@source-branch2 "Added brach2 file" files+: [file-branch2 renamed], files-: [rename_me], files: [] |
|
160 | 160 | / / |
@@ -147,7 +147,7 b' merge' | |||
|
147 | 147 | 1 Editing b |
|
148 | 148 | 0 Merged improve branch |
|
149 | 149 | $ glog -R source-hg |
|
150 |
o 3@source "Merged improve branch" files+: [], files-: [], files: [ |
|
|
150 | o 3@source "Merged improve branch" files+: [], files-: [], files: [] | |
|
151 | 151 | |\ |
|
152 | 152 | | o 2@source-improve "Editing b" files+: [], files-: [], files: [b] |
|
153 | 153 | | | |
General Comments 0
You need to be logged in to leave comments.
Login now