comparison hgext/keyword.py @ 7308:b6f5490effbf

patch: turn patch.diff() into a generator This should even be a little faster than passing in an fp argument.
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Mon, 03 Nov 2008 16:48:23 +0100
parents 292fb2ad2846
children 87158be081b8
comparison
equal deleted inserted replaced
7307:56380212d630 7308:b6f5490effbf
499 rejects or conflicts due to expanded keywords in working dir.''' 499 rejects or conflicts due to expanded keywords in working dir.'''
500 orig(self, ui, fname, missing) 500 orig(self, ui, fname, missing)
501 # shrink keywords read from working dir 501 # shrink keywords read from working dir
502 self.lines = kwt.shrinklines(self.fname, self.lines) 502 self.lines = kwt.shrinklines(self.fname, self.lines)
503 503
504 def kw_diff(orig, repo, node1=None, node2=None, match=None, 504 def kw_diff(orig, repo, node1=None, node2=None, match=None, changes=None,
505 fp=None, changes=None, opts=None): 505 opts=None):
506 '''Monkeypatch patch.diff to avoid expansion except when 506 '''Monkeypatch patch.diff to avoid expansion except when
507 comparing against working dir.''' 507 comparing against working dir.'''
508 if node2 is not None: 508 if node2 is not None:
509 kwt.matcher = util.never 509 kwt.matcher = util.never
510 elif node1 is not None and node1 != repo['.'].node(): 510 elif node1 is not None and node1 != repo['.'].node():
511 kwt.restrict = True 511 kwt.restrict = True
512 orig(repo, node1, node2, match, fp, changes, opts) 512 return orig(repo, node1, node2, match, changes, opts)
513 513
514 def kwweb_skip(orig, web, req, tmpl): 514 def kwweb_skip(orig, web, req, tmpl):
515 '''Wraps webcommands.x turning off keyword expansion.''' 515 '''Wraps webcommands.x turning off keyword expansion.'''
516 kwt.matcher = util.never 516 kwt.matcher = util.never
517 return orig(web, req, tmpl) 517 return orig(web, req, tmpl)