Show More
@@ -1,306 +1,306 b'' | |||
|
1 | 1 | $ "$TESTDIR/hghave" git || exit 80 |
|
2 | 2 | |
|
3 | 3 | make git commits repeatable |
|
4 | 4 | |
|
5 | 5 | $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME |
|
6 | 6 | $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL |
|
7 | 7 | $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE |
|
8 | 8 | $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME |
|
9 | 9 | $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL |
|
10 | 10 | $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE |
|
11 | 11 | |
|
12 | 12 | root hg repo |
|
13 | 13 | |
|
14 | 14 | $ hg init t |
|
15 | 15 | $ cd t |
|
16 | 16 | $ echo a > a |
|
17 | 17 | $ hg add a |
|
18 | 18 | $ hg commit -m a |
|
19 | 19 | $ cd .. |
|
20 | 20 | |
|
21 | 21 | new external git repo |
|
22 | 22 | |
|
23 | 23 | $ mkdir gitroot |
|
24 | 24 | $ cd gitroot |
|
25 | 25 | $ git init -q |
|
26 | 26 | $ echo g > g |
|
27 | 27 | $ git add g |
|
28 | 28 | $ git commit -q -m g |
|
29 | 29 | |
|
30 | 30 | add subrepo clone |
|
31 | 31 | |
|
32 | 32 | $ cd ../t |
|
33 | 33 | $ echo 's = [git]../gitroot' > .hgsub |
|
34 | 34 | $ git clone -q ../gitroot s |
|
35 | 35 | $ hg add .hgsub |
|
36 | 36 | $ hg commit -m 'new git subrepo' |
|
37 | 37 | committing subrepository s |
|
38 | 38 | $ hg debugsub |
|
39 | 39 | path s |
|
40 | 40 | source ../gitroot |
|
41 | 41 | revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
42 | 42 | |
|
43 | 43 | record a new commit from upstream from a different branch |
|
44 | 44 | |
|
45 | 45 | $ cd ../gitroot |
|
46 | 46 | $ git checkout -q -b testing |
|
47 | 47 | $ echo gg >> g |
|
48 | 48 | $ git commit -q -a -m gg |
|
49 | 49 | |
|
50 | 50 | $ cd ../t/s |
|
51 | 51 | $ git pull -q >/dev/null 2>/dev/null |
|
52 | 52 | $ git checkout -q -b testing origin/testing >/dev/null |
|
53 | 53 | |
|
54 | 54 | $ cd .. |
|
55 | 55 | $ hg status --subrepos |
|
56 | 56 | M s/g |
|
57 | 57 | $ hg commit -m 'update git subrepo' |
|
58 | 58 | committing subrepository s |
|
59 | 59 | $ hg debugsub |
|
60 | 60 | path s |
|
61 | 61 | source ../gitroot |
|
62 | 62 | revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a |
|
63 | 63 | |
|
64 | 64 | make $GITROOT pushable, by replacing it with a clone with nothing checked out |
|
65 | 65 | |
|
66 | 66 | $ cd .. |
|
67 | 67 | $ git clone gitroot gitrootbare --bare -q |
|
68 | 68 | $ rm -rf gitroot |
|
69 | 69 | $ mv gitrootbare gitroot |
|
70 | 70 | |
|
71 | 71 | clone root |
|
72 | 72 | |
|
73 | 73 | $ cd t |
|
74 | 74 | $ hg clone . ../tc |
|
75 | 75 | updating to branch default |
|
76 | 76 | cloning subrepo s |
|
77 | 77 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
78 | 78 | $ cd ../tc |
|
79 | 79 | $ hg debugsub |
|
80 | 80 | path s |
|
81 | 81 | source ../gitroot |
|
82 | 82 | revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a |
|
83 | 83 | |
|
84 | 84 | update to previous substate |
|
85 | 85 | |
|
86 | 86 | $ hg update 1 -q |
|
87 | 87 | $ cat s/g |
|
88 | 88 | g |
|
89 | 89 | $ hg debugsub |
|
90 | 90 | path s |
|
91 | 91 | source ../gitroot |
|
92 | 92 | revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
93 | 93 | |
|
94 | 94 | clone root, make local change |
|
95 | 95 | |
|
96 | 96 | $ cd ../t |
|
97 | 97 | $ hg clone . ../ta |
|
98 | 98 | updating to branch default |
|
99 | 99 | cloning subrepo s |
|
100 | 100 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
101 | 101 | |
|
102 | 102 | $ cd ../ta |
|
103 | 103 | $ echo ggg >> s/g |
|
104 | 104 | $ hg status --subrepos |
|
105 | 105 | M s/g |
|
106 | 106 | $ hg commit -m ggg |
|
107 | 107 | committing subrepository s |
|
108 | 108 | $ hg debugsub |
|
109 | 109 | path s |
|
110 | 110 | source ../gitroot |
|
111 | 111 | revision 79695940086840c99328513acbe35f90fcd55e57 |
|
112 | 112 | |
|
113 | 113 | clone root separately, make different local change |
|
114 | 114 | |
|
115 | 115 | $ cd ../t |
|
116 | 116 | $ hg clone . ../tb |
|
117 | 117 | updating to branch default |
|
118 | 118 | cloning subrepo s |
|
119 | 119 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
120 | 120 | |
|
121 | 121 | $ cd ../tb/s |
|
122 | 122 | $ echo f > f |
|
123 | 123 | $ git add f |
|
124 | 124 | $ cd .. |
|
125 | 125 | |
|
126 | 126 | $ hg status --subrepos |
|
127 | 127 | A s/f |
|
128 | 128 | $ hg commit -m f |
|
129 | 129 | committing subrepository s |
|
130 | 130 | $ hg debugsub |
|
131 | 131 | path s |
|
132 | 132 | source ../gitroot |
|
133 | 133 | revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
134 | 134 | |
|
135 | 135 | user b push changes |
|
136 | 136 | |
|
137 | 137 | $ hg push 2>/dev/null |
|
138 | 138 | pushing to $TESTTMP/t |
|
139 | 139 | pushing branch testing of subrepo s |
|
140 | 140 | searching for changes |
|
141 | 141 | adding changesets |
|
142 | 142 | adding manifests |
|
143 | 143 | adding file changes |
|
144 | 144 | added 1 changesets with 1 changes to 1 files |
|
145 | 145 | |
|
146 | 146 | user a pulls, merges, commits |
|
147 | 147 | |
|
148 | 148 | $ cd ../ta |
|
149 | 149 | $ hg pull |
|
150 | 150 | pulling from $TESTTMP/t |
|
151 | 151 | searching for changes |
|
152 | 152 | adding changesets |
|
153 | 153 | adding manifests |
|
154 | 154 | adding file changes |
|
155 | 155 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
156 | 156 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
157 | 157 | $ hg merge 2>/dev/null |
|
158 | 158 | pulling subrepo s |
|
159 | 159 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
160 | 160 | (branch merge, don't forget to commit) |
|
161 | 161 | $ cat s/f |
|
162 | 162 | f |
|
163 | 163 | $ cat s/g |
|
164 | 164 | g |
|
165 | 165 | gg |
|
166 | 166 | ggg |
|
167 | 167 | $ hg commit -m 'merge' |
|
168 | 168 | committing subrepository s |
|
169 | 169 | $ hg status --subrepos --rev 1:5 |
|
170 | 170 | M .hgsubstate |
|
171 | 171 | M s/g |
|
172 | 172 | A s/f |
|
173 | 173 | $ hg debugsub |
|
174 | 174 | path s |
|
175 | 175 | source ../gitroot |
|
176 | 176 | revision f47b465e1bce645dbf37232a00574aa1546ca8d3 |
|
177 | 177 | $ hg push 2>/dev/null |
|
178 | 178 | pushing to $TESTTMP/t |
|
179 | 179 | pushing branch testing of subrepo s |
|
180 | 180 | searching for changes |
|
181 | 181 | adding changesets |
|
182 | 182 | adding manifests |
|
183 | 183 | adding file changes |
|
184 | 184 | added 2 changesets with 2 changes to 1 files |
|
185 | 185 | |
|
186 | 186 | make upstream git changes |
|
187 | 187 | |
|
188 | 188 | $ cd .. |
|
189 | 189 | $ git clone -q gitroot gitclone |
|
190 | 190 | $ cd gitclone |
|
191 | 191 | $ echo ff >> f |
|
192 | 192 | $ git commit -q -a -m ff |
|
193 | 193 | $ echo fff >> f |
|
194 | 194 | $ git commit -q -a -m fff |
|
195 | 195 | $ git push origin testing 2>/dev/null |
|
196 | 196 | |
|
197 | 197 | make and push changes to hg without updating the subrepo |
|
198 | 198 | |
|
199 | 199 | $ cd ../t |
|
200 | 200 | $ hg clone . ../td |
|
201 | 201 | updating to branch default |
|
202 | 202 | cloning subrepo s |
|
203 | 203 | checking out detached HEAD in subrepo s |
|
204 | 204 | check out a git branch if you intend to make changes |
|
205 | 205 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
206 | 206 | $ cd ../td |
|
207 | 207 | $ echo aa >> a |
|
208 | 208 | $ hg commit -m aa |
|
209 | 209 | $ hg push |
|
210 | 210 | pushing to $TESTTMP/t |
|
211 | 211 | searching for changes |
|
212 | 212 | adding changesets |
|
213 | 213 | adding manifests |
|
214 | 214 | adding file changes |
|
215 | 215 | added 1 changesets with 1 changes to 1 files |
|
216 | 216 | |
|
217 | 217 | sync to upstream git, distribute changes |
|
218 | 218 | |
|
219 | 219 | $ cd ../ta |
|
220 | 220 | $ hg pull -u -q |
|
221 | 221 | $ cd s |
|
222 | 222 | $ git pull -q >/dev/null 2>/dev/null |
|
223 | 223 | $ cd .. |
|
224 | 224 | $ hg commit -m 'git upstream sync' |
|
225 | 225 | committing subrepository s |
|
226 | 226 | $ hg debugsub |
|
227 | 227 | path s |
|
228 | 228 | source ../gitroot |
|
229 | 229 | revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
230 | 230 | $ hg push -q |
|
231 | 231 | |
|
232 | 232 | $ cd ../tb |
|
233 | 233 | $ hg pull -q |
|
234 | 234 | $ hg update 2>/dev/null |
|
235 | 235 | pulling subrepo s |
|
236 | 236 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
237 | 237 | $ hg debugsub |
|
238 | 238 | path s |
|
239 | 239 | source ../gitroot |
|
240 | 240 | revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
241 | 241 | |
|
242 | 242 | update to a revision without the subrepo, keeping the local git repository |
|
243 | 243 | |
|
244 | 244 | $ cd ../t |
|
245 | 245 | $ hg up 0 |
|
246 | 246 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
247 | 247 | $ ls -a s |
|
248 | 248 | . |
|
249 | 249 | .. |
|
250 | 250 | .git |
|
251 | 251 | |
|
252 | 252 | $ hg up 2 |
|
253 | 253 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
254 | 254 | $ ls -a s |
|
255 | 255 | . |
|
256 | 256 | .. |
|
257 | 257 | .git |
|
258 | 258 | g |
|
259 | 259 | |
|
260 | 260 | archive subrepos |
|
261 | 261 | |
|
262 | 262 | $ cd ../tc |
|
263 | 263 | $ hg pull -q |
|
264 | 264 | $ hg archive --subrepos -r 5 ../archive 2>/dev/null |
|
265 | 265 | pulling subrepo s |
|
266 | 266 | $ cd ../archive |
|
267 | 267 | $ cat s/f |
|
268 | 268 | f |
|
269 | 269 | $ cat s/g |
|
270 | 270 | g |
|
271 | 271 | gg |
|
272 | 272 | ggg |
|
273 | 273 | |
|
274 | 274 | create nested repo |
|
275 | 275 | |
|
276 | 276 | $ cd .. |
|
277 | 277 | $ hg init outer |
|
278 | 278 | $ cd outer |
|
279 | 279 | $ echo b>b |
|
280 | 280 | $ hg add b |
|
281 | 281 | $ hg commit -m b |
|
282 | 282 | |
|
283 | 283 | $ hg clone ../t inner |
|
284 | 284 | updating to branch default |
|
285 | 285 | cloning subrepo s |
|
286 | 286 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
287 | 287 | $ echo inner = inner > .hgsub |
|
288 | 288 | $ hg add .hgsub |
|
289 | 289 | $ hg commit -m 'nested sub' |
|
290 | 290 | committing subrepository inner |
|
291 | 291 | |
|
292 | 292 | nested commit |
|
293 | 293 | |
|
294 | 294 | $ echo ffff >> inner/s/f |
|
295 | 295 | $ hg status --subrepos |
|
296 | 296 | M inner/s/f |
|
297 | 297 | $ hg commit -m nested |
|
298 | 298 | committing subrepository inner |
|
299 | 299 | committing subrepository inner/s |
|
300 | 300 | |
|
301 | 301 | nested archive |
|
302 | 302 | |
|
303 | 303 | $ hg archive --subrepos ../narchive |
|
304 | $ ls ../narchive/inner/s | |
|
304 | $ ls ../narchive/inner/s | grep -v pax_global_header | |
|
305 | 305 | f |
|
306 | 306 | g |
General Comments 0
You need to be logged in to leave comments.
Login now