##// END OF EJS Templates
cmdutil: make "files" list all files, add "file_mods" for modified files
Patrick Mezard -
r5550:db6633f1 default
parent child Browse files
Show More
@@ -578,15 +578,10 b' class changeset_templater(changeset_prin'
578 files[:] = self.repo.status(
578 files[:] = self.repo.status(
579 log.parents(changenode)[0], changenode)[:3]
579 log.parents(changenode)[0], changenode)[:3]
580 return files
580 return files
581 # XXX: "files" means "modified files" in debug, "all changed
581 def showfiles(**args):
582 # files" otherwise. This should be fixed and a "file_mods" be
582 return showlist('file', changes[3], **args)
583 # introduced instead.
583 def showmods(**args):
584 if self.ui.debugflag:
584 return showlist('file_mod', getfiles()[0], **args)
585 def showfiles(**args):
586 return showlist('file', getfiles()[0], **args)
587 else:
588 def showfiles(**args):
589 return showlist('file', changes[3], **args)
590 def showadds(**args):
585 def showadds(**args):
591 return showlist('file_add', getfiles()[1], **args)
586 return showlist('file_add', getfiles()[1], **args)
592 def showdels(**args):
587 def showdels(**args):
@@ -604,6 +599,7 b' class changeset_templater(changeset_prin'
604 'desc': changes[4].strip(),
599 'desc': changes[4].strip(),
605 'file_adds': showadds,
600 'file_adds': showadds,
606 'file_dels': showdels,
601 'file_dels': showdels,
602 'file_mods': showmods,
607 'files': showfiles,
603 'files': showfiles,
608 'file_copies': showcopies,
604 'file_copies': showcopies,
609 'manifest': showmanifest,
605 'manifest': showmanifest,
@@ -1,10 +1,13 b''
1 changeset = 'changeset: {rev}:{node|short}\n{branches}{tags}{parents}user: {author}\ndate: {date|date}\nsummary: {desc|firstline}\n\n'
1 changeset = 'changeset: {rev}:{node|short}\n{branches}{tags}{parents}user: {author}\ndate: {date|date}\nsummary: {desc|firstline}\n\n'
2 changeset_quiet = '{rev}:{node|short}\n'
2 changeset_quiet = '{rev}:{node|short}\n'
3 changeset_verbose = 'changeset: {rev}:{node|short}\n{branches}{tags}{parents}user: {author}\ndate: {date|date}\n{files}{file_copies}description:\n{desc|strip}\n\n\n'
3 changeset_verbose = 'changeset: {rev}:{node|short}\n{branches}{tags}{parents}user: {author}\ndate: {date|date}\n{files}{file_copies}description:\n{desc|strip}\n\n\n'
4 changeset_debug = 'changeset: {rev}:{node}\n{branches}{tags}{parents}{manifest}user: {author}\ndate: {date|date}\n{files}{file_adds}{file_dels}{file_copies}{extras}description:\n{desc|strip}\n\n\n'
4 changeset_debug = 'changeset: {rev}:{node}\n{branches}{tags}{parents}{manifest}user: {author}\ndate: {date|date}\n{file_mods}{file_adds}{file_dels}{file_copies}{extras}description:\n{desc|strip}\n\n\n'
5 start_files = 'files: '
5 start_files = 'files: '
6 file = ' {file}'
6 file = ' {file}'
7 end_files = '\n'
7 end_files = '\n'
8 start_file_mods = 'files: '
9 file_mod = ' {file_mod}'
10 end_file_mods = '\n'
8 start_file_adds = 'files+: '
11 start_file_adds = 'files+: '
9 file_add = ' {file_add}'
12 file_add = ' {file_add}'
10 end_file_adds = '\n'
13 end_file_adds = '\n'
@@ -89,8 +89,8 b' hg log --style=changelog > changelog'
89 cat changelog
89 cat changelog
90
90
91 echo "# keys work"
91 echo "# keys work"
92 for key in author branches date desc file_adds file_dels files \
92 for key in author branches date desc file_adds file_dels file_mods \
93 manifest node parents rev tags; do
93 files manifest node parents rev tags; do
94 for mode in '' --verbose --debug; do
94 for mode in '' --verbose --debug; do
95 hg log $mode --template "$key$mode: {$key}\n"
95 hg log $mode --template "$key$mode: {$key}\n"
96 done
96 done
@@ -308,6 +308,30 b' file_dels--debug:'
308 file_dels--debug:
308 file_dels--debug:
309 file_dels--debug:
309 file_dels--debug:
310 file_dels--debug:
310 file_dels--debug:
311 file_mods:
312 file_mods:
313 file_mods:
314 file_mods:
315 file_mods: c
316 file_mods:
317 file_mods:
318 file_mods:
319 file_mods--verbose:
320 file_mods--verbose:
321 file_mods--verbose:
322 file_mods--verbose:
323 file_mods--verbose: c
324 file_mods--verbose:
325 file_mods--verbose:
326 file_mods--verbose:
327 file_mods--debug:
328 file_mods--debug:
329 file_mods--debug:
330 file_mods--debug:
331 file_mods--debug: c
332 file_mods--debug:
333 file_mods--debug:
334 file_mods--debug:
311 files: second
335 files: second
312 files:
336 files:
313 files: d
337 files: d
@@ -324,14 +348,14 b' files--verbose: c'
324 files--verbose: c
348 files--verbose: c
325 files--verbose: b
349 files--verbose: b
326 files--verbose: a
350 files--verbose: a
327 files--debug:
351 files--debug: second
328 files--debug:
352 files--debug:
329 files--debug:
353 files--debug: d
330 files--debug:
354 files--debug:
331 files--debug: c
355 files--debug: c
332 files--debug:
356 files--debug: c
333 files--debug:
357 files--debug: b
334 files--debug:
358 files--debug: a
335 manifest: 7:f2dbc354b94e
359 manifest: 7:f2dbc354b94e
336 manifest: 6:91015e9dbdd7
360 manifest: 6:91015e9dbdd7
337 manifest: 5:4dc3def4f9b4
361 manifest: 5:4dc3def4f9b4
General Comments 0
You need to be logged in to leave comments. Login now