Show More
@@ -1,170 +1,178 b'' | |||
|
1 | 1 | #testcases flat tree |
|
2 | 2 | |
|
3 | 3 | $ . "$TESTDIR/narrow-library.sh" |
|
4 | 4 | |
|
5 | 5 | #if tree |
|
6 | 6 | $ cat << EOF >> $HGRCPATH |
|
7 | 7 | > [experimental] |
|
8 | 8 | > treemanifest = 1 |
|
9 | 9 | > EOF |
|
10 | 10 | #endif |
|
11 | 11 | |
|
12 | 12 | $ cat << EOF >> $HGRCPATH |
|
13 | 13 | > [extensions] |
|
14 | 14 | > share = |
|
15 | 15 | > EOF |
|
16 | 16 | |
|
17 | 17 | $ hg init remote |
|
18 | 18 | $ cd remote |
|
19 | 19 | $ for x in `$TESTDIR/seq.py 0 10` |
|
20 | 20 | > do |
|
21 | 21 | > mkdir d$x |
|
22 | 22 | > echo $x > d$x/f |
|
23 | 23 | > hg add d$x/f |
|
24 | 24 | > hg commit -m "add d$x/f" |
|
25 | 25 | > done |
|
26 | 26 | $ cd .. |
|
27 | 27 | |
|
28 | 28 | $ hg clone --narrow ssh://user@dummy/remote main -q \ |
|
29 | 29 | > --include d1 --include d3 --include d5 --include d7 |
|
30 | 30 | |
|
31 | 31 | $ hg share main share |
|
32 | 32 | updating working directory |
|
33 | 33 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
34 | 34 | $ hg -R share tracked |
|
35 | 35 | I path:d1 |
|
36 | 36 | I path:d3 |
|
37 | 37 | I path:d5 |
|
38 | 38 | I path:d7 |
|
39 | 39 | $ hg -R share files |
|
40 | 40 | share/d1/f |
|
41 | 41 | share/d3/f |
|
42 | 42 | share/d5/f |
|
43 | 43 | share/d7/f |
|
44 | 44 | |
|
45 | 45 | Narrow the share and check that the main repo's working copy gets updated |
|
46 | 46 | |
|
47 | # Make sure the files that are supposed to be known-clean get their timestamps set in the dirstate | |
|
48 | $ sleep 2 | |
|
49 | $ hg -R main st | |
|
50 | $ hg -R main debugdirstate --no-dates | |
|
51 | n 644 2 set d1/f | |
|
52 | n 644 2 set d3/f | |
|
53 | n 644 2 set d5/f | |
|
54 | n 644 2 set d7/f | |
|
47 | 55 | # Make d3/f dirty |
|
48 | 56 | $ echo x >> main/d3/f |
|
49 | 57 | $ echo y >> main/d3/g |
|
50 | 58 | $ hg add main/d3/g |
|
51 | 59 | $ hg -R main st |
|
52 | 60 | M d3/f |
|
53 | 61 | A d3/g |
|
54 | 62 | # Make d5/f not match the dirstate timestamp even though it's clean |
|
55 | 63 | $ sleep 2 |
|
56 | 64 | $ hg -R main st |
|
57 | 65 | M d3/f |
|
58 | 66 | A d3/g |
|
59 | 67 | $ hg -R main debugdirstate --no-dates |
|
60 | 68 | n 644 2 set d1/f |
|
61 |
n 644 2 |
|
|
69 | n 644 2 set d3/f | |
|
62 | 70 | a 0 -1 unset d3/g |
|
63 | 71 | n 644 2 set d5/f |
|
64 | 72 | n 644 2 set d7/f |
|
65 | 73 | $ touch main/d5/f |
|
66 | 74 | $ hg -R share tracked --removeinclude d1 --removeinclude d3 --removeinclude d5 |
|
67 | 75 | comparing with ssh://user@dummy/remote |
|
68 | 76 | searching for changes |
|
69 | 77 | looking for local changes to affected paths |
|
70 | 78 | deleting data/d1/f.i |
|
71 | 79 | deleting data/d3/f.i |
|
72 | 80 | deleting data/d5/f.i |
|
73 | 81 | deleting meta/d1/00manifest.i (tree !) |
|
74 | 82 | deleting meta/d3/00manifest.i (tree !) |
|
75 | 83 | deleting meta/d5/00manifest.i (tree !) |
|
76 | 84 | $ hg -R main tracked |
|
77 | 85 | I path:d7 |
|
78 | 86 | $ hg -R main files |
|
79 | 87 | abort: working copy's narrowspec is stale |
|
80 | 88 | (run 'hg tracked --update-working-copy') |
|
81 | 89 | [255] |
|
82 | 90 | $ hg -R main tracked --update-working-copy |
|
83 | 91 | not deleting possibly dirty file d3/f |
|
84 | 92 | not deleting possibly dirty file d3/g |
|
85 | 93 | not deleting possibly dirty file d5/f |
|
86 | 94 | # d1/f, d3/f, d3/g and d5/f should no longer be reported |
|
87 | 95 | $ hg -R main files |
|
88 | 96 | main/d7/f |
|
89 | 97 | # d1/f should no longer be there, d3/f should be since it was dirty, d3/g should be there since |
|
90 | 98 | # it was added, and d5/f should be since we couldn't be sure it was clean |
|
91 | 99 | $ find main/d* -type f | sort |
|
92 | 100 | main/d3/f |
|
93 | 101 | main/d3/g |
|
94 | 102 | main/d5/f |
|
95 | 103 | main/d7/f |
|
96 | 104 | |
|
97 | 105 | Widen the share and check that the main repo's working copy gets updated |
|
98 | 106 | |
|
99 | 107 | $ hg -R share tracked --addinclude d1 --addinclude d3 -q |
|
100 | 108 | $ hg -R share tracked |
|
101 | 109 | I path:d1 |
|
102 | 110 | I path:d3 |
|
103 | 111 | I path:d7 |
|
104 | 112 | $ hg -R share files |
|
105 | 113 | share/d1/f |
|
106 | 114 | share/d3/f |
|
107 | 115 | share/d7/f |
|
108 | 116 | $ hg -R main tracked |
|
109 | 117 | I path:d1 |
|
110 | 118 | I path:d3 |
|
111 | 119 | I path:d7 |
|
112 | 120 | $ hg -R main files |
|
113 | 121 | abort: working copy's narrowspec is stale |
|
114 | 122 | (run 'hg tracked --update-working-copy') |
|
115 | 123 | [255] |
|
116 | 124 | $ hg -R main tracked --update-working-copy |
|
117 | 125 | # d1/f, d3/f should be back |
|
118 | 126 | $ hg -R main files |
|
119 | 127 | main/d1/f |
|
120 | 128 | main/d3/f |
|
121 | 129 | main/d7/f |
|
122 | 130 | # d3/f should be modified (not clobbered by the widening), and d3/g should be untracked |
|
123 | 131 | $ hg -R main st --all |
|
124 | 132 | M d3/f |
|
125 | 133 | ? d3/g |
|
126 | 134 | C d1/f |
|
127 | 135 | C d7/f |
|
128 | 136 | |
|
129 | 137 | We should also be able to unshare without breaking everything: |
|
130 | 138 | |
|
131 | 139 | $ hg share main share-unshare |
|
132 | 140 | updating working directory |
|
133 | 141 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
134 | 142 | $ cd share-unshare |
|
135 | 143 | $ hg unshare |
|
136 | 144 | $ hg verify |
|
137 | 145 | checking changesets |
|
138 | 146 | checking manifests |
|
139 | 147 | checking directory manifests (tree !) |
|
140 | 148 | crosschecking files in changesets and manifests |
|
141 | 149 | checking files |
|
142 | 150 | checked 11 changesets with 3 changes to 3 files |
|
143 | 151 | $ cd .. |
|
144 | 152 | |
|
145 | 153 | Dirstate should be left alone when upgrading from version of hg that didn't support narrow+share |
|
146 | 154 | |
|
147 | 155 | $ hg share main share-upgrade |
|
148 | 156 | updating working directory |
|
149 | 157 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
150 | 158 | $ cd share-upgrade |
|
151 | 159 | $ echo x >> d1/f |
|
152 | 160 | $ echo y >> d3/g |
|
153 | 161 | $ hg add d3/g |
|
154 | 162 | $ hg rm d7/f |
|
155 | 163 | $ hg st |
|
156 | 164 | M d1/f |
|
157 | 165 | A d3/g |
|
158 | 166 | R d7/f |
|
159 | 167 | Make it look like a repo from before narrow+share was supported |
|
160 | 168 | $ rm .hg/narrowspec.dirstate |
|
161 | 169 | $ hg st |
|
162 | 170 | abort: working copy's narrowspec is stale |
|
163 | 171 | (run 'hg tracked --update-working-copy') |
|
164 | 172 | [255] |
|
165 | 173 | $ hg tracked --update-working-copy |
|
166 | 174 | $ hg st |
|
167 | 175 | M d1/f |
|
168 | 176 | A d3/g |
|
169 | 177 | R d7/f |
|
170 | 178 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now