Show More
@@ -1,467 +1,475 | |||
|
1 | 1 | # bundlerepo.py - repository class for viewing uncompressed bundles |
|
2 | 2 | # |
|
3 | 3 | # Copyright 2006, 2007 Benoit Boissinot <bboissin@gmail.com> |
|
4 | 4 | # |
|
5 | 5 | # This software may be used and distributed according to the terms of the |
|
6 | 6 | # GNU General Public License version 2 or any later version. |
|
7 | 7 | |
|
8 | 8 | """Repository class for viewing uncompressed bundles. |
|
9 | 9 | |
|
10 | 10 | This provides a read-only repository interface to bundles as if they |
|
11 | 11 | were part of the actual repository. |
|
12 | 12 | """ |
|
13 | 13 | |
|
14 | 14 | from node import nullid |
|
15 | 15 | from i18n import _ |
|
16 | 16 | import os, tempfile, shutil |
|
17 | 17 | import changegroup, util, mdiff, discovery, cmdutil, scmutil, exchange |
|
18 | 18 | import localrepo, changelog, manifest, filelog, revlog, error, phases, bundle2 |
|
19 | 19 | import pathutil |
|
20 | 20 | |
|
21 | 21 | class bundlerevlog(revlog.revlog): |
|
22 | 22 | def __init__(self, opener, indexfile, bundle, linkmapper): |
|
23 | 23 | # How it works: |
|
24 | 24 | # To retrieve a revision, we need to know the offset of the revision in |
|
25 | 25 | # the bundle (an unbundle object). We store this offset in the index |
|
26 | 26 | # (start). The base of the delta is stored in the base field. |
|
27 | 27 | # |
|
28 | 28 | # To differentiate a rev in the bundle from a rev in the revlog, we |
|
29 | 29 | # check revision against repotiprev. |
|
30 | 30 | opener = scmutil.readonlyvfs(opener) |
|
31 | 31 | revlog.revlog.__init__(self, opener, indexfile) |
|
32 | 32 | self.bundle = bundle |
|
33 | 33 | n = len(self) |
|
34 | 34 | self.repotiprev = n - 1 |
|
35 | 35 | chain = None |
|
36 | 36 | self.bundlerevs = set() # used by 'bundle()' revset expression |
|
37 | 37 | while True: |
|
38 | 38 | chunkdata = bundle.deltachunk(chain) |
|
39 | 39 | if not chunkdata: |
|
40 | 40 | break |
|
41 | 41 | node = chunkdata['node'] |
|
42 | 42 | p1 = chunkdata['p1'] |
|
43 | 43 | p2 = chunkdata['p2'] |
|
44 | 44 | cs = chunkdata['cs'] |
|
45 | 45 | deltabase = chunkdata['deltabase'] |
|
46 | 46 | delta = chunkdata['delta'] |
|
47 | 47 | |
|
48 | 48 | size = len(delta) |
|
49 | 49 | start = bundle.tell() - size |
|
50 | 50 | |
|
51 | 51 | link = linkmapper(cs) |
|
52 | 52 | if node in self.nodemap: |
|
53 | 53 | # this can happen if two branches make the same change |
|
54 | 54 | chain = node |
|
55 | 55 | self.bundlerevs.add(self.nodemap[node]) |
|
56 | 56 | continue |
|
57 | 57 | |
|
58 | 58 | for p in (p1, p2): |
|
59 | 59 | if p not in self.nodemap: |
|
60 | 60 | raise error.LookupError(p, self.indexfile, |
|
61 | 61 | _("unknown parent")) |
|
62 | 62 | |
|
63 | 63 | if deltabase not in self.nodemap: |
|
64 | 64 | raise LookupError(deltabase, self.indexfile, |
|
65 | 65 | _('unknown delta base')) |
|
66 | 66 | |
|
67 | 67 | baserev = self.rev(deltabase) |
|
68 | 68 | # start, size, full unc. size, base (unused), link, p1, p2, node |
|
69 | 69 | e = (revlog.offset_type(start, 0), size, -1, baserev, link, |
|
70 | 70 | self.rev(p1), self.rev(p2), node) |
|
71 | 71 | self.index.insert(-1, e) |
|
72 | 72 | self.nodemap[node] = n |
|
73 | 73 | self.bundlerevs.add(n) |
|
74 | 74 | chain = node |
|
75 | 75 | n += 1 |
|
76 | 76 | |
|
77 | 77 | def _chunk(self, rev): |
|
78 | 78 | # Warning: in case of bundle, the diff is against what we stored as |
|
79 | 79 | # delta base, not against rev - 1 |
|
80 | 80 | # XXX: could use some caching |
|
81 | 81 | if rev <= self.repotiprev: |
|
82 | 82 | return revlog.revlog._chunk(self, rev) |
|
83 | 83 | self.bundle.seek(self.start(rev)) |
|
84 | 84 | return self.bundle.read(self.length(rev)) |
|
85 | 85 | |
|
86 | 86 | def revdiff(self, rev1, rev2): |
|
87 | 87 | """return or calculate a delta between two revisions""" |
|
88 | 88 | if rev1 > self.repotiprev and rev2 > self.repotiprev: |
|
89 | 89 | # hot path for bundle |
|
90 | 90 | revb = self.index[rev2][3] |
|
91 | 91 | if revb == rev1: |
|
92 | 92 | return self._chunk(rev2) |
|
93 | 93 | elif rev1 <= self.repotiprev and rev2 <= self.repotiprev: |
|
94 | 94 | return revlog.revlog.revdiff(self, rev1, rev2) |
|
95 | 95 | |
|
96 | 96 | return mdiff.textdiff(self.revision(self.node(rev1)), |
|
97 | 97 | self.revision(self.node(rev2))) |
|
98 | 98 | |
|
99 | 99 | def revision(self, nodeorrev): |
|
100 | 100 | """return an uncompressed revision of a given node or revision |
|
101 | 101 | number. |
|
102 | 102 | """ |
|
103 | 103 | if isinstance(nodeorrev, int): |
|
104 | 104 | rev = nodeorrev |
|
105 | 105 | node = self.node(rev) |
|
106 | 106 | else: |
|
107 | 107 | node = nodeorrev |
|
108 | 108 | rev = self.rev(node) |
|
109 | 109 | |
|
110 | 110 | if node == nullid: |
|
111 | 111 | return "" |
|
112 | 112 | |
|
113 | 113 | text = None |
|
114 | 114 | chain = [] |
|
115 | 115 | iterrev = rev |
|
116 | 116 | # reconstruct the revision if it is from a changegroup |
|
117 | 117 | while iterrev > self.repotiprev: |
|
118 | 118 | if self._cache and self._cache[1] == iterrev: |
|
119 | 119 | text = self._cache[2] |
|
120 | 120 | break |
|
121 | 121 | chain.append(iterrev) |
|
122 | 122 | iterrev = self.index[iterrev][3] |
|
123 | 123 | if text is None: |
|
124 | 124 | text = self.baserevision(iterrev) |
|
125 | 125 | |
|
126 | 126 | while chain: |
|
127 | 127 | delta = self._chunk(chain.pop()) |
|
128 | 128 | text = mdiff.patches(text, [delta]) |
|
129 | 129 | |
|
130 | 130 | self._checkhash(text, node, rev) |
|
131 | 131 | self._cache = (node, rev, text) |
|
132 | 132 | return text |
|
133 | 133 | |
|
134 | 134 | def baserevision(self, nodeorrev): |
|
135 | 135 | # Revlog subclasses may override 'revision' method to modify format of |
|
136 | 136 | # content retrieved from revlog. To use bundlerevlog with such class one |
|
137 | 137 | # needs to override 'baserevision' and make more specific call here. |
|
138 | 138 | return revlog.revlog.revision(self, nodeorrev) |
|
139 | 139 | |
|
140 | 140 | def addrevision(self, text, transaction, link, p1=None, p2=None, d=None): |
|
141 | 141 | raise NotImplementedError |
|
142 | 142 | def addgroup(self, revs, linkmapper, transaction): |
|
143 | 143 | raise NotImplementedError |
|
144 | 144 | def strip(self, rev, minlink): |
|
145 | 145 | raise NotImplementedError |
|
146 | 146 | def checksize(self): |
|
147 | 147 | raise NotImplementedError |
|
148 | 148 | |
|
149 | 149 | class bundlechangelog(bundlerevlog, changelog.changelog): |
|
150 | 150 | def __init__(self, opener, bundle): |
|
151 | 151 | changelog.changelog.__init__(self, opener) |
|
152 | 152 | linkmapper = lambda x: x |
|
153 | 153 | bundlerevlog.__init__(self, opener, self.indexfile, bundle, |
|
154 | 154 | linkmapper) |
|
155 | 155 | |
|
156 | 156 | def baserevision(self, nodeorrev): |
|
157 | 157 | # Although changelog doesn't override 'revision' method, some extensions |
|
158 | 158 | # may replace this class with another that does. Same story with |
|
159 | 159 | # manifest and filelog classes. |
|
160 | ||
|
161 | # This bypasses filtering on changelog.node() and rev() because we need | |
|
162 | # revision text of the bundle base even if it is hidden. | |
|
163 | oldfilter = self.filteredrevs | |
|
164 | try: | |
|
165 | self.filteredrevs = () | |
|
160 | 166 | return changelog.changelog.revision(self, nodeorrev) |
|
167 | finally: | |
|
168 | self.filteredrevs = oldfilter | |
|
161 | 169 | |
|
162 | 170 | class bundlemanifest(bundlerevlog, manifest.manifest): |
|
163 | 171 | def __init__(self, opener, bundle, linkmapper): |
|
164 | 172 | manifest.manifest.__init__(self, opener) |
|
165 | 173 | bundlerevlog.__init__(self, opener, self.indexfile, bundle, |
|
166 | 174 | linkmapper) |
|
167 | 175 | |
|
168 | 176 | def baserevision(self, nodeorrev): |
|
169 | 177 | return manifest.manifest.revision(self, nodeorrev) |
|
170 | 178 | |
|
171 | 179 | class bundlefilelog(bundlerevlog, filelog.filelog): |
|
172 | 180 | def __init__(self, opener, path, bundle, linkmapper, repo): |
|
173 | 181 | filelog.filelog.__init__(self, opener, path) |
|
174 | 182 | bundlerevlog.__init__(self, opener, self.indexfile, bundle, |
|
175 | 183 | linkmapper) |
|
176 | 184 | self._repo = repo |
|
177 | 185 | |
|
178 | 186 | def baserevision(self, nodeorrev): |
|
179 | 187 | return filelog.filelog.revision(self, nodeorrev) |
|
180 | 188 | |
|
181 | 189 | class bundlepeer(localrepo.localpeer): |
|
182 | 190 | def canpush(self): |
|
183 | 191 | return False |
|
184 | 192 | |
|
185 | 193 | class bundlephasecache(phases.phasecache): |
|
186 | 194 | def __init__(self, *args, **kwargs): |
|
187 | 195 | super(bundlephasecache, self).__init__(*args, **kwargs) |
|
188 | 196 | if util.safehasattr(self, 'opener'): |
|
189 | 197 | self.opener = scmutil.readonlyvfs(self.opener) |
|
190 | 198 | |
|
191 | 199 | def write(self): |
|
192 | 200 | raise NotImplementedError |
|
193 | 201 | |
|
194 | 202 | def _write(self, fp): |
|
195 | 203 | raise NotImplementedError |
|
196 | 204 | |
|
197 | 205 | def _updateroots(self, phase, newroots, tr): |
|
198 | 206 | self.phaseroots[phase] = newroots |
|
199 | 207 | self.invalidate() |
|
200 | 208 | self.dirty = True |
|
201 | 209 | |
|
202 | 210 | class bundlerepository(localrepo.localrepository): |
|
203 | 211 | def __init__(self, ui, path, bundlename): |
|
204 | 212 | self._tempparent = None |
|
205 | 213 | try: |
|
206 | 214 | localrepo.localrepository.__init__(self, ui, path) |
|
207 | 215 | except error.RepoError: |
|
208 | 216 | self._tempparent = tempfile.mkdtemp() |
|
209 | 217 | localrepo.instance(ui, self._tempparent, 1) |
|
210 | 218 | localrepo.localrepository.__init__(self, ui, self._tempparent) |
|
211 | 219 | self.ui.setconfig('phases', 'publish', False, 'bundlerepo') |
|
212 | 220 | |
|
213 | 221 | if path: |
|
214 | 222 | self._url = 'bundle:' + util.expandpath(path) + '+' + bundlename |
|
215 | 223 | else: |
|
216 | 224 | self._url = 'bundle:' + bundlename |
|
217 | 225 | |
|
218 | 226 | self.tempfile = None |
|
219 | 227 | f = util.posixfile(bundlename, "rb") |
|
220 | 228 | self.bundlefile = self.bundle = exchange.readbundle(ui, f, bundlename) |
|
221 | 229 | if self.bundle.compressed(): |
|
222 | 230 | fdtemp, temp = self.vfs.mkstemp(prefix="hg-bundle-", |
|
223 | 231 | suffix=".hg10un") |
|
224 | 232 | self.tempfile = temp |
|
225 | 233 | fptemp = os.fdopen(fdtemp, 'wb') |
|
226 | 234 | |
|
227 | 235 | try: |
|
228 | 236 | fptemp.write("HG10UN") |
|
229 | 237 | while True: |
|
230 | 238 | chunk = self.bundle.read(2**18) |
|
231 | 239 | if not chunk: |
|
232 | 240 | break |
|
233 | 241 | fptemp.write(chunk) |
|
234 | 242 | finally: |
|
235 | 243 | fptemp.close() |
|
236 | 244 | |
|
237 | 245 | f = self.vfs.open(self.tempfile, mode="rb") |
|
238 | 246 | self.bundlefile = self.bundle = exchange.readbundle(ui, f, |
|
239 | 247 | bundlename, |
|
240 | 248 | self.vfs) |
|
241 | 249 | |
|
242 | 250 | if isinstance(self.bundle, bundle2.unbundle20): |
|
243 | 251 | cgparts = [part for part in self.bundle.iterparts() |
|
244 | 252 | if (part.type == 'changegroup') |
|
245 | 253 | and (part.params.get('version', '01') |
|
246 | 254 | in changegroup.packermap)] |
|
247 | 255 | |
|
248 | 256 | if not cgparts: |
|
249 | 257 | raise util.Abort('No changegroups found') |
|
250 | 258 | version = cgparts[0].params.get('version', '01') |
|
251 | 259 | cgparts = [p for p in cgparts |
|
252 | 260 | if p.params.get('version', '01') == version] |
|
253 | 261 | if len(cgparts) > 1: |
|
254 | 262 | raise NotImplementedError("Can't process multiple changegroups") |
|
255 | 263 | part = cgparts[0] |
|
256 | 264 | |
|
257 | 265 | part.seek(0) |
|
258 | 266 | self.bundle = changegroup.packermap[version][1](part, 'UN') |
|
259 | 267 | |
|
260 | 268 | # dict with the mapping 'filename' -> position in the bundle |
|
261 | 269 | self.bundlefilespos = {} |
|
262 | 270 | |
|
263 | 271 | self.firstnewrev = self.changelog.repotiprev + 1 |
|
264 | 272 | phases.retractboundary(self, None, phases.draft, |
|
265 | 273 | [ctx.node() for ctx in self[self.firstnewrev:]]) |
|
266 | 274 | |
|
267 | 275 | @localrepo.unfilteredpropertycache |
|
268 | 276 | def _phasecache(self): |
|
269 | 277 | return bundlephasecache(self, self._phasedefaults) |
|
270 | 278 | |
|
271 | 279 | @localrepo.unfilteredpropertycache |
|
272 | 280 | def changelog(self): |
|
273 | 281 | # consume the header if it exists |
|
274 | 282 | self.bundle.changelogheader() |
|
275 | 283 | c = bundlechangelog(self.svfs, self.bundle) |
|
276 | 284 | self.manstart = self.bundle.tell() |
|
277 | 285 | return c |
|
278 | 286 | |
|
279 | 287 | @localrepo.unfilteredpropertycache |
|
280 | 288 | def manifest(self): |
|
281 | 289 | self.bundle.seek(self.manstart) |
|
282 | 290 | # consume the header if it exists |
|
283 | 291 | self.bundle.manifestheader() |
|
284 | 292 | m = bundlemanifest(self.svfs, self.bundle, self.changelog.rev) |
|
285 | 293 | self.filestart = self.bundle.tell() |
|
286 | 294 | return m |
|
287 | 295 | |
|
288 | 296 | @localrepo.unfilteredpropertycache |
|
289 | 297 | def manstart(self): |
|
290 | 298 | self.changelog |
|
291 | 299 | return self.manstart |
|
292 | 300 | |
|
293 | 301 | @localrepo.unfilteredpropertycache |
|
294 | 302 | def filestart(self): |
|
295 | 303 | self.manifest |
|
296 | 304 | return self.filestart |
|
297 | 305 | |
|
298 | 306 | def url(self): |
|
299 | 307 | return self._url |
|
300 | 308 | |
|
301 | 309 | def file(self, f): |
|
302 | 310 | if not self.bundlefilespos: |
|
303 | 311 | self.bundle.seek(self.filestart) |
|
304 | 312 | while True: |
|
305 | 313 | chunkdata = self.bundle.filelogheader() |
|
306 | 314 | if not chunkdata: |
|
307 | 315 | break |
|
308 | 316 | fname = chunkdata['filename'] |
|
309 | 317 | self.bundlefilespos[fname] = self.bundle.tell() |
|
310 | 318 | while True: |
|
311 | 319 | c = self.bundle.deltachunk(None) |
|
312 | 320 | if not c: |
|
313 | 321 | break |
|
314 | 322 | |
|
315 | 323 | if f in self.bundlefilespos: |
|
316 | 324 | self.bundle.seek(self.bundlefilespos[f]) |
|
317 | 325 | return bundlefilelog(self.svfs, f, self.bundle, |
|
318 | 326 | self.changelog.rev, self) |
|
319 | 327 | else: |
|
320 | 328 | return filelog.filelog(self.svfs, f) |
|
321 | 329 | |
|
322 | 330 | def close(self): |
|
323 | 331 | """Close assigned bundle file immediately.""" |
|
324 | 332 | self.bundlefile.close() |
|
325 | 333 | if self.tempfile is not None: |
|
326 | 334 | self.vfs.unlink(self.tempfile) |
|
327 | 335 | if self._tempparent: |
|
328 | 336 | shutil.rmtree(self._tempparent, True) |
|
329 | 337 | |
|
330 | 338 | def cancopy(self): |
|
331 | 339 | return False |
|
332 | 340 | |
|
333 | 341 | def peer(self): |
|
334 | 342 | return bundlepeer(self) |
|
335 | 343 | |
|
336 | 344 | def getcwd(self): |
|
337 | 345 | return os.getcwd() # always outside the repo |
|
338 | 346 | |
|
339 | 347 | |
|
340 | 348 | def instance(ui, path, create): |
|
341 | 349 | if create: |
|
342 | 350 | raise util.Abort(_('cannot create new bundle repository')) |
|
343 | 351 | parentpath = ui.config("bundle", "mainreporoot", "") |
|
344 | 352 | if not parentpath: |
|
345 | 353 | # try to find the correct path to the working directory repo |
|
346 | 354 | parentpath = cmdutil.findrepo(os.getcwd()) |
|
347 | 355 | if parentpath is None: |
|
348 | 356 | parentpath = '' |
|
349 | 357 | if parentpath: |
|
350 | 358 | # Try to make the full path relative so we get a nice, short URL. |
|
351 | 359 | # In particular, we don't want temp dir names in test outputs. |
|
352 | 360 | cwd = os.getcwd() |
|
353 | 361 | if parentpath == cwd: |
|
354 | 362 | parentpath = '' |
|
355 | 363 | else: |
|
356 | 364 | cwd = pathutil.normasprefix(cwd) |
|
357 | 365 | if parentpath.startswith(cwd): |
|
358 | 366 | parentpath = parentpath[len(cwd):] |
|
359 | 367 | u = util.url(path) |
|
360 | 368 | path = u.localpath() |
|
361 | 369 | if u.scheme == 'bundle': |
|
362 | 370 | s = path.split("+", 1) |
|
363 | 371 | if len(s) == 1: |
|
364 | 372 | repopath, bundlename = parentpath, s[0] |
|
365 | 373 | else: |
|
366 | 374 | repopath, bundlename = s |
|
367 | 375 | else: |
|
368 | 376 | repopath, bundlename = parentpath, path |
|
369 | 377 | return bundlerepository(ui, repopath, bundlename) |
|
370 | 378 | |
|
371 | 379 | class bundletransactionmanager(object): |
|
372 | 380 | def transaction(self): |
|
373 | 381 | return None |
|
374 | 382 | |
|
375 | 383 | def close(self): |
|
376 | 384 | raise NotImplementedError |
|
377 | 385 | |
|
378 | 386 | def release(self): |
|
379 | 387 | raise NotImplementedError |
|
380 | 388 | |
|
381 | 389 | def getremotechanges(ui, repo, other, onlyheads=None, bundlename=None, |
|
382 | 390 | force=False): |
|
383 | 391 | '''obtains a bundle of changes incoming from other |
|
384 | 392 | |
|
385 | 393 | "onlyheads" restricts the returned changes to those reachable from the |
|
386 | 394 | specified heads. |
|
387 | 395 | "bundlename", if given, stores the bundle to this file path permanently; |
|
388 | 396 | otherwise it's stored to a temp file and gets deleted again when you call |
|
389 | 397 | the returned "cleanupfn". |
|
390 | 398 | "force" indicates whether to proceed on unrelated repos. |
|
391 | 399 | |
|
392 | 400 | Returns a tuple (local, csets, cleanupfn): |
|
393 | 401 | |
|
394 | 402 | "local" is a local repo from which to obtain the actual incoming |
|
395 | 403 | changesets; it is a bundlerepo for the obtained bundle when the |
|
396 | 404 | original "other" is remote. |
|
397 | 405 | "csets" lists the incoming changeset node ids. |
|
398 | 406 | "cleanupfn" must be called without arguments when you're done processing |
|
399 | 407 | the changes; it closes both the original "other" and the one returned |
|
400 | 408 | here. |
|
401 | 409 | ''' |
|
402 | 410 | tmp = discovery.findcommonincoming(repo, other, heads=onlyheads, |
|
403 | 411 | force=force) |
|
404 | 412 | common, incoming, rheads = tmp |
|
405 | 413 | if not incoming: |
|
406 | 414 | try: |
|
407 | 415 | if bundlename: |
|
408 | 416 | os.unlink(bundlename) |
|
409 | 417 | except OSError: |
|
410 | 418 | pass |
|
411 | 419 | return repo, [], other.close |
|
412 | 420 | |
|
413 | 421 | commonset = set(common) |
|
414 | 422 | rheads = [x for x in rheads if x not in commonset] |
|
415 | 423 | |
|
416 | 424 | bundle = None |
|
417 | 425 | bundlerepo = None |
|
418 | 426 | localrepo = other.local() |
|
419 | 427 | if bundlename or not localrepo: |
|
420 | 428 | # create a bundle (uncompressed if other repo is not local) |
|
421 | 429 | |
|
422 | 430 | if other.capable('getbundle'): |
|
423 | 431 | cg = other.getbundle('incoming', common=common, heads=rheads) |
|
424 | 432 | elif onlyheads is None and not other.capable('changegroupsubset'): |
|
425 | 433 | # compat with older servers when pulling all remote heads |
|
426 | 434 | cg = other.changegroup(incoming, "incoming") |
|
427 | 435 | rheads = None |
|
428 | 436 | else: |
|
429 | 437 | cg = other.changegroupsubset(incoming, rheads, 'incoming') |
|
430 | 438 | if localrepo: |
|
431 | 439 | bundletype = "HG10BZ" |
|
432 | 440 | else: |
|
433 | 441 | bundletype = "HG10UN" |
|
434 | 442 | fname = bundle = changegroup.writebundle(ui, cg, bundlename, bundletype) |
|
435 | 443 | # keep written bundle? |
|
436 | 444 | if bundlename: |
|
437 | 445 | bundle = None |
|
438 | 446 | if not localrepo: |
|
439 | 447 | # use the created uncompressed bundlerepo |
|
440 | 448 | localrepo = bundlerepo = bundlerepository(repo.baseui, repo.root, |
|
441 | 449 | fname) |
|
442 | 450 | # this repo contains local and other now, so filter out local again |
|
443 | 451 | common = repo.heads() |
|
444 | 452 | if localrepo: |
|
445 | 453 | # Part of common may be remotely filtered |
|
446 | 454 | # So use an unfiltered version |
|
447 | 455 | # The discovery process probably need cleanup to avoid that |
|
448 | 456 | localrepo = localrepo.unfiltered() |
|
449 | 457 | |
|
450 | 458 | csets = localrepo.changelog.findmissing(common, rheads) |
|
451 | 459 | |
|
452 | 460 | if bundlerepo: |
|
453 | 461 | reponodes = [ctx.node() for ctx in bundlerepo[bundlerepo.firstnewrev:]] |
|
454 | 462 | remotephases = other.listkeys('phases') |
|
455 | 463 | |
|
456 | 464 | pullop = exchange.pulloperation(bundlerepo, other, heads=reponodes) |
|
457 | 465 | pullop.trmanager = bundletransactionmanager() |
|
458 | 466 | exchange._pullapplyphases(pullop, remotephases) |
|
459 | 467 | |
|
460 | 468 | def cleanup(): |
|
461 | 469 | if bundlerepo: |
|
462 | 470 | bundlerepo.close() |
|
463 | 471 | if bundle: |
|
464 | 472 | os.unlink(bundle) |
|
465 | 473 | other.close() |
|
466 | 474 | |
|
467 | 475 | return (localrepo, csets, cleanup) |
@@ -1,830 +1,886 | |||
|
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}) [{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 | Refuse pathological nullid successors |
|
129 | 129 | $ hg debugobsolete -d '9001 0' 1337133713371337133713371337133713371337 0000000000000000000000000000000000000000 |
|
130 | 130 | transaction abort! |
|
131 | 131 | rollback completed |
|
132 | 132 | abort: bad obsolescence marker detected: invalid successors nullid |
|
133 | 133 | [255] |
|
134 | 134 | |
|
135 | 135 | Check that graphlog detect that a changeset is obsolete: |
|
136 | 136 | |
|
137 | 137 | $ hg log -G |
|
138 | 138 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
139 | 139 | | |
|
140 | 140 | o 1:7c3bad9141dc (draft) [ ] add b |
|
141 | 141 | | |
|
142 | 142 | o 0:1f0dee641bb7 (draft) [ ] add a |
|
143 | 143 | |
|
144 | 144 | |
|
145 | 145 | check that heads does not report them |
|
146 | 146 | |
|
147 | 147 | $ hg heads |
|
148 | 148 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
149 | 149 | $ hg heads --hidden |
|
150 | 150 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
151 | 151 | 4:ca819180edb9 (draft) [ ] add new_2_c |
|
152 | 152 | 3:cdbce2fbb163 (draft) [ ] add new_c |
|
153 | 153 | 2:245bde4270cd (draft) [ ] add original_c |
|
154 | 154 | |
|
155 | 155 | |
|
156 | 156 | check that summary does not report them |
|
157 | 157 | |
|
158 | 158 | $ hg init ../sink |
|
159 | 159 | $ echo '[paths]' >> .hg/hgrc |
|
160 | 160 | $ echo 'default=../sink' >> .hg/hgrc |
|
161 | 161 | $ hg summary --remote |
|
162 | 162 | parent: 5:5601fb93a350 tip |
|
163 | 163 | add new_3_c |
|
164 | 164 | branch: default |
|
165 | 165 | commit: (clean) |
|
166 | 166 | update: (current) |
|
167 | 167 | remote: 3 outgoing |
|
168 | 168 | |
|
169 | 169 | $ hg summary --remote --hidden |
|
170 | 170 | parent: 5:5601fb93a350 tip |
|
171 | 171 | add new_3_c |
|
172 | 172 | branch: default |
|
173 | 173 | commit: (clean) |
|
174 | 174 | update: 3 new changesets, 4 branch heads (merge) |
|
175 | 175 | remote: 3 outgoing |
|
176 | 176 | |
|
177 | 177 | check that various commands work well with filtering |
|
178 | 178 | |
|
179 | 179 | $ hg tip |
|
180 | 180 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
181 | 181 | $ hg log -r 6 |
|
182 | 182 | abort: unknown revision '6'! |
|
183 | 183 | [255] |
|
184 | 184 | $ hg log -r 4 |
|
185 | 185 | abort: hidden revision '4'! |
|
186 | 186 | (use --hidden to access hidden revisions) |
|
187 | 187 | [255] |
|
188 | 188 | $ hg debugrevspec 'rev(6)' |
|
189 | 189 | $ hg debugrevspec 'rev(4)' |
|
190 | 190 | $ hg debugrevspec 'null' |
|
191 | 191 | -1 |
|
192 | 192 | |
|
193 | 193 | Check that public changeset are not accounted as obsolete: |
|
194 | 194 | |
|
195 | 195 | $ hg --hidden phase --public 2 |
|
196 | 196 | $ hg log -G |
|
197 | 197 | @ 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
198 | 198 | | |
|
199 | 199 | | o 2:245bde4270cd (public) [ ] add original_c |
|
200 | 200 | |/ |
|
201 | 201 | o 1:7c3bad9141dc (public) [ ] add b |
|
202 | 202 | | |
|
203 | 203 | o 0:1f0dee641bb7 (public) [ ] add a |
|
204 | 204 | |
|
205 | 205 | |
|
206 | 206 | And that bumped changeset are detected |
|
207 | 207 | -------------------------------------- |
|
208 | 208 | |
|
209 | 209 | If we didn't filtered obsolete changesets out, 3 and 4 would show up too. Also |
|
210 | 210 | note that the bumped changeset (5:5601fb93a350) is not a direct successor of |
|
211 | 211 | the public changeset |
|
212 | 212 | |
|
213 | 213 | $ hg log --hidden -r 'bumped()' |
|
214 | 214 | 5:5601fb93a350 (draft) [tip ] add new_3_c |
|
215 | 215 | |
|
216 | 216 | And that we can't push bumped changeset |
|
217 | 217 | |
|
218 | 218 | $ hg push ../tmpa -r 0 --force #(make repo related) |
|
219 | 219 | pushing to ../tmpa |
|
220 | 220 | searching for changes |
|
221 | 221 | warning: repository is unrelated |
|
222 | 222 | adding changesets |
|
223 | 223 | adding manifests |
|
224 | 224 | adding file changes |
|
225 | 225 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
226 | 226 | $ hg push ../tmpa |
|
227 | 227 | pushing to ../tmpa |
|
228 | 228 | searching for changes |
|
229 | 229 | abort: push includes bumped changeset: 5601fb93a350! |
|
230 | 230 | [255] |
|
231 | 231 | |
|
232 | 232 | Fixing "bumped" situation |
|
233 | 233 | We need to create a clone of 5 and add a special marker with a flag |
|
234 | 234 | |
|
235 | 235 | $ hg up '5^' |
|
236 | 236 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
237 | 237 | $ hg revert -ar 5 |
|
238 | 238 | adding new_3_c |
|
239 | 239 | $ hg ci -m 'add n3w_3_c' |
|
240 | 240 | created new head |
|
241 | 241 | $ hg debugobsolete -d '1338 0' --flags 1 `getid new_3_c` `getid n3w_3_c` |
|
242 | 242 | $ hg log -r 'bumped()' |
|
243 | 243 | $ hg log -G |
|
244 | 244 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
245 | 245 | | |
|
246 | 246 | | o 2:245bde4270cd (public) [ ] add original_c |
|
247 | 247 | |/ |
|
248 | 248 | o 1:7c3bad9141dc (public) [ ] add b |
|
249 | 249 | | |
|
250 | 250 | o 0:1f0dee641bb7 (public) [ ] add a |
|
251 | 251 | |
|
252 | 252 | |
|
253 | 253 | $ cd .. |
|
254 | 254 | |
|
255 | 255 | Revision 0 is hidden |
|
256 | 256 | -------------------- |
|
257 | 257 | |
|
258 | 258 | $ hg init rev0hidden |
|
259 | 259 | $ cd rev0hidden |
|
260 | 260 | |
|
261 | 261 | $ mkcommit kill0 |
|
262 | 262 | $ hg up -q null |
|
263 | 263 | $ hg debugobsolete `getid kill0` |
|
264 | 264 | $ mkcommit a |
|
265 | 265 | $ mkcommit b |
|
266 | 266 | |
|
267 | 267 | Should pick the first visible revision as "repo" node |
|
268 | 268 | |
|
269 | 269 | $ hg archive ../archive-null |
|
270 | 270 | $ cat ../archive-null/.hg_archival.txt |
|
271 | 271 | repo: 1f0dee641bb7258c56bd60e93edfa2405381c41e |
|
272 | 272 | node: 7c3bad9141dcb46ff89abf5f61856facd56e476c |
|
273 | 273 | branch: default |
|
274 | 274 | latesttag: null |
|
275 | 275 | latesttagdistance: 2 |
|
276 | 276 | changessincelatesttag: 2 |
|
277 | 277 | |
|
278 | 278 | |
|
279 | 279 | $ cd .. |
|
280 | 280 | |
|
281 | 281 | Exchange Test |
|
282 | 282 | ============================ |
|
283 | 283 | |
|
284 | 284 | Destination repo does not have any data |
|
285 | 285 | --------------------------------------- |
|
286 | 286 | |
|
287 | 287 | Simple incoming test |
|
288 | 288 | |
|
289 | 289 | $ hg init tmpc |
|
290 | 290 | $ cd tmpc |
|
291 | 291 | $ hg incoming ../tmpb |
|
292 | 292 | comparing with ../tmpb |
|
293 | 293 | 0:1f0dee641bb7 (public) [ ] add a |
|
294 | 294 | 1:7c3bad9141dc (public) [ ] add b |
|
295 | 295 | 2:245bde4270cd (public) [ ] add original_c |
|
296 | 296 | 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
297 | 297 | |
|
298 | 298 | Try to pull markers |
|
299 | 299 | (extinct changeset are excluded but marker are pushed) |
|
300 | 300 | |
|
301 | 301 | $ hg pull ../tmpb |
|
302 | 302 | pulling from ../tmpb |
|
303 | 303 | requesting all changes |
|
304 | 304 | adding changesets |
|
305 | 305 | adding manifests |
|
306 | 306 | adding file changes |
|
307 | 307 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
308 | 308 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
309 | 309 | $ hg debugobsolete |
|
310 | 310 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
311 | 311 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
312 | 312 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
313 | 313 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
314 | 314 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
315 | 315 | |
|
316 | 316 | Rollback//Transaction support |
|
317 | 317 | |
|
318 | 318 | $ hg debugobsolete -d '1340 0' aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb |
|
319 | 319 | $ hg debugobsolete |
|
320 | 320 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
321 | 321 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
322 | 322 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
323 | 323 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
324 | 324 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
325 | 325 | aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb 0 (Thu Jan 01 00:22:20 1970 +0000) {'user': 'test'} |
|
326 | 326 | $ hg rollback -n |
|
327 | 327 | repository tip rolled back to revision 3 (undo debugobsolete) |
|
328 | 328 | $ hg rollback |
|
329 | 329 | repository tip rolled back to revision 3 (undo debugobsolete) |
|
330 | 330 | $ hg debugobsolete |
|
331 | 331 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
332 | 332 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
333 | 333 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
334 | 334 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
335 | 335 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
336 | 336 | |
|
337 | 337 | $ cd .. |
|
338 | 338 | |
|
339 | 339 | Try to push markers |
|
340 | 340 | |
|
341 | 341 | $ hg init tmpd |
|
342 | 342 | $ hg -R tmpb push tmpd |
|
343 | 343 | pushing to tmpd |
|
344 | 344 | searching for changes |
|
345 | 345 | adding changesets |
|
346 | 346 | adding manifests |
|
347 | 347 | adding file changes |
|
348 | 348 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
349 | 349 | $ hg -R tmpd debugobsolete | sort |
|
350 | 350 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
351 | 351 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
352 | 352 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
353 | 353 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
354 | 354 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
355 | 355 | |
|
356 | 356 | Check obsolete keys are exchanged only if source has an obsolete store |
|
357 | 357 | |
|
358 | 358 | $ hg init empty |
|
359 | 359 | $ hg --config extensions.debugkeys=debugkeys.py -R empty push tmpd |
|
360 | 360 | pushing to tmpd |
|
361 | 361 | listkeys phases |
|
362 | 362 | listkeys bookmarks |
|
363 | 363 | no changes found |
|
364 | 364 | listkeys phases |
|
365 | 365 | [1] |
|
366 | 366 | |
|
367 | 367 | clone support |
|
368 | 368 | (markers are copied and extinct changesets are included to allow hardlinks) |
|
369 | 369 | |
|
370 | 370 | $ hg clone tmpb clone-dest |
|
371 | 371 | updating to branch default |
|
372 | 372 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
373 | 373 | $ hg -R clone-dest log -G --hidden |
|
374 | 374 | @ 6:6f9641995072 (draft) [tip ] add n3w_3_c |
|
375 | 375 | | |
|
376 | 376 | | x 5:5601fb93a350 (draft) [ ] add new_3_c |
|
377 | 377 | |/ |
|
378 | 378 | | x 4:ca819180edb9 (draft) [ ] add new_2_c |
|
379 | 379 | |/ |
|
380 | 380 | | x 3:cdbce2fbb163 (draft) [ ] add new_c |
|
381 | 381 | |/ |
|
382 | 382 | | o 2:245bde4270cd (public) [ ] add original_c |
|
383 | 383 | |/ |
|
384 | 384 | o 1:7c3bad9141dc (public) [ ] add b |
|
385 | 385 | | |
|
386 | 386 | o 0:1f0dee641bb7 (public) [ ] add a |
|
387 | 387 | |
|
388 | 388 | $ hg -R clone-dest debugobsolete |
|
389 | 389 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
390 | 390 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
391 | 391 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
392 | 392 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
393 | 393 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
394 | 394 | |
|
395 | 395 | |
|
396 | 396 | Destination repo have existing data |
|
397 | 397 | --------------------------------------- |
|
398 | 398 | |
|
399 | 399 | On pull |
|
400 | 400 | |
|
401 | 401 | $ hg init tmpe |
|
402 | 402 | $ cd tmpe |
|
403 | 403 | $ hg debugobsolete -d '1339 0' 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 |
|
404 | 404 | $ hg pull ../tmpb |
|
405 | 405 | pulling from ../tmpb |
|
406 | 406 | requesting all changes |
|
407 | 407 | adding changesets |
|
408 | 408 | adding manifests |
|
409 | 409 | adding file changes |
|
410 | 410 | added 4 changesets with 4 changes to 4 files (+1 heads) |
|
411 | 411 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
412 | 412 | $ hg debugobsolete |
|
413 | 413 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
414 | 414 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
415 | 415 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
416 | 416 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
417 | 417 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
418 | 418 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
419 | 419 | |
|
420 | 420 | |
|
421 | 421 | On push |
|
422 | 422 | |
|
423 | 423 | $ hg push ../tmpc |
|
424 | 424 | pushing to ../tmpc |
|
425 | 425 | searching for changes |
|
426 | 426 | no changes found |
|
427 | 427 | [1] |
|
428 | 428 | $ hg -R ../tmpc debugobsolete |
|
429 | 429 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
430 | 430 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
431 | 431 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
432 | 432 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
433 | 433 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
434 | 434 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
435 | 435 | |
|
436 | 436 | detect outgoing obsolete and unstable |
|
437 | 437 | --------------------------------------- |
|
438 | 438 | |
|
439 | 439 | |
|
440 | 440 | $ hg log -G |
|
441 | 441 | o 3:6f9641995072 (draft) [tip ] add n3w_3_c |
|
442 | 442 | | |
|
443 | 443 | | o 2:245bde4270cd (public) [ ] add original_c |
|
444 | 444 | |/ |
|
445 | 445 | o 1:7c3bad9141dc (public) [ ] add b |
|
446 | 446 | | |
|
447 | 447 | o 0:1f0dee641bb7 (public) [ ] add a |
|
448 | 448 | |
|
449 | 449 | $ hg up 'desc("n3w_3_c")' |
|
450 | 450 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
451 | 451 | $ mkcommit original_d |
|
452 | 452 | $ mkcommit original_e |
|
453 | 453 | $ hg debugobsolete --record-parents `getid original_d` -d '0 0' |
|
454 | 454 | $ hg debugobsolete | grep `getid original_d` |
|
455 | 455 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
456 | 456 | $ hg log -r 'obsolete()' |
|
457 | 457 | 4:94b33453f93b (draft) [ ] add original_d |
|
458 | 458 | $ hg log -G -r '::unstable()' |
|
459 | 459 | @ 5:cda648ca50f5 (draft) [tip ] add original_e |
|
460 | 460 | | |
|
461 | 461 | x 4:94b33453f93b (draft) [ ] add original_d |
|
462 | 462 | | |
|
463 | 463 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
464 | 464 | | |
|
465 | 465 | o 1:7c3bad9141dc (public) [ ] add b |
|
466 | 466 | | |
|
467 | 467 | o 0:1f0dee641bb7 (public) [ ] add a |
|
468 | 468 | |
|
469 | 469 | |
|
470 | 470 | refuse to push obsolete changeset |
|
471 | 471 | |
|
472 | 472 | $ hg push ../tmpc/ -r 'desc("original_d")' |
|
473 | 473 | pushing to ../tmpc/ |
|
474 | 474 | searching for changes |
|
475 | 475 | abort: push includes obsolete changeset: 94b33453f93b! |
|
476 | 476 | [255] |
|
477 | 477 | |
|
478 | 478 | refuse to push unstable changeset |
|
479 | 479 | |
|
480 | 480 | $ hg push ../tmpc/ |
|
481 | 481 | pushing to ../tmpc/ |
|
482 | 482 | searching for changes |
|
483 | 483 | abort: push includes unstable changeset: cda648ca50f5! |
|
484 | 484 | [255] |
|
485 | 485 | |
|
486 | 486 | Test that extinct changeset are properly detected |
|
487 | 487 | |
|
488 | 488 | $ hg log -r 'extinct()' |
|
489 | 489 | |
|
490 | 490 | Don't try to push extinct changeset |
|
491 | 491 | |
|
492 | 492 | $ hg init ../tmpf |
|
493 | 493 | $ hg out ../tmpf |
|
494 | 494 | comparing with ../tmpf |
|
495 | 495 | searching for changes |
|
496 | 496 | 0:1f0dee641bb7 (public) [ ] add a |
|
497 | 497 | 1:7c3bad9141dc (public) [ ] add b |
|
498 | 498 | 2:245bde4270cd (public) [ ] add original_c |
|
499 | 499 | 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
500 | 500 | 4:94b33453f93b (draft) [ ] add original_d |
|
501 | 501 | 5:cda648ca50f5 (draft) [tip ] add original_e |
|
502 | 502 | $ hg push ../tmpf -f # -f because be push unstable too |
|
503 | 503 | pushing to ../tmpf |
|
504 | 504 | searching for changes |
|
505 | 505 | adding changesets |
|
506 | 506 | adding manifests |
|
507 | 507 | adding file changes |
|
508 | 508 | added 6 changesets with 6 changes to 6 files (+1 heads) |
|
509 | 509 | |
|
510 | 510 | no warning displayed |
|
511 | 511 | |
|
512 | 512 | $ hg push ../tmpf |
|
513 | 513 | pushing to ../tmpf |
|
514 | 514 | searching for changes |
|
515 | 515 | no changes found |
|
516 | 516 | [1] |
|
517 | 517 | |
|
518 | 518 | Do not warn about new head when the new head is a successors of a remote one |
|
519 | 519 | |
|
520 | 520 | $ hg log -G |
|
521 | 521 | @ 5:cda648ca50f5 (draft) [tip ] add original_e |
|
522 | 522 | | |
|
523 | 523 | x 4:94b33453f93b (draft) [ ] add original_d |
|
524 | 524 | | |
|
525 | 525 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
526 | 526 | | |
|
527 | 527 | | o 2:245bde4270cd (public) [ ] add original_c |
|
528 | 528 | |/ |
|
529 | 529 | o 1:7c3bad9141dc (public) [ ] add b |
|
530 | 530 | | |
|
531 | 531 | o 0:1f0dee641bb7 (public) [ ] add a |
|
532 | 532 | |
|
533 | 533 | $ hg up -q 'desc(n3w_3_c)' |
|
534 | 534 | $ mkcommit obsolete_e |
|
535 | 535 | created new head |
|
536 | 536 | $ hg debugobsolete `getid 'original_e'` `getid 'obsolete_e'` |
|
537 | 537 | $ hg outgoing ../tmpf # parasite hg outgoing testin |
|
538 | 538 | comparing with ../tmpf |
|
539 | 539 | searching for changes |
|
540 | 540 | 6:3de5eca88c00 (draft) [tip ] add obsolete_e |
|
541 | 541 | $ hg push ../tmpf |
|
542 | 542 | pushing to ../tmpf |
|
543 | 543 | searching for changes |
|
544 | 544 | adding changesets |
|
545 | 545 | adding manifests |
|
546 | 546 | adding file changes |
|
547 | 547 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
548 | 548 | |
|
549 | 549 | test relevance computation |
|
550 | 550 | --------------------------------------- |
|
551 | 551 | |
|
552 | 552 | Checking simple case of "marker relevance". |
|
553 | 553 | |
|
554 | 554 | |
|
555 | 555 | Reminder of the repo situation |
|
556 | 556 | |
|
557 | 557 | $ hg log --hidden --graph |
|
558 | 558 | @ 6:3de5eca88c00 (draft) [tip ] add obsolete_e |
|
559 | 559 | | |
|
560 | 560 | | x 5:cda648ca50f5 (draft) [ ] add original_e |
|
561 | 561 | | | |
|
562 | 562 | | x 4:94b33453f93b (draft) [ ] add original_d |
|
563 | 563 | |/ |
|
564 | 564 | o 3:6f9641995072 (draft) [ ] add n3w_3_c |
|
565 | 565 | | |
|
566 | 566 | | o 2:245bde4270cd (public) [ ] add original_c |
|
567 | 567 | |/ |
|
568 | 568 | o 1:7c3bad9141dc (public) [ ] add b |
|
569 | 569 | | |
|
570 | 570 | o 0:1f0dee641bb7 (public) [ ] add a |
|
571 | 571 | |
|
572 | 572 | |
|
573 | 573 | List of all markers |
|
574 | 574 | |
|
575 | 575 | $ hg debugobsolete |
|
576 | 576 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
577 | 577 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
578 | 578 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
579 | 579 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
580 | 580 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
581 | 581 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
582 | 582 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
583 | 583 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) |
|
584 | 584 | |
|
585 | 585 | List of changesets with no chain |
|
586 | 586 | |
|
587 | 587 | $ hg debugobsolete --hidden --rev ::2 |
|
588 | 588 | |
|
589 | 589 | List of changesets that are included on marker chain |
|
590 | 590 | |
|
591 | 591 | $ hg debugobsolete --hidden --rev 6 |
|
592 | 592 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) |
|
593 | 593 | |
|
594 | 594 | List of changesets with a longer chain, (including a pruned children) |
|
595 | 595 | |
|
596 | 596 | $ hg debugobsolete --hidden --rev 3 |
|
597 | 597 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
598 | 598 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
599 | 599 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
600 | 600 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
601 | 601 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
602 | 602 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
603 | 603 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
604 | 604 | |
|
605 | 605 | List of both |
|
606 | 606 | |
|
607 | 607 | $ hg debugobsolete --hidden --rev 3::6 |
|
608 | 608 | 1337133713371337133713371337133713371337 5601fb93a350734d935195fee37f4054c529ff39 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
609 | 609 | 1339133913391339133913391339133913391339 ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:19 1970 +0000) {'user': 'test'} |
|
610 | 610 | 245bde4270cd1072a27757984f9cda8ba26f08ca cdbce2fbb16313928851e97e0d85413f3f7eb77f C (Thu Jan 01 00:00:01 1970 -0002) {'user': 'test'} |
|
611 | 611 | 5601fb93a350734d935195fee37f4054c529ff39 6f96419950729f3671185b847352890f074f7557 1 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
612 | 612 | 94b33453f93bdb8d457ef9b770851a618bf413e1 0 {6f96419950729f3671185b847352890f074f7557} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
613 | 613 | ca819180edb99ed25ceafb3e9584ac287e240b00 1337133713371337133713371337133713371337 0 (Thu Jan 01 00:22:18 1970 +0000) {'user': 'test'} |
|
614 | 614 | cda648ca50f50482b7055c0b0c4c117bba6733d9 3de5eca88c00aa039da7399a220f4a5221faa585 0 (*) {'user': 'test'} (glob) |
|
615 | 615 | cdbce2fbb16313928851e97e0d85413f3f7eb77f ca819180edb99ed25ceafb3e9584ac287e240b00 0 (Thu Jan 01 00:22:17 1970 +0000) {'user': 'test'} |
|
616 | 616 | |
|
617 | 617 | #if serve |
|
618 | 618 | |
|
619 | 619 | Test the debug output for exchange |
|
620 | 620 | ---------------------------------- |
|
621 | 621 | |
|
622 | 622 | $ hg pull ../tmpb --config 'experimental.obsmarkers-exchange-debug=True' --config 'experimental.bundle2-exp=True' |
|
623 | 623 | pulling from ../tmpb |
|
624 | 624 | searching for changes |
|
625 | 625 | no changes found |
|
626 | 626 | obsmarker-exchange: 346 bytes received |
|
627 | 627 | |
|
628 | 628 | check hgweb does not explode |
|
629 | 629 | ==================================== |
|
630 | 630 | |
|
631 | 631 | $ hg unbundle $TESTDIR/bundles/hgweb+obs.hg |
|
632 | 632 | adding changesets |
|
633 | 633 | adding manifests |
|
634 | 634 | adding file changes |
|
635 | 635 | added 62 changesets with 63 changes to 9 files (+60 heads) |
|
636 | 636 | (run 'hg heads .' to see heads, 'hg merge' to merge) |
|
637 | 637 | $ for node in `hg log -r 'desc(babar_)' --template '{node}\n'`; |
|
638 | 638 | > do |
|
639 | 639 | > hg debugobsolete $node |
|
640 | 640 | > done |
|
641 | 641 | $ hg up tip |
|
642 | 642 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
643 | 643 | |
|
644 | 644 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
645 | 645 | $ cat hg.pid >> $DAEMON_PIDS |
|
646 | 646 | |
|
647 | 647 | check changelog view |
|
648 | 648 | |
|
649 | 649 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'shortlog/' |
|
650 | 650 | 200 Script output follows |
|
651 | 651 | |
|
652 | 652 | check graph view |
|
653 | 653 | |
|
654 | 654 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'graph' |
|
655 | 655 | 200 Script output follows |
|
656 | 656 | |
|
657 | 657 | check filelog view |
|
658 | 658 | |
|
659 | 659 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'log/'`hg log -r . -T "{node}"`/'babar' |
|
660 | 660 | 200 Script output follows |
|
661 | 661 | |
|
662 | 662 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/68' |
|
663 | 663 | 200 Script output follows |
|
664 | 664 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67' |
|
665 | 665 | 404 Not Found |
|
666 | 666 | [1] |
|
667 | 667 | |
|
668 | 668 | check that web.view config option: |
|
669 | 669 | |
|
670 | 670 | $ "$TESTDIR/killdaemons.py" hg.pid |
|
671 | 671 | $ cat >> .hg/hgrc << EOF |
|
672 | 672 | > [web] |
|
673 | 673 | > view=all |
|
674 | 674 | > EOF |
|
675 | 675 | $ wait |
|
676 | 676 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
677 | 677 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/67' |
|
678 | 678 | 200 Script output follows |
|
679 | 679 | $ "$TESTDIR/killdaemons.py" hg.pid |
|
680 | 680 | |
|
681 | 681 | Checking _enable=False warning if obsolete marker exists |
|
682 | 682 | |
|
683 | 683 | $ echo '[experimental]' >> $HGRCPATH |
|
684 | 684 | $ echo "evolution=" >> $HGRCPATH |
|
685 | 685 | $ hg log -r tip |
|
686 | 686 | obsolete feature not enabled but 68 markers found! |
|
687 | 687 | 68:c15e9edfca13 (draft) [tip ] add celestine |
|
688 | 688 | |
|
689 | 689 | reenable for later test |
|
690 | 690 | |
|
691 | 691 | $ echo '[experimental]' >> $HGRCPATH |
|
692 | 692 | $ echo "evolution=createmarkers,exchange" >> $HGRCPATH |
|
693 | 693 | |
|
694 | 694 | #endif |
|
695 | 695 | |
|
696 | 696 | Test incoming/outcoming with changesets obsoleted remotely, known locally |
|
697 | 697 | =============================================================================== |
|
698 | 698 | |
|
699 | 699 | This test issue 3805 |
|
700 | 700 | |
|
701 | 701 | $ hg init repo-issue3805 |
|
702 | 702 | $ cd repo-issue3805 |
|
703 | 703 | $ echo "foo" > foo |
|
704 | 704 | $ hg ci -Am "A" |
|
705 | 705 | adding foo |
|
706 | 706 | $ hg clone . ../other-issue3805 |
|
707 | 707 | updating to branch default |
|
708 | 708 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
709 | 709 | $ echo "bar" >> foo |
|
710 | 710 | $ hg ci --amend |
|
711 | 711 | $ cd ../other-issue3805 |
|
712 | 712 | $ hg log -G |
|
713 | 713 | @ 0:193e9254ce7e (draft) [tip ] A |
|
714 | 714 | |
|
715 | 715 | $ hg log -G -R ../repo-issue3805 |
|
716 | 716 | @ 2:3816541e5485 (draft) [tip ] A |
|
717 | 717 | |
|
718 | 718 | $ hg incoming |
|
719 | 719 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
720 | 720 | searching for changes |
|
721 | 721 | 2:3816541e5485 (draft) [tip ] A |
|
722 | 722 | $ hg incoming --bundle ../issue3805.hg |
|
723 | 723 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
724 | 724 | searching for changes |
|
725 | 725 | 2:3816541e5485 (draft) [tip ] A |
|
726 | 726 | $ hg outgoing |
|
727 | 727 | comparing with $TESTTMP/tmpe/repo-issue3805 (glob) |
|
728 | 728 | searching for changes |
|
729 | 729 | no changes found |
|
730 | 730 | [1] |
|
731 | 731 | |
|
732 | 732 | #if serve |
|
733 | 733 | |
|
734 | 734 | $ hg serve -R ../repo-issue3805 -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
735 | 735 | $ cat hg.pid >> $DAEMON_PIDS |
|
736 | 736 | |
|
737 | 737 | $ hg incoming http://localhost:$HGPORT |
|
738 | 738 | comparing with http://localhost:$HGPORT/ |
|
739 | 739 | searching for changes |
|
740 | 740 | 1:3816541e5485 (draft) [tip ] A |
|
741 | 741 | $ hg outgoing http://localhost:$HGPORT |
|
742 | 742 | comparing with http://localhost:$HGPORT/ |
|
743 | 743 | searching for changes |
|
744 | 744 | no changes found |
|
745 | 745 | [1] |
|
746 | 746 | |
|
747 | 747 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
748 | 748 | |
|
749 | 749 | #endif |
|
750 | 750 | |
|
751 | 751 | This test issue 3814 |
|
752 | 752 | |
|
753 | 753 | (nothing to push but locally hidden changeset) |
|
754 | 754 | |
|
755 | 755 | $ cd .. |
|
756 | 756 | $ hg init repo-issue3814 |
|
757 | 757 | $ cd repo-issue3805 |
|
758 | 758 | $ hg push -r 3816541e5485 ../repo-issue3814 |
|
759 | 759 | pushing to ../repo-issue3814 |
|
760 | 760 | searching for changes |
|
761 | 761 | adding changesets |
|
762 | 762 | adding manifests |
|
763 | 763 | adding file changes |
|
764 | 764 | added 1 changesets with 1 changes to 1 files |
|
765 | 765 | $ hg out ../repo-issue3814 |
|
766 | 766 | comparing with ../repo-issue3814 |
|
767 | 767 | searching for changes |
|
768 | 768 | no changes found |
|
769 | 769 | [1] |
|
770 | 770 | |
|
771 | 771 | Test that a local tag blocks a changeset from being hidden |
|
772 | 772 | |
|
773 | 773 | $ hg tag -l visible -r 0 --hidden |
|
774 | 774 | $ hg log -G |
|
775 | 775 | @ 2:3816541e5485 (draft) [tip ] A |
|
776 | 776 | |
|
777 | 777 | x 0:193e9254ce7e (draft) [visible ] A |
|
778 | 778 | |
|
779 | 779 | Test that removing a local tag does not cause some commands to fail |
|
780 | 780 | |
|
781 | 781 | $ hg tag -l -r tip tiptag |
|
782 | 782 | $ hg tags |
|
783 | 783 | tiptag 2:3816541e5485 |
|
784 | 784 | tip 2:3816541e5485 |
|
785 | 785 | visible 0:193e9254ce7e |
|
786 | 786 | $ hg --config extensions.strip= strip -r tip --no-backup |
|
787 | 787 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
788 | 788 | $ hg tags |
|
789 | 789 | visible 0:193e9254ce7e |
|
790 | 790 | tip 0:193e9254ce7e |
|
791 | 791 | |
|
792 | Test bundle overlay onto hidden revision | |
|
793 | ||
|
794 | $ cd .. | |
|
795 | $ hg init repo-bundleoverlay | |
|
796 | $ cd repo-bundleoverlay | |
|
797 | $ echo "A" > foo | |
|
798 | $ hg ci -Am "A" | |
|
799 | adding foo | |
|
800 | $ echo "B" >> foo | |
|
801 | $ hg ci -m "B" | |
|
802 | $ hg up 0 | |
|
803 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
804 | $ echo "C" >> foo | |
|
805 | $ hg ci -m "C" | |
|
806 | created new head | |
|
807 | $ hg log -G | |
|
808 | @ 2:c186d7714947 (draft) [tip ] C | |
|
809 | | | |
|
810 | | o 1:44526ebb0f98 (draft) [ ] B | |
|
811 | |/ | |
|
812 | o 0:4b34ecfb0d56 (draft) [ ] A | |
|
813 | ||
|
814 | ||
|
815 | $ hg clone -r1 . ../other-bundleoverlay | |
|
816 | adding changesets | |
|
817 | adding manifests | |
|
818 | adding file changes | |
|
819 | added 2 changesets with 2 changes to 1 files | |
|
820 | updating to branch default | |
|
821 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
|
822 | $ cd ../other-bundleoverlay | |
|
823 | $ echo "B+" >> foo | |
|
824 | $ hg ci --amend -m "B+" | |
|
825 | $ hg log -G --hidden | |
|
826 | @ 3:b7d587542d40 (draft) [tip ] B+ | |
|
827 | | | |
|
828 | | x 2:eb95e9297e18 (draft) [ ] temporary amend commit for 44526ebb0f98 | |
|
829 | | | | |
|
830 | | x 1:44526ebb0f98 (draft) [ ] B | |
|
831 | |/ | |
|
832 | o 0:4b34ecfb0d56 (draft) [ ] A | |
|
833 | ||
|
834 | ||
|
835 | $ hg incoming ../repo-bundleoverlay --bundle ../bundleoverlay.hg | |
|
836 | comparing with ../repo-bundleoverlay | |
|
837 | searching for changes | |
|
838 | 1:44526ebb0f98 (draft) [ ] B | |
|
839 | 2:c186d7714947 (draft) [tip ] C | |
|
840 | $ hg log -G -R ../bundleoverlay.hg | |
|
841 | o 4:c186d7714947 (draft) [tip ] C | |
|
842 | | | |
|
843 | | @ 3:b7d587542d40 (draft) [ ] B+ | |
|
844 | |/ | |
|
845 | o 0:4b34ecfb0d56 (draft) [ ] A | |
|
846 | ||
|
847 | ||
|
792 | 848 | #if serve |
|
793 | 849 | |
|
794 | 850 | Test issue 4506 |
|
795 | 851 | |
|
796 | 852 | $ cd .. |
|
797 | 853 | $ hg init repo-issue4506 |
|
798 | 854 | $ cd repo-issue4506 |
|
799 | 855 | $ echo "0" > foo |
|
800 | 856 | $ hg add foo |
|
801 | 857 | $ hg ci -m "content-0" |
|
802 | 858 | |
|
803 | 859 | $ hg up null |
|
804 | 860 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
805 | 861 | $ echo "1" > bar |
|
806 | 862 | $ hg add bar |
|
807 | 863 | $ hg ci -m "content-1" |
|
808 | 864 | created new head |
|
809 | 865 | $ hg up 0 |
|
810 | 866 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
811 | 867 | $ hg graft 1 |
|
812 | 868 | grafting 1:1c9eddb02162 "content-1" (tip) |
|
813 | 869 | |
|
814 | 870 | $ hg debugobsolete `hg log -r1 -T'{node}'` `hg log -r2 -T'{node}'` |
|
815 | 871 | |
|
816 | 872 | $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
|
817 | 873 | $ cat hg.pid >> $DAEMON_PIDS |
|
818 | 874 | |
|
819 | 875 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'rev/1' |
|
820 | 876 | 404 Not Found |
|
821 | 877 | [1] |
|
822 | 878 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'file/tip/bar' |
|
823 | 879 | 200 Script output follows |
|
824 | 880 | $ "$TESTDIR/get-with-headers.py" --headeronly localhost:$HGPORT 'annotate/tip/bar' |
|
825 | 881 | 200 Script output follows |
|
826 | 882 | |
|
827 | 883 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
828 | 884 | |
|
829 | 885 | #endif |
|
830 | 886 |
General Comments 0
You need to be logged in to leave comments.
Login now