Show More
@@ -1,416 +1,433 b'' | |||
|
1 | 1 | # templatekw.py - common changeset template keywords |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | from node import hex |
|
9 | 9 | import patch, util, error |
|
10 | 10 | import hbisect |
|
11 | 11 | |
|
12 | 12 | # This helper class allows us to handle both: |
|
13 | 13 | # "{files}" (legacy command-line-specific list hack) and |
|
14 | 14 | # "{files % '{file}\n'}" (hgweb-style with inlining and function support) |
|
15 | 15 | |
|
16 | 16 | class _hybrid(object): |
|
17 | 17 | def __init__(self, gen, values, joinfmt=None): |
|
18 | 18 | self.gen = gen |
|
19 | 19 | self.values = values |
|
20 | 20 | if joinfmt: |
|
21 | 21 | self.joinfmt = joinfmt |
|
22 | 22 | else: |
|
23 | 23 | self.joinfmt = lambda x: x.values()[0] |
|
24 | 24 | def __iter__(self): |
|
25 | 25 | return self.gen |
|
26 | 26 | def __call__(self): |
|
27 | 27 | for x in self.values: |
|
28 | 28 | yield x |
|
29 | 29 | |
|
30 | 30 | def showlist(name, values, plural=None, element=None, **args): |
|
31 | 31 | if not element: |
|
32 | 32 | element = name |
|
33 | 33 | f = _showlist(name, values, plural, **args) |
|
34 | 34 | return _hybrid(f, [{element: x} for x in values]) |
|
35 | 35 | |
|
36 | 36 | def _showlist(name, values, plural=None, **args): |
|
37 | 37 | '''expand set of values. |
|
38 | 38 | name is name of key in template map. |
|
39 | 39 | values is list of strings or dicts. |
|
40 | 40 | plural is plural of name, if not simply name + 's'. |
|
41 | 41 | |
|
42 | 42 | expansion works like this, given name 'foo'. |
|
43 | 43 | |
|
44 | 44 | if values is empty, expand 'no_foos'. |
|
45 | 45 | |
|
46 | 46 | if 'foo' not in template map, return values as a string, |
|
47 | 47 | joined by space. |
|
48 | 48 | |
|
49 | 49 | expand 'start_foos'. |
|
50 | 50 | |
|
51 | 51 | for each value, expand 'foo'. if 'last_foo' in template |
|
52 | 52 | map, expand it instead of 'foo' for last key. |
|
53 | 53 | |
|
54 | 54 | expand 'end_foos'. |
|
55 | 55 | ''' |
|
56 | 56 | templ = args['templ'] |
|
57 | 57 | if plural: |
|
58 | 58 | names = plural |
|
59 | 59 | else: names = name + 's' |
|
60 | 60 | if not values: |
|
61 | 61 | noname = 'no_' + names |
|
62 | 62 | if noname in templ: |
|
63 | 63 | yield templ(noname, **args) |
|
64 | 64 | return |
|
65 | 65 | if name not in templ: |
|
66 | 66 | if isinstance(values[0], str): |
|
67 | 67 | yield ' '.join(values) |
|
68 | 68 | else: |
|
69 | 69 | for v in values: |
|
70 | 70 | yield dict(v, **args) |
|
71 | 71 | return |
|
72 | 72 | startname = 'start_' + names |
|
73 | 73 | if startname in templ: |
|
74 | 74 | yield templ(startname, **args) |
|
75 | 75 | vargs = args.copy() |
|
76 | 76 | def one(v, tag=name): |
|
77 | 77 | try: |
|
78 | 78 | vargs.update(v) |
|
79 | 79 | except (AttributeError, ValueError): |
|
80 | 80 | try: |
|
81 | 81 | for a, b in v: |
|
82 | 82 | vargs[a] = b |
|
83 | 83 | except ValueError: |
|
84 | 84 | vargs[name] = v |
|
85 | 85 | return templ(tag, **vargs) |
|
86 | 86 | lastname = 'last_' + name |
|
87 | 87 | if lastname in templ: |
|
88 | 88 | last = values.pop() |
|
89 | 89 | else: |
|
90 | 90 | last = None |
|
91 | 91 | for v in values: |
|
92 | 92 | yield one(v) |
|
93 | 93 | if last is not None: |
|
94 | 94 | yield one(last, tag=lastname) |
|
95 | 95 | endname = 'end_' + names |
|
96 | 96 | if endname in templ: |
|
97 | 97 | yield templ(endname, **args) |
|
98 | 98 | |
|
99 | 99 | def getfiles(repo, ctx, revcache): |
|
100 | 100 | if 'files' not in revcache: |
|
101 | 101 | revcache['files'] = repo.status(ctx.p1().node(), ctx.node())[:3] |
|
102 | 102 | return revcache['files'] |
|
103 | 103 | |
|
104 | 104 | def getlatesttags(repo, ctx, cache): |
|
105 | 105 | '''return date, distance and name for the latest tag of rev''' |
|
106 | 106 | |
|
107 | 107 | if 'latesttags' not in cache: |
|
108 | 108 | # Cache mapping from rev to a tuple with tag date, tag |
|
109 | 109 | # distance and tag name |
|
110 | 110 | cache['latesttags'] = {-1: (0, 0, 'null')} |
|
111 | 111 | latesttags = cache['latesttags'] |
|
112 | 112 | |
|
113 | 113 | rev = ctx.rev() |
|
114 | 114 | todo = [rev] |
|
115 | 115 | while todo: |
|
116 | 116 | rev = todo.pop() |
|
117 | 117 | if rev in latesttags: |
|
118 | 118 | continue |
|
119 | 119 | ctx = repo[rev] |
|
120 | 120 | tags = [t for t in ctx.tags() |
|
121 | 121 | if (repo.tagtype(t) and repo.tagtype(t) != 'local')] |
|
122 | 122 | if tags: |
|
123 | 123 | latesttags[rev] = ctx.date()[0], 0, ':'.join(sorted(tags)) |
|
124 | 124 | continue |
|
125 | 125 | try: |
|
126 | 126 | # The tuples are laid out so the right one can be found by |
|
127 | 127 | # comparison. |
|
128 | 128 | pdate, pdist, ptag = max( |
|
129 | 129 | latesttags[p.rev()] for p in ctx.parents()) |
|
130 | 130 | except KeyError: |
|
131 | 131 | # Cache miss - recurse |
|
132 | 132 | todo.append(rev) |
|
133 | 133 | todo.extend(p.rev() for p in ctx.parents()) |
|
134 | 134 | continue |
|
135 | 135 | latesttags[rev] = pdate, pdist + 1, ptag |
|
136 | 136 | return latesttags[rev] |
|
137 | 137 | |
|
138 | 138 | def getrenamedfn(repo, endrev=None): |
|
139 | 139 | rcache = {} |
|
140 | 140 | if endrev is None: |
|
141 | 141 | endrev = len(repo) |
|
142 | 142 | |
|
143 | 143 | def getrenamed(fn, rev): |
|
144 | 144 | '''looks up all renames for a file (up to endrev) the first |
|
145 | 145 | time the file is given. It indexes on the changerev and only |
|
146 | 146 | parses the manifest if linkrev != changerev. |
|
147 | 147 | Returns rename info for fn at changerev rev.''' |
|
148 | 148 | if fn not in rcache: |
|
149 | 149 | rcache[fn] = {} |
|
150 | 150 | fl = repo.file(fn) |
|
151 | 151 | for i in fl: |
|
152 | 152 | lr = fl.linkrev(i) |
|
153 | 153 | renamed = fl.renamed(fl.node(i)) |
|
154 | 154 | rcache[fn][lr] = renamed |
|
155 | 155 | if lr >= endrev: |
|
156 | 156 | break |
|
157 | 157 | if rev in rcache[fn]: |
|
158 | 158 | return rcache[fn][rev] |
|
159 | 159 | |
|
160 | 160 | # If linkrev != rev (i.e. rev not found in rcache) fallback to |
|
161 | 161 | # filectx logic. |
|
162 | 162 | try: |
|
163 | 163 | return repo[rev][fn].renamed() |
|
164 | 164 | except error.LookupError: |
|
165 | 165 | return None |
|
166 | 166 | |
|
167 | 167 | return getrenamed |
|
168 | 168 | |
|
169 | 169 | |
|
170 | 170 | def showauthor(repo, ctx, templ, **args): |
|
171 | 171 | """:author: String. The unmodified author of the changeset.""" |
|
172 | 172 | return ctx.user() |
|
173 | 173 | |
|
174 | 174 | def showbisect(repo, ctx, templ, **args): |
|
175 | 175 | """:bisect: String. The changeset bisection status.""" |
|
176 | 176 | return hbisect.label(repo, ctx.node()) |
|
177 | 177 | |
|
178 | 178 | def showbranch(**args): |
|
179 | 179 | """:branch: String. The name of the branch on which the changeset was |
|
180 | 180 | committed. |
|
181 | 181 | """ |
|
182 | 182 | return args['ctx'].branch() |
|
183 | 183 | |
|
184 | 184 | def showbranches(**args): |
|
185 | 185 | """:branches: List of strings. The name of the branch on which the |
|
186 | 186 | changeset was committed. Will be empty if the branch name was |
|
187 | 187 | default. |
|
188 | 188 | """ |
|
189 | 189 | branch = args['ctx'].branch() |
|
190 | 190 | if branch != 'default': |
|
191 | 191 | return showlist('branch', [branch], plural='branches', **args) |
|
192 | 192 | return showlist('branch', [], plural='branches', **args) |
|
193 | 193 | |
|
194 | 194 | def showbookmarks(**args): |
|
195 | 195 | """:bookmarks: List of strings. Any bookmarks associated with the |
|
196 | 196 | changeset. |
|
197 | 197 | """ |
|
198 | 198 | repo = args['ctx']._repo |
|
199 | 199 | bookmarks = args['ctx'].bookmarks() |
|
200 | 200 | hybrid = showlist('bookmark', bookmarks, **args) |
|
201 | 201 | for value in hybrid.values: |
|
202 | 202 | value['current'] = repo._bookmarkcurrent |
|
203 | 203 | return hybrid |
|
204 | 204 | |
|
205 | 205 | def showchildren(**args): |
|
206 | 206 | """:children: List of strings. The children of the changeset.""" |
|
207 | 207 | ctx = args['ctx'] |
|
208 | 208 | childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()] |
|
209 | 209 | return showlist('children', childrevs, element='child', **args) |
|
210 | 210 | |
|
211 | 211 | def showcurrentbookmark(**args): |
|
212 | 212 | """:currentbookmark: String. The active bookmark, if it is |
|
213 | 213 | associated with the changeset""" |
|
214 | 214 | import bookmarks as bookmarks # to avoid circular import issues |
|
215 | 215 | repo = args['repo'] |
|
216 | 216 | if bookmarks.iscurrent(repo): |
|
217 | 217 | current = repo._bookmarkcurrent |
|
218 | 218 | if current in args['ctx'].bookmarks(): |
|
219 | 219 | return current |
|
220 | 220 | return '' |
|
221 | 221 | |
|
222 | 222 | def showdate(repo, ctx, templ, **args): |
|
223 | 223 | """:date: Date information. The date when the changeset was committed.""" |
|
224 | 224 | return ctx.date() |
|
225 | 225 | |
|
226 | 226 | def showdescription(repo, ctx, templ, **args): |
|
227 | 227 | """:desc: String. The text of the changeset description.""" |
|
228 | 228 | return ctx.description().strip() |
|
229 | 229 | |
|
230 | 230 | def showdiffstat(repo, ctx, templ, **args): |
|
231 | 231 | """:diffstat: String. Statistics of changes with the following format: |
|
232 | 232 | "modified files: +added/-removed lines" |
|
233 | 233 | """ |
|
234 | 234 | stats = patch.diffstatdata(util.iterlines(ctx.diff())) |
|
235 | 235 | maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats) |
|
236 | 236 | return '%s: +%s/-%s' % (len(stats), adds, removes) |
|
237 | 237 | |
|
238 | 238 | def showextras(**args): |
|
239 | 239 | """:extras: List of dicts with key, value entries of the 'extras' |
|
240 | 240 | field of this changeset.""" |
|
241 | 241 | extras = args['ctx'].extra() |
|
242 | 242 | c = [{'key': x[0], 'value': x[1]} for x in sorted(extras.items())] |
|
243 | 243 | f = _showlist('extra', c, plural='extras', **args) |
|
244 | 244 | return _hybrid(f, c, lambda x: '%s=%s' % (x['key'], x['value'])) |
|
245 | 245 | |
|
246 | 246 | def showfileadds(**args): |
|
247 | 247 | """:file_adds: List of strings. Files added by this changeset.""" |
|
248 | 248 | repo, ctx, revcache = args['repo'], args['ctx'], args['revcache'] |
|
249 | 249 | return showlist('file_add', getfiles(repo, ctx, revcache)[1], |
|
250 | 250 | element='file', **args) |
|
251 | 251 | |
|
252 | 252 | def showfilecopies(**args): |
|
253 | 253 | """:file_copies: List of strings. Files copied in this changeset with |
|
254 | 254 | their sources. |
|
255 | 255 | """ |
|
256 | 256 | cache, ctx = args['cache'], args['ctx'] |
|
257 | 257 | copies = args['revcache'].get('copies') |
|
258 | 258 | if copies is None: |
|
259 | 259 | if 'getrenamed' not in cache: |
|
260 | 260 | cache['getrenamed'] = getrenamedfn(args['repo']) |
|
261 | 261 | copies = [] |
|
262 | 262 | getrenamed = cache['getrenamed'] |
|
263 | 263 | for fn in ctx.files(): |
|
264 | 264 | rename = getrenamed(fn, ctx.rev()) |
|
265 | 265 | if rename: |
|
266 | 266 | copies.append((fn, rename[0])) |
|
267 | 267 | |
|
268 | 268 | c = [{'name': x[0], 'source': x[1]} for x in copies] |
|
269 | 269 | f = _showlist('file_copy', c, plural='file_copies', **args) |
|
270 | 270 | return _hybrid(f, c, lambda x: '%s (%s)' % (x['name'], x['source'])) |
|
271 | 271 | |
|
272 | 272 | # showfilecopiesswitch() displays file copies only if copy records are |
|
273 | 273 | # provided before calling the templater, usually with a --copies |
|
274 | 274 | # command line switch. |
|
275 | 275 | def showfilecopiesswitch(**args): |
|
276 | 276 | """:file_copies_switch: List of strings. Like "file_copies" but displayed |
|
277 | 277 | only if the --copied switch is set. |
|
278 | 278 | """ |
|
279 | 279 | copies = args['revcache'].get('copies') or [] |
|
280 | 280 | c = [{'name': x[0], 'source': x[1]} for x in copies] |
|
281 | 281 | f = _showlist('file_copy', c, plural='file_copies', **args) |
|
282 | 282 | return _hybrid(f, c, lambda x: '%s (%s)' % (x['name'], x['source'])) |
|
283 | 283 | |
|
284 | 284 | def showfiledels(**args): |
|
285 | 285 | """:file_dels: List of strings. Files removed by this changeset.""" |
|
286 | 286 | repo, ctx, revcache = args['repo'], args['ctx'], args['revcache'] |
|
287 | 287 | return showlist('file_del', getfiles(repo, ctx, revcache)[2], |
|
288 | 288 | element='file', **args) |
|
289 | 289 | |
|
290 | 290 | def showfilemods(**args): |
|
291 | 291 | """:file_mods: List of strings. Files modified by this changeset.""" |
|
292 | 292 | repo, ctx, revcache = args['repo'], args['ctx'], args['revcache'] |
|
293 | 293 | return showlist('file_mod', getfiles(repo, ctx, revcache)[0], |
|
294 | 294 | element='file', **args) |
|
295 | 295 | |
|
296 | 296 | def showfiles(**args): |
|
297 | 297 | """:files: List of strings. All files modified, added, or removed by this |
|
298 | 298 | changeset. |
|
299 | 299 | """ |
|
300 | 300 | return showlist('file', args['ctx'].files(), **args) |
|
301 | 301 | |
|
302 | 302 | def showlatesttag(repo, ctx, templ, cache, **args): |
|
303 | 303 | """:latesttag: String. Most recent global tag in the ancestors of this |
|
304 | 304 | changeset. |
|
305 | 305 | """ |
|
306 | 306 | return getlatesttags(repo, ctx, cache)[2] |
|
307 | 307 | |
|
308 | 308 | def showlatesttagdistance(repo, ctx, templ, cache, **args): |
|
309 | 309 | """:latesttagdistance: Integer. Longest path to the latest tag.""" |
|
310 | 310 | return getlatesttags(repo, ctx, cache)[1] |
|
311 | 311 | |
|
312 | 312 | def showmanifest(**args): |
|
313 | 313 | repo, ctx, templ = args['repo'], args['ctx'], args['templ'] |
|
314 | 314 | args = args.copy() |
|
315 | 315 | args.update({'rev': repo.manifest.rev(ctx.changeset()[0]), |
|
316 | 316 | 'node': hex(ctx.changeset()[0])}) |
|
317 | 317 | return templ('manifest', **args) |
|
318 | 318 | |
|
319 | 319 | def shownode(repo, ctx, templ, **args): |
|
320 | 320 | """:node: String. The changeset identification hash, as a 40 hexadecimal |
|
321 | 321 | digit string. |
|
322 | 322 | """ |
|
323 | 323 | return ctx.hex() |
|
324 | 324 | |
|
325 | 325 | def showp1rev(repo, ctx, templ, **args): |
|
326 | 326 | """:p1rev: Integer. The repository-local revision number of the changeset's |
|
327 | 327 | first parent, or -1 if the changeset has no parents.""" |
|
328 | 328 | return ctx.p1().rev() |
|
329 | 329 | |
|
330 | 330 | def showp2rev(repo, ctx, templ, **args): |
|
331 | 331 | """:p2rev: Integer. The repository-local revision number of the changeset's |
|
332 | 332 | second parent, or -1 if the changeset has no second parent.""" |
|
333 | 333 | return ctx.p2().rev() |
|
334 | 334 | |
|
335 | 335 | def showp1node(repo, ctx, templ, **args): |
|
336 | 336 | """:p1node: String. The identification hash of the changeset's first parent, |
|
337 | 337 | as a 40 digit hexadecimal string. If the changeset has no parents, all |
|
338 | 338 | digits are 0.""" |
|
339 | 339 | return ctx.p1().hex() |
|
340 | 340 | |
|
341 | 341 | def showp2node(repo, ctx, templ, **args): |
|
342 | 342 | """:p2node: String. The identification hash of the changeset's second |
|
343 | 343 | parent, as a 40 digit hexadecimal string. If the changeset has no second |
|
344 | 344 | parent, all digits are 0.""" |
|
345 | 345 | return ctx.p2().hex() |
|
346 | 346 | |
|
347 | 347 | def showphase(repo, ctx, templ, **args): |
|
348 | 348 | """:phase: String. The changeset phase name.""" |
|
349 | 349 | return ctx.phasestr() |
|
350 | 350 | |
|
351 | 351 | def showphaseidx(repo, ctx, templ, **args): |
|
352 | 352 | """:phaseidx: Integer. The changeset phase index.""" |
|
353 | 353 | return ctx.phase() |
|
354 | 354 | |
|
355 | 355 | def showrev(repo, ctx, templ, **args): |
|
356 | 356 | """:rev: Integer. The repository-local changeset revision number.""" |
|
357 | 357 | return ctx.rev() |
|
358 | 358 | |
|
359 | def showsubrepos(**args): | |
|
360 | """:subrepos: List of strings. Updated subrepositories in the changeset.""" | |
|
361 | ctx = args['ctx'] | |
|
362 | substate = ctx.substate | |
|
363 | if not substate: | |
|
364 | return showlist('subrepo', [], **args) | |
|
365 | psubstate = ctx.parents()[0].substate or {} | |
|
366 | subrepos = [] | |
|
367 | for sub in substate: | |
|
368 | if sub not in psubstate or substate[sub] != psubstate[sub]: | |
|
369 | subrepos.append(sub) # modified or newly added in ctx | |
|
370 | for sub in psubstate: | |
|
371 | if sub not in substate: | |
|
372 | subrepos.append(sub) # removed in ctx | |
|
373 | return showlist('subrepo', sorted(subrepos), **args) | |
|
374 | ||
|
359 | 375 | def showtags(**args): |
|
360 | 376 | """:tags: List of strings. Any tags associated with the changeset.""" |
|
361 | 377 | return showlist('tag', args['ctx'].tags(), **args) |
|
362 | 378 | |
|
363 | 379 | # keywords are callables like: |
|
364 | 380 | # fn(repo, ctx, templ, cache, revcache, **args) |
|
365 | 381 | # with: |
|
366 | 382 | # repo - current repository instance |
|
367 | 383 | # ctx - the changectx being displayed |
|
368 | 384 | # templ - the templater instance |
|
369 | 385 | # cache - a cache dictionary for the whole templater run |
|
370 | 386 | # revcache - a cache dictionary for the current revision |
|
371 | 387 | keywords = { |
|
372 | 388 | 'author': showauthor, |
|
373 | 389 | 'bisect': showbisect, |
|
374 | 390 | 'branch': showbranch, |
|
375 | 391 | 'branches': showbranches, |
|
376 | 392 | 'bookmarks': showbookmarks, |
|
377 | 393 | 'children': showchildren, |
|
378 | 394 | 'currentbookmark': showcurrentbookmark, |
|
379 | 395 | 'date': showdate, |
|
380 | 396 | 'desc': showdescription, |
|
381 | 397 | 'diffstat': showdiffstat, |
|
382 | 398 | 'extras': showextras, |
|
383 | 399 | 'file_adds': showfileadds, |
|
384 | 400 | 'file_copies': showfilecopies, |
|
385 | 401 | 'file_copies_switch': showfilecopiesswitch, |
|
386 | 402 | 'file_dels': showfiledels, |
|
387 | 403 | 'file_mods': showfilemods, |
|
388 | 404 | 'files': showfiles, |
|
389 | 405 | 'latesttag': showlatesttag, |
|
390 | 406 | 'latesttagdistance': showlatesttagdistance, |
|
391 | 407 | 'manifest': showmanifest, |
|
392 | 408 | 'node': shownode, |
|
393 | 409 | 'p1rev': showp1rev, |
|
394 | 410 | 'p1node': showp1node, |
|
395 | 411 | 'p2rev': showp2rev, |
|
396 | 412 | 'p2node': showp2node, |
|
397 | 413 | 'phase': showphase, |
|
398 | 414 | 'phaseidx': showphaseidx, |
|
399 | 415 | 'rev': showrev, |
|
416 | 'subrepos': showsubrepos, | |
|
400 | 417 | 'tags': showtags, |
|
401 | 418 | } |
|
402 | 419 | |
|
403 | 420 | def _showparents(**args): |
|
404 | 421 | """:parents: List of strings. The parents of the changeset in "rev:node" |
|
405 | 422 | format. If the changeset has only one "natural" parent (the predecessor |
|
406 | 423 | revision) nothing is shown.""" |
|
407 | 424 | pass |
|
408 | 425 | |
|
409 | 426 | dockeywords = { |
|
410 | 427 | 'parents': _showparents, |
|
411 | 428 | } |
|
412 | 429 | dockeywords.update(keywords) |
|
413 | 430 | del dockeywords['branches'] |
|
414 | 431 | |
|
415 | 432 | # tell hggettext to extract docstrings from these functions: |
|
416 | 433 | i18nfunctions = dockeywords.values() |
@@ -1,1390 +1,1476 b'' | |||
|
1 | 1 | Let commit recurse into subrepos by default to match pre-2.0 behavior: |
|
2 | 2 | |
|
3 | 3 | $ echo "[ui]" >> $HGRCPATH |
|
4 | 4 | $ echo "commitsubrepos = Yes" >> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | $ hg init t |
|
7 | 7 | $ cd t |
|
8 | 8 | |
|
9 | 9 | first revision, no sub |
|
10 | 10 | |
|
11 | 11 | $ echo a > a |
|
12 | 12 | $ hg ci -Am0 |
|
13 | 13 | adding a |
|
14 | 14 | |
|
15 | 15 | add first sub |
|
16 | 16 | |
|
17 | 17 | $ echo s = s > .hgsub |
|
18 | 18 | $ hg add .hgsub |
|
19 | 19 | $ hg init s |
|
20 | 20 | $ echo a > s/a |
|
21 | 21 | |
|
22 | 22 | Issue2232: committing a subrepo without .hgsub |
|
23 | 23 | |
|
24 | 24 | $ hg ci -mbad s |
|
25 | 25 | abort: can't commit subrepos without .hgsub |
|
26 | 26 | [255] |
|
27 | 27 | |
|
28 | 28 | $ hg -R s ci -Ams0 |
|
29 | 29 | adding a |
|
30 | 30 | $ hg sum |
|
31 | 31 | parent: 0:f7b1eb17ad24 tip |
|
32 | 32 | 0 |
|
33 | 33 | branch: default |
|
34 | 34 | commit: 1 added, 1 subrepos |
|
35 | 35 | update: (current) |
|
36 | 36 | $ hg ci -m1 |
|
37 | 37 | |
|
38 | 38 | test handling .hgsubstate "added" explicitly. |
|
39 | 39 | |
|
40 | 40 | $ hg parents --template '{node}\n{files}\n' |
|
41 | 41 | 7cf8cfea66e410e8e3336508dfeec07b3192de51 |
|
42 | 42 | .hgsub .hgsubstate |
|
43 | 43 | $ hg rollback -q |
|
44 | 44 | $ hg add .hgsubstate |
|
45 | 45 | $ hg ci -m1 |
|
46 | 46 | $ hg parents --template '{node}\n{files}\n' |
|
47 | 47 | 7cf8cfea66e410e8e3336508dfeec07b3192de51 |
|
48 | 48 | .hgsub .hgsubstate |
|
49 | 49 | |
|
50 | 50 | Revert subrepo and test subrepo fileset keyword: |
|
51 | 51 | |
|
52 | 52 | $ echo b > s/a |
|
53 | 53 | $ hg revert "set:subrepo('glob:s*')" |
|
54 | 54 | reverting subrepo s |
|
55 | 55 | reverting s/a (glob) |
|
56 | 56 | $ rm s/a.orig |
|
57 | 57 | |
|
58 | 58 | Revert subrepo with no backup. The "reverting s/a" line is gone since |
|
59 | 59 | we're really running 'hg update' in the subrepo: |
|
60 | 60 | |
|
61 | 61 | $ echo b > s/a |
|
62 | 62 | $ hg revert --no-backup s |
|
63 | 63 | reverting subrepo s |
|
64 | 64 | |
|
65 | 65 | Issue2022: update -C |
|
66 | 66 | |
|
67 | 67 | $ echo b > s/a |
|
68 | 68 | $ hg sum |
|
69 | 69 | parent: 1:7cf8cfea66e4 tip |
|
70 | 70 | 1 |
|
71 | 71 | branch: default |
|
72 | 72 | commit: 1 subrepos |
|
73 | 73 | update: (current) |
|
74 | 74 | $ hg co -C 1 |
|
75 | 75 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
76 | 76 | $ hg sum |
|
77 | 77 | parent: 1:7cf8cfea66e4 tip |
|
78 | 78 | 1 |
|
79 | 79 | branch: default |
|
80 | 80 | commit: (clean) |
|
81 | 81 | update: (current) |
|
82 | 82 | |
|
83 | 83 | commands that require a clean repo should respect subrepos |
|
84 | 84 | |
|
85 | 85 | $ echo b >> s/a |
|
86 | 86 | $ hg backout tip |
|
87 | 87 | abort: uncommitted changes in subrepo s |
|
88 | 88 | [255] |
|
89 | 89 | $ hg revert -C -R s s/a |
|
90 | 90 | |
|
91 | 91 | add sub sub |
|
92 | 92 | |
|
93 | 93 | $ echo ss = ss > s/.hgsub |
|
94 | 94 | $ hg init s/ss |
|
95 | 95 | $ echo a > s/ss/a |
|
96 | 96 | $ hg -R s add s/.hgsub |
|
97 | 97 | $ hg -R s/ss add s/ss/a |
|
98 | 98 | $ hg sum |
|
99 | 99 | parent: 1:7cf8cfea66e4 tip |
|
100 | 100 | 1 |
|
101 | 101 | branch: default |
|
102 | 102 | commit: 1 subrepos |
|
103 | 103 | update: (current) |
|
104 | 104 | $ hg ci -m2 |
|
105 | 105 | committing subrepository s |
|
106 | 106 | committing subrepository s/ss (glob) |
|
107 | 107 | $ hg sum |
|
108 | 108 | parent: 2:df30734270ae tip |
|
109 | 109 | 2 |
|
110 | 110 | branch: default |
|
111 | 111 | commit: (clean) |
|
112 | 112 | update: (current) |
|
113 | 113 | |
|
114 | 114 | test handling .hgsubstate "modified" explicitly. |
|
115 | 115 | |
|
116 | 116 | $ hg parents --template '{node}\n{files}\n' |
|
117 | 117 | df30734270ae757feb35e643b7018e818e78a9aa |
|
118 | 118 | .hgsubstate |
|
119 | 119 | $ hg rollback -q |
|
120 | 120 | $ hg status -A .hgsubstate |
|
121 | 121 | M .hgsubstate |
|
122 | 122 | $ hg ci -m2 |
|
123 | 123 | $ hg parents --template '{node}\n{files}\n' |
|
124 | 124 | df30734270ae757feb35e643b7018e818e78a9aa |
|
125 | 125 | .hgsubstate |
|
126 | 126 | |
|
127 | 127 | bump sub rev (and check it is ignored by ui.commitsubrepos) |
|
128 | 128 | |
|
129 | 129 | $ echo b > s/a |
|
130 | 130 | $ hg -R s ci -ms1 |
|
131 | 131 | $ hg --config ui.commitsubrepos=no ci -m3 |
|
132 | 132 | |
|
133 | 133 | leave sub dirty (and check ui.commitsubrepos=no aborts the commit) |
|
134 | 134 | |
|
135 | 135 | $ echo c > s/a |
|
136 | 136 | $ hg --config ui.commitsubrepos=no ci -m4 |
|
137 | 137 | abort: uncommitted changes in subrepo s |
|
138 | 138 | (use --subrepos for recursive commit) |
|
139 | 139 | [255] |
|
140 | 140 | $ hg id |
|
141 | 141 | f6affe3fbfaa+ tip |
|
142 | 142 | $ hg -R s ci -mc |
|
143 | 143 | $ hg id |
|
144 | 144 | f6affe3fbfaa+ tip |
|
145 | 145 | $ echo d > s/a |
|
146 | 146 | $ hg ci -m4 |
|
147 | 147 | committing subrepository s |
|
148 | 148 | $ hg tip -R s |
|
149 | 149 | changeset: 4:02dcf1d70411 |
|
150 | 150 | tag: tip |
|
151 | 151 | user: test |
|
152 | 152 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
153 | 153 | summary: 4 |
|
154 | 154 | |
|
155 | 155 | |
|
156 | 156 | check caching |
|
157 | 157 | |
|
158 | 158 | $ hg co 0 |
|
159 | 159 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
160 | 160 | $ hg debugsub |
|
161 | 161 | |
|
162 | 162 | restore |
|
163 | 163 | |
|
164 | 164 | $ hg co |
|
165 | 165 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
166 | 166 | $ hg debugsub |
|
167 | 167 | path s |
|
168 | 168 | source s |
|
169 | 169 | revision 02dcf1d704118aee3ee306ccfa1910850d5b05ef |
|
170 | 170 | |
|
171 | 171 | new branch for merge tests |
|
172 | 172 | |
|
173 | 173 | $ hg co 1 |
|
174 | 174 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
175 | 175 | $ echo t = t >> .hgsub |
|
176 | 176 | $ hg init t |
|
177 | 177 | $ echo t > t/t |
|
178 | 178 | $ hg -R t add t |
|
179 | 179 | adding t/t (glob) |
|
180 | 180 | |
|
181 | 181 | 5 |
|
182 | 182 | |
|
183 | 183 | $ hg ci -m5 # add sub |
|
184 | 184 | committing subrepository t |
|
185 | 185 | created new head |
|
186 | 186 | $ echo t2 > t/t |
|
187 | 187 | |
|
188 | 188 | 6 |
|
189 | 189 | |
|
190 | 190 | $ hg st -R s |
|
191 | 191 | $ hg ci -m6 # change sub |
|
192 | 192 | committing subrepository t |
|
193 | 193 | $ hg debugsub |
|
194 | 194 | path s |
|
195 | 195 | source s |
|
196 | 196 | revision e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 |
|
197 | 197 | path t |
|
198 | 198 | source t |
|
199 | 199 | revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad |
|
200 | 200 | $ echo t3 > t/t |
|
201 | 201 | |
|
202 | 202 | 7 |
|
203 | 203 | |
|
204 | 204 | $ hg ci -m7 # change sub again for conflict test |
|
205 | 205 | committing subrepository t |
|
206 | 206 | $ hg rm .hgsub |
|
207 | 207 | |
|
208 | 208 | 8 |
|
209 | 209 | |
|
210 | 210 | $ hg ci -m8 # remove sub |
|
211 | 211 | |
|
212 | 212 | test handling .hgsubstate "removed" explicitly. |
|
213 | 213 | |
|
214 | 214 | $ hg parents --template '{node}\n{files}\n' |
|
215 | 215 | 96615c1dad2dc8e3796d7332c77ce69156f7b78e |
|
216 | 216 | .hgsub .hgsubstate |
|
217 | 217 | $ hg rollback -q |
|
218 | 218 | $ hg remove .hgsubstate |
|
219 | 219 | $ hg ci -m8 |
|
220 | 220 | $ hg parents --template '{node}\n{files}\n' |
|
221 | 221 | 96615c1dad2dc8e3796d7332c77ce69156f7b78e |
|
222 | 222 | .hgsub .hgsubstate |
|
223 | 223 | |
|
224 | 224 | merge tests |
|
225 | 225 | |
|
226 | 226 | $ hg co -C 3 |
|
227 | 227 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
228 | 228 | $ hg merge 5 # test adding |
|
229 | 229 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
230 | 230 | (branch merge, don't forget to commit) |
|
231 | 231 | $ hg debugsub |
|
232 | 232 | path s |
|
233 | 233 | source s |
|
234 | 234 | revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 |
|
235 | 235 | path t |
|
236 | 236 | source t |
|
237 | 237 | revision 60ca1237c19474e7a3978b0dc1ca4e6f36d51382 |
|
238 | 238 | $ hg ci -m9 |
|
239 | 239 | created new head |
|
240 | 240 | $ hg merge 6 --debug # test change |
|
241 | 241 | searching for copies back to rev 2 |
|
242 | 242 | resolving manifests |
|
243 | 243 | branchmerge: True, force: False, partial: False |
|
244 | 244 | ancestor: 1f14a2e2d3ec, local: f0d2028bf86d+, remote: 1831e14459c4 |
|
245 | 245 | .hgsubstate: versions differ -> m |
|
246 | 246 | updating: .hgsubstate 1/1 files (100.00%) |
|
247 | 247 | subrepo merge f0d2028bf86d+ 1831e14459c4 1f14a2e2d3ec |
|
248 | 248 | subrepo t: other changed, get t:6747d179aa9a688023c4b0cad32e4c92bb7f34ad:hg |
|
249 | 249 | getting subrepo t |
|
250 | 250 | resolving manifests |
|
251 | 251 | branchmerge: False, force: False, partial: False |
|
252 | 252 | ancestor: 60ca1237c194, local: 60ca1237c194+, remote: 6747d179aa9a |
|
253 | 253 | t: remote is newer -> g |
|
254 | 254 | getting t |
|
255 | 255 | updating: t 1/1 files (100.00%) |
|
256 | 256 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
257 | 257 | (branch merge, don't forget to commit) |
|
258 | 258 | $ hg debugsub |
|
259 | 259 | path s |
|
260 | 260 | source s |
|
261 | 261 | revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 |
|
262 | 262 | path t |
|
263 | 263 | source t |
|
264 | 264 | revision 6747d179aa9a688023c4b0cad32e4c92bb7f34ad |
|
265 | 265 | $ echo conflict > t/t |
|
266 | 266 | $ hg ci -m10 |
|
267 | 267 | committing subrepository t |
|
268 | 268 | $ HGMERGE=internal:merge hg merge --debug 7 # test conflict |
|
269 | 269 | searching for copies back to rev 2 |
|
270 | 270 | resolving manifests |
|
271 | 271 | branchmerge: True, force: False, partial: False |
|
272 | 272 | ancestor: 1831e14459c4, local: e45c8b14af55+, remote: f94576341bcf |
|
273 | 273 | .hgsubstate: versions differ -> m |
|
274 | 274 | updating: .hgsubstate 1/1 files (100.00%) |
|
275 | 275 | subrepo merge e45c8b14af55+ f94576341bcf 1831e14459c4 |
|
276 | 276 | subrepo t: both sides changed |
|
277 | 277 | subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198) |
|
278 | 278 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
279 | 279 | merging subrepo t |
|
280 | 280 | searching for copies back to rev 2 |
|
281 | 281 | resolving manifests |
|
282 | 282 | branchmerge: True, force: False, partial: False |
|
283 | 283 | ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198 |
|
284 | 284 | preserving t for resolve of t |
|
285 | 285 | t: versions differ -> m |
|
286 | 286 | updating: t 1/1 files (100.00%) |
|
287 | 287 | picked tool 'internal:merge' for t (binary False symlink False) |
|
288 | 288 | merging t |
|
289 | 289 | my t@20a0db6fbf6c+ other t@7af322bc1198 ancestor t@6747d179aa9a |
|
290 | 290 | warning: conflicts during merge. |
|
291 | 291 | merging t incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
292 | 292 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
293 | 293 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
294 | 294 | subrepo t: merge with t:7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4:hg |
|
295 | 295 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
296 | 296 | (branch merge, don't forget to commit) |
|
297 | 297 | |
|
298 | 298 | should conflict |
|
299 | 299 | |
|
300 | 300 | $ cat t/t |
|
301 | 301 | <<<<<<< local: 20a0db6fbf6c - test: 10 |
|
302 | 302 | conflict |
|
303 | 303 | ======= |
|
304 | 304 | t3 |
|
305 | 305 | >>>>>>> other: 7af322bc1198 - test: 7 |
|
306 | 306 | |
|
307 | 307 | clone |
|
308 | 308 | |
|
309 | 309 | $ cd .. |
|
310 | 310 | $ hg clone t tc |
|
311 | 311 | updating to branch default |
|
312 | 312 | cloning subrepo s from $TESTTMP/t/s |
|
313 | 313 | cloning subrepo s/ss from $TESTTMP/t/s/ss (glob) |
|
314 | 314 | cloning subrepo t from $TESTTMP/t/t |
|
315 | 315 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
316 | 316 | $ cd tc |
|
317 | 317 | $ hg debugsub |
|
318 | 318 | path s |
|
319 | 319 | source s |
|
320 | 320 | revision fc627a69481fcbe5f1135069e8a3881c023e4cf5 |
|
321 | 321 | path t |
|
322 | 322 | source t |
|
323 | 323 | revision 20a0db6fbf6c3d2836e6519a642ae929bfc67c0e |
|
324 | 324 | |
|
325 | 325 | push |
|
326 | 326 | |
|
327 | 327 | $ echo bah > t/t |
|
328 | 328 | $ hg ci -m11 |
|
329 | 329 | committing subrepository t |
|
330 | 330 | $ hg push |
|
331 | 331 | pushing to $TESTTMP/t (glob) |
|
332 | 332 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
333 | 333 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
334 | 334 | pushing subrepo t to $TESTTMP/t/t |
|
335 | 335 | searching for changes |
|
336 | 336 | adding changesets |
|
337 | 337 | adding manifests |
|
338 | 338 | adding file changes |
|
339 | 339 | added 1 changesets with 1 changes to 1 files |
|
340 | 340 | searching for changes |
|
341 | 341 | adding changesets |
|
342 | 342 | adding manifests |
|
343 | 343 | adding file changes |
|
344 | 344 | added 1 changesets with 1 changes to 1 files |
|
345 | 345 | |
|
346 | 346 | push -f |
|
347 | 347 | |
|
348 | 348 | $ echo bah > s/a |
|
349 | 349 | $ hg ci -m12 |
|
350 | 350 | committing subrepository s |
|
351 | 351 | $ hg push |
|
352 | 352 | pushing to $TESTTMP/t (glob) |
|
353 | 353 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
354 | 354 | pushing subrepo s to $TESTTMP/t/s |
|
355 | 355 | searching for changes |
|
356 | 356 | abort: push creates new remote head 12a213df6fa9! (in subrepo s) |
|
357 | 357 | (merge or see "hg help push" for details about pushing new heads) |
|
358 | 358 | [255] |
|
359 | 359 | $ hg push -f |
|
360 | 360 | pushing to $TESTTMP/t (glob) |
|
361 | 361 | pushing subrepo s/ss to $TESTTMP/t/s/ss (glob) |
|
362 | 362 | searching for changes |
|
363 | 363 | no changes found |
|
364 | 364 | pushing subrepo s to $TESTTMP/t/s |
|
365 | 365 | searching for changes |
|
366 | 366 | adding changesets |
|
367 | 367 | adding manifests |
|
368 | 368 | adding file changes |
|
369 | 369 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
370 | 370 | pushing subrepo t to $TESTTMP/t/t |
|
371 | 371 | searching for changes |
|
372 | 372 | no changes found |
|
373 | 373 | searching for changes |
|
374 | 374 | adding changesets |
|
375 | 375 | adding manifests |
|
376 | 376 | adding file changes |
|
377 | 377 | added 1 changesets with 1 changes to 1 files |
|
378 | 378 | |
|
379 | 379 | check that unmodified subrepos are not pushed |
|
380 | 380 | |
|
381 | 381 | $ hg clone . ../tcc |
|
382 | 382 | updating to branch default |
|
383 | 383 | cloning subrepo s from $TESTTMP/tc/s |
|
384 | 384 | cloning subrepo s/ss from $TESTTMP/tc/s/ss (glob) |
|
385 | 385 | cloning subrepo t from $TESTTMP/tc/t |
|
386 | 386 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
387 | 387 | |
|
388 | 388 | the subrepos on the new clone have nothing to push to its source |
|
389 | 389 | |
|
390 | 390 | $ hg push -R ../tcc . |
|
391 | 391 | pushing to . |
|
392 | 392 | no changes made to subrepo s/ss since last push to s/ss (glob) |
|
393 | 393 | no changes made to subrepo s since last push to s |
|
394 | 394 | no changes made to subrepo t since last push to t |
|
395 | 395 | searching for changes |
|
396 | 396 | no changes found |
|
397 | 397 | [1] |
|
398 | 398 | |
|
399 | 399 | the subrepos on the source do not have a clean store versus the clone target |
|
400 | 400 | because they were never explicitly pushed to the source |
|
401 | 401 | |
|
402 | 402 | $ hg push ../tcc |
|
403 | 403 | pushing to ../tcc |
|
404 | 404 | pushing subrepo s/ss to ../tcc/s/ss (glob) |
|
405 | 405 | searching for changes |
|
406 | 406 | no changes found |
|
407 | 407 | pushing subrepo s to ../tcc/s |
|
408 | 408 | searching for changes |
|
409 | 409 | no changes found |
|
410 | 410 | pushing subrepo t to ../tcc/t |
|
411 | 411 | searching for changes |
|
412 | 412 | no changes found |
|
413 | 413 | searching for changes |
|
414 | 414 | no changes found |
|
415 | 415 | [1] |
|
416 | 416 | |
|
417 | 417 | after push their stores become clean |
|
418 | 418 | |
|
419 | 419 | $ hg push ../tcc |
|
420 | 420 | pushing to ../tcc |
|
421 | 421 | no changes made to subrepo s/ss since last push to ../tcc/s/ss (glob) |
|
422 | 422 | no changes made to subrepo s since last push to ../tcc/s |
|
423 | 423 | no changes made to subrepo t since last push to ../tcc/t |
|
424 | 424 | searching for changes |
|
425 | 425 | no changes found |
|
426 | 426 | [1] |
|
427 | 427 | |
|
428 | 428 | updating a subrepo to a different revision or changing |
|
429 | 429 | its working directory does not make its store dirty |
|
430 | 430 | |
|
431 | 431 | $ hg -R s update '.^' |
|
432 | 432 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
433 | 433 | $ hg push |
|
434 | 434 | pushing to $TESTTMP/t (glob) |
|
435 | 435 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
436 | 436 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
437 | 437 | no changes made to subrepo t since last push to $TESTTMP/t/t |
|
438 | 438 | searching for changes |
|
439 | 439 | no changes found |
|
440 | 440 | [1] |
|
441 | 441 | $ echo foo >> s/a |
|
442 | 442 | $ hg push |
|
443 | 443 | pushing to $TESTTMP/t (glob) |
|
444 | 444 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
445 | 445 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
446 | 446 | no changes made to subrepo t since last push to $TESTTMP/t/t |
|
447 | 447 | searching for changes |
|
448 | 448 | no changes found |
|
449 | 449 | [1] |
|
450 | 450 | $ hg -R s update -C tip |
|
451 | 451 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
452 | 452 | |
|
453 | 453 | committing into a subrepo makes its store (but not its parent's store) dirty |
|
454 | 454 | |
|
455 | 455 | $ echo foo >> s/ss/a |
|
456 | 456 | $ hg -R s/ss commit -m 'test dirty store detection' |
|
457 | 457 | $ hg push |
|
458 | 458 | pushing to $TESTTMP/t (glob) |
|
459 | 459 | pushing subrepo s/ss to $TESTTMP/t/s/ss (glob) |
|
460 | 460 | searching for changes |
|
461 | 461 | adding changesets |
|
462 | 462 | adding manifests |
|
463 | 463 | adding file changes |
|
464 | 464 | added 1 changesets with 1 changes to 1 files |
|
465 | 465 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
466 | 466 | no changes made to subrepo t since last push to $TESTTMP/t/t |
|
467 | 467 | searching for changes |
|
468 | 468 | no changes found |
|
469 | 469 | [1] |
|
470 | 470 | |
|
471 | 471 | a subrepo store may be clean versus one repo but not versus another |
|
472 | 472 | |
|
473 | 473 | $ hg push |
|
474 | 474 | pushing to $TESTTMP/t (glob) |
|
475 | 475 | no changes made to subrepo s/ss since last push to $TESTTMP/t/s/ss (glob) |
|
476 | 476 | no changes made to subrepo s since last push to $TESTTMP/t/s |
|
477 | 477 | no changes made to subrepo t since last push to $TESTTMP/t/t |
|
478 | 478 | searching for changes |
|
479 | 479 | no changes found |
|
480 | 480 | [1] |
|
481 | 481 | $ hg push ../tcc |
|
482 | 482 | pushing to ../tcc |
|
483 | 483 | pushing subrepo s/ss to ../tcc/s/ss (glob) |
|
484 | 484 | searching for changes |
|
485 | 485 | adding changesets |
|
486 | 486 | adding manifests |
|
487 | 487 | adding file changes |
|
488 | 488 | added 1 changesets with 1 changes to 1 files |
|
489 | 489 | no changes made to subrepo s since last push to ../tcc/s |
|
490 | 490 | no changes made to subrepo t since last push to ../tcc/t |
|
491 | 491 | searching for changes |
|
492 | 492 | no changes found |
|
493 | 493 | [1] |
|
494 | 494 | |
|
495 | 495 | update |
|
496 | 496 | |
|
497 | 497 | $ cd ../t |
|
498 | 498 | $ hg up -C # discard our earlier merge |
|
499 | 499 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
500 | 500 | $ echo blah > t/t |
|
501 | 501 | $ hg ci -m13 |
|
502 | 502 | committing subrepository t |
|
503 | 503 | |
|
504 | 504 | backout calls revert internally with minimal opts, which should not raise |
|
505 | 505 | KeyError |
|
506 | 506 | |
|
507 | 507 | $ hg backout ".^" |
|
508 | 508 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
509 | 509 | changeset c373c8102e68 backed out, don't forget to commit. |
|
510 | 510 | |
|
511 | 511 | $ hg up -C # discard changes |
|
512 | 512 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
513 | 513 | |
|
514 | 514 | pull |
|
515 | 515 | |
|
516 | 516 | $ cd ../tc |
|
517 | 517 | $ hg pull |
|
518 | 518 | pulling from $TESTTMP/t (glob) |
|
519 | 519 | searching for changes |
|
520 | 520 | adding changesets |
|
521 | 521 | adding manifests |
|
522 | 522 | adding file changes |
|
523 | 523 | added 1 changesets with 1 changes to 1 files |
|
524 | 524 | (run 'hg update' to get a working copy) |
|
525 | 525 | |
|
526 | 526 | should pull t |
|
527 | 527 | |
|
528 | 528 | $ hg up |
|
529 | 529 | pulling subrepo t from $TESTTMP/t/t |
|
530 | 530 | searching for changes |
|
531 | 531 | adding changesets |
|
532 | 532 | adding manifests |
|
533 | 533 | adding file changes |
|
534 | 534 | added 1 changesets with 1 changes to 1 files |
|
535 | 535 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
536 | 536 | $ cat t/t |
|
537 | 537 | blah |
|
538 | 538 | |
|
539 | 539 | bogus subrepo path aborts |
|
540 | 540 | |
|
541 | 541 | $ echo 'bogus=[boguspath' >> .hgsub |
|
542 | 542 | $ hg ci -m 'bogus subrepo path' |
|
543 | 543 | abort: missing ] in subrepo source |
|
544 | 544 | [255] |
|
545 | 545 | |
|
546 | 546 | Issue1986: merge aborts when trying to merge a subrepo that |
|
547 | 547 | shouldn't need merging |
|
548 | 548 | |
|
549 | 549 | # subrepo layout |
|
550 | 550 | # |
|
551 | 551 | # o 5 br |
|
552 | 552 | # /| |
|
553 | 553 | # o | 4 default |
|
554 | 554 | # | | |
|
555 | 555 | # | o 3 br |
|
556 | 556 | # |/| |
|
557 | 557 | # o | 2 default |
|
558 | 558 | # | | |
|
559 | 559 | # | o 1 br |
|
560 | 560 | # |/ |
|
561 | 561 | # o 0 default |
|
562 | 562 | |
|
563 | 563 | $ cd .. |
|
564 | 564 | $ rm -rf sub |
|
565 | 565 | $ hg init main |
|
566 | 566 | $ cd main |
|
567 | 567 | $ hg init s |
|
568 | 568 | $ cd s |
|
569 | 569 | $ echo a > a |
|
570 | 570 | $ hg ci -Am1 |
|
571 | 571 | adding a |
|
572 | 572 | $ hg branch br |
|
573 | 573 | marked working directory as branch br |
|
574 | 574 | (branches are permanent and global, did you want a bookmark?) |
|
575 | 575 | $ echo a >> a |
|
576 | 576 | $ hg ci -m1 |
|
577 | 577 | $ hg up default |
|
578 | 578 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
579 | 579 | $ echo b > b |
|
580 | 580 | $ hg ci -Am1 |
|
581 | 581 | adding b |
|
582 | 582 | $ hg up br |
|
583 | 583 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
584 | 584 | $ hg merge tip |
|
585 | 585 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
586 | 586 | (branch merge, don't forget to commit) |
|
587 | 587 | $ hg ci -m1 |
|
588 | 588 | $ hg up 2 |
|
589 | 589 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
590 | 590 | $ echo c > c |
|
591 | 591 | $ hg ci -Am1 |
|
592 | 592 | adding c |
|
593 | 593 | $ hg up 3 |
|
594 | 594 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
595 | 595 | $ hg merge 4 |
|
596 | 596 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
597 | 597 | (branch merge, don't forget to commit) |
|
598 | 598 | $ hg ci -m1 |
|
599 | 599 | |
|
600 | 600 | # main repo layout: |
|
601 | 601 | # |
|
602 | 602 | # * <-- try to merge default into br again |
|
603 | 603 | # .`| |
|
604 | 604 | # . o 5 br --> substate = 5 |
|
605 | 605 | # . | |
|
606 | 606 | # o | 4 default --> substate = 4 |
|
607 | 607 | # | | |
|
608 | 608 | # | o 3 br --> substate = 2 |
|
609 | 609 | # |/| |
|
610 | 610 | # o | 2 default --> substate = 2 |
|
611 | 611 | # | | |
|
612 | 612 | # | o 1 br --> substate = 3 |
|
613 | 613 | # |/ |
|
614 | 614 | # o 0 default --> substate = 2 |
|
615 | 615 | |
|
616 | 616 | $ cd .. |
|
617 | 617 | $ echo 's = s' > .hgsub |
|
618 | 618 | $ hg -R s up 2 |
|
619 | 619 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
620 | 620 | $ hg ci -Am1 |
|
621 | 621 | adding .hgsub |
|
622 | 622 | $ hg branch br |
|
623 | 623 | marked working directory as branch br |
|
624 | 624 | (branches are permanent and global, did you want a bookmark?) |
|
625 | 625 | $ echo b > b |
|
626 | 626 | $ hg -R s up 3 |
|
627 | 627 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
628 | 628 | $ hg ci -Am1 |
|
629 | 629 | adding b |
|
630 | 630 | $ hg up default |
|
631 | 631 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
632 | 632 | $ echo c > c |
|
633 | 633 | $ hg ci -Am1 |
|
634 | 634 | adding c |
|
635 | 635 | $ hg up 1 |
|
636 | 636 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
637 | 637 | $ hg merge 2 |
|
638 | 638 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
639 | 639 | (branch merge, don't forget to commit) |
|
640 | 640 | $ hg ci -m1 |
|
641 | 641 | $ hg up 2 |
|
642 | 642 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
643 | 643 | $ hg -R s up 4 |
|
644 | 644 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
645 | 645 | $ echo d > d |
|
646 | 646 | $ hg ci -Am1 |
|
647 | 647 | adding d |
|
648 | 648 | $ hg up 3 |
|
649 | 649 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
650 | 650 | $ hg -R s up 5 |
|
651 | 651 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
652 | 652 | $ echo e > e |
|
653 | 653 | $ hg ci -Am1 |
|
654 | 654 | adding e |
|
655 | 655 | |
|
656 | 656 | $ hg up 5 |
|
657 | 657 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
658 | 658 | $ hg merge 4 # try to merge default into br again |
|
659 | 659 | subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88) |
|
660 | 660 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
661 | 661 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
662 | 662 | (branch merge, don't forget to commit) |
|
663 | 663 | $ cd .. |
|
664 | 664 | |
|
665 | 665 | test subrepo delete from .hgsubstate |
|
666 | 666 | |
|
667 | 667 | $ hg init testdelete |
|
668 | 668 | $ mkdir testdelete/nested testdelete/nested2 |
|
669 | 669 | $ hg init testdelete/nested |
|
670 | 670 | $ hg init testdelete/nested2 |
|
671 | 671 | $ echo test > testdelete/nested/foo |
|
672 | 672 | $ echo test > testdelete/nested2/foo |
|
673 | 673 | $ hg -R testdelete/nested add |
|
674 | 674 | adding testdelete/nested/foo (glob) |
|
675 | 675 | $ hg -R testdelete/nested2 add |
|
676 | 676 | adding testdelete/nested2/foo (glob) |
|
677 | 677 | $ hg -R testdelete/nested ci -m test |
|
678 | 678 | $ hg -R testdelete/nested2 ci -m test |
|
679 | 679 | $ echo nested = nested > testdelete/.hgsub |
|
680 | 680 | $ echo nested2 = nested2 >> testdelete/.hgsub |
|
681 | 681 | $ hg -R testdelete add |
|
682 | 682 | adding testdelete/.hgsub (glob) |
|
683 | 683 | $ hg -R testdelete ci -m "nested 1 & 2 added" |
|
684 | 684 | $ echo nested = nested > testdelete/.hgsub |
|
685 | 685 | $ hg -R testdelete ci -m "nested 2 deleted" |
|
686 | 686 | $ cat testdelete/.hgsubstate |
|
687 | 687 | bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested |
|
688 | 688 | $ hg -R testdelete remove testdelete/.hgsub |
|
689 | 689 | $ hg -R testdelete ci -m ".hgsub deleted" |
|
690 | 690 | $ cat testdelete/.hgsubstate |
|
691 | 691 | bdf5c9a3103743d900b12ae0db3ffdcfd7b0d878 nested |
|
692 | 692 | |
|
693 | 693 | test repository cloning |
|
694 | 694 | |
|
695 | 695 | $ mkdir mercurial mercurial2 |
|
696 | 696 | $ hg init nested_absolute |
|
697 | 697 | $ echo test > nested_absolute/foo |
|
698 | 698 | $ hg -R nested_absolute add |
|
699 | 699 | adding nested_absolute/foo (glob) |
|
700 | 700 | $ hg -R nested_absolute ci -mtest |
|
701 | 701 | $ cd mercurial |
|
702 | 702 | $ hg init nested_relative |
|
703 | 703 | $ echo test2 > nested_relative/foo2 |
|
704 | 704 | $ hg -R nested_relative add |
|
705 | 705 | adding nested_relative/foo2 (glob) |
|
706 | 706 | $ hg -R nested_relative ci -mtest2 |
|
707 | 707 | $ hg init main |
|
708 | 708 | $ echo "nested_relative = ../nested_relative" > main/.hgsub |
|
709 | 709 | $ echo "nested_absolute = `pwd`/nested_absolute" >> main/.hgsub |
|
710 | 710 | $ hg -R main add |
|
711 | 711 | adding main/.hgsub (glob) |
|
712 | 712 | $ hg -R main ci -m "add subrepos" |
|
713 | 713 | $ cd .. |
|
714 | 714 | $ hg clone mercurial/main mercurial2/main |
|
715 | 715 | updating to branch default |
|
716 | 716 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
717 | 717 | $ cat mercurial2/main/nested_absolute/.hg/hgrc \ |
|
718 | 718 | > mercurial2/main/nested_relative/.hg/hgrc |
|
719 | 719 | [paths] |
|
720 | 720 | default = $TESTTMP/mercurial/nested_absolute |
|
721 | 721 | [paths] |
|
722 | 722 | default = $TESTTMP/mercurial/nested_relative |
|
723 | 723 | $ rm -rf mercurial mercurial2 |
|
724 | 724 | |
|
725 | 725 | Issue1977: multirepo push should fail if subrepo push fails |
|
726 | 726 | |
|
727 | 727 | $ hg init repo |
|
728 | 728 | $ hg init repo/s |
|
729 | 729 | $ echo a > repo/s/a |
|
730 | 730 | $ hg -R repo/s ci -Am0 |
|
731 | 731 | adding a |
|
732 | 732 | $ echo s = s > repo/.hgsub |
|
733 | 733 | $ hg -R repo ci -Am1 |
|
734 | 734 | adding .hgsub |
|
735 | 735 | $ hg clone repo repo2 |
|
736 | 736 | updating to branch default |
|
737 | 737 | cloning subrepo s from $TESTTMP/repo/s |
|
738 | 738 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
739 | 739 | $ hg -q -R repo2 pull -u |
|
740 | 740 | $ echo 1 > repo2/s/a |
|
741 | 741 | $ hg -R repo2/s ci -m2 |
|
742 | 742 | $ hg -q -R repo2/s push |
|
743 | 743 | $ hg -R repo2/s up -C 0 |
|
744 | 744 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
745 | 745 | $ echo 2 > repo2/s/b |
|
746 | 746 | $ hg -R repo2/s ci -m3 -A |
|
747 | 747 | adding b |
|
748 | 748 | created new head |
|
749 | 749 | $ hg -R repo2 ci -m3 |
|
750 | 750 | $ hg -q -R repo2 push |
|
751 | 751 | abort: push creates new remote head cc505f09a8b2! (in subrepo s) |
|
752 | 752 | (merge or see "hg help push" for details about pushing new heads) |
|
753 | 753 | [255] |
|
754 | 754 | $ hg -R repo update |
|
755 | 755 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
756 | 756 | |
|
757 | 757 | test if untracked file is not overwritten |
|
758 | 758 | |
|
759 | 759 | $ echo issue3276_ok > repo/s/b |
|
760 | 760 | $ hg -R repo2 push -f -q |
|
761 | 761 | $ hg -R repo update |
|
762 | 762 | b: untracked file differs |
|
763 | 763 | abort: untracked files in working directory differ from files in requested revision (in subrepo s) |
|
764 | 764 | [255] |
|
765 | 765 | |
|
766 | 766 | $ cat repo/s/b |
|
767 | 767 | issue3276_ok |
|
768 | 768 | $ rm repo/s/b |
|
769 | 769 | $ hg -R repo revert --all |
|
770 | 770 | reverting repo/.hgsubstate (glob) |
|
771 | 771 | reverting subrepo s |
|
772 | 772 | $ hg -R repo update |
|
773 | 773 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
774 | 774 | $ cat repo/s/b |
|
775 | 775 | 2 |
|
776 | 776 | $ rm -rf repo2 repo |
|
777 | 777 | |
|
778 | 778 | |
|
779 | 779 | Issue1852 subrepos with relative paths always push/pull relative to default |
|
780 | 780 | |
|
781 | 781 | Prepare a repo with subrepo |
|
782 | 782 | |
|
783 | 783 | $ hg init issue1852a |
|
784 | 784 | $ cd issue1852a |
|
785 | 785 | $ hg init sub/repo |
|
786 | 786 | $ echo test > sub/repo/foo |
|
787 | 787 | $ hg -R sub/repo add sub/repo/foo |
|
788 | 788 | $ echo sub/repo = sub/repo > .hgsub |
|
789 | 789 | $ hg add .hgsub |
|
790 | 790 | $ hg ci -mtest |
|
791 | 791 | committing subrepository sub/repo (glob) |
|
792 | 792 | $ echo test >> sub/repo/foo |
|
793 | 793 | $ hg ci -mtest |
|
794 | 794 | committing subrepository sub/repo (glob) |
|
795 | 795 | $ hg cat sub/repo/foo |
|
796 | 796 | test |
|
797 | 797 | test |
|
798 | 798 | $ mkdir -p tmp/sub/repo |
|
799 | 799 | $ hg cat -r 0 --output tmp/%p_p sub/repo/foo |
|
800 | 800 | $ cat tmp/sub/repo/foo_p |
|
801 | 801 | test |
|
802 | 802 | $ mv sub/repo sub_ |
|
803 | 803 | $ hg cat sub/repo/baz |
|
804 | 804 | skipping missing subrepository: sub/repo |
|
805 | 805 | [1] |
|
806 | 806 | $ rm -rf sub/repo |
|
807 | 807 | $ mv sub_ sub/repo |
|
808 | 808 | $ cd .. |
|
809 | 809 | |
|
810 | 810 | Create repo without default path, pull top repo, and see what happens on update |
|
811 | 811 | |
|
812 | 812 | $ hg init issue1852b |
|
813 | 813 | $ hg -R issue1852b pull issue1852a |
|
814 | 814 | pulling from issue1852a |
|
815 | 815 | requesting all changes |
|
816 | 816 | adding changesets |
|
817 | 817 | adding manifests |
|
818 | 818 | adding file changes |
|
819 | 819 | added 2 changesets with 3 changes to 2 files |
|
820 | 820 | (run 'hg update' to get a working copy) |
|
821 | 821 | $ hg -R issue1852b update |
|
822 | 822 | abort: default path for subrepository not found (in subrepo sub/repo) (glob) |
|
823 | 823 | [255] |
|
824 | 824 | |
|
825 | 825 | Ensure a full traceback, not just the SubrepoAbort part |
|
826 | 826 | |
|
827 | 827 | $ hg -R issue1852b update --traceback 2>&1 | grep 'raise util\.Abort' |
|
828 | 828 | raise util.Abort(_("default path for subrepository not found")) |
|
829 | 829 | |
|
830 | 830 | Pull -u now doesn't help |
|
831 | 831 | |
|
832 | 832 | $ hg -R issue1852b pull -u issue1852a |
|
833 | 833 | pulling from issue1852a |
|
834 | 834 | searching for changes |
|
835 | 835 | no changes found |
|
836 | 836 | |
|
837 | 837 | Try the same, but with pull -u |
|
838 | 838 | |
|
839 | 839 | $ hg init issue1852c |
|
840 | 840 | $ hg -R issue1852c pull -r0 -u issue1852a |
|
841 | 841 | pulling from issue1852a |
|
842 | 842 | adding changesets |
|
843 | 843 | adding manifests |
|
844 | 844 | adding file changes |
|
845 | 845 | added 1 changesets with 2 changes to 2 files |
|
846 | 846 | cloning subrepo sub/repo from issue1852a/sub/repo (glob) |
|
847 | 847 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
848 | 848 | |
|
849 | 849 | Try to push from the other side |
|
850 | 850 | |
|
851 | 851 | $ hg -R issue1852a push `pwd`/issue1852c |
|
852 | 852 | pushing to $TESTTMP/issue1852c (glob) |
|
853 | 853 | pushing subrepo sub/repo to $TESTTMP/issue1852c/sub/repo (glob) |
|
854 | 854 | searching for changes |
|
855 | 855 | no changes found |
|
856 | 856 | searching for changes |
|
857 | 857 | adding changesets |
|
858 | 858 | adding manifests |
|
859 | 859 | adding file changes |
|
860 | 860 | added 1 changesets with 1 changes to 1 files |
|
861 | 861 | |
|
862 | 862 | Incoming and outgoing should not use the default path: |
|
863 | 863 | |
|
864 | 864 | $ hg clone -q issue1852a issue1852d |
|
865 | 865 | $ hg -R issue1852d outgoing --subrepos issue1852c |
|
866 | 866 | comparing with issue1852c |
|
867 | 867 | searching for changes |
|
868 | 868 | no changes found |
|
869 | 869 | comparing with issue1852c/sub/repo |
|
870 | 870 | searching for changes |
|
871 | 871 | no changes found |
|
872 | 872 | [1] |
|
873 | 873 | $ hg -R issue1852d incoming --subrepos issue1852c |
|
874 | 874 | comparing with issue1852c |
|
875 | 875 | searching for changes |
|
876 | 876 | no changes found |
|
877 | 877 | comparing with issue1852c/sub/repo |
|
878 | 878 | searching for changes |
|
879 | 879 | no changes found |
|
880 | 880 | [1] |
|
881 | 881 | |
|
882 | 882 | Check status of files when none of them belong to the first |
|
883 | 883 | subrepository: |
|
884 | 884 | |
|
885 | 885 | $ hg init subrepo-status |
|
886 | 886 | $ cd subrepo-status |
|
887 | 887 | $ hg init subrepo-1 |
|
888 | 888 | $ hg init subrepo-2 |
|
889 | 889 | $ cd subrepo-2 |
|
890 | 890 | $ touch file |
|
891 | 891 | $ hg add file |
|
892 | 892 | $ cd .. |
|
893 | 893 | $ echo subrepo-1 = subrepo-1 > .hgsub |
|
894 | 894 | $ echo subrepo-2 = subrepo-2 >> .hgsub |
|
895 | 895 | $ hg add .hgsub |
|
896 | 896 | $ hg ci -m 'Added subrepos' |
|
897 | 897 | committing subrepository subrepo-2 |
|
898 | 898 | $ hg st subrepo-2/file |
|
899 | 899 | |
|
900 | 900 | Check that share works with subrepo |
|
901 | 901 | $ hg --config extensions.share= share . ../shared |
|
902 | 902 | updating working directory |
|
903 | 903 | cloning subrepo subrepo-2 from $TESTTMP/subrepo-status/subrepo-2 |
|
904 | 904 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
905 | 905 | $ test -f ../shared/subrepo-1/.hg/sharedpath |
|
906 | 906 | [1] |
|
907 | 907 | $ hg -R ../shared in |
|
908 | 908 | abort: repository default not found! |
|
909 | 909 | [255] |
|
910 | 910 | $ hg -R ../shared/subrepo-2 showconfig paths |
|
911 | 911 | paths.default=$TESTTMP/subrepo-status/subrepo-2 |
|
912 | 912 | $ hg -R ../shared/subrepo-1 sum --remote |
|
913 | 913 | parent: -1:000000000000 tip (empty repository) |
|
914 | 914 | branch: default |
|
915 | 915 | commit: (clean) |
|
916 | 916 | update: (current) |
|
917 | 917 | remote: (synced) |
|
918 | 918 | |
|
919 | 919 | Check hg update --clean |
|
920 | 920 | $ cd $TESTTMP/t |
|
921 | 921 | $ rm -r t/t.orig |
|
922 | 922 | $ hg status -S --all |
|
923 | 923 | C .hgsub |
|
924 | 924 | C .hgsubstate |
|
925 | 925 | C a |
|
926 | 926 | C s/.hgsub |
|
927 | 927 | C s/.hgsubstate |
|
928 | 928 | C s/a |
|
929 | 929 | C s/ss/a |
|
930 | 930 | C t/t |
|
931 | 931 | $ echo c1 > s/a |
|
932 | 932 | $ cd s |
|
933 | 933 | $ echo c1 > b |
|
934 | 934 | $ echo c1 > c |
|
935 | 935 | $ hg add b |
|
936 | 936 | $ cd .. |
|
937 | 937 | $ hg status -S |
|
938 | 938 | M s/a |
|
939 | 939 | A s/b |
|
940 | 940 | ? s/c |
|
941 | 941 | $ hg update -C |
|
942 | 942 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
943 | 943 | $ hg status -S |
|
944 | 944 | ? s/b |
|
945 | 945 | ? s/c |
|
946 | 946 | |
|
947 | 947 | Sticky subrepositories, no changes |
|
948 | 948 | $ cd $TESTTMP/t |
|
949 | 949 | $ hg id |
|
950 | 950 | 925c17564ef8 tip |
|
951 | 951 | $ hg -R s id |
|
952 | 952 | 12a213df6fa9 tip |
|
953 | 953 | $ hg -R t id |
|
954 | 954 | 52c0adc0515a tip |
|
955 | 955 | $ hg update 11 |
|
956 | 956 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
957 | 957 | $ hg id |
|
958 | 958 | 365661e5936a |
|
959 | 959 | $ hg -R s id |
|
960 | 960 | fc627a69481f |
|
961 | 961 | $ hg -R t id |
|
962 | 962 | e95bcfa18a35 |
|
963 | 963 | |
|
964 | 964 | Sticky subrepositories, file changes |
|
965 | 965 | $ touch s/f1 |
|
966 | 966 | $ touch t/f1 |
|
967 | 967 | $ hg add -S s/f1 |
|
968 | 968 | $ hg add -S t/f1 |
|
969 | 969 | $ hg id |
|
970 | 970 | 365661e5936a+ |
|
971 | 971 | $ hg -R s id |
|
972 | 972 | fc627a69481f+ |
|
973 | 973 | $ hg -R t id |
|
974 | 974 | e95bcfa18a35+ |
|
975 | 975 | $ hg update tip |
|
976 | 976 | subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9) |
|
977 | 977 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
978 | 978 | subrepository sources for s differ |
|
979 | 979 | use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? |
|
980 | 980 | l |
|
981 | 981 | subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a) |
|
982 | 982 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
983 | 983 | subrepository sources for t differ |
|
984 | 984 | use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? |
|
985 | 985 | l |
|
986 | 986 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
987 | 987 | $ hg id |
|
988 | 988 | 925c17564ef8+ tip |
|
989 | 989 | $ hg -R s id |
|
990 | 990 | fc627a69481f+ |
|
991 | 991 | $ hg -R t id |
|
992 | 992 | e95bcfa18a35+ |
|
993 | 993 | $ hg update --clean tip |
|
994 | 994 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
995 | 995 | |
|
996 | 996 | Sticky subrepository, revision updates |
|
997 | 997 | $ hg id |
|
998 | 998 | 925c17564ef8 tip |
|
999 | 999 | $ hg -R s id |
|
1000 | 1000 | 12a213df6fa9 tip |
|
1001 | 1001 | $ hg -R t id |
|
1002 | 1002 | 52c0adc0515a tip |
|
1003 | 1003 | $ cd s |
|
1004 | 1004 | $ hg update -r -2 |
|
1005 | 1005 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1006 | 1006 | $ cd ../t |
|
1007 | 1007 | $ hg update -r 2 |
|
1008 | 1008 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1009 | 1009 | $ cd .. |
|
1010 | 1010 | $ hg update 10 |
|
1011 | 1011 | subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) |
|
1012 | 1012 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
1013 | 1013 | subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c) |
|
1014 | 1014 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
1015 | 1015 | subrepository sources for t differ (in checked out version) |
|
1016 | 1016 | use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? |
|
1017 | 1017 | l |
|
1018 | 1018 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1019 | 1019 | $ hg id |
|
1020 | 1020 | e45c8b14af55+ |
|
1021 | 1021 | $ hg -R s id |
|
1022 | 1022 | 02dcf1d70411 |
|
1023 | 1023 | $ hg -R t id |
|
1024 | 1024 | 7af322bc1198 |
|
1025 | 1025 | |
|
1026 | 1026 | Sticky subrepository, file changes and revision updates |
|
1027 | 1027 | $ touch s/f1 |
|
1028 | 1028 | $ touch t/f1 |
|
1029 | 1029 | $ hg add -S s/f1 |
|
1030 | 1030 | $ hg add -S t/f1 |
|
1031 | 1031 | $ hg id |
|
1032 | 1032 | e45c8b14af55+ |
|
1033 | 1033 | $ hg -R s id |
|
1034 | 1034 | 02dcf1d70411+ |
|
1035 | 1035 | $ hg -R t id |
|
1036 | 1036 | 7af322bc1198+ |
|
1037 | 1037 | $ hg update tip |
|
1038 | 1038 | subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9) |
|
1039 | 1039 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
1040 | 1040 | subrepository sources for s differ |
|
1041 | 1041 | use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? |
|
1042 | 1042 | l |
|
1043 | 1043 | subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a) |
|
1044 | 1044 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
1045 | 1045 | subrepository sources for t differ |
|
1046 | 1046 | use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? |
|
1047 | 1047 | l |
|
1048 | 1048 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1049 | 1049 | $ hg id |
|
1050 | 1050 | 925c17564ef8+ tip |
|
1051 | 1051 | $ hg -R s id |
|
1052 | 1052 | 02dcf1d70411+ |
|
1053 | 1053 | $ hg -R t id |
|
1054 | 1054 | 7af322bc1198+ |
|
1055 | 1055 | |
|
1056 | 1056 | Sticky repository, update --clean |
|
1057 | 1057 | $ hg update --clean tip |
|
1058 | 1058 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1059 | 1059 | $ hg id |
|
1060 | 1060 | 925c17564ef8 tip |
|
1061 | 1061 | $ hg -R s id |
|
1062 | 1062 | 12a213df6fa9 tip |
|
1063 | 1063 | $ hg -R t id |
|
1064 | 1064 | 52c0adc0515a tip |
|
1065 | 1065 | |
|
1066 | 1066 | Test subrepo already at intended revision: |
|
1067 | 1067 | $ cd s |
|
1068 | 1068 | $ hg update fc627a69481f |
|
1069 | 1069 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1070 | 1070 | $ cd .. |
|
1071 | 1071 | $ hg update 11 |
|
1072 | 1072 | subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f) |
|
1073 | 1073 | (M)erge, keep (l)ocal or keep (r)emote? m |
|
1074 | 1074 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1075 | 1075 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1076 | 1076 | $ hg id -n |
|
1077 | 1077 | 11+ |
|
1078 | 1078 | $ hg -R s id |
|
1079 | 1079 | fc627a69481f |
|
1080 | 1080 | $ hg -R t id |
|
1081 | 1081 | e95bcfa18a35 |
|
1082 | 1082 | |
|
1083 | 1083 | Test that removing .hgsubstate doesn't break anything: |
|
1084 | 1084 | |
|
1085 | 1085 | $ hg rm -f .hgsubstate |
|
1086 | 1086 | $ hg ci -mrm |
|
1087 | 1087 | nothing changed |
|
1088 | 1088 | [1] |
|
1089 | 1089 | $ hg log -vr tip |
|
1090 | 1090 | changeset: 13:925c17564ef8 |
|
1091 | 1091 | tag: tip |
|
1092 | 1092 | user: test |
|
1093 | 1093 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1094 | 1094 | files: .hgsubstate |
|
1095 | 1095 | description: |
|
1096 | 1096 | 13 |
|
1097 | 1097 | |
|
1098 | 1098 | |
|
1099 | 1099 | |
|
1100 | 1100 | Test that removing .hgsub removes .hgsubstate: |
|
1101 | 1101 | |
|
1102 | 1102 | $ hg rm .hgsub |
|
1103 | 1103 | $ hg ci -mrm2 |
|
1104 | 1104 | created new head |
|
1105 | 1105 | $ hg log -vr tip |
|
1106 | 1106 | changeset: 14:2400bccd50af |
|
1107 | 1107 | tag: tip |
|
1108 | 1108 | parent: 11:365661e5936a |
|
1109 | 1109 | user: test |
|
1110 | 1110 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1111 | 1111 | files: .hgsub .hgsubstate |
|
1112 | 1112 | description: |
|
1113 | 1113 | rm2 |
|
1114 | 1114 | |
|
1115 | 1115 | |
|
1116 | 1116 | Test issue3153: diff -S with deleted subrepos |
|
1117 | 1117 | |
|
1118 | 1118 | $ hg diff --nodates -S -c . |
|
1119 | 1119 | diff -r 365661e5936a -r 2400bccd50af .hgsub |
|
1120 | 1120 | --- a/.hgsub |
|
1121 | 1121 | +++ /dev/null |
|
1122 | 1122 | @@ -1,2 +0,0 @@ |
|
1123 | 1123 | -s = s |
|
1124 | 1124 | -t = t |
|
1125 | 1125 | diff -r 365661e5936a -r 2400bccd50af .hgsubstate |
|
1126 | 1126 | --- a/.hgsubstate |
|
1127 | 1127 | +++ /dev/null |
|
1128 | 1128 | @@ -1,2 +0,0 @@ |
|
1129 | 1129 | -fc627a69481fcbe5f1135069e8a3881c023e4cf5 s |
|
1130 | 1130 | -e95bcfa18a358dc4936da981ebf4147b4cad1362 t |
|
1131 | 1131 | |
|
1132 | 1132 | Test behavior of add for explicit path in subrepo: |
|
1133 | 1133 | $ cd .. |
|
1134 | 1134 | $ hg init explicit |
|
1135 | 1135 | $ cd explicit |
|
1136 | 1136 | $ echo s = s > .hgsub |
|
1137 | 1137 | $ hg add .hgsub |
|
1138 | 1138 | $ hg init s |
|
1139 | 1139 | $ hg ci -m0 |
|
1140 | 1140 | Adding with an explicit path in a subrepo adds the file |
|
1141 | 1141 | $ echo c1 > f1 |
|
1142 | 1142 | $ echo c2 > s/f2 |
|
1143 | 1143 | $ hg st -S |
|
1144 | 1144 | ? f1 |
|
1145 | 1145 | ? s/f2 |
|
1146 | 1146 | $ hg add s/f2 |
|
1147 | 1147 | $ hg st -S |
|
1148 | 1148 | A s/f2 |
|
1149 | 1149 | ? f1 |
|
1150 | 1150 | $ hg ci -R s -m0 |
|
1151 | 1151 | $ hg ci -Am1 |
|
1152 | 1152 | adding f1 |
|
1153 | 1153 | Adding with an explicit path in a subrepo with -S has the same behavior |
|
1154 | 1154 | $ echo c3 > f3 |
|
1155 | 1155 | $ echo c4 > s/f4 |
|
1156 | 1156 | $ hg st -S |
|
1157 | 1157 | ? f3 |
|
1158 | 1158 | ? s/f4 |
|
1159 | 1159 | $ hg add -S s/f4 |
|
1160 | 1160 | $ hg st -S |
|
1161 | 1161 | A s/f4 |
|
1162 | 1162 | ? f3 |
|
1163 | 1163 | $ hg ci -R s -m1 |
|
1164 | 1164 | $ hg ci -Ama2 |
|
1165 | 1165 | adding f3 |
|
1166 | 1166 | Adding without a path or pattern silently ignores subrepos |
|
1167 | 1167 | $ echo c5 > f5 |
|
1168 | 1168 | $ echo c6 > s/f6 |
|
1169 | 1169 | $ echo c7 > s/f7 |
|
1170 | 1170 | $ hg st -S |
|
1171 | 1171 | ? f5 |
|
1172 | 1172 | ? s/f6 |
|
1173 | 1173 | ? s/f7 |
|
1174 | 1174 | $ hg add |
|
1175 | 1175 | adding f5 |
|
1176 | 1176 | $ hg st -S |
|
1177 | 1177 | A f5 |
|
1178 | 1178 | ? s/f6 |
|
1179 | 1179 | ? s/f7 |
|
1180 | 1180 | $ hg ci -R s -Am2 |
|
1181 | 1181 | adding f6 |
|
1182 | 1182 | adding f7 |
|
1183 | 1183 | $ hg ci -m3 |
|
1184 | 1184 | Adding without a path or pattern with -S also adds files in subrepos |
|
1185 | 1185 | $ echo c8 > f8 |
|
1186 | 1186 | $ echo c9 > s/f9 |
|
1187 | 1187 | $ echo c10 > s/f10 |
|
1188 | 1188 | $ hg st -S |
|
1189 | 1189 | ? f8 |
|
1190 | 1190 | ? s/f10 |
|
1191 | 1191 | ? s/f9 |
|
1192 | 1192 | $ hg add -S |
|
1193 | 1193 | adding f8 |
|
1194 | 1194 | adding s/f10 (glob) |
|
1195 | 1195 | adding s/f9 (glob) |
|
1196 | 1196 | $ hg st -S |
|
1197 | 1197 | A f8 |
|
1198 | 1198 | A s/f10 |
|
1199 | 1199 | A s/f9 |
|
1200 | 1200 | $ hg ci -R s -m3 |
|
1201 | 1201 | $ hg ci -m4 |
|
1202 | 1202 | Adding with a pattern silently ignores subrepos |
|
1203 | 1203 | $ echo c11 > fm11 |
|
1204 | 1204 | $ echo c12 > fn12 |
|
1205 | 1205 | $ echo c13 > s/fm13 |
|
1206 | 1206 | $ echo c14 > s/fn14 |
|
1207 | 1207 | $ hg st -S |
|
1208 | 1208 | ? fm11 |
|
1209 | 1209 | ? fn12 |
|
1210 | 1210 | ? s/fm13 |
|
1211 | 1211 | ? s/fn14 |
|
1212 | 1212 | $ hg add 'glob:**fm*' |
|
1213 | 1213 | adding fm11 |
|
1214 | 1214 | $ hg st -S |
|
1215 | 1215 | A fm11 |
|
1216 | 1216 | ? fn12 |
|
1217 | 1217 | ? s/fm13 |
|
1218 | 1218 | ? s/fn14 |
|
1219 | 1219 | $ hg ci -R s -Am4 |
|
1220 | 1220 | adding fm13 |
|
1221 | 1221 | adding fn14 |
|
1222 | 1222 | $ hg ci -Am5 |
|
1223 | 1223 | adding fn12 |
|
1224 | 1224 | Adding with a pattern with -S also adds matches in subrepos |
|
1225 | 1225 | $ echo c15 > fm15 |
|
1226 | 1226 | $ echo c16 > fn16 |
|
1227 | 1227 | $ echo c17 > s/fm17 |
|
1228 | 1228 | $ echo c18 > s/fn18 |
|
1229 | 1229 | $ hg st -S |
|
1230 | 1230 | ? fm15 |
|
1231 | 1231 | ? fn16 |
|
1232 | 1232 | ? s/fm17 |
|
1233 | 1233 | ? s/fn18 |
|
1234 | 1234 | $ hg add -S 'glob:**fm*' |
|
1235 | 1235 | adding fm15 |
|
1236 | 1236 | adding s/fm17 (glob) |
|
1237 | 1237 | $ hg st -S |
|
1238 | 1238 | A fm15 |
|
1239 | 1239 | A s/fm17 |
|
1240 | 1240 | ? fn16 |
|
1241 | 1241 | ? s/fn18 |
|
1242 | 1242 | $ hg ci -R s -Am5 |
|
1243 | 1243 | adding fn18 |
|
1244 | 1244 | $ hg ci -Am6 |
|
1245 | 1245 | adding fn16 |
|
1246 | 1246 | |
|
1247 | 1247 | Test behavior of forget for explicit path in subrepo: |
|
1248 | 1248 | Forgetting an explicit path in a subrepo untracks the file |
|
1249 | 1249 | $ echo c19 > s/f19 |
|
1250 | 1250 | $ hg add s/f19 |
|
1251 | 1251 | $ hg st -S |
|
1252 | 1252 | A s/f19 |
|
1253 | 1253 | $ hg forget s/f19 |
|
1254 | 1254 | $ hg st -S |
|
1255 | 1255 | ? s/f19 |
|
1256 | 1256 | $ rm s/f19 |
|
1257 | 1257 | $ cd .. |
|
1258 | 1258 | |
|
1259 | 1259 | Courtesy phases synchronisation to publishing server does not block the push |
|
1260 | 1260 | (issue3781) |
|
1261 | 1261 | |
|
1262 | 1262 | $ cp -r main issue3781 |
|
1263 | 1263 | $ cp -r main issue3781-dest |
|
1264 | 1264 | $ cd issue3781-dest/s |
|
1265 | 1265 | $ hg phase tip # show we have draft changeset |
|
1266 | 1266 | 5: draft |
|
1267 | 1267 | $ chmod a-w .hg/store/phaseroots # prevent phase push |
|
1268 | 1268 | $ cd ../../issue3781 |
|
1269 | 1269 | $ cat >> .hg/hgrc << EOF |
|
1270 | 1270 | > [paths] |
|
1271 | 1271 | > default=../issue3781-dest/ |
|
1272 | 1272 | > EOF |
|
1273 | 1273 | $ hg push |
|
1274 | 1274 | pushing to $TESTTMP/issue3781-dest (glob) |
|
1275 | 1275 | pushing subrepo s to $TESTTMP/issue3781-dest/s |
|
1276 | 1276 | searching for changes |
|
1277 | 1277 | no changes found |
|
1278 | 1278 | searching for changes |
|
1279 | 1279 | no changes found |
|
1280 | 1280 | [1] |
|
1281 | 1281 | $ cd .. |
|
1282 | 1282 | |
|
1283 | 1283 | Test phase choice for newly created commit with "phases.subrepochecks" |
|
1284 | 1284 | configuration |
|
1285 | 1285 | |
|
1286 | 1286 | $ cd t |
|
1287 | 1287 | $ hg update -q -r 12 |
|
1288 | 1288 | |
|
1289 | 1289 | $ cat >> s/ss/.hg/hgrc <<EOF |
|
1290 | 1290 | > [phases] |
|
1291 | 1291 | > new-commit = secret |
|
1292 | 1292 | > EOF |
|
1293 | 1293 | $ cat >> s/.hg/hgrc <<EOF |
|
1294 | 1294 | > [phases] |
|
1295 | 1295 | > new-commit = draft |
|
1296 | 1296 | > EOF |
|
1297 | 1297 | $ echo phasecheck1 >> s/ss/a |
|
1298 | 1298 | $ hg -R s commit -S --config phases.checksubrepos=abort -m phasecheck1 |
|
1299 | 1299 | committing subrepository ss |
|
1300 | 1300 | transaction abort! |
|
1301 | 1301 | rollback completed |
|
1302 | 1302 | abort: can't commit in draft phase conflicting secret from subrepository ss |
|
1303 | 1303 | [255] |
|
1304 | 1304 | $ echo phasecheck2 >> s/ss/a |
|
1305 | 1305 | $ hg -R s commit -S --config phases.checksubrepos=ignore -m phasecheck2 |
|
1306 | 1306 | committing subrepository ss |
|
1307 | 1307 | $ hg -R s/ss phase tip |
|
1308 | 1308 | 3: secret |
|
1309 | 1309 | $ hg -R s phase tip |
|
1310 | 1310 | 6: draft |
|
1311 | 1311 | $ echo phasecheck3 >> s/ss/a |
|
1312 | 1312 | $ hg -R s commit -S -m phasecheck3 |
|
1313 | 1313 | committing subrepository ss |
|
1314 | 1314 | warning: changes are committed in secret phase from subrepository ss |
|
1315 | 1315 | $ hg -R s/ss phase tip |
|
1316 | 1316 | 4: secret |
|
1317 | 1317 | $ hg -R s phase tip |
|
1318 | 1318 | 7: secret |
|
1319 | 1319 | |
|
1320 | 1320 | $ cat >> t/.hg/hgrc <<EOF |
|
1321 | 1321 | > [phases] |
|
1322 | 1322 | > new-commit = draft |
|
1323 | 1323 | > EOF |
|
1324 | 1324 | $ cat >> .hg/hgrc <<EOF |
|
1325 | 1325 | > [phases] |
|
1326 | 1326 | > new-commit = public |
|
1327 | 1327 | > EOF |
|
1328 | 1328 | $ echo phasecheck4 >> s/ss/a |
|
1329 | 1329 | $ echo phasecheck4 >> t/t |
|
1330 | 1330 | $ hg commit -S -m phasecheck4 |
|
1331 | 1331 | committing subrepository s |
|
1332 | 1332 | committing subrepository s/ss |
|
1333 | 1333 | warning: changes are committed in secret phase from subrepository ss |
|
1334 | 1334 | committing subrepository t |
|
1335 | 1335 | warning: changes are committed in secret phase from subrepository s |
|
1336 | 1336 | created new head |
|
1337 | 1337 | $ hg -R s/ss phase tip |
|
1338 | 1338 | 5: secret |
|
1339 | 1339 | $ hg -R s phase tip |
|
1340 | 1340 | 8: secret |
|
1341 | 1341 | $ hg -R t phase tip |
|
1342 | 1342 | 6: draft |
|
1343 | 1343 | $ hg phase tip |
|
1344 | 1344 | 15: secret |
|
1345 | 1345 | |
|
1346 | 1346 | $ cd .. |
|
1347 | 1347 | |
|
1348 | 1348 | |
|
1349 | 1349 | Test that commit --secret works on both repo and subrepo (issue4182) |
|
1350 | 1350 | |
|
1351 | 1351 | $ cd main |
|
1352 | 1352 | $ echo secret >> b |
|
1353 | 1353 | $ echo secret >> s/b |
|
1354 | 1354 | $ hg commit --secret --subrepo -m "secret" |
|
1355 | 1355 | committing subrepository s |
|
1356 | 1356 | $ hg phase -r . |
|
1357 | 1357 | 6: secret |
|
1358 | 1358 | $ cd s |
|
1359 | 1359 | $ hg phase -r . |
|
1360 | 1360 | 6: secret |
|
1361 | 1361 | $ cd ../../ |
|
1362 | 1362 | |
|
1363 | Test "subrepos" template keyword | |
|
1364 | ||
|
1365 | $ cd t | |
|
1366 | $ hg update -q 15 | |
|
1367 | $ cat > .hgsub <<EOF | |
|
1368 | > s = s | |
|
1369 | > EOF | |
|
1370 | $ hg commit -m "16" | |
|
1371 | warning: changes are committed in secret phase from subrepository s | |
|
1372 | ||
|
1373 | (addition of ".hgsub" itself) | |
|
1374 | ||
|
1375 | $ hg diff --nodates -c 1 .hgsubstate | |
|
1376 | diff -r f7b1eb17ad24 -r 7cf8cfea66e4 .hgsubstate | |
|
1377 | --- /dev/null | |
|
1378 | +++ b/.hgsubstate | |
|
1379 | @@ -0,0 +1,1 @@ | |
|
1380 | +e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | |
|
1381 | $ hg log -r 1 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | |
|
1382 | f7b1eb17ad24 000000000000 | |
|
1383 | s | |
|
1384 | ||
|
1385 | (modification of existing entry) | |
|
1386 | ||
|
1387 | $ hg diff --nodates -c 2 .hgsubstate | |
|
1388 | diff -r 7cf8cfea66e4 -r df30734270ae .hgsubstate | |
|
1389 | --- a/.hgsubstate | |
|
1390 | +++ b/.hgsubstate | |
|
1391 | @@ -1,1 +1,1 @@ | |
|
1392 | -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | |
|
1393 | +dc73e2e6d2675eb2e41e33c205f4bdab4ea5111d s | |
|
1394 | $ hg log -r 2 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | |
|
1395 | 7cf8cfea66e4 000000000000 | |
|
1396 | s | |
|
1397 | ||
|
1398 | (addition of entry) | |
|
1399 | ||
|
1400 | $ hg diff --nodates -c 5 .hgsubstate | |
|
1401 | diff -r 7cf8cfea66e4 -r 1f14a2e2d3ec .hgsubstate | |
|
1402 | --- a/.hgsubstate | |
|
1403 | +++ b/.hgsubstate | |
|
1404 | @@ -1,1 +1,2 @@ | |
|
1405 | e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | |
|
1406 | +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t | |
|
1407 | $ hg log -r 5 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | |
|
1408 | 7cf8cfea66e4 000000000000 | |
|
1409 | t | |
|
1410 | ||
|
1411 | (removal of existing entry) | |
|
1412 | ||
|
1413 | $ hg diff --nodates -c 16 .hgsubstate | |
|
1414 | diff -r 8bec38d2bd0b -r f2f70bc3d3c9 .hgsubstate | |
|
1415 | --- a/.hgsubstate | |
|
1416 | +++ b/.hgsubstate | |
|
1417 | @@ -1,2 +1,1 @@ | |
|
1418 | 0731af8ca9423976d3743119d0865097c07bdc1b s | |
|
1419 | -e202dc79b04c88a636ea8913d9182a1346d9b3dc t | |
|
1420 | $ hg log -r 16 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | |
|
1421 | 8bec38d2bd0b 000000000000 | |
|
1422 | t | |
|
1423 | ||
|
1424 | (merging) | |
|
1425 | ||
|
1426 | $ hg diff --nodates -c 9 .hgsubstate | |
|
1427 | diff -r f6affe3fbfaa -r f0d2028bf86d .hgsubstate | |
|
1428 | --- a/.hgsubstate | |
|
1429 | +++ b/.hgsubstate | |
|
1430 | @@ -1,1 +1,2 @@ | |
|
1431 | fc627a69481fcbe5f1135069e8a3881c023e4cf5 s | |
|
1432 | +60ca1237c19474e7a3978b0dc1ca4e6f36d51382 t | |
|
1433 | $ hg log -r 9 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | |
|
1434 | f6affe3fbfaa 1f14a2e2d3ec | |
|
1435 | t | |
|
1436 | ||
|
1437 | (removal of ".hgsub" itself) | |
|
1438 | ||
|
1439 | $ hg diff --nodates -c 8 .hgsubstate | |
|
1440 | diff -r f94576341bcf -r 96615c1dad2d .hgsubstate | |
|
1441 | --- a/.hgsubstate | |
|
1442 | +++ /dev/null | |
|
1443 | @@ -1,2 +0,0 @@ | |
|
1444 | -e4ece1bf43360ddc8f6a96432201a37b7cd27ae4 s | |
|
1445 | -7af322bc1198a32402fe903e0b7ebcfc5c9bf8f4 t | |
|
1446 | $ hg log -r 8 --template "{p1node|short} {p2node|short}\n{subrepos % '{subrepo}\n'}" | |
|
1447 | f94576341bcf 000000000000 | |
|
1448 | ||
|
1363 | 1449 | Test that '[paths]' is configured correctly at subrepo creation |
|
1364 | 1450 | |
|
1365 | 1451 | $ cd $TESTTMP/tc |
|
1366 | 1452 | $ cat > .hgsub <<EOF |
|
1367 | 1453 |
> # |
|
1368 | 1454 | > s = s |
|
1369 | 1455 | > t = t |
|
1370 | 1456 | > EOF |
|
1371 | 1457 |
$ |
|
1372 | 1458 |
$ |
|
1373 | 1459 |
$ |
|
1374 | 1460 | > [paths] |
|
1375 | 1461 | > default-push = /foo/bar |
|
1376 | 1462 | > EOF |
|
1377 | 1463 |
$ |
|
1378 | 1464 |
$ |
|
1379 | 1465 | [paths] |
|
1380 | 1466 |
default |
|
1381 | 1467 |
default |
|
1382 | 1468 |
$ |
|
1383 | 1469 | [paths] |
|
1384 | 1470 |
default |
|
1385 | 1471 |
default |
|
1386 | 1472 |
$ |
|
1387 | 1473 | [paths] |
|
1388 | 1474 |
default |
|
1389 | 1475 |
default |
|
1390 | 1476 |
$ |
General Comments 0
You need to be logged in to leave comments.
Login now