##// END OF EJS Templates
test: prepare tests for removing date aliases...
Boris Feld -
r32413:d6be5b5c default
parent child Browse files
Show More
@@ -1,982 +1,982 b''
1 ==========================
1 ==========================
2 Test rebase with obsolete
2 Test rebase with obsolete
3 ==========================
3 ==========================
4
4
5 Enable obsolete
5 Enable obsolete
6
6
7 $ cat >> $HGRCPATH << EOF
7 $ cat >> $HGRCPATH << EOF
8 > [ui]
8 > [ui]
9 > logtemplate= {rev}:{node|short} {desc|firstline}
9 > logtemplate= {rev}:{node|short} {desc|firstline}
10 > [experimental]
10 > [experimental]
11 > evolution=createmarkers,allowunstable
11 > evolution=createmarkers,allowunstable
12 > [phases]
12 > [phases]
13 > publish=False
13 > publish=False
14 > [extensions]
14 > [extensions]
15 > rebase=
15 > rebase=
16 > EOF
16 > EOF
17
17
18 Setup rebase canonical repo
18 Setup rebase canonical repo
19
19
20 $ hg init base
20 $ hg init base
21 $ cd base
21 $ cd base
22 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
22 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
23 adding changesets
23 adding changesets
24 adding manifests
24 adding manifests
25 adding file changes
25 adding file changes
26 added 8 changesets with 7 changes to 7 files (+2 heads)
26 added 8 changesets with 7 changes to 7 files (+2 heads)
27 (run 'hg heads' to see heads, 'hg merge' to merge)
27 (run 'hg heads' to see heads, 'hg merge' to merge)
28 $ hg up tip
28 $ hg up tip
29 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
29 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 $ hg log -G
30 $ hg log -G
31 @ 7:02de42196ebe H
31 @ 7:02de42196ebe H
32 |
32 |
33 | o 6:eea13746799a G
33 | o 6:eea13746799a G
34 |/|
34 |/|
35 o | 5:24b6387c8c8c F
35 o | 5:24b6387c8c8c F
36 | |
36 | |
37 | o 4:9520eea781bc E
37 | o 4:9520eea781bc E
38 |/
38 |/
39 | o 3:32af7686d403 D
39 | o 3:32af7686d403 D
40 | |
40 | |
41 | o 2:5fddd98957c8 C
41 | o 2:5fddd98957c8 C
42 | |
42 | |
43 | o 1:42ccdea3bb16 B
43 | o 1:42ccdea3bb16 B
44 |/
44 |/
45 o 0:cd010b8cd998 A
45 o 0:cd010b8cd998 A
46
46
47 $ cd ..
47 $ cd ..
48
48
49 simple rebase
49 simple rebase
50 ---------------------------------
50 ---------------------------------
51
51
52 $ hg clone base simple
52 $ hg clone base simple
53 updating to branch default
53 updating to branch default
54 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
55 $ cd simple
55 $ cd simple
56 $ hg up 32af7686d403
56 $ hg up 32af7686d403
57 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
57 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
58 $ hg rebase -d eea13746799a
58 $ hg rebase -d eea13746799a
59 rebasing 1:42ccdea3bb16 "B"
59 rebasing 1:42ccdea3bb16 "B"
60 rebasing 2:5fddd98957c8 "C"
60 rebasing 2:5fddd98957c8 "C"
61 rebasing 3:32af7686d403 "D"
61 rebasing 3:32af7686d403 "D"
62 $ hg log -G
62 $ hg log -G
63 @ 10:8eeb3c33ad33 D
63 @ 10:8eeb3c33ad33 D
64 |
64 |
65 o 9:2327fea05063 C
65 o 9:2327fea05063 C
66 |
66 |
67 o 8:e4e5be0395b2 B
67 o 8:e4e5be0395b2 B
68 |
68 |
69 | o 7:02de42196ebe H
69 | o 7:02de42196ebe H
70 | |
70 | |
71 o | 6:eea13746799a G
71 o | 6:eea13746799a G
72 |\|
72 |\|
73 | o 5:24b6387c8c8c F
73 | o 5:24b6387c8c8c F
74 | |
74 | |
75 o | 4:9520eea781bc E
75 o | 4:9520eea781bc E
76 |/
76 |/
77 o 0:cd010b8cd998 A
77 o 0:cd010b8cd998 A
78
78
79 $ hg log --hidden -G
79 $ hg log --hidden -G
80 @ 10:8eeb3c33ad33 D
80 @ 10:8eeb3c33ad33 D
81 |
81 |
82 o 9:2327fea05063 C
82 o 9:2327fea05063 C
83 |
83 |
84 o 8:e4e5be0395b2 B
84 o 8:e4e5be0395b2 B
85 |
85 |
86 | o 7:02de42196ebe H
86 | o 7:02de42196ebe H
87 | |
87 | |
88 o | 6:eea13746799a G
88 o | 6:eea13746799a G
89 |\|
89 |\|
90 | o 5:24b6387c8c8c F
90 | o 5:24b6387c8c8c F
91 | |
91 | |
92 o | 4:9520eea781bc E
92 o | 4:9520eea781bc E
93 |/
93 |/
94 | x 3:32af7686d403 D
94 | x 3:32af7686d403 D
95 | |
95 | |
96 | x 2:5fddd98957c8 C
96 | x 2:5fddd98957c8 C
97 | |
97 | |
98 | x 1:42ccdea3bb16 B
98 | x 1:42ccdea3bb16 B
99 |/
99 |/
100 o 0:cd010b8cd998 A
100 o 0:cd010b8cd998 A
101
101
102 $ hg debugobsolete
102 $ hg debugobsolete
103 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (*) {'user': 'test'} (glob)
103 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 e4e5be0395b2cbd471ed22a26b1b6a1a0658a794 0 (*) {'user': 'test'} (glob)
104 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (*) {'user': 'test'} (glob)
104 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 2327fea05063f39961b14cb69435a9898dc9a245 0 (*) {'user': 'test'} (glob)
105 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (*) {'user': 'test'} (glob)
105 32af7686d403cf45b5d95f2d70cebea587ac806a 8eeb3c33ad33d452c89e5dcf611c347f978fb42b 0 (*) {'user': 'test'} (glob)
106
106
107
107
108 $ cd ..
108 $ cd ..
109
109
110 empty changeset
110 empty changeset
111 ---------------------------------
111 ---------------------------------
112
112
113 $ hg clone base empty
113 $ hg clone base empty
114 updating to branch default
114 updating to branch default
115 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
116 $ cd empty
116 $ cd empty
117 $ hg up eea13746799a
117 $ hg up eea13746799a
118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
119
119
120 We make a copy of both the first changeset in the rebased and some other in the
120 We make a copy of both the first changeset in the rebased and some other in the
121 set.
121 set.
122
122
123 $ hg graft 42ccdea3bb16 32af7686d403
123 $ hg graft 42ccdea3bb16 32af7686d403
124 grafting 1:42ccdea3bb16 "B"
124 grafting 1:42ccdea3bb16 "B"
125 grafting 3:32af7686d403 "D"
125 grafting 3:32af7686d403 "D"
126 $ hg rebase -s 42ccdea3bb16 -d .
126 $ hg rebase -s 42ccdea3bb16 -d .
127 rebasing 1:42ccdea3bb16 "B"
127 rebasing 1:42ccdea3bb16 "B"
128 note: rebase of 1:42ccdea3bb16 created no changes to commit
128 note: rebase of 1:42ccdea3bb16 created no changes to commit
129 rebasing 2:5fddd98957c8 "C"
129 rebasing 2:5fddd98957c8 "C"
130 rebasing 3:32af7686d403 "D"
130 rebasing 3:32af7686d403 "D"
131 note: rebase of 3:32af7686d403 created no changes to commit
131 note: rebase of 3:32af7686d403 created no changes to commit
132 $ hg log -G
132 $ hg log -G
133 o 10:5ae4c968c6ac C
133 o 10:5ae4c968c6ac C
134 |
134 |
135 @ 9:08483444fef9 D
135 @ 9:08483444fef9 D
136 |
136 |
137 o 8:8877864f1edb B
137 o 8:8877864f1edb B
138 |
138 |
139 | o 7:02de42196ebe H
139 | o 7:02de42196ebe H
140 | |
140 | |
141 o | 6:eea13746799a G
141 o | 6:eea13746799a G
142 |\|
142 |\|
143 | o 5:24b6387c8c8c F
143 | o 5:24b6387c8c8c F
144 | |
144 | |
145 o | 4:9520eea781bc E
145 o | 4:9520eea781bc E
146 |/
146 |/
147 o 0:cd010b8cd998 A
147 o 0:cd010b8cd998 A
148
148
149 $ hg log --hidden -G
149 $ hg log --hidden -G
150 o 10:5ae4c968c6ac C
150 o 10:5ae4c968c6ac C
151 |
151 |
152 @ 9:08483444fef9 D
152 @ 9:08483444fef9 D
153 |
153 |
154 o 8:8877864f1edb B
154 o 8:8877864f1edb B
155 |
155 |
156 | o 7:02de42196ebe H
156 | o 7:02de42196ebe H
157 | |
157 | |
158 o | 6:eea13746799a G
158 o | 6:eea13746799a G
159 |\|
159 |\|
160 | o 5:24b6387c8c8c F
160 | o 5:24b6387c8c8c F
161 | |
161 | |
162 o | 4:9520eea781bc E
162 o | 4:9520eea781bc E
163 |/
163 |/
164 | x 3:32af7686d403 D
164 | x 3:32af7686d403 D
165 | |
165 | |
166 | x 2:5fddd98957c8 C
166 | x 2:5fddd98957c8 C
167 | |
167 | |
168 | x 1:42ccdea3bb16 B
168 | x 1:42ccdea3bb16 B
169 |/
169 |/
170 o 0:cd010b8cd998 A
170 o 0:cd010b8cd998 A
171
171
172 $ hg debugobsolete
172 $ hg debugobsolete
173 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
173 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
174 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
174 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
175 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
175 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
176
176
177
177
178 More complex case where part of the rebase set were already rebased
178 More complex case where part of the rebase set were already rebased
179
179
180 $ hg rebase --rev 'desc(D)' --dest 'desc(H)'
180 $ hg rebase --rev 'desc(D)' --dest 'desc(H)'
181 rebasing 9:08483444fef9 "D"
181 rebasing 9:08483444fef9 "D"
182 $ hg debugobsolete
182 $ hg debugobsolete
183 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
183 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
184 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
184 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
185 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
185 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
186 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
186 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
187 $ hg log -G
187 $ hg log -G
188 @ 11:4596109a6a43 D
188 @ 11:4596109a6a43 D
189 |
189 |
190 | o 10:5ae4c968c6ac C
190 | o 10:5ae4c968c6ac C
191 | |
191 | |
192 | x 9:08483444fef9 D
192 | x 9:08483444fef9 D
193 | |
193 | |
194 | o 8:8877864f1edb B
194 | o 8:8877864f1edb B
195 | |
195 | |
196 o | 7:02de42196ebe H
196 o | 7:02de42196ebe H
197 | |
197 | |
198 | o 6:eea13746799a G
198 | o 6:eea13746799a G
199 |/|
199 |/|
200 o | 5:24b6387c8c8c F
200 o | 5:24b6387c8c8c F
201 | |
201 | |
202 | o 4:9520eea781bc E
202 | o 4:9520eea781bc E
203 |/
203 |/
204 o 0:cd010b8cd998 A
204 o 0:cd010b8cd998 A
205
205
206 $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True
206 $ hg rebase --source 'desc(B)' --dest 'tip' --config experimental.rebaseskipobsolete=True
207 rebasing 8:8877864f1edb "B"
207 rebasing 8:8877864f1edb "B"
208 note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D"
208 note: not rebasing 9:08483444fef9 "D", already in destination as 11:4596109a6a43 "D"
209 rebasing 10:5ae4c968c6ac "C"
209 rebasing 10:5ae4c968c6ac "C"
210 $ hg debugobsolete
210 $ hg debugobsolete
211 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
211 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 {cd010b8cd998f3981a5a8115f94f8da4ab506089} (*) {'user': 'test'} (glob)
212 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
212 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 5ae4c968c6aca831df823664e706c9d4aa34473d 0 (*) {'user': 'test'} (glob)
213 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
213 32af7686d403cf45b5d95f2d70cebea587ac806a 0 {5fddd98957c8a54a4d436dfe1da9d87f21a1b97b} (*) {'user': 'test'} (glob)
214 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
214 08483444fef91d6224f6655ee586a65d263ad34c 4596109a6a4328c398bde3a4a3b6737cfade3003 0 (*) {'user': 'test'} (glob)
215 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (*) {'user': 'test'} (glob)
215 8877864f1edb05d0e07dc4ba77b67a80a7b86672 462a34d07e599b87ea08676a449373fe4e2e1347 0 (*) {'user': 'test'} (glob)
216 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (*) {'user': 'test'} (glob)
216 5ae4c968c6aca831df823664e706c9d4aa34473d 98f6af4ee9539e14da4465128f894c274900b6e5 0 (*) {'user': 'test'} (glob)
217 $ hg log --rev 'divergent()'
217 $ hg log --rev 'divergent()'
218 $ hg log -G
218 $ hg log -G
219 o 13:98f6af4ee953 C
219 o 13:98f6af4ee953 C
220 |
220 |
221 o 12:462a34d07e59 B
221 o 12:462a34d07e59 B
222 |
222 |
223 @ 11:4596109a6a43 D
223 @ 11:4596109a6a43 D
224 |
224 |
225 o 7:02de42196ebe H
225 o 7:02de42196ebe H
226 |
226 |
227 | o 6:eea13746799a G
227 | o 6:eea13746799a G
228 |/|
228 |/|
229 o | 5:24b6387c8c8c F
229 o | 5:24b6387c8c8c F
230 | |
230 | |
231 | o 4:9520eea781bc E
231 | o 4:9520eea781bc E
232 |/
232 |/
233 o 0:cd010b8cd998 A
233 o 0:cd010b8cd998 A
234
234
235 $ hg log --style default --debug -r 4596109a6a4328c398bde3a4a3b6737cfade3003
235 $ hg log --style default --debug -r 4596109a6a4328c398bde3a4a3b6737cfade3003
236 changeset: 11:4596109a6a4328c398bde3a4a3b6737cfade3003
236 changeset: 11:4596109a6a4328c398bde3a4a3b6737cfade3003
237 phase: draft
237 phase: draft
238 parent: 7:02de42196ebee42ef284b6780a87cdc96e8eaab6
238 parent: 7:02de42196ebee42ef284b6780a87cdc96e8eaab6
239 parent: -1:0000000000000000000000000000000000000000
239 parent: -1:0000000000000000000000000000000000000000
240 manifest: 11:a91006e3a02f1edf631f7018e6e5684cf27dd905
240 manifest: 11:a91006e3a02f1edf631f7018e6e5684cf27dd905
241 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
241 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
242 date: Sat Apr 30 15:24:48 2011 +0200
242 date: Sat Apr 30 15:24:48 2011 +0200
243 files+: D
243 files+: D
244 extra: branch=default
244 extra: branch=default
245 extra: rebase_source=08483444fef91d6224f6655ee586a65d263ad34c
245 extra: rebase_source=08483444fef91d6224f6655ee586a65d263ad34c
246 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
246 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
247 description:
247 description:
248 D
248 D
249
249
250
250
251 $ hg up -qr 'desc(G)'
251 $ hg up -qr 'desc(G)'
252 $ hg graft 4596109a6a4328c398bde3a4a3b6737cfade3003
252 $ hg graft 4596109a6a4328c398bde3a4a3b6737cfade3003
253 grafting 11:4596109a6a43 "D"
253 grafting 11:4596109a6a43 "D"
254 $ hg up -qr 'desc(E)'
254 $ hg up -qr 'desc(E)'
255 $ hg rebase -s tip -d .
255 $ hg rebase -s tip -d .
256 rebasing 14:9e36056a46e3 "D" (tip)
256 rebasing 14:9e36056a46e3 "D" (tip)
257 $ hg log --style default --debug -r tip
257 $ hg log --style default --debug -r tip
258 changeset: 15:627d4614809036ba22b9e7cb31638ddc06ab99ab
258 changeset: 15:627d4614809036ba22b9e7cb31638ddc06ab99ab
259 tag: tip
259 tag: tip
260 phase: draft
260 phase: draft
261 parent: 4:9520eea781bcca16c1e15acc0ba14335a0e8e5ba
261 parent: 4:9520eea781bcca16c1e15acc0ba14335a0e8e5ba
262 parent: -1:0000000000000000000000000000000000000000
262 parent: -1:0000000000000000000000000000000000000000
263 manifest: 15:648e8ede73ae3e497d093d3a4c8fcc2daa864f42
263 manifest: 15:648e8ede73ae3e497d093d3a4c8fcc2daa864f42
264 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
264 user: Nicolas Dumazet <nicdumz.commits@gmail.com>
265 date: Sat Apr 30 15:24:48 2011 +0200
265 date: Sat Apr 30 15:24:48 2011 +0200
266 files+: D
266 files+: D
267 extra: branch=default
267 extra: branch=default
268 extra: intermediate-source=4596109a6a4328c398bde3a4a3b6737cfade3003
268 extra: intermediate-source=4596109a6a4328c398bde3a4a3b6737cfade3003
269 extra: rebase_source=9e36056a46e37c9776168c7375734eebc70e294f
269 extra: rebase_source=9e36056a46e37c9776168c7375734eebc70e294f
270 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
270 extra: source=32af7686d403cf45b5d95f2d70cebea587ac806a
271 description:
271 description:
272 D
272 D
273
273
274
274
275 Start rebase from a commit that is obsolete but not hidden only because it's
275 Start rebase from a commit that is obsolete but not hidden only because it's
276 a working copy parent. We should be moved back to the starting commit as usual
276 a working copy parent. We should be moved back to the starting commit as usual
277 even though it is hidden (until we're moved there).
277 even though it is hidden (until we're moved there).
278
278
279 $ hg --hidden up -qr 'first(hidden())'
279 $ hg --hidden up -qr 'first(hidden())'
280 $ hg rebase --rev 13 --dest 15
280 $ hg rebase --rev 13 --dest 15
281 rebasing 13:98f6af4ee953 "C"
281 rebasing 13:98f6af4ee953 "C"
282 $ hg log -G
282 $ hg log -G
283 o 16:294a2b93eb4d C
283 o 16:294a2b93eb4d C
284 |
284 |
285 o 15:627d46148090 D
285 o 15:627d46148090 D
286 |
286 |
287 | o 12:462a34d07e59 B
287 | o 12:462a34d07e59 B
288 | |
288 | |
289 | o 11:4596109a6a43 D
289 | o 11:4596109a6a43 D
290 | |
290 | |
291 | o 7:02de42196ebe H
291 | o 7:02de42196ebe H
292 | |
292 | |
293 +---o 6:eea13746799a G
293 +---o 6:eea13746799a G
294 | |/
294 | |/
295 | o 5:24b6387c8c8c F
295 | o 5:24b6387c8c8c F
296 | |
296 | |
297 o | 4:9520eea781bc E
297 o | 4:9520eea781bc E
298 |/
298 |/
299 | @ 1:42ccdea3bb16 B
299 | @ 1:42ccdea3bb16 B
300 |/
300 |/
301 o 0:cd010b8cd998 A
301 o 0:cd010b8cd998 A
302
302
303
303
304 $ cd ..
304 $ cd ..
305
305
306 collapse rebase
306 collapse rebase
307 ---------------------------------
307 ---------------------------------
308
308
309 $ hg clone base collapse
309 $ hg clone base collapse
310 updating to branch default
310 updating to branch default
311 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
311 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
312 $ cd collapse
312 $ cd collapse
313 $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse
313 $ hg rebase -s 42ccdea3bb16 -d eea13746799a --collapse
314 rebasing 1:42ccdea3bb16 "B"
314 rebasing 1:42ccdea3bb16 "B"
315 rebasing 2:5fddd98957c8 "C"
315 rebasing 2:5fddd98957c8 "C"
316 rebasing 3:32af7686d403 "D"
316 rebasing 3:32af7686d403 "D"
317 $ hg log -G
317 $ hg log -G
318 o 8:4dc2197e807b Collapsed revision
318 o 8:4dc2197e807b Collapsed revision
319 |
319 |
320 | @ 7:02de42196ebe H
320 | @ 7:02de42196ebe H
321 | |
321 | |
322 o | 6:eea13746799a G
322 o | 6:eea13746799a G
323 |\|
323 |\|
324 | o 5:24b6387c8c8c F
324 | o 5:24b6387c8c8c F
325 | |
325 | |
326 o | 4:9520eea781bc E
326 o | 4:9520eea781bc E
327 |/
327 |/
328 o 0:cd010b8cd998 A
328 o 0:cd010b8cd998 A
329
329
330 $ hg log --hidden -G
330 $ hg log --hidden -G
331 o 8:4dc2197e807b Collapsed revision
331 o 8:4dc2197e807b Collapsed revision
332 |
332 |
333 | @ 7:02de42196ebe H
333 | @ 7:02de42196ebe H
334 | |
334 | |
335 o | 6:eea13746799a G
335 o | 6:eea13746799a G
336 |\|
336 |\|
337 | o 5:24b6387c8c8c F
337 | o 5:24b6387c8c8c F
338 | |
338 | |
339 o | 4:9520eea781bc E
339 o | 4:9520eea781bc E
340 |/
340 |/
341 | x 3:32af7686d403 D
341 | x 3:32af7686d403 D
342 | |
342 | |
343 | x 2:5fddd98957c8 C
343 | x 2:5fddd98957c8 C
344 | |
344 | |
345 | x 1:42ccdea3bb16 B
345 | x 1:42ccdea3bb16 B
346 |/
346 |/
347 o 0:cd010b8cd998 A
347 o 0:cd010b8cd998 A
348
348
349 $ hg id --debug -r tip
349 $ hg id --debug -r tip
350 4dc2197e807bae9817f09905b50ab288be2dbbcf tip
350 4dc2197e807bae9817f09905b50ab288be2dbbcf tip
351 $ hg debugobsolete
351 $ hg debugobsolete
352 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
352 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
353 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
353 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
354 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
354 32af7686d403cf45b5d95f2d70cebea587ac806a 4dc2197e807bae9817f09905b50ab288be2dbbcf 0 (*) {'user': 'test'} (glob)
355
355
356 $ cd ..
356 $ cd ..
357
357
358 Rebase set has hidden descendants
358 Rebase set has hidden descendants
359 ---------------------------------
359 ---------------------------------
360
360
361 We rebase a changeset which has a hidden changeset. The hidden changeset must
361 We rebase a changeset which has a hidden changeset. The hidden changeset must
362 not be rebased.
362 not be rebased.
363
363
364 $ hg clone base hidden
364 $ hg clone base hidden
365 updating to branch default
365 updating to branch default
366 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
366 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
367 $ cd hidden
367 $ cd hidden
368 $ hg rebase -s 5fddd98957c8 -d eea13746799a
368 $ hg rebase -s 5fddd98957c8 -d eea13746799a
369 rebasing 2:5fddd98957c8 "C"
369 rebasing 2:5fddd98957c8 "C"
370 rebasing 3:32af7686d403 "D"
370 rebasing 3:32af7686d403 "D"
371 $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe
371 $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe
372 rebasing 1:42ccdea3bb16 "B"
372 rebasing 1:42ccdea3bb16 "B"
373 $ hg log -G
373 $ hg log -G
374 o 10:7c6027df6a99 B
374 o 10:7c6027df6a99 B
375 |
375 |
376 | o 9:cf44d2f5a9f4 D
376 | o 9:cf44d2f5a9f4 D
377 | |
377 | |
378 | o 8:e273c5e7d2d2 C
378 | o 8:e273c5e7d2d2 C
379 | |
379 | |
380 @ | 7:02de42196ebe H
380 @ | 7:02de42196ebe H
381 | |
381 | |
382 | o 6:eea13746799a G
382 | o 6:eea13746799a G
383 |/|
383 |/|
384 o | 5:24b6387c8c8c F
384 o | 5:24b6387c8c8c F
385 | |
385 | |
386 | o 4:9520eea781bc E
386 | o 4:9520eea781bc E
387 |/
387 |/
388 o 0:cd010b8cd998 A
388 o 0:cd010b8cd998 A
389
389
390 $ hg log --hidden -G
390 $ hg log --hidden -G
391 o 10:7c6027df6a99 B
391 o 10:7c6027df6a99 B
392 |
392 |
393 | o 9:cf44d2f5a9f4 D
393 | o 9:cf44d2f5a9f4 D
394 | |
394 | |
395 | o 8:e273c5e7d2d2 C
395 | o 8:e273c5e7d2d2 C
396 | |
396 | |
397 @ | 7:02de42196ebe H
397 @ | 7:02de42196ebe H
398 | |
398 | |
399 | o 6:eea13746799a G
399 | o 6:eea13746799a G
400 |/|
400 |/|
401 o | 5:24b6387c8c8c F
401 o | 5:24b6387c8c8c F
402 | |
402 | |
403 | o 4:9520eea781bc E
403 | o 4:9520eea781bc E
404 |/
404 |/
405 | x 3:32af7686d403 D
405 | x 3:32af7686d403 D
406 | |
406 | |
407 | x 2:5fddd98957c8 C
407 | x 2:5fddd98957c8 C
408 | |
408 | |
409 | x 1:42ccdea3bb16 B
409 | x 1:42ccdea3bb16 B
410 |/
410 |/
411 o 0:cd010b8cd998 A
411 o 0:cd010b8cd998 A
412
412
413 $ hg debugobsolete
413 $ hg debugobsolete
414 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 (*) {'user': 'test'} (glob)
414 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b e273c5e7d2d29df783dce9f9eaa3ac4adc69c15d 0 (*) {'user': 'test'} (glob)
415 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 (*) {'user': 'test'} (glob)
415 32af7686d403cf45b5d95f2d70cebea587ac806a cf44d2f5a9f4297a62be94cbdd3dff7c7dc54258 0 (*) {'user': 'test'} (glob)
416 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 (*) {'user': 'test'} (glob)
416 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 7c6027df6a99d93f461868e5433f63bde20b6dfb 0 (*) {'user': 'test'} (glob)
417
417
418 Test that rewriting leaving instability behind is allowed
418 Test that rewriting leaving instability behind is allowed
419 ---------------------------------------------------------------------
419 ---------------------------------------------------------------------
420
420
421 $ hg log -r 'children(8)'
421 $ hg log -r 'children(8)'
422 9:cf44d2f5a9f4 D (no-eol)
422 9:cf44d2f5a9f4 D (no-eol)
423 $ hg rebase -r 8
423 $ hg rebase -r 8
424 rebasing 8:e273c5e7d2d2 "C"
424 rebasing 8:e273c5e7d2d2 "C"
425 $ hg log -G
425 $ hg log -G
426 o 11:0d8f238b634c C
426 o 11:0d8f238b634c C
427 |
427 |
428 o 10:7c6027df6a99 B
428 o 10:7c6027df6a99 B
429 |
429 |
430 | o 9:cf44d2f5a9f4 D
430 | o 9:cf44d2f5a9f4 D
431 | |
431 | |
432 | x 8:e273c5e7d2d2 C
432 | x 8:e273c5e7d2d2 C
433 | |
433 | |
434 @ | 7:02de42196ebe H
434 @ | 7:02de42196ebe H
435 | |
435 | |
436 | o 6:eea13746799a G
436 | o 6:eea13746799a G
437 |/|
437 |/|
438 o | 5:24b6387c8c8c F
438 o | 5:24b6387c8c8c F
439 | |
439 | |
440 | o 4:9520eea781bc E
440 | o 4:9520eea781bc E
441 |/
441 |/
442 o 0:cd010b8cd998 A
442 o 0:cd010b8cd998 A
443
443
444
444
445
445
446 Test multiple root handling
446 Test multiple root handling
447 ------------------------------------
447 ------------------------------------
448
448
449 $ hg rebase --dest 4 --rev '7+11+9'
449 $ hg rebase --dest 4 --rev '7+11+9'
450 rebasing 9:cf44d2f5a9f4 "D"
450 rebasing 9:cf44d2f5a9f4 "D"
451 rebasing 7:02de42196ebe "H"
451 rebasing 7:02de42196ebe "H"
452 not rebasing ignored 10:7c6027df6a99 "B"
452 not rebasing ignored 10:7c6027df6a99 "B"
453 rebasing 11:0d8f238b634c "C" (tip)
453 rebasing 11:0d8f238b634c "C" (tip)
454 $ hg log -G
454 $ hg log -G
455 o 14:1e8370e38cca C
455 o 14:1e8370e38cca C
456 |
456 |
457 @ 13:bfe264faf697 H
457 @ 13:bfe264faf697 H
458 |
458 |
459 | o 12:102b4c1d889b D
459 | o 12:102b4c1d889b D
460 |/
460 |/
461 | o 10:7c6027df6a99 B
461 | o 10:7c6027df6a99 B
462 | |
462 | |
463 | x 7:02de42196ebe H
463 | x 7:02de42196ebe H
464 | |
464 | |
465 +---o 6:eea13746799a G
465 +---o 6:eea13746799a G
466 | |/
466 | |/
467 | o 5:24b6387c8c8c F
467 | o 5:24b6387c8c8c F
468 | |
468 | |
469 o | 4:9520eea781bc E
469 o | 4:9520eea781bc E
470 |/
470 |/
471 o 0:cd010b8cd998 A
471 o 0:cd010b8cd998 A
472
472
473 $ cd ..
473 $ cd ..
474
474
475 test on rebase dropping a merge
475 test on rebase dropping a merge
476
476
477 (setup)
477 (setup)
478
478
479 $ hg init dropmerge
479 $ hg init dropmerge
480 $ cd dropmerge
480 $ cd dropmerge
481 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
481 $ hg unbundle "$TESTDIR/bundles/rebase.hg"
482 adding changesets
482 adding changesets
483 adding manifests
483 adding manifests
484 adding file changes
484 adding file changes
485 added 8 changesets with 7 changes to 7 files (+2 heads)
485 added 8 changesets with 7 changes to 7 files (+2 heads)
486 (run 'hg heads' to see heads, 'hg merge' to merge)
486 (run 'hg heads' to see heads, 'hg merge' to merge)
487 $ hg up 3
487 $ hg up 3
488 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 $ hg merge 7
489 $ hg merge 7
490 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
490 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
491 (branch merge, don't forget to commit)
491 (branch merge, don't forget to commit)
492 $ hg ci -m 'M'
492 $ hg ci -m 'M'
493 $ echo I > I
493 $ echo I > I
494 $ hg add I
494 $ hg add I
495 $ hg ci -m I
495 $ hg ci -m I
496 $ hg log -G
496 $ hg log -G
497 @ 9:4bde274eefcf I
497 @ 9:4bde274eefcf I
498 |
498 |
499 o 8:53a6a128b2b7 M
499 o 8:53a6a128b2b7 M
500 |\
500 |\
501 | o 7:02de42196ebe H
501 | o 7:02de42196ebe H
502 | |
502 | |
503 | | o 6:eea13746799a G
503 | | o 6:eea13746799a G
504 | |/|
504 | |/|
505 | o | 5:24b6387c8c8c F
505 | o | 5:24b6387c8c8c F
506 | | |
506 | | |
507 | | o 4:9520eea781bc E
507 | | o 4:9520eea781bc E
508 | |/
508 | |/
509 o | 3:32af7686d403 D
509 o | 3:32af7686d403 D
510 | |
510 | |
511 o | 2:5fddd98957c8 C
511 o | 2:5fddd98957c8 C
512 | |
512 | |
513 o | 1:42ccdea3bb16 B
513 o | 1:42ccdea3bb16 B
514 |/
514 |/
515 o 0:cd010b8cd998 A
515 o 0:cd010b8cd998 A
516
516
517 (actual test)
517 (actual test)
518
518
519 $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)'
519 $ hg rebase --dest 6 --rev '((desc(H) + desc(D))::) - desc(M)'
520 rebasing 3:32af7686d403 "D"
520 rebasing 3:32af7686d403 "D"
521 rebasing 7:02de42196ebe "H"
521 rebasing 7:02de42196ebe "H"
522 not rebasing ignored 8:53a6a128b2b7 "M"
522 not rebasing ignored 8:53a6a128b2b7 "M"
523 rebasing 9:4bde274eefcf "I" (tip)
523 rebasing 9:4bde274eefcf "I" (tip)
524 $ hg log -G
524 $ hg log -G
525 @ 12:acd174b7ab39 I
525 @ 12:acd174b7ab39 I
526 |
526 |
527 o 11:6c11a6218c97 H
527 o 11:6c11a6218c97 H
528 |
528 |
529 | o 10:b5313c85b22e D
529 | o 10:b5313c85b22e D
530 |/
530 |/
531 | o 8:53a6a128b2b7 M
531 | o 8:53a6a128b2b7 M
532 | |\
532 | |\
533 | | x 7:02de42196ebe H
533 | | x 7:02de42196ebe H
534 | | |
534 | | |
535 o---+ 6:eea13746799a G
535 o---+ 6:eea13746799a G
536 | | |
536 | | |
537 | | o 5:24b6387c8c8c F
537 | | o 5:24b6387c8c8c F
538 | | |
538 | | |
539 o---+ 4:9520eea781bc E
539 o---+ 4:9520eea781bc E
540 / /
540 / /
541 x | 3:32af7686d403 D
541 x | 3:32af7686d403 D
542 | |
542 | |
543 o | 2:5fddd98957c8 C
543 o | 2:5fddd98957c8 C
544 | |
544 | |
545 o | 1:42ccdea3bb16 B
545 o | 1:42ccdea3bb16 B
546 |/
546 |/
547 o 0:cd010b8cd998 A
547 o 0:cd010b8cd998 A
548
548
549
549
550 Test hidden changesets in the rebase set (issue4504)
550 Test hidden changesets in the rebase set (issue4504)
551
551
552 $ hg up --hidden 9
552 $ hg up --hidden 9
553 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
553 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
554 $ echo J > J
554 $ echo J > J
555 $ hg add J
555 $ hg add J
556 $ hg commit -m J
556 $ hg commit -m J
557 $ hg debugobsolete `hg log --rev . -T '{node}'`
557 $ hg debugobsolete `hg log --rev . -T '{node}'`
558
558
559 $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback --config experimental.rebaseskipobsolete=off
559 $ hg rebase --rev .~1::. --dest 'max(desc(D))' --traceback --config experimental.rebaseskipobsolete=off
560 rebasing 9:4bde274eefcf "I"
560 rebasing 9:4bde274eefcf "I"
561 rebasing 13:06edfc82198f "J" (tip)
561 rebasing 13:06edfc82198f "J" (tip)
562 $ hg log -G
562 $ hg log -G
563 @ 15:5ae8a643467b J
563 @ 15:5ae8a643467b J
564 |
564 |
565 o 14:9ad579b4a5de I
565 o 14:9ad579b4a5de I
566 |
566 |
567 | o 12:acd174b7ab39 I
567 | o 12:acd174b7ab39 I
568 | |
568 | |
569 | o 11:6c11a6218c97 H
569 | o 11:6c11a6218c97 H
570 | |
570 | |
571 o | 10:b5313c85b22e D
571 o | 10:b5313c85b22e D
572 |/
572 |/
573 | o 8:53a6a128b2b7 M
573 | o 8:53a6a128b2b7 M
574 | |\
574 | |\
575 | | x 7:02de42196ebe H
575 | | x 7:02de42196ebe H
576 | | |
576 | | |
577 o---+ 6:eea13746799a G
577 o---+ 6:eea13746799a G
578 | | |
578 | | |
579 | | o 5:24b6387c8c8c F
579 | | o 5:24b6387c8c8c F
580 | | |
580 | | |
581 o---+ 4:9520eea781bc E
581 o---+ 4:9520eea781bc E
582 / /
582 / /
583 x | 3:32af7686d403 D
583 x | 3:32af7686d403 D
584 | |
584 | |
585 o | 2:5fddd98957c8 C
585 o | 2:5fddd98957c8 C
586 | |
586 | |
587 o | 1:42ccdea3bb16 B
587 o | 1:42ccdea3bb16 B
588 |/
588 |/
589 o 0:cd010b8cd998 A
589 o 0:cd010b8cd998 A
590
590
591 $ hg up 14 -C
591 $ hg up 14 -C
592 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
592 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
593 $ echo "K" > K
593 $ echo "K" > K
594 $ hg add K
594 $ hg add K
595 $ hg commit --amend -m "K"
595 $ hg commit --amend -m "K"
596 $ echo "L" > L
596 $ echo "L" > L
597 $ hg add L
597 $ hg add L
598 $ hg commit -m "L"
598 $ hg commit -m "L"
599 $ hg up '.^'
599 $ hg up '.^'
600 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
600 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
601 $ echo "M" > M
601 $ echo "M" > M
602 $ hg add M
602 $ hg add M
603 $ hg commit --amend -m "M"
603 $ hg commit --amend -m "M"
604 $ hg log -G
604 $ hg log -G
605 @ 20:bfaedf8eb73b M
605 @ 20:bfaedf8eb73b M
606 |
606 |
607 | o 18:97219452e4bd L
607 | o 18:97219452e4bd L
608 | |
608 | |
609 | x 17:fc37a630c901 K
609 | x 17:fc37a630c901 K
610 |/
610 |/
611 | o 15:5ae8a643467b J
611 | o 15:5ae8a643467b J
612 | |
612 | |
613 | x 14:9ad579b4a5de I
613 | x 14:9ad579b4a5de I
614 |/
614 |/
615 | o 12:acd174b7ab39 I
615 | o 12:acd174b7ab39 I
616 | |
616 | |
617 | o 11:6c11a6218c97 H
617 | o 11:6c11a6218c97 H
618 | |
618 | |
619 o | 10:b5313c85b22e D
619 o | 10:b5313c85b22e D
620 |/
620 |/
621 | o 8:53a6a128b2b7 M
621 | o 8:53a6a128b2b7 M
622 | |\
622 | |\
623 | | x 7:02de42196ebe H
623 | | x 7:02de42196ebe H
624 | | |
624 | | |
625 o---+ 6:eea13746799a G
625 o---+ 6:eea13746799a G
626 | | |
626 | | |
627 | | o 5:24b6387c8c8c F
627 | | o 5:24b6387c8c8c F
628 | | |
628 | | |
629 o---+ 4:9520eea781bc E
629 o---+ 4:9520eea781bc E
630 / /
630 / /
631 x | 3:32af7686d403 D
631 x | 3:32af7686d403 D
632 | |
632 | |
633 o | 2:5fddd98957c8 C
633 o | 2:5fddd98957c8 C
634 | |
634 | |
635 o | 1:42ccdea3bb16 B
635 o | 1:42ccdea3bb16 B
636 |/
636 |/
637 o 0:cd010b8cd998 A
637 o 0:cd010b8cd998 A
638
638
639 $ hg rebase -s 14 -d 18 --config experimental.rebaseskipobsolete=True
639 $ hg rebase -s 14 -d 18 --config experimental.rebaseskipobsolete=True
640 note: not rebasing 14:9ad579b4a5de "I", already in destination as 17:fc37a630c901 "K"
640 note: not rebasing 14:9ad579b4a5de "I", already in destination as 17:fc37a630c901 "K"
641 rebasing 15:5ae8a643467b "J"
641 rebasing 15:5ae8a643467b "J"
642
642
643 $ cd ..
643 $ cd ..
644
644
645 Skip obsolete changeset even with multiple hops
645 Skip obsolete changeset even with multiple hops
646 -----------------------------------------------
646 -----------------------------------------------
647
647
648 setup
648 setup
649
649
650 $ hg init obsskip
650 $ hg init obsskip
651 $ cd obsskip
651 $ cd obsskip
652 $ cat << EOF >> .hg/hgrc
652 $ cat << EOF >> .hg/hgrc
653 > [experimental]
653 > [experimental]
654 > rebaseskipobsolete = True
654 > rebaseskipobsolete = True
655 > [extensions]
655 > [extensions]
656 > strip =
656 > strip =
657 > EOF
657 > EOF
658 $ echo A > A
658 $ echo A > A
659 $ hg add A
659 $ hg add A
660 $ hg commit -m A
660 $ hg commit -m A
661 $ echo B > B
661 $ echo B > B
662 $ hg add B
662 $ hg add B
663 $ hg commit -m B0
663 $ hg commit -m B0
664 $ hg commit --amend -m B1
664 $ hg commit --amend -m B1
665 $ hg commit --amend -m B2
665 $ hg commit --amend -m B2
666 $ hg up --hidden 'desc(B0)'
666 $ hg up --hidden 'desc(B0)'
667 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
667 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
668 $ echo C > C
668 $ echo C > C
669 $ hg add C
669 $ hg add C
670 $ hg commit -m C
670 $ hg commit -m C
671
671
672 Rebase finds its way in a chain of marker
672 Rebase finds its way in a chain of marker
673
673
674 $ hg rebase -d 'desc(B2)'
674 $ hg rebase -d 'desc(B2)'
675 note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 3:261e70097290 "B2"
675 note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 3:261e70097290 "B2"
676 rebasing 4:212cb178bcbb "C" (tip)
676 rebasing 4:212cb178bcbb "C" (tip)
677
677
678 Even when the chain include missing node
678 Even when the chain include missing node
679
679
680 $ hg up --hidden 'desc(B0)'
680 $ hg up --hidden 'desc(B0)'
681 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
681 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
682 $ echo D > D
682 $ echo D > D
683 $ hg add D
683 $ hg add D
684 $ hg commit -m D
684 $ hg commit -m D
685 $ hg --hidden strip -r 'desc(B1)'
685 $ hg --hidden strip -r 'desc(B1)'
686 saved backup bundle to $TESTTMP/obsskip/.hg/strip-backup/86f6414ccda7-b1c452ee-backup.hg (glob)
686 saved backup bundle to $TESTTMP/obsskip/.hg/strip-backup/86f6414ccda7-b1c452ee-backup.hg (glob)
687
687
688 $ hg rebase -d 'desc(B2)'
688 $ hg rebase -d 'desc(B2)'
689 note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 2:261e70097290 "B2"
689 note: not rebasing 1:a8b11f55fb19 "B0", already in destination as 2:261e70097290 "B2"
690 rebasing 5:1a79b7535141 "D" (tip)
690 rebasing 5:1a79b7535141 "D" (tip)
691 $ hg up 4
691 $ hg up 4
692 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
692 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
693 $ echo "O" > O
693 $ echo "O" > O
694 $ hg add O
694 $ hg add O
695 $ hg commit -m O
695 $ hg commit -m O
696 $ echo "P" > P
696 $ echo "P" > P
697 $ hg add P
697 $ hg add P
698 $ hg commit -m P
698 $ hg commit -m P
699 $ hg log -G
699 $ hg log -G
700 @ 8:8d47583e023f P
700 @ 8:8d47583e023f P
701 |
701 |
702 o 7:360bbaa7d3ce O
702 o 7:360bbaa7d3ce O
703 |
703 |
704 | o 6:9c48361117de D
704 | o 6:9c48361117de D
705 | |
705 | |
706 o | 4:ff2c4d47b71d C
706 o | 4:ff2c4d47b71d C
707 |/
707 |/
708 o 2:261e70097290 B2
708 o 2:261e70097290 B2
709 |
709 |
710 o 0:4a2df7238c3b A
710 o 0:4a2df7238c3b A
711
711
712 $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=all
712 $ hg debugobsolete `hg log -r 7 -T '{node}\n'` --config experimental.evolution=all
713 $ hg rebase -d 6 -r "4::"
713 $ hg rebase -d 6 -r "4::"
714 rebasing 4:ff2c4d47b71d "C"
714 rebasing 4:ff2c4d47b71d "C"
715 note: not rebasing 7:360bbaa7d3ce "O", it has no successor
715 note: not rebasing 7:360bbaa7d3ce "O", it has no successor
716 rebasing 8:8d47583e023f "P" (tip)
716 rebasing 8:8d47583e023f "P" (tip)
717
717
718 If all the changeset to be rebased are obsolete and present in the destination, we
718 If all the changeset to be rebased are obsolete and present in the destination, we
719 should display a friendly error message
719 should display a friendly error message
720
720
721 $ hg log -G
721 $ hg log -G
722 @ 10:121d9e3bc4c6 P
722 @ 10:121d9e3bc4c6 P
723 |
723 |
724 o 9:4be60e099a77 C
724 o 9:4be60e099a77 C
725 |
725 |
726 o 6:9c48361117de D
726 o 6:9c48361117de D
727 |
727 |
728 o 2:261e70097290 B2
728 o 2:261e70097290 B2
729 |
729 |
730 o 0:4a2df7238c3b A
730 o 0:4a2df7238c3b A
731
731
732
732
733 $ hg up 9
733 $ hg up 9
734 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
734 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
735 $ echo "non-relevant change" > nonrelevant
735 $ echo "non-relevant change" > nonrelevant
736 $ hg add nonrelevant
736 $ hg add nonrelevant
737 $ hg commit -m nonrelevant
737 $ hg commit -m nonrelevant
738 created new head
738 created new head
739 $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=all
739 $ hg debugobsolete `hg log -r 11 -T '{node}\n'` --config experimental.evolution=all
740 $ hg rebase -r . -d 10
740 $ hg rebase -r . -d 10
741 note: not rebasing 11:f44da1f4954c "nonrelevant" (tip), it has no successor
741 note: not rebasing 11:f44da1f4954c "nonrelevant" (tip), it has no successor
742
742
743 If a rebase is going to create divergence, it should abort
743 If a rebase is going to create divergence, it should abort
744
744
745 $ hg log -G
745 $ hg log -G
746 @ 11:f44da1f4954c nonrelevant
746 @ 11:f44da1f4954c nonrelevant
747 |
747 |
748 | o 10:121d9e3bc4c6 P
748 | o 10:121d9e3bc4c6 P
749 |/
749 |/
750 o 9:4be60e099a77 C
750 o 9:4be60e099a77 C
751 |
751 |
752 o 6:9c48361117de D
752 o 6:9c48361117de D
753 |
753 |
754 o 2:261e70097290 B2
754 o 2:261e70097290 B2
755 |
755 |
756 o 0:4a2df7238c3b A
756 o 0:4a2df7238c3b A
757
757
758
758
759 $ hg up 9
759 $ hg up 9
760 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
760 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
761 $ echo "john" > doe
761 $ echo "john" > doe
762 $ hg add doe
762 $ hg add doe
763 $ hg commit -m "john doe"
763 $ hg commit -m "john doe"
764 created new head
764 created new head
765 $ hg up 10
765 $ hg up 10
766 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
766 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
767 $ echo "foo" > bar
767 $ echo "foo" > bar
768 $ hg add bar
768 $ hg add bar
769 $ hg commit --amend -m "10'"
769 $ hg commit --amend -m "10'"
770 $ hg up 10 --hidden
770 $ hg up 10 --hidden
771 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
771 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
772 $ echo "bar" > foo
772 $ echo "bar" > foo
773 $ hg add foo
773 $ hg add foo
774 $ hg commit -m "bar foo"
774 $ hg commit -m "bar foo"
775 $ hg log -G
775 $ hg log -G
776 @ 15:73568ab6879d bar foo
776 @ 15:73568ab6879d bar foo
777 |
777 |
778 | o 14:77d874d096a2 10'
778 | o 14:77d874d096a2 10'
779 | |
779 | |
780 | | o 12:3eb461388009 john doe
780 | | o 12:3eb461388009 john doe
781 | |/
781 | |/
782 x | 10:121d9e3bc4c6 P
782 x | 10:121d9e3bc4c6 P
783 |/
783 |/
784 o 9:4be60e099a77 C
784 o 9:4be60e099a77 C
785 |
785 |
786 o 6:9c48361117de D
786 o 6:9c48361117de D
787 |
787 |
788 o 2:261e70097290 B2
788 o 2:261e70097290 B2
789 |
789 |
790 o 0:4a2df7238c3b A
790 o 0:4a2df7238c3b A
791
791
792 $ hg summary
792 $ hg summary
793 parent: 15:73568ab6879d tip (unstable)
793 parent: 15:73568ab6879d tip (unstable)
794 bar foo
794 bar foo
795 branch: default
795 branch: default
796 commit: (clean)
796 commit: (clean)
797 update: 2 new changesets, 3 branch heads (merge)
797 update: 2 new changesets, 3 branch heads (merge)
798 phases: 8 draft
798 phases: 8 draft
799 unstable: 1 changesets
799 unstable: 1 changesets
800 $ hg rebase -s 10 -d 12
800 $ hg rebase -s 10 -d 12
801 abort: this rebase will cause divergences from: 121d9e3bc4c6
801 abort: this rebase will cause divergences from: 121d9e3bc4c6
802 (to force the rebase please set experimental.allowdivergence=True)
802 (to force the rebase please set experimental.allowdivergence=True)
803 [255]
803 [255]
804 $ hg log -G
804 $ hg log -G
805 @ 15:73568ab6879d bar foo
805 @ 15:73568ab6879d bar foo
806 |
806 |
807 | o 14:77d874d096a2 10'
807 | o 14:77d874d096a2 10'
808 | |
808 | |
809 | | o 12:3eb461388009 john doe
809 | | o 12:3eb461388009 john doe
810 | |/
810 | |/
811 x | 10:121d9e3bc4c6 P
811 x | 10:121d9e3bc4c6 P
812 |/
812 |/
813 o 9:4be60e099a77 C
813 o 9:4be60e099a77 C
814 |
814 |
815 o 6:9c48361117de D
815 o 6:9c48361117de D
816 |
816 |
817 o 2:261e70097290 B2
817 o 2:261e70097290 B2
818 |
818 |
819 o 0:4a2df7238c3b A
819 o 0:4a2df7238c3b A
820
820
821 With experimental.allowdivergence=True, rebase can create divergence
821 With experimental.allowdivergence=True, rebase can create divergence
822
822
823 $ hg rebase -s 10 -d 12 --config experimental.allowdivergence=True
823 $ hg rebase -s 10 -d 12 --config experimental.allowdivergence=True
824 rebasing 10:121d9e3bc4c6 "P"
824 rebasing 10:121d9e3bc4c6 "P"
825 rebasing 15:73568ab6879d "bar foo" (tip)
825 rebasing 15:73568ab6879d "bar foo" (tip)
826 $ hg summary
826 $ hg summary
827 parent: 17:61bd55f69bc4 tip
827 parent: 17:61bd55f69bc4 tip
828 bar foo
828 bar foo
829 branch: default
829 branch: default
830 commit: (clean)
830 commit: (clean)
831 update: 1 new changesets, 2 branch heads (merge)
831 update: 1 new changesets, 2 branch heads (merge)
832 phases: 8 draft
832 phases: 8 draft
833 divergent: 2 changesets
833 divergent: 2 changesets
834
834
835 rebase --continue + skipped rev because their successors are in destination
835 rebase --continue + skipped rev because their successors are in destination
836 we make a change in trunk and work on conflicting changes to make rebase abort.
836 we make a change in trunk and work on conflicting changes to make rebase abort.
837
837
838 $ hg log -G -r 17::
838 $ hg log -G -r 17::
839 @ 17:61bd55f69bc4 bar foo
839 @ 17:61bd55f69bc4 bar foo
840 |
840 |
841 ~
841 ~
842
842
843 Create the two changes in trunk
843 Create the two changes in trunk
844 $ printf "a" > willconflict
844 $ printf "a" > willconflict
845 $ hg add willconflict
845 $ hg add willconflict
846 $ hg commit -m "willconflict first version"
846 $ hg commit -m "willconflict first version"
847
847
848 $ printf "dummy" > C
848 $ printf "dummy" > C
849 $ hg commit -m "dummy change successor"
849 $ hg commit -m "dummy change successor"
850
850
851 Create the changes that we will rebase
851 Create the changes that we will rebase
852 $ hg update -C 17 -q
852 $ hg update -C 17 -q
853 $ printf "b" > willconflict
853 $ printf "b" > willconflict
854 $ hg add willconflict
854 $ hg add willconflict
855 $ hg commit -m "willconflict second version"
855 $ hg commit -m "willconflict second version"
856 created new head
856 created new head
857 $ printf "dummy" > K
857 $ printf "dummy" > K
858 $ hg add K
858 $ hg add K
859 $ hg commit -m "dummy change"
859 $ hg commit -m "dummy change"
860 $ printf "dummy" > L
860 $ printf "dummy" > L
861 $ hg add L
861 $ hg add L
862 $ hg commit -m "dummy change"
862 $ hg commit -m "dummy change"
863 $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 19 -T '{node}'` --config experimental.evolution=all
863 $ hg debugobsolete `hg log -r ".^" -T '{node}'` `hg log -r 19 -T '{node}'` --config experimental.evolution=all
864
864
865 $ hg log -G -r 17::
865 $ hg log -G -r 17::
866 @ 22:7bdc8a87673d dummy change
866 @ 22:7bdc8a87673d dummy change
867 |
867 |
868 x 21:8b31da3c4919 dummy change
868 x 21:8b31da3c4919 dummy change
869 |
869 |
870 o 20:b82fb57ea638 willconflict second version
870 o 20:b82fb57ea638 willconflict second version
871 |
871 |
872 | o 19:601db7a18f51 dummy change successor
872 | o 19:601db7a18f51 dummy change successor
873 | |
873 | |
874 | o 18:357ddf1602d5 willconflict first version
874 | o 18:357ddf1602d5 willconflict first version
875 |/
875 |/
876 o 17:61bd55f69bc4 bar foo
876 o 17:61bd55f69bc4 bar foo
877 |
877 |
878 ~
878 ~
879 $ hg rebase -r ".^^ + .^ + ." -d 19
879 $ hg rebase -r ".^^ + .^ + ." -d 19
880 rebasing 20:b82fb57ea638 "willconflict second version"
880 rebasing 20:b82fb57ea638 "willconflict second version"
881 merging willconflict
881 merging willconflict
882 warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark')
882 warning: conflicts while merging willconflict! (edit, then use 'hg resolve --mark')
883 unresolved conflicts (see hg resolve, then hg rebase --continue)
883 unresolved conflicts (see hg resolve, then hg rebase --continue)
884 [1]
884 [1]
885
885
886 $ hg resolve --mark willconflict
886 $ hg resolve --mark willconflict
887 (no more unresolved files)
887 (no more unresolved files)
888 continue: hg rebase --continue
888 continue: hg rebase --continue
889 $ hg rebase --continue
889 $ hg rebase --continue
890 rebasing 20:b82fb57ea638 "willconflict second version"
890 rebasing 20:b82fb57ea638 "willconflict second version"
891 note: not rebasing 21:8b31da3c4919 "dummy change", already in destination as 19:601db7a18f51 "dummy change successor"
891 note: not rebasing 21:8b31da3c4919 "dummy change", already in destination as 19:601db7a18f51 "dummy change successor"
892 rebasing 22:7bdc8a87673d "dummy change" (tip)
892 rebasing 22:7bdc8a87673d "dummy change" (tip)
893 $ cd ..
893 $ cd ..
894
894
895 rebase source is obsoleted (issue5198)
895 rebase source is obsoleted (issue5198)
896 ---------------------------------
896 ---------------------------------
897
897
898 $ hg clone base amended
898 $ hg clone base amended
899 updating to branch default
899 updating to branch default
900 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
900 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
901 $ cd amended
901 $ cd amended
902 $ hg up 9520eea781bc
902 $ hg up 9520eea781bc
903 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
903 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
904 $ echo 1 >> E
904 $ echo 1 >> E
905 $ hg commit --amend -m "E'"
905 $ hg commit --amend -m "E'" -d "0 0"
906 $ hg log -G
906 $ hg log -G
907 @ 9:69abe8906104 E'
907 @ 9:69abe8906104 E'
908 |
908 |
909 | o 7:02de42196ebe H
909 | o 7:02de42196ebe H
910 | |
910 | |
911 | | o 6:eea13746799a G
911 | | o 6:eea13746799a G
912 | |/|
912 | |/|
913 | o | 5:24b6387c8c8c F
913 | o | 5:24b6387c8c8c F
914 |/ /
914 |/ /
915 | x 4:9520eea781bc E
915 | x 4:9520eea781bc E
916 |/
916 |/
917 | o 3:32af7686d403 D
917 | o 3:32af7686d403 D
918 | |
918 | |
919 | o 2:5fddd98957c8 C
919 | o 2:5fddd98957c8 C
920 | |
920 | |
921 | o 1:42ccdea3bb16 B
921 | o 1:42ccdea3bb16 B
922 |/
922 |/
923 o 0:cd010b8cd998 A
923 o 0:cd010b8cd998 A
924
924
925 $ hg rebase -d . -s 9520eea781bc
925 $ hg rebase -d . -s 9520eea781bc
926 note: not rebasing 4:9520eea781bc "E", already in destination as 9:69abe8906104 "E'"
926 note: not rebasing 4:9520eea781bc "E", already in destination as 9:69abe8906104 "E'"
927 rebasing 6:eea13746799a "G"
927 rebasing 6:eea13746799a "G"
928 $ hg log -G
928 $ hg log -G
929 o 10:17be06e82e95 G
929 o 10:17be06e82e95 G
930 |\
930 |\
931 | @ 9:69abe8906104 E'
931 | @ 9:69abe8906104 E'
932 | |
932 | |
933 +---o 7:02de42196ebe H
933 +---o 7:02de42196ebe H
934 | |
934 | |
935 o | 5:24b6387c8c8c F
935 o | 5:24b6387c8c8c F
936 |/
936 |/
937 | o 3:32af7686d403 D
937 | o 3:32af7686d403 D
938 | |
938 | |
939 | o 2:5fddd98957c8 C
939 | o 2:5fddd98957c8 C
940 | |
940 | |
941 | o 1:42ccdea3bb16 B
941 | o 1:42ccdea3bb16 B
942 |/
942 |/
943 o 0:cd010b8cd998 A
943 o 0:cd010b8cd998 A
944
944
945 $ cd ..
945 $ cd ..
946
946
947 Test that bookmark is moved and working dir is updated when all changesets have
947 Test that bookmark is moved and working dir is updated when all changesets have
948 equivalents in destination
948 equivalents in destination
949 $ hg init rbsrepo && cd rbsrepo
949 $ hg init rbsrepo && cd rbsrepo
950 $ echo "[experimental]" > .hg/hgrc
950 $ echo "[experimental]" > .hg/hgrc
951 $ echo "evolution=all" >> .hg/hgrc
951 $ echo "evolution=all" >> .hg/hgrc
952 $ echo "rebaseskipobsolete=on" >> .hg/hgrc
952 $ echo "rebaseskipobsolete=on" >> .hg/hgrc
953 $ echo root > root && hg ci -Am root
953 $ echo root > root && hg ci -Am root
954 adding root
954 adding root
955 $ echo a > a && hg ci -Am a
955 $ echo a > a && hg ci -Am a
956 adding a
956 adding a
957 $ hg up 0
957 $ hg up 0
958 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
958 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
959 $ echo b > b && hg ci -Am b
959 $ echo b > b && hg ci -Am b
960 adding b
960 adding b
961 created new head
961 created new head
962 $ hg rebase -r 2 -d 1
962 $ hg rebase -r 2 -d 1
963 rebasing 2:1e9a3c00cbe9 "b" (tip)
963 rebasing 2:1e9a3c00cbe9 "b" (tip)
964 $ hg log -r . # working dir is at rev 3 (successor of 2)
964 $ hg log -r . # working dir is at rev 3 (successor of 2)
965 3:be1832deae9a b (no-eol)
965 3:be1832deae9a b (no-eol)
966 $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now
966 $ hg book -r 2 mybook --hidden # rev 2 has a bookmark on it now
967 $ hg up 2 && hg log -r . # working dir is at rev 2 again
967 $ hg up 2 && hg log -r . # working dir is at rev 2 again
968 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
968 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
969 2:1e9a3c00cbe9 b (no-eol)
969 2:1e9a3c00cbe9 b (no-eol)
970 $ hg rebase -r 2 -d 3 --config experimental.evolution.track-operation=1
970 $ hg rebase -r 2 -d 3 --config experimental.evolution.track-operation=1
971 note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b"
971 note: not rebasing 2:1e9a3c00cbe9 "b" (mybook), already in destination as 3:be1832deae9a "b"
972 Check that working directory was updated to rev 3 although rev 2 was skipped
972 Check that working directory was updated to rev 3 although rev 2 was skipped
973 during the rebase operation
973 during the rebase operation
974 $ hg log -r .
974 $ hg log -r .
975 3:be1832deae9a b (no-eol)
975 3:be1832deae9a b (no-eol)
976
976
977 Check that bookmark was moved to rev 3 although rev 2 was skipped
977 Check that bookmark was moved to rev 3 although rev 2 was skipped
978 during the rebase operation
978 during the rebase operation
979 $ hg bookmarks
979 $ hg bookmarks
980 mybook 3:be1832deae9a
980 mybook 3:be1832deae9a
981 $ hg debugobsolete --rev tip
981 $ hg debugobsolete --rev tip
982 1e9a3c00cbe90d236ac05ef61efcc5e40b7412bc be1832deae9ac531caa7438b8dcf6055a122cd8e 0 (*) {'user': 'test'} (glob)
982 1e9a3c00cbe90d236ac05ef61efcc5e40b7412bc be1832deae9ac531caa7438b8dcf6055a122cd8e 0 (*) {'user': 'test'} (glob)
@@ -1,1175 +1,1180 b''
1 #require git
1 #require git
2
2
3 make git commits repeatable
3 make git commits repeatable
4
4
5 $ cat >> $HGRCPATH <<EOF
6 > [defaults]
7 > commit = -d "0 0"
8 > EOF
9
5 $ echo "[core]" >> $HOME/.gitconfig
10 $ echo "[core]" >> $HOME/.gitconfig
6 $ echo "autocrlf = false" >> $HOME/.gitconfig
11 $ echo "autocrlf = false" >> $HOME/.gitconfig
7 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
12 $ GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME
8 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
13 $ GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL
9 $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE
14 $ GIT_AUTHOR_DATE='1234567891 +0000'; export GIT_AUTHOR_DATE
10 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
15 $ GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME
11 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
16 $ GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL
12 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
17 $ GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE
13 $ GIT_CONFIG_NOSYSTEM=1; export GIT_CONFIG_NOSYSTEM
18 $ GIT_CONFIG_NOSYSTEM=1; export GIT_CONFIG_NOSYSTEM
14
19
15 root hg repo
20 root hg repo
16
21
17 $ hg init t
22 $ hg init t
18 $ cd t
23 $ cd t
19 $ echo a > a
24 $ echo a > a
20 $ hg add a
25 $ hg add a
21 $ hg commit -m a
26 $ hg commit -m a
22 $ cd ..
27 $ cd ..
23
28
24 new external git repo
29 new external git repo
25
30
26 $ mkdir gitroot
31 $ mkdir gitroot
27 $ cd gitroot
32 $ cd gitroot
28 $ git init -q
33 $ git init -q
29 $ echo g > g
34 $ echo g > g
30 $ git add g
35 $ git add g
31 $ git commit -q -m g
36 $ git commit -q -m g
32
37
33 add subrepo clone
38 add subrepo clone
34
39
35 $ cd ../t
40 $ cd ../t
36 $ echo 's = [git]../gitroot' > .hgsub
41 $ echo 's = [git]../gitroot' > .hgsub
37 $ git clone -q ../gitroot s
42 $ git clone -q ../gitroot s
38 $ hg add .hgsub
43 $ hg add .hgsub
39 $ hg commit -m 'new git subrepo'
44 $ hg commit -m 'new git subrepo'
40 $ hg debugsub
45 $ hg debugsub
41 path s
46 path s
42 source ../gitroot
47 source ../gitroot
43 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
48 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
44
49
45 record a new commit from upstream from a different branch
50 record a new commit from upstream from a different branch
46
51
47 $ cd ../gitroot
52 $ cd ../gitroot
48 $ git checkout -q -b testing
53 $ git checkout -q -b testing
49 $ echo gg >> g
54 $ echo gg >> g
50 $ git commit -q -a -m gg
55 $ git commit -q -a -m gg
51
56
52 $ cd ../t/s
57 $ cd ../t/s
53 $ git pull -q >/dev/null 2>/dev/null
58 $ git pull -q >/dev/null 2>/dev/null
54 $ git checkout -q -b testing origin/testing >/dev/null
59 $ git checkout -q -b testing origin/testing >/dev/null
55
60
56 $ cd ..
61 $ cd ..
57 $ hg status --subrepos
62 $ hg status --subrepos
58 M s/g
63 M s/g
59 $ hg commit -m 'update git subrepo'
64 $ hg commit -m 'update git subrepo'
60 $ hg debugsub
65 $ hg debugsub
61 path s
66 path s
62 source ../gitroot
67 source ../gitroot
63 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
68 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
64
69
65 make $GITROOT pushable, by replacing it with a clone with nothing checked out
70 make $GITROOT pushable, by replacing it with a clone with nothing checked out
66
71
67 $ cd ..
72 $ cd ..
68 $ git clone gitroot gitrootbare --bare -q
73 $ git clone gitroot gitrootbare --bare -q
69 $ rm -rf gitroot
74 $ rm -rf gitroot
70 $ mv gitrootbare gitroot
75 $ mv gitrootbare gitroot
71
76
72 clone root
77 clone root
73
78
74 $ cd t
79 $ cd t
75 $ hg clone . ../tc 2> /dev/null
80 $ hg clone . ../tc 2> /dev/null
76 updating to branch default
81 updating to branch default
77 cloning subrepo s from $TESTTMP/gitroot
82 cloning subrepo s from $TESTTMP/gitroot
78 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 $ cd ../tc
84 $ cd ../tc
80 $ hg debugsub
85 $ hg debugsub
81 path s
86 path s
82 source ../gitroot
87 source ../gitroot
83 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
88 revision 126f2a14290cd5ce061fdedc430170e8d39e1c5a
84
89
85 update to previous substate
90 update to previous substate
86
91
87 $ hg update 1 -q
92 $ hg update 1 -q
88 $ cat s/g
93 $ cat s/g
89 g
94 g
90 $ hg debugsub
95 $ hg debugsub
91 path s
96 path s
92 source ../gitroot
97 source ../gitroot
93 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
98 revision da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
94
99
95 clone root, make local change
100 clone root, make local change
96
101
97 $ cd ../t
102 $ cd ../t
98 $ hg clone . ../ta 2> /dev/null
103 $ hg clone . ../ta 2> /dev/null
99 updating to branch default
104 updating to branch default
100 cloning subrepo s from $TESTTMP/gitroot
105 cloning subrepo s from $TESTTMP/gitroot
101 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
102
107
103 $ cd ../ta
108 $ cd ../ta
104 $ echo ggg >> s/g
109 $ echo ggg >> s/g
105 $ hg status --subrepos
110 $ hg status --subrepos
106 M s/g
111 M s/g
107 $ hg diff --subrepos
112 $ hg diff --subrepos
108 diff --git a/s/g b/s/g
113 diff --git a/s/g b/s/g
109 index 089258f..85341ee 100644
114 index 089258f..85341ee 100644
110 --- a/s/g
115 --- a/s/g
111 +++ b/s/g
116 +++ b/s/g
112 @@ -1,2 +1,3 @@
117 @@ -1,2 +1,3 @@
113 g
118 g
114 gg
119 gg
115 +ggg
120 +ggg
116 $ hg commit --subrepos -m ggg
121 $ hg commit --subrepos -m ggg
117 committing subrepository s
122 committing subrepository s
118 $ hg debugsub
123 $ hg debugsub
119 path s
124 path s
120 source ../gitroot
125 source ../gitroot
121 revision 79695940086840c99328513acbe35f90fcd55e57
126 revision 79695940086840c99328513acbe35f90fcd55e57
122
127
123 clone root separately, make different local change
128 clone root separately, make different local change
124
129
125 $ cd ../t
130 $ cd ../t
126 $ hg clone . ../tb 2> /dev/null
131 $ hg clone . ../tb 2> /dev/null
127 updating to branch default
132 updating to branch default
128 cloning subrepo s from $TESTTMP/gitroot
133 cloning subrepo s from $TESTTMP/gitroot
129 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
134 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
130
135
131 $ cd ../tb/s
136 $ cd ../tb/s
132 $ hg status --subrepos
137 $ hg status --subrepos
133 $ echo f > f
138 $ echo f > f
134 $ hg status --subrepos
139 $ hg status --subrepos
135 ? s/f
140 ? s/f
136 $ hg add .
141 $ hg add .
137 adding f
142 adding f
138 $ git add f
143 $ git add f
139 $ cd ..
144 $ cd ..
140
145
141 $ hg status --subrepos
146 $ hg status --subrepos
142 A s/f
147 A s/f
143 $ hg commit --subrepos -m f
148 $ hg commit --subrepos -m f
144 committing subrepository s
149 committing subrepository s
145 $ hg debugsub
150 $ hg debugsub
146 path s
151 path s
147 source ../gitroot
152 source ../gitroot
148 revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
153 revision aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
149
154
150 user b push changes
155 user b push changes
151
156
152 $ hg push 2>/dev/null
157 $ hg push 2>/dev/null
153 pushing to $TESTTMP/t (glob)
158 pushing to $TESTTMP/t (glob)
154 pushing branch testing of subrepo s
159 pushing branch testing of subrepo s
155 searching for changes
160 searching for changes
156 adding changesets
161 adding changesets
157 adding manifests
162 adding manifests
158 adding file changes
163 adding file changes
159 added 1 changesets with 1 changes to 1 files
164 added 1 changesets with 1 changes to 1 files
160
165
161 user a pulls, merges, commits
166 user a pulls, merges, commits
162
167
163 $ cd ../ta
168 $ cd ../ta
164 $ hg pull
169 $ hg pull
165 pulling from $TESTTMP/t (glob)
170 pulling from $TESTTMP/t (glob)
166 searching for changes
171 searching for changes
167 adding changesets
172 adding changesets
168 adding manifests
173 adding manifests
169 adding file changes
174 adding file changes
170 added 1 changesets with 1 changes to 1 files (+1 heads)
175 added 1 changesets with 1 changes to 1 files (+1 heads)
171 (run 'hg heads' to see heads, 'hg merge' to merge)
176 (run 'hg heads' to see heads, 'hg merge' to merge)
172 $ hg merge 2>/dev/null
177 $ hg merge 2>/dev/null
173 subrepository s diverged (local revision: 7969594, remote revision: aa84837)
178 subrepository s diverged (local revision: 7969594, remote revision: aa84837)
174 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
179 (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
175 pulling subrepo s from $TESTTMP/gitroot
180 pulling subrepo s from $TESTTMP/gitroot
176 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
181 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 (branch merge, don't forget to commit)
182 (branch merge, don't forget to commit)
178 $ hg st --subrepos s
183 $ hg st --subrepos s
179 A s/f
184 A s/f
180 $ cat s/f
185 $ cat s/f
181 f
186 f
182 $ cat s/g
187 $ cat s/g
183 g
188 g
184 gg
189 gg
185 ggg
190 ggg
186 $ hg commit --subrepos -m 'merge'
191 $ hg commit --subrepos -m 'merge'
187 committing subrepository s
192 committing subrepository s
188 $ hg status --subrepos --rev 1:5
193 $ hg status --subrepos --rev 1:5
189 M .hgsubstate
194 M .hgsubstate
190 M s/g
195 M s/g
191 A s/f
196 A s/f
192 $ hg debugsub
197 $ hg debugsub
193 path s
198 path s
194 source ../gitroot
199 source ../gitroot
195 revision f47b465e1bce645dbf37232a00574aa1546ca8d3
200 revision f47b465e1bce645dbf37232a00574aa1546ca8d3
196 $ hg push 2>/dev/null
201 $ hg push 2>/dev/null
197 pushing to $TESTTMP/t (glob)
202 pushing to $TESTTMP/t (glob)
198 pushing branch testing of subrepo s
203 pushing branch testing of subrepo s
199 searching for changes
204 searching for changes
200 adding changesets
205 adding changesets
201 adding manifests
206 adding manifests
202 adding file changes
207 adding file changes
203 added 2 changesets with 2 changes to 1 files
208 added 2 changesets with 2 changes to 1 files
204
209
205 make upstream git changes
210 make upstream git changes
206
211
207 $ cd ..
212 $ cd ..
208 $ git clone -q gitroot gitclone
213 $ git clone -q gitroot gitclone
209 $ cd gitclone
214 $ cd gitclone
210 $ echo ff >> f
215 $ echo ff >> f
211 $ git commit -q -a -m ff
216 $ git commit -q -a -m ff
212 $ echo fff >> f
217 $ echo fff >> f
213 $ git commit -q -a -m fff
218 $ git commit -q -a -m fff
214 $ git push origin testing 2>/dev/null
219 $ git push origin testing 2>/dev/null
215
220
216 make and push changes to hg without updating the subrepo
221 make and push changes to hg without updating the subrepo
217
222
218 $ cd ../t
223 $ cd ../t
219 $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
224 $ hg clone . ../td 2>&1 | egrep -v '^Cloning into|^done\.'
220 updating to branch default
225 updating to branch default
221 cloning subrepo s from $TESTTMP/gitroot
226 cloning subrepo s from $TESTTMP/gitroot
222 checking out detached HEAD in subrepo s
227 checking out detached HEAD in subrepo s
223 check out a git branch if you intend to make changes
228 check out a git branch if you intend to make changes
224 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
229 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
225 $ cd ../td
230 $ cd ../td
226 $ echo aa >> a
231 $ echo aa >> a
227 $ hg commit -m aa
232 $ hg commit -m aa
228 $ hg push
233 $ hg push
229 pushing to $TESTTMP/t (glob)
234 pushing to $TESTTMP/t (glob)
230 searching for changes
235 searching for changes
231 adding changesets
236 adding changesets
232 adding manifests
237 adding manifests
233 adding file changes
238 adding file changes
234 added 1 changesets with 1 changes to 1 files
239 added 1 changesets with 1 changes to 1 files
235
240
236 sync to upstream git, distribute changes
241 sync to upstream git, distribute changes
237
242
238 $ cd ../ta
243 $ cd ../ta
239 $ hg pull -u -q
244 $ hg pull -u -q
240 $ cd s
245 $ cd s
241 $ git pull -q >/dev/null 2>/dev/null
246 $ git pull -q >/dev/null 2>/dev/null
242 $ cd ..
247 $ cd ..
243 $ hg commit -m 'git upstream sync'
248 $ hg commit -m 'git upstream sync'
244 $ hg debugsub
249 $ hg debugsub
245 path s
250 path s
246 source ../gitroot
251 source ../gitroot
247 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
252 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
248 $ hg push -q
253 $ hg push -q
249
254
250 $ cd ../tb
255 $ cd ../tb
251 $ hg pull -q
256 $ hg pull -q
252 $ hg update 2>/dev/null
257 $ hg update 2>/dev/null
253 pulling subrepo s from $TESTTMP/gitroot
258 pulling subrepo s from $TESTTMP/gitroot
254 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 $ hg debugsub
260 $ hg debugsub
256 path s
261 path s
257 source ../gitroot
262 source ../gitroot
258 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
263 revision 32a343883b74769118bb1d3b4b1fbf9156f4dddc
259
264
260 create a new git branch
265 create a new git branch
261
266
262 $ cd s
267 $ cd s
263 $ git checkout -b b2
268 $ git checkout -b b2
264 Switched to a new branch 'b2'
269 Switched to a new branch 'b2'
265 $ echo a>a
270 $ echo a>a
266 $ git add a
271 $ git add a
267 $ git commit -qm 'add a'
272 $ git commit -qm 'add a'
268 $ cd ..
273 $ cd ..
269 $ hg commit -m 'add branch in s'
274 $ hg commit -m 'add branch in s'
270
275
271 pulling new git branch should not create tracking branch named 'origin/b2'
276 pulling new git branch should not create tracking branch named 'origin/b2'
272 (issue3870)
277 (issue3870)
273 $ cd ../td/s
278 $ cd ../td/s
274 $ git remote set-url origin $TESTTMP/tb/s
279 $ git remote set-url origin $TESTTMP/tb/s
275 $ git branch --no-track oldtesting
280 $ git branch --no-track oldtesting
276 $ cd ..
281 $ cd ..
277 $ hg pull -q ../tb
282 $ hg pull -q ../tb
278 $ hg up
283 $ hg up
279 From $TESTTMP/tb/s
284 From $TESTTMP/tb/s
280 * [new branch] b2 -> origin/b2
285 * [new branch] b2 -> origin/b2
281 Previous HEAD position was f47b465... merge
286 Previous HEAD position was f47b465... merge
282 Switched to a new branch 'b2'
287 Switched to a new branch 'b2'
283 pulling subrepo s from $TESTTMP/tb/s
288 pulling subrepo s from $TESTTMP/tb/s
284 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
289 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
285
290
286 update to a revision without the subrepo, keeping the local git repository
291 update to a revision without the subrepo, keeping the local git repository
287
292
288 $ cd ../t
293 $ cd ../t
289 $ hg up 0
294 $ hg up 0
290 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
295 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
291 $ ls -a s
296 $ ls -a s
292 .
297 .
293 ..
298 ..
294 .git
299 .git
295
300
296 $ hg up 2
301 $ hg up 2
297 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
302 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
298 $ ls -a s
303 $ ls -a s
299 .
304 .
300 ..
305 ..
301 .git
306 .git
302 g
307 g
303
308
304 archive subrepos
309 archive subrepos
305
310
306 $ cd ../tc
311 $ cd ../tc
307 $ hg pull -q
312 $ hg pull -q
308 $ hg archive --subrepos -r 5 ../archive 2>/dev/null
313 $ hg archive --subrepos -r 5 ../archive 2>/dev/null
309 pulling subrepo s from $TESTTMP/gitroot
314 pulling subrepo s from $TESTTMP/gitroot
310 $ cd ../archive
315 $ cd ../archive
311 $ cat s/f
316 $ cat s/f
312 f
317 f
313 $ cat s/g
318 $ cat s/g
314 g
319 g
315 gg
320 gg
316 ggg
321 ggg
317
322
318 $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null
323 $ hg -R ../tc archive --subrepo -r 5 -X ../tc/**f ../archive_x 2>/dev/null
319 $ find ../archive_x | sort | grep -v pax_global_header
324 $ find ../archive_x | sort | grep -v pax_global_header
320 ../archive_x
325 ../archive_x
321 ../archive_x/.hg_archival.txt
326 ../archive_x/.hg_archival.txt
322 ../archive_x/.hgsub
327 ../archive_x/.hgsub
323 ../archive_x/.hgsubstate
328 ../archive_x/.hgsubstate
324 ../archive_x/a
329 ../archive_x/a
325 ../archive_x/s
330 ../archive_x/s
326 ../archive_x/s/g
331 ../archive_x/s/g
327
332
328 $ hg -R ../tc archive -S ../archive.tgz --prefix '.' 2>/dev/null
333 $ hg -R ../tc archive -S ../archive.tgz --prefix '.' 2>/dev/null
329 $ tar -tzf ../archive.tgz | sort | grep -v pax_global_header
334 $ tar -tzf ../archive.tgz | sort | grep -v pax_global_header
330 .hg_archival.txt
335 .hg_archival.txt
331 .hgsub
336 .hgsub
332 .hgsubstate
337 .hgsubstate
333 a
338 a
334 s/g
339 s/g
335
340
336 create nested repo
341 create nested repo
337
342
338 $ cd ..
343 $ cd ..
339 $ hg init outer
344 $ hg init outer
340 $ cd outer
345 $ cd outer
341 $ echo b>b
346 $ echo b>b
342 $ hg add b
347 $ hg add b
343 $ hg commit -m b
348 $ hg commit -m b
344
349
345 $ hg clone ../t inner 2> /dev/null
350 $ hg clone ../t inner 2> /dev/null
346 updating to branch default
351 updating to branch default
347 cloning subrepo s from $TESTTMP/gitroot
352 cloning subrepo s from $TESTTMP/gitroot
348 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
353 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
349 $ echo inner = inner > .hgsub
354 $ echo inner = inner > .hgsub
350 $ hg add .hgsub
355 $ hg add .hgsub
351 $ hg commit -m 'nested sub'
356 $ hg commit -m 'nested sub'
352
357
353 nested commit
358 nested commit
354
359
355 $ echo ffff >> inner/s/f
360 $ echo ffff >> inner/s/f
356 $ hg status --subrepos
361 $ hg status --subrepos
357 M inner/s/f
362 M inner/s/f
358 $ hg commit --subrepos -m nested
363 $ hg commit --subrepos -m nested
359 committing subrepository inner
364 committing subrepository inner
360 committing subrepository inner/s (glob)
365 committing subrepository inner/s (glob)
361
366
362 nested archive
367 nested archive
363
368
364 $ hg archive --subrepos ../narchive
369 $ hg archive --subrepos ../narchive
365 $ ls ../narchive/inner/s | grep -v pax_global_header
370 $ ls ../narchive/inner/s | grep -v pax_global_header
366 f
371 f
367 g
372 g
368
373
369 relative source expansion
374 relative source expansion
370
375
371 $ cd ..
376 $ cd ..
372 $ mkdir d
377 $ mkdir d
373 $ hg clone t d/t 2> /dev/null
378 $ hg clone t d/t 2> /dev/null
374 updating to branch default
379 updating to branch default
375 cloning subrepo s from $TESTTMP/gitroot
380 cloning subrepo s from $TESTTMP/gitroot
376 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
381 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
377
382
378 Don't crash if the subrepo is missing
383 Don't crash if the subrepo is missing
379
384
380 $ hg clone t missing -q
385 $ hg clone t missing -q
381 $ cd missing
386 $ cd missing
382 $ rm -rf s
387 $ rm -rf s
383 $ hg status -S
388 $ hg status -S
384 $ hg sum | grep commit
389 $ hg sum | grep commit
385 commit: 1 subrepos
390 commit: 1 subrepos
386 $ hg push -q
391 $ hg push -q
387 abort: subrepo s is missing (in subrepo s)
392 abort: subrepo s is missing (in subrepo s)
388 [255]
393 [255]
389 $ hg commit --subrepos -qm missing
394 $ hg commit --subrepos -qm missing
390 abort: subrepo s is missing (in subrepo s)
395 abort: subrepo s is missing (in subrepo s)
391 [255]
396 [255]
392
397
393 #if symlink
398 #if symlink
394 Don't crash if subrepo is a broken symlink
399 Don't crash if subrepo is a broken symlink
395 $ ln -s broken s
400 $ ln -s broken s
396 $ hg status -S
401 $ hg status -S
397 $ hg push -q
402 $ hg push -q
398 abort: subrepo s is missing (in subrepo s)
403 abort: subrepo s is missing (in subrepo s)
399 [255]
404 [255]
400 $ hg commit --subrepos -qm missing
405 $ hg commit --subrepos -qm missing
401 abort: subrepo s is missing (in subrepo s)
406 abort: subrepo s is missing (in subrepo s)
402 [255]
407 [255]
403 $ rm s
408 $ rm s
404 #endif
409 #endif
405
410
406 $ hg update -C 2> /dev/null
411 $ hg update -C 2> /dev/null
407 cloning subrepo s from $TESTTMP/gitroot
412 cloning subrepo s from $TESTTMP/gitroot
408 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
413 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
409 $ hg sum | grep commit
414 $ hg sum | grep commit
410 commit: (clean)
415 commit: (clean)
411
416
412 Don't crash if the .hgsubstate entry is missing
417 Don't crash if the .hgsubstate entry is missing
413
418
414 $ hg update 1 -q
419 $ hg update 1 -q
415 $ hg rm .hgsubstate
420 $ hg rm .hgsubstate
416 $ hg commit .hgsubstate -m 'no substate'
421 $ hg commit .hgsubstate -m 'no substate'
417 nothing changed
422 nothing changed
418 [1]
423 [1]
419 $ hg tag -l nosubstate
424 $ hg tag -l nosubstate
420 $ hg manifest
425 $ hg manifest
421 .hgsub
426 .hgsub
422 .hgsubstate
427 .hgsubstate
423 a
428 a
424
429
425 $ hg status -S
430 $ hg status -S
426 R .hgsubstate
431 R .hgsubstate
427 $ hg sum | grep commit
432 $ hg sum | grep commit
428 commit: 1 removed, 1 subrepos (new branch head)
433 commit: 1 removed, 1 subrepos (new branch head)
429
434
430 $ hg commit -m 'restore substate'
435 $ hg commit -m 'restore substate'
431 nothing changed
436 nothing changed
432 [1]
437 [1]
433 $ hg manifest
438 $ hg manifest
434 .hgsub
439 .hgsub
435 .hgsubstate
440 .hgsubstate
436 a
441 a
437 $ hg sum | grep commit
442 $ hg sum | grep commit
438 commit: 1 removed, 1 subrepos (new branch head)
443 commit: 1 removed, 1 subrepos (new branch head)
439
444
440 $ hg update -qC nosubstate
445 $ hg update -qC nosubstate
441 $ ls s
446 $ ls s
442 g
447 g
443
448
444 issue3109: false positives in git diff-index
449 issue3109: false positives in git diff-index
445
450
446 $ hg update -q
451 $ hg update -q
447 $ touch -t 200001010000 s/g
452 $ touch -t 200001010000 s/g
448 $ hg status --subrepos
453 $ hg status --subrepos
449 $ touch -t 200001010000 s/g
454 $ touch -t 200001010000 s/g
450 $ hg sum | grep commit
455 $ hg sum | grep commit
451 commit: (clean)
456 commit: (clean)
452
457
453 Check hg update --clean
458 Check hg update --clean
454 $ cd $TESTTMP/ta
459 $ cd $TESTTMP/ta
455 $ echo > s/g
460 $ echo > s/g
456 $ cd s
461 $ cd s
457 $ echo c1 > f1
462 $ echo c1 > f1
458 $ echo c1 > f2
463 $ echo c1 > f2
459 $ git add f1
464 $ git add f1
460 $ cd ..
465 $ cd ..
461 $ hg status -S
466 $ hg status -S
462 M s/g
467 M s/g
463 A s/f1
468 A s/f1
464 ? s/f2
469 ? s/f2
465 $ ls s
470 $ ls s
466 f
471 f
467 f1
472 f1
468 f2
473 f2
469 g
474 g
470 $ hg update --clean
475 $ hg update --clean
471 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
476 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
472 $ hg status -S
477 $ hg status -S
473 ? s/f1
478 ? s/f1
474 ? s/f2
479 ? s/f2
475 $ ls s
480 $ ls s
476 f
481 f
477 f1
482 f1
478 f2
483 f2
479 g
484 g
480
485
481 Sticky subrepositories, no changes
486 Sticky subrepositories, no changes
482 $ cd $TESTTMP/ta
487 $ cd $TESTTMP/ta
483 $ hg id -n
488 $ hg id -n
484 7
489 7
485 $ cd s
490 $ cd s
486 $ git rev-parse HEAD
491 $ git rev-parse HEAD
487 32a343883b74769118bb1d3b4b1fbf9156f4dddc
492 32a343883b74769118bb1d3b4b1fbf9156f4dddc
488 $ cd ..
493 $ cd ..
489 $ hg update 1 > /dev/null 2>&1
494 $ hg update 1 > /dev/null 2>&1
490 $ hg id -n
495 $ hg id -n
491 1
496 1
492 $ cd s
497 $ cd s
493 $ git rev-parse HEAD
498 $ git rev-parse HEAD
494 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
499 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
495 $ cd ..
500 $ cd ..
496
501
497 Sticky subrepositories, file changes
502 Sticky subrepositories, file changes
498 $ touch s/f1
503 $ touch s/f1
499 $ cd s
504 $ cd s
500 $ git add f1
505 $ git add f1
501 $ cd ..
506 $ cd ..
502 $ hg id -n
507 $ hg id -n
503 1+
508 1+
504 $ cd s
509 $ cd s
505 $ git rev-parse HEAD
510 $ git rev-parse HEAD
506 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
511 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
507 $ cd ..
512 $ cd ..
508 $ hg update 4
513 $ hg update 4
509 subrepository s diverged (local revision: da5f5b1, remote revision: aa84837)
514 subrepository s diverged (local revision: da5f5b1, remote revision: aa84837)
510 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
515 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
511 subrepository sources for s differ
516 subrepository sources for s differ
512 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l
517 use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l
513 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
518 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
514 $ hg id -n
519 $ hg id -n
515 4+
520 4+
516 $ cd s
521 $ cd s
517 $ git rev-parse HEAD
522 $ git rev-parse HEAD
518 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
523 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
519 $ cd ..
524 $ cd ..
520 $ hg update --clean tip > /dev/null 2>&1
525 $ hg update --clean tip > /dev/null 2>&1
521
526
522 Sticky subrepository, revision updates
527 Sticky subrepository, revision updates
523 $ hg id -n
528 $ hg id -n
524 7
529 7
525 $ cd s
530 $ cd s
526 $ git rev-parse HEAD
531 $ git rev-parse HEAD
527 32a343883b74769118bb1d3b4b1fbf9156f4dddc
532 32a343883b74769118bb1d3b4b1fbf9156f4dddc
528 $ cd ..
533 $ cd ..
529 $ cd s
534 $ cd s
530 $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
535 $ git checkout aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
531 Previous HEAD position was 32a3438... fff
536 Previous HEAD position was 32a3438... fff
532 HEAD is now at aa84837... f
537 HEAD is now at aa84837... f
533 $ cd ..
538 $ cd ..
534 $ hg update 1
539 $ hg update 1
535 subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1)
540 subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1)
536 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
541 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
537 subrepository sources for s differ (in checked out version)
542 subrepository sources for s differ (in checked out version)
538 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l
543 use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l
539 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
540 $ hg id -n
545 $ hg id -n
541 1+
546 1+
542 $ cd s
547 $ cd s
543 $ git rev-parse HEAD
548 $ git rev-parse HEAD
544 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
549 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
545 $ cd ..
550 $ cd ..
546
551
547 Sticky subrepository, file changes and revision updates
552 Sticky subrepository, file changes and revision updates
548 $ touch s/f1
553 $ touch s/f1
549 $ cd s
554 $ cd s
550 $ git add f1
555 $ git add f1
551 $ git rev-parse HEAD
556 $ git rev-parse HEAD
552 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
557 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
553 $ cd ..
558 $ cd ..
554 $ hg id -n
559 $ hg id -n
555 1+
560 1+
556 $ hg update 7
561 $ hg update 7
557 subrepository s diverged (local revision: 32a3438, remote revision: 32a3438)
562 subrepository s diverged (local revision: 32a3438, remote revision: 32a3438)
558 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
563 (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
559 subrepository sources for s differ
564 subrepository sources for s differ
560 use (l)ocal source (32a3438) or (r)emote source (32a3438)? l
565 use (l)ocal source (32a3438) or (r)emote source (32a3438)? l
561 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
566 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
562 $ hg id -n
567 $ hg id -n
563 7+
568 7+
564 $ cd s
569 $ cd s
565 $ git rev-parse HEAD
570 $ git rev-parse HEAD
566 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
571 aa84837ccfbdfedcdcdeeedc309d73e6eb069edc
567 $ cd ..
572 $ cd ..
568
573
569 Sticky repository, update --clean
574 Sticky repository, update --clean
570 $ hg update --clean tip 2>/dev/null
575 $ hg update --clean tip 2>/dev/null
571 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
576 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
572 $ hg id -n
577 $ hg id -n
573 7
578 7
574 $ cd s
579 $ cd s
575 $ git rev-parse HEAD
580 $ git rev-parse HEAD
576 32a343883b74769118bb1d3b4b1fbf9156f4dddc
581 32a343883b74769118bb1d3b4b1fbf9156f4dddc
577 $ cd ..
582 $ cd ..
578
583
579 Test subrepo already at intended revision:
584 Test subrepo already at intended revision:
580 $ cd s
585 $ cd s
581 $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc
586 $ git checkout 32a343883b74769118bb1d3b4b1fbf9156f4dddc
582 HEAD is now at 32a3438... fff
587 HEAD is now at 32a3438... fff
583 $ cd ..
588 $ cd ..
584 $ hg update 1
589 $ hg update 1
585 Previous HEAD position was 32a3438... fff
590 Previous HEAD position was 32a3438... fff
586 HEAD is now at da5f5b1... g
591 HEAD is now at da5f5b1... g
587 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
592 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
588 $ hg id -n
593 $ hg id -n
589 1
594 1
590 $ cd s
595 $ cd s
591 $ git rev-parse HEAD
596 $ git rev-parse HEAD
592 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
597 da5f5b1d8ffcf62fb8327bcd3c89a4367a6018e7
593 $ cd ..
598 $ cd ..
594
599
595 Test forgetting files, not implemented in git subrepo, used to
600 Test forgetting files, not implemented in git subrepo, used to
596 traceback
601 traceback
597 #if no-windows
602 #if no-windows
598 $ hg forget 'notafile*'
603 $ hg forget 'notafile*'
599 notafile*: No such file or directory
604 notafile*: No such file or directory
600 [1]
605 [1]
601 #else
606 #else
602 $ hg forget 'notafile'
607 $ hg forget 'notafile'
603 notafile: * (glob)
608 notafile: * (glob)
604 [1]
609 [1]
605 #endif
610 #endif
606
611
607 $ cd ..
612 $ cd ..
608
613
609 Test sanitizing ".hg/hgrc" in subrepo
614 Test sanitizing ".hg/hgrc" in subrepo
610
615
611 $ cd t
616 $ cd t
612 $ hg tip -q
617 $ hg tip -q
613 7:af6d2edbb0d3
618 7:af6d2edbb0d3
614 $ hg update -q -C af6d2edbb0d3
619 $ hg update -q -C af6d2edbb0d3
615 $ cd s
620 $ cd s
616 $ git checkout -q -b sanitize-test
621 $ git checkout -q -b sanitize-test
617 $ mkdir .hg
622 $ mkdir .hg
618 $ echo '.hg/hgrc in git repo' > .hg/hgrc
623 $ echo '.hg/hgrc in git repo' > .hg/hgrc
619 $ mkdir -p sub/.hg
624 $ mkdir -p sub/.hg
620 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
625 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
621 $ git add .hg sub
626 $ git add .hg sub
622 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update'
627 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update'
623 $ git push -q origin sanitize-test
628 $ git push -q origin sanitize-test
624 $ cd ..
629 $ cd ..
625 $ grep ' s$' .hgsubstate
630 $ grep ' s$' .hgsubstate
626 32a343883b74769118bb1d3b4b1fbf9156f4dddc s
631 32a343883b74769118bb1d3b4b1fbf9156f4dddc s
627 $ hg commit -qm 'commit with git revision including .hg/hgrc'
632 $ hg commit -qm 'commit with git revision including .hg/hgrc'
628 $ hg parents -q
633 $ hg parents -q
629 8:3473d20bddcf
634 8:3473d20bddcf
630 $ grep ' s$' .hgsubstate
635 $ grep ' s$' .hgsubstate
631 c4069473b459cf27fd4d7c2f50c4346b4e936599 s
636 c4069473b459cf27fd4d7c2f50c4346b4e936599 s
632 $ cd ..
637 $ cd ..
633
638
634 $ hg -R tc pull -q
639 $ hg -R tc pull -q
635 $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort
640 $ hg -R tc update -q -C 3473d20bddcf 2>&1 | sort
636 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
641 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
637 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
642 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
638 $ cd tc
643 $ cd tc
639 $ hg parents -q
644 $ hg parents -q
640 8:3473d20bddcf
645 8:3473d20bddcf
641 $ grep ' s$' .hgsubstate
646 $ grep ' s$' .hgsubstate
642 c4069473b459cf27fd4d7c2f50c4346b4e936599 s
647 c4069473b459cf27fd4d7c2f50c4346b4e936599 s
643 $ test -f s/.hg/hgrc
648 $ test -f s/.hg/hgrc
644 [1]
649 [1]
645 $ test -f s/sub/.hg/hgrc
650 $ test -f s/sub/.hg/hgrc
646 [1]
651 [1]
647 $ cd ..
652 $ cd ..
648
653
649 additional test for "git merge --ff" route:
654 additional test for "git merge --ff" route:
650
655
651 $ cd t
656 $ cd t
652 $ hg tip -q
657 $ hg tip -q
653 8:3473d20bddcf
658 8:3473d20bddcf
654 $ hg update -q -C af6d2edbb0d3
659 $ hg update -q -C af6d2edbb0d3
655 $ cd s
660 $ cd s
656 $ git checkout -q testing
661 $ git checkout -q testing
657 $ mkdir .hg
662 $ mkdir .hg
658 $ echo '.hg/hgrc in git repo' > .hg/hgrc
663 $ echo '.hg/hgrc in git repo' > .hg/hgrc
659 $ mkdir -p sub/.hg
664 $ mkdir -p sub/.hg
660 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
665 $ echo 'sub/.hg/hgrc in git repo' > sub/.hg/hgrc
661 $ git add .hg sub
666 $ git add .hg sub
662 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)'
667 $ git commit -qm 'add .hg/hgrc to be sanitized at hg update (git merge --ff)'
663 $ git push -q origin testing
668 $ git push -q origin testing
664 $ cd ..
669 $ cd ..
665 $ grep ' s$' .hgsubstate
670 $ grep ' s$' .hgsubstate
666 32a343883b74769118bb1d3b4b1fbf9156f4dddc s
671 32a343883b74769118bb1d3b4b1fbf9156f4dddc s
667 $ hg commit -qm 'commit with git revision including .hg/hgrc'
672 $ hg commit -qm 'commit with git revision including .hg/hgrc'
668 $ hg parents -q
673 $ hg parents -q
669 9:ed23f7fe024e
674 9:ed23f7fe024e
670 $ grep ' s$' .hgsubstate
675 $ grep ' s$' .hgsubstate
671 f262643c1077219fbd3858d54e78ef050ef84fbf s
676 f262643c1077219fbd3858d54e78ef050ef84fbf s
672 $ cd ..
677 $ cd ..
673
678
674 $ cd tc
679 $ cd tc
675 $ hg update -q -C af6d2edbb0d3
680 $ hg update -q -C af6d2edbb0d3
676 $ test -f s/.hg/hgrc
681 $ test -f s/.hg/hgrc
677 [1]
682 [1]
678 $ test -f s/sub/.hg/hgrc
683 $ test -f s/sub/.hg/hgrc
679 [1]
684 [1]
680 $ cd ..
685 $ cd ..
681 $ hg -R tc pull -q
686 $ hg -R tc pull -q
682 $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort
687 $ hg -R tc update -q -C ed23f7fe024e 2>&1 | sort
683 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
688 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/.hg' (glob)
684 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
689 warning: removing potentially hostile 'hgrc' in '$TESTTMP/tc/s/sub/.hg' (glob)
685 $ cd tc
690 $ cd tc
686 $ hg parents -q
691 $ hg parents -q
687 9:ed23f7fe024e
692 9:ed23f7fe024e
688 $ grep ' s$' .hgsubstate
693 $ grep ' s$' .hgsubstate
689 f262643c1077219fbd3858d54e78ef050ef84fbf s
694 f262643c1077219fbd3858d54e78ef050ef84fbf s
690 $ test -f s/.hg/hgrc
695 $ test -f s/.hg/hgrc
691 [1]
696 [1]
692 $ test -f s/sub/.hg/hgrc
697 $ test -f s/sub/.hg/hgrc
693 [1]
698 [1]
694
699
695 Test that sanitizing is omitted in meta data area:
700 Test that sanitizing is omitted in meta data area:
696
701
697 $ mkdir s/.git/.hg
702 $ mkdir s/.git/.hg
698 $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc
703 $ echo '.hg/hgrc in git metadata area' > s/.git/.hg/hgrc
699 $ hg update -q -C af6d2edbb0d3
704 $ hg update -q -C af6d2edbb0d3
700 checking out detached HEAD in subrepo s
705 checking out detached HEAD in subrepo s
701 check out a git branch if you intend to make changes
706 check out a git branch if you intend to make changes
702
707
703 check differences made by most recent change
708 check differences made by most recent change
704 $ cd s
709 $ cd s
705 $ cat > foobar << EOF
710 $ cat > foobar << EOF
706 > woopwoop
711 > woopwoop
707 >
712 >
708 > foo
713 > foo
709 > bar
714 > bar
710 > EOF
715 > EOF
711 $ git add foobar
716 $ git add foobar
712 $ cd ..
717 $ cd ..
713
718
714 $ hg diff --subrepos
719 $ hg diff --subrepos
715 diff --git a/s/foobar b/s/foobar
720 diff --git a/s/foobar b/s/foobar
716 new file mode 100644
721 new file mode 100644
717 index 0000000..8a5a5e2
722 index 0000000..8a5a5e2
718 --- /dev/null
723 --- /dev/null
719 +++ b/s/foobar
724 +++ b/s/foobar
720 @@ -0,0 +1,4 @@
725 @@ -0,0 +1,4 @@
721 +woopwoop
726 +woopwoop
722 +
727 +
723 +foo
728 +foo
724 +bar
729 +bar
725
730
726 $ hg commit --subrepos -m "Added foobar"
731 $ hg commit --subrepos -m "Added foobar"
727 committing subrepository s
732 committing subrepository s
728 created new head
733 created new head
729
734
730 $ hg diff -c . --subrepos --nodates
735 $ hg diff -c . --subrepos --nodates
731 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
736 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
732 --- a/.hgsubstate
737 --- a/.hgsubstate
733 +++ b/.hgsubstate
738 +++ b/.hgsubstate
734 @@ -1,1 +1,1 @@
739 @@ -1,1 +1,1 @@
735 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
740 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
736 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
741 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
737 diff --git a/s/foobar b/s/foobar
742 diff --git a/s/foobar b/s/foobar
738 new file mode 100644
743 new file mode 100644
739 index 0000000..8a5a5e2
744 index 0000000..8a5a5e2
740 --- /dev/null
745 --- /dev/null
741 +++ b/s/foobar
746 +++ b/s/foobar
742 @@ -0,0 +1,4 @@
747 @@ -0,0 +1,4 @@
743 +woopwoop
748 +woopwoop
744 +
749 +
745 +foo
750 +foo
746 +bar
751 +bar
747
752
748 check output when only diffing the subrepository
753 check output when only diffing the subrepository
749 $ hg diff -c . --subrepos s
754 $ hg diff -c . --subrepos s
750 diff --git a/s/foobar b/s/foobar
755 diff --git a/s/foobar b/s/foobar
751 new file mode 100644
756 new file mode 100644
752 index 0000000..8a5a5e2
757 index 0000000..8a5a5e2
753 --- /dev/null
758 --- /dev/null
754 +++ b/s/foobar
759 +++ b/s/foobar
755 @@ -0,0 +1,4 @@
760 @@ -0,0 +1,4 @@
756 +woopwoop
761 +woopwoop
757 +
762 +
758 +foo
763 +foo
759 +bar
764 +bar
760
765
761 check output when diffing something else
766 check output when diffing something else
762 $ hg diff -c . --subrepos .hgsubstate --nodates
767 $ hg diff -c . --subrepos .hgsubstate --nodates
763 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
768 diff -r af6d2edbb0d3 -r 255ee8cf690e .hgsubstate
764 --- a/.hgsubstate
769 --- a/.hgsubstate
765 +++ b/.hgsubstate
770 +++ b/.hgsubstate
766 @@ -1,1 +1,1 @@
771 @@ -1,1 +1,1 @@
767 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
772 -32a343883b74769118bb1d3b4b1fbf9156f4dddc s
768 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
773 +fd4dbf828a5b2fcd36b2bcf21ea773820970d129 s
769
774
770 add new changes, including whitespace
775 add new changes, including whitespace
771 $ cd s
776 $ cd s
772 $ cat > foobar << EOF
777 $ cat > foobar << EOF
773 > woop woop
778 > woop woop
774 >
779 >
775 > foo
780 > foo
776 > bar
781 > bar
777 > EOF
782 > EOF
778 $ echo foo > barfoo
783 $ echo foo > barfoo
779 $ git add barfoo
784 $ git add barfoo
780 $ cd ..
785 $ cd ..
781
786
782 $ hg diff --subrepos --ignore-all-space
787 $ hg diff --subrepos --ignore-all-space
783 diff --git a/s/barfoo b/s/barfoo
788 diff --git a/s/barfoo b/s/barfoo
784 new file mode 100644
789 new file mode 100644
785 index 0000000..257cc56
790 index 0000000..257cc56
786 --- /dev/null
791 --- /dev/null
787 +++ b/s/barfoo
792 +++ b/s/barfoo
788 @@ -0,0 +1* @@ (glob)
793 @@ -0,0 +1* @@ (glob)
789 +foo
794 +foo
790 $ hg diff --subrepos s/foobar
795 $ hg diff --subrepos s/foobar
791 diff --git a/s/foobar b/s/foobar
796 diff --git a/s/foobar b/s/foobar
792 index 8a5a5e2..bd5812a 100644
797 index 8a5a5e2..bd5812a 100644
793 --- a/s/foobar
798 --- a/s/foobar
794 +++ b/s/foobar
799 +++ b/s/foobar
795 @@ -1,4 +1,4 @@
800 @@ -1,4 +1,4 @@
796 -woopwoop
801 -woopwoop
797 +woop woop
802 +woop woop
798
803
799 foo
804 foo
800 bar
805 bar
801
806
802 execute a diffstat
807 execute a diffstat
803 the output contains a regex, because git 1.7.10 and 1.7.11
808 the output contains a regex, because git 1.7.10 and 1.7.11
804 change the amount of whitespace
809 change the amount of whitespace
805 $ hg diff --subrepos --stat
810 $ hg diff --subrepos --stat
806 \s*barfoo |\s*1 + (re)
811 \s*barfoo |\s*1 + (re)
807 \s*foobar |\s*2 +- (re)
812 \s*foobar |\s*2 +- (re)
808 2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) (re)
813 2 files changed, 2 insertions\(\+\), 1 deletions?\(-\) (re)
809
814
810 adding an include should ignore the other elements
815 adding an include should ignore the other elements
811 $ hg diff --subrepos -I s/foobar
816 $ hg diff --subrepos -I s/foobar
812 diff --git a/s/foobar b/s/foobar
817 diff --git a/s/foobar b/s/foobar
813 index 8a5a5e2..bd5812a 100644
818 index 8a5a5e2..bd5812a 100644
814 --- a/s/foobar
819 --- a/s/foobar
815 +++ b/s/foobar
820 +++ b/s/foobar
816 @@ -1,4 +1,4 @@
821 @@ -1,4 +1,4 @@
817 -woopwoop
822 -woopwoop
818 +woop woop
823 +woop woop
819
824
820 foo
825 foo
821 bar
826 bar
822
827
823 adding an exclude should ignore this element
828 adding an exclude should ignore this element
824 $ hg diff --subrepos -X s/foobar
829 $ hg diff --subrepos -X s/foobar
825 diff --git a/s/barfoo b/s/barfoo
830 diff --git a/s/barfoo b/s/barfoo
826 new file mode 100644
831 new file mode 100644
827 index 0000000..257cc56
832 index 0000000..257cc56
828 --- /dev/null
833 --- /dev/null
829 +++ b/s/barfoo
834 +++ b/s/barfoo
830 @@ -0,0 +1* @@ (glob)
835 @@ -0,0 +1* @@ (glob)
831 +foo
836 +foo
832
837
833 moving a file should show a removal and an add
838 moving a file should show a removal and an add
834 $ hg revert --all
839 $ hg revert --all
835 reverting subrepo ../gitroot
840 reverting subrepo ../gitroot
836 $ cd s
841 $ cd s
837 $ git mv foobar woop
842 $ git mv foobar woop
838 $ cd ..
843 $ cd ..
839 $ hg diff --subrepos
844 $ hg diff --subrepos
840 diff --git a/s/foobar b/s/foobar
845 diff --git a/s/foobar b/s/foobar
841 deleted file mode 100644
846 deleted file mode 100644
842 index 8a5a5e2..0000000
847 index 8a5a5e2..0000000
843 --- a/s/foobar
848 --- a/s/foobar
844 +++ /dev/null
849 +++ /dev/null
845 @@ -1,4 +0,0 @@
850 @@ -1,4 +0,0 @@
846 -woopwoop
851 -woopwoop
847 -
852 -
848 -foo
853 -foo
849 -bar
854 -bar
850 diff --git a/s/woop b/s/woop
855 diff --git a/s/woop b/s/woop
851 new file mode 100644
856 new file mode 100644
852 index 0000000..8a5a5e2
857 index 0000000..8a5a5e2
853 --- /dev/null
858 --- /dev/null
854 +++ b/s/woop
859 +++ b/s/woop
855 @@ -0,0 +1,4 @@
860 @@ -0,0 +1,4 @@
856 +woopwoop
861 +woopwoop
857 +
862 +
858 +foo
863 +foo
859 +bar
864 +bar
860 $ rm s/woop
865 $ rm s/woop
861
866
862 revert the subrepository
867 revert the subrepository
863 $ hg revert --all
868 $ hg revert --all
864 reverting subrepo ../gitroot
869 reverting subrepo ../gitroot
865
870
866 $ hg status --subrepos
871 $ hg status --subrepos
867 ? s/barfoo
872 ? s/barfoo
868 ? s/foobar.orig
873 ? s/foobar.orig
869
874
870 $ mv s/foobar.orig s/foobar
875 $ mv s/foobar.orig s/foobar
871
876
872 $ hg revert --no-backup s
877 $ hg revert --no-backup s
873 reverting subrepo ../gitroot
878 reverting subrepo ../gitroot
874
879
875 $ hg status --subrepos
880 $ hg status --subrepos
876 ? s/barfoo
881 ? s/barfoo
877
882
878 revert moves orig files to the right place
883 revert moves orig files to the right place
879 $ echo 'bloop' > s/foobar
884 $ echo 'bloop' > s/foobar
880 $ hg revert --all --verbose --config 'ui.origbackuppath=.hg/origbackups'
885 $ hg revert --all --verbose --config 'ui.origbackuppath=.hg/origbackups'
881 reverting subrepo ../gitroot
886 reverting subrepo ../gitroot
882 creating directory: $TESTTMP/tc/.hg/origbackups (glob)
887 creating directory: $TESTTMP/tc/.hg/origbackups (glob)
883 saving current version of foobar as $TESTTMP/tc/.hg/origbackups/foobar.orig (glob)
888 saving current version of foobar as $TESTTMP/tc/.hg/origbackups/foobar.orig (glob)
884 $ ls .hg/origbackups
889 $ ls .hg/origbackups
885 foobar.orig
890 foobar.orig
886 $ rm -rf .hg/origbackups
891 $ rm -rf .hg/origbackups
887
892
888 show file at specific revision
893 show file at specific revision
889 $ cat > s/foobar << EOF
894 $ cat > s/foobar << EOF
890 > woop woop
895 > woop woop
891 > fooo bar
896 > fooo bar
892 > EOF
897 > EOF
893 $ hg commit --subrepos -m "updated foobar"
898 $ hg commit --subrepos -m "updated foobar"
894 committing subrepository s
899 committing subrepository s
895 $ cat > s/foobar << EOF
900 $ cat > s/foobar << EOF
896 > current foobar
901 > current foobar
897 > (should not be visible using hg cat)
902 > (should not be visible using hg cat)
898 > EOF
903 > EOF
899
904
900 $ hg cat -r . s/foobar
905 $ hg cat -r . s/foobar
901 woop woop
906 woop woop
902 fooo bar (no-eol)
907 fooo bar (no-eol)
903 $ hg cat -r "parents(.)" s/foobar > catparents
908 $ hg cat -r "parents(.)" s/foobar > catparents
904
909
905 $ mkdir -p tmp/s
910 $ mkdir -p tmp/s
906
911
907 $ hg cat -r "parents(.)" --output tmp/%% s/foobar
912 $ hg cat -r "parents(.)" --output tmp/%% s/foobar
908 $ diff tmp/% catparents
913 $ diff tmp/% catparents
909
914
910 $ hg cat -r "parents(.)" --output tmp/%s s/foobar
915 $ hg cat -r "parents(.)" --output tmp/%s s/foobar
911 $ diff tmp/foobar catparents
916 $ diff tmp/foobar catparents
912
917
913 $ hg cat -r "parents(.)" --output tmp/%d/otherfoobar s/foobar
918 $ hg cat -r "parents(.)" --output tmp/%d/otherfoobar s/foobar
914 $ diff tmp/s/otherfoobar catparents
919 $ diff tmp/s/otherfoobar catparents
915
920
916 $ hg cat -r "parents(.)" --output tmp/%p s/foobar
921 $ hg cat -r "parents(.)" --output tmp/%p s/foobar
917 $ diff tmp/s/foobar catparents
922 $ diff tmp/s/foobar catparents
918
923
919 $ hg cat -r "parents(.)" --output tmp/%H s/foobar
924 $ hg cat -r "parents(.)" --output tmp/%H s/foobar
920 $ diff tmp/255ee8cf690ec86e99b1e80147ea93ece117cd9d catparents
925 $ diff tmp/255ee8cf690ec86e99b1e80147ea93ece117cd9d catparents
921
926
922 $ hg cat -r "parents(.)" --output tmp/%R s/foobar
927 $ hg cat -r "parents(.)" --output tmp/%R s/foobar
923 $ diff tmp/10 catparents
928 $ diff tmp/10 catparents
924
929
925 $ hg cat -r "parents(.)" --output tmp/%h s/foobar
930 $ hg cat -r "parents(.)" --output tmp/%h s/foobar
926 $ diff tmp/255ee8cf690e catparents
931 $ diff tmp/255ee8cf690e catparents
927
932
928 $ rm tmp/10
933 $ rm tmp/10
929 $ hg cat -r "parents(.)" --output tmp/%r s/foobar
934 $ hg cat -r "parents(.)" --output tmp/%r s/foobar
930 $ diff tmp/10 catparents
935 $ diff tmp/10 catparents
931
936
932 $ mkdir tmp/tc
937 $ mkdir tmp/tc
933 $ hg cat -r "parents(.)" --output tmp/%b/foobar s/foobar
938 $ hg cat -r "parents(.)" --output tmp/%b/foobar s/foobar
934 $ diff tmp/tc/foobar catparents
939 $ diff tmp/tc/foobar catparents
935
940
936 cleanup
941 cleanup
937 $ rm -r tmp
942 $ rm -r tmp
938 $ rm catparents
943 $ rm catparents
939
944
940 add git files, using either files or patterns
945 add git files, using either files or patterns
941 $ echo "hsss! hsssssssh!" > s/snake.python
946 $ echo "hsss! hsssssssh!" > s/snake.python
942 $ echo "ccc" > s/c.c
947 $ echo "ccc" > s/c.c
943 $ echo "cpp" > s/cpp.cpp
948 $ echo "cpp" > s/cpp.cpp
944
949
945 $ hg add s/snake.python s/c.c s/cpp.cpp
950 $ hg add s/snake.python s/c.c s/cpp.cpp
946 $ hg st --subrepos s
951 $ hg st --subrepos s
947 M s/foobar
952 M s/foobar
948 A s/c.c
953 A s/c.c
949 A s/cpp.cpp
954 A s/cpp.cpp
950 A s/snake.python
955 A s/snake.python
951 ? s/barfoo
956 ? s/barfoo
952 $ hg revert s
957 $ hg revert s
953 reverting subrepo ../gitroot
958 reverting subrepo ../gitroot
954
959
955 $ hg add --subrepos "glob:**.python"
960 $ hg add --subrepos "glob:**.python"
956 adding s/snake.python (glob)
961 adding s/snake.python (glob)
957 $ hg st --subrepos s
962 $ hg st --subrepos s
958 A s/snake.python
963 A s/snake.python
959 ? s/barfoo
964 ? s/barfoo
960 ? s/c.c
965 ? s/c.c
961 ? s/cpp.cpp
966 ? s/cpp.cpp
962 ? s/foobar.orig
967 ? s/foobar.orig
963 $ hg revert s
968 $ hg revert s
964 reverting subrepo ../gitroot
969 reverting subrepo ../gitroot
965
970
966 $ hg add --subrepos s
971 $ hg add --subrepos s
967 adding s/barfoo (glob)
972 adding s/barfoo (glob)
968 adding s/c.c (glob)
973 adding s/c.c (glob)
969 adding s/cpp.cpp (glob)
974 adding s/cpp.cpp (glob)
970 adding s/foobar.orig (glob)
975 adding s/foobar.orig (glob)
971 adding s/snake.python (glob)
976 adding s/snake.python (glob)
972 $ hg st --subrepos s
977 $ hg st --subrepos s
973 A s/barfoo
978 A s/barfoo
974 A s/c.c
979 A s/c.c
975 A s/cpp.cpp
980 A s/cpp.cpp
976 A s/foobar.orig
981 A s/foobar.orig
977 A s/snake.python
982 A s/snake.python
978 $ hg revert s
983 $ hg revert s
979 reverting subrepo ../gitroot
984 reverting subrepo ../gitroot
980 make sure everything is reverted correctly
985 make sure everything is reverted correctly
981 $ hg st --subrepos s
986 $ hg st --subrepos s
982 ? s/barfoo
987 ? s/barfoo
983 ? s/c.c
988 ? s/c.c
984 ? s/cpp.cpp
989 ? s/cpp.cpp
985 ? s/foobar.orig
990 ? s/foobar.orig
986 ? s/snake.python
991 ? s/snake.python
987
992
988 $ hg add --subrepos --exclude "path:s/c.c"
993 $ hg add --subrepos --exclude "path:s/c.c"
989 adding s/barfoo (glob)
994 adding s/barfoo (glob)
990 adding s/cpp.cpp (glob)
995 adding s/cpp.cpp (glob)
991 adding s/foobar.orig (glob)
996 adding s/foobar.orig (glob)
992 adding s/snake.python (glob)
997 adding s/snake.python (glob)
993 $ hg st --subrepos s
998 $ hg st --subrepos s
994 A s/barfoo
999 A s/barfoo
995 A s/cpp.cpp
1000 A s/cpp.cpp
996 A s/foobar.orig
1001 A s/foobar.orig
997 A s/snake.python
1002 A s/snake.python
998 ? s/c.c
1003 ? s/c.c
999 $ hg revert --all -q
1004 $ hg revert --all -q
1000
1005
1001 .hgignore should not have influence in subrepos
1006 .hgignore should not have influence in subrepos
1002 $ cat > .hgignore << EOF
1007 $ cat > .hgignore << EOF
1003 > syntax: glob
1008 > syntax: glob
1004 > *.python
1009 > *.python
1005 > EOF
1010 > EOF
1006 $ hg add .hgignore
1011 $ hg add .hgignore
1007 $ hg add --subrepos "glob:**.python" s/barfoo
1012 $ hg add --subrepos "glob:**.python" s/barfoo
1008 adding s/snake.python (glob)
1013 adding s/snake.python (glob)
1009 $ hg st --subrepos s
1014 $ hg st --subrepos s
1010 A s/barfoo
1015 A s/barfoo
1011 A s/snake.python
1016 A s/snake.python
1012 ? s/c.c
1017 ? s/c.c
1013 ? s/cpp.cpp
1018 ? s/cpp.cpp
1014 ? s/foobar.orig
1019 ? s/foobar.orig
1015 $ hg revert --all -q
1020 $ hg revert --all -q
1016
1021
1017 .gitignore should have influence,
1022 .gitignore should have influence,
1018 except for explicitly added files (no patterns)
1023 except for explicitly added files (no patterns)
1019 $ cat > s/.gitignore << EOF
1024 $ cat > s/.gitignore << EOF
1020 > *.python
1025 > *.python
1021 > EOF
1026 > EOF
1022 $ hg add s/.gitignore
1027 $ hg add s/.gitignore
1023 $ hg st --subrepos s
1028 $ hg st --subrepos s
1024 A s/.gitignore
1029 A s/.gitignore
1025 ? s/barfoo
1030 ? s/barfoo
1026 ? s/c.c
1031 ? s/c.c
1027 ? s/cpp.cpp
1032 ? s/cpp.cpp
1028 ? s/foobar.orig
1033 ? s/foobar.orig
1029 $ hg st --subrepos s --all
1034 $ hg st --subrepos s --all
1030 A s/.gitignore
1035 A s/.gitignore
1031 ? s/barfoo
1036 ? s/barfoo
1032 ? s/c.c
1037 ? s/c.c
1033 ? s/cpp.cpp
1038 ? s/cpp.cpp
1034 ? s/foobar.orig
1039 ? s/foobar.orig
1035 I s/snake.python
1040 I s/snake.python
1036 C s/f
1041 C s/f
1037 C s/foobar
1042 C s/foobar
1038 C s/g
1043 C s/g
1039 $ hg add --subrepos "glob:**.python"
1044 $ hg add --subrepos "glob:**.python"
1040 $ hg st --subrepos s
1045 $ hg st --subrepos s
1041 A s/.gitignore
1046 A s/.gitignore
1042 ? s/barfoo
1047 ? s/barfoo
1043 ? s/c.c
1048 ? s/c.c
1044 ? s/cpp.cpp
1049 ? s/cpp.cpp
1045 ? s/foobar.orig
1050 ? s/foobar.orig
1046 $ hg add --subrepos s/snake.python
1051 $ hg add --subrepos s/snake.python
1047 $ hg st --subrepos s
1052 $ hg st --subrepos s
1048 A s/.gitignore
1053 A s/.gitignore
1049 A s/snake.python
1054 A s/snake.python
1050 ? s/barfoo
1055 ? s/barfoo
1051 ? s/c.c
1056 ? s/c.c
1052 ? s/cpp.cpp
1057 ? s/cpp.cpp
1053 ? s/foobar.orig
1058 ? s/foobar.orig
1054
1059
1055 correctly do a dry run
1060 correctly do a dry run
1056 $ hg add --subrepos s --dry-run
1061 $ hg add --subrepos s --dry-run
1057 adding s/barfoo (glob)
1062 adding s/barfoo (glob)
1058 adding s/c.c (glob)
1063 adding s/c.c (glob)
1059 adding s/cpp.cpp (glob)
1064 adding s/cpp.cpp (glob)
1060 adding s/foobar.orig (glob)
1065 adding s/foobar.orig (glob)
1061 $ hg st --subrepos s
1066 $ hg st --subrepos s
1062 A s/.gitignore
1067 A s/.gitignore
1063 A s/snake.python
1068 A s/snake.python
1064 ? s/barfoo
1069 ? s/barfoo
1065 ? s/c.c
1070 ? s/c.c
1066 ? s/cpp.cpp
1071 ? s/cpp.cpp
1067 ? s/foobar.orig
1072 ? s/foobar.orig
1068
1073
1069 error given when adding an already tracked file
1074 error given when adding an already tracked file
1070 $ hg add s/.gitignore
1075 $ hg add s/.gitignore
1071 s/.gitignore already tracked!
1076 s/.gitignore already tracked!
1072 [1]
1077 [1]
1073 $ hg add s/g
1078 $ hg add s/g
1074 s/g already tracked!
1079 s/g already tracked!
1075 [1]
1080 [1]
1076
1081
1077 removed files can be re-added
1082 removed files can be re-added
1078 removing files using 'rm' or 'git rm' has the same effect,
1083 removing files using 'rm' or 'git rm' has the same effect,
1079 since we ignore the staging area
1084 since we ignore the staging area
1080 $ hg ci --subrepos -m 'snake'
1085 $ hg ci --subrepos -m 'snake'
1081 committing subrepository s
1086 committing subrepository s
1082 $ cd s
1087 $ cd s
1083 $ rm snake.python
1088 $ rm snake.python
1084 (remove leftover .hg so Mercurial doesn't look for a root here)
1089 (remove leftover .hg so Mercurial doesn't look for a root here)
1085 $ rm -rf .hg
1090 $ rm -rf .hg
1086 $ hg status --subrepos --all .
1091 $ hg status --subrepos --all .
1087 R snake.python
1092 R snake.python
1088 ? barfoo
1093 ? barfoo
1089 ? c.c
1094 ? c.c
1090 ? cpp.cpp
1095 ? cpp.cpp
1091 ? foobar.orig
1096 ? foobar.orig
1092 C .gitignore
1097 C .gitignore
1093 C f
1098 C f
1094 C foobar
1099 C foobar
1095 C g
1100 C g
1096 $ git rm snake.python
1101 $ git rm snake.python
1097 rm 'snake.python'
1102 rm 'snake.python'
1098 $ hg status --subrepos --all .
1103 $ hg status --subrepos --all .
1099 R snake.python
1104 R snake.python
1100 ? barfoo
1105 ? barfoo
1101 ? c.c
1106 ? c.c
1102 ? cpp.cpp
1107 ? cpp.cpp
1103 ? foobar.orig
1108 ? foobar.orig
1104 C .gitignore
1109 C .gitignore
1105 C f
1110 C f
1106 C foobar
1111 C foobar
1107 C g
1112 C g
1108 $ touch snake.python
1113 $ touch snake.python
1109 $ cd ..
1114 $ cd ..
1110 $ hg add s/snake.python
1115 $ hg add s/snake.python
1111 $ hg status -S
1116 $ hg status -S
1112 M s/snake.python
1117 M s/snake.python
1113 ? .hgignore
1118 ? .hgignore
1114 ? s/barfoo
1119 ? s/barfoo
1115 ? s/c.c
1120 ? s/c.c
1116 ? s/cpp.cpp
1121 ? s/cpp.cpp
1117 ? s/foobar.orig
1122 ? s/foobar.orig
1118 $ hg revert --all -q
1123 $ hg revert --all -q
1119
1124
1120 make sure we show changed files, rather than changed subtrees
1125 make sure we show changed files, rather than changed subtrees
1121 $ mkdir s/foo
1126 $ mkdir s/foo
1122 $ touch s/foo/bwuh
1127 $ touch s/foo/bwuh
1123 $ hg add s/foo/bwuh
1128 $ hg add s/foo/bwuh
1124 $ hg commit -S -m "add bwuh"
1129 $ hg commit -S -m "add bwuh"
1125 committing subrepository s
1130 committing subrepository s
1126 $ hg status -S --change .
1131 $ hg status -S --change .
1127 M .hgsubstate
1132 M .hgsubstate
1128 A s/foo/bwuh
1133 A s/foo/bwuh
1129 ? s/barfoo
1134 ? s/barfoo
1130 ? s/c.c
1135 ? s/c.c
1131 ? s/cpp.cpp
1136 ? s/cpp.cpp
1132 ? s/foobar.orig
1137 ? s/foobar.orig
1133 ? s/snake.python.orig
1138 ? s/snake.python.orig
1134
1139
1135 test for Git CVE-2016-3068
1140 test for Git CVE-2016-3068
1136 $ hg init malicious-subrepository
1141 $ hg init malicious-subrepository
1137 $ cd malicious-subrepository
1142 $ cd malicious-subrepository
1138 $ echo "s = [git]ext::sh -c echo% pwned:% \$PWNED_MSG% >pwned.txt" > .hgsub
1143 $ echo "s = [git]ext::sh -c echo% pwned:% \$PWNED_MSG% >pwned.txt" > .hgsub
1139 $ git init s
1144 $ git init s
1140 Initialized empty Git repository in $TESTTMP/tc/malicious-subrepository/s/.git/
1145 Initialized empty Git repository in $TESTTMP/tc/malicious-subrepository/s/.git/
1141 $ cd s
1146 $ cd s
1142 $ git commit --allow-empty -m 'empty'
1147 $ git commit --allow-empty -m 'empty'
1143 [master (root-commit) 153f934] empty
1148 [master (root-commit) 153f934] empty
1144 $ cd ..
1149 $ cd ..
1145 $ hg add .hgsub
1150 $ hg add .hgsub
1146 $ hg commit -m "add subrepo"
1151 $ hg commit -m "add subrepo"
1147 $ cd ..
1152 $ cd ..
1148 $ rm -f pwned.txt
1153 $ rm -f pwned.txt
1149 $ unset GIT_ALLOW_PROTOCOL
1154 $ unset GIT_ALLOW_PROTOCOL
1150 $ PWNED_MSG="your git is too old or mercurial has regressed" hg clone \
1155 $ PWNED_MSG="your git is too old or mercurial has regressed" hg clone \
1151 > malicious-subrepository malicious-subrepository-protected
1156 > malicious-subrepository malicious-subrepository-protected
1152 Cloning into '$TESTTMP/tc/malicious-subrepository-protected/s'... (glob)
1157 Cloning into '$TESTTMP/tc/malicious-subrepository-protected/s'... (glob)
1153 fatal: transport 'ext' not allowed
1158 fatal: transport 'ext' not allowed
1154 updating to branch default
1159 updating to branch default
1155 cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt
1160 cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt
1156 abort: git clone error 128 in s (in subrepo s)
1161 abort: git clone error 128 in s (in subrepo s)
1157 [255]
1162 [255]
1158 $ f -Dq pwned.txt
1163 $ f -Dq pwned.txt
1159 pwned.txt: file not found
1164 pwned.txt: file not found
1160
1165
1161 whitelisting of ext should be respected (that's the git submodule behaviour)
1166 whitelisting of ext should be respected (that's the git submodule behaviour)
1162 $ rm -f pwned.txt
1167 $ rm -f pwned.txt
1163 $ env GIT_ALLOW_PROTOCOL=ext PWNED_MSG="you asked for it" hg clone \
1168 $ env GIT_ALLOW_PROTOCOL=ext PWNED_MSG="you asked for it" hg clone \
1164 > malicious-subrepository malicious-subrepository-clone-allowed
1169 > malicious-subrepository malicious-subrepository-clone-allowed
1165 Cloning into '$TESTTMP/tc/malicious-subrepository-clone-allowed/s'... (glob)
1170 Cloning into '$TESTTMP/tc/malicious-subrepository-clone-allowed/s'... (glob)
1166 fatal: Could not read from remote repository.
1171 fatal: Could not read from remote repository.
1167
1172
1168 Please make sure you have the correct access rights
1173 Please make sure you have the correct access rights
1169 and the repository exists.
1174 and the repository exists.
1170 updating to branch default
1175 updating to branch default
1171 cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt
1176 cloning subrepo s from ext::sh -c echo% pwned:% $PWNED_MSG% >pwned.txt
1172 abort: git clone error 128 in s (in subrepo s)
1177 abort: git clone error 128 in s (in subrepo s)
1173 [255]
1178 [255]
1174 $ f -Dq pwned.txt
1179 $ f -Dq pwned.txt
1175 pwned: you asked for it
1180 pwned: you asked for it
General Comments 0
You need to be logged in to leave comments. Login now