Show More
@@ -1,804 +1,804 b'' | |||||
1 | #require git |
|
1 | #require git | |
2 |
|
2 | |||
3 | make git commits repeatable |
|
3 | make git commits repeatable | |
4 |
|
4 | |||
5 | $ echo "[core]" >> $HOME/.gitconfig |
|
5 | $ echo "[core]" >> $HOME/.gitconfig | |
6 | $ echo "autocrlf = false" >> $HOME/.gitconfig |
|
6 | $ echo "autocrlf = false" >> $HOME/.gitconfig | |
7 | $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME |
|
7 | $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME | |
8 | $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL |
|
8 | $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL | |
9 | $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE |
|
9 | $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE | |
10 | $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME |
|
10 | $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME | |
11 | $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL |
|
11 | $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL | |
12 | $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE |
|
12 | $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE | |
13 |
|
13 | |||
14 | root hg repo |
|
14 | root hg repo | |
15 |
|
15 | |||
16 | $ hg init t |
|
16 | $ hg init t | |
17 | $ cd t |
|
17 | $ cd t | |
18 | $ echo a > a |
|
18 | $ echo a > a | |
19 | $ hg add a |
|
19 | $ hg add a | |
20 | $ hg commit -m a |
|
20 | $ hg commit -m a | |
21 | $ cd .. |
|
21 | $ cd .. | |
22 |
|
22 | |||
23 | new external git repo |
|
23 | new external git repo | |
24 |
|
24 | |||
25 | $ mkdir gitroot |
|
25 | $ mkdir gitroot | |
26 | $ cd gitroot |
|
26 | $ cd gitroot | |
27 | $ git init -q |
|
27 | $ git init -q | |
28 | $ echo g > g |
|
28 | $ echo g > g | |
29 | $ git add g |
|
29 | $ git add g | |
30 | $ git commit -q -m g |
|
30 | $ git commit -q -m g | |
31 |
|
31 | |||
32 | add subrepo clone |
|
32 | add subrepo clone | |
33 |
|
33 | |||
34 | $ cd ../t |
|
34 | $ cd ../t | |
35 | $ echo 's = [git]../gitroot' > .hgsub |
|
35 | $ echo 's = [git]../gitroot' > .hgsub | |
36 | $ git clone -q ../gitroot s |
|
36 | $ git clone -q ../gitroot s | |
37 | $ hg add .hgsub |
|
37 | $ hg add .hgsub | |
38 | $ hg commit -m 'new git subrepo' |
|
38 | $ hg commit -m 'new git subrepo' | |
39 | $ hg debugsub |
|
39 | $ hg debugsub | |
40 | path s |
|
40 | path s | |
41 | source ../gitroot |
|
41 | source ../gitroot | |
42 | revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
42 | revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 | |
43 |
|
43 | |||
44 | record a new commit from upstream from a different branch |
|
44 | record a new commit from upstream from a different branch | |
45 |
|
45 | |||
46 | $ cd ../gitroot |
|
46 | $ cd ../gitroot | |
47 | $ git checkout -q -b testing |
|
47 | $ git checkout -q -b testing | |
48 | $ echo gg >> g |
|
48 | $ echo gg >> g | |
49 | $ git commit -q -a -m gg |
|
49 | $ git commit -q -a -m gg | |
50 |
|
50 | |||
51 | $ cd ../t/s |
|
51 | $ cd ../t/s | |
52 | $ git pull -q >/dev/null 2>/dev/null |
|
52 | $ git pull -q >/dev/null 2>/dev/null | |
53 | $ git checkout -q -b testing origin/testing >/dev/null |
|
53 | $ git checkout -q -b testing origin/testing >/dev/null | |
54 |
|
54 | |||
55 | $ cd .. |
|
55 | $ cd .. | |
56 | $ hg status --subrepos |
|
56 | $ hg status --subrepos | |
57 | M s/g |
|
57 | M s/g | |
58 | $ hg commit -m 'update git subrepo' |
|
58 | $ hg commit -m 'update git subrepo' | |
59 | $ hg debugsub |
|
59 | $ hg debugsub | |
60 | path s |
|
60 | path s | |
61 | source ../gitroot |
|
61 | source ../gitroot | |
62 | revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a |
|
62 | revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a | |
63 |
|
63 | |||
64 | make $GITROOT pushable, by replacing it with a clone with nothing checked out |
|
64 | make $GITROOT pushable, by replacing it with a clone with nothing checked out | |
65 |
|
65 | |||
66 | $ cd .. |
|
66 | $ cd .. | |
67 | $ git clone gitroot gitrootbare --bare -q |
|
67 | $ git clone gitroot gitrootbare --bare -q | |
68 | $ rm -rf gitroot |
|
68 | $ rm -rf gitroot | |
69 | $ mv gitrootbare gitroot |
|
69 | $ mv gitrootbare gitroot | |
70 |
|
70 | |||
71 | clone root |
|
71 | clone root | |
72 |
|
72 | |||
73 | $ cd t |
|
73 | $ cd t | |
74 | $ hg clone . ../tc 2> /dev/null |
|
74 | $ hg clone . ../tc 2> /dev/null | |
75 | updating to branch default |
|
75 | updating to branch default | |
76 | cloning subrepo s from $TESTTMP/gitroot |
|
76 | cloning subrepo s from $TESTTMP/gitroot | |
77 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
77 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
78 | $ cd ../tc |
|
78 | $ cd ../tc | |
79 | $ hg debugsub |
|
79 | $ hg debugsub | |
80 | path s |
|
80 | path s | |
81 | source ../gitroot |
|
81 | source ../gitroot | |
82 | revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a |
|
82 | revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a | |
83 |
|
83 | |||
84 | update to previous substate |
|
84 | update to previous substate | |
85 |
|
85 | |||
86 | $ hg update 1 -q |
|
86 | $ hg update 1 -q | |
87 | $ cat s/g |
|
87 | $ cat s/g | |
88 | g |
|
88 | g | |
89 | $ hg debugsub |
|
89 | $ hg debugsub | |
90 | path s |
|
90 | path s | |
91 | source ../gitroot |
|
91 | source ../gitroot | |
92 | revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
92 | revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 | |
93 |
|
93 | |||
94 | clone root, make local change |
|
94 | clone root, make local change | |
95 |
|
95 | |||
96 | $ cd ../t |
|
96 | $ cd ../t | |
97 | $ hg clone . ../ta 2> /dev/null |
|
97 | $ hg clone . ../ta 2> /dev/null | |
98 | updating to branch default |
|
98 | updating to branch default | |
99 | cloning subrepo s from $TESTTMP/gitroot |
|
99 | cloning subrepo s from $TESTTMP/gitroot | |
100 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
101 |
|
101 | |||
102 | $ cd ../ta |
|
102 | $ cd ../ta | |
103 | $ echo ggg >> s/g |
|
103 | $ echo ggg >> s/g | |
104 | $ hg status --subrepos |
|
104 | $ hg status --subrepos | |
105 | M s/g |
|
105 | M s/g | |
106 | $ hg diff --subrepos |
|
106 | $ hg diff --subrepos | |
107 | diff --git a/s/g b/s/g |
|
107 | diff --git a/s/g b/s/g | |
108 | index 089258f..85341ee 100644 |
|
108 | index 089258f..85341ee 100644 | |
109 | --- a/s/g |
|
109 | --- a/s/g | |
110 | +++ b/s/g |
|
110 | +++ b/s/g | |
111 | @@ -1,2 +1,3 @@ |
|
111 | @@ -1,2 +1,3 @@ | |
112 | g |
|
112 | g | |
113 | gg |
|
113 | gg | |
114 | +ggg (no-eol) |
|
114 | +ggg (no-eol) | |
115 | $ hg commit --subrepos -m ggg |
|
115 | $ hg commit --subrepos -m ggg | |
116 | committing subrepository s |
|
116 | committing subrepository s | |
117 | $ hg debugsub |
|
117 | $ hg debugsub | |
118 | path s |
|
118 | path s | |
119 | source ../gitroot |
|
119 | source ../gitroot | |
120 | revision 79695940086840c99328513acbe35f90fcd55e57 |
|
120 | revision 79695940086840c99328513acbe35f90fcd55e57 | |
121 |
|
121 | |||
122 | clone root separately, make different local change |
|
122 | clone root separately, make different local change | |
123 |
|
123 | |||
124 | $ cd ../t |
|
124 | $ cd ../t | |
125 | $ hg clone . ../tb 2> /dev/null |
|
125 | $ hg clone . ../tb 2> /dev/null | |
126 | updating to branch default |
|
126 | updating to branch default | |
127 | cloning subrepo s from $TESTTMP/gitroot |
|
127 | cloning subrepo s from $TESTTMP/gitroot | |
128 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
128 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
129 |
|
129 | |||
130 | $ cd ../tb/s |
|
130 | $ cd ../tb/s | |
131 | $ hg status --subrepos |
|
131 | $ hg status --subrepos | |
132 | $ echo f > f |
|
132 | $ echo f > f | |
133 | $ hg status --subrepos |
|
133 | $ hg status --subrepos | |
134 | ? s/f |
|
134 | ? s/f | |
135 | $ git add f |
|
135 | $ git add f | |
136 | $ cd .. |
|
136 | $ cd .. | |
137 |
|
137 | |||
138 | $ hg status --subrepos |
|
138 | $ hg status --subrepos | |
139 | A s/f |
|
139 | A s/f | |
140 | $ hg commit --subrepos -m f |
|
140 | $ hg commit --subrepos -m f | |
141 | committing subrepository s |
|
141 | committing subrepository s | |
142 | $ hg debugsub |
|
142 | $ hg debugsub | |
143 | path s |
|
143 | path s | |
144 | source ../gitroot |
|
144 | source ../gitroot | |
145 | revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
145 | revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc | |
146 |
|
146 | |||
147 | user b push changes |
|
147 | user b push changes | |
148 |
|
148 | |||
149 | $ hg push 2>/dev/null |
|
149 | $ hg push 2>/dev/null | |
150 | pushing to $TESTTMP/t (glob) |
|
150 | pushing to $TESTTMP/t (glob) | |
151 | pushing branch testing of subrepo s |
|
151 | pushing branch testing of subrepo s | |
152 | searching for changes |
|
152 | searching for changes | |
153 | adding changesets |
|
153 | adding changesets | |
154 | adding manifests |
|
154 | adding manifests | |
155 | adding file changes |
|
155 | adding file changes | |
156 | added 1 changesets with 1 changes to 1 files |
|
156 | added 1 changesets with 1 changes to 1 files | |
157 |
|
157 | |||
158 | user a pulls, merges, commits |
|
158 | user a pulls, merges, commits | |
159 |
|
159 | |||
160 | $ cd ../ta |
|
160 | $ cd ../ta | |
161 | $ hg pull |
|
161 | $ hg pull | |
162 | pulling from $TESTTMP/t (glob) |
|
162 | pulling from $TESTTMP/t (glob) | |
163 | searching for changes |
|
163 | searching for changes | |
164 | adding changesets |
|
164 | adding changesets | |
165 | adding manifests |
|
165 | adding manifests | |
166 | adding file changes |
|
166 | adding file changes | |
167 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
167 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
168 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
168 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
169 | $ hg merge 2>/dev/null |
|
169 | $ hg merge 2>/dev/null | |
170 | subrepository s diverged (local revision: 7969594, remote revision: aa84837) |
|
170 | subrepository s diverged (local revision: 7969594, remote revision: aa84837) | |
171 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
171 | (M)erge, keep (l)ocal or keep (r)emote? m | |
172 | pulling subrepo s from $TESTTMP/gitroot |
|
172 | pulling subrepo s from $TESTTMP/gitroot | |
173 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
173 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
174 | (branch merge, don't forget to commit) |
|
174 | (branch merge, don't forget to commit) | |
175 | $ cat s/f |
|
175 | $ cat s/f | |
176 | f |
|
176 | f | |
177 | $ cat s/g |
|
177 | $ cat s/g | |
178 | g |
|
178 | g | |
179 | gg |
|
179 | gg | |
180 | ggg |
|
180 | ggg | |
181 | $ hg commit --subrepos -m 'merge' |
|
181 | $ hg commit --subrepos -m 'merge' | |
182 | committing subrepository s |
|
182 | committing subrepository s | |
183 | $ hg status --subrepos --rev 1:5 |
|
183 | $ hg status --subrepos --rev 1:5 | |
184 | M .hgsubstate |
|
184 | M .hgsubstate | |
185 | M s/g |
|
185 | M s/g | |
186 | A s/f |
|
186 | A s/f | |
187 | $ hg debugsub |
|
187 | $ hg debugsub | |
188 | path s |
|
188 | path s | |
189 | source ../gitroot |
|
189 | source ../gitroot | |
190 | revision f47b465e1bce645dbf37232a00574aa1546ca8d3 |
|
190 | revision f47b465e1bce645dbf37232a00574aa1546ca8d3 | |
191 | $ hg push 2>/dev/null |
|
191 | $ hg push 2>/dev/null | |
192 | pushing to $TESTTMP/t (glob) |
|
192 | pushing to $TESTTMP/t (glob) | |
193 | pushing branch testing of subrepo s |
|
193 | pushing branch testing of subrepo s | |
194 | searching for changes |
|
194 | searching for changes | |
195 | adding changesets |
|
195 | adding changesets | |
196 | adding manifests |
|
196 | adding manifests | |
197 | adding file changes |
|
197 | adding file changes | |
198 | added 2 changesets with 2 changes to 1 files |
|
198 | added 2 changesets with 2 changes to 1 files | |
199 |
|
199 | |||
200 | make upstream git changes |
|
200 | make upstream git changes | |
201 |
|
201 | |||
202 | $ cd .. |
|
202 | $ cd .. | |
203 | $ git clone -q gitroot gitclone |
|
203 | $ git clone -q gitroot gitclone | |
204 | $ cd gitclone |
|
204 | $ cd gitclone | |
205 | $ echo ff >> f |
|
205 | $ echo ff >> f | |
206 | $ git commit -q -a -m ff |
|
206 | $ git commit -q -a -m ff | |
207 | $ echo fff >> f |
|
207 | $ echo fff >> f | |
208 | $ git commit -q -a -m fff |
|
208 | $ git commit -q -a -m fff | |
209 | $ git push origin testing 2>/dev/null |
|
209 | $ git push origin testing 2>/dev/null | |
210 |
|
210 | |||
211 | make and push changes to hg without updating the subrepo |
|
211 | make and push changes to hg without updating the subrepo | |
212 |
|
212 | |||
213 | $ cd ../t |
|
213 | $ cd ../t | |
214 | $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.' |
|
214 | $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.' | |
215 | updating to branch default |
|
215 | updating to branch default | |
216 | cloning subrepo s from $TESTTMP/gitroot |
|
216 | cloning subrepo s from $TESTTMP/gitroot | |
217 | checking out detached HEAD in subrepo s |
|
217 | checking out detached HEAD in subrepo s | |
218 | check out a git branch if you intend to make changes |
|
218 | check out a git branch if you intend to make changes | |
219 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
219 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
220 | $ cd ../td |
|
220 | $ cd ../td | |
221 | $ echo aa >> a |
|
221 | $ echo aa >> a | |
222 | $ hg commit -m aa |
|
222 | $ hg commit -m aa | |
223 | $ hg push |
|
223 | $ hg push | |
224 | pushing to $TESTTMP/t (glob) |
|
224 | pushing to $TESTTMP/t (glob) | |
225 | searching for changes |
|
225 | searching for changes | |
226 | adding changesets |
|
226 | adding changesets | |
227 | adding manifests |
|
227 | adding manifests | |
228 | adding file changes |
|
228 | adding file changes | |
229 | added 1 changesets with 1 changes to 1 files |
|
229 | added 1 changesets with 1 changes to 1 files | |
230 |
|
230 | |||
231 | sync to upstream git, distribute changes |
|
231 | sync to upstream git, distribute changes | |
232 |
|
232 | |||
233 | $ cd ../ta |
|
233 | $ cd ../ta | |
234 | $ hg pull -u -q |
|
234 | $ hg pull -u -q | |
235 | $ cd s |
|
235 | $ cd s | |
236 | $ git pull -q >/dev/null 2>/dev/null |
|
236 | $ git pull -q >/dev/null 2>/dev/null | |
237 | $ cd .. |
|
237 | $ cd .. | |
238 | $ hg commit -m 'git upstream sync' |
|
238 | $ hg commit -m 'git upstream sync' | |
239 | $ hg debugsub |
|
239 | $ hg debugsub | |
240 | path s |
|
240 | path s | |
241 | source ../gitroot |
|
241 | source ../gitroot | |
242 | revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
242 | revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc | |
243 | $ hg push -q |
|
243 | $ hg push -q | |
244 |
|
244 | |||
245 | $ cd ../tb |
|
245 | $ cd ../tb | |
246 | $ hg pull -q |
|
246 | $ hg pull -q | |
247 | $ hg update 2>/dev/null |
|
247 | $ hg update 2>/dev/null | |
248 | pulling subrepo s from $TESTTMP/gitroot |
|
248 | pulling subrepo s from $TESTTMP/gitroot | |
249 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
249 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
250 | $ hg debugsub |
|
250 | $ hg debugsub | |
251 | path s |
|
251 | path s | |
252 | source ../gitroot |
|
252 | source ../gitroot | |
253 | revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
253 | revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc | |
254 |
|
254 | |||
255 | create a new git branch |
|
255 | create a new git branch | |
256 |
|
256 | |||
257 | $ cd s |
|
257 | $ cd s | |
258 | $ git checkout -b b2 |
|
258 | $ git checkout -b b2 | |
259 | Switched to a new branch 'b2' |
|
259 | Switched to a new branch 'b2' | |
260 | $ echo a>a |
|
260 | $ echo a>a | |
261 | $ git add a |
|
261 | $ git add a | |
262 | $ git commit -qm 'add a' |
|
262 | $ git commit -qm 'add a' | |
263 | $ cd .. |
|
263 | $ cd .. | |
264 | $ hg commit -m 'add branch in s' |
|
264 | $ hg commit -m 'add branch in s' | |
265 |
|
265 | |||
266 | pulling new git branch should not create tracking branch named 'origin/b2' |
|
266 | pulling new git branch should not create tracking branch named 'origin/b2' | |
267 | (issue3870) |
|
267 | (issue3870) | |
268 | $ cd ../td/s |
|
268 | $ cd ../td/s | |
269 | $ git remote set-url origin $TESTTMP/tb/s |
|
269 | $ git remote set-url origin $TESTTMP/tb/s | |
270 | $ git branch --no-track oldtesting |
|
270 | $ git branch --no-track oldtesting | |
271 | $ cd .. |
|
271 | $ cd .. | |
272 | $ hg pull -q ../tb |
|
272 | $ hg pull -q ../tb | |
273 | $ hg up |
|
273 | $ hg up | |
274 | From $TESTTMP/tb/s |
|
274 | From $TESTTMP/tb/s | |
275 | * [new branch] b2 -> origin/b2 |
|
275 | * [new branch] b2 -> origin/b2 | |
276 | Previous HEAD position was f47b465... merge |
|
276 | Previous HEAD position was f47b465... merge | |
277 | Switched to a new branch 'b2' |
|
277 | Switched to a new branch 'b2' | |
278 | pulling subrepo s from $TESTTMP/tb/s |
|
278 | pulling subrepo s from $TESTTMP/tb/s | |
279 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
279 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
280 |
|
280 | |||
281 | update to a revision without the subrepo, keeping the local git repository |
|
281 | update to a revision without the subrepo, keeping the local git repository | |
282 |
|
282 | |||
283 | $ cd ../t |
|
283 | $ cd ../t | |
284 | $ hg up 0 |
|
284 | $ hg up 0 | |
285 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
285 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
286 | $ ls -a s |
|
286 | $ ls -a s | |
287 | . |
|
287 | . | |
288 | .. |
|
288 | .. | |
289 | .git |
|
289 | .git | |
290 |
|
290 | |||
291 | $ hg up 2 |
|
291 | $ hg up 2 | |
292 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
292 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
293 | $ ls -a s |
|
293 | $ ls -a s | |
294 | . |
|
294 | . | |
295 | .. |
|
295 | .. | |
296 | .git |
|
296 | .git | |
297 | g |
|
297 | g | |
298 |
|
298 | |||
299 | archive subrepos |
|
299 | archive subrepos | |
300 |
|
300 | |||
301 | $ cd ../tc |
|
301 | $ cd ../tc | |
302 | $ hg pull -q |
|
302 | $ hg pull -q | |
303 | $ hg archive --subrepos -r 5 ../archive 2>/dev/null |
|
303 | $ hg archive --subrepos -r 5 ../archive 2>/dev/null | |
304 | pulling subrepo s from $TESTTMP/gitroot |
|
304 | pulling subrepo s from $TESTTMP/gitroot | |
305 | $ cd ../archive |
|
305 | $ cd ../archive | |
306 | $ cat s/f |
|
306 | $ cat s/f | |
307 | f |
|
307 | f | |
308 | $ cat s/g |
|
308 | $ cat s/g | |
309 | g |
|
309 | g | |
310 | gg |
|
310 | gg | |
311 | ggg |
|
311 | ggg | |
312 |
|
312 | |||
313 | $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null |
|
313 | $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null | |
314 | $ find ../archive_x | sort | grep -v pax_global_header |
|
314 | $ find ../archive_x | sort | grep -v pax_global_header | |
315 | ../archive_x |
|
315 | ../archive_x | |
316 | ../archive_x/.hg_archival.txt |
|
316 | ../archive_x/.hg_archival.txt | |
317 | ../archive_x/.hgsub |
|
317 | ../archive_x/.hgsub | |
318 | ../archive_x/.hgsubstate |
|
318 | ../archive_x/.hgsubstate | |
319 | ../archive_x/a |
|
319 | ../archive_x/a | |
320 | ../archive_x/s |
|
320 | ../archive_x/s | |
321 | ../archive_x/s/g |
|
321 | ../archive_x/s/g | |
322 |
|
322 | |||
323 | create nested repo |
|
323 | create nested repo | |
324 |
|
324 | |||
325 | $ cd .. |
|
325 | $ cd .. | |
326 | $ hg init outer |
|
326 | $ hg init outer | |
327 | $ cd outer |
|
327 | $ cd outer | |
328 | $ echo b>b |
|
328 | $ echo b>b | |
329 | $ hg add b |
|
329 | $ hg add b | |
330 | $ hg commit -m b |
|
330 | $ hg commit -m b | |
331 |
|
331 | |||
332 | $ hg clone ../t inner 2> /dev/null |
|
332 | $ hg clone ../t inner 2> /dev/null | |
333 | updating to branch default |
|
333 | updating to branch default | |
334 | cloning subrepo s from $TESTTMP/gitroot |
|
334 | cloning subrepo s from $TESTTMP/gitroot | |
335 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
335 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
336 | $ echo inner = inner > .hgsub |
|
336 | $ echo inner = inner > .hgsub | |
337 | $ hg add .hgsub |
|
337 | $ hg add .hgsub | |
338 | $ hg commit -m 'nested sub' |
|
338 | $ hg commit -m 'nested sub' | |
339 |
|
339 | |||
340 | nested commit |
|
340 | nested commit | |
341 |
|
341 | |||
342 | $ echo ffff >> inner/s/f |
|
342 | $ echo ffff >> inner/s/f | |
343 | $ hg status --subrepos |
|
343 | $ hg status --subrepos | |
344 | M inner/s/f |
|
344 | M inner/s/f | |
345 | $ hg commit --subrepos -m nested |
|
345 | $ hg commit --subrepos -m nested | |
346 | committing subrepository inner |
|
346 | committing subrepository inner | |
347 | committing subrepository inner/s (glob) |
|
347 | committing subrepository inner/s (glob) | |
348 |
|
348 | |||
349 | nested archive |
|
349 | nested archive | |
350 |
|
350 | |||
351 | $ hg archive --subrepos ../narchive |
|
351 | $ hg archive --subrepos ../narchive | |
352 | $ ls ../narchive/inner/s | grep -v pax_global_header |
|
352 | $ ls ../narchive/inner/s | grep -v pax_global_header | |
353 | f |
|
353 | f | |
354 | g |
|
354 | g | |
355 |
|
355 | |||
356 | relative source expansion |
|
356 | relative source expansion | |
357 |
|
357 | |||
358 | $ cd .. |
|
358 | $ cd .. | |
359 | $ mkdir d |
|
359 | $ mkdir d | |
360 | $ hg clone t d/t 2> /dev/null |
|
360 | $ hg clone t d/t 2> /dev/null | |
361 | updating to branch default |
|
361 | updating to branch default | |
362 | cloning subrepo s from $TESTTMP/gitroot |
|
362 | cloning subrepo s from $TESTTMP/gitroot | |
363 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
363 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
364 |
|
364 | |||
365 | Don't crash if the subrepo is missing |
|
365 | Don't crash if the subrepo is missing | |
366 |
|
366 | |||
367 | $ hg clone t missing -q |
|
367 | $ hg clone t missing -q | |
368 | $ cd missing |
|
368 | $ cd missing | |
369 | $ rm -rf s |
|
369 | $ rm -rf s | |
370 | $ hg status -S |
|
370 | $ hg status -S | |
371 | $ hg sum | grep commit |
|
371 | $ hg sum | grep commit | |
372 | commit: 1 subrepos |
|
372 | commit: 1 subrepos | |
373 | $ hg push -q |
|
373 | $ hg push -q | |
374 | abort: subrepo s is missing (in subrepo s) |
|
374 | abort: subrepo s is missing (in subrepo s) | |
375 | [255] |
|
375 | [255] | |
376 | $ hg commit --subrepos -qm missing |
|
376 | $ hg commit --subrepos -qm missing | |
377 | abort: subrepo s is missing (in subrepo s) |
|
377 | abort: subrepo s is missing (in subrepo s) | |
378 | [255] |
|
378 | [255] | |
379 | $ hg update -C 2> /dev/null |
|
379 | $ hg update -C 2> /dev/null | |
380 | cloning subrepo s from $TESTTMP/gitroot |
|
380 | cloning subrepo s from $TESTTMP/gitroot | |
381 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
381 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
382 | $ hg sum | grep commit |
|
382 | $ hg sum | grep commit | |
383 | commit: (clean) |
|
383 | commit: (clean) | |
384 |
|
384 | |||
385 | Don't crash if the .hgsubstate entry is missing |
|
385 | Don't crash if the .hgsubstate entry is missing | |
386 |
|
386 | |||
387 | $ hg update 1 -q |
|
387 | $ hg update 1 -q | |
388 | $ hg rm .hgsubstate |
|
388 | $ hg rm .hgsubstate | |
389 | $ hg commit .hgsubstate -m 'no substate' |
|
389 | $ hg commit .hgsubstate -m 'no substate' | |
390 | nothing changed |
|
390 | nothing changed | |
391 | [1] |
|
391 | [1] | |
392 | $ hg tag -l nosubstate |
|
392 | $ hg tag -l nosubstate | |
393 | $ hg manifest |
|
393 | $ hg manifest | |
394 | .hgsub |
|
394 | .hgsub | |
395 | .hgsubstate |
|
395 | .hgsubstate | |
396 | a |
|
396 | a | |
397 |
|
397 | |||
398 | $ hg status -S |
|
398 | $ hg status -S | |
399 | R .hgsubstate |
|
399 | R .hgsubstate | |
400 | $ hg sum | grep commit |
|
400 | $ hg sum | grep commit | |
401 | commit: 1 removed, 1 subrepos (new branch head) |
|
401 | commit: 1 removed, 1 subrepos (new branch head) | |
402 |
|
402 | |||
403 | $ hg commit -m 'restore substate' |
|
403 | $ hg commit -m 'restore substate' | |
404 | nothing changed |
|
404 | nothing changed | |
405 | [1] |
|
405 | [1] | |
406 | $ hg manifest |
|
406 | $ hg manifest | |
407 | .hgsub |
|
407 | .hgsub | |
408 | .hgsubstate |
|
408 | .hgsubstate | |
409 | a |
|
409 | a | |
410 | $ hg sum | grep commit |
|
410 | $ hg sum | grep commit | |
411 | commit: 1 removed, 1 subrepos (new branch head) |
|
411 | commit: 1 removed, 1 subrepos (new branch head) | |
412 |
|
412 | |||
413 | $ hg update -qC nosubstate |
|
413 | $ hg update -qC nosubstate | |
414 | $ ls s |
|
414 | $ ls s | |
415 | g |
|
415 | g | |
416 |
|
416 | |||
417 | issue3109: false positives in git diff-index |
|
417 | issue3109: false positives in git diff-index | |
418 |
|
418 | |||
419 | $ hg update -q |
|
419 | $ hg update -q | |
420 | $ touch -t 200001010000 s/g |
|
420 | $ touch -t 200001010000 s/g | |
421 | $ hg status --subrepos |
|
421 | $ hg status --subrepos | |
422 | $ touch -t 200001010000 s/g |
|
422 | $ touch -t 200001010000 s/g | |
423 | $ hg sum | grep commit |
|
423 | $ hg sum | grep commit | |
424 | commit: (clean) |
|
424 | commit: (clean) | |
425 |
|
425 | |||
426 | Check hg update --clean |
|
426 | Check hg update --clean | |
427 | $ cd $TESTTMP/ta |
|
427 | $ cd $TESTTMP/ta | |
428 | $ echo > s/g |
|
428 | $ echo > s/g | |
429 | $ cd s |
|
429 | $ cd s | |
430 | $ echo c1 > f1 |
|
430 | $ echo c1 > f1 | |
431 | $ echo c1 > f2 |
|
431 | $ echo c1 > f2 | |
432 | $ git add f1 |
|
432 | $ git add f1 | |
433 | $ cd .. |
|
433 | $ cd .. | |
434 | $ hg status -S |
|
434 | $ hg status -S | |
435 | M s/g |
|
435 | M s/g | |
436 | A s/f1 |
|
436 | A s/f1 | |
437 | ? s/f2 |
|
437 | ? s/f2 | |
438 | $ ls s |
|
438 | $ ls s | |
439 | f |
|
439 | f | |
440 | f1 |
|
440 | f1 | |
441 | f2 |
|
441 | f2 | |
442 | g |
|
442 | g | |
443 | $ hg update --clean |
|
443 | $ hg update --clean | |
444 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
444 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
445 | $ hg status -S |
|
445 | $ hg status -S | |
446 | ? s/f1 |
|
446 | ? s/f1 | |
447 | ? s/f2 |
|
447 | ? s/f2 | |
448 | $ ls s |
|
448 | $ ls s | |
449 | f |
|
449 | f | |
450 | f1 |
|
450 | f1 | |
451 | f2 |
|
451 | f2 | |
452 | g |
|
452 | g | |
453 |
|
453 | |||
454 | Sticky subrepositories, no changes |
|
454 | Sticky subrepositories, no changes | |
455 | $ cd $TESTTMP/ta |
|
455 | $ cd $TESTTMP/ta | |
456 | $ hg id -n |
|
456 | $ hg id -n | |
457 | 7 |
|
457 | 7 | |
458 | $ cd s |
|
458 | $ cd s | |
459 | $ git rev-parse HEAD |
|
459 | $ git rev-parse HEAD | |
460 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
460 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc | |
461 | $ cd .. |
|
461 | $ cd .. | |
462 | $ hg update 1 > /dev/null 2>&1 |
|
462 | $ hg update 1 > /dev/null 2>&1 | |
463 | $ hg id -n |
|
463 | $ hg id -n | |
464 | 1 |
|
464 | 1 | |
465 | $ cd s |
|
465 | $ cd s | |
466 | $ git rev-parse HEAD |
|
466 | $ git rev-parse HEAD | |
467 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
467 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 | |
468 | $ cd .. |
|
468 | $ cd .. | |
469 |
|
469 | |||
470 | Sticky subrepositories, file changes |
|
470 | Sticky subrepositories, file changes | |
471 | $ touch s/f1 |
|
471 | $ touch s/f1 | |
472 | $ cd s |
|
472 | $ cd s | |
473 | $ git add f1 |
|
473 | $ git add f1 | |
474 | $ cd .. |
|
474 | $ cd .. | |
475 | $ hg id -n |
|
475 | $ hg id -n | |
476 | 1+ |
|
476 | 1+ | |
477 | $ cd s |
|
477 | $ cd s | |
478 | $ git rev-parse HEAD |
|
478 | $ git rev-parse HEAD | |
479 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
479 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 | |
480 | $ cd .. |
|
480 | $ cd .. | |
481 | $ hg update 4 |
|
481 | $ hg update 4 | |
482 | subrepository s diverged (local revision: da5f5b1, remote revision: aa84837) |
|
482 | subrepository s diverged (local revision: da5f5b1, remote revision: aa84837) | |
483 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
483 | (M)erge, keep (l)ocal or keep (r)emote? m | |
484 | subrepository sources for s differ |
|
484 | subrepository sources for s differ | |
485 | use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l |
|
485 | use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l | |
486 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
486 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
487 | $ hg id -n |
|
487 | $ hg id -n | |
488 | 4+ |
|
488 | 4+ | |
489 | $ cd s |
|
489 | $ cd s | |
490 | $ git rev-parse HEAD |
|
490 | $ git rev-parse HEAD | |
491 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
491 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 | |
492 | $ cd .. |
|
492 | $ cd .. | |
493 | $ hg update --clean tip > /dev/null 2>&1 |
|
493 | $ hg update --clean tip > /dev/null 2>&1 | |
494 |
|
494 | |||
495 | Sticky subrepository, revision updates |
|
495 | Sticky subrepository, revision updates | |
496 | $ hg id -n |
|
496 | $ hg id -n | |
497 | 7 |
|
497 | 7 | |
498 | $ cd s |
|
498 | $ cd s | |
499 | $ git rev-parse HEAD |
|
499 | $ git rev-parse HEAD | |
500 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
500 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc | |
501 | $ cd .. |
|
501 | $ cd .. | |
502 | $ cd s |
|
502 | $ cd s | |
503 | $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
503 | $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc | |
504 | Previous HEAD position was 32a3438... fff |
|
504 | Previous HEAD position was 32a3438... fff | |
505 | HEAD is now at aa84837... f |
|
505 | HEAD is now at aa84837... f | |
506 | $ cd .. |
|
506 | $ cd .. | |
507 | $ hg update 1 |
|
507 | $ hg update 1 | |
508 | subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1) |
|
508 | subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1) | |
509 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
509 | (M)erge, keep (l)ocal or keep (r)emote? m | |
510 | subrepository sources for s differ (in checked out version) |
|
510 | subrepository sources for s differ (in checked out version) | |
511 | use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l |
|
511 | use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l | |
512 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
512 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
513 | $ hg id -n |
|
513 | $ hg id -n | |
514 | 1+ |
|
514 | 1+ | |
515 | $ cd s |
|
515 | $ cd s | |
516 | $ git rev-parse HEAD |
|
516 | $ git rev-parse HEAD | |
517 | aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
517 | aa84837ccfbdfedcdcdeeedc309d73e6eb069edc | |
518 | $ cd .. |
|
518 | $ cd .. | |
519 |
|
519 | |||
520 | Sticky subrepository, file changes and revision updates |
|
520 | Sticky subrepository, file changes and revision updates | |
521 | $ touch s/f1 |
|
521 | $ touch s/f1 | |
522 | $ cd s |
|
522 | $ cd s | |
523 | $ git add f1 |
|
523 | $ git add f1 | |
524 | $ git rev-parse HEAD |
|
524 | $ git rev-parse HEAD | |
525 | aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
525 | aa84837ccfbdfedcdcdeeedc309d73e6eb069edc | |
526 | $ cd .. |
|
526 | $ cd .. | |
527 | $ hg id -n |
|
527 | $ hg id -n | |
528 | 1+ |
|
528 | 1+ | |
529 | $ hg update 7 |
|
529 | $ hg update 7 | |
530 | subrepository s diverged (local revision: 32a3438, remote revision: 32a3438) |
|
530 | subrepository s diverged (local revision: 32a3438, remote revision: 32a3438) | |
531 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
531 | (M)erge, keep (l)ocal or keep (r)emote? m | |
532 | subrepository sources for s differ |
|
532 | subrepository sources for s differ | |
533 | use (l)ocal source (32a3438) or (r)emote source (32a3438)? l |
|
533 | use (l)ocal source (32a3438) or (r)emote source (32a3438)? l | |
534 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
534 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
535 | $ hg id -n |
|
535 | $ hg id -n | |
536 | 7+ |
|
536 | 7+ | |
537 | $ cd s |
|
537 | $ cd s | |
538 | $ git rev-parse HEAD |
|
538 | $ git rev-parse HEAD | |
539 | aa84837ccfbdfedcdcdeeedc309d73e6eb069edc |
|
539 | aa84837ccfbdfedcdcdeeedc309d73e6eb069edc | |
540 | $ cd .. |
|
540 | $ cd .. | |
541 |
|
541 | |||
542 | Sticky repository, update --clean |
|
542 | Sticky repository, update --clean | |
543 | $ hg update --clean tip 2>/dev/null |
|
543 | $ hg update --clean tip 2>/dev/null | |
544 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
544 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
545 | $ hg id -n |
|
545 | $ hg id -n | |
546 | 7 |
|
546 | 7 | |
547 | $ cd s |
|
547 | $ cd s | |
548 | $ git rev-parse HEAD |
|
548 | $ git rev-parse HEAD | |
549 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
549 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc | |
550 | $ cd .. |
|
550 | $ cd .. | |
551 |
|
551 | |||
552 | Test subrepo already at intended revision: |
|
552 | Test subrepo already at intended revision: | |
553 | $ cd s |
|
553 | $ cd s | |
554 | $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc |
|
554 | $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc | |
555 | HEAD is now at 32a3438... fff |
|
555 | HEAD is now at 32a3438... fff | |
556 | $ cd .. |
|
556 | $ cd .. | |
557 | $ hg update 1 |
|
557 | $ hg update 1 | |
558 | Previous HEAD position was 32a3438... fff |
|
558 | Previous HEAD position was 32a3438... fff | |
559 | HEAD is now at da5f5b1... g |
|
559 | HEAD is now at da5f5b1... g | |
560 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
560 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
561 | $ hg id -n |
|
561 | $ hg id -n | |
562 | 1 |
|
562 | 1 | |
563 | $ cd s |
|
563 | $ cd s | |
564 | $ git rev-parse HEAD |
|
564 | $ git rev-parse HEAD | |
565 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 |
|
565 | da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7 | |
566 | $ cd .. |
|
566 | $ cd .. | |
567 |
|
567 | |||
568 | Test forgetting files, not implemented in git subrepo, used to |
|
568 | Test forgetting files, not implemented in git subrepo, used to | |
569 | traceback |
|
569 | traceback | |
570 | #if no-windows |
|
570 | #if no-windows | |
571 | $ hg forget 'notafile*' |
|
571 | $ hg forget 'notafile*' | |
572 | notafile*: No such file or directory |
|
572 | notafile*: No such file or directory | |
573 | [1] |
|
573 | [1] | |
574 | #else |
|
574 | #else | |
575 | $ hg forget 'notafile' |
|
575 | $ hg forget 'notafile' | |
576 | notafile: * (glob) |
|
576 | notafile: * (glob) | |
577 | [1] |
|
577 | [1] | |
578 | #endif |
|
578 | #endif | |
579 |
|
579 | |||
580 | $ cd .. |
|
580 | $ cd .. | |
581 |
|
581 | |||
582 | Test sanitizing ".hg/hgrc" in subrepo |
|
582 | Test sanitizing ".hg/hgrc" in subrepo | |
583 |
|
583 | |||
584 | $ cd t |
|
584 | $ cd t | |
585 | $ hg tip -q |
|
585 | $ hg tip -q | |
586 | 7:af6d2edbb0d3 |
|
586 | 7:af6d2edbb0d3 | |
587 | $ hg update -q -C af6d2edbb0d3 |
|
587 | $ hg update -q -C af6d2edbb0d3 | |
588 | $ cd s |
|
588 | $ cd s | |
589 | $ git checkout -q -b sanitize-test |
|
589 | $ git checkout -q -b sanitize-test | |
590 | $ mkdir .hg |
|
590 | $ mkdir .hg | |
591 | $ echo '.hg/hgrc in git repo' > .hg/hgrc |
|
591 | $ echo '.hg/hgrc in git repo' > .hg/hgrc | |
592 | $ mkdir -p sub/.hg |
|
592 | $ mkdir -p sub/.hg | |
593 | $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc |
|
593 | $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc | |
594 | $ git add .hg sub |
|
594 | $ git add .hg sub | |
595 | $ git commit -qm 'add .hg/hgrc to be sanitized at hg update' |
|
595 | $ git commit -qm 'add .hg/hgrc to be sanitized at hg update' | |
596 | $ git push -q origin sanitize-test |
|
596 | $ git push -q origin sanitize-test | |
597 | $ cd .. |
|
597 | $ cd .. | |
598 | $ grep ' s$' .hgsubstate |
|
598 | $ grep ' s$' .hgsubstate | |
599 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
|
599 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc s | |
600 | $ hg commit -qm 'commit with git revision including .hg/hgrc' |
|
600 | $ hg commit -qm 'commit with git revision including .hg/hgrc' | |
601 | $ hg parents -q |
|
601 | $ hg parents -q | |
602 | 8:3473d20bddcf |
|
602 | 8:3473d20bddcf | |
603 | $ grep ' s$' .hgsubstate |
|
603 | $ grep ' s$' .hgsubstate | |
604 | c4069473b459cf27fd4d7c2f50c4346b4e936599 s |
|
604 | c4069473b459cf27fd4d7c2f50c4346b4e936599 s | |
605 | $ cd .. |
|
605 | $ cd .. | |
606 |
|
606 | |||
607 | $ hg -R tc pull -q |
|
607 | $ hg -R tc pull -q | |
608 | $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort |
|
608 | $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort | |
609 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob) |
|
609 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob) | |
610 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob) |
|
610 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob) | |
611 | $ cd tc |
|
611 | $ cd tc | |
612 | $ hg parents -q |
|
612 | $ hg parents -q | |
613 | 8:3473d20bddcf |
|
613 | 8:3473d20bddcf | |
614 | $ grep ' s$' .hgsubstate |
|
614 | $ grep ' s$' .hgsubstate | |
615 | c4069473b459cf27fd4d7c2f50c4346b4e936599 s |
|
615 | c4069473b459cf27fd4d7c2f50c4346b4e936599 s | |
616 | $ test -f s/.hg/hgrc |
|
616 | $ test -f s/.hg/hgrc | |
617 | [1] |
|
617 | [1] | |
618 | $ test -f s/sub/.hg/hgrc |
|
618 | $ test -f s/sub/.hg/hgrc | |
619 | [1] |
|
619 | [1] | |
620 | $ cd .. |
|
620 | $ cd .. | |
621 |
|
621 | |||
622 | additional test for "git merge --ff" route: |
|
622 | additional test for "git merge --ff" route: | |
623 |
|
623 | |||
624 | $ cd t |
|
624 | $ cd t | |
625 | $ hg tip -q |
|
625 | $ hg tip -q | |
626 | 8:3473d20bddcf |
|
626 | 8:3473d20bddcf | |
627 | $ hg update -q -C af6d2edbb0d3 |
|
627 | $ hg update -q -C af6d2edbb0d3 | |
628 | $ cd s |
|
628 | $ cd s | |
629 | $ git checkout -q testing |
|
629 | $ git checkout -q testing | |
630 | $ mkdir .hg |
|
630 | $ mkdir .hg | |
631 | $ echo '.hg/hgrc in git repo' > .hg/hgrc |
|
631 | $ echo '.hg/hgrc in git repo' > .hg/hgrc | |
632 | $ mkdir -p sub/.hg |
|
632 | $ mkdir -p sub/.hg | |
633 | $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc |
|
633 | $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc | |
634 | $ git add .hg sub |
|
634 | $ git add .hg sub | |
635 | $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)' |
|
635 | $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)' | |
636 | $ git push -q origin testing |
|
636 | $ git push -q origin testing | |
637 | $ cd .. |
|
637 | $ cd .. | |
638 | $ grep ' s$' .hgsubstate |
|
638 | $ grep ' s$' .hgsubstate | |
639 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
|
639 | 32a343883b74769118bb1d3b4b1fbf9156f4dddc s | |
640 | $ hg commit -qm 'commit with git revision including .hg/hgrc' |
|
640 | $ hg commit -qm 'commit with git revision including .hg/hgrc' | |
641 | $ hg parents -q |
|
641 | $ hg parents -q | |
642 | 9:ed23f7fe024e |
|
642 | 9:ed23f7fe024e | |
643 | $ grep ' s$' .hgsubstate |
|
643 | $ grep ' s$' .hgsubstate | |
644 | f262643c1077219fbd3858d54e78ef050ef84fbf s |
|
644 | f262643c1077219fbd3858d54e78ef050ef84fbf s | |
645 | $ cd .. |
|
645 | $ cd .. | |
646 |
|
646 | |||
647 | $ cd tc |
|
647 | $ cd tc | |
648 | $ hg update -q -C af6d2edbb0d3 |
|
648 | $ hg update -q -C af6d2edbb0d3 | |
649 | $ test -f s/.hg/hgrc |
|
649 | $ test -f s/.hg/hgrc | |
650 | [1] |
|
650 | [1] | |
651 | $ test -f s/sub/.hg/hgrc |
|
651 | $ test -f s/sub/.hg/hgrc | |
652 | [1] |
|
652 | [1] | |
653 | $ cd .. |
|
653 | $ cd .. | |
654 | $ hg -R tc pull -q |
|
654 | $ hg -R tc pull -q | |
655 | $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort |
|
655 | $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort | |
656 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob) |
|
656 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob) | |
657 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob) |
|
657 | warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob) | |
658 | $ cd tc |
|
658 | $ cd tc | |
659 | $ hg parents -q |
|
659 | $ hg parents -q | |
660 | 9:ed23f7fe024e |
|
660 | 9:ed23f7fe024e | |
661 | $ grep ' s$' .hgsubstate |
|
661 | $ grep ' s$' .hgsubstate | |
662 | f262643c1077219fbd3858d54e78ef050ef84fbf s |
|
662 | f262643c1077219fbd3858d54e78ef050ef84fbf s | |
663 | $ test -f s/.hg/hgrc |
|
663 | $ test -f s/.hg/hgrc | |
664 | [1] |
|
664 | [1] | |
665 | $ test -f s/sub/.hg/hgrc |
|
665 | $ test -f s/sub/.hg/hgrc | |
666 | [1] |
|
666 | [1] | |
667 |
|
667 | |||
668 | Test that sanitizing is omitted in meta data area: |
|
668 | Test that sanitizing is omitted in meta data area: | |
669 |
|
669 | |||
670 | $ mkdir s/.git/.hg |
|
670 | $ mkdir s/.git/.hg | |
671 | $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc |
|
671 | $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc | |
672 | $ hg update -q -C af6d2edbb0d3 |
|
672 | $ hg update -q -C af6d2edbb0d3 | |
673 | checking out detached HEAD in subrepo s |
|
673 | checking out detached HEAD in subrepo s | |
674 | check out a git branch if you intend to make changes |
|
674 | check out a git branch if you intend to make changes | |
675 |
|
675 | |||
676 | check differences made by most recent change |
|
676 | check differences made by most recent change | |
677 | $ cd s |
|
677 | $ cd s | |
678 | $ cat > foobar << EOF |
|
678 | $ cat > foobar << EOF | |
679 | > woopwoop |
|
679 | > woopwoop | |
680 | > |
|
680 | > | |
681 | > foo |
|
681 | > foo | |
682 | > bar |
|
682 | > bar | |
683 | > EOF |
|
683 | > EOF | |
684 | $ git add foobar |
|
684 | $ git add foobar | |
685 | $ cd .. |
|
685 | $ cd .. | |
686 |
|
686 | |||
687 | $ hg diff --subrepos |
|
687 | $ hg diff --subrepos | |
688 | diff --git a/s/foobar b/s/foobar |
|
688 | diff --git a/s/foobar b/s/foobar | |
689 | new file mode 100644 |
|
689 | new file mode 100644 | |
690 | index 0000000..8a5a5e2 |
|
690 | index 0000000..8a5a5e2 | |
691 | --- /dev/null |
|
691 | --- /dev/null | |
692 | +++ b/s/foobar |
|
692 | +++ b/s/foobar | |
693 | @@ -0,0 +1,4 @@ |
|
693 | @@ -0,0 +1,4 @@ | |
694 | +woopwoop |
|
694 | +woopwoop | |
695 | + |
|
695 | + | |
696 | +foo |
|
696 | +foo | |
697 | +bar (no-eol) |
|
697 | +bar (no-eol) | |
698 |
|
698 | |||
699 | $ hg commit --subrepos -m "Added foobar" |
|
699 | $ hg commit --subrepos -m "Added foobar" | |
700 | committing subrepository s |
|
700 | committing subrepository s | |
701 | created new head |
|
701 | created new head | |
702 |
|
702 | |||
703 | $ hg diff -c . --subrepos --nodates |
|
703 | $ hg diff -c . --subrepos --nodates | |
704 | diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate |
|
704 | diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate | |
705 | --- a/.hgsubstate |
|
705 | --- a/.hgsubstate | |
706 | +++ b/.hgsubstate |
|
706 | +++ b/.hgsubstate | |
707 | @@ -1,1 +1,1 @@ |
|
707 | @@ -1,1 +1,1 @@ | |
708 | -32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
|
708 | -32a343883b74769118bb1d3b4b1fbf9156f4dddc s | |
709 | +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s |
|
709 | +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s | |
710 | diff --git a/s/foobar b/s/foobar |
|
710 | diff --git a/s/foobar b/s/foobar | |
711 | new file mode 100644 |
|
711 | new file mode 100644 | |
712 | index 0000000..8a5a5e2 |
|
712 | index 0000000..8a5a5e2 | |
713 | --- /dev/null |
|
713 | --- /dev/null | |
714 | +++ b/s/foobar |
|
714 | +++ b/s/foobar | |
715 | @@ -0,0 +1,4 @@ |
|
715 | @@ -0,0 +1,4 @@ | |
716 | +woopwoop |
|
716 | +woopwoop | |
717 | + |
|
717 | + | |
718 | +foo |
|
718 | +foo | |
719 | +bar (no-eol) |
|
719 | +bar (no-eol) | |
720 |
|
720 | |||
721 | check output when only diffing the subrepository |
|
721 | check output when only diffing the subrepository | |
722 | $ hg diff -c . --subrepos s |
|
722 | $ hg diff -c . --subrepos s | |
723 | diff --git a/s/foobar b/s/foobar |
|
723 | diff --git a/s/foobar b/s/foobar | |
724 | new file mode 100644 |
|
724 | new file mode 100644 | |
725 | index 0000000..8a5a5e2 |
|
725 | index 0000000..8a5a5e2 | |
726 | --- /dev/null |
|
726 | --- /dev/null | |
727 | +++ b/s/foobar |
|
727 | +++ b/s/foobar | |
728 | @@ -0,0 +1,4 @@ |
|
728 | @@ -0,0 +1,4 @@ | |
729 | +woopwoop |
|
729 | +woopwoop | |
730 | + |
|
730 | + | |
731 | +foo |
|
731 | +foo | |
732 | +bar (no-eol) |
|
732 | +bar (no-eol) | |
733 |
|
733 | |||
734 | check output when diffing something else |
|
734 | check output when diffing something else | |
735 | $ hg diff -c . --subrepos .hgsubstate --nodates |
|
735 | $ hg diff -c . --subrepos .hgsubstate --nodates | |
736 | diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate |
|
736 | diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate | |
737 | --- a/.hgsubstate |
|
737 | --- a/.hgsubstate | |
738 | +++ b/.hgsubstate |
|
738 | +++ b/.hgsubstate | |
739 | @@ -1,1 +1,1 @@ |
|
739 | @@ -1,1 +1,1 @@ | |
740 | -32a343883b74769118bb1d3b4b1fbf9156f4dddc s |
|
740 | -32a343883b74769118bb1d3b4b1fbf9156f4dddc s | |
741 | +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s |
|
741 | +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s | |
742 |
|
742 | |||
743 | add new changes, including whitespace |
|
743 | add new changes, including whitespace | |
744 | $ cd s |
|
744 | $ cd s | |
745 | $ cat > foobar << EOF |
|
745 | $ cat > foobar << EOF | |
746 | > woop woop |
|
746 | > woop woop | |
747 | > |
|
747 | > | |
748 | > foo |
|
748 | > foo | |
749 | > bar |
|
749 | > bar | |
750 | > EOF |
|
750 | > EOF | |
751 | $ echo foo > barfoo |
|
751 | $ echo foo > barfoo | |
752 | $ git add barfoo |
|
752 | $ git add barfoo | |
753 | $ cd .. |
|
753 | $ cd .. | |
754 |
|
754 | |||
755 | $ hg diff --subrepos --ignore-all-space |
|
755 | $ hg diff --subrepos --ignore-all-space | |
756 | diff --git a/s/barfoo b/s/barfoo |
|
756 | diff --git a/s/barfoo b/s/barfoo | |
757 | new file mode 100644 |
|
757 | new file mode 100644 | |
758 | index 0000000..257cc56 |
|
758 | index 0000000..257cc56 | |
759 | --- /dev/null |
|
759 | --- /dev/null | |
760 | +++ b/s/barfoo |
|
760 | +++ b/s/barfoo | |
761 | @@ -0,0 +1 @@ |
|
761 | @@ -0,0 +1 @@ | |
762 | +foo (no-eol) |
|
762 | +foo (no-eol) | |
763 | $ hg diff --subrepos s/foobar |
|
763 | $ hg diff --subrepos s/foobar | |
764 | diff --git a/s/foobar b/s/foobar |
|
764 | diff --git a/s/foobar b/s/foobar | |
765 | index 8a5a5e2..bd5812a 100644 |
|
765 | index 8a5a5e2..bd5812a 100644 | |
766 | --- a/s/foobar |
|
766 | --- a/s/foobar | |
767 | +++ b/s/foobar |
|
767 | +++ b/s/foobar | |
768 | @@ -1,4 +1,4 @@ |
|
768 | @@ -1,4 +1,4 @@ | |
769 | -woopwoop |
|
769 | -woopwoop | |
770 | +woop woop |
|
770 | +woop woop | |
771 |
|
771 | |||
772 | foo |
|
772 | foo | |
773 | bar (no-eol) |
|
773 | bar (no-eol) | |
774 |
|
774 | |||
775 | execute a diffstat |
|
775 | execute a diffstat | |
776 | the output contains a regex, because git 1.7.10 and 1.7.11 |
|
776 | the output contains a regex, because git 1.7.10 and 1.7.11 | |
777 | change the amount of whitespace |
|
777 | change the amount of whitespace | |
778 | $ hg diff --subrepos --stat |
|
778 | $ hg diff --subrepos --stat | |
779 | \s*barfoo |\s*1 + (re) |
|
779 | \s*barfoo |\s*1 + (re) | |
780 | \s*foobar |\s*2 +- (re) |
|
780 | \s*foobar |\s*2 +- (re) | |
781 | 2 files changed, 2 insertions(+), 1 deletion(-) (no-eol) |
|
781 | 2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) \(no-eol\) (re) | |
782 |
|
782 | |||
783 |
|
|
783 | ensure adding include/exclude ignores the subrepo | |
784 | $ hg diff --subrepos -I s/foobar |
|
784 | $ hg diff --subrepos -I s/foobar | |
785 | $ hg diff --subrepos -X s/foobar |
|
785 | $ hg diff --subrepos -X s/foobar | |
786 |
|
786 | |||
787 | revert the subrepository |
|
787 | revert the subrepository | |
788 | $ hg revert --all |
|
788 | $ hg revert --all | |
789 | reverting subrepo ../gitroot (glob) |
|
789 | reverting subrepo ../gitroot (glob) | |
790 | ../gitroot: reverting git subrepos without --no-backup is unsupported (glob) |
|
790 | ../gitroot: reverting git subrepos without --no-backup is unsupported (glob) | |
791 |
|
791 | |||
792 | $ hg status --subrepos |
|
792 | $ hg status --subrepos | |
793 | M s/foobar |
|
793 | M s/foobar | |
794 | A s/barfoo |
|
794 | A s/barfoo | |
795 |
|
795 | |||
796 | $ hg revert --no-backup --all |
|
796 | $ hg revert --no-backup --all | |
797 | reverting subrepo ../gitroot (glob) |
|
797 | reverting subrepo ../gitroot (glob) | |
798 | $ hg revert --no-backup s |
|
798 | $ hg revert --no-backup s | |
799 | reverting subrepo ../gitroot (glob) |
|
799 | reverting subrepo ../gitroot (glob) | |
800 |
|
800 | |||
801 | $ hg status --subrepos |
|
801 | $ hg status --subrepos | |
802 | ? s/barfoo |
|
802 | ? s/barfoo | |
803 |
|
803 | |||
804 | $ cd .. |
|
804 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now