Show More
@@ -1414,6 +1414,23 b' class changeset_templater(changeset_prin' | |||||
1414 |
|
1414 | |||
1415 | self.cache = {} |
|
1415 | self.cache = {} | |
1416 |
|
1416 | |||
|
1417 | # find correct templates for current mode | |||
|
1418 | tmplmodes = [ | |||
|
1419 | (True, None), | |||
|
1420 | (self.ui.verbose, 'verbose'), | |||
|
1421 | (self.ui.quiet, 'quiet'), | |||
|
1422 | (self.ui.debugflag, 'debug'), | |||
|
1423 | ] | |||
|
1424 | ||||
|
1425 | self._parts = {'header': '', 'footer': '', 'changeset': 'changeset'} | |||
|
1426 | for mode, postfix in tmplmodes: | |||
|
1427 | for t in self._parts: | |||
|
1428 | cur = t | |||
|
1429 | if postfix: | |||
|
1430 | cur += "_" + postfix | |||
|
1431 | if mode and cur in self.t: | |||
|
1432 | self._parts[t] = cur | |||
|
1433 | ||||
1417 | def _show(self, ctx, copies, matchfn, props): |
|
1434 | def _show(self, ctx, copies, matchfn, props): | |
1418 | '''show a single changeset or file revision''' |
|
1435 | '''show a single changeset or file revision''' | |
1419 |
|
1436 | |||
@@ -1440,27 +1457,10 b' class changeset_templater(changeset_prin' | |||||
1440 | props['revcache'] = {'copies': copies} |
|
1457 | props['revcache'] = {'copies': copies} | |
1441 | props['cache'] = self.cache |
|
1458 | props['cache'] = self.cache | |
1442 |
|
1459 | |||
1443 | # find correct templates for current mode |
|
|||
1444 | tmplmodes = [ |
|
|||
1445 | (True, None), |
|
|||
1446 | (self.ui.verbose, 'verbose'), |
|
|||
1447 | (self.ui.quiet, 'quiet'), |
|
|||
1448 | (self.ui.debugflag, 'debug'), |
|
|||
1449 | ] |
|
|||
1450 |
|
||||
1451 | types = {'header': '', 'footer': '', 'changeset': 'changeset'} |
|
|||
1452 | for mode, postfix in tmplmodes: |
|
|||
1453 | for t in types: |
|
|||
1454 | cur = t |
|
|||
1455 | if postfix: |
|
|||
1456 | cur += "_" + postfix |
|
|||
1457 | if mode and cur in self.t: |
|
|||
1458 | types[t] = cur |
|
|||
1459 |
|
||||
1460 | try: |
|
1460 | try: | |
1461 | # write header |
|
1461 | # write header | |
1462 |
if |
|
1462 | if self._parts['header']: | |
1463 |
h = templater.stringify(self.t( |
|
1463 | h = templater.stringify(self.t(self._parts['header'], **props)) | |
1464 | if self.buffered: |
|
1464 | if self.buffered: | |
1465 | self.header[ctx.rev()] = h |
|
1465 | self.header[ctx.rev()] = h | |
1466 | else: |
|
1466 | else: | |
@@ -1469,14 +1469,14 b' class changeset_templater(changeset_prin' | |||||
1469 | self.ui.write(h) |
|
1469 | self.ui.write(h) | |
1470 |
|
1470 | |||
1471 | # write changeset metadata, then patch if requested |
|
1471 | # write changeset metadata, then patch if requested | |
1472 |
key = |
|
1472 | key = self._parts['changeset'] | |
1473 | self.ui.write(templater.stringify(self.t(key, **props))) |
|
1473 | self.ui.write(templater.stringify(self.t(key, **props))) | |
1474 | self.showpatch(ctx.node(), matchfn) |
|
1474 | self.showpatch(ctx.node(), matchfn) | |
1475 |
|
1475 | |||
1476 |
if |
|
1476 | if self._parts['footer']: | |
1477 | if not self.footer: |
|
1477 | if not self.footer: | |
1478 |
self.footer = templater.stringify( |
|
1478 | self.footer = templater.stringify( | |
1479 | **props)) |
|
1479 | self.t(self._parts['footer'], **props)) | |
1480 | except KeyError as inst: |
|
1480 | except KeyError as inst: | |
1481 | msg = _("%s: no key named '%s'") |
|
1481 | msg = _("%s: no key named '%s'") | |
1482 | raise util.Abort(msg % (self.t.mapfile, inst.args[0])) |
|
1482 | raise util.Abort(msg % (self.t.mapfile, inst.args[0])) |
General Comments 0
You need to be logged in to leave comments.
Login now