def showpatch(self, node, matchfn):
     if not matchfn:
         matchfn = self.patch
     if matchfn:
         stat = self.diffopts.get('stat')
         diff = self.diffopts.get('patch')
         diffopts = patch.diffopts(self.ui, self.diffopts)
         prev = self.repo.changelog.parents(node)[0]
         if stat:
             diffordiffstat(self.ui,
                            self.repo,
                            diffopts,
                            prev,
                            node,
                            match=matchfn,
                            stat=True)
         if diff:
             if stat:
                 self.ui.write("\n")
             diffordiffstat(self.ui,
                            self.repo,
                            diffopts,
                            prev,
                            node,
                            match=matchfn,
                            stat=False)
         self.ui.write("\n")
 def diff(self, ctx2=None, match=None, **opts):
     """Returns a diff generator for the given contexts and matcher"""
     if ctx2 is None:
         ctx2 = self.p1()
     if ctx2 is not None and not isinstance(ctx2, changectx):
         ctx2 = self._repo[ctx2]
     diffopts = patch.diffopts(self._repo.ui, opts)
     return patch.diff(self._repo, ctx2.node(), self.node(), match=match, opts=diffopts)
Example #3
0
 def showpatch(self, node):
     if self.patch:
         prev = self.repo.changelog.parents(node)[0]
         chunks = patch.diff(self.repo, prev, node, match=self.patch,
                             opts=patch.diffopts(self.ui, self.diffopts))
         for chunk in chunks:
             self.ui.write(chunk)
         self.ui.write("\n")
Example #4
0
 def showpatch(self, node):
     if self.patch:
         prev = self.repo.changelog.parents(node)[0]
         chunks = patch.diff(self.repo, prev, node, match=self.patch,
                             opts=patch.diffopts(self.ui, self.diffopts))
         for chunk in chunks:
             self.ui.write(chunk)
         self.ui.write("\n")
Example #5
0
 def showpatch(self, node):
     if self.patch:
         prev = self.repo.changelog.parents(node)[0]
         patch.diff(self.repo,
                    prev,
                    node,
                    match=self.patch,
                    fp=self.ui,
                    opts=patch.diffopts(self.ui))
         self.ui.write("\n")
Example #6
0
 def diff(self, ctx2=None, match=None, **opts):
     """Returns a diff generator for the given contexts and matcher"""
     if ctx2 is None:
         ctx2 = self.p1()
     if ctx2 is not None and not isinstance(ctx2, changectx):
         ctx2 = self._repo[ctx2]
     diffopts = patch.diffopts(self._repo.ui, opts)
     return patch.diff(self._repo,
                       ctx2.node(),
                       self.node(),
                       match=match,
                       opts=diffopts)
Example #7
0
 def showpatch(self, node, matchfn):
     if not matchfn:
         matchfn = self.patch
     if matchfn:
         stat = self.diffopts.get('stat')
         diff = self.diffopts.get('patch')
         diffopts = patch.diffopts(self.ui, self.diffopts)
         prev = self.repo.changelog.parents(node)[0]
         if stat:
             diffordiffstat(self.ui, self.repo, diffopts, prev, node,
                            match=matchfn, stat=True)
         if diff:
             if stat:
                 self.ui.write("\n")
             diffordiffstat(self.ui, self.repo, diffopts, prev, node,
                            match=matchfn, stat=False)
         self.ui.write("\n")
Example #8
0
 def showpatch(self, node):
     if self.patch:
         prev = self.repo.changelog.parents(node)[0]
         patch.diff(self.repo, prev, node, match=self.patch, fp=self.ui,
                    opts=patch.diffopts(self.ui))
         self.ui.write("\n")