Mercurial > hg
comparison mercurial/context.py @ 38520:02633fe3883a
context: also take all other arguments than `patch.diff` accept
This is needed to use `context.diff` as a full replacement of `patch.diff`
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Wed, 23 May 2018 15:31:40 +0200 |
parents | 4455e5d4d59c |
children | c1a7bbf9984d |
comparison
equal
deleted
inserted
replaced
38519:4455e5d4d59c | 38520:02633fe3883a |
---|---|
292 return matchmod.match(r.root, r.getcwd(), pats, | 292 return matchmod.match(r.root, r.getcwd(), pats, |
293 include, exclude, default, | 293 include, exclude, default, |
294 auditor=r.nofsauditor, ctx=self, | 294 auditor=r.nofsauditor, ctx=self, |
295 listsubrepos=listsubrepos, badfn=badfn) | 295 listsubrepos=listsubrepos, badfn=badfn) |
296 | 296 |
297 def diff(self, ctx2=None, match=None, opts=None): | 297 def diff(self, ctx2=None, match=None, changes=None, opts=None, |
298 losedatafn=None, prefix='', relroot='', copy=None, | |
299 hunksfilterfn=None): | |
298 """Returns a diff generator for the given contexts and matcher""" | 300 """Returns a diff generator for the given contexts and matcher""" |
299 if ctx2 is None: | 301 if ctx2 is None: |
300 ctx2 = self.p1() | 302 ctx2 = self.p1() |
301 if ctx2 is not None: | 303 if ctx2 is not None: |
302 ctx2 = self._repo[ctx2] | 304 ctx2 = self._repo[ctx2] |
303 diffopts = patch.diffopts(self._repo.ui, opts) | 305 diffopts = patch.diffopts(self._repo.ui, opts) |
304 return patch.diff(self._repo, ctx2, self, match=match, opts=diffopts) | 306 return patch.diff(self._repo, ctx2, self, match=match, changes=changes, |
307 opts=diffopts, losedatafn=losedatafn, prefix=prefix, | |
308 relroot=relroot, copy=copy, | |
309 hunksfilterfn=hunksfilterfn) | |
305 | 310 |
306 def dirs(self): | 311 def dirs(self): |
307 return self._manifest.dirs() | 312 return self._manifest.dirs() |
308 | 313 |
309 def hasdir(self, dir): | 314 def hasdir(self, dir): |