Show More
@@ -19,6 +19,7 b' Arbitraryfilectx.cmp does not follow sym' | |||
|
19 | 19 | $ mkdir case1 |
|
20 | 20 | $ cd case1 |
|
21 | 21 | $ hg init |
|
22 | #if symlink | |
|
22 | 23 | $ printf "A" > real_A |
|
23 | 24 | $ printf "foo" > A |
|
24 | 25 | $ printf "foo" > B |
@@ -29,6 +30,44 b' Arbitraryfilectx.cmp does not follow sym' | |||
|
29 | 30 | adding real_A |
|
30 | 31 | adding sym_A |
|
31 | 32 | $ hg commit -m "base" |
|
33 | #else | |
|
34 | $ hg import -q --bypass - <<EOF | |
|
35 | > # HG changeset patch | |
|
36 | > # User test | |
|
37 | > # Date 0 0 | |
|
38 | > base | |
|
39 | > | |
|
40 | > diff --git a/A b/A | |
|
41 | > new file mode 100644 | |
|
42 | > --- /dev/null | |
|
43 | > +++ b/A | |
|
44 | > @@ -0,0 +1,1 @@ | |
|
45 | > +foo | |
|
46 | > \ No newline at end of file | |
|
47 | > diff --git a/B b/B | |
|
48 | > new file mode 100644 | |
|
49 | > --- /dev/null | |
|
50 | > +++ b/B | |
|
51 | > @@ -0,0 +1,1 @@ | |
|
52 | > +foo | |
|
53 | > \ No newline at end of file | |
|
54 | > diff --git a/real_A b/real_A | |
|
55 | > new file mode 100644 | |
|
56 | > --- /dev/null | |
|
57 | > +++ b/real_A | |
|
58 | > @@ -0,0 +1,1 @@ | |
|
59 | > +A | |
|
60 | > \ No newline at end of file | |
|
61 | > diff --git a/sym_A b/sym_A | |
|
62 | > new file mode 120000 | |
|
63 | > --- /dev/null | |
|
64 | > +++ b/sym_A | |
|
65 | > @@ -0,0 +1,1 @@ | |
|
66 | > +A | |
|
67 | > \ No newline at end of file | |
|
68 | > EOF | |
|
69 | $ hg up -q | |
|
70 | #endif | |
|
32 | 71 | |
|
33 | 72 | These files are different and should return True (different): |
|
34 | 73 | (Note that filecmp.cmp's return semantics are inverted from ours, so we invert |
@@ -53,5 +92,10 b' the same in the eyes of ``filectx.cmp``,' | |||
|
53 | 92 | |
|
54 | 93 | A naive use of filecmp on those two would wrongly return True, since it follows |
|
55 | 94 | the symlink to "A", which has different contents. |
|
95 | #if symlink | |
|
56 | 96 | $ hg eval "not filecmp.cmp('real_A', 'sym_A')" |
|
57 | 97 | True (no-eol) |
|
98 | #else | |
|
99 | $ hg eval "not filecmp.cmp('real_A', 'sym_A')" | |
|
100 | False (no-eol) | |
|
101 | #endif |
General Comments 0
You need to be logged in to leave comments.
Login now