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