##// END OF EJS Templates
command line templates: add formatnode filter...
Alexis S. L. Carvalho -
r4352:051fb8c2 default
parent child Browse files
Show More
@@ -325,10 +325,14 b' class changeset_templater(changeset_prin'
325 325
326 326 def __init__(self, ui, repo, patch, brinfo, mapfile, buffered):
327 327 changeset_printer.__init__(self, ui, repo, patch, brinfo, buffered)
328 self.t = templater.templater(mapfile, templater.common_filters,
329 cache={'parent': '{rev}:{node|short} ',
330 'manifest': '{rev}:{node|short}',
331 'filecopy': '{name} ({source})'})
328 filters = templater.common_filters.copy()
329 filters['formatnode'] = (ui.debugflag and (lambda x: x)
330 or (lambda x: x[:12]))
331 self.t = templater.templater(mapfile, filters,
332 cache={
333 'parent': '{rev}:{node|formatnode} ',
334 'manifest': '{rev}:{node|formatnode}',
335 'filecopy': '{name} ({source})'})
332 336
333 337 def use_template(self, t):
334 338 '''set template string to use'''
@@ -1,4 +1,4 b''
1 changeset = 'changeset: {rev}:{node|short}\n{branches}{tags}{short_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 2 changeset_quiet = '{rev}:{node|short}\n'
3 3 changeset_verbose = 'changeset: {rev}:{node|short}\n{branches}{tags}{parents}{manifest}user: {author}\ndate: {date|date}\n{files}{file_adds}{file_dels}{file_copies}description:\n{desc|strip}\n\n\n'
4 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'
@@ -14,8 +14,7 b" end_file_dels = '\\n'"
14 14 start_file_copies = 'copies: '
15 15 file_copy = ' {name} ({source})'
16 16 end_file_copies = '\n'
17 short_parent = 'parent: {rev}:{node|short}\n'
18 parent = 'parent: {rev}:{node}\n'
17 parent = 'parent: {rev}:{node|formatnode}\n'
19 18 manifest = 'manifest: {rev}:{node}\n'
20 19 branch = 'branch: {branch}\n'
21 20 tag = 'tag: {tag}\n'
@@ -96,6 +96,16 b" hg log --template '{date|rfc822date}\\n'"
96 96 hg log --template '{desc|firstline}\n'
97 97 hg log --template '{node|short}\n'
98 98
99 echo '# formatnode filter works'
100 echo '# quiet'
101 hg -q log -r 0 --template '#node|formatnode#\n'
102 echo '# normal'
103 hg log -r 0 --template '#node|formatnode#\n'
104 echo '# verbose'
105 hg -v log -r 0 --template '#node|formatnode#\n'
106 echo '# debug'
107 hg --debug log -r 0 --template '#node|formatnode#\n'
108
99 109 echo '# error on syntax'
100 110 echo 'x = "f' >> t
101 111 hg log
@@ -230,11 +230,11 b' manifest--verbose:'
230 230 manifest--verbose:
231 231 manifest--verbose:
232 232 manifest--verbose:
233 manifest--debug: 4:90ae8dda64e1
234 manifest--debug: 3:cb5a1327723b
235 manifest--debug: 2:6e0e82995c35
236 manifest--debug: 1:4e8d705b1e53
237 manifest--debug: 0:a0c8bcbbb45c
233 manifest--debug: 4:90ae8dda64e1a876c792bccb9af66284f6018363
234 manifest--debug: 3:cb5a1327723bada42f117e4c55a303246eaf9ccc
235 manifest--debug: 2:6e0e82995c35d0d57a52aca8da4e56139e06b4b1
236 manifest--debug: 1:4e8d705b1e53e3f9375e0e60dc7b525d8211fe55
237 manifest--debug: 0:a0c8bcbbb45c63b90b70ad007bf38961f64f2af0
238 238 node: 32a18f097fcccf76ef282f62f8a85b3adf8d13c4
239 239 node: 10e46f2dcbf4823578cf180f33ecf0b957964c47
240 240 node: 97054abb4ab824450e9164180baf491ae0078465
@@ -260,11 +260,11 b' parents--verbose:'
260 260 parents--verbose:
261 261 parents--verbose:
262 262 parents--verbose:
263 parents--debug: 3:10e46f2dcbf4 -1:000000000000
264 parents--debug: 2:97054abb4ab8 -1:000000000000
265 parents--debug: 1:b608e9d1a3f0 -1:000000000000
266 parents--debug: 0:1e4e1b8f71e0 -1:000000000000
267 parents--debug: -1:000000000000 -1:000000000000
263 parents--debug: 3:10e46f2dcbf4823578cf180f33ecf0b957964c47 -1:0000000000000000000000000000000000000000
264 parents--debug: 2:97054abb4ab824450e9164180baf491ae0078465 -1:0000000000000000000000000000000000000000
265 parents--debug: 1:b608e9d1a3f0273ccf70fb85fd6866b3482bf965 -1:0000000000000000000000000000000000000000
266 parents--debug: 0:1e4e1b8f71e05681d422154f5421e385fec3454f -1:0000000000000000000000000000000000000000
267 parents--debug: -1:0000000000000000000000000000000000000000 -1:0000000000000000000000000000000000000000
268 268 rev: 4
269 269 rev: 3
270 270 rev: 2
@@ -336,6 +336,15 b' 10e46f2dcbf4'
336 336 97054abb4ab8
337 337 b608e9d1a3f0
338 338 1e4e1b8f71e0
339 # formatnode filter works
340 # quiet
341 1e4e1b8f71e0
342 # normal
343 1e4e1b8f71e0
344 # verbose
345 1e4e1b8f71e0
346 # debug
347 1e4e1b8f71e05681d422154f5421e385fec3454f
339 348 # error on syntax
340 349 abort: t:3: unmatched quotes
341 350 # done
General Comments 0
You need to be logged in to leave comments. Login now