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