##// END OF EJS Templates
logcmdutil: unindent diff generator of changesetprinter...
Yuya Nishihara -
r36021:d4c210ee default
parent child Browse files
Show More
@@ -282,7 +282,8 b' class changesetprinter(object):'
282 def _showpatch(self, ctx):
282 def _showpatch(self, ctx):
283 matchfn = self._makefilematcher(ctx)
283 matchfn = self._makefilematcher(ctx)
284 hunksfilterfn = self._makehunksfilter(ctx)
284 hunksfilterfn = self._makehunksfilter(ctx)
285 if matchfn:
285 if not matchfn:
286 return
286 stat = self.diffopts.get('stat')
287 stat = self.diffopts.get('stat')
287 diff = self.diffopts.get('patch')
288 diff = self.diffopts.get('patch')
288 diffopts = patch.diffallopts(self.ui, self.diffopts)
289 diffopts = patch.diffallopts(self.ui, self.diffopts)
@@ -292,9 +293,9 b' class changesetprinter(object):'
292 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
293 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
293 match=matchfn, stat=True,
294 match=matchfn, stat=True,
294 hunksfilterfn=hunksfilterfn)
295 hunksfilterfn=hunksfilterfn)
296 if stat and diff:
297 self.ui.write("\n")
295 if diff:
298 if diff:
296 if stat:
297 self.ui.write("\n")
298 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
299 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
299 match=matchfn, stat=False,
300 match=matchfn, stat=False,
300 hunksfilterfn=hunksfilterfn)
301 hunksfilterfn=hunksfilterfn)
@@ -383,18 +384,17 b' class jsonchangeset(changesetprinter):'
383 for k, v in copies))
384 for k, v in copies))
384
385
385 matchfn = self._makefilematcher(ctx)
386 matchfn = self._makefilematcher(ctx)
386 if matchfn:
387 stat = self.diffopts.get('stat')
387 stat = self.diffopts.get('stat')
388 diff = self.diffopts.get('patch')
388 diff = self.diffopts.get('patch')
389 diffopts = patch.difffeatureopts(self.ui, self.diffopts, git=True)
389 diffopts = patch.difffeatureopts(self.ui, self.diffopts, git=True)
390 node, prev = ctx.node(), ctx.p1().node()
390 node, prev = ctx.node(), ctx.p1().node()
391 if stat:
391 if matchfn and stat:
392 self.ui.pushbuffer()
392 self.ui.pushbuffer()
393 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
393 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
394 match=matchfn, stat=True)
394 match=matchfn, stat=True)
395 self.ui.write((',\n "diffstat": "%s"')
395 self.ui.write((',\n "diffstat": "%s"')
396 % j(self.ui.popbuffer()))
396 % j(self.ui.popbuffer()))
397 if diff:
397 if matchfn and diff:
398 self.ui.pushbuffer()
398 self.ui.pushbuffer()
399 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
399 diffordiffstat(self.ui, self.repo, diffopts, prev, node,
400 match=matchfn, stat=False)
400 match=matchfn, stat=False)
General Comments 0
You need to be logged in to leave comments. Login now