comparison hglib/client.py @ 227:484b56ac4aec default tip

hglib: cat accepts a template argument
author Julien Cristau <jcristau@mozilla.com>
date Mon, 17 Jun 2024 17:17:58 +0200
parents 2ab42323f149
children
comparison
equal deleted inserted replaced
226:7b6ea46ea111 227:484b56ac4aec
589 eh = util.reterrorhandler(args) 589 eh = util.reterrorhandler(args)
590 self.rawcommand(args, eh=eh) 590 self.rawcommand(args, eh=eh)
591 591
592 return bool(eh) 592 return bool(eh)
593 593
594 def cat(self, files, rev=None, output=None): 594 def cat(self, files, rev=None, output=None, template=None):
595 """Return a string containing the specified files as they were at the 595 """Return a string containing the specified files as they were at the
596 given revision. If no revision is given, the parent of the working 596 given revision. If no revision is given, the parent of the working
597 directory is used, or tip if no revision is checked out. 597 directory is used, or tip if no revision is checked out.
598 598
599 If output is given, writes the contents to the specified file. 599 If output is given, writes the contents to the specified file.
604 "%s" basename of file being printed 604 "%s" basename of file being printed
605 "%d" dirname of file being printed, or '.' if in repository root 605 "%d" dirname of file being printed, or '.' if in repository root
606 "%p" root-relative path name of file being printed 606 "%p" root-relative path name of file being printed
607 607
608 """ 608 """
609 args = cmdbuilder(b('cat'), r=rev, o=output, hidden=self.hidden, *files) 609 args = cmdbuilder(b('cat'), r=rev, o=output, hidden=self.hidden, T=template, *files)
610 out = self.rawcommand(args) 610 out = self.rawcommand(args)
611 611
612 if not output: 612 if not output:
613 return out 613 return out
614 614