##// END OF EJS Templates
keyword: avoid extra diffs when not comparing against working dir...
Christian Ebert -
r5885:53be1575 default
parent child Browse files
Show More
@@ -94,7 +94,8 b' def _kwrestrict(cmd):'
94 '''Returns True if cmd should trigger restricted expansion.
94 '''Returns True if cmd should trigger restricted expansion.
95 Keywords will only expanded when writing to working dir.
95 Keywords will only expanded when writing to working dir.
96 Crucial for mq as expanded keywords should not make it into patches.'''
96 Crucial for mq as expanded keywords should not make it into patches.'''
97 return cmd in ('qimport', 'qnew', 'qpush', 'qrefresh', 'record', 'qrecord')
97 return cmd in ('diff1',
98 'qimport', 'qnew', 'qpush', 'qrefresh', 'record', 'qrecord')
98
99
99
100
100 _kwtemplater = None
101 _kwtemplater = None
@@ -419,6 +420,15 b' def reposetup(ui, repo):'
419 if hgcmd in nokwcommands:
420 if hgcmd in nokwcommands:
420 return
421 return
421
422
423 if hgcmd == 'diff':
424 # only expand if comparing against working dir
425 node1, node2 = cmdutil.revpair(repo, cmdopts.get('rev'))
426 if node2 is not None:
427 return
428 # shrink if rev is not current node
429 if node1 is not None and node1 != repo.changectx().node():
430 hgcmd = 'diff1'
431
422 inc, exc = [], ['.hgtags']
432 inc, exc = [], ['.hgtags']
423 for pat, opt in ui.configitems('keyword'):
433 for pat, opt in ui.configitems('keyword'):
424 if opt != 'ignore':
434 if opt != 'ignore':
@@ -188,7 +188,7 b' c'
188 diff -r f782df5f9602 c
188 diff -r f782df5f9602 c
189 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
189 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
190 @@ -0,0 +1,3 @@
190 @@ -0,0 +1,3 @@
191 +expand $Id: c,v 0ba462c0f077 1970/01/01 00:00:01 user $
191 +expand $Id$
192 +do not process $Id:
192 +do not process $Id:
193 +xxx $
193 +xxx $
194 % rollback
194 % rollback
General Comments 0
You need to be logged in to leave comments. Login now