Show More
@@ -72,7 +72,7 b' def wsclean(opts, text, blank=True):' | |||||
72 | text = re.sub('[ \t\r]+', ' ', text) |
|
72 | text = re.sub('[ \t\r]+', ' ', text) | |
73 | text = text.replace(' \n', '\n') |
|
73 | text = text.replace(' \n', '\n') | |
74 | if blank and opts.ignoreblanklines: |
|
74 | if blank and opts.ignoreblanklines: | |
75 | text = re.sub('\n+', '', text) |
|
75 | text = re.sub('\n+', '\n', text).strip('\n') | |
76 | return text |
|
76 | return text | |
77 |
|
77 | |||
78 | def diffline(revs, a, b, opts): |
|
78 | def diffline(revs, a, b, opts): |
@@ -442,3 +442,16 b' Only new line noticed:' | |||||
442 | New line not noticed when space change ignored: |
|
442 | New line not noticed when space change ignored: | |
443 |
|
443 | |||
444 | $ hg ndiff --ignore-blank-lines --ignore-all-space |
|
444 | $ hg ndiff --ignore-blank-lines --ignore-all-space | |
|
445 | ||||
|
446 | Do not ignore all newlines, only blank lines | |||
|
447 | ||||
|
448 | $ printf 'hello \nworld\ngoodbye world\n' > foo | |||
|
449 | $ hg ndiff --ignore-blank-lines | |||
|
450 | diff -r 540c40a65b78 foo | |||
|
451 | --- a/foo | |||
|
452 | +++ b/foo | |||
|
453 | @@ -1,2 +1,3 @@ | |||
|
454 | -hello world | |||
|
455 | +hello | |||
|
456 | +world | |||
|
457 | goodbye world |
General Comments 0
You need to be logged in to leave comments.
Login now