comparison mercurial/mdiff.py @ 10189:e451e599fbcf

patch: support diff data loss detection and upgrade In worst case, generating diff in upgrade mode can be two times more expensive than generating it in git mode directly: we may have to regenerate the whole diff again whenever a git feature is detected. Also, the first diff attempt is completely buffered instead of being streamed. That said, even without having profiled it yet, I am convinced we can fast-path the upgrade mode if necessary were it to be used in regular diff commands, and not only in mq where avoiding data loss is worth the price.
author Patrick Mezard <pmezard@gmail.com>
date Fri, 01 Jan 2010 20:54:05 +0100
parents 7637fe4f525d
children d6512b3e9ac0
comparison
equal deleted inserted replaced
10188:fd6e9c7cd98c 10189:e451e599fbcf
25 showfunc enables diff -p output 25 showfunc enables diff -p output
26 git enables the git extended patch format 26 git enables the git extended patch format
27 nodates removes dates from diff headers 27 nodates removes dates from diff headers
28 ignorews ignores all whitespace changes in the diff 28 ignorews ignores all whitespace changes in the diff
29 ignorewsamount ignores changes in the amount of whitespace 29 ignorewsamount ignores changes in the amount of whitespace
30 ignoreblanklines ignores changes whose lines are all blank''' 30 ignoreblanklines ignores changes whose lines are all blank
31 upgrade generates git diffs to avoid data loss
32 '''
31 33
32 defaults = { 34 defaults = {
33 'context': 3, 35 'context': 3,
34 'text': False, 36 'text': False,
35 'showfunc': False, 37 'showfunc': False,
36 'git': False, 38 'git': False,
37 'nodates': False, 39 'nodates': False,
38 'ignorews': False, 40 'ignorews': False,
39 'ignorewsamount': False, 41 'ignorewsamount': False,
40 'ignoreblanklines': False, 42 'ignoreblanklines': False,
43 'upgrade': False,
41 } 44 }
42 45
43 __slots__ = defaults.keys() 46 __slots__ = defaults.keys()
44 47
45 def __init__(self, **opts): 48 def __init__(self, **opts):