comparison hgext/keyword.py @ 6117:c74f1d9092f8

keyword: do not inspect node1 for diff if node2 is given
author Christian Ebert <blacktrash@gmx.net>
date Fri, 15 Feb 2008 18:37:00 +0100
parents 8121e9d7bfd2
children 09b00faa8670
comparison
equal deleted inserted replaced
6116:e27f39865d7e 6117:c74f1d9092f8
121 fp=None, changes=None, opts=None): 121 fp=None, changes=None, opts=None):
122 '''Monkeypatch patch.diff to avoid expansion except when 122 '''Monkeypatch patch.diff to avoid expansion except when
123 comparing against working dir.''' 123 comparing against working dir.'''
124 if node2 is not None: 124 if node2 is not None:
125 kwtools['templater'].matcher = util.never 125 kwtools['templater'].matcher = util.never
126 if node1 is not None and node1 != repo.changectx().node(): 126 elif node1 is not None and node1 != repo.changectx().node():
127 kwtools['templater'].restrict = True 127 kwtools['templater'].restrict = True
128 _patch_diff(repo, node1=node1, node2=node2, files=files, match=match, 128 _patch_diff(repo, node1=node1, node2=node2, files=files, match=match,
129 fp=fp, changes=changes, opts=opts) 129 fp=fp, changes=changes, opts=opts)
130 130
131 def _kwweb_changeset(web, req, tmpl): 131 def _kwweb_changeset(web, req, tmpl):
456 keyword substitutions. 456 keyword substitutions.
457 This is done for local repos only, and only if there are 457 This is done for local repos only, and only if there are
458 files configured at all for keyword substitution.''' 458 files configured at all for keyword substitution.'''
459 459
460 try: 460 try:
461 if (not repo.local() or kwtools['hgcmd'] in nokwcommands.split() 461 if (not repo.local() or kwtools['hgcmd'] in nokwcommands.split()
462 or '.hg' in util.splitpath(repo.root) 462 or '.hg' in util.splitpath(repo.root)
463 or repo._url.startswith('bundle:')): 463 or repo._url.startswith('bundle:')):
464 return 464 return
465 except AttributeError: 465 except AttributeError:
466 pass 466 pass