Show More
@@ -14,6 +14,7 b' test-amend.t' | |||
|
14 | 14 | test-ancestor.py |
|
15 | 15 | test-annotate.py |
|
16 | 16 | test-annotate.t |
|
17 | test-arbitraryfilectx.t | |
|
17 | 18 | test-archive-symlinks.t |
|
18 | 19 | test-archive.t |
|
19 | 20 | test-atomictempfile.py |
@@ -72,30 +72,30 b' Arbitraryfilectx.cmp does not follow sym' | |||
|
72 | 72 | These files are different and should return True (different): |
|
73 | 73 | (Note that filecmp.cmp's return semantics are inverted from ours, so we invert |
|
74 | 74 | for simplicity): |
|
75 | $ hg eval "context.arbitraryfilectx('A', repo).cmp(repo[None]['real_A'])" | |
|
75 | $ hg eval "context.arbitraryfilectx(b'A', repo).cmp(repo[None][b'real_A'])" | |
|
76 | 76 | True (no-eol) |
|
77 | $ hg eval "not filecmp.cmp('A', 'real_A')" | |
|
77 | $ hg eval "not filecmp.cmp(b'A', b'real_A')" | |
|
78 | 78 | True (no-eol) |
|
79 | 79 | |
|
80 | 80 | These files are identical and should return False (same): |
|
81 | $ hg eval "context.arbitraryfilectx('A', repo).cmp(repo[None]['A'])" | |
|
81 | $ hg eval "context.arbitraryfilectx(b'A', repo).cmp(repo[None][b'A'])" | |
|
82 | 82 | False (no-eol) |
|
83 | $ hg eval "context.arbitraryfilectx('A', repo).cmp(repo[None]['B'])" | |
|
83 | $ hg eval "context.arbitraryfilectx(b'A', repo).cmp(repo[None][b'B'])" | |
|
84 | 84 | False (no-eol) |
|
85 | $ hg eval "not filecmp.cmp('A', 'B')" | |
|
85 | $ hg eval "not filecmp.cmp(b'A', b'B')" | |
|
86 | 86 | False (no-eol) |
|
87 | 87 | |
|
88 | 88 | This comparison should also return False, since A and sym_A are substantially |
|
89 | 89 | the same in the eyes of ``filectx.cmp``, which looks at data only. |
|
90 | $ hg eval "context.arbitraryfilectx('real_A', repo).cmp(repo[None]['sym_A'])" | |
|
90 | $ hg eval "context.arbitraryfilectx(b'real_A', repo).cmp(repo[None][b'sym_A'])" | |
|
91 | 91 | False (no-eol) |
|
92 | 92 | |
|
93 | 93 | A naive use of filecmp on those two would wrongly return True, since it follows |
|
94 | 94 | the symlink to "A", which has different contents. |
|
95 | 95 | #if symlink |
|
96 | $ hg eval "not filecmp.cmp('real_A', 'sym_A')" | |
|
96 | $ hg eval "not filecmp.cmp(b'real_A', b'sym_A')" | |
|
97 | 97 | True (no-eol) |
|
98 | 98 | #else |
|
99 | $ hg eval "not filecmp.cmp('real_A', 'sym_A')" | |
|
99 | $ hg eval "not filecmp.cmp(b'real_A', b'sym_A')" | |
|
100 | 100 | False (no-eol) |
|
101 | 101 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now