Show More
@@ -1,373 +1,378 | |||
|
1 | 1 | # repair.py - functions for repository repair for mercurial |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2005, 2006 Chris Mason <mason@suse.com> |
|
4 | 4 | # Copyright 2007 Matt Mackall |
|
5 | 5 | # |
|
6 | 6 | # This software may be used and distributed according to the terms of the |
|
7 | 7 | # GNU General Public License version 2 or any later version. |
|
8 | 8 | |
|
9 | 9 | from __future__ import absolute_import |
|
10 | 10 | |
|
11 | 11 | import errno |
|
12 | 12 | import hashlib |
|
13 | 13 | |
|
14 | 14 | from .i18n import _ |
|
15 | 15 | from .node import short |
|
16 | 16 | from . import ( |
|
17 | 17 | bundle2, |
|
18 | 18 | changegroup, |
|
19 | 19 | discovery, |
|
20 | 20 | error, |
|
21 | 21 | exchange, |
|
22 | 22 | obsolete, |
|
23 | 23 | util, |
|
24 | 24 | ) |
|
25 | 25 | |
|
26 | 26 | def _bundle(repo, bases, heads, node, suffix, compress=True, obsolescence=True): |
|
27 | 27 | """create a bundle with the specified revisions as a backup""" |
|
28 | 28 | |
|
29 | 29 | backupdir = "strip-backup" |
|
30 | 30 | vfs = repo.vfs |
|
31 | 31 | if not vfs.isdir(backupdir): |
|
32 | 32 | vfs.mkdir(backupdir) |
|
33 | 33 | |
|
34 | 34 | # Include a hash of all the nodes in the filename for uniqueness |
|
35 | 35 | allcommits = repo.set('%ln::%ln', bases, heads) |
|
36 | 36 | allhashes = sorted(c.hex() for c in allcommits) |
|
37 | 37 | totalhash = hashlib.sha1(''.join(allhashes)).hexdigest() |
|
38 | 38 | name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix) |
|
39 | 39 | |
|
40 | 40 | cgversion = changegroup.safeversion(repo) |
|
41 | 41 | comp = None |
|
42 | 42 | if cgversion != '01': |
|
43 | 43 | bundletype = "HG20" |
|
44 | 44 | if compress: |
|
45 | 45 | comp = 'BZ' |
|
46 | 46 | elif compress: |
|
47 | 47 | bundletype = "HG10BZ" |
|
48 | 48 | else: |
|
49 | 49 | bundletype = "HG10UN" |
|
50 | 50 | |
|
51 | 51 | outgoing = discovery.outgoing(repo, missingroots=bases, missingheads=heads) |
|
52 | contentopts = {'cg.version': cgversion, 'obsolescence': obsolescence} | |
|
52 | contentopts = { | |
|
53 | 'cg.version': cgversion, | |
|
54 | 'obsolescence': obsolescence, | |
|
55 | 'phases': True, | |
|
56 | } | |
|
53 | 57 | return bundle2.writenewbundle(repo.ui, repo, 'strip', name, bundletype, |
|
54 | 58 | outgoing, contentopts, vfs, compression=comp) |
|
55 | 59 | |
|
56 | 60 | def _collectfiles(repo, striprev): |
|
57 | 61 | """find out the filelogs affected by the strip""" |
|
58 | 62 | files = set() |
|
59 | 63 | |
|
60 | 64 | for x in xrange(striprev, len(repo)): |
|
61 | 65 | files.update(repo[x].files()) |
|
62 | 66 | |
|
63 | 67 | return sorted(files) |
|
64 | 68 | |
|
65 | 69 | def _collectbrokencsets(repo, files, striprev): |
|
66 | 70 | """return the changesets which will be broken by the truncation""" |
|
67 | 71 | s = set() |
|
68 | 72 | def collectone(revlog): |
|
69 | 73 | _, brokenset = revlog.getstrippoint(striprev) |
|
70 | 74 | s.update([revlog.linkrev(r) for r in brokenset]) |
|
71 | 75 | |
|
72 | 76 | collectone(repo.manifestlog._revlog) |
|
73 | 77 | for fname in files: |
|
74 | 78 | collectone(repo.file(fname)) |
|
75 | 79 | |
|
76 | 80 | return s |
|
77 | 81 | |
|
78 | 82 | def strip(ui, repo, nodelist, backup=True, topic='backup'): |
|
79 | 83 | # This function requires the caller to lock the repo, but it operates |
|
80 | 84 | # within a transaction of its own, and thus requires there to be no current |
|
81 | 85 | # transaction when it is called. |
|
82 | 86 | if repo.currenttransaction() is not None: |
|
83 | 87 | raise error.ProgrammingError('cannot strip from inside a transaction') |
|
84 | 88 | |
|
85 | 89 | # Simple way to maintain backwards compatibility for this |
|
86 | 90 | # argument. |
|
87 | 91 | if backup in ['none', 'strip']: |
|
88 | 92 | backup = False |
|
89 | 93 | |
|
90 | 94 | repo = repo.unfiltered() |
|
91 | 95 | repo.destroying() |
|
92 | 96 | |
|
93 | 97 | cl = repo.changelog |
|
94 | 98 | # TODO handle undo of merge sets |
|
95 | 99 | if isinstance(nodelist, str): |
|
96 | 100 | nodelist = [nodelist] |
|
97 | 101 | striplist = [cl.rev(node) for node in nodelist] |
|
98 | 102 | striprev = min(striplist) |
|
99 | 103 | |
|
100 | 104 | files = _collectfiles(repo, striprev) |
|
101 | 105 | saverevs = _collectbrokencsets(repo, files, striprev) |
|
102 | 106 | |
|
103 | 107 | # Some revisions with rev > striprev may not be descendants of striprev. |
|
104 | 108 | # We have to find these revisions and put them in a bundle, so that |
|
105 | 109 | # we can restore them after the truncations. |
|
106 | 110 | # To create the bundle we use repo.changegroupsubset which requires |
|
107 | 111 | # the list of heads and bases of the set of interesting revisions. |
|
108 | 112 | # (head = revision in the set that has no descendant in the set; |
|
109 | 113 | # base = revision in the set that has no ancestor in the set) |
|
110 | 114 | tostrip = set(striplist) |
|
111 | 115 | saveheads = set(saverevs) |
|
112 | 116 | for r in cl.revs(start=striprev + 1): |
|
113 | 117 | if any(p in tostrip for p in cl.parentrevs(r)): |
|
114 | 118 | tostrip.add(r) |
|
115 | 119 | |
|
116 | 120 | if r not in tostrip: |
|
117 | 121 | saverevs.add(r) |
|
118 | 122 | saveheads.difference_update(cl.parentrevs(r)) |
|
119 | 123 | saveheads.add(r) |
|
120 | 124 | saveheads = [cl.node(r) for r in saveheads] |
|
121 | 125 | |
|
122 | 126 | # compute base nodes |
|
123 | 127 | if saverevs: |
|
124 | 128 | descendants = set(cl.descendants(saverevs)) |
|
125 | 129 | saverevs.difference_update(descendants) |
|
126 | 130 | savebases = [cl.node(r) for r in saverevs] |
|
127 | 131 | stripbases = [cl.node(r) for r in tostrip] |
|
128 | 132 | |
|
129 | 133 | stripobsidx = obsmarkers = () |
|
130 | 134 | if repo.ui.configbool('devel', 'strip-obsmarkers', True): |
|
131 | 135 | obsmarkers = obsolete.exclusivemarkers(repo, stripbases) |
|
132 | 136 | if obsmarkers: |
|
133 | 137 | stripobsidx = [i for i, m in enumerate(repo.obsstore) |
|
134 | 138 | if m in obsmarkers] |
|
135 | 139 | |
|
136 | 140 | # For a set s, max(parents(s) - s) is the same as max(heads(::s - s)), but |
|
137 | 141 | # is much faster |
|
138 | 142 | newbmtarget = repo.revs('max(parents(%ld) - (%ld))', tostrip, tostrip) |
|
139 | 143 | if newbmtarget: |
|
140 | 144 | newbmtarget = repo[newbmtarget.first()].node() |
|
141 | 145 | else: |
|
142 | 146 | newbmtarget = '.' |
|
143 | 147 | |
|
144 | 148 | bm = repo._bookmarks |
|
145 | 149 | updatebm = [] |
|
146 | 150 | for m in bm: |
|
147 | 151 | rev = repo[bm[m]].rev() |
|
148 | 152 | if rev in tostrip: |
|
149 | 153 | updatebm.append(m) |
|
150 | 154 | |
|
151 | 155 | # create a changegroup for all the branches we need to keep |
|
152 | 156 | backupfile = None |
|
153 | 157 | vfs = repo.vfs |
|
154 | 158 | node = nodelist[-1] |
|
155 | 159 | if backup: |
|
156 | 160 | backupfile = _bundle(repo, stripbases, cl.heads(), node, topic) |
|
157 | 161 | repo.ui.status(_("saved backup bundle to %s\n") % |
|
158 | 162 | vfs.join(backupfile)) |
|
159 | 163 | repo.ui.log("backupbundle", "saved backup bundle to %s\n", |
|
160 | 164 | vfs.join(backupfile)) |
|
161 | 165 | tmpbundlefile = None |
|
162 | 166 | if saveheads: |
|
163 | 167 | # do not compress temporary bundle if we remove it from disk later |
|
164 | 168 | # |
|
165 | 169 | # We do not include obsolescence, it might re-introduce prune markers |
|
166 | 170 | # we are trying to strip. This is harmless since the stripped markers |
|
167 | 171 | # are already backed up and we did not touched the markers for the |
|
168 | 172 | # saved changesets. |
|
169 | 173 | tmpbundlefile = _bundle(repo, savebases, saveheads, node, 'temp', |
|
170 | 174 | compress=False, obsolescence=False) |
|
171 | 175 | |
|
172 | 176 | mfst = repo.manifestlog._revlog |
|
173 | 177 | |
|
174 | 178 | try: |
|
175 | 179 | with repo.transaction("strip") as tr: |
|
176 | 180 | offset = len(tr.entries) |
|
177 | 181 | |
|
178 | 182 | tr.startgroup() |
|
179 | 183 | cl.strip(striprev, tr) |
|
180 | 184 | mfst.strip(striprev, tr) |
|
181 | 185 | striptrees(repo, tr, striprev, files) |
|
182 | 186 | |
|
183 | 187 | for fn in files: |
|
184 | 188 | repo.file(fn).strip(striprev, tr) |
|
185 | 189 | tr.endgroup() |
|
186 | 190 | |
|
187 | 191 | for i in xrange(offset, len(tr.entries)): |
|
188 | 192 | file, troffset, ignore = tr.entries[i] |
|
189 | 193 | with repo.svfs(file, 'a', checkambig=True) as fp: |
|
190 | 194 | fp.truncate(troffset) |
|
191 | 195 | if troffset == 0: |
|
192 | 196 | repo.store.markremoved(file) |
|
193 | 197 | |
|
194 | 198 | deleteobsmarkers(repo.obsstore, stripobsidx) |
|
195 | 199 | del repo.obsstore |
|
196 | 200 | |
|
201 | repo._phasecache.filterunknown(repo) | |
|
197 | 202 | if tmpbundlefile: |
|
198 | 203 | ui.note(_("adding branch\n")) |
|
199 | 204 | f = vfs.open(tmpbundlefile, "rb") |
|
200 | 205 | gen = exchange.readbundle(ui, f, tmpbundlefile, vfs) |
|
201 | 206 | if not repo.ui.verbose: |
|
202 | 207 | # silence internal shuffling chatter |
|
203 | 208 | repo.ui.pushbuffer() |
|
204 | 209 | tmpbundleurl = 'bundle:' + vfs.join(tmpbundlefile) |
|
205 | 210 | if isinstance(gen, bundle2.unbundle20): |
|
206 | 211 | with repo.transaction('strip') as tr: |
|
207 | 212 | bundle2.applybundle(repo, gen, tr, source='strip', |
|
208 | 213 | url=tmpbundleurl) |
|
209 | 214 | else: |
|
210 | 215 | txnname = "strip\n%s" % util.hidepassword(tmpbundleurl) |
|
211 | 216 | with repo.transaction(txnname) as tr: |
|
212 | 217 | gen.apply(repo, tr, 'strip', tmpbundleurl, True) |
|
213 | 218 | if not repo.ui.verbose: |
|
214 | 219 | repo.ui.popbuffer() |
|
215 | 220 | f.close() |
|
216 | 221 | repo._phasecache.invalidate() |
|
217 | 222 | |
|
218 | 223 | for m in updatebm: |
|
219 | 224 | bm[m] = repo[newbmtarget].node() |
|
220 | 225 | |
|
221 | 226 | with repo.transaction('repair') as tr: |
|
222 | 227 | bm.recordchange(tr) |
|
223 | 228 | |
|
224 | 229 | # remove undo files |
|
225 | 230 | for undovfs, undofile in repo.undofiles(): |
|
226 | 231 | try: |
|
227 | 232 | undovfs.unlink(undofile) |
|
228 | 233 | except OSError as e: |
|
229 | 234 | if e.errno != errno.ENOENT: |
|
230 | 235 | ui.warn(_('error removing %s: %s\n') % |
|
231 | 236 | (undovfs.join(undofile), str(e))) |
|
232 | 237 | |
|
233 | 238 | except: # re-raises |
|
234 | 239 | if backupfile: |
|
235 | 240 | ui.warn(_("strip failed, backup bundle stored in '%s'\n") |
|
236 | 241 | % vfs.join(backupfile)) |
|
237 | 242 | if tmpbundlefile: |
|
238 | 243 | ui.warn(_("strip failed, unrecovered changes stored in '%s'\n") |
|
239 | 244 | % vfs.join(tmpbundlefile)) |
|
240 | 245 | ui.warn(_("(fix the problem, then recover the changesets with " |
|
241 | 246 | "\"hg unbundle '%s'\")\n") % vfs.join(tmpbundlefile)) |
|
242 | 247 | raise |
|
243 | 248 | else: |
|
244 | 249 | if tmpbundlefile: |
|
245 | 250 | # Remove temporary bundle only if there were no exceptions |
|
246 | 251 | vfs.unlink(tmpbundlefile) |
|
247 | 252 | |
|
248 | 253 | repo.destroyed() |
|
249 | 254 | # return the backup file path (or None if 'backup' was False) so |
|
250 | 255 | # extensions can use it |
|
251 | 256 | return backupfile |
|
252 | 257 | |
|
253 | 258 | def striptrees(repo, tr, striprev, files): |
|
254 | 259 | if 'treemanifest' in repo.requirements: # safe but unnecessary |
|
255 | 260 | # otherwise |
|
256 | 261 | for unencoded, encoded, size in repo.store.datafiles(): |
|
257 | 262 | if (unencoded.startswith('meta/') and |
|
258 | 263 | unencoded.endswith('00manifest.i')): |
|
259 | 264 | dir = unencoded[5:-12] |
|
260 | 265 | repo.manifestlog._revlog.dirlog(dir).strip(striprev, tr) |
|
261 | 266 | |
|
262 | 267 | def rebuildfncache(ui, repo): |
|
263 | 268 | """Rebuilds the fncache file from repo history. |
|
264 | 269 | |
|
265 | 270 | Missing entries will be added. Extra entries will be removed. |
|
266 | 271 | """ |
|
267 | 272 | repo = repo.unfiltered() |
|
268 | 273 | |
|
269 | 274 | if 'fncache' not in repo.requirements: |
|
270 | 275 | ui.warn(_('(not rebuilding fncache because repository does not ' |
|
271 | 276 | 'support fncache)\n')) |
|
272 | 277 | return |
|
273 | 278 | |
|
274 | 279 | with repo.lock(): |
|
275 | 280 | fnc = repo.store.fncache |
|
276 | 281 | # Trigger load of fncache. |
|
277 | 282 | if 'irrelevant' in fnc: |
|
278 | 283 | pass |
|
279 | 284 | |
|
280 | 285 | oldentries = set(fnc.entries) |
|
281 | 286 | newentries = set() |
|
282 | 287 | seenfiles = set() |
|
283 | 288 | |
|
284 | 289 | repolen = len(repo) |
|
285 | 290 | for rev in repo: |
|
286 | 291 | ui.progress(_('rebuilding'), rev, total=repolen, |
|
287 | 292 | unit=_('changesets')) |
|
288 | 293 | |
|
289 | 294 | ctx = repo[rev] |
|
290 | 295 | for f in ctx.files(): |
|
291 | 296 | # This is to minimize I/O. |
|
292 | 297 | if f in seenfiles: |
|
293 | 298 | continue |
|
294 | 299 | seenfiles.add(f) |
|
295 | 300 | |
|
296 | 301 | i = 'data/%s.i' % f |
|
297 | 302 | d = 'data/%s.d' % f |
|
298 | 303 | |
|
299 | 304 | if repo.store._exists(i): |
|
300 | 305 | newentries.add(i) |
|
301 | 306 | if repo.store._exists(d): |
|
302 | 307 | newentries.add(d) |
|
303 | 308 | |
|
304 | 309 | ui.progress(_('rebuilding'), None) |
|
305 | 310 | |
|
306 | 311 | if 'treemanifest' in repo.requirements: # safe but unnecessary otherwise |
|
307 | 312 | for dir in util.dirs(seenfiles): |
|
308 | 313 | i = 'meta/%s/00manifest.i' % dir |
|
309 | 314 | d = 'meta/%s/00manifest.d' % dir |
|
310 | 315 | |
|
311 | 316 | if repo.store._exists(i): |
|
312 | 317 | newentries.add(i) |
|
313 | 318 | if repo.store._exists(d): |
|
314 | 319 | newentries.add(d) |
|
315 | 320 | |
|
316 | 321 | addcount = len(newentries - oldentries) |
|
317 | 322 | removecount = len(oldentries - newentries) |
|
318 | 323 | for p in sorted(oldentries - newentries): |
|
319 | 324 | ui.write(_('removing %s\n') % p) |
|
320 | 325 | for p in sorted(newentries - oldentries): |
|
321 | 326 | ui.write(_('adding %s\n') % p) |
|
322 | 327 | |
|
323 | 328 | if addcount or removecount: |
|
324 | 329 | ui.write(_('%d items added, %d removed from fncache\n') % |
|
325 | 330 | (addcount, removecount)) |
|
326 | 331 | fnc.entries = newentries |
|
327 | 332 | fnc._dirty = True |
|
328 | 333 | |
|
329 | 334 | with repo.transaction('fncache') as tr: |
|
330 | 335 | fnc.write(tr) |
|
331 | 336 | else: |
|
332 | 337 | ui.write(_('fncache already up to date\n')) |
|
333 | 338 | |
|
334 | 339 | def stripbmrevset(repo, mark): |
|
335 | 340 | """ |
|
336 | 341 | The revset to strip when strip is called with -B mark |
|
337 | 342 | |
|
338 | 343 | Needs to live here so extensions can use it and wrap it even when strip is |
|
339 | 344 | not enabled or not present on a box. |
|
340 | 345 | """ |
|
341 | 346 | return repo.revs("ancestors(bookmark(%s)) - " |
|
342 | 347 | "ancestors(head() and not bookmark(%s)) - " |
|
343 | 348 | "ancestors(bookmark() and not bookmark(%s))", |
|
344 | 349 | mark, mark, mark) |
|
345 | 350 | |
|
346 | 351 | def deleteobsmarkers(obsstore, indices): |
|
347 | 352 | """Delete some obsmarkers from obsstore and return how many were deleted |
|
348 | 353 | |
|
349 | 354 | 'indices' is a list of ints which are the indices |
|
350 | 355 | of the markers to be deleted. |
|
351 | 356 | |
|
352 | 357 | Every invocation of this function completely rewrites the obsstore file, |
|
353 | 358 | skipping the markers we want to be removed. The new temporary file is |
|
354 | 359 | created, remaining markers are written there and on .close() this file |
|
355 | 360 | gets atomically renamed to obsstore, thus guaranteeing consistency.""" |
|
356 | 361 | if not indices: |
|
357 | 362 | # we don't want to rewrite the obsstore with the same content |
|
358 | 363 | return |
|
359 | 364 | |
|
360 | 365 | left = [] |
|
361 | 366 | current = obsstore._all |
|
362 | 367 | n = 0 |
|
363 | 368 | for i, m in enumerate(current): |
|
364 | 369 | if i in indices: |
|
365 | 370 | n += 1 |
|
366 | 371 | continue |
|
367 | 372 | left.append(m) |
|
368 | 373 | |
|
369 | 374 | newobsstorefile = obsstore.svfs('obsstore', 'w', atomictemp=True) |
|
370 | 375 | for bytes in obsolete.encodemarkers(left, True, obsstore._version): |
|
371 | 376 | newobsstorefile.write(bytes) |
|
372 | 377 | newobsstorefile.close() |
|
373 | 378 | return n |
@@ -1,259 +1,285 | |||
|
1 | 1 | $ cat >> $HGRCPATH <<EOF |
|
2 | 2 | > [experimental] |
|
3 | 3 | > bundle-phases=yes |
|
4 | 4 | > [extensions] |
|
5 | 5 | > strip= |
|
6 | 6 | > drawdag=$TESTDIR/drawdag.py |
|
7 | 7 | > EOF |
|
8 | 8 | |
|
9 | 9 | Set up repo with linear history |
|
10 | 10 | $ hg init linear |
|
11 | 11 | $ cd linear |
|
12 | 12 | $ hg debugdrawdag <<'EOF' |
|
13 | 13 | > E |
|
14 | 14 | > | |
|
15 | 15 | > D |
|
16 | 16 | > | |
|
17 | 17 | > C |
|
18 | 18 | > | |
|
19 | 19 | > B |
|
20 | 20 | > | |
|
21 | 21 | > A |
|
22 | 22 | > EOF |
|
23 | 23 | $ hg phase --public A |
|
24 | 24 | $ hg phase --force --secret D |
|
25 | 25 | $ hg log -G -T '{desc} {phase}\n' |
|
26 | 26 | o E secret |
|
27 | 27 | | |
|
28 | 28 | o D secret |
|
29 | 29 | | |
|
30 | 30 | o C draft |
|
31 | 31 | | |
|
32 | 32 | o B draft |
|
33 | 33 | | |
|
34 | 34 | o A public |
|
35 | 35 | |
|
36 | 36 | Phases are restored when unbundling |
|
37 | 37 | $ hg bundle --base B -r E bundle |
|
38 | 38 | 3 changesets found |
|
39 | 39 | $ hg debugbundle bundle |
|
40 | 40 | Stream params: sortdict([('Compression', 'BZ')]) |
|
41 | 41 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '3')])" |
|
42 | 42 | 26805aba1e600a82e93661149f2313866a221a7b |
|
43 | 43 | f585351a92f85104bff7c284233c338b10eb1df7 |
|
44 | 44 | 9bc730a19041f9ec7cb33c626e811aa233efb18c |
|
45 | 45 | phase-heads -- 'sortdict()' |
|
46 | 46 | 26805aba1e600a82e93661149f2313866a221a7b draft |
|
47 | 47 | $ hg strip --no-backup C |
|
48 | 48 | $ hg unbundle -q bundle |
|
49 | 49 | $ rm bundle |
|
50 | 50 | $ hg log -G -T '{desc} {phase}\n' |
|
51 | 51 | o E secret |
|
52 | 52 | | |
|
53 | 53 | o D secret |
|
54 | 54 | | |
|
55 | 55 | o C draft |
|
56 | 56 | | |
|
57 | 57 | o B draft |
|
58 | 58 | | |
|
59 | 59 | o A public |
|
60 | 60 | |
|
61 | 61 | Root revision's phase is preserved |
|
62 | 62 | $ hg bundle -a bundle |
|
63 | 63 | 5 changesets found |
|
64 | 64 | $ hg strip --no-backup A |
|
65 | 65 | $ hg unbundle -q bundle |
|
66 | 66 | $ rm bundle |
|
67 | 67 | $ hg log -G -T '{desc} {phase}\n' |
|
68 | 68 | o E secret |
|
69 | 69 | | |
|
70 | 70 | o D secret |
|
71 | 71 | | |
|
72 | 72 | o C draft |
|
73 | 73 | | |
|
74 | 74 | o B draft |
|
75 | 75 | | |
|
76 | 76 | o A public |
|
77 | 77 | |
|
78 | 78 | Completely public history can be restored |
|
79 | 79 | $ hg phase --public E |
|
80 | 80 | $ hg bundle -a bundle |
|
81 | 81 | 5 changesets found |
|
82 | 82 | $ hg strip --no-backup A |
|
83 | 83 | $ hg unbundle -q bundle |
|
84 | 84 | $ rm bundle |
|
85 | 85 | $ hg log -G -T '{desc} {phase}\n' |
|
86 | 86 | o E public |
|
87 | 87 | | |
|
88 | 88 | o D public |
|
89 | 89 | | |
|
90 | 90 | o C public |
|
91 | 91 | | |
|
92 | 92 | o B public |
|
93 | 93 | | |
|
94 | 94 | o A public |
|
95 | 95 | |
|
96 | 96 | Direct transition from public to secret can be restored |
|
97 | 97 | $ hg phase --secret --force D |
|
98 | 98 | $ hg bundle -a bundle |
|
99 | 99 | 5 changesets found |
|
100 | 100 | $ hg strip --no-backup A |
|
101 | 101 | $ hg unbundle -q bundle |
|
102 | 102 | $ rm bundle |
|
103 | 103 | $ hg log -G -T '{desc} {phase}\n' |
|
104 | 104 | o E secret |
|
105 | 105 | | |
|
106 | 106 | o D secret |
|
107 | 107 | | |
|
108 | 108 | o C public |
|
109 | 109 | | |
|
110 | 110 | o B public |
|
111 | 111 | | |
|
112 | 112 | o A public |
|
113 | 113 | |
|
114 | 114 | Revisions within bundle preserve their phase even if parent changes its phase |
|
115 | 115 | $ hg phase --draft --force B |
|
116 | 116 | $ hg bundle --base B -r E bundle |
|
117 | 117 | 3 changesets found |
|
118 | 118 | $ hg strip --no-backup C |
|
119 | 119 | $ hg phase --public B |
|
120 | 120 | $ hg unbundle -q bundle |
|
121 | 121 | $ rm bundle |
|
122 | 122 | $ hg log -G -T '{desc} {phase}\n' |
|
123 | 123 | o E secret |
|
124 | 124 | | |
|
125 | 125 | o D secret |
|
126 | 126 | | |
|
127 | 127 | o C draft |
|
128 | 128 | | |
|
129 | 129 | o B public |
|
130 | 130 | | |
|
131 | 131 | o A public |
|
132 | 132 | |
|
133 | 133 | Phase of ancestors of stripped node get advanced to accommodate child |
|
134 | 134 | $ hg bundle --base B -r E bundle |
|
135 | 135 | 3 changesets found |
|
136 | 136 | $ hg strip --no-backup C |
|
137 | 137 | $ hg phase --force --secret B |
|
138 | 138 | $ hg unbundle -q bundle |
|
139 | 139 | $ rm bundle |
|
140 | 140 | $ hg log -G -T '{desc} {phase}\n' |
|
141 | 141 | o E secret |
|
142 | 142 | | |
|
143 | 143 | o D secret |
|
144 | 144 | | |
|
145 | 145 | o C draft |
|
146 | 146 | | |
|
147 | 147 | o B draft |
|
148 | 148 | | |
|
149 | 149 | o A public |
|
150 | 150 | |
|
151 | 151 | Unbundling advances phases of changesets even if they were already in the repo. |
|
152 | 152 | To test that, create a bundle of everything in draft phase and then unbundle |
|
153 | 153 | to see that secret becomes draft, but public remains public. |
|
154 | 154 | $ hg phase --draft --force A |
|
155 | 155 | $ hg phase --draft E |
|
156 | 156 | $ hg bundle -a bundle |
|
157 | 157 | 5 changesets found |
|
158 | 158 | $ hg phase --public A |
|
159 | 159 | $ hg phase --secret --force E |
|
160 | 160 | $ hg unbundle -q bundle |
|
161 | 161 | $ rm bundle |
|
162 | 162 | $ hg log -G -T '{desc} {phase}\n' |
|
163 | 163 | o E draft |
|
164 | 164 | | |
|
165 | 165 | o D draft |
|
166 | 166 | | |
|
167 | 167 | o C draft |
|
168 | 168 | | |
|
169 | 169 | o B draft |
|
170 | 170 | | |
|
171 | 171 | o A public |
|
172 | 172 | |
|
173 | Unbundling change in the middle of a stack does not affect later changes | |
|
174 | $ hg strip --no-backup E | |
|
175 | $ hg phase --secret --force D | |
|
176 | $ hg log -G -T '{desc} {phase}\n' | |
|
177 | o D secret | |
|
178 | | | |
|
179 | o C draft | |
|
180 | | | |
|
181 | o B draft | |
|
182 | | | |
|
183 | o A public | |
|
184 | ||
|
185 | $ hg bundle --base A -r B bundle | |
|
186 | 1 changesets found | |
|
187 | $ hg unbundle -q bundle | |
|
188 | $ rm bundle | |
|
189 | $ hg log -G -T '{desc} {phase}\n' | |
|
190 | o D secret | |
|
191 | | | |
|
192 | o C draft | |
|
193 | | | |
|
194 | o B draft | |
|
195 | | | |
|
196 | o A public | |
|
197 | ||
|
198 | ||
|
173 | 199 | $ cd .. |
|
174 | 200 | |
|
175 | 201 | Set up repo with non-linear history |
|
176 | 202 | $ hg init non-linear |
|
177 | 203 | $ cd non-linear |
|
178 | 204 | $ hg debugdrawdag <<'EOF' |
|
179 | 205 | > D E |
|
180 | 206 | > |\| |
|
181 | 207 | > B C |
|
182 | 208 | > |/ |
|
183 | 209 | > A |
|
184 | 210 | > EOF |
|
185 | 211 | $ hg phase --public C |
|
186 | 212 | $ hg phase --force --secret B |
|
187 | 213 | $ hg log -G -T '{node|short} {desc} {phase}\n' |
|
188 | 214 | o 03ca77807e91 E draft |
|
189 | 215 | | |
|
190 | 216 | | o 215e7b0814e1 D secret |
|
191 | 217 | |/| |
|
192 | 218 | o | dc0947a82db8 C public |
|
193 | 219 | | | |
|
194 | 220 | | o 112478962961 B secret |
|
195 | 221 | |/ |
|
196 | 222 | o 426bada5c675 A public |
|
197 | 223 | |
|
198 | 224 | |
|
199 | 225 | Restore bundle of entire repo |
|
200 | 226 | $ hg bundle -a bundle |
|
201 | 227 | 5 changesets found |
|
202 | 228 | $ hg debugbundle bundle |
|
203 | 229 | Stream params: sortdict([('Compression', 'BZ')]) |
|
204 | 230 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '5')])" |
|
205 | 231 | 426bada5c67598ca65036d57d9e4b64b0c1ce7a0 |
|
206 | 232 | 112478962961147124edd43549aedd1a335e44bf |
|
207 | 233 | dc0947a82db884575bb76ea10ac97b08536bfa03 |
|
208 | 234 | 215e7b0814e1cac8e2614e7284f2a5dc266b4323 |
|
209 | 235 | 03ca77807e919db8807c3749086dc36fb478cac0 |
|
210 | 236 | phase-heads -- 'sortdict()' |
|
211 | 237 | dc0947a82db884575bb76ea10ac97b08536bfa03 public |
|
212 | 238 | 03ca77807e919db8807c3749086dc36fb478cac0 draft |
|
213 | 239 | $ hg strip --no-backup A |
|
214 | 240 | $ hg unbundle -q bundle |
|
215 | 241 | $ rm bundle |
|
216 | 242 | $ hg log -G -T '{node|short} {desc} {phase}\n' |
|
217 | 243 | o 03ca77807e91 E draft |
|
218 | 244 | | |
|
219 | 245 | | o 215e7b0814e1 D secret |
|
220 | 246 | |/| |
|
221 | 247 | o | dc0947a82db8 C public |
|
222 | 248 | | | |
|
223 | 249 | | o 112478962961 B secret |
|
224 | 250 | |/ |
|
225 | 251 | o 426bada5c675 A public |
|
226 | 252 | |
|
227 | 253 | |
|
228 | 254 | $ hg bundle --base 'A + C' -r D bundle |
|
229 | 255 | 2 changesets found |
|
230 | 256 | $ hg debugbundle bundle |
|
231 | 257 | Stream params: sortdict([('Compression', 'BZ')]) |
|
232 | 258 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])" |
|
233 | 259 | 112478962961147124edd43549aedd1a335e44bf |
|
234 | 260 | 215e7b0814e1cac8e2614e7284f2a5dc266b4323 |
|
235 | 261 | phase-heads -- 'sortdict()' |
|
236 | 262 | $ rm bundle |
|
237 | 263 | |
|
238 | 264 | $ hg bundle --base A -r D bundle |
|
239 | 265 | 3 changesets found |
|
240 | 266 | $ hg debugbundle bundle |
|
241 | 267 | Stream params: sortdict([('Compression', 'BZ')]) |
|
242 | 268 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '3')])" |
|
243 | 269 | 112478962961147124edd43549aedd1a335e44bf |
|
244 | 270 | dc0947a82db884575bb76ea10ac97b08536bfa03 |
|
245 | 271 | 215e7b0814e1cac8e2614e7284f2a5dc266b4323 |
|
246 | 272 | phase-heads -- 'sortdict()' |
|
247 | 273 | dc0947a82db884575bb76ea10ac97b08536bfa03 public |
|
248 | 274 | $ rm bundle |
|
249 | 275 | |
|
250 | 276 | $ hg bundle --base 'B + C' -r 'D + E' bundle |
|
251 | 277 | 2 changesets found |
|
252 | 278 | $ hg debugbundle bundle |
|
253 | 279 | Stream params: sortdict([('Compression', 'BZ')]) |
|
254 | 280 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])" |
|
255 | 281 | 215e7b0814e1cac8e2614e7284f2a5dc266b4323 |
|
256 | 282 | 03ca77807e919db8807c3749086dc36fb478cac0 |
|
257 | 283 | phase-heads -- 'sortdict()' |
|
258 | 284 | 03ca77807e919db8807c3749086dc36fb478cac0 draft |
|
259 | 285 | $ rm bundle |
@@ -1,161 +1,163 | |||
|
1 | 1 | Check whether size of generaldelta revlog is not bigger than its |
|
2 | 2 | regular equivalent. Test would fail if generaldelta was naive |
|
3 | 3 | implementation of parentdelta: third manifest revision would be fully |
|
4 | 4 | inserted due to big distance from its paren revision (zero). |
|
5 | 5 | |
|
6 | 6 | $ hg init repo --config format.generaldelta=no --config format.usegeneraldelta=no |
|
7 | 7 | $ cd repo |
|
8 | 8 | $ echo foo > foo |
|
9 | 9 | $ echo bar > bar |
|
10 | 10 | $ echo baz > baz |
|
11 | 11 | $ hg commit -q -Am boo |
|
12 | 12 | $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes |
|
13 | 13 | $ for r in 1 2 3; do |
|
14 | 14 | > echo $r > foo |
|
15 | 15 | > hg commit -q -m $r |
|
16 | 16 | > hg up -q -r 0 |
|
17 | 17 | > hg pull . -q -r $r -R ../gdrepo |
|
18 | 18 | > done |
|
19 | 19 | |
|
20 | 20 | $ cd .. |
|
21 | 21 | >>> from __future__ import print_function |
|
22 | 22 | >>> import os |
|
23 | 23 | >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size |
|
24 | 24 | >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size |
|
25 | 25 | >>> if regsize < gdsize: |
|
26 | 26 | ... print('generaldata increased size of manifest') |
|
27 | 27 | |
|
28 | 28 | Verify rev reordering doesnt create invalid bundles (issue4462) |
|
29 | 29 | This requires a commit tree that when pulled will reorder manifest revs such |
|
30 | 30 | that the second manifest to create a file rev will be ordered before the first |
|
31 | 31 | manifest to create that file rev. We also need to do a partial pull to ensure |
|
32 | 32 | reordering happens. At the end we verify the linkrev points at the earliest |
|
33 | 33 | commit. |
|
34 | 34 | |
|
35 | 35 | $ hg init server --config format.generaldelta=True |
|
36 | 36 | $ cd server |
|
37 | 37 | $ touch a |
|
38 | 38 | $ hg commit -Aqm a |
|
39 | 39 | $ echo x > x |
|
40 | 40 | $ echo y > y |
|
41 | 41 | $ hg commit -Aqm xy |
|
42 | 42 | $ hg up -q '.^' |
|
43 | 43 | $ echo x > x |
|
44 | 44 | $ echo z > z |
|
45 | 45 | $ hg commit -Aqm xz |
|
46 | 46 | $ hg up -q 1 |
|
47 | 47 | $ echo b > b |
|
48 | 48 | $ hg commit -Aqm b |
|
49 | 49 | $ hg merge -q 2 |
|
50 | 50 | $ hg commit -Aqm merge |
|
51 | 51 | $ echo c > c |
|
52 | 52 | $ hg commit -Aqm c |
|
53 | 53 | $ hg log -G -T '{rev} {shortest(node)} {desc}' |
|
54 | 54 | @ 5 ebb8 c |
|
55 | 55 | | |
|
56 | 56 | o 4 baf7 merge |
|
57 | 57 | |\ |
|
58 | 58 | | o 3 a129 b |
|
59 | 59 | | | |
|
60 | 60 | o | 2 958c xz |
|
61 | 61 | | | |
|
62 | 62 | | o 1 f00c xy |
|
63 | 63 | |/ |
|
64 | 64 | o 0 3903 a |
|
65 | 65 | |
|
66 | 66 | $ cd .. |
|
67 | 67 | $ hg init client --config format.generaldelta=false --config format.usegeneraldelta=false |
|
68 | 68 | $ cd client |
|
69 | 69 | $ hg pull -q ../server -r 4 |
|
70 | 70 | $ hg debugindex x |
|
71 | 71 | rev offset length base linkrev nodeid p1 p2 |
|
72 | 72 | 0 0 3 0 1 1406e7411862 000000000000 000000000000 |
|
73 | 73 | |
|
74 | 74 | $ cd .. |
|
75 | 75 | |
|
76 | 76 | Test "usegeneraldelta" config |
|
77 | 77 | (repo are general delta, but incoming bundle are not re-deltafied) |
|
78 | 78 | |
|
79 | 79 | delta coming from the server base delta server are not recompressed. |
|
80 | 80 | (also include the aggressive version for comparison) |
|
81 | 81 | |
|
82 | 82 | $ hg clone repo --pull --config format.usegeneraldelta=1 usegd |
|
83 | 83 | requesting all changes |
|
84 | 84 | adding changesets |
|
85 | 85 | adding manifests |
|
86 | 86 | adding file changes |
|
87 | 87 | added 4 changesets with 6 changes to 3 files (+2 heads) |
|
88 | 88 | updating to branch default |
|
89 | 89 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
90 | 90 | $ hg clone repo --pull --config format.generaldelta=1 full |
|
91 | 91 | requesting all changes |
|
92 | 92 | adding changesets |
|
93 | 93 | adding manifests |
|
94 | 94 | adding file changes |
|
95 | 95 | added 4 changesets with 6 changes to 3 files (+2 heads) |
|
96 | 96 | updating to branch default |
|
97 | 97 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
98 | 98 | $ hg -R repo debugindex -m |
|
99 | 99 | rev offset length base linkrev nodeid p1 p2 |
|
100 | 100 | 0 0 104 0 0 cef96823c800 000000000000 000000000000 |
|
101 | 101 | 1 104 57 0 1 58ab9a8d541d cef96823c800 000000000000 |
|
102 | 102 | 2 161 57 0 2 134fdc6fd680 cef96823c800 000000000000 |
|
103 | 103 | 3 218 104 3 3 723508934dad cef96823c800 000000000000 |
|
104 | 104 | $ hg -R usegd debugindex -m |
|
105 | 105 | rev offset length delta linkrev nodeid p1 p2 |
|
106 | 106 | 0 0 104 -1 0 cef96823c800 000000000000 000000000000 |
|
107 | 107 | 1 104 57 0 1 58ab9a8d541d cef96823c800 000000000000 |
|
108 | 108 | 2 161 57 1 2 134fdc6fd680 cef96823c800 000000000000 |
|
109 | 109 | 3 218 57 0 3 723508934dad cef96823c800 000000000000 |
|
110 | 110 | $ hg -R full debugindex -m |
|
111 | 111 | rev offset length delta linkrev nodeid p1 p2 |
|
112 | 112 | 0 0 104 -1 0 cef96823c800 000000000000 000000000000 |
|
113 | 113 | 1 104 57 0 1 58ab9a8d541d cef96823c800 000000000000 |
|
114 | 114 | 2 161 57 0 2 134fdc6fd680 cef96823c800 000000000000 |
|
115 | 115 | 3 218 57 0 3 723508934dad cef96823c800 000000000000 |
|
116 | 116 | |
|
117 | 117 | Test format.aggressivemergedeltas |
|
118 | 118 | |
|
119 | 119 | $ hg init --config format.generaldelta=1 aggressive |
|
120 | 120 | $ cd aggressive |
|
121 | 121 | $ cat << EOF >> .hg/hgrc |
|
122 | 122 | > [format] |
|
123 | 123 | > generaldelta = 1 |
|
124 | 124 | > EOF |
|
125 | 125 | $ touch a b c d e |
|
126 | 126 | $ hg commit -Aqm side1 |
|
127 | 127 | $ hg up -q null |
|
128 | 128 | $ touch x y |
|
129 | 129 | $ hg commit -Aqm side2 |
|
130 | 130 | |
|
131 | 131 | - Verify non-aggressive merge uses p1 (commit 1) as delta parent |
|
132 | 132 | $ hg merge -q 0 |
|
133 | 133 | $ hg commit -q -m merge |
|
134 | 134 | $ hg debugindex -m |
|
135 | 135 | rev offset length delta linkrev nodeid p1 p2 |
|
136 | 136 | 0 0 59 -1 0 8dde941edb6e 000000000000 000000000000 |
|
137 | 137 | 1 59 61 0 1 315c023f341d 000000000000 000000000000 |
|
138 | 138 | 2 120 65 1 2 2ab389a983eb 315c023f341d 8dde941edb6e |
|
139 | 139 | |
|
140 | 140 | $ hg strip -q -r . --config extensions.strip= |
|
141 | 141 | |
|
142 | 142 | - Verify aggressive merge uses p2 (commit 0) as delta parent |
|
143 | 143 | $ hg up -q -C 1 |
|
144 | 144 | $ hg merge -q 0 |
|
145 | 145 | $ hg commit -q -m merge --config format.aggressivemergedeltas=True |
|
146 | 146 | $ hg debugindex -m |
|
147 | 147 | rev offset length delta linkrev nodeid p1 p2 |
|
148 | 148 | 0 0 59 -1 0 8dde941edb6e 000000000000 000000000000 |
|
149 | 149 | 1 59 61 0 1 315c023f341d 000000000000 000000000000 |
|
150 | 150 | 2 120 62 0 2 2ab389a983eb 315c023f341d 8dde941edb6e |
|
151 | 151 | |
|
152 | 152 | Test that strip bundle use bundle2 |
|
153 | 153 | $ hg --config extensions.strip= strip . |
|
154 | 154 | 0 files updated, 0 files merged, 5 files removed, 0 files unresolved |
|
155 | 155 | saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg (glob) |
|
156 | 156 | $ hg debugbundle .hg/strip-backup/* |
|
157 | 157 | Stream params: sortdict([('Compression', 'BZ')]) |
|
158 | 158 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])" |
|
159 | 159 | 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 |
|
160 | phase-heads -- 'sortdict()' | |
|
161 | 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 draft | |
|
160 | 162 | |
|
161 | 163 | $ cd .. |
@@ -1,1397 +1,1401 | |||
|
1 | 1 | $ cat >> $HGRCPATH << EOF |
|
2 | 2 | > [phases] |
|
3 | 3 | > # public changeset are not obsolete |
|
4 | 4 | > publish=false |
|
5 | 5 | > [ui] |
|
6 | 6 | > logtemplate="{rev}:{node|short} ({phase}{if(obsolete, ' *{obsolete}*')}{if(troubles, ' {troubles}')}) [{tags} {bookmarks}] {desc|firstline}\n" |
|
7 | 7 | > EOF |
|
8 | 8 | $ mkcommit() { |
|
9 | 9 | > echo "$1" > "$1" |
|
10 | 10 | > hg add "$1" |
|
11 | 11 | > hg ci -m "add $1" |
|
12 | 12 | > } |
|
13 | 13 | $ getid() { |
|
14 | 14 | > hg log -T "{node}\n" --hidden -r "desc('$1')" |
|
15 | 15 | > } |
|
16 | 16 | |
|
17 | 17 | $ cat > debugkeys.py <<EOF |
|
18 | 18 | > def reposetup(ui, repo): |
|
19 | 19 | > class debugkeysrepo(repo.__class__): |
|
20 | 20 | > def listkeys(self, namespace): |
|
21 | 21 | > ui.write('listkeys %s\n' % (namespace,)) |
|
22 | 22 | > return super(debugkeysrepo, self).listkeys(namespace) |
|
23 | 23 | > |
|
24 | 24 | > if repo.local(): |
|
25 | 25 | > repo.__class__ = debugkeysrepo |
|
26 | 26 | > EOF |
|
27 | 27 | |
|
28 | 28 | $ hg init tmpa |
|
29 | 29 | $ cd tmpa |
|
30 | 30 | $ mkcommit kill_me |
|
31 | 31 | |
|
32 | 32 | Checking that the feature is properly disabled |
|
33 | 33 | |
|
34 | 34 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar |
|
35 | 35 | abort: creating obsolete markers is not enabled on this repo |
|
36 | 36 | [255] |
|
37 | 37 | |
|
38 | 38 | Enabling it |
|
39 | 39 | |
|
40 | 40 | $ cat >> $HGRCPATH << EOF |
|
41 | 41 | > [experimental] |
|
42 | 42 | > evolution=createmarkers,exchange |
|
43 | 43 | > EOF |
|
44 | 44 | |
|
45 | 45 | Killing a single changeset without replacement |
|
46 | 46 | |
|
47 | 47 | $ hg debugobsolete 0 |
|
48 | 48 | abort: changeset references must be full hexadecimal node identifiers |
|
49 | 49 | [255] |
|
50 | 50 | $ hg debugobsolete '00' |
|
51 | 51 | abort: changeset references must be full hexadecimal node identifiers |
|
52 | 52 | [255] |
|
53 | 53 | $ hg debugobsolete -d '0 0' `getid kill_me` -u babar |
|
54 | 54 | $ hg debugobsolete |
|
55 | 55 | 97b7c2d76b1845ed3eb988cd612611e72406cef0 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'babar'} |
|
56 | 56 | |
|
57 | 57 | (test that mercurial is not confused) |
|
58 | 58 | |
|
59 | 59 | $ hg up null --quiet # having 0 as parent prevents it to be hidden |
|
60 | 60 | $ hg tip |
|
61 | 61 | -1:000000000000 (public) [tip ] |
|
62 | 62 | $ hg up --hidden tip --quiet |
|
63 | 63 | |
|
64 | 64 | Killing a single changeset with itself should fail |
|
65 | 65 | (simple local safeguard) |
|
66 | 66 | |
|
67 | 67 | $ hg debugobsolete `getid kill_me` `getid kill_me` |
|
68 | 68 | abort: bad obsmarker input: in-marker cycle with 97b7c2d76b1845ed3eb988cd612611e72406cef0 |
|
69 | 69 | [255] |
|
70 | 70 | |
|
71 | 71 | $ cd .. |
|
72 | 72 | |
|
73 | 73 | Killing a single changeset with replacement |
|
74 | 74 | (and testing the format option) |
|
75 | 75 | |
|
76 | 76 | $ hg init tmpb |
|
77 | 77 | $ cd tmpb |
|
78 | 78 | $ mkcommit a |
|
79 | 79 | $ mkcommit b |
|
80 | 80 | $ mkcommit original_c |
|
81 | 81 | $ hg up "desc('b')" |
|
82 | 82 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
83 | 83 | $ mkcommit new_c |
|
84 | 84 | created new head |
|
85 | 85 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden |
|
86 | 86 | $ hg debugobsolete --config format.obsstore-version=0 --flag 12 `getid original_c` `getid new_c` -d '121 120' |
|
87 | 87 | $ hg log -r 'hidden()' --template '{rev}:{node|short} {desc}\n' --hidden |
|
88 | 88 | 2:245bde4270cd add original_c |
|
89 | 89 | $ hg debugrevlog -cd |
|
90 | 90 | # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen |
|
91 | 91 | 0 -1 -1 0 59 0 0 0 0 58 58 0 1 0 |
|
92 | 92 | 1 0 -1 59 118 59 59 0 0 58 116 0 1 0 |
|
93 | 93 | 2 1 -1 118 193 118 118 59 0 76 192 0 1 0 |
|
94 | 94 | 3 1 -1 193 260 193 193 59 0 66 258 0 2 0 |
|
95 | 95 | $ hg debugobsolete |
|
96 | 96 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
97 | 97 | |
|
98 | 98 | (check for version number of the obsstore) |
|
99 | 99 | |
|
100 | 100 | $ dd bs=1 count=1 if=.hg/store/obsstore 2>/dev/null |
|
101 | 101 | \x00 (no-eol) (esc) |
|
102 | 102 | |
|
103 | 103 | do it again (it read the obsstore before adding new changeset) |
|
104 | 104 | |
|
105 | 105 | $ hg up '.^' |
|
106 | 106 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
107 | 107 | $ mkcommit new_2_c |
|
108 | 108 | created new head |
|
109 | 109 | $ hg debugobsolete -d '1337 0' `getid new_c` `getid new_2_c` |
|
110 | 110 | $ hg debugobsolete |
|
111 | 111 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
112 | 112 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
113 | 113 | |
|
114 | 114 | Register two markers with a missing node |
|
115 | 115 | |
|
116 | 116 | $ hg up '.^' |
|
117 | 117 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
118 | 118 | $ mkcommit new_3_c |
|
119 | 119 | created new head |
|
120 | 120 | $ hg debugobsolete -d '1338 0' `getid new_2_c` 1337133713371337133713371337133713371337 |
|
121 | 121 | $ hg debugobsolete -d '1339 0' 1337133713371337133713371337133713371337 `getid new_3_c` |
|
122 | 122 | $ hg debugobsolete |
|
123 | 123 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
124 | 124 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
125 | 125 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
126 | 126 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
127 | 127 | |
|
128 | 128 | Test the --index option of debugobsolete command |
|
129 | 129 | $ hg debugobsolete --index |
|
130 | 130 | 0 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
131 | 131 | 1 cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
132 | 132 | 2 ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
133 | 133 | 3 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
134 | 134 | |
|
135 | 135 | Refuse pathological nullid successors |
|
136 | 136 | $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000 |
|
137 | 137 | transaction abort! |
|
138 | 138 | rollback completed |
|
139 | 139 | abort: bad obsolescence marker detected: invalid successors nullid |
|
140 | 140 | [255] |
|
141 | 141 | |
|
142 | 142 | Check that graphlog detect that a changeset is obsolete: |
|
143 | 143 | |
|
144 | 144 | $ hg log -G |
|
145 | 145 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
146 | 146 | | |
|
147 | 147 | o 1:7c3bad9141dc (draft) [ ] add b |
|
148 | 148 | | |
|
149 | 149 | o 0:1f0dee641bb7 (draft) [ ] add a |
|
150 | 150 | |
|
151 | 151 | |
|
152 | 152 | check that heads does not report them |
|
153 | 153 | |
|
154 | 154 | $ hg heads |
|
155 | 155 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
156 | 156 | $ hg heads --hidden |
|
157 | 157 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
158 | 158 | 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c |
|
159 | 159 | 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c |
|
160 | 160 | 2:245bde4270cd (draft *obsolete*) [ ] add original_c |
|
161 | 161 | |
|
162 | 162 | |
|
163 | 163 | check that summary does not report them |
|
164 | 164 | |
|
165 | 165 | $ hg init ../sink |
|
166 | 166 | $ echo '[paths]' >> .hg/hgrc |
|
167 | 167 | $ echo 'default=../sink' >> .hg/hgrc |
|
168 | 168 | $ hg summary --remote |
|
169 | 169 | parent: 5:5601fb93a350 tip |
|
170 | 170 | add new_3_c |
|
171 | 171 | branch: default |
|
172 | 172 | commit: (clean) |
|
173 | 173 | update: (current) |
|
174 | 174 | phases: 3 draft |
|
175 | 175 | remote: 3 outgoing |
|
176 | 176 | |
|
177 | 177 | $ hg summary --remote --hidden |
|
178 | 178 | parent: 5:5601fb93a350 tip |
|
179 | 179 | add new_3_c |
|
180 | 180 | branch: default |
|
181 | 181 | commit: (clean) |
|
182 | 182 | update: 3 new changesets, 4 branch heads (merge) |
|
183 | 183 | phases: 6 draft |
|
184 | 184 | remote: 3 outgoing |
|
185 | 185 | |
|
186 | 186 | check that various commands work well with filtering |
|
187 | 187 | |
|
188 | 188 | $ hg tip |
|
189 | 189 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
190 | 190 | $ hg log -r 6 |
|
191 | 191 | abort: unknown revision '6'! |
|
192 | 192 | [255] |
|
193 | 193 | $ hg log -r 4 |
|
194 | 194 | abort: hidden revision '4'! |
|
195 | 195 | (use --hidden to access hidden revisions) |
|
196 | 196 | [255] |
|
197 | 197 | $ hg debugrevspec 'rev(6)' |
|
198 | 198 | $ hg debugrevspec 'rev(4)' |
|
199 | 199 | $ hg debugrevspec 'null' |
|
200 | 200 | -1 |
|
201 | 201 | |
|
202 | 202 | Check that public changeset are not accounted as obsolete: |
|
203 | 203 | |
|
204 | 204 | $ hg --hidden phase --public 2 |
|
205 | 205 | $ hg log -G |
|
206 | 206 | @ 5:5601fb93a350 (draft bumped) [tip ] add new_3_c |
|
207 | 207 | | |
|
208 | 208 | | o 2:245bde4270cd (public) [ ] add original_c |
|
209 | 209 | |/ |
|
210 | 210 | o 1:7c3bad9141dc (public) [ ] add b |
|
211 | 211 | | |
|
212 | 212 | o 0:1f0dee641bb7 (public) [ ] add a |
|
213 | 213 | |
|
214 | 214 | |
|
215 | 215 | And that bumped changeset are detected |
|
216 | 216 | -------------------------------------- |
|
217 | 217 | |
|
218 | 218 | If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also |
|
219 | 219 | note that the bumped changeset (5:5601fb93a350) is not a direct successor of |
|
220 | 220 | the public changeset |
|
221 | 221 | |
|
222 | 222 | $ hg log --hidden -r 'bumped()' |
|
223 | 223 | 5:5601fb93a350 (draft bumped) [tip ] add new_3_c |
|
224 | 224 | |
|
225 | 225 | And that we can't push bumped changeset |
|
226 | 226 | |
|
227 | 227 | $ hg push ../tmpa -r 0 --force #(make repo related) |
|
228 | 228 | pushing to ../tmpa |
|
229 | 229 | searching for changes |
|
230 | 230 | warning: repository is unrelated |
|
231 | 231 | adding changesets |
|
232 | 232 | adding manifests |
|
233 | 233 | adding file changes |
|
234 | 234 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
235 | 235 | $ hg push ../tmpa |
|
236 | 236 | pushing to ../tmpa |
|
237 | 237 | searching for changes |
|
238 | 238 | abort: push includes bumped changeset: 5601fb93a350! |
|
239 | 239 | [255] |
|
240 | 240 | |
|
241 | 241 | Fixing "bumped" situation |
|
242 | 242 | We need to create a clone of 5 and add a special marker with a flag |
|
243 | 243 | |
|
244 | 244 | $ hg summary |
|
245 | 245 | parent: 5:5601fb93a350 tip (bumped) |
|
246 | 246 | add new_3_c |
|
247 | 247 | branch: default |
|
248 | 248 | commit: (clean) |
|
249 | 249 | update: 1 new changesets, 2 branch heads (merge) |
|
250 | 250 | phases: 1 draft |
|
251 | 251 | bumped: 1 changesets |
|
252 | 252 | $ hg up '5^' |
|
253 | 253 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
254 | 254 | $ hg revert -ar 5 |
|
255 | 255 | adding new_3_c |
|
256 | 256 | $ hg ci -m 'add n3w_3_c' |
|
257 | 257 | created new head |
|
258 | 258 | $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c` |
|
259 | 259 | $ hg log -r 'bumped()' |
|
260 | 260 | $ hg log -G |
|
261 | 261 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
262 | 262 | | |
|
263 | 263 | | o 2:245bde4270cd (public) [ ] add original_c |
|
264 | 264 | |/ |
|
265 | 265 | o 1:7c3bad9141dc (public) [ ] add b |
|
266 | 266 | | |
|
267 | 267 | o 0:1f0dee641bb7 (public) [ ] add a |
|
268 | 268 | |
|
269 | 269 | |
|
270 | 270 | Basic exclusive testing |
|
271 | 271 | |
|
272 | 272 | $ hg log -G --hidden |
|
273 | 273 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
274 | 274 | | |
|
275 | 275 | | x 5:5601fb93a350 (draft *obsolete*) [ ] add new_3_c |
|
276 | 276 | |/ |
|
277 | 277 | | x 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c |
|
278 | 278 | |/ |
|
279 | 279 | | x 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c |
|
280 | 280 | |/ |
|
281 | 281 | | o 2:245bde4270cd (public) [ ] add original_c |
|
282 | 282 | |/ |
|
283 | 283 | o 1:7c3bad9141dc (public) [ ] add b |
|
284 | 284 | | |
|
285 | 285 | o 0:1f0dee641bb7 (public) [ ] add a |
|
286 | 286 | |
|
287 | 287 | $ hg debugobsolete --rev 6f9641995072 |
|
288 | 288 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
289 | 289 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
290 | 290 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
291 | 291 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
292 | 292 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
293 | 293 | $ hg debugobsolete --rev 6f9641995072 --exclusive |
|
294 | 294 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
295 | 295 | $ hg debugobsolete --rev 5601fb93a350 --hidden |
|
296 | 296 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
297 | 297 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
298 | 298 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
299 | 299 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
300 | 300 | $ hg debugobsolete --rev 5601fb93a350 --hidden --exclusive |
|
301 | 301 | $ hg debugobsolete --rev 5601fb93a350+6f9641995072 --hidden --exclusive |
|
302 | 302 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
303 | 303 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
304 | 304 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
305 | 305 | |
|
306 | 306 | $ cd .. |
|
307 | 307 | |
|
308 | 308 | Revision 0 is hidden |
|
309 | 309 | -------------------- |
|
310 | 310 | |
|
311 | 311 | $ hg init rev0hidden |
|
312 | 312 | $ cd rev0hidden |
|
313 | 313 | |
|
314 | 314 | $ mkcommit kill0 |
|
315 | 315 | $ hg up -q null |
|
316 | 316 | $ hg debugobsolete `getid kill0` |
|
317 | 317 | $ mkcommit a |
|
318 | 318 | $ mkcommit b |
|
319 | 319 | |
|
320 | 320 | Should pick the first visible revision as "repo" node |
|
321 | 321 | |
|
322 | 322 | $ hg archive ../archive-null |
|
323 | 323 | $ cat ../archive-null/.hg_archival.txt |
|
324 | 324 | repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e |
|
325 | 325 | node: 7c3bad9141dcb46ff89abf5f61856facd56e476c |
|
326 | 326 | branch: default |
|
327 | 327 | latesttag: null |
|
328 | 328 | latesttagdistance: 2 |
|
329 | 329 | changessincelatesttag: 2 |
|
330 | 330 | |
|
331 | 331 | |
|
332 | 332 | $ cd .. |
|
333 | 333 | |
|
334 | 334 | Exchange Test |
|
335 | 335 | ============================ |
|
336 | 336 | |
|
337 | 337 | Destination repo does not have any data |
|
338 | 338 | --------------------------------------- |
|
339 | 339 | |
|
340 | 340 | Simple incoming test |
|
341 | 341 | |
|
342 | 342 | $ hg init tmpc |
|
343 | 343 | $ cd tmpc |
|
344 | 344 | $ hg incoming ../tmpb |
|
345 | 345 | comparing with ../tmpb |
|
346 | 346 | 0:1f0dee641bb7 (public) [ ] add a |
|
347 | 347 | 1:7c3bad9141dc (public) [ ] add b |
|
348 | 348 | 2:245bde4270cd (public) [ ] add original_c |
|
349 | 349 | 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
350 | 350 | |
|
351 | 351 | Try to pull markers |
|
352 | 352 | (extinct changeset are excluded but marker are pushed) |
|
353 | 353 | |
|
354 | 354 | $ hg pull ../tmpb |
|
355 | 355 | pulling from ../tmpb |
|
356 | 356 | requesting all changes |
|
357 | 357 | adding changesets |
|
358 | 358 | adding manifests |
|
359 | 359 | adding file changes |
|
360 | 360 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
361 | 361 | 5 new obsolescence markers |
|
362 | 362 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
363 | 363 | $ hg debugobsolete |
|
364 | 364 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
365 | 365 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
366 | 366 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
367 | 367 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
368 | 368 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
369 | 369 | |
|
370 | 370 | Rollback//Transaction support |
|
371 | 371 | |
|
372 | 372 | $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
373 | 373 | $ hg debugobsolete |
|
374 | 374 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
375 | 375 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
376 | 376 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
377 | 377 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
378 | 378 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
379 | 379 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'} |
|
380 | 380 | $ hg rollback -n |
|
381 | 381 | repository tip rolled back to revision 3 (undo debugobsolete) |
|
382 | 382 | $ hg rollback |
|
383 | 383 | repository tip rolled back to revision 3 (undo debugobsolete) |
|
384 | 384 | $ hg debugobsolete |
|
385 | 385 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
386 | 386 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
387 | 387 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
388 | 388 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
389 | 389 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
390 | 390 | |
|
391 | 391 | $ cd .. |
|
392 | 392 | |
|
393 | 393 | Try to push markers |
|
394 | 394 | |
|
395 | 395 | $ hg init tmpd |
|
396 | 396 | $ hg -R tmpb push tmpd |
|
397 | 397 | pushing to tmpd |
|
398 | 398 | searching for changes |
|
399 | 399 | adding changesets |
|
400 | 400 | adding manifests |
|
401 | 401 | adding file changes |
|
402 | 402 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
403 | 403 | 5 new obsolescence markers |
|
404 | 404 | $ hg -R tmpd debugobsolete | sort |
|
405 | 405 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
406 | 406 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
407 | 407 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
408 | 408 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
409 | 409 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
410 | 410 | |
|
411 | 411 | Check obsolete keys are exchanged only if source has an obsolete store |
|
412 | 412 | |
|
413 | 413 | $ hg init empty |
|
414 | 414 | $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd |
|
415 | 415 | pushing to tmpd |
|
416 | 416 | listkeys phases |
|
417 | 417 | listkeys bookmarks |
|
418 | 418 | no changes found |
|
419 | 419 | listkeys phases |
|
420 | 420 | [1] |
|
421 | 421 | |
|
422 | 422 | clone support |
|
423 | 423 | (markers are copied and extinct changesets are included to allow hardlinks) |
|
424 | 424 | |
|
425 | 425 | $ hg clone tmpb clone-dest |
|
426 | 426 | updating to branch default |
|
427 | 427 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
428 | 428 | $ hg -R clone-dest log -G --hidden |
|
429 | 429 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
430 | 430 | | |
|
431 | 431 | | x 5:5601fb93a350 (draft *obsolete*) [ ] add new_3_c |
|
432 | 432 | |/ |
|
433 | 433 | | x 4:ca819180edb9 (draft *obsolete*) [ ] add new_2_c |
|
434 | 434 | |/ |
|
435 | 435 | | x 3:cdbce2fbb163 (draft *obsolete*) [ ] add new_c |
|
436 | 436 | |/ |
|
437 | 437 | | o 2:245bde4270cd (public) [ ] add original_c |
|
438 | 438 | |/ |
|
439 | 439 | o 1:7c3bad9141dc (public) [ ] add b |
|
440 | 440 | | |
|
441 | 441 | o 0:1f0dee641bb7 (public) [ ] add a |
|
442 | 442 | |
|
443 | 443 | $ hg -R clone-dest debugobsolete |
|
444 | 444 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
445 | 445 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
446 | 446 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
447 | 447 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
448 | 448 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
449 | 449 | |
|
450 | 450 | |
|
451 | 451 | Destination repo have existing data |
|
452 | 452 | --------------------------------------- |
|
453 | 453 | |
|
454 | 454 | On pull |
|
455 | 455 | |
|
456 | 456 | $ hg init tmpe |
|
457 | 457 | $ cd tmpe |
|
458 | 458 | $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 |
|
459 | 459 | $ hg pull ../tmpb |
|
460 | 460 | pulling from ../tmpb |
|
461 | 461 | requesting all changes |
|
462 | 462 | adding changesets |
|
463 | 463 | adding manifests |
|
464 | 464 | adding file changes |
|
465 | 465 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
466 | 466 | 5 new obsolescence markers |
|
467 | 467 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
468 | 468 | $ hg debugobsolete |
|
469 | 469 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
470 | 470 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
471 | 471 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
472 | 472 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
473 | 473 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
474 | 474 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
475 | 475 | |
|
476 | 476 | |
|
477 | 477 | On push |
|
478 | 478 | |
|
479 | 479 | $ hg push ../tmpc |
|
480 | 480 | pushing to ../tmpc |
|
481 | 481 | searching for changes |
|
482 | 482 | no changes found |
|
483 | 483 | 1 new obsolescence markers |
|
484 | 484 | [1] |
|
485 | 485 | $ hg -R ../tmpc debugobsolete |
|
486 | 486 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
487 | 487 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
488 | 488 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
489 | 489 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
490 | 490 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
491 | 491 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
492 | 492 | |
|
493 | 493 | detect outgoing obsolete and unstable |
|
494 | 494 | --------------------------------------- |
|
495 | 495 | |
|
496 | 496 | |
|
497 | 497 | $ hg log -G |
|
498 | 498 | o 3:6f9641995072 (draft) [tip ] add n3w_3_c |
|
499 | 499 | | |
|
500 | 500 | | o 2:245bde4270cd (public) [ ] add original_c |
|
501 | 501 | |/ |
|
502 | 502 | o 1:7c3bad9141dc (public) [ ] add b |
|
503 | 503 | | |
|
504 | 504 | o 0:1f0dee641bb7 (public) [ ] add a |
|
505 | 505 | |
|
506 | 506 | $ hg up 'desc("n3w_3_c")' |
|
507 | 507 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
508 | 508 | $ mkcommit original_d |
|
509 | 509 | $ mkcommit original_e |
|
510 | 510 | $ hg debugobsolete --record-parents `getid original_d` -d '0 0' |
|
511 | 511 | $ hg debugobsolete | grep `getid original_d` |
|
512 | 512 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
513 | 513 | $ hg log -r 'obsolete()' |
|
514 | 514 | 4:94b33453f93b (draft *obsolete*) [ ] add original_d |
|
515 | 515 | $ hg summary |
|
516 | 516 | parent: 5:cda648ca50f5 tip (unstable) |
|
517 | 517 | add original_e |
|
518 | 518 | branch: default |
|
519 | 519 | commit: (clean) |
|
520 | 520 | update: 1 new changesets, 2 branch heads (merge) |
|
521 | 521 | phases: 3 draft |
|
522 | 522 | unstable: 1 changesets |
|
523 | 523 | $ hg log -G -r '::unstable()' |
|
524 | 524 | @ 5:cda648ca50f5 (draft unstable) [tip ] add original_e |
|
525 | 525 | | |
|
526 | 526 | x 4:94b33453f93b (draft *obsolete*) [ ] add original_d |
|
527 | 527 | | |
|
528 | 528 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
529 | 529 | | |
|
530 | 530 | o 1:7c3bad9141dc (public) [ ] add b |
|
531 | 531 | | |
|
532 | 532 | o 0:1f0dee641bb7 (public) [ ] add a |
|
533 | 533 | |
|
534 | 534 | |
|
535 | 535 | refuse to push obsolete changeset |
|
536 | 536 | |
|
537 | 537 | $ hg push ../tmpc/ -r 'desc("original_d")' |
|
538 | 538 | pushing to ../tmpc/ |
|
539 | 539 | searching for changes |
|
540 | 540 | abort: push includes obsolete changeset: 94b33453f93b! |
|
541 | 541 | [255] |
|
542 | 542 | |
|
543 | 543 | refuse to push unstable changeset |
|
544 | 544 | |
|
545 | 545 | $ hg push ../tmpc/ |
|
546 | 546 | pushing to ../tmpc/ |
|
547 | 547 | searching for changes |
|
548 | 548 | abort: push includes unstable changeset: cda648ca50f5! |
|
549 | 549 | [255] |
|
550 | 550 | |
|
551 | 551 | Test that extinct changeset are properly detected |
|
552 | 552 | |
|
553 | 553 | $ hg log -r 'extinct()' |
|
554 | 554 | |
|
555 | 555 | Don't try to push extinct changeset |
|
556 | 556 | |
|
557 | 557 | $ hg init ../tmpf |
|
558 | 558 | $ hg out ../tmpf |
|
559 | 559 | comparing with ../tmpf |
|
560 | 560 | searching for changes |
|
561 | 561 | 0:1f0dee641bb7 (public) [ ] add a |
|
562 | 562 | 1:7c3bad9141dc (public) [ ] add b |
|
563 | 563 | 2:245bde4270cd (public) [ ] add original_c |
|
564 | 564 | 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
565 | 565 | 4:94b33453f93b (draft *obsolete*) [ ] add original_d |
|
566 | 566 | 5:cda648ca50f5 (draft unstable) [tip ] add original_e |
|
567 | 567 | $ hg push ../tmpf -f # -f because be push unstable too |
|
568 | 568 | pushing to ../tmpf |
|
569 | 569 | searching for changes |
|
570 | 570 | adding changesets |
|
571 | 571 | adding manifests |
|
572 | 572 | adding file changes |
|
573 | 573 | added 6 changesets with 6 changes to 6 files (+1 heads) |
|
574 | 574 | 7 new obsolescence markers |
|
575 | 575 | |
|
576 | 576 | no warning displayed |
|
577 | 577 | |
|
578 | 578 | $ hg push ../tmpf |
|
579 | 579 | pushing to ../tmpf |
|
580 | 580 | searching for changes |
|
581 | 581 | no changes found |
|
582 | 582 | [1] |
|
583 | 583 | |
|
584 | 584 | Do not warn about new head when the new head is a successors of a remote one |
|
585 | 585 | |
|
586 | 586 | $ hg log -G |
|
587 | 587 | @ 5:cda648ca50f5 (draft unstable) [tip ] add original_e |
|
588 | 588 | | |
|
589 | 589 | x 4:94b33453f93b (draft *obsolete*) [ ] add original_d |
|
590 | 590 | | |
|
591 | 591 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
592 | 592 | | |
|
593 | 593 | | o 2:245bde4270cd (public) [ ] add original_c |
|
594 | 594 | |/ |
|
595 | 595 | o 1:7c3bad9141dc (public) [ ] add b |
|
596 | 596 | | |
|
597 | 597 | o 0:1f0dee641bb7 (public) [ ] add a |
|
598 | 598 | |
|
599 | 599 | $ hg up -q 'desc(n3w_3_c)' |
|
600 | 600 | $ mkcommit obsolete_e |
|
601 | 601 | created new head |
|
602 | 602 | $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` \ |
|
603 | 603 | > -u 'test <test@example.net>' |
|
604 | 604 | $ hg outgoing ../tmpf # parasite hg outgoing testin |
|
605 | 605 | comparing with ../tmpf |
|
606 | 606 | searching for changes |
|
607 | 607 | 6:3de5eca88c00 (draft) [tip ] add obsolete_e |
|
608 | 608 | $ hg push ../tmpf |
|
609 | 609 | pushing to ../tmpf |
|
610 | 610 | searching for changes |
|
611 | 611 | adding changesets |
|
612 | 612 | adding manifests |
|
613 | 613 | adding file changes |
|
614 | 614 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
615 | 615 | 1 new obsolescence markers |
|
616 | 616 | |
|
617 | 617 | test relevance computation |
|
618 | 618 | --------------------------------------- |
|
619 | 619 | |
|
620 | 620 | Checking simple case of "marker relevance". |
|
621 | 621 | |
|
622 | 622 | |
|
623 | 623 | Reminder of the repo situation |
|
624 | 624 | |
|
625 | 625 | $ hg log --hidden --graph |
|
626 | 626 | @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e |
|
627 | 627 | | |
|
628 | 628 | | x 5:cda648ca50f5 (draft *obsolete*) [ ] add original_e |
|
629 | 629 | | | |
|
630 | 630 | | x 4:94b33453f93b (draft *obsolete*) [ ] add original_d |
|
631 | 631 | |/ |
|
632 | 632 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
633 | 633 | | |
|
634 | 634 | | o 2:245bde4270cd (public) [ ] add original_c |
|
635 | 635 | |/ |
|
636 | 636 | o 1:7c3bad9141dc (public) [ ] add b |
|
637 | 637 | | |
|
638 | 638 | o 0:1f0dee641bb7 (public) [ ] add a |
|
639 | 639 | |
|
640 | 640 | |
|
641 | 641 | List of all markers |
|
642 | 642 | |
|
643 | 643 | $ hg debugobsolete |
|
644 | 644 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
645 | 645 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
646 | 646 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
647 | 647 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
648 | 648 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
649 | 649 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
650 | 650 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
651 | 651 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test <test@example.net>'} (glob) |
|
652 | 652 | |
|
653 | 653 | List of changesets with no chain |
|
654 | 654 | |
|
655 | 655 | $ hg debugobsolete --hidden --rev ::2 |
|
656 | 656 | |
|
657 | 657 | List of changesets that are included on marker chain |
|
658 | 658 | |
|
659 | 659 | $ hg debugobsolete --hidden --rev 6 |
|
660 | 660 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test <test@example.net>'} (glob) |
|
661 | 661 | |
|
662 | 662 | List of changesets with a longer chain, (including a pruned children) |
|
663 | 663 | |
|
664 | 664 | $ hg debugobsolete --hidden --rev 3 |
|
665 | 665 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
666 | 666 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
667 | 667 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
668 | 668 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
669 | 669 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
670 | 670 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
671 | 671 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
672 | 672 | |
|
673 | 673 | List of both |
|
674 | 674 | |
|
675 | 675 | $ hg debugobsolete --hidden --rev 3::6 |
|
676 | 676 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
677 | 677 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
678 | 678 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
679 | 679 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
680 | 680 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
681 | 681 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
682 | 682 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test <test@example.net>'} (glob) |
|
683 | 683 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
684 | 684 | |
|
685 | 685 | List of all markers in JSON |
|
686 | 686 | |
|
687 | 687 | $ hg debugobsolete -Tjson |
|
688 | 688 | [ |
|
689 | 689 | { |
|
690 | 690 | "date": [1339.0, 0], |
|
691 | 691 | "flag": 0, |
|
692 | 692 | "metadata": {"user": "test"}, |
|
693 | 693 | "precnode": "1339133913391339133913391339133913391339", |
|
694 | 694 | "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"] |
|
695 | 695 | }, |
|
696 | 696 | { |
|
697 | 697 | "date": [1339.0, 0], |
|
698 | 698 | "flag": 0, |
|
699 | 699 | "metadata": {"user": "test"}, |
|
700 | 700 | "precnode": "1337133713371337133713371337133713371337", |
|
701 | 701 | "succnodes": ["5601fb93a350734d935195fee37f4054c529ff39"] |
|
702 | 702 | }, |
|
703 | 703 | { |
|
704 | 704 | "date": [121.0, 120], |
|
705 | 705 | "flag": 12, |
|
706 | 706 | "metadata": {"user": "test"}, |
|
707 | 707 | "precnode": "245bde4270cd1072a27757984f9cda8ba26f08ca", |
|
708 | 708 | "succnodes": ["cdbce2fbb16313928851e97e0d85413f3f7eb77f"] |
|
709 | 709 | }, |
|
710 | 710 | { |
|
711 | 711 | "date": [1338.0, 0], |
|
712 | 712 | "flag": 1, |
|
713 | 713 | "metadata": {"user": "test"}, |
|
714 | 714 | "precnode": "5601fb93a350734d935195fee37f4054c529ff39", |
|
715 | 715 | "succnodes": ["6f96419950729f3671185b847352890f074f7557"] |
|
716 | 716 | }, |
|
717 | 717 | { |
|
718 | 718 | "date": [1338.0, 0], |
|
719 | 719 | "flag": 0, |
|
720 | 720 | "metadata": {"user": "test"}, |
|
721 | 721 | "precnode": "ca819180edb99ed25ceafb3e9584ac287e240b00", |
|
722 | 722 | "succnodes": ["1337133713371337133713371337133713371337"] |
|
723 | 723 | }, |
|
724 | 724 | { |
|
725 | 725 | "date": [1337.0, 0], |
|
726 | 726 | "flag": 0, |
|
727 | 727 | "metadata": {"user": "test"}, |
|
728 | 728 | "precnode": "cdbce2fbb16313928851e97e0d85413f3f7eb77f", |
|
729 | 729 | "succnodes": ["ca819180edb99ed25ceafb3e9584ac287e240b00"] |
|
730 | 730 | }, |
|
731 | 731 | { |
|
732 | 732 | "date": [0.0, 0], |
|
733 | 733 | "flag": 0, |
|
734 | 734 | "metadata": {"user": "test"}, |
|
735 | 735 | "parentnodes": ["6f96419950729f3671185b847352890f074f7557"], |
|
736 | 736 | "precnode": "94b33453f93bdb8d457ef9b770851a618bf413e1", |
|
737 | 737 | "succnodes": [] |
|
738 | 738 | }, |
|
739 | 739 | { |
|
740 | 740 | "date": *, (glob) |
|
741 | 741 | "flag": 0, |
|
742 | 742 | "metadata": {"user": "test <test@example.net>"}, |
|
743 | 743 | "precnode": "cda648ca50f50482b7055c0b0c4c117bba6733d9", |
|
744 | 744 | "succnodes": ["3de5eca88c00aa039da7399a220f4a5221faa585"] |
|
745 | 745 | } |
|
746 | 746 | ] |
|
747 | 747 | |
|
748 | 748 | Template keywords |
|
749 | 749 | |
|
750 | 750 | $ hg debugobsolete -r6 -T '{succnodes % "{node|short}"} {date|shortdate}\n' |
|
751 | 751 | 3de5eca88c00 ????-??-?? (glob) |
|
752 | 752 | $ hg debugobsolete -r6 -T '{join(metadata % "{key}={value}", " ")}\n' |
|
753 | 753 | user=test <test@example.net> |
|
754 | 754 | $ hg debugobsolete -r6 -T '{metadata}\n' |
|
755 | 755 | 'user': 'test <test@example.net>' |
|
756 | 756 | $ hg debugobsolete -r6 -T '{flag} {get(metadata, "user")}\n' |
|
757 | 757 | 0 test <test@example.net> |
|
758 | 758 | |
|
759 | 759 | Test the debug output for exchange |
|
760 | 760 | ---------------------------------- |
|
761 | 761 | |
|
762 | 762 | $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' # bundle2 |
|
763 | 763 | pulling from ../tmpb |
|
764 | 764 | searching for changes |
|
765 | 765 | no changes found |
|
766 | 766 | obsmarker-exchange: 346 bytes received |
|
767 | 767 | |
|
768 | 768 | check hgweb does not explode |
|
769 | 769 | ==================================== |
|
770 | 770 | |
|
771 | 771 | $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg |
|
772 | 772 | adding changesets |
|
773 | 773 | adding manifests |
|
774 | 774 | adding file changes |
|
775 | 775 | added 62 changesets with 63 changes to 9 files (+60 heads) |
|
776 | 776 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
777 | 777 | $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`; |
|
778 | 778 | > do |
|
779 | 779 | > hg debugobsolete $node |
|
780 | 780 | > done |
|
781 | 781 | $ hg up tip |
|
782 | 782 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
783 | 783 | |
|
784 | 784 | #if serve |
|
785 | 785 | |
|
786 | 786 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
787 | 787 | $ cat hg.pid >> $DAEMON_PIDS |
|
788 | 788 | |
|
789 | 789 | check changelog view |
|
790 | 790 | |
|
791 | 791 | $ get-with-headers.py --headeronly localhost:$HGPORT 'shortlog/' |
|
792 | 792 | 200 Script output follows |
|
793 | 793 | |
|
794 | 794 | check graph view |
|
795 | 795 | |
|
796 | 796 | $ get-with-headers.py --headeronly localhost:$HGPORT 'graph' |
|
797 | 797 | 200 Script output follows |
|
798 | 798 | |
|
799 | 799 | check filelog view |
|
800 | 800 | |
|
801 | 801 | $ get-with-headers.py --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar' |
|
802 | 802 | 200 Script output follows |
|
803 | 803 | |
|
804 | 804 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/68' |
|
805 | 805 | 200 Script output follows |
|
806 | 806 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67' |
|
807 | 807 | 404 Not Found |
|
808 | 808 | [1] |
|
809 | 809 | |
|
810 | 810 | check that web.view config option: |
|
811 | 811 | |
|
812 | 812 | $ killdaemons.py hg.pid |
|
813 | 813 | $ cat >> .hg/hgrc << EOF |
|
814 | 814 | > [web] |
|
815 | 815 | > view=all |
|
816 | 816 | > EOF |
|
817 | 817 | $ wait |
|
818 | 818 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
819 | 819 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/67' |
|
820 | 820 | 200 Script output follows |
|
821 | 821 | $ killdaemons.py hg.pid |
|
822 | 822 | |
|
823 | 823 | Checking _enable=False warning if obsolete marker exists |
|
824 | 824 | |
|
825 | 825 | $ echo '[experimental]' >> $HGRCPATH |
|
826 | 826 | $ echo "evolution=" >> $HGRCPATH |
|
827 | 827 | $ hg log -r tip |
|
828 | 828 | obsolete feature not enabled but 68 markers found! |
|
829 | 829 | 68:c15e9edfca13 (draft) [tip ] add celestine |
|
830 | 830 | |
|
831 | 831 | reenable for later test |
|
832 | 832 | |
|
833 | 833 | $ echo '[experimental]' >> $HGRCPATH |
|
834 | 834 | $ echo "evolution=createmarkers,exchange" >> $HGRCPATH |
|
835 | 835 | |
|
836 | 836 | $ rm hg.pid access.log errors.log |
|
837 | 837 | #endif |
|
838 | 838 | |
|
839 | 839 | Several troubles on the same changeset (create an unstable and bumped changeset) |
|
840 | 840 | |
|
841 | 841 | $ hg debugobsolete `getid obsolete_e` |
|
842 | 842 | $ hg debugobsolete `getid original_c` `getid babar` |
|
843 | 843 | $ hg log --config ui.logtemplate= -r 'bumped() and unstable()' |
|
844 | 844 | changeset: 7:50c51b361e60 |
|
845 | 845 | user: test |
|
846 | 846 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
847 | 847 | trouble: unstable, bumped |
|
848 | 848 | summary: add babar |
|
849 | 849 | |
|
850 | 850 | |
|
851 | 851 | test the "obsolete" templatekw |
|
852 | 852 | |
|
853 | 853 | $ hg log -r 'obsolete()' |
|
854 | 854 | 6:3de5eca88c00 (draft *obsolete*) [ ] add obsolete_e |
|
855 | 855 | |
|
856 | 856 | test the "troubles" templatekw |
|
857 | 857 | |
|
858 | 858 | $ hg log -r 'bumped() and unstable()' |
|
859 | 859 | 7:50c51b361e60 (draft unstable bumped) [ ] add babar |
|
860 | 860 | |
|
861 | 861 | test the default cmdline template |
|
862 | 862 | |
|
863 | 863 | $ hg log -T default -r 'bumped()' |
|
864 | 864 | changeset: 7:50c51b361e60 |
|
865 | 865 | user: test |
|
866 | 866 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
867 | 867 | trouble: unstable, bumped |
|
868 | 868 | summary: add babar |
|
869 | 869 | |
|
870 | 870 | $ hg log -T default -r 'obsolete()' |
|
871 | 871 | changeset: 6:3de5eca88c00 |
|
872 | 872 | parent: 3:6f9641995072 |
|
873 | 873 | user: test |
|
874 | 874 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
875 | 875 | summary: add obsolete_e |
|
876 | 876 | |
|
877 | 877 | |
|
878 | 878 | test summary output |
|
879 | 879 | |
|
880 | 880 | $ hg up -r 'bumped() and unstable()' |
|
881 | 881 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
882 | 882 | $ hg summary |
|
883 | 883 | parent: 7:50c51b361e60 (unstable, bumped) |
|
884 | 884 | add babar |
|
885 | 885 | branch: default |
|
886 | 886 | commit: (clean) |
|
887 | 887 | update: 2 new changesets (update) |
|
888 | 888 | phases: 4 draft |
|
889 | 889 | unstable: 2 changesets |
|
890 | 890 | bumped: 1 changesets |
|
891 | 891 | $ hg up -r 'obsolete()' |
|
892 | 892 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
893 | 893 | $ hg summary |
|
894 | 894 | parent: 6:3de5eca88c00 (obsolete) |
|
895 | 895 | add obsolete_e |
|
896 | 896 | branch: default |
|
897 | 897 | commit: (clean) |
|
898 | 898 | update: 3 new changesets (update) |
|
899 | 899 | phases: 4 draft |
|
900 | 900 | unstable: 2 changesets |
|
901 | 901 | bumped: 1 changesets |
|
902 | 902 | |
|
903 | 903 | Test incoming/outcoming with changesets obsoleted remotely, known locally |
|
904 | 904 | =============================================================================== |
|
905 | 905 | |
|
906 | 906 | This test issue 3805 |
|
907 | 907 | |
|
908 | 908 | $ hg init repo-issue3805 |
|
909 | 909 | $ cd repo-issue3805 |
|
910 | 910 | $ echo "base" > base |
|
911 | 911 | $ hg ci -Am "base" |
|
912 | 912 | adding base |
|
913 | 913 | $ echo "foo" > foo |
|
914 | 914 | $ hg ci -Am "A" |
|
915 | 915 | adding foo |
|
916 | 916 | $ hg clone . ../other-issue3805 |
|
917 | 917 | updating to branch default |
|
918 | 918 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
919 | 919 | $ echo "bar" >> foo |
|
920 | 920 | $ hg ci --amend |
|
921 | 921 | $ cd ../other-issue3805 |
|
922 | 922 | $ hg log -G |
|
923 | 923 | @ 1:29f0c6921ddd (draft) [tip ] A |
|
924 | 924 | | |
|
925 | 925 | o 0:d20a80d4def3 (draft) [ ] base |
|
926 | 926 | |
|
927 | 927 | $ hg log -G -R ../repo-issue3805 |
|
928 | 928 | @ 3:323a9c3ddd91 (draft) [tip ] A |
|
929 | 929 | | |
|
930 | 930 | o 0:d20a80d4def3 (draft) [ ] base |
|
931 | 931 | |
|
932 | 932 | $ hg incoming |
|
933 | 933 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
934 | 934 | searching for changes |
|
935 | 935 | 3:323a9c3ddd91 (draft) [tip ] A |
|
936 | 936 | $ hg incoming --bundle ../issue3805.hg |
|
937 | 937 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
938 | 938 | searching for changes |
|
939 | 939 | 3:323a9c3ddd91 (draft) [tip ] A |
|
940 | 940 | $ hg outgoing |
|
941 | 941 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
942 | 942 | searching for changes |
|
943 | 943 | 1:29f0c6921ddd (draft) [tip ] A |
|
944 | 944 | |
|
945 | 945 | #if serve |
|
946 | 946 | |
|
947 | 947 | $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
948 | 948 | $ cat hg.pid >> $DAEMON_PIDS |
|
949 | 949 | |
|
950 | 950 | $ hg incoming http://localhost:$HGPORT |
|
951 | 951 | comparing with http://localhost:$HGPORT/ |
|
952 | 952 | searching for changes |
|
953 | 953 | 2:323a9c3ddd91 (draft) [tip ] A |
|
954 | 954 | $ hg outgoing http://localhost:$HGPORT |
|
955 | 955 | comparing with http://localhost:$HGPORT/ |
|
956 | 956 | searching for changes |
|
957 | 957 | 1:29f0c6921ddd (draft) [tip ] A |
|
958 | 958 | |
|
959 | 959 | $ killdaemons.py |
|
960 | 960 | |
|
961 | 961 | #endif |
|
962 | 962 | |
|
963 | 963 | This test issue 3814 |
|
964 | 964 | |
|
965 | 965 | (nothing to push but locally hidden changeset) |
|
966 | 966 | |
|
967 | 967 | $ cd .. |
|
968 | 968 | $ hg init repo-issue3814 |
|
969 | 969 | $ cd repo-issue3805 |
|
970 | 970 | $ hg push -r 323a9c3ddd91 ../repo-issue3814 |
|
971 | 971 | pushing to ../repo-issue3814 |
|
972 | 972 | searching for changes |
|
973 | 973 | adding changesets |
|
974 | 974 | adding manifests |
|
975 | 975 | adding file changes |
|
976 | 976 | added 2 changesets with 2 changes to 2 files |
|
977 | 977 | 2 new obsolescence markers |
|
978 | 978 | $ hg out ../repo-issue3814 |
|
979 | 979 | comparing with ../repo-issue3814 |
|
980 | 980 | searching for changes |
|
981 | 981 | no changes found |
|
982 | 982 | [1] |
|
983 | 983 | |
|
984 | 984 | Test that a local tag blocks a changeset from being hidden |
|
985 | 985 | |
|
986 | 986 | $ hg tag -l visible -r 1 --hidden |
|
987 | 987 | $ hg log -G |
|
988 | 988 | @ 3:323a9c3ddd91 (draft) [tip ] A |
|
989 | 989 | | |
|
990 | 990 | | x 1:29f0c6921ddd (draft *obsolete*) [visible ] A |
|
991 | 991 | |/ |
|
992 | 992 | o 0:d20a80d4def3 (draft) [ ] base |
|
993 | 993 | |
|
994 | 994 | Test that removing a local tag does not cause some commands to fail |
|
995 | 995 | |
|
996 | 996 | $ hg tag -l -r tip tiptag |
|
997 | 997 | $ hg tags |
|
998 | 998 | tiptag 3:323a9c3ddd91 |
|
999 | 999 | tip 3:323a9c3ddd91 |
|
1000 | 1000 | visible 1:29f0c6921ddd |
|
1001 | 1001 | $ hg --config extensions.strip= strip -r tip --no-backup |
|
1002 | 1002 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1003 | 1003 | $ hg tags |
|
1004 | 1004 | visible 1:29f0c6921ddd |
|
1005 | 1005 | tip 1:29f0c6921ddd |
|
1006 | 1006 | |
|
1007 | 1007 | Test bundle overlay onto hidden revision |
|
1008 | 1008 | |
|
1009 | 1009 | $ cd .. |
|
1010 | 1010 | $ hg init repo-bundleoverlay |
|
1011 | 1011 | $ cd repo-bundleoverlay |
|
1012 | 1012 | $ echo "A" > foo |
|
1013 | 1013 | $ hg ci -Am "A" |
|
1014 | 1014 | adding foo |
|
1015 | 1015 | $ echo "B" >> foo |
|
1016 | 1016 | $ hg ci -m "B" |
|
1017 | 1017 | $ hg up 0 |
|
1018 | 1018 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1019 | 1019 | $ echo "C" >> foo |
|
1020 | 1020 | $ hg ci -m "C" |
|
1021 | 1021 | created new head |
|
1022 | 1022 | $ hg log -G |
|
1023 | 1023 | @ 2:c186d7714947 (draft) [tip ] C |
|
1024 | 1024 | | |
|
1025 | 1025 | | o 1:44526ebb0f98 (draft) [ ] B |
|
1026 | 1026 | |/ |
|
1027 | 1027 | o 0:4b34ecfb0d56 (draft) [ ] A |
|
1028 | 1028 | |
|
1029 | 1029 | |
|
1030 | 1030 | $ hg clone -r1 . ../other-bundleoverlay |
|
1031 | 1031 | adding changesets |
|
1032 | 1032 | adding manifests |
|
1033 | 1033 | adding file changes |
|
1034 | 1034 | added 2 changesets with 2 changes to 1 files |
|
1035 | 1035 | updating to branch default |
|
1036 | 1036 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1037 | 1037 | $ cd ../other-bundleoverlay |
|
1038 | 1038 | $ echo "B+" >> foo |
|
1039 | 1039 | $ hg ci --amend -m "B+" |
|
1040 | 1040 | $ hg log -G --hidden |
|
1041 | 1041 | @ 3:b7d587542d40 (draft) [tip ] B+ |
|
1042 | 1042 | | |
|
1043 | 1043 | | x 2:eb95e9297e18 (draft *obsolete*) [ ] temporary amend commit for 44526ebb0f98 |
|
1044 | 1044 | | | |
|
1045 | 1045 | | x 1:44526ebb0f98 (draft *obsolete*) [ ] B |
|
1046 | 1046 | |/ |
|
1047 | 1047 | o 0:4b34ecfb0d56 (draft) [ ] A |
|
1048 | 1048 | |
|
1049 | 1049 | |
|
1050 | 1050 | $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg |
|
1051 | 1051 | comparing with ../repo-bundleoverlay |
|
1052 | 1052 | searching for changes |
|
1053 | 1053 | 1:44526ebb0f98 (draft) [ ] B |
|
1054 | 1054 | 2:c186d7714947 (draft) [tip ] C |
|
1055 | 1055 | $ hg log -G -R ../bundleoverlay.hg |
|
1056 | 1056 | o 4:c186d7714947 (draft) [tip ] C |
|
1057 | 1057 | | |
|
1058 | 1058 | | @ 3:b7d587542d40 (draft) [ ] B+ |
|
1059 | 1059 | |/ |
|
1060 | 1060 | o 0:4b34ecfb0d56 (draft) [ ] A |
|
1061 | 1061 | |
|
1062 | 1062 | |
|
1063 | 1063 | #if serve |
|
1064 | 1064 | |
|
1065 | 1065 | Test issue 4506 |
|
1066 | 1066 | |
|
1067 | 1067 | $ cd .. |
|
1068 | 1068 | $ hg init repo-issue4506 |
|
1069 | 1069 | $ cd repo-issue4506 |
|
1070 | 1070 | $ echo "0" > foo |
|
1071 | 1071 | $ hg add foo |
|
1072 | 1072 | $ hg ci -m "content-0" |
|
1073 | 1073 | |
|
1074 | 1074 | $ hg up null |
|
1075 | 1075 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1076 | 1076 | $ echo "1" > bar |
|
1077 | 1077 | $ hg add bar |
|
1078 | 1078 | $ hg ci -m "content-1" |
|
1079 | 1079 | created new head |
|
1080 | 1080 | $ hg up 0 |
|
1081 | 1081 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1082 | 1082 | $ hg graft 1 |
|
1083 | 1083 | grafting 1:1c9eddb02162 "content-1" (tip) |
|
1084 | 1084 | |
|
1085 | 1085 | $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'` |
|
1086 | 1086 | |
|
1087 | 1087 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
1088 | 1088 | $ cat hg.pid >> $DAEMON_PIDS |
|
1089 | 1089 | |
|
1090 | 1090 | $ get-with-headers.py --headeronly localhost:$HGPORT 'rev/1' |
|
1091 | 1091 | 404 Not Found |
|
1092 | 1092 | [1] |
|
1093 | 1093 | $ get-with-headers.py --headeronly localhost:$HGPORT 'file/tip/bar' |
|
1094 | 1094 | 200 Script output follows |
|
1095 | 1095 | $ get-with-headers.py --headeronly localhost:$HGPORT 'annotate/tip/bar' |
|
1096 | 1096 | 200 Script output follows |
|
1097 | 1097 | |
|
1098 | 1098 | $ killdaemons.py |
|
1099 | 1099 | |
|
1100 | 1100 | #endif |
|
1101 | 1101 | |
|
1102 | 1102 | Test heads computation on pending index changes with obsolescence markers |
|
1103 | 1103 | $ cd .. |
|
1104 | 1104 | $ cat >$TESTTMP/test_extension.py << EOF |
|
1105 | 1105 | > from mercurial import cmdutil, registrar |
|
1106 | 1106 | > from mercurial.i18n import _ |
|
1107 | 1107 | > |
|
1108 | 1108 | > cmdtable = {} |
|
1109 | 1109 | > command = registrar.command(cmdtable) |
|
1110 | 1110 | > @command("amendtransient",[], _('hg amendtransient [rev]')) |
|
1111 | 1111 | > def amend(ui, repo, *pats, **opts): |
|
1112 | 1112 | > def commitfunc(ui, repo, message, match, opts): |
|
1113 | 1113 | > return repo.commit(message, repo['.'].user(), repo['.'].date(), match) |
|
1114 | 1114 | > opts['message'] = 'Test' |
|
1115 | 1115 | > opts['logfile'] = None |
|
1116 | 1116 | > cmdutil.amend(ui, repo, commitfunc, repo['.'], {}, pats, opts) |
|
1117 | 1117 | > ui.write('%s\n' % repo.changelog.headrevs()) |
|
1118 | 1118 | > EOF |
|
1119 | 1119 | $ cat >> $HGRCPATH << EOF |
|
1120 | 1120 | > [extensions] |
|
1121 | 1121 | > testextension=$TESTTMP/test_extension.py |
|
1122 | 1122 | > EOF |
|
1123 | 1123 | $ hg init repo-issue-nativerevs-pending-changes |
|
1124 | 1124 | $ cd repo-issue-nativerevs-pending-changes |
|
1125 | 1125 | $ mkcommit a |
|
1126 | 1126 | $ mkcommit b |
|
1127 | 1127 | $ hg up ".^" |
|
1128 | 1128 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1129 | 1129 | $ echo aa > a |
|
1130 | 1130 | $ hg amendtransient |
|
1131 | 1131 | [1, 3] |
|
1132 | 1132 | |
|
1133 | 1133 | Test cache consistency for the visible filter |
|
1134 | 1134 | 1) We want to make sure that the cached filtered revs are invalidated when |
|
1135 | 1135 | bookmarks change |
|
1136 | 1136 | $ cd .. |
|
1137 | 1137 | $ cat >$TESTTMP/test_extension.py << EOF |
|
1138 | 1138 | > import weakref |
|
1139 | 1139 | > from mercurial import cmdutil, extensions, bookmarks, repoview |
|
1140 | 1140 | > def _bookmarkchanged(orig, bkmstoreinst, *args, **kwargs): |
|
1141 | 1141 | > reporef = weakref.ref(bkmstoreinst._repo) |
|
1142 | 1142 | > def trhook(tr): |
|
1143 | 1143 | > repo = reporef() |
|
1144 | 1144 | > hidden1 = repoview.computehidden(repo) |
|
1145 | 1145 | > hidden = repoview.filterrevs(repo, 'visible') |
|
1146 | 1146 | > if sorted(hidden1) != sorted(hidden): |
|
1147 | 1147 | > print "cache inconsistency" |
|
1148 | 1148 | > bkmstoreinst._repo.currenttransaction().addpostclose('test_extension', trhook) |
|
1149 | 1149 | > orig(bkmstoreinst, *args, **kwargs) |
|
1150 | 1150 | > def extsetup(ui): |
|
1151 | 1151 | > extensions.wrapfunction(bookmarks.bmstore, 'recordchange', |
|
1152 | 1152 | > _bookmarkchanged) |
|
1153 | 1153 | > EOF |
|
1154 | 1154 | |
|
1155 | 1155 | $ hg init repo-cache-inconsistency |
|
1156 | 1156 | $ cd repo-issue-nativerevs-pending-changes |
|
1157 | 1157 | $ mkcommit a |
|
1158 | 1158 | a already tracked! |
|
1159 | 1159 | $ mkcommit b |
|
1160 | 1160 | $ hg id |
|
1161 | 1161 | 13bedc178fce tip |
|
1162 | 1162 | $ echo "hello" > b |
|
1163 | 1163 | $ hg commit --amend -m "message" |
|
1164 | 1164 | $ hg book bookb -r 13bedc178fce --hidden |
|
1165 | 1165 | $ hg log -r 13bedc178fce |
|
1166 | 1166 | 5:13bedc178fce (draft *obsolete*) [ bookb] add b |
|
1167 | 1167 | $ hg book -d bookb |
|
1168 | 1168 | $ hg log -r 13bedc178fce |
|
1169 | 1169 | abort: hidden revision '13bedc178fce'! |
|
1170 | 1170 | (use --hidden to access hidden revisions) |
|
1171 | 1171 | [255] |
|
1172 | 1172 | |
|
1173 | 1173 | Empty out the test extension, as it isn't compatible with later parts |
|
1174 | 1174 | of the test. |
|
1175 | 1175 | $ echo > $TESTTMP/test_extension.py |
|
1176 | 1176 | |
|
1177 | 1177 | Test ability to pull changeset with locally applying obsolescence markers |
|
1178 | 1178 | (issue4945) |
|
1179 | 1179 | |
|
1180 | 1180 | $ cd .. |
|
1181 | 1181 | $ hg init issue4845 |
|
1182 | 1182 | $ cd issue4845 |
|
1183 | 1183 | |
|
1184 | 1184 | $ echo foo > f0 |
|
1185 | 1185 | $ hg add f0 |
|
1186 | 1186 | $ hg ci -m '0' |
|
1187 | 1187 | $ echo foo > f1 |
|
1188 | 1188 | $ hg add f1 |
|
1189 | 1189 | $ hg ci -m '1' |
|
1190 | 1190 | $ echo foo > f2 |
|
1191 | 1191 | $ hg add f2 |
|
1192 | 1192 | $ hg ci -m '2' |
|
1193 | 1193 | |
|
1194 | 1194 | $ echo bar > f2 |
|
1195 | 1195 | $ hg commit --amend --config experimetnal.evolution=createmarkers |
|
1196 | 1196 | $ hg log -G |
|
1197 | 1197 | @ 4:b0551702f918 (draft) [tip ] 2 |
|
1198 | 1198 | | |
|
1199 | 1199 | o 1:e016b03fd86f (draft) [ ] 1 |
|
1200 | 1200 | | |
|
1201 | 1201 | o 0:a78f55e5508c (draft) [ ] 0 |
|
1202 | 1202 | |
|
1203 | 1203 | $ hg log -G --hidden |
|
1204 | 1204 | @ 4:b0551702f918 (draft) [tip ] 2 |
|
1205 | 1205 | | |
|
1206 | 1206 | | x 3:f27abbcc1f77 (draft *obsolete*) [ ] temporary amend commit for e008cf283490 |
|
1207 | 1207 | | | |
|
1208 | 1208 | | x 2:e008cf283490 (draft *obsolete*) [ ] 2 |
|
1209 | 1209 | |/ |
|
1210 | 1210 | o 1:e016b03fd86f (draft) [ ] 1 |
|
1211 | 1211 | | |
|
1212 | 1212 | o 0:a78f55e5508c (draft) [ ] 0 |
|
1213 | 1213 | |
|
1214 | 1214 | |
|
1215 | 1215 | $ hg strip --hidden -r 2 --config extensions.strip= --config devel.strip-obsmarkers=no |
|
1216 | 1216 | saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e008cf283490-39c978dc-backup.hg (glob) |
|
1217 | 1217 | $ hg debugobsolete |
|
1218 | 1218 | e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob) |
|
1219 | 1219 | f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob) |
|
1220 | 1220 | $ hg log -G |
|
1221 | 1221 | @ 2:b0551702f918 (draft) [tip ] 2 |
|
1222 | 1222 | | |
|
1223 | 1223 | o 1:e016b03fd86f (draft) [ ] 1 |
|
1224 | 1224 | | |
|
1225 | 1225 | o 0:a78f55e5508c (draft) [ ] 0 |
|
1226 | 1226 | |
|
1227 | 1227 | $ hg log -G --hidden |
|
1228 | 1228 | @ 2:b0551702f918 (draft) [tip ] 2 |
|
1229 | 1229 | | |
|
1230 | 1230 | o 1:e016b03fd86f (draft) [ ] 1 |
|
1231 | 1231 | | |
|
1232 | 1232 | o 0:a78f55e5508c (draft) [ ] 0 |
|
1233 | 1233 | |
|
1234 | 1234 | $ hg debugbundle .hg/strip-backup/e008cf283490-*-backup.hg |
|
1235 | 1235 | Stream params: sortdict([('Compression', 'BZ')]) |
|
1236 | 1236 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])" |
|
1237 | 1237 | e008cf2834908e5d6b0f792a9d4b0e2272260fb8 |
|
1238 | 1238 | f27abbcc1f77fb409cf9160482fe619541e2d605 |
|
1239 | 1239 | obsmarkers -- 'sortdict()' |
|
1240 | 1240 | version: 1 (70 bytes) |
|
1241 | 1241 | f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
1242 | phase-heads -- 'sortdict()' | |
|
1243 | f27abbcc1f77fb409cf9160482fe619541e2d605 draft | |
|
1242 | 1244 | |
|
1243 | 1245 | $ hg pull .hg/strip-backup/e008cf283490-*-backup.hg |
|
1244 | 1246 | pulling from .hg/strip-backup/e008cf283490-39c978dc-backup.hg |
|
1245 | 1247 | searching for changes |
|
1246 | 1248 | no changes found |
|
1247 | 1249 | $ hg debugobsolete |
|
1248 | 1250 | e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob) |
|
1249 | 1251 | f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob) |
|
1250 | 1252 | $ hg log -G |
|
1251 | 1253 | @ 2:b0551702f918 (draft) [tip ] 2 |
|
1252 | 1254 | | |
|
1253 | 1255 | o 1:e016b03fd86f (draft) [ ] 1 |
|
1254 | 1256 | | |
|
1255 | 1257 | o 0:a78f55e5508c (draft) [ ] 0 |
|
1256 | 1258 | |
|
1257 | 1259 | $ hg log -G --hidden |
|
1258 | 1260 | @ 2:b0551702f918 (draft) [tip ] 2 |
|
1259 | 1261 | | |
|
1260 | 1262 | o 1:e016b03fd86f (draft) [ ] 1 |
|
1261 | 1263 | | |
|
1262 | 1264 | o 0:a78f55e5508c (draft) [ ] 0 |
|
1263 | 1265 | |
|
1264 | 1266 | |
|
1265 | 1267 | Testing that strip remove markers: |
|
1266 | 1268 | |
|
1267 | 1269 | $ hg strip -r 1 --config extensions.strip= |
|
1268 | 1270 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1269 | 1271 | saved backup bundle to $TESTTMP/tmpe/issue4845/.hg/strip-backup/e016b03fd86f-65ede734-backup.hg (glob) |
|
1270 | 1272 | $ hg debugobsolete |
|
1271 | 1273 | $ hg log -G |
|
1272 | 1274 | @ 0:a78f55e5508c (draft) [tip ] 0 |
|
1273 | 1275 | |
|
1274 | 1276 | $ hg log -G --hidden |
|
1275 | 1277 | @ 0:a78f55e5508c (draft) [tip ] 0 |
|
1276 | 1278 | |
|
1277 | 1279 | $ hg debugbundle .hg/strip-backup/e016b03fd86f-*-backup.hg |
|
1278 | 1280 | Stream params: sortdict([('Compression', 'BZ')]) |
|
1279 | 1281 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '2')])" |
|
1280 | 1282 | e016b03fd86fcccc54817d120b90b751aaf367d6 |
|
1281 | 1283 | b0551702f918510f01ae838ab03a463054c67b46 |
|
1282 | 1284 | obsmarkers -- 'sortdict()' |
|
1283 | 1285 | version: 1 (139 bytes) |
|
1284 | 1286 | e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
1285 | 1287 | f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
1288 | phase-heads -- 'sortdict()' | |
|
1289 | b0551702f918510f01ae838ab03a463054c67b46 draft | |
|
1286 | 1290 | |
|
1287 | 1291 | $ hg unbundle .hg/strip-backup/e016b03fd86f-*-backup.hg |
|
1288 | 1292 | adding changesets |
|
1289 | 1293 | adding manifests |
|
1290 | 1294 | adding file changes |
|
1291 | 1295 | added 2 changesets with 2 changes to 2 files |
|
1292 | 1296 | 2 new obsolescence markers |
|
1293 | 1297 | (run 'hg update' to get a working copy) |
|
1294 | 1298 | $ hg debugobsolete | sort |
|
1295 | 1299 | e008cf2834908e5d6b0f792a9d4b0e2272260fb8 b0551702f918510f01ae838ab03a463054c67b46 0 (*) {'user': 'test'} (glob) |
|
1296 | 1300 | f27abbcc1f77fb409cf9160482fe619541e2d605 0 {e008cf2834908e5d6b0f792a9d4b0e2272260fb8} (*) {'user': 'test'} (glob) |
|
1297 | 1301 | $ hg log -G |
|
1298 | 1302 | o 2:b0551702f918 (draft) [tip ] 2 |
|
1299 | 1303 | | |
|
1300 | 1304 | o 1:e016b03fd86f (draft) [ ] 1 |
|
1301 | 1305 | | |
|
1302 | 1306 | @ 0:a78f55e5508c (draft) [ ] 0 |
|
1303 | 1307 | |
|
1304 | 1308 | $ hg log -G --hidden |
|
1305 | 1309 | o 2:b0551702f918 (draft) [tip ] 2 |
|
1306 | 1310 | | |
|
1307 | 1311 | o 1:e016b03fd86f (draft) [ ] 1 |
|
1308 | 1312 | | |
|
1309 | 1313 | @ 0:a78f55e5508c (draft) [ ] 0 |
|
1310 | 1314 | |
|
1311 | 1315 | Test that 'hg debugobsolete --index --rev' can show indices of obsmarkers when |
|
1312 | 1316 | only a subset of those are displayed (because of --rev option) |
|
1313 | 1317 | $ hg init doindexrev |
|
1314 | 1318 | $ cd doindexrev |
|
1315 | 1319 | $ echo a > a |
|
1316 | 1320 | $ hg ci -Am a |
|
1317 | 1321 | adding a |
|
1318 | 1322 | $ hg ci --amend -m aa |
|
1319 | 1323 | $ echo b > b |
|
1320 | 1324 | $ hg ci -Am b |
|
1321 | 1325 | adding b |
|
1322 | 1326 | $ hg ci --amend -m bb |
|
1323 | 1327 | $ echo c > c |
|
1324 | 1328 | $ hg ci -Am c |
|
1325 | 1329 | adding c |
|
1326 | 1330 | $ hg ci --amend -m cc |
|
1327 | 1331 | $ echo d > d |
|
1328 | 1332 | $ hg ci -Am d |
|
1329 | 1333 | adding d |
|
1330 | 1334 | $ hg ci --amend -m dd --config experimental.evolution.track-operation=1 |
|
1331 | 1335 | $ hg debugobsolete --index --rev "3+7" |
|
1332 | 1336 | 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 \(.*\) {'user': 'test'} (re) |
|
1333 | 1337 | 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 \(.*\) {'operation': 'amend', 'user': 'test'} (re) |
|
1334 | 1338 | $ hg debugobsolete --index --rev "3+7" -Tjson |
|
1335 | 1339 | [ |
|
1336 | 1340 | { |
|
1337 | 1341 | "date": [0.0, 0], |
|
1338 | 1342 | "flag": 0, |
|
1339 | 1343 | "index": 1, |
|
1340 | 1344 | "metadata": {"user": "test"}, |
|
1341 | 1345 | "precnode": "6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1", |
|
1342 | 1346 | "succnodes": ["d27fb9b066076fd921277a4b9e8b9cb48c95bc6a"] |
|
1343 | 1347 | }, |
|
1344 | 1348 | { |
|
1345 | 1349 | "date": [0.0, 0], |
|
1346 | 1350 | "flag": 0, |
|
1347 | 1351 | "index": 3, |
|
1348 | 1352 | "metadata": {"operation": "amend", "user": "test"}, |
|
1349 | 1353 | "precnode": "4715cf767440ed891755448016c2b8cf70760c30", |
|
1350 | 1354 | "succnodes": ["7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d"] |
|
1351 | 1355 | } |
|
1352 | 1356 | ] |
|
1353 | 1357 | |
|
1354 | 1358 | Test the --delete option of debugobsolete command |
|
1355 | 1359 | $ hg debugobsolete --index |
|
1356 | 1360 | 0 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
1357 | 1361 | 1 6fdef60fcbabbd3d50e9b9cbc2a240724b91a5e1 d27fb9b066076fd921277a4b9e8b9cb48c95bc6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
1358 | 1362 | 2 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
1359 | 1363 | 3 4715cf767440ed891755448016c2b8cf70760c30 7ae79c5d60f049c7b0dd02f5f25b9d60aaf7b36d 0 (Thu Jan 01 00:00:00 1970 +0000) {'operation': 'amend', 'user': 'test'} |
|
1360 | 1364 | $ hg debugobsolete --delete 1 --delete 3 |
|
1361 | 1365 | deleted 2 obsolescence markers |
|
1362 | 1366 | $ hg debugobsolete |
|
1363 | 1367 | cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b f9bd49731b0b175e42992a3c8fa6c678b2bc11f1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
1364 | 1368 | 1ab51af8f9b41ef8c7f6f3312d4706d870b1fb74 29346082e4a9e27042b62d2da0e2de211c027621 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
1365 | 1369 | |
|
1366 | 1370 | Test adding changeset after obsmarkers affecting it |
|
1367 | 1371 | (eg: during pull, or unbundle) |
|
1368 | 1372 | |
|
1369 | 1373 | $ mkcommit e |
|
1370 | 1374 | $ hg bundle -r . --base .~1 ../bundle-2.hg |
|
1371 | 1375 | 1 changesets found |
|
1372 | 1376 | $ getid . |
|
1373 | 1377 | $ hg --config extensions.strip= strip -r . |
|
1374 | 1378 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1375 | 1379 | saved backup bundle to $TESTTMP/tmpe/issue4845/doindexrev/.hg/strip-backup/9bc153528424-ee80edd4-backup.hg (glob) |
|
1376 | 1380 | $ hg debugobsolete 9bc153528424ea266d13e57f9ff0d799dfe61e4b |
|
1377 | 1381 | $ hg unbundle ../bundle-2.hg |
|
1378 | 1382 | adding changesets |
|
1379 | 1383 | adding manifests |
|
1380 | 1384 | adding file changes |
|
1381 | 1385 | added 1 changesets with 1 changes to 1 files |
|
1382 | 1386 | (run 'hg update' to get a working copy) |
|
1383 | 1387 | $ hg log -G |
|
1384 | 1388 | @ 7:7ae79c5d60f0 (draft) [tip ] dd |
|
1385 | 1389 | | |
|
1386 | 1390 | | o 6:4715cf767440 (draft) [ ] d |
|
1387 | 1391 | |/ |
|
1388 | 1392 | o 5:29346082e4a9 (draft) [ ] cc |
|
1389 | 1393 | | |
|
1390 | 1394 | o 3:d27fb9b06607 (draft) [ ] bb |
|
1391 | 1395 | | |
|
1392 | 1396 | | o 2:6fdef60fcbab (draft) [ ] b |
|
1393 | 1397 | |/ |
|
1394 | 1398 | o 1:f9bd49731b0b (draft) [ ] aa |
|
1395 | 1399 | |
|
1396 | 1400 | |
|
1397 | 1401 | $ cd .. |
@@ -1,361 +1,365 | |||
|
1 | 1 | $ cat >> $HGRCPATH <<EOF |
|
2 | 2 | > [format] |
|
3 | 3 | > usegeneraldelta=yes |
|
4 | 4 | > [extensions] |
|
5 | 5 | > rebase= |
|
6 | 6 | > |
|
7 | 7 | > [phases] |
|
8 | 8 | > publish=False |
|
9 | 9 | > |
|
10 | 10 | > [alias] |
|
11 | 11 | > tglog = log -G --template "{rev}:{phase} '{desc}' {branches} {bookmarks}\n" |
|
12 | 12 | > EOF |
|
13 | 13 | |
|
14 | 14 | $ hg init a |
|
15 | 15 | $ cd a |
|
16 | 16 | $ echo c1 >common |
|
17 | 17 | $ hg add common |
|
18 | 18 | $ hg ci -m C1 |
|
19 | 19 | |
|
20 | 20 | $ echo c2 >>common |
|
21 | 21 | $ hg ci -m C2 |
|
22 | 22 | |
|
23 | 23 | $ echo c3 >>common |
|
24 | 24 | $ hg ci -m C3 |
|
25 | 25 | |
|
26 | 26 | $ hg up -q -C 1 |
|
27 | 27 | |
|
28 | 28 | $ echo l1 >>extra |
|
29 | 29 | $ hg add extra |
|
30 | 30 | $ hg ci -m L1 |
|
31 | 31 | created new head |
|
32 | 32 | |
|
33 | 33 | $ sed -e 's/c2/l2/' common > common.new |
|
34 | 34 | $ mv common.new common |
|
35 | 35 | $ hg ci -m L2 |
|
36 | 36 | |
|
37 | 37 | $ echo l3 >> extra2 |
|
38 | 38 | $ hg add extra2 |
|
39 | 39 | $ hg ci -m L3 |
|
40 | 40 | $ hg bookmark mybook |
|
41 | 41 | |
|
42 | 42 | $ hg phase --force --secret 4 |
|
43 | 43 | |
|
44 | 44 | $ hg tglog |
|
45 | 45 | @ 5:secret 'L3' mybook |
|
46 | 46 | | |
|
47 | 47 | o 4:secret 'L2' |
|
48 | 48 | | |
|
49 | 49 | o 3:draft 'L1' |
|
50 | 50 | | |
|
51 | 51 | | o 2:draft 'C3' |
|
52 | 52 | |/ |
|
53 | 53 | o 1:draft 'C2' |
|
54 | 54 | | |
|
55 | 55 | o 0:draft 'C1' |
|
56 | 56 | |
|
57 | 57 | Try to call --continue: |
|
58 | 58 | |
|
59 | 59 | $ hg rebase --continue |
|
60 | 60 | abort: no rebase in progress |
|
61 | 61 | [255] |
|
62 | 62 | |
|
63 | 63 | Conflicting rebase: |
|
64 | 64 | |
|
65 | 65 | $ hg rebase -s 3 -d 2 |
|
66 | 66 | rebasing 3:3163e20567cc "L1" |
|
67 | 67 | rebasing 4:46f0b057b5c0 "L2" |
|
68 | 68 | merging common |
|
69 | 69 | warning: conflicts while merging common! (edit, then use 'hg resolve --mark') |
|
70 | 70 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
71 | 71 | [1] |
|
72 | 72 | |
|
73 | 73 | Try to continue without solving the conflict: |
|
74 | 74 | |
|
75 | 75 | $ hg rebase --continue |
|
76 | 76 | abort: unresolved merge conflicts (see 'hg help resolve') |
|
77 | 77 | [255] |
|
78 | 78 | |
|
79 | 79 | Conclude rebase: |
|
80 | 80 | |
|
81 | 81 | $ echo 'resolved merge' >common |
|
82 | 82 | $ hg resolve -m common |
|
83 | 83 | (no more unresolved files) |
|
84 | 84 | continue: hg rebase --continue |
|
85 | 85 | $ hg rebase --continue |
|
86 | 86 | already rebased 3:3163e20567cc "L1" as 3e046f2ecedb |
|
87 | 87 | rebasing 4:46f0b057b5c0 "L2" |
|
88 | 88 | rebasing 5:8029388f38dc "L3" (mybook) |
|
89 | 89 | saved backup bundle to $TESTTMP/a/.hg/strip-backup/3163e20567cc-5ca4656e-backup.hg (glob) |
|
90 | 90 | |
|
91 | 91 | $ hg tglog |
|
92 | 92 | @ 5:secret 'L3' mybook |
|
93 | 93 | | |
|
94 | 94 | o 4:secret 'L2' |
|
95 | 95 | | |
|
96 | 96 | o 3:draft 'L1' |
|
97 | 97 | | |
|
98 | 98 | o 2:draft 'C3' |
|
99 | 99 | | |
|
100 | 100 | o 1:draft 'C2' |
|
101 | 101 | | |
|
102 | 102 | o 0:draft 'C1' |
|
103 | 103 | |
|
104 | 104 | Check correctness: |
|
105 | 105 | |
|
106 | 106 | $ hg cat -r 0 common |
|
107 | 107 | c1 |
|
108 | 108 | |
|
109 | 109 | $ hg cat -r 1 common |
|
110 | 110 | c1 |
|
111 | 111 | c2 |
|
112 | 112 | |
|
113 | 113 | $ hg cat -r 2 common |
|
114 | 114 | c1 |
|
115 | 115 | c2 |
|
116 | 116 | c3 |
|
117 | 117 | |
|
118 | 118 | $ hg cat -r 3 common |
|
119 | 119 | c1 |
|
120 | 120 | c2 |
|
121 | 121 | c3 |
|
122 | 122 | |
|
123 | 123 | $ hg cat -r 4 common |
|
124 | 124 | resolved merge |
|
125 | 125 | |
|
126 | 126 | $ hg cat -r 5 common |
|
127 | 127 | resolved merge |
|
128 | 128 | |
|
129 | 129 | Bookmark stays active after --continue |
|
130 | 130 | $ hg bookmarks |
|
131 | 131 | * mybook 5:d67b21408fc0 |
|
132 | 132 | |
|
133 | 133 | $ cd .. |
|
134 | 134 | |
|
135 | 135 | Check that the right ancestors is used while rebasing a merge (issue4041) |
|
136 | 136 | |
|
137 | 137 | $ hg clone "$TESTDIR/bundles/issue4041.hg" issue4041 |
|
138 | 138 | requesting all changes |
|
139 | 139 | adding changesets |
|
140 | 140 | adding manifests |
|
141 | 141 | adding file changes |
|
142 | 142 | added 11 changesets with 8 changes to 3 files (+1 heads) |
|
143 | 143 | updating to branch default |
|
144 | 144 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
145 | 145 | $ cd issue4041 |
|
146 | 146 | $ hg log -G |
|
147 | 147 | o changeset: 10:2f2496ddf49d |
|
148 | 148 | |\ branch: f1 |
|
149 | 149 | | | tag: tip |
|
150 | 150 | | | parent: 7:4c9fbe56a16f |
|
151 | 151 | | | parent: 9:e31216eec445 |
|
152 | 152 | | | user: szhang |
|
153 | 153 | | | date: Thu Sep 05 12:59:39 2013 -0400 |
|
154 | 154 | | | summary: merge |
|
155 | 155 | | | |
|
156 | 156 | | o changeset: 9:e31216eec445 |
|
157 | 157 | | | branch: f1 |
|
158 | 158 | | | user: szhang |
|
159 | 159 | | | date: Thu Sep 05 12:59:10 2013 -0400 |
|
160 | 160 | | | summary: more changes to f1 |
|
161 | 161 | | | |
|
162 | 162 | | o changeset: 8:8e4e2c1a07ae |
|
163 | 163 | | |\ branch: f1 |
|
164 | 164 | | | | parent: 2:4bc80088dc6b |
|
165 | 165 | | | | parent: 6:400110238667 |
|
166 | 166 | | | | user: szhang |
|
167 | 167 | | | | date: Thu Sep 05 12:57:59 2013 -0400 |
|
168 | 168 | | | | summary: bad merge |
|
169 | 169 | | | | |
|
170 | 170 | o | | changeset: 7:4c9fbe56a16f |
|
171 | 171 | |/ / branch: f1 |
|
172 | 172 | | | parent: 2:4bc80088dc6b |
|
173 | 173 | | | user: szhang |
|
174 | 174 | | | date: Thu Sep 05 12:54:00 2013 -0400 |
|
175 | 175 | | | summary: changed f1 |
|
176 | 176 | | | |
|
177 | 177 | | o changeset: 6:400110238667 |
|
178 | 178 | | | branch: f2 |
|
179 | 179 | | | parent: 4:12e8ec6bb010 |
|
180 | 180 | | | user: szhang |
|
181 | 181 | | | date: Tue Sep 03 13:58:02 2013 -0400 |
|
182 | 182 | | | summary: changed f2 on f2 |
|
183 | 183 | | | |
|
184 | 184 | | | @ changeset: 5:d79e2059b5c0 |
|
185 | 185 | | | | parent: 3:8a951942e016 |
|
186 | 186 | | | | user: szhang |
|
187 | 187 | | | | date: Tue Sep 03 13:57:39 2013 -0400 |
|
188 | 188 | | | | summary: changed f2 on default |
|
189 | 189 | | | | |
|
190 | 190 | | o | changeset: 4:12e8ec6bb010 |
|
191 | 191 | | |/ branch: f2 |
|
192 | 192 | | | user: szhang |
|
193 | 193 | | | date: Tue Sep 03 13:57:18 2013 -0400 |
|
194 | 194 | | | summary: created f2 branch |
|
195 | 195 | | | |
|
196 | 196 | | o changeset: 3:8a951942e016 |
|
197 | 197 | | | parent: 0:24797d4f68de |
|
198 | 198 | | | user: szhang |
|
199 | 199 | | | date: Tue Sep 03 13:57:11 2013 -0400 |
|
200 | 200 | | | summary: added f2.txt |
|
201 | 201 | | | |
|
202 | 202 | o | changeset: 2:4bc80088dc6b |
|
203 | 203 | | | branch: f1 |
|
204 | 204 | | | user: szhang |
|
205 | 205 | | | date: Tue Sep 03 13:56:20 2013 -0400 |
|
206 | 206 | | | summary: added f1.txt |
|
207 | 207 | | | |
|
208 | 208 | o | changeset: 1:ef53c9e6b608 |
|
209 | 209 | |/ branch: f1 |
|
210 | 210 | | user: szhang |
|
211 | 211 | | date: Tue Sep 03 13:55:26 2013 -0400 |
|
212 | 212 | | summary: created f1 branch |
|
213 | 213 | | |
|
214 | 214 | o changeset: 0:24797d4f68de |
|
215 | 215 | user: szhang |
|
216 | 216 | date: Tue Sep 03 13:55:08 2013 -0400 |
|
217 | 217 | summary: added default.txt |
|
218 | 218 | |
|
219 | 219 | $ hg rebase -s9 -d2 --debug # use debug to really check merge base used |
|
220 | 220 | rebase onto 4bc80088dc6b starting from e31216eec445 |
|
221 | 221 | rebase status stored |
|
222 | 222 | ignoring null merge rebase of 3 |
|
223 | 223 | ignoring null merge rebase of 4 |
|
224 | 224 | ignoring null merge rebase of 6 |
|
225 | 225 | ignoring null merge rebase of 8 |
|
226 | 226 | rebasing 9:e31216eec445 "more changes to f1" |
|
227 | 227 | future parents are 2 and -1 |
|
228 | 228 | update to 2:4bc80088dc6b |
|
229 | 229 | resolving manifests |
|
230 | 230 | branchmerge: False, force: True, partial: False |
|
231 | 231 | ancestor: d79e2059b5c0+, local: d79e2059b5c0+, remote: 4bc80088dc6b |
|
232 | 232 | f2.txt: other deleted -> r |
|
233 | 233 | removing f2.txt |
|
234 | 234 | f1.txt: remote created -> g |
|
235 | 235 | getting f1.txt |
|
236 | 236 | merge against 9:e31216eec445 |
|
237 | 237 | detach base 8:8e4e2c1a07ae |
|
238 | 238 | searching for copies back to rev 3 |
|
239 | 239 | unmatched files in other (from topological common ancestor): |
|
240 | 240 | f2.txt |
|
241 | 241 | resolving manifests |
|
242 | 242 | branchmerge: True, force: True, partial: False |
|
243 | 243 | ancestor: 8e4e2c1a07ae, local: 4bc80088dc6b+, remote: e31216eec445 |
|
244 | 244 | f1.txt: remote is newer -> g |
|
245 | 245 | getting f1.txt |
|
246 | 246 | committing files: |
|
247 | 247 | f1.txt |
|
248 | 248 | committing manifest |
|
249 | 249 | committing changelog |
|
250 | 250 | rebased as 19c888675e13 |
|
251 | 251 | rebasing 10:2f2496ddf49d "merge" (tip) |
|
252 | 252 | future parents are 11 and 7 |
|
253 | 253 | already in destination |
|
254 | 254 | merge against 10:2f2496ddf49d |
|
255 | 255 | detach base 9:e31216eec445 |
|
256 | 256 | searching for copies back to rev 3 |
|
257 | 257 | unmatched files in other (from topological common ancestor): |
|
258 | 258 | f2.txt |
|
259 | 259 | resolving manifests |
|
260 | 260 | branchmerge: True, force: True, partial: False |
|
261 | 261 | ancestor: e31216eec445, local: 19c888675e13+, remote: 2f2496ddf49d |
|
262 | 262 | f1.txt: remote is newer -> g |
|
263 | 263 | getting f1.txt |
|
264 | 264 | committing files: |
|
265 | 265 | f1.txt |
|
266 | 266 | committing manifest |
|
267 | 267 | committing changelog |
|
268 | 268 | rebased as 2a7f09cac94c |
|
269 | 269 | rebase merging completed |
|
270 | 270 | rebase status stored |
|
271 | 271 | updating the branch cache |
|
272 | 272 | update back to initial working directory parent |
|
273 | 273 | resolving manifests |
|
274 | 274 | branchmerge: False, force: False, partial: False |
|
275 | 275 | ancestor: 2a7f09cac94c, local: 2a7f09cac94c+, remote: d79e2059b5c0 |
|
276 | 276 | f1.txt: other deleted -> r |
|
277 | 277 | removing f1.txt |
|
278 | 278 | f2.txt: remote created -> g |
|
279 | 279 | getting f2.txt |
|
280 | 280 | 2 changesets found |
|
281 | 281 | list of changesets: |
|
282 | 282 | e31216eec445e44352c5f01588856059466a24c9 |
|
283 | 283 | 2f2496ddf49d69b5ef23ad8cf9fb2e0e4faf0ac2 |
|
284 |
bundle2-output-bundle: "HG20", (1 params) |
|
|
284 | bundle2-output-bundle: "HG20", (1 params) 2 parts total | |
|
285 | 285 | bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload |
|
286 | bundle2-output-part: "phase-heads" 24 bytes payload | |
|
286 | 287 | saved backup bundle to $TESTTMP/issue4041/.hg/strip-backup/e31216eec445-15f7a814-backup.hg (glob) |
|
287 | 288 | 3 changesets found |
|
288 | 289 | list of changesets: |
|
289 | 290 | 4c9fbe56a16f30c0d5dcc40ec1a97bbe3325209c |
|
290 | 291 | 19c888675e133ab5dff84516926a65672eaf04d9 |
|
291 | 292 | 2a7f09cac94c7f4b73ebd5cd1a62d3b2e8e336bf |
|
292 |
bundle2-output-bundle: "HG20", |
|
|
293 | bundle2-output-bundle: "HG20", 2 parts total | |
|
293 | 294 | bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload |
|
295 | bundle2-output-part: "phase-heads" 24 bytes payload | |
|
294 | 296 | adding branch |
|
295 | 297 | bundle2-input-bundle: with-transaction |
|
296 | 298 | bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported |
|
297 | 299 | adding changesets |
|
298 | 300 | add changeset 4c9fbe56a16f |
|
299 | 301 | add changeset 19c888675e13 |
|
300 | 302 | add changeset 2a7f09cac94c |
|
301 | 303 | adding manifests |
|
302 | 304 | adding file changes |
|
303 | 305 | adding f1.txt revisions |
|
304 | 306 | added 2 changesets with 2 changes to 1 files |
|
305 | 307 | bundle2-input-part: total payload size 1686 |
|
306 | bundle2-input-bundle: 0 parts total | |
|
308 | bundle2-input-part: "phase-heads" supported | |
|
309 | bundle2-input-part: total payload size 24 | |
|
310 | bundle2-input-bundle: 1 parts total | |
|
307 | 311 | updating the branch cache |
|
308 | 312 | invalid branchheads cache (served): tip differs |
|
309 | 313 | rebase completed |
|
310 | 314 | |
|
311 | 315 | Test minimization of merge conflicts |
|
312 | 316 | $ hg up -q null |
|
313 | 317 | $ echo a > a |
|
314 | 318 | $ hg add a |
|
315 | 319 | $ hg commit -q -m 'a' |
|
316 | 320 | $ echo b >> a |
|
317 | 321 | $ hg commit -q -m 'ab' |
|
318 | 322 | $ hg bookmark ab |
|
319 | 323 | $ hg up -q '.^' |
|
320 | 324 | $ echo b >> a |
|
321 | 325 | $ echo c >> a |
|
322 | 326 | $ hg commit -q -m 'abc' |
|
323 | 327 | $ hg rebase -s 7bc217434fc1 -d ab --keep |
|
324 | 328 | rebasing 13:7bc217434fc1 "abc" (tip) |
|
325 | 329 | merging a |
|
326 | 330 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
327 | 331 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
328 | 332 | [1] |
|
329 | 333 | $ hg diff |
|
330 | 334 | diff -r 328e4ab1f7cc a |
|
331 | 335 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
332 | 336 | +++ b/a * (glob) |
|
333 | 337 | @@ -1,2 +1,6 @@ |
|
334 | 338 | a |
|
335 | 339 | b |
|
336 | 340 | +<<<<<<< dest: 328e4ab1f7cc ab - test: ab |
|
337 | 341 | +======= |
|
338 | 342 | +c |
|
339 | 343 | +>>>>>>> source: 7bc217434fc1 - test: abc |
|
340 | 344 | $ hg rebase --abort |
|
341 | 345 | rebase aborted |
|
342 | 346 | $ hg up -q -C 7bc217434fc1 |
|
343 | 347 | $ hg rebase -s . -d ab --keep -t internal:merge3 |
|
344 | 348 | rebasing 13:7bc217434fc1 "abc" (tip) |
|
345 | 349 | merging a |
|
346 | 350 | warning: conflicts while merging a! (edit, then use 'hg resolve --mark') |
|
347 | 351 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
348 | 352 | [1] |
|
349 | 353 | $ hg diff |
|
350 | 354 | diff -r 328e4ab1f7cc a |
|
351 | 355 | --- a/a Thu Jan 01 00:00:00 1970 +0000 |
|
352 | 356 | +++ b/a * (glob) |
|
353 | 357 | @@ -1,2 +1,8 @@ |
|
354 | 358 | a |
|
355 | 359 | +<<<<<<< dest: 328e4ab1f7cc ab - test: ab |
|
356 | 360 | b |
|
357 | 361 | +||||||| base |
|
358 | 362 | +======= |
|
359 | 363 | +b |
|
360 | 364 | +c |
|
361 | 365 | +>>>>>>> source: 7bc217434fc1 - test: abc |
@@ -1,940 +1,943 | |||
|
1 | 1 | $ echo "[format]" >> $HGRCPATH |
|
2 | 2 | $ echo "usegeneraldelta=yes" >> $HGRCPATH |
|
3 | 3 | $ echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | $ echo "strip=" >> $HGRCPATH |
|
5 | 5 | |
|
6 | 6 | $ restore() { |
|
7 | 7 | > hg unbundle -q .hg/strip-backup/* |
|
8 | 8 | > rm .hg/strip-backup/* |
|
9 | 9 | > } |
|
10 | 10 | $ teststrip() { |
|
11 | 11 | > hg up -C $1 |
|
12 | 12 | > echo % before update $1, strip $2 |
|
13 | 13 | > hg parents |
|
14 | 14 | > hg --traceback strip $2 |
|
15 | 15 | > echo % after update $1, strip $2 |
|
16 | 16 | > hg parents |
|
17 | 17 | > restore |
|
18 | 18 | > } |
|
19 | 19 | |
|
20 | 20 | $ hg init test |
|
21 | 21 | $ cd test |
|
22 | 22 | |
|
23 | 23 | $ echo foo > bar |
|
24 | 24 | $ hg ci -Ama |
|
25 | 25 | adding bar |
|
26 | 26 | |
|
27 | 27 | $ echo more >> bar |
|
28 | 28 | $ hg ci -Amb |
|
29 | 29 | |
|
30 | 30 | $ echo blah >> bar |
|
31 | 31 | $ hg ci -Amc |
|
32 | 32 | |
|
33 | 33 | $ hg up 1 |
|
34 | 34 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
35 | 35 | $ echo blah >> bar |
|
36 | 36 | $ hg ci -Amd |
|
37 | 37 | created new head |
|
38 | 38 | |
|
39 | 39 | $ echo final >> bar |
|
40 | 40 | $ hg ci -Ame |
|
41 | 41 | |
|
42 | 42 | $ hg log |
|
43 | 43 | changeset: 4:443431ffac4f |
|
44 | 44 | tag: tip |
|
45 | 45 | user: test |
|
46 | 46 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
47 | 47 | summary: e |
|
48 | 48 | |
|
49 | 49 | changeset: 3:65bd5f99a4a3 |
|
50 | 50 | parent: 1:ef3a871183d7 |
|
51 | 51 | user: test |
|
52 | 52 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
53 | 53 | summary: d |
|
54 | 54 | |
|
55 | 55 | changeset: 2:264128213d29 |
|
56 | 56 | user: test |
|
57 | 57 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
58 | 58 | summary: c |
|
59 | 59 | |
|
60 | 60 | changeset: 1:ef3a871183d7 |
|
61 | 61 | user: test |
|
62 | 62 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
63 | 63 | summary: b |
|
64 | 64 | |
|
65 | 65 | changeset: 0:9ab35a2d17cb |
|
66 | 66 | user: test |
|
67 | 67 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
68 | 68 | summary: a |
|
69 | 69 | |
|
70 | 70 | |
|
71 | 71 | $ teststrip 4 4 |
|
72 | 72 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
73 | 73 | % before update 4, strip 4 |
|
74 | 74 | changeset: 4:443431ffac4f |
|
75 | 75 | tag: tip |
|
76 | 76 | user: test |
|
77 | 77 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
78 | 78 | summary: e |
|
79 | 79 | |
|
80 | 80 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
81 | 81 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
82 | 82 | % after update 4, strip 4 |
|
83 | 83 | changeset: 3:65bd5f99a4a3 |
|
84 | 84 | tag: tip |
|
85 | 85 | parent: 1:ef3a871183d7 |
|
86 | 86 | user: test |
|
87 | 87 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
88 | 88 | summary: d |
|
89 | 89 | |
|
90 | 90 | $ teststrip 4 3 |
|
91 | 91 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
92 | 92 | % before update 4, strip 3 |
|
93 | 93 | changeset: 4:443431ffac4f |
|
94 | 94 | tag: tip |
|
95 | 95 | user: test |
|
96 | 96 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
97 | 97 | summary: e |
|
98 | 98 | |
|
99 | 99 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
100 | 100 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
101 | 101 | % after update 4, strip 3 |
|
102 | 102 | changeset: 1:ef3a871183d7 |
|
103 | 103 | user: test |
|
104 | 104 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
105 | 105 | summary: b |
|
106 | 106 | |
|
107 | 107 | $ teststrip 1 4 |
|
108 | 108 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
109 | 109 | % before update 1, strip 4 |
|
110 | 110 | changeset: 1:ef3a871183d7 |
|
111 | 111 | user: test |
|
112 | 112 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
113 | 113 | summary: b |
|
114 | 114 | |
|
115 | 115 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
116 | 116 | % after update 1, strip 4 |
|
117 | 117 | changeset: 1:ef3a871183d7 |
|
118 | 118 | user: test |
|
119 | 119 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
120 | 120 | summary: b |
|
121 | 121 | |
|
122 | 122 | $ teststrip 4 2 |
|
123 | 123 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
124 | 124 | % before update 4, strip 2 |
|
125 | 125 | changeset: 4:443431ffac4f |
|
126 | 126 | tag: tip |
|
127 | 127 | user: test |
|
128 | 128 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
129 | 129 | summary: e |
|
130 | 130 | |
|
131 | 131 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
132 | 132 | % after update 4, strip 2 |
|
133 | 133 | changeset: 3:443431ffac4f |
|
134 | 134 | tag: tip |
|
135 | 135 | user: test |
|
136 | 136 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
137 | 137 | summary: e |
|
138 | 138 | |
|
139 | 139 | $ teststrip 4 1 |
|
140 | 140 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
141 | 141 | % before update 4, strip 1 |
|
142 | 142 | changeset: 4:264128213d29 |
|
143 | 143 | tag: tip |
|
144 | 144 | parent: 1:ef3a871183d7 |
|
145 | 145 | user: test |
|
146 | 146 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
147 | 147 | summary: c |
|
148 | 148 | |
|
149 | 149 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
150 | 150 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
151 | 151 | % after update 4, strip 1 |
|
152 | 152 | changeset: 0:9ab35a2d17cb |
|
153 | 153 | tag: tip |
|
154 | 154 | user: test |
|
155 | 155 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
156 | 156 | summary: a |
|
157 | 157 | |
|
158 | 158 | $ teststrip null 4 |
|
159 | 159 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
160 | 160 | % before update null, strip 4 |
|
161 | 161 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
162 | 162 | % after update null, strip 4 |
|
163 | 163 | |
|
164 | 164 | $ hg log |
|
165 | 165 | changeset: 4:264128213d29 |
|
166 | 166 | tag: tip |
|
167 | 167 | parent: 1:ef3a871183d7 |
|
168 | 168 | user: test |
|
169 | 169 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
170 | 170 | summary: c |
|
171 | 171 | |
|
172 | 172 | changeset: 3:443431ffac4f |
|
173 | 173 | user: test |
|
174 | 174 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
175 | 175 | summary: e |
|
176 | 176 | |
|
177 | 177 | changeset: 2:65bd5f99a4a3 |
|
178 | 178 | user: test |
|
179 | 179 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
180 | 180 | summary: d |
|
181 | 181 | |
|
182 | 182 | changeset: 1:ef3a871183d7 |
|
183 | 183 | user: test |
|
184 | 184 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
185 | 185 | summary: b |
|
186 | 186 | |
|
187 | 187 | changeset: 0:9ab35a2d17cb |
|
188 | 188 | user: test |
|
189 | 189 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
190 | 190 | summary: a |
|
191 | 191 | |
|
192 | 192 | $ hg up -C 4 |
|
193 | 193 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
194 | 194 | $ hg parents |
|
195 | 195 | changeset: 4:264128213d29 |
|
196 | 196 | tag: tip |
|
197 | 197 | parent: 1:ef3a871183d7 |
|
198 | 198 | user: test |
|
199 | 199 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
200 | 200 | summary: c |
|
201 | 201 | |
|
202 | 202 | |
|
203 | 203 | $ hg --traceback strip 4 |
|
204 | 204 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
205 | 205 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg (glob) |
|
206 | 206 | $ hg parents |
|
207 | 207 | changeset: 1:ef3a871183d7 |
|
208 | 208 | user: test |
|
209 | 209 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
210 | 210 | summary: b |
|
211 | 211 | |
|
212 | 212 | $ hg debugbundle .hg/strip-backup/* |
|
213 | 213 | Stream params: sortdict([('Compression', 'BZ')]) |
|
214 | 214 | changegroup -- "sortdict([('version', '02'), ('nbchanges', '1')])" |
|
215 | 215 | 264128213d290d868c54642d13aeaa3675551a78 |
|
216 | phase-heads -- 'sortdict()' | |
|
217 | 264128213d290d868c54642d13aeaa3675551a78 draft | |
|
216 | 218 | $ hg pull .hg/strip-backup/* |
|
217 | 219 | pulling from .hg/strip-backup/264128213d29-0b39d6bf-backup.hg |
|
218 | 220 | searching for changes |
|
219 | 221 | adding changesets |
|
220 | 222 | adding manifests |
|
221 | 223 | adding file changes |
|
222 | 224 | added 1 changesets with 0 changes to 0 files (+1 heads) |
|
223 | 225 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
224 | 226 | $ rm .hg/strip-backup/* |
|
225 | 227 | $ hg log --graph |
|
226 | 228 | o changeset: 4:264128213d29 |
|
227 | 229 | | tag: tip |
|
228 | 230 | | parent: 1:ef3a871183d7 |
|
229 | 231 | | user: test |
|
230 | 232 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
231 | 233 | | summary: c |
|
232 | 234 | | |
|
233 | 235 | | o changeset: 3:443431ffac4f |
|
234 | 236 | | | user: test |
|
235 | 237 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
236 | 238 | | | summary: e |
|
237 | 239 | | | |
|
238 | 240 | | o changeset: 2:65bd5f99a4a3 |
|
239 | 241 | |/ user: test |
|
240 | 242 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
241 | 243 | | summary: d |
|
242 | 244 | | |
|
243 | 245 | @ changeset: 1:ef3a871183d7 |
|
244 | 246 | | user: test |
|
245 | 247 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
246 | 248 | | summary: b |
|
247 | 249 | | |
|
248 | 250 | o changeset: 0:9ab35a2d17cb |
|
249 | 251 | user: test |
|
250 | 252 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
251 | 253 | summary: a |
|
252 | 254 | |
|
253 | 255 | $ hg up -C 2 |
|
254 | 256 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
255 | 257 | $ hg merge 4 |
|
256 | 258 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
257 | 259 | (branch merge, don't forget to commit) |
|
258 | 260 | |
|
259 | 261 | before strip of merge parent |
|
260 | 262 | |
|
261 | 263 | $ hg parents |
|
262 | 264 | changeset: 2:65bd5f99a4a3 |
|
263 | 265 | user: test |
|
264 | 266 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
265 | 267 | summary: d |
|
266 | 268 | |
|
267 | 269 | changeset: 4:264128213d29 |
|
268 | 270 | tag: tip |
|
269 | 271 | parent: 1:ef3a871183d7 |
|
270 | 272 | user: test |
|
271 | 273 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
272 | 274 | summary: c |
|
273 | 275 | |
|
274 | 276 | $ hg strip 4 |
|
275 | 277 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
276 | 278 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
277 | 279 | |
|
278 | 280 | after strip of merge parent |
|
279 | 281 | |
|
280 | 282 | $ hg parents |
|
281 | 283 | changeset: 1:ef3a871183d7 |
|
282 | 284 | user: test |
|
283 | 285 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
284 | 286 | summary: b |
|
285 | 287 | |
|
286 | 288 | $ restore |
|
287 | 289 | |
|
288 | 290 | $ hg up |
|
289 | 291 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
290 | 292 | updated to "264128213d29: c" |
|
291 | 293 | 1 other heads for branch "default" |
|
292 | 294 | $ hg log -G |
|
293 | 295 | @ changeset: 4:264128213d29 |
|
294 | 296 | | tag: tip |
|
295 | 297 | | parent: 1:ef3a871183d7 |
|
296 | 298 | | user: test |
|
297 | 299 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
298 | 300 | | summary: c |
|
299 | 301 | | |
|
300 | 302 | | o changeset: 3:443431ffac4f |
|
301 | 303 | | | user: test |
|
302 | 304 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
303 | 305 | | | summary: e |
|
304 | 306 | | | |
|
305 | 307 | | o changeset: 2:65bd5f99a4a3 |
|
306 | 308 | |/ user: test |
|
307 | 309 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
308 | 310 | | summary: d |
|
309 | 311 | | |
|
310 | 312 | o changeset: 1:ef3a871183d7 |
|
311 | 313 | | user: test |
|
312 | 314 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
313 | 315 | | summary: b |
|
314 | 316 | | |
|
315 | 317 | o changeset: 0:9ab35a2d17cb |
|
316 | 318 | user: test |
|
317 | 319 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
318 | 320 | summary: a |
|
319 | 321 | |
|
320 | 322 | |
|
321 | 323 | 2 is parent of 3, only one strip should happen |
|
322 | 324 | |
|
323 | 325 | $ hg strip "roots(2)" 3 |
|
324 | 326 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
325 | 327 | $ hg log -G |
|
326 | 328 | @ changeset: 2:264128213d29 |
|
327 | 329 | | tag: tip |
|
328 | 330 | | user: test |
|
329 | 331 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
330 | 332 | | summary: c |
|
331 | 333 | | |
|
332 | 334 | o changeset: 1:ef3a871183d7 |
|
333 | 335 | | user: test |
|
334 | 336 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
335 | 337 | | summary: b |
|
336 | 338 | | |
|
337 | 339 | o changeset: 0:9ab35a2d17cb |
|
338 | 340 | user: test |
|
339 | 341 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
340 | 342 | summary: a |
|
341 | 343 | |
|
342 | 344 | $ restore |
|
343 | 345 | $ hg log -G |
|
344 | 346 | o changeset: 4:443431ffac4f |
|
345 | 347 | | tag: tip |
|
346 | 348 | | user: test |
|
347 | 349 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
348 | 350 | | summary: e |
|
349 | 351 | | |
|
350 | 352 | o changeset: 3:65bd5f99a4a3 |
|
351 | 353 | | parent: 1:ef3a871183d7 |
|
352 | 354 | | user: test |
|
353 | 355 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
354 | 356 | | summary: d |
|
355 | 357 | | |
|
356 | 358 | | @ changeset: 2:264128213d29 |
|
357 | 359 | |/ user: test |
|
358 | 360 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
359 | 361 | | summary: c |
|
360 | 362 | | |
|
361 | 363 | o changeset: 1:ef3a871183d7 |
|
362 | 364 | | user: test |
|
363 | 365 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
364 | 366 | | summary: b |
|
365 | 367 | | |
|
366 | 368 | o changeset: 0:9ab35a2d17cb |
|
367 | 369 | user: test |
|
368 | 370 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
369 | 371 | summary: a |
|
370 | 372 | |
|
371 | 373 | Failed hook while applying "saveheads" bundle. |
|
372 | 374 | |
|
373 | 375 | $ hg strip 2 --config hooks.pretxnchangegroup.bad=false |
|
374 | 376 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
375 | 377 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
376 | 378 | transaction abort! |
|
377 | 379 | rollback completed |
|
378 | 380 | strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob) |
|
379 | 381 | strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob) |
|
380 | 382 | (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob) |
|
381 | 383 | abort: pretxnchangegroup.bad hook exited with status 1 |
|
382 | 384 | [255] |
|
383 | 385 | $ restore |
|
384 | 386 | $ hg log -G |
|
385 | 387 | o changeset: 4:443431ffac4f |
|
386 | 388 | | tag: tip |
|
387 | 389 | | user: test |
|
388 | 390 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
389 | 391 | | summary: e |
|
390 | 392 | | |
|
391 | 393 | o changeset: 3:65bd5f99a4a3 |
|
392 | 394 | | parent: 1:ef3a871183d7 |
|
393 | 395 | | user: test |
|
394 | 396 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
395 | 397 | | summary: d |
|
396 | 398 | | |
|
397 | 399 | | o changeset: 2:264128213d29 |
|
398 | 400 | |/ user: test |
|
399 | 401 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
400 | 402 | | summary: c |
|
401 | 403 | | |
|
402 | 404 | @ changeset: 1:ef3a871183d7 |
|
403 | 405 | | user: test |
|
404 | 406 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
405 | 407 | | summary: b |
|
406 | 408 | | |
|
407 | 409 | o changeset: 0:9ab35a2d17cb |
|
408 | 410 | user: test |
|
409 | 411 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
410 | 412 | summary: a |
|
411 | 413 | |
|
412 | 414 | |
|
413 | 415 | 2 different branches: 2 strips |
|
414 | 416 | |
|
415 | 417 | $ hg strip 2 4 |
|
416 | 418 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
417 | 419 | $ hg log -G |
|
418 | 420 | o changeset: 2:65bd5f99a4a3 |
|
419 | 421 | | tag: tip |
|
420 | 422 | | user: test |
|
421 | 423 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
422 | 424 | | summary: d |
|
423 | 425 | | |
|
424 | 426 | @ changeset: 1:ef3a871183d7 |
|
425 | 427 | | user: test |
|
426 | 428 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
427 | 429 | | summary: b |
|
428 | 430 | | |
|
429 | 431 | o changeset: 0:9ab35a2d17cb |
|
430 | 432 | user: test |
|
431 | 433 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
432 | 434 | summary: a |
|
433 | 435 | |
|
434 | 436 | $ restore |
|
435 | 437 | |
|
436 | 438 | 2 different branches and a common ancestor: 1 strip |
|
437 | 439 | |
|
438 | 440 | $ hg strip 1 "2|4" |
|
439 | 441 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
440 | 442 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
441 | 443 | $ restore |
|
442 | 444 | |
|
443 | 445 | verify fncache is kept up-to-date |
|
444 | 446 | |
|
445 | 447 | $ touch a |
|
446 | 448 | $ hg ci -qAm a |
|
447 | 449 | $ cat .hg/store/fncache | sort |
|
448 | 450 | data/a.i |
|
449 | 451 | data/bar.i |
|
450 | 452 | $ hg strip tip |
|
451 | 453 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
452 | 454 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
453 | 455 | $ cat .hg/store/fncache |
|
454 | 456 | data/bar.i |
|
455 | 457 | |
|
456 | 458 | stripping an empty revset |
|
457 | 459 | |
|
458 | 460 | $ hg strip "1 and not 1" |
|
459 | 461 | abort: empty revision set |
|
460 | 462 | [255] |
|
461 | 463 | |
|
462 | 464 | remove branchy history for qimport tests |
|
463 | 465 | |
|
464 | 466 | $ hg strip 3 |
|
465 | 467 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
466 | 468 | |
|
467 | 469 | |
|
468 | 470 | strip of applied mq should cleanup status file |
|
469 | 471 | |
|
470 | 472 | $ echo "mq=" >> $HGRCPATH |
|
471 | 473 | $ hg up -C 3 |
|
472 | 474 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
473 | 475 | $ echo fooagain >> bar |
|
474 | 476 | $ hg ci -mf |
|
475 | 477 | $ hg qimport -r tip:2 |
|
476 | 478 | |
|
477 | 479 | applied patches before strip |
|
478 | 480 | |
|
479 | 481 | $ hg qapplied |
|
480 | 482 | d |
|
481 | 483 | e |
|
482 | 484 | f |
|
483 | 485 | |
|
484 | 486 | stripping revision in queue |
|
485 | 487 | |
|
486 | 488 | $ hg strip 3 |
|
487 | 489 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
488 | 490 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
489 | 491 | |
|
490 | 492 | applied patches after stripping rev in queue |
|
491 | 493 | |
|
492 | 494 | $ hg qapplied |
|
493 | 495 | d |
|
494 | 496 | |
|
495 | 497 | stripping ancestor of queue |
|
496 | 498 | |
|
497 | 499 | $ hg strip 1 |
|
498 | 500 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
499 | 501 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
500 | 502 | |
|
501 | 503 | applied patches after stripping ancestor of queue |
|
502 | 504 | |
|
503 | 505 | $ hg qapplied |
|
504 | 506 | |
|
505 | 507 | Verify strip protects against stripping wc parent when there are uncommitted mods |
|
506 | 508 | |
|
507 | 509 | $ echo b > b |
|
508 | 510 | $ echo bb > bar |
|
509 | 511 | $ hg add b |
|
510 | 512 | $ hg ci -m 'b' |
|
511 | 513 | $ hg log --graph |
|
512 | 514 | @ changeset: 1:76dcf9fab855 |
|
513 | 515 | | tag: tip |
|
514 | 516 | | user: test |
|
515 | 517 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
516 | 518 | | summary: b |
|
517 | 519 | | |
|
518 | 520 | o changeset: 0:9ab35a2d17cb |
|
519 | 521 | user: test |
|
520 | 522 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
521 | 523 | summary: a |
|
522 | 524 | |
|
523 | 525 | $ hg up 0 |
|
524 | 526 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
525 | 527 | $ echo c > bar |
|
526 | 528 | $ hg up -t false |
|
527 | 529 | merging bar |
|
528 | 530 | merging bar failed! |
|
529 | 531 | 1 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
530 | 532 | use 'hg resolve' to retry unresolved file merges |
|
531 | 533 | [1] |
|
532 | 534 | $ hg sum |
|
533 | 535 | parent: 1:76dcf9fab855 tip |
|
534 | 536 | b |
|
535 | 537 | branch: default |
|
536 | 538 | commit: 1 modified, 1 unknown, 1 unresolved |
|
537 | 539 | update: (current) |
|
538 | 540 | phases: 2 draft |
|
539 | 541 | mq: 3 unapplied |
|
540 | 542 | |
|
541 | 543 | $ echo c > b |
|
542 | 544 | $ hg strip tip |
|
543 | 545 | abort: local changes found |
|
544 | 546 | [255] |
|
545 | 547 | $ hg strip tip --keep |
|
546 | 548 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
547 | 549 | $ hg log --graph |
|
548 | 550 | @ changeset: 0:9ab35a2d17cb |
|
549 | 551 | tag: tip |
|
550 | 552 | user: test |
|
551 | 553 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
552 | 554 | summary: a |
|
553 | 555 | |
|
554 | 556 | $ hg status |
|
555 | 557 | M bar |
|
556 | 558 | ? b |
|
557 | 559 | ? bar.orig |
|
558 | 560 | |
|
559 | 561 | $ rm bar.orig |
|
560 | 562 | $ hg sum |
|
561 | 563 | parent: 0:9ab35a2d17cb tip |
|
562 | 564 | a |
|
563 | 565 | branch: default |
|
564 | 566 | commit: 1 modified, 1 unknown |
|
565 | 567 | update: (current) |
|
566 | 568 | phases: 1 draft |
|
567 | 569 | mq: 3 unapplied |
|
568 | 570 | |
|
569 | 571 | Strip adds, removes, modifies with --keep |
|
570 | 572 | |
|
571 | 573 | $ touch b |
|
572 | 574 | $ hg add b |
|
573 | 575 | $ hg commit -mb |
|
574 | 576 | $ touch c |
|
575 | 577 | |
|
576 | 578 | ... with a clean working dir |
|
577 | 579 | |
|
578 | 580 | $ hg add c |
|
579 | 581 | $ hg rm bar |
|
580 | 582 | $ hg commit -mc |
|
581 | 583 | $ hg status |
|
582 | 584 | $ hg strip --keep tip |
|
583 | 585 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
584 | 586 | $ hg status |
|
585 | 587 | ! bar |
|
586 | 588 | ? c |
|
587 | 589 | |
|
588 | 590 | ... with a dirty working dir |
|
589 | 591 | |
|
590 | 592 | $ hg add c |
|
591 | 593 | $ hg rm bar |
|
592 | 594 | $ hg commit -mc |
|
593 | 595 | $ hg status |
|
594 | 596 | $ echo b > b |
|
595 | 597 | $ echo d > d |
|
596 | 598 | $ hg strip --keep tip |
|
597 | 599 | saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob) |
|
598 | 600 | $ hg status |
|
599 | 601 | M b |
|
600 | 602 | ! bar |
|
601 | 603 | ? c |
|
602 | 604 | ? d |
|
603 | 605 | |
|
604 | 606 | ... after updating the dirstate |
|
605 | 607 | $ hg add c |
|
606 | 608 | $ hg commit -mc |
|
607 | 609 | $ hg rm c |
|
608 | 610 | $ hg commit -mc |
|
609 | 611 | $ hg strip --keep '.^' -q |
|
610 | 612 | $ cd .. |
|
611 | 613 | |
|
612 | 614 | stripping many nodes on a complex graph (issue3299) |
|
613 | 615 | |
|
614 | 616 | $ hg init issue3299 |
|
615 | 617 | $ cd issue3299 |
|
616 | 618 | $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a' |
|
617 | 619 | $ hg strip 'not ancestors(x)' |
|
618 | 620 | saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob) |
|
619 | 621 | |
|
620 | 622 | test hg strip -B bookmark |
|
621 | 623 | |
|
622 | 624 | $ cd .. |
|
623 | 625 | $ hg init bookmarks |
|
624 | 626 | $ cd bookmarks |
|
625 | 627 | $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f' |
|
626 | 628 | $ hg bookmark -r 'a' 'todelete' |
|
627 | 629 | $ hg bookmark -r 'b' 'B' |
|
628 | 630 | $ hg bookmark -r 'b' 'nostrip' |
|
629 | 631 | $ hg bookmark -r 'c' 'delete' |
|
630 | 632 | $ hg bookmark -r 'd' 'multipledelete1' |
|
631 | 633 | $ hg bookmark -r 'e' 'multipledelete2' |
|
632 | 634 | $ hg bookmark -r 'f' 'singlenode1' |
|
633 | 635 | $ hg bookmark -r 'f' 'singlenode2' |
|
634 | 636 | $ hg up -C todelete |
|
635 | 637 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
636 | 638 | (activating bookmark todelete) |
|
637 | 639 | $ hg strip -B nostrip |
|
638 | 640 | bookmark 'nostrip' deleted |
|
639 | 641 | abort: empty revision set |
|
640 | 642 | [255] |
|
641 | 643 | $ hg strip -B todelete |
|
642 | 644 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
643 | 645 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
644 | 646 | bookmark 'todelete' deleted |
|
645 | 647 | $ hg id -ir dcbb326fdec2 |
|
646 | 648 | abort: unknown revision 'dcbb326fdec2'! |
|
647 | 649 | [255] |
|
648 | 650 | $ hg id -ir d62d843c9a01 |
|
649 | 651 | d62d843c9a01 |
|
650 | 652 | $ hg bookmarks |
|
651 | 653 | B 9:ff43616e5d0f |
|
652 | 654 | delete 6:2702dd0c91e7 |
|
653 | 655 | multipledelete1 11:e46a4836065c |
|
654 | 656 | multipledelete2 12:b4594d867745 |
|
655 | 657 | singlenode1 13:43227190fef8 |
|
656 | 658 | singlenode2 13:43227190fef8 |
|
657 | 659 | $ hg strip -B multipledelete1 -B multipledelete2 |
|
658 | 660 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg (glob) |
|
659 | 661 | bookmark 'multipledelete1' deleted |
|
660 | 662 | bookmark 'multipledelete2' deleted |
|
661 | 663 | $ hg id -ir e46a4836065c |
|
662 | 664 | abort: unknown revision 'e46a4836065c'! |
|
663 | 665 | [255] |
|
664 | 666 | $ hg id -ir b4594d867745 |
|
665 | 667 | abort: unknown revision 'b4594d867745'! |
|
666 | 668 | [255] |
|
667 | 669 | $ hg strip -B singlenode1 -B singlenode2 |
|
668 | 670 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg (glob) |
|
669 | 671 | bookmark 'singlenode1' deleted |
|
670 | 672 | bookmark 'singlenode2' deleted |
|
671 | 673 | $ hg id -ir 43227190fef8 |
|
672 | 674 | abort: unknown revision '43227190fef8'! |
|
673 | 675 | [255] |
|
674 | 676 | $ hg strip -B unknownbookmark |
|
675 | 677 | abort: bookmark 'unknownbookmark' not found |
|
676 | 678 | [255] |
|
677 | 679 | $ hg strip -B unknownbookmark1 -B unknownbookmark2 |
|
678 | 680 | abort: bookmark 'unknownbookmark1,unknownbookmark2' not found |
|
679 | 681 | [255] |
|
680 | 682 | $ hg strip -B delete -B unknownbookmark |
|
681 | 683 | abort: bookmark 'unknownbookmark' not found |
|
682 | 684 | [255] |
|
683 | 685 | $ hg strip -B delete |
|
684 | 686 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
685 | 687 | bookmark 'delete' deleted |
|
686 | 688 | $ hg id -ir 6:2702dd0c91e7 |
|
687 | 689 | abort: unknown revision '2702dd0c91e7'! |
|
688 | 690 | [255] |
|
689 | 691 | $ hg update B |
|
690 | 692 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
691 | 693 | (activating bookmark B) |
|
692 | 694 | $ echo a > a |
|
693 | 695 | $ hg add a |
|
694 | 696 | $ hg strip -B B |
|
695 | 697 | abort: local changes found |
|
696 | 698 | [255] |
|
697 | 699 | $ hg bookmarks |
|
698 | 700 | * B 6:ff43616e5d0f |
|
699 | 701 | |
|
700 | 702 | Make sure no one adds back a -b option: |
|
701 | 703 | |
|
702 | 704 | $ hg strip -b tip |
|
703 | 705 | hg strip: option -b not recognized |
|
704 | 706 | hg strip [-k] [-f] [-B bookmark] [-r] REV... |
|
705 | 707 | |
|
706 | 708 | strip changesets and all their descendants from the repository |
|
707 | 709 | |
|
708 | 710 | (use 'hg help -e strip' to show help for the strip extension) |
|
709 | 711 | |
|
710 | 712 | options ([+] can be repeated): |
|
711 | 713 | |
|
712 | 714 | -r --rev REV [+] strip specified revision (optional, can specify |
|
713 | 715 | revisions without this option) |
|
714 | 716 | -f --force force removal of changesets, discard uncommitted |
|
715 | 717 | changes (no backup) |
|
716 | 718 | --no-backup no backups |
|
717 | 719 | -k --keep do not modify working directory during strip |
|
718 | 720 | -B --bookmark VALUE [+] remove revs only reachable from given bookmark |
|
719 | 721 | --mq operate on patch repository |
|
720 | 722 | |
|
721 | 723 | (use 'hg strip -h' to show more help) |
|
722 | 724 | [255] |
|
723 | 725 | |
|
724 | 726 | $ cd .. |
|
725 | 727 | |
|
726 | 728 | Verify bundles don't get overwritten: |
|
727 | 729 | |
|
728 | 730 | $ hg init doublebundle |
|
729 | 731 | $ cd doublebundle |
|
730 | 732 | $ touch a |
|
731 | 733 | $ hg commit -Aqm a |
|
732 | 734 | $ touch b |
|
733 | 735 | $ hg commit -Aqm b |
|
734 | 736 | $ hg strip -r 0 |
|
735 | 737 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
736 | 738 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg (glob) |
|
737 | 739 | $ ls .hg/strip-backup |
|
738 | 740 | 3903775176ed-e68910bd-backup.hg |
|
739 | 741 | $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg |
|
740 | 742 | $ hg strip -r 0 |
|
741 | 743 | saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg (glob) |
|
742 | 744 | $ ls .hg/strip-backup |
|
743 | 745 | 3903775176ed-54390173-backup.hg |
|
744 | 746 | 3903775176ed-e68910bd-backup.hg |
|
745 | 747 | $ cd .. |
|
746 | 748 | |
|
747 | 749 | Test that we only bundle the stripped changesets (issue4736) |
|
748 | 750 | ------------------------------------------------------------ |
|
749 | 751 | |
|
750 | 752 | initialization (previous repo is empty anyway) |
|
751 | 753 | |
|
752 | 754 | $ hg init issue4736 |
|
753 | 755 | $ cd issue4736 |
|
754 | 756 | $ echo a > a |
|
755 | 757 | $ hg add a |
|
756 | 758 | $ hg commit -m commitA |
|
757 | 759 | $ echo b > b |
|
758 | 760 | $ hg add b |
|
759 | 761 | $ hg commit -m commitB |
|
760 | 762 | $ echo c > c |
|
761 | 763 | $ hg add c |
|
762 | 764 | $ hg commit -m commitC |
|
763 | 765 | $ hg up 'desc(commitB)' |
|
764 | 766 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
765 | 767 | $ echo d > d |
|
766 | 768 | $ hg add d |
|
767 | 769 | $ hg commit -m commitD |
|
768 | 770 | created new head |
|
769 | 771 | $ hg up 'desc(commitC)' |
|
770 | 772 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
771 | 773 | $ hg merge 'desc(commitD)' |
|
772 | 774 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
773 | 775 | (branch merge, don't forget to commit) |
|
774 | 776 | $ hg ci -m 'mergeCD' |
|
775 | 777 | $ hg log -G |
|
776 | 778 | @ changeset: 4:d8db9d137221 |
|
777 | 779 | |\ tag: tip |
|
778 | 780 | | | parent: 2:5c51d8d6557d |
|
779 | 781 | | | parent: 3:6625a5168474 |
|
780 | 782 | | | user: test |
|
781 | 783 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
782 | 784 | | | summary: mergeCD |
|
783 | 785 | | | |
|
784 | 786 | | o changeset: 3:6625a5168474 |
|
785 | 787 | | | parent: 1:eca11cf91c71 |
|
786 | 788 | | | user: test |
|
787 | 789 | | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
788 | 790 | | | summary: commitD |
|
789 | 791 | | | |
|
790 | 792 | o | changeset: 2:5c51d8d6557d |
|
791 | 793 | |/ user: test |
|
792 | 794 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
793 | 795 | | summary: commitC |
|
794 | 796 | | |
|
795 | 797 | o changeset: 1:eca11cf91c71 |
|
796 | 798 | | user: test |
|
797 | 799 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
798 | 800 | | summary: commitB |
|
799 | 801 | | |
|
800 | 802 | o changeset: 0:105141ef12d0 |
|
801 | 803 | user: test |
|
802 | 804 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
803 | 805 | summary: commitA |
|
804 | 806 | |
|
805 | 807 | |
|
806 | 808 | Check bundle behavior: |
|
807 | 809 | |
|
808 | 810 | $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg |
|
809 | 811 | 2 changesets found |
|
810 | 812 | $ hg log -r 'bundle()' -R ../issue4736.hg |
|
811 | 813 | changeset: 3:6625a5168474 |
|
812 | 814 | parent: 1:eca11cf91c71 |
|
813 | 815 | user: test |
|
814 | 816 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
815 | 817 | summary: commitD |
|
816 | 818 | |
|
817 | 819 | changeset: 4:d8db9d137221 |
|
818 | 820 | tag: tip |
|
819 | 821 | parent: 2:5c51d8d6557d |
|
820 | 822 | parent: 3:6625a5168474 |
|
821 | 823 | user: test |
|
822 | 824 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
823 | 825 | summary: mergeCD |
|
824 | 826 | |
|
825 | 827 | |
|
826 | 828 | check strip behavior |
|
827 | 829 | |
|
828 | 830 | $ hg --config extensions.strip= strip 'desc(commitD)' --debug |
|
829 | 831 | resolving manifests |
|
830 | 832 | branchmerge: False, force: True, partial: False |
|
831 | 833 | ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71 |
|
832 | 834 | c: other deleted -> r |
|
833 | 835 | removing c |
|
834 | 836 | d: other deleted -> r |
|
835 | 837 | removing d |
|
836 | 838 | starting 4 threads for background file closing (?) |
|
837 | 839 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
838 | 840 | 2 changesets found |
|
839 | 841 | list of changesets: |
|
840 | 842 | 6625a516847449b6f0fa3737b9ba56e9f0f3032c |
|
841 | 843 | d8db9d1372214336d2b5570f20ee468d2c72fa8b |
|
842 |
bundle2-output-bundle: "HG20", (1 params) |
|
|
844 | bundle2-output-bundle: "HG20", (1 params) 2 parts total | |
|
843 | 845 | bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload |
|
846 | bundle2-output-part: "phase-heads" 24 bytes payload | |
|
844 | 847 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg (glob) |
|
845 | 848 | updating the branch cache |
|
846 | 849 | invalid branchheads cache (served): tip differs |
|
847 | 850 | truncating cache/rbc-revs-v1 to 24 |
|
848 | 851 | $ hg log -G |
|
849 | 852 | o changeset: 2:5c51d8d6557d |
|
850 | 853 | | tag: tip |
|
851 | 854 | | user: test |
|
852 | 855 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
853 | 856 | | summary: commitC |
|
854 | 857 | | |
|
855 | 858 | @ changeset: 1:eca11cf91c71 |
|
856 | 859 | | user: test |
|
857 | 860 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
858 | 861 | | summary: commitB |
|
859 | 862 | | |
|
860 | 863 | o changeset: 0:105141ef12d0 |
|
861 | 864 | user: test |
|
862 | 865 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
863 | 866 | summary: commitA |
|
864 | 867 | |
|
865 | 868 | |
|
866 | 869 | strip backup content |
|
867 | 870 | |
|
868 | 871 | $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg |
|
869 | 872 | changeset: 3:6625a5168474 |
|
870 | 873 | parent: 1:eca11cf91c71 |
|
871 | 874 | user: test |
|
872 | 875 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
873 | 876 | summary: commitD |
|
874 | 877 | |
|
875 | 878 | changeset: 4:d8db9d137221 |
|
876 | 879 | tag: tip |
|
877 | 880 | parent: 2:5c51d8d6557d |
|
878 | 881 | parent: 3:6625a5168474 |
|
879 | 882 | user: test |
|
880 | 883 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
881 | 884 | summary: mergeCD |
|
882 | 885 | |
|
883 | 886 | Check that the phase cache is properly invalidated after a strip with bookmark. |
|
884 | 887 | |
|
885 | 888 | $ cat > ../stripstalephasecache.py << EOF |
|
886 | 889 | > from mercurial import extensions, localrepo |
|
887 | 890 | > def transactioncallback(orig, repo, desc, *args, **kwargs): |
|
888 | 891 | > def test(transaction): |
|
889 | 892 | > # observe cache inconsistency |
|
890 | 893 | > try: |
|
891 | 894 | > [repo.changelog.node(r) for r in repo.revs("not public()")] |
|
892 | 895 | > except IndexError: |
|
893 | 896 | > repo.ui.status("Index error!\n") |
|
894 | 897 | > transaction = orig(repo, desc, *args, **kwargs) |
|
895 | 898 | > # warm up the phase cache |
|
896 | 899 | > list(repo.revs("not public()")) |
|
897 | 900 | > if desc != 'strip': |
|
898 | 901 | > transaction.addpostclose("phase invalidation test", test) |
|
899 | 902 | > return transaction |
|
900 | 903 | > def extsetup(ui): |
|
901 | 904 | > extensions.wrapfunction(localrepo.localrepository, "transaction", |
|
902 | 905 | > transactioncallback) |
|
903 | 906 | > EOF |
|
904 | 907 | $ hg up -C 2 |
|
905 | 908 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
906 | 909 | $ echo k > k |
|
907 | 910 | $ hg add k |
|
908 | 911 | $ hg commit -m commitK |
|
909 | 912 | $ echo l > l |
|
910 | 913 | $ hg add l |
|
911 | 914 | $ hg commit -m commitL |
|
912 | 915 | $ hg book -r tip blah |
|
913 | 916 | $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py |
|
914 | 917 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
915 | 918 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg (glob) |
|
916 | 919 | $ hg up -C 1 |
|
917 | 920 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
918 | 921 | |
|
919 | 922 | Error during post-close callback of the strip transaction |
|
920 | 923 | (They should be gracefully handled and reported) |
|
921 | 924 | |
|
922 | 925 | $ cat > ../crashstrip.py << EOF |
|
923 | 926 | > from mercurial import error |
|
924 | 927 | > def reposetup(ui, repo): |
|
925 | 928 | > class crashstriprepo(repo.__class__): |
|
926 | 929 | > def transaction(self, desc, *args, **kwargs): |
|
927 | 930 | > tr = super(crashstriprepo, self).transaction(self, desc, *args, **kwargs) |
|
928 | 931 | > if desc == 'strip': |
|
929 | 932 | > def crash(tra): raise error.Abort('boom') |
|
930 | 933 | > tr.addpostclose('crash', crash) |
|
931 | 934 | > return tr |
|
932 | 935 | > repo.__class__ = crashstriprepo |
|
933 | 936 | > EOF |
|
934 | 937 | $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py |
|
935 | 938 | saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg (glob) |
|
936 | 939 | strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg' (glob) |
|
937 | 940 | abort: boom |
|
938 | 941 | [255] |
|
939 | 942 | |
|
940 | 943 |
General Comments 0
You need to be logged in to leave comments.
Login now