##// END OF EJS Templates
repoview: invalidate 'visible' filtered revisions when bookmarks change...
Laurent Charignon -
r25569:2612e6da default
parent child Browse files
Show More
@@ -1,559 +1,560 b''
1 # Mercurial bookmark support code
1 # Mercurial bookmark support code
2 #
2 #
3 # Copyright 2008 David Soria Parra <dsp@php.net>
3 # Copyright 2008 David Soria Parra <dsp@php.net>
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 import os
8 import os
9 from mercurial.i18n import _
9 from mercurial.i18n import _
10 from mercurial.node import hex, bin
10 from mercurial.node import hex, bin
11 from mercurial import encoding, util, obsolete, lock as lockmod
11 from mercurial import encoding, util, obsolete, lock as lockmod
12 import errno
12 import errno
13
13
14 class bmstore(dict):
14 class bmstore(dict):
15 """Storage for bookmarks.
15 """Storage for bookmarks.
16
16
17 This object should do all bookmark reads and writes, so that it's
17 This object should do all bookmark reads and writes, so that it's
18 fairly simple to replace the storage underlying bookmarks without
18 fairly simple to replace the storage underlying bookmarks without
19 having to clone the logic surrounding bookmarks.
19 having to clone the logic surrounding bookmarks.
20
20
21 This particular bmstore implementation stores bookmarks as
21 This particular bmstore implementation stores bookmarks as
22 {hash}\s{name}\n (the same format as localtags) in
22 {hash}\s{name}\n (the same format as localtags) in
23 .hg/bookmarks. The mapping is stored as {name: nodeid}.
23 .hg/bookmarks. The mapping is stored as {name: nodeid}.
24
24
25 This class does NOT handle the "active" bookmark state at this
25 This class does NOT handle the "active" bookmark state at this
26 time.
26 time.
27 """
27 """
28
28
29 def __init__(self, repo):
29 def __init__(self, repo):
30 dict.__init__(self)
30 dict.__init__(self)
31 self._repo = repo
31 self._repo = repo
32 try:
32 try:
33 bkfile = self.getbkfile(repo)
33 bkfile = self.getbkfile(repo)
34 for line in bkfile:
34 for line in bkfile:
35 line = line.strip()
35 line = line.strip()
36 if not line:
36 if not line:
37 continue
37 continue
38 if ' ' not in line:
38 if ' ' not in line:
39 repo.ui.warn(_('malformed line in .hg/bookmarks: %r\n')
39 repo.ui.warn(_('malformed line in .hg/bookmarks: %r\n')
40 % line)
40 % line)
41 continue
41 continue
42 sha, refspec = line.split(' ', 1)
42 sha, refspec = line.split(' ', 1)
43 refspec = encoding.tolocal(refspec)
43 refspec = encoding.tolocal(refspec)
44 try:
44 try:
45 self[refspec] = repo.changelog.lookup(sha)
45 self[refspec] = repo.changelog.lookup(sha)
46 except LookupError:
46 except LookupError:
47 pass
47 pass
48 except IOError, inst:
48 except IOError, inst:
49 if inst.errno != errno.ENOENT:
49 if inst.errno != errno.ENOENT:
50 raise
50 raise
51
51
52 def getbkfile(self, repo):
52 def getbkfile(self, repo):
53 bkfile = None
53 bkfile = None
54 if 'HG_PENDING' in os.environ:
54 if 'HG_PENDING' in os.environ:
55 try:
55 try:
56 bkfile = repo.vfs('bookmarks.pending')
56 bkfile = repo.vfs('bookmarks.pending')
57 except IOError, inst:
57 except IOError, inst:
58 if inst.errno != errno.ENOENT:
58 if inst.errno != errno.ENOENT:
59 raise
59 raise
60 if bkfile is None:
60 if bkfile is None:
61 bkfile = repo.vfs('bookmarks')
61 bkfile = repo.vfs('bookmarks')
62 return bkfile
62 return bkfile
63
63
64 def recordchange(self, tr):
64 def recordchange(self, tr):
65 """record that bookmarks have been changed in a transaction
65 """record that bookmarks have been changed in a transaction
66
66
67 The transaction is then responsible for updating the file content."""
67 The transaction is then responsible for updating the file content."""
68 tr.addfilegenerator('bookmarks', ('bookmarks',), self._write,
68 tr.addfilegenerator('bookmarks', ('bookmarks',), self._write,
69 location='plain')
69 location='plain')
70 tr.hookargs['bookmark_moved'] = '1'
70 tr.hookargs['bookmark_moved'] = '1'
71
71
72 def write(self):
72 def write(self):
73 '''Write bookmarks
73 '''Write bookmarks
74
74
75 Write the given bookmark => hash dictionary to the .hg/bookmarks file
75 Write the given bookmark => hash dictionary to the .hg/bookmarks file
76 in a format equal to those of localtags.
76 in a format equal to those of localtags.
77
77
78 We also store a backup of the previous state in undo.bookmarks that
78 We also store a backup of the previous state in undo.bookmarks that
79 can be copied back on rollback.
79 can be copied back on rollback.
80 '''
80 '''
81 repo = self._repo
81 repo = self._repo
82 self._writerepo(repo)
82 self._writerepo(repo)
83 repo.invalidatevolatilesets()
83
84
84 def _writerepo(self, repo):
85 def _writerepo(self, repo):
85 """Factored out for extensibility"""
86 """Factored out for extensibility"""
86 if repo._activebookmark not in self:
87 if repo._activebookmark not in self:
87 deactivate(repo)
88 deactivate(repo)
88
89
89 wlock = repo.wlock()
90 wlock = repo.wlock()
90 try:
91 try:
91
92
92 file = repo.vfs('bookmarks', 'w', atomictemp=True)
93 file = repo.vfs('bookmarks', 'w', atomictemp=True)
93 self._write(file)
94 self._write(file)
94 file.close()
95 file.close()
95
96
96 # touch 00changelog.i so hgweb reloads bookmarks (no lock needed)
97 # touch 00changelog.i so hgweb reloads bookmarks (no lock needed)
97 try:
98 try:
98 repo.svfs.utime('00changelog.i', None)
99 repo.svfs.utime('00changelog.i', None)
99 except OSError:
100 except OSError:
100 pass
101 pass
101
102
102 finally:
103 finally:
103 wlock.release()
104 wlock.release()
104
105
105 def _write(self, fp):
106 def _write(self, fp):
106 for name, node in self.iteritems():
107 for name, node in self.iteritems():
107 fp.write("%s %s\n" % (hex(node), encoding.fromlocal(name)))
108 fp.write("%s %s\n" % (hex(node), encoding.fromlocal(name)))
108
109
109 def readactive(repo):
110 def readactive(repo):
110 """
111 """
111 Get the active bookmark. We can have an active bookmark that updates
112 Get the active bookmark. We can have an active bookmark that updates
112 itself as we commit. This function returns the name of that bookmark.
113 itself as we commit. This function returns the name of that bookmark.
113 It is stored in .hg/bookmarks.current
114 It is stored in .hg/bookmarks.current
114 """
115 """
115 mark = None
116 mark = None
116 try:
117 try:
117 file = repo.vfs('bookmarks.current')
118 file = repo.vfs('bookmarks.current')
118 except IOError, inst:
119 except IOError, inst:
119 if inst.errno != errno.ENOENT:
120 if inst.errno != errno.ENOENT:
120 raise
121 raise
121 return None
122 return None
122 try:
123 try:
123 # No readline() in osutil.posixfile, reading everything is cheap
124 # No readline() in osutil.posixfile, reading everything is cheap
124 mark = encoding.tolocal((file.readlines() or [''])[0])
125 mark = encoding.tolocal((file.readlines() or [''])[0])
125 if mark == '' or mark not in repo._bookmarks:
126 if mark == '' or mark not in repo._bookmarks:
126 mark = None
127 mark = None
127 finally:
128 finally:
128 file.close()
129 file.close()
129 return mark
130 return mark
130
131
131 def activate(repo, mark):
132 def activate(repo, mark):
132 """
133 """
133 Set the given bookmark to be 'active', meaning that this bookmark will
134 Set the given bookmark to be 'active', meaning that this bookmark will
134 follow new commits that are made.
135 follow new commits that are made.
135 The name is recorded in .hg/bookmarks.current
136 The name is recorded in .hg/bookmarks.current
136 """
137 """
137 if mark not in repo._bookmarks:
138 if mark not in repo._bookmarks:
138 raise AssertionError('bookmark %s does not exist!' % mark)
139 raise AssertionError('bookmark %s does not exist!' % mark)
139
140
140 active = repo._activebookmark
141 active = repo._activebookmark
141 if active == mark:
142 if active == mark:
142 return
143 return
143
144
144 wlock = repo.wlock()
145 wlock = repo.wlock()
145 try:
146 try:
146 file = repo.vfs('bookmarks.current', 'w', atomictemp=True)
147 file = repo.vfs('bookmarks.current', 'w', atomictemp=True)
147 file.write(encoding.fromlocal(mark))
148 file.write(encoding.fromlocal(mark))
148 file.close()
149 file.close()
149 finally:
150 finally:
150 wlock.release()
151 wlock.release()
151 repo._activebookmark = mark
152 repo._activebookmark = mark
152
153
153 def deactivate(repo):
154 def deactivate(repo):
154 """
155 """
155 Unset the active bookmark in this reposiotry.
156 Unset the active bookmark in this reposiotry.
156 """
157 """
157 wlock = repo.wlock()
158 wlock = repo.wlock()
158 try:
159 try:
159 repo.vfs.unlink('bookmarks.current')
160 repo.vfs.unlink('bookmarks.current')
160 repo._activebookmark = None
161 repo._activebookmark = None
161 except OSError, inst:
162 except OSError, inst:
162 if inst.errno != errno.ENOENT:
163 if inst.errno != errno.ENOENT:
163 raise
164 raise
164 finally:
165 finally:
165 wlock.release()
166 wlock.release()
166
167
167 def isactivewdirparent(repo):
168 def isactivewdirparent(repo):
168 """
169 """
169 Tell whether the 'active' bookmark (the one that follows new commits)
170 Tell whether the 'active' bookmark (the one that follows new commits)
170 points to one of the parents of the current working directory (wdir).
171 points to one of the parents of the current working directory (wdir).
171
172
172 While this is normally the case, it can on occasion be false; for example,
173 While this is normally the case, it can on occasion be false; for example,
173 immediately after a pull, the active bookmark can be moved to point
174 immediately after a pull, the active bookmark can be moved to point
174 to a place different than the wdir. This is solved by running `hg update`.
175 to a place different than the wdir. This is solved by running `hg update`.
175 """
176 """
176 mark = repo._activebookmark
177 mark = repo._activebookmark
177 marks = repo._bookmarks
178 marks = repo._bookmarks
178 parents = [p.node() for p in repo[None].parents()]
179 parents = [p.node() for p in repo[None].parents()]
179 return (mark in marks and marks[mark] in parents)
180 return (mark in marks and marks[mark] in parents)
180
181
181 def deletedivergent(repo, deletefrom, bm):
182 def deletedivergent(repo, deletefrom, bm):
182 '''Delete divergent versions of bm on nodes in deletefrom.
183 '''Delete divergent versions of bm on nodes in deletefrom.
183
184
184 Return True if at least one bookmark was deleted, False otherwise.'''
185 Return True if at least one bookmark was deleted, False otherwise.'''
185 deleted = False
186 deleted = False
186 marks = repo._bookmarks
187 marks = repo._bookmarks
187 divergent = [b for b in marks if b.split('@', 1)[0] == bm.split('@', 1)[0]]
188 divergent = [b for b in marks if b.split('@', 1)[0] == bm.split('@', 1)[0]]
188 for mark in divergent:
189 for mark in divergent:
189 if mark == '@' or '@' not in mark:
190 if mark == '@' or '@' not in mark:
190 # can't be divergent by definition
191 # can't be divergent by definition
191 continue
192 continue
192 if mark and marks[mark] in deletefrom:
193 if mark and marks[mark] in deletefrom:
193 if mark != bm:
194 if mark != bm:
194 del marks[mark]
195 del marks[mark]
195 deleted = True
196 deleted = True
196 return deleted
197 return deleted
197
198
198 def calculateupdate(ui, repo, checkout):
199 def calculateupdate(ui, repo, checkout):
199 '''Return a tuple (targetrev, movemarkfrom) indicating the rev to
200 '''Return a tuple (targetrev, movemarkfrom) indicating the rev to
200 check out and where to move the active bookmark from, if needed.'''
201 check out and where to move the active bookmark from, if needed.'''
201 movemarkfrom = None
202 movemarkfrom = None
202 if checkout is None:
203 if checkout is None:
203 activemark = repo._activebookmark
204 activemark = repo._activebookmark
204 if isactivewdirparent(repo):
205 if isactivewdirparent(repo):
205 movemarkfrom = repo['.'].node()
206 movemarkfrom = repo['.'].node()
206 elif activemark:
207 elif activemark:
207 ui.status(_("updating to active bookmark %s\n") % activemark)
208 ui.status(_("updating to active bookmark %s\n") % activemark)
208 checkout = activemark
209 checkout = activemark
209 return (checkout, movemarkfrom)
210 return (checkout, movemarkfrom)
210
211
211 def update(repo, parents, node):
212 def update(repo, parents, node):
212 deletefrom = parents
213 deletefrom = parents
213 marks = repo._bookmarks
214 marks = repo._bookmarks
214 update = False
215 update = False
215 active = repo._activebookmark
216 active = repo._activebookmark
216 if not active:
217 if not active:
217 return False
218 return False
218
219
219 if marks[active] in parents:
220 if marks[active] in parents:
220 new = repo[node]
221 new = repo[node]
221 divs = [repo[b] for b in marks
222 divs = [repo[b] for b in marks
222 if b.split('@', 1)[0] == active.split('@', 1)[0]]
223 if b.split('@', 1)[0] == active.split('@', 1)[0]]
223 anc = repo.changelog.ancestors([new.rev()])
224 anc = repo.changelog.ancestors([new.rev()])
224 deletefrom = [b.node() for b in divs if b.rev() in anc or b == new]
225 deletefrom = [b.node() for b in divs if b.rev() in anc or b == new]
225 if validdest(repo, repo[marks[active]], new):
226 if validdest(repo, repo[marks[active]], new):
226 marks[active] = new.node()
227 marks[active] = new.node()
227 update = True
228 update = True
228
229
229 if deletedivergent(repo, deletefrom, active):
230 if deletedivergent(repo, deletefrom, active):
230 update = True
231 update = True
231
232
232 if update:
233 if update:
233 marks.write()
234 marks.write()
234 return update
235 return update
235
236
236 def listbookmarks(repo):
237 def listbookmarks(repo):
237 # We may try to list bookmarks on a repo type that does not
238 # We may try to list bookmarks on a repo type that does not
238 # support it (e.g., statichttprepository).
239 # support it (e.g., statichttprepository).
239 marks = getattr(repo, '_bookmarks', {})
240 marks = getattr(repo, '_bookmarks', {})
240
241
241 d = {}
242 d = {}
242 hasnode = repo.changelog.hasnode
243 hasnode = repo.changelog.hasnode
243 for k, v in marks.iteritems():
244 for k, v in marks.iteritems():
244 # don't expose local divergent bookmarks
245 # don't expose local divergent bookmarks
245 if hasnode(v) and ('@' not in k or k.endswith('@')):
246 if hasnode(v) and ('@' not in k or k.endswith('@')):
246 d[k] = hex(v)
247 d[k] = hex(v)
247 return d
248 return d
248
249
249 def pushbookmark(repo, key, old, new):
250 def pushbookmark(repo, key, old, new):
250 w = l = tr = None
251 w = l = tr = None
251 try:
252 try:
252 w = repo.wlock()
253 w = repo.wlock()
253 l = repo.lock()
254 l = repo.lock()
254 tr = repo.transaction('bookmarks')
255 tr = repo.transaction('bookmarks')
255 marks = repo._bookmarks
256 marks = repo._bookmarks
256 existing = hex(marks.get(key, ''))
257 existing = hex(marks.get(key, ''))
257 if existing != old and existing != new:
258 if existing != old and existing != new:
258 return False
259 return False
259 if new == '':
260 if new == '':
260 del marks[key]
261 del marks[key]
261 else:
262 else:
262 if new not in repo:
263 if new not in repo:
263 return False
264 return False
264 marks[key] = repo[new].node()
265 marks[key] = repo[new].node()
265 marks.recordchange(tr)
266 marks.recordchange(tr)
266 tr.close()
267 tr.close()
267 return True
268 return True
268 finally:
269 finally:
269 lockmod.release(tr, l, w)
270 lockmod.release(tr, l, w)
270
271
271 def compare(repo, srcmarks, dstmarks,
272 def compare(repo, srcmarks, dstmarks,
272 srchex=None, dsthex=None, targets=None):
273 srchex=None, dsthex=None, targets=None):
273 '''Compare bookmarks between srcmarks and dstmarks
274 '''Compare bookmarks between srcmarks and dstmarks
274
275
275 This returns tuple "(addsrc, adddst, advsrc, advdst, diverge,
276 This returns tuple "(addsrc, adddst, advsrc, advdst, diverge,
276 differ, invalid)", each are list of bookmarks below:
277 differ, invalid)", each are list of bookmarks below:
277
278
278 :addsrc: added on src side (removed on dst side, perhaps)
279 :addsrc: added on src side (removed on dst side, perhaps)
279 :adddst: added on dst side (removed on src side, perhaps)
280 :adddst: added on dst side (removed on src side, perhaps)
280 :advsrc: advanced on src side
281 :advsrc: advanced on src side
281 :advdst: advanced on dst side
282 :advdst: advanced on dst side
282 :diverge: diverge
283 :diverge: diverge
283 :differ: changed, but changeset referred on src is unknown on dst
284 :differ: changed, but changeset referred on src is unknown on dst
284 :invalid: unknown on both side
285 :invalid: unknown on both side
285 :same: same on both side
286 :same: same on both side
286
287
287 Each elements of lists in result tuple is tuple "(bookmark name,
288 Each elements of lists in result tuple is tuple "(bookmark name,
288 changeset ID on source side, changeset ID on destination
289 changeset ID on source side, changeset ID on destination
289 side)". Each changeset IDs are 40 hexadecimal digit string or
290 side)". Each changeset IDs are 40 hexadecimal digit string or
290 None.
291 None.
291
292
292 Changeset IDs of tuples in "addsrc", "adddst", "differ" or
293 Changeset IDs of tuples in "addsrc", "adddst", "differ" or
293 "invalid" list may be unknown for repo.
294 "invalid" list may be unknown for repo.
294
295
295 This function expects that "srcmarks" and "dstmarks" return
296 This function expects that "srcmarks" and "dstmarks" return
296 changeset ID in 40 hexadecimal digit string for specified
297 changeset ID in 40 hexadecimal digit string for specified
297 bookmark. If not so (e.g. bmstore "repo._bookmarks" returning
298 bookmark. If not so (e.g. bmstore "repo._bookmarks" returning
298 binary value), "srchex" or "dsthex" should be specified to convert
299 binary value), "srchex" or "dsthex" should be specified to convert
299 into such form.
300 into such form.
300
301
301 If "targets" is specified, only bookmarks listed in it are
302 If "targets" is specified, only bookmarks listed in it are
302 examined.
303 examined.
303 '''
304 '''
304 if not srchex:
305 if not srchex:
305 srchex = lambda x: x
306 srchex = lambda x: x
306 if not dsthex:
307 if not dsthex:
307 dsthex = lambda x: x
308 dsthex = lambda x: x
308
309
309 if targets:
310 if targets:
310 bset = set(targets)
311 bset = set(targets)
311 else:
312 else:
312 srcmarkset = set(srcmarks)
313 srcmarkset = set(srcmarks)
313 dstmarkset = set(dstmarks)
314 dstmarkset = set(dstmarks)
314 bset = srcmarkset | dstmarkset
315 bset = srcmarkset | dstmarkset
315
316
316 results = ([], [], [], [], [], [], [], [])
317 results = ([], [], [], [], [], [], [], [])
317 addsrc = results[0].append
318 addsrc = results[0].append
318 adddst = results[1].append
319 adddst = results[1].append
319 advsrc = results[2].append
320 advsrc = results[2].append
320 advdst = results[3].append
321 advdst = results[3].append
321 diverge = results[4].append
322 diverge = results[4].append
322 differ = results[5].append
323 differ = results[5].append
323 invalid = results[6].append
324 invalid = results[6].append
324 same = results[7].append
325 same = results[7].append
325
326
326 for b in sorted(bset):
327 for b in sorted(bset):
327 if b not in srcmarks:
328 if b not in srcmarks:
328 if b in dstmarks:
329 if b in dstmarks:
329 adddst((b, None, dsthex(dstmarks[b])))
330 adddst((b, None, dsthex(dstmarks[b])))
330 else:
331 else:
331 invalid((b, None, None))
332 invalid((b, None, None))
332 elif b not in dstmarks:
333 elif b not in dstmarks:
333 addsrc((b, srchex(srcmarks[b]), None))
334 addsrc((b, srchex(srcmarks[b]), None))
334 else:
335 else:
335 scid = srchex(srcmarks[b])
336 scid = srchex(srcmarks[b])
336 dcid = dsthex(dstmarks[b])
337 dcid = dsthex(dstmarks[b])
337 if scid == dcid:
338 if scid == dcid:
338 same((b, scid, dcid))
339 same((b, scid, dcid))
339 elif scid in repo and dcid in repo:
340 elif scid in repo and dcid in repo:
340 sctx = repo[scid]
341 sctx = repo[scid]
341 dctx = repo[dcid]
342 dctx = repo[dcid]
342 if sctx.rev() < dctx.rev():
343 if sctx.rev() < dctx.rev():
343 if validdest(repo, sctx, dctx):
344 if validdest(repo, sctx, dctx):
344 advdst((b, scid, dcid))
345 advdst((b, scid, dcid))
345 else:
346 else:
346 diverge((b, scid, dcid))
347 diverge((b, scid, dcid))
347 else:
348 else:
348 if validdest(repo, dctx, sctx):
349 if validdest(repo, dctx, sctx):
349 advsrc((b, scid, dcid))
350 advsrc((b, scid, dcid))
350 else:
351 else:
351 diverge((b, scid, dcid))
352 diverge((b, scid, dcid))
352 else:
353 else:
353 # it is too expensive to examine in detail, in this case
354 # it is too expensive to examine in detail, in this case
354 differ((b, scid, dcid))
355 differ((b, scid, dcid))
355
356
356 return results
357 return results
357
358
358 def _diverge(ui, b, path, localmarks, remotenode):
359 def _diverge(ui, b, path, localmarks, remotenode):
359 '''Return appropriate diverged bookmark for specified ``path``
360 '''Return appropriate diverged bookmark for specified ``path``
360
361
361 This returns None, if it is failed to assign any divergent
362 This returns None, if it is failed to assign any divergent
362 bookmark name.
363 bookmark name.
363
364
364 This reuses already existing one with "@number" suffix, if it
365 This reuses already existing one with "@number" suffix, if it
365 refers ``remotenode``.
366 refers ``remotenode``.
366 '''
367 '''
367 if b == '@':
368 if b == '@':
368 b = ''
369 b = ''
369 # try to use an @pathalias suffix
370 # try to use an @pathalias suffix
370 # if an @pathalias already exists, we overwrite (update) it
371 # if an @pathalias already exists, we overwrite (update) it
371 if path.startswith("file:"):
372 if path.startswith("file:"):
372 path = util.url(path).path
373 path = util.url(path).path
373 for p, u in ui.configitems("paths"):
374 for p, u in ui.configitems("paths"):
374 if u.startswith("file:"):
375 if u.startswith("file:"):
375 u = util.url(u).path
376 u = util.url(u).path
376 if path == u:
377 if path == u:
377 return '%s@%s' % (b, p)
378 return '%s@%s' % (b, p)
378
379
379 # assign a unique "@number" suffix newly
380 # assign a unique "@number" suffix newly
380 for x in range(1, 100):
381 for x in range(1, 100):
381 n = '%s@%d' % (b, x)
382 n = '%s@%d' % (b, x)
382 if n not in localmarks or localmarks[n] == remotenode:
383 if n not in localmarks or localmarks[n] == remotenode:
383 return n
384 return n
384
385
385 return None
386 return None
386
387
387 def updatefromremote(ui, repo, remotemarks, path, trfunc, explicit=()):
388 def updatefromremote(ui, repo, remotemarks, path, trfunc, explicit=()):
388 ui.debug("checking for updated bookmarks\n")
389 ui.debug("checking for updated bookmarks\n")
389 localmarks = repo._bookmarks
390 localmarks = repo._bookmarks
390 (addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same
391 (addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same
391 ) = compare(repo, remotemarks, localmarks, dsthex=hex)
392 ) = compare(repo, remotemarks, localmarks, dsthex=hex)
392
393
393 status = ui.status
394 status = ui.status
394 warn = ui.warn
395 warn = ui.warn
395 if ui.configbool('ui', 'quietbookmarkmove', False):
396 if ui.configbool('ui', 'quietbookmarkmove', False):
396 status = warn = ui.debug
397 status = warn = ui.debug
397
398
398 explicit = set(explicit)
399 explicit = set(explicit)
399 changed = []
400 changed = []
400 for b, scid, dcid in addsrc:
401 for b, scid, dcid in addsrc:
401 if scid in repo: # add remote bookmarks for changes we already have
402 if scid in repo: # add remote bookmarks for changes we already have
402 changed.append((b, bin(scid), status,
403 changed.append((b, bin(scid), status,
403 _("adding remote bookmark %s\n") % (b)))
404 _("adding remote bookmark %s\n") % (b)))
404 elif b in explicit:
405 elif b in explicit:
405 explicit.remove(b)
406 explicit.remove(b)
406 ui.warn(_("remote bookmark %s points to locally missing %s\n")
407 ui.warn(_("remote bookmark %s points to locally missing %s\n")
407 % (b, scid[:12]))
408 % (b, scid[:12]))
408
409
409 for b, scid, dcid in advsrc:
410 for b, scid, dcid in advsrc:
410 changed.append((b, bin(scid), status,
411 changed.append((b, bin(scid), status,
411 _("updating bookmark %s\n") % (b)))
412 _("updating bookmark %s\n") % (b)))
412 # remove normal movement from explicit set
413 # remove normal movement from explicit set
413 explicit.difference_update(d[0] for d in changed)
414 explicit.difference_update(d[0] for d in changed)
414
415
415 for b, scid, dcid in diverge:
416 for b, scid, dcid in diverge:
416 if b in explicit:
417 if b in explicit:
417 explicit.discard(b)
418 explicit.discard(b)
418 changed.append((b, bin(scid), status,
419 changed.append((b, bin(scid), status,
419 _("importing bookmark %s\n") % (b)))
420 _("importing bookmark %s\n") % (b)))
420 else:
421 else:
421 snode = bin(scid)
422 snode = bin(scid)
422 db = _diverge(ui, b, path, localmarks, snode)
423 db = _diverge(ui, b, path, localmarks, snode)
423 if db:
424 if db:
424 changed.append((db, snode, warn,
425 changed.append((db, snode, warn,
425 _("divergent bookmark %s stored as %s\n") %
426 _("divergent bookmark %s stored as %s\n") %
426 (b, db)))
427 (b, db)))
427 else:
428 else:
428 warn(_("warning: failed to assign numbered name "
429 warn(_("warning: failed to assign numbered name "
429 "to divergent bookmark %s\n") % (b))
430 "to divergent bookmark %s\n") % (b))
430 for b, scid, dcid in adddst + advdst:
431 for b, scid, dcid in adddst + advdst:
431 if b in explicit:
432 if b in explicit:
432 explicit.discard(b)
433 explicit.discard(b)
433 changed.append((b, bin(scid), status,
434 changed.append((b, bin(scid), status,
434 _("importing bookmark %s\n") % (b)))
435 _("importing bookmark %s\n") % (b)))
435 for b, scid, dcid in differ:
436 for b, scid, dcid in differ:
436 if b in explicit:
437 if b in explicit:
437 explicit.remove(b)
438 explicit.remove(b)
438 ui.warn(_("remote bookmark %s points to locally missing %s\n")
439 ui.warn(_("remote bookmark %s points to locally missing %s\n")
439 % (b, scid[:12]))
440 % (b, scid[:12]))
440
441
441 if changed:
442 if changed:
442 tr = trfunc()
443 tr = trfunc()
443 for b, node, writer, msg in sorted(changed):
444 for b, node, writer, msg in sorted(changed):
444 localmarks[b] = node
445 localmarks[b] = node
445 writer(msg)
446 writer(msg)
446 localmarks.recordchange(tr)
447 localmarks.recordchange(tr)
447
448
448 def incoming(ui, repo, other):
449 def incoming(ui, repo, other):
449 '''Show bookmarks incoming from other to repo
450 '''Show bookmarks incoming from other to repo
450 '''
451 '''
451 ui.status(_("searching for changed bookmarks\n"))
452 ui.status(_("searching for changed bookmarks\n"))
452
453
453 r = compare(repo, other.listkeys('bookmarks'), repo._bookmarks,
454 r = compare(repo, other.listkeys('bookmarks'), repo._bookmarks,
454 dsthex=hex)
455 dsthex=hex)
455 addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
456 addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
456
457
457 incomings = []
458 incomings = []
458 if ui.debugflag:
459 if ui.debugflag:
459 getid = lambda id: id
460 getid = lambda id: id
460 else:
461 else:
461 getid = lambda id: id[:12]
462 getid = lambda id: id[:12]
462 if ui.verbose:
463 if ui.verbose:
463 def add(b, id, st):
464 def add(b, id, st):
464 incomings.append(" %-25s %s %s\n" % (b, getid(id), st))
465 incomings.append(" %-25s %s %s\n" % (b, getid(id), st))
465 else:
466 else:
466 def add(b, id, st):
467 def add(b, id, st):
467 incomings.append(" %-25s %s\n" % (b, getid(id)))
468 incomings.append(" %-25s %s\n" % (b, getid(id)))
468 for b, scid, dcid in addsrc:
469 for b, scid, dcid in addsrc:
469 # i18n: "added" refers to a bookmark
470 # i18n: "added" refers to a bookmark
470 add(b, scid, _('added'))
471 add(b, scid, _('added'))
471 for b, scid, dcid in advsrc:
472 for b, scid, dcid in advsrc:
472 # i18n: "advanced" refers to a bookmark
473 # i18n: "advanced" refers to a bookmark
473 add(b, scid, _('advanced'))
474 add(b, scid, _('advanced'))
474 for b, scid, dcid in diverge:
475 for b, scid, dcid in diverge:
475 # i18n: "diverged" refers to a bookmark
476 # i18n: "diverged" refers to a bookmark
476 add(b, scid, _('diverged'))
477 add(b, scid, _('diverged'))
477 for b, scid, dcid in differ:
478 for b, scid, dcid in differ:
478 # i18n: "changed" refers to a bookmark
479 # i18n: "changed" refers to a bookmark
479 add(b, scid, _('changed'))
480 add(b, scid, _('changed'))
480
481
481 if not incomings:
482 if not incomings:
482 ui.status(_("no changed bookmarks found\n"))
483 ui.status(_("no changed bookmarks found\n"))
483 return 1
484 return 1
484
485
485 for s in sorted(incomings):
486 for s in sorted(incomings):
486 ui.write(s)
487 ui.write(s)
487
488
488 return 0
489 return 0
489
490
490 def outgoing(ui, repo, other):
491 def outgoing(ui, repo, other):
491 '''Show bookmarks outgoing from repo to other
492 '''Show bookmarks outgoing from repo to other
492 '''
493 '''
493 ui.status(_("searching for changed bookmarks\n"))
494 ui.status(_("searching for changed bookmarks\n"))
494
495
495 r = compare(repo, repo._bookmarks, other.listkeys('bookmarks'),
496 r = compare(repo, repo._bookmarks, other.listkeys('bookmarks'),
496 srchex=hex)
497 srchex=hex)
497 addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
498 addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
498
499
499 outgoings = []
500 outgoings = []
500 if ui.debugflag:
501 if ui.debugflag:
501 getid = lambda id: id
502 getid = lambda id: id
502 else:
503 else:
503 getid = lambda id: id[:12]
504 getid = lambda id: id[:12]
504 if ui.verbose:
505 if ui.verbose:
505 def add(b, id, st):
506 def add(b, id, st):
506 outgoings.append(" %-25s %s %s\n" % (b, getid(id), st))
507 outgoings.append(" %-25s %s %s\n" % (b, getid(id), st))
507 else:
508 else:
508 def add(b, id, st):
509 def add(b, id, st):
509 outgoings.append(" %-25s %s\n" % (b, getid(id)))
510 outgoings.append(" %-25s %s\n" % (b, getid(id)))
510 for b, scid, dcid in addsrc:
511 for b, scid, dcid in addsrc:
511 # i18n: "added refers to a bookmark
512 # i18n: "added refers to a bookmark
512 add(b, scid, _('added'))
513 add(b, scid, _('added'))
513 for b, scid, dcid in adddst:
514 for b, scid, dcid in adddst:
514 # i18n: "deleted" refers to a bookmark
515 # i18n: "deleted" refers to a bookmark
515 add(b, ' ' * 40, _('deleted'))
516 add(b, ' ' * 40, _('deleted'))
516 for b, scid, dcid in advsrc:
517 for b, scid, dcid in advsrc:
517 # i18n: "advanced" refers to a bookmark
518 # i18n: "advanced" refers to a bookmark
518 add(b, scid, _('advanced'))
519 add(b, scid, _('advanced'))
519 for b, scid, dcid in diverge:
520 for b, scid, dcid in diverge:
520 # i18n: "diverged" refers to a bookmark
521 # i18n: "diverged" refers to a bookmark
521 add(b, scid, _('diverged'))
522 add(b, scid, _('diverged'))
522 for b, scid, dcid in differ:
523 for b, scid, dcid in differ:
523 # i18n: "changed" refers to a bookmark
524 # i18n: "changed" refers to a bookmark
524 add(b, scid, _('changed'))
525 add(b, scid, _('changed'))
525
526
526 if not outgoings:
527 if not outgoings:
527 ui.status(_("no changed bookmarks found\n"))
528 ui.status(_("no changed bookmarks found\n"))
528 return 1
529 return 1
529
530
530 for s in sorted(outgoings):
531 for s in sorted(outgoings):
531 ui.write(s)
532 ui.write(s)
532
533
533 return 0
534 return 0
534
535
535 def summary(repo, other):
536 def summary(repo, other):
536 '''Compare bookmarks between repo and other for "hg summary" output
537 '''Compare bookmarks between repo and other for "hg summary" output
537
538
538 This returns "(# of incoming, # of outgoing)" tuple.
539 This returns "(# of incoming, # of outgoing)" tuple.
539 '''
540 '''
540 r = compare(repo, other.listkeys('bookmarks'), repo._bookmarks,
541 r = compare(repo, other.listkeys('bookmarks'), repo._bookmarks,
541 dsthex=hex)
542 dsthex=hex)
542 addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
543 addsrc, adddst, advsrc, advdst, diverge, differ, invalid, same = r
543 return (len(addsrc), len(adddst))
544 return (len(addsrc), len(adddst))
544
545
545 def validdest(repo, old, new):
546 def validdest(repo, old, new):
546 """Is the new bookmark destination a valid update from the old one"""
547 """Is the new bookmark destination a valid update from the old one"""
547 repo = repo.unfiltered()
548 repo = repo.unfiltered()
548 if old == new:
549 if old == new:
549 # Old == new -> nothing to update.
550 # Old == new -> nothing to update.
550 return False
551 return False
551 elif not old:
552 elif not old:
552 # old is nullrev, anything is valid.
553 # old is nullrev, anything is valid.
553 # (new != nullrev has been excluded by the previous check)
554 # (new != nullrev has been excluded by the previous check)
554 return True
555 return True
555 elif repo.obsstore:
556 elif repo.obsstore:
556 return new.node() in obsolete.foreground(repo, [old.node()])
557 return new.node() in obsolete.foreground(repo, [old.node()])
557 else:
558 else:
558 # still an independent clause as it is lazier (and therefore faster)
559 # still an independent clause as it is lazier (and therefore faster)
559 return old.descendant(new)
560 return old.descendant(new)
@@ -1,929 +1,968 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}) [{tags} {bookmarks}] {desc|firstline}\n"
6 > logtemplate="{rev}:{node|short} ({phase}) [{tags} {bookmarks}] {desc|firstline}\n"
7 > [experimental]
7 > [experimental]
8 > # drop me once bundle2 is the default,
8 > # drop me once bundle2 is the default,
9 > # added to get test change early.
9 > # added to get test change early.
10 > bundle2-exp = True
10 > bundle2-exp = True
11 > EOF
11 > EOF
12 $ mkcommit() {
12 $ mkcommit() {
13 > echo "$1" > "$1"
13 > echo "$1" > "$1"
14 > hg add "$1"
14 > hg add "$1"
15 > hg ci -m "add $1"
15 > hg ci -m "add $1"
16 > }
16 > }
17 $ getid() {
17 $ getid() {
18 > hg log -T "{node}\n" --hidden -r "desc('$1')"
18 > hg log -T "{node}\n" --hidden -r "desc('$1')"
19 > }
19 > }
20
20
21 $ cat > debugkeys.py <<EOF
21 $ cat > debugkeys.py <<EOF
22 > def reposetup(ui, repo):
22 > def reposetup(ui, repo):
23 > class debugkeysrepo(repo.__class__):
23 > class debugkeysrepo(repo.__class__):
24 > def listkeys(self, namespace):
24 > def listkeys(self, namespace):
25 > ui.write('listkeys %s\n' % (namespace,))
25 > ui.write('listkeys %s\n' % (namespace,))
26 > return super(debugkeysrepo, self).listkeys(namespace)
26 > return super(debugkeysrepo, self).listkeys(namespace)
27 >
27 >
28 > if repo.local():
28 > if repo.local():
29 > repo.__class__ = debugkeysrepo
29 > repo.__class__ = debugkeysrepo
30 > EOF
30 > EOF
31
31
32 $ hg init tmpa
32 $ hg init tmpa
33 $ cd tmpa
33 $ cd tmpa
34 $ mkcommit kill_me
34 $ mkcommit kill_me
35
35
36 Checking that the feature is properly disabled
36 Checking that the feature is properly disabled
37
37
38 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
38 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
39 abort: creating obsolete markers is not enabled on this repo
39 abort: creating obsolete markers is not enabled on this repo
40 [255]
40 [255]
41
41
42 Enabling it
42 Enabling it
43
43
44 $ cat >> $HGRCPATH << EOF
44 $ cat >> $HGRCPATH << EOF
45 > [experimental]
45 > [experimental]
46 > evolution=createmarkers,exchange
46 > evolution=createmarkers,exchange
47 > EOF
47 > EOF
48
48
49 Killing a single changeset without replacement
49 Killing a single changeset without replacement
50
50
51 $ hg debugobsolete 0
51 $ hg debugobsolete 0
52 abort: changeset references must be full hexadecimal node identifiers
52 abort: changeset references must be full hexadecimal node identifiers
53 [255]
53 [255]
54 $ hg debugobsolete '00'
54 $ hg debugobsolete '00'
55 abort: changeset references must be full hexadecimal node identifiers
55 abort: changeset references must be full hexadecimal node identifiers
56 [255]
56 [255]
57 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
57 $ hg debugobsolete -d '0 0' `getid kill_me` -u babar
58 $ hg debugobsolete
58 $ hg debugobsolete
59 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'}
59 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'}
60
60
61 (test that mercurial is not confused)
61 (test that mercurial is not confused)
62
62
63 $ hg up null --quiet # having 0 as parent prevents it to be hidden
63 $ hg up null --quiet # having 0 as parent prevents it to be hidden
64 $ hg tip
64 $ hg tip
65 -1:000000000000 (public) [tip ]
65 -1:000000000000 (public) [tip ]
66 $ hg up --hidden tip --quiet
66 $ hg up --hidden tip --quiet
67
67
68 Killing a single changeset with itself should fail
68 Killing a single changeset with itself should fail
69 (simple local safeguard)
69 (simple local safeguard)
70
70
71 $ hg debugobsolete `getid kill_me` `getid kill_me`
71 $ hg debugobsolete `getid kill_me` `getid kill_me`
72 abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0
72 abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0
73 [255]
73 [255]
74
74
75 $ cd ..
75 $ cd ..
76
76
77 Killing a single changeset with replacement
77 Killing a single changeset with replacement
78 (and testing the format option)
78 (and testing the format option)
79
79
80 $ hg init tmpb
80 $ hg init tmpb
81 $ cd tmpb
81 $ cd tmpb
82 $ mkcommit a
82 $ mkcommit a
83 $ mkcommit b
83 $ mkcommit b
84 $ mkcommit original_c
84 $ mkcommit original_c
85 $ hg up "desc('b')"
85 $ hg up "desc('b')"
86 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
86 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
87 $ mkcommit new_c
87 $ mkcommit new_c
88 created new head
88 created new head
89 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
89 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
90 $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120'
90 $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120'
91 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
91 $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden
92 2:245bde4270cd add original_c
92 2:245bde4270cd add original_c
93 $ hg debugrevlog -cd
93 $ hg debugrevlog -cd
94 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
94 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
95 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0
95 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0
96 1 0 -1 59 118 59 59 0 0 58 116 0 1 0
96 1 0 -1 59 118 59 59 0 0 58 116 0 1 0
97 2 1 -1 118 193 118 118 59 0 76 192 0 1 0
97 2 1 -1 118 193 118 118 59 0 76 192 0 1 0
98 3 1 -1 193 260 193 193 59 0 66 258 0 2 0
98 3 1 -1 193 260 193 193 59 0 66 258 0 2 0
99 $ hg debugobsolete
99 $ hg debugobsolete
100 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
100 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
101
101
102 (check for version number of the obsstore)
102 (check for version number of the obsstore)
103
103
104 $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null
104 $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null
105 \x00 (no-eol) (esc)
105 \x00 (no-eol) (esc)
106
106
107 do it again (it read the obsstore before adding new changeset)
107 do it again (it read the obsstore before adding new changeset)
108
108
109 $ hg up '.^'
109 $ hg up '.^'
110 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
110 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
111 $ mkcommit new_2_c
111 $ mkcommit new_2_c
112 created new head
112 created new head
113 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
113 $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c`
114 $ hg debugobsolete
114 $ hg debugobsolete
115 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
115 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
116 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
116 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
117
117
118 Register two markers with a missing node
118 Register two markers with a missing node
119
119
120 $ hg up '.^'
120 $ hg up '.^'
121 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
121 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
122 $ mkcommit new_3_c
122 $ mkcommit new_3_c
123 created new head
123 created new head
124 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
124 $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337
125 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
125 $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c`
126 $ hg debugobsolete
126 $ hg debugobsolete
127 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
127 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
128 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
128 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
129 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
129 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
130 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
130 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
131
131
132 Refuse pathological nullid successors
132 Refuse pathological nullid successors
133 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
133 $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000
134 transaction abort!
134 transaction abort!
135 rollback completed
135 rollback completed
136 abort: bad obsolescence marker detected: invalid successors nullid
136 abort: bad obsolescence marker detected: invalid successors nullid
137 [255]
137 [255]
138
138
139 Check that graphlog detect that a changeset is obsolete:
139 Check that graphlog detect that a changeset is obsolete:
140
140
141 $ hg log -G
141 $ hg log -G
142 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
142 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
143 |
143 |
144 o 1:7c3bad9141dc (draft) [ ] add b
144 o 1:7c3bad9141dc (draft) [ ] add b
145 |
145 |
146 o 0:1f0dee641bb7 (draft) [ ] add a
146 o 0:1f0dee641bb7 (draft) [ ] add a
147
147
148
148
149 check that heads does not report them
149 check that heads does not report them
150
150
151 $ hg heads
151 $ hg heads
152 5:5601fb93a350 (draft) [tip ] add new_3_c
152 5:5601fb93a350 (draft) [tip ] add new_3_c
153 $ hg heads --hidden
153 $ hg heads --hidden
154 5:5601fb93a350 (draft) [tip ] add new_3_c
154 5:5601fb93a350 (draft) [tip ] add new_3_c
155 4:ca819180edb9 (draft) [ ] add new_2_c
155 4:ca819180edb9 (draft) [ ] add new_2_c
156 3:cdbce2fbb163 (draft) [ ] add new_c
156 3:cdbce2fbb163 (draft) [ ] add new_c
157 2:245bde4270cd (draft) [ ] add original_c
157 2:245bde4270cd (draft) [ ] add original_c
158
158
159
159
160 check that summary does not report them
160 check that summary does not report them
161
161
162 $ hg init ../sink
162 $ hg init ../sink
163 $ echo '[paths]' >> .hg/hgrc
163 $ echo '[paths]' >> .hg/hgrc
164 $ echo 'default=../sink' >> .hg/hgrc
164 $ echo 'default=../sink' >> .hg/hgrc
165 $ hg summary --remote
165 $ hg summary --remote
166 parent: 5:5601fb93a350 tip
166 parent: 5:5601fb93a350 tip
167 add new_3_c
167 add new_3_c
168 branch: default
168 branch: default
169 commit: (clean)
169 commit: (clean)
170 update: (current)
170 update: (current)
171 phases: 3 draft
171 phases: 3 draft
172 remote: 3 outgoing
172 remote: 3 outgoing
173
173
174 $ hg summary --remote --hidden
174 $ hg summary --remote --hidden
175 parent: 5:5601fb93a350 tip
175 parent: 5:5601fb93a350 tip
176 add new_3_c
176 add new_3_c
177 branch: default
177 branch: default
178 commit: (clean)
178 commit: (clean)
179 update: 3 new changesets, 4 branch heads (merge)
179 update: 3 new changesets, 4 branch heads (merge)
180 phases: 6 draft
180 phases: 6 draft
181 remote: 3 outgoing
181 remote: 3 outgoing
182
182
183 check that various commands work well with filtering
183 check that various commands work well with filtering
184
184
185 $ hg tip
185 $ hg tip
186 5:5601fb93a350 (draft) [tip ] add new_3_c
186 5:5601fb93a350 (draft) [tip ] add new_3_c
187 $ hg log -r 6
187 $ hg log -r 6
188 abort: unknown revision '6'!
188 abort: unknown revision '6'!
189 [255]
189 [255]
190 $ hg log -r 4
190 $ hg log -r 4
191 abort: hidden revision '4'!
191 abort: hidden revision '4'!
192 (use --hidden to access hidden revisions)
192 (use --hidden to access hidden revisions)
193 [255]
193 [255]
194 $ hg debugrevspec 'rev(6)'
194 $ hg debugrevspec 'rev(6)'
195 $ hg debugrevspec 'rev(4)'
195 $ hg debugrevspec 'rev(4)'
196 $ hg debugrevspec 'null'
196 $ hg debugrevspec 'null'
197 -1
197 -1
198
198
199 Check that public changeset are not accounted as obsolete:
199 Check that public changeset are not accounted as obsolete:
200
200
201 $ hg --hidden phase --public 2
201 $ hg --hidden phase --public 2
202 $ hg log -G
202 $ hg log -G
203 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
203 @ 5:5601fb93a350 (draft) [tip ] add new_3_c
204 |
204 |
205 | o 2:245bde4270cd (public) [ ] add original_c
205 | o 2:245bde4270cd (public) [ ] add original_c
206 |/
206 |/
207 o 1:7c3bad9141dc (public) [ ] add b
207 o 1:7c3bad9141dc (public) [ ] add b
208 |
208 |
209 o 0:1f0dee641bb7 (public) [ ] add a
209 o 0:1f0dee641bb7 (public) [ ] add a
210
210
211
211
212 And that bumped changeset are detected
212 And that bumped changeset are detected
213 --------------------------------------
213 --------------------------------------
214
214
215 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
215 If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also
216 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
216 note that the bumped changeset (5:5601fb93a350) is not a direct successor of
217 the public changeset
217 the public changeset
218
218
219 $ hg log --hidden -r 'bumped()'
219 $ hg log --hidden -r 'bumped()'
220 5:5601fb93a350 (draft) [tip ] add new_3_c
220 5:5601fb93a350 (draft) [tip ] add new_3_c
221
221
222 And that we can't push bumped changeset
222 And that we can't push bumped changeset
223
223
224 $ hg push ../tmpa -r 0 --force #(make repo related)
224 $ hg push ../tmpa -r 0 --force #(make repo related)
225 pushing to ../tmpa
225 pushing to ../tmpa
226 searching for changes
226 searching for changes
227 warning: repository is unrelated
227 warning: repository is unrelated
228 adding changesets
228 adding changesets
229 adding manifests
229 adding manifests
230 adding file changes
230 adding file changes
231 added 1 changesets with 1 changes to 1 files (+1 heads)
231 added 1 changesets with 1 changes to 1 files (+1 heads)
232 $ hg push ../tmpa
232 $ hg push ../tmpa
233 pushing to ../tmpa
233 pushing to ../tmpa
234 searching for changes
234 searching for changes
235 abort: push includes bumped changeset: 5601fb93a350!
235 abort: push includes bumped changeset: 5601fb93a350!
236 [255]
236 [255]
237
237
238 Fixing "bumped" situation
238 Fixing "bumped" situation
239 We need to create a clone of 5 and add a special marker with a flag
239 We need to create a clone of 5 and add a special marker with a flag
240
240
241 $ hg up '5^'
241 $ hg up '5^'
242 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
242 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
243 $ hg revert -ar 5
243 $ hg revert -ar 5
244 adding new_3_c
244 adding new_3_c
245 $ hg ci -m 'add n3w_3_c'
245 $ hg ci -m 'add n3w_3_c'
246 created new head
246 created new head
247 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
247 $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c`
248 $ hg log -r 'bumped()'
248 $ hg log -r 'bumped()'
249 $ hg log -G
249 $ hg log -G
250 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
250 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
251 |
251 |
252 | o 2:245bde4270cd (public) [ ] add original_c
252 | o 2:245bde4270cd (public) [ ] add original_c
253 |/
253 |/
254 o 1:7c3bad9141dc (public) [ ] add b
254 o 1:7c3bad9141dc (public) [ ] add b
255 |
255 |
256 o 0:1f0dee641bb7 (public) [ ] add a
256 o 0:1f0dee641bb7 (public) [ ] add a
257
257
258
258
259 $ cd ..
259 $ cd ..
260
260
261 Revision 0 is hidden
261 Revision 0 is hidden
262 --------------------
262 --------------------
263
263
264 $ hg init rev0hidden
264 $ hg init rev0hidden
265 $ cd rev0hidden
265 $ cd rev0hidden
266
266
267 $ mkcommit kill0
267 $ mkcommit kill0
268 $ hg up -q null
268 $ hg up -q null
269 $ hg debugobsolete `getid kill0`
269 $ hg debugobsolete `getid kill0`
270 $ mkcommit a
270 $ mkcommit a
271 $ mkcommit b
271 $ mkcommit b
272
272
273 Should pick the first visible revision as "repo" node
273 Should pick the first visible revision as "repo" node
274
274
275 $ hg archive ../archive-null
275 $ hg archive ../archive-null
276 $ cat ../archive-null/.hg_archival.txt
276 $ cat ../archive-null/.hg_archival.txt
277 repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e
277 repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e
278 node: 7c3bad9141dcb46ff89abf5f61856facd56e476c
278 node: 7c3bad9141dcb46ff89abf5f61856facd56e476c
279 branch: default
279 branch: default
280 latesttag: null
280 latesttag: null
281 latesttagdistance: 2
281 latesttagdistance: 2
282 changessincelatesttag: 2
282 changessincelatesttag: 2
283
283
284
284
285 $ cd ..
285 $ cd ..
286
286
287 Exchange Test
287 Exchange Test
288 ============================
288 ============================
289
289
290 Destination repo does not have any data
290 Destination repo does not have any data
291 ---------------------------------------
291 ---------------------------------------
292
292
293 Simple incoming test
293 Simple incoming test
294
294
295 $ hg init tmpc
295 $ hg init tmpc
296 $ cd tmpc
296 $ cd tmpc
297 $ hg incoming ../tmpb
297 $ hg incoming ../tmpb
298 comparing with ../tmpb
298 comparing with ../tmpb
299 0:1f0dee641bb7 (public) [ ] add a
299 0:1f0dee641bb7 (public) [ ] add a
300 1:7c3bad9141dc (public) [ ] add b
300 1:7c3bad9141dc (public) [ ] add b
301 2:245bde4270cd (public) [ ] add original_c
301 2:245bde4270cd (public) [ ] add original_c
302 6:6f9641995072 (draft) [tip ] add n3w_3_c
302 6:6f9641995072 (draft) [tip ] add n3w_3_c
303
303
304 Try to pull markers
304 Try to pull markers
305 (extinct changeset are excluded but marker are pushed)
305 (extinct changeset are excluded but marker are pushed)
306
306
307 $ hg pull ../tmpb
307 $ hg pull ../tmpb
308 pulling from ../tmpb
308 pulling from ../tmpb
309 requesting all changes
309 requesting all changes
310 adding changesets
310 adding changesets
311 adding manifests
311 adding manifests
312 adding file changes
312 adding file changes
313 added 4 changesets with 4 changes to 4 files (+1 heads)
313 added 4 changesets with 4 changes to 4 files (+1 heads)
314 5 new obsolescence markers
314 5 new obsolescence markers
315 (run 'hg heads' to see heads, 'hg merge' to merge)
315 (run 'hg heads' to see heads, 'hg merge' to merge)
316 $ hg debugobsolete
316 $ hg debugobsolete
317 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
317 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
318 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
318 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
319 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
319 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
320 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
320 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
321 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
321 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
322
322
323 Rollback//Transaction support
323 Rollback//Transaction support
324
324
325 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
325 $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
326 $ hg debugobsolete
326 $ hg debugobsolete
327 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
327 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
328 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
328 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
329 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
329 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
330 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
330 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
331 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
331 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
332 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'}
332 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'}
333 $ hg rollback -n
333 $ hg rollback -n
334 repository tip rolled back to revision 3 (undo debugobsolete)
334 repository tip rolled back to revision 3 (undo debugobsolete)
335 $ hg rollback
335 $ hg rollback
336 repository tip rolled back to revision 3 (undo debugobsolete)
336 repository tip rolled back to revision 3 (undo debugobsolete)
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
343
344 $ cd ..
344 $ cd ..
345
345
346 Try to push markers
346 Try to push markers
347
347
348 $ hg init tmpd
348 $ hg init tmpd
349 $ hg -R tmpb push tmpd
349 $ hg -R tmpb push tmpd
350 pushing to tmpd
350 pushing to tmpd
351 searching for changes
351 searching for changes
352 adding changesets
352 adding changesets
353 adding manifests
353 adding manifests
354 adding file changes
354 adding file changes
355 added 4 changesets with 4 changes to 4 files (+1 heads)
355 added 4 changesets with 4 changes to 4 files (+1 heads)
356 5 new obsolescence markers
356 5 new obsolescence markers
357 $ hg -R tmpd debugobsolete | sort
357 $ hg -R tmpd debugobsolete | sort
358 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
358 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
359 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
359 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
360 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
360 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
361 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
361 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
362 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
362 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
363
363
364 Check obsolete keys are exchanged only if source has an obsolete store
364 Check obsolete keys are exchanged only if source has an obsolete store
365
365
366 $ hg init empty
366 $ hg init empty
367 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
367 $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd
368 pushing to tmpd
368 pushing to tmpd
369 listkeys phases
369 listkeys phases
370 listkeys bookmarks
370 listkeys bookmarks
371 no changes found
371 no changes found
372 listkeys phases
372 listkeys phases
373 [1]
373 [1]
374
374
375 clone support
375 clone support
376 (markers are copied and extinct changesets are included to allow hardlinks)
376 (markers are copied and extinct changesets are included to allow hardlinks)
377
377
378 $ hg clone tmpb clone-dest
378 $ hg clone tmpb clone-dest
379 updating to branch default
379 updating to branch default
380 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
381 $ hg -R clone-dest log -G --hidden
381 $ hg -R clone-dest log -G --hidden
382 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
382 @ 6:6f9641995072 (draft) [tip ] add n3w_3_c
383 |
383 |
384 | x 5:5601fb93a350 (draft) [ ] add new_3_c
384 | x 5:5601fb93a350 (draft) [ ] add new_3_c
385 |/
385 |/
386 | x 4:ca819180edb9 (draft) [ ] add new_2_c
386 | x 4:ca819180edb9 (draft) [ ] add new_2_c
387 |/
387 |/
388 | x 3:cdbce2fbb163 (draft) [ ] add new_c
388 | x 3:cdbce2fbb163 (draft) [ ] add new_c
389 |/
389 |/
390 | o 2:245bde4270cd (public) [ ] add original_c
390 | o 2:245bde4270cd (public) [ ] add original_c
391 |/
391 |/
392 o 1:7c3bad9141dc (public) [ ] add b
392 o 1:7c3bad9141dc (public) [ ] add b
393 |
393 |
394 o 0:1f0dee641bb7 (public) [ ] add a
394 o 0:1f0dee641bb7 (public) [ ] add a
395
395
396 $ hg -R clone-dest debugobsolete
396 $ hg -R clone-dest debugobsolete
397 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
397 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
398 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
398 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
399 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
399 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
400 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
400 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
401 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
401 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
402
402
403
403
404 Destination repo have existing data
404 Destination repo have existing data
405 ---------------------------------------
405 ---------------------------------------
406
406
407 On pull
407 On pull
408
408
409 $ hg init tmpe
409 $ hg init tmpe
410 $ cd tmpe
410 $ cd tmpe
411 $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00
411 $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00
412 $ hg pull ../tmpb
412 $ hg pull ../tmpb
413 pulling from ../tmpb
413 pulling from ../tmpb
414 requesting all changes
414 requesting all changes
415 adding changesets
415 adding changesets
416 adding manifests
416 adding manifests
417 adding file changes
417 adding file changes
418 added 4 changesets with 4 changes to 4 files (+1 heads)
418 added 4 changesets with 4 changes to 4 files (+1 heads)
419 5 new obsolescence markers
419 5 new obsolescence markers
420 (run 'hg heads' to see heads, 'hg merge' to merge)
420 (run 'hg heads' to see heads, 'hg merge' to merge)
421 $ hg debugobsolete
421 $ hg debugobsolete
422 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
422 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
423 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
423 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
424 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
424 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
425 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
425 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
426 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
426 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
427 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
427 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
428
428
429
429
430 On push
430 On push
431
431
432 $ hg push ../tmpc
432 $ hg push ../tmpc
433 pushing to ../tmpc
433 pushing to ../tmpc
434 searching for changes
434 searching for changes
435 no changes found
435 no changes found
436 1 new obsolescence markers
436 1 new obsolescence markers
437 [1]
437 [1]
438 $ hg -R ../tmpc debugobsolete
438 $ hg -R ../tmpc debugobsolete
439 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
439 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
440 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
440 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
441 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
441 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
442 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
442 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
443 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
443 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
444 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
444 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
445
445
446 detect outgoing obsolete and unstable
446 detect outgoing obsolete and unstable
447 ---------------------------------------
447 ---------------------------------------
448
448
449
449
450 $ hg log -G
450 $ hg log -G
451 o 3:6f9641995072 (draft) [tip ] add n3w_3_c
451 o 3:6f9641995072 (draft) [tip ] add n3w_3_c
452 |
452 |
453 | o 2:245bde4270cd (public) [ ] add original_c
453 | o 2:245bde4270cd (public) [ ] add original_c
454 |/
454 |/
455 o 1:7c3bad9141dc (public) [ ] add b
455 o 1:7c3bad9141dc (public) [ ] add b
456 |
456 |
457 o 0:1f0dee641bb7 (public) [ ] add a
457 o 0:1f0dee641bb7 (public) [ ] add a
458
458
459 $ hg up 'desc("n3w_3_c")'
459 $ hg up 'desc("n3w_3_c")'
460 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
460 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
461 $ mkcommit original_d
461 $ mkcommit original_d
462 $ mkcommit original_e
462 $ mkcommit original_e
463 $ hg debugobsolete --record-parents `getid original_d` -d '0 0'
463 $ hg debugobsolete --record-parents `getid original_d` -d '0 0'
464 $ hg debugobsolete | grep `getid original_d`
464 $ hg debugobsolete | grep `getid original_d`
465 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
465 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
466 $ hg log -r 'obsolete()'
466 $ hg log -r 'obsolete()'
467 4:94b33453f93b (draft) [ ] add original_d
467 4:94b33453f93b (draft) [ ] add original_d
468 $ hg log -G -r '::unstable()'
468 $ hg log -G -r '::unstable()'
469 @ 5:cda648ca50f5 (draft) [tip ] add original_e
469 @ 5:cda648ca50f5 (draft) [tip ] add original_e
470 |
470 |
471 x 4:94b33453f93b (draft) [ ] add original_d
471 x 4:94b33453f93b (draft) [ ] add original_d
472 |
472 |
473 o 3:6f9641995072 (draft) [ ] add n3w_3_c
473 o 3:6f9641995072 (draft) [ ] add n3w_3_c
474 |
474 |
475 o 1:7c3bad9141dc (public) [ ] add b
475 o 1:7c3bad9141dc (public) [ ] add b
476 |
476 |
477 o 0:1f0dee641bb7 (public) [ ] add a
477 o 0:1f0dee641bb7 (public) [ ] add a
478
478
479
479
480 refuse to push obsolete changeset
480 refuse to push obsolete changeset
481
481
482 $ hg push ../tmpc/ -r 'desc("original_d")'
482 $ hg push ../tmpc/ -r 'desc("original_d")'
483 pushing to ../tmpc/
483 pushing to ../tmpc/
484 searching for changes
484 searching for changes
485 abort: push includes obsolete changeset: 94b33453f93b!
485 abort: push includes obsolete changeset: 94b33453f93b!
486 [255]
486 [255]
487
487
488 refuse to push unstable changeset
488 refuse to push unstable changeset
489
489
490 $ hg push ../tmpc/
490 $ hg push ../tmpc/
491 pushing to ../tmpc/
491 pushing to ../tmpc/
492 searching for changes
492 searching for changes
493 abort: push includes unstable changeset: cda648ca50f5!
493 abort: push includes unstable changeset: cda648ca50f5!
494 [255]
494 [255]
495
495
496 Test that extinct changeset are properly detected
496 Test that extinct changeset are properly detected
497
497
498 $ hg log -r 'extinct()'
498 $ hg log -r 'extinct()'
499
499
500 Don't try to push extinct changeset
500 Don't try to push extinct changeset
501
501
502 $ hg init ../tmpf
502 $ hg init ../tmpf
503 $ hg out ../tmpf
503 $ hg out ../tmpf
504 comparing with ../tmpf
504 comparing with ../tmpf
505 searching for changes
505 searching for changes
506 0:1f0dee641bb7 (public) [ ] add a
506 0:1f0dee641bb7 (public) [ ] add a
507 1:7c3bad9141dc (public) [ ] add b
507 1:7c3bad9141dc (public) [ ] add b
508 2:245bde4270cd (public) [ ] add original_c
508 2:245bde4270cd (public) [ ] add original_c
509 3:6f9641995072 (draft) [ ] add n3w_3_c
509 3:6f9641995072 (draft) [ ] add n3w_3_c
510 4:94b33453f93b (draft) [ ] add original_d
510 4:94b33453f93b (draft) [ ] add original_d
511 5:cda648ca50f5 (draft) [tip ] add original_e
511 5:cda648ca50f5 (draft) [tip ] add original_e
512 $ hg push ../tmpf -f # -f because be push unstable too
512 $ hg push ../tmpf -f # -f because be push unstable too
513 pushing to ../tmpf
513 pushing to ../tmpf
514 searching for changes
514 searching for changes
515 adding changesets
515 adding changesets
516 adding manifests
516 adding manifests
517 adding file changes
517 adding file changes
518 added 6 changesets with 6 changes to 6 files (+1 heads)
518 added 6 changesets with 6 changes to 6 files (+1 heads)
519 7 new obsolescence markers
519 7 new obsolescence markers
520
520
521 no warning displayed
521 no warning displayed
522
522
523 $ hg push ../tmpf
523 $ hg push ../tmpf
524 pushing to ../tmpf
524 pushing to ../tmpf
525 searching for changes
525 searching for changes
526 no changes found
526 no changes found
527 [1]
527 [1]
528
528
529 Do not warn about new head when the new head is a successors of a remote one
529 Do not warn about new head when the new head is a successors of a remote one
530
530
531 $ hg log -G
531 $ hg log -G
532 @ 5:cda648ca50f5 (draft) [tip ] add original_e
532 @ 5:cda648ca50f5 (draft) [tip ] add original_e
533 |
533 |
534 x 4:94b33453f93b (draft) [ ] add original_d
534 x 4:94b33453f93b (draft) [ ] add original_d
535 |
535 |
536 o 3:6f9641995072 (draft) [ ] add n3w_3_c
536 o 3:6f9641995072 (draft) [ ] add n3w_3_c
537 |
537 |
538 | o 2:245bde4270cd (public) [ ] add original_c
538 | o 2:245bde4270cd (public) [ ] add original_c
539 |/
539 |/
540 o 1:7c3bad9141dc (public) [ ] add b
540 o 1:7c3bad9141dc (public) [ ] add b
541 |
541 |
542 o 0:1f0dee641bb7 (public) [ ] add a
542 o 0:1f0dee641bb7 (public) [ ] add a
543
543
544 $ hg up -q 'desc(n3w_3_c)'
544 $ hg up -q 'desc(n3w_3_c)'
545 $ mkcommit obsolete_e
545 $ mkcommit obsolete_e
546 created new head
546 created new head
547 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
547 $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'`
548 $ hg outgoing ../tmpf # parasite hg outgoing testin
548 $ hg outgoing ../tmpf # parasite hg outgoing testin
549 comparing with ../tmpf
549 comparing with ../tmpf
550 searching for changes
550 searching for changes
551 6:3de5eca88c00 (draft) [tip ] add obsolete_e
551 6:3de5eca88c00 (draft) [tip ] add obsolete_e
552 $ hg push ../tmpf
552 $ hg push ../tmpf
553 pushing to ../tmpf
553 pushing to ../tmpf
554 searching for changes
554 searching for changes
555 adding changesets
555 adding changesets
556 adding manifests
556 adding manifests
557 adding file changes
557 adding file changes
558 added 1 changesets with 1 changes to 1 files (+1 heads)
558 added 1 changesets with 1 changes to 1 files (+1 heads)
559 1 new obsolescence markers
559 1 new obsolescence markers
560
560
561 test relevance computation
561 test relevance computation
562 ---------------------------------------
562 ---------------------------------------
563
563
564 Checking simple case of "marker relevance".
564 Checking simple case of "marker relevance".
565
565
566
566
567 Reminder of the repo situation
567 Reminder of the repo situation
568
568
569 $ hg log --hidden --graph
569 $ hg log --hidden --graph
570 @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e
570 @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e
571 |
571 |
572 | x 5:cda648ca50f5 (draft) [ ] add original_e
572 | x 5:cda648ca50f5 (draft) [ ] add original_e
573 | |
573 | |
574 | x 4:94b33453f93b (draft) [ ] add original_d
574 | x 4:94b33453f93b (draft) [ ] add original_d
575 |/
575 |/
576 o 3:6f9641995072 (draft) [ ] add n3w_3_c
576 o 3:6f9641995072 (draft) [ ] add n3w_3_c
577 |
577 |
578 | o 2:245bde4270cd (public) [ ] add original_c
578 | o 2:245bde4270cd (public) [ ] add original_c
579 |/
579 |/
580 o 1:7c3bad9141dc (public) [ ] add b
580 o 1:7c3bad9141dc (public) [ ] add b
581 |
581 |
582 o 0:1f0dee641bb7 (public) [ ] add a
582 o 0:1f0dee641bb7 (public) [ ] add a
583
583
584
584
585 List of all markers
585 List of all markers
586
586
587 $ hg debugobsolete
587 $ hg debugobsolete
588 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
588 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
589 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
589 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
590 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
590 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
591 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
591 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
592 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
592 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
593 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
593 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
594 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
594 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
595 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
595 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
596
596
597 List of changesets with no chain
597 List of changesets with no chain
598
598
599 $ hg debugobsolete --hidden --rev ::2
599 $ hg debugobsolete --hidden --rev ::2
600
600
601 List of changesets that are included on marker chain
601 List of changesets that are included on marker chain
602
602
603 $ hg debugobsolete --hidden --rev 6
603 $ hg debugobsolete --hidden --rev 6
604 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
604 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
605
605
606 List of changesets with a longer chain, (including a pruned children)
606 List of changesets with a longer chain, (including a pruned children)
607
607
608 $ hg debugobsolete --hidden --rev 3
608 $ hg debugobsolete --hidden --rev 3
609 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
609 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
610 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
610 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
611 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
611 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
612 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
612 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 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 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
614 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
615 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
615 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
616
616
617 List of both
617 List of both
618
618
619 $ hg debugobsolete --hidden --rev 3::6
619 $ hg debugobsolete --hidden --rev 3::6
620 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
620 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
621 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
621 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'}
622 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
622 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'}
623 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
623 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
624 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
624 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
625 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
625 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'}
626 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
626 cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob)
627 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
627 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'}
628
628
629 #if serve
629 #if serve
630
630
631 Test the debug output for exchange
631 Test the debug output for exchange
632 ----------------------------------
632 ----------------------------------
633
633
634 $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' --config 'experimental.bundle2-exp=True'
634 $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' --config 'experimental.bundle2-exp=True'
635 pulling from ../tmpb
635 pulling from ../tmpb
636 searching for changes
636 searching for changes
637 no changes found
637 no changes found
638 obsmarker-exchange: 346 bytes received
638 obsmarker-exchange: 346 bytes received
639
639
640 check hgweb does not explode
640 check hgweb does not explode
641 ====================================
641 ====================================
642
642
643 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
643 $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg
644 adding changesets
644 adding changesets
645 adding manifests
645 adding manifests
646 adding file changes
646 adding file changes
647 added 62 changesets with 63 changes to 9 files (+60 heads)
647 added 62 changesets with 63 changes to 9 files (+60 heads)
648 (run 'hg heads .' to see heads, 'hg merge' to merge)
648 (run 'hg heads .' to see heads, 'hg merge' to merge)
649 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
649 $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`;
650 > do
650 > do
651 > hg debugobsolete $node
651 > hg debugobsolete $node
652 > done
652 > done
653 $ hg up tip
653 $ hg up tip
654 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
654 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
655
655
656 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
656 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
657 $ cat hg.pid >> $DAEMON_PIDS
657 $ cat hg.pid >> $DAEMON_PIDS
658
658
659 check changelog view
659 check changelog view
660
660
661 $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/'
661 $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/'
662 200 Script output follows
662 200 Script output follows
663
663
664 check graph view
664 check graph view
665
665
666 $ get-with-headers.py --headeronly localhost:$HGPORT 'graph'
666 $ get-with-headers.py --headeronly localhost:$HGPORT 'graph'
667 200 Script output follows
667 200 Script output follows
668
668
669 check filelog view
669 check filelog view
670
670
671 $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar'
671 $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar'
672 200 Script output follows
672 200 Script output follows
673
673
674 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68'
674 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68'
675 200 Script output follows
675 200 Script output follows
676 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
676 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
677 404 Not Found
677 404 Not Found
678 [1]
678 [1]
679
679
680 check that web.view config option:
680 check that web.view config option:
681
681
682 $ killdaemons.py hg.pid
682 $ killdaemons.py hg.pid
683 $ cat >> .hg/hgrc << EOF
683 $ cat >> .hg/hgrc << EOF
684 > [web]
684 > [web]
685 > view=all
685 > view=all
686 > EOF
686 > EOF
687 $ wait
687 $ wait
688 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
688 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
689 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
689 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67'
690 200 Script output follows
690 200 Script output follows
691 $ killdaemons.py hg.pid
691 $ killdaemons.py hg.pid
692
692
693 Checking _enable=False warning if obsolete marker exists
693 Checking _enable=False warning if obsolete marker exists
694
694
695 $ echo '[experimental]' >> $HGRCPATH
695 $ echo '[experimental]' >> $HGRCPATH
696 $ echo "evolution=" >> $HGRCPATH
696 $ echo "evolution=" >> $HGRCPATH
697 $ hg log -r tip
697 $ hg log -r tip
698 obsolete feature not enabled but 68 markers found!
698 obsolete feature not enabled but 68 markers found!
699 68:c15e9edfca13 (draft) [tip ] add celestine
699 68:c15e9edfca13 (draft) [tip ] add celestine
700
700
701 reenable for later test
701 reenable for later test
702
702
703 $ echo '[experimental]' >> $HGRCPATH
703 $ echo '[experimental]' >> $HGRCPATH
704 $ echo "evolution=createmarkers,exchange" >> $HGRCPATH
704 $ echo "evolution=createmarkers,exchange" >> $HGRCPATH
705
705
706 #endif
706 #endif
707
707
708 Test incoming/outcoming with changesets obsoleted remotely, known locally
708 Test incoming/outcoming with changesets obsoleted remotely, known locally
709 ===============================================================================
709 ===============================================================================
710
710
711 This test issue 3805
711 This test issue 3805
712
712
713 $ hg init repo-issue3805
713 $ hg init repo-issue3805
714 $ cd repo-issue3805
714 $ cd repo-issue3805
715 $ echo "foo" > foo
715 $ echo "foo" > foo
716 $ hg ci -Am "A"
716 $ hg ci -Am "A"
717 adding foo
717 adding foo
718 $ hg clone . ../other-issue3805
718 $ hg clone . ../other-issue3805
719 updating to branch default
719 updating to branch default
720 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
720 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
721 $ echo "bar" >> foo
721 $ echo "bar" >> foo
722 $ hg ci --amend
722 $ hg ci --amend
723 $ cd ../other-issue3805
723 $ cd ../other-issue3805
724 $ hg log -G
724 $ hg log -G
725 @ 0:193e9254ce7e (draft) [tip ] A
725 @ 0:193e9254ce7e (draft) [tip ] A
726
726
727 $ hg log -G -R ../repo-issue3805
727 $ hg log -G -R ../repo-issue3805
728 @ 2:3816541e5485 (draft) [tip ] A
728 @ 2:3816541e5485 (draft) [tip ] A
729
729
730 $ hg incoming
730 $ hg incoming
731 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
731 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
732 searching for changes
732 searching for changes
733 2:3816541e5485 (draft) [tip ] A
733 2:3816541e5485 (draft) [tip ] A
734 $ hg incoming --bundle ../issue3805.hg
734 $ hg incoming --bundle ../issue3805.hg
735 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
735 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
736 searching for changes
736 searching for changes
737 2:3816541e5485 (draft) [tip ] A
737 2:3816541e5485 (draft) [tip ] A
738 $ hg outgoing
738 $ hg outgoing
739 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
739 comparing with $TESTTMP/tmpe/repo-issue3805 (glob)
740 searching for changes
740 searching for changes
741 no changes found
741 no changes found
742 [1]
742 [1]
743
743
744 #if serve
744 #if serve
745
745
746 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
746 $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
747 $ cat hg.pid >> $DAEMON_PIDS
747 $ cat hg.pid >> $DAEMON_PIDS
748
748
749 $ hg incoming http://localhost:$HGPORT
749 $ hg incoming http://localhost:$HGPORT
750 comparing with http://localhost:$HGPORT/
750 comparing with http://localhost:$HGPORT/
751 searching for changes
751 searching for changes
752 1:3816541e5485 (draft) [tip ] A
752 1:3816541e5485 (draft) [tip ] A
753 $ hg outgoing http://localhost:$HGPORT
753 $ hg outgoing http://localhost:$HGPORT
754 comparing with http://localhost:$HGPORT/
754 comparing with http://localhost:$HGPORT/
755 searching for changes
755 searching for changes
756 no changes found
756 no changes found
757 [1]
757 [1]
758
758
759 $ killdaemons.py
759 $ killdaemons.py
760
760
761 #endif
761 #endif
762
762
763 This test issue 3814
763 This test issue 3814
764
764
765 (nothing to push but locally hidden changeset)
765 (nothing to push but locally hidden changeset)
766
766
767 $ cd ..
767 $ cd ..
768 $ hg init repo-issue3814
768 $ hg init repo-issue3814
769 $ cd repo-issue3805
769 $ cd repo-issue3805
770 $ hg push -r 3816541e5485 ../repo-issue3814
770 $ hg push -r 3816541e5485 ../repo-issue3814
771 pushing to ../repo-issue3814
771 pushing to ../repo-issue3814
772 searching for changes
772 searching for changes
773 adding changesets
773 adding changesets
774 adding manifests
774 adding manifests
775 adding file changes
775 adding file changes
776 added 1 changesets with 1 changes to 1 files
776 added 1 changesets with 1 changes to 1 files
777 2 new obsolescence markers
777 2 new obsolescence markers
778 $ hg out ../repo-issue3814
778 $ hg out ../repo-issue3814
779 comparing with ../repo-issue3814
779 comparing with ../repo-issue3814
780 searching for changes
780 searching for changes
781 no changes found
781 no changes found
782 [1]
782 [1]
783
783
784 Test that a local tag blocks a changeset from being hidden
784 Test that a local tag blocks a changeset from being hidden
785
785
786 $ hg tag -l visible -r 0 --hidden
786 $ hg tag -l visible -r 0 --hidden
787 $ hg log -G
787 $ hg log -G
788 @ 2:3816541e5485 (draft) [tip ] A
788 @ 2:3816541e5485 (draft) [tip ] A
789
789
790 x 0:193e9254ce7e (draft) [visible ] A
790 x 0:193e9254ce7e (draft) [visible ] A
791
791
792 Test that removing a local tag does not cause some commands to fail
792 Test that removing a local tag does not cause some commands to fail
793
793
794 $ hg tag -l -r tip tiptag
794 $ hg tag -l -r tip tiptag
795 $ hg tags
795 $ hg tags
796 tiptag 2:3816541e5485
796 tiptag 2:3816541e5485
797 tip 2:3816541e5485
797 tip 2:3816541e5485
798 visible 0:193e9254ce7e
798 visible 0:193e9254ce7e
799 $ hg --config extensions.strip= strip -r tip --no-backup
799 $ hg --config extensions.strip= strip -r tip --no-backup
800 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
800 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
801 $ hg tags
801 $ hg tags
802 visible 0:193e9254ce7e
802 visible 0:193e9254ce7e
803 tip 0:193e9254ce7e
803 tip 0:193e9254ce7e
804
804
805 Test bundle overlay onto hidden revision
805 Test bundle overlay onto hidden revision
806
806
807 $ cd ..
807 $ cd ..
808 $ hg init repo-bundleoverlay
808 $ hg init repo-bundleoverlay
809 $ cd repo-bundleoverlay
809 $ cd repo-bundleoverlay
810 $ echo "A" > foo
810 $ echo "A" > foo
811 $ hg ci -Am "A"
811 $ hg ci -Am "A"
812 adding foo
812 adding foo
813 $ echo "B" >> foo
813 $ echo "B" >> foo
814 $ hg ci -m "B"
814 $ hg ci -m "B"
815 $ hg up 0
815 $ hg up 0
816 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
816 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
817 $ echo "C" >> foo
817 $ echo "C" >> foo
818 $ hg ci -m "C"
818 $ hg ci -m "C"
819 created new head
819 created new head
820 $ hg log -G
820 $ hg log -G
821 @ 2:c186d7714947 (draft) [tip ] C
821 @ 2:c186d7714947 (draft) [tip ] C
822 |
822 |
823 | o 1:44526ebb0f98 (draft) [ ] B
823 | o 1:44526ebb0f98 (draft) [ ] B
824 |/
824 |/
825 o 0:4b34ecfb0d56 (draft) [ ] A
825 o 0:4b34ecfb0d56 (draft) [ ] A
826
826
827
827
828 $ hg clone -r1 . ../other-bundleoverlay
828 $ hg clone -r1 . ../other-bundleoverlay
829 adding changesets
829 adding changesets
830 adding manifests
830 adding manifests
831 adding file changes
831 adding file changes
832 added 2 changesets with 2 changes to 1 files
832 added 2 changesets with 2 changes to 1 files
833 updating to branch default
833 updating to branch default
834 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
834 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
835 $ cd ../other-bundleoverlay
835 $ cd ../other-bundleoverlay
836 $ echo "B+" >> foo
836 $ echo "B+" >> foo
837 $ hg ci --amend -m "B+"
837 $ hg ci --amend -m "B+"
838 $ hg log -G --hidden
838 $ hg log -G --hidden
839 @ 3:b7d587542d40 (draft) [tip ] B+
839 @ 3:b7d587542d40 (draft) [tip ] B+
840 |
840 |
841 | x 2:eb95e9297e18 (draft) [ ] temporary amend commit for 44526ebb0f98
841 | x 2:eb95e9297e18 (draft) [ ] temporary amend commit for 44526ebb0f98
842 | |
842 | |
843 | x 1:44526ebb0f98 (draft) [ ] B
843 | x 1:44526ebb0f98 (draft) [ ] B
844 |/
844 |/
845 o 0:4b34ecfb0d56 (draft) [ ] A
845 o 0:4b34ecfb0d56 (draft) [ ] A
846
846
847
847
848 $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
848 $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg
849 comparing with ../repo-bundleoverlay
849 comparing with ../repo-bundleoverlay
850 searching for changes
850 searching for changes
851 1:44526ebb0f98 (draft) [ ] B
851 1:44526ebb0f98 (draft) [ ] B
852 2:c186d7714947 (draft) [tip ] C
852 2:c186d7714947 (draft) [tip ] C
853 $ hg log -G -R ../bundleoverlay.hg
853 $ hg log -G -R ../bundleoverlay.hg
854 o 4:c186d7714947 (draft) [tip ] C
854 o 4:c186d7714947 (draft) [tip ] C
855 |
855 |
856 | @ 3:b7d587542d40 (draft) [ ] B+
856 | @ 3:b7d587542d40 (draft) [ ] B+
857 |/
857 |/
858 o 0:4b34ecfb0d56 (draft) [ ] A
858 o 0:4b34ecfb0d56 (draft) [ ] A
859
859
860
860
861 #if serve
861 #if serve
862
862
863 Test issue 4506
863 Test issue 4506
864
864
865 $ cd ..
865 $ cd ..
866 $ hg init repo-issue4506
866 $ hg init repo-issue4506
867 $ cd repo-issue4506
867 $ cd repo-issue4506
868 $ echo "0" > foo
868 $ echo "0" > foo
869 $ hg add foo
869 $ hg add foo
870 $ hg ci -m "content-0"
870 $ hg ci -m "content-0"
871
871
872 $ hg up null
872 $ hg up null
873 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
873 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
874 $ echo "1" > bar
874 $ echo "1" > bar
875 $ hg add bar
875 $ hg add bar
876 $ hg ci -m "content-1"
876 $ hg ci -m "content-1"
877 created new head
877 created new head
878 $ hg up 0
878 $ hg up 0
879 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
879 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
880 $ hg graft 1
880 $ hg graft 1
881 grafting 1:1c9eddb02162 "content-1" (tip)
881 grafting 1:1c9eddb02162 "content-1" (tip)
882
882
883 $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'`
883 $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'`
884
884
885 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
885 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
886 $ cat hg.pid >> $DAEMON_PIDS
886 $ cat hg.pid >> $DAEMON_PIDS
887
887
888 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1'
888 $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1'
889 404 Not Found
889 404 Not Found
890 [1]
890 [1]
891 $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar'
891 $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar'
892 200 Script output follows
892 200 Script output follows
893 $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar'
893 $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar'
894 200 Script output follows
894 200 Script output follows
895
895
896 $ killdaemons.py
896 $ killdaemons.py
897
897
898 #endif
898 #endif
899
899
900 Test heads computation on pending index changes with obsolescence markers
900 Test heads computation on pending index changes with obsolescence markers
901 $ cd ..
901 $ cd ..
902 $ cat >$TESTTMP/test_extension.py << EOF
902 $ cat >$TESTTMP/test_extension.py << EOF
903 > from mercurial import cmdutil
903 > from mercurial import cmdutil
904 > from mercurial.i18n import _
904 > from mercurial.i18n import _
905 >
905 >
906 > cmdtable = {}
906 > cmdtable = {}
907 > command = cmdutil.command(cmdtable)
907 > command = cmdutil.command(cmdtable)
908 > @command("amendtransient",[], _('hg amendtransient [rev]'))
908 > @command("amendtransient",[], _('hg amendtransient [rev]'))
909 > def amend(ui, repo, *pats, **opts):
909 > def amend(ui, repo, *pats, **opts):
910 > def commitfunc(ui, repo, message, match, opts):
910 > def commitfunc(ui, repo, message, match, opts):
911 > return repo.commit(message, repo['.'].user(), repo['.'].date(), match)
911 > return repo.commit(message, repo['.'].user(), repo['.'].date(), match)
912 > opts['message'] = 'Test'
912 > opts['message'] = 'Test'
913 > opts['logfile'] = None
913 > opts['logfile'] = None
914 > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts)
914 > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts)
915 > print repo.changelog.headrevs()
915 > print repo.changelog.headrevs()
916 > EOF
916 > EOF
917 $ cat >> $HGRCPATH << EOF
917 $ cat >> $HGRCPATH << EOF
918 > [extensions]
918 > [extensions]
919 > testextension=$TESTTMP/test_extension.py
919 > testextension=$TESTTMP/test_extension.py
920 > EOF
920 > EOF
921 $ hg init repo-issue-nativerevs-pending-changes
921 $ hg init repo-issue-nativerevs-pending-changes
922 $ cd repo-issue-nativerevs-pending-changes
922 $ cd repo-issue-nativerevs-pending-changes
923 $ mkcommit a
923 $ mkcommit a
924 $ mkcommit b
924 $ mkcommit b
925 $ hg up ".^"
925 $ hg up ".^"
926 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
926 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
927 $ echo aa > a
927 $ echo aa > a
928 $ hg amendtransient
928 $ hg amendtransient
929 [1, 3]
929 [1, 3]
930
931 Test cache consistency for the visible filter
932 1) We want to make sure that the cached filtered revs are invalidated when
933 bookmarks change
934 $ cd ..
935 $ cat >$TESTTMP/test_extension.py << EOF
936 > from mercurial import cmdutil, extensions, bookmarks, repoview
937 > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs):
938 > repo = bkmstoreinst._repo
939 > ret = orig(bkmstoreinst, *args, **kwargs)
940 > hidden1 = repoview.computehidden(repo)
941 > hidden = repoview.filterrevs(repo, 'visible')
942 > if sorted(hidden1) != sorted(hidden):
943 > print "cache inconsistency"
944 > return ret
945 > def extsetup(ui):
946 > extensions.wrapfunction(bookmarks.bmstore, 'write', _bookmarkchanged)
947 > EOF
948
949 $ hg init repo-cache-inconsistency
950 $ cd repo-issue-nativerevs-pending-changes
951 $ mkcommit a
952 a already tracked!
953 $ mkcommit b
954 $ hg id
955 13bedc178fce tip
956 $ echo "hello" > b
957 $ hg commit --amend -m "message"
958 $ hg book bookb -r 13bedc178fce --hidden
959 $ hg log -r 13bedc178fce
960 5:13bedc178fce (draft) [ bookb] add b
961 $ hg book -d bookb
962 $ hg log -r 13bedc178fce
963 abort: hidden revision '13bedc178fce'!
964 (use --hidden to access hidden revisions)
965 [255]
966
967
968
General Comments 0
You need to be logged in to leave comments. Login now