comparison mercurial/cmdutil.py @ 11958:60bfb876dc45

merge with stable
author Matt Mackall <mpm@selenic.com>
date Tue, 17 Aug 2010 17:44:19 -0500
parents a80577bfea29 d157e040ac4c
children ad787252fed6
comparison
equal deleted inserted replaced
11957:8439a7a2d613 11958:60bfb876dc45
661 else: 661 else:
662 def write(s, **kw): 662 def write(s, **kw):
663 fp.write(s) 663 fp.write(s)
664 664
665 if stat: 665 if stat:
666 diffopts.context = 0 666 diffopts = diffopts.copy(context=0)
667 width = 80 667 width = 80
668 if not ui.plain(): 668 if not ui.plain():
669 width = util.termwidth() 669 width = util.termwidth()
670 chunks = patch.diff(repo, node1, node2, match, changes, diffopts) 670 chunks = patch.diff(repo, node1, node2, match, changes, diffopts)
671 for chunk, label in patch.diffstatui(util.iterlines(chunks), 671 for chunk, label in patch.diffstatui(util.iterlines(chunks),
801 def showpatch(self, node, matchfn): 801 def showpatch(self, node, matchfn):
802 if not matchfn: 802 if not matchfn:
803 matchfn = self.patch 803 matchfn = self.patch
804 if matchfn: 804 if matchfn:
805 stat = self.diffopts.get('stat') 805 stat = self.diffopts.get('stat')
806 diff = self.diffopts.get('patch')
806 diffopts = patch.diffopts(self.ui, self.diffopts) 807 diffopts = patch.diffopts(self.ui, self.diffopts)
807 prev = self.repo.changelog.parents(node)[0] 808 prev = self.repo.changelog.parents(node)[0]
808 diffordiffstat(self.ui, self.repo, diffopts, prev, node, 809 if stat:
809 match=matchfn, stat=stat) 810 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
811 match=matchfn, stat=True)
812 if diff:
813 if stat:
814 self.ui.write("\n")
815 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
816 match=matchfn, stat=False)
810 self.ui.write("\n") 817 self.ui.write("\n")
811 818
812 def _meaningful_parentrevs(self, log, rev): 819 def _meaningful_parentrevs(self, log, rev):
813 """Return list of meaningful (or all if debug) parentrevs for rev. 820 """Return list of meaningful (or all if debug) parentrevs for rev.
814 821