##// END OF EJS Templates
make templater bit more flexible and efficient for external users.
Vadim Gelfer -
r2191:c2e43535 default
parent child Browse files
Show More
@@ -268,6 +268,7 def indent(text, prefix):
268
268
269 common_filters = {
269 common_filters = {
270 "addbreaks": nl2br,
270 "addbreaks": nl2br,
271 "basename": os.path.basename,
271 "age": age,
272 "age": age,
272 "date": lambda x: util.datestr(x),
273 "date": lambda x: util.datestr(x),
273 "domain": domain,
274 "domain": domain,
@@ -336,14 +337,15 class changeset_templater(object):
336 def write_header(self, thing):
337 def write_header(self, thing):
337 self.write(thing, header=True)
338 self.write(thing, header=True)
338
339
339 def show(self, rev=0, changenode=None, brinfo=None):
340 def show(self, rev=0, changenode=None, brinfo=None, changes=None,
341 **props):
340 '''show a single changeset or file revision'''
342 '''show a single changeset or file revision'''
341 log = self.repo.changelog
343 log = self.repo.changelog
342 if changenode is None:
344 if changenode is None:
343 changenode = log.node(rev)
345 changenode = log.node(rev)
344 elif not rev:
346 elif not rev:
345 rev = log.rev(changenode)
347 rev = log.rev(changenode)
346
348 if changes is None:
347 changes = log.read(changenode)
349 changes = log.read(changenode)
348
350
349 def showlist(name, values, plural=None, **args):
351 def showlist(name, values, plural=None, **args):
@@ -453,7 +455,7 class changeset_templater(object):
453 showadds = ''
455 showadds = ''
454 showdels = ''
456 showdels = ''
455
457
456 props = {
458 defprops = {
457 'author': changes[1],
459 'author': changes[1],
458 'branches': showbranches,
460 'branches': showbranches,
459 'date': changes[2],
461 'date': changes[2],
@@ -467,6 +469,8 class changeset_templater(object):
467 'rev': rev,
469 'rev': rev,
468 'tags': showtags,
470 'tags': showtags,
469 }
471 }
472 props = props.copy()
473 props.update(defprops)
470
474
471 try:
475 try:
472 if self.ui.debugflag and 'header_debug' in self.t:
476 if self.ui.debugflag and 'header_debug' in self.t:
General Comments 0
You need to be logged in to leave comments. Login now