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