comparison mercurial/cmdutil.py @ 11061:51d0387523c6

log: add --stat for diffstat output log --stat shows diffstat in place of patch output.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 01 Apr 2010 00:35:12 +0900
parents ef4aa90b1e58
children e8d10d085f47
comparison
equal deleted inserted replaced
11060:e6df01776e08 11061:51d0387523c6
801 801
802 self.showpatch(changenode) 802 self.showpatch(changenode)
803 803
804 def showpatch(self, node): 804 def showpatch(self, node):
805 if self.patch: 805 if self.patch:
806 stat = self.diffopts.get('stat')
807 diffopts = patch.diffopts(self.ui, self.diffopts)
806 prev = self.repo.changelog.parents(node)[0] 808 prev = self.repo.changelog.parents(node)[0]
807 chunks = patch.diffui(self.repo, prev, node, match=self.patch, 809 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
808 opts=patch.diffopts(self.ui, self.diffopts)) 810 match=self.patch, stat=stat)
809 for chunk, label in chunks:
810 self.ui.write(chunk, label=label)
811 self.ui.write("\n") 811 self.ui.write("\n")
812 812
813 def _meaningful_parentrevs(self, log, rev): 813 def _meaningful_parentrevs(self, log, rev):
814 """Return list of meaningful (or all if debug) parentrevs for rev. 814 """Return list of meaningful (or all if debug) parentrevs for rev.
815 815
937 If all of these values are either the unset or the empty string, 937 If all of these values are either the unset or the empty string,
938 regular display via changeset_printer() is done. 938 regular display via changeset_printer() is done.
939 """ 939 """
940 # options 940 # options
941 patch = False 941 patch = False
942 if opts.get('patch'): 942 if opts.get('patch') or opts.get('stat'):
943 patch = matchfn or matchall(repo) 943 patch = matchfn or matchall(repo)
944 944
945 tmpl = opts.get('template') 945 tmpl = opts.get('template')
946 style = None 946 style = None
947 if tmpl: 947 if tmpl: