Show More
@@ -1,673 +1,675 b'' | |||||
1 | # simplestorerepo.py - Extension that swaps in alternate repository storage. |
|
1 | # simplestorerepo.py - Extension that swaps in alternate repository storage. | |
2 | # |
|
2 | # | |
3 | # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com> |
|
3 | # Copyright 2018 Gregory Szorc <gregory.szorc@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 | # To use this with the test suite: |
|
8 | # To use this with the test suite: | |
9 | # |
|
9 | # | |
10 | # $ HGREPOFEATURES="simplestore" ./run-tests.py \ |
|
10 | # $ HGREPOFEATURES="simplestore" ./run-tests.py \ | |
11 | # --extra-config-opt extensions.simplestore=`pwd`/simplestorerepo.py |
|
11 | # --extra-config-opt extensions.simplestore=`pwd`/simplestorerepo.py | |
12 |
|
12 | |||
13 | from __future__ import absolute_import |
|
13 | from __future__ import absolute_import | |
14 |
|
14 | |||
15 | import stat |
|
15 | import stat | |
16 |
|
16 | |||
17 | from mercurial.i18n import _ |
|
17 | from mercurial.i18n import _ | |
18 | from mercurial.node import ( |
|
18 | from mercurial.node import ( | |
19 | bin, |
|
19 | bin, | |
20 | hex, |
|
20 | hex, | |
21 | nullid, |
|
21 | nullid, | |
22 | nullrev, |
|
22 | nullrev, | |
23 | ) |
|
23 | ) | |
24 | from mercurial.thirdparty import ( |
|
24 | from mercurial.thirdparty import ( | |
25 | cbor, |
|
25 | cbor, | |
26 | ) |
|
26 | ) | |
27 | from mercurial import ( |
|
27 | from mercurial import ( | |
28 | ancestor, |
|
28 | ancestor, | |
29 | bundlerepo, |
|
29 | bundlerepo, | |
30 | error, |
|
30 | error, | |
31 | extensions, |
|
31 | extensions, | |
32 | filelog, |
|
32 | filelog, | |
33 | localrepo, |
|
33 | localrepo, | |
34 | mdiff, |
|
34 | mdiff, | |
35 | pycompat, |
|
35 | pycompat, | |
36 | revlog, |
|
36 | revlog, | |
37 | store, |
|
37 | store, | |
38 | verify, |
|
38 | verify, | |
39 | ) |
|
39 | ) | |
40 |
|
40 | |||
41 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
|
41 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | |
42 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
|
42 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | |
43 | # be specifying the version(s) of Mercurial they are tested with, or |
|
43 | # be specifying the version(s) of Mercurial they are tested with, or | |
44 | # leave the attribute unspecified. |
|
44 | # leave the attribute unspecified. | |
45 | testedwith = 'ships-with-hg-core' |
|
45 | testedwith = 'ships-with-hg-core' | |
46 |
|
46 | |||
47 | REQUIREMENT = 'testonly-simplestore' |
|
47 | REQUIREMENT = 'testonly-simplestore' | |
48 |
|
48 | |||
49 | def validatenode(node): |
|
49 | def validatenode(node): | |
50 | if isinstance(node, int): |
|
50 | if isinstance(node, int): | |
51 | raise ValueError('expected node; got int') |
|
51 | raise ValueError('expected node; got int') | |
52 |
|
52 | |||
53 | if len(node) != 20: |
|
53 | if len(node) != 20: | |
54 | raise ValueError('expected 20 byte node') |
|
54 | raise ValueError('expected 20 byte node') | |
55 |
|
55 | |||
56 | def validaterev(rev): |
|
56 | def validaterev(rev): | |
57 | if not isinstance(rev, int): |
|
57 | if not isinstance(rev, int): | |
58 | raise ValueError('expected int') |
|
58 | raise ValueError('expected int') | |
59 |
|
59 | |||
60 | class filestorage(object): |
|
60 | class filestorage(object): | |
61 | """Implements storage for a tracked path. |
|
61 | """Implements storage for a tracked path. | |
62 |
|
62 | |||
63 | Data is stored in the VFS in a directory corresponding to the tracked |
|
63 | Data is stored in the VFS in a directory corresponding to the tracked | |
64 | path. |
|
64 | path. | |
65 |
|
65 | |||
66 | Index data is stored in an ``index`` file using CBOR. |
|
66 | Index data is stored in an ``index`` file using CBOR. | |
67 |
|
67 | |||
68 | Fulltext data is stored in files having names of the node. |
|
68 | Fulltext data is stored in files having names of the node. | |
69 | """ |
|
69 | """ | |
70 |
|
70 | |||
71 | def __init__(self, svfs, path): |
|
71 | def __init__(self, svfs, path): | |
72 | self._svfs = svfs |
|
72 | self._svfs = svfs | |
73 | self._path = path |
|
73 | self._path = path | |
74 |
|
74 | |||
75 | self._storepath = b'/'.join([b'data', path]) |
|
75 | self._storepath = b'/'.join([b'data', path]) | |
76 | self._indexpath = b'/'.join([self._storepath, b'index']) |
|
76 | self._indexpath = b'/'.join([self._storepath, b'index']) | |
77 |
|
77 | |||
78 | indexdata = self._svfs.tryread(self._indexpath) |
|
78 | indexdata = self._svfs.tryread(self._indexpath) | |
79 | if indexdata: |
|
79 | if indexdata: | |
80 | indexdata = cbor.loads(indexdata) |
|
80 | indexdata = cbor.loads(indexdata) | |
81 |
|
81 | |||
82 | self._indexdata = indexdata or [] |
|
82 | self._indexdata = indexdata or [] | |
83 | self._indexbynode = {} |
|
83 | self._indexbynode = {} | |
84 | self._indexbyrev = {} |
|
84 | self._indexbyrev = {} | |
85 | self.index = [] |
|
85 | self.index = [] | |
86 | self._refreshindex() |
|
86 | self._refreshindex() | |
87 |
|
87 | |||
88 | # This is used by changegroup code :/ |
|
88 | # This is used by changegroup code :/ | |
89 | self._generaldelta = True |
|
89 | self._generaldelta = True | |
90 | self.storedeltachains = False |
|
90 | self.storedeltachains = False | |
91 |
|
91 | |||
92 | self.version = 1 |
|
92 | self.version = 1 | |
93 |
|
93 | |||
94 | def _refreshindex(self): |
|
94 | def _refreshindex(self): | |
95 | self._indexbynode.clear() |
|
95 | self._indexbynode.clear() | |
96 | self._indexbyrev.clear() |
|
96 | self._indexbyrev.clear() | |
97 | self.index = [] |
|
97 | self.index = [] | |
98 |
|
98 | |||
99 | for i, entry in enumerate(self._indexdata): |
|
99 | for i, entry in enumerate(self._indexdata): | |
100 | self._indexbynode[entry[b'node']] = entry |
|
100 | self._indexbynode[entry[b'node']] = entry | |
101 | self._indexbyrev[i] = entry |
|
101 | self._indexbyrev[i] = entry | |
102 |
|
102 | |||
103 | self._indexbynode[nullid] = { |
|
103 | self._indexbynode[nullid] = { | |
104 | b'node': nullid, |
|
104 | b'node': nullid, | |
105 | b'p1': nullid, |
|
105 | b'p1': nullid, | |
106 | b'p2': nullid, |
|
106 | b'p2': nullid, | |
107 | b'linkrev': nullrev, |
|
107 | b'linkrev': nullrev, | |
108 | b'flags': 0, |
|
108 | b'flags': 0, | |
109 | } |
|
109 | } | |
110 |
|
110 | |||
111 | self._indexbyrev[nullrev] = { |
|
111 | self._indexbyrev[nullrev] = { | |
112 | b'node': nullid, |
|
112 | b'node': nullid, | |
113 | b'p1': nullid, |
|
113 | b'p1': nullid, | |
114 | b'p2': nullid, |
|
114 | b'p2': nullid, | |
115 | b'linkrev': nullrev, |
|
115 | b'linkrev': nullrev, | |
116 | b'flags': 0, |
|
116 | b'flags': 0, | |
117 | } |
|
117 | } | |
118 |
|
118 | |||
119 | for i, entry in enumerate(self._indexdata): |
|
119 | for i, entry in enumerate(self._indexdata): | |
120 | p1rev, p2rev = self.parentrevs(self.rev(entry[b'node'])) |
|
120 | p1rev, p2rev = self.parentrevs(self.rev(entry[b'node'])) | |
121 |
|
121 | |||
122 | # start, length, rawsize, chainbase, linkrev, p1, p2, node |
|
122 | # start, length, rawsize, chainbase, linkrev, p1, p2, node | |
123 | self.index.append((0, 0, 0, -1, entry[b'linkrev'], p1rev, p2rev, |
|
123 | self.index.append((0, 0, 0, -1, entry[b'linkrev'], p1rev, p2rev, | |
124 | entry[b'node'])) |
|
124 | entry[b'node'])) | |
125 |
|
125 | |||
126 | self.index.append((0, 0, 0, -1, -1, -1, -1, nullid)) |
|
126 | self.index.append((0, 0, 0, -1, -1, -1, -1, nullid)) | |
127 |
|
127 | |||
128 | def __len__(self): |
|
128 | def __len__(self): | |
129 | return len(self._indexdata) |
|
129 | return len(self._indexdata) | |
130 |
|
130 | |||
131 | def __iter__(self): |
|
131 | def __iter__(self): | |
132 | return iter(range(len(self))) |
|
132 | return iter(range(len(self))) | |
133 |
|
133 | |||
134 | def revs(self, start=0, stop=None): |
|
134 | def revs(self, start=0, stop=None): | |
135 | step = 1 |
|
135 | step = 1 | |
136 | if stop is not None: |
|
136 | if stop is not None: | |
137 | if start > stop: |
|
137 | if start > stop: | |
138 | step = -1 |
|
138 | step = -1 | |
139 |
|
139 | |||
140 | stop += step |
|
140 | stop += step | |
141 | else: |
|
141 | else: | |
142 | stop = len(self) |
|
142 | stop = len(self) | |
143 |
|
143 | |||
144 | return range(start, stop, step) |
|
144 | return range(start, stop, step) | |
145 |
|
145 | |||
146 | def parents(self, node): |
|
146 | def parents(self, node): | |
147 | validatenode(node) |
|
147 | validatenode(node) | |
148 |
|
148 | |||
149 | if node not in self._indexbynode: |
|
149 | if node not in self._indexbynode: | |
150 | raise KeyError('unknown node') |
|
150 | raise KeyError('unknown node') | |
151 |
|
151 | |||
152 | entry = self._indexbynode[node] |
|
152 | entry = self._indexbynode[node] | |
153 |
|
153 | |||
154 | return entry[b'p1'], entry[b'p2'] |
|
154 | return entry[b'p1'], entry[b'p2'] | |
155 |
|
155 | |||
156 | def parentrevs(self, rev): |
|
156 | def parentrevs(self, rev): | |
157 | p1, p2 = self.parents(self._indexbyrev[rev][b'node']) |
|
157 | p1, p2 = self.parents(self._indexbyrev[rev][b'node']) | |
158 | return self.rev(p1), self.rev(p2) |
|
158 | return self.rev(p1), self.rev(p2) | |
159 |
|
159 | |||
160 | def rev(self, node): |
|
160 | def rev(self, node): | |
161 | validatenode(node) |
|
161 | validatenode(node) | |
162 |
|
162 | |||
163 | try: |
|
163 | try: | |
164 | self._indexbynode[node] |
|
164 | self._indexbynode[node] | |
165 | except KeyError: |
|
165 | except KeyError: | |
166 | raise error.LookupError(node, self._indexpath, _('no node')) |
|
166 | raise error.LookupError(node, self._indexpath, _('no node')) | |
167 |
|
167 | |||
168 | for rev, entry in self._indexbyrev.items(): |
|
168 | for rev, entry in self._indexbyrev.items(): | |
169 | if entry[b'node'] == node: |
|
169 | if entry[b'node'] == node: | |
170 | return rev |
|
170 | return rev | |
171 |
|
171 | |||
172 | raise error.ProgrammingError('this should not occur') |
|
172 | raise error.ProgrammingError('this should not occur') | |
173 |
|
173 | |||
174 | def node(self, rev): |
|
174 | def node(self, rev): | |
175 | validaterev(rev) |
|
175 | validaterev(rev) | |
176 |
|
176 | |||
177 | return self._indexbyrev[rev][b'node'] |
|
177 | return self._indexbyrev[rev][b'node'] | |
178 |
|
178 | |||
179 | def lookup(self, node): |
|
179 | def lookup(self, node): | |
180 | if isinstance(node, int): |
|
180 | if isinstance(node, int): | |
181 | return self.node(node) |
|
181 | return self.node(node) | |
182 |
|
182 | |||
183 | if len(node) == 20: |
|
183 | if len(node) == 20: | |
184 | self.rev(node) |
|
184 | self.rev(node) | |
185 | return node |
|
185 | return node | |
186 |
|
186 | |||
187 | try: |
|
187 | try: | |
188 | rev = int(node) |
|
188 | rev = int(node) | |
189 | if '%d' % rev != node: |
|
189 | if '%d' % rev != node: | |
190 | raise ValueError |
|
190 | raise ValueError | |
191 |
|
191 | |||
192 | if rev < 0: |
|
192 | if rev < 0: | |
193 | rev = len(self) + rev |
|
193 | rev = len(self) + rev | |
194 | if rev < 0 or rev >= len(self): |
|
194 | if rev < 0 or rev >= len(self): | |
195 | raise ValueError |
|
195 | raise ValueError | |
196 |
|
196 | |||
197 | return self.node(rev) |
|
197 | return self.node(rev) | |
198 | except (ValueError, OverflowError): |
|
198 | except (ValueError, OverflowError): | |
199 | pass |
|
199 | pass | |
200 |
|
200 | |||
201 | if len(node) == 40: |
|
201 | if len(node) == 40: | |
202 | try: |
|
202 | try: | |
203 | rawnode = bin(node) |
|
203 | rawnode = bin(node) | |
204 | self.rev(rawnode) |
|
204 | self.rev(rawnode) | |
205 | return rawnode |
|
205 | return rawnode | |
206 | except TypeError: |
|
206 | except TypeError: | |
207 | pass |
|
207 | pass | |
208 |
|
208 | |||
209 | raise error.LookupError(node, self._path, _('invalid lookup input')) |
|
209 | raise error.LookupError(node, self._path, _('invalid lookup input')) | |
210 |
|
210 | |||
211 | def linkrev(self, rev): |
|
211 | def linkrev(self, rev): | |
212 | validaterev(rev) |
|
212 | validaterev(rev) | |
213 |
|
213 | |||
214 | return self._indexbyrev[rev][b'linkrev'] |
|
214 | return self._indexbyrev[rev][b'linkrev'] | |
215 |
|
215 | |||
216 | def flags(self, rev): |
|
216 | def flags(self, rev): | |
217 | validaterev(rev) |
|
217 | validaterev(rev) | |
218 |
|
218 | |||
219 | return self._indexbyrev[rev][b'flags'] |
|
219 | return self._indexbyrev[rev][b'flags'] | |
220 |
|
220 | |||
221 | def deltaparent(self, rev): |
|
221 | def deltaparent(self, rev): | |
222 | validaterev(rev) |
|
222 | validaterev(rev) | |
223 |
|
223 | |||
224 | p1node = self.parents(self.node(rev))[0] |
|
224 | p1node = self.parents(self.node(rev))[0] | |
225 | return self.rev(p1node) |
|
225 | return self.rev(p1node) | |
226 |
|
226 | |||
227 | def candelta(self, baserev, rev): |
|
227 | def candelta(self, baserev, rev): | |
228 | validaterev(baserev) |
|
228 | validaterev(baserev) | |
229 | validaterev(rev) |
|
229 | validaterev(rev) | |
230 |
|
230 | |||
231 | if ((self.flags(baserev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS) |
|
231 | if ((self.flags(baserev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS) | |
232 | or (self.flags(rev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS)): |
|
232 | or (self.flags(rev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS)): | |
233 | return False |
|
233 | return False | |
234 |
|
234 | |||
235 | return True |
|
235 | return True | |
236 |
|
236 | |||
237 | def rawsize(self, rev): |
|
237 | def rawsize(self, rev): | |
238 | validaterev(rev) |
|
238 | validaterev(rev) | |
239 | node = self.node(rev) |
|
239 | node = self.node(rev) | |
240 | return len(self.revision(node, raw=True)) |
|
240 | return len(self.revision(node, raw=True)) | |
241 |
|
241 | |||
242 | def _processflags(self, text, flags, operation, raw=False): |
|
242 | def _processflags(self, text, flags, operation, raw=False): | |
243 | if flags == 0: |
|
243 | if flags == 0: | |
244 | return text, True |
|
244 | return text, True | |
245 |
|
245 | |||
246 | validatehash = True |
|
246 | validatehash = True | |
247 | # Depending on the operation (read or write), the order might be |
|
247 | # Depending on the operation (read or write), the order might be | |
248 | # reversed due to non-commutative transforms. |
|
248 | # reversed due to non-commutative transforms. | |
249 | orderedflags = revlog.REVIDX_FLAGS_ORDER |
|
249 | orderedflags = revlog.REVIDX_FLAGS_ORDER | |
250 | if operation == 'write': |
|
250 | if operation == 'write': | |
251 | orderedflags = reversed(orderedflags) |
|
251 | orderedflags = reversed(orderedflags) | |
252 |
|
252 | |||
253 | for flag in orderedflags: |
|
253 | for flag in orderedflags: | |
254 | # If a flagprocessor has been registered for a known flag, apply the |
|
254 | # If a flagprocessor has been registered for a known flag, apply the | |
255 | # related operation transform and update result tuple. |
|
255 | # related operation transform and update result tuple. | |
256 | if flag & flags: |
|
256 | if flag & flags: | |
257 | vhash = True |
|
257 | vhash = True | |
258 |
|
258 | |||
259 | if flag not in revlog._flagprocessors: |
|
259 | if flag not in revlog._flagprocessors: | |
260 | message = _("missing processor for flag '%#x'") % (flag) |
|
260 | message = _("missing processor for flag '%#x'") % (flag) | |
261 | raise revlog.RevlogError(message) |
|
261 | raise revlog.RevlogError(message) | |
262 |
|
262 | |||
263 | processor = revlog._flagprocessors[flag] |
|
263 | processor = revlog._flagprocessors[flag] | |
264 | if processor is not None: |
|
264 | if processor is not None: | |
265 | readtransform, writetransform, rawtransform = processor |
|
265 | readtransform, writetransform, rawtransform = processor | |
266 |
|
266 | |||
267 | if raw: |
|
267 | if raw: | |
268 | vhash = rawtransform(self, text) |
|
268 | vhash = rawtransform(self, text) | |
269 | elif operation == 'read': |
|
269 | elif operation == 'read': | |
270 | text, vhash = readtransform(self, text) |
|
270 | text, vhash = readtransform(self, text) | |
271 | else: # write operation |
|
271 | else: # write operation | |
272 | text, vhash = writetransform(self, text) |
|
272 | text, vhash = writetransform(self, text) | |
273 | validatehash = validatehash and vhash |
|
273 | validatehash = validatehash and vhash | |
274 |
|
274 | |||
275 | return text, validatehash |
|
275 | return text, validatehash | |
276 |
|
276 | |||
277 | def checkhash(self, text, node, p1=None, p2=None, rev=None): |
|
277 | def checkhash(self, text, node, p1=None, p2=None, rev=None): | |
278 | if p1 is None and p2 is None: |
|
278 | if p1 is None and p2 is None: | |
279 | p1, p2 = self.parents(node) |
|
279 | p1, p2 = self.parents(node) | |
280 | if node != revlog.hash(text, p1, p2): |
|
280 | if node != revlog.hash(text, p1, p2): | |
281 | raise error.RevlogError(_("integrity check failed on %s") % |
|
281 | raise error.RevlogError(_("integrity check failed on %s") % | |
282 | self._path) |
|
282 | self._path) | |
283 |
|
283 | |||
284 | def revision(self, node, raw=False): |
|
284 | def revision(self, node, raw=False): | |
285 | validatenode(node) |
|
285 | validatenode(node) | |
286 |
|
286 | |||
287 | if node == nullid: |
|
287 | if node == nullid: | |
288 | return b'' |
|
288 | return b'' | |
289 |
|
289 | |||
290 | rev = self.rev(node) |
|
290 | rev = self.rev(node) | |
291 | flags = self.flags(rev) |
|
291 | flags = self.flags(rev) | |
292 |
|
292 | |||
293 | path = b'/'.join([self._storepath, hex(node)]) |
|
293 | path = b'/'.join([self._storepath, hex(node)]) | |
294 | rawtext = self._svfs.read(path) |
|
294 | rawtext = self._svfs.read(path) | |
295 |
|
295 | |||
296 | text, validatehash = self._processflags(rawtext, flags, 'read', raw=raw) |
|
296 | text, validatehash = self._processflags(rawtext, flags, 'read', raw=raw) | |
297 | if validatehash: |
|
297 | if validatehash: | |
298 | self.checkhash(text, node, rev=rev) |
|
298 | self.checkhash(text, node, rev=rev) | |
299 |
|
299 | |||
300 | return text |
|
300 | return text | |
301 |
|
301 | |||
302 | def read(self, node): |
|
302 | def read(self, node): | |
303 | validatenode(node) |
|
303 | validatenode(node) | |
304 |
|
304 | |||
305 | revision = self.revision(node) |
|
305 | revision = self.revision(node) | |
306 |
|
306 | |||
307 | if not revision.startswith(b'\1\n'): |
|
307 | if not revision.startswith(b'\1\n'): | |
308 | return revision |
|
308 | return revision | |
309 |
|
309 | |||
310 | start = revision.index(b'\1\n', 2) |
|
310 | start = revision.index(b'\1\n', 2) | |
311 | return revision[start + 2:] |
|
311 | return revision[start + 2:] | |
312 |
|
312 | |||
313 | def renamed(self, node): |
|
313 | def renamed(self, node): | |
314 | validatenode(node) |
|
314 | validatenode(node) | |
315 |
|
315 | |||
316 | if self.parents(node)[0] != nullid: |
|
316 | if self.parents(node)[0] != nullid: | |
317 | return False |
|
317 | return False | |
318 |
|
318 | |||
319 | fulltext = self.revision(node) |
|
319 | fulltext = self.revision(node) | |
320 | m = filelog.parsemeta(fulltext)[0] |
|
320 | m = filelog.parsemeta(fulltext)[0] | |
321 |
|
321 | |||
322 | if m and 'copy' in m: |
|
322 | if m and 'copy' in m: | |
323 | return m['copy'], bin(m['copyrev']) |
|
323 | return m['copy'], bin(m['copyrev']) | |
324 |
|
324 | |||
325 | return False |
|
325 | return False | |
326 |
|
326 | |||
327 | def cmp(self, node, text): |
|
327 | def cmp(self, node, text): | |
328 | validatenode(node) |
|
328 | validatenode(node) | |
329 |
|
329 | |||
330 | t = text |
|
330 | t = text | |
331 |
|
331 | |||
332 | if text.startswith(b'\1\n'): |
|
332 | if text.startswith(b'\1\n'): | |
333 | t = b'\1\n\1\n' + text |
|
333 | t = b'\1\n\1\n' + text | |
334 |
|
334 | |||
335 | p1, p2 = self.parents(node) |
|
335 | p1, p2 = self.parents(node) | |
336 |
|
336 | |||
337 | if revlog.hash(t, p1, p2) == node: |
|
337 | if revlog.hash(t, p1, p2) == node: | |
338 | return False |
|
338 | return False | |
339 |
|
339 | |||
340 | if self.iscensored(self.rev(node)): |
|
340 | if self.iscensored(self.rev(node)): | |
341 | return text != b'' |
|
341 | return text != b'' | |
342 |
|
342 | |||
343 | if self.renamed(node): |
|
343 | if self.renamed(node): | |
344 | t2 = self.read(node) |
|
344 | t2 = self.read(node) | |
345 | return t2 != text |
|
345 | return t2 != text | |
346 |
|
346 | |||
347 | return True |
|
347 | return True | |
348 |
|
348 | |||
349 | def size(self, rev): |
|
349 | def size(self, rev): | |
350 | validaterev(rev) |
|
350 | validaterev(rev) | |
351 |
|
351 | |||
352 | node = self._indexbyrev[rev][b'node'] |
|
352 | node = self._indexbyrev[rev][b'node'] | |
353 |
|
353 | |||
354 | if self.renamed(node): |
|
354 | if self.renamed(node): | |
355 | return len(self.read(node)) |
|
355 | return len(self.read(node)) | |
356 |
|
356 | |||
357 | if self.iscensored(rev): |
|
357 | if self.iscensored(rev): | |
358 | return 0 |
|
358 | return 0 | |
359 |
|
359 | |||
360 | return len(self.revision(node)) |
|
360 | return len(self.revision(node)) | |
361 |
|
361 | |||
362 | def iscensored(self, rev): |
|
362 | def iscensored(self, rev): | |
363 | validaterev(rev) |
|
363 | validaterev(rev) | |
364 |
|
364 | |||
365 | return self.flags(rev) & revlog.REVIDX_ISCENSORED |
|
365 | return self.flags(rev) & revlog.REVIDX_ISCENSORED | |
366 |
|
366 | |||
367 | def commonancestorsheads(self, a, b): |
|
367 | def commonancestorsheads(self, a, b): | |
368 | validatenode(a) |
|
368 | validatenode(a) | |
369 | validatenode(b) |
|
369 | validatenode(b) | |
370 |
|
370 | |||
371 | a = self.rev(a) |
|
371 | a = self.rev(a) | |
372 | b = self.rev(b) |
|
372 | b = self.rev(b) | |
373 |
|
373 | |||
374 | ancestors = ancestor.commonancestorsheads(self.parentrevs, a, b) |
|
374 | ancestors = ancestor.commonancestorsheads(self.parentrevs, a, b) | |
375 | return pycompat.maplist(self.node, ancestors) |
|
375 | return pycompat.maplist(self.node, ancestors) | |
376 |
|
376 | |||
377 | def descendants(self, revs): |
|
377 | def descendants(self, revs): | |
378 | # This is a copy of revlog.descendants() |
|
378 | # This is a copy of revlog.descendants() | |
379 | first = min(revs) |
|
379 | first = min(revs) | |
380 | if first == nullrev: |
|
380 | if first == nullrev: | |
381 | for i in self: |
|
381 | for i in self: | |
382 | yield i |
|
382 | yield i | |
383 | return |
|
383 | return | |
384 |
|
384 | |||
385 | seen = set(revs) |
|
385 | seen = set(revs) | |
386 | for i in self.revs(start=first + 1): |
|
386 | for i in self.revs(start=first + 1): | |
387 | for x in self.parentrevs(i): |
|
387 | for x in self.parentrevs(i): | |
388 | if x != nullrev and x in seen: |
|
388 | if x != nullrev and x in seen: | |
389 | seen.add(i) |
|
389 | seen.add(i) | |
390 | yield i |
|
390 | yield i | |
391 | break |
|
391 | break | |
392 |
|
392 | |||
393 | # Required by verify. |
|
393 | # Required by verify. | |
394 | def files(self): |
|
394 | def files(self): | |
395 | entries = self._svfs.listdir(self._storepath) |
|
395 | entries = self._svfs.listdir(self._storepath) | |
396 |
|
396 | |||
397 | # Strip out undo.backup.* files created as part of transaction |
|
397 | # Strip out undo.backup.* files created as part of transaction | |
398 | # recording. |
|
398 | # recording. | |
399 | entries = [f for f in entries if not f.startswith('undo.backup.')] |
|
399 | entries = [f for f in entries if not f.startswith('undo.backup.')] | |
400 |
|
400 | |||
401 | return [b'/'.join((self._storepath, f)) for f in entries] |
|
401 | return [b'/'.join((self._storepath, f)) for f in entries] | |
402 |
|
402 | |||
403 | # Required by verify. |
|
403 | # Required by verify. | |
404 | def checksize(self): |
|
404 | def checksize(self): | |
405 | return 0, 0 |
|
405 | return 0, 0 | |
406 |
|
406 | |||
407 | def add(self, text, meta, transaction, linkrev, p1, p2): |
|
407 | def add(self, text, meta, transaction, linkrev, p1, p2): | |
|
408 | transaction.addbackup(self._indexpath) | |||
|
409 | ||||
408 | if meta or text.startswith(b'\1\n'): |
|
410 | if meta or text.startswith(b'\1\n'): | |
409 | text = filelog.packmeta(meta, text) |
|
411 | text = filelog.packmeta(meta, text) | |
410 |
|
412 | |||
411 | return self.addrevision(text, transaction, linkrev, p1, p2) |
|
413 | return self.addrevision(text, transaction, linkrev, p1, p2) | |
412 |
|
414 | |||
413 | def addrevision(self, text, transaction, linkrev, p1, p2, node=None, |
|
415 | def addrevision(self, text, transaction, linkrev, p1, p2, node=None, | |
414 | flags=0): |
|
416 | flags=0): | |
415 | validatenode(p1) |
|
417 | validatenode(p1) | |
416 | validatenode(p2) |
|
418 | validatenode(p2) | |
417 |
|
419 | |||
418 | if flags: |
|
420 | if flags: | |
419 | node = node or revlog.hash(text, p1, p2) |
|
421 | node = node or revlog.hash(text, p1, p2) | |
420 |
|
422 | |||
421 | rawtext, validatehash = self._processflags(text, flags, 'write') |
|
423 | rawtext, validatehash = self._processflags(text, flags, 'write') | |
422 |
|
424 | |||
423 | node = node or revlog.hash(text, p1, p2) |
|
425 | node = node or revlog.hash(text, p1, p2) | |
424 |
|
426 | |||
425 | if node in self._indexbynode: |
|
427 | if node in self._indexbynode: | |
426 | return node |
|
428 | return node | |
427 |
|
429 | |||
428 | if validatehash: |
|
430 | if validatehash: | |
429 | self.checkhash(rawtext, node, p1=p1, p2=p2) |
|
431 | self.checkhash(rawtext, node, p1=p1, p2=p2) | |
430 |
|
432 | |||
431 | path = b'/'.join([self._storepath, hex(node)]) |
|
433 | path = b'/'.join([self._storepath, hex(node)]) | |
432 |
|
434 | |||
433 | self._svfs.write(path, text) |
|
435 | self._svfs.write(path, text) | |
434 |
|
436 | |||
435 | self._indexdata.append({ |
|
437 | self._indexdata.append({ | |
436 | b'node': node, |
|
438 | b'node': node, | |
437 | b'p1': p1, |
|
439 | b'p1': p1, | |
438 | b'p2': p2, |
|
440 | b'p2': p2, | |
439 | b'linkrev': linkrev, |
|
441 | b'linkrev': linkrev, | |
440 | b'flags': flags, |
|
442 | b'flags': flags, | |
441 | }) |
|
443 | }) | |
442 |
|
444 | |||
443 | self._reflectindexupdate() |
|
445 | self._reflectindexupdate() | |
444 |
|
446 | |||
445 | return node |
|
447 | return node | |
446 |
|
448 | |||
447 | def _reflectindexupdate(self): |
|
449 | def _reflectindexupdate(self): | |
448 | self._refreshindex() |
|
450 | self._refreshindex() | |
449 | self._svfs.write(self._indexpath, cbor.dumps(self._indexdata)) |
|
451 | self._svfs.write(self._indexpath, cbor.dumps(self._indexdata)) | |
450 |
|
452 | |||
451 | def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None): |
|
453 | def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None): | |
452 | nodes = [] |
|
454 | nodes = [] | |
453 |
|
455 | |||
454 | transaction.addbackup(self._indexpath) |
|
456 | transaction.addbackup(self._indexpath) | |
455 |
|
457 | |||
456 | for node, p1, p2, linknode, deltabase, delta, flags in deltas: |
|
458 | for node, p1, p2, linknode, deltabase, delta, flags in deltas: | |
457 | linkrev = linkmapper(linknode) |
|
459 | linkrev = linkmapper(linknode) | |
458 |
|
460 | |||
459 | nodes.append(node) |
|
461 | nodes.append(node) | |
460 |
|
462 | |||
461 | if node in self._indexbynode: |
|
463 | if node in self._indexbynode: | |
462 | continue |
|
464 | continue | |
463 |
|
465 | |||
464 | # Need to resolve the fulltext from the delta base. |
|
466 | # Need to resolve the fulltext from the delta base. | |
465 | if deltabase == nullid: |
|
467 | if deltabase == nullid: | |
466 | text = mdiff.patch(b'', delta) |
|
468 | text = mdiff.patch(b'', delta) | |
467 | else: |
|
469 | else: | |
468 | text = mdiff.patch(self.revision(deltabase), delta) |
|
470 | text = mdiff.patch(self.revision(deltabase), delta) | |
469 |
|
471 | |||
470 | self.addrevision(text, transaction, linkrev, p1, p2, flags) |
|
472 | self.addrevision(text, transaction, linkrev, p1, p2, flags) | |
471 |
|
473 | |||
472 | if addrevisioncb: |
|
474 | if addrevisioncb: | |
473 | addrevisioncb(self, node) |
|
475 | addrevisioncb(self, node) | |
474 |
|
476 | |||
475 | return nodes |
|
477 | return nodes | |
476 |
|
478 | |||
477 | def revdiff(self, rev1, rev2): |
|
479 | def revdiff(self, rev1, rev2): | |
478 | validaterev(rev1) |
|
480 | validaterev(rev1) | |
479 | validaterev(rev2) |
|
481 | validaterev(rev2) | |
480 |
|
482 | |||
481 | node1 = self.node(rev1) |
|
483 | node1 = self.node(rev1) | |
482 | node2 = self.node(rev2) |
|
484 | node2 = self.node(rev2) | |
483 |
|
485 | |||
484 | return mdiff.textdiff(self.revision(node1, raw=True), |
|
486 | return mdiff.textdiff(self.revision(node1, raw=True), | |
485 | self.revision(node2, raw=True)) |
|
487 | self.revision(node2, raw=True)) | |
486 |
|
488 | |||
487 | def headrevs(self): |
|
489 | def headrevs(self): | |
488 | # Assume all revisions are heads by default. |
|
490 | # Assume all revisions are heads by default. | |
489 | revishead = {rev: True for rev in self._indexbyrev} |
|
491 | revishead = {rev: True for rev in self._indexbyrev} | |
490 |
|
492 | |||
491 | for rev, entry in self._indexbyrev.items(): |
|
493 | for rev, entry in self._indexbyrev.items(): | |
492 | # Unset head flag for all seen parents. |
|
494 | # Unset head flag for all seen parents. | |
493 | revishead[self.rev(entry[b'p1'])] = False |
|
495 | revishead[self.rev(entry[b'p1'])] = False | |
494 | revishead[self.rev(entry[b'p2'])] = False |
|
496 | revishead[self.rev(entry[b'p2'])] = False | |
495 |
|
497 | |||
496 | return [rev for rev, ishead in sorted(revishead.items()) |
|
498 | return [rev for rev, ishead in sorted(revishead.items()) | |
497 | if ishead] |
|
499 | if ishead] | |
498 |
|
500 | |||
499 | def heads(self, start=None, stop=None): |
|
501 | def heads(self, start=None, stop=None): | |
500 | # This is copied from revlog.py. |
|
502 | # This is copied from revlog.py. | |
501 | if start is None and stop is None: |
|
503 | if start is None and stop is None: | |
502 | if not len(self): |
|
504 | if not len(self): | |
503 | return [nullid] |
|
505 | return [nullid] | |
504 | return [self.node(r) for r in self.headrevs()] |
|
506 | return [self.node(r) for r in self.headrevs()] | |
505 |
|
507 | |||
506 | if start is None: |
|
508 | if start is None: | |
507 | start = nullid |
|
509 | start = nullid | |
508 | if stop is None: |
|
510 | if stop is None: | |
509 | stop = [] |
|
511 | stop = [] | |
510 | stoprevs = set([self.rev(n) for n in stop]) |
|
512 | stoprevs = set([self.rev(n) for n in stop]) | |
511 | startrev = self.rev(start) |
|
513 | startrev = self.rev(start) | |
512 | reachable = {startrev} |
|
514 | reachable = {startrev} | |
513 | heads = {startrev} |
|
515 | heads = {startrev} | |
514 |
|
516 | |||
515 | parentrevs = self.parentrevs |
|
517 | parentrevs = self.parentrevs | |
516 | for r in self.revs(start=startrev + 1): |
|
518 | for r in self.revs(start=startrev + 1): | |
517 | for p in parentrevs(r): |
|
519 | for p in parentrevs(r): | |
518 | if p in reachable: |
|
520 | if p in reachable: | |
519 | if r not in stoprevs: |
|
521 | if r not in stoprevs: | |
520 | reachable.add(r) |
|
522 | reachable.add(r) | |
521 | heads.add(r) |
|
523 | heads.add(r) | |
522 | if p in heads and p not in stoprevs: |
|
524 | if p in heads and p not in stoprevs: | |
523 | heads.remove(p) |
|
525 | heads.remove(p) | |
524 |
|
526 | |||
525 | return [self.node(r) for r in heads] |
|
527 | return [self.node(r) for r in heads] | |
526 |
|
528 | |||
527 | def children(self, node): |
|
529 | def children(self, node): | |
528 | validatenode(node) |
|
530 | validatenode(node) | |
529 |
|
531 | |||
530 | # This is a copy of revlog.children(). |
|
532 | # This is a copy of revlog.children(). | |
531 | c = [] |
|
533 | c = [] | |
532 | p = self.rev(node) |
|
534 | p = self.rev(node) | |
533 | for r in self.revs(start=p + 1): |
|
535 | for r in self.revs(start=p + 1): | |
534 | prevs = [pr for pr in self.parentrevs(r) if pr != nullrev] |
|
536 | prevs = [pr for pr in self.parentrevs(r) if pr != nullrev] | |
535 | if prevs: |
|
537 | if prevs: | |
536 | for pr in prevs: |
|
538 | for pr in prevs: | |
537 | if pr == p: |
|
539 | if pr == p: | |
538 | c.append(self.node(r)) |
|
540 | c.append(self.node(r)) | |
539 | elif p == nullrev: |
|
541 | elif p == nullrev: | |
540 | c.append(self.node(r)) |
|
542 | c.append(self.node(r)) | |
541 | return c |
|
543 | return c | |
542 |
|
544 | |||
543 | def getstrippoint(self, minlink): |
|
545 | def getstrippoint(self, minlink): | |
544 |
|
546 | |||
545 | # This is largely a copy of revlog.getstrippoint(). |
|
547 | # This is largely a copy of revlog.getstrippoint(). | |
546 | brokenrevs = set() |
|
548 | brokenrevs = set() | |
547 | strippoint = len(self) |
|
549 | strippoint = len(self) | |
548 |
|
550 | |||
549 | heads = {} |
|
551 | heads = {} | |
550 | futurelargelinkrevs = set() |
|
552 | futurelargelinkrevs = set() | |
551 | for head in self.headrevs(): |
|
553 | for head in self.headrevs(): | |
552 | headlinkrev = self.linkrev(head) |
|
554 | headlinkrev = self.linkrev(head) | |
553 | heads[head] = headlinkrev |
|
555 | heads[head] = headlinkrev | |
554 | if headlinkrev >= minlink: |
|
556 | if headlinkrev >= minlink: | |
555 | futurelargelinkrevs.add(headlinkrev) |
|
557 | futurelargelinkrevs.add(headlinkrev) | |
556 |
|
558 | |||
557 | # This algorithm involves walking down the rev graph, starting at the |
|
559 | # This algorithm involves walking down the rev graph, starting at the | |
558 | # heads. Since the revs are topologically sorted according to linkrev, |
|
560 | # heads. Since the revs are topologically sorted according to linkrev, | |
559 | # once all head linkrevs are below the minlink, we know there are |
|
561 | # once all head linkrevs are below the minlink, we know there are | |
560 | # no more revs that could have a linkrev greater than minlink. |
|
562 | # no more revs that could have a linkrev greater than minlink. | |
561 | # So we can stop walking. |
|
563 | # So we can stop walking. | |
562 | while futurelargelinkrevs: |
|
564 | while futurelargelinkrevs: | |
563 | strippoint -= 1 |
|
565 | strippoint -= 1 | |
564 | linkrev = heads.pop(strippoint) |
|
566 | linkrev = heads.pop(strippoint) | |
565 |
|
567 | |||
566 | if linkrev < minlink: |
|
568 | if linkrev < minlink: | |
567 | brokenrevs.add(strippoint) |
|
569 | brokenrevs.add(strippoint) | |
568 | else: |
|
570 | else: | |
569 | futurelargelinkrevs.remove(linkrev) |
|
571 | futurelargelinkrevs.remove(linkrev) | |
570 |
|
572 | |||
571 | for p in self.parentrevs(strippoint): |
|
573 | for p in self.parentrevs(strippoint): | |
572 | if p != nullrev: |
|
574 | if p != nullrev: | |
573 | plinkrev = self.linkrev(p) |
|
575 | plinkrev = self.linkrev(p) | |
574 | heads[p] = plinkrev |
|
576 | heads[p] = plinkrev | |
575 | if plinkrev >= minlink: |
|
577 | if plinkrev >= minlink: | |
576 | futurelargelinkrevs.add(plinkrev) |
|
578 | futurelargelinkrevs.add(plinkrev) | |
577 |
|
579 | |||
578 | return strippoint, brokenrevs |
|
580 | return strippoint, brokenrevs | |
579 |
|
581 | |||
580 | def strip(self, minlink, transaction): |
|
582 | def strip(self, minlink, transaction): | |
581 | if not len(self): |
|
583 | if not len(self): | |
582 | return |
|
584 | return | |
583 |
|
585 | |||
584 | rev, _ignored = self.getstrippoint(minlink) |
|
586 | rev, _ignored = self.getstrippoint(minlink) | |
585 | if rev == len(self): |
|
587 | if rev == len(self): | |
586 | return |
|
588 | return | |
587 |
|
589 | |||
588 | # Purge index data starting at the requested revision. |
|
590 | # Purge index data starting at the requested revision. | |
589 | self._indexdata[rev:] = [] |
|
591 | self._indexdata[rev:] = [] | |
590 | self._reflectindexupdate() |
|
592 | self._reflectindexupdate() | |
591 |
|
593 | |||
592 | def issimplestorefile(f, kind, st): |
|
594 | def issimplestorefile(f, kind, st): | |
593 | if kind != stat.S_IFREG: |
|
595 | if kind != stat.S_IFREG: | |
594 | return False |
|
596 | return False | |
595 |
|
597 | |||
596 | if store.isrevlog(f, kind, st): |
|
598 | if store.isrevlog(f, kind, st): | |
597 | return False |
|
599 | return False | |
598 |
|
600 | |||
599 | # Ignore transaction undo files. |
|
601 | # Ignore transaction undo files. | |
600 | if f.startswith('undo.'): |
|
602 | if f.startswith('undo.'): | |
601 | return False |
|
603 | return False | |
602 |
|
604 | |||
603 | # Otherwise assume it belongs to the simple store. |
|
605 | # Otherwise assume it belongs to the simple store. | |
604 | return True |
|
606 | return True | |
605 |
|
607 | |||
606 | class simplestore(store.encodedstore): |
|
608 | class simplestore(store.encodedstore): | |
607 | def datafiles(self): |
|
609 | def datafiles(self): | |
608 | for x in super(simplestore, self).datafiles(): |
|
610 | for x in super(simplestore, self).datafiles(): | |
609 | yield x |
|
611 | yield x | |
610 |
|
612 | |||
611 | # Supplement with non-revlog files. |
|
613 | # Supplement with non-revlog files. | |
612 | extrafiles = self._walk('data', True, filefilter=issimplestorefile) |
|
614 | extrafiles = self._walk('data', True, filefilter=issimplestorefile) | |
613 |
|
615 | |||
614 | for unencoded, encoded, size in extrafiles: |
|
616 | for unencoded, encoded, size in extrafiles: | |
615 | try: |
|
617 | try: | |
616 | unencoded = store.decodefilename(unencoded) |
|
618 | unencoded = store.decodefilename(unencoded) | |
617 | except KeyError: |
|
619 | except KeyError: | |
618 | unencoded = None |
|
620 | unencoded = None | |
619 |
|
621 | |||
620 | yield unencoded, encoded, size |
|
622 | yield unencoded, encoded, size | |
621 |
|
623 | |||
622 | def reposetup(ui, repo): |
|
624 | def reposetup(ui, repo): | |
623 | if not repo.local(): |
|
625 | if not repo.local(): | |
624 | return |
|
626 | return | |
625 |
|
627 | |||
626 | if isinstance(repo, bundlerepo.bundlerepository): |
|
628 | if isinstance(repo, bundlerepo.bundlerepository): | |
627 | raise error.Abort(_('cannot use simple store with bundlerepo')) |
|
629 | raise error.Abort(_('cannot use simple store with bundlerepo')) | |
628 |
|
630 | |||
629 | class simplestorerepo(repo.__class__): |
|
631 | class simplestorerepo(repo.__class__): | |
630 | def file(self, f): |
|
632 | def file(self, f): | |
631 | return filestorage(self.svfs, f) |
|
633 | return filestorage(self.svfs, f) | |
632 |
|
634 | |||
633 | repo.__class__ = simplestorerepo |
|
635 | repo.__class__ = simplestorerepo | |
634 |
|
636 | |||
635 | def featuresetup(ui, supported): |
|
637 | def featuresetup(ui, supported): | |
636 | supported.add(REQUIREMENT) |
|
638 | supported.add(REQUIREMENT) | |
637 |
|
639 | |||
638 | def newreporequirements(orig, repo): |
|
640 | def newreporequirements(orig, repo): | |
639 | """Modifies default requirements for new repos to use the simple store.""" |
|
641 | """Modifies default requirements for new repos to use the simple store.""" | |
640 | requirements = orig(repo) |
|
642 | requirements = orig(repo) | |
641 |
|
643 | |||
642 | # These requirements are only used to affect creation of the store |
|
644 | # These requirements are only used to affect creation of the store | |
643 | # object. We have our own store. So we can remove them. |
|
645 | # object. We have our own store. So we can remove them. | |
644 | # TODO do this once we feel like taking the test hit. |
|
646 | # TODO do this once we feel like taking the test hit. | |
645 | #if 'fncache' in requirements: |
|
647 | #if 'fncache' in requirements: | |
646 | # requirements.remove('fncache') |
|
648 | # requirements.remove('fncache') | |
647 | #if 'dotencode' in requirements: |
|
649 | #if 'dotencode' in requirements: | |
648 | # requirements.remove('dotencode') |
|
650 | # requirements.remove('dotencode') | |
649 |
|
651 | |||
650 | requirements.add(REQUIREMENT) |
|
652 | requirements.add(REQUIREMENT) | |
651 |
|
653 | |||
652 | return requirements |
|
654 | return requirements | |
653 |
|
655 | |||
654 | def makestore(orig, requirements, path, vfstype): |
|
656 | def makestore(orig, requirements, path, vfstype): | |
655 | if REQUIREMENT not in requirements: |
|
657 | if REQUIREMENT not in requirements: | |
656 | return orig(requirements, path, vfstype) |
|
658 | return orig(requirements, path, vfstype) | |
657 |
|
659 | |||
658 | return simplestore(path, vfstype) |
|
660 | return simplestore(path, vfstype) | |
659 |
|
661 | |||
660 | def verifierinit(orig, self, *args, **kwargs): |
|
662 | def verifierinit(orig, self, *args, **kwargs): | |
661 | orig(self, *args, **kwargs) |
|
663 | orig(self, *args, **kwargs) | |
662 |
|
664 | |||
663 | # We don't care that files in the store don't align with what is |
|
665 | # We don't care that files in the store don't align with what is | |
664 | # advertised. So suppress these warnings. |
|
666 | # advertised. So suppress these warnings. | |
665 | self.warnorphanstorefiles = False |
|
667 | self.warnorphanstorefiles = False | |
666 |
|
668 | |||
667 | def extsetup(ui): |
|
669 | def extsetup(ui): | |
668 | localrepo.featuresetupfuncs.add(featuresetup) |
|
670 | localrepo.featuresetupfuncs.add(featuresetup) | |
669 |
|
671 | |||
670 | extensions.wrapfunction(localrepo, 'newreporequirements', |
|
672 | extensions.wrapfunction(localrepo, 'newreporequirements', | |
671 | newreporequirements) |
|
673 | newreporequirements) | |
672 | extensions.wrapfunction(store, 'store', makestore) |
|
674 | extensions.wrapfunction(store, 'store', makestore) | |
673 | extensions.wrapfunction(verify.verifier, '__init__', verifierinit) |
|
675 | extensions.wrapfunction(verify.verifier, '__init__', verifierinit) |
@@ -1,1293 +1,1295 b'' | |||||
1 | #testcases sshv1 sshv2 |
|
1 | #testcases sshv1 sshv2 | |
2 |
|
2 | |||
3 | #if sshv2 |
|
3 | #if sshv2 | |
4 | $ cat >> $HGRCPATH << EOF |
|
4 | $ cat >> $HGRCPATH << EOF | |
5 | > [experimental] |
|
5 | > [experimental] | |
6 | > sshpeer.advertise-v2 = true |
|
6 | > sshpeer.advertise-v2 = true | |
7 | > sshserver.support-v2 = true |
|
7 | > sshserver.support-v2 = true | |
8 | > EOF |
|
8 | > EOF | |
9 | #endif |
|
9 | #endif | |
10 |
|
10 | |||
11 | Prepare repo a: |
|
11 | Prepare repo a: | |
12 |
|
12 | |||
13 | $ hg init a |
|
13 | $ hg init a | |
14 | $ cd a |
|
14 | $ cd a | |
15 | $ echo a > a |
|
15 | $ echo a > a | |
16 | $ hg add a |
|
16 | $ hg add a | |
17 | $ hg commit -m test |
|
17 | $ hg commit -m test | |
18 | $ echo first line > b |
|
18 | $ echo first line > b | |
19 | $ hg add b |
|
19 | $ hg add b | |
20 |
|
20 | |||
21 | Create a non-inlined filelog: |
|
21 | Create a non-inlined filelog: | |
22 |
|
22 | |||
23 | $ $PYTHON -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))' |
|
23 | $ $PYTHON -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))' | |
24 | $ for j in 0 1 2 3 4 5 6 7 8 9; do |
|
24 | $ for j in 0 1 2 3 4 5 6 7 8 9; do | |
25 | > cat data1 >> b |
|
25 | > cat data1 >> b | |
26 | > hg commit -m test |
|
26 | > hg commit -m test | |
27 | > done |
|
27 | > done | |
28 |
|
28 | |||
29 | List files in store/data (should show a 'b.d'): |
|
29 | List files in store/data (should show a 'b.d'): | |
30 |
|
30 | |||
31 | #if reporevlogstore |
|
31 | #if reporevlogstore | |
32 | $ for i in .hg/store/data/*; do |
|
32 | $ for i in .hg/store/data/*; do | |
33 | > echo $i |
|
33 | > echo $i | |
34 | > done |
|
34 | > done | |
35 | .hg/store/data/a.i |
|
35 | .hg/store/data/a.i | |
36 | .hg/store/data/b.d |
|
36 | .hg/store/data/b.d | |
37 | .hg/store/data/b.i |
|
37 | .hg/store/data/b.i | |
38 | #endif |
|
38 | #endif | |
39 |
|
39 | |||
40 | Trigger branchcache creation: |
|
40 | Trigger branchcache creation: | |
41 |
|
41 | |||
42 | $ hg branches |
|
42 | $ hg branches | |
43 | default 10:a7949464abda |
|
43 | default 10:a7949464abda | |
44 | $ ls .hg/cache |
|
44 | $ ls .hg/cache | |
45 | branch2-served |
|
45 | branch2-served | |
46 | checkisexec (execbit !) |
|
46 | checkisexec (execbit !) | |
47 | checklink (symlink !) |
|
47 | checklink (symlink !) | |
48 | checklink-target (symlink !) |
|
48 | checklink-target (symlink !) | |
49 | checknoexec (execbit !) |
|
49 | checknoexec (execbit !) | |
50 | rbc-names-v1 |
|
50 | rbc-names-v1 | |
51 | rbc-revs-v1 |
|
51 | rbc-revs-v1 | |
52 |
|
52 | |||
53 | Default operation: |
|
53 | Default operation: | |
54 |
|
54 | |||
55 | $ hg clone . ../b |
|
55 | $ hg clone . ../b | |
56 | updating to branch default |
|
56 | updating to branch default | |
57 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
57 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
58 | $ cd ../b |
|
58 | $ cd ../b | |
59 |
|
59 | |||
60 | Ensure branchcache got copied over: |
|
60 | Ensure branchcache got copied over: | |
61 |
|
61 | |||
62 | $ ls .hg/cache |
|
62 | $ ls .hg/cache | |
63 | branch2-served |
|
63 | branch2-served | |
64 | checkisexec (execbit !) |
|
64 | checkisexec (execbit !) | |
65 | checklink (symlink !) |
|
65 | checklink (symlink !) | |
66 | checklink-target (symlink !) |
|
66 | checklink-target (symlink !) | |
67 | rbc-names-v1 |
|
67 | rbc-names-v1 | |
68 | rbc-revs-v1 |
|
68 | rbc-revs-v1 | |
69 |
|
69 | |||
70 | $ cat a |
|
70 | $ cat a | |
71 | a |
|
71 | a | |
72 | $ hg verify |
|
72 | $ hg verify | |
73 | checking changesets |
|
73 | checking changesets | |
74 | checking manifests |
|
74 | checking manifests | |
75 | crosschecking files in changesets and manifests |
|
75 | crosschecking files in changesets and manifests | |
76 | checking files |
|
76 | checking files | |
77 | 2 files, 11 changesets, 11 total revisions |
|
77 | 2 files, 11 changesets, 11 total revisions | |
78 |
|
78 | |||
79 | Invalid dest '' must abort: |
|
79 | Invalid dest '' must abort: | |
80 |
|
80 | |||
81 | $ hg clone . '' |
|
81 | $ hg clone . '' | |
82 | abort: empty destination path is not valid |
|
82 | abort: empty destination path is not valid | |
83 | [255] |
|
83 | [255] | |
84 |
|
84 | |||
85 | No update, with debug option: |
|
85 | No update, with debug option: | |
86 |
|
86 | |||
87 | #if hardlink |
|
87 | #if hardlink | |
88 | $ hg --debug clone -U . ../c --config progress.debug=true |
|
88 | $ hg --debug clone -U . ../c --config progress.debug=true | |
89 | linking: 1 |
|
89 | linking: 1 | |
90 | linking: 2 |
|
90 | linking: 2 | |
91 | linking: 3 |
|
91 | linking: 3 | |
92 | linking: 4 |
|
92 | linking: 4 | |
93 | linking: 5 |
|
93 | linking: 5 | |
94 | linking: 6 |
|
94 | linking: 6 | |
95 | linking: 7 |
|
95 | linking: 7 | |
96 | linking: 8 |
|
96 | linking: 8 | |
97 | linked 8 files (reporevlogstore !) |
|
97 | linked 8 files (reporevlogstore !) | |
98 | linking: 9 (reposimplestore !) |
|
98 | linking: 9 (reposimplestore !) | |
99 | linking: 10 (reposimplestore !) |
|
99 | linking: 10 (reposimplestore !) | |
100 | linking: 11 (reposimplestore !) |
|
100 | linking: 11 (reposimplestore !) | |
101 | linking: 12 (reposimplestore !) |
|
101 | linking: 12 (reposimplestore !) | |
102 | linking: 13 (reposimplestore !) |
|
102 | linking: 13 (reposimplestore !) | |
103 | linking: 14 (reposimplestore !) |
|
103 | linking: 14 (reposimplestore !) | |
104 | linking: 15 (reposimplestore !) |
|
104 | linking: 15 (reposimplestore !) | |
105 | linking: 16 (reposimplestore !) |
|
105 | linking: 16 (reposimplestore !) | |
106 | linking: 17 (reposimplestore !) |
|
106 | linking: 17 (reposimplestore !) | |
107 |
link |
|
107 | linking: 18 (reposimplestore !) | |
|
108 | linked 18 files (reposimplestore !) | |||
108 | #else |
|
109 | #else | |
109 | $ hg --debug clone -U . ../c --config progress.debug=true |
|
110 | $ hg --debug clone -U . ../c --config progress.debug=true | |
110 | linking: 1 |
|
111 | linking: 1 | |
111 | copying: 2 |
|
112 | copying: 2 | |
112 | copying: 3 |
|
113 | copying: 3 | |
113 | copying: 4 |
|
114 | copying: 4 | |
114 | copying: 5 |
|
115 | copying: 5 | |
115 | copying: 6 |
|
116 | copying: 6 | |
116 | copying: 7 |
|
117 | copying: 7 | |
117 | copying: 8 |
|
118 | copying: 8 | |
118 | copied 8 files (reporevlogstore !) |
|
119 | copied 8 files (reporevlogstore !) | |
119 | copying: 9 (reposimplestore !) |
|
120 | copying: 9 (reposimplestore !) | |
120 | copying: 10 (reposimplestore !) |
|
121 | copying: 10 (reposimplestore !) | |
121 | copying: 11 (reposimplestore !) |
|
122 | copying: 11 (reposimplestore !) | |
122 | copying: 12 (reposimplestore !) |
|
123 | copying: 12 (reposimplestore !) | |
123 | copying: 13 (reposimplestore !) |
|
124 | copying: 13 (reposimplestore !) | |
124 | copying: 14 (reposimplestore !) |
|
125 | copying: 14 (reposimplestore !) | |
125 | copying: 15 (reposimplestore !) |
|
126 | copying: 15 (reposimplestore !) | |
126 | copying: 16 (reposimplestore !) |
|
127 | copying: 16 (reposimplestore !) | |
127 | copying: 17 (reposimplestore !) |
|
128 | copying: 17 (reposimplestore !) | |
128 |
cop |
|
129 | copying: 18 (reposimplestore !) | |
|
130 | copied 18 files (reposimplestore !) | |||
129 | #endif |
|
131 | #endif | |
130 | $ cd ../c |
|
132 | $ cd ../c | |
131 |
|
133 | |||
132 | Ensure branchcache got copied over: |
|
134 | Ensure branchcache got copied over: | |
133 |
|
135 | |||
134 | $ ls .hg/cache |
|
136 | $ ls .hg/cache | |
135 | branch2-served |
|
137 | branch2-served | |
136 | rbc-names-v1 |
|
138 | rbc-names-v1 | |
137 | rbc-revs-v1 |
|
139 | rbc-revs-v1 | |
138 |
|
140 | |||
139 | $ cat a 2>/dev/null || echo "a not present" |
|
141 | $ cat a 2>/dev/null || echo "a not present" | |
140 | a not present |
|
142 | a not present | |
141 | $ hg verify |
|
143 | $ hg verify | |
142 | checking changesets |
|
144 | checking changesets | |
143 | checking manifests |
|
145 | checking manifests | |
144 | crosschecking files in changesets and manifests |
|
146 | crosschecking files in changesets and manifests | |
145 | checking files |
|
147 | checking files | |
146 | 2 files, 11 changesets, 11 total revisions |
|
148 | 2 files, 11 changesets, 11 total revisions | |
147 |
|
149 | |||
148 | Default destination: |
|
150 | Default destination: | |
149 |
|
151 | |||
150 | $ mkdir ../d |
|
152 | $ mkdir ../d | |
151 | $ cd ../d |
|
153 | $ cd ../d | |
152 | $ hg clone ../a |
|
154 | $ hg clone ../a | |
153 | destination directory: a |
|
155 | destination directory: a | |
154 | updating to branch default |
|
156 | updating to branch default | |
155 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
157 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
156 | $ cd a |
|
158 | $ cd a | |
157 | $ hg cat a |
|
159 | $ hg cat a | |
158 | a |
|
160 | a | |
159 | $ cd ../.. |
|
161 | $ cd ../.. | |
160 |
|
162 | |||
161 | Check that we drop the 'file:' from the path before writing the .hgrc: |
|
163 | Check that we drop the 'file:' from the path before writing the .hgrc: | |
162 |
|
164 | |||
163 | $ hg clone file:a e |
|
165 | $ hg clone file:a e | |
164 | updating to branch default |
|
166 | updating to branch default | |
165 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
167 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
166 | $ grep 'file:' e/.hg/hgrc |
|
168 | $ grep 'file:' e/.hg/hgrc | |
167 | [1] |
|
169 | [1] | |
168 |
|
170 | |||
169 | Check that path aliases are expanded: |
|
171 | Check that path aliases are expanded: | |
170 |
|
172 | |||
171 | $ hg clone -q -U --config 'paths.foobar=a#0' foobar f |
|
173 | $ hg clone -q -U --config 'paths.foobar=a#0' foobar f | |
172 | $ hg -R f showconfig paths.default |
|
174 | $ hg -R f showconfig paths.default | |
173 | $TESTTMP/a#0 |
|
175 | $TESTTMP/a#0 | |
174 |
|
176 | |||
175 | Use --pull: |
|
177 | Use --pull: | |
176 |
|
178 | |||
177 | $ hg clone --pull a g |
|
179 | $ hg clone --pull a g | |
178 | requesting all changes |
|
180 | requesting all changes | |
179 | adding changesets |
|
181 | adding changesets | |
180 | adding manifests |
|
182 | adding manifests | |
181 | adding file changes |
|
183 | adding file changes | |
182 | added 11 changesets with 11 changes to 2 files |
|
184 | added 11 changesets with 11 changes to 2 files | |
183 | new changesets acb14030fe0a:a7949464abda |
|
185 | new changesets acb14030fe0a:a7949464abda | |
184 | updating to branch default |
|
186 | updating to branch default | |
185 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
187 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
186 | $ hg -R g verify |
|
188 | $ hg -R g verify | |
187 | checking changesets |
|
189 | checking changesets | |
188 | checking manifests |
|
190 | checking manifests | |
189 | crosschecking files in changesets and manifests |
|
191 | crosschecking files in changesets and manifests | |
190 | checking files |
|
192 | checking files | |
191 | 2 files, 11 changesets, 11 total revisions |
|
193 | 2 files, 11 changesets, 11 total revisions | |
192 |
|
194 | |||
193 | Invalid dest '' with --pull must abort (issue2528): |
|
195 | Invalid dest '' with --pull must abort (issue2528): | |
194 |
|
196 | |||
195 | $ hg clone --pull a '' |
|
197 | $ hg clone --pull a '' | |
196 | abort: empty destination path is not valid |
|
198 | abort: empty destination path is not valid | |
197 | [255] |
|
199 | [255] | |
198 |
|
200 | |||
199 | Clone to '.': |
|
201 | Clone to '.': | |
200 |
|
202 | |||
201 | $ mkdir h |
|
203 | $ mkdir h | |
202 | $ cd h |
|
204 | $ cd h | |
203 | $ hg clone ../a . |
|
205 | $ hg clone ../a . | |
204 | updating to branch default |
|
206 | updating to branch default | |
205 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
207 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
206 | $ cd .. |
|
208 | $ cd .. | |
207 |
|
209 | |||
208 |
|
210 | |||
209 | *** Tests for option -u *** |
|
211 | *** Tests for option -u *** | |
210 |
|
212 | |||
211 | Adding some more history to repo a: |
|
213 | Adding some more history to repo a: | |
212 |
|
214 | |||
213 | $ cd a |
|
215 | $ cd a | |
214 | $ hg tag ref1 |
|
216 | $ hg tag ref1 | |
215 | $ echo the quick brown fox >a |
|
217 | $ echo the quick brown fox >a | |
216 | $ hg ci -m "hacked default" |
|
218 | $ hg ci -m "hacked default" | |
217 | $ hg up ref1 |
|
219 | $ hg up ref1 | |
218 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
220 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
219 | $ hg branch stable |
|
221 | $ hg branch stable | |
220 | marked working directory as branch stable |
|
222 | marked working directory as branch stable | |
221 | (branches are permanent and global, did you want a bookmark?) |
|
223 | (branches are permanent and global, did you want a bookmark?) | |
222 | $ echo some text >a |
|
224 | $ echo some text >a | |
223 | $ hg ci -m "starting branch stable" |
|
225 | $ hg ci -m "starting branch stable" | |
224 | $ hg tag ref2 |
|
226 | $ hg tag ref2 | |
225 | $ echo some more text >a |
|
227 | $ echo some more text >a | |
226 | $ hg ci -m "another change for branch stable" |
|
228 | $ hg ci -m "another change for branch stable" | |
227 | $ hg up ref2 |
|
229 | $ hg up ref2 | |
228 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
230 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
229 | $ hg parents |
|
231 | $ hg parents | |
230 | changeset: 13:e8ece76546a6 |
|
232 | changeset: 13:e8ece76546a6 | |
231 | branch: stable |
|
233 | branch: stable | |
232 | tag: ref2 |
|
234 | tag: ref2 | |
233 | parent: 10:a7949464abda |
|
235 | parent: 10:a7949464abda | |
234 | user: test |
|
236 | user: test | |
235 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
237 | date: Thu Jan 01 00:00:00 1970 +0000 | |
236 | summary: starting branch stable |
|
238 | summary: starting branch stable | |
237 |
|
239 | |||
238 |
|
240 | |||
239 | Repo a has two heads: |
|
241 | Repo a has two heads: | |
240 |
|
242 | |||
241 | $ hg heads |
|
243 | $ hg heads | |
242 | changeset: 15:0aae7cf88f0d |
|
244 | changeset: 15:0aae7cf88f0d | |
243 | branch: stable |
|
245 | branch: stable | |
244 | tag: tip |
|
246 | tag: tip | |
245 | user: test |
|
247 | user: test | |
246 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
248 | date: Thu Jan 01 00:00:00 1970 +0000 | |
247 | summary: another change for branch stable |
|
249 | summary: another change for branch stable | |
248 |
|
250 | |||
249 | changeset: 12:f21241060d6a |
|
251 | changeset: 12:f21241060d6a | |
250 | user: test |
|
252 | user: test | |
251 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
253 | date: Thu Jan 01 00:00:00 1970 +0000 | |
252 | summary: hacked default |
|
254 | summary: hacked default | |
253 |
|
255 | |||
254 |
|
256 | |||
255 | $ cd .. |
|
257 | $ cd .. | |
256 |
|
258 | |||
257 |
|
259 | |||
258 | Testing --noupdate with --updaterev (must abort): |
|
260 | Testing --noupdate with --updaterev (must abort): | |
259 |
|
261 | |||
260 | $ hg clone --noupdate --updaterev 1 a ua |
|
262 | $ hg clone --noupdate --updaterev 1 a ua | |
261 | abort: cannot specify both --noupdate and --updaterev |
|
263 | abort: cannot specify both --noupdate and --updaterev | |
262 | [255] |
|
264 | [255] | |
263 |
|
265 | |||
264 |
|
266 | |||
265 | Testing clone -u: |
|
267 | Testing clone -u: | |
266 |
|
268 | |||
267 | $ hg clone -u . a ua |
|
269 | $ hg clone -u . a ua | |
268 | updating to branch stable |
|
270 | updating to branch stable | |
269 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
271 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
270 |
|
272 | |||
271 | Repo ua has both heads: |
|
273 | Repo ua has both heads: | |
272 |
|
274 | |||
273 | $ hg -R ua heads |
|
275 | $ hg -R ua heads | |
274 | changeset: 15:0aae7cf88f0d |
|
276 | changeset: 15:0aae7cf88f0d | |
275 | branch: stable |
|
277 | branch: stable | |
276 | tag: tip |
|
278 | tag: tip | |
277 | user: test |
|
279 | user: test | |
278 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
280 | date: Thu Jan 01 00:00:00 1970 +0000 | |
279 | summary: another change for branch stable |
|
281 | summary: another change for branch stable | |
280 |
|
282 | |||
281 | changeset: 12:f21241060d6a |
|
283 | changeset: 12:f21241060d6a | |
282 | user: test |
|
284 | user: test | |
283 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
285 | date: Thu Jan 01 00:00:00 1970 +0000 | |
284 | summary: hacked default |
|
286 | summary: hacked default | |
285 |
|
287 | |||
286 |
|
288 | |||
287 | Same revision checked out in repo a and ua: |
|
289 | Same revision checked out in repo a and ua: | |
288 |
|
290 | |||
289 | $ hg -R a parents --template "{node|short}\n" |
|
291 | $ hg -R a parents --template "{node|short}\n" | |
290 | e8ece76546a6 |
|
292 | e8ece76546a6 | |
291 | $ hg -R ua parents --template "{node|short}\n" |
|
293 | $ hg -R ua parents --template "{node|short}\n" | |
292 | e8ece76546a6 |
|
294 | e8ece76546a6 | |
293 |
|
295 | |||
294 | $ rm -r ua |
|
296 | $ rm -r ua | |
295 |
|
297 | |||
296 |
|
298 | |||
297 | Testing clone --pull -u: |
|
299 | Testing clone --pull -u: | |
298 |
|
300 | |||
299 | $ hg clone --pull -u . a ua |
|
301 | $ hg clone --pull -u . a ua | |
300 | requesting all changes |
|
302 | requesting all changes | |
301 | adding changesets |
|
303 | adding changesets | |
302 | adding manifests |
|
304 | adding manifests | |
303 | adding file changes |
|
305 | adding file changes | |
304 | added 16 changesets with 16 changes to 3 files (+1 heads) |
|
306 | added 16 changesets with 16 changes to 3 files (+1 heads) | |
305 | new changesets acb14030fe0a:0aae7cf88f0d |
|
307 | new changesets acb14030fe0a:0aae7cf88f0d | |
306 | updating to branch stable |
|
308 | updating to branch stable | |
307 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
309 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
308 |
|
310 | |||
309 | Repo ua has both heads: |
|
311 | Repo ua has both heads: | |
310 |
|
312 | |||
311 | $ hg -R ua heads |
|
313 | $ hg -R ua heads | |
312 | changeset: 15:0aae7cf88f0d |
|
314 | changeset: 15:0aae7cf88f0d | |
313 | branch: stable |
|
315 | branch: stable | |
314 | tag: tip |
|
316 | tag: tip | |
315 | user: test |
|
317 | user: test | |
316 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
318 | date: Thu Jan 01 00:00:00 1970 +0000 | |
317 | summary: another change for branch stable |
|
319 | summary: another change for branch stable | |
318 |
|
320 | |||
319 | changeset: 12:f21241060d6a |
|
321 | changeset: 12:f21241060d6a | |
320 | user: test |
|
322 | user: test | |
321 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
323 | date: Thu Jan 01 00:00:00 1970 +0000 | |
322 | summary: hacked default |
|
324 | summary: hacked default | |
323 |
|
325 | |||
324 |
|
326 | |||
325 | Same revision checked out in repo a and ua: |
|
327 | Same revision checked out in repo a and ua: | |
326 |
|
328 | |||
327 | $ hg -R a parents --template "{node|short}\n" |
|
329 | $ hg -R a parents --template "{node|short}\n" | |
328 | e8ece76546a6 |
|
330 | e8ece76546a6 | |
329 | $ hg -R ua parents --template "{node|short}\n" |
|
331 | $ hg -R ua parents --template "{node|short}\n" | |
330 | e8ece76546a6 |
|
332 | e8ece76546a6 | |
331 |
|
333 | |||
332 | $ rm -r ua |
|
334 | $ rm -r ua | |
333 |
|
335 | |||
334 |
|
336 | |||
335 | Testing clone -u <branch>: |
|
337 | Testing clone -u <branch>: | |
336 |
|
338 | |||
337 | $ hg clone -u stable a ua |
|
339 | $ hg clone -u stable a ua | |
338 | updating to branch stable |
|
340 | updating to branch stable | |
339 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
341 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
340 |
|
342 | |||
341 | Repo ua has both heads: |
|
343 | Repo ua has both heads: | |
342 |
|
344 | |||
343 | $ hg -R ua heads |
|
345 | $ hg -R ua heads | |
344 | changeset: 15:0aae7cf88f0d |
|
346 | changeset: 15:0aae7cf88f0d | |
345 | branch: stable |
|
347 | branch: stable | |
346 | tag: tip |
|
348 | tag: tip | |
347 | user: test |
|
349 | user: test | |
348 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
350 | date: Thu Jan 01 00:00:00 1970 +0000 | |
349 | summary: another change for branch stable |
|
351 | summary: another change for branch stable | |
350 |
|
352 | |||
351 | changeset: 12:f21241060d6a |
|
353 | changeset: 12:f21241060d6a | |
352 | user: test |
|
354 | user: test | |
353 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
355 | date: Thu Jan 01 00:00:00 1970 +0000 | |
354 | summary: hacked default |
|
356 | summary: hacked default | |
355 |
|
357 | |||
356 |
|
358 | |||
357 | Branch 'stable' is checked out: |
|
359 | Branch 'stable' is checked out: | |
358 |
|
360 | |||
359 | $ hg -R ua parents |
|
361 | $ hg -R ua parents | |
360 | changeset: 15:0aae7cf88f0d |
|
362 | changeset: 15:0aae7cf88f0d | |
361 | branch: stable |
|
363 | branch: stable | |
362 | tag: tip |
|
364 | tag: tip | |
363 | user: test |
|
365 | user: test | |
364 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
366 | date: Thu Jan 01 00:00:00 1970 +0000 | |
365 | summary: another change for branch stable |
|
367 | summary: another change for branch stable | |
366 |
|
368 | |||
367 |
|
369 | |||
368 | $ rm -r ua |
|
370 | $ rm -r ua | |
369 |
|
371 | |||
370 |
|
372 | |||
371 | Testing default checkout: |
|
373 | Testing default checkout: | |
372 |
|
374 | |||
373 | $ hg clone a ua |
|
375 | $ hg clone a ua | |
374 | updating to branch default |
|
376 | updating to branch default | |
375 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
377 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
376 |
|
378 | |||
377 | Repo ua has both heads: |
|
379 | Repo ua has both heads: | |
378 |
|
380 | |||
379 | $ hg -R ua heads |
|
381 | $ hg -R ua heads | |
380 | changeset: 15:0aae7cf88f0d |
|
382 | changeset: 15:0aae7cf88f0d | |
381 | branch: stable |
|
383 | branch: stable | |
382 | tag: tip |
|
384 | tag: tip | |
383 | user: test |
|
385 | user: test | |
384 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
386 | date: Thu Jan 01 00:00:00 1970 +0000 | |
385 | summary: another change for branch stable |
|
387 | summary: another change for branch stable | |
386 |
|
388 | |||
387 | changeset: 12:f21241060d6a |
|
389 | changeset: 12:f21241060d6a | |
388 | user: test |
|
390 | user: test | |
389 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
391 | date: Thu Jan 01 00:00:00 1970 +0000 | |
390 | summary: hacked default |
|
392 | summary: hacked default | |
391 |
|
393 | |||
392 |
|
394 | |||
393 | Branch 'default' is checked out: |
|
395 | Branch 'default' is checked out: | |
394 |
|
396 | |||
395 | $ hg -R ua parents |
|
397 | $ hg -R ua parents | |
396 | changeset: 12:f21241060d6a |
|
398 | changeset: 12:f21241060d6a | |
397 | user: test |
|
399 | user: test | |
398 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
400 | date: Thu Jan 01 00:00:00 1970 +0000 | |
399 | summary: hacked default |
|
401 | summary: hacked default | |
400 |
|
402 | |||
401 | Test clone with a branch named "@" (issue3677) |
|
403 | Test clone with a branch named "@" (issue3677) | |
402 |
|
404 | |||
403 | $ hg -R ua branch @ |
|
405 | $ hg -R ua branch @ | |
404 | marked working directory as branch @ |
|
406 | marked working directory as branch @ | |
405 | $ hg -R ua commit -m 'created branch @' |
|
407 | $ hg -R ua commit -m 'created branch @' | |
406 | $ hg clone ua atbranch |
|
408 | $ hg clone ua atbranch | |
407 | updating to branch default |
|
409 | updating to branch default | |
408 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
410 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
409 | $ hg -R atbranch heads |
|
411 | $ hg -R atbranch heads | |
410 | changeset: 16:798b6d97153e |
|
412 | changeset: 16:798b6d97153e | |
411 | branch: @ |
|
413 | branch: @ | |
412 | tag: tip |
|
414 | tag: tip | |
413 | parent: 12:f21241060d6a |
|
415 | parent: 12:f21241060d6a | |
414 | user: test |
|
416 | user: test | |
415 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
417 | date: Thu Jan 01 00:00:00 1970 +0000 | |
416 | summary: created branch @ |
|
418 | summary: created branch @ | |
417 |
|
419 | |||
418 | changeset: 15:0aae7cf88f0d |
|
420 | changeset: 15:0aae7cf88f0d | |
419 | branch: stable |
|
421 | branch: stable | |
420 | user: test |
|
422 | user: test | |
421 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
423 | date: Thu Jan 01 00:00:00 1970 +0000 | |
422 | summary: another change for branch stable |
|
424 | summary: another change for branch stable | |
423 |
|
425 | |||
424 | changeset: 12:f21241060d6a |
|
426 | changeset: 12:f21241060d6a | |
425 | user: test |
|
427 | user: test | |
426 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
428 | date: Thu Jan 01 00:00:00 1970 +0000 | |
427 | summary: hacked default |
|
429 | summary: hacked default | |
428 |
|
430 | |||
429 | $ hg -R atbranch parents |
|
431 | $ hg -R atbranch parents | |
430 | changeset: 12:f21241060d6a |
|
432 | changeset: 12:f21241060d6a | |
431 | user: test |
|
433 | user: test | |
432 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
434 | date: Thu Jan 01 00:00:00 1970 +0000 | |
433 | summary: hacked default |
|
435 | summary: hacked default | |
434 |
|
436 | |||
435 |
|
437 | |||
436 | $ rm -r ua atbranch |
|
438 | $ rm -r ua atbranch | |
437 |
|
439 | |||
438 |
|
440 | |||
439 | Testing #<branch>: |
|
441 | Testing #<branch>: | |
440 |
|
442 | |||
441 | $ hg clone -u . a#stable ua |
|
443 | $ hg clone -u . a#stable ua | |
442 | adding changesets |
|
444 | adding changesets | |
443 | adding manifests |
|
445 | adding manifests | |
444 | adding file changes |
|
446 | adding file changes | |
445 | added 14 changesets with 14 changes to 3 files |
|
447 | added 14 changesets with 14 changes to 3 files | |
446 | new changesets acb14030fe0a:0aae7cf88f0d |
|
448 | new changesets acb14030fe0a:0aae7cf88f0d | |
447 | updating to branch stable |
|
449 | updating to branch stable | |
448 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
450 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
449 |
|
451 | |||
450 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
452 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): | |
451 |
|
453 | |||
452 | $ hg -R ua heads |
|
454 | $ hg -R ua heads | |
453 | changeset: 13:0aae7cf88f0d |
|
455 | changeset: 13:0aae7cf88f0d | |
454 | branch: stable |
|
456 | branch: stable | |
455 | tag: tip |
|
457 | tag: tip | |
456 | user: test |
|
458 | user: test | |
457 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
459 | date: Thu Jan 01 00:00:00 1970 +0000 | |
458 | summary: another change for branch stable |
|
460 | summary: another change for branch stable | |
459 |
|
461 | |||
460 | changeset: 10:a7949464abda |
|
462 | changeset: 10:a7949464abda | |
461 | user: test |
|
463 | user: test | |
462 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
464 | date: Thu Jan 01 00:00:00 1970 +0000 | |
463 | summary: test |
|
465 | summary: test | |
464 |
|
466 | |||
465 |
|
467 | |||
466 | Same revision checked out in repo a and ua: |
|
468 | Same revision checked out in repo a and ua: | |
467 |
|
469 | |||
468 | $ hg -R a parents --template "{node|short}\n" |
|
470 | $ hg -R a parents --template "{node|short}\n" | |
469 | e8ece76546a6 |
|
471 | e8ece76546a6 | |
470 | $ hg -R ua parents --template "{node|short}\n" |
|
472 | $ hg -R ua parents --template "{node|short}\n" | |
471 | e8ece76546a6 |
|
473 | e8ece76546a6 | |
472 |
|
474 | |||
473 | $ rm -r ua |
|
475 | $ rm -r ua | |
474 |
|
476 | |||
475 |
|
477 | |||
476 | Testing -u -r <branch>: |
|
478 | Testing -u -r <branch>: | |
477 |
|
479 | |||
478 | $ hg clone -u . -r stable a ua |
|
480 | $ hg clone -u . -r stable a ua | |
479 | adding changesets |
|
481 | adding changesets | |
480 | adding manifests |
|
482 | adding manifests | |
481 | adding file changes |
|
483 | adding file changes | |
482 | added 14 changesets with 14 changes to 3 files |
|
484 | added 14 changesets with 14 changes to 3 files | |
483 | new changesets acb14030fe0a:0aae7cf88f0d |
|
485 | new changesets acb14030fe0a:0aae7cf88f0d | |
484 | updating to branch stable |
|
486 | updating to branch stable | |
485 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
487 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
486 |
|
488 | |||
487 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
489 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): | |
488 |
|
490 | |||
489 | $ hg -R ua heads |
|
491 | $ hg -R ua heads | |
490 | changeset: 13:0aae7cf88f0d |
|
492 | changeset: 13:0aae7cf88f0d | |
491 | branch: stable |
|
493 | branch: stable | |
492 | tag: tip |
|
494 | tag: tip | |
493 | user: test |
|
495 | user: test | |
494 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
496 | date: Thu Jan 01 00:00:00 1970 +0000 | |
495 | summary: another change for branch stable |
|
497 | summary: another change for branch stable | |
496 |
|
498 | |||
497 | changeset: 10:a7949464abda |
|
499 | changeset: 10:a7949464abda | |
498 | user: test |
|
500 | user: test | |
499 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
501 | date: Thu Jan 01 00:00:00 1970 +0000 | |
500 | summary: test |
|
502 | summary: test | |
501 |
|
503 | |||
502 |
|
504 | |||
503 | Same revision checked out in repo a and ua: |
|
505 | Same revision checked out in repo a and ua: | |
504 |
|
506 | |||
505 | $ hg -R a parents --template "{node|short}\n" |
|
507 | $ hg -R a parents --template "{node|short}\n" | |
506 | e8ece76546a6 |
|
508 | e8ece76546a6 | |
507 | $ hg -R ua parents --template "{node|short}\n" |
|
509 | $ hg -R ua parents --template "{node|short}\n" | |
508 | e8ece76546a6 |
|
510 | e8ece76546a6 | |
509 |
|
511 | |||
510 | $ rm -r ua |
|
512 | $ rm -r ua | |
511 |
|
513 | |||
512 |
|
514 | |||
513 | Testing -r <branch>: |
|
515 | Testing -r <branch>: | |
514 |
|
516 | |||
515 | $ hg clone -r stable a ua |
|
517 | $ hg clone -r stable a ua | |
516 | adding changesets |
|
518 | adding changesets | |
517 | adding manifests |
|
519 | adding manifests | |
518 | adding file changes |
|
520 | adding file changes | |
519 | added 14 changesets with 14 changes to 3 files |
|
521 | added 14 changesets with 14 changes to 3 files | |
520 | new changesets acb14030fe0a:0aae7cf88f0d |
|
522 | new changesets acb14030fe0a:0aae7cf88f0d | |
521 | updating to branch stable |
|
523 | updating to branch stable | |
522 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
524 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
523 |
|
525 | |||
524 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): |
|
526 | Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6): | |
525 |
|
527 | |||
526 | $ hg -R ua heads |
|
528 | $ hg -R ua heads | |
527 | changeset: 13:0aae7cf88f0d |
|
529 | changeset: 13:0aae7cf88f0d | |
528 | branch: stable |
|
530 | branch: stable | |
529 | tag: tip |
|
531 | tag: tip | |
530 | user: test |
|
532 | user: test | |
531 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
533 | date: Thu Jan 01 00:00:00 1970 +0000 | |
532 | summary: another change for branch stable |
|
534 | summary: another change for branch stable | |
533 |
|
535 | |||
534 | changeset: 10:a7949464abda |
|
536 | changeset: 10:a7949464abda | |
535 | user: test |
|
537 | user: test | |
536 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
538 | date: Thu Jan 01 00:00:00 1970 +0000 | |
537 | summary: test |
|
539 | summary: test | |
538 |
|
540 | |||
539 |
|
541 | |||
540 | Branch 'stable' is checked out: |
|
542 | Branch 'stable' is checked out: | |
541 |
|
543 | |||
542 | $ hg -R ua parents |
|
544 | $ hg -R ua parents | |
543 | changeset: 13:0aae7cf88f0d |
|
545 | changeset: 13:0aae7cf88f0d | |
544 | branch: stable |
|
546 | branch: stable | |
545 | tag: tip |
|
547 | tag: tip | |
546 | user: test |
|
548 | user: test | |
547 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
549 | date: Thu Jan 01 00:00:00 1970 +0000 | |
548 | summary: another change for branch stable |
|
550 | summary: another change for branch stable | |
549 |
|
551 | |||
550 |
|
552 | |||
551 | $ rm -r ua |
|
553 | $ rm -r ua | |
552 |
|
554 | |||
553 |
|
555 | |||
554 | Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not |
|
556 | Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not | |
555 | iterable in addbranchrevs() |
|
557 | iterable in addbranchrevs() | |
556 |
|
558 | |||
557 | $ cat <<EOF > simpleclone.py |
|
559 | $ cat <<EOF > simpleclone.py | |
558 | > from mercurial import ui, hg |
|
560 | > from mercurial import ui, hg | |
559 | > myui = ui.ui.load() |
|
561 | > myui = ui.ui.load() | |
560 | > repo = hg.repository(myui, 'a') |
|
562 | > repo = hg.repository(myui, 'a') | |
561 | > hg.clone(myui, {}, repo, dest="ua") |
|
563 | > hg.clone(myui, {}, repo, dest="ua") | |
562 | > EOF |
|
564 | > EOF | |
563 |
|
565 | |||
564 | $ $PYTHON simpleclone.py |
|
566 | $ $PYTHON simpleclone.py | |
565 | updating to branch default |
|
567 | updating to branch default | |
566 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
568 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
567 |
|
569 | |||
568 | $ rm -r ua |
|
570 | $ rm -r ua | |
569 |
|
571 | |||
570 | $ cat <<EOF > branchclone.py |
|
572 | $ cat <<EOF > branchclone.py | |
571 | > from mercurial import ui, hg, extensions |
|
573 | > from mercurial import ui, hg, extensions | |
572 | > myui = ui.ui.load() |
|
574 | > myui = ui.ui.load() | |
573 | > extensions.loadall(myui) |
|
575 | > extensions.loadall(myui) | |
574 | > repo = hg.repository(myui, 'a') |
|
576 | > repo = hg.repository(myui, 'a') | |
575 | > hg.clone(myui, {}, repo, dest="ua", branch=["stable",]) |
|
577 | > hg.clone(myui, {}, repo, dest="ua", branch=["stable",]) | |
576 | > EOF |
|
578 | > EOF | |
577 |
|
579 | |||
578 | $ $PYTHON branchclone.py |
|
580 | $ $PYTHON branchclone.py | |
579 | adding changesets |
|
581 | adding changesets | |
580 | adding manifests |
|
582 | adding manifests | |
581 | adding file changes |
|
583 | adding file changes | |
582 | added 14 changesets with 14 changes to 3 files |
|
584 | added 14 changesets with 14 changes to 3 files | |
583 | new changesets acb14030fe0a:0aae7cf88f0d |
|
585 | new changesets acb14030fe0a:0aae7cf88f0d | |
584 | updating to branch stable |
|
586 | updating to branch stable | |
585 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
587 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
586 | $ rm -r ua |
|
588 | $ rm -r ua | |
587 |
|
589 | |||
588 |
|
590 | |||
589 | Test clone with special '@' bookmark: |
|
591 | Test clone with special '@' bookmark: | |
590 | $ cd a |
|
592 | $ cd a | |
591 | $ hg bookmark -r a7949464abda @ # branch point of stable from default |
|
593 | $ hg bookmark -r a7949464abda @ # branch point of stable from default | |
592 | $ hg clone . ../i |
|
594 | $ hg clone . ../i | |
593 | updating to bookmark @ |
|
595 | updating to bookmark @ | |
594 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
596 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
595 | $ hg id -i ../i |
|
597 | $ hg id -i ../i | |
596 | a7949464abda |
|
598 | a7949464abda | |
597 | $ rm -r ../i |
|
599 | $ rm -r ../i | |
598 |
|
600 | |||
599 | $ hg bookmark -f -r stable @ |
|
601 | $ hg bookmark -f -r stable @ | |
600 | $ hg bookmarks |
|
602 | $ hg bookmarks | |
601 | @ 15:0aae7cf88f0d |
|
603 | @ 15:0aae7cf88f0d | |
602 | $ hg clone . ../i |
|
604 | $ hg clone . ../i | |
603 | updating to bookmark @ on branch stable |
|
605 | updating to bookmark @ on branch stable | |
604 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
606 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
605 | $ hg id -i ../i |
|
607 | $ hg id -i ../i | |
606 | 0aae7cf88f0d |
|
608 | 0aae7cf88f0d | |
607 | $ cd "$TESTTMP" |
|
609 | $ cd "$TESTTMP" | |
608 |
|
610 | |||
609 |
|
611 | |||
610 | Testing failures: |
|
612 | Testing failures: | |
611 |
|
613 | |||
612 | $ mkdir fail |
|
614 | $ mkdir fail | |
613 | $ cd fail |
|
615 | $ cd fail | |
614 |
|
616 | |||
615 | No local source |
|
617 | No local source | |
616 |
|
618 | |||
617 | $ hg clone a b |
|
619 | $ hg clone a b | |
618 | abort: repository a not found! |
|
620 | abort: repository a not found! | |
619 | [255] |
|
621 | [255] | |
620 |
|
622 | |||
621 | No remote source |
|
623 | No remote source | |
622 |
|
624 | |||
623 | #if windows |
|
625 | #if windows | |
624 | $ hg clone http://$LOCALIP:3121/a b |
|
626 | $ hg clone http://$LOCALIP:3121/a b | |
625 | abort: error: * (glob) |
|
627 | abort: error: * (glob) | |
626 | [255] |
|
628 | [255] | |
627 | #else |
|
629 | #else | |
628 | $ hg clone http://$LOCALIP:3121/a b |
|
630 | $ hg clone http://$LOCALIP:3121/a b | |
629 | abort: error: *refused* (glob) |
|
631 | abort: error: *refused* (glob) | |
630 | [255] |
|
632 | [255] | |
631 | #endif |
|
633 | #endif | |
632 | $ rm -rf b # work around bug with http clone |
|
634 | $ rm -rf b # work around bug with http clone | |
633 |
|
635 | |||
634 |
|
636 | |||
635 | #if unix-permissions no-root |
|
637 | #if unix-permissions no-root | |
636 |
|
638 | |||
637 | Inaccessible source |
|
639 | Inaccessible source | |
638 |
|
640 | |||
639 | $ mkdir a |
|
641 | $ mkdir a | |
640 | $ chmod 000 a |
|
642 | $ chmod 000 a | |
641 | $ hg clone a b |
|
643 | $ hg clone a b | |
642 | abort: repository a not found! |
|
644 | abort: repository a not found! | |
643 | [255] |
|
645 | [255] | |
644 |
|
646 | |||
645 | Inaccessible destination |
|
647 | Inaccessible destination | |
646 |
|
648 | |||
647 | $ hg init b |
|
649 | $ hg init b | |
648 | $ cd b |
|
650 | $ cd b | |
649 | $ hg clone . ../a |
|
651 | $ hg clone . ../a | |
650 | abort: Permission denied: '../a' |
|
652 | abort: Permission denied: '../a' | |
651 | [255] |
|
653 | [255] | |
652 | $ cd .. |
|
654 | $ cd .. | |
653 | $ chmod 700 a |
|
655 | $ chmod 700 a | |
654 | $ rm -r a b |
|
656 | $ rm -r a b | |
655 |
|
657 | |||
656 | #endif |
|
658 | #endif | |
657 |
|
659 | |||
658 |
|
660 | |||
659 | #if fifo |
|
661 | #if fifo | |
660 |
|
662 | |||
661 | Source of wrong type |
|
663 | Source of wrong type | |
662 |
|
664 | |||
663 | $ mkfifo a |
|
665 | $ mkfifo a | |
664 | $ hg clone a b |
|
666 | $ hg clone a b | |
665 | abort: repository a not found! |
|
667 | abort: repository a not found! | |
666 | [255] |
|
668 | [255] | |
667 | $ rm a |
|
669 | $ rm a | |
668 |
|
670 | |||
669 | #endif |
|
671 | #endif | |
670 |
|
672 | |||
671 | Default destination, same directory |
|
673 | Default destination, same directory | |
672 |
|
674 | |||
673 | $ hg init q |
|
675 | $ hg init q | |
674 | $ hg clone q |
|
676 | $ hg clone q | |
675 | destination directory: q |
|
677 | destination directory: q | |
676 | abort: destination 'q' is not empty |
|
678 | abort: destination 'q' is not empty | |
677 | [255] |
|
679 | [255] | |
678 |
|
680 | |||
679 | destination directory not empty |
|
681 | destination directory not empty | |
680 |
|
682 | |||
681 | $ mkdir a |
|
683 | $ mkdir a | |
682 | $ echo stuff > a/a |
|
684 | $ echo stuff > a/a | |
683 | $ hg clone q a |
|
685 | $ hg clone q a | |
684 | abort: destination 'a' is not empty |
|
686 | abort: destination 'a' is not empty | |
685 | [255] |
|
687 | [255] | |
686 |
|
688 | |||
687 |
|
689 | |||
688 | #if unix-permissions no-root |
|
690 | #if unix-permissions no-root | |
689 |
|
691 | |||
690 | leave existing directory in place after clone failure |
|
692 | leave existing directory in place after clone failure | |
691 |
|
693 | |||
692 | $ hg init c |
|
694 | $ hg init c | |
693 | $ cd c |
|
695 | $ cd c | |
694 | $ echo c > c |
|
696 | $ echo c > c | |
695 | $ hg commit -A -m test |
|
697 | $ hg commit -A -m test | |
696 | adding c |
|
698 | adding c | |
697 | $ chmod -rx .hg/store/data |
|
699 | $ chmod -rx .hg/store/data | |
698 | $ cd .. |
|
700 | $ cd .. | |
699 | $ mkdir d |
|
701 | $ mkdir d | |
700 | $ hg clone c d 2> err |
|
702 | $ hg clone c d 2> err | |
701 | [255] |
|
703 | [255] | |
702 | $ test -d d |
|
704 | $ test -d d | |
703 | $ test -d d/.hg |
|
705 | $ test -d d/.hg | |
704 | [1] |
|
706 | [1] | |
705 |
|
707 | |||
706 | re-enable perm to allow deletion |
|
708 | re-enable perm to allow deletion | |
707 |
|
709 | |||
708 | $ chmod +rx c/.hg/store/data |
|
710 | $ chmod +rx c/.hg/store/data | |
709 |
|
711 | |||
710 | #endif |
|
712 | #endif | |
711 |
|
713 | |||
712 | $ cd .. |
|
714 | $ cd .. | |
713 |
|
715 | |||
714 | Test clone from the repository in (emulated) revlog format 0 (issue4203): |
|
716 | Test clone from the repository in (emulated) revlog format 0 (issue4203): | |
715 |
|
717 | |||
716 | $ mkdir issue4203 |
|
718 | $ mkdir issue4203 | |
717 | $ mkdir -p src/.hg |
|
719 | $ mkdir -p src/.hg | |
718 | $ echo foo > src/foo |
|
720 | $ echo foo > src/foo | |
719 | $ hg -R src add src/foo |
|
721 | $ hg -R src add src/foo | |
720 | $ hg -R src commit -m '#0' |
|
722 | $ hg -R src commit -m '#0' | |
721 | $ hg -R src log -q |
|
723 | $ hg -R src log -q | |
722 | 0:e1bab28bca43 |
|
724 | 0:e1bab28bca43 | |
723 | $ hg clone -U -q src dst |
|
725 | $ hg clone -U -q src dst | |
724 | $ hg -R dst log -q |
|
726 | $ hg -R dst log -q | |
725 | 0:e1bab28bca43 |
|
727 | 0:e1bab28bca43 | |
726 |
|
728 | |||
727 | Create repositories to test auto sharing functionality |
|
729 | Create repositories to test auto sharing functionality | |
728 |
|
730 | |||
729 | $ cat >> $HGRCPATH << EOF |
|
731 | $ cat >> $HGRCPATH << EOF | |
730 | > [extensions] |
|
732 | > [extensions] | |
731 | > share= |
|
733 | > share= | |
732 | > EOF |
|
734 | > EOF | |
733 |
|
735 | |||
734 | $ hg init empty |
|
736 | $ hg init empty | |
735 | $ hg init source1a |
|
737 | $ hg init source1a | |
736 | $ cd source1a |
|
738 | $ cd source1a | |
737 | $ echo initial1 > foo |
|
739 | $ echo initial1 > foo | |
738 | $ hg -q commit -A -m initial |
|
740 | $ hg -q commit -A -m initial | |
739 | $ echo second > foo |
|
741 | $ echo second > foo | |
740 | $ hg commit -m second |
|
742 | $ hg commit -m second | |
741 | $ cd .. |
|
743 | $ cd .. | |
742 |
|
744 | |||
743 | $ hg init filteredrev0 |
|
745 | $ hg init filteredrev0 | |
744 | $ cd filteredrev0 |
|
746 | $ cd filteredrev0 | |
745 | $ cat >> .hg/hgrc << EOF |
|
747 | $ cat >> .hg/hgrc << EOF | |
746 | > [experimental] |
|
748 | > [experimental] | |
747 | > evolution.createmarkers=True |
|
749 | > evolution.createmarkers=True | |
748 | > EOF |
|
750 | > EOF | |
749 | $ echo initial1 > foo |
|
751 | $ echo initial1 > foo | |
750 | $ hg -q commit -A -m initial0 |
|
752 | $ hg -q commit -A -m initial0 | |
751 | $ hg -q up -r null |
|
753 | $ hg -q up -r null | |
752 | $ echo initial2 > foo |
|
754 | $ echo initial2 > foo | |
753 | $ hg -q commit -A -m initial1 |
|
755 | $ hg -q commit -A -m initial1 | |
754 | $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8 |
|
756 | $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8 | |
755 | obsoleted 1 changesets |
|
757 | obsoleted 1 changesets | |
756 | $ cd .. |
|
758 | $ cd .. | |
757 |
|
759 | |||
758 | $ hg -q clone --pull source1a source1b |
|
760 | $ hg -q clone --pull source1a source1b | |
759 | $ cd source1a |
|
761 | $ cd source1a | |
760 | $ hg bookmark bookA |
|
762 | $ hg bookmark bookA | |
761 | $ echo 1a > foo |
|
763 | $ echo 1a > foo | |
762 | $ hg commit -m 1a |
|
764 | $ hg commit -m 1a | |
763 | $ cd ../source1b |
|
765 | $ cd ../source1b | |
764 | $ hg -q up -r 0 |
|
766 | $ hg -q up -r 0 | |
765 | $ echo head1 > foo |
|
767 | $ echo head1 > foo | |
766 | $ hg commit -m head1 |
|
768 | $ hg commit -m head1 | |
767 | created new head |
|
769 | created new head | |
768 | $ hg bookmark head1 |
|
770 | $ hg bookmark head1 | |
769 | $ hg -q up -r 0 |
|
771 | $ hg -q up -r 0 | |
770 | $ echo head2 > foo |
|
772 | $ echo head2 > foo | |
771 | $ hg commit -m head2 |
|
773 | $ hg commit -m head2 | |
772 | created new head |
|
774 | created new head | |
773 | $ hg bookmark head2 |
|
775 | $ hg bookmark head2 | |
774 | $ hg -q up -r 0 |
|
776 | $ hg -q up -r 0 | |
775 | $ hg branch branch1 |
|
777 | $ hg branch branch1 | |
776 | marked working directory as branch branch1 |
|
778 | marked working directory as branch branch1 | |
777 | (branches are permanent and global, did you want a bookmark?) |
|
779 | (branches are permanent and global, did you want a bookmark?) | |
778 | $ echo branch1 > foo |
|
780 | $ echo branch1 > foo | |
779 | $ hg commit -m branch1 |
|
781 | $ hg commit -m branch1 | |
780 | $ hg -q up -r 0 |
|
782 | $ hg -q up -r 0 | |
781 | $ hg branch branch2 |
|
783 | $ hg branch branch2 | |
782 | marked working directory as branch branch2 |
|
784 | marked working directory as branch branch2 | |
783 | $ echo branch2 > foo |
|
785 | $ echo branch2 > foo | |
784 | $ hg commit -m branch2 |
|
786 | $ hg commit -m branch2 | |
785 | $ cd .. |
|
787 | $ cd .. | |
786 | $ hg init source2 |
|
788 | $ hg init source2 | |
787 | $ cd source2 |
|
789 | $ cd source2 | |
788 | $ echo initial2 > foo |
|
790 | $ echo initial2 > foo | |
789 | $ hg -q commit -A -m initial2 |
|
791 | $ hg -q commit -A -m initial2 | |
790 | $ echo second > foo |
|
792 | $ echo second > foo | |
791 | $ hg commit -m second |
|
793 | $ hg commit -m second | |
792 | $ cd .. |
|
794 | $ cd .. | |
793 |
|
795 | |||
794 | Clone with auto share from an empty repo should not result in share |
|
796 | Clone with auto share from an empty repo should not result in share | |
795 |
|
797 | |||
796 | $ mkdir share |
|
798 | $ mkdir share | |
797 | $ hg --config share.pool=share clone empty share-empty |
|
799 | $ hg --config share.pool=share clone empty share-empty | |
798 | (not using pooled storage: remote appears to be empty) |
|
800 | (not using pooled storage: remote appears to be empty) | |
799 | updating to branch default |
|
801 | updating to branch default | |
800 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
802 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
801 | $ ls share |
|
803 | $ ls share | |
802 | $ test -d share-empty/.hg/store |
|
804 | $ test -d share-empty/.hg/store | |
803 | $ test -f share-empty/.hg/sharedpath |
|
805 | $ test -f share-empty/.hg/sharedpath | |
804 | [1] |
|
806 | [1] | |
805 |
|
807 | |||
806 | Clone with auto share from a repo with filtered revision 0 should not result in share |
|
808 | Clone with auto share from a repo with filtered revision 0 should not result in share | |
807 |
|
809 | |||
808 | $ hg --config share.pool=share clone filteredrev0 share-filtered |
|
810 | $ hg --config share.pool=share clone filteredrev0 share-filtered | |
809 | (not using pooled storage: unable to resolve identity of remote) |
|
811 | (not using pooled storage: unable to resolve identity of remote) | |
810 | requesting all changes |
|
812 | requesting all changes | |
811 | adding changesets |
|
813 | adding changesets | |
812 | adding manifests |
|
814 | adding manifests | |
813 | adding file changes |
|
815 | adding file changes | |
814 | added 1 changesets with 1 changes to 1 files |
|
816 | added 1 changesets with 1 changes to 1 files | |
815 | new changesets e082c1832e09 |
|
817 | new changesets e082c1832e09 | |
816 | updating to branch default |
|
818 | updating to branch default | |
817 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
819 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
818 |
|
820 | |||
819 | Clone from repo with content should result in shared store being created |
|
821 | Clone from repo with content should result in shared store being created | |
820 |
|
822 | |||
821 | $ hg --config share.pool=share clone source1a share-dest1a |
|
823 | $ hg --config share.pool=share clone source1a share-dest1a | |
822 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
824 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) | |
823 | requesting all changes |
|
825 | requesting all changes | |
824 | adding changesets |
|
826 | adding changesets | |
825 | adding manifests |
|
827 | adding manifests | |
826 | adding file changes |
|
828 | adding file changes | |
827 | added 3 changesets with 3 changes to 1 files |
|
829 | added 3 changesets with 3 changes to 1 files | |
828 | new changesets b5f04eac9d8f:e5bfe23c0b47 |
|
830 | new changesets b5f04eac9d8f:e5bfe23c0b47 | |
829 | searching for changes |
|
831 | searching for changes | |
830 | no changes found |
|
832 | no changes found | |
831 | adding remote bookmark bookA |
|
833 | adding remote bookmark bookA | |
832 | updating working directory |
|
834 | updating working directory | |
833 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
835 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
834 |
|
836 | |||
835 | The shared repo should have been created |
|
837 | The shared repo should have been created | |
836 |
|
838 | |||
837 | $ ls share |
|
839 | $ ls share | |
838 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 |
|
840 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 | |
839 |
|
841 | |||
840 | The destination should point to it |
|
842 | The destination should point to it | |
841 |
|
843 | |||
842 | $ cat share-dest1a/.hg/sharedpath; echo |
|
844 | $ cat share-dest1a/.hg/sharedpath; echo | |
843 | $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg |
|
845 | $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg | |
844 |
|
846 | |||
845 | The destination should have bookmarks |
|
847 | The destination should have bookmarks | |
846 |
|
848 | |||
847 | $ hg -R share-dest1a bookmarks |
|
849 | $ hg -R share-dest1a bookmarks | |
848 | bookA 2:e5bfe23c0b47 |
|
850 | bookA 2:e5bfe23c0b47 | |
849 |
|
851 | |||
850 | The default path should be the remote, not the share |
|
852 | The default path should be the remote, not the share | |
851 |
|
853 | |||
852 | $ hg -R share-dest1a config paths.default |
|
854 | $ hg -R share-dest1a config paths.default | |
853 | $TESTTMP/source1a |
|
855 | $TESTTMP/source1a | |
854 |
|
856 | |||
855 | Clone with existing share dir should result in pull + share |
|
857 | Clone with existing share dir should result in pull + share | |
856 |
|
858 | |||
857 | $ hg --config share.pool=share clone source1b share-dest1b |
|
859 | $ hg --config share.pool=share clone source1b share-dest1b | |
858 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
860 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) | |
859 | searching for changes |
|
861 | searching for changes | |
860 | adding changesets |
|
862 | adding changesets | |
861 | adding manifests |
|
863 | adding manifests | |
862 | adding file changes |
|
864 | adding file changes | |
863 | added 4 changesets with 4 changes to 1 files (+4 heads) |
|
865 | added 4 changesets with 4 changes to 1 files (+4 heads) | |
864 | adding remote bookmark head1 |
|
866 | adding remote bookmark head1 | |
865 | adding remote bookmark head2 |
|
867 | adding remote bookmark head2 | |
866 | new changesets 4a8dc1ab4c13:6bacf4683960 |
|
868 | new changesets 4a8dc1ab4c13:6bacf4683960 | |
867 | updating working directory |
|
869 | updating working directory | |
868 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
870 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
869 |
|
871 | |||
870 | $ ls share |
|
872 | $ ls share | |
871 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 |
|
873 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 | |
872 |
|
874 | |||
873 | $ cat share-dest1b/.hg/sharedpath; echo |
|
875 | $ cat share-dest1b/.hg/sharedpath; echo | |
874 | $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg |
|
876 | $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg | |
875 |
|
877 | |||
876 | We only get bookmarks from the remote, not everything in the share |
|
878 | We only get bookmarks from the remote, not everything in the share | |
877 |
|
879 | |||
878 | $ hg -R share-dest1b bookmarks |
|
880 | $ hg -R share-dest1b bookmarks | |
879 | head1 3:4a8dc1ab4c13 |
|
881 | head1 3:4a8dc1ab4c13 | |
880 | head2 4:99f71071f117 |
|
882 | head2 4:99f71071f117 | |
881 |
|
883 | |||
882 | Default path should be source, not share. |
|
884 | Default path should be source, not share. | |
883 |
|
885 | |||
884 | $ hg -R share-dest1b config paths.default |
|
886 | $ hg -R share-dest1b config paths.default | |
885 | $TESTTMP/source1b |
|
887 | $TESTTMP/source1b | |
886 |
|
888 | |||
887 | Checked out revision should be head of default branch |
|
889 | Checked out revision should be head of default branch | |
888 |
|
890 | |||
889 | $ hg -R share-dest1b log -r . |
|
891 | $ hg -R share-dest1b log -r . | |
890 | changeset: 4:99f71071f117 |
|
892 | changeset: 4:99f71071f117 | |
891 | bookmark: head2 |
|
893 | bookmark: head2 | |
892 | parent: 0:b5f04eac9d8f |
|
894 | parent: 0:b5f04eac9d8f | |
893 | user: test |
|
895 | user: test | |
894 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
896 | date: Thu Jan 01 00:00:00 1970 +0000 | |
895 | summary: head2 |
|
897 | summary: head2 | |
896 |
|
898 | |||
897 |
|
899 | |||
898 | Clone from unrelated repo should result in new share |
|
900 | Clone from unrelated repo should result in new share | |
899 |
|
901 | |||
900 | $ hg --config share.pool=share clone source2 share-dest2 |
|
902 | $ hg --config share.pool=share clone source2 share-dest2 | |
901 | (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e) |
|
903 | (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e) | |
902 | requesting all changes |
|
904 | requesting all changes | |
903 | adding changesets |
|
905 | adding changesets | |
904 | adding manifests |
|
906 | adding manifests | |
905 | adding file changes |
|
907 | adding file changes | |
906 | added 2 changesets with 2 changes to 1 files |
|
908 | added 2 changesets with 2 changes to 1 files | |
907 | new changesets 22aeff664783:63cf6c3dba4a |
|
909 | new changesets 22aeff664783:63cf6c3dba4a | |
908 | searching for changes |
|
910 | searching for changes | |
909 | no changes found |
|
911 | no changes found | |
910 | updating working directory |
|
912 | updating working directory | |
911 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
913 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
912 |
|
914 | |||
913 | $ ls share |
|
915 | $ ls share | |
914 | 22aeff664783fd44c6d9b435618173c118c3448e |
|
916 | 22aeff664783fd44c6d9b435618173c118c3448e | |
915 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 |
|
917 | b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1 | |
916 |
|
918 | |||
917 | remote naming mode works as advertised |
|
919 | remote naming mode works as advertised | |
918 |
|
920 | |||
919 | $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a |
|
921 | $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a | |
920 | (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde) |
|
922 | (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde) | |
921 | requesting all changes |
|
923 | requesting all changes | |
922 | adding changesets |
|
924 | adding changesets | |
923 | adding manifests |
|
925 | adding manifests | |
924 | adding file changes |
|
926 | adding file changes | |
925 | added 3 changesets with 3 changes to 1 files |
|
927 | added 3 changesets with 3 changes to 1 files | |
926 | new changesets b5f04eac9d8f:e5bfe23c0b47 |
|
928 | new changesets b5f04eac9d8f:e5bfe23c0b47 | |
927 | searching for changes |
|
929 | searching for changes | |
928 | no changes found |
|
930 | no changes found | |
929 | adding remote bookmark bookA |
|
931 | adding remote bookmark bookA | |
930 | updating working directory |
|
932 | updating working directory | |
931 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
933 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
932 |
|
934 | |||
933 | $ ls shareremote |
|
935 | $ ls shareremote | |
934 | 195bb1fcdb595c14a6c13e0269129ed78f6debde |
|
936 | 195bb1fcdb595c14a6c13e0269129ed78f6debde | |
935 |
|
937 | |||
936 | $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b |
|
938 | $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b | |
937 | (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46) |
|
939 | (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46) | |
938 | requesting all changes |
|
940 | requesting all changes | |
939 | adding changesets |
|
941 | adding changesets | |
940 | adding manifests |
|
942 | adding manifests | |
941 | adding file changes |
|
943 | adding file changes | |
942 | added 6 changesets with 6 changes to 1 files (+4 heads) |
|
944 | added 6 changesets with 6 changes to 1 files (+4 heads) | |
943 | new changesets b5f04eac9d8f:6bacf4683960 |
|
945 | new changesets b5f04eac9d8f:6bacf4683960 | |
944 | searching for changes |
|
946 | searching for changes | |
945 | no changes found |
|
947 | no changes found | |
946 | adding remote bookmark head1 |
|
948 | adding remote bookmark head1 | |
947 | adding remote bookmark head2 |
|
949 | adding remote bookmark head2 | |
948 | updating working directory |
|
950 | updating working directory | |
949 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
951 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
950 |
|
952 | |||
951 | $ ls shareremote |
|
953 | $ ls shareremote | |
952 | 195bb1fcdb595c14a6c13e0269129ed78f6debde |
|
954 | 195bb1fcdb595c14a6c13e0269129ed78f6debde | |
953 | c0d4f83847ca2a873741feb7048a45085fd47c46 |
|
955 | c0d4f83847ca2a873741feb7048a45085fd47c46 | |
954 |
|
956 | |||
955 | request to clone a single revision is respected in sharing mode |
|
957 | request to clone a single revision is respected in sharing mode | |
956 |
|
958 | |||
957 | $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev |
|
959 | $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev | |
958 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
960 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) | |
959 | adding changesets |
|
961 | adding changesets | |
960 | adding manifests |
|
962 | adding manifests | |
961 | adding file changes |
|
963 | adding file changes | |
962 | added 2 changesets with 2 changes to 1 files |
|
964 | added 2 changesets with 2 changes to 1 files | |
963 | new changesets b5f04eac9d8f:4a8dc1ab4c13 |
|
965 | new changesets b5f04eac9d8f:4a8dc1ab4c13 | |
964 | no changes found |
|
966 | no changes found | |
965 | adding remote bookmark head1 |
|
967 | adding remote bookmark head1 | |
966 | updating working directory |
|
968 | updating working directory | |
967 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
969 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
968 |
|
970 | |||
969 | $ hg -R share-1arev log -G |
|
971 | $ hg -R share-1arev log -G | |
970 | @ changeset: 1:4a8dc1ab4c13 |
|
972 | @ changeset: 1:4a8dc1ab4c13 | |
971 | | bookmark: head1 |
|
973 | | bookmark: head1 | |
972 | | tag: tip |
|
974 | | tag: tip | |
973 | | user: test |
|
975 | | user: test | |
974 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
976 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
975 | | summary: head1 |
|
977 | | summary: head1 | |
976 | | |
|
978 | | | |
977 | o changeset: 0:b5f04eac9d8f |
|
979 | o changeset: 0:b5f04eac9d8f | |
978 | user: test |
|
980 | user: test | |
979 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
981 | date: Thu Jan 01 00:00:00 1970 +0000 | |
980 | summary: initial |
|
982 | summary: initial | |
981 |
|
983 | |||
982 |
|
984 | |||
983 | making another clone should only pull down requested rev |
|
985 | making another clone should only pull down requested rev | |
984 |
|
986 | |||
985 | $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev |
|
987 | $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev | |
986 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
988 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) | |
987 | searching for changes |
|
989 | searching for changes | |
988 | adding changesets |
|
990 | adding changesets | |
989 | adding manifests |
|
991 | adding manifests | |
990 | adding file changes |
|
992 | adding file changes | |
991 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
993 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
992 | adding remote bookmark head1 |
|
994 | adding remote bookmark head1 | |
993 | adding remote bookmark head2 |
|
995 | adding remote bookmark head2 | |
994 | new changesets 99f71071f117 |
|
996 | new changesets 99f71071f117 | |
995 | updating working directory |
|
997 | updating working directory | |
996 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
998 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
997 |
|
999 | |||
998 | $ hg -R share-1brev log -G |
|
1000 | $ hg -R share-1brev log -G | |
999 | @ changeset: 2:99f71071f117 |
|
1001 | @ changeset: 2:99f71071f117 | |
1000 | | bookmark: head2 |
|
1002 | | bookmark: head2 | |
1001 | | tag: tip |
|
1003 | | tag: tip | |
1002 | | parent: 0:b5f04eac9d8f |
|
1004 | | parent: 0:b5f04eac9d8f | |
1003 | | user: test |
|
1005 | | user: test | |
1004 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1006 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1005 | | summary: head2 |
|
1007 | | summary: head2 | |
1006 | | |
|
1008 | | | |
1007 | | o changeset: 1:4a8dc1ab4c13 |
|
1009 | | o changeset: 1:4a8dc1ab4c13 | |
1008 | |/ bookmark: head1 |
|
1010 | |/ bookmark: head1 | |
1009 | | user: test |
|
1011 | | user: test | |
1010 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1012 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1011 | | summary: head1 |
|
1013 | | summary: head1 | |
1012 | | |
|
1014 | | | |
1013 | o changeset: 0:b5f04eac9d8f |
|
1015 | o changeset: 0:b5f04eac9d8f | |
1014 | user: test |
|
1016 | user: test | |
1015 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1017 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1016 | summary: initial |
|
1018 | summary: initial | |
1017 |
|
1019 | |||
1018 |
|
1020 | |||
1019 | Request to clone a single branch is respected in sharing mode |
|
1021 | Request to clone a single branch is respected in sharing mode | |
1020 |
|
1022 | |||
1021 | $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1 |
|
1023 | $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1 | |
1022 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1024 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) | |
1023 | adding changesets |
|
1025 | adding changesets | |
1024 | adding manifests |
|
1026 | adding manifests | |
1025 | adding file changes |
|
1027 | adding file changes | |
1026 | added 2 changesets with 2 changes to 1 files |
|
1028 | added 2 changesets with 2 changes to 1 files | |
1027 | new changesets b5f04eac9d8f:5f92a6c1a1b1 |
|
1029 | new changesets b5f04eac9d8f:5f92a6c1a1b1 | |
1028 | no changes found |
|
1030 | no changes found | |
1029 | updating working directory |
|
1031 | updating working directory | |
1030 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1032 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1031 |
|
1033 | |||
1032 | $ hg -R share-1bbranch1 log -G |
|
1034 | $ hg -R share-1bbranch1 log -G | |
1033 | o changeset: 1:5f92a6c1a1b1 |
|
1035 | o changeset: 1:5f92a6c1a1b1 | |
1034 | | branch: branch1 |
|
1036 | | branch: branch1 | |
1035 | | tag: tip |
|
1037 | | tag: tip | |
1036 | | user: test |
|
1038 | | user: test | |
1037 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1039 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1038 | | summary: branch1 |
|
1040 | | summary: branch1 | |
1039 | | |
|
1041 | | | |
1040 | @ changeset: 0:b5f04eac9d8f |
|
1042 | @ changeset: 0:b5f04eac9d8f | |
1041 | user: test |
|
1043 | user: test | |
1042 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1044 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1043 | summary: initial |
|
1045 | summary: initial | |
1044 |
|
1046 | |||
1045 |
|
1047 | |||
1046 | $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2 |
|
1048 | $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2 | |
1047 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1049 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) | |
1048 | searching for changes |
|
1050 | searching for changes | |
1049 | adding changesets |
|
1051 | adding changesets | |
1050 | adding manifests |
|
1052 | adding manifests | |
1051 | adding file changes |
|
1053 | adding file changes | |
1052 | added 1 changesets with 1 changes to 1 files (+1 heads) |
|
1054 | added 1 changesets with 1 changes to 1 files (+1 heads) | |
1053 | new changesets 6bacf4683960 |
|
1055 | new changesets 6bacf4683960 | |
1054 | updating working directory |
|
1056 | updating working directory | |
1055 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1057 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1056 |
|
1058 | |||
1057 | $ hg -R share-1bbranch2 log -G |
|
1059 | $ hg -R share-1bbranch2 log -G | |
1058 | o changeset: 2:6bacf4683960 |
|
1060 | o changeset: 2:6bacf4683960 | |
1059 | | branch: branch2 |
|
1061 | | branch: branch2 | |
1060 | | tag: tip |
|
1062 | | tag: tip | |
1061 | | parent: 0:b5f04eac9d8f |
|
1063 | | parent: 0:b5f04eac9d8f | |
1062 | | user: test |
|
1064 | | user: test | |
1063 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1065 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1064 | | summary: branch2 |
|
1066 | | summary: branch2 | |
1065 | | |
|
1067 | | | |
1066 | | o changeset: 1:5f92a6c1a1b1 |
|
1068 | | o changeset: 1:5f92a6c1a1b1 | |
1067 | |/ branch: branch1 |
|
1069 | |/ branch: branch1 | |
1068 | | user: test |
|
1070 | | user: test | |
1069 | | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1071 | | date: Thu Jan 01 00:00:00 1970 +0000 | |
1070 | | summary: branch1 |
|
1072 | | summary: branch1 | |
1071 | | |
|
1073 | | | |
1072 | @ changeset: 0:b5f04eac9d8f |
|
1074 | @ changeset: 0:b5f04eac9d8f | |
1073 | user: test |
|
1075 | user: test | |
1074 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1076 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1075 | summary: initial |
|
1077 | summary: initial | |
1076 |
|
1078 | |||
1077 |
|
1079 | |||
1078 | -U is respected in share clone mode |
|
1080 | -U is respected in share clone mode | |
1079 |
|
1081 | |||
1080 | $ hg --config share.pool=share clone -U source1a share-1anowc |
|
1082 | $ hg --config share.pool=share clone -U source1a share-1anowc | |
1081 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1083 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) | |
1082 | searching for changes |
|
1084 | searching for changes | |
1083 | no changes found |
|
1085 | no changes found | |
1084 | adding remote bookmark bookA |
|
1086 | adding remote bookmark bookA | |
1085 |
|
1087 | |||
1086 | $ ls share-1anowc |
|
1088 | $ ls share-1anowc | |
1087 |
|
1089 | |||
1088 | Test that auto sharing doesn't cause failure of "hg clone local remote" |
|
1090 | Test that auto sharing doesn't cause failure of "hg clone local remote" | |
1089 |
|
1091 | |||
1090 | $ cd $TESTTMP |
|
1092 | $ cd $TESTTMP | |
1091 | $ hg -R a id -r 0 |
|
1093 | $ hg -R a id -r 0 | |
1092 | acb14030fe0a |
|
1094 | acb14030fe0a | |
1093 | $ hg id -R remote -r 0 |
|
1095 | $ hg id -R remote -r 0 | |
1094 | abort: repository remote not found! |
|
1096 | abort: repository remote not found! | |
1095 | [255] |
|
1097 | [255] | |
1096 | $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote |
|
1098 | $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote | |
1097 | $ hg -R remote id -r 0 |
|
1099 | $ hg -R remote id -r 0 | |
1098 | acb14030fe0a |
|
1100 | acb14030fe0a | |
1099 |
|
1101 | |||
1100 | Cloning into pooled storage doesn't race (issue5104) |
|
1102 | Cloning into pooled storage doesn't race (issue5104) | |
1101 |
|
1103 | |||
1102 | $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 & |
|
1104 | $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 & | |
1103 | $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1 |
|
1105 | $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1 | |
1104 | $ wait |
|
1106 | $ wait | |
1105 |
|
1107 | |||
1106 | $ hg -R share-destrace1 log -r tip |
|
1108 | $ hg -R share-destrace1 log -r tip | |
1107 | changeset: 2:e5bfe23c0b47 |
|
1109 | changeset: 2:e5bfe23c0b47 | |
1108 | bookmark: bookA |
|
1110 | bookmark: bookA | |
1109 | tag: tip |
|
1111 | tag: tip | |
1110 | user: test |
|
1112 | user: test | |
1111 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1113 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1112 | summary: 1a |
|
1114 | summary: 1a | |
1113 |
|
1115 | |||
1114 |
|
1116 | |||
1115 | $ hg -R share-destrace2 log -r tip |
|
1117 | $ hg -R share-destrace2 log -r tip | |
1116 | changeset: 2:e5bfe23c0b47 |
|
1118 | changeset: 2:e5bfe23c0b47 | |
1117 | bookmark: bookA |
|
1119 | bookmark: bookA | |
1118 | tag: tip |
|
1120 | tag: tip | |
1119 | user: test |
|
1121 | user: test | |
1120 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1122 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1121 | summary: 1a |
|
1123 | summary: 1a | |
1122 |
|
1124 | |||
1123 | One repo should be new, the other should be shared from the pool. We |
|
1125 | One repo should be new, the other should be shared from the pool. We | |
1124 | don't care which is which, so we just make sure we always print the |
|
1126 | don't care which is which, so we just make sure we always print the | |
1125 | one containing "new pooled" first, then one one containing "existing |
|
1127 | one containing "new pooled" first, then one one containing "existing | |
1126 | pooled". |
|
1128 | pooled". | |
1127 |
|
1129 | |||
1128 | $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock |
|
1130 | $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock | |
1129 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1131 | (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) | |
1130 | requesting all changes |
|
1132 | requesting all changes | |
1131 | adding changesets |
|
1133 | adding changesets | |
1132 | adding manifests |
|
1134 | adding manifests | |
1133 | adding file changes |
|
1135 | adding file changes | |
1134 | added 3 changesets with 3 changes to 1 files |
|
1136 | added 3 changesets with 3 changes to 1 files | |
1135 | new changesets b5f04eac9d8f:e5bfe23c0b47 |
|
1137 | new changesets b5f04eac9d8f:e5bfe23c0b47 | |
1136 | searching for changes |
|
1138 | searching for changes | |
1137 | no changes found |
|
1139 | no changes found | |
1138 | adding remote bookmark bookA |
|
1140 | adding remote bookmark bookA | |
1139 | updating working directory |
|
1141 | updating working directory | |
1140 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1142 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1141 |
|
1143 | |||
1142 | $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock |
|
1144 | $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock | |
1143 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) |
|
1145 | (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1) | |
1144 | searching for changes |
|
1146 | searching for changes | |
1145 | no changes found |
|
1147 | no changes found | |
1146 | adding remote bookmark bookA |
|
1148 | adding remote bookmark bookA | |
1147 | updating working directory |
|
1149 | updating working directory | |
1148 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1150 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1149 |
|
1151 | |||
1150 | SEC: check for unsafe ssh url |
|
1152 | SEC: check for unsafe ssh url | |
1151 |
|
1153 | |||
1152 | $ cat >> $HGRCPATH << EOF |
|
1154 | $ cat >> $HGRCPATH << EOF | |
1153 | > [ui] |
|
1155 | > [ui] | |
1154 | > ssh = sh -c "read l; read l; read l" |
|
1156 | > ssh = sh -c "read l; read l; read l" | |
1155 | > EOF |
|
1157 | > EOF | |
1156 |
|
1158 | |||
1157 | $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path' |
|
1159 | $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path' | |
1158 | abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' |
|
1160 | abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' | |
1159 | [255] |
|
1161 | [255] | |
1160 | $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path' |
|
1162 | $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path' | |
1161 | abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' |
|
1163 | abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path' | |
1162 | [255] |
|
1164 | [255] | |
1163 | $ hg clone 'ssh://fakehost|touch%20owned/path' |
|
1165 | $ hg clone 'ssh://fakehost|touch%20owned/path' | |
1164 | abort: no suitable response from remote hg! |
|
1166 | abort: no suitable response from remote hg! | |
1165 | [255] |
|
1167 | [255] | |
1166 | $ hg clone 'ssh://fakehost%7Ctouch%20owned/path' |
|
1168 | $ hg clone 'ssh://fakehost%7Ctouch%20owned/path' | |
1167 | abort: no suitable response from remote hg! |
|
1169 | abort: no suitable response from remote hg! | |
1168 | [255] |
|
1170 | [255] | |
1169 |
|
1171 | |||
1170 | $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path' |
|
1172 | $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path' | |
1171 | abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path' |
|
1173 | abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path' | |
1172 | [255] |
|
1174 | [255] | |
1173 |
|
1175 | |||
1174 | #if windows |
|
1176 | #if windows | |
1175 | $ hg clone "ssh://%26touch%20owned%20/" --debug |
|
1177 | $ hg clone "ssh://%26touch%20owned%20/" --debug | |
1176 | running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio" |
|
1178 | running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio" | |
1177 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) |
|
1179 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) | |
1178 | sending hello command |
|
1180 | sending hello command | |
1179 | sending between command |
|
1181 | sending between command | |
1180 | abort: no suitable response from remote hg! |
|
1182 | abort: no suitable response from remote hg! | |
1181 | [255] |
|
1183 | [255] | |
1182 | $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug |
|
1184 | $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug | |
1183 | running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio" |
|
1185 | running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio" | |
1184 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) |
|
1186 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) | |
1185 | sending hello command |
|
1187 | sending hello command | |
1186 | sending between command |
|
1188 | sending between command | |
1187 | abort: no suitable response from remote hg! |
|
1189 | abort: no suitable response from remote hg! | |
1188 | [255] |
|
1190 | [255] | |
1189 | #else |
|
1191 | #else | |
1190 | $ hg clone "ssh://%3btouch%20owned%20/" --debug |
|
1192 | $ hg clone "ssh://%3btouch%20owned%20/" --debug | |
1191 | running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio' |
|
1193 | running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio' | |
1192 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) |
|
1194 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) | |
1193 | sending hello command |
|
1195 | sending hello command | |
1194 | sending between command |
|
1196 | sending between command | |
1195 | abort: no suitable response from remote hg! |
|
1197 | abort: no suitable response from remote hg! | |
1196 | [255] |
|
1198 | [255] | |
1197 | $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug |
|
1199 | $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug | |
1198 | running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio' |
|
1200 | running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio' | |
1199 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) |
|
1201 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) | |
1200 | sending hello command |
|
1202 | sending hello command | |
1201 | sending between command |
|
1203 | sending between command | |
1202 | abort: no suitable response from remote hg! |
|
1204 | abort: no suitable response from remote hg! | |
1203 | [255] |
|
1205 | [255] | |
1204 | #endif |
|
1206 | #endif | |
1205 |
|
1207 | |||
1206 | $ hg clone "ssh://v-alid.example.com/" --debug |
|
1208 | $ hg clone "ssh://v-alid.example.com/" --debug | |
1207 | running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re) |
|
1209 | running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re) | |
1208 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) |
|
1210 | sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !) | |
1209 | sending hello command |
|
1211 | sending hello command | |
1210 | sending between command |
|
1212 | sending between command | |
1211 | abort: no suitable response from remote hg! |
|
1213 | abort: no suitable response from remote hg! | |
1212 | [255] |
|
1214 | [255] | |
1213 |
|
1215 | |||
1214 | We should not have created a file named owned - if it exists, the |
|
1216 | We should not have created a file named owned - if it exists, the | |
1215 | attack succeeded. |
|
1217 | attack succeeded. | |
1216 | $ if test -f owned; then echo 'you got owned'; fi |
|
1218 | $ if test -f owned; then echo 'you got owned'; fi | |
1217 |
|
1219 | |||
1218 | Cloning without fsmonitor enabled does not print a warning for small repos |
|
1220 | Cloning without fsmonitor enabled does not print a warning for small repos | |
1219 |
|
1221 | |||
1220 | $ hg clone a fsmonitor-default |
|
1222 | $ hg clone a fsmonitor-default | |
1221 | updating to bookmark @ on branch stable |
|
1223 | updating to bookmark @ on branch stable | |
1222 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1224 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1223 |
|
1225 | |||
1224 | Lower the warning threshold to simulate a large repo |
|
1226 | Lower the warning threshold to simulate a large repo | |
1225 |
|
1227 | |||
1226 | $ cat >> $HGRCPATH << EOF |
|
1228 | $ cat >> $HGRCPATH << EOF | |
1227 | > [fsmonitor] |
|
1229 | > [fsmonitor] | |
1228 | > warn_update_file_count = 2 |
|
1230 | > warn_update_file_count = 2 | |
1229 | > EOF |
|
1231 | > EOF | |
1230 |
|
1232 | |||
1231 | We should see a warning about no fsmonitor on supported platforms |
|
1233 | We should see a warning about no fsmonitor on supported platforms | |
1232 |
|
1234 | |||
1233 | #if linuxormacos no-fsmonitor |
|
1235 | #if linuxormacos no-fsmonitor | |
1234 | $ hg clone a nofsmonitor |
|
1236 | $ hg clone a nofsmonitor | |
1235 | updating to bookmark @ on branch stable |
|
1237 | updating to bookmark @ on branch stable | |
1236 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") |
|
1238 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") | |
1237 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1239 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1238 | #else |
|
1240 | #else | |
1239 | $ hg clone a nofsmonitor |
|
1241 | $ hg clone a nofsmonitor | |
1240 | updating to bookmark @ on branch stable |
|
1242 | updating to bookmark @ on branch stable | |
1241 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1243 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1242 | #endif |
|
1244 | #endif | |
1243 |
|
1245 | |||
1244 | We should not see warning about fsmonitor when it is enabled |
|
1246 | We should not see warning about fsmonitor when it is enabled | |
1245 |
|
1247 | |||
1246 | #if fsmonitor |
|
1248 | #if fsmonitor | |
1247 | $ hg clone a fsmonitor-enabled |
|
1249 | $ hg clone a fsmonitor-enabled | |
1248 | updating to bookmark @ on branch stable |
|
1250 | updating to bookmark @ on branch stable | |
1249 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1251 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1250 | #endif |
|
1252 | #endif | |
1251 |
|
1253 | |||
1252 | We can disable the fsmonitor warning |
|
1254 | We can disable the fsmonitor warning | |
1253 |
|
1255 | |||
1254 | $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning |
|
1256 | $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning | |
1255 | updating to bookmark @ on branch stable |
|
1257 | updating to bookmark @ on branch stable | |
1256 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1258 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1257 |
|
1259 | |||
1258 | Loaded fsmonitor but disabled in config should still print warning |
|
1260 | Loaded fsmonitor but disabled in config should still print warning | |
1259 |
|
1261 | |||
1260 | #if linuxormacos fsmonitor |
|
1262 | #if linuxormacos fsmonitor | |
1261 | $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off |
|
1263 | $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off | |
1262 | updating to bookmark @ on branch stable |
|
1264 | updating to bookmark @ on branch stable | |
1263 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !) |
|
1265 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !) | |
1264 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1266 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1265 | #endif |
|
1267 | #endif | |
1266 |
|
1268 | |||
1267 | Warning not printed if working directory isn't empty |
|
1269 | Warning not printed if working directory isn't empty | |
1268 |
|
1270 | |||
1269 | $ hg -q clone a fsmonitor-update |
|
1271 | $ hg -q clone a fsmonitor-update | |
1270 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?) |
|
1272 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?) | |
1271 | $ cd fsmonitor-update |
|
1273 | $ cd fsmonitor-update | |
1272 | $ hg up acb14030fe0a |
|
1274 | $ hg up acb14030fe0a | |
1273 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1275 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1274 | (leaving bookmark @) |
|
1276 | (leaving bookmark @) | |
1275 | $ hg up cf0fe1914066 |
|
1277 | $ hg up cf0fe1914066 | |
1276 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1278 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1277 |
|
1279 | |||
1278 | `hg update` from null revision also prints |
|
1280 | `hg update` from null revision also prints | |
1279 |
|
1281 | |||
1280 | $ hg up null |
|
1282 | $ hg up null | |
1281 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1283 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1282 |
|
1284 | |||
1283 | #if linuxormacos no-fsmonitor |
|
1285 | #if linuxormacos no-fsmonitor | |
1284 | $ hg up cf0fe1914066 |
|
1286 | $ hg up cf0fe1914066 | |
1285 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") |
|
1287 | (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") | |
1286 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1288 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1287 | #else |
|
1289 | #else | |
1288 | $ hg up cf0fe1914066 |
|
1290 | $ hg up cf0fe1914066 | |
1289 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1291 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1290 | #endif |
|
1292 | #endif | |
1291 |
|
1293 | |||
1292 | $ cd .. |
|
1294 | $ cd .. | |
1293 |
|
1295 |
@@ -1,708 +1,712 b'' | |||||
1 | Create test repository: |
|
1 | Create test repository: | |
2 |
|
2 | |||
3 | $ hg init repo |
|
3 | $ hg init repo | |
4 | $ cd repo |
|
4 | $ cd repo | |
5 | $ echo x1 > x.txt |
|
5 | $ echo x1 > x.txt | |
6 |
|
6 | |||
7 | $ hg init foo |
|
7 | $ hg init foo | |
8 | $ cd foo |
|
8 | $ cd foo | |
9 | $ echo y1 > y.txt |
|
9 | $ echo y1 > y.txt | |
10 |
|
10 | |||
11 | $ hg init bar |
|
11 | $ hg init bar | |
12 | $ cd bar |
|
12 | $ cd bar | |
13 | $ echo z1 > z.txt |
|
13 | $ echo z1 > z.txt | |
14 |
|
14 | |||
15 | $ cd .. |
|
15 | $ cd .. | |
16 | $ echo 'bar = bar' > .hgsub |
|
16 | $ echo 'bar = bar' > .hgsub | |
17 |
|
17 | |||
18 | $ cd .. |
|
18 | $ cd .. | |
19 | $ echo 'foo = foo' > .hgsub |
|
19 | $ echo 'foo = foo' > .hgsub | |
20 |
|
20 | |||
21 | Add files --- .hgsub files must go first to trigger subrepos: |
|
21 | Add files --- .hgsub files must go first to trigger subrepos: | |
22 |
|
22 | |||
23 | $ hg add -S .hgsub |
|
23 | $ hg add -S .hgsub | |
24 | $ hg add -S foo/.hgsub |
|
24 | $ hg add -S foo/.hgsub | |
25 | $ hg add -S foo/bar |
|
25 | $ hg add -S foo/bar | |
26 | adding foo/bar/z.txt |
|
26 | adding foo/bar/z.txt | |
27 | $ hg add -S |
|
27 | $ hg add -S | |
28 | adding x.txt |
|
28 | adding x.txt | |
29 | adding foo/y.txt |
|
29 | adding foo/y.txt | |
30 |
|
30 | |||
31 | Test recursive status without committing anything: |
|
31 | Test recursive status without committing anything: | |
32 |
|
32 | |||
33 | $ hg status -S |
|
33 | $ hg status -S | |
34 | A .hgsub |
|
34 | A .hgsub | |
35 | A foo/.hgsub |
|
35 | A foo/.hgsub | |
36 | A foo/bar/z.txt |
|
36 | A foo/bar/z.txt | |
37 | A foo/y.txt |
|
37 | A foo/y.txt | |
38 | A x.txt |
|
38 | A x.txt | |
39 |
|
39 | |||
40 | Test recursive diff without committing anything: |
|
40 | Test recursive diff without committing anything: | |
41 |
|
41 | |||
42 | $ hg diff --nodates -S foo |
|
42 | $ hg diff --nodates -S foo | |
43 | diff -r 000000000000 foo/.hgsub |
|
43 | diff -r 000000000000 foo/.hgsub | |
44 | --- /dev/null |
|
44 | --- /dev/null | |
45 | +++ b/foo/.hgsub |
|
45 | +++ b/foo/.hgsub | |
46 | @@ -0,0 +1,1 @@ |
|
46 | @@ -0,0 +1,1 @@ | |
47 | +bar = bar |
|
47 | +bar = bar | |
48 | diff -r 000000000000 foo/y.txt |
|
48 | diff -r 000000000000 foo/y.txt | |
49 | --- /dev/null |
|
49 | --- /dev/null | |
50 | +++ b/foo/y.txt |
|
50 | +++ b/foo/y.txt | |
51 | @@ -0,0 +1,1 @@ |
|
51 | @@ -0,0 +1,1 @@ | |
52 | +y1 |
|
52 | +y1 | |
53 | diff -r 000000000000 foo/bar/z.txt |
|
53 | diff -r 000000000000 foo/bar/z.txt | |
54 | --- /dev/null |
|
54 | --- /dev/null | |
55 | +++ b/foo/bar/z.txt |
|
55 | +++ b/foo/bar/z.txt | |
56 | @@ -0,0 +1,1 @@ |
|
56 | @@ -0,0 +1,1 @@ | |
57 | +z1 |
|
57 | +z1 | |
58 |
|
58 | |||
59 | Commits: |
|
59 | Commits: | |
60 |
|
60 | |||
61 | $ hg commit -m fails |
|
61 | $ hg commit -m fails | |
62 | abort: uncommitted changes in subrepository "foo" |
|
62 | abort: uncommitted changes in subrepository "foo" | |
63 | (use --subrepos for recursive commit) |
|
63 | (use --subrepos for recursive commit) | |
64 | [255] |
|
64 | [255] | |
65 |
|
65 | |||
66 | The --subrepos flag overwrite the config setting: |
|
66 | The --subrepos flag overwrite the config setting: | |
67 |
|
67 | |||
68 | $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos |
|
68 | $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos | |
69 | committing subrepository foo |
|
69 | committing subrepository foo | |
70 | committing subrepository foo/bar |
|
70 | committing subrepository foo/bar | |
71 |
|
71 | |||
72 | $ cd foo |
|
72 | $ cd foo | |
73 | $ echo y2 >> y.txt |
|
73 | $ echo y2 >> y.txt | |
74 | $ hg commit -m 0-1-0 |
|
74 | $ hg commit -m 0-1-0 | |
75 |
|
75 | |||
76 | $ cd bar |
|
76 | $ cd bar | |
77 | $ echo z2 >> z.txt |
|
77 | $ echo z2 >> z.txt | |
78 | $ hg commit -m 0-1-1 |
|
78 | $ hg commit -m 0-1-1 | |
79 |
|
79 | |||
80 | $ cd .. |
|
80 | $ cd .. | |
81 | $ hg commit -m 0-2-1 |
|
81 | $ hg commit -m 0-2-1 | |
82 |
|
82 | |||
83 | $ cd .. |
|
83 | $ cd .. | |
84 | $ hg commit -m 1-2-1 |
|
84 | $ hg commit -m 1-2-1 | |
85 |
|
85 | |||
86 | Change working directory: |
|
86 | Change working directory: | |
87 |
|
87 | |||
88 | $ echo y3 >> foo/y.txt |
|
88 | $ echo y3 >> foo/y.txt | |
89 | $ echo z3 >> foo/bar/z.txt |
|
89 | $ echo z3 >> foo/bar/z.txt | |
90 | $ hg status -S |
|
90 | $ hg status -S | |
91 | M foo/bar/z.txt |
|
91 | M foo/bar/z.txt | |
92 | M foo/y.txt |
|
92 | M foo/y.txt | |
93 | $ hg diff --nodates -S |
|
93 | $ hg diff --nodates -S | |
94 | diff -r d254738c5f5e foo/y.txt |
|
94 | diff -r d254738c5f5e foo/y.txt | |
95 | --- a/foo/y.txt |
|
95 | --- a/foo/y.txt | |
96 | +++ b/foo/y.txt |
|
96 | +++ b/foo/y.txt | |
97 | @@ -1,2 +1,3 @@ |
|
97 | @@ -1,2 +1,3 @@ | |
98 | y1 |
|
98 | y1 | |
99 | y2 |
|
99 | y2 | |
100 | +y3 |
|
100 | +y3 | |
101 | diff -r 9647f22de499 foo/bar/z.txt |
|
101 | diff -r 9647f22de499 foo/bar/z.txt | |
102 | --- a/foo/bar/z.txt |
|
102 | --- a/foo/bar/z.txt | |
103 | +++ b/foo/bar/z.txt |
|
103 | +++ b/foo/bar/z.txt | |
104 | @@ -1,2 +1,3 @@ |
|
104 | @@ -1,2 +1,3 @@ | |
105 | z1 |
|
105 | z1 | |
106 | z2 |
|
106 | z2 | |
107 | +z3 |
|
107 | +z3 | |
108 |
|
108 | |||
109 | Status call crossing repository boundaries: |
|
109 | Status call crossing repository boundaries: | |
110 |
|
110 | |||
111 | $ hg status -S foo/bar/z.txt |
|
111 | $ hg status -S foo/bar/z.txt | |
112 | M foo/bar/z.txt |
|
112 | M foo/bar/z.txt | |
113 | $ hg status -S -I 'foo/?.txt' |
|
113 | $ hg status -S -I 'foo/?.txt' | |
114 | M foo/y.txt |
|
114 | M foo/y.txt | |
115 | $ hg status -S -I '**/?.txt' |
|
115 | $ hg status -S -I '**/?.txt' | |
116 | M foo/bar/z.txt |
|
116 | M foo/bar/z.txt | |
117 | M foo/y.txt |
|
117 | M foo/y.txt | |
118 | $ hg diff --nodates -S -I '**/?.txt' |
|
118 | $ hg diff --nodates -S -I '**/?.txt' | |
119 | diff -r d254738c5f5e foo/y.txt |
|
119 | diff -r d254738c5f5e foo/y.txt | |
120 | --- a/foo/y.txt |
|
120 | --- a/foo/y.txt | |
121 | +++ b/foo/y.txt |
|
121 | +++ b/foo/y.txt | |
122 | @@ -1,2 +1,3 @@ |
|
122 | @@ -1,2 +1,3 @@ | |
123 | y1 |
|
123 | y1 | |
124 | y2 |
|
124 | y2 | |
125 | +y3 |
|
125 | +y3 | |
126 | diff -r 9647f22de499 foo/bar/z.txt |
|
126 | diff -r 9647f22de499 foo/bar/z.txt | |
127 | --- a/foo/bar/z.txt |
|
127 | --- a/foo/bar/z.txt | |
128 | +++ b/foo/bar/z.txt |
|
128 | +++ b/foo/bar/z.txt | |
129 | @@ -1,2 +1,3 @@ |
|
129 | @@ -1,2 +1,3 @@ | |
130 | z1 |
|
130 | z1 | |
131 | z2 |
|
131 | z2 | |
132 | +z3 |
|
132 | +z3 | |
133 |
|
133 | |||
134 | Status from within a subdirectory: |
|
134 | Status from within a subdirectory: | |
135 |
|
135 | |||
136 | $ mkdir dir |
|
136 | $ mkdir dir | |
137 | $ cd dir |
|
137 | $ cd dir | |
138 | $ echo a1 > a.txt |
|
138 | $ echo a1 > a.txt | |
139 | $ hg status -S |
|
139 | $ hg status -S | |
140 | M foo/bar/z.txt |
|
140 | M foo/bar/z.txt | |
141 | M foo/y.txt |
|
141 | M foo/y.txt | |
142 | ? dir/a.txt |
|
142 | ? dir/a.txt | |
143 | $ hg diff --nodates -S |
|
143 | $ hg diff --nodates -S | |
144 | diff -r d254738c5f5e foo/y.txt |
|
144 | diff -r d254738c5f5e foo/y.txt | |
145 | --- a/foo/y.txt |
|
145 | --- a/foo/y.txt | |
146 | +++ b/foo/y.txt |
|
146 | +++ b/foo/y.txt | |
147 | @@ -1,2 +1,3 @@ |
|
147 | @@ -1,2 +1,3 @@ | |
148 | y1 |
|
148 | y1 | |
149 | y2 |
|
149 | y2 | |
150 | +y3 |
|
150 | +y3 | |
151 | diff -r 9647f22de499 foo/bar/z.txt |
|
151 | diff -r 9647f22de499 foo/bar/z.txt | |
152 | --- a/foo/bar/z.txt |
|
152 | --- a/foo/bar/z.txt | |
153 | +++ b/foo/bar/z.txt |
|
153 | +++ b/foo/bar/z.txt | |
154 | @@ -1,2 +1,3 @@ |
|
154 | @@ -1,2 +1,3 @@ | |
155 | z1 |
|
155 | z1 | |
156 | z2 |
|
156 | z2 | |
157 | +z3 |
|
157 | +z3 | |
158 |
|
158 | |||
159 | Status with relative path: |
|
159 | Status with relative path: | |
160 |
|
160 | |||
161 | $ hg status -S .. |
|
161 | $ hg status -S .. | |
162 | M ../foo/bar/z.txt |
|
162 | M ../foo/bar/z.txt | |
163 | M ../foo/y.txt |
|
163 | M ../foo/y.txt | |
164 | ? a.txt |
|
164 | ? a.txt | |
165 |
|
165 | |||
166 | XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as |
|
166 | XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as | |
167 | added instead of modified. |
|
167 | added instead of modified. | |
168 | $ hg status -S .. --config extensions.largefiles= |
|
168 | $ hg status -S .. --config extensions.largefiles= | |
169 | M ../foo/bar/z.txt |
|
169 | M ../foo/bar/z.txt | |
170 | M ../foo/y.txt |
|
170 | M ../foo/y.txt | |
171 | ? a.txt |
|
171 | ? a.txt | |
172 |
|
172 | |||
173 | $ hg diff --nodates -S .. |
|
173 | $ hg diff --nodates -S .. | |
174 | diff -r d254738c5f5e foo/y.txt |
|
174 | diff -r d254738c5f5e foo/y.txt | |
175 | --- a/foo/y.txt |
|
175 | --- a/foo/y.txt | |
176 | +++ b/foo/y.txt |
|
176 | +++ b/foo/y.txt | |
177 | @@ -1,2 +1,3 @@ |
|
177 | @@ -1,2 +1,3 @@ | |
178 | y1 |
|
178 | y1 | |
179 | y2 |
|
179 | y2 | |
180 | +y3 |
|
180 | +y3 | |
181 | diff -r 9647f22de499 foo/bar/z.txt |
|
181 | diff -r 9647f22de499 foo/bar/z.txt | |
182 | --- a/foo/bar/z.txt |
|
182 | --- a/foo/bar/z.txt | |
183 | +++ b/foo/bar/z.txt |
|
183 | +++ b/foo/bar/z.txt | |
184 | @@ -1,2 +1,3 @@ |
|
184 | @@ -1,2 +1,3 @@ | |
185 | z1 |
|
185 | z1 | |
186 | z2 |
|
186 | z2 | |
187 | +z3 |
|
187 | +z3 | |
188 | $ cd .. |
|
188 | $ cd .. | |
189 |
|
189 | |||
190 | Cleanup and final commit: |
|
190 | Cleanup and final commit: | |
191 |
|
191 | |||
192 | $ rm -r dir |
|
192 | $ rm -r dir | |
193 | $ hg commit --subrepos -m 2-3-2 |
|
193 | $ hg commit --subrepos -m 2-3-2 | |
194 | committing subrepository foo |
|
194 | committing subrepository foo | |
195 | committing subrepository foo/bar |
|
195 | committing subrepository foo/bar | |
196 |
|
196 | |||
197 | Test explicit path commands within subrepos: add/forget |
|
197 | Test explicit path commands within subrepos: add/forget | |
198 | $ echo z1 > foo/bar/z2.txt |
|
198 | $ echo z1 > foo/bar/z2.txt | |
199 | $ hg status -S |
|
199 | $ hg status -S | |
200 | ? foo/bar/z2.txt |
|
200 | ? foo/bar/z2.txt | |
201 | $ hg add foo/bar/z2.txt |
|
201 | $ hg add foo/bar/z2.txt | |
202 | $ hg status -S |
|
202 | $ hg status -S | |
203 | A foo/bar/z2.txt |
|
203 | A foo/bar/z2.txt | |
204 | $ hg forget foo/bar/z2.txt |
|
204 | $ hg forget foo/bar/z2.txt | |
205 | $ hg status -S |
|
205 | $ hg status -S | |
206 | ? foo/bar/z2.txt |
|
206 | ? foo/bar/z2.txt | |
207 | $ hg forget foo/bar/z2.txt |
|
207 | $ hg forget foo/bar/z2.txt | |
208 | not removing foo/bar/z2.txt: file is already untracked |
|
208 | not removing foo/bar/z2.txt: file is already untracked | |
209 | [1] |
|
209 | [1] | |
210 | $ hg status -S |
|
210 | $ hg status -S | |
211 | ? foo/bar/z2.txt |
|
211 | ? foo/bar/z2.txt | |
212 | $ rm foo/bar/z2.txt |
|
212 | $ rm foo/bar/z2.txt | |
213 |
|
213 | |||
214 | Log with the relationships between repo and its subrepo: |
|
214 | Log with the relationships between repo and its subrepo: | |
215 |
|
215 | |||
216 | $ hg log --template '{rev}:{node|short} {desc}\n' |
|
216 | $ hg log --template '{rev}:{node|short} {desc}\n' | |
217 | 2:1326fa26d0c0 2-3-2 |
|
217 | 2:1326fa26d0c0 2-3-2 | |
218 | 1:4b3c9ff4f66b 1-2-1 |
|
218 | 1:4b3c9ff4f66b 1-2-1 | |
219 | 0:23376cbba0d8 0-0-0 |
|
219 | 0:23376cbba0d8 0-0-0 | |
220 |
|
220 | |||
221 | $ hg -R foo log --template '{rev}:{node|short} {desc}\n' |
|
221 | $ hg -R foo log --template '{rev}:{node|short} {desc}\n' | |
222 | 3:65903cebad86 2-3-2 |
|
222 | 3:65903cebad86 2-3-2 | |
223 | 2:d254738c5f5e 0-2-1 |
|
223 | 2:d254738c5f5e 0-2-1 | |
224 | 1:8629ce7dcc39 0-1-0 |
|
224 | 1:8629ce7dcc39 0-1-0 | |
225 | 0:af048e97ade2 0-0-0 |
|
225 | 0:af048e97ade2 0-0-0 | |
226 |
|
226 | |||
227 | $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n' |
|
227 | $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n' | |
228 | 2:31ecbdafd357 2-3-2 |
|
228 | 2:31ecbdafd357 2-3-2 | |
229 | 1:9647f22de499 0-1-1 |
|
229 | 1:9647f22de499 0-1-1 | |
230 | 0:4904098473f9 0-0-0 |
|
230 | 0:4904098473f9 0-0-0 | |
231 |
|
231 | |||
232 | Status between revisions: |
|
232 | Status between revisions: | |
233 |
|
233 | |||
234 | $ hg status -S |
|
234 | $ hg status -S | |
235 | $ hg status -S --rev 0:1 |
|
235 | $ hg status -S --rev 0:1 | |
236 | M .hgsubstate |
|
236 | M .hgsubstate | |
237 | M foo/.hgsubstate |
|
237 | M foo/.hgsubstate | |
238 | M foo/bar/z.txt |
|
238 | M foo/bar/z.txt | |
239 | M foo/y.txt |
|
239 | M foo/y.txt | |
240 | $ hg diff --nodates -S -I '**/?.txt' --rev 0:1 |
|
240 | $ hg diff --nodates -S -I '**/?.txt' --rev 0:1 | |
241 | diff -r af048e97ade2 -r d254738c5f5e foo/y.txt |
|
241 | diff -r af048e97ade2 -r d254738c5f5e foo/y.txt | |
242 | --- a/foo/y.txt |
|
242 | --- a/foo/y.txt | |
243 | +++ b/foo/y.txt |
|
243 | +++ b/foo/y.txt | |
244 | @@ -1,1 +1,2 @@ |
|
244 | @@ -1,1 +1,2 @@ | |
245 | y1 |
|
245 | y1 | |
246 | +y2 |
|
246 | +y2 | |
247 | diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt |
|
247 | diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt | |
248 | --- a/foo/bar/z.txt |
|
248 | --- a/foo/bar/z.txt | |
249 | +++ b/foo/bar/z.txt |
|
249 | +++ b/foo/bar/z.txt | |
250 | @@ -1,1 +1,2 @@ |
|
250 | @@ -1,1 +1,2 @@ | |
251 | z1 |
|
251 | z1 | |
252 | +z2 |
|
252 | +z2 | |
253 |
|
253 | |||
254 | #if serve |
|
254 | #if serve | |
255 | $ cd .. |
|
255 | $ cd .. | |
256 | $ hg serve -R repo --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log |
|
256 | $ hg serve -R repo --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log | |
257 | adding = $TESTTMP/repo |
|
257 | adding = $TESTTMP/repo | |
258 | adding foo = $TESTTMP/repo/foo |
|
258 | adding foo = $TESTTMP/repo/foo | |
259 | adding foo/bar = $TESTTMP/repo/foo/bar |
|
259 | adding foo/bar = $TESTTMP/repo/foo/bar | |
260 | listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?) |
|
260 | listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?) | |
261 | adding = $TESTTMP/repo (?) |
|
261 | adding = $TESTTMP/repo (?) | |
262 | adding foo = $TESTTMP/repo/foo (?) |
|
262 | adding foo = $TESTTMP/repo/foo (?) | |
263 | adding foo/bar = $TESTTMP/repo/foo/bar (?) |
|
263 | adding foo/bar = $TESTTMP/repo/foo/bar (?) | |
264 | $ cat hg1.pid >> $DAEMON_PIDS |
|
264 | $ cat hg1.pid >> $DAEMON_PIDS | |
265 |
|
265 | |||
266 | $ hg clone http://localhost:$HGPORT clone --config progress.disable=True |
|
266 | $ hg clone http://localhost:$HGPORT clone --config progress.disable=True | |
267 | requesting all changes |
|
267 | requesting all changes | |
268 | adding changesets |
|
268 | adding changesets | |
269 | adding manifests |
|
269 | adding manifests | |
270 | adding file changes |
|
270 | adding file changes | |
271 | added 3 changesets with 5 changes to 3 files |
|
271 | added 3 changesets with 5 changes to 3 files | |
272 | new changesets 23376cbba0d8:1326fa26d0c0 |
|
272 | new changesets 23376cbba0d8:1326fa26d0c0 | |
273 | updating to branch default |
|
273 | updating to branch default | |
274 | cloning subrepo foo from http://localhost:$HGPORT/foo |
|
274 | cloning subrepo foo from http://localhost:$HGPORT/foo | |
275 | requesting all changes |
|
275 | requesting all changes | |
276 | adding changesets |
|
276 | adding changesets | |
277 | adding manifests |
|
277 | adding manifests | |
278 | adding file changes |
|
278 | adding file changes | |
279 | added 4 changesets with 7 changes to 3 files |
|
279 | added 4 changesets with 7 changes to 3 files | |
280 | new changesets af048e97ade2:65903cebad86 |
|
280 | new changesets af048e97ade2:65903cebad86 | |
281 | cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar |
|
281 | cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar | |
282 | requesting all changes |
|
282 | requesting all changes | |
283 | adding changesets |
|
283 | adding changesets | |
284 | adding manifests |
|
284 | adding manifests | |
285 | adding file changes |
|
285 | adding file changes | |
286 | added 3 changesets with 3 changes to 1 files |
|
286 | added 3 changesets with 3 changes to 1 files | |
287 | new changesets 4904098473f9:31ecbdafd357 |
|
287 | new changesets 4904098473f9:31ecbdafd357 | |
288 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
288 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
289 |
|
289 | |||
290 | $ cat clone/foo/bar/z.txt |
|
290 | $ cat clone/foo/bar/z.txt | |
291 | z1 |
|
291 | z1 | |
292 | z2 |
|
292 | z2 | |
293 | z3 |
|
293 | z3 | |
294 |
|
294 | |||
295 | Clone pooling from a remote URL will share the top level repo and the subrepos, |
|
295 | Clone pooling from a remote URL will share the top level repo and the subrepos, | |
296 | even if they are referenced by remote URL. |
|
296 | even if they are referenced by remote URL. | |
297 |
|
297 | |||
298 | $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \ |
|
298 | $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \ | |
299 | > clone http://localhost:$HGPORT shared |
|
299 | > clone http://localhost:$HGPORT shared | |
300 | (sharing from new pooled repository 23376cbba0d87c15906bb3652584927c140907bf) |
|
300 | (sharing from new pooled repository 23376cbba0d87c15906bb3652584927c140907bf) | |
301 | requesting all changes |
|
301 | requesting all changes | |
302 | adding changesets |
|
302 | adding changesets | |
303 | adding manifests |
|
303 | adding manifests | |
304 | adding file changes |
|
304 | adding file changes | |
305 | added 3 changesets with 5 changes to 3 files |
|
305 | added 3 changesets with 5 changes to 3 files | |
306 | new changesets 23376cbba0d8:1326fa26d0c0 |
|
306 | new changesets 23376cbba0d8:1326fa26d0c0 | |
307 | searching for changes |
|
307 | searching for changes | |
308 | no changes found |
|
308 | no changes found | |
309 | updating working directory |
|
309 | updating working directory | |
310 | cloning subrepo foo from http://localhost:$HGPORT/foo |
|
310 | cloning subrepo foo from http://localhost:$HGPORT/foo | |
311 | (sharing from new pooled repository af048e97ade2e236f754f05d07013e586af0f8bf) |
|
311 | (sharing from new pooled repository af048e97ade2e236f754f05d07013e586af0f8bf) | |
312 | requesting all changes |
|
312 | requesting all changes | |
313 | adding changesets |
|
313 | adding changesets | |
314 | adding manifests |
|
314 | adding manifests | |
315 | adding file changes |
|
315 | adding file changes | |
316 | added 4 changesets with 7 changes to 3 files |
|
316 | added 4 changesets with 7 changes to 3 files | |
317 | new changesets af048e97ade2:65903cebad86 |
|
317 | new changesets af048e97ade2:65903cebad86 | |
318 | searching for changes |
|
318 | searching for changes | |
319 | no changes found |
|
319 | no changes found | |
320 | cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar |
|
320 | cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar | |
321 | (sharing from new pooled repository 4904098473f96c900fec436dad267edd4da59fad) |
|
321 | (sharing from new pooled repository 4904098473f96c900fec436dad267edd4da59fad) | |
322 | requesting all changes |
|
322 | requesting all changes | |
323 | adding changesets |
|
323 | adding changesets | |
324 | adding manifests |
|
324 | adding manifests | |
325 | adding file changes |
|
325 | adding file changes | |
326 | added 3 changesets with 3 changes to 1 files |
|
326 | added 3 changesets with 3 changes to 1 files | |
327 | new changesets 4904098473f9:31ecbdafd357 |
|
327 | new changesets 4904098473f9:31ecbdafd357 | |
328 | searching for changes |
|
328 | searching for changes | |
329 | no changes found |
|
329 | no changes found | |
330 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
330 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
331 |
|
331 | |||
332 | $ cat access.log |
|
332 | $ cat access.log | |
333 | * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
333 | * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) | |
334 | * "GET /?cmd=batch HTTP/1.1" 200 - * (glob) |
|
334 | * "GET /?cmd=batch HTTP/1.1" 200 - * (glob) | |
335 | * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob) |
|
335 | * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob) | |
336 | * "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
336 | * "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) | |
337 | * "GET /foo?cmd=batch HTTP/1.1" 200 - * (glob) |
|
337 | * "GET /foo?cmd=batch HTTP/1.1" 200 - * (glob) | |
338 | * "GET /foo?cmd=getbundle HTTP/1.1" 200 - * (glob) |
|
338 | * "GET /foo?cmd=getbundle HTTP/1.1" 200 - * (glob) | |
339 | * "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
339 | * "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) | |
340 | * "GET /foo/bar?cmd=batch HTTP/1.1" 200 - * (glob) |
|
340 | * "GET /foo/bar?cmd=batch HTTP/1.1" 200 - * (glob) | |
341 | * "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - * (glob) |
|
341 | * "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - * (glob) | |
342 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
342 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) | |
343 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
343 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
344 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
344 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob) | |
345 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
345 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
346 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
346 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
347 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D1326fa26d0c00d2146c63b56bb6a45149d7325ac x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
347 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D1326fa26d0c00d2146c63b56bb6a45149d7325ac x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
348 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=1326fa26d0c00d2146c63b56bb6a45149d7325ac&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
348 | $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=1326fa26d0c00d2146c63b56bb6a45149d7325ac&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
349 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
349 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) | |
350 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
350 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
351 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
351 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob) | |
352 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
352 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
353 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
353 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
354 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D65903cebad86f1a84bd4f1134f62fa7dcb7a1c98 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
354 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D65903cebad86f1a84bd4f1134f62fa7dcb7a1c98 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
355 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
355 | $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
356 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
356 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) | |
357 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
357 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
358 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) |
|
358 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob) | |
359 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
359 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
360 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
360 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
361 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D31ecbdafd357f54b281c9bd1d681bb90de219e22 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
361 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D31ecbdafd357f54b281c9bd1d681bb90de219e22 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
362 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=31ecbdafd357f54b281c9bd1d681bb90de219e22&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) |
|
362 | $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=31ecbdafd357f54b281c9bd1d681bb90de219e22&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob) | |
363 |
|
363 | |||
364 | $ killdaemons.py |
|
364 | $ killdaemons.py | |
365 | $ rm hg1.pid error.log access.log |
|
365 | $ rm hg1.pid error.log access.log | |
366 | $ cd repo |
|
366 | $ cd repo | |
367 | #endif |
|
367 | #endif | |
368 |
|
368 | |||
369 | Enable progress extension for archive tests: |
|
369 | Enable progress extension for archive tests: | |
370 |
|
370 | |||
371 | $ cp $HGRCPATH $HGRCPATH.no-progress |
|
371 | $ cp $HGRCPATH $HGRCPATH.no-progress | |
372 | $ cat >> $HGRCPATH <<EOF |
|
372 | $ cat >> $HGRCPATH <<EOF | |
373 | > [progress] |
|
373 | > [progress] | |
374 | > disable=False |
|
374 | > disable=False | |
375 | > assume-tty = 1 |
|
375 | > assume-tty = 1 | |
376 | > delay = 0 |
|
376 | > delay = 0 | |
377 | > # set changedelay really large so we don't see nested topics |
|
377 | > # set changedelay really large so we don't see nested topics | |
378 | > changedelay = 30000 |
|
378 | > changedelay = 30000 | |
379 | > format = topic bar number |
|
379 | > format = topic bar number | |
380 | > refresh = 0 |
|
380 | > refresh = 0 | |
381 | > width = 60 |
|
381 | > width = 60 | |
382 | > EOF |
|
382 | > EOF | |
383 |
|
383 | |||
384 | Test archiving to a directory tree (the doubled lines in the output |
|
384 | Test archiving to a directory tree (the doubled lines in the output | |
385 | only show up in the test output, not in real usage): |
|
385 | only show up in the test output, not in real usage): | |
386 |
|
386 | |||
387 | $ hg archive --subrepos ../archive |
|
387 | $ hg archive --subrepos ../archive | |
388 | \r (no-eol) (esc) |
|
388 | \r (no-eol) (esc) | |
389 | archiving [ ] 0/3\r (no-eol) (esc) |
|
389 | archiving [ ] 0/3\r (no-eol) (esc) | |
390 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
390 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
391 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
391 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
392 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
392 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
393 | \r (no-eol) (esc) |
|
393 | \r (no-eol) (esc) | |
394 | \r (no-eol) (esc) |
|
394 | \r (no-eol) (esc) | |
395 | archiving (foo) [ ] 0/3\r (no-eol) (esc) |
|
395 | archiving (foo) [ ] 0/3\r (no-eol) (esc) | |
396 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) |
|
396 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) | |
397 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) |
|
397 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) | |
398 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) |
|
398 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) | |
399 | \r (no-eol) (esc) |
|
399 | \r (no-eol) (esc) | |
400 | \r (no-eol) (esc) |
|
400 | \r (no-eol) (esc) | |
401 | archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) |
|
401 | archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) | |
402 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc) |
|
402 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc) | |
403 | \r (no-eol) (esc) |
|
403 | \r (no-eol) (esc) | |
404 | $ find ../archive | sort |
|
404 | $ find ../archive | sort | |
405 | ../archive |
|
405 | ../archive | |
406 | ../archive/.hg_archival.txt |
|
406 | ../archive/.hg_archival.txt | |
407 | ../archive/.hgsub |
|
407 | ../archive/.hgsub | |
408 | ../archive/.hgsubstate |
|
408 | ../archive/.hgsubstate | |
409 | ../archive/foo |
|
409 | ../archive/foo | |
410 | ../archive/foo/.hgsub |
|
410 | ../archive/foo/.hgsub | |
411 | ../archive/foo/.hgsubstate |
|
411 | ../archive/foo/.hgsubstate | |
412 | ../archive/foo/bar |
|
412 | ../archive/foo/bar | |
413 | ../archive/foo/bar/z.txt |
|
413 | ../archive/foo/bar/z.txt | |
414 | ../archive/foo/y.txt |
|
414 | ../archive/foo/y.txt | |
415 | ../archive/x.txt |
|
415 | ../archive/x.txt | |
416 |
|
416 | |||
417 | Test archiving to zip file (unzip output is unstable): |
|
417 | Test archiving to zip file (unzip output is unstable): | |
418 |
|
418 | |||
419 | $ hg archive --subrepos --prefix '.' ../archive.zip |
|
419 | $ hg archive --subrepos --prefix '.' ../archive.zip | |
420 | \r (no-eol) (esc) |
|
420 | \r (no-eol) (esc) | |
421 | archiving [ ] 0/3\r (no-eol) (esc) |
|
421 | archiving [ ] 0/3\r (no-eol) (esc) | |
422 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
422 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
423 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
423 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
424 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
424 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
425 | \r (no-eol) (esc) |
|
425 | \r (no-eol) (esc) | |
426 | \r (no-eol) (esc) |
|
426 | \r (no-eol) (esc) | |
427 | archiving (foo) [ ] 0/3\r (no-eol) (esc) |
|
427 | archiving (foo) [ ] 0/3\r (no-eol) (esc) | |
428 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) |
|
428 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) | |
429 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) |
|
429 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) | |
430 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) |
|
430 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) | |
431 | \r (no-eol) (esc) |
|
431 | \r (no-eol) (esc) | |
432 | \r (no-eol) (esc) |
|
432 | \r (no-eol) (esc) | |
433 | archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) |
|
433 | archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) | |
434 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc) |
|
434 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc) | |
435 | \r (no-eol) (esc) |
|
435 | \r (no-eol) (esc) | |
436 |
|
436 | |||
437 | (unzip date formating is unstable, we do not care about it and glob it out) |
|
437 | (unzip date formating is unstable, we do not care about it and glob it out) | |
438 |
|
438 | |||
439 | $ unzip -l ../archive.zip | grep -v -- ----- | egrep -v files$ |
|
439 | $ unzip -l ../archive.zip | grep -v -- ----- | egrep -v files$ | |
440 | Archive: ../archive.zip |
|
440 | Archive: ../archive.zip | |
441 | Length [ ]* Date [ ]* Time [ ]* Name (re) |
|
441 | Length [ ]* Date [ ]* Time [ ]* Name (re) | |
442 | 172 [0-9:\- ]* .hg_archival.txt (re) |
|
442 | 172 [0-9:\- ]* .hg_archival.txt (re) | |
443 | 10 [0-9:\- ]* .hgsub (re) |
|
443 | 10 [0-9:\- ]* .hgsub (re) | |
444 | 45 [0-9:\- ]* .hgsubstate (re) |
|
444 | 45 [0-9:\- ]* .hgsubstate (re) | |
445 | 3 [0-9:\- ]* x.txt (re) |
|
445 | 3 [0-9:\- ]* x.txt (re) | |
446 | 10 [0-9:\- ]* foo/.hgsub (re) |
|
446 | 10 [0-9:\- ]* foo/.hgsub (re) | |
447 | 45 [0-9:\- ]* foo/.hgsubstate (re) |
|
447 | 45 [0-9:\- ]* foo/.hgsubstate (re) | |
448 | 9 [0-9:\- ]* foo/y.txt (re) |
|
448 | 9 [0-9:\- ]* foo/y.txt (re) | |
449 | 9 [0-9:\- ]* foo/bar/z.txt (re) |
|
449 | 9 [0-9:\- ]* foo/bar/z.txt (re) | |
450 |
|
450 | |||
451 | Test archiving a revision that references a subrepo that is not yet |
|
451 | Test archiving a revision that references a subrepo that is not yet | |
452 | cloned: |
|
452 | cloned: | |
453 |
|
453 | |||
454 | #if hardlink |
|
454 | #if hardlink | |
455 | $ hg clone -U . ../empty |
|
455 | $ hg clone -U . ../empty | |
456 | \r (no-eol) (esc) |
|
456 | \r (no-eol) (esc) | |
457 | linking [ <=> ] 1\r (no-eol) (esc) |
|
457 | linking [ <=> ] 1\r (no-eol) (esc) | |
458 | linking [ <=> ] 2\r (no-eol) (esc) |
|
458 | linking [ <=> ] 2\r (no-eol) (esc) | |
459 | linking [ <=> ] 3\r (no-eol) (esc) |
|
459 | linking [ <=> ] 3\r (no-eol) (esc) | |
460 | linking [ <=> ] 4\r (no-eol) (esc) |
|
460 | linking [ <=> ] 4\r (no-eol) (esc) | |
461 | linking [ <=> ] 5\r (no-eol) (esc) |
|
461 | linking [ <=> ] 5\r (no-eol) (esc) | |
462 | linking [ <=> ] 6\r (no-eol) (esc) |
|
462 | linking [ <=> ] 6\r (no-eol) (esc) | |
463 | linking [ <=> ] 7\r (no-eol) (esc) |
|
463 | linking [ <=> ] 7\r (no-eol) (esc) | |
464 | linking [ <=> ] 8\r (no-eol) (esc) |
|
464 | linking [ <=> ] 8\r (no-eol) (esc) | |
465 | linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) |
|
465 | linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) | |
466 | linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) |
|
466 | linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) | |
467 | linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !) |
|
467 | linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !) | |
468 | linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !) |
|
468 | linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !) | |
|
469 | linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) | |||
469 | \r (no-eol) (esc) |
|
470 | \r (no-eol) (esc) | |
470 | #else |
|
471 | #else | |
471 | $ hg clone -U . ../empty |
|
472 | $ hg clone -U . ../empty | |
472 | \r (no-eol) (esc) |
|
473 | \r (no-eol) (esc) | |
473 | linking [ <=> ] 1 (no-eol) |
|
474 | linking [ <=> ] 1 (no-eol) | |
474 | #endif |
|
475 | #endif | |
475 |
|
476 | |||
476 | $ cd ../empty |
|
477 | $ cd ../empty | |
477 | #if hardlink |
|
478 | #if hardlink | |
478 | $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz |
|
479 | $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz | |
479 | \r (no-eol) (esc) |
|
480 | \r (no-eol) (esc) | |
480 | archiving [ ] 0/3\r (no-eol) (esc) |
|
481 | archiving [ ] 0/3\r (no-eol) (esc) | |
481 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
482 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
482 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
483 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
483 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
484 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
484 | \r (no-eol) (esc) |
|
485 | \r (no-eol) (esc) | |
485 | \r (no-eol) (esc) |
|
486 | \r (no-eol) (esc) | |
486 | linking [ <=> ] 1\r (no-eol) (esc) |
|
487 | linking [ <=> ] 1\r (no-eol) (esc) | |
487 | linking [ <=> ] 2\r (no-eol) (esc) |
|
488 | linking [ <=> ] 2\r (no-eol) (esc) | |
488 | linking [ <=> ] 3\r (no-eol) (esc) |
|
489 | linking [ <=> ] 3\r (no-eol) (esc) | |
489 | linking [ <=> ] 4\r (no-eol) (esc) |
|
490 | linking [ <=> ] 4\r (no-eol) (esc) | |
490 | linking [ <=> ] 5\r (no-eol) (esc) |
|
491 | linking [ <=> ] 5\r (no-eol) (esc) | |
491 | linking [ <=> ] 6\r (no-eol) (esc) |
|
492 | linking [ <=> ] 6\r (no-eol) (esc) | |
492 | linking [ <=> ] 7\r (no-eol) (esc) |
|
493 | linking [ <=> ] 7\r (no-eol) (esc) | |
493 | linking [ <=> ] 8\r (no-eol) (esc) |
|
494 | linking [ <=> ] 8\r (no-eol) (esc) | |
494 | linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) |
|
495 | linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) | |
495 | linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) |
|
496 | linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !) | |
496 | linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !) |
|
497 | linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !) | |
497 | linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !) |
|
498 | linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !) | |
498 | linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) |
|
499 | linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !) | |
499 | linking [ <=> ] 14\r (no-eol) (esc) (reposimplestore !) |
|
500 | linking [ <=> ] 14\r (no-eol) (esc) (reposimplestore !) | |
|
501 | linking [ <=> ] 15\r (no-eol) (esc) (reposimplestore !) | |||
|
502 | linking [ <=> ] 16\r (no-eol) (esc) (reposimplestore !) | |||
500 | \r (no-eol) (esc) |
|
503 | \r (no-eol) (esc) | |
501 | \r (no-eol) (esc) |
|
504 | \r (no-eol) (esc) | |
502 | archiving (foo) [ ] 0/3\r (no-eol) (esc) |
|
505 | archiving (foo) [ ] 0/3\r (no-eol) (esc) | |
503 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) |
|
506 | archiving (foo) [===========> ] 1/3\r (no-eol) (esc) | |
504 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) |
|
507 | archiving (foo) [=======================> ] 2/3\r (no-eol) (esc) | |
505 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) |
|
508 | archiving (foo) [====================================>] 3/3\r (no-eol) (esc) | |
506 | \r (no-eol) (esc) |
|
509 | \r (no-eol) (esc) | |
507 | \r (no-eol) (esc) |
|
510 | \r (no-eol) (esc) | |
508 | linking [ <=> ] 1\r (no-eol) (esc) |
|
511 | linking [ <=> ] 1\r (no-eol) (esc) | |
509 | linking [ <=> ] 2\r (no-eol) (esc) |
|
512 | linking [ <=> ] 2\r (no-eol) (esc) | |
510 | linking [ <=> ] 3\r (no-eol) (esc) |
|
513 | linking [ <=> ] 3\r (no-eol) (esc) | |
511 | linking [ <=> ] 4\r (no-eol) (esc) |
|
514 | linking [ <=> ] 4\r (no-eol) (esc) | |
512 | linking [ <=> ] 5\r (no-eol) (esc) |
|
515 | linking [ <=> ] 5\r (no-eol) (esc) | |
513 | linking [ <=> ] 6\r (no-eol) (esc) |
|
516 | linking [ <=> ] 6\r (no-eol) (esc) | |
514 | linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !) |
|
517 | linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !) | |
515 | linking [ <=> ] 8\r (no-eol) (esc) (reposimplestore !) |
|
518 | linking [ <=> ] 8\r (no-eol) (esc) (reposimplestore !) | |
|
519 | linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !) | |||
516 | \r (no-eol) (esc) |
|
520 | \r (no-eol) (esc) | |
517 | \r (no-eol) (esc) |
|
521 | \r (no-eol) (esc) | |
518 | archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) |
|
522 | archiving (foo/bar) [ ] 0/1\r (no-eol) (esc) | |
519 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc) |
|
523 | archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc) | |
520 | \r (no-eol) (esc) |
|
524 | \r (no-eol) (esc) | |
521 | cloning subrepo foo from $TESTTMP/repo/foo |
|
525 | cloning subrepo foo from $TESTTMP/repo/foo | |
522 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar |
|
526 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar | |
523 | #else |
|
527 | #else | |
524 | Note there's a slight output glitch on non-hardlink systems: the last |
|
528 | Note there's a slight output glitch on non-hardlink systems: the last | |
525 | "linking" progress topic never gets closed, leading to slight output corruption on that platform. |
|
529 | "linking" progress topic never gets closed, leading to slight output corruption on that platform. | |
526 | $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz |
|
530 | $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz | |
527 | \r (no-eol) (esc) |
|
531 | \r (no-eol) (esc) | |
528 | archiving [ ] 0/3\r (no-eol) (esc) |
|
532 | archiving [ ] 0/3\r (no-eol) (esc) | |
529 | archiving [=============> ] 1/3\r (no-eol) (esc) |
|
533 | archiving [=============> ] 1/3\r (no-eol) (esc) | |
530 | archiving [===========================> ] 2/3\r (no-eol) (esc) |
|
534 | archiving [===========================> ] 2/3\r (no-eol) (esc) | |
531 | archiving [==========================================>] 3/3\r (no-eol) (esc) |
|
535 | archiving [==========================================>] 3/3\r (no-eol) (esc) | |
532 | \r (no-eol) (esc) |
|
536 | \r (no-eol) (esc) | |
533 | \r (no-eol) (esc) |
|
537 | \r (no-eol) (esc) | |
534 | linking [ <=> ] 1\r (no-eol) (esc) |
|
538 | linking [ <=> ] 1\r (no-eol) (esc) | |
535 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar |
|
539 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar | |
536 | #endif |
|
540 | #endif | |
537 |
|
541 | |||
538 | Archive + subrepos uses '/' for all component separators |
|
542 | Archive + subrepos uses '/' for all component separators | |
539 |
|
543 | |||
540 | $ tar -tzf ../archive.tar.gz | sort |
|
544 | $ tar -tzf ../archive.tar.gz | sort | |
541 | .hg_archival.txt |
|
545 | .hg_archival.txt | |
542 | .hgsub |
|
546 | .hgsub | |
543 | .hgsubstate |
|
547 | .hgsubstate | |
544 | foo/.hgsub |
|
548 | foo/.hgsub | |
545 | foo/.hgsubstate |
|
549 | foo/.hgsubstate | |
546 | foo/bar/z.txt |
|
550 | foo/bar/z.txt | |
547 | foo/y.txt |
|
551 | foo/y.txt | |
548 | x.txt |
|
552 | x.txt | |
549 |
|
553 | |||
550 | The newly cloned subrepos contain no working copy: |
|
554 | The newly cloned subrepos contain no working copy: | |
551 |
|
555 | |||
552 | $ hg -R foo summary |
|
556 | $ hg -R foo summary | |
553 | parent: -1:000000000000 (no revision checked out) |
|
557 | parent: -1:000000000000 (no revision checked out) | |
554 | branch: default |
|
558 | branch: default | |
555 | commit: (clean) |
|
559 | commit: (clean) | |
556 | update: 4 new changesets (update) |
|
560 | update: 4 new changesets (update) | |
557 |
|
561 | |||
558 | Sharing a local repo without the locally referenced subrepo (i.e. it was never |
|
562 | Sharing a local repo without the locally referenced subrepo (i.e. it was never | |
559 | updated from null), fails the same as a clone operation. |
|
563 | updated from null), fails the same as a clone operation. | |
560 |
|
564 | |||
561 | $ hg --config progress.disable=True clone -U ../empty ../empty2 |
|
565 | $ hg --config progress.disable=True clone -U ../empty ../empty2 | |
562 |
|
566 | |||
563 | $ hg --config extensions.share= --config progress.disable=True \ |
|
567 | $ hg --config extensions.share= --config progress.disable=True \ | |
564 | > share ../empty2 ../empty_share |
|
568 | > share ../empty2 ../empty_share | |
565 | updating working directory |
|
569 | updating working directory | |
566 | abort: repository $TESTTMP/empty2/foo not found! |
|
570 | abort: repository $TESTTMP/empty2/foo not found! | |
567 | [255] |
|
571 | [255] | |
568 |
|
572 | |||
569 | $ hg --config progress.disable=True clone ../empty2 ../empty_clone |
|
573 | $ hg --config progress.disable=True clone ../empty2 ../empty_clone | |
570 | updating to branch default |
|
574 | updating to branch default | |
571 | abort: repository $TESTTMP/empty2/foo not found! |
|
575 | abort: repository $TESTTMP/empty2/foo not found! | |
572 | [255] |
|
576 | [255] | |
573 |
|
577 | |||
574 | Disable progress extension and cleanup: |
|
578 | Disable progress extension and cleanup: | |
575 |
|
579 | |||
576 | $ mv $HGRCPATH.no-progress $HGRCPATH |
|
580 | $ mv $HGRCPATH.no-progress $HGRCPATH | |
577 |
|
581 | |||
578 | Test archiving when there is a directory in the way for a subrepo |
|
582 | Test archiving when there is a directory in the way for a subrepo | |
579 | created by archive: |
|
583 | created by archive: | |
580 |
|
584 | |||
581 | $ hg clone -U . ../almost-empty |
|
585 | $ hg clone -U . ../almost-empty | |
582 | $ cd ../almost-empty |
|
586 | $ cd ../almost-empty | |
583 | $ mkdir foo |
|
587 | $ mkdir foo | |
584 | $ echo f > foo/f |
|
588 | $ echo f > foo/f | |
585 | $ hg archive --subrepos -r tip archive |
|
589 | $ hg archive --subrepos -r tip archive | |
586 | cloning subrepo foo from $TESTTMP/empty/foo |
|
590 | cloning subrepo foo from $TESTTMP/empty/foo | |
587 | abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepository "foo") |
|
591 | abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepository "foo") | |
588 | [255] |
|
592 | [255] | |
589 |
|
593 | |||
590 | Clone and test outgoing: |
|
594 | Clone and test outgoing: | |
591 |
|
595 | |||
592 | $ cd .. |
|
596 | $ cd .. | |
593 | $ hg clone repo repo2 |
|
597 | $ hg clone repo repo2 | |
594 | updating to branch default |
|
598 | updating to branch default | |
595 | cloning subrepo foo from $TESTTMP/repo/foo |
|
599 | cloning subrepo foo from $TESTTMP/repo/foo | |
596 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar |
|
600 | cloning subrepo foo/bar from $TESTTMP/repo/foo/bar | |
597 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
601 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
598 | $ cd repo2 |
|
602 | $ cd repo2 | |
599 | $ hg outgoing -S |
|
603 | $ hg outgoing -S | |
600 | comparing with $TESTTMP/repo |
|
604 | comparing with $TESTTMP/repo | |
601 | searching for changes |
|
605 | searching for changes | |
602 | no changes found |
|
606 | no changes found | |
603 | comparing with $TESTTMP/repo/foo |
|
607 | comparing with $TESTTMP/repo/foo | |
604 | searching for changes |
|
608 | searching for changes | |
605 | no changes found |
|
609 | no changes found | |
606 | comparing with $TESTTMP/repo/foo/bar |
|
610 | comparing with $TESTTMP/repo/foo/bar | |
607 | searching for changes |
|
611 | searching for changes | |
608 | no changes found |
|
612 | no changes found | |
609 | [1] |
|
613 | [1] | |
610 |
|
614 | |||
611 | Make nested change: |
|
615 | Make nested change: | |
612 |
|
616 | |||
613 | $ echo y4 >> foo/y.txt |
|
617 | $ echo y4 >> foo/y.txt | |
614 | $ hg diff --nodates -S |
|
618 | $ hg diff --nodates -S | |
615 | diff -r 65903cebad86 foo/y.txt |
|
619 | diff -r 65903cebad86 foo/y.txt | |
616 | --- a/foo/y.txt |
|
620 | --- a/foo/y.txt | |
617 | +++ b/foo/y.txt |
|
621 | +++ b/foo/y.txt | |
618 | @@ -1,3 +1,4 @@ |
|
622 | @@ -1,3 +1,4 @@ | |
619 | y1 |
|
623 | y1 | |
620 | y2 |
|
624 | y2 | |
621 | y3 |
|
625 | y3 | |
622 | +y4 |
|
626 | +y4 | |
623 | $ hg commit --subrepos -m 3-4-2 |
|
627 | $ hg commit --subrepos -m 3-4-2 | |
624 | committing subrepository foo |
|
628 | committing subrepository foo | |
625 | $ hg outgoing -S |
|
629 | $ hg outgoing -S | |
626 | comparing with $TESTTMP/repo |
|
630 | comparing with $TESTTMP/repo | |
627 | searching for changes |
|
631 | searching for changes | |
628 | changeset: 3:2655b8ecc4ee |
|
632 | changeset: 3:2655b8ecc4ee | |
629 | tag: tip |
|
633 | tag: tip | |
630 | user: test |
|
634 | user: test | |
631 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
635 | date: Thu Jan 01 00:00:00 1970 +0000 | |
632 | summary: 3-4-2 |
|
636 | summary: 3-4-2 | |
633 |
|
637 | |||
634 | comparing with $TESTTMP/repo/foo |
|
638 | comparing with $TESTTMP/repo/foo | |
635 | searching for changes |
|
639 | searching for changes | |
636 | changeset: 4:e96193d6cb36 |
|
640 | changeset: 4:e96193d6cb36 | |
637 | tag: tip |
|
641 | tag: tip | |
638 | user: test |
|
642 | user: test | |
639 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
643 | date: Thu Jan 01 00:00:00 1970 +0000 | |
640 | summary: 3-4-2 |
|
644 | summary: 3-4-2 | |
641 |
|
645 | |||
642 | comparing with $TESTTMP/repo/foo/bar |
|
646 | comparing with $TESTTMP/repo/foo/bar | |
643 | searching for changes |
|
647 | searching for changes | |
644 | no changes found |
|
648 | no changes found | |
645 |
|
649 | |||
646 |
|
650 | |||
647 | Switch to original repo and setup default path: |
|
651 | Switch to original repo and setup default path: | |
648 |
|
652 | |||
649 | $ cd ../repo |
|
653 | $ cd ../repo | |
650 | $ echo '[paths]' >> .hg/hgrc |
|
654 | $ echo '[paths]' >> .hg/hgrc | |
651 | $ echo 'default = ../repo2' >> .hg/hgrc |
|
655 | $ echo 'default = ../repo2' >> .hg/hgrc | |
652 |
|
656 | |||
653 | Test incoming: |
|
657 | Test incoming: | |
654 |
|
658 | |||
655 | $ hg incoming -S |
|
659 | $ hg incoming -S | |
656 | comparing with $TESTTMP/repo2 |
|
660 | comparing with $TESTTMP/repo2 | |
657 | searching for changes |
|
661 | searching for changes | |
658 | changeset: 3:2655b8ecc4ee |
|
662 | changeset: 3:2655b8ecc4ee | |
659 | tag: tip |
|
663 | tag: tip | |
660 | user: test |
|
664 | user: test | |
661 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
665 | date: Thu Jan 01 00:00:00 1970 +0000 | |
662 | summary: 3-4-2 |
|
666 | summary: 3-4-2 | |
663 |
|
667 | |||
664 | comparing with $TESTTMP/repo2/foo |
|
668 | comparing with $TESTTMP/repo2/foo | |
665 | searching for changes |
|
669 | searching for changes | |
666 | changeset: 4:e96193d6cb36 |
|
670 | changeset: 4:e96193d6cb36 | |
667 | tag: tip |
|
671 | tag: tip | |
668 | user: test |
|
672 | user: test | |
669 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
673 | date: Thu Jan 01 00:00:00 1970 +0000 | |
670 | summary: 3-4-2 |
|
674 | summary: 3-4-2 | |
671 |
|
675 | |||
672 | comparing with $TESTTMP/repo2/foo/bar |
|
676 | comparing with $TESTTMP/repo2/foo/bar | |
673 | searching for changes |
|
677 | searching for changes | |
674 | no changes found |
|
678 | no changes found | |
675 |
|
679 | |||
676 | $ hg incoming -S --bundle incoming.hg |
|
680 | $ hg incoming -S --bundle incoming.hg | |
677 | abort: cannot combine --bundle and --subrepos |
|
681 | abort: cannot combine --bundle and --subrepos | |
678 | [255] |
|
682 | [255] | |
679 |
|
683 | |||
680 | Test missing subrepo: |
|
684 | Test missing subrepo: | |
681 |
|
685 | |||
682 | $ rm -r foo |
|
686 | $ rm -r foo | |
683 | $ hg status -S |
|
687 | $ hg status -S | |
684 | warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo" |
|
688 | warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo" | |
685 |
|
689 | |||
686 | Issue2619: IndexError: list index out of range on hg add with subrepos |
|
690 | Issue2619: IndexError: list index out of range on hg add with subrepos | |
687 | The subrepo must sorts after the explicit filename. |
|
691 | The subrepo must sorts after the explicit filename. | |
688 |
|
692 | |||
689 | $ cd .. |
|
693 | $ cd .. | |
690 | $ hg init test |
|
694 | $ hg init test | |
691 | $ cd test |
|
695 | $ cd test | |
692 | $ hg init x |
|
696 | $ hg init x | |
693 | $ echo abc > abc.txt |
|
697 | $ echo abc > abc.txt | |
694 | $ hg ci -Am "abc" |
|
698 | $ hg ci -Am "abc" | |
695 | adding abc.txt |
|
699 | adding abc.txt | |
696 | $ echo "x = x" >> .hgsub |
|
700 | $ echo "x = x" >> .hgsub | |
697 | $ hg add .hgsub |
|
701 | $ hg add .hgsub | |
698 | $ touch a x/a |
|
702 | $ touch a x/a | |
699 | $ hg add a x/a |
|
703 | $ hg add a x/a | |
700 |
|
704 | |||
701 | $ hg ci -Sm "added x" |
|
705 | $ hg ci -Sm "added x" | |
702 | committing subrepository x |
|
706 | committing subrepository x | |
703 | $ echo abc > x/a |
|
707 | $ echo abc > x/a | |
704 | $ hg revert --rev '.^' "set:subrepo('glob:x*')" |
|
708 | $ hg revert --rev '.^' "set:subrepo('glob:x*')" | |
705 | abort: subrepository 'x' does not exist in 25ac2c9b3180! |
|
709 | abort: subrepository 'x' does not exist in 25ac2c9b3180! | |
706 | [255] |
|
710 | [255] | |
707 |
|
711 | |||
708 | $ cd .. |
|
712 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now