##// END OF EJS Templates
log: consume --stat/patch options at constructor of changesetprinter...
Yuya Nishihara -
r37859:3fe1c926 default
parent child Browse files
Show More
@@ -155,7 +155,8 b' class changesetprinter(object):'
155 self.buffered = buffered
155 self.buffered = buffered
156 self._differ = differ or changesetdiffer()
156 self._differ = differ or changesetdiffer()
157 self._diffopts = patch.diffallopts(ui, diffopts)
157 self._diffopts = patch.diffallopts(ui, diffopts)
158 self.diffopts = diffopts or {}
158 self._includestat = diffopts and diffopts.get('stat')
159 self._includediff = diffopts and diffopts.get('patch')
159 self.header = {}
160 self.header = {}
160 self.hunk = {}
161 self.hunk = {}
161 self.lastheader = None
162 self.lastheader = None
@@ -299,15 +300,13 b' class changesetprinter(object):'
299 '''
300 '''
300
301
301 def _showpatch(self, ctx):
302 def _showpatch(self, ctx):
302 stat = self.diffopts.get('stat')
303 if self._includestat:
303 diff = self.diffopts.get('patch')
304 if stat:
305 self._differ.showdiff(self.ui, ctx, self._diffopts, stat=True)
304 self._differ.showdiff(self.ui, ctx, self._diffopts, stat=True)
306 if stat and diff:
305 if self._includestat and self._includediff:
307 self.ui.write("\n")
306 self.ui.write("\n")
308 if diff:
307 if self._includediff:
309 self._differ.showdiff(self.ui, ctx, self._diffopts, stat=False)
308 self._differ.showdiff(self.ui, ctx, self._diffopts, stat=False)
310 if stat or diff:
309 if self._includestat or self._includediff:
311 self.ui.write("\n")
310 self.ui.write("\n")
312
311
313 class changesetformatter(changesetprinter):
312 class changesetformatter(changesetprinter):
@@ -368,13 +367,11 b' class changesetformatter(changesetprinte'
368 fm.data(copies=fm.formatdict(copies,
367 fm.data(copies=fm.formatdict(copies,
369 key='name', value='source'))
368 key='name', value='source'))
370
369
371 stat = self.diffopts.get('stat')
370 if self._includestat:
372 diff = self.diffopts.get('patch')
373 if stat:
374 self.ui.pushbuffer()
371 self.ui.pushbuffer()
375 self._differ.showdiff(self.ui, ctx, self._diffopts, stat=True)
372 self._differ.showdiff(self.ui, ctx, self._diffopts, stat=True)
376 fm.data(diffstat=self.ui.popbuffer())
373 fm.data(diffstat=self.ui.popbuffer())
377 if diff:
374 if self._includediff:
378 self.ui.pushbuffer()
375 self.ui.pushbuffer()
379 self._differ.showdiff(self.ui, ctx, self._diffopts, stat=False)
376 self._differ.showdiff(self.ui, ctx, self._diffopts, stat=False)
380 fm.data(diff=self.ui.popbuffer())
377 fm.data(diff=self.ui.popbuffer())
General Comments 0
You need to be logged in to leave comments. Login now