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