[issue2950] hg diff seems to not preserve whitespace changes
Nathan Michaels
bugs at mercurial.selenic.com
Wed Aug 10 11:16:21 CDT 2011
New submission from Nathan Michaels <nmichaels at gmail.com>:
I've got this happening in 1.8.3, but I couldn't find any references to it.
The problem is that hg diff seems to be ignoring whitespace (as though it had been passed "-
b" or "-w", but it hadn't. To make this happen, I put a snippet of mockup assembler code in a
file in a new repository. After adding and committing it, I changed one line and the spacing
on other lines, as you'll see below.
Here's my shell history showing it in action:
$ hg log
changeset: 1:3a3315c3161c
tag: tip
user: me
date: Wed Aug 10 12:00:23 2011 -0400
summary: Changed a number.
changeset: 0:a5e29a057ab5
user: me
date: Wed Aug 10 11:59:03 2011 -0400
summary: A file with formatted code.
$ hg update 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ ls
file.S
$ hg cat -r 0 file.S
LabelName:
{ move r3, lr ; fnop }
{ move r12, r7 ; shri r6, CONSTANT, 7 }
{ bbs r1, someBit ; addi r4, r4, 9 }
$ hg cat -r 1 file.S
LabelName:
{ move r3, lr ; fnop }
{ move r12, r7 ; shri r6, CONSTANT, 12 }
{ bbs r1, someBit ; addi r4, r4, 9 }
$ hg diff -c 1 file.S
diff -r a5e29a057ab5 -r 3a3315c3161c file.S
--- a/file.S Wed Aug 10 11:59:03 2011 -0400
+++ b/file.S Wed Aug 10 12:00:23 2011 -0400
@@ -1,4 +1,4 @@
LabelName:
{ move r3, lr ; fnop }
- { move r12, r7 ; shri r6, CONSTANT, 7 }
+ { move r12, r7 ; shri r6, CONSTANT, 12 }
{ bbs r1, someBit ; addi r4, r4, 9 }
$ hg diff -c 1 file.S > DIFF
$ hg import --no-commit DIFF
applying DIFF
$ cat file.S
LabelName:
{ move r3, lr ; fnop }
{ move r12, r7 ; shri r6, CONSTANT, 12 }
{ bbs r1, someBit ; addi r4, r4, 9 }
As you can see, the }s don't line up in the diff version but they do in the cat version.
----------
messages: 17104
nosy: nmichaels
priority: bug
status: unread
title: hg diff seems to not preserve whitespace changes
____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2950>
____________________________________________________
More information about the Mercurial-devel
mailing list