##// END OF EJS Templates
templatekw: add an "obsolete" keyword...
Denis Laxalde -
r31699:568c4e74 default
parent child Browse files
Show More
@@ -1,630 +1,638 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 __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 from .node import hex, nullid
10 from .node import hex, nullid
11 from . import (
11 from . import (
12 encoding,
12 encoding,
13 error,
13 error,
14 hbisect,
14 hbisect,
15 patch,
15 patch,
16 registrar,
16 registrar,
17 scmutil,
17 scmutil,
18 util,
18 util,
19 )
19 )
20
20
21 # This helper class allows us to handle both:
21 # This helper class allows us to handle both:
22 # "{files}" (legacy command-line-specific list hack) and
22 # "{files}" (legacy command-line-specific list hack) and
23 # "{files % '{file}\n'}" (hgweb-style with inlining and function support)
23 # "{files % '{file}\n'}" (hgweb-style with inlining and function support)
24 # and to access raw values:
24 # and to access raw values:
25 # "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
25 # "{ifcontains(file, files, ...)}", "{ifcontains(key, extras, ...)}"
26 # "{get(extras, key)}"
26 # "{get(extras, key)}"
27
27
28 class _hybrid(object):
28 class _hybrid(object):
29 def __init__(self, gen, values, makemap, joinfmt):
29 def __init__(self, gen, values, makemap, joinfmt):
30 self.gen = gen
30 self.gen = gen
31 self.values = values
31 self.values = values
32 self._makemap = makemap
32 self._makemap = makemap
33 self.joinfmt = joinfmt
33 self.joinfmt = joinfmt
34 def __iter__(self):
34 def __iter__(self):
35 return self.gen
35 return self.gen
36 def itermaps(self):
36 def itermaps(self):
37 makemap = self._makemap
37 makemap = self._makemap
38 for x in self.values:
38 for x in self.values:
39 yield makemap(x)
39 yield makemap(x)
40 def __contains__(self, x):
40 def __contains__(self, x):
41 return x in self.values
41 return x in self.values
42 def __len__(self):
42 def __len__(self):
43 return len(self.values)
43 return len(self.values)
44 def __getattr__(self, name):
44 def __getattr__(self, name):
45 if name != 'get':
45 if name != 'get':
46 raise AttributeError(name)
46 raise AttributeError(name)
47 return getattr(self.values, name)
47 return getattr(self.values, name)
48
48
49 def showlist(name, values, plural=None, element=None, separator=' ', **args):
49 def showlist(name, values, plural=None, element=None, separator=' ', **args):
50 if not element:
50 if not element:
51 element = name
51 element = name
52 f = _showlist(name, values, plural, separator, **args)
52 f = _showlist(name, values, plural, separator, **args)
53 return _hybrid(f, values, lambda x: {element: x}, lambda d: d[element])
53 return _hybrid(f, values, lambda x: {element: x}, lambda d: d[element])
54
54
55 def _showlist(name, values, plural=None, separator=' ', **args):
55 def _showlist(name, values, plural=None, separator=' ', **args):
56 '''expand set of values.
56 '''expand set of values.
57 name is name of key in template map.
57 name is name of key in template map.
58 values is list of strings or dicts.
58 values is list of strings or dicts.
59 plural is plural of name, if not simply name + 's'.
59 plural is plural of name, if not simply name + 's'.
60 separator is used to join values as a string
60 separator is used to join values as a string
61
61
62 expansion works like this, given name 'foo'.
62 expansion works like this, given name 'foo'.
63
63
64 if values is empty, expand 'no_foos'.
64 if values is empty, expand 'no_foos'.
65
65
66 if 'foo' not in template map, return values as a string,
66 if 'foo' not in template map, return values as a string,
67 joined by 'separator'.
67 joined by 'separator'.
68
68
69 expand 'start_foos'.
69 expand 'start_foos'.
70
70
71 for each value, expand 'foo'. if 'last_foo' in template
71 for each value, expand 'foo'. if 'last_foo' in template
72 map, expand it instead of 'foo' for last key.
72 map, expand it instead of 'foo' for last key.
73
73
74 expand 'end_foos'.
74 expand 'end_foos'.
75 '''
75 '''
76 templ = args['templ']
76 templ = args['templ']
77 if plural:
77 if plural:
78 names = plural
78 names = plural
79 else: names = name + 's'
79 else: names = name + 's'
80 if not values:
80 if not values:
81 noname = 'no_' + names
81 noname = 'no_' + names
82 if noname in templ:
82 if noname in templ:
83 yield templ(noname, **args)
83 yield templ(noname, **args)
84 return
84 return
85 if name not in templ:
85 if name not in templ:
86 if isinstance(values[0], str):
86 if isinstance(values[0], str):
87 yield separator.join(values)
87 yield separator.join(values)
88 else:
88 else:
89 for v in values:
89 for v in values:
90 yield dict(v, **args)
90 yield dict(v, **args)
91 return
91 return
92 startname = 'start_' + names
92 startname = 'start_' + names
93 if startname in templ:
93 if startname in templ:
94 yield templ(startname, **args)
94 yield templ(startname, **args)
95 vargs = args.copy()
95 vargs = args.copy()
96 def one(v, tag=name):
96 def one(v, tag=name):
97 try:
97 try:
98 vargs.update(v)
98 vargs.update(v)
99 except (AttributeError, ValueError):
99 except (AttributeError, ValueError):
100 try:
100 try:
101 for a, b in v:
101 for a, b in v:
102 vargs[a] = b
102 vargs[a] = b
103 except ValueError:
103 except ValueError:
104 vargs[name] = v
104 vargs[name] = v
105 return templ(tag, **vargs)
105 return templ(tag, **vargs)
106 lastname = 'last_' + name
106 lastname = 'last_' + name
107 if lastname in templ:
107 if lastname in templ:
108 last = values.pop()
108 last = values.pop()
109 else:
109 else:
110 last = None
110 last = None
111 for v in values:
111 for v in values:
112 yield one(v)
112 yield one(v)
113 if last is not None:
113 if last is not None:
114 yield one(last, tag=lastname)
114 yield one(last, tag=lastname)
115 endname = 'end_' + names
115 endname = 'end_' + names
116 if endname in templ:
116 if endname in templ:
117 yield templ(endname, **args)
117 yield templ(endname, **args)
118
118
119 def _formatrevnode(ctx):
119 def _formatrevnode(ctx):
120 """Format changeset as '{rev}:{node|formatnode}', which is the default
120 """Format changeset as '{rev}:{node|formatnode}', which is the default
121 template provided by cmdutil.changeset_templater"""
121 template provided by cmdutil.changeset_templater"""
122 repo = ctx.repo()
122 repo = ctx.repo()
123 if repo.ui.debugflag:
123 if repo.ui.debugflag:
124 hexnode = ctx.hex()
124 hexnode = ctx.hex()
125 else:
125 else:
126 hexnode = ctx.hex()[:12]
126 hexnode = ctx.hex()[:12]
127 return '%d:%s' % (scmutil.intrev(ctx.rev()), hexnode)
127 return '%d:%s' % (scmutil.intrev(ctx.rev()), hexnode)
128
128
129 def getfiles(repo, ctx, revcache):
129 def getfiles(repo, ctx, revcache):
130 if 'files' not in revcache:
130 if 'files' not in revcache:
131 revcache['files'] = repo.status(ctx.p1(), ctx)[:3]
131 revcache['files'] = repo.status(ctx.p1(), ctx)[:3]
132 return revcache['files']
132 return revcache['files']
133
133
134 def getlatesttags(repo, ctx, cache, pattern=None):
134 def getlatesttags(repo, ctx, cache, pattern=None):
135 '''return date, distance and name for the latest tag of rev'''
135 '''return date, distance and name for the latest tag of rev'''
136
136
137 cachename = 'latesttags'
137 cachename = 'latesttags'
138 if pattern is not None:
138 if pattern is not None:
139 cachename += '-' + pattern
139 cachename += '-' + pattern
140 match = util.stringmatcher(pattern)[2]
140 match = util.stringmatcher(pattern)[2]
141 else:
141 else:
142 match = util.always
142 match = util.always
143
143
144 if cachename not in cache:
144 if cachename not in cache:
145 # Cache mapping from rev to a tuple with tag date, tag
145 # Cache mapping from rev to a tuple with tag date, tag
146 # distance and tag name
146 # distance and tag name
147 cache[cachename] = {-1: (0, 0, ['null'])}
147 cache[cachename] = {-1: (0, 0, ['null'])}
148 latesttags = cache[cachename]
148 latesttags = cache[cachename]
149
149
150 rev = ctx.rev()
150 rev = ctx.rev()
151 todo = [rev]
151 todo = [rev]
152 while todo:
152 while todo:
153 rev = todo.pop()
153 rev = todo.pop()
154 if rev in latesttags:
154 if rev in latesttags:
155 continue
155 continue
156 ctx = repo[rev]
156 ctx = repo[rev]
157 tags = [t for t in ctx.tags()
157 tags = [t for t in ctx.tags()
158 if (repo.tagtype(t) and repo.tagtype(t) != 'local'
158 if (repo.tagtype(t) and repo.tagtype(t) != 'local'
159 and match(t))]
159 and match(t))]
160 if tags:
160 if tags:
161 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
161 latesttags[rev] = ctx.date()[0], 0, [t for t in sorted(tags)]
162 continue
162 continue
163 try:
163 try:
164 # The tuples are laid out so the right one can be found by
164 # The tuples are laid out so the right one can be found by
165 # comparison.
165 # comparison.
166 pdate, pdist, ptag = max(
166 pdate, pdist, ptag = max(
167 latesttags[p.rev()] for p in ctx.parents())
167 latesttags[p.rev()] for p in ctx.parents())
168 except KeyError:
168 except KeyError:
169 # Cache miss - recurse
169 # Cache miss - recurse
170 todo.append(rev)
170 todo.append(rev)
171 todo.extend(p.rev() for p in ctx.parents())
171 todo.extend(p.rev() for p in ctx.parents())
172 continue
172 continue
173 latesttags[rev] = pdate, pdist + 1, ptag
173 latesttags[rev] = pdate, pdist + 1, ptag
174 return latesttags[rev]
174 return latesttags[rev]
175
175
176 def getrenamedfn(repo, endrev=None):
176 def getrenamedfn(repo, endrev=None):
177 rcache = {}
177 rcache = {}
178 if endrev is None:
178 if endrev is None:
179 endrev = len(repo)
179 endrev = len(repo)
180
180
181 def getrenamed(fn, rev):
181 def getrenamed(fn, rev):
182 '''looks up all renames for a file (up to endrev) the first
182 '''looks up all renames for a file (up to endrev) the first
183 time the file is given. It indexes on the changerev and only
183 time the file is given. It indexes on the changerev and only
184 parses the manifest if linkrev != changerev.
184 parses the manifest if linkrev != changerev.
185 Returns rename info for fn at changerev rev.'''
185 Returns rename info for fn at changerev rev.'''
186 if fn not in rcache:
186 if fn not in rcache:
187 rcache[fn] = {}
187 rcache[fn] = {}
188 fl = repo.file(fn)
188 fl = repo.file(fn)
189 for i in fl:
189 for i in fl:
190 lr = fl.linkrev(i)
190 lr = fl.linkrev(i)
191 renamed = fl.renamed(fl.node(i))
191 renamed = fl.renamed(fl.node(i))
192 rcache[fn][lr] = renamed
192 rcache[fn][lr] = renamed
193 if lr >= endrev:
193 if lr >= endrev:
194 break
194 break
195 if rev in rcache[fn]:
195 if rev in rcache[fn]:
196 return rcache[fn][rev]
196 return rcache[fn][rev]
197
197
198 # If linkrev != rev (i.e. rev not found in rcache) fallback to
198 # If linkrev != rev (i.e. rev not found in rcache) fallback to
199 # filectx logic.
199 # filectx logic.
200 try:
200 try:
201 return repo[rev][fn].renamed()
201 return repo[rev][fn].renamed()
202 except error.LookupError:
202 except error.LookupError:
203 return None
203 return None
204
204
205 return getrenamed
205 return getrenamed
206
206
207 # default templates internally used for rendering of lists
207 # default templates internally used for rendering of lists
208 defaulttempl = {
208 defaulttempl = {
209 'parent': '{rev}:{node|formatnode} ',
209 'parent': '{rev}:{node|formatnode} ',
210 'manifest': '{rev}:{node|formatnode}',
210 'manifest': '{rev}:{node|formatnode}',
211 'file_copy': '{name} ({source})',
211 'file_copy': '{name} ({source})',
212 'envvar': '{key}={value}',
212 'envvar': '{key}={value}',
213 'extra': '{key}={value|stringescape}'
213 'extra': '{key}={value|stringescape}'
214 }
214 }
215 # filecopy is preserved for compatibility reasons
215 # filecopy is preserved for compatibility reasons
216 defaulttempl['filecopy'] = defaulttempl['file_copy']
216 defaulttempl['filecopy'] = defaulttempl['file_copy']
217
217
218 # keywords are callables like:
218 # keywords are callables like:
219 # fn(repo, ctx, templ, cache, revcache, **args)
219 # fn(repo, ctx, templ, cache, revcache, **args)
220 # with:
220 # with:
221 # repo - current repository instance
221 # repo - current repository instance
222 # ctx - the changectx being displayed
222 # ctx - the changectx being displayed
223 # templ - the templater instance
223 # templ - the templater instance
224 # cache - a cache dictionary for the whole templater run
224 # cache - a cache dictionary for the whole templater run
225 # revcache - a cache dictionary for the current revision
225 # revcache - a cache dictionary for the current revision
226 keywords = {}
226 keywords = {}
227
227
228 templatekeyword = registrar.templatekeyword(keywords)
228 templatekeyword = registrar.templatekeyword(keywords)
229
229
230 @templatekeyword('author')
230 @templatekeyword('author')
231 def showauthor(repo, ctx, templ, **args):
231 def showauthor(repo, ctx, templ, **args):
232 """String. The unmodified author of the changeset."""
232 """String. The unmodified author of the changeset."""
233 return ctx.user()
233 return ctx.user()
234
234
235 @templatekeyword('bisect')
235 @templatekeyword('bisect')
236 def showbisect(repo, ctx, templ, **args):
236 def showbisect(repo, ctx, templ, **args):
237 """String. The changeset bisection status."""
237 """String. The changeset bisection status."""
238 return hbisect.label(repo, ctx.node())
238 return hbisect.label(repo, ctx.node())
239
239
240 @templatekeyword('branch')
240 @templatekeyword('branch')
241 def showbranch(**args):
241 def showbranch(**args):
242 """String. The name of the branch on which the changeset was
242 """String. The name of the branch on which the changeset was
243 committed.
243 committed.
244 """
244 """
245 return args['ctx'].branch()
245 return args['ctx'].branch()
246
246
247 @templatekeyword('branches')
247 @templatekeyword('branches')
248 def showbranches(**args):
248 def showbranches(**args):
249 """List of strings. The name of the branch on which the
249 """List of strings. The name of the branch on which the
250 changeset was committed. Will be empty if the branch name was
250 changeset was committed. Will be empty if the branch name was
251 default. (DEPRECATED)
251 default. (DEPRECATED)
252 """
252 """
253 branch = args['ctx'].branch()
253 branch = args['ctx'].branch()
254 if branch != 'default':
254 if branch != 'default':
255 return showlist('branch', [branch], plural='branches', **args)
255 return showlist('branch', [branch], plural='branches', **args)
256 return showlist('branch', [], plural='branches', **args)
256 return showlist('branch', [], plural='branches', **args)
257
257
258 @templatekeyword('bookmarks')
258 @templatekeyword('bookmarks')
259 def showbookmarks(**args):
259 def showbookmarks(**args):
260 """List of strings. Any bookmarks associated with the
260 """List of strings. Any bookmarks associated with the
261 changeset. Also sets 'active', the name of the active bookmark.
261 changeset. Also sets 'active', the name of the active bookmark.
262 """
262 """
263 repo = args['ctx']._repo
263 repo = args['ctx']._repo
264 bookmarks = args['ctx'].bookmarks()
264 bookmarks = args['ctx'].bookmarks()
265 active = repo._activebookmark
265 active = repo._activebookmark
266 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
266 makemap = lambda v: {'bookmark': v, 'active': active, 'current': active}
267 f = _showlist('bookmark', bookmarks, **args)
267 f = _showlist('bookmark', bookmarks, **args)
268 return _hybrid(f, bookmarks, makemap, lambda x: x['bookmark'])
268 return _hybrid(f, bookmarks, makemap, lambda x: x['bookmark'])
269
269
270 @templatekeyword('children')
270 @templatekeyword('children')
271 def showchildren(**args):
271 def showchildren(**args):
272 """List of strings. The children of the changeset."""
272 """List of strings. The children of the changeset."""
273 ctx = args['ctx']
273 ctx = args['ctx']
274 childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()]
274 childrevs = ['%d:%s' % (cctx, cctx) for cctx in ctx.children()]
275 return showlist('children', childrevs, element='child', **args)
275 return showlist('children', childrevs, element='child', **args)
276
276
277 # Deprecated, but kept alive for help generation a purpose.
277 # Deprecated, but kept alive for help generation a purpose.
278 @templatekeyword('currentbookmark')
278 @templatekeyword('currentbookmark')
279 def showcurrentbookmark(**args):
279 def showcurrentbookmark(**args):
280 """String. The active bookmark, if it is
280 """String. The active bookmark, if it is
281 associated with the changeset (DEPRECATED)"""
281 associated with the changeset (DEPRECATED)"""
282 return showactivebookmark(**args)
282 return showactivebookmark(**args)
283
283
284 @templatekeyword('activebookmark')
284 @templatekeyword('activebookmark')
285 def showactivebookmark(**args):
285 def showactivebookmark(**args):
286 """String. The active bookmark, if it is
286 """String. The active bookmark, if it is
287 associated with the changeset"""
287 associated with the changeset"""
288 active = args['repo']._activebookmark
288 active = args['repo']._activebookmark
289 if active and active in args['ctx'].bookmarks():
289 if active and active in args['ctx'].bookmarks():
290 return active
290 return active
291 return ''
291 return ''
292
292
293 @templatekeyword('date')
293 @templatekeyword('date')
294 def showdate(repo, ctx, templ, **args):
294 def showdate(repo, ctx, templ, **args):
295 """Date information. The date when the changeset was committed."""
295 """Date information. The date when the changeset was committed."""
296 return ctx.date()
296 return ctx.date()
297
297
298 @templatekeyword('desc')
298 @templatekeyword('desc')
299 def showdescription(repo, ctx, templ, **args):
299 def showdescription(repo, ctx, templ, **args):
300 """String. The text of the changeset description."""
300 """String. The text of the changeset description."""
301 s = ctx.description()
301 s = ctx.description()
302 if isinstance(s, encoding.localstr):
302 if isinstance(s, encoding.localstr):
303 # try hard to preserve utf-8 bytes
303 # try hard to preserve utf-8 bytes
304 return encoding.tolocal(encoding.fromlocal(s).strip())
304 return encoding.tolocal(encoding.fromlocal(s).strip())
305 else:
305 else:
306 return s.strip()
306 return s.strip()
307
307
308 @templatekeyword('diffstat')
308 @templatekeyword('diffstat')
309 def showdiffstat(repo, ctx, templ, **args):
309 def showdiffstat(repo, ctx, templ, **args):
310 """String. Statistics of changes with the following format:
310 """String. Statistics of changes with the following format:
311 "modified files: +added/-removed lines"
311 "modified files: +added/-removed lines"
312 """
312 """
313 stats = patch.diffstatdata(util.iterlines(ctx.diff(noprefix=False)))
313 stats = patch.diffstatdata(util.iterlines(ctx.diff(noprefix=False)))
314 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
314 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
315 return '%s: +%s/-%s' % (len(stats), adds, removes)
315 return '%s: +%s/-%s' % (len(stats), adds, removes)
316
316
317 @templatekeyword('envvars')
317 @templatekeyword('envvars')
318 def showenvvars(repo, **args):
318 def showenvvars(repo, **args):
319 """A dictionary of environment variables. (EXPERIMENTAL)"""
319 """A dictionary of environment variables. (EXPERIMENTAL)"""
320
320
321 env = repo.ui.exportableenviron()
321 env = repo.ui.exportableenviron()
322 env = util.sortdict((k, env[k]) for k in sorted(env))
322 env = util.sortdict((k, env[k]) for k in sorted(env))
323 makemap = lambda k: {'key': k, 'value': env[k]}
323 makemap = lambda k: {'key': k, 'value': env[k]}
324 c = [makemap(k) for k in env]
324 c = [makemap(k) for k in env]
325 f = _showlist('envvar', c, plural='envvars', **args)
325 f = _showlist('envvar', c, plural='envvars', **args)
326 return _hybrid(f, env, makemap,
326 return _hybrid(f, env, makemap,
327 lambda x: '%s=%s' % (x['key'], x['value']))
327 lambda x: '%s=%s' % (x['key'], x['value']))
328
328
329 @templatekeyword('extras')
329 @templatekeyword('extras')
330 def showextras(**args):
330 def showextras(**args):
331 """List of dicts with key, value entries of the 'extras'
331 """List of dicts with key, value entries of the 'extras'
332 field of this changeset."""
332 field of this changeset."""
333 extras = args['ctx'].extra()
333 extras = args['ctx'].extra()
334 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
334 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
335 makemap = lambda k: {'key': k, 'value': extras[k]}
335 makemap = lambda k: {'key': k, 'value': extras[k]}
336 c = [makemap(k) for k in extras]
336 c = [makemap(k) for k in extras]
337 f = _showlist('extra', c, plural='extras', **args)
337 f = _showlist('extra', c, plural='extras', **args)
338 return _hybrid(f, extras, makemap,
338 return _hybrid(f, extras, makemap,
339 lambda x: '%s=%s' % (x['key'], util.escapestr(x['value'])))
339 lambda x: '%s=%s' % (x['key'], util.escapestr(x['value'])))
340
340
341 @templatekeyword('file_adds')
341 @templatekeyword('file_adds')
342 def showfileadds(**args):
342 def showfileadds(**args):
343 """List of strings. Files added by this changeset."""
343 """List of strings. Files added by this changeset."""
344 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
344 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
345 return showlist('file_add', getfiles(repo, ctx, revcache)[1],
345 return showlist('file_add', getfiles(repo, ctx, revcache)[1],
346 element='file', **args)
346 element='file', **args)
347
347
348 @templatekeyword('file_copies')
348 @templatekeyword('file_copies')
349 def showfilecopies(**args):
349 def showfilecopies(**args):
350 """List of strings. Files copied in this changeset with
350 """List of strings. Files copied in this changeset with
351 their sources.
351 their sources.
352 """
352 """
353 cache, ctx = args['cache'], args['ctx']
353 cache, ctx = args['cache'], args['ctx']
354 copies = args['revcache'].get('copies')
354 copies = args['revcache'].get('copies')
355 if copies is None:
355 if copies is None:
356 if 'getrenamed' not in cache:
356 if 'getrenamed' not in cache:
357 cache['getrenamed'] = getrenamedfn(args['repo'])
357 cache['getrenamed'] = getrenamedfn(args['repo'])
358 copies = []
358 copies = []
359 getrenamed = cache['getrenamed']
359 getrenamed = cache['getrenamed']
360 for fn in ctx.files():
360 for fn in ctx.files():
361 rename = getrenamed(fn, ctx.rev())
361 rename = getrenamed(fn, ctx.rev())
362 if rename:
362 if rename:
363 copies.append((fn, rename[0]))
363 copies.append((fn, rename[0]))
364
364
365 copies = util.sortdict(copies)
365 copies = util.sortdict(copies)
366 makemap = lambda k: {'name': k, 'source': copies[k]}
366 makemap = lambda k: {'name': k, 'source': copies[k]}
367 c = [makemap(k) for k in copies]
367 c = [makemap(k) for k in copies]
368 f = _showlist('file_copy', c, plural='file_copies', **args)
368 f = _showlist('file_copy', c, plural='file_copies', **args)
369 return _hybrid(f, copies, makemap,
369 return _hybrid(f, copies, makemap,
370 lambda x: '%s (%s)' % (x['name'], x['source']))
370 lambda x: '%s (%s)' % (x['name'], x['source']))
371
371
372 # showfilecopiesswitch() displays file copies only if copy records are
372 # showfilecopiesswitch() displays file copies only if copy records are
373 # provided before calling the templater, usually with a --copies
373 # provided before calling the templater, usually with a --copies
374 # command line switch.
374 # command line switch.
375 @templatekeyword('file_copies_switch')
375 @templatekeyword('file_copies_switch')
376 def showfilecopiesswitch(**args):
376 def showfilecopiesswitch(**args):
377 """List of strings. Like "file_copies" but displayed
377 """List of strings. Like "file_copies" but displayed
378 only if the --copied switch is set.
378 only if the --copied switch is set.
379 """
379 """
380 copies = args['revcache'].get('copies') or []
380 copies = args['revcache'].get('copies') or []
381 copies = util.sortdict(copies)
381 copies = util.sortdict(copies)
382 makemap = lambda k: {'name': k, 'source': copies[k]}
382 makemap = lambda k: {'name': k, 'source': copies[k]}
383 c = [makemap(k) for k in copies]
383 c = [makemap(k) for k in copies]
384 f = _showlist('file_copy', c, plural='file_copies', **args)
384 f = _showlist('file_copy', c, plural='file_copies', **args)
385 return _hybrid(f, copies, makemap,
385 return _hybrid(f, copies, makemap,
386 lambda x: '%s (%s)' % (x['name'], x['source']))
386 lambda x: '%s (%s)' % (x['name'], x['source']))
387
387
388 @templatekeyword('file_dels')
388 @templatekeyword('file_dels')
389 def showfiledels(**args):
389 def showfiledels(**args):
390 """List of strings. Files removed by this changeset."""
390 """List of strings. Files removed by this changeset."""
391 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
391 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
392 return showlist('file_del', getfiles(repo, ctx, revcache)[2],
392 return showlist('file_del', getfiles(repo, ctx, revcache)[2],
393 element='file', **args)
393 element='file', **args)
394
394
395 @templatekeyword('file_mods')
395 @templatekeyword('file_mods')
396 def showfilemods(**args):
396 def showfilemods(**args):
397 """List of strings. Files modified by this changeset."""
397 """List of strings. Files modified by this changeset."""
398 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
398 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
399 return showlist('file_mod', getfiles(repo, ctx, revcache)[0],
399 return showlist('file_mod', getfiles(repo, ctx, revcache)[0],
400 element='file', **args)
400 element='file', **args)
401
401
402 @templatekeyword('files')
402 @templatekeyword('files')
403 def showfiles(**args):
403 def showfiles(**args):
404 """List of strings. All files modified, added, or removed by this
404 """List of strings. All files modified, added, or removed by this
405 changeset.
405 changeset.
406 """
406 """
407 return showlist('file', args['ctx'].files(), **args)
407 return showlist('file', args['ctx'].files(), **args)
408
408
409 @templatekeyword('graphnode')
409 @templatekeyword('graphnode')
410 def showgraphnode(repo, ctx, **args):
410 def showgraphnode(repo, ctx, **args):
411 """String. The character representing the changeset node in
411 """String. The character representing the changeset node in
412 an ASCII revision graph"""
412 an ASCII revision graph"""
413 wpnodes = repo.dirstate.parents()
413 wpnodes = repo.dirstate.parents()
414 if wpnodes[1] == nullid:
414 if wpnodes[1] == nullid:
415 wpnodes = wpnodes[:1]
415 wpnodes = wpnodes[:1]
416 if ctx.node() in wpnodes:
416 if ctx.node() in wpnodes:
417 return '@'
417 return '@'
418 elif ctx.obsolete():
418 elif ctx.obsolete():
419 return 'x'
419 return 'x'
420 elif ctx.closesbranch():
420 elif ctx.closesbranch():
421 return '_'
421 return '_'
422 else:
422 else:
423 return 'o'
423 return 'o'
424
424
425 @templatekeyword('latesttag')
425 @templatekeyword('latesttag')
426 def showlatesttag(**args):
426 def showlatesttag(**args):
427 """List of strings. The global tags on the most recent globally
427 """List of strings. The global tags on the most recent globally
428 tagged ancestor of this changeset.
428 tagged ancestor of this changeset.
429 """
429 """
430 return showlatesttags(None, **args)
430 return showlatesttags(None, **args)
431
431
432 def showlatesttags(pattern, **args):
432 def showlatesttags(pattern, **args):
433 """helper method for the latesttag keyword and function"""
433 """helper method for the latesttag keyword and function"""
434 repo, ctx = args['repo'], args['ctx']
434 repo, ctx = args['repo'], args['ctx']
435 cache = args['cache']
435 cache = args['cache']
436 latesttags = getlatesttags(repo, ctx, cache, pattern)
436 latesttags = getlatesttags(repo, ctx, cache, pattern)
437
437
438 # latesttag[0] is an implementation detail for sorting csets on different
438 # latesttag[0] is an implementation detail for sorting csets on different
439 # branches in a stable manner- it is the date the tagged cset was created,
439 # branches in a stable manner- it is the date the tagged cset was created,
440 # not the date the tag was created. Therefore it isn't made visible here.
440 # not the date the tag was created. Therefore it isn't made visible here.
441 makemap = lambda v: {
441 makemap = lambda v: {
442 'changes': _showchangessincetag,
442 'changes': _showchangessincetag,
443 'distance': latesttags[1],
443 'distance': latesttags[1],
444 'latesttag': v, # BC with {latesttag % '{latesttag}'}
444 'latesttag': v, # BC with {latesttag % '{latesttag}'}
445 'tag': v
445 'tag': v
446 }
446 }
447
447
448 tags = latesttags[2]
448 tags = latesttags[2]
449 f = _showlist('latesttag', tags, separator=':', **args)
449 f = _showlist('latesttag', tags, separator=':', **args)
450 return _hybrid(f, tags, makemap, lambda x: x['latesttag'])
450 return _hybrid(f, tags, makemap, lambda x: x['latesttag'])
451
451
452 @templatekeyword('latesttagdistance')
452 @templatekeyword('latesttagdistance')
453 def showlatesttagdistance(repo, ctx, templ, cache, **args):
453 def showlatesttagdistance(repo, ctx, templ, cache, **args):
454 """Integer. Longest path to the latest tag."""
454 """Integer. Longest path to the latest tag."""
455 return getlatesttags(repo, ctx, cache)[1]
455 return getlatesttags(repo, ctx, cache)[1]
456
456
457 @templatekeyword('changessincelatesttag')
457 @templatekeyword('changessincelatesttag')
458 def showchangessincelatesttag(repo, ctx, templ, cache, **args):
458 def showchangessincelatesttag(repo, ctx, templ, cache, **args):
459 """Integer. All ancestors not in the latest tag."""
459 """Integer. All ancestors not in the latest tag."""
460 latesttag = getlatesttags(repo, ctx, cache)[2][0]
460 latesttag = getlatesttags(repo, ctx, cache)[2][0]
461
461
462 return _showchangessincetag(repo, ctx, tag=latesttag, **args)
462 return _showchangessincetag(repo, ctx, tag=latesttag, **args)
463
463
464 def _showchangessincetag(repo, ctx, **args):
464 def _showchangessincetag(repo, ctx, **args):
465 offset = 0
465 offset = 0
466 revs = [ctx.rev()]
466 revs = [ctx.rev()]
467 tag = args['tag']
467 tag = args['tag']
468
468
469 # The only() revset doesn't currently support wdir()
469 # The only() revset doesn't currently support wdir()
470 if ctx.rev() is None:
470 if ctx.rev() is None:
471 offset = 1
471 offset = 1
472 revs = [p.rev() for p in ctx.parents()]
472 revs = [p.rev() for p in ctx.parents()]
473
473
474 return len(repo.revs('only(%ld, %s)', revs, tag)) + offset
474 return len(repo.revs('only(%ld, %s)', revs, tag)) + offset
475
475
476 @templatekeyword('manifest')
476 @templatekeyword('manifest')
477 def showmanifest(**args):
477 def showmanifest(**args):
478 repo, ctx, templ = args['repo'], args['ctx'], args['templ']
478 repo, ctx, templ = args['repo'], args['ctx'], args['templ']
479 mnode = ctx.manifestnode()
479 mnode = ctx.manifestnode()
480 if mnode is None:
480 if mnode is None:
481 # just avoid crash, we might want to use the 'ff...' hash in future
481 # just avoid crash, we might want to use the 'ff...' hash in future
482 return
482 return
483 args = args.copy()
483 args = args.copy()
484 args.update({'rev': repo.manifestlog._revlog.rev(mnode),
484 args.update({'rev': repo.manifestlog._revlog.rev(mnode),
485 'node': hex(mnode)})
485 'node': hex(mnode)})
486 return templ('manifest', **args)
486 return templ('manifest', **args)
487
487
488 def shownames(namespace, **args):
488 def shownames(namespace, **args):
489 """helper method to generate a template keyword for a namespace"""
489 """helper method to generate a template keyword for a namespace"""
490 ctx = args['ctx']
490 ctx = args['ctx']
491 repo = ctx.repo()
491 repo = ctx.repo()
492 ns = repo.names[namespace]
492 ns = repo.names[namespace]
493 names = ns.names(repo, ctx.node())
493 names = ns.names(repo, ctx.node())
494 return showlist(ns.templatename, names, plural=namespace, **args)
494 return showlist(ns.templatename, names, plural=namespace, **args)
495
495
496 @templatekeyword('namespaces')
496 @templatekeyword('namespaces')
497 def shownamespaces(**args):
497 def shownamespaces(**args):
498 """Dict of lists. Names attached to this changeset per
498 """Dict of lists. Names attached to this changeset per
499 namespace."""
499 namespace."""
500 ctx = args['ctx']
500 ctx = args['ctx']
501 repo = ctx.repo()
501 repo = ctx.repo()
502 namespaces = util.sortdict((k, showlist('name', ns.names(repo, ctx.node()),
502 namespaces = util.sortdict((k, showlist('name', ns.names(repo, ctx.node()),
503 **args))
503 **args))
504 for k, ns in repo.names.iteritems())
504 for k, ns in repo.names.iteritems())
505 f = _showlist('namespace', list(namespaces), **args)
505 f = _showlist('namespace', list(namespaces), **args)
506 return _hybrid(f, namespaces,
506 return _hybrid(f, namespaces,
507 lambda k: {'namespace': k, 'names': namespaces[k]},
507 lambda k: {'namespace': k, 'names': namespaces[k]},
508 lambda x: x['namespace'])
508 lambda x: x['namespace'])
509
509
510 @templatekeyword('node')
510 @templatekeyword('node')
511 def shownode(repo, ctx, templ, **args):
511 def shownode(repo, ctx, templ, **args):
512 """String. The changeset identification hash, as a 40 hexadecimal
512 """String. The changeset identification hash, as a 40 hexadecimal
513 digit string.
513 digit string.
514 """
514 """
515 return ctx.hex()
515 return ctx.hex()
516
516
517 @templatekeyword('obsolete')
518 def showobsolete(repo, ctx, templ, **args):
519 """String. Whether the changeset is obsolete.
520 """
521 if ctx.obsolete():
522 return 'obsolete'
523 return ''
524
517 @templatekeyword('p1rev')
525 @templatekeyword('p1rev')
518 def showp1rev(repo, ctx, templ, **args):
526 def showp1rev(repo, ctx, templ, **args):
519 """Integer. The repository-local revision number of the changeset's
527 """Integer. The repository-local revision number of the changeset's
520 first parent, or -1 if the changeset has no parents."""
528 first parent, or -1 if the changeset has no parents."""
521 return ctx.p1().rev()
529 return ctx.p1().rev()
522
530
523 @templatekeyword('p2rev')
531 @templatekeyword('p2rev')
524 def showp2rev(repo, ctx, templ, **args):
532 def showp2rev(repo, ctx, templ, **args):
525 """Integer. The repository-local revision number of the changeset's
533 """Integer. The repository-local revision number of the changeset's
526 second parent, or -1 if the changeset has no second parent."""
534 second parent, or -1 if the changeset has no second parent."""
527 return ctx.p2().rev()
535 return ctx.p2().rev()
528
536
529 @templatekeyword('p1node')
537 @templatekeyword('p1node')
530 def showp1node(repo, ctx, templ, **args):
538 def showp1node(repo, ctx, templ, **args):
531 """String. The identification hash of the changeset's first parent,
539 """String. The identification hash of the changeset's first parent,
532 as a 40 digit hexadecimal string. If the changeset has no parents, all
540 as a 40 digit hexadecimal string. If the changeset has no parents, all
533 digits are 0."""
541 digits are 0."""
534 return ctx.p1().hex()
542 return ctx.p1().hex()
535
543
536 @templatekeyword('p2node')
544 @templatekeyword('p2node')
537 def showp2node(repo, ctx, templ, **args):
545 def showp2node(repo, ctx, templ, **args):
538 """String. The identification hash of the changeset's second
546 """String. The identification hash of the changeset's second
539 parent, as a 40 digit hexadecimal string. If the changeset has no second
547 parent, as a 40 digit hexadecimal string. If the changeset has no second
540 parent, all digits are 0."""
548 parent, all digits are 0."""
541 return ctx.p2().hex()
549 return ctx.p2().hex()
542
550
543 @templatekeyword('parents')
551 @templatekeyword('parents')
544 def showparents(**args):
552 def showparents(**args):
545 """List of strings. The parents of the changeset in "rev:node"
553 """List of strings. The parents of the changeset in "rev:node"
546 format. If the changeset has only one "natural" parent (the predecessor
554 format. If the changeset has only one "natural" parent (the predecessor
547 revision) nothing is shown."""
555 revision) nothing is shown."""
548 repo = args['repo']
556 repo = args['repo']
549 ctx = args['ctx']
557 ctx = args['ctx']
550 pctxs = scmutil.meaningfulparents(repo, ctx)
558 pctxs = scmutil.meaningfulparents(repo, ctx)
551 prevs = [str(p.rev()) for p in pctxs] # ifcontains() needs a list of str
559 prevs = [str(p.rev()) for p in pctxs] # ifcontains() needs a list of str
552 parents = [[('rev', p.rev()),
560 parents = [[('rev', p.rev()),
553 ('node', p.hex()),
561 ('node', p.hex()),
554 ('phase', p.phasestr())]
562 ('phase', p.phasestr())]
555 for p in pctxs]
563 for p in pctxs]
556 f = _showlist('parent', parents, **args)
564 f = _showlist('parent', parents, **args)
557 return _hybrid(f, prevs, lambda x: {'ctx': repo[int(x)], 'revcache': {}},
565 return _hybrid(f, prevs, lambda x: {'ctx': repo[int(x)], 'revcache': {}},
558 lambda d: _formatrevnode(d['ctx']))
566 lambda d: _formatrevnode(d['ctx']))
559
567
560 @templatekeyword('phase')
568 @templatekeyword('phase')
561 def showphase(repo, ctx, templ, **args):
569 def showphase(repo, ctx, templ, **args):
562 """String. The changeset phase name."""
570 """String. The changeset phase name."""
563 return ctx.phasestr()
571 return ctx.phasestr()
564
572
565 @templatekeyword('phaseidx')
573 @templatekeyword('phaseidx')
566 def showphaseidx(repo, ctx, templ, **args):
574 def showphaseidx(repo, ctx, templ, **args):
567 """Integer. The changeset phase index."""
575 """Integer. The changeset phase index."""
568 return ctx.phase()
576 return ctx.phase()
569
577
570 @templatekeyword('rev')
578 @templatekeyword('rev')
571 def showrev(repo, ctx, templ, **args):
579 def showrev(repo, ctx, templ, **args):
572 """Integer. The repository-local changeset revision number."""
580 """Integer. The repository-local changeset revision number."""
573 return scmutil.intrev(ctx.rev())
581 return scmutil.intrev(ctx.rev())
574
582
575 def showrevslist(name, revs, **args):
583 def showrevslist(name, revs, **args):
576 """helper to generate a list of revisions in which a mapped template will
584 """helper to generate a list of revisions in which a mapped template will
577 be evaluated"""
585 be evaluated"""
578 repo = args['ctx'].repo()
586 repo = args['ctx'].repo()
579 revs = [str(r) for r in revs] # ifcontains() needs a list of str
587 revs = [str(r) for r in revs] # ifcontains() needs a list of str
580 f = _showlist(name, revs, **args)
588 f = _showlist(name, revs, **args)
581 return _hybrid(f, revs,
589 return _hybrid(f, revs,
582 lambda x: {name: x, 'ctx': repo[int(x)], 'revcache': {}},
590 lambda x: {name: x, 'ctx': repo[int(x)], 'revcache': {}},
583 lambda d: d[name])
591 lambda d: d[name])
584
592
585 @templatekeyword('subrepos')
593 @templatekeyword('subrepos')
586 def showsubrepos(**args):
594 def showsubrepos(**args):
587 """List of strings. Updated subrepositories in the changeset."""
595 """List of strings. Updated subrepositories in the changeset."""
588 ctx = args['ctx']
596 ctx = args['ctx']
589 substate = ctx.substate
597 substate = ctx.substate
590 if not substate:
598 if not substate:
591 return showlist('subrepo', [], **args)
599 return showlist('subrepo', [], **args)
592 psubstate = ctx.parents()[0].substate or {}
600 psubstate = ctx.parents()[0].substate or {}
593 subrepos = []
601 subrepos = []
594 for sub in substate:
602 for sub in substate:
595 if sub not in psubstate or substate[sub] != psubstate[sub]:
603 if sub not in psubstate or substate[sub] != psubstate[sub]:
596 subrepos.append(sub) # modified or newly added in ctx
604 subrepos.append(sub) # modified or newly added in ctx
597 for sub in psubstate:
605 for sub in psubstate:
598 if sub not in substate:
606 if sub not in substate:
599 subrepos.append(sub) # removed in ctx
607 subrepos.append(sub) # removed in ctx
600 return showlist('subrepo', sorted(subrepos), **args)
608 return showlist('subrepo', sorted(subrepos), **args)
601
609
602 # don't remove "showtags" definition, even though namespaces will put
610 # don't remove "showtags" definition, even though namespaces will put
603 # a helper function for "tags" keyword into "keywords" map automatically,
611 # a helper function for "tags" keyword into "keywords" map automatically,
604 # because online help text is built without namespaces initialization
612 # because online help text is built without namespaces initialization
605 @templatekeyword('tags')
613 @templatekeyword('tags')
606 def showtags(**args):
614 def showtags(**args):
607 """List of strings. Any tags associated with the changeset."""
615 """List of strings. Any tags associated with the changeset."""
608 return shownames('tags', **args)
616 return shownames('tags', **args)
609
617
610 def loadkeyword(ui, extname, registrarobj):
618 def loadkeyword(ui, extname, registrarobj):
611 """Load template keyword from specified registrarobj
619 """Load template keyword from specified registrarobj
612 """
620 """
613 for name, func in registrarobj._table.iteritems():
621 for name, func in registrarobj._table.iteritems():
614 keywords[name] = func
622 keywords[name] = func
615
623
616 @templatekeyword('termwidth')
624 @templatekeyword('termwidth')
617 def termwidth(repo, ctx, templ, **args):
625 def termwidth(repo, ctx, templ, **args):
618 """Integer. The width of the current terminal."""
626 """Integer. The width of the current terminal."""
619 return repo.ui.termwidth()
627 return repo.ui.termwidth()
620
628
621 @templatekeyword('troubles')
629 @templatekeyword('troubles')
622 def showtroubles(**args):
630 def showtroubles(**args):
623 """List of strings. Evolution troubles affecting the changeset.
631 """List of strings. Evolution troubles affecting the changeset.
624
632
625 (EXPERIMENTAL)
633 (EXPERIMENTAL)
626 """
634 """
627 return showlist('trouble', args['ctx'].troubles(), **args)
635 return showlist('trouble', args['ctx'].troubles(), **args)
628
636
629 # tell hggettext to extract docstrings from these functions:
637 # tell hggettext to extract docstrings from these functions:
630 i18nfunctions = keywords.values()
638 i18nfunctions = keywords.values()
@@ -1,1261 +1,1266 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [phases]
2 > [phases]
3 > # public changeset are not obsolete
3 > # public changeset are not obsolete
4 > publish=false
4 > publish=false
5 > [ui]
5 > [ui]
6 > logtemplate="{rev}:{node|short} ({phase}{if(troubles, ' {troubles}')}) [{tags} {bookmarks}] {desc|firstline}\n"
6 > logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' *{obsolete}*')}{if(troubles, ' {troubles}')}) [{tags} {bookmarks}] {desc|firstline}\n"
7 > EOF
7 > EOF
8 $ mkcommit() {
8 $ mkcommit() {
9 > echo "$1" > "$1"
9 > echo "$1" > "$1"
10 > hg add "$1"
10 > hg add "$1"
11 > hg ci -m "add $1"
11 > hg ci -m "add $1"
12 > }
12 > }
13 $ getid() {
13 $ getid() {
14 > hg log -T "{node}\n" --hidden -r "desc('$1')"
14 > hg log -T "{node}\n" --hidden -r "desc('$1')"
15 > }
15 > }
16
16
17 $ cat > debugkeys.py <<EOF
17 $ cat > debugkeys.py <<EOF
18 > def reposetup(ui, repo):
18 > def reposetup(ui, repo):
19 > class debugkeysrepo(repo.__class__):
19 > class debugkeysrepo(repo.__class__):
20 > def listkeys(self, namespace):
20 > def listkeys(self, namespace):
21 > ui.write('listkeys %s\n' % (namespace,))
21 > ui.write('listkeys %s\n' % (namespace,))
22 > return super(debugkeysrepo, self).listkeys(namespace)
22 > return super(debugkeysrepo, self).listkeys(namespace)
23 >
23 >
24 > if repo.local():
24 > if repo.local():
25 > repo.__class__ = debugkeysrepo
25 > repo.__class__ = debugkeysrepo
26 > EOF
26 > EOF
27
27
28 $ hg init tmpa
28 $ hg init tmpa
29 $ cd tmpa
29 $ cd tmpa
30 $ mkcommit kill_me
30 $ mkcommit kill_me
31
31
32 Checking that the feature is properly disabled
32 Checking that the feature is properly disabled
33
33
34 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
34 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
35 abort: creating obsolete markers is not enabled on this repo
35 abort: creating obsolete markers is not enabled on this repo
36 [255]
36 [255]
37
37
38 Enabling it
38 Enabling it
39
39
40 $ cat >> $HGRCPATH << EOF
40 $ cat >> $HGRCPATH << EOF
41 > [experimental]
41 > [experimental]
42 > evolution=createmarkers,exchange
42 > evolution=createmarkers,exchange
43 > EOF
43 > EOF
44
44
45 Killing a single changeset without replacement
45 Killing a single changeset without replacement
46
46
47 $ hg debugobsolete 0
47 $ hg debugobsolete 0
48 abort: changeset references must be full hexadecimal node identifiers
48 abort: changeset references must be full hexadecimal node identifiers
49 [255]
49 [255]
50 $ hg debugobsolete '00'
50 $ hg debugobsolete '00'
51 abort: changeset references must be full hexadecimal node identifiers
51 abort: changeset references must be full hexadecimal node identifiers
52 [255]
52 [255]
53 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
53 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
54 $ hg debugobsolete
54 $ hg debugobsolete
55 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'}
55 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'}
56
56
57 (test that mercurial is not confused)
57 (test that mercurial is not confused)
58
58
59 $ hg up null --quiet # having 0 as parent prevents it to be hidden
59 $ hg up null --quiet # having 0 as parent prevents it to be hidden
60 $ hg tip
60 $ hg tip
61 -1:000000000000 (public) [tip ]
61 -1:000000000000 (public) [tip ]
62 $ hg up --hidden tip --quiet
62 $ hg up --hidden tip --quiet
63
63
64 Killing a single changeset with itself should fail
64 Killing a single changeset with itself should fail
65 (simple local safeguard)
65 (simple local safeguard)
66
66
67 $ hg debugobsolete `getid kill_me` `getid kill_me`
67 $ hg debugobsolete `getid kill_me` `getid kill_me`
68 abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0
68 abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0
69 [255]
69 [255]
70
70
71 $ cd ..
71 $ cd ..
72
72
73 Killing a single changeset with replacement
73 Killing a single changeset with replacement
74 (and testing the format option)
74 (and testing the format option)
75
75
76 $ hg init tmpb
76 $ hg init tmpb
77 $ cd tmpb
77 $ cd tmpb
78 $ mkcommit a
78 $ mkcommit a
79 $ mkcommit b
79 $ mkcommit b
80 $ mkcommit original_c
80 $ mkcommit original_c
81 $ hg up "desc('b')"
81 $ hg up "desc('b')"
82 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
83 $ mkcommit new_c
83 $ mkcommit new_c
84 created new head
84 created new head
85 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
85 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
86 $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120'
86 $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120'
87 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
87 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
88 2:245bde4270cd add original_c
88 2:245bde4270cd add original_c
89 $ hg debugrevlog -cd
89 $ hg debugrevlog -cd
90 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
90 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
91 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0
91 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0
92 1 0 -1 59 118 59 59 0 0 58 116 0 1 0
92 1 0 -1 59 118 59 59 0 0 58 116 0 1 0
93 2 1 -1 118 193 118 118 59 0 76 192 0 1 0
93 2 1 -1 118 193 118 118 59 0 76 192 0 1 0
94 3 1 -1 193 260 193 193 59 0 66 258 0 2 0
94 3 1 -1 193 260 193 193 59 0 66 258 0 2 0
95 $ hg debugobsolete
95 $ hg debugobsolete
96 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
96 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
97
97
98 (check for version number of the obsstore)
98 (check for version number of the obsstore)
99
99
100 $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null
100 $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null
101 \x00 (no-eol) (esc)
101 \x00 (no-eol) (esc)
102
102
103 do it again (it read the obsstore before adding new changeset)
103 do it again (it read the obsstore before adding new changeset)
104
104
105 $ hg up '.^'
105 $ hg up '.^'
106 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
106 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
107 $ mkcommit new_2_c
107 $ mkcommit new_2_c
108 created new head
108 created new head
109 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
109 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
110 $ hg debugobsolete
110 $ hg debugobsolete
111 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
111 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
112 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
112 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
113
113
114 Register two markers with a missing node
114 Register two markers with a missing node
115
115
116 $ hg up '.^'
116 $ hg up '.^'
117 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
117 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
118 $ mkcommit new_3_c
118 $ mkcommit new_3_c
119 created new head
119 created new head
120 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
120 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
121 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
121 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
122 $ hg debugobsolete
122 $ hg debugobsolete
123 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
123 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
124 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
124 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
125 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
125 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
126 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
126 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
127
127
128 Test the --index option of debugobsolete command
128 Test the --index option of debugobsolete command
129 $ hg debugobsolete --index
129 $ hg debugobsolete --index
130 0 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
130 0 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
131 1 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
131 1 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
132 2 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
132 2 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
133 3 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
133 3 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
134
134
135 Refuse pathological nullid successors
135 Refuse pathological nullid successors
136 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
136 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
137 transaction abort!
137 transaction abort!
138 rollback completed
138 rollback completed
139 abort: bad obsolescence marker detected: invalid successors nullid
139 abort: bad obsolescence marker detected: invalid successors nullid
140 [255]
140 [255]
141
141
142 Check that graphlog detect that a changeset is obsolete:
142 Check that graphlog detect that a changeset is obsolete:
143
143
144 $ hg log -G
144 $ hg log -G
145 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
145 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
146 |
146 |
147 o 1:7c3bad9141dc (draft) [ ] add b
147 o 1:7c3bad9141dc (draft) [ ] add b
148 |
148 |
149 o 0:1f0dee641bb7 (draft) [ ] add a
149 o 0:1f0dee641bb7 (draft) [ ] add a
150
150
151
151
152 check that heads does not report them
152 check that heads does not report them
153
153
154 $ hg heads
154 $ hg heads
155 5:5601fb93a350 (draft) [tip ] add new_3_c
155 5:5601fb93a350 (draft) [tip ] add new_3_c
156 $ hg heads --hidden
156 $ hg heads --hidden
157 5:5601fb93a350 (draft) [tip ] add new_3_c
157 5:5601fb93a350 (draft) [tip ] add new_3_c
158 4:ca819180edb9 (draft) [ ] add new_2_c
158 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c
159 3:cdbce2fbb163 (draft) [ ] add new_c
159 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c
160 2:245bde4270cd (draft) [ ] add original_c
160 2:245bde4270cd (draft *obsolete*) [ ] add original_c
161
161
162
162
163 check that summary does not report them
163 check that summary does not report them
164
164
165 $ hg init ../sink
165 $ hg init ../sink
166 $ echo '[paths]' >> .hg/hgrc
166 $ echo '[paths]' >> .hg/hgrc
167 $ echo 'default=../sink' >> .hg/hgrc
167 $ echo 'default=../sink' >> .hg/hgrc
168 $ hg summary --remote
168 $ hg summary --remote
169 parent: 5:5601fb93a350 tip
169 parent: 5:5601fb93a350 tip
170 add new_3_c
170 add new_3_c
171 branch: default
171 branch: default
172 commit: (clean)
172 commit: (clean)
173 update: (current)
173 update: (current)
174 phases: 3 draft
174 phases: 3 draft
175 remote: 3 outgoing
175 remote: 3 outgoing
176
176
177 $ hg summary --remote --hidden
177 $ hg summary --remote --hidden
178 parent: 5:5601fb93a350 tip
178 parent: 5:5601fb93a350 tip
179 add new_3_c
179 add new_3_c
180 branch: default
180 branch: default
181 commit: (clean)
181 commit: (clean)
182 update: 3 new changesets, 4 branch heads (merge)
182 update: 3 new changesets, 4 branch heads (merge)
183 phases: 6 draft
183 phases: 6 draft
184 remote: 3 outgoing
184 remote: 3 outgoing
185
185
186 check that various commands work well with filtering
186 check that various commands work well with filtering
187
187
188 $ hg tip
188 $ hg tip
189 5:5601fb93a350 (draft) [tip ] add new_3_c
189 5:5601fb93a350 (draft) [tip ] add new_3_c
190 $ hg log -r 6
190 $ hg log -r 6
191 abort: unknown revision '6'!
191 abort: unknown revision '6'!
192 [255]
192 [255]
193 $ hg log -r 4
193 $ hg log -r 4
194 abort: hidden revision '4'!
194 abort: hidden revision '4'!
195 (use --hidden to access hidden revisions)
195 (use --hidden to access hidden revisions)
196 [255]
196 [255]
197 $ hg debugrevspec 'rev(6)'
197 $ hg debugrevspec 'rev(6)'
198 $ hg debugrevspec 'rev(4)'
198 $ hg debugrevspec 'rev(4)'
199 $ hg debugrevspec 'null'
199 $ hg debugrevspec 'null'
200 -1
200 -1
201
201
202 Check that public changeset are not accounted as obsolete:
202 Check that public changeset are not accounted as obsolete:
203
203
204 $ hg --hidden phase --public 2
204 $ hg --hidden phase --public 2
205 $ hg log -G
205 $ hg log -G
206 @ 5:5601fb93a350 (draft bumped) [tip ] add new_3_c
206 @ 5:5601fb93a350 (draft bumped) [tip ] add new_3_c
207 |
207 |
208 | o 2:245bde4270cd (public) [ ] add original_c
208 | o 2:245bde4270cd (public) [ ] add original_c
209 |/
209 |/
210 o 1:7c3bad9141dc (public) [ ] add b
210 o 1:7c3bad9141dc (public) [ ] add b
211 |
211 |
212 o 0:1f0dee641bb7 (public) [ ] add a
212 o 0:1f0dee641bb7 (public) [ ] add a
213
213
214
214
215 And that bumped changeset are detected
215 And that bumped changeset are detected
216 --------------------------------------
216 --------------------------------------
217
217
218 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
218 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
219 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
219 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
220 the public changeset
220 the public changeset
221
221
222 $ hg log --hidden -r 'bumped()'
222 $ hg log --hidden -r 'bumped()'
223 5:5601fb93a350 (draft bumped) [tip ] add new_3_c
223 5:5601fb93a350 (draft bumped) [tip ] add new_3_c
224
224
225 And that we can't push bumped changeset
225 And that we can't push bumped changeset
226
226
227 $ hg push ../tmpa -r 0 --force #(make repo related)
227 $ hg push ../tmpa -r 0 --force #(make repo related)
228 pushing to ../tmpa
228 pushing to ../tmpa
229 searching for changes
229 searching for changes
230 warning: repository is unrelated
230 warning: repository is unrelated
231 adding changesets
231 adding changesets
232 adding manifests
232 adding manifests
233 adding file changes
233 adding file changes
234 added 1 changesets with 1 changes to 1 files (+1 heads)
234 added 1 changesets with 1 changes to 1 files (+1 heads)
235 $ hg push ../tmpa
235 $ hg push ../tmpa
236 pushing to ../tmpa
236 pushing to ../tmpa
237 searching for changes
237 searching for changes
238 abort: push includes bumped changeset: 5601fb93a350!
238 abort: push includes bumped changeset: 5601fb93a350!
239 [255]
239 [255]
240
240
241 Fixing "bumped" situation
241 Fixing "bumped" situation
242 We need to create a clone of 5 and add a special marker with a flag
242 We need to create a clone of 5 and add a special marker with a flag
243
243
244 $ hg summary
244 $ hg summary
245 parent: 5:5601fb93a350 tip (bumped)
245 parent: 5:5601fb93a350 tip (bumped)
246 add new_3_c
246 add new_3_c
247 branch: default
247 branch: default
248 commit: (clean)
248 commit: (clean)
249 update: 1 new changesets, 2 branch heads (merge)
249 update: 1 new changesets, 2 branch heads (merge)
250 phases: 1 draft
250 phases: 1 draft
251 bumped: 1 changesets
251 bumped: 1 changesets
252 $ hg up '5^'
252 $ hg up '5^'
253 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
253 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
254 $ hg revert -ar 5
254 $ hg revert -ar 5
255 adding new_3_c
255 adding new_3_c
256 $ hg ci -m 'add n3w_3_c'
256 $ hg ci -m 'add n3w_3_c'
257 created new head
257 created new head
258 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
258 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
259 $ hg log -r 'bumped()'
259 $ hg log -r 'bumped()'
260 $ hg log -G
260 $ hg log -G
261 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
261 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
262 |
262 |
263 | o 2:245bde4270cd (public) [ ] add original_c
263 | o 2:245bde4270cd (public) [ ] add original_c
264 |/
264 |/
265 o 1:7c3bad9141dc (public) [ ] add b
265 o 1:7c3bad9141dc (public) [ ] add b
266 |
266 |
267 o 0:1f0dee641bb7 (public) [ ] add a
267 o 0:1f0dee641bb7 (public) [ ] add a
268
268
269
269
270 $ cd ..
270 $ cd ..
271
271
272 Revision 0 is hidden
272 Revision 0 is hidden
273 --------------------
273 --------------------
274
274
275 $ hg init rev0hidden
275 $ hg init rev0hidden
276 $ cd rev0hidden
276 $ cd rev0hidden
277
277
278 $ mkcommit kill0
278 $ mkcommit kill0
279 $ hg up -q null
279 $ hg up -q null
280 $ hg debugobsolete `getid kill0`
280 $ hg debugobsolete `getid kill0`
281 $ mkcommit a
281 $ mkcommit a
282 $ mkcommit b
282 $ mkcommit b
283
283
284 Should pick the first visible revision as "repo" node
284 Should pick the first visible revision as "repo" node
285
285
286 $ hg archive ../archive-null
286 $ hg archive ../archive-null
287 $ cat ../archive-null/.hg_archival.txt
287 $ cat ../archive-null/.hg_archival.txt
288 repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e
288 repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e
289 node: 7c3bad9141dcb46ff89abf5f61856facd56e476c
289 node: 7c3bad9141dcb46ff89abf5f61856facd56e476c
290 branch: default
290 branch: default
291 latesttag: null
291 latesttag: null
292 latesttagdistance: 2
292 latesttagdistance: 2
293 changessincelatesttag: 2
293 changessincelatesttag: 2
294
294
295
295
296 $ cd ..
296 $ cd ..
297
297
298 Exchange Test
298 Exchange Test
299 ============================
299 ============================
300
300
301 Destination repo does not have any data
301 Destination repo does not have any data
302 ---------------------------------------
302 ---------------------------------------
303
303
304 Simple incoming test
304 Simple incoming test
305
305
306 $ hg init tmpc
306 $ hg init tmpc
307 $ cd tmpc
307 $ cd tmpc
308 $ hg incoming ../tmpb
308 $ hg incoming ../tmpb
309 comparing with ../tmpb
309 comparing with ../tmpb
310 0:1f0dee641bb7 (public) [ ] add a
310 0:1f0dee641bb7 (public) [ ] add a
311 1:7c3bad9141dc (public) [ ] add b
311 1:7c3bad9141dc (public) [ ] add b
312 2:245bde4270cd (public) [ ] add original_c
312 2:245bde4270cd (public) [ ] add original_c
313 6:6f9641995072 (draft) [tip ] add n3w_3_c
313 6:6f9641995072 (draft) [tip ] add n3w_3_c
314
314
315 Try to pull markers
315 Try to pull markers
316 (extinct changeset are excluded but marker are pushed)
316 (extinct changeset are excluded but marker are pushed)
317
317
318 $ hg pull ../tmpb
318 $ hg pull ../tmpb
319 pulling from ../tmpb
319 pulling from ../tmpb
320 requesting all changes
320 requesting all changes
321 adding changesets
321 adding changesets
322 adding manifests
322 adding manifests
323 adding file changes
323 adding file changes
324 added 4 changesets with 4 changes to 4 files (+1 heads)
324 added 4 changesets with 4 changes to 4 files (+1 heads)
325 5 new obsolescence markers
325 5 new obsolescence markers
326 (run 'hg heads' to see heads, 'hg merge' to merge)
326 (run 'hg heads' to see heads, 'hg merge' to merge)
327 $ hg debugobsolete
327 $ hg debugobsolete
328 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
328 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
329 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
329 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
330 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
330 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
331 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
331 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
332 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
332 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
333
333
334 Rollback//Transaction support
334 Rollback//Transaction support
335
335
336 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
336 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
337 $ hg debugobsolete
337 $ hg debugobsolete
338 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
338 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
339 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
339 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
340 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
340 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
341 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
341 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
342 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
342 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
343 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'}
343 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'}
344 $ hg rollback -n
344 $ hg rollback -n
345 repository tip rolled back to revision 3 (undo debugobsolete)
345 repository tip rolled back to revision 3 (undo debugobsolete)
346 $ hg rollback
346 $ hg rollback
347 repository tip rolled back to revision 3 (undo debugobsolete)
347 repository tip rolled back to revision 3 (undo debugobsolete)
348 $ hg debugobsolete
348 $ hg debugobsolete
349 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
349 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
350 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
350 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
351 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
351 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
352 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
352 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
353 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
353 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
354
354
355 $ cd ..
355 $ cd ..
356
356
357 Try to push markers
357 Try to push markers
358
358
359 $ hg init tmpd
359 $ hg init tmpd
360 $ hg -R tmpb push tmpd
360 $ hg -R tmpb push tmpd
361 pushing to tmpd
361 pushing to tmpd
362 searching for changes
362 searching for changes
363 adding changesets
363 adding changesets
364 adding manifests
364 adding manifests
365 adding file changes
365 adding file changes
366 added 4 changesets with 4 changes to 4 files (+1 heads)
366 added 4 changesets with 4 changes to 4 files (+1 heads)
367 5 new obsolescence markers
367 5 new obsolescence markers
368 $ hg -R tmpd debugobsolete | sort
368 $ hg -R tmpd debugobsolete | sort
369 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
369 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
370 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
370 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
371 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
371 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
372 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
372 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
373 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
373 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
374
374
375 Check obsolete keys are exchanged only if source has an obsolete store
375 Check obsolete keys are exchanged only if source has an obsolete store
376
376
377 $ hg init empty
377 $ hg init empty
378 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
378 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
379 pushing to tmpd
379 pushing to tmpd
380 listkeys phases
380 listkeys phases
381 listkeys bookmarks
381 listkeys bookmarks
382 no changes found
382 no changes found
383 listkeys phases
383 listkeys phases
384 [1]
384 [1]
385
385
386 clone support
386 clone support
387 (markers are copied and extinct changesets are included to allow hardlinks)
387 (markers are copied and extinct changesets are included to allow hardlinks)
388
388
389 $ hg clone tmpb clone-dest
389 $ hg clone tmpb clone-dest
390 updating to branch default
390 updating to branch default
391 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
391 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
392 $ hg -R clone-dest log -G --hidden
392 $ hg -R clone-dest log -G --hidden
393 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
393 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
394 |
394 |
395 | x 5:5601fb93a350 (draft) [ ] add new_3_c
395 | x 5:5601fb93a350 (draft *obsolete*) [ ] add new_3_c
396 |/
396 |/
397 | x 4:ca819180edb9 (draft) [ ] add new_2_c
397 | x 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c
398 |/
398 |/
399 | x 3:cdbce2fbb163 (draft) [ ] add new_c
399 | x 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c
400 |/
400 |/
401 | o 2:245bde4270cd (public) [ ] add original_c
401 | o 2:245bde4270cd (public) [ ] add original_c
402 |/
402 |/
403 o 1:7c3bad9141dc (public) [ ] add b
403 o 1:7c3bad9141dc (public) [ ] add b
404 |
404 |
405 o 0:1f0dee641bb7 (public) [ ] add a
405 o 0:1f0dee641bb7 (public) [ ] add a
406
406
407 $ hg -R clone-dest debugobsolete
407 $ hg -R clone-dest debugobsolete
408 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
408 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
409 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
409 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
410 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
410 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
411 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
411 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
412 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
412 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
413
413
414
414
415 Destination repo have existing data
415 Destination repo have existing data
416 ---------------------------------------
416 ---------------------------------------
417
417
418 On pull
418 On pull
419
419
420 $ hg init tmpe
420 $ hg init tmpe
421 $ cd tmpe
421 $ cd tmpe
422 $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00
422 $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00
423 $ hg pull ../tmpb
423 $ hg pull ../tmpb
424 pulling from ../tmpb
424 pulling from ../tmpb
425 requesting all changes
425 requesting all changes
426 adding changesets
426 adding changesets
427 adding manifests
427 adding manifests
428 adding file changes
428 adding file changes
429 added 4 changesets with 4 changes to 4 files (+1 heads)
429 added 4 changesets with 4 changes to 4 files (+1 heads)
430 5 new obsolescence markers
430 5 new obsolescence markers
431 (run 'hg heads' to see heads, 'hg merge' to merge)
431 (run 'hg heads' to see heads, 'hg merge' to merge)
432 $ hg debugobsolete
432 $ hg debugobsolete
433 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
433 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
434 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
434 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
435 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
435 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
436 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
436 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
437 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
437 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
438 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
438 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
439
439
440
440
441 On push
441 On push
442
442
443 $ hg push ../tmpc
443 $ hg push ../tmpc
444 pushing to ../tmpc
444 pushing to ../tmpc
445 searching for changes
445 searching for changes
446 no changes found
446 no changes found
447 1 new obsolescence markers
447 1 new obsolescence markers
448 [1]
448 [1]
449 $ hg -R ../tmpc debugobsolete
449 $ hg -R ../tmpc debugobsolete
450 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
450 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
451 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
451 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
452 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
452 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
453 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
453 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
454 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
454 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
455 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
455 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
456
456
457 detect outgoing obsolete and unstable
457 detect outgoing obsolete and unstable
458 ---------------------------------------
458 ---------------------------------------
459
459
460
460
461 $ hg log -G
461 $ hg log -G
462 o 3:6f9641995072 (draft) [tip ] add n3w_3_c
462 o 3:6f9641995072 (draft) [tip ] add n3w_3_c
463 |
463 |
464 | o 2:245bde4270cd (public) [ ] add original_c
464 | o 2:245bde4270cd (public) [ ] add original_c
465 |/
465 |/
466 o 1:7c3bad9141dc (public) [ ] add b
466 o 1:7c3bad9141dc (public) [ ] add b
467 |
467 |
468 o 0:1f0dee641bb7 (public) [ ] add a
468 o 0:1f0dee641bb7 (public) [ ] add a
469
469
470 $ hg up 'desc("n3w_3_c")'
470 $ hg up 'desc("n3w_3_c")'
471 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
471 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
472 $ mkcommit original_d
472 $ mkcommit original_d
473 $ mkcommit original_e
473 $ mkcommit original_e
474 $ hg debugobsolete --record-parents `getid original_d` -d '0 0'
474 $ hg debugobsolete --record-parents `getid original_d` -d '0 0'
475 $ hg debugobsolete | grep `getid original_d`
475 $ hg debugobsolete | grep `getid original_d`
476 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
476 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
477 $ hg log -r 'obsolete()'
477 $ hg log -r 'obsolete()'
478 4:94b33453f93b (draft) [ ] add original_d
478 4:94b33453f93b (draft *obsolete*) [ ] add original_d
479 $ hg summary
479 $ hg summary
480 parent: 5:cda648ca50f5 tip (unstable)
480 parent: 5:cda648ca50f5 tip (unstable)
481 add original_e
481 add original_e
482 branch: default
482 branch: default
483 commit: (clean)
483 commit: (clean)
484 update: 1 new changesets, 2 branch heads (merge)
484 update: 1 new changesets, 2 branch heads (merge)
485 phases: 3 draft
485 phases: 3 draft
486 unstable: 1 changesets
486 unstable: 1 changesets
487 $ hg log -G -r '::unstable()'
487 $ hg log -G -r '::unstable()'
488 @ 5:cda648ca50f5 (draft unstable) [tip ] add original_e
488 @ 5:cda648ca50f5 (draft unstable) [tip ] add original_e
489 |
489 |
490 x 4:94b33453f93b (draft) [ ] add original_d
490 x 4:94b33453f93b (draft *obsolete*) [ ] add original_d
491 |
491 |
492 o 3:6f9641995072 (draft) [ ] add n3w_3_c
492 o 3:6f9641995072 (draft) [ ] add n3w_3_c
493 |
493 |
494 o 1:7c3bad9141dc (public) [ ] add b
494 o 1:7c3bad9141dc (public) [ ] add b
495 |
495 |
496 o 0:1f0dee641bb7 (public) [ ] add a
496 o 0:1f0dee641bb7 (public) [ ] add a
497
497
498
498
499 refuse to push obsolete changeset
499 refuse to push obsolete changeset
500
500
501 $ hg push ../tmpc/ -r 'desc("original_d")'
501 $ hg push ../tmpc/ -r 'desc("original_d")'
502 pushing to ../tmpc/
502 pushing to ../tmpc/
503 searching for changes
503 searching for changes
504 abort: push includes obsolete changeset: 94b33453f93b!
504 abort: push includes obsolete changeset: 94b33453f93b!
505 [255]
505 [255]
506
506
507 refuse to push unstable changeset
507 refuse to push unstable changeset
508
508
509 $ hg push ../tmpc/
509 $ hg push ../tmpc/
510 pushing to ../tmpc/
510 pushing to ../tmpc/
511 searching for changes
511 searching for changes
512 abort: push includes unstable changeset: cda648ca50f5!
512 abort: push includes unstable changeset: cda648ca50f5!
513 [255]
513 [255]
514
514
515 Test that extinct changeset are properly detected
515 Test that extinct changeset are properly detected
516
516
517 $ hg log -r 'extinct()'
517 $ hg log -r 'extinct()'
518
518
519 Don't try to push extinct changeset
519 Don't try to push extinct changeset
520
520
521 $ hg init ../tmpf
521 $ hg init ../tmpf
522 $ hg out ../tmpf
522 $ hg out ../tmpf
523 comparing with ../tmpf
523 comparing with ../tmpf
524 searching for changes
524 searching for changes
525 0:1f0dee641bb7 (public) [ ] add a
525 0:1f0dee641bb7 (public) [ ] add a
526 1:7c3bad9141dc (public) [ ] add b
526 1:7c3bad9141dc (public) [ ] add b
527 2:245bde4270cd (public) [ ] add original_c
527 2:245bde4270cd (public) [ ] add original_c
528 3:6f9641995072 (draft) [ ] add n3w_3_c
528 3:6f9641995072 (draft) [ ] add n3w_3_c
529 4:94b33453f93b (draft) [ ] add original_d
529 4:94b33453f93b (draft *obsolete*) [ ] add original_d
530 5:cda648ca50f5 (draft unstable) [tip ] add original_e
530 5:cda648ca50f5 (draft unstable) [tip ] add original_e
531 $ hg push ../tmpf -f # -f because be push unstable too
531 $ hg push ../tmpf -f # -f because be push unstable too
532 pushing to ../tmpf
532 pushing to ../tmpf
533 searching for changes
533 searching for changes
534 adding changesets
534 adding changesets
535 adding manifests
535 adding manifests
536 adding file changes
536 adding file changes
537 added 6 changesets with 6 changes to 6 files (+1 heads)
537 added 6 changesets with 6 changes to 6 files (+1 heads)
538 7 new obsolescence markers
538 7 new obsolescence markers
539
539
540 no warning displayed
540 no warning displayed
541
541
542 $ hg push ../tmpf
542 $ hg push ../tmpf
543 pushing to ../tmpf
543 pushing to ../tmpf
544 searching for changes
544 searching for changes
545 no changes found
545 no changes found
546 [1]
546 [1]
547
547
548 Do not warn about new head when the new head is a successors of a remote one
548 Do not warn about new head when the new head is a successors of a remote one
549
549
550 $ hg log -G
550 $ hg log -G
551 @ 5:cda648ca50f5 (draft unstable) [tip ] add original_e
551 @ 5:cda648ca50f5 (draft unstable) [tip ] add original_e
552 |
552 |
553 x 4:94b33453f93b (draft) [ ] add original_d
553 x 4:94b33453f93b (draft *obsolete*) [ ] add original_d
554 |
554 |
555 o 3:6f9641995072 (draft) [ ] add n3w_3_c
555 o 3:6f9641995072 (draft) [ ] add n3w_3_c
556 |
556 |
557 | o 2:245bde4270cd (public) [ ] add original_c
557 | o 2:245bde4270cd (public) [ ] add original_c
558 |/
558 |/
559 o 1:7c3bad9141dc (public) [ ] add b
559 o 1:7c3bad9141dc (public) [ ] add b
560 |
560 |
561 o 0:1f0dee641bb7 (public) [ ] add a
561 o 0:1f0dee641bb7 (public) [ ] add a
562
562
563 $ hg up -q 'desc(n3w_3_c)'
563 $ hg up -q 'desc(n3w_3_c)'
564 $ mkcommit obsolete_e
564 $ mkcommit obsolete_e
565 created new head
565 created new head
566 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
566 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
567 $ hg outgoing ../tmpf # parasite hg outgoing testin
567 $ hg outgoing ../tmpf # parasite hg outgoing testin
568 comparing with ../tmpf
568 comparing with ../tmpf
569 searching for changes
569 searching for changes
570 6:3de5eca88c00 (draft) [tip ] add obsolete_e
570 6:3de5eca88c00 (draft) [tip ] add obsolete_e
571 $ hg push ../tmpf
571 $ hg push ../tmpf
572 pushing to ../tmpf
572 pushing to ../tmpf
573 searching for changes
573 searching for changes
574 adding changesets
574 adding changesets
575 adding manifests
575 adding manifests
576 adding file changes
576 adding file changes
577 added 1 changesets with 1 changes to 1 files (+1 heads)
577 added 1 changesets with 1 changes to 1 files (+1 heads)
578 1 new obsolescence markers
578 1 new obsolescence markers
579
579
580 test relevance computation
580 test relevance computation
581 ---------------------------------------
581 ---------------------------------------
582
582
583 Checking simple case of "marker relevance".
583 Checking simple case of "marker relevance".
584
584
585
585
586 Reminder of the repo situation
586 Reminder of the repo situation
587
587
588 $ hg log --hidden --graph
588 $ hg log --hidden --graph
589 @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e
589 @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e
590 |
590 |
591 | x 5:cda648ca50f5 (draft) [ ] add original_e
591 | x 5:cda648ca50f5 (draft *obsolete*) [ ] add original_e
592 | |
592 | |
593 | x 4:94b33453f93b (draft) [ ] add original_d
593 | x 4:94b33453f93b (draft *obsolete*) [ ] add original_d
594 |/
594 |/
595 o 3:6f9641995072 (draft) [ ] add n3w_3_c
595 o 3:6f9641995072 (draft) [ ] add n3w_3_c
596 |
596 |
597 | o 2:245bde4270cd (public) [ ] add original_c
597 | o 2:245bde4270cd (public) [ ] add original_c
598 |/
598 |/
599 o 1:7c3bad9141dc (public) [ ] add b
599 o 1:7c3bad9141dc (public) [ ] add b
600 |
600 |
601 o 0:1f0dee641bb7 (public) [ ] add a
601 o 0:1f0dee641bb7 (public) [ ] add a
602
602
603
603
604 List of all markers
604 List of all markers
605
605
606 $ hg debugobsolete
606 $ hg debugobsolete
607 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
607 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
608 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
608 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
609 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
609 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
610 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
610 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
611 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
611 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
612 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
612 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
613 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
613 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
614 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
614 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
615
615
616 List of changesets with no chain
616 List of changesets with no chain
617
617
618 $ hg debugobsolete --hidden --rev ::2
618 $ hg debugobsolete --hidden --rev ::2
619
619
620 List of changesets that are included on marker chain
620 List of changesets that are included on marker chain
621
621
622 $ hg debugobsolete --hidden --rev 6
622 $ hg debugobsolete --hidden --rev 6
623 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
623 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
624
624
625 List of changesets with a longer chain, (including a pruned children)
625 List of changesets with a longer chain, (including a pruned children)
626
626
627 $ hg debugobsolete --hidden --rev 3
627 $ hg debugobsolete --hidden --rev 3
628 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
628 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
629 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
629 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
630 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
630 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
631 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
631 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
632 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
632 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
633 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
633 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
634 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
634 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
635
635
636 List of both
636 List of both
637
637
638 $ hg debugobsolete --hidden --rev 3::6
638 $ hg debugobsolete --hidden --rev 3::6
639 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
639 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
640 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
640 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
641 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
641 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
642 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
642 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
643 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
643 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
644 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
644 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
645 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
645 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
646 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
646 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
647
647
648 List of all markers in JSON
648 List of all markers in JSON
649
649
650 $ hg debugobsolete -Tjson
650 $ hg debugobsolete -Tjson
651 [
651 [
652 {
652 {
653 "date": [1339.0, 0],
653 "date": [1339.0, 0],
654 "flag": 0,
654 "flag": 0,
655 "metadata": {"user": "test"},
655 "metadata": {"user": "test"},
656 "precnode": "1339133913391339133913391339133913391339",
656 "precnode": "1339133913391339133913391339133913391339",
657 "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"]
657 "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"]
658 },
658 },
659 {
659 {
660 "date": [1339.0, 0],
660 "date": [1339.0, 0],
661 "flag": 0,
661 "flag": 0,
662 "metadata": {"user": "test"},
662 "metadata": {"user": "test"},
663 "precnode": "1337133713371337133713371337133713371337",
663 "precnode": "1337133713371337133713371337133713371337",
664 "succnodes": ["5601fb93a350734d935195fee37f4054c529ff39"]
664 "succnodes": ["5601fb93a350734d935195fee37f4054c529ff39"]
665 },
665 },
666 {
666 {
667 "date": [121.0, 120],
667 "date": [121.0, 120],
668 "flag": 12,
668 "flag": 12,
669 "metadata": {"user": "test"},
669 "metadata": {"user": "test"},
670 "precnode": "245bde4270cd1072a27757984f9cda8ba26f08ca",
670 "precnode": "245bde4270cd1072a27757984f9cda8ba26f08ca",
671 "succnodes": ["cdbce2fbb16313928851e97e0d85413f3f7eb77f"]
671 "succnodes": ["cdbce2fbb16313928851e97e0d85413f3f7eb77f"]
672 },
672 },
673 {
673 {
674 "date": [1338.0, 0],
674 "date": [1338.0, 0],
675 "flag": 1,
675 "flag": 1,
676 "metadata": {"user": "test"},
676 "metadata": {"user": "test"},
677 "precnode": "5601fb93a350734d935195fee37f4054c529ff39",
677 "precnode": "5601fb93a350734d935195fee37f4054c529ff39",
678 "succnodes": ["6f96419950729f3671185b847352890f074f7557"]
678 "succnodes": ["6f96419950729f3671185b847352890f074f7557"]
679 },
679 },
680 {
680 {
681 "date": [1338.0, 0],
681 "date": [1338.0, 0],
682 "flag": 0,
682 "flag": 0,
683 "metadata": {"user": "test"},
683 "metadata": {"user": "test"},
684 "precnode": "ca819180edb99ed25ceafb3e9584ac287e240b00",
684 "precnode": "ca819180edb99ed25ceafb3e9584ac287e240b00",
685 "succnodes": ["1337133713371337133713371337133713371337"]
685 "succnodes": ["1337133713371337133713371337133713371337"]
686 },
686 },
687 {
687 {
688 "date": [1337.0, 0],
688 "date": [1337.0, 0],
689 "flag": 0,
689 "flag": 0,
690 "metadata": {"user": "test"},
690 "metadata": {"user": "test"},
691 "precnode": "cdbce2fbb16313928851e97e0d85413f3f7eb77f",
691 "precnode": "cdbce2fbb16313928851e97e0d85413f3f7eb77f",
692 "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"]
692 "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"]
693 },
693 },
694 {
694 {
695 "date": [0.0, 0],
695 "date": [0.0, 0],
696 "flag": 0,
696 "flag": 0,
697 "metadata": {"user": "test"},
697 "metadata": {"user": "test"},
698 "parentnodes": ["6f96419950729f3671185b847352890f074f7557"],
698 "parentnodes": ["6f96419950729f3671185b847352890f074f7557"],
699 "precnode": "94b33453f93bdb8d457ef9b770851a618bf413e1",
699 "precnode": "94b33453f93bdb8d457ef9b770851a618bf413e1",
700 "succnodes": []
700 "succnodes": []
701 },
701 },
702 {
702 {
703 "date": *, (glob)
703 "date": *, (glob)
704 "flag": 0,
704 "flag": 0,
705 "metadata": {"user": "test"},
705 "metadata": {"user": "test"},
706 "precnode": "cda648ca50f50482b7055c0b0c4c117bba6733d9",
706 "precnode": "cda648ca50f50482b7055c0b0c4c117bba6733d9",
707 "succnodes": ["3de5eca88c00aa039da7399a220f4a5221faa585"]
707 "succnodes": ["3de5eca88c00aa039da7399a220f4a5221faa585"]
708 }
708 }
709 ]
709 ]
710
710
711 Template keywords
711 Template keywords
712
712
713 $ hg debugobsolete -r6 -T '{succnodes % "{node|short}"} {date|shortdate}\n'
713 $ hg debugobsolete -r6 -T '{succnodes % "{node|short}"} {date|shortdate}\n'
714 3de5eca88c00 ????-??-?? (glob)
714 3de5eca88c00 ????-??-?? (glob)
715 $ hg debugobsolete -r6 -T '{join(metadata % "{key}={value}", " ")}\n'
715 $ hg debugobsolete -r6 -T '{join(metadata % "{key}={value}", " ")}\n'
716 user=test
716 user=test
717 $ hg debugobsolete -r6 -T '{metadata}\n'
717 $ hg debugobsolete -r6 -T '{metadata}\n'
718 'user': 'test'
718 'user': 'test'
719 $ hg debugobsolete -r6 -T '{flag} {get(metadata, "user")}\n'
719 $ hg debugobsolete -r6 -T '{flag} {get(metadata, "user")}\n'
720 0 test
720 0 test
721
721
722 Test the debug output for exchange
722 Test the debug output for exchange
723 ----------------------------------
723 ----------------------------------
724
724
725 $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' # bundle2
725 $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' # bundle2
726 pulling from ../tmpb
726 pulling from ../tmpb
727 searching for changes
727 searching for changes
728 no changes found
728 no changes found
729 obsmarker-exchange: 346 bytes received
729 obsmarker-exchange: 346 bytes received
730
730
731 check hgweb does not explode
731 check hgweb does not explode
732 ====================================
732 ====================================
733
733
734 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
734 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
735 adding changesets
735 adding changesets
736 adding manifests
736 adding manifests
737 adding file changes
737 adding file changes
738 added 62 changesets with 63 changes to 9 files (+60 heads)
738 added 62 changesets with 63 changes to 9 files (+60 heads)
739 (run 'hg heads .' to see heads, 'hg merge' to merge)
739 (run 'hg heads .' to see heads, 'hg merge' to merge)
740 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
740 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
741 > do
741 > do
742 > hg debugobsolete $node
742 > hg debugobsolete $node
743 > done
743 > done
744 $ hg up tip
744 $ hg up tip
745 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
745 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
746
746
747 #if serve
747 #if serve
748
748
749 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
749 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
750 $ cat hg.pid >> $DAEMON_PIDS
750 $ cat hg.pid >> $DAEMON_PIDS
751
751
752 check changelog view
752 check changelog view
753
753
754 $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/'
754 $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/'
755 200 Script output follows
755 200 Script output follows
756
756
757 check graph view
757 check graph view
758
758
759 $ get-with-headers.py --headeronly localhost:$HGPORT 'graph'
759 $ get-with-headers.py --headeronly localhost:$HGPORT 'graph'
760 200 Script output follows
760 200 Script output follows
761
761
762 check filelog view
762 check filelog view
763
763
764 $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar'
764 $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar'
765 200 Script output follows
765 200 Script output follows
766
766
767 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68'
767 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68'
768 200 Script output follows
768 200 Script output follows
769 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
769 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
770 404 Not Found
770 404 Not Found
771 [1]
771 [1]
772
772
773 check that web.view config option:
773 check that web.view config option:
774
774
775 $ killdaemons.py hg.pid
775 $ killdaemons.py hg.pid
776 $ cat >> .hg/hgrc << EOF
776 $ cat >> .hg/hgrc << EOF
777 > [web]
777 > [web]
778 > view=all
778 > view=all
779 > EOF
779 > EOF
780 $ wait
780 $ wait
781 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
781 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
782 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
782 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
783 200 Script output follows
783 200 Script output follows
784 $ killdaemons.py hg.pid
784 $ killdaemons.py hg.pid
785
785
786 Checking _enable=False warning if obsolete marker exists
786 Checking _enable=False warning if obsolete marker exists
787
787
788 $ echo '[experimental]' >> $HGRCPATH
788 $ echo '[experimental]' >> $HGRCPATH
789 $ echo "evolution=" >> $HGRCPATH
789 $ echo "evolution=" >> $HGRCPATH
790 $ hg log -r tip
790 $ hg log -r tip
791 obsolete feature not enabled but 68 markers found!
791 obsolete feature not enabled but 68 markers found!
792 68:c15e9edfca13 (draft) [tip ] add celestine
792 68:c15e9edfca13 (draft) [tip ] add celestine
793
793
794 reenable for later test
794 reenable for later test
795
795
796 $ echo '[experimental]' >> $HGRCPATH
796 $ echo '[experimental]' >> $HGRCPATH
797 $ echo "evolution=createmarkers,exchange" >> $HGRCPATH
797 $ echo "evolution=createmarkers,exchange" >> $HGRCPATH
798
798
799 $ rm hg.pid access.log errors.log
799 $ rm hg.pid access.log errors.log
800 #endif
800 #endif
801
801
802 Several troubles on the same changeset (create an unstable and bumped changeset)
802 Several troubles on the same changeset (create an unstable and bumped changeset)
803
803
804 $ hg debugobsolete `getid obsolete_e`
804 $ hg debugobsolete `getid obsolete_e`
805 $ hg debugobsolete `getid original_c` `getid babar`
805 $ hg debugobsolete `getid original_c` `getid babar`
806 $ hg log --config ui.logtemplate= -r 'bumped() and unstable()'
806 $ hg log --config ui.logtemplate= -r 'bumped() and unstable()'
807 changeset: 7:50c51b361e60
807 changeset: 7:50c51b361e60
808 user: test
808 user: test
809 date: Thu Jan 01 00:00:00 1970 +0000
809 date: Thu Jan 01 00:00:00 1970 +0000
810 trouble: unstable, bumped
810 trouble: unstable, bumped
811 summary: add babar
811 summary: add babar
812
812
813
813
814 test the "obsolete" templatekw
815
816 $ hg log -r 'obsolete()'
817 6:3de5eca88c00 (draft *obsolete*) [ ] add obsolete_e
818
814 test the "troubles" templatekw
819 test the "troubles" templatekw
815
820
816 $ hg log -r 'bumped() and unstable()'
821 $ hg log -r 'bumped() and unstable()'
817 7:50c51b361e60 (draft unstable bumped) [ ] add babar
822 7:50c51b361e60 (draft unstable bumped) [ ] add babar
818
823
819 test the default cmdline template
824 test the default cmdline template
820
825
821 $ hg log -T default -r 'bumped()'
826 $ hg log -T default -r 'bumped()'
822 changeset: 7:50c51b361e60
827 changeset: 7:50c51b361e60
823 user: test
828 user: test
824 date: Thu Jan 01 00:00:00 1970 +0000
829 date: Thu Jan 01 00:00:00 1970 +0000
825 trouble: unstable, bumped
830 trouble: unstable, bumped
826 summary: add babar
831 summary: add babar
827
832
828
833
829 test summary output
834 test summary output
830
835
831 $ hg up -r 'bumped() and unstable()'
836 $ hg up -r 'bumped() and unstable()'
832 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
837 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
833 $ hg summary
838 $ hg summary
834 parent: 7:50c51b361e60 (unstable, bumped)
839 parent: 7:50c51b361e60 (unstable, bumped)
835 add babar
840 add babar
836 branch: default
841 branch: default
837 commit: (clean)
842 commit: (clean)
838 update: 2 new changesets (update)
843 update: 2 new changesets (update)
839 phases: 4 draft
844 phases: 4 draft
840 unstable: 2 changesets
845 unstable: 2 changesets
841 bumped: 1 changesets
846 bumped: 1 changesets
842
847
843 Test incoming/outcoming with changesets obsoleted remotely, known locally
848 Test incoming/outcoming with changesets obsoleted remotely, known locally
844 ===============================================================================
849 ===============================================================================
845
850
846 This test issue 3805
851 This test issue 3805
847
852
848 $ hg init repo-issue3805
853 $ hg init repo-issue3805
849 $ cd repo-issue3805
854 $ cd repo-issue3805
850 $ echo "base" > base
855 $ echo "base" > base
851 $ hg ci -Am "base"
856 $ hg ci -Am "base"
852 adding base
857 adding base
853 $ echo "foo" > foo
858 $ echo "foo" > foo
854 $ hg ci -Am "A"
859 $ hg ci -Am "A"
855 adding foo
860 adding foo
856 $ hg clone . ../other-issue3805
861 $ hg clone . ../other-issue3805
857 updating to branch default
862 updating to branch default
858 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
863 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
859 $ echo "bar" >> foo
864 $ echo "bar" >> foo
860 $ hg ci --amend
865 $ hg ci --amend
861 $ cd ../other-issue3805
866 $ cd ../other-issue3805
862 $ hg log -G
867 $ hg log -G
863 @ 1:29f0c6921ddd (draft) [tip ] A
868 @ 1:29f0c6921ddd (draft) [tip ] A
864 |
869 |
865 o 0:d20a80d4def3 (draft) [ ] base
870 o 0:d20a80d4def3 (draft) [ ] base
866
871
867 $ hg log -G -R ../repo-issue3805
872 $ hg log -G -R ../repo-issue3805
868 @ 3:323a9c3ddd91 (draft) [tip ] A
873 @ 3:323a9c3ddd91 (draft) [tip ] A
869 |
874 |
870 o 0:d20a80d4def3 (draft) [ ] base
875 o 0:d20a80d4def3 (draft) [ ] base
871
876
872 $ hg incoming
877 $ hg incoming
873 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
878 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
874 searching for changes
879 searching for changes
875 3:323a9c3ddd91 (draft) [tip ] A
880 3:323a9c3ddd91 (draft) [tip ] A
876 $ hg incoming --bundle ../issue3805.hg
881 $ hg incoming --bundle ../issue3805.hg
877 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
882 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
878 searching for changes
883 searching for changes
879 3:323a9c3ddd91 (draft) [tip ] A
884 3:323a9c3ddd91 (draft) [tip ] A
880 $ hg outgoing
885 $ hg outgoing
881 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
886 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
882 searching for changes
887 searching for changes
883 1:29f0c6921ddd (draft) [tip ] A
888 1:29f0c6921ddd (draft) [tip ] A
884
889
885 #if serve
890 #if serve
886
891
887 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
892 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
888 $ cat hg.pid >> $DAEMON_PIDS
893 $ cat hg.pid >> $DAEMON_PIDS
889
894
890 $ hg incoming http://localhost:$HGPORT
895 $ hg incoming http://localhost:$HGPORT
891 comparing with http://localhost:$HGPORT/
896 comparing with http://localhost:$HGPORT/
892 searching for changes
897 searching for changes
893 2:323a9c3ddd91 (draft) [tip ] A
898 2:323a9c3ddd91 (draft) [tip ] A
894 $ hg outgoing http://localhost:$HGPORT
899 $ hg outgoing http://localhost:$HGPORT
895 comparing with http://localhost:$HGPORT/
900 comparing with http://localhost:$HGPORT/
896 searching for changes
901 searching for changes
897 1:29f0c6921ddd (draft) [tip ] A
902 1:29f0c6921ddd (draft) [tip ] A
898
903
899 $ killdaemons.py
904 $ killdaemons.py
900
905
901 #endif
906 #endif
902
907
903 This test issue 3814
908 This test issue 3814
904
909
905 (nothing to push but locally hidden changeset)
910 (nothing to push but locally hidden changeset)
906
911
907 $ cd ..
912 $ cd ..
908 $ hg init repo-issue3814
913 $ hg init repo-issue3814
909 $ cd repo-issue3805
914 $ cd repo-issue3805
910 $ hg push -r 323a9c3ddd91 ../repo-issue3814
915 $ hg push -r 323a9c3ddd91 ../repo-issue3814
911 pushing to ../repo-issue3814
916 pushing to ../repo-issue3814
912 searching for changes
917 searching for changes
913 adding changesets
918 adding changesets
914 adding manifests
919 adding manifests
915 adding file changes
920 adding file changes
916 added 2 changesets with 2 changes to 2 files
921 added 2 changesets with 2 changes to 2 files
917 2 new obsolescence markers
922 2 new obsolescence markers
918 $ hg out ../repo-issue3814
923 $ hg out ../repo-issue3814
919 comparing with ../repo-issue3814
924 comparing with ../repo-issue3814
920 searching for changes
925 searching for changes
921 no changes found
926 no changes found
922 [1]
927 [1]
923
928
924 Test that a local tag blocks a changeset from being hidden
929 Test that a local tag blocks a changeset from being hidden
925
930
926 $ hg tag -l visible -r 1 --hidden
931 $ hg tag -l visible -r 1 --hidden
927 $ hg log -G
932 $ hg log -G
928 @ 3:323a9c3ddd91 (draft) [tip ] A
933 @ 3:323a9c3ddd91 (draft) [tip ] A
929 |
934 |
930 | x 1:29f0c6921ddd (draft) [visible ] A
935 | x 1:29f0c6921ddd (draft *obsolete*) [visible ] A
931 |/
936 |/
932 o 0:d20a80d4def3 (draft) [ ] base
937 o 0:d20a80d4def3 (draft) [ ] base
933
938
934 Test that removing a local tag does not cause some commands to fail
939 Test that removing a local tag does not cause some commands to fail
935
940
936 $ hg tag -l -r tip tiptag
941 $ hg tag -l -r tip tiptag
937 $ hg tags
942 $ hg tags
938 tiptag 3:323a9c3ddd91
943 tiptag 3:323a9c3ddd91
939 tip 3:323a9c3ddd91
944 tip 3:323a9c3ddd91
940 visible 1:29f0c6921ddd
945 visible 1:29f0c6921ddd
941 $ hg --config extensions.strip= strip -r tip --no-backup
946 $ hg --config extensions.strip= strip -r tip --no-backup
942 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
947 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
943 $ hg tags
948 $ hg tags
944 visible 1:29f0c6921ddd
949 visible 1:29f0c6921ddd
945 tip 1:29f0c6921ddd
950 tip 1:29f0c6921ddd
946
951
947 Test bundle overlay onto hidden revision
952 Test bundle overlay onto hidden revision
948
953
949 $ cd ..
954 $ cd ..
950 $ hg init repo-bundleoverlay
955 $ hg init repo-bundleoverlay
951 $ cd repo-bundleoverlay
956 $ cd repo-bundleoverlay
952 $ echo "A" > foo
957 $ echo "A" > foo
953 $ hg ci -Am "A"
958 $ hg ci -Am "A"
954 adding foo
959 adding foo
955 $ echo "B" >> foo
960 $ echo "B" >> foo
956 $ hg ci -m "B"
961 $ hg ci -m "B"
957 $ hg up 0
962 $ hg up 0
958 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
963 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
959 $ echo "C" >> foo
964 $ echo "C" >> foo
960 $ hg ci -m "C"
965 $ hg ci -m "C"
961 created new head
966 created new head
962 $ hg log -G
967 $ hg log -G
963 @ 2:c186d7714947 (draft) [tip ] C
968 @ 2:c186d7714947 (draft) [tip ] C
964 |
969 |
965 | o 1:44526ebb0f98 (draft) [ ] B
970 | o 1:44526ebb0f98 (draft) [ ] B
966 |/
971 |/
967 o 0:4b34ecfb0d56 (draft) [ ] A
972 o 0:4b34ecfb0d56 (draft) [ ] A
968
973
969
974
970 $ hg clone -r1 . ../other-bundleoverlay
975 $ hg clone -r1 . ../other-bundleoverlay
971 adding changesets
976 adding changesets
972 adding manifests
977 adding manifests
973 adding file changes
978 adding file changes
974 added 2 changesets with 2 changes to 1 files
979 added 2 changesets with 2 changes to 1 files
975 updating to branch default
980 updating to branch default
976 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
981 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
977 $ cd ../other-bundleoverlay
982 $ cd ../other-bundleoverlay
978 $ echo "B+" >> foo
983 $ echo "B+" >> foo
979 $ hg ci --amend -m "B+"
984 $ hg ci --amend -m "B+"
980 $ hg log -G --hidden
985 $ hg log -G --hidden
981 @ 3:b7d587542d40 (draft) [tip ] B+
986 @ 3:b7d587542d40 (draft) [tip ] B+
982 |
987 |
983 | x 2:eb95e9297e18 (draft) [ ] temporary amend commit for 44526ebb0f98
988 | x 2:eb95e9297e18 (draft *obsolete*) [ ] temporary amend commit for 44526ebb0f98
984 | |
989 | |
985 | x 1:44526ebb0f98 (draft) [ ] B
990 | x 1:44526ebb0f98 (draft *obsolete*) [ ] B
986 |/
991 |/
987 o 0:4b34ecfb0d56 (draft) [ ] A
992 o 0:4b34ecfb0d56 (draft) [ ] A
988
993
989
994
990 $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
995 $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
991 comparing with ../repo-bundleoverlay
996 comparing with ../repo-bundleoverlay
992 searching for changes
997 searching for changes
993 1:44526ebb0f98 (draft) [ ] B
998 1:44526ebb0f98 (draft) [ ] B
994 2:c186d7714947 (draft) [tip ] C
999 2:c186d7714947 (draft) [tip ] C
995 $ hg log -G -R ../bundleoverlay.hg
1000 $ hg log -G -R ../bundleoverlay.hg
996 o 4:c186d7714947 (draft) [tip ] C
1001 o 4:c186d7714947 (draft) [tip ] C
997 |
1002 |
998 | @ 3:b7d587542d40 (draft) [ ] B+
1003 | @ 3:b7d587542d40 (draft) [ ] B+
999 |/
1004 |/
1000 o 0:4b34ecfb0d56 (draft) [ ] A
1005 o 0:4b34ecfb0d56 (draft) [ ] A
1001
1006
1002
1007
1003 #if serve
1008 #if serve
1004
1009
1005 Test issue 4506
1010 Test issue 4506
1006
1011
1007 $ cd ..
1012 $ cd ..
1008 $ hg init repo-issue4506
1013 $ hg init repo-issue4506
1009 $ cd repo-issue4506
1014 $ cd repo-issue4506
1010 $ echo "0" > foo
1015 $ echo "0" > foo
1011 $ hg add foo
1016 $ hg add foo
1012 $ hg ci -m "content-0"
1017 $ hg ci -m "content-0"
1013
1018
1014 $ hg up null
1019 $ hg up null
1015 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1020 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1016 $ echo "1" > bar
1021 $ echo "1" > bar
1017 $ hg add bar
1022 $ hg add bar
1018 $ hg ci -m "content-1"
1023 $ hg ci -m "content-1"
1019 created new head
1024 created new head
1020 $ hg up 0
1025 $ hg up 0
1021 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1026 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1022 $ hg graft 1
1027 $ hg graft 1
1023 grafting 1:1c9eddb02162 "content-1" (tip)
1028 grafting 1:1c9eddb02162 "content-1" (tip)
1024
1029
1025 $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'`
1030 $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'`
1026
1031
1027 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1032 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1028 $ cat hg.pid >> $DAEMON_PIDS
1033 $ cat hg.pid >> $DAEMON_PIDS
1029
1034
1030 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1'
1035 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1'
1031 404 Not Found
1036 404 Not Found
1032 [1]
1037 [1]
1033 $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar'
1038 $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar'
1034 200 Script output follows
1039 200 Script output follows
1035 $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar'
1040 $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar'
1036 200 Script output follows
1041 200 Script output follows
1037
1042
1038 $ killdaemons.py
1043 $ killdaemons.py
1039
1044
1040 #endif
1045 #endif
1041
1046
1042 Test heads computation on pending index changes with obsolescence markers
1047 Test heads computation on pending index changes with obsolescence markers
1043 $ cd ..
1048 $ cd ..
1044 $ cat >$TESTTMP/test_extension.py << EOF
1049 $ cat >$TESTTMP/test_extension.py << EOF
1045 > from mercurial import cmdutil
1050 > from mercurial import cmdutil
1046 > from mercurial.i18n import _
1051 > from mercurial.i18n import _
1047 >
1052 >
1048 > cmdtable = {}
1053 > cmdtable = {}
1049 > command = cmdutil.command(cmdtable)
1054 > command = cmdutil.command(cmdtable)
1050 > @command("amendtransient",[], _('hg amendtransient [rev]'))
1055 > @command("amendtransient",[], _('hg amendtransient [rev]'))
1051 > def amend(ui, repo, *pats, **opts):
1056 > def amend(ui, repo, *pats, **opts):
1052 > def commitfunc(ui, repo, message, match, opts):
1057 > def commitfunc(ui, repo, message, match, opts):
1053 > return repo.commit(message, repo['.'].user(), repo['.'].date(), match)
1058 > return repo.commit(message, repo['.'].user(), repo['.'].date(), match)
1054 > opts['message'] = 'Test'
1059 > opts['message'] = 'Test'
1055 > opts['logfile'] = None
1060 > opts['logfile'] = None
1056 > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts)
1061 > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts)
1057 > ui.write('%s\n' % repo.changelog.headrevs())
1062 > ui.write('%s\n' % repo.changelog.headrevs())
1058 > EOF
1063 > EOF
1059 $ cat >> $HGRCPATH << EOF
1064 $ cat >> $HGRCPATH << EOF
1060 > [extensions]
1065 > [extensions]
1061 > testextension=$TESTTMP/test_extension.py
1066 > testextension=$TESTTMP/test_extension.py
1062 > EOF
1067 > EOF
1063 $ hg init repo-issue-nativerevs-pending-changes
1068 $ hg init repo-issue-nativerevs-pending-changes
1064 $ cd repo-issue-nativerevs-pending-changes
1069 $ cd repo-issue-nativerevs-pending-changes
1065 $ mkcommit a
1070 $ mkcommit a
1066 $ mkcommit b
1071 $ mkcommit b
1067 $ hg up ".^"
1072 $ hg up ".^"
1068 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1073 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1069 $ echo aa > a
1074 $ echo aa > a
1070 $ hg amendtransient
1075 $ hg amendtransient
1071 [1, 3]
1076 [1, 3]
1072
1077
1073 Check that corrupted hidden cache does not crash
1078 Check that corrupted hidden cache does not crash
1074
1079
1075 $ printf "" > .hg/cache/hidden
1080 $ printf "" > .hg/cache/hidden
1076 $ hg log -r . -T '{node}' --debug
1081 $ hg log -r . -T '{node}' --debug
1077 corrupted hidden cache
1082 corrupted hidden cache
1078 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol)
1083 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol)
1079 $ hg log -r . -T '{node}' --debug
1084 $ hg log -r . -T '{node}' --debug
1080 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol)
1085 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol)
1081
1086
1082 #if unix-permissions
1087 #if unix-permissions
1083 Check that wrong hidden cache permission does not crash
1088 Check that wrong hidden cache permission does not crash
1084
1089
1085 $ chmod 000 .hg/cache/hidden
1090 $ chmod 000 .hg/cache/hidden
1086 $ hg log -r . -T '{node}' --debug
1091 $ hg log -r . -T '{node}' --debug
1087 cannot read hidden cache
1092 cannot read hidden cache
1088 error writing hidden changesets cache
1093 error writing hidden changesets cache
1089 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol)
1094 8fd96dfc63e51ed5a8af1bec18eb4b19dbf83812 (no-eol)
1090 #endif
1095 #endif
1091
1096
1092 Test cache consistency for the visible filter
1097 Test cache consistency for the visible filter
1093 1) We want to make sure that the cached filtered revs are invalidated when
1098 1) We want to make sure that the cached filtered revs are invalidated when
1094 bookmarks change
1099 bookmarks change
1095 $ cd ..
1100 $ cd ..
1096 $ cat >$TESTTMP/test_extension.py << EOF
1101 $ cat >$TESTTMP/test_extension.py << EOF
1097 > import weakref
1102 > import weakref
1098 > from mercurial import cmdutil, extensions, bookmarks, repoview
1103 > from mercurial import cmdutil, extensions, bookmarks, repoview
1099 > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs):
1104 > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs):
1100 > reporef = weakref.ref(bkmstoreinst._repo)
1105 > reporef = weakref.ref(bkmstoreinst._repo)
1101 > def trhook(tr):
1106 > def trhook(tr):
1102 > repo = reporef()
1107 > repo = reporef()
1103 > hidden1 = repoview.computehidden(repo)
1108 > hidden1 = repoview.computehidden(repo)
1104 > hidden = repoview.filterrevs(repo, 'visible')
1109 > hidden = repoview.filterrevs(repo, 'visible')
1105 > if sorted(hidden1) != sorted(hidden):
1110 > if sorted(hidden1) != sorted(hidden):
1106 > print "cache inconsistency"
1111 > print "cache inconsistency"
1107 > bkmstoreinst._repo.currenttransaction().addpostclose('test_extension', trhook)
1112 > bkmstoreinst._repo.currenttransaction().addpostclose('test_extension', trhook)
1108 > orig(bkmstoreinst, *args, **kwargs)
1113 > orig(bkmstoreinst, *args, **kwargs)
1109 > def extsetup(ui):
1114 > def extsetup(ui):
1110 > extensions.wrapfunction(bookmarks.bmstore, 'recordchange',
1115 > extensions.wrapfunction(bookmarks.bmstore, 'recordchange',
1111 > _bookmarkchanged)
1116 > _bookmarkchanged)
1112 > EOF
1117 > EOF
1113
1118
1114 $ hg init repo-cache-inconsistency
1119 $ hg init repo-cache-inconsistency
1115 $ cd repo-issue-nativerevs-pending-changes
1120 $ cd repo-issue-nativerevs-pending-changes
1116 $ mkcommit a
1121 $ mkcommit a
1117 a already tracked!
1122 a already tracked!
1118 $ mkcommit b
1123 $ mkcommit b
1119 $ hg id
1124 $ hg id
1120 13bedc178fce tip
1125 13bedc178fce tip
1121 $ echo "hello" > b
1126 $ echo "hello" > b
1122 $ hg commit --amend -m "message"
1127 $ hg commit --amend -m "message"
1123 $ hg book bookb -r 13bedc178fce --hidden
1128 $ hg book bookb -r 13bedc178fce --hidden
1124 $ hg log -r 13bedc178fce
1129 $ hg log -r 13bedc178fce
1125 5:13bedc178fce (draft) [ bookb] add b
1130 5:13bedc178fce (draft *obsolete*) [ bookb] add b
1126 $ hg book -d bookb
1131 $ hg book -d bookb
1127 $ hg log -r 13bedc178fce
1132 $ hg log -r 13bedc178fce
1128 abort: hidden revision '13bedc178fce'!
1133 abort: hidden revision '13bedc178fce'!
1129 (use --hidden to access hidden revisions)
1134 (use --hidden to access hidden revisions)
1130 [255]
1135 [255]
1131
1136
1132 Empty out the test extension, as it isn't compatible with later parts
1137 Empty out the test extension, as it isn't compatible with later parts
1133 of the test.
1138 of the test.
1134 $ echo > $TESTTMP/test_extension.py
1139 $ echo > $TESTTMP/test_extension.py
1135
1140
1136 Test ability to pull changeset with locally applying obsolescence markers
1141 Test ability to pull changeset with locally applying obsolescence markers
1137 (issue4945)
1142 (issue4945)
1138
1143
1139 $ cd ..
1144 $ cd ..
1140 $ hg init issue4845
1145 $ hg init issue4845
1141 $ cd issue4845
1146 $ cd issue4845
1142
1147
1143 $ echo foo > f0
1148 $ echo foo > f0
1144 $ hg add f0
1149 $ hg add f0
1145 $ hg ci -m '0'
1150 $ hg ci -m '0'
1146 $ echo foo > f1
1151 $ echo foo > f1
1147 $ hg add f1
1152 $ hg add f1
1148 $ hg ci -m '1'
1153 $ hg ci -m '1'
1149 $ echo foo > f2
1154 $ echo foo > f2
1150 $ hg add f2
1155 $ hg add f2
1151 $ hg ci -m '2'
1156 $ hg ci -m '2'
1152
1157
1153 $ echo bar > f2
1158 $ echo bar > f2
1154 $ hg commit --amend --config experimetnal.evolution=createmarkers
1159 $ hg commit --amend --config experimetnal.evolution=createmarkers
1155 $ hg log -G
1160 $ hg log -G
1156 @ 4:b0551702f918 (draft) [tip ] 2
1161 @ 4:b0551702f918 (draft) [tip ] 2
1157 |
1162 |
1158 o 1:e016b03fd86f (draft) [ ] 1
1163 o 1:e016b03fd86f (draft) [ ] 1
1159 |
1164 |
1160 o 0:a78f55e5508c (draft) [ ] 0
1165 o 0:a78f55e5508c (draft) [ ] 0
1161
1166
1162 $ hg log -G --hidden
1167 $ hg log -G --hidden
1163 @ 4:b0551702f918 (draft) [tip ] 2
1168 @ 4:b0551702f918 (draft) [tip ] 2
1164 |
1169 |
1165 | x 3:f27abbcc1f77 (draft) [ ] temporary amend commit for e008cf283490
1170 | x 3:f27abbcc1f77 (draft *obsolete*) [ ] temporary amend commit for e008cf283490
1166 | |
1171 | |
1167 | x 2:e008cf283490 (draft) [ ] 2
1172 | x 2:e008cf283490 (draft *obsolete*) [ ] 2
1168 |/
1173 |/
1169 o 1:e016b03fd86f (draft) [ ] 1
1174 o 1:e016b03fd86f (draft) [ ] 1
1170 |
1175 |
1171 o 0:a78f55e5508c (draft) [ ] 0
1176 o 0:a78f55e5508c (draft) [ ] 0
1172
1177
1173
1178
1174 $ hg strip -r 1 --config extensions.strip=
1179 $ hg strip -r 1 --config extensions.strip=
1175 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1180 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1176 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg (glob)
1181 saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg (glob)
1177 $ hg log -G
1182 $ hg log -G
1178 @ 0:a78f55e5508c (draft) [tip ] 0
1183 @ 0:a78f55e5508c (draft) [tip ] 0
1179
1184
1180 $ hg log -G --hidden
1185 $ hg log -G --hidden
1181 @ 0:a78f55e5508c (draft) [tip ] 0
1186 @ 0:a78f55e5508c (draft) [tip ] 0
1182
1187
1183
1188
1184 $ hg pull .hg/strip-backup/*
1189 $ hg pull .hg/strip-backup/*
1185 pulling from .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg
1190 pulling from .hg/strip-backup/e016b03fd86f-c41c6bcc-backup.hg
1186 searching for changes
1191 searching for changes
1187 adding changesets
1192 adding changesets
1188 adding manifests
1193 adding manifests
1189 adding file changes
1194 adding file changes
1190 added 2 changesets with 2 changes to 2 files
1195 added 2 changesets with 2 changes to 2 files
1191 (run 'hg update' to get a working copy)
1196 (run 'hg update' to get a working copy)
1192 $ hg log -G
1197 $ hg log -G
1193 o 2:b0551702f918 (draft) [tip ] 2
1198 o 2:b0551702f918 (draft) [tip ] 2
1194 |
1199 |
1195 o 1:e016b03fd86f (draft) [ ] 1
1200 o 1:e016b03fd86f (draft) [ ] 1
1196 |
1201 |
1197 @ 0:a78f55e5508c (draft) [ ] 0
1202 @ 0:a78f55e5508c (draft) [ ] 0
1198
1203
1199 $ hg log -G --hidden
1204 $ hg log -G --hidden
1200 o 2:b0551702f918 (draft) [tip ] 2
1205 o 2:b0551702f918 (draft) [tip ] 2
1201 |
1206 |
1202 o 1:e016b03fd86f (draft) [ ] 1
1207 o 1:e016b03fd86f (draft) [ ] 1
1203 |
1208 |
1204 @ 0:a78f55e5508c (draft) [ ] 0
1209 @ 0:a78f55e5508c (draft) [ ] 0
1205
1210
1206 Test that 'hg debugobsolete --index --rev' can show indices of obsmarkers when
1211 Test that 'hg debugobsolete --index --rev' can show indices of obsmarkers when
1207 only a subset of those are displayed (because of --rev option)
1212 only a subset of those are displayed (because of --rev option)
1208 $ hg init doindexrev
1213 $ hg init doindexrev
1209 $ cd doindexrev
1214 $ cd doindexrev
1210 $ echo a > a
1215 $ echo a > a
1211 $ hg ci -Am a
1216 $ hg ci -Am a
1212 adding a
1217 adding a
1213 $ hg ci --amend -m aa
1218 $ hg ci --amend -m aa
1214 $ echo b > b
1219 $ echo b > b
1215 $ hg ci -Am b
1220 $ hg ci -Am b
1216 adding b
1221 adding b
1217 $ hg ci --amend -m bb
1222 $ hg ci --amend -m bb
1218 $ echo c > c
1223 $ echo c > c
1219 $ hg ci -Am c
1224 $ hg ci -Am c
1220 adding c
1225 adding c
1221 $ hg ci --amend -m cc
1226 $ hg ci --amend -m cc
1222 $ echo d > d
1227 $ echo d > d
1223 $ hg ci -Am d
1228 $ hg ci -Am d
1224 adding d
1229 adding d
1225 $ hg ci --amend -m dd
1230 $ hg ci --amend -m dd
1226 $ hg debugobsolete --index --rev "3+7"
1231 $ hg debugobsolete --index --rev "3+7"
1227 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 \(.*\) {'user': 'test'} (re)
1232 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 \(.*\) {'user': 'test'} (re)
1228 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 \(.*\) {'user': 'test'} (re)
1233 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 \(.*\) {'user': 'test'} (re)
1229 $ hg debugobsolete --index --rev "3+7" -Tjson
1234 $ hg debugobsolete --index --rev "3+7" -Tjson
1230 [
1235 [
1231 {
1236 {
1232 "date": *, (glob)
1237 "date": *, (glob)
1233 "flag": 0,
1238 "flag": 0,
1234 "index": 1,
1239 "index": 1,
1235 "metadata": {"user": "test"},
1240 "metadata": {"user": "test"},
1236 "precnode": "6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1",
1241 "precnode": "6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1",
1237 "succnodes": ["d27fb9b066076fd921277a4b9e8b9cb48c95bc6a"]
1242 "succnodes": ["d27fb9b066076fd921277a4b9e8b9cb48c95bc6a"]
1238 },
1243 },
1239 {
1244 {
1240 "date": *, (glob)
1245 "date": *, (glob)
1241 "flag": 0,
1246 "flag": 0,
1242 "index": 3,
1247 "index": 3,
1243 "metadata": {"user": "test"},
1248 "metadata": {"user": "test"},
1244 "precnode": "4715cf767440ed891755448016c2b8cf70760c30",
1249 "precnode": "4715cf767440ed891755448016c2b8cf70760c30",
1245 "succnodes": ["7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d"]
1250 "succnodes": ["7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d"]
1246 }
1251 }
1247 ]
1252 ]
1248
1253
1249 Test the --delete option of debugobsolete command
1254 Test the --delete option of debugobsolete command
1250 $ hg debugobsolete --index
1255 $ hg debugobsolete --index
1251 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 \(.*\) {'user': 'test'} (re)
1256 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 \(.*\) {'user': 'test'} (re)
1252 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 \(.*\) {'user': 'test'} (re)
1257 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 \(.*\) {'user': 'test'} (re)
1253 2 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 \(.*\) {'user': 'test'} (re)
1258 2 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 \(.*\) {'user': 'test'} (re)
1254 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 \(.*\) {'user': 'test'} (re)
1259 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 \(.*\) {'user': 'test'} (re)
1255 $ hg debugobsolete --delete 1 --delete 3
1260 $ hg debugobsolete --delete 1 --delete 3
1256 deleted 2 obsolescence markers
1261 deleted 2 obsolescence markers
1257 $ hg debugobsolete
1262 $ hg debugobsolete
1258 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 \(.*\) {'user': 'test'} (re)
1263 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 \(.*\) {'user': 'test'} (re)
1259 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 \(.*\) {'user': 'test'} (re)
1264 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 \(.*\) {'user': 'test'} (re)
1260 $ cd ..
1265 $ cd ..
1261
1266
General Comments 0
You need to be logged in to leave comments. Login now