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