##// END OF EJS Templates
hgweb: ignore filtered revision in revnav...
Pierre-Yves David -
r18426:01638b51 default
parent child Browse files
Show More
@@ -1,402 +1,404 b''
1 # hgweb/webutil.py - utility library for the web interface.
1 # hgweb/webutil.py - utility library for the web interface.
2 #
2 #
3 # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
3 # Copyright 21 May 2005 - (c) 2005 Jake Edge <jake@edge2.net>
4 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 import os, copy
9 import os, copy
10 from mercurial import match, patch, scmutil, error, ui, util
10 from mercurial import match, patch, scmutil, error, ui, util
11 from mercurial.i18n import _
11 from mercurial.i18n import _
12 from mercurial.node import hex, nullid
12 from mercurial.node import hex, nullid
13 from common import ErrorResponse
13 from common import ErrorResponse
14 from common import HTTP_NOT_FOUND
14 from common import HTTP_NOT_FOUND
15 import difflib
15 import difflib
16
16
17 def up(p):
17 def up(p):
18 if p[0] != "/":
18 if p[0] != "/":
19 p = "/" + p
19 p = "/" + p
20 if p[-1] == "/":
20 if p[-1] == "/":
21 p = p[:-1]
21 p = p[:-1]
22 up = os.path.dirname(p)
22 up = os.path.dirname(p)
23 if up == "/":
23 if up == "/":
24 return "/"
24 return "/"
25 return up + "/"
25 return up + "/"
26
26
27 def _navseq(step, firststep=None):
27 def _navseq(step, firststep=None):
28 if firststep:
28 if firststep:
29 yield firststep
29 yield firststep
30 if firststep >= 20 and firststep <= 40:
30 if firststep >= 20 and firststep <= 40:
31 firststep = 50
31 firststep = 50
32 yield firststep
32 yield firststep
33 assert step > 0
33 assert step > 0
34 assert firststep > 0
34 assert firststep > 0
35 while step <= firststep:
35 while step <= firststep:
36 step *= 10
36 step *= 10
37 while True:
37 while True:
38 yield 1 * step
38 yield 1 * step
39 yield 3 * step
39 yield 3 * step
40 step *= 10
40 step *= 10
41
41
42 class revnav(object):
42 class revnav(object):
43
43
44 def __init__(self, repo):
44 def __init__(self, repo):
45 """Navigation generation object
45 """Navigation generation object
46
46
47 :repo: repo object we generate nav for
47 :repo: repo object we generate nav for
48 """
48 """
49 # used for hex generation
49 # used for hex generation
50 self._revlog = repo.changelog
50 self._revlog = repo.changelog
51
51
52 def __nonzero__(self):
52 def __nonzero__(self):
53 """return True if any revision to navigate over"""
53 """return True if any revision to navigate over"""
54 try:
54 try:
55 self._revlog.node(0)
55 self._revlog.node(0)
56 return True
56 return True
57 except error.RepoError:
57 except error.RepoError:
58 return False
58 return False
59
59
60 def hex(self, rev):
60 def hex(self, rev):
61 return hex(self._revlog.node(rev))
61 return hex(self._revlog.node(rev))
62
62
63 def gen(self, pos, pagelen, limit):
63 def gen(self, pos, pagelen, limit):
64 """computes label and revision id for navigation link
64 """computes label and revision id for navigation link
65
65
66 :pos: is the revision relative to which we generate navigation.
66 :pos: is the revision relative to which we generate navigation.
67 :pagelen: the size of each navigation page
67 :pagelen: the size of each navigation page
68 :limit: how far shall we link
68 :limit: how far shall we link
69
69
70 The return is:
70 The return is:
71 - a single element tuple
71 - a single element tuple
72 - containing a dictionary with a `before` and `after` key
72 - containing a dictionary with a `before` and `after` key
73 - values are generator functions taking arbitrary number of kwargs
73 - values are generator functions taking arbitrary number of kwargs
74 - yield items are dictionaries with `label` and `node` keys
74 - yield items are dictionaries with `label` and `node` keys
75 """
75 """
76 if not self:
76 if not self:
77 # empty repo
77 # empty repo
78 return ({'before': (), 'after': ()},)
78 return ({'before': (), 'after': ()},)
79
79
80 targets = []
80 targets = []
81 for f in _navseq(1, pagelen):
81 for f in _navseq(1, pagelen):
82 if f > limit:
82 if f > limit:
83 break
83 break
84 targets.append(pos + f)
84 targets.append(pos + f)
85 targets.append(pos - f)
85 targets.append(pos - f)
86 targets.sort()
86 targets.sort()
87
87
88 navbefore = [("(0)", self.hex(0))]
88 navbefore = [("(0)", self.hex(0))]
89 navafter = []
89 navafter = []
90 for rev in targets:
90 for rev in targets:
91 if rev not in self._revlog:
92 continue
91 if pos < rev < limit:
93 if pos < rev < limit:
92 navafter.append(("+%d" % f, self.hex(rev)))
94 navafter.append(("+%d" % f, self.hex(rev)))
93 if 0 < rev < pos:
95 if 0 < rev < pos:
94 navbefore.append(("-%d" % f, self.hex(rev)))
96 navbefore.append(("-%d" % f, self.hex(rev)))
95
97
96
98
97 navafter.append(("tip", "tip"))
99 navafter.append(("tip", "tip"))
98
100
99 data = lambda i: {"label": i[0], "node": i[1]}
101 data = lambda i: {"label": i[0], "node": i[1]}
100 return ({'before': lambda **map: (data(i) for i in navbefore),
102 return ({'before': lambda **map: (data(i) for i in navbefore),
101 'after': lambda **map: (data(i) for i in navafter)},)
103 'after': lambda **map: (data(i) for i in navafter)},)
102
104
103 class filerevnav(revnav):
105 class filerevnav(revnav):
104
106
105 def __init__(self, repo, path):
107 def __init__(self, repo, path):
106 """Navigation generation object
108 """Navigation generation object
107
109
108 :repo: repo object we generate nav for
110 :repo: repo object we generate nav for
109 :path: path of the file we generate nav for
111 :path: path of the file we generate nav for
110 """
112 """
111 # used for iteration
113 # used for iteration
112 self._changelog = repo.unfiltered().changelog
114 self._changelog = repo.unfiltered().changelog
113 # used for hex generation
115 # used for hex generation
114 self._revlog = repo.file(path)
116 self._revlog = repo.file(path)
115
117
116 def hex(self, rev):
118 def hex(self, rev):
117 return hex(self._changelog.node(self._revlog.linkrev(rev)))
119 return hex(self._changelog.node(self._revlog.linkrev(rev)))
118
120
119
121
120 def _siblings(siblings=[], hiderev=None):
122 def _siblings(siblings=[], hiderev=None):
121 siblings = [s for s in siblings if s.node() != nullid]
123 siblings = [s for s in siblings if s.node() != nullid]
122 if len(siblings) == 1 and siblings[0].rev() == hiderev:
124 if len(siblings) == 1 and siblings[0].rev() == hiderev:
123 return
125 return
124 for s in siblings:
126 for s in siblings:
125 d = {'node': s.hex(), 'rev': s.rev()}
127 d = {'node': s.hex(), 'rev': s.rev()}
126 d['user'] = s.user()
128 d['user'] = s.user()
127 d['date'] = s.date()
129 d['date'] = s.date()
128 d['description'] = s.description()
130 d['description'] = s.description()
129 d['branch'] = s.branch()
131 d['branch'] = s.branch()
130 if util.safehasattr(s, 'path'):
132 if util.safehasattr(s, 'path'):
131 d['file'] = s.path()
133 d['file'] = s.path()
132 yield d
134 yield d
133
135
134 def parents(ctx, hide=None):
136 def parents(ctx, hide=None):
135 return _siblings(ctx.parents(), hide)
137 return _siblings(ctx.parents(), hide)
136
138
137 def children(ctx, hide=None):
139 def children(ctx, hide=None):
138 return _siblings(ctx.children(), hide)
140 return _siblings(ctx.children(), hide)
139
141
140 def renamelink(fctx):
142 def renamelink(fctx):
141 r = fctx.renamed()
143 r = fctx.renamed()
142 if r:
144 if r:
143 return [dict(file=r[0], node=hex(r[1]))]
145 return [dict(file=r[0], node=hex(r[1]))]
144 return []
146 return []
145
147
146 def nodetagsdict(repo, node):
148 def nodetagsdict(repo, node):
147 return [{"name": i} for i in repo.nodetags(node)]
149 return [{"name": i} for i in repo.nodetags(node)]
148
150
149 def nodebookmarksdict(repo, node):
151 def nodebookmarksdict(repo, node):
150 return [{"name": i} for i in repo.nodebookmarks(node)]
152 return [{"name": i} for i in repo.nodebookmarks(node)]
151
153
152 def nodebranchdict(repo, ctx):
154 def nodebranchdict(repo, ctx):
153 branches = []
155 branches = []
154 branch = ctx.branch()
156 branch = ctx.branch()
155 # If this is an empty repo, ctx.node() == nullid,
157 # If this is an empty repo, ctx.node() == nullid,
156 # ctx.branch() == 'default'.
158 # ctx.branch() == 'default'.
157 try:
159 try:
158 branchnode = repo.branchtip(branch)
160 branchnode = repo.branchtip(branch)
159 except error.RepoLookupError:
161 except error.RepoLookupError:
160 branchnode = None
162 branchnode = None
161 if branchnode == ctx.node():
163 if branchnode == ctx.node():
162 branches.append({"name": branch})
164 branches.append({"name": branch})
163 return branches
165 return branches
164
166
165 def nodeinbranch(repo, ctx):
167 def nodeinbranch(repo, ctx):
166 branches = []
168 branches = []
167 branch = ctx.branch()
169 branch = ctx.branch()
168 try:
170 try:
169 branchnode = repo.branchtip(branch)
171 branchnode = repo.branchtip(branch)
170 except error.RepoLookupError:
172 except error.RepoLookupError:
171 branchnode = None
173 branchnode = None
172 if branch != 'default' and branchnode != ctx.node():
174 if branch != 'default' and branchnode != ctx.node():
173 branches.append({"name": branch})
175 branches.append({"name": branch})
174 return branches
176 return branches
175
177
176 def nodebranchnodefault(ctx):
178 def nodebranchnodefault(ctx):
177 branches = []
179 branches = []
178 branch = ctx.branch()
180 branch = ctx.branch()
179 if branch != 'default':
181 if branch != 'default':
180 branches.append({"name": branch})
182 branches.append({"name": branch})
181 return branches
183 return branches
182
184
183 def showtag(repo, tmpl, t1, node=nullid, **args):
185 def showtag(repo, tmpl, t1, node=nullid, **args):
184 for t in repo.nodetags(node):
186 for t in repo.nodetags(node):
185 yield tmpl(t1, tag=t, **args)
187 yield tmpl(t1, tag=t, **args)
186
188
187 def showbookmark(repo, tmpl, t1, node=nullid, **args):
189 def showbookmark(repo, tmpl, t1, node=nullid, **args):
188 for t in repo.nodebookmarks(node):
190 for t in repo.nodebookmarks(node):
189 yield tmpl(t1, bookmark=t, **args)
191 yield tmpl(t1, bookmark=t, **args)
190
192
191 def cleanpath(repo, path):
193 def cleanpath(repo, path):
192 path = path.lstrip('/')
194 path = path.lstrip('/')
193 return scmutil.canonpath(repo.root, '', path)
195 return scmutil.canonpath(repo.root, '', path)
194
196
195 def changeidctx (repo, changeid):
197 def changeidctx (repo, changeid):
196 try:
198 try:
197 ctx = repo[changeid]
199 ctx = repo[changeid]
198 except error.RepoError:
200 except error.RepoError:
199 man = repo.manifest
201 man = repo.manifest
200 ctx = repo[man.linkrev(man.rev(man.lookup(changeid)))]
202 ctx = repo[man.linkrev(man.rev(man.lookup(changeid)))]
201
203
202 return ctx
204 return ctx
203
205
204 def changectx (repo, req):
206 def changectx (repo, req):
205 changeid = "tip"
207 changeid = "tip"
206 if 'node' in req.form:
208 if 'node' in req.form:
207 changeid = req.form['node'][0]
209 changeid = req.form['node'][0]
208 ipos=changeid.find(':')
210 ipos=changeid.find(':')
209 if ipos != -1:
211 if ipos != -1:
210 changeid = changeid[(ipos + 1):]
212 changeid = changeid[(ipos + 1):]
211 elif 'manifest' in req.form:
213 elif 'manifest' in req.form:
212 changeid = req.form['manifest'][0]
214 changeid = req.form['manifest'][0]
213
215
214 return changeidctx(repo, changeid)
216 return changeidctx(repo, changeid)
215
217
216 def basechangectx(repo, req):
218 def basechangectx(repo, req):
217 if 'node' in req.form:
219 if 'node' in req.form:
218 changeid = req.form['node'][0]
220 changeid = req.form['node'][0]
219 ipos=changeid.find(':')
221 ipos=changeid.find(':')
220 if ipos != -1:
222 if ipos != -1:
221 changeid = changeid[:ipos]
223 changeid = changeid[:ipos]
222 return changeidctx(repo, changeid)
224 return changeidctx(repo, changeid)
223
225
224 return None
226 return None
225
227
226 def filectx(repo, req):
228 def filectx(repo, req):
227 if 'file' not in req.form:
229 if 'file' not in req.form:
228 raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
230 raise ErrorResponse(HTTP_NOT_FOUND, 'file not given')
229 path = cleanpath(repo, req.form['file'][0])
231 path = cleanpath(repo, req.form['file'][0])
230 if 'node' in req.form:
232 if 'node' in req.form:
231 changeid = req.form['node'][0]
233 changeid = req.form['node'][0]
232 elif 'filenode' in req.form:
234 elif 'filenode' in req.form:
233 changeid = req.form['filenode'][0]
235 changeid = req.form['filenode'][0]
234 else:
236 else:
235 raise ErrorResponse(HTTP_NOT_FOUND, 'node or filenode not given')
237 raise ErrorResponse(HTTP_NOT_FOUND, 'node or filenode not given')
236 try:
238 try:
237 fctx = repo[changeid][path]
239 fctx = repo[changeid][path]
238 except error.RepoError:
240 except error.RepoError:
239 fctx = repo.filectx(path, fileid=changeid)
241 fctx = repo.filectx(path, fileid=changeid)
240
242
241 return fctx
243 return fctx
242
244
243 def listfilediffs(tmpl, files, node, max):
245 def listfilediffs(tmpl, files, node, max):
244 for f in files[:max]:
246 for f in files[:max]:
245 yield tmpl('filedifflink', node=hex(node), file=f)
247 yield tmpl('filedifflink', node=hex(node), file=f)
246 if len(files) > max:
248 if len(files) > max:
247 yield tmpl('fileellipses')
249 yield tmpl('fileellipses')
248
250
249 def diffs(repo, tmpl, ctx, basectx, files, parity, style):
251 def diffs(repo, tmpl, ctx, basectx, files, parity, style):
250
252
251 def countgen():
253 def countgen():
252 start = 1
254 start = 1
253 while True:
255 while True:
254 yield start
256 yield start
255 start += 1
257 start += 1
256
258
257 blockcount = countgen()
259 blockcount = countgen()
258 def prettyprintlines(diff, blockno):
260 def prettyprintlines(diff, blockno):
259 for lineno, l in enumerate(diff.splitlines(True)):
261 for lineno, l in enumerate(diff.splitlines(True)):
260 lineno = "%d.%d" % (blockno, lineno + 1)
262 lineno = "%d.%d" % (blockno, lineno + 1)
261 if l.startswith('+'):
263 if l.startswith('+'):
262 ltype = "difflineplus"
264 ltype = "difflineplus"
263 elif l.startswith('-'):
265 elif l.startswith('-'):
264 ltype = "difflineminus"
266 ltype = "difflineminus"
265 elif l.startswith('@'):
267 elif l.startswith('@'):
266 ltype = "difflineat"
268 ltype = "difflineat"
267 else:
269 else:
268 ltype = "diffline"
270 ltype = "diffline"
269 yield tmpl(ltype,
271 yield tmpl(ltype,
270 line=l,
272 line=l,
271 lineid="l%s" % lineno,
273 lineid="l%s" % lineno,
272 linenumber="% 8s" % lineno)
274 linenumber="% 8s" % lineno)
273
275
274 if files:
276 if files:
275 m = match.exact(repo.root, repo.getcwd(), files)
277 m = match.exact(repo.root, repo.getcwd(), files)
276 else:
278 else:
277 m = match.always(repo.root, repo.getcwd())
279 m = match.always(repo.root, repo.getcwd())
278
280
279 diffopts = patch.diffopts(repo.ui, untrusted=True)
281 diffopts = patch.diffopts(repo.ui, untrusted=True)
280 if basectx is None:
282 if basectx is None:
281 parents = ctx.parents()
283 parents = ctx.parents()
282 node1 = parents and parents[0].node() or nullid
284 node1 = parents and parents[0].node() or nullid
283 else:
285 else:
284 node1 = basectx.node()
286 node1 = basectx.node()
285 node2 = ctx.node()
287 node2 = ctx.node()
286
288
287 block = []
289 block = []
288 for chunk in patch.diff(repo, node1, node2, m, opts=diffopts):
290 for chunk in patch.diff(repo, node1, node2, m, opts=diffopts):
289 if chunk.startswith('diff') and block:
291 if chunk.startswith('diff') and block:
290 blockno = blockcount.next()
292 blockno = blockcount.next()
291 yield tmpl('diffblock', parity=parity.next(), blockno=blockno,
293 yield tmpl('diffblock', parity=parity.next(), blockno=blockno,
292 lines=prettyprintlines(''.join(block), blockno))
294 lines=prettyprintlines(''.join(block), blockno))
293 block = []
295 block = []
294 if chunk.startswith('diff') and style != 'raw':
296 if chunk.startswith('diff') and style != 'raw':
295 chunk = ''.join(chunk.splitlines(True)[1:])
297 chunk = ''.join(chunk.splitlines(True)[1:])
296 block.append(chunk)
298 block.append(chunk)
297 blockno = blockcount.next()
299 blockno = blockcount.next()
298 yield tmpl('diffblock', parity=parity.next(), blockno=blockno,
300 yield tmpl('diffblock', parity=parity.next(), blockno=blockno,
299 lines=prettyprintlines(''.join(block), blockno))
301 lines=prettyprintlines(''.join(block), blockno))
300
302
301 def compare(tmpl, context, leftlines, rightlines):
303 def compare(tmpl, context, leftlines, rightlines):
302 '''Generator function that provides side-by-side comparison data.'''
304 '''Generator function that provides side-by-side comparison data.'''
303
305
304 def compline(type, leftlineno, leftline, rightlineno, rightline):
306 def compline(type, leftlineno, leftline, rightlineno, rightline):
305 lineid = leftlineno and ("l%s" % leftlineno) or ''
307 lineid = leftlineno and ("l%s" % leftlineno) or ''
306 lineid += rightlineno and ("r%s" % rightlineno) or ''
308 lineid += rightlineno and ("r%s" % rightlineno) or ''
307 return tmpl('comparisonline',
309 return tmpl('comparisonline',
308 type=type,
310 type=type,
309 lineid=lineid,
311 lineid=lineid,
310 leftlinenumber="% 6s" % (leftlineno or ''),
312 leftlinenumber="% 6s" % (leftlineno or ''),
311 leftline=leftline or '',
313 leftline=leftline or '',
312 rightlinenumber="% 6s" % (rightlineno or ''),
314 rightlinenumber="% 6s" % (rightlineno or ''),
313 rightline=rightline or '')
315 rightline=rightline or '')
314
316
315 def getblock(opcodes):
317 def getblock(opcodes):
316 for type, llo, lhi, rlo, rhi in opcodes:
318 for type, llo, lhi, rlo, rhi in opcodes:
317 len1 = lhi - llo
319 len1 = lhi - llo
318 len2 = rhi - rlo
320 len2 = rhi - rlo
319 count = min(len1, len2)
321 count = min(len1, len2)
320 for i in xrange(count):
322 for i in xrange(count):
321 yield compline(type=type,
323 yield compline(type=type,
322 leftlineno=llo + i + 1,
324 leftlineno=llo + i + 1,
323 leftline=leftlines[llo + i],
325 leftline=leftlines[llo + i],
324 rightlineno=rlo + i + 1,
326 rightlineno=rlo + i + 1,
325 rightline=rightlines[rlo + i])
327 rightline=rightlines[rlo + i])
326 if len1 > len2:
328 if len1 > len2:
327 for i in xrange(llo + count, lhi):
329 for i in xrange(llo + count, lhi):
328 yield compline(type=type,
330 yield compline(type=type,
329 leftlineno=i + 1,
331 leftlineno=i + 1,
330 leftline=leftlines[i],
332 leftline=leftlines[i],
331 rightlineno=None,
333 rightlineno=None,
332 rightline=None)
334 rightline=None)
333 elif len2 > len1:
335 elif len2 > len1:
334 for i in xrange(rlo + count, rhi):
336 for i in xrange(rlo + count, rhi):
335 yield compline(type=type,
337 yield compline(type=type,
336 leftlineno=None,
338 leftlineno=None,
337 leftline=None,
339 leftline=None,
338 rightlineno=i + 1,
340 rightlineno=i + 1,
339 rightline=rightlines[i])
341 rightline=rightlines[i])
340
342
341 s = difflib.SequenceMatcher(None, leftlines, rightlines)
343 s = difflib.SequenceMatcher(None, leftlines, rightlines)
342 if context < 0:
344 if context < 0:
343 yield tmpl('comparisonblock', lines=getblock(s.get_opcodes()))
345 yield tmpl('comparisonblock', lines=getblock(s.get_opcodes()))
344 else:
346 else:
345 for oc in s.get_grouped_opcodes(n=context):
347 for oc in s.get_grouped_opcodes(n=context):
346 yield tmpl('comparisonblock', lines=getblock(oc))
348 yield tmpl('comparisonblock', lines=getblock(oc))
347
349
348 def diffstatgen(ctx, basectx):
350 def diffstatgen(ctx, basectx):
349 '''Generator function that provides the diffstat data.'''
351 '''Generator function that provides the diffstat data.'''
350
352
351 stats = patch.diffstatdata(util.iterlines(ctx.diff(basectx)))
353 stats = patch.diffstatdata(util.iterlines(ctx.diff(basectx)))
352 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats)
354 maxname, maxtotal, addtotal, removetotal, binary = patch.diffstatsum(stats)
353 while True:
355 while True:
354 yield stats, maxname, maxtotal, addtotal, removetotal, binary
356 yield stats, maxname, maxtotal, addtotal, removetotal, binary
355
357
356 def diffsummary(statgen):
358 def diffsummary(statgen):
357 '''Return a short summary of the diff.'''
359 '''Return a short summary of the diff.'''
358
360
359 stats, maxname, maxtotal, addtotal, removetotal, binary = statgen.next()
361 stats, maxname, maxtotal, addtotal, removetotal, binary = statgen.next()
360 return _(' %d files changed, %d insertions(+), %d deletions(-)\n') % (
362 return _(' %d files changed, %d insertions(+), %d deletions(-)\n') % (
361 len(stats), addtotal, removetotal)
363 len(stats), addtotal, removetotal)
362
364
363 def diffstat(tmpl, ctx, statgen, parity):
365 def diffstat(tmpl, ctx, statgen, parity):
364 '''Return a diffstat template for each file in the diff.'''
366 '''Return a diffstat template for each file in the diff.'''
365
367
366 stats, maxname, maxtotal, addtotal, removetotal, binary = statgen.next()
368 stats, maxname, maxtotal, addtotal, removetotal, binary = statgen.next()
367 files = ctx.files()
369 files = ctx.files()
368
370
369 def pct(i):
371 def pct(i):
370 if maxtotal == 0:
372 if maxtotal == 0:
371 return 0
373 return 0
372 return (float(i) / maxtotal) * 100
374 return (float(i) / maxtotal) * 100
373
375
374 fileno = 0
376 fileno = 0
375 for filename, adds, removes, isbinary in stats:
377 for filename, adds, removes, isbinary in stats:
376 template = filename in files and 'diffstatlink' or 'diffstatnolink'
378 template = filename in files and 'diffstatlink' or 'diffstatnolink'
377 total = adds + removes
379 total = adds + removes
378 fileno += 1
380 fileno += 1
379 yield tmpl(template, node=ctx.hex(), file=filename, fileno=fileno,
381 yield tmpl(template, node=ctx.hex(), file=filename, fileno=fileno,
380 total=total, addpct=pct(adds), removepct=pct(removes),
382 total=total, addpct=pct(adds), removepct=pct(removes),
381 parity=parity.next())
383 parity=parity.next())
382
384
383 class sessionvars(object):
385 class sessionvars(object):
384 def __init__(self, vars, start='?'):
386 def __init__(self, vars, start='?'):
385 self.start = start
387 self.start = start
386 self.vars = vars
388 self.vars = vars
387 def __getitem__(self, key):
389 def __getitem__(self, key):
388 return self.vars[key]
390 return self.vars[key]
389 def __setitem__(self, key, value):
391 def __setitem__(self, key, value):
390 self.vars[key] = value
392 self.vars[key] = value
391 def __copy__(self):
393 def __copy__(self):
392 return sessionvars(copy.copy(self.vars), self.start)
394 return sessionvars(copy.copy(self.vars), self.start)
393 def __iter__(self):
395 def __iter__(self):
394 separator = self.start
396 separator = self.start
395 for key, value in sorted(self.vars.iteritems()):
397 for key, value in sorted(self.vars.iteritems()):
396 yield {'name': key, 'value': str(value), 'separator': separator}
398 yield {'name': key, 'value': str(value), 'separator': separator}
397 separator = '&'
399 separator = '&'
398
400
399 class wsgiui(ui.ui):
401 class wsgiui(ui.ui):
400 # default termwidth breaks under mod_wsgi
402 # default termwidth breaks under mod_wsgi
401 def termwidth(self):
403 def termwidth(self):
402 return 80
404 return 80
@@ -1,711 +1,710 b''
1 $ cat >> $HGRCPATH << EOF
1 $ cat >> $HGRCPATH << EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 > [phases]
4 > [phases]
5 > # public changeset are not obsolete
5 > # public changeset are not obsolete
6 > publish=false
6 > publish=false
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 id --debug --hidden -ir "desc('$1')"
14 > hg id --debug --hidden -ir "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: obsolete feature is not enabled on this repo
35 abort: obsolete feature is not enabled on this repo
36 [255]
36 [255]
37
37
38 Enabling it
38 Enabling it
39
39
40 $ cat > ../obs.py << EOF
40 $ cat > ../obs.py << EOF
41 > import mercurial.obsolete
41 > import mercurial.obsolete
42 > mercurial.obsolete._enabled = True
42 > mercurial.obsolete._enabled = True
43 > EOF
43 > EOF
44 $ echo '[extensions]' >> $HGRCPATH
44 $ echo '[extensions]' >> $HGRCPATH
45 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
45 $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH
46
46
47 Killing a single changeset without replacement
47 Killing a single changeset without replacement
48
48
49 $ hg debugobsolete 0
49 $ hg debugobsolete 0
50 abort: changeset references must be full hexadecimal node identifiers
50 abort: changeset references must be full hexadecimal node identifiers
51 [255]
51 [255]
52 $ hg debugobsolete '00'
52 $ hg debugobsolete '00'
53 abort: changeset references must be full hexadecimal node identifiers
53 abort: changeset references must be full hexadecimal node identifiers
54 [255]
54 [255]
55 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
55 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
56 $ hg debugobsolete
56 $ hg debugobsolete
57 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
57 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 {'date': '0 0', 'user': 'babar'}
58 $ cd ..
58 $ cd ..
59
59
60 Killing a single changeset with replacement
60 Killing a single changeset with replacement
61
61
62 $ hg init tmpb
62 $ hg init tmpb
63 $ cd tmpb
63 $ cd tmpb
64 $ mkcommit a
64 $ mkcommit a
65 $ mkcommit b
65 $ mkcommit b
66 $ mkcommit original_c
66 $ mkcommit original_c
67 $ hg up "desc('b')"
67 $ hg up "desc('b')"
68 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
68 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
69 $ mkcommit new_c
69 $ mkcommit new_c
70 created new head
70 created new head
71 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
71 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
72 $ hg debugobsolete --flag 12 `getid original_c` `getid new_c` -d '56 12'
72 $ hg debugobsolete --flag 12 `getid original_c` `getid new_c` -d '56 12'
73 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
73 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
74 2:245bde4270cd add original_c
74 2:245bde4270cd add original_c
75 $ hg debugobsolete
75 $ hg debugobsolete
76 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
76 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
77
77
78 do it again (it read the obsstore before adding new changeset)
78 do it again (it read the obsstore before adding new changeset)
79
79
80 $ hg up '.^'
80 $ hg up '.^'
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
81 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
82 $ mkcommit new_2_c
82 $ mkcommit new_2_c
83 created new head
83 created new head
84 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
84 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
85 $ hg debugobsolete
85 $ hg debugobsolete
86 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
86 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
87 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
87 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
88
88
89 Register two markers with a missing node
89 Register two markers with a missing node
90
90
91 $ hg up '.^'
91 $ hg up '.^'
92 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
92 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
93 $ mkcommit new_3_c
93 $ mkcommit new_3_c
94 created new head
94 created new head
95 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
95 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
96 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
96 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
97 $ hg debugobsolete
97 $ hg debugobsolete
98 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
98 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
99 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
99 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
100 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
100 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
101 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
101 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
102
102
103 Refuse pathological nullid successors
103 Refuse pathological nullid successors
104 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
104 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
105 transaction abort!
105 transaction abort!
106 rollback completed
106 rollback completed
107 abort: bad obsolescence marker detected: invalid successors nullid
107 abort: bad obsolescence marker detected: invalid successors nullid
108 [255]
108 [255]
109
109
110 Check that graphlog detect that a changeset is obsolete:
110 Check that graphlog detect that a changeset is obsolete:
111
111
112 $ hg glog
112 $ hg glog
113 @ changeset: 5:5601fb93a350
113 @ changeset: 5:5601fb93a350
114 | tag: tip
114 | tag: tip
115 | parent: 1:7c3bad9141dc
115 | parent: 1:7c3bad9141dc
116 | user: test
116 | user: test
117 | date: Thu Jan 01 00:00:00 1970 +0000
117 | date: Thu Jan 01 00:00:00 1970 +0000
118 | summary: add new_3_c
118 | summary: add new_3_c
119 |
119 |
120 o changeset: 1:7c3bad9141dc
120 o changeset: 1:7c3bad9141dc
121 | user: test
121 | user: test
122 | date: Thu Jan 01 00:00:00 1970 +0000
122 | date: Thu Jan 01 00:00:00 1970 +0000
123 | summary: add b
123 | summary: add b
124 |
124 |
125 o changeset: 0:1f0dee641bb7
125 o changeset: 0:1f0dee641bb7
126 user: test
126 user: test
127 date: Thu Jan 01 00:00:00 1970 +0000
127 date: Thu Jan 01 00:00:00 1970 +0000
128 summary: add a
128 summary: add a
129
129
130
130
131 check that heads does not report them
131 check that heads does not report them
132
132
133 $ hg heads
133 $ hg heads
134 changeset: 5:5601fb93a350
134 changeset: 5:5601fb93a350
135 tag: tip
135 tag: tip
136 parent: 1:7c3bad9141dc
136 parent: 1:7c3bad9141dc
137 user: test
137 user: test
138 date: Thu Jan 01 00:00:00 1970 +0000
138 date: Thu Jan 01 00:00:00 1970 +0000
139 summary: add new_3_c
139 summary: add new_3_c
140
140
141 $ hg heads --hidden
141 $ hg heads --hidden
142 changeset: 5:5601fb93a350
142 changeset: 5:5601fb93a350
143 tag: tip
143 tag: tip
144 parent: 1:7c3bad9141dc
144 parent: 1:7c3bad9141dc
145 user: test
145 user: test
146 date: Thu Jan 01 00:00:00 1970 +0000
146 date: Thu Jan 01 00:00:00 1970 +0000
147 summary: add new_3_c
147 summary: add new_3_c
148
148
149 changeset: 4:ca819180edb9
149 changeset: 4:ca819180edb9
150 parent: 1:7c3bad9141dc
150 parent: 1:7c3bad9141dc
151 user: test
151 user: test
152 date: Thu Jan 01 00:00:00 1970 +0000
152 date: Thu Jan 01 00:00:00 1970 +0000
153 summary: add new_2_c
153 summary: add new_2_c
154
154
155 changeset: 3:cdbce2fbb163
155 changeset: 3:cdbce2fbb163
156 parent: 1:7c3bad9141dc
156 parent: 1:7c3bad9141dc
157 user: test
157 user: test
158 date: Thu Jan 01 00:00:00 1970 +0000
158 date: Thu Jan 01 00:00:00 1970 +0000
159 summary: add new_c
159 summary: add new_c
160
160
161 changeset: 2:245bde4270cd
161 changeset: 2:245bde4270cd
162 user: test
162 user: test
163 date: Thu Jan 01 00:00:00 1970 +0000
163 date: Thu Jan 01 00:00:00 1970 +0000
164 summary: add original_c
164 summary: add original_c
165
165
166
166
167
167
168 check that summary does not report them
168 check that summary does not report them
169
169
170 $ hg init ../sink
170 $ hg init ../sink
171 $ echo '[paths]' >> .hg/hgrc
171 $ echo '[paths]' >> .hg/hgrc
172 $ echo 'default=../sink' >> .hg/hgrc
172 $ echo 'default=../sink' >> .hg/hgrc
173 $ hg summary --remote
173 $ hg summary --remote
174 parent: 5:5601fb93a350 tip
174 parent: 5:5601fb93a350 tip
175 add new_3_c
175 add new_3_c
176 branch: default
176 branch: default
177 commit: (clean)
177 commit: (clean)
178 update: (current)
178 update: (current)
179 remote: 3 outgoing
179 remote: 3 outgoing
180
180
181 $ hg summary --remote --hidden
181 $ hg summary --remote --hidden
182 parent: 5:5601fb93a350 tip
182 parent: 5:5601fb93a350 tip
183 add new_3_c
183 add new_3_c
184 branch: default
184 branch: default
185 commit: (clean)
185 commit: (clean)
186 update: 3 new changesets, 4 branch heads (merge)
186 update: 3 new changesets, 4 branch heads (merge)
187 remote: 3 outgoing
187 remote: 3 outgoing
188
188
189 check that various commands work well with filtering
189 check that various commands work well with filtering
190
190
191 $ hg tip
191 $ hg tip
192 changeset: 5:5601fb93a350
192 changeset: 5:5601fb93a350
193 tag: tip
193 tag: tip
194 parent: 1:7c3bad9141dc
194 parent: 1:7c3bad9141dc
195 user: test
195 user: test
196 date: Thu Jan 01 00:00:00 1970 +0000
196 date: Thu Jan 01 00:00:00 1970 +0000
197 summary: add new_3_c
197 summary: add new_3_c
198
198
199 $ hg log -r 6
199 $ hg log -r 6
200 abort: unknown revision '6'!
200 abort: unknown revision '6'!
201 [255]
201 [255]
202 $ hg log -r 4
202 $ hg log -r 4
203 abort: unknown revision '4'!
203 abort: unknown revision '4'!
204 [255]
204 [255]
205
205
206 Check that public changeset are not accounted as obsolete:
206 Check that public changeset are not accounted as obsolete:
207
207
208 $ hg --hidden phase --public 2
208 $ hg --hidden phase --public 2
209 $ hg --config 'extensions.graphlog=' glog
209 $ hg --config 'extensions.graphlog=' glog
210 @ changeset: 5:5601fb93a350
210 @ changeset: 5:5601fb93a350
211 | tag: tip
211 | tag: tip
212 | parent: 1:7c3bad9141dc
212 | parent: 1:7c3bad9141dc
213 | user: test
213 | user: test
214 | date: Thu Jan 01 00:00:00 1970 +0000
214 | date: Thu Jan 01 00:00:00 1970 +0000
215 | summary: add new_3_c
215 | summary: add new_3_c
216 |
216 |
217 | o changeset: 2:245bde4270cd
217 | o changeset: 2:245bde4270cd
218 |/ user: test
218 |/ user: test
219 | date: Thu Jan 01 00:00:00 1970 +0000
219 | date: Thu Jan 01 00:00:00 1970 +0000
220 | summary: add original_c
220 | summary: add original_c
221 |
221 |
222 o changeset: 1:7c3bad9141dc
222 o changeset: 1:7c3bad9141dc
223 | user: test
223 | user: test
224 | date: Thu Jan 01 00:00:00 1970 +0000
224 | date: Thu Jan 01 00:00:00 1970 +0000
225 | summary: add b
225 | summary: add b
226 |
226 |
227 o changeset: 0:1f0dee641bb7
227 o changeset: 0:1f0dee641bb7
228 user: test
228 user: test
229 date: Thu Jan 01 00:00:00 1970 +0000
229 date: Thu Jan 01 00:00:00 1970 +0000
230 summary: add a
230 summary: add a
231
231
232
232
233 And that bumped changeset are detected
233 And that bumped changeset are detected
234 --------------------------------------
234 --------------------------------------
235
235
236 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
236 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
237 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
237 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
238 the public changeset
238 the public changeset
239
239
240 $ hg log --hidden -r 'bumped()'
240 $ hg log --hidden -r 'bumped()'
241 changeset: 5:5601fb93a350
241 changeset: 5:5601fb93a350
242 tag: tip
242 tag: tip
243 parent: 1:7c3bad9141dc
243 parent: 1:7c3bad9141dc
244 user: test
244 user: test
245 date: Thu Jan 01 00:00:00 1970 +0000
245 date: Thu Jan 01 00:00:00 1970 +0000
246 summary: add new_3_c
246 summary: add new_3_c
247
247
248
248
249 And that we can't push bumped changeset
249 And that we can't push bumped changeset
250
250
251 $ hg push ../tmpa -r 0 --force #(make repo related)
251 $ hg push ../tmpa -r 0 --force #(make repo related)
252 pushing to ../tmpa
252 pushing to ../tmpa
253 searching for changes
253 searching for changes
254 warning: repository is unrelated
254 warning: repository is unrelated
255 adding changesets
255 adding changesets
256 adding manifests
256 adding manifests
257 adding file changes
257 adding file changes
258 added 1 changesets with 1 changes to 1 files (+1 heads)
258 added 1 changesets with 1 changes to 1 files (+1 heads)
259 $ hg push ../tmpa
259 $ hg push ../tmpa
260 pushing to ../tmpa
260 pushing to ../tmpa
261 searching for changes
261 searching for changes
262 abort: push includes bumped changeset: 5601fb93a350!
262 abort: push includes bumped changeset: 5601fb93a350!
263 [255]
263 [255]
264
264
265 Fixing "bumped" situation
265 Fixing "bumped" situation
266 We need to create a clone of 5 and add a special marker with a flag
266 We need to create a clone of 5 and add a special marker with a flag
267
267
268 $ hg up '5^'
268 $ hg up '5^'
269 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
269 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
270 $ hg revert -ar 5
270 $ hg revert -ar 5
271 adding new_3_c
271 adding new_3_c
272 $ hg ci -m 'add n3w_3_c'
272 $ hg ci -m 'add n3w_3_c'
273 created new head
273 created new head
274 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
274 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
275 $ hg log -r 'bumped()'
275 $ hg log -r 'bumped()'
276 $ hg log -G
276 $ hg log -G
277 @ changeset: 6:6f9641995072
277 @ changeset: 6:6f9641995072
278 | tag: tip
278 | tag: tip
279 | parent: 1:7c3bad9141dc
279 | parent: 1:7c3bad9141dc
280 | user: test
280 | user: test
281 | date: Thu Jan 01 00:00:00 1970 +0000
281 | date: Thu Jan 01 00:00:00 1970 +0000
282 | summary: add n3w_3_c
282 | summary: add n3w_3_c
283 |
283 |
284 | o changeset: 2:245bde4270cd
284 | o changeset: 2:245bde4270cd
285 |/ user: test
285 |/ user: test
286 | date: Thu Jan 01 00:00:00 1970 +0000
286 | date: Thu Jan 01 00:00:00 1970 +0000
287 | summary: add original_c
287 | summary: add original_c
288 |
288 |
289 o changeset: 1:7c3bad9141dc
289 o changeset: 1:7c3bad9141dc
290 | user: test
290 | user: test
291 | date: Thu Jan 01 00:00:00 1970 +0000
291 | date: Thu Jan 01 00:00:00 1970 +0000
292 | summary: add b
292 | summary: add b
293 |
293 |
294 o changeset: 0:1f0dee641bb7
294 o changeset: 0:1f0dee641bb7
295 user: test
295 user: test
296 date: Thu Jan 01 00:00:00 1970 +0000
296 date: Thu Jan 01 00:00:00 1970 +0000
297 summary: add a
297 summary: add a
298
298
299
299
300
300
301
301
302 $ cd ..
302 $ cd ..
303
303
304 Exchange Test
304 Exchange Test
305 ============================
305 ============================
306
306
307 Destination repo does not have any data
307 Destination repo does not have any data
308 ---------------------------------------
308 ---------------------------------------
309
309
310 Try to pull markers
310 Try to pull markers
311 (extinct changeset are excluded but marker are pushed)
311 (extinct changeset are excluded but marker are pushed)
312
312
313 $ hg init tmpc
313 $ hg init tmpc
314 $ cd tmpc
314 $ cd tmpc
315 $ hg pull ../tmpb
315 $ hg pull ../tmpb
316 pulling from ../tmpb
316 pulling from ../tmpb
317 requesting all changes
317 requesting all changes
318 adding changesets
318 adding changesets
319 adding manifests
319 adding manifests
320 adding file changes
320 adding file changes
321 added 4 changesets with 4 changes to 4 files (+1 heads)
321 added 4 changesets with 4 changes to 4 files (+1 heads)
322 (run 'hg heads' to see heads, 'hg merge' to merge)
322 (run 'hg heads' to see heads, 'hg merge' to merge)
323 $ hg debugobsolete
323 $ hg debugobsolete
324 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
324 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
325 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
325 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
326 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
326 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
327 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
327 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
328 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
328 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
329
329
330 Rollback//Transaction support
330 Rollback//Transaction support
331
331
332 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
332 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
333 $ hg debugobsolete
333 $ hg debugobsolete
334 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
334 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
335 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
335 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
336 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
336 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
337 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
337 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
338 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
338 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
339 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 {'date': '1340 0', 'user': 'test'}
339 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 {'date': '1340 0', 'user': 'test'}
340 $ hg rollback -n
340 $ hg rollback -n
341 repository tip rolled back to revision 3 (undo debugobsolete)
341 repository tip rolled back to revision 3 (undo debugobsolete)
342 $ hg rollback
342 $ hg rollback
343 repository tip rolled back to revision 3 (undo debugobsolete)
343 repository tip rolled back to revision 3 (undo debugobsolete)
344 $ hg debugobsolete
344 $ hg debugobsolete
345 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
345 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
346 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
346 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
347 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
347 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
348 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
348 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
349 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
349 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
350
350
351 $ cd ..
351 $ cd ..
352
352
353 Try to pull markers
353 Try to pull markers
354
354
355 $ hg init tmpd
355 $ hg init tmpd
356 $ hg -R tmpb push tmpd
356 $ hg -R tmpb push tmpd
357 pushing to tmpd
357 pushing to tmpd
358 searching for changes
358 searching for changes
359 adding changesets
359 adding changesets
360 adding manifests
360 adding manifests
361 adding file changes
361 adding file changes
362 added 4 changesets with 4 changes to 4 files (+1 heads)
362 added 4 changesets with 4 changes to 4 files (+1 heads)
363 $ hg -R tmpd debugobsolete
363 $ hg -R tmpd debugobsolete
364 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
364 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
365 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
365 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
366 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
366 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
367 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
367 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
368 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
368 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
369
369
370 Check obsolete keys are exchanged only if source has an obsolete store
370 Check obsolete keys are exchanged only if source has an obsolete store
371
371
372 $ hg init empty
372 $ hg init empty
373 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
373 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
374 pushing to tmpd
374 pushing to tmpd
375 no changes found
375 no changes found
376 listkeys phases
376 listkeys phases
377 listkeys bookmarks
377 listkeys bookmarks
378 [1]
378 [1]
379
379
380 clone support
380 clone support
381 (markers are copied and extinct changesets are included to allow hardlinks)
381 (markers are copied and extinct changesets are included to allow hardlinks)
382
382
383 $ hg clone tmpb clone-dest
383 $ hg clone tmpb clone-dest
384 updating to branch default
384 updating to branch default
385 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
385 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
386 $ hg -R clone-dest log -G --hidden
386 $ hg -R clone-dest log -G --hidden
387 @ changeset: 6:6f9641995072
387 @ changeset: 6:6f9641995072
388 | tag: tip
388 | tag: tip
389 | parent: 1:7c3bad9141dc
389 | parent: 1:7c3bad9141dc
390 | user: test
390 | user: test
391 | date: Thu Jan 01 00:00:00 1970 +0000
391 | date: Thu Jan 01 00:00:00 1970 +0000
392 | summary: add n3w_3_c
392 | summary: add n3w_3_c
393 |
393 |
394 | x changeset: 5:5601fb93a350
394 | x changeset: 5:5601fb93a350
395 |/ parent: 1:7c3bad9141dc
395 |/ parent: 1:7c3bad9141dc
396 | user: test
396 | user: test
397 | date: Thu Jan 01 00:00:00 1970 +0000
397 | date: Thu Jan 01 00:00:00 1970 +0000
398 | summary: add new_3_c
398 | summary: add new_3_c
399 |
399 |
400 | x changeset: 4:ca819180edb9
400 | x changeset: 4:ca819180edb9
401 |/ parent: 1:7c3bad9141dc
401 |/ parent: 1:7c3bad9141dc
402 | user: test
402 | user: test
403 | date: Thu Jan 01 00:00:00 1970 +0000
403 | date: Thu Jan 01 00:00:00 1970 +0000
404 | summary: add new_2_c
404 | summary: add new_2_c
405 |
405 |
406 | x changeset: 3:cdbce2fbb163
406 | x changeset: 3:cdbce2fbb163
407 |/ parent: 1:7c3bad9141dc
407 |/ parent: 1:7c3bad9141dc
408 | user: test
408 | user: test
409 | date: Thu Jan 01 00:00:00 1970 +0000
409 | date: Thu Jan 01 00:00:00 1970 +0000
410 | summary: add new_c
410 | summary: add new_c
411 |
411 |
412 | o changeset: 2:245bde4270cd
412 | o changeset: 2:245bde4270cd
413 |/ user: test
413 |/ user: test
414 | date: Thu Jan 01 00:00:00 1970 +0000
414 | date: Thu Jan 01 00:00:00 1970 +0000
415 | summary: add original_c
415 | summary: add original_c
416 |
416 |
417 o changeset: 1:7c3bad9141dc
417 o changeset: 1:7c3bad9141dc
418 | user: test
418 | user: test
419 | date: Thu Jan 01 00:00:00 1970 +0000
419 | date: Thu Jan 01 00:00:00 1970 +0000
420 | summary: add b
420 | summary: add b
421 |
421 |
422 o changeset: 0:1f0dee641bb7
422 o changeset: 0:1f0dee641bb7
423 user: test
423 user: test
424 date: Thu Jan 01 00:00:00 1970 +0000
424 date: Thu Jan 01 00:00:00 1970 +0000
425 summary: add a
425 summary: add a
426
426
427 $ hg -R clone-dest debugobsolete
427 $ hg -R clone-dest debugobsolete
428 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
428 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
429 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
429 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
430 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
430 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
431 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
431 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
432 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
432 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
433
433
434
434
435 Destination repo have existing data
435 Destination repo have existing data
436 ---------------------------------------
436 ---------------------------------------
437
437
438 On pull
438 On pull
439
439
440 $ hg init tmpe
440 $ hg init tmpe
441 $ cd tmpe
441 $ cd tmpe
442 $ hg debugobsolete -d '1339 0' 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339
442 $ hg debugobsolete -d '1339 0' 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339
443 $ hg pull ../tmpb
443 $ hg pull ../tmpb
444 pulling from ../tmpb
444 pulling from ../tmpb
445 requesting all changes
445 requesting all changes
446 adding changesets
446 adding changesets
447 adding manifests
447 adding manifests
448 adding file changes
448 adding file changes
449 added 4 changesets with 4 changes to 4 files (+1 heads)
449 added 4 changesets with 4 changes to 4 files (+1 heads)
450 (run 'hg heads' to see heads, 'hg merge' to merge)
450 (run 'hg heads' to see heads, 'hg merge' to merge)
451 $ hg debugobsolete
451 $ hg debugobsolete
452 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
452 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
453 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
453 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
454 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
454 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
455 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
455 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
456 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
456 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
457 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
457 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
458
458
459
459
460 On push
460 On push
461
461
462 $ hg push ../tmpc
462 $ hg push ../tmpc
463 pushing to ../tmpc
463 pushing to ../tmpc
464 searching for changes
464 searching for changes
465 no changes found
465 no changes found
466 [1]
466 [1]
467 $ hg -R ../tmpc debugobsolete
467 $ hg -R ../tmpc debugobsolete
468 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
468 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C {'date': '56 12', 'user': 'test'}
469 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
469 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 {'date': '1337 0', 'user': 'test'}
470 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
470 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 {'date': '1338 0', 'user': 'test'}
471 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
471 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 {'date': '1339 0', 'user': 'test'}
472 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
472 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 {'date': '1338 0', 'user': 'test'}
473 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
473 2448244824482448244824482448244824482448 1339133913391339133913391339133913391339 0 {'date': '1339 0', 'user': 'test'}
474
474
475 detect outgoing obsolete and unstable
475 detect outgoing obsolete and unstable
476 ---------------------------------------
476 ---------------------------------------
477
477
478
478
479 $ hg glog
479 $ hg glog
480 o changeset: 3:6f9641995072
480 o changeset: 3:6f9641995072
481 | tag: tip
481 | tag: tip
482 | parent: 1:7c3bad9141dc
482 | parent: 1:7c3bad9141dc
483 | user: test
483 | user: test
484 | date: Thu Jan 01 00:00:00 1970 +0000
484 | date: Thu Jan 01 00:00:00 1970 +0000
485 | summary: add n3w_3_c
485 | summary: add n3w_3_c
486 |
486 |
487 | o changeset: 2:245bde4270cd
487 | o changeset: 2:245bde4270cd
488 |/ user: test
488 |/ user: test
489 | date: Thu Jan 01 00:00:00 1970 +0000
489 | date: Thu Jan 01 00:00:00 1970 +0000
490 | summary: add original_c
490 | summary: add original_c
491 |
491 |
492 o changeset: 1:7c3bad9141dc
492 o changeset: 1:7c3bad9141dc
493 | user: test
493 | user: test
494 | date: Thu Jan 01 00:00:00 1970 +0000
494 | date: Thu Jan 01 00:00:00 1970 +0000
495 | summary: add b
495 | summary: add b
496 |
496 |
497 o changeset: 0:1f0dee641bb7
497 o changeset: 0:1f0dee641bb7
498 user: test
498 user: test
499 date: Thu Jan 01 00:00:00 1970 +0000
499 date: Thu Jan 01 00:00:00 1970 +0000
500 summary: add a
500 summary: add a
501
501
502 $ hg up 'desc("n3w_3_c")'
502 $ hg up 'desc("n3w_3_c")'
503 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
503 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
504 $ mkcommit original_d
504 $ mkcommit original_d
505 $ mkcommit original_e
505 $ mkcommit original_e
506 $ hg debugobsolete `getid original_d` -d '0 0'
506 $ hg debugobsolete `getid original_d` -d '0 0'
507 $ hg log -r 'obsolete()'
507 $ hg log -r 'obsolete()'
508 changeset: 4:94b33453f93b
508 changeset: 4:94b33453f93b
509 user: test
509 user: test
510 date: Thu Jan 01 00:00:00 1970 +0000
510 date: Thu Jan 01 00:00:00 1970 +0000
511 summary: add original_d
511 summary: add original_d
512
512
513 $ hg glog -r '::unstable()'
513 $ hg glog -r '::unstable()'
514 @ changeset: 5:cda648ca50f5
514 @ changeset: 5:cda648ca50f5
515 | tag: tip
515 | tag: tip
516 | user: test
516 | user: test
517 | date: Thu Jan 01 00:00:00 1970 +0000
517 | date: Thu Jan 01 00:00:00 1970 +0000
518 | summary: add original_e
518 | summary: add original_e
519 |
519 |
520 x changeset: 4:94b33453f93b
520 x changeset: 4:94b33453f93b
521 | user: test
521 | user: test
522 | date: Thu Jan 01 00:00:00 1970 +0000
522 | date: Thu Jan 01 00:00:00 1970 +0000
523 | summary: add original_d
523 | summary: add original_d
524 |
524 |
525 o changeset: 3:6f9641995072
525 o changeset: 3:6f9641995072
526 | parent: 1:7c3bad9141dc
526 | parent: 1:7c3bad9141dc
527 | user: test
527 | user: test
528 | date: Thu Jan 01 00:00:00 1970 +0000
528 | date: Thu Jan 01 00:00:00 1970 +0000
529 | summary: add n3w_3_c
529 | summary: add n3w_3_c
530 |
530 |
531 o changeset: 1:7c3bad9141dc
531 o changeset: 1:7c3bad9141dc
532 | user: test
532 | user: test
533 | date: Thu Jan 01 00:00:00 1970 +0000
533 | date: Thu Jan 01 00:00:00 1970 +0000
534 | summary: add b
534 | summary: add b
535 |
535 |
536 o changeset: 0:1f0dee641bb7
536 o changeset: 0:1f0dee641bb7
537 user: test
537 user: test
538 date: Thu Jan 01 00:00:00 1970 +0000
538 date: Thu Jan 01 00:00:00 1970 +0000
539 summary: add a
539 summary: add a
540
540
541
541
542 refuse to push obsolete changeset
542 refuse to push obsolete changeset
543
543
544 $ hg push ../tmpc/ -r 'desc("original_d")'
544 $ hg push ../tmpc/ -r 'desc("original_d")'
545 pushing to ../tmpc/
545 pushing to ../tmpc/
546 searching for changes
546 searching for changes
547 abort: push includes obsolete changeset: 94b33453f93b!
547 abort: push includes obsolete changeset: 94b33453f93b!
548 [255]
548 [255]
549
549
550 refuse to push unstable changeset
550 refuse to push unstable changeset
551
551
552 $ hg push ../tmpc/
552 $ hg push ../tmpc/
553 pushing to ../tmpc/
553 pushing to ../tmpc/
554 searching for changes
554 searching for changes
555 abort: push includes unstable changeset: cda648ca50f5!
555 abort: push includes unstable changeset: cda648ca50f5!
556 [255]
556 [255]
557
557
558 Test that extinct changeset are properly detected
558 Test that extinct changeset are properly detected
559
559
560 $ hg log -r 'extinct()'
560 $ hg log -r 'extinct()'
561
561
562 Don't try to push extinct changeset
562 Don't try to push extinct changeset
563
563
564 $ hg init ../tmpf
564 $ hg init ../tmpf
565 $ hg out ../tmpf
565 $ hg out ../tmpf
566 comparing with ../tmpf
566 comparing with ../tmpf
567 searching for changes
567 searching for changes
568 changeset: 0:1f0dee641bb7
568 changeset: 0:1f0dee641bb7
569 user: test
569 user: test
570 date: Thu Jan 01 00:00:00 1970 +0000
570 date: Thu Jan 01 00:00:00 1970 +0000
571 summary: add a
571 summary: add a
572
572
573 changeset: 1:7c3bad9141dc
573 changeset: 1:7c3bad9141dc
574 user: test
574 user: test
575 date: Thu Jan 01 00:00:00 1970 +0000
575 date: Thu Jan 01 00:00:00 1970 +0000
576 summary: add b
576 summary: add b
577
577
578 changeset: 2:245bde4270cd
578 changeset: 2:245bde4270cd
579 user: test
579 user: test
580 date: Thu Jan 01 00:00:00 1970 +0000
580 date: Thu Jan 01 00:00:00 1970 +0000
581 summary: add original_c
581 summary: add original_c
582
582
583 changeset: 3:6f9641995072
583 changeset: 3:6f9641995072
584 parent: 1:7c3bad9141dc
584 parent: 1:7c3bad9141dc
585 user: test
585 user: test
586 date: Thu Jan 01 00:00:00 1970 +0000
586 date: Thu Jan 01 00:00:00 1970 +0000
587 summary: add n3w_3_c
587 summary: add n3w_3_c
588
588
589 changeset: 4:94b33453f93b
589 changeset: 4:94b33453f93b
590 user: test
590 user: test
591 date: Thu Jan 01 00:00:00 1970 +0000
591 date: Thu Jan 01 00:00:00 1970 +0000
592 summary: add original_d
592 summary: add original_d
593
593
594 changeset: 5:cda648ca50f5
594 changeset: 5:cda648ca50f5
595 tag: tip
595 tag: tip
596 user: test
596 user: test
597 date: Thu Jan 01 00:00:00 1970 +0000
597 date: Thu Jan 01 00:00:00 1970 +0000
598 summary: add original_e
598 summary: add original_e
599
599
600 $ hg push ../tmpf -f # -f because be push unstable too
600 $ hg push ../tmpf -f # -f because be push unstable too
601 pushing to ../tmpf
601 pushing to ../tmpf
602 searching for changes
602 searching for changes
603 adding changesets
603 adding changesets
604 adding manifests
604 adding manifests
605 adding file changes
605 adding file changes
606 added 6 changesets with 6 changes to 6 files (+1 heads)
606 added 6 changesets with 6 changes to 6 files (+1 heads)
607
607
608 no warning displayed
608 no warning displayed
609
609
610 $ hg push ../tmpf
610 $ hg push ../tmpf
611 pushing to ../tmpf
611 pushing to ../tmpf
612 searching for changes
612 searching for changes
613 no changes found
613 no changes found
614 [1]
614 [1]
615
615
616 Do not warn about new head when the new head is a successors of a remote one
616 Do not warn about new head when the new head is a successors of a remote one
617
617
618 $ hg glog
618 $ hg glog
619 @ changeset: 5:cda648ca50f5
619 @ changeset: 5:cda648ca50f5
620 | tag: tip
620 | tag: tip
621 | user: test
621 | user: test
622 | date: Thu Jan 01 00:00:00 1970 +0000
622 | date: Thu Jan 01 00:00:00 1970 +0000
623 | summary: add original_e
623 | summary: add original_e
624 |
624 |
625 x changeset: 4:94b33453f93b
625 x changeset: 4:94b33453f93b
626 | user: test
626 | user: test
627 | date: Thu Jan 01 00:00:00 1970 +0000
627 | date: Thu Jan 01 00:00:00 1970 +0000
628 | summary: add original_d
628 | summary: add original_d
629 |
629 |
630 o changeset: 3:6f9641995072
630 o changeset: 3:6f9641995072
631 | parent: 1:7c3bad9141dc
631 | parent: 1:7c3bad9141dc
632 | user: test
632 | user: test
633 | date: Thu Jan 01 00:00:00 1970 +0000
633 | date: Thu Jan 01 00:00:00 1970 +0000
634 | summary: add n3w_3_c
634 | summary: add n3w_3_c
635 |
635 |
636 | o changeset: 2:245bde4270cd
636 | o changeset: 2:245bde4270cd
637 |/ user: test
637 |/ user: test
638 | date: Thu Jan 01 00:00:00 1970 +0000
638 | date: Thu Jan 01 00:00:00 1970 +0000
639 | summary: add original_c
639 | summary: add original_c
640 |
640 |
641 o changeset: 1:7c3bad9141dc
641 o changeset: 1:7c3bad9141dc
642 | user: test
642 | user: test
643 | date: Thu Jan 01 00:00:00 1970 +0000
643 | date: Thu Jan 01 00:00:00 1970 +0000
644 | summary: add b
644 | summary: add b
645 |
645 |
646 o changeset: 0:1f0dee641bb7
646 o changeset: 0:1f0dee641bb7
647 user: test
647 user: test
648 date: Thu Jan 01 00:00:00 1970 +0000
648 date: Thu Jan 01 00:00:00 1970 +0000
649 summary: add a
649 summary: add a
650
650
651 $ hg up -q 'desc(n3w_3_c)'
651 $ hg up -q 'desc(n3w_3_c)'
652 $ mkcommit obsolete_e
652 $ mkcommit obsolete_e
653 created new head
653 created new head
654 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
654 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
655 $ hg push ../tmpf
655 $ hg push ../tmpf
656 pushing to ../tmpf
656 pushing to ../tmpf
657 searching for changes
657 searching for changes
658 adding changesets
658 adding changesets
659 adding manifests
659 adding manifests
660 adding file changes
660 adding file changes
661 added 1 changesets with 1 changes to 1 files (+1 heads)
661 added 1 changesets with 1 changes to 1 files (+1 heads)
662
662
663 check hgweb does not explode
663 check hgweb does not explode
664 ====================================
664 ====================================
665
665
666 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
666 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
667 adding changesets
667 adding changesets
668 adding manifests
668 adding manifests
669 adding file changes
669 adding file changes
670 added 62 changesets with 63 changes to 9 files (+60 heads)
670 added 62 changesets with 63 changes to 9 files (+60 heads)
671 (run 'hg heads .' to see heads, 'hg merge' to merge)
671 (run 'hg heads .' to see heads, 'hg merge' to merge)
672 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
672 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
673 > do
673 > do
674 > hg debugobsolete $node
674 > hg debugobsolete $node
675 > done
675 > done
676 $ hg up tip
676 $ hg up tip
677 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
677 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
678
678
679 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
679 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
680 $ cat hg.pid >> $DAEMON_PIDS
680 $ cat hg.pid >> $DAEMON_PIDS
681
681
682 #check changelog view
682 check changelog view
683 #
683
684 # $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'shortlog/'
684 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'shortlog/'
685 # 200 Script output follows
685 200 Script output follows
686
686
687 #check graph view
687 #check graph view
688 #
688 #
689 # $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph'
689 # $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph'
690 # 200 Script output follows
690 # 200 Script output follows
691
692 check filelog view
691 check filelog view
693
692
694 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar'
693 $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg id --debug --id`/'babar'
695 200 Script output follows
694 200 Script output follows
696
695
697 $ kill `cat hg.pid`
696 $ kill `cat hg.pid`
698
697
699 Checking _enable=False warning if obsolete marker exists
698 Checking _enable=False warning if obsolete marker exists
700
699
701 $ echo '[extensions]' >> $HGRCPATH
700 $ echo '[extensions]' >> $HGRCPATH
702 $ echo "obs=!" >> $HGRCPATH
701 $ echo "obs=!" >> $HGRCPATH
703 $ hg log -r tip
702 $ hg log -r tip
704 obsolete feature not enabled but 68 markers found!
703 obsolete feature not enabled but 68 markers found!
705 changeset: 68:c15e9edfca13
704 changeset: 68:c15e9edfca13
706 tag: tip
705 tag: tip
707 parent: 7:50c51b361e60
706 parent: 7:50c51b361e60
708 user: test
707 user: test
709 date: Thu Jan 01 00:00:00 1970 +0000
708 date: Thu Jan 01 00:00:00 1970 +0000
710 summary: add celestine
709 summary: add celestine
711
710
General Comments 0
You need to be logged in to leave comments. Login now