Show More
@@ -1,347 +1,354 | |||||
1 | # repair.py - functions for repository repair for mercurial |
|
1 | # repair.py - functions for repository repair for mercurial | |
2 | # |
|
2 | # | |
3 | # Copyright 2005, 2006 Chris Mason <mason@suse.com> |
|
3 | # Copyright 2005, 2006 Chris Mason <mason@suse.com> | |
4 | # Copyright 2007 Matt Mackall |
|
4 | # Copyright 2007 Matt Mackall | |
5 | # |
|
5 | # | |
6 | # This software may be used and distributed according to the terms of the |
|
6 | # This software may be used and distributed according to the terms of the | |
7 | # GNU General Public License version 2 or any later version. |
|
7 | # GNU General Public License version 2 or any later version. | |
8 |
|
8 | |||
9 | from __future__ import absolute_import |
|
9 | from __future__ import absolute_import | |
10 |
|
10 | |||
11 | import errno |
|
11 | import errno | |
12 | import hashlib |
|
12 | import hashlib | |
13 |
|
13 | |||
14 | from .i18n import _ |
|
14 | from .i18n import _ | |
15 | from .node import short |
|
15 | from .node import short | |
16 | from . import ( |
|
16 | from . import ( | |
17 | bundle2, |
|
17 | bundle2, | |
18 | changegroup, |
|
18 | changegroup, | |
19 | error, |
|
19 | error, | |
20 | exchange, |
|
20 | exchange, | |
21 | obsolete, |
|
21 | obsolete, | |
22 | util, |
|
22 | util, | |
23 | ) |
|
23 | ) | |
24 |
|
24 | |||
25 | def _bundle(repo, bases, heads, node, suffix, compress=True): |
|
25 | def _bundle(repo, bases, heads, node, suffix, compress=True): | |
26 | """create a bundle with the specified revisions as a backup""" |
|
26 | """create a bundle with the specified revisions as a backup""" | |
27 | cgversion = changegroup.safeversion(repo) |
|
27 | cgversion = changegroup.safeversion(repo) | |
28 |
|
28 | |||
29 | cg = changegroup.changegroupsubset(repo, bases, heads, 'strip', |
|
29 | cg = changegroup.changegroupsubset(repo, bases, heads, 'strip', | |
30 | version=cgversion) |
|
30 | version=cgversion) | |
31 | backupdir = "strip-backup" |
|
31 | backupdir = "strip-backup" | |
32 | vfs = repo.vfs |
|
32 | vfs = repo.vfs | |
33 | if not vfs.isdir(backupdir): |
|
33 | if not vfs.isdir(backupdir): | |
34 | vfs.mkdir(backupdir) |
|
34 | vfs.mkdir(backupdir) | |
35 |
|
35 | |||
36 | # Include a hash of all the nodes in the filename for uniqueness |
|
36 | # Include a hash of all the nodes in the filename for uniqueness | |
37 | allcommits = repo.set('%ln::%ln', bases, heads) |
|
37 | allcommits = repo.set('%ln::%ln', bases, heads) | |
38 | allhashes = sorted(c.hex() for c in allcommits) |
|
38 | allhashes = sorted(c.hex() for c in allcommits) | |
39 | totalhash = hashlib.sha1(''.join(allhashes)).hexdigest() |
|
39 | totalhash = hashlib.sha1(''.join(allhashes)).hexdigest() | |
40 | name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix) |
|
40 | name = "%s/%s-%s-%s.hg" % (backupdir, short(node), totalhash[:8], suffix) | |
41 |
|
41 | |||
42 | comp = None |
|
42 | comp = None | |
43 | if cgversion != '01': |
|
43 | if cgversion != '01': | |
44 | bundletype = "HG20" |
|
44 | bundletype = "HG20" | |
45 | if compress: |
|
45 | if compress: | |
46 | comp = 'BZ' |
|
46 | comp = 'BZ' | |
47 | elif compress: |
|
47 | elif compress: | |
48 | bundletype = "HG10BZ" |
|
48 | bundletype = "HG10BZ" | |
49 | else: |
|
49 | else: | |
50 | bundletype = "HG10UN" |
|
50 | bundletype = "HG10UN" | |
51 | return bundle2.writebundle(repo.ui, cg, name, bundletype, vfs, |
|
51 | return bundle2.writebundle(repo.ui, cg, name, bundletype, vfs, | |
52 | compression=comp) |
|
52 | compression=comp) | |
53 |
|
53 | |||
54 | def _collectfiles(repo, striprev): |
|
54 | def _collectfiles(repo, striprev): | |
55 | """find out the filelogs affected by the strip""" |
|
55 | """find out the filelogs affected by the strip""" | |
56 | files = set() |
|
56 | files = set() | |
57 |
|
57 | |||
58 | for x in xrange(striprev, len(repo)): |
|
58 | for x in xrange(striprev, len(repo)): | |
59 | files.update(repo[x].files()) |
|
59 | files.update(repo[x].files()) | |
60 |
|
60 | |||
61 | return sorted(files) |
|
61 | return sorted(files) | |
62 |
|
62 | |||
63 | def _collectbrokencsets(repo, files, striprev): |
|
63 | def _collectbrokencsets(repo, files, striprev): | |
64 | """return the changesets which will be broken by the truncation""" |
|
64 | """return the changesets which will be broken by the truncation""" | |
65 | s = set() |
|
65 | s = set() | |
66 | def collectone(revlog): |
|
66 | def collectone(revlog): | |
67 | _, brokenset = revlog.getstrippoint(striprev) |
|
67 | _, brokenset = revlog.getstrippoint(striprev) | |
68 | s.update([revlog.linkrev(r) for r in brokenset]) |
|
68 | s.update([revlog.linkrev(r) for r in brokenset]) | |
69 |
|
69 | |||
70 | collectone(repo.manifest) |
|
70 | collectone(repo.manifest) | |
71 | for fname in files: |
|
71 | for fname in files: | |
72 | collectone(repo.file(fname)) |
|
72 | collectone(repo.file(fname)) | |
73 |
|
73 | |||
74 | return s |
|
74 | return s | |
75 |
|
75 | |||
76 | def strip(ui, repo, nodelist, backup=True, topic='backup'): |
|
76 | def strip(ui, repo, nodelist, backup=True, topic='backup'): | |
77 | # This function operates within a transaction of its own, but does |
|
77 | # This function operates within a transaction of its own, but does | |
78 | # not take any lock on the repo. |
|
78 | # not take any lock on the repo. | |
79 | # Simple way to maintain backwards compatibility for this |
|
79 | # Simple way to maintain backwards compatibility for this | |
80 | # argument. |
|
80 | # argument. | |
81 | if backup in ['none', 'strip']: |
|
81 | if backup in ['none', 'strip']: | |
82 | backup = False |
|
82 | backup = False | |
83 |
|
83 | |||
84 | repo = repo.unfiltered() |
|
84 | repo = repo.unfiltered() | |
85 | repo.destroying() |
|
85 | repo.destroying() | |
86 |
|
86 | |||
87 | cl = repo.changelog |
|
87 | cl = repo.changelog | |
88 | # TODO handle undo of merge sets |
|
88 | # TODO handle undo of merge sets | |
89 | if isinstance(nodelist, str): |
|
89 | if isinstance(nodelist, str): | |
90 | nodelist = [nodelist] |
|
90 | nodelist = [nodelist] | |
91 | striplist = [cl.rev(node) for node in nodelist] |
|
91 | striplist = [cl.rev(node) for node in nodelist] | |
92 | striprev = min(striplist) |
|
92 | striprev = min(striplist) | |
93 |
|
93 | |||
94 | # Some revisions with rev > striprev may not be descendants of striprev. |
|
94 | # Some revisions with rev > striprev may not be descendants of striprev. | |
95 | # We have to find these revisions and put them in a bundle, so that |
|
95 | # We have to find these revisions and put them in a bundle, so that | |
96 | # we can restore them after the truncations. |
|
96 | # we can restore them after the truncations. | |
97 | # To create the bundle we use repo.changegroupsubset which requires |
|
97 | # To create the bundle we use repo.changegroupsubset which requires | |
98 | # the list of heads and bases of the set of interesting revisions. |
|
98 | # the list of heads and bases of the set of interesting revisions. | |
99 | # (head = revision in the set that has no descendant in the set; |
|
99 | # (head = revision in the set that has no descendant in the set; | |
100 | # base = revision in the set that has no ancestor in the set) |
|
100 | # base = revision in the set that has no ancestor in the set) | |
101 | tostrip = set(striplist) |
|
101 | tostrip = set(striplist) | |
102 | for rev in striplist: |
|
102 | for rev in striplist: | |
103 | for desc in cl.descendants([rev]): |
|
103 | for desc in cl.descendants([rev]): | |
104 | tostrip.add(desc) |
|
104 | tostrip.add(desc) | |
105 |
|
105 | |||
106 | files = _collectfiles(repo, striprev) |
|
106 | files = _collectfiles(repo, striprev) | |
107 | saverevs = _collectbrokencsets(repo, files, striprev) |
|
107 | saverevs = _collectbrokencsets(repo, files, striprev) | |
108 |
|
108 | |||
109 | # compute heads |
|
109 | # compute heads | |
110 | saveheads = set(saverevs) |
|
110 | saveheads = set(saverevs) | |
111 | for r in xrange(striprev + 1, len(cl)): |
|
111 | for r in xrange(striprev + 1, len(cl)): | |
112 | if r not in tostrip: |
|
112 | if r not in tostrip: | |
113 | saverevs.add(r) |
|
113 | saverevs.add(r) | |
114 | saveheads.difference_update(cl.parentrevs(r)) |
|
114 | saveheads.difference_update(cl.parentrevs(r)) | |
115 | saveheads.add(r) |
|
115 | saveheads.add(r) | |
116 | saveheads = [cl.node(r) for r in saveheads] |
|
116 | saveheads = [cl.node(r) for r in saveheads] | |
117 |
|
117 | |||
118 | # compute base nodes |
|
118 | # compute base nodes | |
119 | if saverevs: |
|
119 | if saverevs: | |
120 | descendants = set(cl.descendants(saverevs)) |
|
120 | descendants = set(cl.descendants(saverevs)) | |
121 | saverevs.difference_update(descendants) |
|
121 | saverevs.difference_update(descendants) | |
122 | savebases = [cl.node(r) for r in saverevs] |
|
122 | savebases = [cl.node(r) for r in saverevs] | |
123 | stripbases = [cl.node(r) for r in tostrip] |
|
123 | stripbases = [cl.node(r) for r in tostrip] | |
124 |
|
124 | |||
125 | # For a set s, max(parents(s) - s) is the same as max(heads(::s - s)), but |
|
125 | # For a set s, max(parents(s) - s) is the same as max(heads(::s - s)), but | |
126 | # is much faster |
|
126 | # is much faster | |
127 | newbmtarget = repo.revs('max(parents(%ld) - (%ld))', tostrip, tostrip) |
|
127 | newbmtarget = repo.revs('max(parents(%ld) - (%ld))', tostrip, tostrip) | |
128 | if newbmtarget: |
|
128 | if newbmtarget: | |
129 | newbmtarget = repo[newbmtarget.first()].node() |
|
129 | newbmtarget = repo[newbmtarget.first()].node() | |
130 | else: |
|
130 | else: | |
131 | newbmtarget = '.' |
|
131 | newbmtarget = '.' | |
132 |
|
132 | |||
133 | bm = repo._bookmarks |
|
133 | bm = repo._bookmarks | |
134 | updatebm = [] |
|
134 | updatebm = [] | |
135 | for m in bm: |
|
135 | for m in bm: | |
136 | rev = repo[bm[m]].rev() |
|
136 | rev = repo[bm[m]].rev() | |
137 | if rev in tostrip: |
|
137 | if rev in tostrip: | |
138 | updatebm.append(m) |
|
138 | updatebm.append(m) | |
139 |
|
139 | |||
140 | # create a changegroup for all the branches we need to keep |
|
140 | # create a changegroup for all the branches we need to keep | |
141 | backupfile = None |
|
141 | backupfile = None | |
142 | vfs = repo.vfs |
|
142 | vfs = repo.vfs | |
143 | node = nodelist[-1] |
|
143 | node = nodelist[-1] | |
144 | if backup: |
|
144 | if backup: | |
145 | backupfile = _bundle(repo, stripbases, cl.heads(), node, topic) |
|
145 | backupfile = _bundle(repo, stripbases, cl.heads(), node, topic) | |
146 | repo.ui.status(_("saved backup bundle to %s\n") % |
|
146 | repo.ui.status(_("saved backup bundle to %s\n") % | |
147 | vfs.join(backupfile)) |
|
147 | vfs.join(backupfile)) | |
148 | repo.ui.log("backupbundle", "saved backup bundle to %s\n", |
|
148 | repo.ui.log("backupbundle", "saved backup bundle to %s\n", | |
149 | vfs.join(backupfile)) |
|
149 | vfs.join(backupfile)) | |
150 | if saveheads or savebases: |
|
150 | if saveheads or savebases: | |
151 | # do not compress partial bundle if we remove it from disk later |
|
151 | # do not compress partial bundle if we remove it from disk later | |
152 | chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp', |
|
152 | chgrpfile = _bundle(repo, savebases, saveheads, node, 'temp', | |
153 | compress=False) |
|
153 | compress=False) | |
154 |
|
154 | |||
155 | mfst = repo.manifest |
|
155 | mfst = repo.manifest | |
156 |
|
156 | |||
157 | curtr = repo.currenttransaction() |
|
157 | curtr = repo.currenttransaction() | |
158 | if curtr is not None: |
|
158 | if curtr is not None: | |
159 | del curtr # avoid carrying reference to transaction for nothing |
|
159 | del curtr # avoid carrying reference to transaction for nothing | |
160 | msg = _('programming error: cannot strip from inside a transaction') |
|
160 | msg = _('programming error: cannot strip from inside a transaction') | |
161 | raise error.Abort(msg, hint=_('contact your extension maintainer')) |
|
161 | raise error.Abort(msg, hint=_('contact your extension maintainer')) | |
162 |
|
162 | |||
163 | try: |
|
163 | try: | |
164 | with repo.transaction("strip") as tr: |
|
164 | with repo.transaction("strip") as tr: | |
165 | offset = len(tr.entries) |
|
165 | offset = len(tr.entries) | |
166 |
|
166 | |||
167 | tr.startgroup() |
|
167 | tr.startgroup() | |
168 | cl.strip(striprev, tr) |
|
168 | cl.strip(striprev, tr) | |
169 | mfst.strip(striprev, tr) |
|
169 | mfst.strip(striprev, tr) | |
|
170 | if 'treemanifest' in repo.requirements: # safe but unnecessary | |||
|
171 | # otherwise | |||
|
172 | for unencoded, encoded, size in repo.store.datafiles(): | |||
|
173 | if (unencoded.startswith('meta/') and | |||
|
174 | unencoded.endswith('00manifest.i')): | |||
|
175 | dir = unencoded[5:-12] | |||
|
176 | repo.dirlog(dir).strip(striprev, tr) | |||
170 | for fn in files: |
|
177 | for fn in files: | |
171 | repo.file(fn).strip(striprev, tr) |
|
178 | repo.file(fn).strip(striprev, tr) | |
172 | tr.endgroup() |
|
179 | tr.endgroup() | |
173 |
|
180 | |||
174 | for i in xrange(offset, len(tr.entries)): |
|
181 | for i in xrange(offset, len(tr.entries)): | |
175 | file, troffset, ignore = tr.entries[i] |
|
182 | file, troffset, ignore = tr.entries[i] | |
176 | repo.svfs(file, 'a').truncate(troffset) |
|
183 | repo.svfs(file, 'a').truncate(troffset) | |
177 | if troffset == 0: |
|
184 | if troffset == 0: | |
178 | repo.store.markremoved(file) |
|
185 | repo.store.markremoved(file) | |
179 |
|
186 | |||
180 | if saveheads or savebases: |
|
187 | if saveheads or savebases: | |
181 | ui.note(_("adding branch\n")) |
|
188 | ui.note(_("adding branch\n")) | |
182 | f = vfs.open(chgrpfile, "rb") |
|
189 | f = vfs.open(chgrpfile, "rb") | |
183 | gen = exchange.readbundle(ui, f, chgrpfile, vfs) |
|
190 | gen = exchange.readbundle(ui, f, chgrpfile, vfs) | |
184 | if not repo.ui.verbose: |
|
191 | if not repo.ui.verbose: | |
185 | # silence internal shuffling chatter |
|
192 | # silence internal shuffling chatter | |
186 | repo.ui.pushbuffer() |
|
193 | repo.ui.pushbuffer() | |
187 | if isinstance(gen, bundle2.unbundle20): |
|
194 | if isinstance(gen, bundle2.unbundle20): | |
188 | with repo.transaction('strip') as tr: |
|
195 | with repo.transaction('strip') as tr: | |
189 | tr.hookargs = {'source': 'strip', |
|
196 | tr.hookargs = {'source': 'strip', | |
190 | 'url': 'bundle:' + vfs.join(chgrpfile)} |
|
197 | 'url': 'bundle:' + vfs.join(chgrpfile)} | |
191 | bundle2.applybundle(repo, gen, tr, source='strip', |
|
198 | bundle2.applybundle(repo, gen, tr, source='strip', | |
192 | url='bundle:' + vfs.join(chgrpfile)) |
|
199 | url='bundle:' + vfs.join(chgrpfile)) | |
193 | else: |
|
200 | else: | |
194 | gen.apply(repo, 'strip', 'bundle:' + vfs.join(chgrpfile), True) |
|
201 | gen.apply(repo, 'strip', 'bundle:' + vfs.join(chgrpfile), True) | |
195 | if not repo.ui.verbose: |
|
202 | if not repo.ui.verbose: | |
196 | repo.ui.popbuffer() |
|
203 | repo.ui.popbuffer() | |
197 | f.close() |
|
204 | f.close() | |
198 | repo._phasecache.invalidate() |
|
205 | repo._phasecache.invalidate() | |
199 |
|
206 | |||
200 | for m in updatebm: |
|
207 | for m in updatebm: | |
201 | bm[m] = repo[newbmtarget].node() |
|
208 | bm[m] = repo[newbmtarget].node() | |
202 | lock = tr = None |
|
209 | lock = tr = None | |
203 | try: |
|
210 | try: | |
204 | lock = repo.lock() |
|
211 | lock = repo.lock() | |
205 | tr = repo.transaction('repair') |
|
212 | tr = repo.transaction('repair') | |
206 | bm.recordchange(tr) |
|
213 | bm.recordchange(tr) | |
207 | tr.close() |
|
214 | tr.close() | |
208 | finally: |
|
215 | finally: | |
209 | tr.release() |
|
216 | tr.release() | |
210 | lock.release() |
|
217 | lock.release() | |
211 |
|
218 | |||
212 | # remove undo files |
|
219 | # remove undo files | |
213 | for undovfs, undofile in repo.undofiles(): |
|
220 | for undovfs, undofile in repo.undofiles(): | |
214 | try: |
|
221 | try: | |
215 | undovfs.unlink(undofile) |
|
222 | undovfs.unlink(undofile) | |
216 | except OSError as e: |
|
223 | except OSError as e: | |
217 | if e.errno != errno.ENOENT: |
|
224 | if e.errno != errno.ENOENT: | |
218 | ui.warn(_('error removing %s: %s\n') % |
|
225 | ui.warn(_('error removing %s: %s\n') % | |
219 | (undovfs.join(undofile), str(e))) |
|
226 | (undovfs.join(undofile), str(e))) | |
220 |
|
227 | |||
221 | except: # re-raises |
|
228 | except: # re-raises | |
222 | if backupfile: |
|
229 | if backupfile: | |
223 | ui.warn(_("strip failed, full bundle stored in '%s'\n") |
|
230 | ui.warn(_("strip failed, full bundle stored in '%s'\n") | |
224 | % vfs.join(backupfile)) |
|
231 | % vfs.join(backupfile)) | |
225 | elif saveheads: |
|
232 | elif saveheads: | |
226 | ui.warn(_("strip failed, partial bundle stored in '%s'\n") |
|
233 | ui.warn(_("strip failed, partial bundle stored in '%s'\n") | |
227 | % vfs.join(chgrpfile)) |
|
234 | % vfs.join(chgrpfile)) | |
228 | raise |
|
235 | raise | |
229 | else: |
|
236 | else: | |
230 | if saveheads or savebases: |
|
237 | if saveheads or savebases: | |
231 | # Remove partial backup only if there were no exceptions |
|
238 | # Remove partial backup only if there were no exceptions | |
232 | vfs.unlink(chgrpfile) |
|
239 | vfs.unlink(chgrpfile) | |
233 |
|
240 | |||
234 | repo.destroyed() |
|
241 | repo.destroyed() | |
235 |
|
242 | |||
236 | def rebuildfncache(ui, repo): |
|
243 | def rebuildfncache(ui, repo): | |
237 | """Rebuilds the fncache file from repo history. |
|
244 | """Rebuilds the fncache file from repo history. | |
238 |
|
245 | |||
239 | Missing entries will be added. Extra entries will be removed. |
|
246 | Missing entries will be added. Extra entries will be removed. | |
240 | """ |
|
247 | """ | |
241 | repo = repo.unfiltered() |
|
248 | repo = repo.unfiltered() | |
242 |
|
249 | |||
243 | if 'fncache' not in repo.requirements: |
|
250 | if 'fncache' not in repo.requirements: | |
244 | ui.warn(_('(not rebuilding fncache because repository does not ' |
|
251 | ui.warn(_('(not rebuilding fncache because repository does not ' | |
245 | 'support fncache)\n')) |
|
252 | 'support fncache)\n')) | |
246 | return |
|
253 | return | |
247 |
|
254 | |||
248 | with repo.lock(): |
|
255 | with repo.lock(): | |
249 | fnc = repo.store.fncache |
|
256 | fnc = repo.store.fncache | |
250 | # Trigger load of fncache. |
|
257 | # Trigger load of fncache. | |
251 | if 'irrelevant' in fnc: |
|
258 | if 'irrelevant' in fnc: | |
252 | pass |
|
259 | pass | |
253 |
|
260 | |||
254 | oldentries = set(fnc.entries) |
|
261 | oldentries = set(fnc.entries) | |
255 | newentries = set() |
|
262 | newentries = set() | |
256 | seenfiles = set() |
|
263 | seenfiles = set() | |
257 |
|
264 | |||
258 | repolen = len(repo) |
|
265 | repolen = len(repo) | |
259 | for rev in repo: |
|
266 | for rev in repo: | |
260 | ui.progress(_('rebuilding'), rev, total=repolen, |
|
267 | ui.progress(_('rebuilding'), rev, total=repolen, | |
261 | unit=_('changesets')) |
|
268 | unit=_('changesets')) | |
262 |
|
269 | |||
263 | ctx = repo[rev] |
|
270 | ctx = repo[rev] | |
264 | for f in ctx.files(): |
|
271 | for f in ctx.files(): | |
265 | # This is to minimize I/O. |
|
272 | # This is to minimize I/O. | |
266 | if f in seenfiles: |
|
273 | if f in seenfiles: | |
267 | continue |
|
274 | continue | |
268 | seenfiles.add(f) |
|
275 | seenfiles.add(f) | |
269 |
|
276 | |||
270 | i = 'data/%s.i' % f |
|
277 | i = 'data/%s.i' % f | |
271 | d = 'data/%s.d' % f |
|
278 | d = 'data/%s.d' % f | |
272 |
|
279 | |||
273 | if repo.store._exists(i): |
|
280 | if repo.store._exists(i): | |
274 | newentries.add(i) |
|
281 | newentries.add(i) | |
275 | if repo.store._exists(d): |
|
282 | if repo.store._exists(d): | |
276 | newentries.add(d) |
|
283 | newentries.add(d) | |
277 |
|
284 | |||
278 | ui.progress(_('rebuilding'), None) |
|
285 | ui.progress(_('rebuilding'), None) | |
279 |
|
286 | |||
280 | if 'treemanifest' in repo.requirements: # safe but unnecessary otherwise |
|
287 | if 'treemanifest' in repo.requirements: # safe but unnecessary otherwise | |
281 | for dir in util.dirs(seenfiles): |
|
288 | for dir in util.dirs(seenfiles): | |
282 | i = 'meta/%s/00manifest.i' % dir |
|
289 | i = 'meta/%s/00manifest.i' % dir | |
283 | d = 'meta/%s/00manifest.d' % dir |
|
290 | d = 'meta/%s/00manifest.d' % dir | |
284 |
|
291 | |||
285 | if repo.store._exists(i): |
|
292 | if repo.store._exists(i): | |
286 | newentries.add(i) |
|
293 | newentries.add(i) | |
287 | if repo.store._exists(d): |
|
294 | if repo.store._exists(d): | |
288 | newentries.add(d) |
|
295 | newentries.add(d) | |
289 |
|
296 | |||
290 | addcount = len(newentries - oldentries) |
|
297 | addcount = len(newentries - oldentries) | |
291 | removecount = len(oldentries - newentries) |
|
298 | removecount = len(oldentries - newentries) | |
292 | for p in sorted(oldentries - newentries): |
|
299 | for p in sorted(oldentries - newentries): | |
293 | ui.write(_('removing %s\n') % p) |
|
300 | ui.write(_('removing %s\n') % p) | |
294 | for p in sorted(newentries - oldentries): |
|
301 | for p in sorted(newentries - oldentries): | |
295 | ui.write(_('adding %s\n') % p) |
|
302 | ui.write(_('adding %s\n') % p) | |
296 |
|
303 | |||
297 | if addcount or removecount: |
|
304 | if addcount or removecount: | |
298 | ui.write(_('%d items added, %d removed from fncache\n') % |
|
305 | ui.write(_('%d items added, %d removed from fncache\n') % | |
299 | (addcount, removecount)) |
|
306 | (addcount, removecount)) | |
300 | fnc.entries = newentries |
|
307 | fnc.entries = newentries | |
301 | fnc._dirty = True |
|
308 | fnc._dirty = True | |
302 |
|
309 | |||
303 | with repo.transaction('fncache') as tr: |
|
310 | with repo.transaction('fncache') as tr: | |
304 | fnc.write(tr) |
|
311 | fnc.write(tr) | |
305 | else: |
|
312 | else: | |
306 | ui.write(_('fncache already up to date\n')) |
|
313 | ui.write(_('fncache already up to date\n')) | |
307 |
|
314 | |||
308 | def stripbmrevset(repo, mark): |
|
315 | def stripbmrevset(repo, mark): | |
309 | """ |
|
316 | """ | |
310 | The revset to strip when strip is called with -B mark |
|
317 | The revset to strip when strip is called with -B mark | |
311 |
|
318 | |||
312 | Needs to live here so extensions can use it and wrap it even when strip is |
|
319 | Needs to live here so extensions can use it and wrap it even when strip is | |
313 | not enabled or not present on a box. |
|
320 | not enabled or not present on a box. | |
314 | """ |
|
321 | """ | |
315 | return repo.revs("ancestors(bookmark(%s)) - " |
|
322 | return repo.revs("ancestors(bookmark(%s)) - " | |
316 | "ancestors(head() and not bookmark(%s)) - " |
|
323 | "ancestors(head() and not bookmark(%s)) - " | |
317 | "ancestors(bookmark() and not bookmark(%s))", |
|
324 | "ancestors(bookmark() and not bookmark(%s))", | |
318 | mark, mark, mark) |
|
325 | mark, mark, mark) | |
319 |
|
326 | |||
320 | def deleteobsmarkers(obsstore, indices): |
|
327 | def deleteobsmarkers(obsstore, indices): | |
321 | """Delete some obsmarkers from obsstore and return how many were deleted |
|
328 | """Delete some obsmarkers from obsstore and return how many were deleted | |
322 |
|
329 | |||
323 | 'indices' is a list of ints which are the indices |
|
330 | 'indices' is a list of ints which are the indices | |
324 | of the markers to be deleted. |
|
331 | of the markers to be deleted. | |
325 |
|
332 | |||
326 | Every invocation of this function completely rewrites the obsstore file, |
|
333 | Every invocation of this function completely rewrites the obsstore file, | |
327 | skipping the markers we want to be removed. The new temporary file is |
|
334 | skipping the markers we want to be removed. The new temporary file is | |
328 | created, remaining markers are written there and on .close() this file |
|
335 | created, remaining markers are written there and on .close() this file | |
329 | gets atomically renamed to obsstore, thus guaranteeing consistency.""" |
|
336 | gets atomically renamed to obsstore, thus guaranteeing consistency.""" | |
330 | if not indices: |
|
337 | if not indices: | |
331 | # we don't want to rewrite the obsstore with the same content |
|
338 | # we don't want to rewrite the obsstore with the same content | |
332 | return |
|
339 | return | |
333 |
|
340 | |||
334 | left = [] |
|
341 | left = [] | |
335 | current = obsstore._all |
|
342 | current = obsstore._all | |
336 | n = 0 |
|
343 | n = 0 | |
337 | for i, m in enumerate(current): |
|
344 | for i, m in enumerate(current): | |
338 | if i in indices: |
|
345 | if i in indices: | |
339 | n += 1 |
|
346 | n += 1 | |
340 | continue |
|
347 | continue | |
341 | left.append(m) |
|
348 | left.append(m) | |
342 |
|
349 | |||
343 | newobsstorefile = obsstore.svfs('obsstore', 'w', atomictemp=True) |
|
350 | newobsstorefile = obsstore.svfs('obsstore', 'w', atomictemp=True) | |
344 | for bytes in obsolete.encodemarkers(left, True, obsstore._version): |
|
351 | for bytes in obsolete.encodemarkers(left, True, obsstore._version): | |
345 | newobsstorefile.write(bytes) |
|
352 | newobsstorefile.write(bytes) | |
346 | newobsstorefile.close() |
|
353 | newobsstorefile.close() | |
347 | return n |
|
354 | return n |
@@ -1,786 +1,795 | |||||
1 | #require killdaemons |
|
1 | #require killdaemons | |
2 |
|
2 | |||
3 | $ cat << EOF >> $HGRCPATH |
|
3 | $ cat << EOF >> $HGRCPATH | |
4 | > [format] |
|
4 | > [format] | |
5 | > usegeneraldelta=yes |
|
5 | > usegeneraldelta=yes | |
6 | > [ui] |
|
6 | > [ui] | |
7 | > ssh=python "$TESTDIR/dummyssh" |
|
7 | > ssh=python "$TESTDIR/dummyssh" | |
8 | > EOF |
|
8 | > EOF | |
9 |
|
9 | |||
10 | Set up repo |
|
10 | Set up repo | |
11 |
|
11 | |||
12 | $ hg --config experimental.treemanifest=True init repo |
|
12 | $ hg --config experimental.treemanifest=True init repo | |
13 | $ cd repo |
|
13 | $ cd repo | |
14 |
|
14 | |||
15 | Requirements get set on init |
|
15 | Requirements get set on init | |
16 |
|
16 | |||
17 | $ grep treemanifest .hg/requires |
|
17 | $ grep treemanifest .hg/requires | |
18 | treemanifest |
|
18 | treemanifest | |
19 |
|
19 | |||
20 | Without directories, looks like any other repo |
|
20 | Without directories, looks like any other repo | |
21 |
|
21 | |||
22 | $ echo 0 > a |
|
22 | $ echo 0 > a | |
23 | $ echo 0 > b |
|
23 | $ echo 0 > b | |
24 | $ hg ci -Aqm initial |
|
24 | $ hg ci -Aqm initial | |
25 | $ hg debugdata -m 0 |
|
25 | $ hg debugdata -m 0 | |
26 | a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) |
|
26 | a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) | |
27 | b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) |
|
27 | b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) | |
28 |
|
28 | |||
29 | Submanifest is stored in separate revlog |
|
29 | Submanifest is stored in separate revlog | |
30 |
|
30 | |||
31 | $ mkdir dir1 |
|
31 | $ mkdir dir1 | |
32 | $ echo 1 > dir1/a |
|
32 | $ echo 1 > dir1/a | |
33 | $ echo 1 > dir1/b |
|
33 | $ echo 1 > dir1/b | |
34 | $ echo 1 > e |
|
34 | $ echo 1 > e | |
35 | $ hg ci -Aqm 'add dir1' |
|
35 | $ hg ci -Aqm 'add dir1' | |
36 | $ hg debugdata -m 1 |
|
36 | $ hg debugdata -m 1 | |
37 | a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) |
|
37 | a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) | |
38 | b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) |
|
38 | b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc) | |
39 | dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc) |
|
39 | dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc) | |
40 | e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) |
|
40 | e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) | |
41 | $ hg debugdata --dir dir1 0 |
|
41 | $ hg debugdata --dir dir1 0 | |
42 | a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) |
|
42 | a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) | |
43 | b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) |
|
43 | b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc) | |
44 |
|
44 | |||
45 | Can add nested directories |
|
45 | Can add nested directories | |
46 |
|
46 | |||
47 | $ mkdir dir1/dir1 |
|
47 | $ mkdir dir1/dir1 | |
48 | $ echo 2 > dir1/dir1/a |
|
48 | $ echo 2 > dir1/dir1/a | |
49 | $ echo 2 > dir1/dir1/b |
|
49 | $ echo 2 > dir1/dir1/b | |
50 | $ mkdir dir1/dir2 |
|
50 | $ mkdir dir1/dir2 | |
51 | $ echo 2 > dir1/dir2/a |
|
51 | $ echo 2 > dir1/dir2/a | |
52 | $ echo 2 > dir1/dir2/b |
|
52 | $ echo 2 > dir1/dir2/b | |
53 | $ hg ci -Aqm 'add dir1/dir1' |
|
53 | $ hg ci -Aqm 'add dir1/dir1' | |
54 | $ hg files -r . |
|
54 | $ hg files -r . | |
55 | a |
|
55 | a | |
56 | b |
|
56 | b | |
57 | dir1/a (glob) |
|
57 | dir1/a (glob) | |
58 | dir1/b (glob) |
|
58 | dir1/b (glob) | |
59 | dir1/dir1/a (glob) |
|
59 | dir1/dir1/a (glob) | |
60 | dir1/dir1/b (glob) |
|
60 | dir1/dir1/b (glob) | |
61 | dir1/dir2/a (glob) |
|
61 | dir1/dir2/a (glob) | |
62 | dir1/dir2/b (glob) |
|
62 | dir1/dir2/b (glob) | |
63 | e |
|
63 | e | |
64 |
|
64 | |||
65 | Revision is not created for unchanged directory |
|
65 | Revision is not created for unchanged directory | |
66 |
|
66 | |||
67 | $ mkdir dir2 |
|
67 | $ mkdir dir2 | |
68 | $ echo 3 > dir2/a |
|
68 | $ echo 3 > dir2/a | |
69 | $ hg add dir2 |
|
69 | $ hg add dir2 | |
70 | adding dir2/a (glob) |
|
70 | adding dir2/a (glob) | |
71 | $ hg debugindex --dir dir1 > before |
|
71 | $ hg debugindex --dir dir1 > before | |
72 | $ hg ci -qm 'add dir2' |
|
72 | $ hg ci -qm 'add dir2' | |
73 | $ hg debugindex --dir dir1 > after |
|
73 | $ hg debugindex --dir dir1 > after | |
74 | $ diff before after |
|
74 | $ diff before after | |
75 | $ rm before after |
|
75 | $ rm before after | |
76 |
|
76 | |||
77 | Removing directory does not create an revlog entry |
|
77 | Removing directory does not create an revlog entry | |
78 |
|
78 | |||
79 | $ hg rm dir1/dir1 |
|
79 | $ hg rm dir1/dir1 | |
80 | removing dir1/dir1/a (glob) |
|
80 | removing dir1/dir1/a (glob) | |
81 | removing dir1/dir1/b (glob) |
|
81 | removing dir1/dir1/b (glob) | |
82 | $ hg debugindex --dir dir1/dir1 > before |
|
82 | $ hg debugindex --dir dir1/dir1 > before | |
83 | $ hg ci -qm 'remove dir1/dir1' |
|
83 | $ hg ci -qm 'remove dir1/dir1' | |
84 | $ hg debugindex --dir dir1/dir1 > after |
|
84 | $ hg debugindex --dir dir1/dir1 > after | |
85 | $ diff before after |
|
85 | $ diff before after | |
86 | $ rm before after |
|
86 | $ rm before after | |
87 |
|
87 | |||
88 | Check that hg files (calls treemanifest.walk()) works |
|
88 | Check that hg files (calls treemanifest.walk()) works | |
89 | without loading all directory revlogs |
|
89 | without loading all directory revlogs | |
90 |
|
90 | |||
91 | $ hg co 'desc("add dir2")' |
|
91 | $ hg co 'desc("add dir2")' | |
92 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
92 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
93 | $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup |
|
93 | $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup | |
94 | $ hg files -r . dir1 |
|
94 | $ hg files -r . dir1 | |
95 | dir1/a (glob) |
|
95 | dir1/a (glob) | |
96 | dir1/b (glob) |
|
96 | dir1/b (glob) | |
97 | dir1/dir1/a (glob) |
|
97 | dir1/dir1/a (glob) | |
98 | dir1/dir1/b (glob) |
|
98 | dir1/dir1/b (glob) | |
99 | dir1/dir2/a (glob) |
|
99 | dir1/dir2/a (glob) | |
100 | dir1/dir2/b (glob) |
|
100 | dir1/dir2/b (glob) | |
101 |
|
101 | |||
102 | Check that status between revisions works (calls treemanifest.matches()) |
|
102 | Check that status between revisions works (calls treemanifest.matches()) | |
103 | without loading all directory revlogs |
|
103 | without loading all directory revlogs | |
104 |
|
104 | |||
105 | $ hg status --rev 'desc("add dir1")' --rev . dir1 |
|
105 | $ hg status --rev 'desc("add dir1")' --rev . dir1 | |
106 | A dir1/dir1/a |
|
106 | A dir1/dir1/a | |
107 | A dir1/dir1/b |
|
107 | A dir1/dir1/b | |
108 | A dir1/dir2/a |
|
108 | A dir1/dir2/a | |
109 | A dir1/dir2/b |
|
109 | A dir1/dir2/b | |
110 | $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2 |
|
110 | $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2 | |
111 |
|
111 | |||
112 | Merge creates 2-parent revision of directory revlog |
|
112 | Merge creates 2-parent revision of directory revlog | |
113 |
|
113 | |||
114 | $ echo 5 > dir1/a |
|
114 | $ echo 5 > dir1/a | |
115 | $ hg ci -Aqm 'modify dir1/a' |
|
115 | $ hg ci -Aqm 'modify dir1/a' | |
116 | $ hg co '.^' |
|
116 | $ hg co '.^' | |
117 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
117 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
118 | $ echo 6 > dir1/b |
|
118 | $ echo 6 > dir1/b | |
119 | $ hg ci -Aqm 'modify dir1/b' |
|
119 | $ hg ci -Aqm 'modify dir1/b' | |
120 | $ hg merge 'desc("modify dir1/a")' |
|
120 | $ hg merge 'desc("modify dir1/a")' | |
121 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
121 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
122 | (branch merge, don't forget to commit) |
|
122 | (branch merge, don't forget to commit) | |
123 | $ hg ci -m 'conflict-free merge involving dir1/' |
|
123 | $ hg ci -m 'conflict-free merge involving dir1/' | |
124 | $ cat dir1/a |
|
124 | $ cat dir1/a | |
125 | 5 |
|
125 | 5 | |
126 | $ cat dir1/b |
|
126 | $ cat dir1/b | |
127 | 6 |
|
127 | 6 | |
128 | $ hg debugindex --dir dir1 |
|
128 | $ hg debugindex --dir dir1 | |
129 | rev offset length delta linkrev nodeid p1 p2 |
|
129 | rev offset length delta linkrev nodeid p1 p2 | |
130 | 0 0 54 -1 1 8b3ffd73f901 000000000000 000000000000 |
|
130 | 0 0 54 -1 1 8b3ffd73f901 000000000000 000000000000 | |
131 | 1 54 68 0 2 68e9d057c5a8 8b3ffd73f901 000000000000 |
|
131 | 1 54 68 0 2 68e9d057c5a8 8b3ffd73f901 000000000000 | |
132 | 2 122 12 1 4 4698198d2624 68e9d057c5a8 000000000000 |
|
132 | 2 122 12 1 4 4698198d2624 68e9d057c5a8 000000000000 | |
133 | 3 134 55 1 5 44844058ccce 68e9d057c5a8 000000000000 |
|
133 | 3 134 55 1 5 44844058ccce 68e9d057c5a8 000000000000 | |
134 | 4 189 55 1 6 bf3d9b744927 68e9d057c5a8 000000000000 |
|
134 | 4 189 55 1 6 bf3d9b744927 68e9d057c5a8 000000000000 | |
135 | 5 244 55 4 7 dde7c0af2a03 bf3d9b744927 44844058ccce |
|
135 | 5 244 55 4 7 dde7c0af2a03 bf3d9b744927 44844058ccce | |
136 |
|
136 | |||
137 | Merge keeping directory from parent 1 does not create revlog entry. (Note that |
|
137 | Merge keeping directory from parent 1 does not create revlog entry. (Note that | |
138 | dir1's manifest does change, but only because dir1/a's filelog changes.) |
|
138 | dir1's manifest does change, but only because dir1/a's filelog changes.) | |
139 |
|
139 | |||
140 | $ hg co 'desc("add dir2")' |
|
140 | $ hg co 'desc("add dir2")' | |
141 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
141 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
142 | $ echo 8 > dir2/a |
|
142 | $ echo 8 > dir2/a | |
143 | $ hg ci -m 'modify dir2/a' |
|
143 | $ hg ci -m 'modify dir2/a' | |
144 | created new head |
|
144 | created new head | |
145 |
|
145 | |||
146 | $ hg debugindex --dir dir2 > before |
|
146 | $ hg debugindex --dir dir2 > before | |
147 | $ hg merge 'desc("modify dir1/a")' |
|
147 | $ hg merge 'desc("modify dir1/a")' | |
148 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
148 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
149 | (branch merge, don't forget to commit) |
|
149 | (branch merge, don't forget to commit) | |
150 | $ hg revert -r 'desc("modify dir2/a")' . |
|
150 | $ hg revert -r 'desc("modify dir2/a")' . | |
151 | reverting dir1/a (glob) |
|
151 | reverting dir1/a (glob) | |
152 | $ hg ci -m 'merge, keeping parent 1' |
|
152 | $ hg ci -m 'merge, keeping parent 1' | |
153 | $ hg debugindex --dir dir2 > after |
|
153 | $ hg debugindex --dir dir2 > after | |
154 | $ diff before after |
|
154 | $ diff before after | |
155 | $ rm before after |
|
155 | $ rm before after | |
156 |
|
156 | |||
157 | Merge keeping directory from parent 2 does not create revlog entry. (Note that |
|
157 | Merge keeping directory from parent 2 does not create revlog entry. (Note that | |
158 | dir2's manifest does change, but only because dir2/a's filelog changes.) |
|
158 | dir2's manifest does change, but only because dir2/a's filelog changes.) | |
159 |
|
159 | |||
160 | $ hg co 'desc("modify dir2/a")' |
|
160 | $ hg co 'desc("modify dir2/a")' | |
161 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
161 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
162 | $ hg debugindex --dir dir1 > before |
|
162 | $ hg debugindex --dir dir1 > before | |
163 | $ hg merge 'desc("modify dir1/a")' |
|
163 | $ hg merge 'desc("modify dir1/a")' | |
164 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
164 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
165 | (branch merge, don't forget to commit) |
|
165 | (branch merge, don't forget to commit) | |
166 | $ hg revert -r 'desc("modify dir1/a")' . |
|
166 | $ hg revert -r 'desc("modify dir1/a")' . | |
167 | reverting dir2/a (glob) |
|
167 | reverting dir2/a (glob) | |
168 | $ hg ci -m 'merge, keeping parent 2' |
|
168 | $ hg ci -m 'merge, keeping parent 2' | |
169 | created new head |
|
169 | created new head | |
170 | $ hg debugindex --dir dir1 > after |
|
170 | $ hg debugindex --dir dir1 > after | |
171 | $ diff before after |
|
171 | $ diff before after | |
172 | $ rm before after |
|
172 | $ rm before after | |
173 |
|
173 | |||
174 | Create flat source repo for tests with mixed flat/tree manifests |
|
174 | Create flat source repo for tests with mixed flat/tree manifests | |
175 |
|
175 | |||
176 | $ cd .. |
|
176 | $ cd .. | |
177 | $ hg init repo-flat |
|
177 | $ hg init repo-flat | |
178 | $ cd repo-flat |
|
178 | $ cd repo-flat | |
179 |
|
179 | |||
180 | Create a few commits with flat manifest |
|
180 | Create a few commits with flat manifest | |
181 |
|
181 | |||
182 | $ echo 0 > a |
|
182 | $ echo 0 > a | |
183 | $ echo 0 > b |
|
183 | $ echo 0 > b | |
184 | $ echo 0 > e |
|
184 | $ echo 0 > e | |
185 | $ for d in dir1 dir1/dir1 dir1/dir2 dir2 |
|
185 | $ for d in dir1 dir1/dir1 dir1/dir2 dir2 | |
186 | > do |
|
186 | > do | |
187 | > mkdir $d |
|
187 | > mkdir $d | |
188 | > echo 0 > $d/a |
|
188 | > echo 0 > $d/a | |
189 | > echo 0 > $d/b |
|
189 | > echo 0 > $d/b | |
190 | > done |
|
190 | > done | |
191 | $ hg ci -Aqm initial |
|
191 | $ hg ci -Aqm initial | |
192 |
|
192 | |||
193 | $ echo 1 > a |
|
193 | $ echo 1 > a | |
194 | $ echo 1 > dir1/a |
|
194 | $ echo 1 > dir1/a | |
195 | $ echo 1 > dir1/dir1/a |
|
195 | $ echo 1 > dir1/dir1/a | |
196 | $ hg ci -Aqm 'modify on branch 1' |
|
196 | $ hg ci -Aqm 'modify on branch 1' | |
197 |
|
197 | |||
198 | $ hg co 0 |
|
198 | $ hg co 0 | |
199 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
199 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
200 | $ echo 2 > b |
|
200 | $ echo 2 > b | |
201 | $ echo 2 > dir1/b |
|
201 | $ echo 2 > dir1/b | |
202 | $ echo 2 > dir1/dir1/b |
|
202 | $ echo 2 > dir1/dir1/b | |
203 | $ hg ci -Aqm 'modify on branch 2' |
|
203 | $ hg ci -Aqm 'modify on branch 2' | |
204 |
|
204 | |||
205 | $ hg merge 1 |
|
205 | $ hg merge 1 | |
206 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
206 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
207 | (branch merge, don't forget to commit) |
|
207 | (branch merge, don't forget to commit) | |
208 | $ hg ci -m 'merge of flat manifests to new flat manifest' |
|
208 | $ hg ci -m 'merge of flat manifests to new flat manifest' | |
209 |
|
209 | |||
210 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log |
|
210 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log | |
211 | $ cat hg.pid >> $DAEMON_PIDS |
|
211 | $ cat hg.pid >> $DAEMON_PIDS | |
212 |
|
212 | |||
213 | Create clone with tree manifests enabled |
|
213 | Create clone with tree manifests enabled | |
214 |
|
214 | |||
215 | $ cd .. |
|
215 | $ cd .. | |
216 | $ hg clone --config experimental.treemanifest=1 \ |
|
216 | $ hg clone --config experimental.treemanifest=1 \ | |
217 | > http://localhost:$HGPORT repo-mixed -r 1 |
|
217 | > http://localhost:$HGPORT repo-mixed -r 1 | |
218 | adding changesets |
|
218 | adding changesets | |
219 | adding manifests |
|
219 | adding manifests | |
220 | adding file changes |
|
220 | adding file changes | |
221 | added 2 changesets with 14 changes to 11 files |
|
221 | added 2 changesets with 14 changes to 11 files | |
222 | updating to branch default |
|
222 | updating to branch default | |
223 | 11 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
223 | 11 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
224 | $ cd repo-mixed |
|
224 | $ cd repo-mixed | |
225 | $ test -d .hg/store/meta |
|
225 | $ test -d .hg/store/meta | |
226 | [1] |
|
226 | [1] | |
227 | $ grep treemanifest .hg/requires |
|
227 | $ grep treemanifest .hg/requires | |
228 | treemanifest |
|
228 | treemanifest | |
229 |
|
229 | |||
230 | Should be possible to push updates from flat to tree manifest repo |
|
230 | Should be possible to push updates from flat to tree manifest repo | |
231 |
|
231 | |||
232 | $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed |
|
232 | $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed | |
233 | pushing to ssh://user@dummy/repo-mixed |
|
233 | pushing to ssh://user@dummy/repo-mixed | |
234 | searching for changes |
|
234 | searching for changes | |
235 | remote: adding changesets |
|
235 | remote: adding changesets | |
236 | remote: adding manifests |
|
236 | remote: adding manifests | |
237 | remote: adding file changes |
|
237 | remote: adding file changes | |
238 | remote: added 2 changesets with 3 changes to 3 files |
|
238 | remote: added 2 changesets with 3 changes to 3 files | |
239 |
|
239 | |||
240 | Commit should store revlog per directory |
|
240 | Commit should store revlog per directory | |
241 |
|
241 | |||
242 | $ hg co 1 |
|
242 | $ hg co 1 | |
243 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
243 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
244 | $ echo 3 > a |
|
244 | $ echo 3 > a | |
245 | $ echo 3 > dir1/a |
|
245 | $ echo 3 > dir1/a | |
246 | $ echo 3 > dir1/dir1/a |
|
246 | $ echo 3 > dir1/dir1/a | |
247 | $ hg ci -m 'first tree' |
|
247 | $ hg ci -m 'first tree' | |
248 | created new head |
|
248 | created new head | |
249 | $ find .hg/store/meta | sort |
|
249 | $ find .hg/store/meta | sort | |
250 | .hg/store/meta |
|
250 | .hg/store/meta | |
251 | .hg/store/meta/dir1 |
|
251 | .hg/store/meta/dir1 | |
252 | .hg/store/meta/dir1/00manifest.i |
|
252 | .hg/store/meta/dir1/00manifest.i | |
253 | .hg/store/meta/dir1/dir1 |
|
253 | .hg/store/meta/dir1/dir1 | |
254 | .hg/store/meta/dir1/dir1/00manifest.i |
|
254 | .hg/store/meta/dir1/dir1/00manifest.i | |
255 | .hg/store/meta/dir1/dir2 |
|
255 | .hg/store/meta/dir1/dir2 | |
256 | .hg/store/meta/dir1/dir2/00manifest.i |
|
256 | .hg/store/meta/dir1/dir2/00manifest.i | |
257 | .hg/store/meta/dir2 |
|
257 | .hg/store/meta/dir2 | |
258 | .hg/store/meta/dir2/00manifest.i |
|
258 | .hg/store/meta/dir2/00manifest.i | |
259 |
|
259 | |||
260 | Merge of two trees |
|
260 | Merge of two trees | |
261 |
|
261 | |||
262 | $ hg co 2 |
|
262 | $ hg co 2 | |
263 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
263 | 6 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
264 | $ hg merge 1 |
|
264 | $ hg merge 1 | |
265 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
265 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
266 | (branch merge, don't forget to commit) |
|
266 | (branch merge, don't forget to commit) | |
267 | $ hg ci -m 'merge of flat manifests to new tree manifest' |
|
267 | $ hg ci -m 'merge of flat manifests to new tree manifest' | |
268 | created new head |
|
268 | created new head | |
269 | $ hg diff -r 3 |
|
269 | $ hg diff -r 3 | |
270 |
|
270 | |||
271 | Parent of tree root manifest should be flat manifest, and two for merge |
|
271 | Parent of tree root manifest should be flat manifest, and two for merge | |
272 |
|
272 | |||
273 | $ hg debugindex -m |
|
273 | $ hg debugindex -m | |
274 | rev offset length delta linkrev nodeid p1 p2 |
|
274 | rev offset length delta linkrev nodeid p1 p2 | |
275 | 0 0 80 -1 0 40536115ed9e 000000000000 000000000000 |
|
275 | 0 0 80 -1 0 40536115ed9e 000000000000 000000000000 | |
276 | 1 80 83 0 1 f3376063c255 40536115ed9e 000000000000 |
|
276 | 1 80 83 0 1 f3376063c255 40536115ed9e 000000000000 | |
277 | 2 163 89 0 2 5d9b9da231a2 40536115ed9e 000000000000 |
|
277 | 2 163 89 0 2 5d9b9da231a2 40536115ed9e 000000000000 | |
278 | 3 252 83 2 3 d17d663cbd8a 5d9b9da231a2 f3376063c255 |
|
278 | 3 252 83 2 3 d17d663cbd8a 5d9b9da231a2 f3376063c255 | |
279 | 4 335 124 1 4 51e32a8c60ee f3376063c255 000000000000 |
|
279 | 4 335 124 1 4 51e32a8c60ee f3376063c255 000000000000 | |
280 | 5 459 126 2 5 cc5baa78b230 5d9b9da231a2 f3376063c255 |
|
280 | 5 459 126 2 5 cc5baa78b230 5d9b9da231a2 f3376063c255 | |
281 |
|
281 | |||
282 |
|
282 | |||
283 | Status across flat/tree boundary should work |
|
283 | Status across flat/tree boundary should work | |
284 |
|
284 | |||
285 | $ hg status --rev '.^' --rev . |
|
285 | $ hg status --rev '.^' --rev . | |
286 | M a |
|
286 | M a | |
287 | M dir1/a |
|
287 | M dir1/a | |
288 | M dir1/dir1/a |
|
288 | M dir1/dir1/a | |
289 |
|
289 | |||
290 |
|
290 | |||
291 | Turning off treemanifest config has no effect |
|
291 | Turning off treemanifest config has no effect | |
292 |
|
292 | |||
293 | $ hg debugindex --dir dir1 |
|
293 | $ hg debugindex --dir dir1 | |
294 | rev offset length delta linkrev nodeid p1 p2 |
|
294 | rev offset length delta linkrev nodeid p1 p2 | |
295 | 0 0 127 -1 4 064927a0648a 000000000000 000000000000 |
|
295 | 0 0 127 -1 4 064927a0648a 000000000000 000000000000 | |
296 | 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 |
|
296 | 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 | |
297 | $ echo 2 > dir1/a |
|
297 | $ echo 2 > dir1/a | |
298 | $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a' |
|
298 | $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a' | |
299 | $ hg debugindex --dir dir1 |
|
299 | $ hg debugindex --dir dir1 | |
300 | rev offset length delta linkrev nodeid p1 p2 |
|
300 | rev offset length delta linkrev nodeid p1 p2 | |
301 | 0 0 127 -1 4 064927a0648a 000000000000 000000000000 |
|
301 | 0 0 127 -1 4 064927a0648a 000000000000 000000000000 | |
302 | 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 |
|
302 | 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 | |
303 | 2 238 55 1 6 5b16163a30c6 25ecb8cb8618 000000000000 |
|
303 | 2 238 55 1 6 5b16163a30c6 25ecb8cb8618 000000000000 | |
304 |
|
304 | |||
305 | Stripping and recovering changes should work |
|
305 | Stripping and recovering changes should work | |
306 |
|
306 | |||
307 | $ hg st --change tip |
|
307 | $ hg st --change tip | |
308 | M dir1/a |
|
308 | M dir1/a | |
309 | $ hg --config extensions.strip= strip tip |
|
309 | $ hg --config extensions.strip= strip tip | |
310 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
310 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
311 | saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg (glob) |
|
311 | saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg (glob) | |
|
312 | $ hg debugindex --dir dir1 | |||
|
313 | rev offset length delta linkrev nodeid p1 p2 | |||
|
314 | 0 0 127 -1 4 064927a0648a 000000000000 000000000000 | |||
|
315 | 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 | |||
312 | $ hg unbundle -q .hg/strip-backup/* |
|
316 | $ hg unbundle -q .hg/strip-backup/* | |
|
317 | $ hg debugindex --dir dir1 | |||
|
318 | rev offset length delta linkrev nodeid p1 p2 | |||
|
319 | 0 0 127 -1 4 064927a0648a 000000000000 000000000000 | |||
|
320 | 1 127 111 0 5 25ecb8cb8618 000000000000 000000000000 | |||
|
321 | 2 238 55 1 6 5b16163a30c6 25ecb8cb8618 000000000000 | |||
313 | $ hg st --change tip |
|
322 | $ hg st --change tip | |
314 | M dir1/a |
|
323 | M dir1/a | |
315 |
|
324 | |||
316 | Shelving and unshelving should work |
|
325 | Shelving and unshelving should work | |
317 |
|
326 | |||
318 | $ echo foo >> dir1/a |
|
327 | $ echo foo >> dir1/a | |
319 | $ hg --config extensions.shelve= shelve |
|
328 | $ hg --config extensions.shelve= shelve | |
320 | shelved as default |
|
329 | shelved as default | |
321 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
330 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
322 | $ hg --config extensions.shelve= unshelve |
|
331 | $ hg --config extensions.shelve= unshelve | |
323 | unshelving change 'default' |
|
332 | unshelving change 'default' | |
324 | $ hg diff --nodates |
|
333 | $ hg diff --nodates | |
325 | diff -r 708a273da119 dir1/a |
|
334 | diff -r 708a273da119 dir1/a | |
326 | --- a/dir1/a |
|
335 | --- a/dir1/a | |
327 | +++ b/dir1/a |
|
336 | +++ b/dir1/a | |
328 | @@ -1,1 +1,2 @@ |
|
337 | @@ -1,1 +1,2 @@ | |
329 | 1 |
|
338 | 1 | |
330 | +foo |
|
339 | +foo | |
331 |
|
340 | |||
332 | Pushing from treemanifest repo to an empty repo makes that a treemanifest repo |
|
341 | Pushing from treemanifest repo to an empty repo makes that a treemanifest repo | |
333 |
|
342 | |||
334 | $ cd .. |
|
343 | $ cd .. | |
335 | $ hg init empty-repo |
|
344 | $ hg init empty-repo | |
336 | $ cat << EOF >> empty-repo/.hg/hgrc |
|
345 | $ cat << EOF >> empty-repo/.hg/hgrc | |
337 | > [experimental] |
|
346 | > [experimental] | |
338 | > changegroup3=yes |
|
347 | > changegroup3=yes | |
339 | > EOF |
|
348 | > EOF | |
340 | $ grep treemanifest empty-repo/.hg/requires |
|
349 | $ grep treemanifest empty-repo/.hg/requires | |
341 | [1] |
|
350 | [1] | |
342 | $ hg push -R repo -r 0 empty-repo |
|
351 | $ hg push -R repo -r 0 empty-repo | |
343 | pushing to empty-repo |
|
352 | pushing to empty-repo | |
344 | searching for changes |
|
353 | searching for changes | |
345 | adding changesets |
|
354 | adding changesets | |
346 | adding manifests |
|
355 | adding manifests | |
347 | adding file changes |
|
356 | adding file changes | |
348 | added 1 changesets with 2 changes to 2 files |
|
357 | added 1 changesets with 2 changes to 2 files | |
349 | $ grep treemanifest empty-repo/.hg/requires |
|
358 | $ grep treemanifest empty-repo/.hg/requires | |
350 | treemanifest |
|
359 | treemanifest | |
351 |
|
360 | |||
352 | Pushing to an empty repo works |
|
361 | Pushing to an empty repo works | |
353 |
|
362 | |||
354 | $ hg --config experimental.treemanifest=1 init clone |
|
363 | $ hg --config experimental.treemanifest=1 init clone | |
355 | $ grep treemanifest clone/.hg/requires |
|
364 | $ grep treemanifest clone/.hg/requires | |
356 | treemanifest |
|
365 | treemanifest | |
357 | $ hg push -R repo clone |
|
366 | $ hg push -R repo clone | |
358 | pushing to clone |
|
367 | pushing to clone | |
359 | searching for changes |
|
368 | searching for changes | |
360 | adding changesets |
|
369 | adding changesets | |
361 | adding manifests |
|
370 | adding manifests | |
362 | adding file changes |
|
371 | adding file changes | |
363 | added 11 changesets with 15 changes to 10 files (+3 heads) |
|
372 | added 11 changesets with 15 changes to 10 files (+3 heads) | |
364 | $ grep treemanifest clone/.hg/requires |
|
373 | $ grep treemanifest clone/.hg/requires | |
365 | treemanifest |
|
374 | treemanifest | |
366 | $ hg -R clone verify |
|
375 | $ hg -R clone verify | |
367 | checking changesets |
|
376 | checking changesets | |
368 | checking manifests |
|
377 | checking manifests | |
369 | checking directory manifests |
|
378 | checking directory manifests | |
370 | crosschecking files in changesets and manifests |
|
379 | crosschecking files in changesets and manifests | |
371 | checking files |
|
380 | checking files | |
372 | 10 files, 11 changesets, 15 total revisions |
|
381 | 10 files, 11 changesets, 15 total revisions | |
373 |
|
382 | |||
374 | Create deeper repo with tree manifests. |
|
383 | Create deeper repo with tree manifests. | |
375 |
|
384 | |||
376 | $ hg --config experimental.treemanifest=True init deeprepo |
|
385 | $ hg --config experimental.treemanifest=True init deeprepo | |
377 | $ cd deeprepo |
|
386 | $ cd deeprepo | |
378 |
|
387 | |||
379 | $ mkdir .A |
|
388 | $ mkdir .A | |
380 | $ mkdir b |
|
389 | $ mkdir b | |
381 | $ mkdir b/bar |
|
390 | $ mkdir b/bar | |
382 | $ mkdir b/bar/orange |
|
391 | $ mkdir b/bar/orange | |
383 | $ mkdir b/bar/orange/fly |
|
392 | $ mkdir b/bar/orange/fly | |
384 | $ mkdir b/foo |
|
393 | $ mkdir b/foo | |
385 | $ mkdir b/foo/apple |
|
394 | $ mkdir b/foo/apple | |
386 | $ mkdir b/foo/apple/bees |
|
395 | $ mkdir b/foo/apple/bees | |
387 |
|
396 | |||
388 | $ touch .A/one.txt |
|
397 | $ touch .A/one.txt | |
389 | $ touch .A/two.txt |
|
398 | $ touch .A/two.txt | |
390 | $ touch b/bar/fruits.txt |
|
399 | $ touch b/bar/fruits.txt | |
391 | $ touch b/bar/orange/fly/gnat.py |
|
400 | $ touch b/bar/orange/fly/gnat.py | |
392 | $ touch b/bar/orange/fly/housefly.txt |
|
401 | $ touch b/bar/orange/fly/housefly.txt | |
393 | $ touch b/foo/apple/bees/flower.py |
|
402 | $ touch b/foo/apple/bees/flower.py | |
394 | $ touch c.txt |
|
403 | $ touch c.txt | |
395 | $ touch d.py |
|
404 | $ touch d.py | |
396 |
|
405 | |||
397 | $ hg ci -Aqm 'initial' |
|
406 | $ hg ci -Aqm 'initial' | |
398 |
|
407 | |||
399 | We'll see that visitdir works by removing some treemanifest revlogs and running |
|
408 | We'll see that visitdir works by removing some treemanifest revlogs and running | |
400 | the files command with various parameters. |
|
409 | the files command with various parameters. | |
401 |
|
410 | |||
402 | Test files from the root. |
|
411 | Test files from the root. | |
403 |
|
412 | |||
404 | $ hg files -r . |
|
413 | $ hg files -r . | |
405 | .A/one.txt (glob) |
|
414 | .A/one.txt (glob) | |
406 | .A/two.txt (glob) |
|
415 | .A/two.txt (glob) | |
407 | b/bar/fruits.txt (glob) |
|
416 | b/bar/fruits.txt (glob) | |
408 | b/bar/orange/fly/gnat.py (glob) |
|
417 | b/bar/orange/fly/gnat.py (glob) | |
409 | b/bar/orange/fly/housefly.txt (glob) |
|
418 | b/bar/orange/fly/housefly.txt (glob) | |
410 | b/foo/apple/bees/flower.py (glob) |
|
419 | b/foo/apple/bees/flower.py (glob) | |
411 | c.txt |
|
420 | c.txt | |
412 | d.py |
|
421 | d.py | |
413 |
|
422 | |||
414 | Excludes with a glob should not exclude everything from the glob's root |
|
423 | Excludes with a glob should not exclude everything from the glob's root | |
415 |
|
424 | |||
416 | $ hg files -r . -X 'b/fo?' b |
|
425 | $ hg files -r . -X 'b/fo?' b | |
417 | b/bar/fruits.txt (glob) |
|
426 | b/bar/fruits.txt (glob) | |
418 | b/bar/orange/fly/gnat.py (glob) |
|
427 | b/bar/orange/fly/gnat.py (glob) | |
419 | b/bar/orange/fly/housefly.txt (glob) |
|
428 | b/bar/orange/fly/housefly.txt (glob) | |
420 | $ cp -r .hg/store .hg/store-copy |
|
429 | $ cp -r .hg/store .hg/store-copy | |
421 |
|
430 | |||
422 | Test files for a subdirectory. |
|
431 | Test files for a subdirectory. | |
423 |
|
432 | |||
424 | $ rm -r .hg/store/meta/~2e_a |
|
433 | $ rm -r .hg/store/meta/~2e_a | |
425 | $ hg files -r . b |
|
434 | $ hg files -r . b | |
426 | b/bar/fruits.txt (glob) |
|
435 | b/bar/fruits.txt (glob) | |
427 | b/bar/orange/fly/gnat.py (glob) |
|
436 | b/bar/orange/fly/gnat.py (glob) | |
428 | b/bar/orange/fly/housefly.txt (glob) |
|
437 | b/bar/orange/fly/housefly.txt (glob) | |
429 | b/foo/apple/bees/flower.py (glob) |
|
438 | b/foo/apple/bees/flower.py (glob) | |
430 | $ cp -r .hg/store-copy/. .hg/store |
|
439 | $ cp -r .hg/store-copy/. .hg/store | |
431 |
|
440 | |||
432 | Test files with just includes and excludes. |
|
441 | Test files with just includes and excludes. | |
433 |
|
442 | |||
434 | $ rm -r .hg/store/meta/~2e_a |
|
443 | $ rm -r .hg/store/meta/~2e_a | |
435 | $ rm -r .hg/store/meta/b/bar/orange/fly |
|
444 | $ rm -r .hg/store/meta/b/bar/orange/fly | |
436 | $ rm -r .hg/store/meta/b/foo/apple/bees |
|
445 | $ rm -r .hg/store/meta/b/foo/apple/bees | |
437 | $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees |
|
446 | $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees | |
438 | b/bar/fruits.txt (glob) |
|
447 | b/bar/fruits.txt (glob) | |
439 | $ cp -r .hg/store-copy/. .hg/store |
|
448 | $ cp -r .hg/store-copy/. .hg/store | |
440 |
|
449 | |||
441 | Test files for a subdirectory, excluding a directory within it. |
|
450 | Test files for a subdirectory, excluding a directory within it. | |
442 |
|
451 | |||
443 | $ rm -r .hg/store/meta/~2e_a |
|
452 | $ rm -r .hg/store/meta/~2e_a | |
444 | $ rm -r .hg/store/meta/b/foo |
|
453 | $ rm -r .hg/store/meta/b/foo | |
445 | $ hg files -r . -X path:b/foo b |
|
454 | $ hg files -r . -X path:b/foo b | |
446 | b/bar/fruits.txt (glob) |
|
455 | b/bar/fruits.txt (glob) | |
447 | b/bar/orange/fly/gnat.py (glob) |
|
456 | b/bar/orange/fly/gnat.py (glob) | |
448 | b/bar/orange/fly/housefly.txt (glob) |
|
457 | b/bar/orange/fly/housefly.txt (glob) | |
449 | $ cp -r .hg/store-copy/. .hg/store |
|
458 | $ cp -r .hg/store-copy/. .hg/store | |
450 |
|
459 | |||
451 | Test files for a sub directory, including only a directory within it, and |
|
460 | Test files for a sub directory, including only a directory within it, and | |
452 | including an unrelated directory. |
|
461 | including an unrelated directory. | |
453 |
|
462 | |||
454 | $ rm -r .hg/store/meta/~2e_a |
|
463 | $ rm -r .hg/store/meta/~2e_a | |
455 | $ rm -r .hg/store/meta/b/foo |
|
464 | $ rm -r .hg/store/meta/b/foo | |
456 | $ hg files -r . -I path:b/bar/orange -I path:a b |
|
465 | $ hg files -r . -I path:b/bar/orange -I path:a b | |
457 | b/bar/orange/fly/gnat.py (glob) |
|
466 | b/bar/orange/fly/gnat.py (glob) | |
458 | b/bar/orange/fly/housefly.txt (glob) |
|
467 | b/bar/orange/fly/housefly.txt (glob) | |
459 | $ cp -r .hg/store-copy/. .hg/store |
|
468 | $ cp -r .hg/store-copy/. .hg/store | |
460 |
|
469 | |||
461 | Test files for a pattern, including a directory, and excluding a directory |
|
470 | Test files for a pattern, including a directory, and excluding a directory | |
462 | within that. |
|
471 | within that. | |
463 |
|
472 | |||
464 | $ rm -r .hg/store/meta/~2e_a |
|
473 | $ rm -r .hg/store/meta/~2e_a | |
465 | $ rm -r .hg/store/meta/b/foo |
|
474 | $ rm -r .hg/store/meta/b/foo | |
466 | $ rm -r .hg/store/meta/b/bar/orange |
|
475 | $ rm -r .hg/store/meta/b/bar/orange | |
467 | $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange |
|
476 | $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange | |
468 | b/bar/fruits.txt (glob) |
|
477 | b/bar/fruits.txt (glob) | |
469 | $ cp -r .hg/store-copy/. .hg/store |
|
478 | $ cp -r .hg/store-copy/. .hg/store | |
470 |
|
479 | |||
471 | Add some more changes to the deep repo |
|
480 | Add some more changes to the deep repo | |
472 | $ echo narf >> b/bar/fruits.txt |
|
481 | $ echo narf >> b/bar/fruits.txt | |
473 | $ hg ci -m narf |
|
482 | $ hg ci -m narf | |
474 | $ echo troz >> b/bar/orange/fly/gnat.py |
|
483 | $ echo troz >> b/bar/orange/fly/gnat.py | |
475 | $ hg ci -m troz |
|
484 | $ hg ci -m troz | |
476 |
|
485 | |||
477 | Verify works |
|
486 | Verify works | |
478 | $ hg verify |
|
487 | $ hg verify | |
479 | checking changesets |
|
488 | checking changesets | |
480 | checking manifests |
|
489 | checking manifests | |
481 | checking directory manifests |
|
490 | checking directory manifests | |
482 | crosschecking files in changesets and manifests |
|
491 | crosschecking files in changesets and manifests | |
483 | checking files |
|
492 | checking files | |
484 | 8 files, 3 changesets, 10 total revisions |
|
493 | 8 files, 3 changesets, 10 total revisions | |
485 |
|
494 | |||
486 | Dirlogs are included in fncache |
|
495 | Dirlogs are included in fncache | |
487 | $ grep meta/.A/00manifest.i .hg/store/fncache |
|
496 | $ grep meta/.A/00manifest.i .hg/store/fncache | |
488 | meta/.A/00manifest.i |
|
497 | meta/.A/00manifest.i | |
489 |
|
498 | |||
490 | Rebuilt fncache includes dirlogs |
|
499 | Rebuilt fncache includes dirlogs | |
491 | $ rm .hg/store/fncache |
|
500 | $ rm .hg/store/fncache | |
492 | $ hg debugrebuildfncache |
|
501 | $ hg debugrebuildfncache | |
493 | adding data/.A/one.txt.i |
|
502 | adding data/.A/one.txt.i | |
494 | adding data/.A/two.txt.i |
|
503 | adding data/.A/two.txt.i | |
495 | adding data/b/bar/fruits.txt.i |
|
504 | adding data/b/bar/fruits.txt.i | |
496 | adding data/b/bar/orange/fly/gnat.py.i |
|
505 | adding data/b/bar/orange/fly/gnat.py.i | |
497 | adding data/b/bar/orange/fly/housefly.txt.i |
|
506 | adding data/b/bar/orange/fly/housefly.txt.i | |
498 | adding data/b/foo/apple/bees/flower.py.i |
|
507 | adding data/b/foo/apple/bees/flower.py.i | |
499 | adding data/c.txt.i |
|
508 | adding data/c.txt.i | |
500 | adding data/d.py.i |
|
509 | adding data/d.py.i | |
501 | adding meta/.A/00manifest.i |
|
510 | adding meta/.A/00manifest.i | |
502 | adding meta/b/00manifest.i |
|
511 | adding meta/b/00manifest.i | |
503 | adding meta/b/bar/00manifest.i |
|
512 | adding meta/b/bar/00manifest.i | |
504 | adding meta/b/bar/orange/00manifest.i |
|
513 | adding meta/b/bar/orange/00manifest.i | |
505 | adding meta/b/bar/orange/fly/00manifest.i |
|
514 | adding meta/b/bar/orange/fly/00manifest.i | |
506 | adding meta/b/foo/00manifest.i |
|
515 | adding meta/b/foo/00manifest.i | |
507 | adding meta/b/foo/apple/00manifest.i |
|
516 | adding meta/b/foo/apple/00manifest.i | |
508 | adding meta/b/foo/apple/bees/00manifest.i |
|
517 | adding meta/b/foo/apple/bees/00manifest.i | |
509 | 16 items added, 0 removed from fncache |
|
518 | 16 items added, 0 removed from fncache | |
510 |
|
519 | |||
511 | Finish first server |
|
520 | Finish first server | |
512 | $ killdaemons.py |
|
521 | $ killdaemons.py | |
513 |
|
522 | |||
514 | Back up the recently added revlogs |
|
523 | Back up the recently added revlogs | |
515 | $ cp -r .hg/store .hg/store-newcopy |
|
524 | $ cp -r .hg/store .hg/store-newcopy | |
516 |
|
525 | |||
517 | Verify reports missing dirlog |
|
526 | Verify reports missing dirlog | |
518 | $ rm .hg/store/meta/b/00manifest.* |
|
527 | $ rm .hg/store/meta/b/00manifest.* | |
519 | $ hg verify |
|
528 | $ hg verify | |
520 | checking changesets |
|
529 | checking changesets | |
521 | checking manifests |
|
530 | checking manifests | |
522 | checking directory manifests |
|
531 | checking directory manifests | |
523 | 0: empty or missing b/ |
|
532 | 0: empty or missing b/ | |
524 | b/@0: parent-directory manifest refers to unknown revision 67688a370455 |
|
533 | b/@0: parent-directory manifest refers to unknown revision 67688a370455 | |
525 | b/@1: parent-directory manifest refers to unknown revision f38e85d334c5 |
|
534 | b/@1: parent-directory manifest refers to unknown revision f38e85d334c5 | |
526 | b/@2: parent-directory manifest refers to unknown revision 99c9792fd4b0 |
|
535 | b/@2: parent-directory manifest refers to unknown revision 99c9792fd4b0 | |
527 | warning: orphan revlog 'meta/b/bar/00manifest.i' |
|
536 | warning: orphan revlog 'meta/b/bar/00manifest.i' | |
528 | warning: orphan revlog 'meta/b/bar/orange/00manifest.i' |
|
537 | warning: orphan revlog 'meta/b/bar/orange/00manifest.i' | |
529 | warning: orphan revlog 'meta/b/bar/orange/fly/00manifest.i' |
|
538 | warning: orphan revlog 'meta/b/bar/orange/fly/00manifest.i' | |
530 | warning: orphan revlog 'meta/b/foo/00manifest.i' |
|
539 | warning: orphan revlog 'meta/b/foo/00manifest.i' | |
531 | warning: orphan revlog 'meta/b/foo/apple/00manifest.i' |
|
540 | warning: orphan revlog 'meta/b/foo/apple/00manifest.i' | |
532 | warning: orphan revlog 'meta/b/foo/apple/bees/00manifest.i' |
|
541 | warning: orphan revlog 'meta/b/foo/apple/bees/00manifest.i' | |
533 | crosschecking files in changesets and manifests |
|
542 | crosschecking files in changesets and manifests | |
534 | b/bar/fruits.txt@0: in changeset but not in manifest |
|
543 | b/bar/fruits.txt@0: in changeset but not in manifest | |
535 | b/bar/orange/fly/gnat.py@0: in changeset but not in manifest |
|
544 | b/bar/orange/fly/gnat.py@0: in changeset but not in manifest | |
536 | b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest |
|
545 | b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest | |
537 | b/foo/apple/bees/flower.py@0: in changeset but not in manifest |
|
546 | b/foo/apple/bees/flower.py@0: in changeset but not in manifest | |
538 | checking files |
|
547 | checking files | |
539 | 8 files, 3 changesets, 10 total revisions |
|
548 | 8 files, 3 changesets, 10 total revisions | |
540 | 6 warnings encountered! |
|
549 | 6 warnings encountered! | |
541 | 8 integrity errors encountered! |
|
550 | 8 integrity errors encountered! | |
542 | (first damaged changeset appears to be 0) |
|
551 | (first damaged changeset appears to be 0) | |
543 | [1] |
|
552 | [1] | |
544 | $ cp -r .hg/store-newcopy/. .hg/store |
|
553 | $ cp -r .hg/store-newcopy/. .hg/store | |
545 |
|
554 | |||
546 | Verify reports missing dirlog entry |
|
555 | Verify reports missing dirlog entry | |
547 | $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/ |
|
556 | $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/ | |
548 | $ hg verify |
|
557 | $ hg verify | |
549 | checking changesets |
|
558 | checking changesets | |
550 | checking manifests |
|
559 | checking manifests | |
551 | checking directory manifests |
|
560 | checking directory manifests | |
552 | b/@1: parent-directory manifest refers to unknown revision f38e85d334c5 |
|
561 | b/@1: parent-directory manifest refers to unknown revision f38e85d334c5 | |
553 | b/@2: parent-directory manifest refers to unknown revision 99c9792fd4b0 |
|
562 | b/@2: parent-directory manifest refers to unknown revision 99c9792fd4b0 | |
554 | b/bar/@?: rev 1 points to unexpected changeset 1 |
|
563 | b/bar/@?: rev 1 points to unexpected changeset 1 | |
555 | b/bar/@?: 5e03c4ee5e4a not in parent-directory manifest |
|
564 | b/bar/@?: 5e03c4ee5e4a not in parent-directory manifest | |
556 | b/bar/@?: rev 2 points to unexpected changeset 2 |
|
565 | b/bar/@?: rev 2 points to unexpected changeset 2 | |
557 | b/bar/@?: 1b16940d66d6 not in parent-directory manifest |
|
566 | b/bar/@?: 1b16940d66d6 not in parent-directory manifest | |
558 | b/bar/orange/@?: rev 1 points to unexpected changeset 2 |
|
567 | b/bar/orange/@?: rev 1 points to unexpected changeset 2 | |
559 | (expected None) |
|
568 | (expected None) | |
560 | b/bar/orange/fly/@?: rev 1 points to unexpected changeset 2 |
|
569 | b/bar/orange/fly/@?: rev 1 points to unexpected changeset 2 | |
561 | (expected None) |
|
570 | (expected None) | |
562 | crosschecking files in changesets and manifests |
|
571 | crosschecking files in changesets and manifests | |
563 | checking files |
|
572 | checking files | |
564 | 8 files, 3 changesets, 10 total revisions |
|
573 | 8 files, 3 changesets, 10 total revisions | |
565 | 2 warnings encountered! |
|
574 | 2 warnings encountered! | |
566 | 8 integrity errors encountered! |
|
575 | 8 integrity errors encountered! | |
567 | (first damaged changeset appears to be 1) |
|
576 | (first damaged changeset appears to be 1) | |
568 | [1] |
|
577 | [1] | |
569 | $ cp -r .hg/store-newcopy/. .hg/store |
|
578 | $ cp -r .hg/store-newcopy/. .hg/store | |
570 |
|
579 | |||
571 | Test cloning a treemanifest repo over http. |
|
580 | Test cloning a treemanifest repo over http. | |
572 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log |
|
581 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log | |
573 | $ cat hg.pid >> $DAEMON_PIDS |
|
582 | $ cat hg.pid >> $DAEMON_PIDS | |
574 | $ cd .. |
|
583 | $ cd .. | |
575 | We can clone even with the knob turned off and we'll get a treemanifest repo. |
|
584 | We can clone even with the knob turned off and we'll get a treemanifest repo. | |
576 | $ hg clone --config experimental.treemanifest=False \ |
|
585 | $ hg clone --config experimental.treemanifest=False \ | |
577 | > --config experimental.changegroup3=True \ |
|
586 | > --config experimental.changegroup3=True \ | |
578 | > http://localhost:$HGPORT deepclone |
|
587 | > http://localhost:$HGPORT deepclone | |
579 | requesting all changes |
|
588 | requesting all changes | |
580 | adding changesets |
|
589 | adding changesets | |
581 | adding manifests |
|
590 | adding manifests | |
582 | adding file changes |
|
591 | adding file changes | |
583 | added 3 changesets with 10 changes to 8 files |
|
592 | added 3 changesets with 10 changes to 8 files | |
584 | updating to branch default |
|
593 | updating to branch default | |
585 | 8 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
594 | 8 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
586 | No server errors. |
|
595 | No server errors. | |
587 | $ cat deeprepo/errors.log |
|
596 | $ cat deeprepo/errors.log | |
588 | requires got updated to include treemanifest |
|
597 | requires got updated to include treemanifest | |
589 | $ cat deepclone/.hg/requires | grep treemanifest |
|
598 | $ cat deepclone/.hg/requires | grep treemanifest | |
590 | treemanifest |
|
599 | treemanifest | |
591 | Tree manifest revlogs exist. |
|
600 | Tree manifest revlogs exist. | |
592 | $ find deepclone/.hg/store/meta | sort |
|
601 | $ find deepclone/.hg/store/meta | sort | |
593 | deepclone/.hg/store/meta |
|
602 | deepclone/.hg/store/meta | |
594 | deepclone/.hg/store/meta/b |
|
603 | deepclone/.hg/store/meta/b | |
595 | deepclone/.hg/store/meta/b/00manifest.i |
|
604 | deepclone/.hg/store/meta/b/00manifest.i | |
596 | deepclone/.hg/store/meta/b/bar |
|
605 | deepclone/.hg/store/meta/b/bar | |
597 | deepclone/.hg/store/meta/b/bar/00manifest.i |
|
606 | deepclone/.hg/store/meta/b/bar/00manifest.i | |
598 | deepclone/.hg/store/meta/b/bar/orange |
|
607 | deepclone/.hg/store/meta/b/bar/orange | |
599 | deepclone/.hg/store/meta/b/bar/orange/00manifest.i |
|
608 | deepclone/.hg/store/meta/b/bar/orange/00manifest.i | |
600 | deepclone/.hg/store/meta/b/bar/orange/fly |
|
609 | deepclone/.hg/store/meta/b/bar/orange/fly | |
601 | deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i |
|
610 | deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i | |
602 | deepclone/.hg/store/meta/b/foo |
|
611 | deepclone/.hg/store/meta/b/foo | |
603 | deepclone/.hg/store/meta/b/foo/00manifest.i |
|
612 | deepclone/.hg/store/meta/b/foo/00manifest.i | |
604 | deepclone/.hg/store/meta/b/foo/apple |
|
613 | deepclone/.hg/store/meta/b/foo/apple | |
605 | deepclone/.hg/store/meta/b/foo/apple/00manifest.i |
|
614 | deepclone/.hg/store/meta/b/foo/apple/00manifest.i | |
606 | deepclone/.hg/store/meta/b/foo/apple/bees |
|
615 | deepclone/.hg/store/meta/b/foo/apple/bees | |
607 | deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i |
|
616 | deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i | |
608 | deepclone/.hg/store/meta/~2e_a |
|
617 | deepclone/.hg/store/meta/~2e_a | |
609 | deepclone/.hg/store/meta/~2e_a/00manifest.i |
|
618 | deepclone/.hg/store/meta/~2e_a/00manifest.i | |
610 | Verify passes. |
|
619 | Verify passes. | |
611 | $ cd deepclone |
|
620 | $ cd deepclone | |
612 | $ hg verify |
|
621 | $ hg verify | |
613 | checking changesets |
|
622 | checking changesets | |
614 | checking manifests |
|
623 | checking manifests | |
615 | checking directory manifests |
|
624 | checking directory manifests | |
616 | crosschecking files in changesets and manifests |
|
625 | crosschecking files in changesets and manifests | |
617 | checking files |
|
626 | checking files | |
618 | 8 files, 3 changesets, 10 total revisions |
|
627 | 8 files, 3 changesets, 10 total revisions | |
619 | $ cd .. |
|
628 | $ cd .. | |
620 |
|
629 | |||
621 | Create clones using old repo formats to use in later tests |
|
630 | Create clones using old repo formats to use in later tests | |
622 | $ hg clone --config format.usestore=False \ |
|
631 | $ hg clone --config format.usestore=False \ | |
623 | > --config experimental.changegroup3=True \ |
|
632 | > --config experimental.changegroup3=True \ | |
624 | > http://localhost:$HGPORT deeprepo-basicstore |
|
633 | > http://localhost:$HGPORT deeprepo-basicstore | |
625 | requesting all changes |
|
634 | requesting all changes | |
626 | adding changesets |
|
635 | adding changesets | |
627 | adding manifests |
|
636 | adding manifests | |
628 | adding file changes |
|
637 | adding file changes | |
629 | added 3 changesets with 10 changes to 8 files |
|
638 | added 3 changesets with 10 changes to 8 files | |
630 | updating to branch default |
|
639 | updating to branch default | |
631 | 8 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
640 | 8 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
632 | $ cd deeprepo-basicstore |
|
641 | $ cd deeprepo-basicstore | |
633 | $ grep store .hg/requires |
|
642 | $ grep store .hg/requires | |
634 | [1] |
|
643 | [1] | |
635 | $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log |
|
644 | $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log | |
636 | $ cat hg.pid >> $DAEMON_PIDS |
|
645 | $ cat hg.pid >> $DAEMON_PIDS | |
637 | $ cd .. |
|
646 | $ cd .. | |
638 | $ hg clone --config format.usefncache=False \ |
|
647 | $ hg clone --config format.usefncache=False \ | |
639 | > --config experimental.changegroup3=True \ |
|
648 | > --config experimental.changegroup3=True \ | |
640 | > http://localhost:$HGPORT deeprepo-encodedstore |
|
649 | > http://localhost:$HGPORT deeprepo-encodedstore | |
641 | requesting all changes |
|
650 | requesting all changes | |
642 | adding changesets |
|
651 | adding changesets | |
643 | adding manifests |
|
652 | adding manifests | |
644 | adding file changes |
|
653 | adding file changes | |
645 | added 3 changesets with 10 changes to 8 files |
|
654 | added 3 changesets with 10 changes to 8 files | |
646 | updating to branch default |
|
655 | updating to branch default | |
647 | 8 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
656 | 8 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
648 | $ cd deeprepo-encodedstore |
|
657 | $ cd deeprepo-encodedstore | |
649 | $ grep fncache .hg/requires |
|
658 | $ grep fncache .hg/requires | |
650 | [1] |
|
659 | [1] | |
651 | $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log |
|
660 | $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log | |
652 | $ cat hg.pid >> $DAEMON_PIDS |
|
661 | $ cat hg.pid >> $DAEMON_PIDS | |
653 | $ cd .. |
|
662 | $ cd .. | |
654 |
|
663 | |||
655 | Local clone with basicstore |
|
664 | Local clone with basicstore | |
656 | $ hg clone -U deeprepo-basicstore local-clone-basicstore |
|
665 | $ hg clone -U deeprepo-basicstore local-clone-basicstore | |
657 | $ hg -R local-clone-basicstore verify |
|
666 | $ hg -R local-clone-basicstore verify | |
658 | checking changesets |
|
667 | checking changesets | |
659 | checking manifests |
|
668 | checking manifests | |
660 | checking directory manifests |
|
669 | checking directory manifests | |
661 | crosschecking files in changesets and manifests |
|
670 | crosschecking files in changesets and manifests | |
662 | checking files |
|
671 | checking files | |
663 | 8 files, 3 changesets, 10 total revisions |
|
672 | 8 files, 3 changesets, 10 total revisions | |
664 |
|
673 | |||
665 | Local clone with encodedstore |
|
674 | Local clone with encodedstore | |
666 | $ hg clone -U deeprepo-encodedstore local-clone-encodedstore |
|
675 | $ hg clone -U deeprepo-encodedstore local-clone-encodedstore | |
667 | $ hg -R local-clone-encodedstore verify |
|
676 | $ hg -R local-clone-encodedstore verify | |
668 | checking changesets |
|
677 | checking changesets | |
669 | checking manifests |
|
678 | checking manifests | |
670 | checking directory manifests |
|
679 | checking directory manifests | |
671 | crosschecking files in changesets and manifests |
|
680 | crosschecking files in changesets and manifests | |
672 | checking files |
|
681 | checking files | |
673 | 8 files, 3 changesets, 10 total revisions |
|
682 | 8 files, 3 changesets, 10 total revisions | |
674 |
|
683 | |||
675 | Local clone with fncachestore |
|
684 | Local clone with fncachestore | |
676 | $ hg clone -U deeprepo local-clone-fncachestore |
|
685 | $ hg clone -U deeprepo local-clone-fncachestore | |
677 | $ hg -R local-clone-fncachestore verify |
|
686 | $ hg -R local-clone-fncachestore verify | |
678 | checking changesets |
|
687 | checking changesets | |
679 | checking manifests |
|
688 | checking manifests | |
680 | checking directory manifests |
|
689 | checking directory manifests | |
681 | crosschecking files in changesets and manifests |
|
690 | crosschecking files in changesets and manifests | |
682 | checking files |
|
691 | checking files | |
683 | 8 files, 3 changesets, 10 total revisions |
|
692 | 8 files, 3 changesets, 10 total revisions | |
684 |
|
693 | |||
685 | Stream clone with basicstore |
|
694 | Stream clone with basicstore | |
686 | $ hg clone --config experimental.changegroup3=True --uncompressed -U \ |
|
695 | $ hg clone --config experimental.changegroup3=True --uncompressed -U \ | |
687 | > http://localhost:$HGPORT1 stream-clone-basicstore |
|
696 | > http://localhost:$HGPORT1 stream-clone-basicstore | |
688 | streaming all changes |
|
697 | streaming all changes | |
689 | 18 files to transfer, * of data (glob) |
|
698 | 18 files to transfer, * of data (glob) | |
690 | transferred * in * seconds (*) (glob) |
|
699 | transferred * in * seconds (*) (glob) | |
691 | searching for changes |
|
700 | searching for changes | |
692 | no changes found |
|
701 | no changes found | |
693 | $ hg -R stream-clone-basicstore verify |
|
702 | $ hg -R stream-clone-basicstore verify | |
694 | checking changesets |
|
703 | checking changesets | |
695 | checking manifests |
|
704 | checking manifests | |
696 | checking directory manifests |
|
705 | checking directory manifests | |
697 | crosschecking files in changesets and manifests |
|
706 | crosschecking files in changesets and manifests | |
698 | checking files |
|
707 | checking files | |
699 | 8 files, 3 changesets, 10 total revisions |
|
708 | 8 files, 3 changesets, 10 total revisions | |
700 |
|
709 | |||
701 | Stream clone with encodedstore |
|
710 | Stream clone with encodedstore | |
702 | $ hg clone --config experimental.changegroup3=True --uncompressed -U \ |
|
711 | $ hg clone --config experimental.changegroup3=True --uncompressed -U \ | |
703 | > http://localhost:$HGPORT2 stream-clone-encodedstore |
|
712 | > http://localhost:$HGPORT2 stream-clone-encodedstore | |
704 | streaming all changes |
|
713 | streaming all changes | |
705 | 18 files to transfer, * of data (glob) |
|
714 | 18 files to transfer, * of data (glob) | |
706 | transferred * in * seconds (*) (glob) |
|
715 | transferred * in * seconds (*) (glob) | |
707 | searching for changes |
|
716 | searching for changes | |
708 | no changes found |
|
717 | no changes found | |
709 | $ hg -R stream-clone-encodedstore verify |
|
718 | $ hg -R stream-clone-encodedstore verify | |
710 | checking changesets |
|
719 | checking changesets | |
711 | checking manifests |
|
720 | checking manifests | |
712 | checking directory manifests |
|
721 | checking directory manifests | |
713 | crosschecking files in changesets and manifests |
|
722 | crosschecking files in changesets and manifests | |
714 | checking files |
|
723 | checking files | |
715 | 8 files, 3 changesets, 10 total revisions |
|
724 | 8 files, 3 changesets, 10 total revisions | |
716 |
|
725 | |||
717 | Stream clone with fncachestore |
|
726 | Stream clone with fncachestore | |
718 | $ hg clone --config experimental.changegroup3=True --uncompressed -U \ |
|
727 | $ hg clone --config experimental.changegroup3=True --uncompressed -U \ | |
719 | > http://localhost:$HGPORT stream-clone-fncachestore |
|
728 | > http://localhost:$HGPORT stream-clone-fncachestore | |
720 | streaming all changes |
|
729 | streaming all changes | |
721 | 18 files to transfer, * of data (glob) |
|
730 | 18 files to transfer, * of data (glob) | |
722 | transferred * in * seconds (*) (glob) |
|
731 | transferred * in * seconds (*) (glob) | |
723 | searching for changes |
|
732 | searching for changes | |
724 | no changes found |
|
733 | no changes found | |
725 | $ hg -R stream-clone-fncachestore verify |
|
734 | $ hg -R stream-clone-fncachestore verify | |
726 | checking changesets |
|
735 | checking changesets | |
727 | checking manifests |
|
736 | checking manifests | |
728 | checking directory manifests |
|
737 | checking directory manifests | |
729 | crosschecking files in changesets and manifests |
|
738 | crosschecking files in changesets and manifests | |
730 | checking files |
|
739 | checking files | |
731 | 8 files, 3 changesets, 10 total revisions |
|
740 | 8 files, 3 changesets, 10 total revisions | |
732 |
|
741 | |||
733 | Packed bundle |
|
742 | Packed bundle | |
734 | $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg |
|
743 | $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg | |
735 | writing 3349 bytes for 18 files |
|
744 | writing 3349 bytes for 18 files | |
736 | bundle requirements: generaldelta, revlogv1, treemanifest |
|
745 | bundle requirements: generaldelta, revlogv1, treemanifest | |
737 | $ hg debugbundle --spec repo-packed.hg |
|
746 | $ hg debugbundle --spec repo-packed.hg | |
738 | none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Ctreemanifest |
|
747 | none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Ctreemanifest | |
739 |
|
748 | |||
740 | Bundle with changegroup2 is not supported |
|
749 | Bundle with changegroup2 is not supported | |
741 |
|
750 | |||
742 | $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle |
|
751 | $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle | |
743 | abort: repository does not support bundle version 02 |
|
752 | abort: repository does not support bundle version 02 | |
744 | [255] |
|
753 | [255] | |
745 |
|
754 | |||
746 | Pull does not include changegroup for manifest the client already has from |
|
755 | Pull does not include changegroup for manifest the client already has from | |
747 | other branch |
|
756 | other branch | |
748 |
|
757 | |||
749 | $ mkdir grafted-dir-repo |
|
758 | $ mkdir grafted-dir-repo | |
750 | $ cd grafted-dir-repo |
|
759 | $ cd grafted-dir-repo | |
751 | $ hg --config experimental.treemanifest=1 init |
|
760 | $ hg --config experimental.treemanifest=1 init | |
752 | $ mkdir dir |
|
761 | $ mkdir dir | |
753 | $ echo a > dir/file |
|
762 | $ echo a > dir/file | |
754 | $ echo a > file |
|
763 | $ echo a > file | |
755 | $ hg ci -Am initial |
|
764 | $ hg ci -Am initial | |
756 | adding dir/file |
|
765 | adding dir/file | |
757 | adding file |
|
766 | adding file | |
758 | $ echo b > dir/file |
|
767 | $ echo b > dir/file | |
759 | $ hg ci -m updated |
|
768 | $ hg ci -m updated | |
760 | $ hg co '.^' |
|
769 | $ hg co '.^' | |
761 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
770 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
762 | $ hg revert -r tip dir/ |
|
771 | $ hg revert -r tip dir/ | |
763 | reverting dir/file (glob) |
|
772 | reverting dir/file (glob) | |
764 | $ echo b > file # to make sure root manifest is sent |
|
773 | $ echo b > file # to make sure root manifest is sent | |
765 | $ hg ci -m grafted |
|
774 | $ hg ci -m grafted | |
766 | created new head |
|
775 | created new head | |
767 | $ cd .. |
|
776 | $ cd .. | |
768 |
|
777 | |||
769 | $ hg --config experimental.treemanifest=1 clone --pull -r 1 \ |
|
778 | $ hg --config experimental.treemanifest=1 clone --pull -r 1 \ | |
770 | > grafted-dir-repo grafted-dir-repo-clone |
|
779 | > grafted-dir-repo grafted-dir-repo-clone | |
771 | adding changesets |
|
780 | adding changesets | |
772 | adding manifests |
|
781 | adding manifests | |
773 | adding file changes |
|
782 | adding file changes | |
774 | added 2 changesets with 3 changes to 2 files |
|
783 | added 2 changesets with 3 changes to 2 files | |
775 | updating to branch default |
|
784 | updating to branch default | |
776 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
785 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
777 | $ cd grafted-dir-repo-clone |
|
786 | $ cd grafted-dir-repo-clone | |
778 | $ hg pull -r 2 |
|
787 | $ hg pull -r 2 | |
779 | pulling from $TESTTMP/grafted-dir-repo (glob) |
|
788 | pulling from $TESTTMP/grafted-dir-repo (glob) | |
780 | searching for changes |
|
789 | searching for changes | |
781 | adding changesets |
|
790 | adding changesets | |
782 | adding manifests |
|
791 | adding manifests | |
783 | adding file changes |
|
792 | adding file changes | |
784 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
793 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
785 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
794 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
786 |
|
795 |
General Comments 0
You need to be logged in to leave comments.
Login now