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