##// END OF EJS Templates
changelog: never inline changelog...
marmoute -
r52074:dcaa2df1 default
parent child Browse files
Show More
@@ -1,500 +1,506 b''
1 # changelog.py - changelog class for mercurial
1 # changelog.py - changelog class for mercurial
2 #
2 #
3 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
3 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.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
8
9 from .i18n import _
9 from .i18n import _
10 from .node import (
10 from .node import (
11 bin,
11 bin,
12 hex,
12 hex,
13 )
13 )
14 from .thirdparty import attr
14 from .thirdparty import attr
15
15
16 from . import (
16 from . import (
17 encoding,
17 encoding,
18 error,
18 error,
19 metadata,
19 metadata,
20 pycompat,
20 pycompat,
21 revlog,
21 revlog,
22 )
22 )
23 from .utils import (
23 from .utils import (
24 dateutil,
24 dateutil,
25 stringutil,
25 stringutil,
26 )
26 )
27 from .revlogutils import (
27 from .revlogutils import (
28 constants as revlog_constants,
28 constants as revlog_constants,
29 flagutil,
29 flagutil,
30 )
30 )
31
31
32 _defaultextra = {b'branch': b'default'}
32 _defaultextra = {b'branch': b'default'}
33
33
34
34
35 def _string_escape(text):
35 def _string_escape(text):
36 """
36 """
37 >>> from .pycompat import bytechr as chr
37 >>> from .pycompat import bytechr as chr
38 >>> d = {b'nl': chr(10), b'bs': chr(92), b'cr': chr(13), b'nul': chr(0)}
38 >>> d = {b'nl': chr(10), b'bs': chr(92), b'cr': chr(13), b'nul': chr(0)}
39 >>> s = b"ab%(nl)scd%(bs)s%(bs)sn%(nul)s12ab%(cr)scd%(bs)s%(nl)s" % d
39 >>> s = b"ab%(nl)scd%(bs)s%(bs)sn%(nul)s12ab%(cr)scd%(bs)s%(nl)s" % d
40 >>> s
40 >>> s
41 'ab\\ncd\\\\\\\\n\\x0012ab\\rcd\\\\\\n'
41 'ab\\ncd\\\\\\\\n\\x0012ab\\rcd\\\\\\n'
42 >>> res = _string_escape(s)
42 >>> res = _string_escape(s)
43 >>> s == _string_unescape(res)
43 >>> s == _string_unescape(res)
44 True
44 True
45 """
45 """
46 # subset of the string_escape codec
46 # subset of the string_escape codec
47 text = (
47 text = (
48 text.replace(b'\\', b'\\\\')
48 text.replace(b'\\', b'\\\\')
49 .replace(b'\n', b'\\n')
49 .replace(b'\n', b'\\n')
50 .replace(b'\r', b'\\r')
50 .replace(b'\r', b'\\r')
51 )
51 )
52 return text.replace(b'\0', b'\\0')
52 return text.replace(b'\0', b'\\0')
53
53
54
54
55 def _string_unescape(text):
55 def _string_unescape(text):
56 if b'\\0' in text:
56 if b'\\0' in text:
57 # fix up \0 without getting into trouble with \\0
57 # fix up \0 without getting into trouble with \\0
58 text = text.replace(b'\\\\', b'\\\\\n')
58 text = text.replace(b'\\\\', b'\\\\\n')
59 text = text.replace(b'\\0', b'\0')
59 text = text.replace(b'\\0', b'\0')
60 text = text.replace(b'\n', b'')
60 text = text.replace(b'\n', b'')
61 return stringutil.unescapestr(text)
61 return stringutil.unescapestr(text)
62
62
63
63
64 def decodeextra(text):
64 def decodeextra(text):
65 """
65 """
66 >>> from .pycompat import bytechr as chr
66 >>> from .pycompat import bytechr as chr
67 >>> sorted(decodeextra(encodeextra({b'foo': b'bar', b'baz': chr(0) + b'2'})
67 >>> sorted(decodeextra(encodeextra({b'foo': b'bar', b'baz': chr(0) + b'2'})
68 ... ).items())
68 ... ).items())
69 [('baz', '\\x002'), ('branch', 'default'), ('foo', 'bar')]
69 [('baz', '\\x002'), ('branch', 'default'), ('foo', 'bar')]
70 >>> sorted(decodeextra(encodeextra({b'foo': b'bar',
70 >>> sorted(decodeextra(encodeextra({b'foo': b'bar',
71 ... b'baz': chr(92) + chr(0) + b'2'})
71 ... b'baz': chr(92) + chr(0) + b'2'})
72 ... ).items())
72 ... ).items())
73 [('baz', '\\\\\\x002'), ('branch', 'default'), ('foo', 'bar')]
73 [('baz', '\\\\\\x002'), ('branch', 'default'), ('foo', 'bar')]
74 """
74 """
75 extra = _defaultextra.copy()
75 extra = _defaultextra.copy()
76 for l in text.split(b'\0'):
76 for l in text.split(b'\0'):
77 if l:
77 if l:
78 k, v = _string_unescape(l).split(b':', 1)
78 k, v = _string_unescape(l).split(b':', 1)
79 extra[k] = v
79 extra[k] = v
80 return extra
80 return extra
81
81
82
82
83 def encodeextra(d):
83 def encodeextra(d):
84 # keys must be sorted to produce a deterministic changelog entry
84 # keys must be sorted to produce a deterministic changelog entry
85 items = [_string_escape(b'%s:%s' % (k, d[k])) for k in sorted(d)]
85 items = [_string_escape(b'%s:%s' % (k, d[k])) for k in sorted(d)]
86 return b"\0".join(items)
86 return b"\0".join(items)
87
87
88
88
89 def stripdesc(desc):
89 def stripdesc(desc):
90 """strip trailing whitespace and leading and trailing empty lines"""
90 """strip trailing whitespace and leading and trailing empty lines"""
91 return b'\n'.join([l.rstrip() for l in desc.splitlines()]).strip(b'\n')
91 return b'\n'.join([l.rstrip() for l in desc.splitlines()]).strip(b'\n')
92
92
93
93
94 @attr.s
94 @attr.s
95 class _changelogrevision:
95 class _changelogrevision:
96 # Extensions might modify _defaultextra, so let the constructor below pass
96 # Extensions might modify _defaultextra, so let the constructor below pass
97 # it in
97 # it in
98 extra = attr.ib()
98 extra = attr.ib()
99 manifest = attr.ib()
99 manifest = attr.ib()
100 user = attr.ib(default=b'')
100 user = attr.ib(default=b'')
101 date = attr.ib(default=(0, 0))
101 date = attr.ib(default=(0, 0))
102 files = attr.ib(default=attr.Factory(list))
102 files = attr.ib(default=attr.Factory(list))
103 filesadded = attr.ib(default=None)
103 filesadded = attr.ib(default=None)
104 filesremoved = attr.ib(default=None)
104 filesremoved = attr.ib(default=None)
105 p1copies = attr.ib(default=None)
105 p1copies = attr.ib(default=None)
106 p2copies = attr.ib(default=None)
106 p2copies = attr.ib(default=None)
107 description = attr.ib(default=b'')
107 description = attr.ib(default=b'')
108 branchinfo = attr.ib(default=(_defaultextra[b'branch'], False))
108 branchinfo = attr.ib(default=(_defaultextra[b'branch'], False))
109
109
110
110
111 class changelogrevision:
111 class changelogrevision:
112 """Holds results of a parsed changelog revision.
112 """Holds results of a parsed changelog revision.
113
113
114 Changelog revisions consist of multiple pieces of data, including
114 Changelog revisions consist of multiple pieces of data, including
115 the manifest node, user, and date. This object exposes a view into
115 the manifest node, user, and date. This object exposes a view into
116 the parsed object.
116 the parsed object.
117 """
117 """
118
118
119 __slots__ = (
119 __slots__ = (
120 '_offsets',
120 '_offsets',
121 '_text',
121 '_text',
122 '_sidedata',
122 '_sidedata',
123 '_cpsd',
123 '_cpsd',
124 '_changes',
124 '_changes',
125 )
125 )
126
126
127 def __new__(cls, cl, text, sidedata, cpsd):
127 def __new__(cls, cl, text, sidedata, cpsd):
128 if not text:
128 if not text:
129 return _changelogrevision(extra=_defaultextra, manifest=cl.nullid)
129 return _changelogrevision(extra=_defaultextra, manifest=cl.nullid)
130
130
131 self = super(changelogrevision, cls).__new__(cls)
131 self = super(changelogrevision, cls).__new__(cls)
132 # We could return here and implement the following as an __init__.
132 # We could return here and implement the following as an __init__.
133 # But doing it here is equivalent and saves an extra function call.
133 # But doing it here is equivalent and saves an extra function call.
134
134
135 # format used:
135 # format used:
136 # nodeid\n : manifest node in ascii
136 # nodeid\n : manifest node in ascii
137 # user\n : user, no \n or \r allowed
137 # user\n : user, no \n or \r allowed
138 # time tz extra\n : date (time is int or float, timezone is int)
138 # time tz extra\n : date (time is int or float, timezone is int)
139 # : extra is metadata, encoded and separated by '\0'
139 # : extra is metadata, encoded and separated by '\0'
140 # : older versions ignore it
140 # : older versions ignore it
141 # files\n\n : files modified by the cset, no \n or \r allowed
141 # files\n\n : files modified by the cset, no \n or \r allowed
142 # (.*) : comment (free text, ideally utf-8)
142 # (.*) : comment (free text, ideally utf-8)
143 #
143 #
144 # changelog v0 doesn't use extra
144 # changelog v0 doesn't use extra
145
145
146 nl1 = text.index(b'\n')
146 nl1 = text.index(b'\n')
147 nl2 = text.index(b'\n', nl1 + 1)
147 nl2 = text.index(b'\n', nl1 + 1)
148 nl3 = text.index(b'\n', nl2 + 1)
148 nl3 = text.index(b'\n', nl2 + 1)
149
149
150 # The list of files may be empty. Which means nl3 is the first of the
150 # The list of files may be empty. Which means nl3 is the first of the
151 # double newline that precedes the description.
151 # double newline that precedes the description.
152 if text[nl3 + 1 : nl3 + 2] == b'\n':
152 if text[nl3 + 1 : nl3 + 2] == b'\n':
153 doublenl = nl3
153 doublenl = nl3
154 else:
154 else:
155 doublenl = text.index(b'\n\n', nl3 + 1)
155 doublenl = text.index(b'\n\n', nl3 + 1)
156
156
157 self._offsets = (nl1, nl2, nl3, doublenl)
157 self._offsets = (nl1, nl2, nl3, doublenl)
158 self._text = text
158 self._text = text
159 self._sidedata = sidedata
159 self._sidedata = sidedata
160 self._cpsd = cpsd
160 self._cpsd = cpsd
161 self._changes = None
161 self._changes = None
162
162
163 return self
163 return self
164
164
165 @property
165 @property
166 def manifest(self):
166 def manifest(self):
167 return bin(self._text[0 : self._offsets[0]])
167 return bin(self._text[0 : self._offsets[0]])
168
168
169 @property
169 @property
170 def user(self):
170 def user(self):
171 off = self._offsets
171 off = self._offsets
172 return encoding.tolocal(self._text[off[0] + 1 : off[1]])
172 return encoding.tolocal(self._text[off[0] + 1 : off[1]])
173
173
174 @property
174 @property
175 def _rawdate(self):
175 def _rawdate(self):
176 off = self._offsets
176 off = self._offsets
177 dateextra = self._text[off[1] + 1 : off[2]]
177 dateextra = self._text[off[1] + 1 : off[2]]
178 return dateextra.split(b' ', 2)[0:2]
178 return dateextra.split(b' ', 2)[0:2]
179
179
180 @property
180 @property
181 def _rawextra(self):
181 def _rawextra(self):
182 off = self._offsets
182 off = self._offsets
183 dateextra = self._text[off[1] + 1 : off[2]]
183 dateextra = self._text[off[1] + 1 : off[2]]
184 fields = dateextra.split(b' ', 2)
184 fields = dateextra.split(b' ', 2)
185 if len(fields) != 3:
185 if len(fields) != 3:
186 return None
186 return None
187
187
188 return fields[2]
188 return fields[2]
189
189
190 @property
190 @property
191 def date(self):
191 def date(self):
192 raw = self._rawdate
192 raw = self._rawdate
193 time = float(raw[0])
193 time = float(raw[0])
194 # Various tools did silly things with the timezone.
194 # Various tools did silly things with the timezone.
195 try:
195 try:
196 timezone = int(raw[1])
196 timezone = int(raw[1])
197 except ValueError:
197 except ValueError:
198 timezone = 0
198 timezone = 0
199
199
200 return time, timezone
200 return time, timezone
201
201
202 @property
202 @property
203 def extra(self):
203 def extra(self):
204 raw = self._rawextra
204 raw = self._rawextra
205 if raw is None:
205 if raw is None:
206 return _defaultextra
206 return _defaultextra
207
207
208 return decodeextra(raw)
208 return decodeextra(raw)
209
209
210 @property
210 @property
211 def changes(self):
211 def changes(self):
212 if self._changes is not None:
212 if self._changes is not None:
213 return self._changes
213 return self._changes
214 if self._cpsd:
214 if self._cpsd:
215 changes = metadata.decode_files_sidedata(self._sidedata)
215 changes = metadata.decode_files_sidedata(self._sidedata)
216 else:
216 else:
217 changes = metadata.ChangingFiles(
217 changes = metadata.ChangingFiles(
218 touched=self.files or (),
218 touched=self.files or (),
219 added=self.filesadded or (),
219 added=self.filesadded or (),
220 removed=self.filesremoved or (),
220 removed=self.filesremoved or (),
221 p1_copies=self.p1copies or {},
221 p1_copies=self.p1copies or {},
222 p2_copies=self.p2copies or {},
222 p2_copies=self.p2copies or {},
223 )
223 )
224 self._changes = changes
224 self._changes = changes
225 return changes
225 return changes
226
226
227 @property
227 @property
228 def files(self):
228 def files(self):
229 if self._cpsd:
229 if self._cpsd:
230 return sorted(self.changes.touched)
230 return sorted(self.changes.touched)
231 off = self._offsets
231 off = self._offsets
232 if off[2] == off[3]:
232 if off[2] == off[3]:
233 return []
233 return []
234
234
235 return self._text[off[2] + 1 : off[3]].split(b'\n')
235 return self._text[off[2] + 1 : off[3]].split(b'\n')
236
236
237 @property
237 @property
238 def filesadded(self):
238 def filesadded(self):
239 if self._cpsd:
239 if self._cpsd:
240 return self.changes.added
240 return self.changes.added
241 else:
241 else:
242 rawindices = self.extra.get(b'filesadded')
242 rawindices = self.extra.get(b'filesadded')
243 if rawindices is None:
243 if rawindices is None:
244 return None
244 return None
245 return metadata.decodefileindices(self.files, rawindices)
245 return metadata.decodefileindices(self.files, rawindices)
246
246
247 @property
247 @property
248 def filesremoved(self):
248 def filesremoved(self):
249 if self._cpsd:
249 if self._cpsd:
250 return self.changes.removed
250 return self.changes.removed
251 else:
251 else:
252 rawindices = self.extra.get(b'filesremoved')
252 rawindices = self.extra.get(b'filesremoved')
253 if rawindices is None:
253 if rawindices is None:
254 return None
254 return None
255 return metadata.decodefileindices(self.files, rawindices)
255 return metadata.decodefileindices(self.files, rawindices)
256
256
257 @property
257 @property
258 def p1copies(self):
258 def p1copies(self):
259 if self._cpsd:
259 if self._cpsd:
260 return self.changes.copied_from_p1
260 return self.changes.copied_from_p1
261 else:
261 else:
262 rawcopies = self.extra.get(b'p1copies')
262 rawcopies = self.extra.get(b'p1copies')
263 if rawcopies is None:
263 if rawcopies is None:
264 return None
264 return None
265 return metadata.decodecopies(self.files, rawcopies)
265 return metadata.decodecopies(self.files, rawcopies)
266
266
267 @property
267 @property
268 def p2copies(self):
268 def p2copies(self):
269 if self._cpsd:
269 if self._cpsd:
270 return self.changes.copied_from_p2
270 return self.changes.copied_from_p2
271 else:
271 else:
272 rawcopies = self.extra.get(b'p2copies')
272 rawcopies = self.extra.get(b'p2copies')
273 if rawcopies is None:
273 if rawcopies is None:
274 return None
274 return None
275 return metadata.decodecopies(self.files, rawcopies)
275 return metadata.decodecopies(self.files, rawcopies)
276
276
277 @property
277 @property
278 def description(self):
278 def description(self):
279 return encoding.tolocal(self._text[self._offsets[3] + 2 :])
279 return encoding.tolocal(self._text[self._offsets[3] + 2 :])
280
280
281 @property
281 @property
282 def branchinfo(self):
282 def branchinfo(self):
283 extra = self.extra
283 extra = self.extra
284 return encoding.tolocal(extra.get(b"branch")), b'close' in extra
284 return encoding.tolocal(extra.get(b"branch")), b'close' in extra
285
285
286
286
287 class changelog(revlog.revlog):
287 class changelog(revlog.revlog):
288 def __init__(self, opener, trypending=False, concurrencychecker=None):
288 def __init__(self, opener, trypending=False, concurrencychecker=None):
289 """Load a changelog revlog using an opener.
289 """Load a changelog revlog using an opener.
290
290
291 If ``trypending`` is true, we attempt to load the index from a
291 If ``trypending`` is true, we attempt to load the index from a
292 ``00changelog.i.a`` file instead of the default ``00changelog.i``.
292 ``00changelog.i.a`` file instead of the default ``00changelog.i``.
293 The ``00changelog.i.a`` file contains index (and possibly inline
293 The ``00changelog.i.a`` file contains index (and possibly inline
294 revision) data for a transaction that hasn't been finalized yet.
294 revision) data for a transaction that hasn't been finalized yet.
295 It exists in a separate file to facilitate readers (such as
295 It exists in a separate file to facilitate readers (such as
296 hooks processes) accessing data before a transaction is finalized.
296 hooks processes) accessing data before a transaction is finalized.
297
297
298 ``concurrencychecker`` will be passed to the revlog init function, see
298 ``concurrencychecker`` will be passed to the revlog init function, see
299 the documentation there.
299 the documentation there.
300 """
300 """
301 revlog.revlog.__init__(
301 revlog.revlog.__init__(
302 self,
302 self,
303 opener,
303 opener,
304 target=(revlog_constants.KIND_CHANGELOG, None),
304 target=(revlog_constants.KIND_CHANGELOG, None),
305 radix=b'00changelog',
305 radix=b'00changelog',
306 checkambig=True,
306 checkambig=True,
307 mmaplargeindex=True,
307 mmaplargeindex=True,
308 persistentnodemap=opener.options.get(b'persistent-nodemap', False),
308 persistentnodemap=opener.options.get(b'persistent-nodemap', False),
309 concurrencychecker=concurrencychecker,
309 concurrencychecker=concurrencychecker,
310 trypending=trypending,
310 trypending=trypending,
311 may_inline=False,
311 )
312 )
312
313
313 if self._initempty and (self._format_version == revlog.REVLOGV1):
314 if self._initempty and (self._format_version == revlog.REVLOGV1):
314 # changelogs don't benefit from generaldelta.
315 # changelogs don't benefit from generaldelta.
315
316
316 self._format_flags &= ~revlog.FLAG_GENERALDELTA
317 self._format_flags &= ~revlog.FLAG_GENERALDELTA
317 self.delta_config.general_delta = False
318 self.delta_config.general_delta = False
318
319
319 # Delta chains for changelogs tend to be very small because entries
320 # Delta chains for changelogs tend to be very small because entries
320 # tend to be small and don't delta well with each. So disable delta
321 # tend to be small and don't delta well with each. So disable delta
321 # chains.
322 # chains.
322 self._storedeltachains = False
323 self._storedeltachains = False
323
324
324 self._v2_delayed = False
325 self._v2_delayed = False
325 self._filteredrevs = frozenset()
326 self._filteredrevs = frozenset()
326 self._filteredrevs_hashcache = {}
327 self._filteredrevs_hashcache = {}
327 self._copiesstorage = opener.options.get(b'copies-storage')
328 self._copiesstorage = opener.options.get(b'copies-storage')
328
329
329 @property
330 @property
330 def filteredrevs(self):
331 def filteredrevs(self):
331 return self._filteredrevs
332 return self._filteredrevs
332
333
333 @filteredrevs.setter
334 @filteredrevs.setter
334 def filteredrevs(self, val):
335 def filteredrevs(self, val):
335 # Ensure all updates go through this function
336 # Ensure all updates go through this function
336 assert isinstance(val, frozenset)
337 assert isinstance(val, frozenset)
337 self._filteredrevs = val
338 self._filteredrevs = val
338 self._filteredrevs_hashcache = {}
339 self._filteredrevs_hashcache = {}
339
340
340 def _write_docket(self, tr):
341 def _write_docket(self, tr):
341 if not self._v2_delayed:
342 if not self._v2_delayed:
342 super(changelog, self)._write_docket(tr)
343 super(changelog, self)._write_docket(tr)
343
344
344 def delayupdate(self, tr):
345 def delayupdate(self, tr):
345 """delay visibility of index updates to other readers"""
346 """delay visibility of index updates to other readers"""
346 assert not self._inner.is_open
347 assert not self._inner.is_open
348 assert not self._may_inline
349 # enforce that older changelog that are still inline are split at the
350 # first opportunity.
351 if self._inline:
352 self._enforceinlinesize(tr)
347 if self._docket is not None:
353 if self._docket is not None:
348 self._v2_delayed = True
354 self._v2_delayed = True
349 else:
355 else:
350 new_index = self._inner.delay()
356 new_index = self._inner.delay()
351 if new_index is not None:
357 if new_index is not None:
352 self._indexfile = new_index
358 self._indexfile = new_index
353 tr.registertmp(new_index)
359 tr.registertmp(new_index)
354 tr.addpending(b'cl-%i' % id(self), self._writepending)
360 tr.addpending(b'cl-%i' % id(self), self._writepending)
355 tr.addfinalize(b'cl-%i' % id(self), self._finalize)
361 tr.addfinalize(b'cl-%i' % id(self), self._finalize)
356
362
357 def _finalize(self, tr):
363 def _finalize(self, tr):
358 """finalize index updates"""
364 """finalize index updates"""
359 assert not self._inner.is_open
365 assert not self._inner.is_open
360 if self._docket is not None:
366 if self._docket is not None:
361 self._docket.write(tr)
367 self._docket.write(tr)
362 self._v2_delayed = False
368 self._v2_delayed = False
363 else:
369 else:
364 new_index_file = self._inner.finalize_pending()
370 new_index_file = self._inner.finalize_pending()
365 self._indexfile = new_index_file
371 self._indexfile = new_index_file
366 # split when we're done
372 # split when we're done
367 self._enforceinlinesize(tr, side_write=False)
373 self._enforceinlinesize(tr, side_write=False)
368
374
369 def _writepending(self, tr):
375 def _writepending(self, tr):
370 """create a file containing the unfinalized state for
376 """create a file containing the unfinalized state for
371 pretxnchangegroup"""
377 pretxnchangegroup"""
372 assert not self._inner.is_open
378 assert not self._inner.is_open
373 if self._docket:
379 if self._docket:
374 any_pending = self._docket.write(tr, pending=True)
380 any_pending = self._docket.write(tr, pending=True)
375 self._v2_delayed = False
381 self._v2_delayed = False
376 else:
382 else:
377 new_index, any_pending = self._inner.write_pending()
383 new_index, any_pending = self._inner.write_pending()
378 if new_index is not None:
384 if new_index is not None:
379 self._indexfile = new_index
385 self._indexfile = new_index
380 tr.registertmp(new_index)
386 tr.registertmp(new_index)
381 return any_pending
387 return any_pending
382
388
383 def _enforceinlinesize(self, tr, side_write=True):
389 def _enforceinlinesize(self, tr, side_write=True):
384 if not self.is_delaying:
390 if not self.is_delaying:
385 revlog.revlog._enforceinlinesize(self, tr, side_write=side_write)
391 revlog.revlog._enforceinlinesize(self, tr, side_write=side_write)
386
392
387 def read(self, nodeorrev):
393 def read(self, nodeorrev):
388 """Obtain data from a parsed changelog revision.
394 """Obtain data from a parsed changelog revision.
389
395
390 Returns a 6-tuple of:
396 Returns a 6-tuple of:
391
397
392 - manifest node in binary
398 - manifest node in binary
393 - author/user as a localstr
399 - author/user as a localstr
394 - date as a 2-tuple of (time, timezone)
400 - date as a 2-tuple of (time, timezone)
395 - list of files
401 - list of files
396 - commit message as a localstr
402 - commit message as a localstr
397 - dict of extra metadata
403 - dict of extra metadata
398
404
399 Unless you need to access all fields, consider calling
405 Unless you need to access all fields, consider calling
400 ``changelogrevision`` instead, as it is faster for partial object
406 ``changelogrevision`` instead, as it is faster for partial object
401 access.
407 access.
402 """
408 """
403 d = self._revisiondata(nodeorrev)
409 d = self._revisiondata(nodeorrev)
404 sidedata = self.sidedata(nodeorrev)
410 sidedata = self.sidedata(nodeorrev)
405 copy_sd = self._copiesstorage == b'changeset-sidedata'
411 copy_sd = self._copiesstorage == b'changeset-sidedata'
406 c = changelogrevision(self, d, sidedata, copy_sd)
412 c = changelogrevision(self, d, sidedata, copy_sd)
407 return (c.manifest, c.user, c.date, c.files, c.description, c.extra)
413 return (c.manifest, c.user, c.date, c.files, c.description, c.extra)
408
414
409 def changelogrevision(self, nodeorrev):
415 def changelogrevision(self, nodeorrev):
410 """Obtain a ``changelogrevision`` for a node or revision."""
416 """Obtain a ``changelogrevision`` for a node or revision."""
411 text = self._revisiondata(nodeorrev)
417 text = self._revisiondata(nodeorrev)
412 sidedata = self.sidedata(nodeorrev)
418 sidedata = self.sidedata(nodeorrev)
413 return changelogrevision(
419 return changelogrevision(
414 self, text, sidedata, self._copiesstorage == b'changeset-sidedata'
420 self, text, sidedata, self._copiesstorage == b'changeset-sidedata'
415 )
421 )
416
422
417 def readfiles(self, nodeorrev):
423 def readfiles(self, nodeorrev):
418 """
424 """
419 short version of read that only returns the files modified by the cset
425 short version of read that only returns the files modified by the cset
420 """
426 """
421 text = self.revision(nodeorrev)
427 text = self.revision(nodeorrev)
422 if not text:
428 if not text:
423 return []
429 return []
424 last = text.index(b"\n\n")
430 last = text.index(b"\n\n")
425 l = text[:last].split(b'\n')
431 l = text[:last].split(b'\n')
426 return l[3:]
432 return l[3:]
427
433
428 def add(
434 def add(
429 self,
435 self,
430 manifest,
436 manifest,
431 files,
437 files,
432 desc,
438 desc,
433 transaction,
439 transaction,
434 p1,
440 p1,
435 p2,
441 p2,
436 user,
442 user,
437 date=None,
443 date=None,
438 extra=None,
444 extra=None,
439 ):
445 ):
440 # Convert to UTF-8 encoded bytestrings as the very first
446 # Convert to UTF-8 encoded bytestrings as the very first
441 # thing: calling any method on a localstr object will turn it
447 # thing: calling any method on a localstr object will turn it
442 # into a str object and the cached UTF-8 string is thus lost.
448 # into a str object and the cached UTF-8 string is thus lost.
443 user, desc = encoding.fromlocal(user), encoding.fromlocal(desc)
449 user, desc = encoding.fromlocal(user), encoding.fromlocal(desc)
444
450
445 user = user.strip()
451 user = user.strip()
446 # An empty username or a username with a "\n" will make the
452 # An empty username or a username with a "\n" will make the
447 # revision text contain two "\n\n" sequences -> corrupt
453 # revision text contain two "\n\n" sequences -> corrupt
448 # repository since read cannot unpack the revision.
454 # repository since read cannot unpack the revision.
449 if not user:
455 if not user:
450 raise error.StorageError(_(b"empty username"))
456 raise error.StorageError(_(b"empty username"))
451 if b"\n" in user:
457 if b"\n" in user:
452 raise error.StorageError(
458 raise error.StorageError(
453 _(b"username %r contains a newline") % pycompat.bytestr(user)
459 _(b"username %r contains a newline") % pycompat.bytestr(user)
454 )
460 )
455
461
456 desc = stripdesc(desc)
462 desc = stripdesc(desc)
457
463
458 if date:
464 if date:
459 parseddate = b"%d %d" % dateutil.parsedate(date)
465 parseddate = b"%d %d" % dateutil.parsedate(date)
460 else:
466 else:
461 parseddate = b"%d %d" % dateutil.makedate()
467 parseddate = b"%d %d" % dateutil.makedate()
462 if extra:
468 if extra:
463 branch = extra.get(b"branch")
469 branch = extra.get(b"branch")
464 if branch in (b"default", b""):
470 if branch in (b"default", b""):
465 del extra[b"branch"]
471 del extra[b"branch"]
466 elif branch in (b".", b"null", b"tip"):
472 elif branch in (b".", b"null", b"tip"):
467 raise error.StorageError(
473 raise error.StorageError(
468 _(b'the name \'%s\' is reserved') % branch
474 _(b'the name \'%s\' is reserved') % branch
469 )
475 )
470 sortedfiles = sorted(files.touched)
476 sortedfiles = sorted(files.touched)
471 flags = 0
477 flags = 0
472 sidedata = None
478 sidedata = None
473 if self._copiesstorage == b'changeset-sidedata':
479 if self._copiesstorage == b'changeset-sidedata':
474 if files.has_copies_info:
480 if files.has_copies_info:
475 flags |= flagutil.REVIDX_HASCOPIESINFO
481 flags |= flagutil.REVIDX_HASCOPIESINFO
476 sidedata = metadata.encode_files_sidedata(files)
482 sidedata = metadata.encode_files_sidedata(files)
477
483
478 if extra:
484 if extra:
479 extra = encodeextra(extra)
485 extra = encodeextra(extra)
480 parseddate = b"%s %s" % (parseddate, extra)
486 parseddate = b"%s %s" % (parseddate, extra)
481 l = [hex(manifest), user, parseddate] + sortedfiles + [b"", desc]
487 l = [hex(manifest), user, parseddate] + sortedfiles + [b"", desc]
482 text = b"\n".join(l)
488 text = b"\n".join(l)
483 rev = self.addrevision(
489 rev = self.addrevision(
484 text, transaction, len(self), p1, p2, sidedata=sidedata, flags=flags
490 text, transaction, len(self), p1, p2, sidedata=sidedata, flags=flags
485 )
491 )
486 return self.node(rev)
492 return self.node(rev)
487
493
488 def branchinfo(self, rev):
494 def branchinfo(self, rev):
489 """return the branch name and open/close state of a revision
495 """return the branch name and open/close state of a revision
490
496
491 This function exists because creating a changectx object
497 This function exists because creating a changectx object
492 just to access this is costly."""
498 just to access this is costly."""
493 return self.changelogrevision(rev).branchinfo
499 return self.changelogrevision(rev).branchinfo
494
500
495 def _nodeduplicatecallback(self, transaction, rev):
501 def _nodeduplicatecallback(self, transaction, rev):
496 # keep track of revisions that got "re-added", eg: unbunde of know rev.
502 # keep track of revisions that got "re-added", eg: unbunde of know rev.
497 #
503 #
498 # We track them in a list to preserve their order from the source bundle
504 # We track them in a list to preserve their order from the source bundle
499 duplicates = transaction.changes.setdefault(b'revduplicates', [])
505 duplicates = transaction.changes.setdefault(b'revduplicates', [])
500 duplicates.append(rev)
506 duplicates.append(rev)
@@ -1,4246 +1,4062 b''
1 # revlog.py - storage back-end for mercurial
1 # revlog.py - storage back-end for mercurial
2 # coding: utf8
2 # coding: utf8
3 #
3 #
4 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
4 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 """Storage back-end for Mercurial.
9 """Storage back-end for Mercurial.
10
10
11 This provides efficient delta storage with O(1) retrieve and append
11 This provides efficient delta storage with O(1) retrieve and append
12 and O(changes) merge between branches.
12 and O(changes) merge between branches.
13 """
13 """
14
14
15
15
16 import binascii
16 import binascii
17 import collections
17 import collections
18 import contextlib
18 import contextlib
19 import io
19 import io
20 import os
20 import os
21 import struct
21 import struct
22 import weakref
22 import weakref
23 import zlib
23 import zlib
24
24
25 # import stuff from node for others to import from revlog
25 # import stuff from node for others to import from revlog
26 from .node import (
26 from .node import (
27 bin,
27 bin,
28 hex,
28 hex,
29 nullrev,
29 nullrev,
30 sha1nodeconstants,
30 sha1nodeconstants,
31 short,
31 short,
32 wdirrev,
32 wdirrev,
33 )
33 )
34 from .i18n import _
34 from .i18n import _
35 from .revlogutils.constants import (
35 from .revlogutils.constants import (
36 ALL_KINDS,
36 ALL_KINDS,
37 CHANGELOGV2,
37 CHANGELOGV2,
38 COMP_MODE_DEFAULT,
38 COMP_MODE_DEFAULT,
39 COMP_MODE_INLINE,
39 COMP_MODE_INLINE,
40 COMP_MODE_PLAIN,
40 COMP_MODE_PLAIN,
41 DELTA_BASE_REUSE_NO,
41 DELTA_BASE_REUSE_NO,
42 DELTA_BASE_REUSE_TRY,
42 DELTA_BASE_REUSE_TRY,
43 ENTRY_RANK,
43 ENTRY_RANK,
44 FEATURES_BY_VERSION,
44 FEATURES_BY_VERSION,
45 FLAG_GENERALDELTA,
45 FLAG_GENERALDELTA,
46 FLAG_INLINE_DATA,
46 FLAG_INLINE_DATA,
47 INDEX_HEADER,
47 INDEX_HEADER,
48 KIND_CHANGELOG,
48 KIND_CHANGELOG,
49 KIND_FILELOG,
49 KIND_FILELOG,
50 RANK_UNKNOWN,
50 RANK_UNKNOWN,
51 REVLOGV0,
51 REVLOGV0,
52 REVLOGV1,
52 REVLOGV1,
53 REVLOGV1_FLAGS,
53 REVLOGV1_FLAGS,
54 REVLOGV2,
54 REVLOGV2,
55 REVLOGV2_FLAGS,
55 REVLOGV2_FLAGS,
56 REVLOG_DEFAULT_FLAGS,
56 REVLOG_DEFAULT_FLAGS,
57 REVLOG_DEFAULT_FORMAT,
57 REVLOG_DEFAULT_FORMAT,
58 REVLOG_DEFAULT_VERSION,
58 REVLOG_DEFAULT_VERSION,
59 SUPPORTED_FLAGS,
59 SUPPORTED_FLAGS,
60 )
60 )
61 from .revlogutils.flagutil import (
61 from .revlogutils.flagutil import (
62 REVIDX_DEFAULT_FLAGS,
62 REVIDX_DEFAULT_FLAGS,
63 REVIDX_ELLIPSIS,
63 REVIDX_ELLIPSIS,
64 REVIDX_EXTSTORED,
64 REVIDX_EXTSTORED,
65 REVIDX_FLAGS_ORDER,
65 REVIDX_FLAGS_ORDER,
66 REVIDX_HASCOPIESINFO,
66 REVIDX_HASCOPIESINFO,
67 REVIDX_ISCENSORED,
67 REVIDX_ISCENSORED,
68 REVIDX_RAWTEXT_CHANGING_FLAGS,
68 REVIDX_RAWTEXT_CHANGING_FLAGS,
69 )
69 )
70 from .thirdparty import attr
70 from .thirdparty import attr
71 from . import (
71 from . import (
72 ancestor,
72 ancestor,
73 dagop,
73 dagop,
74 error,
74 error,
75 mdiff,
75 mdiff,
76 policy,
76 policy,
77 pycompat,
77 pycompat,
78 revlogutils,
78 revlogutils,
79 templatefilters,
79 templatefilters,
80 util,
80 util,
81 )
81 )
82 from .interfaces import (
82 from .interfaces import (
83 repository,
83 repository,
84 util as interfaceutil,
84 util as interfaceutil,
85 )
85 )
86 from .revlogutils import (
86 from .revlogutils import (
87 deltas as deltautil,
87 deltas as deltautil,
88 docket as docketutil,
88 docket as docketutil,
89 flagutil,
89 flagutil,
90 nodemap as nodemaputil,
90 nodemap as nodemaputil,
91 randomaccessfile,
91 randomaccessfile,
92 revlogv0,
92 revlogv0,
93 rewrite,
93 rewrite,
94 sidedata as sidedatautil,
94 sidedata as sidedatautil,
95 )
95 )
96 from .utils import (
96 from .utils import (
97 storageutil,
97 storageutil,
98 stringutil,
98 stringutil,
99 )
99 )
100
100
101 # blanked usage of all the name to prevent pyflakes constraints
101 # blanked usage of all the name to prevent pyflakes constraints
102 # We need these name available in the module for extensions.
102 # We need these name available in the module for extensions.
103
103
104 REVLOGV0
104 REVLOGV0
105 REVLOGV1
105 REVLOGV1
106 REVLOGV2
106 REVLOGV2
107 CHANGELOGV2
107 CHANGELOGV2
108 FLAG_INLINE_DATA
108 FLAG_INLINE_DATA
109 FLAG_GENERALDELTA
109 FLAG_GENERALDELTA
110 REVLOG_DEFAULT_FLAGS
110 REVLOG_DEFAULT_FLAGS
111 REVLOG_DEFAULT_FORMAT
111 REVLOG_DEFAULT_FORMAT
112 REVLOG_DEFAULT_VERSION
112 REVLOG_DEFAULT_VERSION
113 REVLOGV1_FLAGS
113 REVLOGV1_FLAGS
114 REVLOGV2_FLAGS
114 REVLOGV2_FLAGS
115 REVIDX_ISCENSORED
115 REVIDX_ISCENSORED
116 REVIDX_ELLIPSIS
116 REVIDX_ELLIPSIS
117 REVIDX_HASCOPIESINFO
117 REVIDX_HASCOPIESINFO
118 REVIDX_EXTSTORED
118 REVIDX_EXTSTORED
119 REVIDX_DEFAULT_FLAGS
119 REVIDX_DEFAULT_FLAGS
120 REVIDX_FLAGS_ORDER
120 REVIDX_FLAGS_ORDER
121 REVIDX_RAWTEXT_CHANGING_FLAGS
121 REVIDX_RAWTEXT_CHANGING_FLAGS
122
122
123 parsers = policy.importmod('parsers')
123 parsers = policy.importmod('parsers')
124 rustancestor = policy.importrust('ancestor')
124 rustancestor = policy.importrust('ancestor')
125 rustdagop = policy.importrust('dagop')
125 rustdagop = policy.importrust('dagop')
126 rustrevlog = policy.importrust('revlog')
126 rustrevlog = policy.importrust('revlog')
127
127
128 # Aliased for performance.
128 # Aliased for performance.
129 _zlibdecompress = zlib.decompress
129 _zlibdecompress = zlib.decompress
130
130
131 # max size of inline data embedded into a revlog
131 # max size of inline data embedded into a revlog
132 _maxinline = 131072
132 _maxinline = 131072
133
133
134 # Flag processors for REVIDX_ELLIPSIS.
134 # Flag processors for REVIDX_ELLIPSIS.
135 def ellipsisreadprocessor(rl, text):
135 def ellipsisreadprocessor(rl, text):
136 return text, False
136 return text, False
137
137
138
138
139 def ellipsiswriteprocessor(rl, text):
139 def ellipsiswriteprocessor(rl, text):
140 return text, False
140 return text, False
141
141
142
142
143 def ellipsisrawprocessor(rl, text):
143 def ellipsisrawprocessor(rl, text):
144 return False
144 return False
145
145
146
146
147 ellipsisprocessor = (
147 ellipsisprocessor = (
148 ellipsisreadprocessor,
148 ellipsisreadprocessor,
149 ellipsiswriteprocessor,
149 ellipsiswriteprocessor,
150 ellipsisrawprocessor,
150 ellipsisrawprocessor,
151 )
151 )
152
152
153
153
154 def _verify_revision(rl, skipflags, state, node):
154 def _verify_revision(rl, skipflags, state, node):
155 """Verify the integrity of the given revlog ``node`` while providing a hook
155 """Verify the integrity of the given revlog ``node`` while providing a hook
156 point for extensions to influence the operation."""
156 point for extensions to influence the operation."""
157 if skipflags:
157 if skipflags:
158 state[b'skipread'].add(node)
158 state[b'skipread'].add(node)
159 else:
159 else:
160 # Side-effect: read content and verify hash.
160 # Side-effect: read content and verify hash.
161 rl.revision(node)
161 rl.revision(node)
162
162
163
163
164 # True if a fast implementation for persistent-nodemap is available
164 # True if a fast implementation for persistent-nodemap is available
165 #
165 #
166 # We also consider we have a "fast" implementation in "pure" python because
166 # We also consider we have a "fast" implementation in "pure" python because
167 # people using pure don't really have performance consideration (and a
167 # people using pure don't really have performance consideration (and a
168 # wheelbarrow of other slowness source)
168 # wheelbarrow of other slowness source)
169 HAS_FAST_PERSISTENT_NODEMAP = rustrevlog is not None or hasattr(
169 HAS_FAST_PERSISTENT_NODEMAP = rustrevlog is not None or hasattr(
170 parsers, 'BaseIndexObject'
170 parsers, 'BaseIndexObject'
171 )
171 )
172
172
173
173
174 @interfaceutil.implementer(repository.irevisiondelta)
174 @interfaceutil.implementer(repository.irevisiondelta)
175 @attr.s(slots=True)
175 @attr.s(slots=True)
176 class revlogrevisiondelta:
176 class revlogrevisiondelta:
177 node = attr.ib()
177 node = attr.ib()
178 p1node = attr.ib()
178 p1node = attr.ib()
179 p2node = attr.ib()
179 p2node = attr.ib()
180 basenode = attr.ib()
180 basenode = attr.ib()
181 flags = attr.ib()
181 flags = attr.ib()
182 baserevisionsize = attr.ib()
182 baserevisionsize = attr.ib()
183 revision = attr.ib()
183 revision = attr.ib()
184 delta = attr.ib()
184 delta = attr.ib()
185 sidedata = attr.ib()
185 sidedata = attr.ib()
186 protocol_flags = attr.ib()
186 protocol_flags = attr.ib()
187 linknode = attr.ib(default=None)
187 linknode = attr.ib(default=None)
188
188
189
189
190 @interfaceutil.implementer(repository.iverifyproblem)
190 @interfaceutil.implementer(repository.iverifyproblem)
191 @attr.s(frozen=True)
191 @attr.s(frozen=True)
192 class revlogproblem:
192 class revlogproblem:
193 warning = attr.ib(default=None)
193 warning = attr.ib(default=None)
194 error = attr.ib(default=None)
194 error = attr.ib(default=None)
195 node = attr.ib(default=None)
195 node = attr.ib(default=None)
196
196
197
197
198 def parse_index_v1(data, inline):
198 def parse_index_v1(data, inline):
199 # call the C implementation to parse the index data
199 # call the C implementation to parse the index data
200 index, cache = parsers.parse_index2(data, inline)
200 index, cache = parsers.parse_index2(data, inline)
201 return index, cache
201 return index, cache
202
202
203
203
204 def parse_index_v2(data, inline):
204 def parse_index_v2(data, inline):
205 # call the C implementation to parse the index data
205 # call the C implementation to parse the index data
206 index, cache = parsers.parse_index2(data, inline, format=REVLOGV2)
206 index, cache = parsers.parse_index2(data, inline, format=REVLOGV2)
207 return index, cache
207 return index, cache
208
208
209
209
210 def parse_index_cl_v2(data, inline):
210 def parse_index_cl_v2(data, inline):
211 # call the C implementation to parse the index data
211 # call the C implementation to parse the index data
212 index, cache = parsers.parse_index2(data, inline, format=CHANGELOGV2)
212 index, cache = parsers.parse_index2(data, inline, format=CHANGELOGV2)
213 return index, cache
213 return index, cache
214
214
215
215
216 if hasattr(parsers, 'parse_index_devel_nodemap'):
216 if hasattr(parsers, 'parse_index_devel_nodemap'):
217
217
218 def parse_index_v1_nodemap(data, inline):
218 def parse_index_v1_nodemap(data, inline):
219 index, cache = parsers.parse_index_devel_nodemap(data, inline)
219 index, cache = parsers.parse_index_devel_nodemap(data, inline)
220 return index, cache
220 return index, cache
221
221
222
222
223 else:
223 else:
224 parse_index_v1_nodemap = None
224 parse_index_v1_nodemap = None
225
225
226
226
227 def parse_index_v1_mixed(data, inline):
227 def parse_index_v1_mixed(data, inline):
228 index, cache = parse_index_v1(data, inline)
228 index, cache = parse_index_v1(data, inline)
229 return rustrevlog.MixedIndex(index), cache
229 return rustrevlog.MixedIndex(index), cache
230
230
231
231
232 # corresponds to uncompressed length of indexformatng (2 gigs, 4-byte
232 # corresponds to uncompressed length of indexformatng (2 gigs, 4-byte
233 # signed integer)
233 # signed integer)
234 _maxentrysize = 0x7FFFFFFF
234 _maxentrysize = 0x7FFFFFFF
235
235
236 FILE_TOO_SHORT_MSG = _(
236 FILE_TOO_SHORT_MSG = _(
237 b'cannot read from revlog %s;'
237 b'cannot read from revlog %s;'
238 b' expected %d bytes from offset %d, data size is %d'
238 b' expected %d bytes from offset %d, data size is %d'
239 )
239 )
240
240
241 hexdigits = b'0123456789abcdefABCDEF'
241 hexdigits = b'0123456789abcdefABCDEF'
242
242
243
243
244 class _Config:
244 class _Config:
245 def copy(self):
245 def copy(self):
246 return self.__class__(**self.__dict__)
246 return self.__class__(**self.__dict__)
247
247
248
248
249 @attr.s()
249 @attr.s()
250 class FeatureConfig(_Config):
250 class FeatureConfig(_Config):
251 """Hold configuration values about the available revlog features"""
251 """Hold configuration values about the available revlog features"""
252
252
253 # the default compression engine
253 # the default compression engine
254 compression_engine = attr.ib(default=b'zlib')
254 compression_engine = attr.ib(default=b'zlib')
255 # compression engines options
255 # compression engines options
256 compression_engine_options = attr.ib(default=attr.Factory(dict))
256 compression_engine_options = attr.ib(default=attr.Factory(dict))
257
257
258 # can we use censor on this revlog
258 # can we use censor on this revlog
259 censorable = attr.ib(default=False)
259 censorable = attr.ib(default=False)
260 # does this revlog use the "side data" feature
260 # does this revlog use the "side data" feature
261 has_side_data = attr.ib(default=False)
261 has_side_data = attr.ib(default=False)
262 # might remove rank configuration once the computation has no impact
262 # might remove rank configuration once the computation has no impact
263 compute_rank = attr.ib(default=False)
263 compute_rank = attr.ib(default=False)
264 # parent order is supposed to be semantically irrelevant, so we
264 # parent order is supposed to be semantically irrelevant, so we
265 # normally resort parents to ensure that the first parent is non-null,
265 # normally resort parents to ensure that the first parent is non-null,
266 # if there is a non-null parent at all.
266 # if there is a non-null parent at all.
267 # filelog abuses the parent order as flag to mark some instances of
267 # filelog abuses the parent order as flag to mark some instances of
268 # meta-encoded files, so allow it to disable this behavior.
268 # meta-encoded files, so allow it to disable this behavior.
269 canonical_parent_order = attr.ib(default=False)
269 canonical_parent_order = attr.ib(default=False)
270 # can ellipsis commit be used
270 # can ellipsis commit be used
271 enable_ellipsis = attr.ib(default=False)
271 enable_ellipsis = attr.ib(default=False)
272
272
273 def copy(self):
273 def copy(self):
274 new = super().copy()
274 new = super().copy()
275 new.compression_engine_options = self.compression_engine_options.copy()
275 new.compression_engine_options = self.compression_engine_options.copy()
276 return new
276 return new
277
277
278
278
279 @attr.s()
279 @attr.s()
280 class DataConfig(_Config):
280 class DataConfig(_Config):
281 """Hold configuration value about how the revlog data are read"""
281 """Hold configuration value about how the revlog data are read"""
282
282
283 # should we try to open the "pending" version of the revlog
283 # should we try to open the "pending" version of the revlog
284 try_pending = attr.ib(default=False)
284 try_pending = attr.ib(default=False)
285 # should we try to open the "splitted" version of the revlog
285 # should we try to open the "splitted" version of the revlog
286 try_split = attr.ib(default=False)
286 try_split = attr.ib(default=False)
287 # When True, indexfile should be opened with checkambig=True at writing,
287 # When True, indexfile should be opened with checkambig=True at writing,
288 # to avoid file stat ambiguity.
288 # to avoid file stat ambiguity.
289 check_ambig = attr.ib(default=False)
289 check_ambig = attr.ib(default=False)
290
290
291 # If true, use mmap instead of reading to deal with large index
291 # If true, use mmap instead of reading to deal with large index
292 mmap_large_index = attr.ib(default=False)
292 mmap_large_index = attr.ib(default=False)
293 # how much data is large
293 # how much data is large
294 mmap_index_threshold = attr.ib(default=None)
294 mmap_index_threshold = attr.ib(default=None)
295 # How much data to read and cache into the raw revlog data cache.
295 # How much data to read and cache into the raw revlog data cache.
296 chunk_cache_size = attr.ib(default=65536)
296 chunk_cache_size = attr.ib(default=65536)
297
297
298 # The size of the uncompressed cache compared to the largest revision seen.
298 # The size of the uncompressed cache compared to the largest revision seen.
299 uncompressed_cache_factor = attr.ib(default=None)
299 uncompressed_cache_factor = attr.ib(default=None)
300
300
301 # The number of chunk cached
301 # The number of chunk cached
302 uncompressed_cache_count = attr.ib(default=None)
302 uncompressed_cache_count = attr.ib(default=None)
303
303
304 # Allow sparse reading of the revlog data
304 # Allow sparse reading of the revlog data
305 with_sparse_read = attr.ib(default=False)
305 with_sparse_read = attr.ib(default=False)
306 # minimal density of a sparse read chunk
306 # minimal density of a sparse read chunk
307 sr_density_threshold = attr.ib(default=0.50)
307 sr_density_threshold = attr.ib(default=0.50)
308 # minimal size of data we skip when performing sparse read
308 # minimal size of data we skip when performing sparse read
309 sr_min_gap_size = attr.ib(default=262144)
309 sr_min_gap_size = attr.ib(default=262144)
310
310
311 # are delta encoded against arbitrary bases.
311 # are delta encoded against arbitrary bases.
312 generaldelta = attr.ib(default=False)
312 generaldelta = attr.ib(default=False)
313
313
314
314
315 @attr.s()
315 @attr.s()
316 class DeltaConfig(_Config):
316 class DeltaConfig(_Config):
317 """Hold configuration value about how new delta are computed
317 """Hold configuration value about how new delta are computed
318
318
319 Some attributes are duplicated from DataConfig to help havign each object
319 Some attributes are duplicated from DataConfig to help havign each object
320 self contained.
320 self contained.
321 """
321 """
322
322
323 # can delta be encoded against arbitrary bases.
323 # can delta be encoded against arbitrary bases.
324 general_delta = attr.ib(default=False)
324 general_delta = attr.ib(default=False)
325 # Allow sparse writing of the revlog data
325 # Allow sparse writing of the revlog data
326 sparse_revlog = attr.ib(default=False)
326 sparse_revlog = attr.ib(default=False)
327 # maximum length of a delta chain
327 # maximum length of a delta chain
328 max_chain_len = attr.ib(default=None)
328 max_chain_len = attr.ib(default=None)
329 # Maximum distance between delta chain base start and end
329 # Maximum distance between delta chain base start and end
330 max_deltachain_span = attr.ib(default=-1)
330 max_deltachain_span = attr.ib(default=-1)
331 # If `upper_bound_comp` is not None, this is the expected maximal gain from
331 # If `upper_bound_comp` is not None, this is the expected maximal gain from
332 # compression for the data content.
332 # compression for the data content.
333 upper_bound_comp = attr.ib(default=None)
333 upper_bound_comp = attr.ib(default=None)
334 # Should we try a delta against both parent
334 # Should we try a delta against both parent
335 delta_both_parents = attr.ib(default=True)
335 delta_both_parents = attr.ib(default=True)
336 # Test delta base candidate group by chunk of this maximal size.
336 # Test delta base candidate group by chunk of this maximal size.
337 candidate_group_chunk_size = attr.ib(default=0)
337 candidate_group_chunk_size = attr.ib(default=0)
338 # Should we display debug information about delta computation
338 # Should we display debug information about delta computation
339 debug_delta = attr.ib(default=False)
339 debug_delta = attr.ib(default=False)
340 # trust incoming delta by default
340 # trust incoming delta by default
341 lazy_delta = attr.ib(default=True)
341 lazy_delta = attr.ib(default=True)
342 # trust the base of incoming delta by default
342 # trust the base of incoming delta by default
343 lazy_delta_base = attr.ib(default=False)
343 lazy_delta_base = attr.ib(default=False)
344
344
345
345
346 class _InnerRevlog:
346 class _InnerRevlog:
347 """An inner layer of the revlog object
347 """An inner layer of the revlog object
348
348
349 That layer exist to be able to delegate some operation to Rust, its
349 That layer exist to be able to delegate some operation to Rust, its
350 boundaries are arbitrary and based on what we can delegate to Rust.
350 boundaries are arbitrary and based on what we can delegate to Rust.
351 """
351 """
352
352
353 def __init__(
353 def __init__(
354 self,
354 self,
355 opener,
355 opener,
356 index,
356 index,
357 index_file,
357 index_file,
358 data_file,
358 data_file,
359 sidedata_file,
359 sidedata_file,
360 inline,
360 inline,
361 data_config,
361 data_config,
362 delta_config,
362 delta_config,
363 feature_config,
363 feature_config,
364 chunk_cache,
364 chunk_cache,
365 default_compression_header,
365 default_compression_header,
366 ):
366 ):
367 self.opener = opener
367 self.opener = opener
368 self.index = index
368 self.index = index
369
369
370 self.__index_file = index_file
370 self.__index_file = index_file
371 self.data_file = data_file
371 self.data_file = data_file
372 self.sidedata_file = sidedata_file
372 self.sidedata_file = sidedata_file
373 self.inline = inline
373 self.inline = inline
374 self.data_config = data_config
374 self.data_config = data_config
375 self.delta_config = delta_config
375 self.delta_config = delta_config
376 self.feature_config = feature_config
376 self.feature_config = feature_config
377
377
378 # used during diverted write.
378 # used during diverted write.
379 self._orig_index_file = None
379 self._orig_index_file = None
380
380
381 self._default_compression_header = default_compression_header
381 self._default_compression_header = default_compression_header
382
382
383 # index
383 # index
384
384
385 # 3-tuple of file handles being used for active writing.
385 # 3-tuple of file handles being used for active writing.
386 self._writinghandles = None
386 self._writinghandles = None
387
387
388 self._segmentfile = randomaccessfile.randomaccessfile(
388 self._segmentfile = randomaccessfile.randomaccessfile(
389 self.opener,
389 self.opener,
390 (self.index_file if self.inline else self.data_file),
390 (self.index_file if self.inline else self.data_file),
391 self.data_config.chunk_cache_size,
391 self.data_config.chunk_cache_size,
392 chunk_cache,
392 chunk_cache,
393 )
393 )
394 self._segmentfile_sidedata = randomaccessfile.randomaccessfile(
394 self._segmentfile_sidedata = randomaccessfile.randomaccessfile(
395 self.opener,
395 self.opener,
396 self.sidedata_file,
396 self.sidedata_file,
397 self.data_config.chunk_cache_size,
397 self.data_config.chunk_cache_size,
398 )
398 )
399
399
400 # revlog header -> revlog compressor
400 # revlog header -> revlog compressor
401 self._decompressors = {}
401 self._decompressors = {}
402 # 3-tuple of (node, rev, text) for a raw revision.
402 # 3-tuple of (node, rev, text) for a raw revision.
403 self._revisioncache = None
403 self._revisioncache = None
404
404
405 # cache some uncompressed chunks
405 # cache some uncompressed chunks
406 # rev → uncompressed_chunk
406 # rev → uncompressed_chunk
407 #
407 #
408 # the max cost is dynamically updated to be proportionnal to the
408 # the max cost is dynamically updated to be proportionnal to the
409 # size of revision we actually encounter.
409 # size of revision we actually encounter.
410 self._uncompressed_chunk_cache = None
410 self._uncompressed_chunk_cache = None
411 if self.data_config.uncompressed_cache_factor is not None:
411 if self.data_config.uncompressed_cache_factor is not None:
412 self._uncompressed_chunk_cache = util.lrucachedict(
412 self._uncompressed_chunk_cache = util.lrucachedict(
413 self.data_config.uncompressed_cache_count,
413 self.data_config.uncompressed_cache_count,
414 maxcost=65536, # some arbitrary initial value
414 maxcost=65536, # some arbitrary initial value
415 )
415 )
416
416
417 self._delay_buffer = None
417 self._delay_buffer = None
418
418
419 @property
419 @property
420 def index_file(self):
420 def index_file(self):
421 return self.__index_file
421 return self.__index_file
422
422
423 @index_file.setter
423 @index_file.setter
424 def index_file(self, new_index_file):
424 def index_file(self, new_index_file):
425 self.__index_file = new_index_file
425 self.__index_file = new_index_file
426 if self.inline:
426 if self.inline:
427 self._segmentfile.filename = new_index_file
427 self._segmentfile.filename = new_index_file
428
428
429 def __len__(self):
429 def __len__(self):
430 return len(self.index)
430 return len(self.index)
431
431
432 def clear_cache(self):
432 def clear_cache(self):
433 assert not self.is_delaying
433 assert not self.is_delaying
434 self._revisioncache = None
434 self._revisioncache = None
435 if self._uncompressed_chunk_cache is not None:
435 if self._uncompressed_chunk_cache is not None:
436 self._uncompressed_chunk_cache.clear()
436 self._uncompressed_chunk_cache.clear()
437 self._segmentfile.clear_cache()
437 self._segmentfile.clear_cache()
438 self._segmentfile_sidedata.clear_cache()
438 self._segmentfile_sidedata.clear_cache()
439
439
440 @property
440 @property
441 def canonical_index_file(self):
441 def canonical_index_file(self):
442 if self._orig_index_file is not None:
442 if self._orig_index_file is not None:
443 return self._orig_index_file
443 return self._orig_index_file
444 return self.index_file
444 return self.index_file
445
445
446 @property
446 @property
447 def is_delaying(self):
447 def is_delaying(self):
448 """is the revlog is currently delaying the visibility of written data?
448 """is the revlog is currently delaying the visibility of written data?
449
449
450 The delaying mechanism can be either in-memory or written on disk in a
450 The delaying mechanism can be either in-memory or written on disk in a
451 side-file."""
451 side-file."""
452 return (self._delay_buffer is not None) or (
452 return (self._delay_buffer is not None) or (
453 self._orig_index_file is not None
453 self._orig_index_file is not None
454 )
454 )
455
455
456 # Derived from index values.
456 # Derived from index values.
457
457
458 def start(self, rev):
458 def start(self, rev):
459 """the offset of the data chunk for this revision"""
459 """the offset of the data chunk for this revision"""
460 return int(self.index[rev][0] >> 16)
460 return int(self.index[rev][0] >> 16)
461
461
462 def length(self, rev):
462 def length(self, rev):
463 """the length of the data chunk for this revision"""
463 """the length of the data chunk for this revision"""
464 return self.index[rev][1]
464 return self.index[rev][1]
465
465
466 def end(self, rev):
466 def end(self, rev):
467 """the end of the data chunk for this revision"""
467 """the end of the data chunk for this revision"""
468 return self.start(rev) + self.length(rev)
468 return self.start(rev) + self.length(rev)
469
469
470 def deltaparent(self, rev):
470 def deltaparent(self, rev):
471 """return deltaparent of the given revision"""
471 """return deltaparent of the given revision"""
472 base = self.index[rev][3]
472 base = self.index[rev][3]
473 if base == rev:
473 if base == rev:
474 return nullrev
474 return nullrev
475 elif self.delta_config.general_delta:
475 elif self.delta_config.general_delta:
476 return base
476 return base
477 else:
477 else:
478 return rev - 1
478 return rev - 1
479
479
480 def issnapshot(self, rev):
480 def issnapshot(self, rev):
481 """tells whether rev is a snapshot"""
481 """tells whether rev is a snapshot"""
482 if not self.delta_config.sparse_revlog:
482 if not self.delta_config.sparse_revlog:
483 return self.deltaparent(rev) == nullrev
483 return self.deltaparent(rev) == nullrev
484 elif hasattr(self.index, 'issnapshot'):
484 elif hasattr(self.index, 'issnapshot'):
485 # directly assign the method to cache the testing and access
485 # directly assign the method to cache the testing and access
486 self.issnapshot = self.index.issnapshot
486 self.issnapshot = self.index.issnapshot
487 return self.issnapshot(rev)
487 return self.issnapshot(rev)
488 if rev == nullrev:
488 if rev == nullrev:
489 return True
489 return True
490 entry = self.index[rev]
490 entry = self.index[rev]
491 base = entry[3]
491 base = entry[3]
492 if base == rev:
492 if base == rev:
493 return True
493 return True
494 if base == nullrev:
494 if base == nullrev:
495 return True
495 return True
496 p1 = entry[5]
496 p1 = entry[5]
497 while self.length(p1) == 0:
497 while self.length(p1) == 0:
498 b = self.deltaparent(p1)
498 b = self.deltaparent(p1)
499 if b == p1:
499 if b == p1:
500 break
500 break
501 p1 = b
501 p1 = b
502 p2 = entry[6]
502 p2 = entry[6]
503 while self.length(p2) == 0:
503 while self.length(p2) == 0:
504 b = self.deltaparent(p2)
504 b = self.deltaparent(p2)
505 if b == p2:
505 if b == p2:
506 break
506 break
507 p2 = b
507 p2 = b
508 if base == p1 or base == p2:
508 if base == p1 or base == p2:
509 return False
509 return False
510 return self.issnapshot(base)
510 return self.issnapshot(base)
511
511
512 def _deltachain(self, rev, stoprev=None):
512 def _deltachain(self, rev, stoprev=None):
513 """Obtain the delta chain for a revision.
513 """Obtain the delta chain for a revision.
514
514
515 ``stoprev`` specifies a revision to stop at. If not specified, we
515 ``stoprev`` specifies a revision to stop at. If not specified, we
516 stop at the base of the chain.
516 stop at the base of the chain.
517
517
518 Returns a 2-tuple of (chain, stopped) where ``chain`` is a list of
518 Returns a 2-tuple of (chain, stopped) where ``chain`` is a list of
519 revs in ascending order and ``stopped`` is a bool indicating whether
519 revs in ascending order and ``stopped`` is a bool indicating whether
520 ``stoprev`` was hit.
520 ``stoprev`` was hit.
521 """
521 """
522 generaldelta = self.delta_config.general_delta
522 generaldelta = self.delta_config.general_delta
523 # Try C implementation.
523 # Try C implementation.
524 try:
524 try:
525 return self.index.deltachain(rev, stoprev, generaldelta)
525 return self.index.deltachain(rev, stoprev, generaldelta)
526 except AttributeError:
526 except AttributeError:
527 pass
527 pass
528
528
529 chain = []
529 chain = []
530
530
531 # Alias to prevent attribute lookup in tight loop.
531 # Alias to prevent attribute lookup in tight loop.
532 index = self.index
532 index = self.index
533
533
534 iterrev = rev
534 iterrev = rev
535 e = index[iterrev]
535 e = index[iterrev]
536 while iterrev != e[3] and iterrev != stoprev:
536 while iterrev != e[3] and iterrev != stoprev:
537 chain.append(iterrev)
537 chain.append(iterrev)
538 if generaldelta:
538 if generaldelta:
539 iterrev = e[3]
539 iterrev = e[3]
540 else:
540 else:
541 iterrev -= 1
541 iterrev -= 1
542 e = index[iterrev]
542 e = index[iterrev]
543
543
544 if iterrev == stoprev:
544 if iterrev == stoprev:
545 stopped = True
545 stopped = True
546 else:
546 else:
547 chain.append(iterrev)
547 chain.append(iterrev)
548 stopped = False
548 stopped = False
549
549
550 chain.reverse()
550 chain.reverse()
551 return chain, stopped
551 return chain, stopped
552
552
553 @util.propertycache
553 @util.propertycache
554 def _compressor(self):
554 def _compressor(self):
555 engine = util.compengines[self.feature_config.compression_engine]
555 engine = util.compengines[self.feature_config.compression_engine]
556 return engine.revlogcompressor(
556 return engine.revlogcompressor(
557 self.feature_config.compression_engine_options
557 self.feature_config.compression_engine_options
558 )
558 )
559
559
560 @util.propertycache
560 @util.propertycache
561 def _decompressor(self):
561 def _decompressor(self):
562 """the default decompressor"""
562 """the default decompressor"""
563 if self._default_compression_header is None:
563 if self._default_compression_header is None:
564 return None
564 return None
565 t = self._default_compression_header
565 t = self._default_compression_header
566 c = self._get_decompressor(t)
566 c = self._get_decompressor(t)
567 return c.decompress
567 return c.decompress
568
568
569 def _get_decompressor(self, t):
569 def _get_decompressor(self, t):
570 try:
570 try:
571 compressor = self._decompressors[t]
571 compressor = self._decompressors[t]
572 except KeyError:
572 except KeyError:
573 try:
573 try:
574 engine = util.compengines.forrevlogheader(t)
574 engine = util.compengines.forrevlogheader(t)
575 compressor = engine.revlogcompressor(
575 compressor = engine.revlogcompressor(
576 self.feature_config.compression_engine_options
576 self.feature_config.compression_engine_options
577 )
577 )
578 self._decompressors[t] = compressor
578 self._decompressors[t] = compressor
579 except KeyError:
579 except KeyError:
580 raise error.RevlogError(
580 raise error.RevlogError(
581 _(b'unknown compression type %s') % binascii.hexlify(t)
581 _(b'unknown compression type %s') % binascii.hexlify(t)
582 )
582 )
583 return compressor
583 return compressor
584
584
585 def compress(self, data):
585 def compress(self, data):
586 """Generate a possibly-compressed representation of data."""
586 """Generate a possibly-compressed representation of data."""
587 if not data:
587 if not data:
588 return b'', data
588 return b'', data
589
589
590 compressed = self._compressor.compress(data)
590 compressed = self._compressor.compress(data)
591
591
592 if compressed:
592 if compressed:
593 # The revlog compressor added the header in the returned data.
593 # The revlog compressor added the header in the returned data.
594 return b'', compressed
594 return b'', compressed
595
595
596 if data[0:1] == b'\0':
596 if data[0:1] == b'\0':
597 return b'', data
597 return b'', data
598 return b'u', data
598 return b'u', data
599
599
600 def decompress(self, data):
600 def decompress(self, data):
601 """Decompress a revlog chunk.
601 """Decompress a revlog chunk.
602
602
603 The chunk is expected to begin with a header identifying the
603 The chunk is expected to begin with a header identifying the
604 format type so it can be routed to an appropriate decompressor.
604 format type so it can be routed to an appropriate decompressor.
605 """
605 """
606 if not data:
606 if not data:
607 return data
607 return data
608
608
609 # Revlogs are read much more frequently than they are written and many
609 # Revlogs are read much more frequently than they are written and many
610 # chunks only take microseconds to decompress, so performance is
610 # chunks only take microseconds to decompress, so performance is
611 # important here.
611 # important here.
612 #
612 #
613 # We can make a few assumptions about revlogs:
613 # We can make a few assumptions about revlogs:
614 #
614 #
615 # 1) the majority of chunks will be compressed (as opposed to inline
615 # 1) the majority of chunks will be compressed (as opposed to inline
616 # raw data).
616 # raw data).
617 # 2) decompressing *any* data will likely by at least 10x slower than
617 # 2) decompressing *any* data will likely by at least 10x slower than
618 # returning raw inline data.
618 # returning raw inline data.
619 # 3) we want to prioritize common and officially supported compression
619 # 3) we want to prioritize common and officially supported compression
620 # engines
620 # engines
621 #
621 #
622 # It follows that we want to optimize for "decompress compressed data
622 # It follows that we want to optimize for "decompress compressed data
623 # when encoded with common and officially supported compression engines"
623 # when encoded with common and officially supported compression engines"
624 # case over "raw data" and "data encoded by less common or non-official
624 # case over "raw data" and "data encoded by less common or non-official
625 # compression engines." That is why we have the inline lookup first
625 # compression engines." That is why we have the inline lookup first
626 # followed by the compengines lookup.
626 # followed by the compengines lookup.
627 #
627 #
628 # According to `hg perfrevlogchunks`, this is ~0.5% faster for zlib
628 # According to `hg perfrevlogchunks`, this is ~0.5% faster for zlib
629 # compressed chunks. And this matters for changelog and manifest reads.
629 # compressed chunks. And this matters for changelog and manifest reads.
630 t = data[0:1]
630 t = data[0:1]
631
631
632 if t == b'x':
632 if t == b'x':
633 try:
633 try:
634 return _zlibdecompress(data)
634 return _zlibdecompress(data)
635 except zlib.error as e:
635 except zlib.error as e:
636 raise error.RevlogError(
636 raise error.RevlogError(
637 _(b'revlog decompress error: %s')
637 _(b'revlog decompress error: %s')
638 % stringutil.forcebytestr(e)
638 % stringutil.forcebytestr(e)
639 )
639 )
640 # '\0' is more common than 'u' so it goes first.
640 # '\0' is more common than 'u' so it goes first.
641 elif t == b'\0':
641 elif t == b'\0':
642 return data
642 return data
643 elif t == b'u':
643 elif t == b'u':
644 return util.buffer(data, 1)
644 return util.buffer(data, 1)
645
645
646 compressor = self._get_decompressor(t)
646 compressor = self._get_decompressor(t)
647
647
648 return compressor.decompress(data)
648 return compressor.decompress(data)
649
649
650 @contextlib.contextmanager
650 @contextlib.contextmanager
651 def reading(self):
651 def reading(self):
652 """Context manager that keeps data and sidedata files open for reading"""
652 """Context manager that keeps data and sidedata files open for reading"""
653 if len(self.index) == 0:
653 if len(self.index) == 0:
654 yield # nothing to be read
654 yield # nothing to be read
655 else:
655 else:
656 with self._segmentfile.reading():
656 with self._segmentfile.reading():
657 with self._segmentfile_sidedata.reading():
657 with self._segmentfile_sidedata.reading():
658 yield
658 yield
659
659
660 @property
660 @property
661 def is_writing(self):
661 def is_writing(self):
662 """True is a writing context is open"""
662 """True is a writing context is open"""
663 return self._writinghandles is not None
663 return self._writinghandles is not None
664
664
665 @property
665 @property
666 def is_open(self):
666 def is_open(self):
667 """True if any file handle is being held
667 """True if any file handle is being held
668
668
669 Used for assert and debug in the python code"""
669 Used for assert and debug in the python code"""
670 return self._segmentfile.is_open or self._segmentfile_sidedata.is_open
670 return self._segmentfile.is_open or self._segmentfile_sidedata.is_open
671
671
672 @contextlib.contextmanager
672 @contextlib.contextmanager
673 def writing(self, transaction, data_end=None, sidedata_end=None):
673 def writing(self, transaction, data_end=None, sidedata_end=None):
674 """Open the revlog files for writing
674 """Open the revlog files for writing
675
675
676 Add content to a revlog should be done within such context.
676 Add content to a revlog should be done within such context.
677 """
677 """
678 if self.is_writing:
678 if self.is_writing:
679 yield
679 yield
680 else:
680 else:
681 ifh = dfh = sdfh = None
681 ifh = dfh = sdfh = None
682 try:
682 try:
683 r = len(self.index)
683 r = len(self.index)
684 # opening the data file.
684 # opening the data file.
685 dsize = 0
685 dsize = 0
686 if r:
686 if r:
687 dsize = self.end(r - 1)
687 dsize = self.end(r - 1)
688 dfh = None
688 dfh = None
689 if not self.inline:
689 if not self.inline:
690 try:
690 try:
691 dfh = self.opener(self.data_file, mode=b"r+")
691 dfh = self.opener(self.data_file, mode=b"r+")
692 if data_end is None:
692 if data_end is None:
693 dfh.seek(0, os.SEEK_END)
693 dfh.seek(0, os.SEEK_END)
694 else:
694 else:
695 dfh.seek(data_end, os.SEEK_SET)
695 dfh.seek(data_end, os.SEEK_SET)
696 except FileNotFoundError:
696 except FileNotFoundError:
697 dfh = self.opener(self.data_file, mode=b"w+")
697 dfh = self.opener(self.data_file, mode=b"w+")
698 transaction.add(self.data_file, dsize)
698 transaction.add(self.data_file, dsize)
699 if self.sidedata_file is not None:
699 if self.sidedata_file is not None:
700 assert sidedata_end is not None
700 assert sidedata_end is not None
701 # revlog-v2 does not inline, help Pytype
701 # revlog-v2 does not inline, help Pytype
702 assert dfh is not None
702 assert dfh is not None
703 try:
703 try:
704 sdfh = self.opener(self.sidedata_file, mode=b"r+")
704 sdfh = self.opener(self.sidedata_file, mode=b"r+")
705 dfh.seek(sidedata_end, os.SEEK_SET)
705 dfh.seek(sidedata_end, os.SEEK_SET)
706 except FileNotFoundError:
706 except FileNotFoundError:
707 sdfh = self.opener(self.sidedata_file, mode=b"w+")
707 sdfh = self.opener(self.sidedata_file, mode=b"w+")
708 transaction.add(self.sidedata_file, sidedata_end)
708 transaction.add(self.sidedata_file, sidedata_end)
709
709
710 # opening the index file.
710 # opening the index file.
711 isize = r * self.index.entry_size
711 isize = r * self.index.entry_size
712 ifh = self.__index_write_fp()
712 ifh = self.__index_write_fp()
713 if self.inline:
713 if self.inline:
714 transaction.add(self.index_file, dsize + isize)
714 transaction.add(self.index_file, dsize + isize)
715 else:
715 else:
716 transaction.add(self.index_file, isize)
716 transaction.add(self.index_file, isize)
717 # exposing all file handle for writing.
717 # exposing all file handle for writing.
718 self._writinghandles = (ifh, dfh, sdfh)
718 self._writinghandles = (ifh, dfh, sdfh)
719 self._segmentfile.writing_handle = ifh if self.inline else dfh
719 self._segmentfile.writing_handle = ifh if self.inline else dfh
720 self._segmentfile_sidedata.writing_handle = sdfh
720 self._segmentfile_sidedata.writing_handle = sdfh
721 yield
721 yield
722 finally:
722 finally:
723 self._writinghandles = None
723 self._writinghandles = None
724 self._segmentfile.writing_handle = None
724 self._segmentfile.writing_handle = None
725 self._segmentfile_sidedata.writing_handle = None
725 self._segmentfile_sidedata.writing_handle = None
726 if dfh is not None:
726 if dfh is not None:
727 dfh.close()
727 dfh.close()
728 if sdfh is not None:
728 if sdfh is not None:
729 sdfh.close()
729 sdfh.close()
730 # closing the index file last to avoid exposing referent to
730 # closing the index file last to avoid exposing referent to
731 # potential unflushed data content.
731 # potential unflushed data content.
732 if ifh is not None:
732 if ifh is not None:
733 ifh.close()
733 ifh.close()
734
734
735 def __index_write_fp(self, index_end=None):
735 def __index_write_fp(self, index_end=None):
736 """internal method to open the index file for writing
736 """internal method to open the index file for writing
737
737
738 You should not use this directly and use `_writing` instead
738 You should not use this directly and use `_writing` instead
739 """
739 """
740 try:
740 try:
741 if self._delay_buffer is None:
741 if self._delay_buffer is None:
742 f = self.opener(
742 f = self.opener(
743 self.index_file,
743 self.index_file,
744 mode=b"r+",
744 mode=b"r+",
745 checkambig=self.data_config.check_ambig,
745 checkambig=self.data_config.check_ambig,
746 )
746 )
747 else:
747 else:
748 # check_ambig affect we way we open file for writing, however
748 # check_ambig affect we way we open file for writing, however
749 # here, we do not actually open a file for writting as write
749 # here, we do not actually open a file for writting as write
750 # will appened to a delay_buffer. So check_ambig is not
750 # will appened to a delay_buffer. So check_ambig is not
751 # meaningful and unneeded here.
751 # meaningful and unneeded here.
752 f = randomaccessfile.appender(
752 f = randomaccessfile.appender(
753 self.opener, self.index_file, b"r+", self._delay_buffer
753 self.opener, self.index_file, b"r+", self._delay_buffer
754 )
754 )
755 if index_end is None:
755 if index_end is None:
756 f.seek(0, os.SEEK_END)
756 f.seek(0, os.SEEK_END)
757 else:
757 else:
758 f.seek(index_end, os.SEEK_SET)
758 f.seek(index_end, os.SEEK_SET)
759 return f
759 return f
760 except FileNotFoundError:
760 except FileNotFoundError:
761 if self._delay_buffer is None:
761 if self._delay_buffer is None:
762 return self.opener(
762 return self.opener(
763 self.index_file,
763 self.index_file,
764 mode=b"w+",
764 mode=b"w+",
765 checkambig=self.data_config.check_ambig,
765 checkambig=self.data_config.check_ambig,
766 )
766 )
767 else:
767 else:
768 return randomaccessfile.appender(
768 return randomaccessfile.appender(
769 self.opener, self.index_file, b"w+", self._delay_buffer
769 self.opener, self.index_file, b"w+", self._delay_buffer
770 )
770 )
771
771
772 def __index_new_fp(self):
772 def __index_new_fp(self):
773 """internal method to create a new index file for writing
773 """internal method to create a new index file for writing
774
774
775 You should not use this unless you are upgrading from inline revlog
775 You should not use this unless you are upgrading from inline revlog
776 """
776 """
777 return self.opener(
777 return self.opener(
778 self.index_file,
778 self.index_file,
779 mode=b"w",
779 mode=b"w",
780 checkambig=self.data_config.check_ambig,
780 checkambig=self.data_config.check_ambig,
781 atomictemp=True,
781 atomictemp=True,
782 )
782 )
783
783
784 def split_inline(self, tr, header, new_index_file_path=None):
784 def split_inline(self, tr, header, new_index_file_path=None):
785 """split the data of an inline revlog into an index and a data file"""
785 """split the data of an inline revlog into an index and a data file"""
786 assert self._delay_buffer is None
786 assert self._delay_buffer is None
787 existing_handles = False
787 existing_handles = False
788 if self._writinghandles is not None:
788 if self._writinghandles is not None:
789 existing_handles = True
789 existing_handles = True
790 fp = self._writinghandles[0]
790 fp = self._writinghandles[0]
791 fp.flush()
791 fp.flush()
792 fp.close()
792 fp.close()
793 # We can't use the cached file handle after close(). So prevent
793 # We can't use the cached file handle after close(). So prevent
794 # its usage.
794 # its usage.
795 self._writinghandles = None
795 self._writinghandles = None
796 self._segmentfile.writing_handle = None
796 self._segmentfile.writing_handle = None
797 # No need to deal with sidedata writing handle as it is only
797 # No need to deal with sidedata writing handle as it is only
798 # relevant with revlog-v2 which is never inline, not reaching
798 # relevant with revlog-v2 which is never inline, not reaching
799 # this code
799 # this code
800
800
801 new_dfh = self.opener(self.data_file, mode=b"w+")
801 new_dfh = self.opener(self.data_file, mode=b"w+")
802 new_dfh.truncate(0) # drop any potentially existing data
802 new_dfh.truncate(0) # drop any potentially existing data
803 try:
803 try:
804 with self.reading():
804 with self.reading():
805 for r in range(len(self.index)):
805 for r in range(len(self.index)):
806 new_dfh.write(self.get_segment_for_revs(r, r)[1])
806 new_dfh.write(self.get_segment_for_revs(r, r)[1])
807 new_dfh.flush()
807 new_dfh.flush()
808
808
809 if new_index_file_path is not None:
809 if new_index_file_path is not None:
810 self.index_file = new_index_file_path
810 self.index_file = new_index_file_path
811 with self.__index_new_fp() as fp:
811 with self.__index_new_fp() as fp:
812 self.inline = False
812 self.inline = False
813 for i in range(len(self.index)):
813 for i in range(len(self.index)):
814 e = self.index.entry_binary(i)
814 e = self.index.entry_binary(i)
815 if i == 0:
815 if i == 0:
816 packed_header = self.index.pack_header(header)
816 packed_header = self.index.pack_header(header)
817 e = packed_header + e
817 e = packed_header + e
818 fp.write(e)
818 fp.write(e)
819
819
820 # If we don't use side-write, the temp file replace the real
820 # If we don't use side-write, the temp file replace the real
821 # index when we exit the context manager
821 # index when we exit the context manager
822
822
823 self._segmentfile = randomaccessfile.randomaccessfile(
823 self._segmentfile = randomaccessfile.randomaccessfile(
824 self.opener,
824 self.opener,
825 self.data_file,
825 self.data_file,
826 self.data_config.chunk_cache_size,
826 self.data_config.chunk_cache_size,
827 )
827 )
828
828
829 if existing_handles:
829 if existing_handles:
830 # switched from inline to conventional reopen the index
830 # switched from inline to conventional reopen the index
831 ifh = self.__index_write_fp()
831 ifh = self.__index_write_fp()
832 self._writinghandles = (ifh, new_dfh, None)
832 self._writinghandles = (ifh, new_dfh, None)
833 self._segmentfile.writing_handle = new_dfh
833 self._segmentfile.writing_handle = new_dfh
834 new_dfh = None
834 new_dfh = None
835 # No need to deal with sidedata writing handle as it is only
835 # No need to deal with sidedata writing handle as it is only
836 # relevant with revlog-v2 which is never inline, not reaching
836 # relevant with revlog-v2 which is never inline, not reaching
837 # this code
837 # this code
838 finally:
838 finally:
839 if new_dfh is not None:
839 if new_dfh is not None:
840 new_dfh.close()
840 new_dfh.close()
841 return self.index_file
841 return self.index_file
842
842
843 def get_segment_for_revs(self, startrev, endrev):
843 def get_segment_for_revs(self, startrev, endrev):
844 """Obtain a segment of raw data corresponding to a range of revisions.
844 """Obtain a segment of raw data corresponding to a range of revisions.
845
845
846 Accepts the start and end revisions and an optional already-open
846 Accepts the start and end revisions and an optional already-open
847 file handle to be used for reading. If the file handle is read, its
847 file handle to be used for reading. If the file handle is read, its
848 seek position will not be preserved.
848 seek position will not be preserved.
849
849
850 Requests for data may be satisfied by a cache.
850 Requests for data may be satisfied by a cache.
851
851
852 Returns a 2-tuple of (offset, data) for the requested range of
852 Returns a 2-tuple of (offset, data) for the requested range of
853 revisions. Offset is the integer offset from the beginning of the
853 revisions. Offset is the integer offset from the beginning of the
854 revlog and data is a str or buffer of the raw byte data.
854 revlog and data is a str or buffer of the raw byte data.
855
855
856 Callers will need to call ``self.start(rev)`` and ``self.length(rev)``
856 Callers will need to call ``self.start(rev)`` and ``self.length(rev)``
857 to determine where each revision's data begins and ends.
857 to determine where each revision's data begins and ends.
858
858
859 API: we should consider making this a private part of the InnerRevlog
859 API: we should consider making this a private part of the InnerRevlog
860 at some point.
860 at some point.
861 """
861 """
862 # Inlined self.start(startrev) & self.end(endrev) for perf reasons
862 # Inlined self.start(startrev) & self.end(endrev) for perf reasons
863 # (functions are expensive).
863 # (functions are expensive).
864 index = self.index
864 index = self.index
865 istart = index[startrev]
865 istart = index[startrev]
866 start = int(istart[0] >> 16)
866 start = int(istart[0] >> 16)
867 if startrev == endrev:
867 if startrev == endrev:
868 end = start + istart[1]
868 end = start + istart[1]
869 else:
869 else:
870 iend = index[endrev]
870 iend = index[endrev]
871 end = int(iend[0] >> 16) + iend[1]
871 end = int(iend[0] >> 16) + iend[1]
872
872
873 if self.inline:
873 if self.inline:
874 start += (startrev + 1) * self.index.entry_size
874 start += (startrev + 1) * self.index.entry_size
875 end += (endrev + 1) * self.index.entry_size
875 end += (endrev + 1) * self.index.entry_size
876 length = end - start
876 length = end - start
877
877
878 return start, self._segmentfile.read_chunk(start, length)
878 return start, self._segmentfile.read_chunk(start, length)
879
879
880 def _chunk(self, rev):
880 def _chunk(self, rev):
881 """Obtain a single decompressed chunk for a revision.
881 """Obtain a single decompressed chunk for a revision.
882
882
883 Accepts an integer revision and an optional already-open file handle
883 Accepts an integer revision and an optional already-open file handle
884 to be used for reading. If used, the seek position of the file will not
884 to be used for reading. If used, the seek position of the file will not
885 be preserved.
885 be preserved.
886
886
887 Returns a str holding uncompressed data for the requested revision.
887 Returns a str holding uncompressed data for the requested revision.
888 """
888 """
889 if self._uncompressed_chunk_cache is not None:
889 if self._uncompressed_chunk_cache is not None:
890 uncomp = self._uncompressed_chunk_cache.get(rev)
890 uncomp = self._uncompressed_chunk_cache.get(rev)
891 if uncomp is not None:
891 if uncomp is not None:
892 return uncomp
892 return uncomp
893
893
894 compression_mode = self.index[rev][10]
894 compression_mode = self.index[rev][10]
895 data = self.get_segment_for_revs(rev, rev)[1]
895 data = self.get_segment_for_revs(rev, rev)[1]
896 if compression_mode == COMP_MODE_PLAIN:
896 if compression_mode == COMP_MODE_PLAIN:
897 uncomp = data
897 uncomp = data
898 elif compression_mode == COMP_MODE_DEFAULT:
898 elif compression_mode == COMP_MODE_DEFAULT:
899 uncomp = self._decompressor(data)
899 uncomp = self._decompressor(data)
900 elif compression_mode == COMP_MODE_INLINE:
900 elif compression_mode == COMP_MODE_INLINE:
901 uncomp = self.decompress(data)
901 uncomp = self.decompress(data)
902 else:
902 else:
903 msg = b'unknown compression mode %d'
903 msg = b'unknown compression mode %d'
904 msg %= compression_mode
904 msg %= compression_mode
905 raise error.RevlogError(msg)
905 raise error.RevlogError(msg)
906 if self._uncompressed_chunk_cache is not None:
906 if self._uncompressed_chunk_cache is not None:
907 self._uncompressed_chunk_cache.insert(rev, uncomp, cost=len(uncomp))
907 self._uncompressed_chunk_cache.insert(rev, uncomp, cost=len(uncomp))
908 return uncomp
908 return uncomp
909
909
910 def _chunks(self, revs, targetsize=None):
910 def _chunks(self, revs, targetsize=None):
911 """Obtain decompressed chunks for the specified revisions.
911 """Obtain decompressed chunks for the specified revisions.
912
912
913 Accepts an iterable of numeric revisions that are assumed to be in
913 Accepts an iterable of numeric revisions that are assumed to be in
914 ascending order. Also accepts an optional already-open file handle
914 ascending order. Also accepts an optional already-open file handle
915 to be used for reading. If used, the seek position of the file will
915 to be used for reading. If used, the seek position of the file will
916 not be preserved.
916 not be preserved.
917
917
918 This function is similar to calling ``self._chunk()`` multiple times,
918 This function is similar to calling ``self._chunk()`` multiple times,
919 but is faster.
919 but is faster.
920
920
921 Returns a list with decompressed data for each requested revision.
921 Returns a list with decompressed data for each requested revision.
922 """
922 """
923 if not revs:
923 if not revs:
924 return []
924 return []
925 start = self.start
925 start = self.start
926 length = self.length
926 length = self.length
927 inline = self.inline
927 inline = self.inline
928 iosize = self.index.entry_size
928 iosize = self.index.entry_size
929 buffer = util.buffer
929 buffer = util.buffer
930
930
931 fetched_revs = []
931 fetched_revs = []
932 fadd = fetched_revs.append
932 fadd = fetched_revs.append
933
933
934 chunks = []
934 chunks = []
935 ladd = chunks.append
935 ladd = chunks.append
936
936
937 if self._uncompressed_chunk_cache is None:
937 if self._uncompressed_chunk_cache is None:
938 fetched_revs = revs
938 fetched_revs = revs
939 else:
939 else:
940 for rev in revs:
940 for rev in revs:
941 cached_value = self._uncompressed_chunk_cache.get(rev)
941 cached_value = self._uncompressed_chunk_cache.get(rev)
942 if cached_value is None:
942 if cached_value is None:
943 fadd(rev)
943 fadd(rev)
944 else:
944 else:
945 ladd((rev, cached_value))
945 ladd((rev, cached_value))
946
946
947 if not fetched_revs:
947 if not fetched_revs:
948 slicedchunks = ()
948 slicedchunks = ()
949 elif not self.data_config.with_sparse_read:
949 elif not self.data_config.with_sparse_read:
950 slicedchunks = (fetched_revs,)
950 slicedchunks = (fetched_revs,)
951 else:
951 else:
952 slicedchunks = deltautil.slicechunk(
952 slicedchunks = deltautil.slicechunk(
953 self,
953 self,
954 fetched_revs,
954 fetched_revs,
955 targetsize=targetsize,
955 targetsize=targetsize,
956 )
956 )
957
957
958 for revschunk in slicedchunks:
958 for revschunk in slicedchunks:
959 firstrev = revschunk[0]
959 firstrev = revschunk[0]
960 # Skip trailing revisions with empty diff
960 # Skip trailing revisions with empty diff
961 for lastrev in revschunk[::-1]:
961 for lastrev in revschunk[::-1]:
962 if length(lastrev) != 0:
962 if length(lastrev) != 0:
963 break
963 break
964
964
965 try:
965 try:
966 offset, data = self.get_segment_for_revs(firstrev, lastrev)
966 offset, data = self.get_segment_for_revs(firstrev, lastrev)
967 except OverflowError:
967 except OverflowError:
968 # issue4215 - we can't cache a run of chunks greater than
968 # issue4215 - we can't cache a run of chunks greater than
969 # 2G on Windows
969 # 2G on Windows
970 for rev in revschunk:
970 for rev in revschunk:
971 ladd((rev, self._chunk(rev)))
971 ladd((rev, self._chunk(rev)))
972
972
973 decomp = self.decompress
973 decomp = self.decompress
974 # self._decompressor might be None, but will not be used in that case
974 # self._decompressor might be None, but will not be used in that case
975 def_decomp = self._decompressor
975 def_decomp = self._decompressor
976 for rev in revschunk:
976 for rev in revschunk:
977 chunkstart = start(rev)
977 chunkstart = start(rev)
978 if inline:
978 if inline:
979 chunkstart += (rev + 1) * iosize
979 chunkstart += (rev + 1) * iosize
980 chunklength = length(rev)
980 chunklength = length(rev)
981 comp_mode = self.index[rev][10]
981 comp_mode = self.index[rev][10]
982 c = buffer(data, chunkstart - offset, chunklength)
982 c = buffer(data, chunkstart - offset, chunklength)
983 if comp_mode == COMP_MODE_PLAIN:
983 if comp_mode == COMP_MODE_PLAIN:
984 c = c
984 c = c
985 elif comp_mode == COMP_MODE_INLINE:
985 elif comp_mode == COMP_MODE_INLINE:
986 c = decomp(c)
986 c = decomp(c)
987 elif comp_mode == COMP_MODE_DEFAULT:
987 elif comp_mode == COMP_MODE_DEFAULT:
988 c = def_decomp(c)
988 c = def_decomp(c)
989 else:
989 else:
990 msg = b'unknown compression mode %d'
990 msg = b'unknown compression mode %d'
991 msg %= comp_mode
991 msg %= comp_mode
992 raise error.RevlogError(msg)
992 raise error.RevlogError(msg)
993 ladd((rev, c))
993 ladd((rev, c))
994 if self._uncompressed_chunk_cache is not None:
994 if self._uncompressed_chunk_cache is not None:
995 self._uncompressed_chunk_cache.insert(rev, c, len(c))
995 self._uncompressed_chunk_cache.insert(rev, c, len(c))
996
996
997 chunks.sort()
997 chunks.sort()
998 return [x[1] for x in chunks]
998 return [x[1] for x in chunks]
999
999
1000 def raw_text(self, node, rev):
1000 def raw_text(self, node, rev):
1001 """return the possibly unvalidated rawtext for a revision
1001 """return the possibly unvalidated rawtext for a revision
1002
1002
1003 returns (rev, rawtext, validated)
1003 returns (rev, rawtext, validated)
1004 """
1004 """
1005
1005
1006 # revision in the cache (could be useful to apply delta)
1006 # revision in the cache (could be useful to apply delta)
1007 cachedrev = None
1007 cachedrev = None
1008 # An intermediate text to apply deltas to
1008 # An intermediate text to apply deltas to
1009 basetext = None
1009 basetext = None
1010
1010
1011 # Check if we have the entry in cache
1011 # Check if we have the entry in cache
1012 # The cache entry looks like (node, rev, rawtext)
1012 # The cache entry looks like (node, rev, rawtext)
1013 if self._revisioncache:
1013 if self._revisioncache:
1014 cachedrev = self._revisioncache[1]
1014 cachedrev = self._revisioncache[1]
1015
1015
1016 chain, stopped = self._deltachain(rev, stoprev=cachedrev)
1016 chain, stopped = self._deltachain(rev, stoprev=cachedrev)
1017 if stopped:
1017 if stopped:
1018 basetext = self._revisioncache[2]
1018 basetext = self._revisioncache[2]
1019
1019
1020 # drop cache to save memory, the caller is expected to
1020 # drop cache to save memory, the caller is expected to
1021 # update self._inner._revisioncache after validating the text
1021 # update self._inner._revisioncache after validating the text
1022 self._revisioncache = None
1022 self._revisioncache = None
1023
1023
1024 targetsize = None
1024 targetsize = None
1025 rawsize = self.index[rev][2]
1025 rawsize = self.index[rev][2]
1026 if 0 <= rawsize:
1026 if 0 <= rawsize:
1027 targetsize = 4 * rawsize
1027 targetsize = 4 * rawsize
1028
1028
1029 if self._uncompressed_chunk_cache is not None:
1029 if self._uncompressed_chunk_cache is not None:
1030 # dynamically update the uncompressed_chunk_cache size to the
1030 # dynamically update the uncompressed_chunk_cache size to the
1031 # largest revision we saw in this revlog.
1031 # largest revision we saw in this revlog.
1032 factor = self.data_config.uncompressed_cache_factor
1032 factor = self.data_config.uncompressed_cache_factor
1033 candidate_size = rawsize * factor
1033 candidate_size = rawsize * factor
1034 if candidate_size > self._uncompressed_chunk_cache.maxcost:
1034 if candidate_size > self._uncompressed_chunk_cache.maxcost:
1035 self._uncompressed_chunk_cache.maxcost = candidate_size
1035 self._uncompressed_chunk_cache.maxcost = candidate_size
1036
1036
1037 bins = self._chunks(chain, targetsize=targetsize)
1037 bins = self._chunks(chain, targetsize=targetsize)
1038 if basetext is None:
1038 if basetext is None:
1039 basetext = bytes(bins[0])
1039 basetext = bytes(bins[0])
1040 bins = bins[1:]
1040 bins = bins[1:]
1041
1041
1042 rawtext = mdiff.patches(basetext, bins)
1042 rawtext = mdiff.patches(basetext, bins)
1043 del basetext # let us have a chance to free memory early
1043 del basetext # let us have a chance to free memory early
1044 return (rev, rawtext, False)
1044 return (rev, rawtext, False)
1045
1045
1046 def sidedata(self, rev, sidedata_end):
1046 def sidedata(self, rev, sidedata_end):
1047 """Return the sidedata for a given revision number."""
1047 """Return the sidedata for a given revision number."""
1048 index_entry = self.index[rev]
1048 index_entry = self.index[rev]
1049 sidedata_offset = index_entry[8]
1049 sidedata_offset = index_entry[8]
1050 sidedata_size = index_entry[9]
1050 sidedata_size = index_entry[9]
1051
1051
1052 if self.inline:
1052 if self.inline:
1053 sidedata_offset += self.index.entry_size * (1 + rev)
1053 sidedata_offset += self.index.entry_size * (1 + rev)
1054 if sidedata_size == 0:
1054 if sidedata_size == 0:
1055 return {}
1055 return {}
1056
1056
1057 if sidedata_end < sidedata_offset + sidedata_size:
1057 if sidedata_end < sidedata_offset + sidedata_size:
1058 filename = self.sidedata_file
1058 filename = self.sidedata_file
1059 end = sidedata_end
1059 end = sidedata_end
1060 offset = sidedata_offset
1060 offset = sidedata_offset
1061 length = sidedata_size
1061 length = sidedata_size
1062 m = FILE_TOO_SHORT_MSG % (filename, length, offset, end)
1062 m = FILE_TOO_SHORT_MSG % (filename, length, offset, end)
1063 raise error.RevlogError(m)
1063 raise error.RevlogError(m)
1064
1064
1065 comp_segment = self._segmentfile_sidedata.read_chunk(
1065 comp_segment = self._segmentfile_sidedata.read_chunk(
1066 sidedata_offset, sidedata_size
1066 sidedata_offset, sidedata_size
1067 )
1067 )
1068
1068
1069 comp = self.index[rev][11]
1069 comp = self.index[rev][11]
1070 if comp == COMP_MODE_PLAIN:
1070 if comp == COMP_MODE_PLAIN:
1071 segment = comp_segment
1071 segment = comp_segment
1072 elif comp == COMP_MODE_DEFAULT:
1072 elif comp == COMP_MODE_DEFAULT:
1073 segment = self._decompressor(comp_segment)
1073 segment = self._decompressor(comp_segment)
1074 elif comp == COMP_MODE_INLINE:
1074 elif comp == COMP_MODE_INLINE:
1075 segment = self.decompress(comp_segment)
1075 segment = self.decompress(comp_segment)
1076 else:
1076 else:
1077 msg = b'unknown compression mode %d'
1077 msg = b'unknown compression mode %d'
1078 msg %= comp
1078 msg %= comp
1079 raise error.RevlogError(msg)
1079 raise error.RevlogError(msg)
1080
1080
1081 sidedata = sidedatautil.deserialize_sidedata(segment)
1081 sidedata = sidedatautil.deserialize_sidedata(segment)
1082 return sidedata
1082 return sidedata
1083
1083
1084 def write_entry(
1084 def write_entry(
1085 self,
1085 self,
1086 transaction,
1086 transaction,
1087 entry,
1087 entry,
1088 data,
1088 data,
1089 link,
1089 link,
1090 offset,
1090 offset,
1091 sidedata,
1091 sidedata,
1092 sidedata_offset,
1092 sidedata_offset,
1093 index_end,
1093 index_end,
1094 data_end,
1094 data_end,
1095 sidedata_end,
1095 sidedata_end,
1096 ):
1096 ):
1097 # Files opened in a+ mode have inconsistent behavior on various
1097 # Files opened in a+ mode have inconsistent behavior on various
1098 # platforms. Windows requires that a file positioning call be made
1098 # platforms. Windows requires that a file positioning call be made
1099 # when the file handle transitions between reads and writes. See
1099 # when the file handle transitions between reads and writes. See
1100 # 3686fa2b8eee and the mixedfilemodewrapper in windows.py. On other
1100 # 3686fa2b8eee and the mixedfilemodewrapper in windows.py. On other
1101 # platforms, Python or the platform itself can be buggy. Some versions
1101 # platforms, Python or the platform itself can be buggy. Some versions
1102 # of Solaris have been observed to not append at the end of the file
1102 # of Solaris have been observed to not append at the end of the file
1103 # if the file was seeked to before the end. See issue4943 for more.
1103 # if the file was seeked to before the end. See issue4943 for more.
1104 #
1104 #
1105 # We work around this issue by inserting a seek() before writing.
1105 # We work around this issue by inserting a seek() before writing.
1106 # Note: This is likely not necessary on Python 3. However, because
1106 # Note: This is likely not necessary on Python 3. However, because
1107 # the file handle is reused for reads and may be seeked there, we need
1107 # the file handle is reused for reads and may be seeked there, we need
1108 # to be careful before changing this.
1108 # to be careful before changing this.
1109 if self._writinghandles is None:
1109 if self._writinghandles is None:
1110 msg = b'adding revision outside `revlog._writing` context'
1110 msg = b'adding revision outside `revlog._writing` context'
1111 raise error.ProgrammingError(msg)
1111 raise error.ProgrammingError(msg)
1112 ifh, dfh, sdfh = self._writinghandles
1112 ifh, dfh, sdfh = self._writinghandles
1113 if index_end is None:
1113 if index_end is None:
1114 ifh.seek(0, os.SEEK_END)
1114 ifh.seek(0, os.SEEK_END)
1115 else:
1115 else:
1116 ifh.seek(index_end, os.SEEK_SET)
1116 ifh.seek(index_end, os.SEEK_SET)
1117 if dfh:
1117 if dfh:
1118 if data_end is None:
1118 if data_end is None:
1119 dfh.seek(0, os.SEEK_END)
1119 dfh.seek(0, os.SEEK_END)
1120 else:
1120 else:
1121 dfh.seek(data_end, os.SEEK_SET)
1121 dfh.seek(data_end, os.SEEK_SET)
1122 if sdfh:
1122 if sdfh:
1123 sdfh.seek(sidedata_end, os.SEEK_SET)
1123 sdfh.seek(sidedata_end, os.SEEK_SET)
1124
1124
1125 curr = len(self.index) - 1
1125 curr = len(self.index) - 1
1126 if not self.inline:
1126 if not self.inline:
1127 transaction.add(self.data_file, offset)
1127 transaction.add(self.data_file, offset)
1128 if self.sidedata_file:
1128 if self.sidedata_file:
1129 transaction.add(self.sidedata_file, sidedata_offset)
1129 transaction.add(self.sidedata_file, sidedata_offset)
1130 transaction.add(self.canonical_index_file, curr * len(entry))
1130 transaction.add(self.canonical_index_file, curr * len(entry))
1131 if data[0]:
1131 if data[0]:
1132 dfh.write(data[0])
1132 dfh.write(data[0])
1133 dfh.write(data[1])
1133 dfh.write(data[1])
1134 if sidedata:
1134 if sidedata:
1135 sdfh.write(sidedata)
1135 sdfh.write(sidedata)
1136 if self._delay_buffer is None:
1136 if self._delay_buffer is None:
1137 ifh.write(entry)
1137 ifh.write(entry)
1138 else:
1138 else:
1139 self._delay_buffer.append(entry)
1139 self._delay_buffer.append(entry)
1140 else:
1140 else:
1141 offset += curr * self.index.entry_size
1141 offset += curr * self.index.entry_size
1142 transaction.add(self.canonical_index_file, offset)
1142 transaction.add(self.canonical_index_file, offset)
1143 assert not sidedata
1143 assert not sidedata
1144 if self._delay_buffer is None:
1144 if self._delay_buffer is None:
1145 ifh.write(entry)
1145 ifh.write(entry)
1146 ifh.write(data[0])
1146 ifh.write(data[0])
1147 ifh.write(data[1])
1147 ifh.write(data[1])
1148 else:
1148 else:
1149 self._delay_buffer.append(entry)
1149 self._delay_buffer.append(entry)
1150 self._delay_buffer.append(data[0])
1150 self._delay_buffer.append(data[0])
1151 self._delay_buffer.append(data[1])
1151 self._delay_buffer.append(data[1])
1152 return (
1152 return (
1153 ifh.tell(),
1153 ifh.tell(),
1154 dfh.tell() if dfh else None,
1154 dfh.tell() if dfh else None,
1155 sdfh.tell() if sdfh else None,
1155 sdfh.tell() if sdfh else None,
1156 )
1156 )
1157
1157
1158 def _divert_index(self):
1158 def _divert_index(self):
1159 return self.index_file + b'.a'
1159 return self.index_file + b'.a'
1160
1160
1161 def delay(self):
1161 def delay(self):
1162 assert not self.is_open
1162 assert not self.is_open
1163 if self._delay_buffer is not None or self._orig_index_file is not None:
1163 if self._delay_buffer is not None or self._orig_index_file is not None:
1164 # delay or divert already in place
1164 # delay or divert already in place
1165 return None
1165 return None
1166 elif len(self.index) == 0:
1166 elif len(self.index) == 0:
1167 self._orig_index_file = self.index_file
1167 self._orig_index_file = self.index_file
1168 self.index_file = self._divert_index()
1168 self.index_file = self._divert_index()
1169 assert self._orig_index_file is not None
1169 assert self._orig_index_file is not None
1170 assert self.index_file is not None
1170 assert self.index_file is not None
1171 if self.opener.exists(self.index_file):
1171 if self.opener.exists(self.index_file):
1172 self.opener.unlink(self.index_file)
1172 self.opener.unlink(self.index_file)
1173 return self.index_file
1173 return self.index_file
1174 else:
1174 else:
1175 self._delay_buffer = []
1175 self._delay_buffer = []
1176 if self.inline:
1176 if self.inline:
1177 self._segmentfile._delay_buffer = self._delay_buffer
1177 self._segmentfile._delay_buffer = self._delay_buffer
1178 return None
1178 return None
1179
1179
1180 def write_pending(self):
1180 def write_pending(self):
1181 assert not self.is_open
1181 assert not self.is_open
1182 if self._orig_index_file is not None:
1182 if self._orig_index_file is not None:
1183 return None, True
1183 return None, True
1184 any_pending = False
1184 any_pending = False
1185 pending_index_file = self._divert_index()
1185 pending_index_file = self._divert_index()
1186 if self.opener.exists(pending_index_file):
1186 if self.opener.exists(pending_index_file):
1187 self.opener.unlink(pending_index_file)
1187 self.opener.unlink(pending_index_file)
1188 util.copyfile(
1188 util.copyfile(
1189 self.opener.join(self.index_file),
1189 self.opener.join(self.index_file),
1190 self.opener.join(pending_index_file),
1190 self.opener.join(pending_index_file),
1191 )
1191 )
1192 if self._delay_buffer:
1192 if self._delay_buffer:
1193 with self.opener(pending_index_file, b'r+') as ifh:
1193 with self.opener(pending_index_file, b'r+') as ifh:
1194 ifh.seek(0, os.SEEK_END)
1194 ifh.seek(0, os.SEEK_END)
1195 ifh.write(b"".join(self._delay_buffer))
1195 ifh.write(b"".join(self._delay_buffer))
1196 any_pending = True
1196 any_pending = True
1197 self._delay_buffer = None
1197 self._delay_buffer = None
1198 if self.inline:
1198 if self.inline:
1199 self._segmentfile._delay_buffer = self._delay_buffer
1199 self._segmentfile._delay_buffer = self._delay_buffer
1200 else:
1200 else:
1201 assert self._segmentfile._delay_buffer is None
1201 assert self._segmentfile._delay_buffer is None
1202 self._orig_index_file = self.index_file
1202 self._orig_index_file = self.index_file
1203 self.index_file = pending_index_file
1203 self.index_file = pending_index_file
1204 return self.index_file, any_pending
1204 return self.index_file, any_pending
1205
1205
1206 def finalize_pending(self):
1206 def finalize_pending(self):
1207 assert not self.is_open
1207 assert not self.is_open
1208
1208
1209 delay = self._delay_buffer is not None
1209 delay = self._delay_buffer is not None
1210 divert = self._orig_index_file is not None
1210 divert = self._orig_index_file is not None
1211
1211
1212 if delay and divert:
1212 if delay and divert:
1213 assert False, "unreachable"
1213 assert False, "unreachable"
1214 elif delay:
1214 elif delay:
1215 if self._delay_buffer:
1215 if self._delay_buffer:
1216 with self.opener(self.index_file, b'r+') as ifh:
1216 with self.opener(self.index_file, b'r+') as ifh:
1217 ifh.seek(0, os.SEEK_END)
1217 ifh.seek(0, os.SEEK_END)
1218 ifh.write(b"".join(self._delay_buffer))
1218 ifh.write(b"".join(self._delay_buffer))
1219 self._segmentfile._delay_buffer = self._delay_buffer = None
1219 self._segmentfile._delay_buffer = self._delay_buffer = None
1220 elif divert:
1220 elif divert:
1221 if self.opener.exists(self.index_file):
1221 if self.opener.exists(self.index_file):
1222 self.opener.rename(
1222 self.opener.rename(
1223 self.index_file,
1223 self.index_file,
1224 self._orig_index_file,
1224 self._orig_index_file,
1225 checkambig=True,
1225 checkambig=True,
1226 )
1226 )
1227 self.index_file = self._orig_index_file
1227 self.index_file = self._orig_index_file
1228 self._orig_index_file = None
1228 self._orig_index_file = None
1229 else:
1229 else:
1230 msg = b"not delay or divert found on this revlog"
1230 msg = b"not delay or divert found on this revlog"
1231 raise error.ProgrammingError(msg)
1231 raise error.ProgrammingError(msg)
1232 return self.canonical_index_file
1232 return self.canonical_index_file
1233
1233
1234
1234
1235 class revlog:
1235 class revlog:
1236 """
1236 """
1237 the underlying revision storage object
1237 the underlying revision storage object
1238
1238
1239 A revlog consists of two parts, an index and the revision data.
1239 A revlog consists of two parts, an index and the revision data.
1240
1240
1241 The index is a file with a fixed record size containing
1241 The index is a file with a fixed record size containing
1242 information on each revision, including its nodeid (hash), the
1242 information on each revision, including its nodeid (hash), the
1243 nodeids of its parents, the position and offset of its data within
1243 nodeids of its parents, the position and offset of its data within
1244 the data file, and the revision it's based on. Finally, each entry
1244 the data file, and the revision it's based on. Finally, each entry
1245 contains a linkrev entry that can serve as a pointer to external
1245 contains a linkrev entry that can serve as a pointer to external
1246 data.
1246 data.
1247
1247
1248 The revision data itself is a linear collection of data chunks.
1248 The revision data itself is a linear collection of data chunks.
1249 Each chunk represents a revision and is usually represented as a
1249 Each chunk represents a revision and is usually represented as a
1250 delta against the previous chunk. To bound lookup time, runs of
1250 delta against the previous chunk. To bound lookup time, runs of
1251 deltas are limited to about 2 times the length of the original
1251 deltas are limited to about 2 times the length of the original
1252 version data. This makes retrieval of a version proportional to
1252 version data. This makes retrieval of a version proportional to
1253 its size, or O(1) relative to the number of revisions.
1253 its size, or O(1) relative to the number of revisions.
1254
1254
1255 Both pieces of the revlog are written to in an append-only
1255 Both pieces of the revlog are written to in an append-only
1256 fashion, which means we never need to rewrite a file to insert or
1256 fashion, which means we never need to rewrite a file to insert or
1257 remove data, and can use some simple techniques to avoid the need
1257 remove data, and can use some simple techniques to avoid the need
1258 for locking while reading.
1258 for locking while reading.
1259
1259
1260 If checkambig, indexfile is opened with checkambig=True at
1260 If checkambig, indexfile is opened with checkambig=True at
1261 writing, to avoid file stat ambiguity.
1261 writing, to avoid file stat ambiguity.
1262
1262
1263 If mmaplargeindex is True, and an mmapindexthreshold is set, the
1263 If mmaplargeindex is True, and an mmapindexthreshold is set, the
1264 index will be mmapped rather than read if it is larger than the
1264 index will be mmapped rather than read if it is larger than the
1265 configured threshold.
1265 configured threshold.
1266
1266
1267 If censorable is True, the revlog can have censored revisions.
1267 If censorable is True, the revlog can have censored revisions.
1268
1268
1269 If `upperboundcomp` is not None, this is the expected maximal gain from
1269 If `upperboundcomp` is not None, this is the expected maximal gain from
1270 compression for the data content.
1270 compression for the data content.
1271
1271
1272 `concurrencychecker` is an optional function that receives 3 arguments: a
1272 `concurrencychecker` is an optional function that receives 3 arguments: a
1273 file handle, a filename, and an expected position. It should check whether
1273 file handle, a filename, and an expected position. It should check whether
1274 the current position in the file handle is valid, and log/warn/fail (by
1274 the current position in the file handle is valid, and log/warn/fail (by
1275 raising).
1275 raising).
1276
1276
1277 See mercurial/revlogutils/contants.py for details about the content of an
1277 See mercurial/revlogutils/contants.py for details about the content of an
1278 index entry.
1278 index entry.
1279 """
1279 """
1280
1280
1281 _flagserrorclass = error.RevlogError
1281 _flagserrorclass = error.RevlogError
1282
1282
1283 @staticmethod
1283 @staticmethod
1284 def is_inline_index(header_bytes):
1284 def is_inline_index(header_bytes):
1285 """Determine if a revlog is inline from the initial bytes of the index"""
1285 """Determine if a revlog is inline from the initial bytes of the index"""
1286 if len(header_bytes) == 0:
1286 if len(header_bytes) == 0:
1287 return True
1287 return True
1288
1288
1289 header = INDEX_HEADER.unpack(header_bytes)[0]
1289 header = INDEX_HEADER.unpack(header_bytes)[0]
1290
1290
1291 _format_flags = header & ~0xFFFF
1291 _format_flags = header & ~0xFFFF
1292 _format_version = header & 0xFFFF
1292 _format_version = header & 0xFFFF
1293
1293
1294 features = FEATURES_BY_VERSION[_format_version]
1294 features = FEATURES_BY_VERSION[_format_version]
1295 return features[b'inline'](_format_flags)
1295 return features[b'inline'](_format_flags)
1296
1296
1297 def __init__(
1297 def __init__(
1298 self,
1298 self,
1299 opener,
1299 opener,
1300 target,
1300 target,
1301 radix,
1301 radix,
1302 postfix=None, # only exist for `tmpcensored` now
1302 postfix=None, # only exist for `tmpcensored` now
1303 checkambig=False,
1303 checkambig=False,
1304 mmaplargeindex=False,
1304 mmaplargeindex=False,
1305 censorable=False,
1305 censorable=False,
1306 upperboundcomp=None,
1306 upperboundcomp=None,
1307 persistentnodemap=False,
1307 persistentnodemap=False,
1308 concurrencychecker=None,
1308 concurrencychecker=None,
1309 trypending=False,
1309 trypending=False,
1310 try_split=False,
1310 try_split=False,
1311 canonical_parent_order=True,
1311 canonical_parent_order=True,
1312 data_config=None,
1312 data_config=None,
1313 delta_config=None,
1313 delta_config=None,
1314 feature_config=None,
1314 feature_config=None,
1315 may_inline=True, # may inline new revlog
1315 may_inline=True, # may inline new revlog
1316 ):
1316 ):
1317 """
1317 """
1318 create a revlog object
1318 create a revlog object
1319
1319
1320 opener is a function that abstracts the file opening operation
1320 opener is a function that abstracts the file opening operation
1321 and can be used to implement COW semantics or the like.
1321 and can be used to implement COW semantics or the like.
1322
1322
1323 `target`: a (KIND, ID) tuple that identify the content stored in
1323 `target`: a (KIND, ID) tuple that identify the content stored in
1324 this revlog. It help the rest of the code to understand what the revlog
1324 this revlog. It help the rest of the code to understand what the revlog
1325 is about without having to resort to heuristic and index filename
1325 is about without having to resort to heuristic and index filename
1326 analysis. Note: that this must be reliably be set by normal code, but
1326 analysis. Note: that this must be reliably be set by normal code, but
1327 that test, debug, or performance measurement code might not set this to
1327 that test, debug, or performance measurement code might not set this to
1328 accurate value.
1328 accurate value.
1329 """
1329 """
1330
1330
1331 self.radix = radix
1331 self.radix = radix
1332
1332
1333 self._docket_file = None
1333 self._docket_file = None
1334 self._indexfile = None
1334 self._indexfile = None
1335 self._datafile = None
1335 self._datafile = None
1336 self._sidedatafile = None
1336 self._sidedatafile = None
1337 self._nodemap_file = None
1337 self._nodemap_file = None
1338 self.postfix = postfix
1338 self.postfix = postfix
1339 self._trypending = trypending
1339 self._trypending = trypending
1340 self._try_split = try_split
1340 self._try_split = try_split
1341 self._may_inline = may_inline
1341 self._may_inline = may_inline
1342 self.opener = opener
1342 self.opener = opener
1343 if persistentnodemap:
1343 if persistentnodemap:
1344 self._nodemap_file = nodemaputil.get_nodemap_file(self)
1344 self._nodemap_file = nodemaputil.get_nodemap_file(self)
1345
1345
1346 assert target[0] in ALL_KINDS
1346 assert target[0] in ALL_KINDS
1347 assert len(target) == 2
1347 assert len(target) == 2
1348 self.target = target
1348 self.target = target
1349 if feature_config is not None:
1349 if feature_config is not None:
1350 self.feature_config = feature_config.copy()
1350 self.feature_config = feature_config.copy()
1351 elif b'feature-config' in self.opener.options:
1351 elif b'feature-config' in self.opener.options:
1352 self.feature_config = self.opener.options[b'feature-config'].copy()
1352 self.feature_config = self.opener.options[b'feature-config'].copy()
1353 else:
1353 else:
1354 self.feature_config = FeatureConfig()
1354 self.feature_config = FeatureConfig()
1355 self.feature_config.censorable = censorable
1355 self.feature_config.censorable = censorable
1356 self.feature_config.canonical_parent_order = canonical_parent_order
1356 self.feature_config.canonical_parent_order = canonical_parent_order
1357 if data_config is not None:
1357 if data_config is not None:
1358 self.data_config = data_config.copy()
1358 self.data_config = data_config.copy()
1359 elif b'data-config' in self.opener.options:
1359 elif b'data-config' in self.opener.options:
1360 self.data_config = self.opener.options[b'data-config'].copy()
1360 self.data_config = self.opener.options[b'data-config'].copy()
1361 else:
1361 else:
1362 self.data_config = DataConfig()
1362 self.data_config = DataConfig()
1363 self.data_config.check_ambig = checkambig
1363 self.data_config.check_ambig = checkambig
1364 self.data_config.mmap_large_index = mmaplargeindex
1364 self.data_config.mmap_large_index = mmaplargeindex
1365 if delta_config is not None:
1365 if delta_config is not None:
1366 self.delta_config = delta_config.copy()
1366 self.delta_config = delta_config.copy()
1367 elif b'delta-config' in self.opener.options:
1367 elif b'delta-config' in self.opener.options:
1368 self.delta_config = self.opener.options[b'delta-config'].copy()
1368 self.delta_config = self.opener.options[b'delta-config'].copy()
1369 else:
1369 else:
1370 self.delta_config = DeltaConfig()
1370 self.delta_config = DeltaConfig()
1371 self.delta_config.upper_bound_comp = upperboundcomp
1371 self.delta_config.upper_bound_comp = upperboundcomp
1372
1372
1373 # Maps rev to chain base rev.
1373 # Maps rev to chain base rev.
1374 self._chainbasecache = util.lrucachedict(100)
1374 self._chainbasecache = util.lrucachedict(100)
1375
1375
1376 self.index = None
1376 self.index = None
1377 self._docket = None
1377 self._docket = None
1378 self._nodemap_docket = None
1378 self._nodemap_docket = None
1379 # Mapping of partial identifiers to full nodes.
1379 # Mapping of partial identifiers to full nodes.
1380 self._pcache = {}
1380 self._pcache = {}
1381
1381
1382 # other optionnals features
1382 # other optionnals features
1383
1383
1384 # Make copy of flag processors so each revlog instance can support
1384 # Make copy of flag processors so each revlog instance can support
1385 # custom flags.
1385 # custom flags.
1386 self._flagprocessors = dict(flagutil.flagprocessors)
1386 self._flagprocessors = dict(flagutil.flagprocessors)
1387 # prevent nesting of addgroup
1387 # prevent nesting of addgroup
1388 self._adding_group = None
1388 self._adding_group = None
1389
1389
1390 chunk_cache = self._loadindex()
1390 chunk_cache = self._loadindex()
1391 self._load_inner(chunk_cache)
1391 self._load_inner(chunk_cache)
1392 self._concurrencychecker = concurrencychecker
1392 self._concurrencychecker = concurrencychecker
1393
1393
1394 @property
1395 def _generaldelta(self):
1396 """temporary compatibility proxy"""
1397 util.nouideprecwarn(
1398 b"use revlog.delta_config.general_delta", b"6.6", stacklevel=2
1399 )
1400 return self.delta_config.general_delta
1401
1402 @property
1403 def _checkambig(self):
1404 """temporary compatibility proxy"""
1405 util.nouideprecwarn(
1406 b"use revlog.data_config.checkambig", b"6.6", stacklevel=2
1407 )
1408 return self.data_config.check_ambig
1409
1410 @property
1411 def _mmaplargeindex(self):
1412 """temporary compatibility proxy"""
1413 util.nouideprecwarn(
1414 b"use revlog.data_config.mmap_large_index", b"6.6", stacklevel=2
1415 )
1416 return self.data_config.mmap_large_index
1417
1418 @property
1419 def _censorable(self):
1420 """temporary compatibility proxy"""
1421 util.nouideprecwarn(
1422 b"use revlog.feature_config.censorable", b"6.6", stacklevel=2
1423 )
1424 return self.feature_config.censorable
1425
1426 @property
1427 def _chunkcachesize(self):
1428 """temporary compatibility proxy"""
1429 util.nouideprecwarn(
1430 b"use revlog.data_config.chunk_cache_size", b"6.6", stacklevel=2
1431 )
1432 return self.data_config.chunk_cache_size
1433
1434 @property
1435 def _maxchainlen(self):
1436 """temporary compatibility proxy"""
1437 util.nouideprecwarn(
1438 b"use revlog.delta_config.max_chain_len", b"6.6", stacklevel=2
1439 )
1440 return self.delta_config.max_chain_len
1441
1442 @property
1443 def _deltabothparents(self):
1444 """temporary compatibility proxy"""
1445 util.nouideprecwarn(
1446 b"use revlog.delta_config.delta_both_parents", b"6.6", stacklevel=2
1447 )
1448 return self.delta_config.delta_both_parents
1449
1450 @property
1451 def _candidate_group_chunk_size(self):
1452 """temporary compatibility proxy"""
1453 util.nouideprecwarn(
1454 b"use revlog.delta_config.candidate_group_chunk_size",
1455 b"6.6",
1456 stacklevel=2,
1457 )
1458 return self.delta_config.candidate_group_chunk_size
1459
1460 @property
1461 def _debug_delta(self):
1462 """temporary compatibility proxy"""
1463 util.nouideprecwarn(
1464 b"use revlog.delta_config.debug_delta", b"6.6", stacklevel=2
1465 )
1466 return self.delta_config.debug_delta
1467
1468 @property
1469 def _compengine(self):
1470 """temporary compatibility proxy"""
1471 util.nouideprecwarn(
1472 b"use revlog.feature_config.compression_engine",
1473 b"6.6",
1474 stacklevel=2,
1475 )
1476 return self.feature_config.compression_engine
1477
1478 @property
1479 def upperboundcomp(self):
1480 """temporary compatibility proxy"""
1481 util.nouideprecwarn(
1482 b"use revlog.delta_config.upper_bound_comp",
1483 b"6.6",
1484 stacklevel=2,
1485 )
1486 return self.delta_config.upper_bound_comp
1487
1488 @property
1489 def _compengineopts(self):
1490 """temporary compatibility proxy"""
1491 util.nouideprecwarn(
1492 b"use revlog.feature_config.compression_engine_options",
1493 b"6.6",
1494 stacklevel=2,
1495 )
1496 return self.feature_config.compression_engine_options
1497
1498 @property
1499 def _maxdeltachainspan(self):
1500 """temporary compatibility proxy"""
1501 util.nouideprecwarn(
1502 b"use revlog.delta_config.max_deltachain_span", b"6.6", stacklevel=2
1503 )
1504 return self.delta_config.max_deltachain_span
1505
1506 @property
1507 def _withsparseread(self):
1508 """temporary compatibility proxy"""
1509 util.nouideprecwarn(
1510 b"use revlog.data_config.with_sparse_read", b"6.6", stacklevel=2
1511 )
1512 return self.data_config.with_sparse_read
1513
1514 @property
1515 def _sparserevlog(self):
1516 """temporary compatibility proxy"""
1517 util.nouideprecwarn(
1518 b"use revlog.delta_config.sparse_revlog", b"6.6", stacklevel=2
1519 )
1520 return self.delta_config.sparse_revlog
1521
1522 @property
1523 def hassidedata(self):
1524 """temporary compatibility proxy"""
1525 util.nouideprecwarn(
1526 b"use revlog.feature_config.has_side_data", b"6.6", stacklevel=2
1527 )
1528 return self.feature_config.has_side_data
1529
1530 @property
1531 def _srdensitythreshold(self):
1532 """temporary compatibility proxy"""
1533 util.nouideprecwarn(
1534 b"use revlog.data_config.sr_density_threshold",
1535 b"6.6",
1536 stacklevel=2,
1537 )
1538 return self.data_config.sr_density_threshold
1539
1540 @property
1541 def _srmingapsize(self):
1542 """temporary compatibility proxy"""
1543 util.nouideprecwarn(
1544 b"use revlog.data_config.sr_min_gap_size", b"6.6", stacklevel=2
1545 )
1546 return self.data_config.sr_min_gap_size
1547
1548 @property
1549 def _compute_rank(self):
1550 """temporary compatibility proxy"""
1551 util.nouideprecwarn(
1552 b"use revlog.feature_config.compute_rank", b"6.6", stacklevel=2
1553 )
1554 return self.feature_config.compute_rank
1555
1556 @property
1557 def canonical_parent_order(self):
1558 """temporary compatibility proxy"""
1559 util.nouideprecwarn(
1560 b"use revlog.feature_config.canonical_parent_order",
1561 b"6.6",
1562 stacklevel=2,
1563 )
1564 return self.feature_config.canonical_parent_order
1565
1566 @property
1567 def _lazydelta(self):
1568 """temporary compatibility proxy"""
1569 util.nouideprecwarn(
1570 b"use revlog.delta_config.lazy_delta", b"6.6", stacklevel=2
1571 )
1572 return self.delta_config.lazy_delta
1573
1574 @property
1575 def _lazydeltabase(self):
1576 """temporary compatibility proxy"""
1577 util.nouideprecwarn(
1578 b"use revlog.delta_config.lazy_delta_base", b"6.6", stacklevel=2
1579 )
1580 return self.delta_config.lazy_delta_base
1581
1582 def _init_opts(self):
1394 def _init_opts(self):
1583 """process options (from above/config) to setup associated default revlog mode
1395 """process options (from above/config) to setup associated default revlog mode
1584
1396
1585 These values might be affected when actually reading on disk information.
1397 These values might be affected when actually reading on disk information.
1586
1398
1587 The relevant values are returned for use in _loadindex().
1399 The relevant values are returned for use in _loadindex().
1588
1400
1589 * newversionflags:
1401 * newversionflags:
1590 version header to use if we need to create a new revlog
1402 version header to use if we need to create a new revlog
1591
1403
1592 * mmapindexthreshold:
1404 * mmapindexthreshold:
1593 minimal index size for start to use mmap
1405 minimal index size for start to use mmap
1594
1406
1595 * force_nodemap:
1407 * force_nodemap:
1596 force the usage of a "development" version of the nodemap code
1408 force the usage of a "development" version of the nodemap code
1597 """
1409 """
1598 opts = self.opener.options
1410 opts = self.opener.options
1599
1411
1600 if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG:
1412 if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG:
1601 new_header = CHANGELOGV2
1413 new_header = CHANGELOGV2
1602 compute_rank = opts.get(b'changelogv2.compute-rank', True)
1414 compute_rank = opts.get(b'changelogv2.compute-rank', True)
1603 self.feature_config.compute_rank = compute_rank
1415 self.feature_config.compute_rank = compute_rank
1604 elif b'revlogv2' in opts:
1416 elif b'revlogv2' in opts:
1605 new_header = REVLOGV2
1417 new_header = REVLOGV2
1606 elif b'revlogv1' in opts:
1418 elif b'revlogv1' in opts:
1607 new_header = REVLOGV1
1419 new_header = REVLOGV1
1608 if self._may_inline:
1420 if self._may_inline:
1609 new_header |= FLAG_INLINE_DATA
1421 new_header |= FLAG_INLINE_DATA
1610 if b'generaldelta' in opts:
1422 if b'generaldelta' in opts:
1611 new_header |= FLAG_GENERALDELTA
1423 new_header |= FLAG_GENERALDELTA
1612 elif b'revlogv0' in self.opener.options:
1424 elif b'revlogv0' in self.opener.options:
1613 new_header = REVLOGV0
1425 new_header = REVLOGV0
1614 else:
1426 else:
1615 new_header = REVLOG_DEFAULT_VERSION
1427 new_header = REVLOG_DEFAULT_VERSION
1616
1428
1617 mmapindexthreshold = None
1429 mmapindexthreshold = None
1618 if self.data_config.mmap_large_index:
1430 if self.data_config.mmap_large_index:
1619 mmapindexthreshold = self.data_config.mmap_index_threshold
1431 mmapindexthreshold = self.data_config.mmap_index_threshold
1620 if self.feature_config.enable_ellipsis:
1432 if self.feature_config.enable_ellipsis:
1621 self._flagprocessors[REVIDX_ELLIPSIS] = ellipsisprocessor
1433 self._flagprocessors[REVIDX_ELLIPSIS] = ellipsisprocessor
1622
1434
1623 # revlog v0 doesn't have flag processors
1435 # revlog v0 doesn't have flag processors
1624 for flag, processor in opts.get(b'flagprocessors', {}).items():
1436 for flag, processor in opts.get(b'flagprocessors', {}).items():
1625 flagutil.insertflagprocessor(flag, processor, self._flagprocessors)
1437 flagutil.insertflagprocessor(flag, processor, self._flagprocessors)
1626
1438
1627 chunk_cache_size = self.data_config.chunk_cache_size
1439 chunk_cache_size = self.data_config.chunk_cache_size
1628 if chunk_cache_size <= 0:
1440 if chunk_cache_size <= 0:
1629 raise error.RevlogError(
1441 raise error.RevlogError(
1630 _(b'revlog chunk cache size %r is not greater than 0')
1442 _(b'revlog chunk cache size %r is not greater than 0')
1631 % chunk_cache_size
1443 % chunk_cache_size
1632 )
1444 )
1633 elif chunk_cache_size & (chunk_cache_size - 1):
1445 elif chunk_cache_size & (chunk_cache_size - 1):
1634 raise error.RevlogError(
1446 raise error.RevlogError(
1635 _(b'revlog chunk cache size %r is not a power of 2')
1447 _(b'revlog chunk cache size %r is not a power of 2')
1636 % chunk_cache_size
1448 % chunk_cache_size
1637 )
1449 )
1638 force_nodemap = opts.get(b'devel-force-nodemap', False)
1450 force_nodemap = opts.get(b'devel-force-nodemap', False)
1639 return new_header, mmapindexthreshold, force_nodemap
1451 return new_header, mmapindexthreshold, force_nodemap
1640
1452
1641 def _get_data(self, filepath, mmap_threshold, size=None):
1453 def _get_data(self, filepath, mmap_threshold, size=None):
1642 """return a file content with or without mmap
1454 """return a file content with or without mmap
1643
1455
1644 If the file is missing return the empty string"""
1456 If the file is missing return the empty string"""
1645 try:
1457 try:
1646 with self.opener(filepath) as fp:
1458 with self.opener(filepath) as fp:
1647 if mmap_threshold is not None:
1459 if mmap_threshold is not None:
1648 file_size = self.opener.fstat(fp).st_size
1460 file_size = self.opener.fstat(fp).st_size
1649 if file_size >= mmap_threshold:
1461 if file_size >= mmap_threshold:
1650 if size is not None:
1462 if size is not None:
1651 # avoid potentiel mmap crash
1463 # avoid potentiel mmap crash
1652 size = min(file_size, size)
1464 size = min(file_size, size)
1653 # TODO: should .close() to release resources without
1465 # TODO: should .close() to release resources without
1654 # relying on Python GC
1466 # relying on Python GC
1655 if size is None:
1467 if size is None:
1656 return util.buffer(util.mmapread(fp))
1468 return util.buffer(util.mmapread(fp))
1657 else:
1469 else:
1658 return util.buffer(util.mmapread(fp, size))
1470 return util.buffer(util.mmapread(fp, size))
1659 if size is None:
1471 if size is None:
1660 return fp.read()
1472 return fp.read()
1661 else:
1473 else:
1662 return fp.read(size)
1474 return fp.read(size)
1663 except FileNotFoundError:
1475 except FileNotFoundError:
1664 return b''
1476 return b''
1665
1477
1666 def get_streams(self, max_linkrev, force_inline=False):
1478 def get_streams(self, max_linkrev, force_inline=False):
1667 """return a list of streams that represent this revlog
1479 """return a list of streams that represent this revlog
1668
1480
1669 This is used by stream-clone to do bytes to bytes copies of a repository.
1481 This is used by stream-clone to do bytes to bytes copies of a repository.
1670
1482
1671 This streams data for all revisions that refer to a changelog revision up
1483 This streams data for all revisions that refer to a changelog revision up
1672 to `max_linkrev`.
1484 to `max_linkrev`.
1673
1485
1674 If `force_inline` is set, it enforces that the stream will represent an inline revlog.
1486 If `force_inline` is set, it enforces that the stream will represent an inline revlog.
1675
1487
1676 It returns is a list of three-tuple:
1488 It returns is a list of three-tuple:
1677
1489
1678 [
1490 [
1679 (filename, bytes_stream, stream_size),
1491 (filename, bytes_stream, stream_size),
1680 …
1492 …
1681 ]
1493 ]
1682 """
1494 """
1683 n = len(self)
1495 n = len(self)
1684 index = self.index
1496 index = self.index
1685 while n > 0:
1497 while n > 0:
1686 linkrev = index[n - 1][4]
1498 linkrev = index[n - 1][4]
1687 if linkrev < max_linkrev:
1499 if linkrev < max_linkrev:
1688 break
1500 break
1689 # note: this loop will rarely go through multiple iterations, since
1501 # note: this loop will rarely go through multiple iterations, since
1690 # it only traverses commits created during the current streaming
1502 # it only traverses commits created during the current streaming
1691 # pull operation.
1503 # pull operation.
1692 #
1504 #
1693 # If this become a problem, using a binary search should cap the
1505 # If this become a problem, using a binary search should cap the
1694 # runtime of this.
1506 # runtime of this.
1695 n = n - 1
1507 n = n - 1
1696 if n == 0:
1508 if n == 0:
1697 # no data to send
1509 # no data to send
1698 return []
1510 return []
1699 index_size = n * index.entry_size
1511 index_size = n * index.entry_size
1700 data_size = self.end(n - 1)
1512 data_size = self.end(n - 1)
1701
1513
1702 # XXX we might have been split (or stripped) since the object
1514 # XXX we might have been split (or stripped) since the object
1703 # initialization, We need to close this race too, but having a way to
1515 # initialization, We need to close this race too, but having a way to
1704 # pre-open the file we feed to the revlog and never closing them before
1516 # pre-open the file we feed to the revlog and never closing them before
1705 # we are done streaming.
1517 # we are done streaming.
1706
1518
1707 if self._inline:
1519 if self._inline:
1708
1520
1709 def get_stream():
1521 def get_stream():
1710 with self.opener(self._indexfile, mode=b"r") as fp:
1522 with self.opener(self._indexfile, mode=b"r") as fp:
1711 yield None
1523 yield None
1712 size = index_size + data_size
1524 size = index_size + data_size
1713 if size <= 65536:
1525 if size <= 65536:
1714 yield fp.read(size)
1526 yield fp.read(size)
1715 else:
1527 else:
1716 yield from util.filechunkiter(fp, limit=size)
1528 yield from util.filechunkiter(fp, limit=size)
1717
1529
1718 inline_stream = get_stream()
1530 inline_stream = get_stream()
1719 next(inline_stream)
1531 next(inline_stream)
1720 return [
1532 return [
1721 (self._indexfile, inline_stream, index_size + data_size),
1533 (self._indexfile, inline_stream, index_size + data_size),
1722 ]
1534 ]
1723 elif force_inline:
1535 elif force_inline:
1724
1536
1725 def get_stream():
1537 def get_stream():
1726 with self.reading():
1538 with self.reading():
1727 yield None
1539 yield None
1728
1540
1729 for rev in range(n):
1541 for rev in range(n):
1730 idx = self.index.entry_binary(rev)
1542 idx = self.index.entry_binary(rev)
1731 if rev == 0 and self._docket is None:
1543 if rev == 0 and self._docket is None:
1732 # re-inject the inline flag
1544 # re-inject the inline flag
1733 header = self._format_flags
1545 header = self._format_flags
1734 header |= self._format_version
1546 header |= self._format_version
1735 header |= FLAG_INLINE_DATA
1547 header |= FLAG_INLINE_DATA
1736 header = self.index.pack_header(header)
1548 header = self.index.pack_header(header)
1737 idx = header + idx
1549 idx = header + idx
1738 yield idx
1550 yield idx
1739 yield self._inner.get_segment_for_revs(rev, rev)[1]
1551 yield self._inner.get_segment_for_revs(rev, rev)[1]
1740
1552
1741 inline_stream = get_stream()
1553 inline_stream = get_stream()
1742 next(inline_stream)
1554 next(inline_stream)
1743 return [
1555 return [
1744 (self._indexfile, inline_stream, index_size + data_size),
1556 (self._indexfile, inline_stream, index_size + data_size),
1745 ]
1557 ]
1746 else:
1558 else:
1747
1559
1748 def get_index_stream():
1560 def get_index_stream():
1749 with self.opener(self._indexfile, mode=b"r") as fp:
1561 with self.opener(self._indexfile, mode=b"r") as fp:
1750 yield None
1562 yield None
1751 if index_size <= 65536:
1563 if index_size <= 65536:
1752 yield fp.read(index_size)
1564 yield fp.read(index_size)
1753 else:
1565 else:
1754 yield from util.filechunkiter(fp, limit=index_size)
1566 yield from util.filechunkiter(fp, limit=index_size)
1755
1567
1756 def get_data_stream():
1568 def get_data_stream():
1757 with self._datafp() as fp:
1569 with self._datafp() as fp:
1758 yield None
1570 yield None
1759 if data_size <= 65536:
1571 if data_size <= 65536:
1760 yield fp.read(data_size)
1572 yield fp.read(data_size)
1761 else:
1573 else:
1762 yield from util.filechunkiter(fp, limit=data_size)
1574 yield from util.filechunkiter(fp, limit=data_size)
1763
1575
1764 index_stream = get_index_stream()
1576 index_stream = get_index_stream()
1765 next(index_stream)
1577 next(index_stream)
1766 data_stream = get_data_stream()
1578 data_stream = get_data_stream()
1767 next(data_stream)
1579 next(data_stream)
1768 return [
1580 return [
1769 (self._datafile, data_stream, data_size),
1581 (self._datafile, data_stream, data_size),
1770 (self._indexfile, index_stream, index_size),
1582 (self._indexfile, index_stream, index_size),
1771 ]
1583 ]
1772
1584
1773 def _loadindex(self, docket=None):
1585 def _loadindex(self, docket=None):
1774
1586
1775 new_header, mmapindexthreshold, force_nodemap = self._init_opts()
1587 new_header, mmapindexthreshold, force_nodemap = self._init_opts()
1776
1588
1777 if self.postfix is not None:
1589 if self.postfix is not None:
1778 entry_point = b'%s.i.%s' % (self.radix, self.postfix)
1590 entry_point = b'%s.i.%s' % (self.radix, self.postfix)
1779 elif self._trypending and self.opener.exists(b'%s.i.a' % self.radix):
1591 elif self._trypending and self.opener.exists(b'%s.i.a' % self.radix):
1780 entry_point = b'%s.i.a' % self.radix
1592 entry_point = b'%s.i.a' % self.radix
1781 elif self._try_split and self.opener.exists(self._split_index_file):
1593 elif self._try_split and self.opener.exists(self._split_index_file):
1782 entry_point = self._split_index_file
1594 entry_point = self._split_index_file
1783 else:
1595 else:
1784 entry_point = b'%s.i' % self.radix
1596 entry_point = b'%s.i' % self.radix
1785
1597
1786 if docket is not None:
1598 if docket is not None:
1787 self._docket = docket
1599 self._docket = docket
1788 self._docket_file = entry_point
1600 self._docket_file = entry_point
1789 else:
1601 else:
1790 self._initempty = True
1602 self._initempty = True
1791 entry_data = self._get_data(entry_point, mmapindexthreshold)
1603 entry_data = self._get_data(entry_point, mmapindexthreshold)
1792 if len(entry_data) > 0:
1604 if len(entry_data) > 0:
1793 header = INDEX_HEADER.unpack(entry_data[:4])[0]
1605 header = INDEX_HEADER.unpack(entry_data[:4])[0]
1794 self._initempty = False
1606 self._initempty = False
1795 else:
1607 else:
1796 header = new_header
1608 header = new_header
1797
1609
1798 self._format_flags = header & ~0xFFFF
1610 self._format_flags = header & ~0xFFFF
1799 self._format_version = header & 0xFFFF
1611 self._format_version = header & 0xFFFF
1800
1612
1801 supported_flags = SUPPORTED_FLAGS.get(self._format_version)
1613 supported_flags = SUPPORTED_FLAGS.get(self._format_version)
1802 if supported_flags is None:
1614 if supported_flags is None:
1803 msg = _(b'unknown version (%d) in revlog %s')
1615 msg = _(b'unknown version (%d) in revlog %s')
1804 msg %= (self._format_version, self.display_id)
1616 msg %= (self._format_version, self.display_id)
1805 raise error.RevlogError(msg)
1617 raise error.RevlogError(msg)
1806 elif self._format_flags & ~supported_flags:
1618 elif self._format_flags & ~supported_flags:
1807 msg = _(b'unknown flags (%#04x) in version %d revlog %s')
1619 msg = _(b'unknown flags (%#04x) in version %d revlog %s')
1808 display_flag = self._format_flags >> 16
1620 display_flag = self._format_flags >> 16
1809 msg %= (display_flag, self._format_version, self.display_id)
1621 msg %= (display_flag, self._format_version, self.display_id)
1810 raise error.RevlogError(msg)
1622 raise error.RevlogError(msg)
1811
1623
1812 features = FEATURES_BY_VERSION[self._format_version]
1624 features = FEATURES_BY_VERSION[self._format_version]
1813 self._inline = features[b'inline'](self._format_flags)
1625 self._inline = features[b'inline'](self._format_flags)
1814 self.delta_config.general_delta = features[b'generaldelta'](
1626 self.delta_config.general_delta = features[b'generaldelta'](
1815 self._format_flags
1627 self._format_flags
1816 )
1628 )
1817 self.feature_config.has_side_data = features[b'sidedata']
1629 self.feature_config.has_side_data = features[b'sidedata']
1818
1630
1819 if not features[b'docket']:
1631 if not features[b'docket']:
1820 self._indexfile = entry_point
1632 self._indexfile = entry_point
1821 index_data = entry_data
1633 index_data = entry_data
1822 else:
1634 else:
1823 self._docket_file = entry_point
1635 self._docket_file = entry_point
1824 if self._initempty:
1636 if self._initempty:
1825 self._docket = docketutil.default_docket(self, header)
1637 self._docket = docketutil.default_docket(self, header)
1826 else:
1638 else:
1827 self._docket = docketutil.parse_docket(
1639 self._docket = docketutil.parse_docket(
1828 self, entry_data, use_pending=self._trypending
1640 self, entry_data, use_pending=self._trypending
1829 )
1641 )
1830
1642
1831 if self._docket is not None:
1643 if self._docket is not None:
1832 self._indexfile = self._docket.index_filepath()
1644 self._indexfile = self._docket.index_filepath()
1833 index_data = b''
1645 index_data = b''
1834 index_size = self._docket.index_end
1646 index_size = self._docket.index_end
1835 if index_size > 0:
1647 if index_size > 0:
1836 index_data = self._get_data(
1648 index_data = self._get_data(
1837 self._indexfile, mmapindexthreshold, size=index_size
1649 self._indexfile, mmapindexthreshold, size=index_size
1838 )
1650 )
1839 if len(index_data) < index_size:
1651 if len(index_data) < index_size:
1840 msg = _(b'too few index data for %s: got %d, expected %d')
1652 msg = _(b'too few index data for %s: got %d, expected %d')
1841 msg %= (self.display_id, len(index_data), index_size)
1653 msg %= (self.display_id, len(index_data), index_size)
1842 raise error.RevlogError(msg)
1654 raise error.RevlogError(msg)
1843
1655
1844 self._inline = False
1656 self._inline = False
1845 # generaldelta implied by version 2 revlogs.
1657 # generaldelta implied by version 2 revlogs.
1846 self.delta_config.general_delta = True
1658 self.delta_config.general_delta = True
1847 # the logic for persistent nodemap will be dealt with within the
1659 # the logic for persistent nodemap will be dealt with within the
1848 # main docket, so disable it for now.
1660 # main docket, so disable it for now.
1849 self._nodemap_file = None
1661 self._nodemap_file = None
1850
1662
1851 if self._docket is not None:
1663 if self._docket is not None:
1852 self._datafile = self._docket.data_filepath()
1664 self._datafile = self._docket.data_filepath()
1853 self._sidedatafile = self._docket.sidedata_filepath()
1665 self._sidedatafile = self._docket.sidedata_filepath()
1854 elif self.postfix is None:
1666 elif self.postfix is None:
1855 self._datafile = b'%s.d' % self.radix
1667 self._datafile = b'%s.d' % self.radix
1856 else:
1668 else:
1857 self._datafile = b'%s.d.%s' % (self.radix, self.postfix)
1669 self._datafile = b'%s.d.%s' % (self.radix, self.postfix)
1858
1670
1859 self.nodeconstants = sha1nodeconstants
1671 self.nodeconstants = sha1nodeconstants
1860 self.nullid = self.nodeconstants.nullid
1672 self.nullid = self.nodeconstants.nullid
1861
1673
1862 # sparse-revlog can't be on without general-delta (issue6056)
1674 # sparse-revlog can't be on without general-delta (issue6056)
1863 if not self.delta_config.general_delta:
1675 if not self.delta_config.general_delta:
1864 self.delta_config.sparse_revlog = False
1676 self.delta_config.sparse_revlog = False
1865
1677
1866 self._storedeltachains = True
1678 self._storedeltachains = True
1867
1679
1868 devel_nodemap = (
1680 devel_nodemap = (
1869 self._nodemap_file
1681 self._nodemap_file
1870 and force_nodemap
1682 and force_nodemap
1871 and parse_index_v1_nodemap is not None
1683 and parse_index_v1_nodemap is not None
1872 )
1684 )
1873
1685
1874 use_rust_index = False
1686 use_rust_index = False
1875 if rustrevlog is not None:
1687 if rustrevlog is not None:
1876 if self._nodemap_file is not None:
1688 if self._nodemap_file is not None:
1877 use_rust_index = True
1689 use_rust_index = True
1878 else:
1690 else:
1879 use_rust_index = self.opener.options.get(b'rust.index')
1691 use_rust_index = self.opener.options.get(b'rust.index')
1880
1692
1881 self._parse_index = parse_index_v1
1693 self._parse_index = parse_index_v1
1882 if self._format_version == REVLOGV0:
1694 if self._format_version == REVLOGV0:
1883 self._parse_index = revlogv0.parse_index_v0
1695 self._parse_index = revlogv0.parse_index_v0
1884 elif self._format_version == REVLOGV2:
1696 elif self._format_version == REVLOGV2:
1885 self._parse_index = parse_index_v2
1697 self._parse_index = parse_index_v2
1886 elif self._format_version == CHANGELOGV2:
1698 elif self._format_version == CHANGELOGV2:
1887 self._parse_index = parse_index_cl_v2
1699 self._parse_index = parse_index_cl_v2
1888 elif devel_nodemap:
1700 elif devel_nodemap:
1889 self._parse_index = parse_index_v1_nodemap
1701 self._parse_index = parse_index_v1_nodemap
1890 elif use_rust_index:
1702 elif use_rust_index:
1891 self._parse_index = parse_index_v1_mixed
1703 self._parse_index = parse_index_v1_mixed
1892 try:
1704 try:
1893 d = self._parse_index(index_data, self._inline)
1705 d = self._parse_index(index_data, self._inline)
1894 index, chunkcache = d
1706 index, chunkcache = d
1895 use_nodemap = (
1707 use_nodemap = (
1896 not self._inline
1708 not self._inline
1897 and self._nodemap_file is not None
1709 and self._nodemap_file is not None
1898 and hasattr(index, 'update_nodemap_data')
1710 and hasattr(index, 'update_nodemap_data')
1899 )
1711 )
1900 if use_nodemap:
1712 if use_nodemap:
1901 nodemap_data = nodemaputil.persisted_data(self)
1713 nodemap_data = nodemaputil.persisted_data(self)
1902 if nodemap_data is not None:
1714 if nodemap_data is not None:
1903 docket = nodemap_data[0]
1715 docket = nodemap_data[0]
1904 if (
1716 if (
1905 len(d[0]) > docket.tip_rev
1717 len(d[0]) > docket.tip_rev
1906 and d[0][docket.tip_rev][7] == docket.tip_node
1718 and d[0][docket.tip_rev][7] == docket.tip_node
1907 ):
1719 ):
1908 # no changelog tampering
1720 # no changelog tampering
1909 self._nodemap_docket = docket
1721 self._nodemap_docket = docket
1910 index.update_nodemap_data(*nodemap_data)
1722 index.update_nodemap_data(*nodemap_data)
1911 except (ValueError, IndexError):
1723 except (ValueError, IndexError):
1912 raise error.RevlogError(
1724 raise error.RevlogError(
1913 _(b"index %s is corrupted") % self.display_id
1725 _(b"index %s is corrupted") % self.display_id
1914 )
1726 )
1915 self.index = index
1727 self.index = index
1916 # revnum -> (chain-length, sum-delta-length)
1728 # revnum -> (chain-length, sum-delta-length)
1917 self._chaininfocache = util.lrucachedict(500)
1729 self._chaininfocache = util.lrucachedict(500)
1918
1730
1919 return chunkcache
1731 return chunkcache
1920
1732
1921 def _load_inner(self, chunk_cache):
1733 def _load_inner(self, chunk_cache):
1922 if self._docket is None:
1734 if self._docket is None:
1923 default_compression_header = None
1735 default_compression_header = None
1924 else:
1736 else:
1925 default_compression_header = self._docket.default_compression_header
1737 default_compression_header = self._docket.default_compression_header
1926
1738
1927 self._inner = _InnerRevlog(
1739 self._inner = _InnerRevlog(
1928 opener=self.opener,
1740 opener=self.opener,
1929 index=self.index,
1741 index=self.index,
1930 index_file=self._indexfile,
1742 index_file=self._indexfile,
1931 data_file=self._datafile,
1743 data_file=self._datafile,
1932 sidedata_file=self._sidedatafile,
1744 sidedata_file=self._sidedatafile,
1933 inline=self._inline,
1745 inline=self._inline,
1934 data_config=self.data_config,
1746 data_config=self.data_config,
1935 delta_config=self.delta_config,
1747 delta_config=self.delta_config,
1936 feature_config=self.feature_config,
1748 feature_config=self.feature_config,
1937 chunk_cache=chunk_cache,
1749 chunk_cache=chunk_cache,
1938 default_compression_header=default_compression_header,
1750 default_compression_header=default_compression_header,
1939 )
1751 )
1940
1752
1941 def get_revlog(self):
1753 def get_revlog(self):
1942 """simple function to mirror API of other not-really-revlog API"""
1754 """simple function to mirror API of other not-really-revlog API"""
1943 return self
1755 return self
1944
1756
1945 @util.propertycache
1757 @util.propertycache
1946 def revlog_kind(self):
1758 def revlog_kind(self):
1947 return self.target[0]
1759 return self.target[0]
1948
1760
1949 @util.propertycache
1761 @util.propertycache
1950 def display_id(self):
1762 def display_id(self):
1951 """The public facing "ID" of the revlog that we use in message"""
1763 """The public facing "ID" of the revlog that we use in message"""
1952 if self.revlog_kind == KIND_FILELOG:
1764 if self.revlog_kind == KIND_FILELOG:
1953 # Reference the file without the "data/" prefix, so it is familiar
1765 # Reference the file without the "data/" prefix, so it is familiar
1954 # to the user.
1766 # to the user.
1955 return self.target[1]
1767 return self.target[1]
1956 else:
1768 else:
1957 return self.radix
1769 return self.radix
1958
1770
1959 def _datafp(self, mode=b'r'):
1771 def _datafp(self, mode=b'r'):
1960 """file object for the revlog's data file"""
1772 """file object for the revlog's data file"""
1961 return self.opener(self._datafile, mode=mode)
1773 return self.opener(self._datafile, mode=mode)
1962
1774
1963 def tiprev(self):
1775 def tiprev(self):
1964 return len(self.index) - 1
1776 return len(self.index) - 1
1965
1777
1966 def tip(self):
1778 def tip(self):
1967 return self.node(self.tiprev())
1779 return self.node(self.tiprev())
1968
1780
1969 def __contains__(self, rev):
1781 def __contains__(self, rev):
1970 return 0 <= rev < len(self)
1782 return 0 <= rev < len(self)
1971
1783
1972 def __len__(self):
1784 def __len__(self):
1973 return len(self.index)
1785 return len(self.index)
1974
1786
1975 def __iter__(self):
1787 def __iter__(self):
1976 return iter(range(len(self)))
1788 return iter(range(len(self)))
1977
1789
1978 def revs(self, start=0, stop=None):
1790 def revs(self, start=0, stop=None):
1979 """iterate over all rev in this revlog (from start to stop)"""
1791 """iterate over all rev in this revlog (from start to stop)"""
1980 return storageutil.iterrevs(len(self), start=start, stop=stop)
1792 return storageutil.iterrevs(len(self), start=start, stop=stop)
1981
1793
1982 def hasnode(self, node):
1794 def hasnode(self, node):
1983 try:
1795 try:
1984 self.rev(node)
1796 self.rev(node)
1985 return True
1797 return True
1986 except KeyError:
1798 except KeyError:
1987 return False
1799 return False
1988
1800
1989 def _candelta(self, baserev, rev):
1801 def _candelta(self, baserev, rev):
1990 """whether two revisions (baserev, rev) can be delta-ed or not"""
1802 """whether two revisions (baserev, rev) can be delta-ed or not"""
1991 # Disable delta if either rev requires a content-changing flag
1803 # Disable delta if either rev requires a content-changing flag
1992 # processor (ex. LFS). This is because such flag processor can alter
1804 # processor (ex. LFS). This is because such flag processor can alter
1993 # the rawtext content that the delta will be based on, and two clients
1805 # the rawtext content that the delta will be based on, and two clients
1994 # could have a same revlog node with different flags (i.e. different
1806 # could have a same revlog node with different flags (i.e. different
1995 # rawtext contents) and the delta could be incompatible.
1807 # rawtext contents) and the delta could be incompatible.
1996 if (self.flags(baserev) & REVIDX_RAWTEXT_CHANGING_FLAGS) or (
1808 if (self.flags(baserev) & REVIDX_RAWTEXT_CHANGING_FLAGS) or (
1997 self.flags(rev) & REVIDX_RAWTEXT_CHANGING_FLAGS
1809 self.flags(rev) & REVIDX_RAWTEXT_CHANGING_FLAGS
1998 ):
1810 ):
1999 return False
1811 return False
2000 return True
1812 return True
2001
1813
2002 def update_caches(self, transaction):
1814 def update_caches(self, transaction):
2003 """update on disk cache
1815 """update on disk cache
2004
1816
2005 If a transaction is passed, the update may be delayed to transaction
1817 If a transaction is passed, the update may be delayed to transaction
2006 commit."""
1818 commit."""
2007 if self._nodemap_file is not None:
1819 if self._nodemap_file is not None:
2008 if transaction is None:
1820 if transaction is None:
2009 nodemaputil.update_persistent_nodemap(self)
1821 nodemaputil.update_persistent_nodemap(self)
2010 else:
1822 else:
2011 nodemaputil.setup_persistent_nodemap(transaction, self)
1823 nodemaputil.setup_persistent_nodemap(transaction, self)
2012
1824
2013 def clearcaches(self):
1825 def clearcaches(self):
2014 """Clear in-memory caches"""
1826 """Clear in-memory caches"""
2015 self._chainbasecache.clear()
1827 self._chainbasecache.clear()
2016 self._inner.clear_cache()
1828 self._inner.clear_cache()
2017 self._pcache = {}
1829 self._pcache = {}
2018 self._nodemap_docket = None
1830 self._nodemap_docket = None
2019 self.index.clearcaches()
1831 self.index.clearcaches()
2020 # The python code is the one responsible for validating the docket, we
1832 # The python code is the one responsible for validating the docket, we
2021 # end up having to refresh it here.
1833 # end up having to refresh it here.
2022 use_nodemap = (
1834 use_nodemap = (
2023 not self._inline
1835 not self._inline
2024 and self._nodemap_file is not None
1836 and self._nodemap_file is not None
2025 and hasattr(self.index, 'update_nodemap_data')
1837 and hasattr(self.index, 'update_nodemap_data')
2026 )
1838 )
2027 if use_nodemap:
1839 if use_nodemap:
2028 nodemap_data = nodemaputil.persisted_data(self)
1840 nodemap_data = nodemaputil.persisted_data(self)
2029 if nodemap_data is not None:
1841 if nodemap_data is not None:
2030 self._nodemap_docket = nodemap_data[0]
1842 self._nodemap_docket = nodemap_data[0]
2031 self.index.update_nodemap_data(*nodemap_data)
1843 self.index.update_nodemap_data(*nodemap_data)
2032
1844
2033 def rev(self, node):
1845 def rev(self, node):
2034 """return the revision number associated with a <nodeid>"""
1846 """return the revision number associated with a <nodeid>"""
2035 try:
1847 try:
2036 return self.index.rev(node)
1848 return self.index.rev(node)
2037 except TypeError:
1849 except TypeError:
2038 raise
1850 raise
2039 except error.RevlogError:
1851 except error.RevlogError:
2040 # parsers.c radix tree lookup failed
1852 # parsers.c radix tree lookup failed
2041 if (
1853 if (
2042 node == self.nodeconstants.wdirid
1854 node == self.nodeconstants.wdirid
2043 or node in self.nodeconstants.wdirfilenodeids
1855 or node in self.nodeconstants.wdirfilenodeids
2044 ):
1856 ):
2045 raise error.WdirUnsupported
1857 raise error.WdirUnsupported
2046 raise error.LookupError(node, self.display_id, _(b'no node'))
1858 raise error.LookupError(node, self.display_id, _(b'no node'))
2047
1859
2048 # Accessors for index entries.
1860 # Accessors for index entries.
2049
1861
2050 # First tuple entry is 8 bytes. First 6 bytes are offset. Last 2 bytes
1862 # First tuple entry is 8 bytes. First 6 bytes are offset. Last 2 bytes
2051 # are flags.
1863 # are flags.
2052 def start(self, rev):
1864 def start(self, rev):
2053 return int(self.index[rev][0] >> 16)
1865 return int(self.index[rev][0] >> 16)
2054
1866
2055 def sidedata_cut_off(self, rev):
1867 def sidedata_cut_off(self, rev):
2056 sd_cut_off = self.index[rev][8]
1868 sd_cut_off = self.index[rev][8]
2057 if sd_cut_off != 0:
1869 if sd_cut_off != 0:
2058 return sd_cut_off
1870 return sd_cut_off
2059 # This is some annoying dance, because entries without sidedata
1871 # This is some annoying dance, because entries without sidedata
2060 # currently use 0 as their ofsset. (instead of previous-offset +
1872 # currently use 0 as their ofsset. (instead of previous-offset +
2061 # previous-size)
1873 # previous-size)
2062 #
1874 #
2063 # We should reconsider this sidedata → 0 sidata_offset policy.
1875 # We should reconsider this sidedata → 0 sidata_offset policy.
2064 # In the meantime, we need this.
1876 # In the meantime, we need this.
2065 while 0 <= rev:
1877 while 0 <= rev:
2066 e = self.index[rev]
1878 e = self.index[rev]
2067 if e[9] != 0:
1879 if e[9] != 0:
2068 return e[8] + e[9]
1880 return e[8] + e[9]
2069 rev -= 1
1881 rev -= 1
2070 return 0
1882 return 0
2071
1883
2072 def flags(self, rev):
1884 def flags(self, rev):
2073 return self.index[rev][0] & 0xFFFF
1885 return self.index[rev][0] & 0xFFFF
2074
1886
2075 def length(self, rev):
1887 def length(self, rev):
2076 return self.index[rev][1]
1888 return self.index[rev][1]
2077
1889
2078 def sidedata_length(self, rev):
1890 def sidedata_length(self, rev):
2079 if not self.feature_config.has_side_data:
1891 if not self.feature_config.has_side_data:
2080 return 0
1892 return 0
2081 return self.index[rev][9]
1893 return self.index[rev][9]
2082
1894
2083 def rawsize(self, rev):
1895 def rawsize(self, rev):
2084 """return the length of the uncompressed text for a given revision"""
1896 """return the length of the uncompressed text for a given revision"""
2085 l = self.index[rev][2]
1897 l = self.index[rev][2]
2086 if l >= 0:
1898 if l >= 0:
2087 return l
1899 return l
2088
1900
2089 t = self.rawdata(rev)
1901 t = self.rawdata(rev)
2090 return len(t)
1902 return len(t)
2091
1903
2092 def size(self, rev):
1904 def size(self, rev):
2093 """length of non-raw text (processed by a "read" flag processor)"""
1905 """length of non-raw text (processed by a "read" flag processor)"""
2094 # fast path: if no "read" flag processor could change the content,
1906 # fast path: if no "read" flag processor could change the content,
2095 # size is rawsize. note: ELLIPSIS is known to not change the content.
1907 # size is rawsize. note: ELLIPSIS is known to not change the content.
2096 flags = self.flags(rev)
1908 flags = self.flags(rev)
2097 if flags & (flagutil.REVIDX_KNOWN_FLAGS ^ REVIDX_ELLIPSIS) == 0:
1909 if flags & (flagutil.REVIDX_KNOWN_FLAGS ^ REVIDX_ELLIPSIS) == 0:
2098 return self.rawsize(rev)
1910 return self.rawsize(rev)
2099
1911
2100 return len(self.revision(rev))
1912 return len(self.revision(rev))
2101
1913
2102 def fast_rank(self, rev):
1914 def fast_rank(self, rev):
2103 """Return the rank of a revision if already known, or None otherwise.
1915 """Return the rank of a revision if already known, or None otherwise.
2104
1916
2105 The rank of a revision is the size of the sub-graph it defines as a
1917 The rank of a revision is the size of the sub-graph it defines as a
2106 head. Equivalently, the rank of a revision `r` is the size of the set
1918 head. Equivalently, the rank of a revision `r` is the size of the set
2107 `ancestors(r)`, `r` included.
1919 `ancestors(r)`, `r` included.
2108
1920
2109 This method returns the rank retrieved from the revlog in constant
1921 This method returns the rank retrieved from the revlog in constant
2110 time. It makes no attempt at computing unknown values for versions of
1922 time. It makes no attempt at computing unknown values for versions of
2111 the revlog which do not persist the rank.
1923 the revlog which do not persist the rank.
2112 """
1924 """
2113 rank = self.index[rev][ENTRY_RANK]
1925 rank = self.index[rev][ENTRY_RANK]
2114 if self._format_version != CHANGELOGV2 or rank == RANK_UNKNOWN:
1926 if self._format_version != CHANGELOGV2 or rank == RANK_UNKNOWN:
2115 return None
1927 return None
2116 if rev == nullrev:
1928 if rev == nullrev:
2117 return 0 # convention
1929 return 0 # convention
2118 return rank
1930 return rank
2119
1931
2120 def chainbase(self, rev):
1932 def chainbase(self, rev):
2121 base = self._chainbasecache.get(rev)
1933 base = self._chainbasecache.get(rev)
2122 if base is not None:
1934 if base is not None:
2123 return base
1935 return base
2124
1936
2125 index = self.index
1937 index = self.index
2126 iterrev = rev
1938 iterrev = rev
2127 base = index[iterrev][3]
1939 base = index[iterrev][3]
2128 while base != iterrev:
1940 while base != iterrev:
2129 iterrev = base
1941 iterrev = base
2130 base = index[iterrev][3]
1942 base = index[iterrev][3]
2131
1943
2132 self._chainbasecache[rev] = base
1944 self._chainbasecache[rev] = base
2133 return base
1945 return base
2134
1946
2135 def linkrev(self, rev):
1947 def linkrev(self, rev):
2136 return self.index[rev][4]
1948 return self.index[rev][4]
2137
1949
2138 def parentrevs(self, rev):
1950 def parentrevs(self, rev):
2139 try:
1951 try:
2140 entry = self.index[rev]
1952 entry = self.index[rev]
2141 except IndexError:
1953 except IndexError:
2142 if rev == wdirrev:
1954 if rev == wdirrev:
2143 raise error.WdirUnsupported
1955 raise error.WdirUnsupported
2144 raise
1956 raise
2145
1957
2146 if self.feature_config.canonical_parent_order and entry[5] == nullrev:
1958 if self.feature_config.canonical_parent_order and entry[5] == nullrev:
2147 return entry[6], entry[5]
1959 return entry[6], entry[5]
2148 else:
1960 else:
2149 return entry[5], entry[6]
1961 return entry[5], entry[6]
2150
1962
2151 # fast parentrevs(rev) where rev isn't filtered
1963 # fast parentrevs(rev) where rev isn't filtered
2152 _uncheckedparentrevs = parentrevs
1964 _uncheckedparentrevs = parentrevs
2153
1965
2154 def node(self, rev):
1966 def node(self, rev):
2155 try:
1967 try:
2156 return self.index[rev][7]
1968 return self.index[rev][7]
2157 except IndexError:
1969 except IndexError:
2158 if rev == wdirrev:
1970 if rev == wdirrev:
2159 raise error.WdirUnsupported
1971 raise error.WdirUnsupported
2160 raise
1972 raise
2161
1973
2162 # Derived from index values.
1974 # Derived from index values.
2163
1975
2164 def end(self, rev):
1976 def end(self, rev):
2165 return self.start(rev) + self.length(rev)
1977 return self.start(rev) + self.length(rev)
2166
1978
2167 def parents(self, node):
1979 def parents(self, node):
2168 i = self.index
1980 i = self.index
2169 d = i[self.rev(node)]
1981 d = i[self.rev(node)]
2170 # inline node() to avoid function call overhead
1982 # inline node() to avoid function call overhead
2171 if self.feature_config.canonical_parent_order and d[5] == self.nullid:
1983 if self.feature_config.canonical_parent_order and d[5] == self.nullid:
2172 return i[d[6]][7], i[d[5]][7]
1984 return i[d[6]][7], i[d[5]][7]
2173 else:
1985 else:
2174 return i[d[5]][7], i[d[6]][7]
1986 return i[d[5]][7], i[d[6]][7]
2175
1987
2176 def chainlen(self, rev):
1988 def chainlen(self, rev):
2177 return self._chaininfo(rev)[0]
1989 return self._chaininfo(rev)[0]
2178
1990
2179 def _chaininfo(self, rev):
1991 def _chaininfo(self, rev):
2180 chaininfocache = self._chaininfocache
1992 chaininfocache = self._chaininfocache
2181 if rev in chaininfocache:
1993 if rev in chaininfocache:
2182 return chaininfocache[rev]
1994 return chaininfocache[rev]
2183 index = self.index
1995 index = self.index
2184 generaldelta = self.delta_config.general_delta
1996 generaldelta = self.delta_config.general_delta
2185 iterrev = rev
1997 iterrev = rev
2186 e = index[iterrev]
1998 e = index[iterrev]
2187 clen = 0
1999 clen = 0
2188 compresseddeltalen = 0
2000 compresseddeltalen = 0
2189 while iterrev != e[3]:
2001 while iterrev != e[3]:
2190 clen += 1
2002 clen += 1
2191 compresseddeltalen += e[1]
2003 compresseddeltalen += e[1]
2192 if generaldelta:
2004 if generaldelta:
2193 iterrev = e[3]
2005 iterrev = e[3]
2194 else:
2006 else:
2195 iterrev -= 1
2007 iterrev -= 1
2196 if iterrev in chaininfocache:
2008 if iterrev in chaininfocache:
2197 t = chaininfocache[iterrev]
2009 t = chaininfocache[iterrev]
2198 clen += t[0]
2010 clen += t[0]
2199 compresseddeltalen += t[1]
2011 compresseddeltalen += t[1]
2200 break
2012 break
2201 e = index[iterrev]
2013 e = index[iterrev]
2202 else:
2014 else:
2203 # Add text length of base since decompressing that also takes
2015 # Add text length of base since decompressing that also takes
2204 # work. For cache hits the length is already included.
2016 # work. For cache hits the length is already included.
2205 compresseddeltalen += e[1]
2017 compresseddeltalen += e[1]
2206 r = (clen, compresseddeltalen)
2018 r = (clen, compresseddeltalen)
2207 chaininfocache[rev] = r
2019 chaininfocache[rev] = r
2208 return r
2020 return r
2209
2021
2210 def _deltachain(self, rev, stoprev=None):
2022 def _deltachain(self, rev, stoprev=None):
2211 return self._inner._deltachain(rev, stoprev=stoprev)
2023 return self._inner._deltachain(rev, stoprev=stoprev)
2212
2024
2213 def ancestors(self, revs, stoprev=0, inclusive=False):
2025 def ancestors(self, revs, stoprev=0, inclusive=False):
2214 """Generate the ancestors of 'revs' in reverse revision order.
2026 """Generate the ancestors of 'revs' in reverse revision order.
2215 Does not generate revs lower than stoprev.
2027 Does not generate revs lower than stoprev.
2216
2028
2217 See the documentation for ancestor.lazyancestors for more details."""
2029 See the documentation for ancestor.lazyancestors for more details."""
2218
2030
2219 # first, make sure start revisions aren't filtered
2031 # first, make sure start revisions aren't filtered
2220 revs = list(revs)
2032 revs = list(revs)
2221 checkrev = self.node
2033 checkrev = self.node
2222 for r in revs:
2034 for r in revs:
2223 checkrev(r)
2035 checkrev(r)
2224 # and we're sure ancestors aren't filtered as well
2036 # and we're sure ancestors aren't filtered as well
2225
2037
2226 if rustancestor is not None and self.index.rust_ext_compat:
2038 if rustancestor is not None and self.index.rust_ext_compat:
2227 lazyancestors = rustancestor.LazyAncestors
2039 lazyancestors = rustancestor.LazyAncestors
2228 arg = self.index
2040 arg = self.index
2229 else:
2041 else:
2230 lazyancestors = ancestor.lazyancestors
2042 lazyancestors = ancestor.lazyancestors
2231 arg = self._uncheckedparentrevs
2043 arg = self._uncheckedparentrevs
2232 return lazyancestors(arg, revs, stoprev=stoprev, inclusive=inclusive)
2044 return lazyancestors(arg, revs, stoprev=stoprev, inclusive=inclusive)
2233
2045
2234 def descendants(self, revs):
2046 def descendants(self, revs):
2235 return dagop.descendantrevs(revs, self.revs, self.parentrevs)
2047 return dagop.descendantrevs(revs, self.revs, self.parentrevs)
2236
2048
2237 def findcommonmissing(self, common=None, heads=None):
2049 def findcommonmissing(self, common=None, heads=None):
2238 """Return a tuple of the ancestors of common and the ancestors of heads
2050 """Return a tuple of the ancestors of common and the ancestors of heads
2239 that are not ancestors of common. In revset terminology, we return the
2051 that are not ancestors of common. In revset terminology, we return the
2240 tuple:
2052 tuple:
2241
2053
2242 ::common, (::heads) - (::common)
2054 ::common, (::heads) - (::common)
2243
2055
2244 The list is sorted by revision number, meaning it is
2056 The list is sorted by revision number, meaning it is
2245 topologically sorted.
2057 topologically sorted.
2246
2058
2247 'heads' and 'common' are both lists of node IDs. If heads is
2059 'heads' and 'common' are both lists of node IDs. If heads is
2248 not supplied, uses all of the revlog's heads. If common is not
2060 not supplied, uses all of the revlog's heads. If common is not
2249 supplied, uses nullid."""
2061 supplied, uses nullid."""
2250 if common is None:
2062 if common is None:
2251 common = [self.nullid]
2063 common = [self.nullid]
2252 if heads is None:
2064 if heads is None:
2253 heads = self.heads()
2065 heads = self.heads()
2254
2066
2255 common = [self.rev(n) for n in common]
2067 common = [self.rev(n) for n in common]
2256 heads = [self.rev(n) for n in heads]
2068 heads = [self.rev(n) for n in heads]
2257
2069
2258 # we want the ancestors, but inclusive
2070 # we want the ancestors, but inclusive
2259 class lazyset:
2071 class lazyset:
2260 def __init__(self, lazyvalues):
2072 def __init__(self, lazyvalues):
2261 self.addedvalues = set()
2073 self.addedvalues = set()
2262 self.lazyvalues = lazyvalues
2074 self.lazyvalues = lazyvalues
2263
2075
2264 def __contains__(self, value):
2076 def __contains__(self, value):
2265 return value in self.addedvalues or value in self.lazyvalues
2077 return value in self.addedvalues or value in self.lazyvalues
2266
2078
2267 def __iter__(self):
2079 def __iter__(self):
2268 added = self.addedvalues
2080 added = self.addedvalues
2269 for r in added:
2081 for r in added:
2270 yield r
2082 yield r
2271 for r in self.lazyvalues:
2083 for r in self.lazyvalues:
2272 if not r in added:
2084 if not r in added:
2273 yield r
2085 yield r
2274
2086
2275 def add(self, value):
2087 def add(self, value):
2276 self.addedvalues.add(value)
2088 self.addedvalues.add(value)
2277
2089
2278 def update(self, values):
2090 def update(self, values):
2279 self.addedvalues.update(values)
2091 self.addedvalues.update(values)
2280
2092
2281 has = lazyset(self.ancestors(common))
2093 has = lazyset(self.ancestors(common))
2282 has.add(nullrev)
2094 has.add(nullrev)
2283 has.update(common)
2095 has.update(common)
2284
2096
2285 # take all ancestors from heads that aren't in has
2097 # take all ancestors from heads that aren't in has
2286 missing = set()
2098 missing = set()
2287 visit = collections.deque(r for r in heads if r not in has)
2099 visit = collections.deque(r for r in heads if r not in has)
2288 while visit:
2100 while visit:
2289 r = visit.popleft()
2101 r = visit.popleft()
2290 if r in missing:
2102 if r in missing:
2291 continue
2103 continue
2292 else:
2104 else:
2293 missing.add(r)
2105 missing.add(r)
2294 for p in self.parentrevs(r):
2106 for p in self.parentrevs(r):
2295 if p not in has:
2107 if p not in has:
2296 visit.append(p)
2108 visit.append(p)
2297 missing = list(missing)
2109 missing = list(missing)
2298 missing.sort()
2110 missing.sort()
2299 return has, [self.node(miss) for miss in missing]
2111 return has, [self.node(miss) for miss in missing]
2300
2112
2301 def incrementalmissingrevs(self, common=None):
2113 def incrementalmissingrevs(self, common=None):
2302 """Return an object that can be used to incrementally compute the
2114 """Return an object that can be used to incrementally compute the
2303 revision numbers of the ancestors of arbitrary sets that are not
2115 revision numbers of the ancestors of arbitrary sets that are not
2304 ancestors of common. This is an ancestor.incrementalmissingancestors
2116 ancestors of common. This is an ancestor.incrementalmissingancestors
2305 object.
2117 object.
2306
2118
2307 'common' is a list of revision numbers. If common is not supplied, uses
2119 'common' is a list of revision numbers. If common is not supplied, uses
2308 nullrev.
2120 nullrev.
2309 """
2121 """
2310 if common is None:
2122 if common is None:
2311 common = [nullrev]
2123 common = [nullrev]
2312
2124
2313 if rustancestor is not None and self.index.rust_ext_compat:
2125 if rustancestor is not None and self.index.rust_ext_compat:
2314 return rustancestor.MissingAncestors(self.index, common)
2126 return rustancestor.MissingAncestors(self.index, common)
2315 return ancestor.incrementalmissingancestors(self.parentrevs, common)
2127 return ancestor.incrementalmissingancestors(self.parentrevs, common)
2316
2128
2317 def findmissingrevs(self, common=None, heads=None):
2129 def findmissingrevs(self, common=None, heads=None):
2318 """Return the revision numbers of the ancestors of heads that
2130 """Return the revision numbers of the ancestors of heads that
2319 are not ancestors of common.
2131 are not ancestors of common.
2320
2132
2321 More specifically, return a list of revision numbers corresponding to
2133 More specifically, return a list of revision numbers corresponding to
2322 nodes N such that every N satisfies the following constraints:
2134 nodes N such that every N satisfies the following constraints:
2323
2135
2324 1. N is an ancestor of some node in 'heads'
2136 1. N is an ancestor of some node in 'heads'
2325 2. N is not an ancestor of any node in 'common'
2137 2. N is not an ancestor of any node in 'common'
2326
2138
2327 The list is sorted by revision number, meaning it is
2139 The list is sorted by revision number, meaning it is
2328 topologically sorted.
2140 topologically sorted.
2329
2141
2330 'heads' and 'common' are both lists of revision numbers. If heads is
2142 'heads' and 'common' are both lists of revision numbers. If heads is
2331 not supplied, uses all of the revlog's heads. If common is not
2143 not supplied, uses all of the revlog's heads. If common is not
2332 supplied, uses nullid."""
2144 supplied, uses nullid."""
2333 if common is None:
2145 if common is None:
2334 common = [nullrev]
2146 common = [nullrev]
2335 if heads is None:
2147 if heads is None:
2336 heads = self.headrevs()
2148 heads = self.headrevs()
2337
2149
2338 inc = self.incrementalmissingrevs(common=common)
2150 inc = self.incrementalmissingrevs(common=common)
2339 return inc.missingancestors(heads)
2151 return inc.missingancestors(heads)
2340
2152
2341 def findmissing(self, common=None, heads=None):
2153 def findmissing(self, common=None, heads=None):
2342 """Return the ancestors of heads that are not ancestors of common.
2154 """Return the ancestors of heads that are not ancestors of common.
2343
2155
2344 More specifically, return a list of nodes N such that every N
2156 More specifically, return a list of nodes N such that every N
2345 satisfies the following constraints:
2157 satisfies the following constraints:
2346
2158
2347 1. N is an ancestor of some node in 'heads'
2159 1. N is an ancestor of some node in 'heads'
2348 2. N is not an ancestor of any node in 'common'
2160 2. N is not an ancestor of any node in 'common'
2349
2161
2350 The list is sorted by revision number, meaning it is
2162 The list is sorted by revision number, meaning it is
2351 topologically sorted.
2163 topologically sorted.
2352
2164
2353 'heads' and 'common' are both lists of node IDs. If heads is
2165 'heads' and 'common' are both lists of node IDs. If heads is
2354 not supplied, uses all of the revlog's heads. If common is not
2166 not supplied, uses all of the revlog's heads. If common is not
2355 supplied, uses nullid."""
2167 supplied, uses nullid."""
2356 if common is None:
2168 if common is None:
2357 common = [self.nullid]
2169 common = [self.nullid]
2358 if heads is None:
2170 if heads is None:
2359 heads = self.heads()
2171 heads = self.heads()
2360
2172
2361 common = [self.rev(n) for n in common]
2173 common = [self.rev(n) for n in common]
2362 heads = [self.rev(n) for n in heads]
2174 heads = [self.rev(n) for n in heads]
2363
2175
2364 inc = self.incrementalmissingrevs(common=common)
2176 inc = self.incrementalmissingrevs(common=common)
2365 return [self.node(r) for r in inc.missingancestors(heads)]
2177 return [self.node(r) for r in inc.missingancestors(heads)]
2366
2178
2367 def nodesbetween(self, roots=None, heads=None):
2179 def nodesbetween(self, roots=None, heads=None):
2368 """Return a topological path from 'roots' to 'heads'.
2180 """Return a topological path from 'roots' to 'heads'.
2369
2181
2370 Return a tuple (nodes, outroots, outheads) where 'nodes' is a
2182 Return a tuple (nodes, outroots, outheads) where 'nodes' is a
2371 topologically sorted list of all nodes N that satisfy both of
2183 topologically sorted list of all nodes N that satisfy both of
2372 these constraints:
2184 these constraints:
2373
2185
2374 1. N is a descendant of some node in 'roots'
2186 1. N is a descendant of some node in 'roots'
2375 2. N is an ancestor of some node in 'heads'
2187 2. N is an ancestor of some node in 'heads'
2376
2188
2377 Every node is considered to be both a descendant and an ancestor
2189 Every node is considered to be both a descendant and an ancestor
2378 of itself, so every reachable node in 'roots' and 'heads' will be
2190 of itself, so every reachable node in 'roots' and 'heads' will be
2379 included in 'nodes'.
2191 included in 'nodes'.
2380
2192
2381 'outroots' is the list of reachable nodes in 'roots', i.e., the
2193 'outroots' is the list of reachable nodes in 'roots', i.e., the
2382 subset of 'roots' that is returned in 'nodes'. Likewise,
2194 subset of 'roots' that is returned in 'nodes'. Likewise,
2383 'outheads' is the subset of 'heads' that is also in 'nodes'.
2195 'outheads' is the subset of 'heads' that is also in 'nodes'.
2384
2196
2385 'roots' and 'heads' are both lists of node IDs. If 'roots' is
2197 'roots' and 'heads' are both lists of node IDs. If 'roots' is
2386 unspecified, uses nullid as the only root. If 'heads' is
2198 unspecified, uses nullid as the only root. If 'heads' is
2387 unspecified, uses list of all of the revlog's heads."""
2199 unspecified, uses list of all of the revlog's heads."""
2388 nonodes = ([], [], [])
2200 nonodes = ([], [], [])
2389 if roots is not None:
2201 if roots is not None:
2390 roots = list(roots)
2202 roots = list(roots)
2391 if not roots:
2203 if not roots:
2392 return nonodes
2204 return nonodes
2393 lowestrev = min([self.rev(n) for n in roots])
2205 lowestrev = min([self.rev(n) for n in roots])
2394 else:
2206 else:
2395 roots = [self.nullid] # Everybody's a descendant of nullid
2207 roots = [self.nullid] # Everybody's a descendant of nullid
2396 lowestrev = nullrev
2208 lowestrev = nullrev
2397 if (lowestrev == nullrev) and (heads is None):
2209 if (lowestrev == nullrev) and (heads is None):
2398 # We want _all_ the nodes!
2210 # We want _all_ the nodes!
2399 return (
2211 return (
2400 [self.node(r) for r in self],
2212 [self.node(r) for r in self],
2401 [self.nullid],
2213 [self.nullid],
2402 list(self.heads()),
2214 list(self.heads()),
2403 )
2215 )
2404 if heads is None:
2216 if heads is None:
2405 # All nodes are ancestors, so the latest ancestor is the last
2217 # All nodes are ancestors, so the latest ancestor is the last
2406 # node.
2218 # node.
2407 highestrev = len(self) - 1
2219 highestrev = len(self) - 1
2408 # Set ancestors to None to signal that every node is an ancestor.
2220 # Set ancestors to None to signal that every node is an ancestor.
2409 ancestors = None
2221 ancestors = None
2410 # Set heads to an empty dictionary for later discovery of heads
2222 # Set heads to an empty dictionary for later discovery of heads
2411 heads = {}
2223 heads = {}
2412 else:
2224 else:
2413 heads = list(heads)
2225 heads = list(heads)
2414 if not heads:
2226 if not heads:
2415 return nonodes
2227 return nonodes
2416 ancestors = set()
2228 ancestors = set()
2417 # Turn heads into a dictionary so we can remove 'fake' heads.
2229 # Turn heads into a dictionary so we can remove 'fake' heads.
2418 # Also, later we will be using it to filter out the heads we can't
2230 # Also, later we will be using it to filter out the heads we can't
2419 # find from roots.
2231 # find from roots.
2420 heads = dict.fromkeys(heads, False)
2232 heads = dict.fromkeys(heads, False)
2421 # Start at the top and keep marking parents until we're done.
2233 # Start at the top and keep marking parents until we're done.
2422 nodestotag = set(heads)
2234 nodestotag = set(heads)
2423 # Remember where the top was so we can use it as a limit later.
2235 # Remember where the top was so we can use it as a limit later.
2424 highestrev = max([self.rev(n) for n in nodestotag])
2236 highestrev = max([self.rev(n) for n in nodestotag])
2425 while nodestotag:
2237 while nodestotag:
2426 # grab a node to tag
2238 # grab a node to tag
2427 n = nodestotag.pop()
2239 n = nodestotag.pop()
2428 # Never tag nullid
2240 # Never tag nullid
2429 if n == self.nullid:
2241 if n == self.nullid:
2430 continue
2242 continue
2431 # A node's revision number represents its place in a
2243 # A node's revision number represents its place in a
2432 # topologically sorted list of nodes.
2244 # topologically sorted list of nodes.
2433 r = self.rev(n)
2245 r = self.rev(n)
2434 if r >= lowestrev:
2246 if r >= lowestrev:
2435 if n not in ancestors:
2247 if n not in ancestors:
2436 # If we are possibly a descendant of one of the roots
2248 # If we are possibly a descendant of one of the roots
2437 # and we haven't already been marked as an ancestor
2249 # and we haven't already been marked as an ancestor
2438 ancestors.add(n) # Mark as ancestor
2250 ancestors.add(n) # Mark as ancestor
2439 # Add non-nullid parents to list of nodes to tag.
2251 # Add non-nullid parents to list of nodes to tag.
2440 nodestotag.update(
2252 nodestotag.update(
2441 [p for p in self.parents(n) if p != self.nullid]
2253 [p for p in self.parents(n) if p != self.nullid]
2442 )
2254 )
2443 elif n in heads: # We've seen it before, is it a fake head?
2255 elif n in heads: # We've seen it before, is it a fake head?
2444 # So it is, real heads should not be the ancestors of
2256 # So it is, real heads should not be the ancestors of
2445 # any other heads.
2257 # any other heads.
2446 heads.pop(n)
2258 heads.pop(n)
2447 if not ancestors:
2259 if not ancestors:
2448 return nonodes
2260 return nonodes
2449 # Now that we have our set of ancestors, we want to remove any
2261 # Now that we have our set of ancestors, we want to remove any
2450 # roots that are not ancestors.
2262 # roots that are not ancestors.
2451
2263
2452 # If one of the roots was nullid, everything is included anyway.
2264 # If one of the roots was nullid, everything is included anyway.
2453 if lowestrev > nullrev:
2265 if lowestrev > nullrev:
2454 # But, since we weren't, let's recompute the lowest rev to not
2266 # But, since we weren't, let's recompute the lowest rev to not
2455 # include roots that aren't ancestors.
2267 # include roots that aren't ancestors.
2456
2268
2457 # Filter out roots that aren't ancestors of heads
2269 # Filter out roots that aren't ancestors of heads
2458 roots = [root for root in roots if root in ancestors]
2270 roots = [root for root in roots if root in ancestors]
2459 # Recompute the lowest revision
2271 # Recompute the lowest revision
2460 if roots:
2272 if roots:
2461 lowestrev = min([self.rev(root) for root in roots])
2273 lowestrev = min([self.rev(root) for root in roots])
2462 else:
2274 else:
2463 # No more roots? Return empty list
2275 # No more roots? Return empty list
2464 return nonodes
2276 return nonodes
2465 else:
2277 else:
2466 # We are descending from nullid, and don't need to care about
2278 # We are descending from nullid, and don't need to care about
2467 # any other roots.
2279 # any other roots.
2468 lowestrev = nullrev
2280 lowestrev = nullrev
2469 roots = [self.nullid]
2281 roots = [self.nullid]
2470 # Transform our roots list into a set.
2282 # Transform our roots list into a set.
2471 descendants = set(roots)
2283 descendants = set(roots)
2472 # Also, keep the original roots so we can filter out roots that aren't
2284 # Also, keep the original roots so we can filter out roots that aren't
2473 # 'real' roots (i.e. are descended from other roots).
2285 # 'real' roots (i.e. are descended from other roots).
2474 roots = descendants.copy()
2286 roots = descendants.copy()
2475 # Our topologically sorted list of output nodes.
2287 # Our topologically sorted list of output nodes.
2476 orderedout = []
2288 orderedout = []
2477 # Don't start at nullid since we don't want nullid in our output list,
2289 # Don't start at nullid since we don't want nullid in our output list,
2478 # and if nullid shows up in descendants, empty parents will look like
2290 # and if nullid shows up in descendants, empty parents will look like
2479 # they're descendants.
2291 # they're descendants.
2480 for r in self.revs(start=max(lowestrev, 0), stop=highestrev + 1):
2292 for r in self.revs(start=max(lowestrev, 0), stop=highestrev + 1):
2481 n = self.node(r)
2293 n = self.node(r)
2482 isdescendant = False
2294 isdescendant = False
2483 if lowestrev == nullrev: # Everybody is a descendant of nullid
2295 if lowestrev == nullrev: # Everybody is a descendant of nullid
2484 isdescendant = True
2296 isdescendant = True
2485 elif n in descendants:
2297 elif n in descendants:
2486 # n is already a descendant
2298 # n is already a descendant
2487 isdescendant = True
2299 isdescendant = True
2488 # This check only needs to be done here because all the roots
2300 # This check only needs to be done here because all the roots
2489 # will start being marked is descendants before the loop.
2301 # will start being marked is descendants before the loop.
2490 if n in roots:
2302 if n in roots:
2491 # If n was a root, check if it's a 'real' root.
2303 # If n was a root, check if it's a 'real' root.
2492 p = tuple(self.parents(n))
2304 p = tuple(self.parents(n))
2493 # If any of its parents are descendants, it's not a root.
2305 # If any of its parents are descendants, it's not a root.
2494 if (p[0] in descendants) or (p[1] in descendants):
2306 if (p[0] in descendants) or (p[1] in descendants):
2495 roots.remove(n)
2307 roots.remove(n)
2496 else:
2308 else:
2497 p = tuple(self.parents(n))
2309 p = tuple(self.parents(n))
2498 # A node is a descendant if either of its parents are
2310 # A node is a descendant if either of its parents are
2499 # descendants. (We seeded the dependents list with the roots
2311 # descendants. (We seeded the dependents list with the roots
2500 # up there, remember?)
2312 # up there, remember?)
2501 if (p[0] in descendants) or (p[1] in descendants):
2313 if (p[0] in descendants) or (p[1] in descendants):
2502 descendants.add(n)
2314 descendants.add(n)
2503 isdescendant = True
2315 isdescendant = True
2504 if isdescendant and ((ancestors is None) or (n in ancestors)):
2316 if isdescendant and ((ancestors is None) or (n in ancestors)):
2505 # Only include nodes that are both descendants and ancestors.
2317 # Only include nodes that are both descendants and ancestors.
2506 orderedout.append(n)
2318 orderedout.append(n)
2507 if (ancestors is not None) and (n in heads):
2319 if (ancestors is not None) and (n in heads):
2508 # We're trying to figure out which heads are reachable
2320 # We're trying to figure out which heads are reachable
2509 # from roots.
2321 # from roots.
2510 # Mark this head as having been reached
2322 # Mark this head as having been reached
2511 heads[n] = True
2323 heads[n] = True
2512 elif ancestors is None:
2324 elif ancestors is None:
2513 # Otherwise, we're trying to discover the heads.
2325 # Otherwise, we're trying to discover the heads.
2514 # Assume this is a head because if it isn't, the next step
2326 # Assume this is a head because if it isn't, the next step
2515 # will eventually remove it.
2327 # will eventually remove it.
2516 heads[n] = True
2328 heads[n] = True
2517 # But, obviously its parents aren't.
2329 # But, obviously its parents aren't.
2518 for p in self.parents(n):
2330 for p in self.parents(n):
2519 heads.pop(p, None)
2331 heads.pop(p, None)
2520 heads = [head for head, flag in heads.items() if flag]
2332 heads = [head for head, flag in heads.items() if flag]
2521 roots = list(roots)
2333 roots = list(roots)
2522 assert orderedout
2334 assert orderedout
2523 assert roots
2335 assert roots
2524 assert heads
2336 assert heads
2525 return (orderedout, roots, heads)
2337 return (orderedout, roots, heads)
2526
2338
2527 def headrevs(self, revs=None):
2339 def headrevs(self, revs=None):
2528 if revs is None:
2340 if revs is None:
2529 try:
2341 try:
2530 return self.index.headrevs()
2342 return self.index.headrevs()
2531 except AttributeError:
2343 except AttributeError:
2532 return self._headrevs()
2344 return self._headrevs()
2533 if rustdagop is not None and self.index.rust_ext_compat:
2345 if rustdagop is not None and self.index.rust_ext_compat:
2534 return rustdagop.headrevs(self.index, revs)
2346 return rustdagop.headrevs(self.index, revs)
2535 return dagop.headrevs(revs, self._uncheckedparentrevs)
2347 return dagop.headrevs(revs, self._uncheckedparentrevs)
2536
2348
2537 def computephases(self, roots):
2349 def computephases(self, roots):
2538 return self.index.computephasesmapsets(roots)
2350 return self.index.computephasesmapsets(roots)
2539
2351
2540 def _headrevs(self):
2352 def _headrevs(self):
2541 count = len(self)
2353 count = len(self)
2542 if not count:
2354 if not count:
2543 return [nullrev]
2355 return [nullrev]
2544 # we won't iter over filtered rev so nobody is a head at start
2356 # we won't iter over filtered rev so nobody is a head at start
2545 ishead = [0] * (count + 1)
2357 ishead = [0] * (count + 1)
2546 index = self.index
2358 index = self.index
2547 for r in self:
2359 for r in self:
2548 ishead[r] = 1 # I may be an head
2360 ishead[r] = 1 # I may be an head
2549 e = index[r]
2361 e = index[r]
2550 ishead[e[5]] = ishead[e[6]] = 0 # my parent are not
2362 ishead[e[5]] = ishead[e[6]] = 0 # my parent are not
2551 return [r for r, val in enumerate(ishead) if val]
2363 return [r for r, val in enumerate(ishead) if val]
2552
2364
2553 def heads(self, start=None, stop=None):
2365 def heads(self, start=None, stop=None):
2554 """return the list of all nodes that have no children
2366 """return the list of all nodes that have no children
2555
2367
2556 if start is specified, only heads that are descendants of
2368 if start is specified, only heads that are descendants of
2557 start will be returned
2369 start will be returned
2558 if stop is specified, it will consider all the revs from stop
2370 if stop is specified, it will consider all the revs from stop
2559 as if they had no children
2371 as if they had no children
2560 """
2372 """
2561 if start is None and stop is None:
2373 if start is None and stop is None:
2562 if not len(self):
2374 if not len(self):
2563 return [self.nullid]
2375 return [self.nullid]
2564 return [self.node(r) for r in self.headrevs()]
2376 return [self.node(r) for r in self.headrevs()]
2565
2377
2566 if start is None:
2378 if start is None:
2567 start = nullrev
2379 start = nullrev
2568 else:
2380 else:
2569 start = self.rev(start)
2381 start = self.rev(start)
2570
2382
2571 stoprevs = {self.rev(n) for n in stop or []}
2383 stoprevs = {self.rev(n) for n in stop or []}
2572
2384
2573 revs = dagop.headrevssubset(
2385 revs = dagop.headrevssubset(
2574 self.revs, self.parentrevs, startrev=start, stoprevs=stoprevs
2386 self.revs, self.parentrevs, startrev=start, stoprevs=stoprevs
2575 )
2387 )
2576
2388
2577 return [self.node(rev) for rev in revs]
2389 return [self.node(rev) for rev in revs]
2578
2390
2579 def children(self, node):
2391 def children(self, node):
2580 """find the children of a given node"""
2392 """find the children of a given node"""
2581 c = []
2393 c = []
2582 p = self.rev(node)
2394 p = self.rev(node)
2583 for r in self.revs(start=p + 1):
2395 for r in self.revs(start=p + 1):
2584 prevs = [pr for pr in self.parentrevs(r) if pr != nullrev]
2396 prevs = [pr for pr in self.parentrevs(r) if pr != nullrev]
2585 if prevs:
2397 if prevs:
2586 for pr in prevs:
2398 for pr in prevs:
2587 if pr == p:
2399 if pr == p:
2588 c.append(self.node(r))
2400 c.append(self.node(r))
2589 elif p == nullrev:
2401 elif p == nullrev:
2590 c.append(self.node(r))
2402 c.append(self.node(r))
2591 return c
2403 return c
2592
2404
2593 def commonancestorsheads(self, a, b):
2405 def commonancestorsheads(self, a, b):
2594 """calculate all the heads of the common ancestors of nodes a and b"""
2406 """calculate all the heads of the common ancestors of nodes a and b"""
2595 a, b = self.rev(a), self.rev(b)
2407 a, b = self.rev(a), self.rev(b)
2596 ancs = self._commonancestorsheads(a, b)
2408 ancs = self._commonancestorsheads(a, b)
2597 return pycompat.maplist(self.node, ancs)
2409 return pycompat.maplist(self.node, ancs)
2598
2410
2599 def _commonancestorsheads(self, *revs):
2411 def _commonancestorsheads(self, *revs):
2600 """calculate all the heads of the common ancestors of revs"""
2412 """calculate all the heads of the common ancestors of revs"""
2601 try:
2413 try:
2602 ancs = self.index.commonancestorsheads(*revs)
2414 ancs = self.index.commonancestorsheads(*revs)
2603 except (AttributeError, OverflowError): # C implementation failed
2415 except (AttributeError, OverflowError): # C implementation failed
2604 ancs = ancestor.commonancestorsheads(self.parentrevs, *revs)
2416 ancs = ancestor.commonancestorsheads(self.parentrevs, *revs)
2605 return ancs
2417 return ancs
2606
2418
2607 def isancestor(self, a, b):
2419 def isancestor(self, a, b):
2608 """return True if node a is an ancestor of node b
2420 """return True if node a is an ancestor of node b
2609
2421
2610 A revision is considered an ancestor of itself."""
2422 A revision is considered an ancestor of itself."""
2611 a, b = self.rev(a), self.rev(b)
2423 a, b = self.rev(a), self.rev(b)
2612 return self.isancestorrev(a, b)
2424 return self.isancestorrev(a, b)
2613
2425
2614 def isancestorrev(self, a, b):
2426 def isancestorrev(self, a, b):
2615 """return True if revision a is an ancestor of revision b
2427 """return True if revision a is an ancestor of revision b
2616
2428
2617 A revision is considered an ancestor of itself.
2429 A revision is considered an ancestor of itself.
2618
2430
2619 The implementation of this is trivial but the use of
2431 The implementation of this is trivial but the use of
2620 reachableroots is not."""
2432 reachableroots is not."""
2621 if a == nullrev:
2433 if a == nullrev:
2622 return True
2434 return True
2623 elif a == b:
2435 elif a == b:
2624 return True
2436 return True
2625 elif a > b:
2437 elif a > b:
2626 return False
2438 return False
2627 return bool(self.reachableroots(a, [b], [a], includepath=False))
2439 return bool(self.reachableroots(a, [b], [a], includepath=False))
2628
2440
2629 def reachableroots(self, minroot, heads, roots, includepath=False):
2441 def reachableroots(self, minroot, heads, roots, includepath=False):
2630 """return (heads(::(<roots> and <roots>::<heads>)))
2442 """return (heads(::(<roots> and <roots>::<heads>)))
2631
2443
2632 If includepath is True, return (<roots>::<heads>)."""
2444 If includepath is True, return (<roots>::<heads>)."""
2633 try:
2445 try:
2634 return self.index.reachableroots2(
2446 return self.index.reachableroots2(
2635 minroot, heads, roots, includepath
2447 minroot, heads, roots, includepath
2636 )
2448 )
2637 except AttributeError:
2449 except AttributeError:
2638 return dagop._reachablerootspure(
2450 return dagop._reachablerootspure(
2639 self.parentrevs, minroot, roots, heads, includepath
2451 self.parentrevs, minroot, roots, heads, includepath
2640 )
2452 )
2641
2453
2642 def ancestor(self, a, b):
2454 def ancestor(self, a, b):
2643 """calculate the "best" common ancestor of nodes a and b"""
2455 """calculate the "best" common ancestor of nodes a and b"""
2644
2456
2645 a, b = self.rev(a), self.rev(b)
2457 a, b = self.rev(a), self.rev(b)
2646 try:
2458 try:
2647 ancs = self.index.ancestors(a, b)
2459 ancs = self.index.ancestors(a, b)
2648 except (AttributeError, OverflowError):
2460 except (AttributeError, OverflowError):
2649 ancs = ancestor.ancestors(self.parentrevs, a, b)
2461 ancs = ancestor.ancestors(self.parentrevs, a, b)
2650 if ancs:
2462 if ancs:
2651 # choose a consistent winner when there's a tie
2463 # choose a consistent winner when there's a tie
2652 return min(map(self.node, ancs))
2464 return min(map(self.node, ancs))
2653 return self.nullid
2465 return self.nullid
2654
2466
2655 def _match(self, id):
2467 def _match(self, id):
2656 if isinstance(id, int):
2468 if isinstance(id, int):
2657 # rev
2469 # rev
2658 return self.node(id)
2470 return self.node(id)
2659 if len(id) == self.nodeconstants.nodelen:
2471 if len(id) == self.nodeconstants.nodelen:
2660 # possibly a binary node
2472 # possibly a binary node
2661 # odds of a binary node being all hex in ASCII are 1 in 10**25
2473 # odds of a binary node being all hex in ASCII are 1 in 10**25
2662 try:
2474 try:
2663 node = id
2475 node = id
2664 self.rev(node) # quick search the index
2476 self.rev(node) # quick search the index
2665 return node
2477 return node
2666 except error.LookupError:
2478 except error.LookupError:
2667 pass # may be partial hex id
2479 pass # may be partial hex id
2668 try:
2480 try:
2669 # str(rev)
2481 # str(rev)
2670 rev = int(id)
2482 rev = int(id)
2671 if b"%d" % rev != id:
2483 if b"%d" % rev != id:
2672 raise ValueError
2484 raise ValueError
2673 if rev < 0:
2485 if rev < 0:
2674 rev = len(self) + rev
2486 rev = len(self) + rev
2675 if rev < 0 or rev >= len(self):
2487 if rev < 0 or rev >= len(self):
2676 raise ValueError
2488 raise ValueError
2677 return self.node(rev)
2489 return self.node(rev)
2678 except (ValueError, OverflowError):
2490 except (ValueError, OverflowError):
2679 pass
2491 pass
2680 if len(id) == 2 * self.nodeconstants.nodelen:
2492 if len(id) == 2 * self.nodeconstants.nodelen:
2681 try:
2493 try:
2682 # a full hex nodeid?
2494 # a full hex nodeid?
2683 node = bin(id)
2495 node = bin(id)
2684 self.rev(node)
2496 self.rev(node)
2685 return node
2497 return node
2686 except (binascii.Error, error.LookupError):
2498 except (binascii.Error, error.LookupError):
2687 pass
2499 pass
2688
2500
2689 def _partialmatch(self, id):
2501 def _partialmatch(self, id):
2690 # we don't care wdirfilenodeids as they should be always full hash
2502 # we don't care wdirfilenodeids as they should be always full hash
2691 maybewdir = self.nodeconstants.wdirhex.startswith(id)
2503 maybewdir = self.nodeconstants.wdirhex.startswith(id)
2692 ambiguous = False
2504 ambiguous = False
2693 try:
2505 try:
2694 partial = self.index.partialmatch(id)
2506 partial = self.index.partialmatch(id)
2695 if partial and self.hasnode(partial):
2507 if partial and self.hasnode(partial):
2696 if maybewdir:
2508 if maybewdir:
2697 # single 'ff...' match in radix tree, ambiguous with wdir
2509 # single 'ff...' match in radix tree, ambiguous with wdir
2698 ambiguous = True
2510 ambiguous = True
2699 else:
2511 else:
2700 return partial
2512 return partial
2701 elif maybewdir:
2513 elif maybewdir:
2702 # no 'ff...' match in radix tree, wdir identified
2514 # no 'ff...' match in radix tree, wdir identified
2703 raise error.WdirUnsupported
2515 raise error.WdirUnsupported
2704 else:
2516 else:
2705 return None
2517 return None
2706 except error.RevlogError:
2518 except error.RevlogError:
2707 # parsers.c radix tree lookup gave multiple matches
2519 # parsers.c radix tree lookup gave multiple matches
2708 # fast path: for unfiltered changelog, radix tree is accurate
2520 # fast path: for unfiltered changelog, radix tree is accurate
2709 if not getattr(self, 'filteredrevs', None):
2521 if not getattr(self, 'filteredrevs', None):
2710 ambiguous = True
2522 ambiguous = True
2711 # fall through to slow path that filters hidden revisions
2523 # fall through to slow path that filters hidden revisions
2712 except (AttributeError, ValueError):
2524 except (AttributeError, ValueError):
2713 # we are pure python, or key is not hex
2525 # we are pure python, or key is not hex
2714 pass
2526 pass
2715 if ambiguous:
2527 if ambiguous:
2716 raise error.AmbiguousPrefixLookupError(
2528 raise error.AmbiguousPrefixLookupError(
2717 id, self.display_id, _(b'ambiguous identifier')
2529 id, self.display_id, _(b'ambiguous identifier')
2718 )
2530 )
2719
2531
2720 if id in self._pcache:
2532 if id in self._pcache:
2721 return self._pcache[id]
2533 return self._pcache[id]
2722
2534
2723 if len(id) <= 40:
2535 if len(id) <= 40:
2724 # hex(node)[:...]
2536 # hex(node)[:...]
2725 l = len(id) // 2 * 2 # grab an even number of digits
2537 l = len(id) // 2 * 2 # grab an even number of digits
2726 try:
2538 try:
2727 # we're dropping the last digit, so let's check that it's hex,
2539 # we're dropping the last digit, so let's check that it's hex,
2728 # to avoid the expensive computation below if it's not
2540 # to avoid the expensive computation below if it's not
2729 if len(id) % 2 > 0:
2541 if len(id) % 2 > 0:
2730 if not (id[-1] in hexdigits):
2542 if not (id[-1] in hexdigits):
2731 return None
2543 return None
2732 prefix = bin(id[:l])
2544 prefix = bin(id[:l])
2733 except binascii.Error:
2545 except binascii.Error:
2734 pass
2546 pass
2735 else:
2547 else:
2736 nl = [e[7] for e in self.index if e[7].startswith(prefix)]
2548 nl = [e[7] for e in self.index if e[7].startswith(prefix)]
2737 nl = [
2549 nl = [
2738 n for n in nl if hex(n).startswith(id) and self.hasnode(n)
2550 n for n in nl if hex(n).startswith(id) and self.hasnode(n)
2739 ]
2551 ]
2740 if self.nodeconstants.nullhex.startswith(id):
2552 if self.nodeconstants.nullhex.startswith(id):
2741 nl.append(self.nullid)
2553 nl.append(self.nullid)
2742 if len(nl) > 0:
2554 if len(nl) > 0:
2743 if len(nl) == 1 and not maybewdir:
2555 if len(nl) == 1 and not maybewdir:
2744 self._pcache[id] = nl[0]
2556 self._pcache[id] = nl[0]
2745 return nl[0]
2557 return nl[0]
2746 raise error.AmbiguousPrefixLookupError(
2558 raise error.AmbiguousPrefixLookupError(
2747 id, self.display_id, _(b'ambiguous identifier')
2559 id, self.display_id, _(b'ambiguous identifier')
2748 )
2560 )
2749 if maybewdir:
2561 if maybewdir:
2750 raise error.WdirUnsupported
2562 raise error.WdirUnsupported
2751 return None
2563 return None
2752
2564
2753 def lookup(self, id):
2565 def lookup(self, id):
2754 """locate a node based on:
2566 """locate a node based on:
2755 - revision number or str(revision number)
2567 - revision number or str(revision number)
2756 - nodeid or subset of hex nodeid
2568 - nodeid or subset of hex nodeid
2757 """
2569 """
2758 n = self._match(id)
2570 n = self._match(id)
2759 if n is not None:
2571 if n is not None:
2760 return n
2572 return n
2761 n = self._partialmatch(id)
2573 n = self._partialmatch(id)
2762 if n:
2574 if n:
2763 return n
2575 return n
2764
2576
2765 raise error.LookupError(id, self.display_id, _(b'no match found'))
2577 raise error.LookupError(id, self.display_id, _(b'no match found'))
2766
2578
2767 def shortest(self, node, minlength=1):
2579 def shortest(self, node, minlength=1):
2768 """Find the shortest unambiguous prefix that matches node."""
2580 """Find the shortest unambiguous prefix that matches node."""
2769
2581
2770 def isvalid(prefix):
2582 def isvalid(prefix):
2771 try:
2583 try:
2772 matchednode = self._partialmatch(prefix)
2584 matchednode = self._partialmatch(prefix)
2773 except error.AmbiguousPrefixLookupError:
2585 except error.AmbiguousPrefixLookupError:
2774 return False
2586 return False
2775 except error.WdirUnsupported:
2587 except error.WdirUnsupported:
2776 # single 'ff...' match
2588 # single 'ff...' match
2777 return True
2589 return True
2778 if matchednode is None:
2590 if matchednode is None:
2779 raise error.LookupError(node, self.display_id, _(b'no node'))
2591 raise error.LookupError(node, self.display_id, _(b'no node'))
2780 return True
2592 return True
2781
2593
2782 def maybewdir(prefix):
2594 def maybewdir(prefix):
2783 return all(c == b'f' for c in pycompat.iterbytestr(prefix))
2595 return all(c == b'f' for c in pycompat.iterbytestr(prefix))
2784
2596
2785 hexnode = hex(node)
2597 hexnode = hex(node)
2786
2598
2787 def disambiguate(hexnode, minlength):
2599 def disambiguate(hexnode, minlength):
2788 """Disambiguate against wdirid."""
2600 """Disambiguate against wdirid."""
2789 for length in range(minlength, len(hexnode) + 1):
2601 for length in range(minlength, len(hexnode) + 1):
2790 prefix = hexnode[:length]
2602 prefix = hexnode[:length]
2791 if not maybewdir(prefix):
2603 if not maybewdir(prefix):
2792 return prefix
2604 return prefix
2793
2605
2794 if not getattr(self, 'filteredrevs', None):
2606 if not getattr(self, 'filteredrevs', None):
2795 try:
2607 try:
2796 length = max(self.index.shortest(node), minlength)
2608 length = max(self.index.shortest(node), minlength)
2797 return disambiguate(hexnode, length)
2609 return disambiguate(hexnode, length)
2798 except error.RevlogError:
2610 except error.RevlogError:
2799 if node != self.nodeconstants.wdirid:
2611 if node != self.nodeconstants.wdirid:
2800 raise error.LookupError(
2612 raise error.LookupError(
2801 node, self.display_id, _(b'no node')
2613 node, self.display_id, _(b'no node')
2802 )
2614 )
2803 except AttributeError:
2615 except AttributeError:
2804 # Fall through to pure code
2616 # Fall through to pure code
2805 pass
2617 pass
2806
2618
2807 if node == self.nodeconstants.wdirid:
2619 if node == self.nodeconstants.wdirid:
2808 for length in range(minlength, len(hexnode) + 1):
2620 for length in range(minlength, len(hexnode) + 1):
2809 prefix = hexnode[:length]
2621 prefix = hexnode[:length]
2810 if isvalid(prefix):
2622 if isvalid(prefix):
2811 return prefix
2623 return prefix
2812
2624
2813 for length in range(minlength, len(hexnode) + 1):
2625 for length in range(minlength, len(hexnode) + 1):
2814 prefix = hexnode[:length]
2626 prefix = hexnode[:length]
2815 if isvalid(prefix):
2627 if isvalid(prefix):
2816 return disambiguate(hexnode, length)
2628 return disambiguate(hexnode, length)
2817
2629
2818 def cmp(self, node, text):
2630 def cmp(self, node, text):
2819 """compare text with a given file revision
2631 """compare text with a given file revision
2820
2632
2821 returns True if text is different than what is stored.
2633 returns True if text is different than what is stored.
2822 """
2634 """
2823 p1, p2 = self.parents(node)
2635 p1, p2 = self.parents(node)
2824 return storageutil.hashrevisionsha1(text, p1, p2) != node
2636 return storageutil.hashrevisionsha1(text, p1, p2) != node
2825
2637
2826 def deltaparent(self, rev):
2638 def deltaparent(self, rev):
2827 """return deltaparent of the given revision"""
2639 """return deltaparent of the given revision"""
2828 base = self.index[rev][3]
2640 base = self.index[rev][3]
2829 if base == rev:
2641 if base == rev:
2830 return nullrev
2642 return nullrev
2831 elif self.delta_config.general_delta:
2643 elif self.delta_config.general_delta:
2832 return base
2644 return base
2833 else:
2645 else:
2834 return rev - 1
2646 return rev - 1
2835
2647
2836 def issnapshot(self, rev):
2648 def issnapshot(self, rev):
2837 """tells whether rev is a snapshot"""
2649 """tells whether rev is a snapshot"""
2838 ret = self._inner.issnapshot(rev)
2650 ret = self._inner.issnapshot(rev)
2839 self.issnapshot = self._inner.issnapshot
2651 self.issnapshot = self._inner.issnapshot
2840 return ret
2652 return ret
2841
2653
2842 def snapshotdepth(self, rev):
2654 def snapshotdepth(self, rev):
2843 """number of snapshot in the chain before this one"""
2655 """number of snapshot in the chain before this one"""
2844 if not self.issnapshot(rev):
2656 if not self.issnapshot(rev):
2845 raise error.ProgrammingError(b'revision %d not a snapshot')
2657 raise error.ProgrammingError(b'revision %d not a snapshot')
2846 return len(self._inner._deltachain(rev)[0]) - 1
2658 return len(self._inner._deltachain(rev)[0]) - 1
2847
2659
2848 def revdiff(self, rev1, rev2):
2660 def revdiff(self, rev1, rev2):
2849 """return or calculate a delta between two revisions
2661 """return or calculate a delta between two revisions
2850
2662
2851 The delta calculated is in binary form and is intended to be written to
2663 The delta calculated is in binary form and is intended to be written to
2852 revlog data directly. So this function needs raw revision data.
2664 revlog data directly. So this function needs raw revision data.
2853 """
2665 """
2854 if rev1 != nullrev and self.deltaparent(rev2) == rev1:
2666 if rev1 != nullrev and self.deltaparent(rev2) == rev1:
2855 return bytes(self._inner._chunk(rev2))
2667 return bytes(self._inner._chunk(rev2))
2856
2668
2857 return mdiff.textdiff(self.rawdata(rev1), self.rawdata(rev2))
2669 return mdiff.textdiff(self.rawdata(rev1), self.rawdata(rev2))
2858
2670
2859 def revision(self, nodeorrev):
2671 def revision(self, nodeorrev):
2860 """return an uncompressed revision of a given node or revision
2672 """return an uncompressed revision of a given node or revision
2861 number.
2673 number.
2862 """
2674 """
2863 return self._revisiondata(nodeorrev)
2675 return self._revisiondata(nodeorrev)
2864
2676
2865 def sidedata(self, nodeorrev):
2677 def sidedata(self, nodeorrev):
2866 """a map of extra data related to the changeset but not part of the hash
2678 """a map of extra data related to the changeset but not part of the hash
2867
2679
2868 This function currently return a dictionary. However, more advanced
2680 This function currently return a dictionary. However, more advanced
2869 mapping object will likely be used in the future for a more
2681 mapping object will likely be used in the future for a more
2870 efficient/lazy code.
2682 efficient/lazy code.
2871 """
2683 """
2872 # deal with <nodeorrev> argument type
2684 # deal with <nodeorrev> argument type
2873 if isinstance(nodeorrev, int):
2685 if isinstance(nodeorrev, int):
2874 rev = nodeorrev
2686 rev = nodeorrev
2875 else:
2687 else:
2876 rev = self.rev(nodeorrev)
2688 rev = self.rev(nodeorrev)
2877 return self._sidedata(rev)
2689 return self._sidedata(rev)
2878
2690
2879 def _rawtext(self, node, rev):
2691 def _rawtext(self, node, rev):
2880 """return the possibly unvalidated rawtext for a revision
2692 """return the possibly unvalidated rawtext for a revision
2881
2693
2882 returns (rev, rawtext, validated)
2694 returns (rev, rawtext, validated)
2883 """
2695 """
2884 # Check if we have the entry in cache
2696 # Check if we have the entry in cache
2885 # The cache entry looks like (node, rev, rawtext)
2697 # The cache entry looks like (node, rev, rawtext)
2886 if self._inner._revisioncache:
2698 if self._inner._revisioncache:
2887 if self._inner._revisioncache[0] == node:
2699 if self._inner._revisioncache[0] == node:
2888 return (rev, self._inner._revisioncache[2], True)
2700 return (rev, self._inner._revisioncache[2], True)
2889
2701
2890 if rev is None:
2702 if rev is None:
2891 rev = self.rev(node)
2703 rev = self.rev(node)
2892
2704
2893 return self._inner.raw_text(node, rev)
2705 return self._inner.raw_text(node, rev)
2894
2706
2895 def _revisiondata(self, nodeorrev, raw=False):
2707 def _revisiondata(self, nodeorrev, raw=False):
2896 # deal with <nodeorrev> argument type
2708 # deal with <nodeorrev> argument type
2897 if isinstance(nodeorrev, int):
2709 if isinstance(nodeorrev, int):
2898 rev = nodeorrev
2710 rev = nodeorrev
2899 node = self.node(rev)
2711 node = self.node(rev)
2900 else:
2712 else:
2901 node = nodeorrev
2713 node = nodeorrev
2902 rev = None
2714 rev = None
2903
2715
2904 # fast path the special `nullid` rev
2716 # fast path the special `nullid` rev
2905 if node == self.nullid:
2717 if node == self.nullid:
2906 return b""
2718 return b""
2907
2719
2908 # ``rawtext`` is the text as stored inside the revlog. Might be the
2720 # ``rawtext`` is the text as stored inside the revlog. Might be the
2909 # revision or might need to be processed to retrieve the revision.
2721 # revision or might need to be processed to retrieve the revision.
2910 rev, rawtext, validated = self._rawtext(node, rev)
2722 rev, rawtext, validated = self._rawtext(node, rev)
2911
2723
2912 if raw and validated:
2724 if raw and validated:
2913 # if we don't want to process the raw text and that raw
2725 # if we don't want to process the raw text and that raw
2914 # text is cached, we can exit early.
2726 # text is cached, we can exit early.
2915 return rawtext
2727 return rawtext
2916 if rev is None:
2728 if rev is None:
2917 rev = self.rev(node)
2729 rev = self.rev(node)
2918 # the revlog's flag for this revision
2730 # the revlog's flag for this revision
2919 # (usually alter its state or content)
2731 # (usually alter its state or content)
2920 flags = self.flags(rev)
2732 flags = self.flags(rev)
2921
2733
2922 if validated and flags == REVIDX_DEFAULT_FLAGS:
2734 if validated and flags == REVIDX_DEFAULT_FLAGS:
2923 # no extra flags set, no flag processor runs, text = rawtext
2735 # no extra flags set, no flag processor runs, text = rawtext
2924 return rawtext
2736 return rawtext
2925
2737
2926 if raw:
2738 if raw:
2927 validatehash = flagutil.processflagsraw(self, rawtext, flags)
2739 validatehash = flagutil.processflagsraw(self, rawtext, flags)
2928 text = rawtext
2740 text = rawtext
2929 else:
2741 else:
2930 r = flagutil.processflagsread(self, rawtext, flags)
2742 r = flagutil.processflagsread(self, rawtext, flags)
2931 text, validatehash = r
2743 text, validatehash = r
2932 if validatehash:
2744 if validatehash:
2933 self.checkhash(text, node, rev=rev)
2745 self.checkhash(text, node, rev=rev)
2934 if not validated:
2746 if not validated:
2935 self._inner._revisioncache = (node, rev, rawtext)
2747 self._inner._revisioncache = (node, rev, rawtext)
2936
2748
2937 return text
2749 return text
2938
2750
2939 def _sidedata(self, rev):
2751 def _sidedata(self, rev):
2940 """Return the sidedata for a given revision number."""
2752 """Return the sidedata for a given revision number."""
2941 sidedata_end = None
2753 sidedata_end = None
2942 if self._docket is not None:
2754 if self._docket is not None:
2943 sidedata_end = self._docket.sidedata_end
2755 sidedata_end = self._docket.sidedata_end
2944 return self._inner.sidedata(rev, sidedata_end)
2756 return self._inner.sidedata(rev, sidedata_end)
2945
2757
2946 def rawdata(self, nodeorrev):
2758 def rawdata(self, nodeorrev):
2947 """return an uncompressed raw data of a given node or revision number."""
2759 """return an uncompressed raw data of a given node or revision number."""
2948 return self._revisiondata(nodeorrev, raw=True)
2760 return self._revisiondata(nodeorrev, raw=True)
2949
2761
2950 def hash(self, text, p1, p2):
2762 def hash(self, text, p1, p2):
2951 """Compute a node hash.
2763 """Compute a node hash.
2952
2764
2953 Available as a function so that subclasses can replace the hash
2765 Available as a function so that subclasses can replace the hash
2954 as needed.
2766 as needed.
2955 """
2767 """
2956 return storageutil.hashrevisionsha1(text, p1, p2)
2768 return storageutil.hashrevisionsha1(text, p1, p2)
2957
2769
2958 def checkhash(self, text, node, p1=None, p2=None, rev=None):
2770 def checkhash(self, text, node, p1=None, p2=None, rev=None):
2959 """Check node hash integrity.
2771 """Check node hash integrity.
2960
2772
2961 Available as a function so that subclasses can extend hash mismatch
2773 Available as a function so that subclasses can extend hash mismatch
2962 behaviors as needed.
2774 behaviors as needed.
2963 """
2775 """
2964 try:
2776 try:
2965 if p1 is None and p2 is None:
2777 if p1 is None and p2 is None:
2966 p1, p2 = self.parents(node)
2778 p1, p2 = self.parents(node)
2967 if node != self.hash(text, p1, p2):
2779 if node != self.hash(text, p1, p2):
2968 # Clear the revision cache on hash failure. The revision cache
2780 # Clear the revision cache on hash failure. The revision cache
2969 # only stores the raw revision and clearing the cache does have
2781 # only stores the raw revision and clearing the cache does have
2970 # the side-effect that we won't have a cache hit when the raw
2782 # the side-effect that we won't have a cache hit when the raw
2971 # revision data is accessed. But this case should be rare and
2783 # revision data is accessed. But this case should be rare and
2972 # it is extra work to teach the cache about the hash
2784 # it is extra work to teach the cache about the hash
2973 # verification state.
2785 # verification state.
2974 if (
2786 if (
2975 self._inner._revisioncache
2787 self._inner._revisioncache
2976 and self._inner._revisioncache[0] == node
2788 and self._inner._revisioncache[0] == node
2977 ):
2789 ):
2978 self._inner._revisioncache = None
2790 self._inner._revisioncache = None
2979
2791
2980 revornode = rev
2792 revornode = rev
2981 if revornode is None:
2793 if revornode is None:
2982 revornode = templatefilters.short(hex(node))
2794 revornode = templatefilters.short(hex(node))
2983 raise error.RevlogError(
2795 raise error.RevlogError(
2984 _(b"integrity check failed on %s:%s")
2796 _(b"integrity check failed on %s:%s")
2985 % (self.display_id, pycompat.bytestr(revornode))
2797 % (self.display_id, pycompat.bytestr(revornode))
2986 )
2798 )
2987 except error.RevlogError:
2799 except error.RevlogError:
2988 if self.feature_config.censorable and storageutil.iscensoredtext(
2800 if self.feature_config.censorable and storageutil.iscensoredtext(
2989 text
2801 text
2990 ):
2802 ):
2991 raise error.CensoredNodeError(self.display_id, node, text)
2803 raise error.CensoredNodeError(self.display_id, node, text)
2992 raise
2804 raise
2993
2805
2994 @property
2806 @property
2995 def _split_index_file(self):
2807 def _split_index_file(self):
2996 """the path where to expect the index of an ongoing splitting operation
2808 """the path where to expect the index of an ongoing splitting operation
2997
2809
2998 The file will only exist if a splitting operation is in progress, but
2810 The file will only exist if a splitting operation is in progress, but
2999 it is always expected at the same location."""
2811 it is always expected at the same location."""
3000 parts = self.radix.split(b'/')
2812 parts = self.radix.split(b'/')
3001 if len(parts) > 1:
2813 if len(parts) > 1:
3002 # adds a '-s' prefix to the ``data/` or `meta/` base
2814 # adds a '-s' prefix to the ``data/` or `meta/` base
3003 head = parts[0] + b'-s'
2815 head = parts[0] + b'-s'
3004 mids = parts[1:-1]
2816 mids = parts[1:-1]
3005 tail = parts[-1] + b'.i'
2817 tail = parts[-1] + b'.i'
3006 pieces = [head] + mids + [tail]
2818 pieces = [head] + mids + [tail]
3007 return b'/'.join(pieces)
2819 return b'/'.join(pieces)
3008 else:
2820 else:
3009 # the revlog is stored at the root of the store (changelog or
2821 # the revlog is stored at the root of the store (changelog or
3010 # manifest), no risk of collision.
2822 # manifest), no risk of collision.
3011 return self.radix + b'.i.s'
2823 return self.radix + b'.i.s'
3012
2824
3013 def _enforceinlinesize(self, tr, side_write=True):
2825 def _enforceinlinesize(self, tr, side_write=True):
3014 """Check if the revlog is too big for inline and convert if so.
2826 """Check if the revlog is too big for inline and convert if so.
3015
2827
3016 This should be called after revisions are added to the revlog. If the
2828 This should be called after revisions are added to the revlog. If the
3017 revlog has grown too large to be an inline revlog, it will convert it
2829 revlog has grown too large to be an inline revlog, it will convert it
3018 to use multiple index and data files.
2830 to use multiple index and data files.
3019 """
2831 """
3020 tiprev = len(self) - 1
2832 tiprev = len(self) - 1
3021 total_size = self.start(tiprev) + self.length(tiprev)
2833 total_size = self.start(tiprev) + self.length(tiprev)
3022 if not self._inline or total_size < _maxinline:
2834 if not self._inline or total_size < _maxinline:
3023 return
2835 return
3024
2836
3025 if self._docket is not None:
2837 if self._docket is not None:
3026 msg = b"inline revlog should not have a docket"
2838 msg = b"inline revlog should not have a docket"
3027 raise error.ProgrammingError(msg)
2839 raise error.ProgrammingError(msg)
3028
2840
2841 # In the common case, we enforce inline size because the revlog has
2842 # been appened too. And in such case, it must have an initial offset
2843 # recorded in the transaction.
3029 troffset = tr.findoffset(self._inner.canonical_index_file)
2844 troffset = tr.findoffset(self._inner.canonical_index_file)
3030 if troffset is None:
2845 pre_touched = troffset is not None
2846 if not pre_touched and self.target[0] != KIND_CHANGELOG:
3031 raise error.RevlogError(
2847 raise error.RevlogError(
3032 _(b"%s not found in the transaction") % self._indexfile
2848 _(b"%s not found in the transaction") % self._indexfile
3033 )
2849 )
3034 if troffset:
2850
3035 tr.addbackup(self._inner.canonical_index_file, for_offset=True)
2851 tr.addbackup(self._inner.canonical_index_file, for_offset=pre_touched)
3036 tr.add(self._datafile, 0)
2852 tr.add(self._datafile, 0)
3037
2853
3038 new_index_file_path = None
2854 new_index_file_path = None
3039 if side_write:
2855 if side_write:
3040 old_index_file_path = self._indexfile
2856 old_index_file_path = self._indexfile
3041 new_index_file_path = self._split_index_file
2857 new_index_file_path = self._split_index_file
3042 opener = self.opener
2858 opener = self.opener
3043 weak_self = weakref.ref(self)
2859 weak_self = weakref.ref(self)
3044
2860
3045 # the "split" index replace the real index when the transaction is
2861 # the "split" index replace the real index when the transaction is
3046 # finalized
2862 # finalized
3047 def finalize_callback(tr):
2863 def finalize_callback(tr):
3048 opener.rename(
2864 opener.rename(
3049 new_index_file_path,
2865 new_index_file_path,
3050 old_index_file_path,
2866 old_index_file_path,
3051 checkambig=True,
2867 checkambig=True,
3052 )
2868 )
3053 maybe_self = weak_self()
2869 maybe_self = weak_self()
3054 if maybe_self is not None:
2870 if maybe_self is not None:
3055 maybe_self._indexfile = old_index_file_path
2871 maybe_self._indexfile = old_index_file_path
3056 maybe_self._inner.index_file = maybe_self._indexfile
2872 maybe_self._inner.index_file = maybe_self._indexfile
3057
2873
3058 def abort_callback(tr):
2874 def abort_callback(tr):
3059 maybe_self = weak_self()
2875 maybe_self = weak_self()
3060 if maybe_self is not None:
2876 if maybe_self is not None:
3061 maybe_self._indexfile = old_index_file_path
2877 maybe_self._indexfile = old_index_file_path
3062 maybe_self._inner.inline = True
2878 maybe_self._inner.inline = True
3063 maybe_self._inner.index_file = old_index_file_path
2879 maybe_self._inner.index_file = old_index_file_path
3064
2880
3065 tr.registertmp(new_index_file_path)
2881 tr.registertmp(new_index_file_path)
3066 if self.target[1] is not None:
2882 if self.target[1] is not None:
3067 callback_id = b'000-revlog-split-%d-%s' % self.target
2883 callback_id = b'000-revlog-split-%d-%s' % self.target
3068 else:
2884 else:
3069 callback_id = b'000-revlog-split-%d' % self.target[0]
2885 callback_id = b'000-revlog-split-%d' % self.target[0]
3070 tr.addfinalize(callback_id, finalize_callback)
2886 tr.addfinalize(callback_id, finalize_callback)
3071 tr.addabort(callback_id, abort_callback)
2887 tr.addabort(callback_id, abort_callback)
3072
2888
3073 self._format_flags &= ~FLAG_INLINE_DATA
2889 self._format_flags &= ~FLAG_INLINE_DATA
3074 self._inner.split_inline(
2890 self._inner.split_inline(
3075 tr,
2891 tr,
3076 self._format_flags | self._format_version,
2892 self._format_flags | self._format_version,
3077 new_index_file_path=new_index_file_path,
2893 new_index_file_path=new_index_file_path,
3078 )
2894 )
3079
2895
3080 self._inline = False
2896 self._inline = False
3081 if new_index_file_path is not None:
2897 if new_index_file_path is not None:
3082 self._indexfile = new_index_file_path
2898 self._indexfile = new_index_file_path
3083
2899
3084 nodemaputil.setup_persistent_nodemap(tr, self)
2900 nodemaputil.setup_persistent_nodemap(tr, self)
3085
2901
3086 def _nodeduplicatecallback(self, transaction, node):
2902 def _nodeduplicatecallback(self, transaction, node):
3087 """called when trying to add a node already stored."""
2903 """called when trying to add a node already stored."""
3088
2904
3089 @contextlib.contextmanager
2905 @contextlib.contextmanager
3090 def reading(self):
2906 def reading(self):
3091 with self._inner.reading():
2907 with self._inner.reading():
3092 yield
2908 yield
3093
2909
3094 @contextlib.contextmanager
2910 @contextlib.contextmanager
3095 def _writing(self, transaction):
2911 def _writing(self, transaction):
3096 if self._trypending:
2912 if self._trypending:
3097 msg = b'try to write in a `trypending` revlog: %s'
2913 msg = b'try to write in a `trypending` revlog: %s'
3098 msg %= self.display_id
2914 msg %= self.display_id
3099 raise error.ProgrammingError(msg)
2915 raise error.ProgrammingError(msg)
3100 if self._inner.is_writing:
2916 if self._inner.is_writing:
3101 yield
2917 yield
3102 else:
2918 else:
3103 data_end = None
2919 data_end = None
3104 sidedata_end = None
2920 sidedata_end = None
3105 if self._docket is not None:
2921 if self._docket is not None:
3106 data_end = self._docket.data_end
2922 data_end = self._docket.data_end
3107 sidedata_end = self._docket.sidedata_end
2923 sidedata_end = self._docket.sidedata_end
3108 with self._inner.writing(
2924 with self._inner.writing(
3109 transaction,
2925 transaction,
3110 data_end=data_end,
2926 data_end=data_end,
3111 sidedata_end=sidedata_end,
2927 sidedata_end=sidedata_end,
3112 ):
2928 ):
3113 yield
2929 yield
3114 if self._docket is not None:
2930 if self._docket is not None:
3115 self._write_docket(transaction)
2931 self._write_docket(transaction)
3116
2932
3117 @property
2933 @property
3118 def is_delaying(self):
2934 def is_delaying(self):
3119 return self._inner.is_delaying
2935 return self._inner.is_delaying
3120
2936
3121 def _write_docket(self, transaction):
2937 def _write_docket(self, transaction):
3122 """write the current docket on disk
2938 """write the current docket on disk
3123
2939
3124 Exist as a method to help changelog to implement transaction logic
2940 Exist as a method to help changelog to implement transaction logic
3125
2941
3126 We could also imagine using the same transaction logic for all revlog
2942 We could also imagine using the same transaction logic for all revlog
3127 since docket are cheap."""
2943 since docket are cheap."""
3128 self._docket.write(transaction)
2944 self._docket.write(transaction)
3129
2945
3130 def addrevision(
2946 def addrevision(
3131 self,
2947 self,
3132 text,
2948 text,
3133 transaction,
2949 transaction,
3134 link,
2950 link,
3135 p1,
2951 p1,
3136 p2,
2952 p2,
3137 cachedelta=None,
2953 cachedelta=None,
3138 node=None,
2954 node=None,
3139 flags=REVIDX_DEFAULT_FLAGS,
2955 flags=REVIDX_DEFAULT_FLAGS,
3140 deltacomputer=None,
2956 deltacomputer=None,
3141 sidedata=None,
2957 sidedata=None,
3142 ):
2958 ):
3143 """add a revision to the log
2959 """add a revision to the log
3144
2960
3145 text - the revision data to add
2961 text - the revision data to add
3146 transaction - the transaction object used for rollback
2962 transaction - the transaction object used for rollback
3147 link - the linkrev data to add
2963 link - the linkrev data to add
3148 p1, p2 - the parent nodeids of the revision
2964 p1, p2 - the parent nodeids of the revision
3149 cachedelta - an optional precomputed delta
2965 cachedelta - an optional precomputed delta
3150 node - nodeid of revision; typically node is not specified, and it is
2966 node - nodeid of revision; typically node is not specified, and it is
3151 computed by default as hash(text, p1, p2), however subclasses might
2967 computed by default as hash(text, p1, p2), however subclasses might
3152 use different hashing method (and override checkhash() in such case)
2968 use different hashing method (and override checkhash() in such case)
3153 flags - the known flags to set on the revision
2969 flags - the known flags to set on the revision
3154 deltacomputer - an optional deltacomputer instance shared between
2970 deltacomputer - an optional deltacomputer instance shared between
3155 multiple calls
2971 multiple calls
3156 """
2972 """
3157 if link == nullrev:
2973 if link == nullrev:
3158 raise error.RevlogError(
2974 raise error.RevlogError(
3159 _(b"attempted to add linkrev -1 to %s") % self.display_id
2975 _(b"attempted to add linkrev -1 to %s") % self.display_id
3160 )
2976 )
3161
2977
3162 if sidedata is None:
2978 if sidedata is None:
3163 sidedata = {}
2979 sidedata = {}
3164 elif sidedata and not self.feature_config.has_side_data:
2980 elif sidedata and not self.feature_config.has_side_data:
3165 raise error.ProgrammingError(
2981 raise error.ProgrammingError(
3166 _(b"trying to add sidedata to a revlog who don't support them")
2982 _(b"trying to add sidedata to a revlog who don't support them")
3167 )
2983 )
3168
2984
3169 if flags:
2985 if flags:
3170 node = node or self.hash(text, p1, p2)
2986 node = node or self.hash(text, p1, p2)
3171
2987
3172 rawtext, validatehash = flagutil.processflagswrite(self, text, flags)
2988 rawtext, validatehash = flagutil.processflagswrite(self, text, flags)
3173
2989
3174 # If the flag processor modifies the revision data, ignore any provided
2990 # If the flag processor modifies the revision data, ignore any provided
3175 # cachedelta.
2991 # cachedelta.
3176 if rawtext != text:
2992 if rawtext != text:
3177 cachedelta = None
2993 cachedelta = None
3178
2994
3179 if len(rawtext) > _maxentrysize:
2995 if len(rawtext) > _maxentrysize:
3180 raise error.RevlogError(
2996 raise error.RevlogError(
3181 _(
2997 _(
3182 b"%s: size of %d bytes exceeds maximum revlog storage of 2GiB"
2998 b"%s: size of %d bytes exceeds maximum revlog storage of 2GiB"
3183 )
2999 )
3184 % (self.display_id, len(rawtext))
3000 % (self.display_id, len(rawtext))
3185 )
3001 )
3186
3002
3187 node = node or self.hash(rawtext, p1, p2)
3003 node = node or self.hash(rawtext, p1, p2)
3188 rev = self.index.get_rev(node)
3004 rev = self.index.get_rev(node)
3189 if rev is not None:
3005 if rev is not None:
3190 return rev
3006 return rev
3191
3007
3192 if validatehash:
3008 if validatehash:
3193 self.checkhash(rawtext, node, p1=p1, p2=p2)
3009 self.checkhash(rawtext, node, p1=p1, p2=p2)
3194
3010
3195 return self.addrawrevision(
3011 return self.addrawrevision(
3196 rawtext,
3012 rawtext,
3197 transaction,
3013 transaction,
3198 link,
3014 link,
3199 p1,
3015 p1,
3200 p2,
3016 p2,
3201 node,
3017 node,
3202 flags,
3018 flags,
3203 cachedelta=cachedelta,
3019 cachedelta=cachedelta,
3204 deltacomputer=deltacomputer,
3020 deltacomputer=deltacomputer,
3205 sidedata=sidedata,
3021 sidedata=sidedata,
3206 )
3022 )
3207
3023
3208 def addrawrevision(
3024 def addrawrevision(
3209 self,
3025 self,
3210 rawtext,
3026 rawtext,
3211 transaction,
3027 transaction,
3212 link,
3028 link,
3213 p1,
3029 p1,
3214 p2,
3030 p2,
3215 node,
3031 node,
3216 flags,
3032 flags,
3217 cachedelta=None,
3033 cachedelta=None,
3218 deltacomputer=None,
3034 deltacomputer=None,
3219 sidedata=None,
3035 sidedata=None,
3220 ):
3036 ):
3221 """add a raw revision with known flags, node and parents
3037 """add a raw revision with known flags, node and parents
3222 useful when reusing a revision not stored in this revlog (ex: received
3038 useful when reusing a revision not stored in this revlog (ex: received
3223 over wire, or read from an external bundle).
3039 over wire, or read from an external bundle).
3224 """
3040 """
3225 with self._writing(transaction):
3041 with self._writing(transaction):
3226 return self._addrevision(
3042 return self._addrevision(
3227 node,
3043 node,
3228 rawtext,
3044 rawtext,
3229 transaction,
3045 transaction,
3230 link,
3046 link,
3231 p1,
3047 p1,
3232 p2,
3048 p2,
3233 flags,
3049 flags,
3234 cachedelta,
3050 cachedelta,
3235 deltacomputer=deltacomputer,
3051 deltacomputer=deltacomputer,
3236 sidedata=sidedata,
3052 sidedata=sidedata,
3237 )
3053 )
3238
3054
3239 def compress(self, data):
3055 def compress(self, data):
3240 return self._inner.compress(data)
3056 return self._inner.compress(data)
3241
3057
3242 def decompress(self, data):
3058 def decompress(self, data):
3243 return self._inner.decompress(data)
3059 return self._inner.decompress(data)
3244
3060
3245 def _addrevision(
3061 def _addrevision(
3246 self,
3062 self,
3247 node,
3063 node,
3248 rawtext,
3064 rawtext,
3249 transaction,
3065 transaction,
3250 link,
3066 link,
3251 p1,
3067 p1,
3252 p2,
3068 p2,
3253 flags,
3069 flags,
3254 cachedelta,
3070 cachedelta,
3255 alwayscache=False,
3071 alwayscache=False,
3256 deltacomputer=None,
3072 deltacomputer=None,
3257 sidedata=None,
3073 sidedata=None,
3258 ):
3074 ):
3259 """internal function to add revisions to the log
3075 """internal function to add revisions to the log
3260
3076
3261 see addrevision for argument descriptions.
3077 see addrevision for argument descriptions.
3262
3078
3263 note: "addrevision" takes non-raw text, "_addrevision" takes raw text.
3079 note: "addrevision" takes non-raw text, "_addrevision" takes raw text.
3264
3080
3265 if "deltacomputer" is not provided or None, a defaultdeltacomputer will
3081 if "deltacomputer" is not provided or None, a defaultdeltacomputer will
3266 be used.
3082 be used.
3267
3083
3268 invariants:
3084 invariants:
3269 - rawtext is optional (can be None); if not set, cachedelta must be set.
3085 - rawtext is optional (can be None); if not set, cachedelta must be set.
3270 if both are set, they must correspond to each other.
3086 if both are set, they must correspond to each other.
3271 """
3087 """
3272 if node == self.nullid:
3088 if node == self.nullid:
3273 raise error.RevlogError(
3089 raise error.RevlogError(
3274 _(b"%s: attempt to add null revision") % self.display_id
3090 _(b"%s: attempt to add null revision") % self.display_id
3275 )
3091 )
3276 if (
3092 if (
3277 node == self.nodeconstants.wdirid
3093 node == self.nodeconstants.wdirid
3278 or node in self.nodeconstants.wdirfilenodeids
3094 or node in self.nodeconstants.wdirfilenodeids
3279 ):
3095 ):
3280 raise error.RevlogError(
3096 raise error.RevlogError(
3281 _(b"%s: attempt to add wdir revision") % self.display_id
3097 _(b"%s: attempt to add wdir revision") % self.display_id
3282 )
3098 )
3283 if self._inner._writinghandles is None:
3099 if self._inner._writinghandles is None:
3284 msg = b'adding revision outside `revlog._writing` context'
3100 msg = b'adding revision outside `revlog._writing` context'
3285 raise error.ProgrammingError(msg)
3101 raise error.ProgrammingError(msg)
3286
3102
3287 btext = [rawtext]
3103 btext = [rawtext]
3288
3104
3289 curr = len(self)
3105 curr = len(self)
3290 prev = curr - 1
3106 prev = curr - 1
3291
3107
3292 offset = self._get_data_offset(prev)
3108 offset = self._get_data_offset(prev)
3293
3109
3294 if self._concurrencychecker:
3110 if self._concurrencychecker:
3295 ifh, dfh, sdfh = self._inner._writinghandles
3111 ifh, dfh, sdfh = self._inner._writinghandles
3296 # XXX no checking for the sidedata file
3112 # XXX no checking for the sidedata file
3297 if self._inline:
3113 if self._inline:
3298 # offset is "as if" it were in the .d file, so we need to add on
3114 # offset is "as if" it were in the .d file, so we need to add on
3299 # the size of the entry metadata.
3115 # the size of the entry metadata.
3300 self._concurrencychecker(
3116 self._concurrencychecker(
3301 ifh, self._indexfile, offset + curr * self.index.entry_size
3117 ifh, self._indexfile, offset + curr * self.index.entry_size
3302 )
3118 )
3303 else:
3119 else:
3304 # Entries in the .i are a consistent size.
3120 # Entries in the .i are a consistent size.
3305 self._concurrencychecker(
3121 self._concurrencychecker(
3306 ifh, self._indexfile, curr * self.index.entry_size
3122 ifh, self._indexfile, curr * self.index.entry_size
3307 )
3123 )
3308 self._concurrencychecker(dfh, self._datafile, offset)
3124 self._concurrencychecker(dfh, self._datafile, offset)
3309
3125
3310 p1r, p2r = self.rev(p1), self.rev(p2)
3126 p1r, p2r = self.rev(p1), self.rev(p2)
3311
3127
3312 # full versions are inserted when the needed deltas
3128 # full versions are inserted when the needed deltas
3313 # become comparable to the uncompressed text
3129 # become comparable to the uncompressed text
3314 if rawtext is None:
3130 if rawtext is None:
3315 # need rawtext size, before changed by flag processors, which is
3131 # need rawtext size, before changed by flag processors, which is
3316 # the non-raw size. use revlog explicitly to avoid filelog's extra
3132 # the non-raw size. use revlog explicitly to avoid filelog's extra
3317 # logic that might remove metadata size.
3133 # logic that might remove metadata size.
3318 textlen = mdiff.patchedsize(
3134 textlen = mdiff.patchedsize(
3319 revlog.size(self, cachedelta[0]), cachedelta[1]
3135 revlog.size(self, cachedelta[0]), cachedelta[1]
3320 )
3136 )
3321 else:
3137 else:
3322 textlen = len(rawtext)
3138 textlen = len(rawtext)
3323
3139
3324 if deltacomputer is None:
3140 if deltacomputer is None:
3325 write_debug = None
3141 write_debug = None
3326 if self.delta_config.debug_delta:
3142 if self.delta_config.debug_delta:
3327 write_debug = transaction._report
3143 write_debug = transaction._report
3328 deltacomputer = deltautil.deltacomputer(
3144 deltacomputer = deltautil.deltacomputer(
3329 self, write_debug=write_debug
3145 self, write_debug=write_debug
3330 )
3146 )
3331
3147
3332 if cachedelta is not None and len(cachedelta) == 2:
3148 if cachedelta is not None and len(cachedelta) == 2:
3333 # If the cached delta has no information about how it should be
3149 # If the cached delta has no information about how it should be
3334 # reused, add the default reuse instruction according to the
3150 # reused, add the default reuse instruction according to the
3335 # revlog's configuration.
3151 # revlog's configuration.
3336 if (
3152 if (
3337 self.delta_config.general_delta
3153 self.delta_config.general_delta
3338 and self.delta_config.lazy_delta_base
3154 and self.delta_config.lazy_delta_base
3339 ):
3155 ):
3340 delta_base_reuse = DELTA_BASE_REUSE_TRY
3156 delta_base_reuse = DELTA_BASE_REUSE_TRY
3341 else:
3157 else:
3342 delta_base_reuse = DELTA_BASE_REUSE_NO
3158 delta_base_reuse = DELTA_BASE_REUSE_NO
3343 cachedelta = (cachedelta[0], cachedelta[1], delta_base_reuse)
3159 cachedelta = (cachedelta[0], cachedelta[1], delta_base_reuse)
3344
3160
3345 revinfo = revlogutils.revisioninfo(
3161 revinfo = revlogutils.revisioninfo(
3346 node,
3162 node,
3347 p1,
3163 p1,
3348 p2,
3164 p2,
3349 btext,
3165 btext,
3350 textlen,
3166 textlen,
3351 cachedelta,
3167 cachedelta,
3352 flags,
3168 flags,
3353 )
3169 )
3354
3170
3355 deltainfo = deltacomputer.finddeltainfo(revinfo)
3171 deltainfo = deltacomputer.finddeltainfo(revinfo)
3356
3172
3357 compression_mode = COMP_MODE_INLINE
3173 compression_mode = COMP_MODE_INLINE
3358 if self._docket is not None:
3174 if self._docket is not None:
3359 default_comp = self._docket.default_compression_header
3175 default_comp = self._docket.default_compression_header
3360 r = deltautil.delta_compression(default_comp, deltainfo)
3176 r = deltautil.delta_compression(default_comp, deltainfo)
3361 compression_mode, deltainfo = r
3177 compression_mode, deltainfo = r
3362
3178
3363 sidedata_compression_mode = COMP_MODE_INLINE
3179 sidedata_compression_mode = COMP_MODE_INLINE
3364 if sidedata and self.feature_config.has_side_data:
3180 if sidedata and self.feature_config.has_side_data:
3365 sidedata_compression_mode = COMP_MODE_PLAIN
3181 sidedata_compression_mode = COMP_MODE_PLAIN
3366 serialized_sidedata = sidedatautil.serialize_sidedata(sidedata)
3182 serialized_sidedata = sidedatautil.serialize_sidedata(sidedata)
3367 sidedata_offset = self._docket.sidedata_end
3183 sidedata_offset = self._docket.sidedata_end
3368 h, comp_sidedata = self._inner.compress(serialized_sidedata)
3184 h, comp_sidedata = self._inner.compress(serialized_sidedata)
3369 if (
3185 if (
3370 h != b'u'
3186 h != b'u'
3371 and comp_sidedata[0:1] != b'\0'
3187 and comp_sidedata[0:1] != b'\0'
3372 and len(comp_sidedata) < len(serialized_sidedata)
3188 and len(comp_sidedata) < len(serialized_sidedata)
3373 ):
3189 ):
3374 assert not h
3190 assert not h
3375 if (
3191 if (
3376 comp_sidedata[0:1]
3192 comp_sidedata[0:1]
3377 == self._docket.default_compression_header
3193 == self._docket.default_compression_header
3378 ):
3194 ):
3379 sidedata_compression_mode = COMP_MODE_DEFAULT
3195 sidedata_compression_mode = COMP_MODE_DEFAULT
3380 serialized_sidedata = comp_sidedata
3196 serialized_sidedata = comp_sidedata
3381 else:
3197 else:
3382 sidedata_compression_mode = COMP_MODE_INLINE
3198 sidedata_compression_mode = COMP_MODE_INLINE
3383 serialized_sidedata = comp_sidedata
3199 serialized_sidedata = comp_sidedata
3384 else:
3200 else:
3385 serialized_sidedata = b""
3201 serialized_sidedata = b""
3386 # Don't store the offset if the sidedata is empty, that way
3202 # Don't store the offset if the sidedata is empty, that way
3387 # we can easily detect empty sidedata and they will be no different
3203 # we can easily detect empty sidedata and they will be no different
3388 # than ones we manually add.
3204 # than ones we manually add.
3389 sidedata_offset = 0
3205 sidedata_offset = 0
3390
3206
3391 rank = RANK_UNKNOWN
3207 rank = RANK_UNKNOWN
3392 if self.feature_config.compute_rank:
3208 if self.feature_config.compute_rank:
3393 if (p1r, p2r) == (nullrev, nullrev):
3209 if (p1r, p2r) == (nullrev, nullrev):
3394 rank = 1
3210 rank = 1
3395 elif p1r != nullrev and p2r == nullrev:
3211 elif p1r != nullrev and p2r == nullrev:
3396 rank = 1 + self.fast_rank(p1r)
3212 rank = 1 + self.fast_rank(p1r)
3397 elif p1r == nullrev and p2r != nullrev:
3213 elif p1r == nullrev and p2r != nullrev:
3398 rank = 1 + self.fast_rank(p2r)
3214 rank = 1 + self.fast_rank(p2r)
3399 else: # merge node
3215 else: # merge node
3400 if rustdagop is not None and self.index.rust_ext_compat:
3216 if rustdagop is not None and self.index.rust_ext_compat:
3401 rank = rustdagop.rank(self.index, p1r, p2r)
3217 rank = rustdagop.rank(self.index, p1r, p2r)
3402 else:
3218 else:
3403 pmin, pmax = sorted((p1r, p2r))
3219 pmin, pmax = sorted((p1r, p2r))
3404 rank = 1 + self.fast_rank(pmax)
3220 rank = 1 + self.fast_rank(pmax)
3405 rank += sum(1 for _ in self.findmissingrevs([pmax], [pmin]))
3221 rank += sum(1 for _ in self.findmissingrevs([pmax], [pmin]))
3406
3222
3407 e = revlogutils.entry(
3223 e = revlogutils.entry(
3408 flags=flags,
3224 flags=flags,
3409 data_offset=offset,
3225 data_offset=offset,
3410 data_compressed_length=deltainfo.deltalen,
3226 data_compressed_length=deltainfo.deltalen,
3411 data_uncompressed_length=textlen,
3227 data_uncompressed_length=textlen,
3412 data_compression_mode=compression_mode,
3228 data_compression_mode=compression_mode,
3413 data_delta_base=deltainfo.base,
3229 data_delta_base=deltainfo.base,
3414 link_rev=link,
3230 link_rev=link,
3415 parent_rev_1=p1r,
3231 parent_rev_1=p1r,
3416 parent_rev_2=p2r,
3232 parent_rev_2=p2r,
3417 node_id=node,
3233 node_id=node,
3418 sidedata_offset=sidedata_offset,
3234 sidedata_offset=sidedata_offset,
3419 sidedata_compressed_length=len(serialized_sidedata),
3235 sidedata_compressed_length=len(serialized_sidedata),
3420 sidedata_compression_mode=sidedata_compression_mode,
3236 sidedata_compression_mode=sidedata_compression_mode,
3421 rank=rank,
3237 rank=rank,
3422 )
3238 )
3423
3239
3424 self.index.append(e)
3240 self.index.append(e)
3425 entry = self.index.entry_binary(curr)
3241 entry = self.index.entry_binary(curr)
3426 if curr == 0 and self._docket is None:
3242 if curr == 0 and self._docket is None:
3427 header = self._format_flags | self._format_version
3243 header = self._format_flags | self._format_version
3428 header = self.index.pack_header(header)
3244 header = self.index.pack_header(header)
3429 entry = header + entry
3245 entry = header + entry
3430 self._writeentry(
3246 self._writeentry(
3431 transaction,
3247 transaction,
3432 entry,
3248 entry,
3433 deltainfo.data,
3249 deltainfo.data,
3434 link,
3250 link,
3435 offset,
3251 offset,
3436 serialized_sidedata,
3252 serialized_sidedata,
3437 sidedata_offset,
3253 sidedata_offset,
3438 )
3254 )
3439
3255
3440 rawtext = btext[0]
3256 rawtext = btext[0]
3441
3257
3442 if alwayscache and rawtext is None:
3258 if alwayscache and rawtext is None:
3443 rawtext = deltacomputer.buildtext(revinfo)
3259 rawtext = deltacomputer.buildtext(revinfo)
3444
3260
3445 if type(rawtext) == bytes: # only accept immutable objects
3261 if type(rawtext) == bytes: # only accept immutable objects
3446 self._inner._revisioncache = (node, curr, rawtext)
3262 self._inner._revisioncache = (node, curr, rawtext)
3447 self._chainbasecache[curr] = deltainfo.chainbase
3263 self._chainbasecache[curr] = deltainfo.chainbase
3448 return curr
3264 return curr
3449
3265
3450 def _get_data_offset(self, prev):
3266 def _get_data_offset(self, prev):
3451 """Returns the current offset in the (in-transaction) data file.
3267 """Returns the current offset in the (in-transaction) data file.
3452 Versions < 2 of the revlog can get this 0(1), revlog v2 needs a docket
3268 Versions < 2 of the revlog can get this 0(1), revlog v2 needs a docket
3453 file to store that information: since sidedata can be rewritten to the
3269 file to store that information: since sidedata can be rewritten to the
3454 end of the data file within a transaction, you can have cases where, for
3270 end of the data file within a transaction, you can have cases where, for
3455 example, rev `n` does not have sidedata while rev `n - 1` does, leading
3271 example, rev `n` does not have sidedata while rev `n - 1` does, leading
3456 to `n - 1`'s sidedata being written after `n`'s data.
3272 to `n - 1`'s sidedata being written after `n`'s data.
3457
3273
3458 TODO cache this in a docket file before getting out of experimental."""
3274 TODO cache this in a docket file before getting out of experimental."""
3459 if self._docket is None:
3275 if self._docket is None:
3460 return self.end(prev)
3276 return self.end(prev)
3461 else:
3277 else:
3462 return self._docket.data_end
3278 return self._docket.data_end
3463
3279
3464 def _writeentry(
3280 def _writeentry(
3465 self,
3281 self,
3466 transaction,
3282 transaction,
3467 entry,
3283 entry,
3468 data,
3284 data,
3469 link,
3285 link,
3470 offset,
3286 offset,
3471 sidedata,
3287 sidedata,
3472 sidedata_offset,
3288 sidedata_offset,
3473 ):
3289 ):
3474 # Files opened in a+ mode have inconsistent behavior on various
3290 # Files opened in a+ mode have inconsistent behavior on various
3475 # platforms. Windows requires that a file positioning call be made
3291 # platforms. Windows requires that a file positioning call be made
3476 # when the file handle transitions between reads and writes. See
3292 # when the file handle transitions between reads and writes. See
3477 # 3686fa2b8eee and the mixedfilemodewrapper in windows.py. On other
3293 # 3686fa2b8eee and the mixedfilemodewrapper in windows.py. On other
3478 # platforms, Python or the platform itself can be buggy. Some versions
3294 # platforms, Python or the platform itself can be buggy. Some versions
3479 # of Solaris have been observed to not append at the end of the file
3295 # of Solaris have been observed to not append at the end of the file
3480 # if the file was seeked to before the end. See issue4943 for more.
3296 # if the file was seeked to before the end. See issue4943 for more.
3481 #
3297 #
3482 # We work around this issue by inserting a seek() before writing.
3298 # We work around this issue by inserting a seek() before writing.
3483 # Note: This is likely not necessary on Python 3. However, because
3299 # Note: This is likely not necessary on Python 3. However, because
3484 # the file handle is reused for reads and may be seeked there, we need
3300 # the file handle is reused for reads and may be seeked there, we need
3485 # to be careful before changing this.
3301 # to be careful before changing this.
3486 index_end = data_end = sidedata_end = None
3302 index_end = data_end = sidedata_end = None
3487 if self._docket is not None:
3303 if self._docket is not None:
3488 index_end = self._docket.index_end
3304 index_end = self._docket.index_end
3489 data_end = self._docket.data_end
3305 data_end = self._docket.data_end
3490 sidedata_end = self._docket.sidedata_end
3306 sidedata_end = self._docket.sidedata_end
3491
3307
3492 files_end = self._inner.write_entry(
3308 files_end = self._inner.write_entry(
3493 transaction,
3309 transaction,
3494 entry,
3310 entry,
3495 data,
3311 data,
3496 link,
3312 link,
3497 offset,
3313 offset,
3498 sidedata,
3314 sidedata,
3499 sidedata_offset,
3315 sidedata_offset,
3500 index_end,
3316 index_end,
3501 data_end,
3317 data_end,
3502 sidedata_end,
3318 sidedata_end,
3503 )
3319 )
3504 self._enforceinlinesize(transaction)
3320 self._enforceinlinesize(transaction)
3505 if self._docket is not None:
3321 if self._docket is not None:
3506 self._docket.index_end = files_end[0]
3322 self._docket.index_end = files_end[0]
3507 self._docket.data_end = files_end[1]
3323 self._docket.data_end = files_end[1]
3508 self._docket.sidedata_end = files_end[2]
3324 self._docket.sidedata_end = files_end[2]
3509
3325
3510 nodemaputil.setup_persistent_nodemap(transaction, self)
3326 nodemaputil.setup_persistent_nodemap(transaction, self)
3511
3327
3512 def addgroup(
3328 def addgroup(
3513 self,
3329 self,
3514 deltas,
3330 deltas,
3515 linkmapper,
3331 linkmapper,
3516 transaction,
3332 transaction,
3517 alwayscache=False,
3333 alwayscache=False,
3518 addrevisioncb=None,
3334 addrevisioncb=None,
3519 duplicaterevisioncb=None,
3335 duplicaterevisioncb=None,
3520 debug_info=None,
3336 debug_info=None,
3521 delta_base_reuse_policy=None,
3337 delta_base_reuse_policy=None,
3522 ):
3338 ):
3523 """
3339 """
3524 add a delta group
3340 add a delta group
3525
3341
3526 given a set of deltas, add them to the revision log. the
3342 given a set of deltas, add them to the revision log. the
3527 first delta is against its parent, which should be in our
3343 first delta is against its parent, which should be in our
3528 log, the rest are against the previous delta.
3344 log, the rest are against the previous delta.
3529
3345
3530 If ``addrevisioncb`` is defined, it will be called with arguments of
3346 If ``addrevisioncb`` is defined, it will be called with arguments of
3531 this revlog and the node that was added.
3347 this revlog and the node that was added.
3532 """
3348 """
3533
3349
3534 if self._adding_group:
3350 if self._adding_group:
3535 raise error.ProgrammingError(b'cannot nest addgroup() calls')
3351 raise error.ProgrammingError(b'cannot nest addgroup() calls')
3536
3352
3537 # read the default delta-base reuse policy from revlog config if the
3353 # read the default delta-base reuse policy from revlog config if the
3538 # group did not specify one.
3354 # group did not specify one.
3539 if delta_base_reuse_policy is None:
3355 if delta_base_reuse_policy is None:
3540 if (
3356 if (
3541 self.delta_config.general_delta
3357 self.delta_config.general_delta
3542 and self.delta_config.lazy_delta_base
3358 and self.delta_config.lazy_delta_base
3543 ):
3359 ):
3544 delta_base_reuse_policy = DELTA_BASE_REUSE_TRY
3360 delta_base_reuse_policy = DELTA_BASE_REUSE_TRY
3545 else:
3361 else:
3546 delta_base_reuse_policy = DELTA_BASE_REUSE_NO
3362 delta_base_reuse_policy = DELTA_BASE_REUSE_NO
3547
3363
3548 self._adding_group = True
3364 self._adding_group = True
3549 empty = True
3365 empty = True
3550 try:
3366 try:
3551 with self._writing(transaction):
3367 with self._writing(transaction):
3552 write_debug = None
3368 write_debug = None
3553 if self.delta_config.debug_delta:
3369 if self.delta_config.debug_delta:
3554 write_debug = transaction._report
3370 write_debug = transaction._report
3555 deltacomputer = deltautil.deltacomputer(
3371 deltacomputer = deltautil.deltacomputer(
3556 self,
3372 self,
3557 write_debug=write_debug,
3373 write_debug=write_debug,
3558 debug_info=debug_info,
3374 debug_info=debug_info,
3559 )
3375 )
3560 # loop through our set of deltas
3376 # loop through our set of deltas
3561 for data in deltas:
3377 for data in deltas:
3562 (
3378 (
3563 node,
3379 node,
3564 p1,
3380 p1,
3565 p2,
3381 p2,
3566 linknode,
3382 linknode,
3567 deltabase,
3383 deltabase,
3568 delta,
3384 delta,
3569 flags,
3385 flags,
3570 sidedata,
3386 sidedata,
3571 ) = data
3387 ) = data
3572 link = linkmapper(linknode)
3388 link = linkmapper(linknode)
3573 flags = flags or REVIDX_DEFAULT_FLAGS
3389 flags = flags or REVIDX_DEFAULT_FLAGS
3574
3390
3575 rev = self.index.get_rev(node)
3391 rev = self.index.get_rev(node)
3576 if rev is not None:
3392 if rev is not None:
3577 # this can happen if two branches make the same change
3393 # this can happen if two branches make the same change
3578 self._nodeduplicatecallback(transaction, rev)
3394 self._nodeduplicatecallback(transaction, rev)
3579 if duplicaterevisioncb:
3395 if duplicaterevisioncb:
3580 duplicaterevisioncb(self, rev)
3396 duplicaterevisioncb(self, rev)
3581 empty = False
3397 empty = False
3582 continue
3398 continue
3583
3399
3584 for p in (p1, p2):
3400 for p in (p1, p2):
3585 if not self.index.has_node(p):
3401 if not self.index.has_node(p):
3586 raise error.LookupError(
3402 raise error.LookupError(
3587 p, self.radix, _(b'unknown parent')
3403 p, self.radix, _(b'unknown parent')
3588 )
3404 )
3589
3405
3590 if not self.index.has_node(deltabase):
3406 if not self.index.has_node(deltabase):
3591 raise error.LookupError(
3407 raise error.LookupError(
3592 deltabase, self.display_id, _(b'unknown delta base')
3408 deltabase, self.display_id, _(b'unknown delta base')
3593 )
3409 )
3594
3410
3595 baserev = self.rev(deltabase)
3411 baserev = self.rev(deltabase)
3596
3412
3597 if baserev != nullrev and self.iscensored(baserev):
3413 if baserev != nullrev and self.iscensored(baserev):
3598 # if base is censored, delta must be full replacement in a
3414 # if base is censored, delta must be full replacement in a
3599 # single patch operation
3415 # single patch operation
3600 hlen = struct.calcsize(b">lll")
3416 hlen = struct.calcsize(b">lll")
3601 oldlen = self.rawsize(baserev)
3417 oldlen = self.rawsize(baserev)
3602 newlen = len(delta) - hlen
3418 newlen = len(delta) - hlen
3603 if delta[:hlen] != mdiff.replacediffheader(
3419 if delta[:hlen] != mdiff.replacediffheader(
3604 oldlen, newlen
3420 oldlen, newlen
3605 ):
3421 ):
3606 raise error.CensoredBaseError(
3422 raise error.CensoredBaseError(
3607 self.display_id, self.node(baserev)
3423 self.display_id, self.node(baserev)
3608 )
3424 )
3609
3425
3610 if not flags and self._peek_iscensored(baserev, delta):
3426 if not flags and self._peek_iscensored(baserev, delta):
3611 flags |= REVIDX_ISCENSORED
3427 flags |= REVIDX_ISCENSORED
3612
3428
3613 # We assume consumers of addrevisioncb will want to retrieve
3429 # We assume consumers of addrevisioncb will want to retrieve
3614 # the added revision, which will require a call to
3430 # the added revision, which will require a call to
3615 # revision(). revision() will fast path if there is a cache
3431 # revision(). revision() will fast path if there is a cache
3616 # hit. So, we tell _addrevision() to always cache in this case.
3432 # hit. So, we tell _addrevision() to always cache in this case.
3617 # We're only using addgroup() in the context of changegroup
3433 # We're only using addgroup() in the context of changegroup
3618 # generation so the revision data can always be handled as raw
3434 # generation so the revision data can always be handled as raw
3619 # by the flagprocessor.
3435 # by the flagprocessor.
3620 rev = self._addrevision(
3436 rev = self._addrevision(
3621 node,
3437 node,
3622 None,
3438 None,
3623 transaction,
3439 transaction,
3624 link,
3440 link,
3625 p1,
3441 p1,
3626 p2,
3442 p2,
3627 flags,
3443 flags,
3628 (baserev, delta, delta_base_reuse_policy),
3444 (baserev, delta, delta_base_reuse_policy),
3629 alwayscache=alwayscache,
3445 alwayscache=alwayscache,
3630 deltacomputer=deltacomputer,
3446 deltacomputer=deltacomputer,
3631 sidedata=sidedata,
3447 sidedata=sidedata,
3632 )
3448 )
3633
3449
3634 if addrevisioncb:
3450 if addrevisioncb:
3635 addrevisioncb(self, rev)
3451 addrevisioncb(self, rev)
3636 empty = False
3452 empty = False
3637 finally:
3453 finally:
3638 self._adding_group = False
3454 self._adding_group = False
3639 return not empty
3455 return not empty
3640
3456
3641 def iscensored(self, rev):
3457 def iscensored(self, rev):
3642 """Check if a file revision is censored."""
3458 """Check if a file revision is censored."""
3643 if not self.feature_config.censorable:
3459 if not self.feature_config.censorable:
3644 return False
3460 return False
3645
3461
3646 return self.flags(rev) & REVIDX_ISCENSORED
3462 return self.flags(rev) & REVIDX_ISCENSORED
3647
3463
3648 def _peek_iscensored(self, baserev, delta):
3464 def _peek_iscensored(self, baserev, delta):
3649 """Quickly check if a delta produces a censored revision."""
3465 """Quickly check if a delta produces a censored revision."""
3650 if not self.feature_config.censorable:
3466 if not self.feature_config.censorable:
3651 return False
3467 return False
3652
3468
3653 return storageutil.deltaiscensored(delta, baserev, self.rawsize)
3469 return storageutil.deltaiscensored(delta, baserev, self.rawsize)
3654
3470
3655 def getstrippoint(self, minlink):
3471 def getstrippoint(self, minlink):
3656 """find the minimum rev that must be stripped to strip the linkrev
3472 """find the minimum rev that must be stripped to strip the linkrev
3657
3473
3658 Returns a tuple containing the minimum rev and a set of all revs that
3474 Returns a tuple containing the minimum rev and a set of all revs that
3659 have linkrevs that will be broken by this strip.
3475 have linkrevs that will be broken by this strip.
3660 """
3476 """
3661 return storageutil.resolvestripinfo(
3477 return storageutil.resolvestripinfo(
3662 minlink,
3478 minlink,
3663 len(self) - 1,
3479 len(self) - 1,
3664 self.headrevs(),
3480 self.headrevs(),
3665 self.linkrev,
3481 self.linkrev,
3666 self.parentrevs,
3482 self.parentrevs,
3667 )
3483 )
3668
3484
3669 def strip(self, minlink, transaction):
3485 def strip(self, minlink, transaction):
3670 """truncate the revlog on the first revision with a linkrev >= minlink
3486 """truncate the revlog on the first revision with a linkrev >= minlink
3671
3487
3672 This function is called when we're stripping revision minlink and
3488 This function is called when we're stripping revision minlink and
3673 its descendants from the repository.
3489 its descendants from the repository.
3674
3490
3675 We have to remove all revisions with linkrev >= minlink, because
3491 We have to remove all revisions with linkrev >= minlink, because
3676 the equivalent changelog revisions will be renumbered after the
3492 the equivalent changelog revisions will be renumbered after the
3677 strip.
3493 strip.
3678
3494
3679 So we truncate the revlog on the first of these revisions, and
3495 So we truncate the revlog on the first of these revisions, and
3680 trust that the caller has saved the revisions that shouldn't be
3496 trust that the caller has saved the revisions that shouldn't be
3681 removed and that it'll re-add them after this truncation.
3497 removed and that it'll re-add them after this truncation.
3682 """
3498 """
3683 if len(self) == 0:
3499 if len(self) == 0:
3684 return
3500 return
3685
3501
3686 rev, _ = self.getstrippoint(minlink)
3502 rev, _ = self.getstrippoint(minlink)
3687 if rev == len(self):
3503 if rev == len(self):
3688 return
3504 return
3689
3505
3690 # first truncate the files on disk
3506 # first truncate the files on disk
3691 data_end = self.start(rev)
3507 data_end = self.start(rev)
3692 if not self._inline:
3508 if not self._inline:
3693 transaction.add(self._datafile, data_end)
3509 transaction.add(self._datafile, data_end)
3694 end = rev * self.index.entry_size
3510 end = rev * self.index.entry_size
3695 else:
3511 else:
3696 end = data_end + (rev * self.index.entry_size)
3512 end = data_end + (rev * self.index.entry_size)
3697
3513
3698 if self._sidedatafile:
3514 if self._sidedatafile:
3699 sidedata_end = self.sidedata_cut_off(rev)
3515 sidedata_end = self.sidedata_cut_off(rev)
3700 transaction.add(self._sidedatafile, sidedata_end)
3516 transaction.add(self._sidedatafile, sidedata_end)
3701
3517
3702 transaction.add(self._indexfile, end)
3518 transaction.add(self._indexfile, end)
3703 if self._docket is not None:
3519 if self._docket is not None:
3704 # XXX we could, leverage the docket while stripping. However it is
3520 # XXX we could, leverage the docket while stripping. However it is
3705 # not powerfull enough at the time of this comment
3521 # not powerfull enough at the time of this comment
3706 self._docket.index_end = end
3522 self._docket.index_end = end
3707 self._docket.data_end = data_end
3523 self._docket.data_end = data_end
3708 self._docket.sidedata_end = sidedata_end
3524 self._docket.sidedata_end = sidedata_end
3709 self._docket.write(transaction, stripping=True)
3525 self._docket.write(transaction, stripping=True)
3710
3526
3711 # then reset internal state in memory to forget those revisions
3527 # then reset internal state in memory to forget those revisions
3712 self._chaininfocache = util.lrucachedict(500)
3528 self._chaininfocache = util.lrucachedict(500)
3713 self._inner.clear_cache()
3529 self._inner.clear_cache()
3714
3530
3715 del self.index[rev:-1]
3531 del self.index[rev:-1]
3716
3532
3717 def checksize(self):
3533 def checksize(self):
3718 """Check size of index and data files
3534 """Check size of index and data files
3719
3535
3720 return a (dd, di) tuple.
3536 return a (dd, di) tuple.
3721 - dd: extra bytes for the "data" file
3537 - dd: extra bytes for the "data" file
3722 - di: extra bytes for the "index" file
3538 - di: extra bytes for the "index" file
3723
3539
3724 A healthy revlog will return (0, 0).
3540 A healthy revlog will return (0, 0).
3725 """
3541 """
3726 expected = 0
3542 expected = 0
3727 if len(self):
3543 if len(self):
3728 expected = max(0, self.end(len(self) - 1))
3544 expected = max(0, self.end(len(self) - 1))
3729
3545
3730 try:
3546 try:
3731 with self._datafp() as f:
3547 with self._datafp() as f:
3732 f.seek(0, io.SEEK_END)
3548 f.seek(0, io.SEEK_END)
3733 actual = f.tell()
3549 actual = f.tell()
3734 dd = actual - expected
3550 dd = actual - expected
3735 except FileNotFoundError:
3551 except FileNotFoundError:
3736 dd = 0
3552 dd = 0
3737
3553
3738 try:
3554 try:
3739 f = self.opener(self._indexfile)
3555 f = self.opener(self._indexfile)
3740 f.seek(0, io.SEEK_END)
3556 f.seek(0, io.SEEK_END)
3741 actual = f.tell()
3557 actual = f.tell()
3742 f.close()
3558 f.close()
3743 s = self.index.entry_size
3559 s = self.index.entry_size
3744 i = max(0, actual // s)
3560 i = max(0, actual // s)
3745 di = actual - (i * s)
3561 di = actual - (i * s)
3746 if self._inline:
3562 if self._inline:
3747 databytes = 0
3563 databytes = 0
3748 for r in self:
3564 for r in self:
3749 databytes += max(0, self.length(r))
3565 databytes += max(0, self.length(r))
3750 dd = 0
3566 dd = 0
3751 di = actual - len(self) * s - databytes
3567 di = actual - len(self) * s - databytes
3752 except FileNotFoundError:
3568 except FileNotFoundError:
3753 di = 0
3569 di = 0
3754
3570
3755 return (dd, di)
3571 return (dd, di)
3756
3572
3757 def files(self):
3573 def files(self):
3758 """return list of files that compose this revlog"""
3574 """return list of files that compose this revlog"""
3759 res = [self._indexfile]
3575 res = [self._indexfile]
3760 if self._docket_file is None:
3576 if self._docket_file is None:
3761 if not self._inline:
3577 if not self._inline:
3762 res.append(self._datafile)
3578 res.append(self._datafile)
3763 else:
3579 else:
3764 res.append(self._docket_file)
3580 res.append(self._docket_file)
3765 res.extend(self._docket.old_index_filepaths(include_empty=False))
3581 res.extend(self._docket.old_index_filepaths(include_empty=False))
3766 if self._docket.data_end:
3582 if self._docket.data_end:
3767 res.append(self._datafile)
3583 res.append(self._datafile)
3768 res.extend(self._docket.old_data_filepaths(include_empty=False))
3584 res.extend(self._docket.old_data_filepaths(include_empty=False))
3769 if self._docket.sidedata_end:
3585 if self._docket.sidedata_end:
3770 res.append(self._sidedatafile)
3586 res.append(self._sidedatafile)
3771 res.extend(self._docket.old_sidedata_filepaths(include_empty=False))
3587 res.extend(self._docket.old_sidedata_filepaths(include_empty=False))
3772 return res
3588 return res
3773
3589
3774 def emitrevisions(
3590 def emitrevisions(
3775 self,
3591 self,
3776 nodes,
3592 nodes,
3777 nodesorder=None,
3593 nodesorder=None,
3778 revisiondata=False,
3594 revisiondata=False,
3779 assumehaveparentrevisions=False,
3595 assumehaveparentrevisions=False,
3780 deltamode=repository.CG_DELTAMODE_STD,
3596 deltamode=repository.CG_DELTAMODE_STD,
3781 sidedata_helpers=None,
3597 sidedata_helpers=None,
3782 debug_info=None,
3598 debug_info=None,
3783 ):
3599 ):
3784 if nodesorder not in (b'nodes', b'storage', b'linear', None):
3600 if nodesorder not in (b'nodes', b'storage', b'linear', None):
3785 raise error.ProgrammingError(
3601 raise error.ProgrammingError(
3786 b'unhandled value for nodesorder: %s' % nodesorder
3602 b'unhandled value for nodesorder: %s' % nodesorder
3787 )
3603 )
3788
3604
3789 if nodesorder is None and not self.delta_config.general_delta:
3605 if nodesorder is None and not self.delta_config.general_delta:
3790 nodesorder = b'storage'
3606 nodesorder = b'storage'
3791
3607
3792 if (
3608 if (
3793 not self._storedeltachains
3609 not self._storedeltachains
3794 and deltamode != repository.CG_DELTAMODE_PREV
3610 and deltamode != repository.CG_DELTAMODE_PREV
3795 ):
3611 ):
3796 deltamode = repository.CG_DELTAMODE_FULL
3612 deltamode = repository.CG_DELTAMODE_FULL
3797
3613
3798 return storageutil.emitrevisions(
3614 return storageutil.emitrevisions(
3799 self,
3615 self,
3800 nodes,
3616 nodes,
3801 nodesorder,
3617 nodesorder,
3802 revlogrevisiondelta,
3618 revlogrevisiondelta,
3803 deltaparentfn=self.deltaparent,
3619 deltaparentfn=self.deltaparent,
3804 candeltafn=self._candelta,
3620 candeltafn=self._candelta,
3805 rawsizefn=self.rawsize,
3621 rawsizefn=self.rawsize,
3806 revdifffn=self.revdiff,
3622 revdifffn=self.revdiff,
3807 flagsfn=self.flags,
3623 flagsfn=self.flags,
3808 deltamode=deltamode,
3624 deltamode=deltamode,
3809 revisiondata=revisiondata,
3625 revisiondata=revisiondata,
3810 assumehaveparentrevisions=assumehaveparentrevisions,
3626 assumehaveparentrevisions=assumehaveparentrevisions,
3811 sidedata_helpers=sidedata_helpers,
3627 sidedata_helpers=sidedata_helpers,
3812 debug_info=debug_info,
3628 debug_info=debug_info,
3813 )
3629 )
3814
3630
3815 DELTAREUSEALWAYS = b'always'
3631 DELTAREUSEALWAYS = b'always'
3816 DELTAREUSESAMEREVS = b'samerevs'
3632 DELTAREUSESAMEREVS = b'samerevs'
3817 DELTAREUSENEVER = b'never'
3633 DELTAREUSENEVER = b'never'
3818
3634
3819 DELTAREUSEFULLADD = b'fulladd'
3635 DELTAREUSEFULLADD = b'fulladd'
3820
3636
3821 DELTAREUSEALL = {b'always', b'samerevs', b'never', b'fulladd'}
3637 DELTAREUSEALL = {b'always', b'samerevs', b'never', b'fulladd'}
3822
3638
3823 def clone(
3639 def clone(
3824 self,
3640 self,
3825 tr,
3641 tr,
3826 destrevlog,
3642 destrevlog,
3827 addrevisioncb=None,
3643 addrevisioncb=None,
3828 deltareuse=DELTAREUSESAMEREVS,
3644 deltareuse=DELTAREUSESAMEREVS,
3829 forcedeltabothparents=None,
3645 forcedeltabothparents=None,
3830 sidedata_helpers=None,
3646 sidedata_helpers=None,
3831 ):
3647 ):
3832 """Copy this revlog to another, possibly with format changes.
3648 """Copy this revlog to another, possibly with format changes.
3833
3649
3834 The destination revlog will contain the same revisions and nodes.
3650 The destination revlog will contain the same revisions and nodes.
3835 However, it may not be bit-for-bit identical due to e.g. delta encoding
3651 However, it may not be bit-for-bit identical due to e.g. delta encoding
3836 differences.
3652 differences.
3837
3653
3838 The ``deltareuse`` argument control how deltas from the existing revlog
3654 The ``deltareuse`` argument control how deltas from the existing revlog
3839 are preserved in the destination revlog. The argument can have the
3655 are preserved in the destination revlog. The argument can have the
3840 following values:
3656 following values:
3841
3657
3842 DELTAREUSEALWAYS
3658 DELTAREUSEALWAYS
3843 Deltas will always be reused (if possible), even if the destination
3659 Deltas will always be reused (if possible), even if the destination
3844 revlog would not select the same revisions for the delta. This is the
3660 revlog would not select the same revisions for the delta. This is the
3845 fastest mode of operation.
3661 fastest mode of operation.
3846 DELTAREUSESAMEREVS
3662 DELTAREUSESAMEREVS
3847 Deltas will be reused if the destination revlog would pick the same
3663 Deltas will be reused if the destination revlog would pick the same
3848 revisions for the delta. This mode strikes a balance between speed
3664 revisions for the delta. This mode strikes a balance between speed
3849 and optimization.
3665 and optimization.
3850 DELTAREUSENEVER
3666 DELTAREUSENEVER
3851 Deltas will never be reused. This is the slowest mode of execution.
3667 Deltas will never be reused. This is the slowest mode of execution.
3852 This mode can be used to recompute deltas (e.g. if the diff/delta
3668 This mode can be used to recompute deltas (e.g. if the diff/delta
3853 algorithm changes).
3669 algorithm changes).
3854 DELTAREUSEFULLADD
3670 DELTAREUSEFULLADD
3855 Revision will be re-added as if their were new content. This is
3671 Revision will be re-added as if their were new content. This is
3856 slower than DELTAREUSEALWAYS but allow more mechanism to kicks in.
3672 slower than DELTAREUSEALWAYS but allow more mechanism to kicks in.
3857 eg: large file detection and handling.
3673 eg: large file detection and handling.
3858
3674
3859 Delta computation can be slow, so the choice of delta reuse policy can
3675 Delta computation can be slow, so the choice of delta reuse policy can
3860 significantly affect run time.
3676 significantly affect run time.
3861
3677
3862 The default policy (``DELTAREUSESAMEREVS``) strikes a balance between
3678 The default policy (``DELTAREUSESAMEREVS``) strikes a balance between
3863 two extremes. Deltas will be reused if they are appropriate. But if the
3679 two extremes. Deltas will be reused if they are appropriate. But if the
3864 delta could choose a better revision, it will do so. This means if you
3680 delta could choose a better revision, it will do so. This means if you
3865 are converting a non-generaldelta revlog to a generaldelta revlog,
3681 are converting a non-generaldelta revlog to a generaldelta revlog,
3866 deltas will be recomputed if the delta's parent isn't a parent of the
3682 deltas will be recomputed if the delta's parent isn't a parent of the
3867 revision.
3683 revision.
3868
3684
3869 In addition to the delta policy, the ``forcedeltabothparents``
3685 In addition to the delta policy, the ``forcedeltabothparents``
3870 argument controls whether to force compute deltas against both parents
3686 argument controls whether to force compute deltas against both parents
3871 for merges. By default, the current default is used.
3687 for merges. By default, the current default is used.
3872
3688
3873 See `revlogutil.sidedata.get_sidedata_helpers` for the doc on
3689 See `revlogutil.sidedata.get_sidedata_helpers` for the doc on
3874 `sidedata_helpers`.
3690 `sidedata_helpers`.
3875 """
3691 """
3876 if deltareuse not in self.DELTAREUSEALL:
3692 if deltareuse not in self.DELTAREUSEALL:
3877 raise ValueError(
3693 raise ValueError(
3878 _(b'value for deltareuse invalid: %s') % deltareuse
3694 _(b'value for deltareuse invalid: %s') % deltareuse
3879 )
3695 )
3880
3696
3881 if len(destrevlog):
3697 if len(destrevlog):
3882 raise ValueError(_(b'destination revlog is not empty'))
3698 raise ValueError(_(b'destination revlog is not empty'))
3883
3699
3884 if getattr(self, 'filteredrevs', None):
3700 if getattr(self, 'filteredrevs', None):
3885 raise ValueError(_(b'source revlog has filtered revisions'))
3701 raise ValueError(_(b'source revlog has filtered revisions'))
3886 if getattr(destrevlog, 'filteredrevs', None):
3702 if getattr(destrevlog, 'filteredrevs', None):
3887 raise ValueError(_(b'destination revlog has filtered revisions'))
3703 raise ValueError(_(b'destination revlog has filtered revisions'))
3888
3704
3889 # lazydelta and lazydeltabase controls whether to reuse a cached delta,
3705 # lazydelta and lazydeltabase controls whether to reuse a cached delta,
3890 # if possible.
3706 # if possible.
3891 old_delta_config = destrevlog.delta_config
3707 old_delta_config = destrevlog.delta_config
3892 destrevlog.delta_config = destrevlog.delta_config.copy()
3708 destrevlog.delta_config = destrevlog.delta_config.copy()
3893
3709
3894 try:
3710 try:
3895 if deltareuse == self.DELTAREUSEALWAYS:
3711 if deltareuse == self.DELTAREUSEALWAYS:
3896 destrevlog.delta_config.lazy_delta_base = True
3712 destrevlog.delta_config.lazy_delta_base = True
3897 destrevlog.delta_config.lazy_delta = True
3713 destrevlog.delta_config.lazy_delta = True
3898 elif deltareuse == self.DELTAREUSESAMEREVS:
3714 elif deltareuse == self.DELTAREUSESAMEREVS:
3899 destrevlog.delta_config.lazy_delta_base = False
3715 destrevlog.delta_config.lazy_delta_base = False
3900 destrevlog.delta_config.lazy_delta = True
3716 destrevlog.delta_config.lazy_delta = True
3901 elif deltareuse == self.DELTAREUSENEVER:
3717 elif deltareuse == self.DELTAREUSENEVER:
3902 destrevlog.delta_config.lazy_delta_base = False
3718 destrevlog.delta_config.lazy_delta_base = False
3903 destrevlog.delta_config.lazy_delta = False
3719 destrevlog.delta_config.lazy_delta = False
3904
3720
3905 delta_both_parents = (
3721 delta_both_parents = (
3906 forcedeltabothparents or old_delta_config.delta_both_parents
3722 forcedeltabothparents or old_delta_config.delta_both_parents
3907 )
3723 )
3908 destrevlog.delta_config.delta_both_parents = delta_both_parents
3724 destrevlog.delta_config.delta_both_parents = delta_both_parents
3909
3725
3910 with self.reading(), destrevlog._writing(tr):
3726 with self.reading(), destrevlog._writing(tr):
3911 self._clone(
3727 self._clone(
3912 tr,
3728 tr,
3913 destrevlog,
3729 destrevlog,
3914 addrevisioncb,
3730 addrevisioncb,
3915 deltareuse,
3731 deltareuse,
3916 forcedeltabothparents,
3732 forcedeltabothparents,
3917 sidedata_helpers,
3733 sidedata_helpers,
3918 )
3734 )
3919
3735
3920 finally:
3736 finally:
3921 destrevlog.delta_config = old_delta_config
3737 destrevlog.delta_config = old_delta_config
3922
3738
3923 def _clone(
3739 def _clone(
3924 self,
3740 self,
3925 tr,
3741 tr,
3926 destrevlog,
3742 destrevlog,
3927 addrevisioncb,
3743 addrevisioncb,
3928 deltareuse,
3744 deltareuse,
3929 forcedeltabothparents,
3745 forcedeltabothparents,
3930 sidedata_helpers,
3746 sidedata_helpers,
3931 ):
3747 ):
3932 """perform the core duty of `revlog.clone` after parameter processing"""
3748 """perform the core duty of `revlog.clone` after parameter processing"""
3933 write_debug = None
3749 write_debug = None
3934 if self.delta_config.debug_delta:
3750 if self.delta_config.debug_delta:
3935 write_debug = tr._report
3751 write_debug = tr._report
3936 deltacomputer = deltautil.deltacomputer(
3752 deltacomputer = deltautil.deltacomputer(
3937 destrevlog,
3753 destrevlog,
3938 write_debug=write_debug,
3754 write_debug=write_debug,
3939 )
3755 )
3940 index = self.index
3756 index = self.index
3941 for rev in self:
3757 for rev in self:
3942 entry = index[rev]
3758 entry = index[rev]
3943
3759
3944 # Some classes override linkrev to take filtered revs into
3760 # Some classes override linkrev to take filtered revs into
3945 # account. Use raw entry from index.
3761 # account. Use raw entry from index.
3946 flags = entry[0] & 0xFFFF
3762 flags = entry[0] & 0xFFFF
3947 linkrev = entry[4]
3763 linkrev = entry[4]
3948 p1 = index[entry[5]][7]
3764 p1 = index[entry[5]][7]
3949 p2 = index[entry[6]][7]
3765 p2 = index[entry[6]][7]
3950 node = entry[7]
3766 node = entry[7]
3951
3767
3952 # (Possibly) reuse the delta from the revlog if allowed and
3768 # (Possibly) reuse the delta from the revlog if allowed and
3953 # the revlog chunk is a delta.
3769 # the revlog chunk is a delta.
3954 cachedelta = None
3770 cachedelta = None
3955 rawtext = None
3771 rawtext = None
3956 if deltareuse == self.DELTAREUSEFULLADD:
3772 if deltareuse == self.DELTAREUSEFULLADD:
3957 text = self._revisiondata(rev)
3773 text = self._revisiondata(rev)
3958 sidedata = self.sidedata(rev)
3774 sidedata = self.sidedata(rev)
3959
3775
3960 if sidedata_helpers is not None:
3776 if sidedata_helpers is not None:
3961 (sidedata, new_flags) = sidedatautil.run_sidedata_helpers(
3777 (sidedata, new_flags) = sidedatautil.run_sidedata_helpers(
3962 self, sidedata_helpers, sidedata, rev
3778 self, sidedata_helpers, sidedata, rev
3963 )
3779 )
3964 flags = flags | new_flags[0] & ~new_flags[1]
3780 flags = flags | new_flags[0] & ~new_flags[1]
3965
3781
3966 destrevlog.addrevision(
3782 destrevlog.addrevision(
3967 text,
3783 text,
3968 tr,
3784 tr,
3969 linkrev,
3785 linkrev,
3970 p1,
3786 p1,
3971 p2,
3787 p2,
3972 cachedelta=cachedelta,
3788 cachedelta=cachedelta,
3973 node=node,
3789 node=node,
3974 flags=flags,
3790 flags=flags,
3975 deltacomputer=deltacomputer,
3791 deltacomputer=deltacomputer,
3976 sidedata=sidedata,
3792 sidedata=sidedata,
3977 )
3793 )
3978 else:
3794 else:
3979 if destrevlog.delta_config.lazy_delta:
3795 if destrevlog.delta_config.lazy_delta:
3980 dp = self.deltaparent(rev)
3796 dp = self.deltaparent(rev)
3981 if dp != nullrev:
3797 if dp != nullrev:
3982 cachedelta = (dp, bytes(self._inner._chunk(rev)))
3798 cachedelta = (dp, bytes(self._inner._chunk(rev)))
3983
3799
3984 sidedata = None
3800 sidedata = None
3985 if not cachedelta:
3801 if not cachedelta:
3986 try:
3802 try:
3987 rawtext = self._revisiondata(rev)
3803 rawtext = self._revisiondata(rev)
3988 except error.CensoredNodeError as censored:
3804 except error.CensoredNodeError as censored:
3989 assert flags & REVIDX_ISCENSORED
3805 assert flags & REVIDX_ISCENSORED
3990 rawtext = censored.tombstone
3806 rawtext = censored.tombstone
3991 sidedata = self.sidedata(rev)
3807 sidedata = self.sidedata(rev)
3992 if sidedata is None:
3808 if sidedata is None:
3993 sidedata = self.sidedata(rev)
3809 sidedata = self.sidedata(rev)
3994
3810
3995 if sidedata_helpers is not None:
3811 if sidedata_helpers is not None:
3996 (sidedata, new_flags) = sidedatautil.run_sidedata_helpers(
3812 (sidedata, new_flags) = sidedatautil.run_sidedata_helpers(
3997 self, sidedata_helpers, sidedata, rev
3813 self, sidedata_helpers, sidedata, rev
3998 )
3814 )
3999 flags = flags | new_flags[0] & ~new_flags[1]
3815 flags = flags | new_flags[0] & ~new_flags[1]
4000
3816
4001 destrevlog._addrevision(
3817 destrevlog._addrevision(
4002 node,
3818 node,
4003 rawtext,
3819 rawtext,
4004 tr,
3820 tr,
4005 linkrev,
3821 linkrev,
4006 p1,
3822 p1,
4007 p2,
3823 p2,
4008 flags,
3824 flags,
4009 cachedelta,
3825 cachedelta,
4010 deltacomputer=deltacomputer,
3826 deltacomputer=deltacomputer,
4011 sidedata=sidedata,
3827 sidedata=sidedata,
4012 )
3828 )
4013
3829
4014 if addrevisioncb:
3830 if addrevisioncb:
4015 addrevisioncb(self, rev, node)
3831 addrevisioncb(self, rev, node)
4016
3832
4017 def censorrevision(self, tr, censornode, tombstone=b''):
3833 def censorrevision(self, tr, censornode, tombstone=b''):
4018 if self._format_version == REVLOGV0:
3834 if self._format_version == REVLOGV0:
4019 raise error.RevlogError(
3835 raise error.RevlogError(
4020 _(b'cannot censor with version %d revlogs')
3836 _(b'cannot censor with version %d revlogs')
4021 % self._format_version
3837 % self._format_version
4022 )
3838 )
4023 elif self._format_version == REVLOGV1:
3839 elif self._format_version == REVLOGV1:
4024 rewrite.v1_censor(self, tr, censornode, tombstone)
3840 rewrite.v1_censor(self, tr, censornode, tombstone)
4025 else:
3841 else:
4026 rewrite.v2_censor(self, tr, censornode, tombstone)
3842 rewrite.v2_censor(self, tr, censornode, tombstone)
4027
3843
4028 def verifyintegrity(self, state):
3844 def verifyintegrity(self, state):
4029 """Verifies the integrity of the revlog.
3845 """Verifies the integrity of the revlog.
4030
3846
4031 Yields ``revlogproblem`` instances describing problems that are
3847 Yields ``revlogproblem`` instances describing problems that are
4032 found.
3848 found.
4033 """
3849 """
4034 dd, di = self.checksize()
3850 dd, di = self.checksize()
4035 if dd:
3851 if dd:
4036 yield revlogproblem(error=_(b'data length off by %d bytes') % dd)
3852 yield revlogproblem(error=_(b'data length off by %d bytes') % dd)
4037 if di:
3853 if di:
4038 yield revlogproblem(error=_(b'index contains %d extra bytes') % di)
3854 yield revlogproblem(error=_(b'index contains %d extra bytes') % di)
4039
3855
4040 version = self._format_version
3856 version = self._format_version
4041
3857
4042 # The verifier tells us what version revlog we should be.
3858 # The verifier tells us what version revlog we should be.
4043 if version != state[b'expectedversion']:
3859 if version != state[b'expectedversion']:
4044 yield revlogproblem(
3860 yield revlogproblem(
4045 warning=_(b"warning: '%s' uses revlog format %d; expected %d")
3861 warning=_(b"warning: '%s' uses revlog format %d; expected %d")
4046 % (self.display_id, version, state[b'expectedversion'])
3862 % (self.display_id, version, state[b'expectedversion'])
4047 )
3863 )
4048
3864
4049 state[b'skipread'] = set()
3865 state[b'skipread'] = set()
4050 state[b'safe_renamed'] = set()
3866 state[b'safe_renamed'] = set()
4051
3867
4052 for rev in self:
3868 for rev in self:
4053 node = self.node(rev)
3869 node = self.node(rev)
4054
3870
4055 # Verify contents. 4 cases to care about:
3871 # Verify contents. 4 cases to care about:
4056 #
3872 #
4057 # common: the most common case
3873 # common: the most common case
4058 # rename: with a rename
3874 # rename: with a rename
4059 # meta: file content starts with b'\1\n', the metadata
3875 # meta: file content starts with b'\1\n', the metadata
4060 # header defined in filelog.py, but without a rename
3876 # header defined in filelog.py, but without a rename
4061 # ext: content stored externally
3877 # ext: content stored externally
4062 #
3878 #
4063 # More formally, their differences are shown below:
3879 # More formally, their differences are shown below:
4064 #
3880 #
4065 # | common | rename | meta | ext
3881 # | common | rename | meta | ext
4066 # -------------------------------------------------------
3882 # -------------------------------------------------------
4067 # flags() | 0 | 0 | 0 | not 0
3883 # flags() | 0 | 0 | 0 | not 0
4068 # renamed() | False | True | False | ?
3884 # renamed() | False | True | False | ?
4069 # rawtext[0:2]=='\1\n'| False | True | True | ?
3885 # rawtext[0:2]=='\1\n'| False | True | True | ?
4070 #
3886 #
4071 # "rawtext" means the raw text stored in revlog data, which
3887 # "rawtext" means the raw text stored in revlog data, which
4072 # could be retrieved by "rawdata(rev)". "text"
3888 # could be retrieved by "rawdata(rev)". "text"
4073 # mentioned below is "revision(rev)".
3889 # mentioned below is "revision(rev)".
4074 #
3890 #
4075 # There are 3 different lengths stored physically:
3891 # There are 3 different lengths stored physically:
4076 # 1. L1: rawsize, stored in revlog index
3892 # 1. L1: rawsize, stored in revlog index
4077 # 2. L2: len(rawtext), stored in revlog data
3893 # 2. L2: len(rawtext), stored in revlog data
4078 # 3. L3: len(text), stored in revlog data if flags==0, or
3894 # 3. L3: len(text), stored in revlog data if flags==0, or
4079 # possibly somewhere else if flags!=0
3895 # possibly somewhere else if flags!=0
4080 #
3896 #
4081 # L1 should be equal to L2. L3 could be different from them.
3897 # L1 should be equal to L2. L3 could be different from them.
4082 # "text" may or may not affect commit hash depending on flag
3898 # "text" may or may not affect commit hash depending on flag
4083 # processors (see flagutil.addflagprocessor).
3899 # processors (see flagutil.addflagprocessor).
4084 #
3900 #
4085 # | common | rename | meta | ext
3901 # | common | rename | meta | ext
4086 # -------------------------------------------------
3902 # -------------------------------------------------
4087 # rawsize() | L1 | L1 | L1 | L1
3903 # rawsize() | L1 | L1 | L1 | L1
4088 # size() | L1 | L2-LM | L1(*) | L1 (?)
3904 # size() | L1 | L2-LM | L1(*) | L1 (?)
4089 # len(rawtext) | L2 | L2 | L2 | L2
3905 # len(rawtext) | L2 | L2 | L2 | L2
4090 # len(text) | L2 | L2 | L2 | L3
3906 # len(text) | L2 | L2 | L2 | L3
4091 # len(read()) | L2 | L2-LM | L2-LM | L3 (?)
3907 # len(read()) | L2 | L2-LM | L2-LM | L3 (?)
4092 #
3908 #
4093 # LM: length of metadata, depending on rawtext
3909 # LM: length of metadata, depending on rawtext
4094 # (*): not ideal, see comment in filelog.size
3910 # (*): not ideal, see comment in filelog.size
4095 # (?): could be "- len(meta)" if the resolved content has
3911 # (?): could be "- len(meta)" if the resolved content has
4096 # rename metadata
3912 # rename metadata
4097 #
3913 #
4098 # Checks needed to be done:
3914 # Checks needed to be done:
4099 # 1. length check: L1 == L2, in all cases.
3915 # 1. length check: L1 == L2, in all cases.
4100 # 2. hash check: depending on flag processor, we may need to
3916 # 2. hash check: depending on flag processor, we may need to
4101 # use either "text" (external), or "rawtext" (in revlog).
3917 # use either "text" (external), or "rawtext" (in revlog).
4102
3918
4103 try:
3919 try:
4104 skipflags = state.get(b'skipflags', 0)
3920 skipflags = state.get(b'skipflags', 0)
4105 if skipflags:
3921 if skipflags:
4106 skipflags &= self.flags(rev)
3922 skipflags &= self.flags(rev)
4107
3923
4108 _verify_revision(self, skipflags, state, node)
3924 _verify_revision(self, skipflags, state, node)
4109
3925
4110 l1 = self.rawsize(rev)
3926 l1 = self.rawsize(rev)
4111 l2 = len(self.rawdata(node))
3927 l2 = len(self.rawdata(node))
4112
3928
4113 if l1 != l2:
3929 if l1 != l2:
4114 yield revlogproblem(
3930 yield revlogproblem(
4115 error=_(b'unpacked size is %d, %d expected') % (l2, l1),
3931 error=_(b'unpacked size is %d, %d expected') % (l2, l1),
4116 node=node,
3932 node=node,
4117 )
3933 )
4118
3934
4119 except error.CensoredNodeError:
3935 except error.CensoredNodeError:
4120 if state[b'erroroncensored']:
3936 if state[b'erroroncensored']:
4121 yield revlogproblem(
3937 yield revlogproblem(
4122 error=_(b'censored file data'), node=node
3938 error=_(b'censored file data'), node=node
4123 )
3939 )
4124 state[b'skipread'].add(node)
3940 state[b'skipread'].add(node)
4125 except Exception as e:
3941 except Exception as e:
4126 yield revlogproblem(
3942 yield revlogproblem(
4127 error=_(b'unpacking %s: %s')
3943 error=_(b'unpacking %s: %s')
4128 % (short(node), stringutil.forcebytestr(e)),
3944 % (short(node), stringutil.forcebytestr(e)),
4129 node=node,
3945 node=node,
4130 )
3946 )
4131 state[b'skipread'].add(node)
3947 state[b'skipread'].add(node)
4132
3948
4133 def storageinfo(
3949 def storageinfo(
4134 self,
3950 self,
4135 exclusivefiles=False,
3951 exclusivefiles=False,
4136 sharedfiles=False,
3952 sharedfiles=False,
4137 revisionscount=False,
3953 revisionscount=False,
4138 trackedsize=False,
3954 trackedsize=False,
4139 storedsize=False,
3955 storedsize=False,
4140 ):
3956 ):
4141 d = {}
3957 d = {}
4142
3958
4143 if exclusivefiles:
3959 if exclusivefiles:
4144 d[b'exclusivefiles'] = [(self.opener, self._indexfile)]
3960 d[b'exclusivefiles'] = [(self.opener, self._indexfile)]
4145 if not self._inline:
3961 if not self._inline:
4146 d[b'exclusivefiles'].append((self.opener, self._datafile))
3962 d[b'exclusivefiles'].append((self.opener, self._datafile))
4147
3963
4148 if sharedfiles:
3964 if sharedfiles:
4149 d[b'sharedfiles'] = []
3965 d[b'sharedfiles'] = []
4150
3966
4151 if revisionscount:
3967 if revisionscount:
4152 d[b'revisionscount'] = len(self)
3968 d[b'revisionscount'] = len(self)
4153
3969
4154 if trackedsize:
3970 if trackedsize:
4155 d[b'trackedsize'] = sum(map(self.rawsize, iter(self)))
3971 d[b'trackedsize'] = sum(map(self.rawsize, iter(self)))
4156
3972
4157 if storedsize:
3973 if storedsize:
4158 d[b'storedsize'] = sum(
3974 d[b'storedsize'] = sum(
4159 self.opener.stat(path).st_size for path in self.files()
3975 self.opener.stat(path).st_size for path in self.files()
4160 )
3976 )
4161
3977
4162 return d
3978 return d
4163
3979
4164 def rewrite_sidedata(self, transaction, helpers, startrev, endrev):
3980 def rewrite_sidedata(self, transaction, helpers, startrev, endrev):
4165 if not self.feature_config.has_side_data:
3981 if not self.feature_config.has_side_data:
4166 return
3982 return
4167 # revlog formats with sidedata support does not support inline
3983 # revlog formats with sidedata support does not support inline
4168 assert not self._inline
3984 assert not self._inline
4169 if not helpers[1] and not helpers[2]:
3985 if not helpers[1] and not helpers[2]:
4170 # Nothing to generate or remove
3986 # Nothing to generate or remove
4171 return
3987 return
4172
3988
4173 new_entries = []
3989 new_entries = []
4174 # append the new sidedata
3990 # append the new sidedata
4175 with self._writing(transaction):
3991 with self._writing(transaction):
4176 ifh, dfh, sdfh = self._inner._writinghandles
3992 ifh, dfh, sdfh = self._inner._writinghandles
4177 dfh.seek(self._docket.sidedata_end, os.SEEK_SET)
3993 dfh.seek(self._docket.sidedata_end, os.SEEK_SET)
4178
3994
4179 current_offset = sdfh.tell()
3995 current_offset = sdfh.tell()
4180 for rev in range(startrev, endrev + 1):
3996 for rev in range(startrev, endrev + 1):
4181 entry = self.index[rev]
3997 entry = self.index[rev]
4182 new_sidedata, flags = sidedatautil.run_sidedata_helpers(
3998 new_sidedata, flags = sidedatautil.run_sidedata_helpers(
4183 store=self,
3999 store=self,
4184 sidedata_helpers=helpers,
4000 sidedata_helpers=helpers,
4185 sidedata={},
4001 sidedata={},
4186 rev=rev,
4002 rev=rev,
4187 )
4003 )
4188
4004
4189 serialized_sidedata = sidedatautil.serialize_sidedata(
4005 serialized_sidedata = sidedatautil.serialize_sidedata(
4190 new_sidedata
4006 new_sidedata
4191 )
4007 )
4192
4008
4193 sidedata_compression_mode = COMP_MODE_INLINE
4009 sidedata_compression_mode = COMP_MODE_INLINE
4194 if serialized_sidedata and self.feature_config.has_side_data:
4010 if serialized_sidedata and self.feature_config.has_side_data:
4195 sidedata_compression_mode = COMP_MODE_PLAIN
4011 sidedata_compression_mode = COMP_MODE_PLAIN
4196 h, comp_sidedata = self._inner.compress(serialized_sidedata)
4012 h, comp_sidedata = self._inner.compress(serialized_sidedata)
4197 if (
4013 if (
4198 h != b'u'
4014 h != b'u'
4199 and comp_sidedata[0] != b'\0'
4015 and comp_sidedata[0] != b'\0'
4200 and len(comp_sidedata) < len(serialized_sidedata)
4016 and len(comp_sidedata) < len(serialized_sidedata)
4201 ):
4017 ):
4202 assert not h
4018 assert not h
4203 if (
4019 if (
4204 comp_sidedata[0]
4020 comp_sidedata[0]
4205 == self._docket.default_compression_header
4021 == self._docket.default_compression_header
4206 ):
4022 ):
4207 sidedata_compression_mode = COMP_MODE_DEFAULT
4023 sidedata_compression_mode = COMP_MODE_DEFAULT
4208 serialized_sidedata = comp_sidedata
4024 serialized_sidedata = comp_sidedata
4209 else:
4025 else:
4210 sidedata_compression_mode = COMP_MODE_INLINE
4026 sidedata_compression_mode = COMP_MODE_INLINE
4211 serialized_sidedata = comp_sidedata
4027 serialized_sidedata = comp_sidedata
4212 if entry[8] != 0 or entry[9] != 0:
4028 if entry[8] != 0 or entry[9] != 0:
4213 # rewriting entries that already have sidedata is not
4029 # rewriting entries that already have sidedata is not
4214 # supported yet, because it introduces garbage data in the
4030 # supported yet, because it introduces garbage data in the
4215 # revlog.
4031 # revlog.
4216 msg = b"rewriting existing sidedata is not supported yet"
4032 msg = b"rewriting existing sidedata is not supported yet"
4217 raise error.Abort(msg)
4033 raise error.Abort(msg)
4218
4034
4219 # Apply (potential) flags to add and to remove after running
4035 # Apply (potential) flags to add and to remove after running
4220 # the sidedata helpers
4036 # the sidedata helpers
4221 new_offset_flags = entry[0] | flags[0] & ~flags[1]
4037 new_offset_flags = entry[0] | flags[0] & ~flags[1]
4222 entry_update = (
4038 entry_update = (
4223 current_offset,
4039 current_offset,
4224 len(serialized_sidedata),
4040 len(serialized_sidedata),
4225 new_offset_flags,
4041 new_offset_flags,
4226 sidedata_compression_mode,
4042 sidedata_compression_mode,
4227 )
4043 )
4228
4044
4229 # the sidedata computation might have move the file cursors around
4045 # the sidedata computation might have move the file cursors around
4230 sdfh.seek(current_offset, os.SEEK_SET)
4046 sdfh.seek(current_offset, os.SEEK_SET)
4231 sdfh.write(serialized_sidedata)
4047 sdfh.write(serialized_sidedata)
4232 new_entries.append(entry_update)
4048 new_entries.append(entry_update)
4233 current_offset += len(serialized_sidedata)
4049 current_offset += len(serialized_sidedata)
4234 self._docket.sidedata_end = sdfh.tell()
4050 self._docket.sidedata_end = sdfh.tell()
4235
4051
4236 # rewrite the new index entries
4052 # rewrite the new index entries
4237 ifh.seek(startrev * self.index.entry_size)
4053 ifh.seek(startrev * self.index.entry_size)
4238 for i, e in enumerate(new_entries):
4054 for i, e in enumerate(new_entries):
4239 rev = startrev + i
4055 rev = startrev + i
4240 self.index.replace_sidedata_info(rev, *e)
4056 self.index.replace_sidedata_info(rev, *e)
4241 packed = self.index.entry_binary(rev)
4057 packed = self.index.entry_binary(rev)
4242 if rev == 0 and self._docket is None:
4058 if rev == 0 and self._docket is None:
4243 header = self._format_flags | self._format_version
4059 header = self._format_flags | self._format_version
4244 header = self.index.pack_header(header)
4060 header = self.index.pack_header(header)
4245 packed = header + packed
4061 packed = header + packed
4246 ifh.write(packed)
4062 ifh.write(packed)
@@ -1,1107 +1,1118 b''
1 Setting up test
1 Setting up test
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ echo 0 > afile
5 $ echo 0 > afile
6 $ hg add afile
6 $ hg add afile
7 $ hg commit -m "0.0"
7 $ hg commit -m "0.0"
8 $ echo 1 >> afile
8 $ echo 1 >> afile
9 $ hg commit -m "0.1"
9 $ hg commit -m "0.1"
10 $ echo 2 >> afile
10 $ echo 2 >> afile
11 $ hg commit -m "0.2"
11 $ hg commit -m "0.2"
12 $ echo 3 >> afile
12 $ echo 3 >> afile
13 $ hg commit -m "0.3"
13 $ hg commit -m "0.3"
14 $ hg update -C 0
14 $ hg update -C 0
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ echo 1 >> afile
16 $ echo 1 >> afile
17 $ hg commit -m "1.1"
17 $ hg commit -m "1.1"
18 created new head
18 created new head
19 $ echo 2 >> afile
19 $ echo 2 >> afile
20 $ hg commit -m "1.2"
20 $ hg commit -m "1.2"
21 $ echo "a line" > fred
21 $ echo "a line" > fred
22 $ echo 3 >> afile
22 $ echo 3 >> afile
23 $ hg add fred
23 $ hg add fred
24 $ hg commit -m "1.3"
24 $ hg commit -m "1.3"
25 $ hg mv afile adifferentfile
25 $ hg mv afile adifferentfile
26 $ hg commit -m "1.3m"
26 $ hg commit -m "1.3m"
27 $ hg update -C 3
27 $ hg update -C 3
28 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
28 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
29 $ hg mv afile anotherfile
29 $ hg mv afile anotherfile
30 $ hg commit -m "0.3m"
30 $ hg commit -m "0.3m"
31 $ hg verify -q
31 $ hg verify -q
32 $ cd ..
32 $ cd ..
33 $ hg init empty
33 $ hg init empty
34
34
35 Bundle and phase
35 Bundle and phase
36
36
37 $ hg -R test phase --force --secret 0
37 $ hg -R test phase --force --secret 0
38 $ hg -R test bundle phase.hg empty
38 $ hg -R test bundle phase.hg empty
39 searching for changes
39 searching for changes
40 no changes found (ignored 9 secret changesets)
40 no changes found (ignored 9 secret changesets)
41 [1]
41 [1]
42 $ hg -R test phase --draft -r 'head()'
42 $ hg -R test phase --draft -r 'head()'
43
43
44 Bundle --all
44 Bundle --all
45
45
46 $ hg -R test bundle --all all.hg
46 $ hg -R test bundle --all all.hg
47 9 changesets found
47 9 changesets found
48
48
49 Bundle test to full.hg
49 Bundle test to full.hg
50
50
51 $ hg -R test bundle full.hg empty
51 $ hg -R test bundle full.hg empty
52 searching for changes
52 searching for changes
53 9 changesets found
53 9 changesets found
54
54
55 Unbundle full.hg in test
55 Unbundle full.hg in test
56
56
57 $ hg -R test unbundle full.hg
57 $ hg -R test unbundle full.hg
58 adding changesets
58 adding changesets
59 adding manifests
59 adding manifests
60 adding file changes
60 adding file changes
61 added 0 changesets with 0 changes to 4 files
61 added 0 changesets with 0 changes to 4 files
62 (run 'hg update' to get a working copy)
62 (run 'hg update' to get a working copy)
63
63
64 Verify empty
64 Verify empty
65
65
66 $ hg -R empty heads
66 $ hg -R empty heads
67 [1]
67 [1]
68 $ hg -R empty verify -q
68 $ hg -R empty verify -q
69
69
70 #if repobundlerepo
70 #if repobundlerepo
71
71
72 Pull full.hg into test (using --cwd)
72 Pull full.hg into test (using --cwd)
73
73
74 $ hg --cwd test pull ../full.hg
74 $ hg --cwd test pull ../full.hg
75 pulling from ../full.hg
75 pulling from ../full.hg
76 searching for changes
76 searching for changes
77 no changes found
77 no changes found
78
78
79 Verify that there are no leaked temporary files after pull (issue2797)
79 Verify that there are no leaked temporary files after pull (issue2797)
80
80
81 $ ls test/.hg | grep .hg10un
81 $ ls test/.hg | grep .hg10un
82 [1]
82 [1]
83
83
84 Pull full.hg into empty (using --cwd)
84 Pull full.hg into empty (using --cwd)
85
85
86 $ hg --cwd empty pull ../full.hg
86 $ hg --cwd empty pull ../full.hg
87 pulling from ../full.hg
87 pulling from ../full.hg
88 requesting all changes
88 requesting all changes
89 adding changesets
89 adding changesets
90 adding manifests
90 adding manifests
91 adding file changes
91 adding file changes
92 added 9 changesets with 7 changes to 4 files (+1 heads)
92 added 9 changesets with 7 changes to 4 files (+1 heads)
93 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
93 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
94 (run 'hg heads' to see heads, 'hg merge' to merge)
94 (run 'hg heads' to see heads, 'hg merge' to merge)
95
95
96 Rollback empty
96 Rollback empty
97
97
98 $ hg -R empty rollback
98 $ hg -R empty rollback
99 repository tip rolled back to revision -1 (undo pull)
99 repository tip rolled back to revision -1 (undo pull)
100
100
101 Pull full.hg into empty again (using --cwd)
101 Pull full.hg into empty again (using --cwd)
102
102
103 $ hg --cwd empty pull ../full.hg
103 $ hg --cwd empty pull ../full.hg
104 pulling from ../full.hg
104 pulling from ../full.hg
105 requesting all changes
105 requesting all changes
106 adding changesets
106 adding changesets
107 adding manifests
107 adding manifests
108 adding file changes
108 adding file changes
109 added 9 changesets with 7 changes to 4 files (+1 heads)
109 added 9 changesets with 7 changes to 4 files (+1 heads)
110 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
110 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
111 (run 'hg heads' to see heads, 'hg merge' to merge)
111 (run 'hg heads' to see heads, 'hg merge' to merge)
112
112
113 Pull full.hg into test (using -R)
113 Pull full.hg into test (using -R)
114
114
115 $ hg -R test pull full.hg
115 $ hg -R test pull full.hg
116 pulling from full.hg
116 pulling from full.hg
117 searching for changes
117 searching for changes
118 no changes found
118 no changes found
119
119
120 Pull full.hg into empty (using -R)
120 Pull full.hg into empty (using -R)
121
121
122 $ hg -R empty pull full.hg
122 $ hg -R empty pull full.hg
123 pulling from full.hg
123 pulling from full.hg
124 searching for changes
124 searching for changes
125 no changes found
125 no changes found
126
126
127 Rollback empty
127 Rollback empty
128
128
129 $ hg -R empty rollback
129 $ hg -R empty rollback
130 repository tip rolled back to revision -1 (undo pull)
130 repository tip rolled back to revision -1 (undo pull)
131
131
132 Pull full.hg into empty again (using -R)
132 Pull full.hg into empty again (using -R)
133
133
134 $ hg -R empty pull full.hg
134 $ hg -R empty pull full.hg
135 pulling from full.hg
135 pulling from full.hg
136 requesting all changes
136 requesting all changes
137 adding changesets
137 adding changesets
138 adding manifests
138 adding manifests
139 adding file changes
139 adding file changes
140 added 9 changesets with 7 changes to 4 files (+1 heads)
140 added 9 changesets with 7 changes to 4 files (+1 heads)
141 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
141 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
142 (run 'hg heads' to see heads, 'hg merge' to merge)
142 (run 'hg heads' to see heads, 'hg merge' to merge)
143
143
144 Log -R full.hg in fresh empty
144 Log -R full.hg in fresh empty
145
145
146 $ rm -r empty
146 $ rm -r empty
147 $ hg init empty
147 $ hg init empty
148 $ cd empty
148 $ cd empty
149 $ hg -R bundle://../full.hg log
149 $ hg -R bundle://../full.hg log
150 changeset: 8:aa35859c02ea
150 changeset: 8:aa35859c02ea
151 tag: tip
151 tag: tip
152 parent: 3:eebf5a27f8ca
152 parent: 3:eebf5a27f8ca
153 user: test
153 user: test
154 date: Thu Jan 01 00:00:00 1970 +0000
154 date: Thu Jan 01 00:00:00 1970 +0000
155 summary: 0.3m
155 summary: 0.3m
156
156
157 changeset: 7:a6a34bfa0076
157 changeset: 7:a6a34bfa0076
158 user: test
158 user: test
159 date: Thu Jan 01 00:00:00 1970 +0000
159 date: Thu Jan 01 00:00:00 1970 +0000
160 summary: 1.3m
160 summary: 1.3m
161
161
162 changeset: 6:7373c1169842
162 changeset: 6:7373c1169842
163 user: test
163 user: test
164 date: Thu Jan 01 00:00:00 1970 +0000
164 date: Thu Jan 01 00:00:00 1970 +0000
165 summary: 1.3
165 summary: 1.3
166
166
167 changeset: 5:1bb50a9436a7
167 changeset: 5:1bb50a9436a7
168 user: test
168 user: test
169 date: Thu Jan 01 00:00:00 1970 +0000
169 date: Thu Jan 01 00:00:00 1970 +0000
170 summary: 1.2
170 summary: 1.2
171
171
172 changeset: 4:095197eb4973
172 changeset: 4:095197eb4973
173 parent: 0:f9ee2f85a263
173 parent: 0:f9ee2f85a263
174 user: test
174 user: test
175 date: Thu Jan 01 00:00:00 1970 +0000
175 date: Thu Jan 01 00:00:00 1970 +0000
176 summary: 1.1
176 summary: 1.1
177
177
178 changeset: 3:eebf5a27f8ca
178 changeset: 3:eebf5a27f8ca
179 user: test
179 user: test
180 date: Thu Jan 01 00:00:00 1970 +0000
180 date: Thu Jan 01 00:00:00 1970 +0000
181 summary: 0.3
181 summary: 0.3
182
182
183 changeset: 2:e38ba6f5b7e0
183 changeset: 2:e38ba6f5b7e0
184 user: test
184 user: test
185 date: Thu Jan 01 00:00:00 1970 +0000
185 date: Thu Jan 01 00:00:00 1970 +0000
186 summary: 0.2
186 summary: 0.2
187
187
188 changeset: 1:34c2bf6b0626
188 changeset: 1:34c2bf6b0626
189 user: test
189 user: test
190 date: Thu Jan 01 00:00:00 1970 +0000
190 date: Thu Jan 01 00:00:00 1970 +0000
191 summary: 0.1
191 summary: 0.1
192
192
193 changeset: 0:f9ee2f85a263
193 changeset: 0:f9ee2f85a263
194 user: test
194 user: test
195 date: Thu Jan 01 00:00:00 1970 +0000
195 date: Thu Jan 01 00:00:00 1970 +0000
196 summary: 0.0
196 summary: 0.0
197
197
198 Make sure bundlerepo doesn't leak tempfiles (issue2491)
198 Make sure bundlerepo doesn't leak tempfiles (issue2491)
199
199
200 $ ls .hg
200 $ ls .hg
201 00changelog.i
201 00changelog.i
202 cache
202 cache
203 requires
203 requires
204 store
204 store
205 wcache
205 wcache
206
206
207 Pull ../full.hg into empty (with hook)
207 Pull ../full.hg into empty (with hook)
208
208
209 $ cat >> .hg/hgrc <<EOF
209 $ cat >> .hg/hgrc <<EOF
210 > [hooks]
210 > [hooks]
211 > changegroup = sh -c "printenv.py --line changegroup"
211 > changegroup = sh -c "printenv.py --line changegroup"
212 > EOF
212 > EOF
213
213
214 doesn't work (yet ?)
214 doesn't work (yet ?)
215 NOTE: msys is mangling the URL below
215 NOTE: msys is mangling the URL below
216
216
217 hg -R bundle://../full.hg verify
217 hg -R bundle://../full.hg verify
218
218
219 $ hg pull bundle://../full.hg
219 $ hg pull bundle://../full.hg
220 pulling from bundle:../full.hg
220 pulling from bundle:../full.hg
221 requesting all changes
221 requesting all changes
222 adding changesets
222 adding changesets
223 adding manifests
223 adding manifests
224 adding file changes
224 adding file changes
225 added 9 changesets with 7 changes to 4 files (+1 heads)
225 added 9 changesets with 7 changes to 4 files (+1 heads)
226 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
226 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
227 changegroup hook: HG_HOOKNAME=changegroup
227 changegroup hook: HG_HOOKNAME=changegroup
228 HG_HOOKTYPE=changegroup
228 HG_HOOKTYPE=changegroup
229 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
229 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
230 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
230 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
231 HG_SOURCE=pull
231 HG_SOURCE=pull
232 HG_TXNID=TXN:$ID$
232 HG_TXNID=TXN:$ID$
233 HG_TXNNAME=pull
233 HG_TXNNAME=pull
234 bundle:../full.hg (no-msys !)
234 bundle:../full.hg (no-msys !)
235 bundle;../full.hg (msys !)
235 bundle;../full.hg (msys !)
236 HG_URL=bundle:../full.hg (no-msys !)
236 HG_URL=bundle:../full.hg (no-msys !)
237 HG_URL=bundle;../full.hg (msys !)
237 HG_URL=bundle;../full.hg (msys !)
238
238
239 (run 'hg heads' to see heads, 'hg merge' to merge)
239 (run 'hg heads' to see heads, 'hg merge' to merge)
240
240
241 Rollback empty
241 Rollback empty
242
242
243 $ hg rollback
243 $ hg rollback
244 repository tip rolled back to revision -1 (undo pull)
244 repository tip rolled back to revision -1 (undo pull)
245 $ cd ..
245 $ cd ..
246
246
247 Log -R bundle:empty+full.hg
247 Log -R bundle:empty+full.hg
248
248
249 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
249 $ hg -R bundle:empty+full.hg log --template="{rev} "; echo ""
250 8 7 6 5 4 3 2 1 0
250 8 7 6 5 4 3 2 1 0
251
251
252 Pull full.hg into empty again (using -R; with hook)
252 Pull full.hg into empty again (using -R; with hook)
253
253
254 $ hg -R empty pull full.hg
254 $ hg -R empty pull full.hg
255 pulling from full.hg
255 pulling from full.hg
256 requesting all changes
256 requesting all changes
257 adding changesets
257 adding changesets
258 adding manifests
258 adding manifests
259 adding file changes
259 adding file changes
260 added 9 changesets with 7 changes to 4 files (+1 heads)
260 added 9 changesets with 7 changes to 4 files (+1 heads)
261 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
261 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
262 changegroup hook: HG_HOOKNAME=changegroup
262 changegroup hook: HG_HOOKNAME=changegroup
263 HG_HOOKTYPE=changegroup
263 HG_HOOKTYPE=changegroup
264 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
264 HG_NODE=f9ee2f85a263049e9ae6d37a0e67e96194ffb735
265 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
265 HG_NODE_LAST=aa35859c02ea8bd48da5da68cd2740ac71afcbaf
266 HG_SOURCE=pull
266 HG_SOURCE=pull
267 HG_TXNID=TXN:$ID$
267 HG_TXNID=TXN:$ID$
268 HG_TXNNAME=pull
268 HG_TXNNAME=pull
269 bundle:empty+full.hg
269 bundle:empty+full.hg
270 HG_URL=bundle:empty+full.hg
270 HG_URL=bundle:empty+full.hg
271
271
272 (run 'hg heads' to see heads, 'hg merge' to merge)
272 (run 'hg heads' to see heads, 'hg merge' to merge)
273
273
274 #endif
274 #endif
275
275
276 Cannot produce streaming clone bundles with "hg bundle"
276 Cannot produce streaming clone bundles with "hg bundle"
277
277
278 $ hg -R test bundle -t packed1 packed.hg
278 $ hg -R test bundle -t packed1 packed.hg
279 abort: packed bundles cannot be produced by "hg bundle"
279 abort: packed bundles cannot be produced by "hg bundle"
280 (use 'hg debugcreatestreamclonebundle')
280 (use 'hg debugcreatestreamclonebundle')
281 [10]
281 [10]
282
282
283 packed1 is produced properly
283 packed1 is produced properly
284
284
285
285
286 #if reporevlogstore rust
286 #if reporevlogstore rust
287
287
288 $ hg -R test debugcreatestreamclonebundle packed.hg
288 $ hg -R test debugcreatestreamclonebundle packed.hg
289 writing 2665 bytes for 6 files
289 writing 2665 bytes for 6 files (no-rust !)
290 writing 2919 bytes for 9 files (rust !)
290 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
291 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
291
292
292 $ f -B 64 --size --sha1 --hexdump packed.hg
293 $ f -B 64 --size --sha1 --hexdump packed.hg
293 packed.hg: size=2865, sha1=353d10311f4befa195d9a1ca4b8e26518115c702
294 packed.hg: size=2865, sha1=353d10311f4befa195d9a1ca4b8e26518115c702 (no-rust !)
294 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
295 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........| (no-rust !)
295 0010: 00 00 00 00 0a 69 00 3b 67 65 6e 65 72 61 6c 64 |.....i.;generald|
296 0010: 00 00 00 00 0a 69 00 3b 67 65 6e 65 72 61 6c 64 |.....i.;generald| (no-rust !)
297 packed.hg: size=3181, sha1=b202787710a1c109246554be589506cd2916acb7 (rust !)
298 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 09 00 00 |HGS1UN..........| (rust !)
299 0010: 00 00 00 00 0b 67 00 3b 67 65 6e 65 72 61 6c 64 |.....g.;generald| (rust !)
296 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 2d 63 6f 6d 70 |elta,revlog-comp|
300 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 2d 63 6f 6d 70 |elta,revlog-comp|
297 0030: 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c 72 65 76 |ression-zstd,rev|
301 0030: 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c 72 65 76 |ression-zstd,rev|
298 $ hg debugbundle --spec packed.hg
302 $ hg debugbundle --spec packed.hg
299 none-packed1;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog
303 none-packed1;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog
300 #endif
304 #endif
301
305
302 #if reporevlogstore no-rust zstd
306 #if reporevlogstore no-rust zstd
303
307
304 $ hg -R test debugcreatestreamclonebundle packed.hg
308 $ hg -R test debugcreatestreamclonebundle packed.hg
305 writing 2665 bytes for 6 files
309 writing 2665 bytes for 7 files
306 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
310 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
307
311
308 $ f -B 64 --size --sha1 --hexdump packed.hg
312 $ f -B 64 --size --sha1 --hexdump packed.hg
309 packed.hg: size=2865, sha1=353d10311f4befa195d9a1ca4b8e26518115c702
313 packed.hg: size=2882, sha1=6525b07e6bfced4b6c2319cb58c6ff76ca72fa13
310 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
314 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 07 00 00 |HGS1UN..........|
311 0010: 00 00 00 00 0a 69 00 3b 67 65 6e 65 72 61 6c 64 |.....i.;generald|
315 0010: 00 00 00 00 0a 69 00 3b 67 65 6e 65 72 61 6c 64 |.....i.;generald|
312 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 2d 63 6f 6d 70 |elta,revlog-comp|
316 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 2d 63 6f 6d 70 |elta,revlog-comp|
313 0030: 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c 72 65 76 |ression-zstd,rev|
317 0030: 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c 72 65 76 |ression-zstd,rev|
314 $ hg debugbundle --spec packed.hg
318 $ hg debugbundle --spec packed.hg
315 none-packed1;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog
319 none-packed1;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog
316 #endif
320 #endif
317
321
318 #if reporevlogstore no-rust no-zstd
322 #if reporevlogstore no-rust no-zstd
319
323
320 $ hg -R test debugcreatestreamclonebundle packed.hg
324 $ hg -R test debugcreatestreamclonebundle packed.hg
321 writing 2664 bytes for 6 files
325 writing 2664 bytes for 7 files
322 bundle requirements: generaldelta, revlogv1, sparserevlog
326 bundle requirements: generaldelta, revlogv1, sparserevlog
323
327
324 $ f -B 64 --size --sha1 --hexdump packed.hg
328 $ f -B 64 --size --sha1 --hexdump packed.hg
325 packed.hg: size=2840, sha1=12bf3eee3eb8a04c503ce2d29b48f0135c7edff5
329 packed.hg: size=2857, sha1=3a7353323915b095baa6f2ee0a5aed588f11f5f0
326 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........|
330 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 07 00 00 |HGS1UN..........|
327 0010: 00 00 00 00 0a 68 00 23 67 65 6e 65 72 61 6c 64 |.....h.#generald|
331 0010: 00 00 00 00 0a 68 00 23 67 65 6e 65 72 61 6c 64 |.....h.#generald|
328 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 2c 73 70 |elta,revlogv1,sp|
332 0020: 65 6c 74 61 2c 72 65 76 6c 6f 67 76 31 2c 73 70 |elta,revlogv1,sp|
329 0030: 61 72 73 65 72 65 76 6c 6f 67 00 64 61 74 61 2f |arserevlog.data/|
333 0030: 61 72 73 65 72 65 76 6c 6f 67 00 64 61 74 61 2f |arserevlog.data/|
330 $ hg debugbundle --spec packed.hg
334 $ hg debugbundle --spec packed.hg
331 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog
335 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog
332 #endif
336 #endif
333
337
334 #if reporevlogstore
338 #if reporevlogstore
335
339
336 generaldelta requirement is not listed in stream clone bundles unless used
340 generaldelta requirement is not listed in stream clone bundles unless used
337
341
338 $ hg --config format.usegeneraldelta=false init testnongd
342 $ hg --config format.usegeneraldelta=false init testnongd
339 $ cd testnongd
343 $ cd testnongd
340 $ touch foo
344 $ touch foo
341 $ hg -q commit -A -m initial
345 $ hg -q commit -A -m initial
342 $ cd ..
346 $ cd ..
343
347
344 #endif
348 #endif
345
349
346 #if reporevlogstore rust
350 #if reporevlogstore rust
347
351
348 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
352 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
349 writing 301 bytes for 3 files
353 writing 301 bytes for 3 files (no-rust !)
354 writing 427 bytes for 6 files (rust !)
350 bundle requirements: revlog-compression-zstd, revlogv1
355 bundle requirements: revlog-compression-zstd, revlogv1
351
356
352 $ f -B 64 --size --sha1 --hexdump packednongd.hg
357 $ f -B 64 --size --sha1 --hexdump packednongd.hg
353 packednongd.hg: size=407, sha1=0b8714422b785ba8eb98c916b41ffd5fb994c9b5
358 packednongd.hg: size=407, sha1=0b8714422b785ba8eb98c916b41ffd5fb994c9b5 (no-rust !)
354 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
359 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........| (no-rust !)
355 0010: 00 00 00 00 01 2d 00 21 72 65 76 6c 6f 67 2d 63 |.....-.!revlog-c|
360 0010: 00 00 00 00 01 2d 00 21 72 65 76 6c 6f 67 2d 63 |.....-.!revlog-c| (no-rust !)
361 packednongd.hg: size=593, sha1=1ad0cbea11b5dd7b0437e54ae20fc5f8df118521 (rust !)
362 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 06 00 00 |HGS1UN..........| (rust !)
363 0010: 00 00 00 00 01 ab 00 21 72 65 76 6c 6f 67 2d 63 |.......!revlog-c| (rust !)
356 0020: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c |ompression-zstd,|
364 0020: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c |ompression-zstd,|
357 0030: 72 65 76 6c 6f 67 76 31 00 64 61 74 61 2f 66 6f |revlogv1.data/fo|
365 0030: 72 65 76 6c 6f 67 76 31 00 64 61 74 61 2f 66 6f |revlogv1.data/fo|
358
366
359 $ hg debugbundle --spec packednongd.hg
367 $ hg debugbundle --spec packednongd.hg
360 none-packed1;requirements%3Drevlog-compression-zstd%2Crevlogv1
368 none-packed1;requirements%3Drevlog-compression-zstd%2Crevlogv1
361
369
362 #endif
370 #endif
363
371
364 #if reporevlogstore no-rust zstd
372 #if reporevlogstore no-rust zstd
365
373
366 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
374 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
367 writing 301 bytes for 3 files
375 writing 301 bytes for 4 files
368 bundle requirements: revlog-compression-zstd, revlogv1
376 bundle requirements: revlog-compression-zstd, revlogv1
369
377
370 $ f -B 64 --size --sha1 --hexdump packednongd.hg
378 $ f -B 64 --size --sha1 --hexdump packednongd.hg
371 packednongd.hg: size=407, sha1=0b8714422b785ba8eb98c916b41ffd5fb994c9b5
379 packednongd.hg: size=423, sha1=4269c89cf64b6a4377be75a3983771c4153362bf
372 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
380 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 04 00 00 |HGS1UN..........|
373 0010: 00 00 00 00 01 2d 00 21 72 65 76 6c 6f 67 2d 63 |.....-.!revlog-c|
381 0010: 00 00 00 00 01 2d 00 21 72 65 76 6c 6f 67 2d 63 |.....-.!revlog-c|
374 0020: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c |ompression-zstd,|
382 0020: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 2c |ompression-zstd,|
375 0030: 72 65 76 6c 6f 67 76 31 00 64 61 74 61 2f 66 6f |revlogv1.data/fo|
383 0030: 72 65 76 6c 6f 67 76 31 00 64 61 74 61 2f 66 6f |revlogv1.data/fo|
376
384
377 $ hg debugbundle --spec packednongd.hg
385 $ hg debugbundle --spec packednongd.hg
378 none-packed1;requirements%3Drevlog-compression-zstd%2Crevlogv1
386 none-packed1;requirements%3Drevlog-compression-zstd%2Crevlogv1
379
387
380
388
381 #endif
389 #endif
382
390
383 #if reporevlogstore no-rust no-zstd
391 #if reporevlogstore no-rust no-zstd
384
392
385 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
393 $ hg -R testnongd debugcreatestreamclonebundle packednongd.hg
386 writing 301 bytes for 3 files
394 writing 301 bytes for 4 files
387 bundle requirements: revlogv1
395 bundle requirements: revlogv1
388
396
389 $ f -B 64 --size --sha1 --hexdump packednongd.hg
397 $ f -B 64 --size --sha1 --hexdump packednongd.hg
390 packednongd.hg: size=383, sha1=1d9c230238edd5d38907100b729ba72b1831fe6f
398 packednongd.hg: size=399, sha1=99bb89decfc6674a3cf2cc87accc8c5332ede7fd
391 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 03 00 00 |HGS1UN..........|
399 0000: 48 47 53 31 55 4e 00 00 00 00 00 00 00 04 00 00 |HGS1UN..........|
392 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
400 0010: 00 00 00 00 01 2d 00 09 72 65 76 6c 6f 67 76 31 |.....-..revlogv1|
393 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
401 0020: 00 64 61 74 61 2f 66 6f 6f 2e 69 00 36 34 0a 00 |.data/foo.i.64..|
394 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
402 0030: 01 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
395
403
396 $ hg debugbundle --spec packednongd.hg
404 $ hg debugbundle --spec packednongd.hg
397 none-packed1;requirements%3Drevlogv1
405 none-packed1;requirements%3Drevlogv1
398
406
399
407
400 #endif
408 #endif
401
409
402 #if reporevlogstore
410 #if reporevlogstore
403
411
404 Warning emitted when packed bundles contain secret changesets
412 Warning emitted when packed bundles contain secret changesets
405
413
406 $ hg init testsecret
414 $ hg init testsecret
407 $ cd testsecret
415 $ cd testsecret
408 $ touch foo
416 $ touch foo
409 $ hg -q commit -A -m initial
417 $ hg -q commit -A -m initial
410 $ hg phase --force --secret -r .
418 $ hg phase --force --secret -r .
411 $ cd ..
419 $ cd ..
412
420
413 #endif
421 #endif
414
422
415 #if reporevlogstore rust
423 #if reporevlogstore rust
416
424
417 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
425 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
418 (warning: stream clone bundle will contain secret revisions)
426 (warning: stream clone bundle will contain secret revisions)
419 writing 301 bytes for 3 files
427 writing 301 bytes for 3 files (no-rust !)
428 writing 427 bytes for 6 files (rust !)
420 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
429 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
421
430
422 #endif
431 #endif
423
432
424 #if reporevlogstore no-rust zstd
433 #if reporevlogstore no-rust zstd
425
434
426 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
435 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
427 (warning: stream clone bundle will contain secret revisions)
436 (warning: stream clone bundle will contain secret revisions)
428 writing 301 bytes for 3 files
437 writing 301 bytes for 4 files
429 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
438 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog
430
439
431 #endif
440 #endif
432
441
433 #if reporevlogstore no-rust no-zstd
442 #if reporevlogstore no-rust no-zstd
434
443
435 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
444 $ hg -R testsecret debugcreatestreamclonebundle packedsecret.hg
436 (warning: stream clone bundle will contain secret revisions)
445 (warning: stream clone bundle will contain secret revisions)
437 writing 301 bytes for 3 files
446 writing 301 bytes for 4 files
438 bundle requirements: generaldelta, revlogv1, sparserevlog
447 bundle requirements: generaldelta, revlogv1, sparserevlog
439
448
440 #endif
449 #endif
441
450
442 #if reporevlogstore
451 #if reporevlogstore
443
452
444 Unpacking packed1 bundles with "hg unbundle" isn't allowed
453 Unpacking packed1 bundles with "hg unbundle" isn't allowed
445
454
446 $ hg init packed
455 $ hg init packed
447 $ hg -R packed unbundle packed.hg
456 $ hg -R packed unbundle packed.hg
448 abort: packed bundles cannot be applied with "hg unbundle"
457 abort: packed bundles cannot be applied with "hg unbundle"
449 (use "hg debugapplystreamclonebundle")
458 (use "hg debugapplystreamclonebundle")
450 [10]
459 [10]
451
460
452 packed1 can be consumed from debug command
461 packed1 can be consumed from debug command
453
462
454 (this also confirms that streamclone-ed changes are visible via
463 (this also confirms that streamclone-ed changes are visible via
455 @filecache properties to in-process procedures before closing
464 @filecache properties to in-process procedures before closing
456 transaction)
465 transaction)
457
466
458 $ cat > $TESTTMP/showtip.py <<EOF
467 $ cat > $TESTTMP/showtip.py <<EOF
459 >
468 >
460 > def showtip(ui, repo, hooktype, **kwargs):
469 > def showtip(ui, repo, hooktype, **kwargs):
461 > ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
470 > ui.warn(b'%s: %s\n' % (hooktype, repo[b'tip'].hex()[:12]))
462 >
471 >
463 > def reposetup(ui, repo):
472 > def reposetup(ui, repo):
464 > # this confirms (and ensures) that (empty) 00changelog.i
473 > # this confirms (and ensures) that (empty) 00changelog.i
465 > # before streamclone is already cached as repo.changelog
474 > # before streamclone is already cached as repo.changelog
466 > ui.setconfig(b'hooks', b'pretxnopen.showtip', showtip)
475 > ui.setconfig(b'hooks', b'pretxnopen.showtip', showtip)
467 >
476 >
468 > # this confirms that streamclone-ed changes are visible to
477 > # this confirms that streamclone-ed changes are visible to
469 > # in-process procedures before closing transaction
478 > # in-process procedures before closing transaction
470 > ui.setconfig(b'hooks', b'pretxnclose.showtip', showtip)
479 > ui.setconfig(b'hooks', b'pretxnclose.showtip', showtip)
471 >
480 >
472 > # this confirms that streamclone-ed changes are still visible
481 > # this confirms that streamclone-ed changes are still visible
473 > # after closing transaction
482 > # after closing transaction
474 > ui.setconfig(b'hooks', b'txnclose.showtip', showtip)
483 > ui.setconfig(b'hooks', b'txnclose.showtip', showtip)
475 > EOF
484 > EOF
476 $ cat >> $HGRCPATH <<EOF
485 $ cat >> $HGRCPATH <<EOF
477 > [extensions]
486 > [extensions]
478 > showtip = $TESTTMP/showtip.py
487 > showtip = $TESTTMP/showtip.py
479 > EOF
488 > EOF
480
489
481 $ hg -R packed debugapplystreamclonebundle packed.hg
490 $ hg -R packed debugapplystreamclonebundle packed.hg
482 6 files to transfer, 2.60 KB of data
491 7 files to transfer, 2.60 KB of data (no-rust !)
492 9 files to transfer, 2.85 KB of data (rust !)
483 pretxnopen: 000000000000
493 pretxnopen: 000000000000
484 pretxnclose: aa35859c02ea
494 pretxnclose: aa35859c02ea
485 transferred 2.60 KB in * seconds (* */sec) (glob)
495 transferred 2.60 KB in * seconds (* */sec) (glob) (no-rust !)
496 transferred 2.85 KB in * seconds (* */sec) (glob) (rust !)
486 txnclose: aa35859c02ea
497 txnclose: aa35859c02ea
487
498
488 (for safety, confirm visibility of streamclone-ed changes by another
499 (for safety, confirm visibility of streamclone-ed changes by another
489 process, too)
500 process, too)
490
501
491 $ hg -R packed tip -T "{node|short}\n"
502 $ hg -R packed tip -T "{node|short}\n"
492 aa35859c02ea
503 aa35859c02ea
493
504
494 $ cat >> $HGRCPATH <<EOF
505 $ cat >> $HGRCPATH <<EOF
495 > [extensions]
506 > [extensions]
496 > showtip = !
507 > showtip = !
497 > EOF
508 > EOF
498
509
499 Does not work on non-empty repo
510 Does not work on non-empty repo
500
511
501 $ hg -R packed debugapplystreamclonebundle packed.hg
512 $ hg -R packed debugapplystreamclonebundle packed.hg
502 abort: cannot apply stream clone bundle on non-empty repo
513 abort: cannot apply stream clone bundle on non-empty repo
503 [255]
514 [255]
504
515
505 #endif
516 #endif
506
517
507 Create partial clones
518 Create partial clones
508
519
509 $ rm -r empty
520 $ rm -r empty
510 $ hg init empty
521 $ hg init empty
511 $ hg clone -r 3 test partial
522 $ hg clone -r 3 test partial
512 adding changesets
523 adding changesets
513 adding manifests
524 adding manifests
514 adding file changes
525 adding file changes
515 added 4 changesets with 4 changes to 1 files
526 added 4 changesets with 4 changes to 1 files
516 new changesets f9ee2f85a263:eebf5a27f8ca
527 new changesets f9ee2f85a263:eebf5a27f8ca
517 updating to branch default
528 updating to branch default
518 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
529 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
519 $ hg clone partial partial2
530 $ hg clone partial partial2
520 updating to branch default
531 updating to branch default
521 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
532 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
522 $ cd partial
533 $ cd partial
523
534
524 #if repobundlerepo
535 #if repobundlerepo
525
536
526 Log -R full.hg in partial
537 Log -R full.hg in partial
527
538
528 $ hg -R bundle://../full.hg log -T phases
539 $ hg -R bundle://../full.hg log -T phases
529 changeset: 8:aa35859c02ea
540 changeset: 8:aa35859c02ea
530 tag: tip
541 tag: tip
531 phase: draft
542 phase: draft
532 parent: 3:eebf5a27f8ca
543 parent: 3:eebf5a27f8ca
533 user: test
544 user: test
534 date: Thu Jan 01 00:00:00 1970 +0000
545 date: Thu Jan 01 00:00:00 1970 +0000
535 summary: 0.3m
546 summary: 0.3m
536
547
537 changeset: 7:a6a34bfa0076
548 changeset: 7:a6a34bfa0076
538 phase: draft
549 phase: draft
539 user: test
550 user: test
540 date: Thu Jan 01 00:00:00 1970 +0000
551 date: Thu Jan 01 00:00:00 1970 +0000
541 summary: 1.3m
552 summary: 1.3m
542
553
543 changeset: 6:7373c1169842
554 changeset: 6:7373c1169842
544 phase: draft
555 phase: draft
545 user: test
556 user: test
546 date: Thu Jan 01 00:00:00 1970 +0000
557 date: Thu Jan 01 00:00:00 1970 +0000
547 summary: 1.3
558 summary: 1.3
548
559
549 changeset: 5:1bb50a9436a7
560 changeset: 5:1bb50a9436a7
550 phase: draft
561 phase: draft
551 user: test
562 user: test
552 date: Thu Jan 01 00:00:00 1970 +0000
563 date: Thu Jan 01 00:00:00 1970 +0000
553 summary: 1.2
564 summary: 1.2
554
565
555 changeset: 4:095197eb4973
566 changeset: 4:095197eb4973
556 phase: draft
567 phase: draft
557 parent: 0:f9ee2f85a263
568 parent: 0:f9ee2f85a263
558 user: test
569 user: test
559 date: Thu Jan 01 00:00:00 1970 +0000
570 date: Thu Jan 01 00:00:00 1970 +0000
560 summary: 1.1
571 summary: 1.1
561
572
562 changeset: 3:eebf5a27f8ca
573 changeset: 3:eebf5a27f8ca
563 phase: public
574 phase: public
564 user: test
575 user: test
565 date: Thu Jan 01 00:00:00 1970 +0000
576 date: Thu Jan 01 00:00:00 1970 +0000
566 summary: 0.3
577 summary: 0.3
567
578
568 changeset: 2:e38ba6f5b7e0
579 changeset: 2:e38ba6f5b7e0
569 phase: public
580 phase: public
570 user: test
581 user: test
571 date: Thu Jan 01 00:00:00 1970 +0000
582 date: Thu Jan 01 00:00:00 1970 +0000
572 summary: 0.2
583 summary: 0.2
573
584
574 changeset: 1:34c2bf6b0626
585 changeset: 1:34c2bf6b0626
575 phase: public
586 phase: public
576 user: test
587 user: test
577 date: Thu Jan 01 00:00:00 1970 +0000
588 date: Thu Jan 01 00:00:00 1970 +0000
578 summary: 0.1
589 summary: 0.1
579
590
580 changeset: 0:f9ee2f85a263
591 changeset: 0:f9ee2f85a263
581 phase: public
592 phase: public
582 user: test
593 user: test
583 date: Thu Jan 01 00:00:00 1970 +0000
594 date: Thu Jan 01 00:00:00 1970 +0000
584 summary: 0.0
595 summary: 0.0
585
596
586
597
587 Incoming full.hg in partial
598 Incoming full.hg in partial
588
599
589 $ hg incoming bundle://../full.hg
600 $ hg incoming bundle://../full.hg
590 comparing with bundle:../full.hg
601 comparing with bundle:../full.hg
591 searching for changes
602 searching for changes
592 changeset: 4:095197eb4973
603 changeset: 4:095197eb4973
593 parent: 0:f9ee2f85a263
604 parent: 0:f9ee2f85a263
594 user: test
605 user: test
595 date: Thu Jan 01 00:00:00 1970 +0000
606 date: Thu Jan 01 00:00:00 1970 +0000
596 summary: 1.1
607 summary: 1.1
597
608
598 changeset: 5:1bb50a9436a7
609 changeset: 5:1bb50a9436a7
599 user: test
610 user: test
600 date: Thu Jan 01 00:00:00 1970 +0000
611 date: Thu Jan 01 00:00:00 1970 +0000
601 summary: 1.2
612 summary: 1.2
602
613
603 changeset: 6:7373c1169842
614 changeset: 6:7373c1169842
604 user: test
615 user: test
605 date: Thu Jan 01 00:00:00 1970 +0000
616 date: Thu Jan 01 00:00:00 1970 +0000
606 summary: 1.3
617 summary: 1.3
607
618
608 changeset: 7:a6a34bfa0076
619 changeset: 7:a6a34bfa0076
609 user: test
620 user: test
610 date: Thu Jan 01 00:00:00 1970 +0000
621 date: Thu Jan 01 00:00:00 1970 +0000
611 summary: 1.3m
622 summary: 1.3m
612
623
613 changeset: 8:aa35859c02ea
624 changeset: 8:aa35859c02ea
614 tag: tip
625 tag: tip
615 parent: 3:eebf5a27f8ca
626 parent: 3:eebf5a27f8ca
616 user: test
627 user: test
617 date: Thu Jan 01 00:00:00 1970 +0000
628 date: Thu Jan 01 00:00:00 1970 +0000
618 summary: 0.3m
629 summary: 0.3m
619
630
620
631
621 Outgoing -R full.hg vs partial2 in partial
632 Outgoing -R full.hg vs partial2 in partial
622
633
623 $ hg -R bundle://../full.hg outgoing ../partial2
634 $ hg -R bundle://../full.hg outgoing ../partial2
624 comparing with ../partial2
635 comparing with ../partial2
625 searching for changes
636 searching for changes
626 changeset: 4:095197eb4973
637 changeset: 4:095197eb4973
627 parent: 0:f9ee2f85a263
638 parent: 0:f9ee2f85a263
628 user: test
639 user: test
629 date: Thu Jan 01 00:00:00 1970 +0000
640 date: Thu Jan 01 00:00:00 1970 +0000
630 summary: 1.1
641 summary: 1.1
631
642
632 changeset: 5:1bb50a9436a7
643 changeset: 5:1bb50a9436a7
633 user: test
644 user: test
634 date: Thu Jan 01 00:00:00 1970 +0000
645 date: Thu Jan 01 00:00:00 1970 +0000
635 summary: 1.2
646 summary: 1.2
636
647
637 changeset: 6:7373c1169842
648 changeset: 6:7373c1169842
638 user: test
649 user: test
639 date: Thu Jan 01 00:00:00 1970 +0000
650 date: Thu Jan 01 00:00:00 1970 +0000
640 summary: 1.3
651 summary: 1.3
641
652
642 changeset: 7:a6a34bfa0076
653 changeset: 7:a6a34bfa0076
643 user: test
654 user: test
644 date: Thu Jan 01 00:00:00 1970 +0000
655 date: Thu Jan 01 00:00:00 1970 +0000
645 summary: 1.3m
656 summary: 1.3m
646
657
647 changeset: 8:aa35859c02ea
658 changeset: 8:aa35859c02ea
648 tag: tip
659 tag: tip
649 parent: 3:eebf5a27f8ca
660 parent: 3:eebf5a27f8ca
650 user: test
661 user: test
651 date: Thu Jan 01 00:00:00 1970 +0000
662 date: Thu Jan 01 00:00:00 1970 +0000
652 summary: 0.3m
663 summary: 0.3m
653
664
654
665
655 Outgoing -R does-not-exist.hg vs partial2 in partial
666 Outgoing -R does-not-exist.hg vs partial2 in partial
656
667
657 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
668 $ hg -R bundle://../does-not-exist.hg outgoing ../partial2
658 abort: *../does-not-exist.hg* (glob)
669 abort: *../does-not-exist.hg* (glob)
659 [255]
670 [255]
660
671
661 #endif
672 #endif
662
673
663 $ cd ..
674 $ cd ..
664
675
665 hide outer repo
676 hide outer repo
666 $ hg init
677 $ hg init
667
678
668 Direct clone from bundle (all-history)
679 Direct clone from bundle (all-history)
669
680
670 #if repobundlerepo
681 #if repobundlerepo
671
682
672 $ hg clone full.hg full-clone
683 $ hg clone full.hg full-clone
673 requesting all changes
684 requesting all changes
674 adding changesets
685 adding changesets
675 adding manifests
686 adding manifests
676 adding file changes
687 adding file changes
677 added 9 changesets with 7 changes to 4 files (+1 heads)
688 added 9 changesets with 7 changes to 4 files (+1 heads)
678 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
689 new changesets f9ee2f85a263:aa35859c02ea (9 drafts)
679 updating to branch default
690 updating to branch default
680 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
691 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
681 $ hg -R full-clone heads
692 $ hg -R full-clone heads
682 changeset: 8:aa35859c02ea
693 changeset: 8:aa35859c02ea
683 tag: tip
694 tag: tip
684 parent: 3:eebf5a27f8ca
695 parent: 3:eebf5a27f8ca
685 user: test
696 user: test
686 date: Thu Jan 01 00:00:00 1970 +0000
697 date: Thu Jan 01 00:00:00 1970 +0000
687 summary: 0.3m
698 summary: 0.3m
688
699
689 changeset: 7:a6a34bfa0076
700 changeset: 7:a6a34bfa0076
690 user: test
701 user: test
691 date: Thu Jan 01 00:00:00 1970 +0000
702 date: Thu Jan 01 00:00:00 1970 +0000
692 summary: 1.3m
703 summary: 1.3m
693
704
694 $ rm -r full-clone
705 $ rm -r full-clone
695
706
696 When cloning from a non-copiable repository into '', do not
707 When cloning from a non-copiable repository into '', do not
697 recurse infinitely (issue2528)
708 recurse infinitely (issue2528)
698
709
699 $ hg clone full.hg ''
710 $ hg clone full.hg ''
700 abort: empty destination path is not valid
711 abort: empty destination path is not valid
701 [10]
712 [10]
702
713
703 test for https://bz.mercurial-scm.org/216
714 test for https://bz.mercurial-scm.org/216
704
715
705 Unbundle incremental bundles into fresh empty in one go
716 Unbundle incremental bundles into fresh empty in one go
706
717
707 $ rm -r empty
718 $ rm -r empty
708 $ hg init empty
719 $ hg init empty
709 $ hg -R test bundle --base null -r 0 ../0.hg
720 $ hg -R test bundle --base null -r 0 ../0.hg
710 1 changesets found
721 1 changesets found
711 $ hg -R test bundle --exact -r 1 ../1.hg
722 $ hg -R test bundle --exact -r 1 ../1.hg
712 1 changesets found
723 1 changesets found
713 $ hg -R empty unbundle -u ../0.hg ../1.hg
724 $ hg -R empty unbundle -u ../0.hg ../1.hg
714 adding changesets
725 adding changesets
715 adding manifests
726 adding manifests
716 adding file changes
727 adding file changes
717 added 1 changesets with 1 changes to 1 files
728 added 1 changesets with 1 changes to 1 files
718 new changesets f9ee2f85a263 (1 drafts)
729 new changesets f9ee2f85a263 (1 drafts)
719 adding changesets
730 adding changesets
720 adding manifests
731 adding manifests
721 adding file changes
732 adding file changes
722 added 1 changesets with 1 changes to 1 files
733 added 1 changesets with 1 changes to 1 files
723 new changesets 34c2bf6b0626 (1 drafts)
734 new changesets 34c2bf6b0626 (1 drafts)
724 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
735 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
725
736
726 View full contents of the bundle
737 View full contents of the bundle
727 $ hg -R test bundle --base null -r 3 ../partial.hg
738 $ hg -R test bundle --base null -r 3 ../partial.hg
728 4 changesets found
739 4 changesets found
729 $ cd test
740 $ cd test
730 $ hg -R ../../partial.hg log -r "bundle()"
741 $ hg -R ../../partial.hg log -r "bundle()"
731 changeset: 0:f9ee2f85a263
742 changeset: 0:f9ee2f85a263
732 user: test
743 user: test
733 date: Thu Jan 01 00:00:00 1970 +0000
744 date: Thu Jan 01 00:00:00 1970 +0000
734 summary: 0.0
745 summary: 0.0
735
746
736 changeset: 1:34c2bf6b0626
747 changeset: 1:34c2bf6b0626
737 user: test
748 user: test
738 date: Thu Jan 01 00:00:00 1970 +0000
749 date: Thu Jan 01 00:00:00 1970 +0000
739 summary: 0.1
750 summary: 0.1
740
751
741 changeset: 2:e38ba6f5b7e0
752 changeset: 2:e38ba6f5b7e0
742 user: test
753 user: test
743 date: Thu Jan 01 00:00:00 1970 +0000
754 date: Thu Jan 01 00:00:00 1970 +0000
744 summary: 0.2
755 summary: 0.2
745
756
746 changeset: 3:eebf5a27f8ca
757 changeset: 3:eebf5a27f8ca
747 user: test
758 user: test
748 date: Thu Jan 01 00:00:00 1970 +0000
759 date: Thu Jan 01 00:00:00 1970 +0000
749 summary: 0.3
760 summary: 0.3
750
761
751 $ cd ..
762 $ cd ..
752
763
753 #endif
764 #endif
754
765
755 test for 540d1059c802
766 test for 540d1059c802
756
767
757 $ hg init orig
768 $ hg init orig
758 $ cd orig
769 $ cd orig
759 $ echo foo > foo
770 $ echo foo > foo
760 $ hg add foo
771 $ hg add foo
761 $ hg ci -m 'add foo'
772 $ hg ci -m 'add foo'
762
773
763 $ hg clone . ../copy
774 $ hg clone . ../copy
764 updating to branch default
775 updating to branch default
765 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
776 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
766 $ hg tag foo
777 $ hg tag foo
767
778
768 $ cd ../copy
779 $ cd ../copy
769 $ echo >> foo
780 $ echo >> foo
770 $ hg ci -m 'change foo'
781 $ hg ci -m 'change foo'
771 $ hg bundle ../bundle.hg ../orig
782 $ hg bundle ../bundle.hg ../orig
772 searching for changes
783 searching for changes
773 1 changesets found
784 1 changesets found
774
785
775 $ cd ..
786 $ cd ..
776
787
777 #if repobundlerepo
788 #if repobundlerepo
778 $ cd orig
789 $ cd orig
779 $ hg incoming ../bundle.hg
790 $ hg incoming ../bundle.hg
780 comparing with ../bundle.hg
791 comparing with ../bundle.hg
781 searching for changes
792 searching for changes
782 changeset: 2:ed1b79f46b9a
793 changeset: 2:ed1b79f46b9a
783 tag: tip
794 tag: tip
784 parent: 0:bbd179dfa0a7
795 parent: 0:bbd179dfa0a7
785 user: test
796 user: test
786 date: Thu Jan 01 00:00:00 1970 +0000
797 date: Thu Jan 01 00:00:00 1970 +0000
787 summary: change foo
798 summary: change foo
788
799
789 $ cd ..
800 $ cd ..
790
801
791 test bundle with # in the filename (issue2154):
802 test bundle with # in the filename (issue2154):
792
803
793 $ cp bundle.hg 'test#bundle.hg'
804 $ cp bundle.hg 'test#bundle.hg'
794 $ cd orig
805 $ cd orig
795 $ hg incoming '../test#bundle.hg'
806 $ hg incoming '../test#bundle.hg'
796 comparing with ../test
807 comparing with ../test
797 abort: unknown revision 'bundle.hg'
808 abort: unknown revision 'bundle.hg'
798 [10]
809 [10]
799
810
800 note that percent encoding is not handled:
811 note that percent encoding is not handled:
801
812
802 $ hg incoming ../test%23bundle.hg
813 $ hg incoming ../test%23bundle.hg
803 abort: repository ../test%23bundle.hg not found
814 abort: repository ../test%23bundle.hg not found
804 [255]
815 [255]
805 $ cd ..
816 $ cd ..
806
817
807 #endif
818 #endif
808
819
809 test to bundle revisions on the newly created branch (issue3828):
820 test to bundle revisions on the newly created branch (issue3828):
810
821
811 $ hg -q clone -U test test-clone
822 $ hg -q clone -U test test-clone
812 $ cd test
823 $ cd test
813
824
814 $ hg -q branch foo
825 $ hg -q branch foo
815 $ hg commit -m "create foo branch"
826 $ hg commit -m "create foo branch"
816 $ hg -q outgoing ../test-clone
827 $ hg -q outgoing ../test-clone
817 9:b4f5acb1ee27
828 9:b4f5acb1ee27
818 $ hg -q bundle --branch foo foo.hg ../test-clone
829 $ hg -q bundle --branch foo foo.hg ../test-clone
819 #if repobundlerepo
830 #if repobundlerepo
820 $ hg -R foo.hg -q log -r "bundle()"
831 $ hg -R foo.hg -q log -r "bundle()"
821 9:b4f5acb1ee27
832 9:b4f5acb1ee27
822 #endif
833 #endif
823
834
824 $ cd ..
835 $ cd ..
825
836
826 test for https://bz.mercurial-scm.org/1144
837 test for https://bz.mercurial-scm.org/1144
827
838
828 test that verify bundle does not traceback
839 test that verify bundle does not traceback
829
840
830 partial history bundle, fails w/ unknown parent
841 partial history bundle, fails w/ unknown parent
831
842
832 $ hg -R bundle.hg verify
843 $ hg -R bundle.hg verify
833 abort: 00changelog@bbd179dfa0a71671c253b3ae0aa1513b60d199fa: unknown parent
844 abort: 00changelog@bbd179dfa0a71671c253b3ae0aa1513b60d199fa: unknown parent
834 [50]
845 [50]
835
846
836 full history bundle, refuses to verify non-local repo
847 full history bundle, refuses to verify non-local repo
837
848
838 #if repobundlerepo
849 #if repobundlerepo
839 $ hg -R all.hg verify
850 $ hg -R all.hg verify
840 abort: cannot verify bundle or remote repos
851 abort: cannot verify bundle or remote repos
841 [255]
852 [255]
842 #endif
853 #endif
843
854
844 but, regular verify must continue to work
855 but, regular verify must continue to work
845
856
846 $ hg -R orig verify -q
857 $ hg -R orig verify -q
847
858
848 #if repobundlerepo
859 #if repobundlerepo
849 diff against bundle
860 diff against bundle
850
861
851 $ hg init b
862 $ hg init b
852 $ cd b
863 $ cd b
853 $ hg -R ../all.hg diff -r tip
864 $ hg -R ../all.hg diff -r tip
854 diff -r aa35859c02ea anotherfile
865 diff -r aa35859c02ea anotherfile
855 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
866 --- a/anotherfile Thu Jan 01 00:00:00 1970 +0000
856 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
867 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
857 @@ -1,4 +0,0 @@
868 @@ -1,4 +0,0 @@
858 -0
869 -0
859 -1
870 -1
860 -2
871 -2
861 -3
872 -3
862 $ cd ..
873 $ cd ..
863 #endif
874 #endif
864
875
865 bundle single branch
876 bundle single branch
866
877
867 $ hg init branchy
878 $ hg init branchy
868 $ cd branchy
879 $ cd branchy
869 $ echo a >a
880 $ echo a >a
870 $ echo x >x
881 $ echo x >x
871 $ hg ci -Ama
882 $ hg ci -Ama
872 adding a
883 adding a
873 adding x
884 adding x
874 $ echo c >c
885 $ echo c >c
875 $ echo xx >x
886 $ echo xx >x
876 $ hg ci -Amc
887 $ hg ci -Amc
877 adding c
888 adding c
878 $ echo c1 >c1
889 $ echo c1 >c1
879 $ hg ci -Amc1
890 $ hg ci -Amc1
880 adding c1
891 adding c1
881 $ hg up 0
892 $ hg up 0
882 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
893 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
883 $ echo b >b
894 $ echo b >b
884 $ hg ci -Amb
895 $ hg ci -Amb
885 adding b
896 adding b
886 created new head
897 created new head
887 $ echo b1 >b1
898 $ echo b1 >b1
888 $ echo xx >x
899 $ echo xx >x
889 $ hg ci -Amb1
900 $ hg ci -Amb1
890 adding b1
901 adding b1
891 $ hg clone -q -r2 . part
902 $ hg clone -q -r2 . part
892
903
893 == bundling via incoming
904 == bundling via incoming
894
905
895 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
906 $ hg in -R part --bundle incoming.hg --template "{node}\n" .
896 comparing with .
907 comparing with .
897 searching for changes
908 searching for changes
898 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
909 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
899 057f4db07f61970e1c11e83be79e9d08adc4dc31
910 057f4db07f61970e1c11e83be79e9d08adc4dc31
900
911
901 == bundling
912 == bundling
902
913
903 $ hg bundle bundle.hg part --debug --config progress.debug=true
914 $ hg bundle bundle.hg part --debug --config progress.debug=true
904 query 1; heads
915 query 1; heads
905 searching for changes
916 searching for changes
906 all remote heads known locally
917 all remote heads known locally
907 2 changesets found
918 2 changesets found
908 list of changesets:
919 list of changesets:
909 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
920 1a38c1b849e8b70c756d2d80b0b9a3ac0b7ea11a
910 057f4db07f61970e1c11e83be79e9d08adc4dc31
921 057f4db07f61970e1c11e83be79e9d08adc4dc31
911 bundle2-output-bundle: "HG20", (1 params) 2 parts total
922 bundle2-output-bundle: "HG20", (1 params) 2 parts total
912 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
923 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
913 changesets: 1/2 chunks (50.00%)
924 changesets: 1/2 chunks (50.00%)
914 changesets: 2/2 chunks (100.00%)
925 changesets: 2/2 chunks (100.00%)
915 manifests: 1/2 chunks (50.00%)
926 manifests: 1/2 chunks (50.00%)
916 manifests: 2/2 chunks (100.00%)
927 manifests: 2/2 chunks (100.00%)
917 files: b 1/3 files (33.33%)
928 files: b 1/3 files (33.33%)
918 files: b1 2/3 files (66.67%)
929 files: b1 2/3 files (66.67%)
919 files: x 3/3 files (100.00%)
930 files: x 3/3 files (100.00%)
920 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
931 bundle2-output-part: "cache:rev-branch-cache" (advisory) streamed payload
921
932
922 #if repobundlerepo
933 #if repobundlerepo
923 == Test for issue3441
934 == Test for issue3441
924
935
925 $ hg clone -q -r0 . part2
936 $ hg clone -q -r0 . part2
926 $ hg -q -R part2 pull bundle.hg
937 $ hg -q -R part2 pull bundle.hg
927 $ hg -R part2 verify -q
938 $ hg -R part2 verify -q
928 #endif
939 #endif
929
940
930 == Test bundling no commits
941 == Test bundling no commits
931
942
932 $ hg bundle -r 'public()' no-output.hg
943 $ hg bundle -r 'public()' no-output.hg
933 abort: no commits to bundle
944 abort: no commits to bundle
934 [10]
945 [10]
935
946
936 $ cd ..
947 $ cd ..
937
948
938 When user merges to the revision existing only in the bundle,
949 When user merges to the revision existing only in the bundle,
939 it should show warning that second parent of the working
950 it should show warning that second parent of the working
940 directory does not exist
951 directory does not exist
941
952
942 $ hg init update2bundled
953 $ hg init update2bundled
943 $ cd update2bundled
954 $ cd update2bundled
944 $ cat <<EOF >> .hg/hgrc
955 $ cat <<EOF >> .hg/hgrc
945 > [extensions]
956 > [extensions]
946 > strip =
957 > strip =
947 > EOF
958 > EOF
948 $ echo "aaa" >> a
959 $ echo "aaa" >> a
949 $ hg commit -A -m 0
960 $ hg commit -A -m 0
950 adding a
961 adding a
951 $ echo "bbb" >> b
962 $ echo "bbb" >> b
952 $ hg commit -A -m 1
963 $ hg commit -A -m 1
953 adding b
964 adding b
954 $ echo "ccc" >> c
965 $ echo "ccc" >> c
955 $ hg commit -A -m 2
966 $ hg commit -A -m 2
956 adding c
967 adding c
957 $ hg update -r 1
968 $ hg update -r 1
958 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
969 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
959 $ echo "ddd" >> d
970 $ echo "ddd" >> d
960 $ hg commit -A -m 3
971 $ hg commit -A -m 3
961 adding d
972 adding d
962 created new head
973 created new head
963 $ hg update -r 2
974 $ hg update -r 2
964 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
975 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
965 $ hg log -G
976 $ hg log -G
966 o changeset: 3:8bd3e1f196af
977 o changeset: 3:8bd3e1f196af
967 | tag: tip
978 | tag: tip
968 | parent: 1:a01eca7af26d
979 | parent: 1:a01eca7af26d
969 | user: test
980 | user: test
970 | date: Thu Jan 01 00:00:00 1970 +0000
981 | date: Thu Jan 01 00:00:00 1970 +0000
971 | summary: 3
982 | summary: 3
972 |
983 |
973 | @ changeset: 2:4652c276ac4f
984 | @ changeset: 2:4652c276ac4f
974 |/ user: test
985 |/ user: test
975 | date: Thu Jan 01 00:00:00 1970 +0000
986 | date: Thu Jan 01 00:00:00 1970 +0000
976 | summary: 2
987 | summary: 2
977 |
988 |
978 o changeset: 1:a01eca7af26d
989 o changeset: 1:a01eca7af26d
979 | user: test
990 | user: test
980 | date: Thu Jan 01 00:00:00 1970 +0000
991 | date: Thu Jan 01 00:00:00 1970 +0000
981 | summary: 1
992 | summary: 1
982 |
993 |
983 o changeset: 0:4fe08cd4693e
994 o changeset: 0:4fe08cd4693e
984 user: test
995 user: test
985 date: Thu Jan 01 00:00:00 1970 +0000
996 date: Thu Jan 01 00:00:00 1970 +0000
986 summary: 0
997 summary: 0
987
998
988
999
989 #if repobundlerepo
1000 #if repobundlerepo
990 $ hg bundle --base 1 -r 3 ../update2bundled.hg
1001 $ hg bundle --base 1 -r 3 ../update2bundled.hg
991 1 changesets found
1002 1 changesets found
992 $ hg strip -r 3
1003 $ hg strip -r 3
993 saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg
1004 saved backup bundle to $TESTTMP/update2bundled/.hg/strip-backup/8bd3e1f196af-017e56d8-backup.hg
994 $ hg merge -R ../update2bundled.hg -r 3
1005 $ hg merge -R ../update2bundled.hg -r 3
995 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
1006 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
996 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1007 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
997 (branch merge, don't forget to commit)
1008 (branch merge, don't forget to commit)
998
1009
999 When user updates to the revision existing only in the bundle,
1010 When user updates to the revision existing only in the bundle,
1000 it should show warning
1011 it should show warning
1001
1012
1002 $ hg update -R ../update2bundled.hg --clean -r 3
1013 $ hg update -R ../update2bundled.hg --clean -r 3
1003 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
1014 setting parent to node 8bd3e1f196af289b2b121be08031e76d7ae92098 that only exists in the bundle
1004 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1015 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1005
1016
1006 When user updates to the revision existing in the local repository
1017 When user updates to the revision existing in the local repository
1007 the warning shouldn't be emitted
1018 the warning shouldn't be emitted
1008
1019
1009 $ hg update -R ../update2bundled.hg -r 0
1020 $ hg update -R ../update2bundled.hg -r 0
1010 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1021 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1011 #endif
1022 #endif
1012
1023
1013 Test the option that create slim bundle
1024 Test the option that create slim bundle
1014
1025
1015 $ hg bundle -a --config devel.bundle.delta=p1 ./slim.hg
1026 $ hg bundle -a --config devel.bundle.delta=p1 ./slim.hg
1016 3 changesets found
1027 3 changesets found
1017
1028
1018 Test the option that create and no-delta's bundle
1029 Test the option that create and no-delta's bundle
1019 $ hg bundle -a --config devel.bundle.delta=full ./full.hg
1030 $ hg bundle -a --config devel.bundle.delta=full ./full.hg
1020 3 changesets found
1031 3 changesets found
1021
1032
1022
1033
1023 Test the debug statistic when building a bundle
1034 Test the debug statistic when building a bundle
1024 -----------------------------------------------
1035 -----------------------------------------------
1025
1036
1026 $ hg bundle -a ./default.hg --config debug.bundling-stats=yes
1037 $ hg bundle -a ./default.hg --config debug.bundling-stats=yes
1027 3 changesets found
1038 3 changesets found
1028 DEBUG-BUNDLING: revisions: 9
1039 DEBUG-BUNDLING: revisions: 9
1029 DEBUG-BUNDLING: changelog: 3
1040 DEBUG-BUNDLING: changelog: 3
1030 DEBUG-BUNDLING: manifest: 3
1041 DEBUG-BUNDLING: manifest: 3
1031 DEBUG-BUNDLING: files: 3 (for 3 revlogs)
1042 DEBUG-BUNDLING: files: 3 (for 3 revlogs)
1032 DEBUG-BUNDLING: deltas:
1043 DEBUG-BUNDLING: deltas:
1033 DEBUG-BUNDLING: from-storage: 2 (100% of available 2)
1044 DEBUG-BUNDLING: from-storage: 2 (100% of available 2)
1034 DEBUG-BUNDLING: computed: 7
1045 DEBUG-BUNDLING: computed: 7
1035 DEBUG-BUNDLING: full: 7 (100% of native 7)
1046 DEBUG-BUNDLING: full: 7 (100% of native 7)
1036 DEBUG-BUNDLING: changelog: 3 (100% of native 3)
1047 DEBUG-BUNDLING: changelog: 3 (100% of native 3)
1037 DEBUG-BUNDLING: manifests: 1 (100% of native 1)
1048 DEBUG-BUNDLING: manifests: 1 (100% of native 1)
1038 DEBUG-BUNDLING: files: 3 (100% of native 3)
1049 DEBUG-BUNDLING: files: 3 (100% of native 3)
1039
1050
1040 Test the debug output when applying delta
1051 Test the debug output when applying delta
1041 -----------------------------------------
1052 -----------------------------------------
1042
1053
1043 $ hg init foo
1054 $ hg init foo
1044 $ hg -R foo unbundle ./slim.hg \
1055 $ hg -R foo unbundle ./slim.hg \
1045 > --config debug.revlog.debug-delta=yes \
1056 > --config debug.revlog.debug-delta=yes \
1046 > --config storage.revlog.reuse-external-delta=no \
1057 > --config storage.revlog.reuse-external-delta=no \
1047 > --config storage.revlog.reuse-external-delta-parent=no
1058 > --config storage.revlog.reuse-external-delta-parent=no
1048 adding changesets
1059 adding changesets
1049 DBG-DELTAS: CHANGELOG: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1060 DBG-DELTAS: CHANGELOG: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1050 DBG-DELTAS: CHANGELOG: rev=1: delta-base=1 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1061 DBG-DELTAS: CHANGELOG: rev=1: delta-base=1 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1051 DBG-DELTAS: CHANGELOG: rev=2: delta-base=2 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1062 DBG-DELTAS: CHANGELOG: rev=2: delta-base=2 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1052 adding manifests
1063 adding manifests
1053 DBG-DELTAS: MANIFESTLOG: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1064 DBG-DELTAS: MANIFESTLOG: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1054 DBG-DELTAS: MANIFESTLOG: rev=1: delta-base=0 is-cached=1 - search-rounds=1 try-count=1 - delta-type=delta snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1065 DBG-DELTAS: MANIFESTLOG: rev=1: delta-base=0 is-cached=1 - search-rounds=1 try-count=1 - delta-type=delta snap-depth=0 - p1-chain-length=0 p2-chain-length=-1 - duration=* (glob)
1055 DBG-DELTAS: MANIFESTLOG: rev=2: delta-base=1 is-cached=1 - search-rounds=1 try-count=1 - delta-type=delta snap-depth=0 - p1-chain-length=1 p2-chain-length=-1 - duration=* (glob)
1066 DBG-DELTAS: MANIFESTLOG: rev=2: delta-base=1 is-cached=1 - search-rounds=1 try-count=1 - delta-type=delta snap-depth=0 - p1-chain-length=1 p2-chain-length=-1 - duration=* (glob)
1056 adding file changes
1067 adding file changes
1057 DBG-DELTAS: FILELOG:a: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1068 DBG-DELTAS: FILELOG:a: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1058 DBG-DELTAS: FILELOG:b: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1069 DBG-DELTAS: FILELOG:b: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1059 DBG-DELTAS: FILELOG:c: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1070 DBG-DELTAS: FILELOG:c: rev=0: delta-base=0 is-cached=1 - search-rounds=0 try-count=0 - delta-type=full snap-depth=0 - p1-chain-length=-1 p2-chain-length=-1 - duration=* (glob)
1060 added 3 changesets with 3 changes to 3 files
1071 added 3 changesets with 3 changes to 3 files
1061 new changesets 4fe08cd4693e:4652c276ac4f (3 drafts)
1072 new changesets 4fe08cd4693e:4652c276ac4f (3 drafts)
1062 (run 'hg update' to get a working copy)
1073 (run 'hg update' to get a working copy)
1063
1074
1064
1075
1065 Test the debug statistic when applying a bundle
1076 Test the debug statistic when applying a bundle
1066 -----------------------------------------------
1077 -----------------------------------------------
1067
1078
1068 $ hg init bar
1079 $ hg init bar
1069 $ hg -R bar unbundle ./default.hg --config debug.unbundling-stats=yes
1080 $ hg -R bar unbundle ./default.hg --config debug.unbundling-stats=yes
1070 adding changesets
1081 adding changesets
1071 adding manifests
1082 adding manifests
1072 adding file changes
1083 adding file changes
1073 DEBUG-UNBUNDLING: revisions: 9
1084 DEBUG-UNBUNDLING: revisions: 9
1074 DEBUG-UNBUNDLING: changelog: 3 ( 33%)
1085 DEBUG-UNBUNDLING: changelog: 3 ( 33%)
1075 DEBUG-UNBUNDLING: manifests: 3 ( 33%)
1086 DEBUG-UNBUNDLING: manifests: 3 ( 33%)
1076 DEBUG-UNBUNDLING: files: 3 ( 33%)
1087 DEBUG-UNBUNDLING: files: 3 ( 33%)
1077 DEBUG-UNBUNDLING: total-time: ?????????????? seconds (glob)
1088 DEBUG-UNBUNDLING: total-time: ?????????????? seconds (glob)
1078 DEBUG-UNBUNDLING: changelog: ?????????????? seconds (???%) (glob)
1089 DEBUG-UNBUNDLING: changelog: ?????????????? seconds (???%) (glob)
1079 DEBUG-UNBUNDLING: manifests: ?????????????? seconds (???%) (glob)
1090 DEBUG-UNBUNDLING: manifests: ?????????????? seconds (???%) (glob)
1080 DEBUG-UNBUNDLING: files: ?????????????? seconds (???%) (glob)
1091 DEBUG-UNBUNDLING: files: ?????????????? seconds (???%) (glob)
1081 DEBUG-UNBUNDLING: type-count:
1092 DEBUG-UNBUNDLING: type-count:
1082 DEBUG-UNBUNDLING: changelog:
1093 DEBUG-UNBUNDLING: changelog:
1083 DEBUG-UNBUNDLING: full: 3
1094 DEBUG-UNBUNDLING: full: 3
1084 DEBUG-UNBUNDLING: cached: 3 (100%)
1095 DEBUG-UNBUNDLING: cached: 3 (100%)
1085 DEBUG-UNBUNDLING: manifests:
1096 DEBUG-UNBUNDLING: manifests:
1086 DEBUG-UNBUNDLING: full: 1
1097 DEBUG-UNBUNDLING: full: 1
1087 DEBUG-UNBUNDLING: cached: 1 (100%)
1098 DEBUG-UNBUNDLING: cached: 1 (100%)
1088 DEBUG-UNBUNDLING: delta: 2
1099 DEBUG-UNBUNDLING: delta: 2
1089 DEBUG-UNBUNDLING: cached: 2 (100%)
1100 DEBUG-UNBUNDLING: cached: 2 (100%)
1090 DEBUG-UNBUNDLING: files:
1101 DEBUG-UNBUNDLING: files:
1091 DEBUG-UNBUNDLING: full: 3
1102 DEBUG-UNBUNDLING: full: 3
1092 DEBUG-UNBUNDLING: cached: 3 (100%)
1103 DEBUG-UNBUNDLING: cached: 3 (100%)
1093 DEBUG-UNBUNDLING: type-time:
1104 DEBUG-UNBUNDLING: type-time:
1094 DEBUG-UNBUNDLING: changelog:
1105 DEBUG-UNBUNDLING: changelog:
1095 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1106 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1096 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1107 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1097 DEBUG-UNBUNDLING: manifests:
1108 DEBUG-UNBUNDLING: manifests:
1098 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1109 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1099 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1110 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1100 DEBUG-UNBUNDLING: delta: ?????????????? seconds (???% of total) (glob)
1111 DEBUG-UNBUNDLING: delta: ?????????????? seconds (???% of total) (glob)
1101 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1112 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1102 DEBUG-UNBUNDLING: files:
1113 DEBUG-UNBUNDLING: files:
1103 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1114 DEBUG-UNBUNDLING: full: ?????????????? seconds (???% of total) (glob)
1104 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1115 DEBUG-UNBUNDLING: cached: ?????????????? seconds (???% of total) (glob)
1105 added 3 changesets with 3 changes to 3 files
1116 added 3 changesets with 3 changes to 3 files
1106 new changesets 4fe08cd4693e:4652c276ac4f (3 drafts)
1117 new changesets 4fe08cd4693e:4652c276ac4f (3 drafts)
1107 (run 'hg update' to get a working copy)
1118 (run 'hg update' to get a working copy)
@@ -1,1134 +1,1136 b''
1 Test exchange of common information using bundle2
1 Test exchange of common information using bundle2
2
2
3
3
4 $ getmainid() {
4 $ getmainid() {
5 > hg -R main log --template '{node}\n' --rev "$1"
5 > hg -R main log --template '{node}\n' --rev "$1"
6 > }
6 > }
7
7
8 enable obsolescence
8 enable obsolescence
9
9
10 $ cp $HGRCPATH $TESTTMP/hgrc.orig
10 $ cp $HGRCPATH $TESTTMP/hgrc.orig
11 $ cat > $TESTTMP/bundle2-pushkey-hook.sh << EOF
11 $ cat > $TESTTMP/bundle2-pushkey-hook.sh << EOF
12 > echo pushkey: lock state after \"\$HG_NAMESPACE\"
12 > echo pushkey: lock state after \"\$HG_NAMESPACE\"
13 > hg debuglock
13 > hg debuglock
14 > EOF
14 > EOF
15
15
16 $ cat >> $HGRCPATH << EOF
16 $ cat >> $HGRCPATH << EOF
17 > [experimental]
17 > [experimental]
18 > evolution.createmarkers=True
18 > evolution.createmarkers=True
19 > evolution.exchange=True
19 > evolution.exchange=True
20 > bundle2-output-capture=True
20 > bundle2-output-capture=True
21 > [command-templates]
21 > [command-templates]
22 > log={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
22 > log={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
23 > [web]
23 > [web]
24 > push_ssl = false
24 > push_ssl = false
25 > allow_push = *
25 > allow_push = *
26 > [phases]
26 > [phases]
27 > publish=False
27 > publish=False
28 > [hooks]
28 > [hooks]
29 > pretxnclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
29 > pretxnclose.tip = hg log -r tip -T "pre-close-tip:{node|short} {phase} {bookmarks}\n"
30 > txnclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
30 > txnclose.tip = hg log -r tip -T "postclose-tip:{node|short} {phase} {bookmarks}\n"
31 > txnclose.env = sh -c "HG_LOCAL= printenv.py txnclose"
31 > txnclose.env = sh -c "HG_LOCAL= printenv.py txnclose"
32 > pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh"
32 > pushkey= sh "$TESTTMP/bundle2-pushkey-hook.sh"
33 > EOF
33 > EOF
34
34
35 The extension requires a repo (currently unused)
35 The extension requires a repo (currently unused)
36
36
37 $ hg init main
37 $ hg init main
38 $ cd main
38 $ cd main
39 $ touch a
39 $ touch a
40 $ hg add a
40 $ hg add a
41 $ hg commit -m 'a'
41 $ hg commit -m 'a'
42 pre-close-tip:3903775176ed draft
42 pre-close-tip:3903775176ed draft
43 postclose-tip:3903775176ed draft
43 postclose-tip:3903775176ed draft
44 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
44 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
45
45
46 $ hg unbundle $TESTDIR/bundles/rebase.hg
46 $ hg unbundle $TESTDIR/bundles/rebase.hg
47 adding changesets
47 adding changesets
48 adding manifests
48 adding manifests
49 adding file changes
49 adding file changes
50 pre-close-tip:02de42196ebe draft
50 pre-close-tip:02de42196ebe draft
51 added 8 changesets with 7 changes to 7 files (+3 heads)
51 added 8 changesets with 7 changes to 7 files (+3 heads)
52 new changesets cd010b8cd998:02de42196ebe (8 drafts)
52 new changesets cd010b8cd998:02de42196ebe (8 drafts)
53 postclose-tip:02de42196ebe draft
53 postclose-tip:02de42196ebe draft
54 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=unbundle HG_TXNID=TXN:$ID$ HG_TXNNAME=unbundle
54 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=unbundle HG_TXNID=TXN:$ID$ HG_TXNNAME=unbundle
55 bundle:*/tests/bundles/rebase.hg HG_URL=bundle:*/tests/bundles/rebase.hg (glob)
55 bundle:*/tests/bundles/rebase.hg HG_URL=bundle:*/tests/bundles/rebase.hg (glob)
56 (run 'hg heads' to see heads, 'hg merge' to merge)
56 (run 'hg heads' to see heads, 'hg merge' to merge)
57
57
58 $ cd ..
58 $ cd ..
59
59
60 Real world exchange
60 Real world exchange
61 =====================
61 =====================
62
62
63 Add more obsolescence information
63 Add more obsolescence information
64
64
65 $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc`
65 $ hg -R main debugobsolete -d '0 0' 1111111111111111111111111111111111111111 `getmainid 9520eea781bc`
66 pre-close-tip:02de42196ebe draft
66 pre-close-tip:02de42196ebe draft
67 1 new obsolescence markers
67 1 new obsolescence markers
68 postclose-tip:02de42196ebe draft
68 postclose-tip:02de42196ebe draft
69 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
69 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
70 $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
70 $ hg -R main debugobsolete -d '0 0' 2222222222222222222222222222222222222222 `getmainid 24b6387c8c8c`
71 pre-close-tip:02de42196ebe draft
71 pre-close-tip:02de42196ebe draft
72 1 new obsolescence markers
72 1 new obsolescence markers
73 postclose-tip:02de42196ebe draft
73 postclose-tip:02de42196ebe draft
74 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
74 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
75
75
76 clone --pull
76 clone --pull
77
77
78 $ hg -R main phase --public cd010b8cd998
78 $ hg -R main phase --public cd010b8cd998
79 pre-close-tip:02de42196ebe draft
79 pre-close-tip:02de42196ebe draft
80 postclose-tip:02de42196ebe draft
80 postclose-tip:02de42196ebe draft
81 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
81 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
82 $ hg clone main other --pull --rev 9520eea781bc
82 $ hg clone main other --pull --rev 9520eea781bc
83 adding changesets
83 adding changesets
84 adding manifests
84 adding manifests
85 adding file changes
85 adding file changes
86 pre-close-tip:9520eea781bc draft
86 pre-close-tip:9520eea781bc draft
87 added 2 changesets with 2 changes to 2 files
87 added 2 changesets with 2 changes to 2 files
88 1 new obsolescence markers
88 1 new obsolescence markers
89 new changesets cd010b8cd998:9520eea781bc (1 drafts)
89 new changesets cd010b8cd998:9520eea781bc (1 drafts)
90 postclose-tip:9520eea781bc draft
90 postclose-tip:9520eea781bc draft
91 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=9520eea781bcca16c1e15acc0ba14335a0e8e5ba HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
91 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=cd010b8cd998f3981a5a8115f94f8da4ab506089 HG_NODE_LAST=9520eea781bcca16c1e15acc0ba14335a0e8e5ba HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
92 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
92 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
93 updating to branch default
93 updating to branch default
94 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 $ hg -R other log -G
95 $ hg -R other log -G
96 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
96 @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
97 |
97 |
98 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
98 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
99
99
100 $ hg -R other debugobsolete
100 $ hg -R other debugobsolete
101 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
101 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
102
102
103 pull
103 pull
104
104
105 $ hg -R main phase --public 9520eea781bc
105 $ hg -R main phase --public 9520eea781bc
106 pre-close-tip:02de42196ebe draft
106 pre-close-tip:02de42196ebe draft
107 postclose-tip:02de42196ebe draft
107 postclose-tip:02de42196ebe draft
108 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
108 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
109 $ hg -R other pull -r 24b6387c8c8c
109 $ hg -R other pull -r 24b6387c8c8c
110 pulling from $TESTTMP/main
110 pulling from $TESTTMP/main
111 searching for changes
111 searching for changes
112 adding changesets
112 adding changesets
113 adding manifests
113 adding manifests
114 adding file changes
114 adding file changes
115 pre-close-tip:24b6387c8c8c draft
115 pre-close-tip:24b6387c8c8c draft
116 added 1 changesets with 1 changes to 1 files (+1 heads)
116 added 1 changesets with 1 changes to 1 files (+1 heads)
117 1 new obsolescence markers
117 1 new obsolescence markers
118 new changesets 24b6387c8c8c (1 drafts)
118 new changesets 24b6387c8c8c (1 drafts)
119 postclose-tip:24b6387c8c8c draft
119 postclose-tip:24b6387c8c8c draft
120 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_NODE_LAST=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
120 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_NODE_LAST=24b6387c8c8cae37178880f3fa95ded3cb1cf785 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
121 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
121 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
122 (run 'hg heads' to see heads, 'hg merge' to merge)
122 (run 'hg heads' to see heads, 'hg merge' to merge)
123 $ hg -R other log -G
123 $ hg -R other log -G
124 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
124 o 2:24b6387c8c8c draft Nicolas Dumazet <nicdumz.commits@gmail.com> F
125 |
125 |
126 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
126 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
127 |/
127 |/
128 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
128 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
129
129
130 $ hg -R other debugobsolete
130 $ hg -R other debugobsolete
131 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
131 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
132 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
132 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
133
133
134 pull empty (with phase movement)
134 pull empty (with phase movement)
135
135
136 $ hg -R main phase --public 24b6387c8c8c
136 $ hg -R main phase --public 24b6387c8c8c
137 pre-close-tip:02de42196ebe draft
137 pre-close-tip:02de42196ebe draft
138 postclose-tip:02de42196ebe draft
138 postclose-tip:02de42196ebe draft
139 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
139 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
140 $ hg -R other pull -r 24b6387c8c8c
140 $ hg -R other pull -r 24b6387c8c8c
141 pulling from $TESTTMP/main
141 pulling from $TESTTMP/main
142 no changes found
142 no changes found
143 pre-close-tip:24b6387c8c8c public
143 pre-close-tip:24b6387c8c8c public
144 1 local changesets published
144 1 local changesets published
145 postclose-tip:24b6387c8c8c public
145 postclose-tip:24b6387c8c8c public
146 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
146 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
147 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
147 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
148 $ hg -R other log -G
148 $ hg -R other log -G
149 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
149 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
150 |
150 |
151 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
151 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
152 |/
152 |/
153 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
153 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
154
154
155 $ hg -R other debugobsolete
155 $ hg -R other debugobsolete
156 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
156 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
157 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
157 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
158
158
159 pull empty
159 pull empty
160
160
161 $ hg -R other pull -r 24b6387c8c8c
161 $ hg -R other pull -r 24b6387c8c8c
162 pulling from $TESTTMP/main
162 pulling from $TESTTMP/main
163 no changes found
163 no changes found
164 pre-close-tip:24b6387c8c8c public
164 pre-close-tip:24b6387c8c8c public
165 postclose-tip:24b6387c8c8c public
165 postclose-tip:24b6387c8c8c public
166 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
166 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=0 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
167 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
167 file:/*/$TESTTMP/main HG_URL=file:$TESTTMP/main (glob)
168 $ hg -R other log -G
168 $ hg -R other log -G
169 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
169 o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
170 |
170 |
171 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
171 | @ 1:9520eea781bc draft Nicolas Dumazet <nicdumz.commits@gmail.com> E
172 |/
172 |/
173 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
173 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
174
174
175 $ hg -R other debugobsolete
175 $ hg -R other debugobsolete
176 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
176 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
177 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
177 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
178
178
179 add extra data to test their exchange during push
179 add extra data to test their exchange during push
180
180
181 $ hg -R main bookmark --rev eea13746799a book_eea1
181 $ hg -R main bookmark --rev eea13746799a book_eea1
182 pre-close-tip:02de42196ebe draft
182 pre-close-tip:02de42196ebe draft
183 postclose-tip:02de42196ebe draft
183 postclose-tip:02de42196ebe draft
184 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
184 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
185 $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
185 $ hg -R main debugobsolete -d '0 0' 3333333333333333333333333333333333333333 `getmainid eea13746799a`
186 pre-close-tip:02de42196ebe draft
186 pre-close-tip:02de42196ebe draft
187 1 new obsolescence markers
187 1 new obsolescence markers
188 postclose-tip:02de42196ebe draft
188 postclose-tip:02de42196ebe draft
189 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
189 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
190 $ hg -R main bookmark --rev 02de42196ebe book_02de
190 $ hg -R main bookmark --rev 02de42196ebe book_02de
191 pre-close-tip:02de42196ebe draft book_02de
191 pre-close-tip:02de42196ebe draft book_02de
192 postclose-tip:02de42196ebe draft book_02de
192 postclose-tip:02de42196ebe draft book_02de
193 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
193 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
194 $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
194 $ hg -R main debugobsolete -d '0 0' 4444444444444444444444444444444444444444 `getmainid 02de42196ebe`
195 pre-close-tip:02de42196ebe draft book_02de
195 pre-close-tip:02de42196ebe draft book_02de
196 1 new obsolescence markers
196 1 new obsolescence markers
197 postclose-tip:02de42196ebe draft book_02de
197 postclose-tip:02de42196ebe draft book_02de
198 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
198 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
199 $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
199 $ hg -R main bookmark --rev 42ccdea3bb16 book_42cc
200 pre-close-tip:02de42196ebe draft book_02de
200 pre-close-tip:02de42196ebe draft book_02de
201 postclose-tip:02de42196ebe draft book_02de
201 postclose-tip:02de42196ebe draft book_02de
202 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
202 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
203 $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
203 $ hg -R main debugobsolete -d '0 0' 5555555555555555555555555555555555555555 `getmainid 42ccdea3bb16`
204 pre-close-tip:02de42196ebe draft book_02de
204 pre-close-tip:02de42196ebe draft book_02de
205 1 new obsolescence markers
205 1 new obsolescence markers
206 postclose-tip:02de42196ebe draft book_02de
206 postclose-tip:02de42196ebe draft book_02de
207 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
207 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
208 $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
208 $ hg -R main bookmark --rev 5fddd98957c8 book_5fdd
209 pre-close-tip:02de42196ebe draft book_02de
209 pre-close-tip:02de42196ebe draft book_02de
210 postclose-tip:02de42196ebe draft book_02de
210 postclose-tip:02de42196ebe draft book_02de
211 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
211 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
212 $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
212 $ hg -R main debugobsolete -d '0 0' 6666666666666666666666666666666666666666 `getmainid 5fddd98957c8`
213 pre-close-tip:02de42196ebe draft book_02de
213 pre-close-tip:02de42196ebe draft book_02de
214 1 new obsolescence markers
214 1 new obsolescence markers
215 postclose-tip:02de42196ebe draft book_02de
215 postclose-tip:02de42196ebe draft book_02de
216 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
216 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
217 $ hg -R main bookmark --rev 32af7686d403 book_32af
217 $ hg -R main bookmark --rev 32af7686d403 book_32af
218 pre-close-tip:02de42196ebe draft book_02de
218 pre-close-tip:02de42196ebe draft book_02de
219 postclose-tip:02de42196ebe draft book_02de
219 postclose-tip:02de42196ebe draft book_02de
220 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
220 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
221 $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
221 $ hg -R main debugobsolete -d '0 0' 7777777777777777777777777777777777777777 `getmainid 32af7686d403`
222 pre-close-tip:02de42196ebe draft book_02de
222 pre-close-tip:02de42196ebe draft book_02de
223 1 new obsolescence markers
223 1 new obsolescence markers
224 postclose-tip:02de42196ebe draft book_02de
224 postclose-tip:02de42196ebe draft book_02de
225 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
225 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=debugobsolete
226
226
227 $ hg -R other bookmark --rev cd010b8cd998 book_eea1
227 $ hg -R other bookmark --rev cd010b8cd998 book_eea1
228 pre-close-tip:24b6387c8c8c public
228 pre-close-tip:24b6387c8c8c public
229 postclose-tip:24b6387c8c8c public
229 postclose-tip:24b6387c8c8c public
230 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
230 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
231 $ hg -R other bookmark --rev cd010b8cd998 book_02de
231 $ hg -R other bookmark --rev cd010b8cd998 book_02de
232 pre-close-tip:24b6387c8c8c public
232 pre-close-tip:24b6387c8c8c public
233 postclose-tip:24b6387c8c8c public
233 postclose-tip:24b6387c8c8c public
234 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
234 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
235 $ hg -R other bookmark --rev cd010b8cd998 book_42cc
235 $ hg -R other bookmark --rev cd010b8cd998 book_42cc
236 pre-close-tip:24b6387c8c8c public
236 pre-close-tip:24b6387c8c8c public
237 postclose-tip:24b6387c8c8c public
237 postclose-tip:24b6387c8c8c public
238 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
238 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
239 $ hg -R other bookmark --rev cd010b8cd998 book_5fdd
239 $ hg -R other bookmark --rev cd010b8cd998 book_5fdd
240 pre-close-tip:24b6387c8c8c public
240 pre-close-tip:24b6387c8c8c public
241 postclose-tip:24b6387c8c8c public
241 postclose-tip:24b6387c8c8c public
242 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
242 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
243 $ hg -R other bookmark --rev cd010b8cd998 book_32af
243 $ hg -R other bookmark --rev cd010b8cd998 book_32af
244 pre-close-tip:24b6387c8c8c public
244 pre-close-tip:24b6387c8c8c public
245 postclose-tip:24b6387c8c8c public
245 postclose-tip:24b6387c8c8c public
246 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
246 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
247
247
248 $ hg -R main phase --public eea13746799a
248 $ hg -R main phase --public eea13746799a
249 pre-close-tip:02de42196ebe draft book_02de
249 pre-close-tip:02de42196ebe draft book_02de
250 postclose-tip:02de42196ebe draft book_02de
250 postclose-tip:02de42196ebe draft book_02de
251 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
251 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
252
252
253 push
253 push
254 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
254 $ hg -R main push other --rev eea13746799a --bookmark book_eea1
255 pushing to other
255 pushing to other
256 searching for changes
256 searching for changes
257 remote: adding changesets
257 remote: adding changesets
258 remote: adding manifests
258 remote: adding manifests
259 remote: adding file changes
259 remote: adding file changes
260 remote: pre-close-tip:eea13746799a public book_eea1
260 remote: pre-close-tip:eea13746799a public book_eea1
261 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
261 remote: added 1 changesets with 0 changes to 0 files (-1 heads)
262 remote: 1 new obsolescence markers
262 remote: 1 new obsolescence markers
263 remote: pushkey: lock state after "bookmarks"
263 remote: pushkey: lock state after "bookmarks"
264 remote: lock: free
264 remote: lock: free
265 remote: wlock: free
265 remote: wlock: free
266 remote: postclose-tip:eea13746799a public book_eea1
266 remote: postclose-tip:eea13746799a public book_eea1
267 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_NODE_LAST=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/other
267 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_NODE_LAST=eea13746799a9e0bfd88f29d3c2e9dc9389f524f HG_PHASES_MOVED=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/other
268 updating bookmark book_eea1
268 updating bookmark book_eea1
269 pre-close-tip:02de42196ebe draft book_02de
269 pre-close-tip:02de42196ebe draft book_02de
270 postclose-tip:02de42196ebe draft book_02de
270 postclose-tip:02de42196ebe draft book_02de
271 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
271 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
272 file:/*/$TESTTMP/other HG_URL=file:$TESTTMP/other (glob)
272 file:/*/$TESTTMP/other HG_URL=file:$TESTTMP/other (glob)
273 $ hg -R other log -G
273 $ hg -R other log -G
274 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
274 o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
275 |\
275 |\
276 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
276 | o 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
277 | |
277 | |
278 @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
278 @ | 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
279 |/
279 |/
280 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A
280 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de book_32af book_42cc book_5fdd A
281
281
282 $ hg -R other debugobsolete
282 $ hg -R other debugobsolete
283 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
283 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
284 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
284 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
285 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
285 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
286
286
287 pull over ssh
287 pull over ssh
288
288
289 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de
289 $ hg -R other pull ssh://user@dummy/main -r 02de42196ebe --bookmark book_02de
290 pulling from ssh://user@dummy/main
290 pulling from ssh://user@dummy/main
291 searching for changes
291 searching for changes
292 adding changesets
292 adding changesets
293 adding manifests
293 adding manifests
294 adding file changes
294 adding file changes
295 updating bookmark book_02de
295 updating bookmark book_02de
296 pre-close-tip:02de42196ebe draft book_02de
296 pre-close-tip:02de42196ebe draft book_02de
297 added 1 changesets with 1 changes to 1 files (+1 heads)
297 added 1 changesets with 1 changes to 1 files (+1 heads)
298 1 new obsolescence markers
298 1 new obsolescence markers
299 new changesets 02de42196ebe (1 drafts)
299 new changesets 02de42196ebe (1 drafts)
300 postclose-tip:02de42196ebe draft book_02de
300 postclose-tip:02de42196ebe draft book_02de
301 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
301 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_NODE_LAST=02de42196ebee42ef284b6780a87cdc96e8eaab6 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
302 ssh://user@dummy/main HG_URL=ssh://user@dummy/main
302 ssh://user@dummy/main HG_URL=ssh://user@dummy/main
303 (run 'hg heads' to see heads, 'hg merge' to merge)
303 (run 'hg heads' to see heads, 'hg merge' to merge)
304 $ hg -R other debugobsolete
304 $ hg -R other debugobsolete
305 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
305 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
306 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
306 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
307 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
307 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
308 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
308 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
309
309
310 pull over http
310 pull over http
311
311
312 $ hg serve -R main -p $HGPORT -d --pid-file=main.pid -E main-error.log
312 $ hg serve -R main -p $HGPORT -d --pid-file=main.pid -E main-error.log
313 $ cat main.pid >> $DAEMON_PIDS
313 $ cat main.pid >> $DAEMON_PIDS
314
314
315 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc
315 $ hg -R other pull http://localhost:$HGPORT/ -r 42ccdea3bb16 --bookmark book_42cc
316 pulling from http://localhost:$HGPORT/
316 pulling from http://localhost:$HGPORT/
317 searching for changes
317 searching for changes
318 adding changesets
318 adding changesets
319 adding manifests
319 adding manifests
320 adding file changes
320 adding file changes
321 updating bookmark book_42cc
321 updating bookmark book_42cc
322 pre-close-tip:42ccdea3bb16 draft book_42cc
322 pre-close-tip:42ccdea3bb16 draft book_42cc
323 added 1 changesets with 1 changes to 1 files (+1 heads)
323 added 1 changesets with 1 changes to 1 files (+1 heads)
324 1 new obsolescence markers
324 1 new obsolescence markers
325 new changesets 42ccdea3bb16 (1 drafts)
325 new changesets 42ccdea3bb16 (1 drafts)
326 postclose-tip:42ccdea3bb16 draft book_42cc
326 postclose-tip:42ccdea3bb16 draft book_42cc
327 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_NODE_LAST=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
327 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_NODE_LAST=42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 HG_PHASES_MOVED=1 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_TXNNAME=pull
328 http://localhost:$HGPORT/ HG_URL=http://localhost:$HGPORT/
328 http://localhost:$HGPORT/ HG_URL=http://localhost:$HGPORT/
329 (run 'hg heads .' to see heads, 'hg merge' to merge)
329 (run 'hg heads .' to see heads, 'hg merge' to merge)
330 $ cat main-error.log
330 $ cat main-error.log
331 $ hg -R other debugobsolete
331 $ hg -R other debugobsolete
332 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
332 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
333 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
333 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
334 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
334 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
335 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
335 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
336 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
336 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
337
337
338 push over ssh
338 push over ssh
339
339
340 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd
340 $ hg -R main push ssh://user@dummy/other -r 5fddd98957c8 --bookmark book_5fdd
341 pushing to ssh://user@dummy/other
341 pushing to ssh://user@dummy/other
342 searching for changes
342 searching for changes
343 remote: adding changesets
343 remote: adding changesets
344 remote: adding manifests
344 remote: adding manifests
345 remote: adding file changes
345 remote: adding file changes
346 remote: pre-close-tip:5fddd98957c8 draft book_5fdd
346 remote: pre-close-tip:5fddd98957c8 draft book_5fdd
347 remote: added 1 changesets with 1 changes to 1 files
347 remote: added 1 changesets with 1 changes to 1 files
348 remote: 1 new obsolescence markers
348 remote: 1 new obsolescence markers
349 remote: pushkey: lock state after "bookmarks"
349 remote: pushkey: lock state after "bookmarks"
350 remote: lock: free
350 remote: lock: free
351 remote: wlock: free
351 remote: wlock: free
352 remote: postclose-tip:5fddd98957c8 draft book_5fdd
352 remote: postclose-tip:5fddd98957c8 draft book_5fdd
353 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_NODE_LAST=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:ssh:$LOCALIP
353 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_NODE_LAST=5fddd98957c8a54a4d436dfe1da9d87f21a1b97b HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:ssh:$LOCALIP
354 updating bookmark book_5fdd
354 updating bookmark book_5fdd
355 pre-close-tip:02de42196ebe draft book_02de
355 pre-close-tip:02de42196ebe draft book_02de
356 postclose-tip:02de42196ebe draft book_02de
356 postclose-tip:02de42196ebe draft book_02de
357 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
357 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
358 ssh://user@dummy/other HG_URL=ssh://user@dummy/other
358 ssh://user@dummy/other HG_URL=ssh://user@dummy/other
359 $ hg -R other log -G
359 $ hg -R other log -G
360 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
360 o 6:5fddd98957c8 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
361 |
361 |
362 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
362 o 5:42ccdea3bb16 draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
363 |
363 |
364 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
364 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
365 | |
365 | |
366 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
366 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
367 | |/|
367 | |/|
368 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
368 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
369 |/ /
369 |/ /
370 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
370 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
371 |/
371 |/
372 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A
372 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af A
373
373
374 $ hg -R other debugobsolete
374 $ hg -R other debugobsolete
375 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
375 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
376 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
376 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
377 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
377 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
378 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
378 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
379 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
379 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
380 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
380 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
381
381
382 push over http
382 push over http
383
383
384 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
384 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
385 $ cat other.pid >> $DAEMON_PIDS
385 $ cat other.pid >> $DAEMON_PIDS
386
386
387 $ hg -R main phase --public 32af7686d403
387 $ hg -R main phase --public 32af7686d403
388 pre-close-tip:02de42196ebe draft book_02de
388 pre-close-tip:02de42196ebe draft book_02de
389 postclose-tip:02de42196ebe draft book_02de
389 postclose-tip:02de42196ebe draft book_02de
390 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
390 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=phase
391 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
391 $ hg -R main push http://localhost:$HGPORT2/ -r 32af7686d403 --bookmark book_32af
392 pushing to http://localhost:$HGPORT2/
392 pushing to http://localhost:$HGPORT2/
393 searching for changes
393 searching for changes
394 remote: adding changesets
394 remote: adding changesets
395 remote: adding manifests
395 remote: adding manifests
396 remote: adding file changes
396 remote: adding file changes
397 remote: pre-close-tip:32af7686d403 public book_32af
397 remote: pre-close-tip:32af7686d403 public book_32af
398 remote: added 1 changesets with 1 changes to 1 files
398 remote: added 1 changesets with 1 changes to 1 files
399 remote: 1 new obsolescence markers
399 remote: 1 new obsolescence markers
400 remote: pushkey: lock state after "bookmarks"
400 remote: pushkey: lock state after "bookmarks"
401 remote: lock: free
401 remote: lock: free
402 remote: wlock: free
402 remote: wlock: free
403 remote: postclose-tip:32af7686d403 public book_32af
403 remote: postclose-tip:32af7686d403 public book_32af
404 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=32af7686d403cf45b5d95f2d70cebea587ac806a HG_NODE_LAST=32af7686d403cf45b5d95f2d70cebea587ac806a HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:http:$LOCALIP: (glob)
404 remote: txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_NEW_OBSMARKERS=1 HG_NODE=32af7686d403cf45b5d95f2d70cebea587ac806a HG_NODE_LAST=32af7686d403cf45b5d95f2d70cebea587ac806a HG_PHASES_MOVED=1 HG_SOURCE=serve HG_TXNID=TXN:$ID$ HG_TXNNAME=serve HG_URL=remote:http:$LOCALIP: (glob)
405 updating bookmark book_32af
405 updating bookmark book_32af
406 pre-close-tip:02de42196ebe draft book_02de
406 pre-close-tip:02de42196ebe draft book_02de
407 postclose-tip:02de42196ebe draft book_02de
407 postclose-tip:02de42196ebe draft book_02de
408 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
408 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_SOURCE=push-response HG_TXNID=TXN:$ID$ HG_TXNNAME=push-response
409 http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/
409 http://localhost:$HGPORT2/ HG_URL=http://localhost:$HGPORT2/
410 $ cat other-error.log
410 $ cat other-error.log
411
411
412 Check final content.
412 Check final content.
413
413
414 $ hg -R other log -G
414 $ hg -R other log -G
415 o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D
415 o 7:32af7686d403 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_32af D
416 |
416 |
417 o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
417 o 6:5fddd98957c8 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_5fdd C
418 |
418 |
419 o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
419 o 5:42ccdea3bb16 public Nicolas Dumazet <nicdumz.commits@gmail.com> book_42cc B
420 |
420 |
421 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
421 | o 4:02de42196ebe draft Nicolas Dumazet <nicdumz.commits@gmail.com> book_02de H
422 | |
422 | |
423 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
423 | | o 3:eea13746799a public Nicolas Dumazet <nicdumz.commits@gmail.com> book_eea1 G
424 | |/|
424 | |/|
425 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
425 | o | 2:24b6387c8c8c public Nicolas Dumazet <nicdumz.commits@gmail.com> F
426 |/ /
426 |/ /
427 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
427 | @ 1:9520eea781bc public Nicolas Dumazet <nicdumz.commits@gmail.com> E
428 |/
428 |/
429 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
429 o 0:cd010b8cd998 public Nicolas Dumazet <nicdumz.commits@gmail.com> A
430
430
431 $ hg -R other debugobsolete
431 $ hg -R other debugobsolete
432 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
432 1111111111111111111111111111111111111111 9520eea781bcca16c1e15acc0ba14335a0e8e5ba 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
433 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
433 2222222222222222222222222222222222222222 24b6387c8c8cae37178880f3fa95ded3cb1cf785 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
434 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
434 3333333333333333333333333333333333333333 eea13746799a9e0bfd88f29d3c2e9dc9389f524f 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
435 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
435 4444444444444444444444444444444444444444 02de42196ebee42ef284b6780a87cdc96e8eaab6 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
436 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
436 5555555555555555555555555555555555555555 42ccdea3bb16d28e1848c95fe2e44c000f3f21b1 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
437 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
437 6666666666666666666666666666666666666666 5fddd98957c8a54a4d436dfe1da9d87f21a1b97b 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
438 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
438 7777777777777777777777777777777777777777 32af7686d403cf45b5d95f2d70cebea587ac806a 0 (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
439
439
440 (check that no 'pending' files remain)
440 (check that no 'pending' files remain)
441
441
442 $ ls -1 other/.hg/bookmarks*
442 $ ls -1 other/.hg/bookmarks*
443 other/.hg/bookmarks
443 other/.hg/bookmarks
444 $ ls -1 other/.hg/store/phaseroots*
444 $ ls -1 other/.hg/store/phaseroots*
445 other/.hg/store/phaseroots
445 other/.hg/store/phaseroots
446 $ ls -1 other/.hg/store/00changelog.i*
446 $ ls -1 other/.hg/store/00changelog.i*
447 other/.hg/store/00changelog.i
447 other/.hg/store/00changelog.i
448
448
449 Error Handling
449 Error Handling
450 ==============
450 ==============
451
451
452 Check that errors are properly returned to the client during push.
452 Check that errors are properly returned to the client during push.
453
453
454 Setting up
454 Setting up
455
455
456 $ cat > failpush.py << EOF
456 $ cat > failpush.py << EOF
457 > """A small extension that makes push fails when using bundle2
457 > """A small extension that makes push fails when using bundle2
458 >
458 >
459 > used to test error handling in bundle2
459 > used to test error handling in bundle2
460 > """
460 > """
461 >
461 >
462 > from mercurial import error
462 > from mercurial import error
463 > from mercurial import bundle2
463 > from mercurial import bundle2
464 > from mercurial import exchange
464 > from mercurial import exchange
465 > from mercurial import extensions
465 > from mercurial import extensions
466 > from mercurial import registrar
466 > from mercurial import registrar
467 > cmdtable = {}
467 > cmdtable = {}
468 > command = registrar.command(cmdtable)
468 > command = registrar.command(cmdtable)
469 >
469 >
470 > configtable = {}
470 > configtable = {}
471 > configitem = registrar.configitem(configtable)
471 > configitem = registrar.configitem(configtable)
472 > configitem(b'failpush', b'reason',
472 > configitem(b'failpush', b'reason',
473 > default=None,
473 > default=None,
474 > )
474 > )
475 >
475 >
476 > def _pushbundle2failpart(pushop, bundler):
476 > def _pushbundle2failpart(pushop, bundler):
477 > reason = pushop.ui.config(b'failpush', b'reason')
477 > reason = pushop.ui.config(b'failpush', b'reason')
478 > part = None
478 > part = None
479 > if reason == b'abort':
479 > if reason == b'abort':
480 > bundler.newpart(b'test:abort')
480 > bundler.newpart(b'test:abort')
481 > if reason == b'unknown':
481 > if reason == b'unknown':
482 > bundler.newpart(b'test:unknown')
482 > bundler.newpart(b'test:unknown')
483 > if reason == b'race':
483 > if reason == b'race':
484 > # 20 Bytes of crap
484 > # 20 Bytes of crap
485 > bundler.newpart(b'check:heads', data=b'01234567890123456789')
485 > bundler.newpart(b'check:heads', data=b'01234567890123456789')
486 >
486 >
487 > @bundle2.parthandler(b"test:abort")
487 > @bundle2.parthandler(b"test:abort")
488 > def handleabort(op, part):
488 > def handleabort(op, part):
489 > raise error.Abort(b'Abandon ship!', hint=b"don't panic")
489 > raise error.Abort(b'Abandon ship!', hint=b"don't panic")
490 >
490 >
491 > def uisetup(ui):
491 > def uisetup(ui):
492 > exchange.b2partsgenmapping[b'failpart'] = _pushbundle2failpart
492 > exchange.b2partsgenmapping[b'failpart'] = _pushbundle2failpart
493 > exchange.b2partsgenorder.insert(0, b'failpart')
493 > exchange.b2partsgenorder.insert(0, b'failpart')
494 >
494 >
495 > EOF
495 > EOF
496
496
497 $ cd main
497 $ cd main
498 $ hg up tip
498 $ hg up tip
499 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
499 3 files updated, 0 files merged, 1 files removed, 0 files unresolved
500 $ echo 'I' > I
500 $ echo 'I' > I
501 $ hg add I
501 $ hg add I
502 $ hg ci -m 'I'
502 $ hg ci -m 'I'
503 pre-close-tip:e7ec4e813ba6 draft
503 pre-close-tip:e7ec4e813ba6 draft
504 postclose-tip:e7ec4e813ba6 draft
504 postclose-tip:e7ec4e813ba6 draft
505 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
505 txnclose hook: HG_HOOKNAME=txnclose.env HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
506 $ hg id
506 $ hg id
507 e7ec4e813ba6 tip
507 e7ec4e813ba6 tip
508 $ cd ..
508 $ cd ..
509
509
510 $ cat << EOF >> $HGRCPATH
510 $ cat << EOF >> $HGRCPATH
511 > [extensions]
511 > [extensions]
512 > failpush=$TESTTMP/failpush.py
512 > failpush=$TESTTMP/failpush.py
513 > EOF
513 > EOF
514
514
515 $ killdaemons.py
515 $ killdaemons.py
516 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
516 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
517 $ cat other.pid >> $DAEMON_PIDS
517 $ cat other.pid >> $DAEMON_PIDS
518
518
519 Doing the actual push: Abort error
519 Doing the actual push: Abort error
520
520
521 $ cat << EOF >> $HGRCPATH
521 $ cat << EOF >> $HGRCPATH
522 > [failpush]
522 > [failpush]
523 > reason = abort
523 > reason = abort
524 > EOF
524 > EOF
525
525
526 $ hg -R main push other -r e7ec4e813ba6
526 $ hg -R main push other -r e7ec4e813ba6
527 pushing to other
527 pushing to other
528 searching for changes
528 searching for changes
529 abort: Abandon ship!
529 abort: Abandon ship!
530 (don't panic)
530 (don't panic)
531 [255]
531 [255]
532
532
533 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
533 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
534 pushing to ssh://user@dummy/other
534 pushing to ssh://user@dummy/other
535 searching for changes
535 searching for changes
536 remote: Abandon ship!
536 remote: Abandon ship!
537 remote: (don't panic)
537 remote: (don't panic)
538 abort: push failed on remote
538 abort: push failed on remote
539 [100]
539 [100]
540
540
541 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
541 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
542 pushing to http://localhost:$HGPORT2/
542 pushing to http://localhost:$HGPORT2/
543 searching for changes
543 searching for changes
544 remote: Abandon ship!
544 remote: Abandon ship!
545 remote: (don't panic)
545 remote: (don't panic)
546 abort: push failed on remote
546 abort: push failed on remote
547 [100]
547 [100]
548
548
549
549
550 Doing the actual push: unknown mandatory parts
550 Doing the actual push: unknown mandatory parts
551
551
552 $ cat << EOF >> $HGRCPATH
552 $ cat << EOF >> $HGRCPATH
553 > [failpush]
553 > [failpush]
554 > reason = unknown
554 > reason = unknown
555 > EOF
555 > EOF
556
556
557 $ hg -R main push other -r e7ec4e813ba6
557 $ hg -R main push other -r e7ec4e813ba6
558 pushing to other
558 pushing to other
559 searching for changes
559 searching for changes
560 abort: missing support for test:unknown
560 abort: missing support for test:unknown
561 [100]
561 [100]
562
562
563 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
563 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
564 pushing to ssh://user@dummy/other
564 pushing to ssh://user@dummy/other
565 searching for changes
565 searching for changes
566 abort: missing support for test:unknown
566 abort: missing support for test:unknown
567 [100]
567 [100]
568
568
569 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
569 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
570 pushing to http://localhost:$HGPORT2/
570 pushing to http://localhost:$HGPORT2/
571 searching for changes
571 searching for changes
572 abort: missing support for test:unknown
572 abort: missing support for test:unknown
573 [100]
573 [100]
574
574
575 Doing the actual push: race
575 Doing the actual push: race
576
576
577 $ cat << EOF >> $HGRCPATH
577 $ cat << EOF >> $HGRCPATH
578 > [failpush]
578 > [failpush]
579 > reason = race
579 > reason = race
580 > EOF
580 > EOF
581
581
582 $ hg -R main push other -r e7ec4e813ba6
582 $ hg -R main push other -r e7ec4e813ba6
583 pushing to other
583 pushing to other
584 searching for changes
584 searching for changes
585 abort: push failed:
585 abort: push failed:
586 'remote repository changed while pushing - please try again'
586 'remote repository changed while pushing - please try again'
587 [255]
587 [255]
588
588
589 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
589 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
590 pushing to ssh://user@dummy/other
590 pushing to ssh://user@dummy/other
591 searching for changes
591 searching for changes
592 abort: push failed:
592 abort: push failed:
593 'remote repository changed while pushing - please try again'
593 'remote repository changed while pushing - please try again'
594 [255]
594 [255]
595
595
596 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
596 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
597 pushing to http://localhost:$HGPORT2/
597 pushing to http://localhost:$HGPORT2/
598 searching for changes
598 searching for changes
599 abort: push failed:
599 abort: push failed:
600 'remote repository changed while pushing - please try again'
600 'remote repository changed while pushing - please try again'
601 [255]
601 [255]
602
602
603 Doing the actual push: hook abort
603 Doing the actual push: hook abort
604
604
605 $ cat << EOF >> $HGRCPATH
605 $ cat << EOF >> $HGRCPATH
606 > [failpush]
606 > [failpush]
607 > reason =
607 > reason =
608 > [hooks]
608 > [hooks]
609 > pretxnclose.failpush = sh -c "echo 'You shall not pass!'; false"
609 > pretxnclose.failpush = sh -c "echo 'You shall not pass!'; false"
610 > txnabort.failpush = sh -c "echo 'Cleaning up the mess...'"
610 > txnabort.failpush = sh -c "echo 'Cleaning up the mess...'"
611 > EOF
611 > EOF
612
612
613 $ killdaemons.py
613 $ killdaemons.py
614 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
614 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
615 $ cat other.pid >> $DAEMON_PIDS
615 $ cat other.pid >> $DAEMON_PIDS
616
616
617 $ hg -R main push other -r e7ec4e813ba6
617 $ hg -R main push other -r e7ec4e813ba6
618 pushing to other
618 pushing to other
619 searching for changes
619 searching for changes
620 remote: adding changesets
620 remote: adding changesets
621 remote: adding manifests
621 remote: adding manifests
622 remote: adding file changes
622 remote: adding file changes
623 remote: pre-close-tip:e7ec4e813ba6 draft
623 remote: pre-close-tip:e7ec4e813ba6 draft
624 remote: You shall not pass!
624 remote: You shall not pass!
625 remote: transaction abort!
625 remote: transaction abort!
626 remote: Cleaning up the mess...
626 remote: Cleaning up the mess...
627 remote: rollback completed
627 remote: rollback completed
628 abort: pretxnclose.failpush hook exited with status 1
628 abort: pretxnclose.failpush hook exited with status 1
629 [40]
629 [40]
630
630
631 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
631 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
632 pushing to ssh://user@dummy/other
632 pushing to ssh://user@dummy/other
633 searching for changes
633 searching for changes
634 remote: adding changesets
634 remote: adding changesets
635 remote: adding manifests
635 remote: adding manifests
636 remote: adding file changes
636 remote: adding file changes
637 remote: pre-close-tip:e7ec4e813ba6 draft
637 remote: pre-close-tip:e7ec4e813ba6 draft
638 remote: You shall not pass!
638 remote: You shall not pass!
639 remote: transaction abort!
639 remote: transaction abort!
640 remote: Cleaning up the mess...
640 remote: Cleaning up the mess...
641 remote: rollback completed
641 remote: rollback completed
642 remote: pretxnclose.failpush hook exited with status 1
642 remote: pretxnclose.failpush hook exited with status 1
643 abort: push failed on remote
643 abort: push failed on remote
644 [100]
644 [100]
645
645
646 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
646 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
647 pushing to http://localhost:$HGPORT2/
647 pushing to http://localhost:$HGPORT2/
648 searching for changes
648 searching for changes
649 remote: adding changesets
649 remote: adding changesets
650 remote: adding manifests
650 remote: adding manifests
651 remote: adding file changes
651 remote: adding file changes
652 remote: pre-close-tip:e7ec4e813ba6 draft
652 remote: pre-close-tip:e7ec4e813ba6 draft
653 remote: You shall not pass!
653 remote: You shall not pass!
654 remote: transaction abort!
654 remote: transaction abort!
655 remote: Cleaning up the mess...
655 remote: Cleaning up the mess...
656 remote: rollback completed
656 remote: rollback completed
657 remote: pretxnclose.failpush hook exited with status 1
657 remote: pretxnclose.failpush hook exited with status 1
658 abort: push failed on remote
658 abort: push failed on remote
659 [100]
659 [100]
660
660
661 (check that no 'pending' files remain)
661 (check that no 'pending' files remain)
662
662
663 $ ls -1 other/.hg/bookmarks*
663 $ ls -1 other/.hg/bookmarks*
664 other/.hg/bookmarks
664 other/.hg/bookmarks
665 $ ls -1 other/.hg/store/phaseroots*
665 $ ls -1 other/.hg/store/phaseroots*
666 other/.hg/store/phaseroots
666 other/.hg/store/phaseroots
667 $ ls -1 other/.hg/store/00changelog.i*
667 $ ls -1 other/.hg/store/00changelog.i*
668 other/.hg/store/00changelog.i
668 other/.hg/store/00changelog.i
669
669
670 Check error from hook during the unbundling process itself
670 Check error from hook during the unbundling process itself
671
671
672 $ cat << EOF >> $HGRCPATH
672 $ cat << EOF >> $HGRCPATH
673 > pretxnchangegroup = sh -c "echo 'Fail early!'; false"
673 > pretxnchangegroup = sh -c "echo 'Fail early!'; false"
674 > EOF
674 > EOF
675 $ killdaemons.py # reload http config
675 $ killdaemons.py # reload http config
676 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
676 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
677 $ cat other.pid >> $DAEMON_PIDS
677 $ cat other.pid >> $DAEMON_PIDS
678
678
679 $ hg -R main push other -r e7ec4e813ba6
679 $ hg -R main push other -r e7ec4e813ba6
680 pushing to other
680 pushing to other
681 searching for changes
681 searching for changes
682 remote: adding changesets
682 remote: adding changesets
683 remote: adding manifests
683 remote: adding manifests
684 remote: adding file changes
684 remote: adding file changes
685 remote: Fail early!
685 remote: Fail early!
686 remote: transaction abort!
686 remote: transaction abort!
687 remote: Cleaning up the mess...
687 remote: Cleaning up the mess...
688 remote: rollback completed
688 remote: rollback completed
689 abort: pretxnchangegroup hook exited with status 1
689 abort: pretxnchangegroup hook exited with status 1
690 [40]
690 [40]
691 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
691 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
692 pushing to ssh://user@dummy/other
692 pushing to ssh://user@dummy/other
693 searching for changes
693 searching for changes
694 remote: adding changesets
694 remote: adding changesets
695 remote: adding manifests
695 remote: adding manifests
696 remote: adding file changes
696 remote: adding file changes
697 remote: Fail early!
697 remote: Fail early!
698 remote: transaction abort!
698 remote: transaction abort!
699 remote: Cleaning up the mess...
699 remote: Cleaning up the mess...
700 remote: rollback completed
700 remote: rollback completed
701 remote: pretxnchangegroup hook exited with status 1
701 remote: pretxnchangegroup hook exited with status 1
702 abort: push failed on remote
702 abort: push failed on remote
703 [100]
703 [100]
704 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
704 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
705 pushing to http://localhost:$HGPORT2/
705 pushing to http://localhost:$HGPORT2/
706 searching for changes
706 searching for changes
707 remote: adding changesets
707 remote: adding changesets
708 remote: adding manifests
708 remote: adding manifests
709 remote: adding file changes
709 remote: adding file changes
710 remote: Fail early!
710 remote: Fail early!
711 remote: transaction abort!
711 remote: transaction abort!
712 remote: Cleaning up the mess...
712 remote: Cleaning up the mess...
713 remote: rollback completed
713 remote: rollback completed
714 remote: pretxnchangegroup hook exited with status 1
714 remote: pretxnchangegroup hook exited with status 1
715 abort: push failed on remote
715 abort: push failed on remote
716 [100]
716 [100]
717
717
718 Check output capture control.
718 Check output capture control.
719
719
720 (should be still forced for http, disabled for local and ssh)
720 (should be still forced for http, disabled for local and ssh)
721
721
722 $ cat >> $HGRCPATH << EOF
722 $ cat >> $HGRCPATH << EOF
723 > [experimental]
723 > [experimental]
724 > bundle2-output-capture=False
724 > bundle2-output-capture=False
725 > EOF
725 > EOF
726
726
727 $ hg -R main push other -r e7ec4e813ba6
727 $ hg -R main push other -r e7ec4e813ba6
728 pushing to other
728 pushing to other
729 searching for changes
729 searching for changes
730 adding changesets
730 adding changesets
731 adding manifests
731 adding manifests
732 adding file changes
732 adding file changes
733 Fail early!
733 Fail early!
734 transaction abort!
734 transaction abort!
735 Cleaning up the mess...
735 Cleaning up the mess...
736 rollback completed
736 rollback completed
737 abort: pretxnchangegroup hook exited with status 1
737 abort: pretxnchangegroup hook exited with status 1
738 [40]
738 [40]
739 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
739 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
740 pushing to ssh://user@dummy/other
740 pushing to ssh://user@dummy/other
741 searching for changes
741 searching for changes
742 remote: adding changesets
742 remote: adding changesets
743 remote: adding manifests
743 remote: adding manifests
744 remote: adding file changes
744 remote: adding file changes
745 remote: Fail early!
745 remote: Fail early!
746 remote: transaction abort!
746 remote: transaction abort!
747 remote: Cleaning up the mess...
747 remote: Cleaning up the mess...
748 remote: rollback completed
748 remote: rollback completed
749 remote: pretxnchangegroup hook exited with status 1
749 remote: pretxnchangegroup hook exited with status 1
750 abort: push failed on remote
750 abort: push failed on remote
751 [100]
751 [100]
752 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
752 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
753 pushing to http://localhost:$HGPORT2/
753 pushing to http://localhost:$HGPORT2/
754 searching for changes
754 searching for changes
755 remote: adding changesets
755 remote: adding changesets
756 remote: adding manifests
756 remote: adding manifests
757 remote: adding file changes
757 remote: adding file changes
758 remote: Fail early!
758 remote: Fail early!
759 remote: transaction abort!
759 remote: transaction abort!
760 remote: Cleaning up the mess...
760 remote: Cleaning up the mess...
761 remote: rollback completed
761 remote: rollback completed
762 remote: pretxnchangegroup hook exited with status 1
762 remote: pretxnchangegroup hook exited with status 1
763 abort: push failed on remote
763 abort: push failed on remote
764 [100]
764 [100]
765
765
766 Check abort from mandatory pushkey
766 Check abort from mandatory pushkey
767
767
768 $ cat > mandatorypart.py << EOF
768 $ cat > mandatorypart.py << EOF
769 > from mercurial import exchange
769 > from mercurial import exchange
770 > from mercurial import pushkey
770 > from mercurial import pushkey
771 > from mercurial import node
771 > from mercurial import node
772 > from mercurial import error
772 > from mercurial import error
773 > @exchange.b2partsgenerator(b'failingpuskey')
773 > @exchange.b2partsgenerator(b'failingpuskey')
774 > def addfailingpushey(pushop, bundler):
774 > def addfailingpushey(pushop, bundler):
775 > enc = pushkey.encode
775 > enc = pushkey.encode
776 > part = bundler.newpart(b'pushkey')
776 > part = bundler.newpart(b'pushkey')
777 > part.addparam(b'namespace', enc(b'phases'))
777 > part.addparam(b'namespace', enc(b'phases'))
778 > part.addparam(b'key', enc(b'cd010b8cd998f3981a5a8115f94f8da4ab506089'))
778 > part.addparam(b'key', enc(b'cd010b8cd998f3981a5a8115f94f8da4ab506089'))
779 > part.addparam(b'old', enc(b'0')) # successful update
779 > part.addparam(b'old', enc(b'0')) # successful update
780 > part.addparam(b'new', enc(b'0'))
780 > part.addparam(b'new', enc(b'0'))
781 > def fail(pushop, exc):
781 > def fail(pushop, exc):
782 > raise error.Abort(b'Correct phase push failed (because hooks)')
782 > raise error.Abort(b'Correct phase push failed (because hooks)')
783 > pushop.pkfailcb[part.id] = fail
783 > pushop.pkfailcb[part.id] = fail
784 > EOF
784 > EOF
785 $ cat >> $HGRCPATH << EOF
785 $ cat >> $HGRCPATH << EOF
786 > [hooks]
786 > [hooks]
787 > pretxnchangegroup=
787 > pretxnchangegroup=
788 > pretxnclose.failpush=
788 > pretxnclose.failpush=
789 > prepushkey.failpush = sh -c "echo 'do not push the key !'; false"
789 > prepushkey.failpush = sh -c "echo 'do not push the key !'; false"
790 > [extensions]
790 > [extensions]
791 > mandatorypart=$TESTTMP/mandatorypart.py
791 > mandatorypart=$TESTTMP/mandatorypart.py
792 > EOF
792 > EOF
793 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
793 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
794 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
794 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
795 $ cat other.pid >> $DAEMON_PIDS
795 $ cat other.pid >> $DAEMON_PIDS
796
796
797 (Failure from a hook)
797 (Failure from a hook)
798
798
799 $ hg -R main push other -r e7ec4e813ba6
799 $ hg -R main push other -r e7ec4e813ba6
800 pushing to other
800 pushing to other
801 searching for changes
801 searching for changes
802 adding changesets
802 adding changesets
803 adding manifests
803 adding manifests
804 adding file changes
804 adding file changes
805 do not push the key !
805 do not push the key !
806 pushkey-abort: prepushkey.failpush hook exited with status 1
806 pushkey-abort: prepushkey.failpush hook exited with status 1
807 transaction abort!
807 transaction abort!
808 Cleaning up the mess...
808 Cleaning up the mess...
809 rollback completed
809 rollback completed
810 abort: Correct phase push failed (because hooks)
810 abort: Correct phase push failed (because hooks)
811 [255]
811 [255]
812 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
812 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
813 pushing to ssh://user@dummy/other
813 pushing to ssh://user@dummy/other
814 searching for changes
814 searching for changes
815 remote: adding changesets
815 remote: adding changesets
816 remote: adding manifests
816 remote: adding manifests
817 remote: adding file changes
817 remote: adding file changes
818 remote: do not push the key !
818 remote: do not push the key !
819 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
819 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
820 remote: transaction abort!
820 remote: transaction abort!
821 remote: Cleaning up the mess...
821 remote: Cleaning up the mess...
822 remote: rollback completed
822 remote: rollback completed
823 abort: Correct phase push failed (because hooks)
823 abort: Correct phase push failed (because hooks)
824 [255]
824 [255]
825 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
825 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
826 pushing to http://localhost:$HGPORT2/
826 pushing to http://localhost:$HGPORT2/
827 searching for changes
827 searching for changes
828 remote: adding changesets
828 remote: adding changesets
829 remote: adding manifests
829 remote: adding manifests
830 remote: adding file changes
830 remote: adding file changes
831 remote: do not push the key !
831 remote: do not push the key !
832 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
832 remote: pushkey-abort: prepushkey.failpush hook exited with status 1
833 remote: transaction abort!
833 remote: transaction abort!
834 remote: Cleaning up the mess...
834 remote: Cleaning up the mess...
835 remote: rollback completed
835 remote: rollback completed
836 abort: Correct phase push failed (because hooks)
836 abort: Correct phase push failed (because hooks)
837 [255]
837 [255]
838
838
839 (Failure from a the pushkey)
839 (Failure from a the pushkey)
840
840
841 $ cat > mandatorypart.py << EOF
841 $ cat > mandatorypart.py << EOF
842 > from mercurial import exchange
842 > from mercurial import exchange
843 > from mercurial import pushkey
843 > from mercurial import pushkey
844 > from mercurial import node
844 > from mercurial import node
845 > from mercurial import error
845 > from mercurial import error
846 > @exchange.b2partsgenerator(b'failingpuskey')
846 > @exchange.b2partsgenerator(b'failingpuskey')
847 > def addfailingpushey(pushop, bundler):
847 > def addfailingpushey(pushop, bundler):
848 > enc = pushkey.encode
848 > enc = pushkey.encode
849 > part = bundler.newpart(b'pushkey')
849 > part = bundler.newpart(b'pushkey')
850 > part.addparam(b'namespace', enc(b'phases'))
850 > part.addparam(b'namespace', enc(b'phases'))
851 > part.addparam(b'key', enc(b'cd010b8cd998f3981a5a8115f94f8da4ab506089'))
851 > part.addparam(b'key', enc(b'cd010b8cd998f3981a5a8115f94f8da4ab506089'))
852 > part.addparam(b'old', enc(b'4')) # will fail
852 > part.addparam(b'old', enc(b'4')) # will fail
853 > part.addparam(b'new', enc(b'3'))
853 > part.addparam(b'new', enc(b'3'))
854 > def fail(pushop, exc):
854 > def fail(pushop, exc):
855 > raise error.Abort(b'Clown phase push failed')
855 > raise error.Abort(b'Clown phase push failed')
856 > pushop.pkfailcb[part.id] = fail
856 > pushop.pkfailcb[part.id] = fail
857 > EOF
857 > EOF
858 $ cat >> $HGRCPATH << EOF
858 $ cat >> $HGRCPATH << EOF
859 > [hooks]
859 > [hooks]
860 > prepushkey.failpush =
860 > prepushkey.failpush =
861 > EOF
861 > EOF
862 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
862 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS # reload http config
863 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
863 $ hg serve -R other -p $HGPORT2 -d --pid-file=other.pid -E other-error.log
864 $ cat other.pid >> $DAEMON_PIDS
864 $ cat other.pid >> $DAEMON_PIDS
865
865
866 $ hg -R main push other -r e7ec4e813ba6
866 $ hg -R main push other -r e7ec4e813ba6
867 pushing to other
867 pushing to other
868 searching for changes
868 searching for changes
869 adding changesets
869 adding changesets
870 adding manifests
870 adding manifests
871 adding file changes
871 adding file changes
872 transaction abort!
872 transaction abort!
873 Cleaning up the mess...
873 Cleaning up the mess...
874 rollback completed
874 rollback completed
875 pushkey: lock state after "phases"
875 pushkey: lock state after "phases"
876 lock: free
876 lock: free
877 wlock: free
877 wlock: free
878 abort: Clown phase push failed
878 abort: Clown phase push failed
879 [255]
879 [255]
880 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
880 $ hg -R main push ssh://user@dummy/other -r e7ec4e813ba6
881 pushing to ssh://user@dummy/other
881 pushing to ssh://user@dummy/other
882 searching for changes
882 searching for changes
883 remote: adding changesets
883 remote: adding changesets
884 remote: adding manifests
884 remote: adding manifests
885 remote: adding file changes
885 remote: adding file changes
886 remote: transaction abort!
886 remote: transaction abort!
887 remote: Cleaning up the mess...
887 remote: Cleaning up the mess...
888 remote: rollback completed
888 remote: rollback completed
889 remote: pushkey: lock state after "phases"
889 remote: pushkey: lock state after "phases"
890 remote: lock: free
890 remote: lock: free
891 remote: wlock: free
891 remote: wlock: free
892 abort: Clown phase push failed
892 abort: Clown phase push failed
893 [255]
893 [255]
894 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
894 $ hg -R main push http://localhost:$HGPORT2/ -r e7ec4e813ba6
895 pushing to http://localhost:$HGPORT2/
895 pushing to http://localhost:$HGPORT2/
896 searching for changes
896 searching for changes
897 remote: adding changesets
897 remote: adding changesets
898 remote: adding manifests
898 remote: adding manifests
899 remote: adding file changes
899 remote: adding file changes
900 remote: transaction abort!
900 remote: transaction abort!
901 remote: Cleaning up the mess...
901 remote: Cleaning up the mess...
902 remote: rollback completed
902 remote: rollback completed
903 remote: pushkey: lock state after "phases"
903 remote: pushkey: lock state after "phases"
904 remote: lock: free
904 remote: lock: free
905 remote: wlock: free
905 remote: wlock: free
906 abort: Clown phase push failed
906 abort: Clown phase push failed
907 [255]
907 [255]
908
908
909 Test lazily acquiring the lock during unbundle
909 Test lazily acquiring the lock during unbundle
910 $ cp $TESTTMP/hgrc.orig $HGRCPATH
910 $ cp $TESTTMP/hgrc.orig $HGRCPATH
911
911
912 $ cat >> $TESTTMP/locktester.py <<EOF
912 $ cat >> $TESTTMP/locktester.py <<EOF
913 > import os
913 > import os
914 > from mercurial import bundle2, error, extensions
914 > from mercurial import bundle2, error, extensions
915 > def checklock(orig, repo, *args, **kwargs):
915 > def checklock(orig, repo, *args, **kwargs):
916 > if repo.svfs.lexists(b"lock"):
916 > if repo.svfs.lexists(b"lock"):
917 > raise error.Abort(b"Lock should not be taken")
917 > raise error.Abort(b"Lock should not be taken")
918 > return orig(repo, *args, **kwargs)
918 > return orig(repo, *args, **kwargs)
919 > def extsetup(ui):
919 > def extsetup(ui):
920 > extensions.wrapfunction(bundle2, 'processbundle', checklock)
920 > extensions.wrapfunction(bundle2, 'processbundle', checklock)
921 > EOF
921 > EOF
922
922
923 $ hg init lazylock
923 $ hg init lazylock
924 $ cat >> lazylock/.hg/hgrc <<EOF
924 $ cat >> lazylock/.hg/hgrc <<EOF
925 > [extensions]
925 > [extensions]
926 > locktester=$TESTTMP/locktester.py
926 > locktester=$TESTTMP/locktester.py
927 > EOF
927 > EOF
928
928
929 $ hg clone -q ssh://user@dummy/lazylock lazylockclient
929 $ hg clone -q ssh://user@dummy/lazylock lazylockclient
930 $ cd lazylockclient
930 $ cd lazylockclient
931 $ touch a && hg ci -Aqm a
931 $ touch a && hg ci -Aqm a
932 $ hg push
932 $ hg push
933 pushing to ssh://user@dummy/lazylock
933 pushing to ssh://user@dummy/lazylock
934 searching for changes
934 searching for changes
935 remote: Lock should not be taken
935 remote: Lock should not be taken
936 abort: push failed on remote
936 abort: push failed on remote
937 [100]
937 [100]
938
938
939 $ cat >> ../lazylock/.hg/hgrc <<EOF
939 $ cat >> ../lazylock/.hg/hgrc <<EOF
940 > [experimental]
940 > [experimental]
941 > bundle2lazylocking=True
941 > bundle2lazylocking=True
942 > EOF
942 > EOF
943 $ hg push
943 $ hg push
944 pushing to ssh://user@dummy/lazylock
944 pushing to ssh://user@dummy/lazylock
945 searching for changes
945 searching for changes
946 remote: adding changesets
946 remote: adding changesets
947 remote: adding manifests
947 remote: adding manifests
948 remote: adding file changes
948 remote: adding file changes
949 remote: added 1 changesets with 1 changes to 1 files
949 remote: added 1 changesets with 1 changes to 1 files
950
950
951 $ cd ..
951 $ cd ..
952
952
953 Servers can disable bundle1 for clone/pull operations
953 Servers can disable bundle1 for clone/pull operations
954
954
955 $ killdaemons.py
955 $ killdaemons.py
956 $ hg init bundle2onlyserver
956 $ hg init bundle2onlyserver
957 $ cd bundle2onlyserver
957 $ cd bundle2onlyserver
958 $ cat > .hg/hgrc << EOF
958 $ cat > .hg/hgrc << EOF
959 > [server]
959 > [server]
960 > bundle1.pull = false
960 > bundle1.pull = false
961 > EOF
961 > EOF
962
962
963 $ touch foo
963 $ touch foo
964 $ hg -q commit -A -m initial
964 $ hg -q commit -A -m initial
965
965
966 $ hg serve -p $HGPORT -d --pid-file=hg.pid
966 $ hg serve -p $HGPORT -d --pid-file=hg.pid
967 $ cat hg.pid >> $DAEMON_PIDS
967 $ cat hg.pid >> $DAEMON_PIDS
968
968
969 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
969 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
970 requesting all changes
970 requesting all changes
971 abort: remote error:
971 abort: remote error:
972 incompatible Mercurial client; bundle2 required
972 incompatible Mercurial client; bundle2 required
973 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
973 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
974 [100]
974 [100]
975 $ killdaemons.py
975 $ killdaemons.py
976 $ cd ..
976 $ cd ..
977
977
978 bundle1 can still pull non-generaldelta repos when generaldelta bundle1 disabled
978 bundle1 can still pull non-generaldelta repos when generaldelta bundle1 disabled
979
979
980 $ hg --config format.usegeneraldelta=false init notgdserver
980 $ hg --config format.usegeneraldelta=false init notgdserver
981 $ cd notgdserver
981 $ cd notgdserver
982 $ cat > .hg/hgrc << EOF
982 $ cat > .hg/hgrc << EOF
983 > [server]
983 > [server]
984 > bundle1gd.pull = false
984 > bundle1gd.pull = false
985 > EOF
985 > EOF
986
986
987 $ touch foo
987 $ touch foo
988 $ hg -q commit -A -m initial
988 $ hg -q commit -A -m initial
989 $ hg serve -p $HGPORT -d --pid-file=hg.pid
989 $ hg serve -p $HGPORT -d --pid-file=hg.pid
990 $ cat hg.pid >> $DAEMON_PIDS
990 $ cat hg.pid >> $DAEMON_PIDS
991
991
992 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-1
992 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-1
993 requesting all changes
993 requesting all changes
994 adding changesets
994 adding changesets
995 adding manifests
995 adding manifests
996 adding file changes
996 adding file changes
997 added 1 changesets with 1 changes to 1 files
997 added 1 changesets with 1 changes to 1 files
998 new changesets 96ee1d7354c4
998 new changesets 96ee1d7354c4
999 updating to branch default
999 updating to branch default
1000 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1000 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1001
1001
1002 $ killdaemons.py
1002 $ killdaemons.py
1003 $ cd ../bundle2onlyserver
1003 $ cd ../bundle2onlyserver
1004
1004
1005 bundle1 pull can be disabled for generaldelta repos only
1005 bundle1 pull can be disabled for generaldelta repos only
1006
1006
1007 $ cat > .hg/hgrc << EOF
1007 $ cat > .hg/hgrc << EOF
1008 > [server]
1008 > [server]
1009 > bundle1gd.pull = false
1009 > bundle1gd.pull = false
1010 > EOF
1010 > EOF
1011
1011
1012 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1012 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1013 $ cat hg.pid >> $DAEMON_PIDS
1013 $ cat hg.pid >> $DAEMON_PIDS
1014 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1014 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1015 requesting all changes
1015 requesting all changes
1016 abort: remote error:
1016 abort: remote error:
1017 incompatible Mercurial client; bundle2 required
1017 incompatible Mercurial client; bundle2 required
1018 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1018 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1019 [100]
1019 [100]
1020
1020
1021 $ killdaemons.py
1021 $ killdaemons.py
1022
1022
1023 Verify the global server.bundle1 option works
1023 Verify the global server.bundle1 option works
1024
1024
1025 $ cd ..
1025 $ cd ..
1026 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1026 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1027 > [server]
1027 > [server]
1028 > bundle1 = false
1028 > bundle1 = false
1029 > EOF
1029 > EOF
1030 $ hg serve -R bundle2onlyserver -p $HGPORT -d --pid-file=hg.pid
1030 $ hg serve -R bundle2onlyserver -p $HGPORT -d --pid-file=hg.pid
1031 $ cat hg.pid >> $DAEMON_PIDS
1031 $ cat hg.pid >> $DAEMON_PIDS
1032 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT not-bundle2
1032 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT not-bundle2
1033 requesting all changes
1033 requesting all changes
1034 abort: remote error:
1034 abort: remote error:
1035 incompatible Mercurial client; bundle2 required
1035 incompatible Mercurial client; bundle2 required
1036 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1036 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1037 [100]
1037 [100]
1038 $ killdaemons.py
1038 $ killdaemons.py
1039
1039
1040 $ hg --config devel.legacy.exchange=bundle1 clone ssh://user@dummy/bundle2onlyserver not-bundle2-ssh
1040 $ hg --config devel.legacy.exchange=bundle1 clone ssh://user@dummy/bundle2onlyserver not-bundle2-ssh
1041 requesting all changes
1041 requesting all changes
1042 adding changesets
1042 adding changesets
1043 remote: abort: incompatible Mercurial client; bundle2 required
1043 remote: abort: incompatible Mercurial client; bundle2 required
1044 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1044 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1045 transaction abort!
1046 rollback completed
1045 abort: stream ended unexpectedly (got 0 bytes, expected 4)
1047 abort: stream ended unexpectedly (got 0 bytes, expected 4)
1046 [255]
1048 [255]
1047
1049
1048 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1050 $ cat > bundle2onlyserver/.hg/hgrc << EOF
1049 > [server]
1051 > [server]
1050 > bundle1gd = false
1052 > bundle1gd = false
1051 > EOF
1053 > EOF
1052 $ hg serve -R bundle2onlyserver -p $HGPORT -d --pid-file=hg.pid
1054 $ hg serve -R bundle2onlyserver -p $HGPORT -d --pid-file=hg.pid
1053 $ cat hg.pid >> $DAEMON_PIDS
1055 $ cat hg.pid >> $DAEMON_PIDS
1054
1056
1055 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1057 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2
1056 requesting all changes
1058 requesting all changes
1057 abort: remote error:
1059 abort: remote error:
1058 incompatible Mercurial client; bundle2 required
1060 incompatible Mercurial client; bundle2 required
1059 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1061 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1060 [100]
1062 [100]
1061
1063
1062 $ killdaemons.py
1064 $ killdaemons.py
1063
1065
1064 $ cd notgdserver
1066 $ cd notgdserver
1065 $ cat > .hg/hgrc << EOF
1067 $ cat > .hg/hgrc << EOF
1066 > [server]
1068 > [server]
1067 > bundle1gd = false
1069 > bundle1gd = false
1068 > EOF
1070 > EOF
1069 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1071 $ hg serve -p $HGPORT -d --pid-file=hg.pid
1070 $ cat hg.pid >> $DAEMON_PIDS
1072 $ cat hg.pid >> $DAEMON_PIDS
1071
1073
1072 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-2
1074 $ hg --config devel.legacy.exchange=bundle1 clone http://localhost:$HGPORT/ not-bundle2-2
1073 requesting all changes
1075 requesting all changes
1074 adding changesets
1076 adding changesets
1075 adding manifests
1077 adding manifests
1076 adding file changes
1078 adding file changes
1077 added 1 changesets with 1 changes to 1 files
1079 added 1 changesets with 1 changes to 1 files
1078 new changesets 96ee1d7354c4
1080 new changesets 96ee1d7354c4
1079 updating to branch default
1081 updating to branch default
1080 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1082 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1081
1083
1082 $ killdaemons.py
1084 $ killdaemons.py
1083 $ cd ../bundle2onlyserver
1085 $ cd ../bundle2onlyserver
1084
1086
1085 Verify bundle1 pushes can be disabled
1087 Verify bundle1 pushes can be disabled
1086
1088
1087 $ cat > .hg/hgrc << EOF
1089 $ cat > .hg/hgrc << EOF
1088 > [server]
1090 > [server]
1089 > bundle1.push = false
1091 > bundle1.push = false
1090 > [web]
1092 > [web]
1091 > allow_push = *
1093 > allow_push = *
1092 > push_ssl = false
1094 > push_ssl = false
1093 > EOF
1095 > EOF
1094
1096
1095 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E error.log
1097 $ hg serve -p $HGPORT -d --pid-file=hg.pid -E error.log
1096 $ cat hg.pid >> $DAEMON_PIDS
1098 $ cat hg.pid >> $DAEMON_PIDS
1097 $ cd ..
1099 $ cd ..
1098
1100
1099 $ hg clone http://localhost:$HGPORT bundle2-only
1101 $ hg clone http://localhost:$HGPORT bundle2-only
1100 requesting all changes
1102 requesting all changes
1101 adding changesets
1103 adding changesets
1102 adding manifests
1104 adding manifests
1103 adding file changes
1105 adding file changes
1104 added 1 changesets with 1 changes to 1 files
1106 added 1 changesets with 1 changes to 1 files
1105 new changesets 96ee1d7354c4
1107 new changesets 96ee1d7354c4
1106 updating to branch default
1108 updating to branch default
1107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1109 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1108 $ cd bundle2-only
1110 $ cd bundle2-only
1109 $ echo commit > foo
1111 $ echo commit > foo
1110 $ hg commit -m commit
1112 $ hg commit -m commit
1111 $ hg --config devel.legacy.exchange=bundle1 push
1113 $ hg --config devel.legacy.exchange=bundle1 push
1112 pushing to http://localhost:$HGPORT/
1114 pushing to http://localhost:$HGPORT/
1113 searching for changes
1115 searching for changes
1114 abort: remote error:
1116 abort: remote error:
1115 incompatible Mercurial client; bundle2 required
1117 incompatible Mercurial client; bundle2 required
1116 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1118 (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1117 [100]
1119 [100]
1118
1120
1119 (also check with ssh)
1121 (also check with ssh)
1120
1122
1121 $ hg --config devel.legacy.exchange=bundle1 push ssh://user@dummy/bundle2onlyserver
1123 $ hg --config devel.legacy.exchange=bundle1 push ssh://user@dummy/bundle2onlyserver
1122 pushing to ssh://user@dummy/bundle2onlyserver
1124 pushing to ssh://user@dummy/bundle2onlyserver
1123 searching for changes
1125 searching for changes
1124 remote: abort: incompatible Mercurial client; bundle2 required
1126 remote: abort: incompatible Mercurial client; bundle2 required
1125 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1127 remote: (see https://www.mercurial-scm.org/wiki/IncompatibleClient)
1126 [1]
1128 [1]
1127
1129
1128 $ hg push
1130 $ hg push
1129 pushing to http://localhost:$HGPORT/
1131 pushing to http://localhost:$HGPORT/
1130 searching for changes
1132 searching for changes
1131 remote: adding changesets
1133 remote: adding changesets
1132 remote: adding manifests
1134 remote: adding manifests
1133 remote: adding file changes
1135 remote: adding file changes
1134 remote: added 1 changesets with 1 changes to 1 files
1136 remote: added 1 changesets with 1 changes to 1 files
@@ -1,179 +1,186 b''
1 Test stream cloning while a revlog split happens
1 Test stream cloning while a revlog split happens
2 ------------------------------------------------
2 ------------------------------------------------
3
3
4 #testcases stream-bundle2-v2 stream-bundle2-v3
4 #testcases stream-bundle2-v2 stream-bundle2-v3
5
5
6 #if stream-bundle2-v3
6 #if stream-bundle2-v3
7 $ cat << EOF >> $HGRCPATH
7 $ cat << EOF >> $HGRCPATH
8 > [experimental]
8 > [experimental]
9 > stream-v3 = yes
9 > stream-v3 = yes
10 > EOF
10 > EOF
11 #endif
11 #endif
12
12
13 setup a repository for tests
13 setup a repository for tests
14 ----------------------------
14 ----------------------------
15
15
16 $ cat >> $HGRCPATH << EOF
16 $ cat >> $HGRCPATH << EOF
17 > [format]
17 > [format]
18 > # skip compression to make it easy to trigger a split
18 > # skip compression to make it easy to trigger a split
19 > revlog-compression=none
19 > revlog-compression=none
20 > [phases]
20 > [phases]
21 > publish=no
21 > publish=no
22 > EOF
22 > EOF
23
23
24 $ hg init server
24 $ hg init server
25 $ cd server
25 $ cd server
26 $ file="some-file"
26 $ file="some-file"
27 $ printf '%20d' '1' > $file
27 $ printf '%20d' '1' > $file
28 $ hg commit -Aqma
28 $ hg commit -Aqma
29 $ printf '%1024d' '1' > $file
29 $ printf '%1024d' '1' > $file
30 $ hg commit -Aqmb
30 $ hg commit -Aqmb
31 $ printf '%20d' '1' > $file
31 $ printf '%20d' '1' > $file
32 $ hg commit -Aqmc
32 $ hg commit -Aqmc
33
33
34 check the revlog is inline
34 check the revlog is inline
35
35
36 $ f -s .hg/store/data/some-file*
36 $ f -s .hg/store/data/some-file*
37 .hg/store/data/some-file.i: size=1259
37 .hg/store/data/some-file.i: size=1259
38 $ hg debug-revlog-index some-file
38 $ hg debug-revlog-index some-file
39 rev linkrev nodeid p1-nodeid p2-nodeid
39 rev linkrev nodeid p1-nodeid p2-nodeid
40 0 0 ed70cecbc103 000000000000 000000000000
40 0 0 ed70cecbc103 000000000000 000000000000
41 1 1 7241018db64c ed70cecbc103 000000000000
41 1 1 7241018db64c ed70cecbc103 000000000000
42 2 2 fa1120531cc1 7241018db64c 000000000000
42 2 2 fa1120531cc1 7241018db64c 000000000000
43 $ cd ..
43 $ cd ..
44
44
45 setup synchronisation file
45 setup synchronisation file
46
46
47 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
47 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
48 $ export HG_TEST_STREAM_WALKED_FILE_1
48 $ export HG_TEST_STREAM_WALKED_FILE_1
49 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
49 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
50 $ export HG_TEST_STREAM_WALKED_FILE_2
50 $ export HG_TEST_STREAM_WALKED_FILE_2
51 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
51 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
52 $ export HG_TEST_STREAM_WALKED_FILE_3
52 $ export HG_TEST_STREAM_WALKED_FILE_3
53
53
54
54
55 Test stream-clone raced by a revlog-split
55 Test stream-clone raced by a revlog-split
56 =========================================
56 =========================================
57
57
58 Test stream-clone where the file is split right after the lock section is done
58 Test stream-clone where the file is split right after the lock section is done
59
59
60 Start the server
60 Start the server
61
61
62 $ hg serve -R server \
62 $ hg serve -R server \
63 > -p $HGPORT1 -d --error errors.log --pid-file=hg.pid \
63 > -p $HGPORT1 -d --error errors.log --pid-file=hg.pid \
64 > --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py"
64 > --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py"
65 $ cat hg.pid >> $DAEMON_PIDS
65 $ cat hg.pid >> $DAEMON_PIDS
66
66
67 Start a client doing a streaming clone
67 Start a client doing a streaming clone
68
68
69 $ ( \
69 $ ( \
70 > hg clone --debug --stream -U http://localhost:$HGPORT1 \
70 > hg clone --debug --stream -U http://localhost:$HGPORT1 \
71 > clone-while-split > client.log 2>&1; \
71 > clone-while-split > client.log 2>&1; \
72 > touch "$HG_TEST_STREAM_WALKED_FILE_3" \
72 > touch "$HG_TEST_STREAM_WALKED_FILE_3" \
73 > ) &
73 > ) &
74
74
75 Wait for the server to be done collecting data
75 Wait for the server to be done collecting data
76
76
77 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
77 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
78
78
79 trigger a split
79 trigger a split
80
80
81 $ dd if=/dev/zero of=server/$file bs=1k count=128 > /dev/null 2>&1
81 $ dd if=/dev/zero of=server/$file bs=1k count=128 > /dev/null 2>&1
82 $ hg -R server ci -m "triggering a split" --config ui.timeout.warn=-1
82 $ hg -R server ci -m "triggering a split" --config ui.timeout.warn=-1
83
83
84 unlock the stream generation
84 unlock the stream generation
85
85
86 $ touch $HG_TEST_STREAM_WALKED_FILE_2
86 $ touch $HG_TEST_STREAM_WALKED_FILE_2
87
87
88 wait for the client to be done cloning.
88 wait for the client to be done cloning.
89
89
90 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
90 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
91
91
92 Check everything is fine
92 Check everything is fine
93
93
94 $ cat client.log
94 $ cat client.log
95 using http://localhost:$HGPORT1/
95 using http://localhost:$HGPORT1/
96 sending capabilities command
96 sending capabilities command
97 query 1; heads
97 query 1; heads
98 sending batch command
98 sending batch command
99 streaming all changes
99 streaming all changes
100 sending getbundle command
100 sending getbundle command
101 bundle2-input-bundle: with-transaction
101 bundle2-input-bundle: with-transaction
102 bundle2-input-part: "stream2" (params: 3 mandatory) supported (stream-bundle2-v2 !)
102 bundle2-input-part: "stream2" (params: 3 mandatory) supported (stream-bundle2-v2 !)
103 bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported (stream-bundle2-v3 !)
103 bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported (stream-bundle2-v3 !)
104 applying stream bundle
104 applying stream bundle
105 7 files to transfer, 2.11 KB of data (stream-bundle2-v2 !)
105 8 files to transfer, 2.11 KB of data (stream-bundle2-v2 no-rust !)
106 10 files to transfer, 2.29 KB of data (stream-bundle2-v2 rust !)
106 adding [s] data/some-file.i (1.23 KB) (stream-bundle2-v2 !)
107 adding [s] data/some-file.i (1.23 KB) (stream-bundle2-v2 !)
107 7 entries to transfer (stream-bundle2-v3 !)
108 7 entries to transfer (stream-bundle2-v3 !)
108 adding [s] data/some-file.d (1.04 KB) (stream-bundle2-v3 !)
109 adding [s] data/some-file.d (1.04 KB) (stream-bundle2-v3 !)
109 adding [s] data/some-file.i (192 bytes) (stream-bundle2-v3 !)
110 adding [s] data/some-file.i (192 bytes) (stream-bundle2-v3 !)
110 adding [s] phaseroots (43 bytes)
111 adding [s] phaseroots (43 bytes)
111 adding [s] 00manifest.i (348 bytes)
112 adding [s] 00manifest.i (348 bytes)
112 adding [s] 00changelog.i (381 bytes)
113 adding [s] 00changelog.n (62 bytes) (rust !)
114 adding [s] 00changelog-88698448.nd (128 bytes) (rust !)
115 adding [s] 00changelog.d (189 bytes)
116 adding [s] 00changelog.i (192 bytes)
113 adding [c] branch2-served (94 bytes)
117 adding [c] branch2-served (94 bytes)
114 adding [c] rbc-names-v1 (7 bytes)
118 adding [c] rbc-names-v1 (7 bytes)
115 adding [c] rbc-revs-v1 (24 bytes)
119 adding [c] rbc-revs-v1 (24 bytes)
116 updating the branch cache
120 updating the branch cache
117 transferred 2.11 KB in * seconds (* */sec) (glob)
121 transferred 2.11 KB in * seconds (* */sec) (glob) (no-rust !)
118 bundle2-input-part: total payload size 2268 (stream-bundle2-v2 !)
122 transferred 2.29 KB in * seconds (* */sec) (glob) (rust !)
119 bundle2-input-part: total payload size 2296 (stream-bundle2-v3 !)
123 bundle2-input-part: total payload size 2285 (stream-bundle2-v2 no-rust !)
124 bundle2-input-part: total payload size 2518 (stream-bundle2-v2 rust !)
125 bundle2-input-part: total payload size 2313 (stream-bundle2-v3 no-rust !)
126 bundle2-input-part: total payload size 2546 (stream-bundle2-v3 rust !)
120 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
127 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
121 bundle2-input-bundle: 2 parts total
128 bundle2-input-bundle: 2 parts total
122 checking for updated bookmarks
129 checking for updated bookmarks
123 updating the branch cache
130 updating the branch cache
124 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
131 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
125 $ tail -2 errors.log
132 $ tail -2 errors.log
126 $ hg -R clone-while-split verify
133 $ hg -R clone-while-split verify
127 checking changesets
134 checking changesets
128 checking manifests
135 checking manifests
129 crosschecking files in changesets and manifests
136 crosschecking files in changesets and manifests
130 checking files
137 checking files
131 checking dirstate
138 checking dirstate
132 checked 3 changesets with 3 changes to 1 files
139 checked 3 changesets with 3 changes to 1 files
133 $ hg -R clone-while-split tip
140 $ hg -R clone-while-split tip
134 changeset: 2:dbd9854c38a6
141 changeset: 2:dbd9854c38a6
135 tag: tip
142 tag: tip
136 user: test
143 user: test
137 date: Thu Jan 01 00:00:00 1970 +0000
144 date: Thu Jan 01 00:00:00 1970 +0000
138 summary: c
145 summary: c
139
146
140 $ hg -R clone-while-split debug-revlog-index some-file
147 $ hg -R clone-while-split debug-revlog-index some-file
141 rev linkrev nodeid p1-nodeid p2-nodeid
148 rev linkrev nodeid p1-nodeid p2-nodeid
142 0 0 ed70cecbc103 000000000000 000000000000
149 0 0 ed70cecbc103 000000000000 000000000000
143 1 1 7241018db64c ed70cecbc103 000000000000
150 1 1 7241018db64c ed70cecbc103 000000000000
144 2 2 fa1120531cc1 7241018db64c 000000000000
151 2 2 fa1120531cc1 7241018db64c 000000000000
145 $ hg -R server phase --rev 'all()'
152 $ hg -R server phase --rev 'all()'
146 0: draft
153 0: draft
147 1: draft
154 1: draft
148 2: draft
155 2: draft
149 3: draft
156 3: draft
150 $ hg -R clone-while-split phase --rev 'all()'
157 $ hg -R clone-while-split phase --rev 'all()'
151 0: draft
158 0: draft
152 1: draft
159 1: draft
153 2: draft
160 2: draft
154
161
155 subsequent pull work
162 subsequent pull work
156
163
157 $ hg -R clone-while-split pull
164 $ hg -R clone-while-split pull
158 pulling from http://localhost:$HGPORT1/
165 pulling from http://localhost:$HGPORT1/
159 searching for changes
166 searching for changes
160 adding changesets
167 adding changesets
161 adding manifests
168 adding manifests
162 adding file changes
169 adding file changes
163 added 1 changesets with 1 changes to 1 files
170 added 1 changesets with 1 changes to 1 files
164 new changesets df05c6cb1406 (1 drafts)
171 new changesets df05c6cb1406 (1 drafts)
165 (run 'hg update' to get a working copy)
172 (run 'hg update' to get a working copy)
166
173
167 $ hg -R clone-while-split debug-revlog-index some-file
174 $ hg -R clone-while-split debug-revlog-index some-file
168 rev linkrev nodeid p1-nodeid p2-nodeid
175 rev linkrev nodeid p1-nodeid p2-nodeid
169 0 0 ed70cecbc103 000000000000 000000000000
176 0 0 ed70cecbc103 000000000000 000000000000
170 1 1 7241018db64c ed70cecbc103 000000000000
177 1 1 7241018db64c ed70cecbc103 000000000000
171 2 2 fa1120531cc1 7241018db64c 000000000000
178 2 2 fa1120531cc1 7241018db64c 000000000000
172 3 3 a631378adaa3 fa1120531cc1 000000000000
179 3 3 a631378adaa3 fa1120531cc1 000000000000
173 $ hg -R clone-while-split verify
180 $ hg -R clone-while-split verify
174 checking changesets
181 checking changesets
175 checking manifests
182 checking manifests
176 crosschecking files in changesets and manifests
183 crosschecking files in changesets and manifests
177 checking files
184 checking files
178 checking dirstate
185 checking dirstate
179 checked 4 changesets with 4 changes to 1 files
186 checked 4 changesets with 4 changes to 1 files
@@ -1,994 +1,1036 b''
1 #require serve no-reposimplestore no-chg
1 #require serve no-reposimplestore no-chg
2
2
3 #testcases stream-legacy stream-bundle2-v2 stream-bundle2-v3
3 #testcases stream-legacy stream-bundle2-v2 stream-bundle2-v3
4
4
5 #if stream-legacy
5 #if stream-legacy
6 $ cat << EOF >> $HGRCPATH
6 $ cat << EOF >> $HGRCPATH
7 > [server]
7 > [server]
8 > bundle2.stream = no
8 > bundle2.stream = no
9 > [format]
10 > # persistent nodemap is too broken with legacy format,
11 > # however client with nodemap support will have better stream support.
12 > use-persistent-nodemap=no
9 > EOF
13 > EOF
10 #endif
14 #endif
11 #if stream-bundle2-v3
15 #if stream-bundle2-v3
12 $ cat << EOF >> $HGRCPATH
16 $ cat << EOF >> $HGRCPATH
13 > [experimental]
17 > [experimental]
14 > stream-v3 = yes
18 > stream-v3 = yes
15 > EOF
19 > EOF
16 #endif
20 #endif
17
21
18 Initialize repository
22 Initialize repository
19
23
20 $ hg init server
24 $ hg init server
21 $ cd server
25 $ cd server
22 $ sh $TESTDIR/testlib/stream_clone_setup.sh
26 $ sh $TESTDIR/testlib/stream_clone_setup.sh
23 adding 00changelog-ab349180a0405010.nd
27 adding 00changelog-ab349180a0405010.nd
24 adding 00changelog.d
28 adding 00changelog.d
25 adding 00changelog.i
29 adding 00changelog.i
26 adding 00changelog.n
30 adding 00changelog.n
27 adding 00manifest.d
31 adding 00manifest.d
28 adding 00manifest.i
32 adding 00manifest.i
29 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
33 adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch
30 adding data/foo.d
34 adding data/foo.d
31 adding data/foo.i
35 adding data/foo.i
32 adding data/foo.n
36 adding data/foo.n
33 adding data/undo.babar
37 adding data/undo.babar
34 adding data/undo.d
38 adding data/undo.d
35 adding data/undo.foo.d
39 adding data/undo.foo.d
36 adding data/undo.foo.i
40 adding data/undo.foo.i
37 adding data/undo.foo.n
41 adding data/undo.foo.n
38 adding data/undo.i
42 adding data/undo.i
39 adding data/undo.n
43 adding data/undo.n
40 adding data/undo.py
44 adding data/undo.py
41 adding foo.d
45 adding foo.d
42 adding foo.i
46 adding foo.i
43 adding foo.n
47 adding foo.n
44 adding meta/foo.d
48 adding meta/foo.d
45 adding meta/foo.i
49 adding meta/foo.i
46 adding meta/foo.n
50 adding meta/foo.n
47 adding meta/undo.babar
51 adding meta/undo.babar
48 adding meta/undo.d
52 adding meta/undo.d
49 adding meta/undo.foo.d
53 adding meta/undo.foo.d
50 adding meta/undo.foo.i
54 adding meta/undo.foo.i
51 adding meta/undo.foo.n
55 adding meta/undo.foo.n
52 adding meta/undo.i
56 adding meta/undo.i
53 adding meta/undo.n
57 adding meta/undo.n
54 adding meta/undo.py
58 adding meta/undo.py
55 adding savanah/foo.d
59 adding savanah/foo.d
56 adding savanah/foo.i
60 adding savanah/foo.i
57 adding savanah/foo.n
61 adding savanah/foo.n
58 adding savanah/undo.babar
62 adding savanah/undo.babar
59 adding savanah/undo.d
63 adding savanah/undo.d
60 adding savanah/undo.foo.d
64 adding savanah/undo.foo.d
61 adding savanah/undo.foo.i
65 adding savanah/undo.foo.i
62 adding savanah/undo.foo.n
66 adding savanah/undo.foo.n
63 adding savanah/undo.i
67 adding savanah/undo.i
64 adding savanah/undo.n
68 adding savanah/undo.n
65 adding savanah/undo.py
69 adding savanah/undo.py
66 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
70 adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc)
67 adding store/foo.d
71 adding store/foo.d
68 adding store/foo.i
72 adding store/foo.i
69 adding store/foo.n
73 adding store/foo.n
70 adding store/undo.babar
74 adding store/undo.babar
71 adding store/undo.d
75 adding store/undo.d
72 adding store/undo.foo.d
76 adding store/undo.foo.d
73 adding store/undo.foo.i
77 adding store/undo.foo.i
74 adding store/undo.foo.n
78 adding store/undo.foo.n
75 adding store/undo.i
79 adding store/undo.i
76 adding store/undo.n
80 adding store/undo.n
77 adding store/undo.py
81 adding store/undo.py
78 adding undo.babar
82 adding undo.babar
79 adding undo.d
83 adding undo.d
80 adding undo.foo.d
84 adding undo.foo.d
81 adding undo.foo.i
85 adding undo.foo.i
82 adding undo.foo.n
86 adding undo.foo.n
83 adding undo.i
87 adding undo.i
84 adding undo.n
88 adding undo.n
85 adding undo.py
89 adding undo.py
86
90
87 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
91 $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid
88 $ cat hg.pid > $DAEMON_PIDS
92 $ cat hg.pid > $DAEMON_PIDS
89 $ cd ..
93 $ cd ..
90
94
91 Check local clone
95 Check local clone
92 ==================
96 ==================
93
97
94 The logic is close enough of uncompressed.
98 The logic is close enough of uncompressed.
95 This is present here to reuse the testing around file with "special" names.
99 This is present here to reuse the testing around file with "special" names.
96
100
97 $ hg clone server local-clone
101 $ hg clone server local-clone
98 updating to branch default
102 updating to branch default
99 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
100
104
101 Check that the clone went well
105 Check that the clone went well
102
106
103 $ hg verify -R local-clone -q
107 $ hg verify -R local-clone -q
104
108
105 Check uncompressed
109 Check uncompressed
106 ==================
110 ==================
107
111
108 Cannot stream clone when server.uncompressed is set
112 Cannot stream clone when server.uncompressed is set
109
113
110 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
114 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out'
111 200 Script output follows
115 200 Script output follows
112
116
113 1
117 1
114
118
115 #if stream-legacy
119 #if stream-legacy
116 $ hg debugcapabilities http://localhost:$HGPORT
120 $ hg debugcapabilities http://localhost:$HGPORT
117 Main capabilities:
121 Main capabilities:
118 batch
122 batch
119 branchmap
123 branchmap
120 $USUAL_BUNDLE2_CAPS_SERVER$
124 $USUAL_BUNDLE2_CAPS_SERVER$
121 changegroupsubset
125 changegroupsubset
122 compression=$BUNDLE2_COMPRESSIONS$
126 compression=$BUNDLE2_COMPRESSIONS$
123 getbundle
127 getbundle
124 httpheader=1024
128 httpheader=1024
125 httpmediatype=0.1rx,0.1tx,0.2tx
129 httpmediatype=0.1rx,0.1tx,0.2tx
126 known
130 known
127 lookup
131 lookup
128 pushkey
132 pushkey
129 unbundle=HG10GZ,HG10BZ,HG10UN
133 unbundle=HG10GZ,HG10BZ,HG10UN
130 unbundlehash
134 unbundlehash
131 Bundle2 capabilities:
135 Bundle2 capabilities:
132 HG20
136 HG20
133 bookmarks
137 bookmarks
134 changegroup
138 changegroup
135 01
139 01
136 02
140 02
137 03
141 03
138 checkheads
142 checkheads
139 related
143 related
140 digests
144 digests
141 md5
145 md5
142 sha1
146 sha1
143 sha512
147 sha512
144 error
148 error
145 abort
149 abort
146 unsupportedcontent
150 unsupportedcontent
147 pushraced
151 pushraced
148 pushkey
152 pushkey
149 hgtagsfnodes
153 hgtagsfnodes
150 listkeys
154 listkeys
151 phases
155 phases
152 heads
156 heads
153 pushkey
157 pushkey
154 remote-changegroup
158 remote-changegroup
155 http
159 http
156 https
160 https
157
161
158 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
162 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
159 warning: stream clone requested but server has them disabled
163 warning: stream clone requested but server has them disabled
160 requesting all changes
164 requesting all changes
161 adding changesets
165 adding changesets
162 adding manifests
166 adding manifests
163 adding file changes
167 adding file changes
164 added 3 changesets with 1088 changes to 1088 files
168 added 3 changesets with 1088 changes to 1088 files
165 new changesets 96ee1d7354c4:5223b5e3265f
169 new changesets 96ee1d7354c4:5223b5e3265f
166
170
167 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
171 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
168 200 Script output follows
172 200 Script output follows
169 content-type: application/mercurial-0.2
173 content-type: application/mercurial-0.2
170
174
171
175
172 $ f --size body --hexdump --bytes 100
176 $ f --size body --hexdump --bytes 100
173 body: size=140
177 body: size=140
174 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
178 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
175 0010: 73 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |s.ERROR:ABORT...|
179 0010: 73 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |s.ERROR:ABORT...|
176 0020: 00 01 01 07 3c 04 16 6d 65 73 73 61 67 65 73 74 |....<..messagest|
180 0020: 00 01 01 07 3c 04 16 6d 65 73 73 61 67 65 73 74 |....<..messagest|
177 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
181 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
178 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
182 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
179 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
183 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
180 0060: 69 73 20 66 |is f|
184 0060: 69 73 20 66 |is f|
181
185
182 #endif
186 #endif
183 #if stream-bundle2-v2
187 #if stream-bundle2-v2
184 $ hg debugcapabilities http://localhost:$HGPORT
188 $ hg debugcapabilities http://localhost:$HGPORT
185 Main capabilities:
189 Main capabilities:
186 batch
190 batch
187 branchmap
191 branchmap
188 $USUAL_BUNDLE2_CAPS_SERVER$
192 $USUAL_BUNDLE2_CAPS_SERVER$
189 changegroupsubset
193 changegroupsubset
190 compression=$BUNDLE2_COMPRESSIONS$
194 compression=$BUNDLE2_COMPRESSIONS$
191 getbundle
195 getbundle
192 httpheader=1024
196 httpheader=1024
193 httpmediatype=0.1rx,0.1tx,0.2tx
197 httpmediatype=0.1rx,0.1tx,0.2tx
194 known
198 known
195 lookup
199 lookup
196 pushkey
200 pushkey
197 unbundle=HG10GZ,HG10BZ,HG10UN
201 unbundle=HG10GZ,HG10BZ,HG10UN
198 unbundlehash
202 unbundlehash
199 Bundle2 capabilities:
203 Bundle2 capabilities:
200 HG20
204 HG20
201 bookmarks
205 bookmarks
202 changegroup
206 changegroup
203 01
207 01
204 02
208 02
205 03
209 03
206 checkheads
210 checkheads
207 related
211 related
208 digests
212 digests
209 md5
213 md5
210 sha1
214 sha1
211 sha512
215 sha512
212 error
216 error
213 abort
217 abort
214 unsupportedcontent
218 unsupportedcontent
215 pushraced
219 pushraced
216 pushkey
220 pushkey
217 hgtagsfnodes
221 hgtagsfnodes
218 listkeys
222 listkeys
219 phases
223 phases
220 heads
224 heads
221 pushkey
225 pushkey
222 remote-changegroup
226 remote-changegroup
223 http
227 http
224 https
228 https
225
229
226 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
230 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
227 warning: stream clone requested but server has them disabled
231 warning: stream clone requested but server has them disabled
228 requesting all changes
232 requesting all changes
229 adding changesets
233 adding changesets
230 adding manifests
234 adding manifests
231 adding file changes
235 adding file changes
232 added 3 changesets with 1088 changes to 1088 files
236 added 3 changesets with 1088 changes to 1088 files
233 new changesets 96ee1d7354c4:5223b5e3265f
237 new changesets 96ee1d7354c4:5223b5e3265f
234
238
235 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
239 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
236 200 Script output follows
240 200 Script output follows
237 content-type: application/mercurial-0.2
241 content-type: application/mercurial-0.2
238
242
239
243
240 $ f --size body --hexdump --bytes 100
244 $ f --size body --hexdump --bytes 100
241 body: size=140
245 body: size=140
242 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
246 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
243 0010: 73 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |s.ERROR:ABORT...|
247 0010: 73 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |s.ERROR:ABORT...|
244 0020: 00 01 01 07 3c 04 16 6d 65 73 73 61 67 65 73 74 |....<..messagest|
248 0020: 00 01 01 07 3c 04 16 6d 65 73 73 61 67 65 73 74 |....<..messagest|
245 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
249 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
246 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
250 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
247 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
251 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
248 0060: 69 73 20 66 |is f|
252 0060: 69 73 20 66 |is f|
249
253
250 #endif
254 #endif
251 #if stream-bundle2-v3
255 #if stream-bundle2-v3
252 $ hg debugcapabilities http://localhost:$HGPORT
256 $ hg debugcapabilities http://localhost:$HGPORT
253 Main capabilities:
257 Main capabilities:
254 batch
258 batch
255 branchmap
259 branchmap
256 $USUAL_BUNDLE2_CAPS_SERVER$
260 $USUAL_BUNDLE2_CAPS_SERVER$
257 changegroupsubset
261 changegroupsubset
258 compression=$BUNDLE2_COMPRESSIONS$
262 compression=$BUNDLE2_COMPRESSIONS$
259 getbundle
263 getbundle
260 httpheader=1024
264 httpheader=1024
261 httpmediatype=0.1rx,0.1tx,0.2tx
265 httpmediatype=0.1rx,0.1tx,0.2tx
262 known
266 known
263 lookup
267 lookup
264 pushkey
268 pushkey
265 unbundle=HG10GZ,HG10BZ,HG10UN
269 unbundle=HG10GZ,HG10BZ,HG10UN
266 unbundlehash
270 unbundlehash
267 Bundle2 capabilities:
271 Bundle2 capabilities:
268 HG20
272 HG20
269 bookmarks
273 bookmarks
270 changegroup
274 changegroup
271 01
275 01
272 02
276 02
273 03
277 03
274 checkheads
278 checkheads
275 related
279 related
276 digests
280 digests
277 md5
281 md5
278 sha1
282 sha1
279 sha512
283 sha512
280 error
284 error
281 abort
285 abort
282 unsupportedcontent
286 unsupportedcontent
283 pushraced
287 pushraced
284 pushkey
288 pushkey
285 hgtagsfnodes
289 hgtagsfnodes
286 listkeys
290 listkeys
287 phases
291 phases
288 heads
292 heads
289 pushkey
293 pushkey
290 remote-changegroup
294 remote-changegroup
291 http
295 http
292 https
296 https
293
297
294 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
298 $ hg clone --stream -U http://localhost:$HGPORT server-disabled
295 warning: stream clone requested but server has them disabled
299 warning: stream clone requested but server has them disabled
296 requesting all changes
300 requesting all changes
297 adding changesets
301 adding changesets
298 adding manifests
302 adding manifests
299 adding file changes
303 adding file changes
300 added 3 changesets with 1088 changes to 1088 files
304 added 3 changesets with 1088 changes to 1088 files
301 new changesets 96ee1d7354c4:5223b5e3265f
305 new changesets 96ee1d7354c4:5223b5e3265f
302
306
303 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
307 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto 0.2 --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
304 200 Script output follows
308 200 Script output follows
305 content-type: application/mercurial-0.2
309 content-type: application/mercurial-0.2
306
310
307
311
308 $ f --size body --hexdump --bytes 100
312 $ f --size body --hexdump --bytes 100
309 body: size=140
313 body: size=140
310 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
314 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
311 0010: 73 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |s.ERROR:ABORT...|
315 0010: 73 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |s.ERROR:ABORT...|
312 0020: 00 01 01 07 3c 04 16 6d 65 73 73 61 67 65 73 74 |....<..messagest|
316 0020: 00 01 01 07 3c 04 16 6d 65 73 73 61 67 65 73 74 |....<..messagest|
313 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
317 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques|
314 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
318 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d|
315 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
319 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th|
316 0060: 69 73 20 66 |is f|
320 0060: 69 73 20 66 |is f|
317
321
318 #endif
322 #endif
319
323
320 $ killdaemons.py
324 $ killdaemons.py
321 $ cd server
325 $ cd server
322 $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt
326 $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt
323 $ cat hg.pid > $DAEMON_PIDS
327 $ cat hg.pid > $DAEMON_PIDS
324 $ cd ..
328 $ cd ..
325
329
326 Basic clone
330 Basic clone
327
331
328 #if stream-legacy
332 #if stream-legacy
329 $ hg clone --stream -U http://localhost:$HGPORT clone1
333 $ hg clone --stream -U http://localhost:$HGPORT clone1
330 streaming all changes
334 streaming all changes
331 1090 files to transfer, 102 KB of data (no-zstd !)
335 1091 files to transfer, 102 KB of data (no-zstd !)
332 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
336 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
333 1090 files to transfer, 98.8 KB of data (zstd !)
337 1091 files to transfer, 98.8 KB of data (zstd !)
334 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
338 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
335 searching for changes
339 searching for changes
336 no changes found
340 no changes found
337 $ cat server/errors.txt
341 $ cat server/errors.txt
338 #endif
342 #endif
339 #if stream-bundle2-v2
343 #if stream-bundle2-v2
340 $ hg clone --stream -U http://localhost:$HGPORT clone1
344 $ hg clone --stream -U http://localhost:$HGPORT clone1
341 streaming all changes
345 streaming all changes
342 1093 files to transfer, 102 KB of data (no-zstd !)
346 1094 files to transfer, 102 KB of data (no-zstd !)
343 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
347 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
344 1093 files to transfer, 98.9 KB of data (zstd !)
348 1094 files to transfer, 98.9 KB of data (zstd no-rust !)
345 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
349 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
350 1096 files to transfer, 99.0 KB of data (zstd rust !)
351 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
346
352
347 $ ls -1 clone1/.hg/cache
353 $ ls -1 clone1/.hg/cache
348 branch2-base
354 branch2-base
349 branch2-immutable
355 branch2-immutable
350 branch2-served
356 branch2-served
351 branch2-served.hidden
357 branch2-served.hidden
352 branch2-visible
358 branch2-visible
353 branch2-visible-hidden
359 branch2-visible-hidden
354 rbc-names-v1
360 rbc-names-v1
355 rbc-revs-v1
361 rbc-revs-v1
356 tags2
362 tags2
357 tags2-served
363 tags2-served
358 $ cat server/errors.txt
364 $ cat server/errors.txt
359 #endif
365 #endif
360 #if stream-bundle2-v3
366 #if stream-bundle2-v3
361 $ hg clone --stream -U http://localhost:$HGPORT clone1
367 $ hg clone --stream -U http://localhost:$HGPORT clone1
362 streaming all changes
368 streaming all changes
363 1093 entries to transfer
369 1093 entries to transfer
364 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
370 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
365 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
371 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
372 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
366
373
367 $ ls -1 clone1/.hg/cache
374 $ ls -1 clone1/.hg/cache
368 branch2-base
375 branch2-base
369 branch2-immutable
376 branch2-immutable
370 branch2-served
377 branch2-served
371 branch2-served.hidden
378 branch2-served.hidden
372 branch2-visible
379 branch2-visible
373 branch2-visible-hidden
380 branch2-visible-hidden
374 rbc-names-v1
381 rbc-names-v1
375 rbc-revs-v1
382 rbc-revs-v1
376 tags2
383 tags2
377 tags2-served
384 tags2-served
378 $ cat server/errors.txt
385 $ cat server/errors.txt
379 #endif
386 #endif
380
387
381 getbundle requests with stream=1 are uncompressed
388 getbundle requests with stream=1 are uncompressed
382
389
383 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
390 $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=getbundle' content-type --bodyfile body --hgproto '0.1 0.2 comp=zlib,none' --requestheader "x-hgarg-1=bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Aphases%253Dheads%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=0&common=0000000000000000000000000000000000000000&heads=c17445101a72edac06facd130d14808dfbd5c7c2&stream=1"
384 200 Script output follows
391 200 Script output follows
385 content-type: application/mercurial-0.2
392 content-type: application/mercurial-0.2
386
393
387
394
388 #if no-zstd no-rust
395 #if no-zstd no-rust
389 $ f --size --hex --bytes 256 body
396 $ f --size --hex --bytes 256 body
390 body: size=119123
397 body: size=119140
391 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
398 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
392 0010: 62 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |b.STREAM2.......|
399 0010: 62 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |b.STREAM2.......|
393 0020: 06 09 04 0c 26 62 79 74 65 63 6f 75 6e 74 31 30 |....&bytecount10|
400 0020: 06 09 04 0c 26 62 79 74 65 63 6f 75 6e 74 31 30 |....&bytecount10|
394 0030: 34 31 31 35 66 69 6c 65 63 6f 75 6e 74 31 30 39 |4115filecount109|
401 0030: 34 31 31 35 66 69 6c 65 63 6f 75 6e 74 31 30 39 |4115filecount109|
395 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen|
402 0040: 34 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |4requirementsgen|
396 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
403 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
397 0060: 6f 67 76 31 25 32 43 73 70 61 72 73 65 72 65 76 |ogv1%2Csparserev|
404 0060: 6f 67 76 31 25 32 43 73 70 61 72 73 65 72 65 76 |ogv1%2Csparserev|
398 0070: 6c 6f 67 00 00 80 00 73 08 42 64 61 74 61 2f 30 |log....s.Bdata/0|
405 0070: 6c 6f 67 00 00 80 00 73 08 42 64 61 74 61 2f 30 |log....s.Bdata/0|
399 0080: 2e 69 00 03 00 01 00 00 00 00 00 00 00 02 00 00 |.i..............|
406 0080: 2e 69 00 03 00 01 00 00 00 00 00 00 00 02 00 00 |.i..............|
400 0090: 00 01 00 00 00 00 00 00 00 01 ff ff ff ff ff ff |................|
407 0090: 00 01 00 00 00 00 00 00 00 01 ff ff ff ff ff ff |................|
401 00a0: ff ff 80 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 |...)c.I.#....Vg.|
408 00a0: ff ff 80 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 |...)c.I.#....Vg.|
402 00b0: 67 2c 69 d1 ec 39 00 00 00 00 00 00 00 00 00 00 |g,i..9..........|
409 00b0: 67 2c 69 d1 ec 39 00 00 00 00 00 00 00 00 00 00 |g,i..9..........|
403 00c0: 00 00 75 30 73 26 45 64 61 74 61 2f 30 30 63 68 |..u0s&Edata/00ch|
410 00c0: 00 00 75 30 73 26 45 64 61 74 61 2f 30 30 63 68 |..u0s&Edata/00ch|
404 00d0: 61 6e 67 65 6c 6f 67 2d 61 62 33 34 39 31 38 30 |angelog-ab349180|
411 00d0: 61 6e 67 65 6c 6f 67 2d 61 62 33 34 39 31 38 30 |angelog-ab349180|
405 00e0: 61 30 34 30 35 30 31 30 2e 6e 64 2e 69 00 03 00 |a0405010.nd.i...|
412 00e0: 61 30 34 30 35 30 31 30 2e 6e 64 2e 69 00 03 00 |a0405010.nd.i...|
406 00f0: 01 00 00 00 00 00 00 00 05 00 00 00 04 00 00 00 |................|
413 00f0: 01 00 00 00 00 00 00 00 05 00 00 00 04 00 00 00 |................|
407 #endif
414 #endif
408 #if zstd no-rust
415 #if zstd no-rust
409 $ f --size --hex --bytes 256 body
416 $ f --size --hex --bytes 256 body
410 body: size=116310 (no-bigendian !)
417 body: size=116327 (no-bigendian !)
411 body: size=116305 (bigendian !)
418 body: size=116322 (bigendian !)
412 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
419 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
413 0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2.......|
420 0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2.......|
414 0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |....@bytecount10|
421 0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |....@bytecount10|
415 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| (no-bigendian !)
422 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| (no-bigendian !)
416 0030: 31 32 37 31 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1271filecount109| (bigendian !)
423 0030: 31 32 37 31 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1271filecount109| (bigendian !)
417 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen|
424 0040: 34 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |4requirementsgen|
418 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
425 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
419 0060: 6f 67 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a |og-compression-z|
426 0060: 6f 67 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a |og-compression-z|
420 0070: 73 74 64 25 32 43 72 65 76 6c 6f 67 76 31 25 32 |std%2Crevlogv1%2|
427 0070: 73 74 64 25 32 43 72 65 76 6c 6f 67 76 31 25 32 |std%2Crevlogv1%2|
421 0080: 43 73 70 61 72 73 65 72 65 76 6c 6f 67 00 00 80 |Csparserevlog...|
428 0080: 43 73 70 61 72 73 65 72 65 76 6c 6f 67 00 00 80 |Csparserevlog...|
422 0090: 00 73 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 |.s.Bdata/0.i....|
429 0090: 00 73 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 |.s.Bdata/0.i....|
423 00a0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
430 00a0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
424 00b0: 00 00 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 |.............)c.|
431 00b0: 00 00 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 |.............)c.|
425 00c0: 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 |I.#....Vg.g,i..9|
432 00c0: 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 |I.#....Vg.g,i..9|
426 00d0: 00 00 00 00 00 00 00 00 00 00 00 00 75 30 73 26 |............u0s&|
433 00d0: 00 00 00 00 00 00 00 00 00 00 00 00 75 30 73 26 |............u0s&|
427 00e0: 45 64 61 74 61 2f 30 30 63 68 61 6e 67 65 6c 6f |Edata/00changelo|
434 00e0: 45 64 61 74 61 2f 30 30 63 68 61 6e 67 65 6c 6f |Edata/00changelo|
428 00f0: 67 2d 61 62 33 34 39 31 38 30 61 30 34 30 35 30 |g-ab349180a04050|
435 00f0: 67 2d 61 62 33 34 39 31 38 30 61 30 34 30 35 30 |g-ab349180a04050|
429 #endif
436 #endif
430 #if zstd rust no-dirstate-v2
437 #if zstd rust no-dirstate-v2
431 $ f --size --hex --bytes 256 body
438 $ f --size --hex --bytes 256 body
432 body: size=116310
439 body: size=116310 (no-rust !)
440 body: size=116495 (rust no-stream-legacy no-bigendian !)
441 body: size=116490 (rust no-stream-legacy bigendian !)
442 body: size=116327 (rust stream-legacy no-bigendian !)
443 body: size=116322 (rust stream-legacy bigendian !)
433 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
444 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
434 0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2.......|
445 0010: 7c 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 ||.STREAM2.......|
435 0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |....@bytecount10|
446 0020: 06 09 04 0c 40 62 79 74 65 63 6f 75 6e 74 31 30 |....@bytecount10|
436 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109|
447 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| (no-rust !)
437 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen|
448 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |3requirementsgen| (no-rust !)
449 0030: 31 34 30 32 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1402filecount109| (rust no-stream-legacy no-bigendian !)
450 0030: 31 33 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1397filecount109| (rust no-stream-legacy bigendian !)
451 0040: 36 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |6requirementsgen| (rust no-stream-legacy !)
452 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| (rust stream-legacy no-bigendian !)
453 0030: 31 32 37 31 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1271filecount109| (rust stream-legacy bigendian !)
454 0040: 34 72 65 71 75 69 72 65 6d 65 6e 74 73 67 65 6e |4requirementsgen| (rust stream-legacy !)
438 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
455 0050: 65 72 61 6c 64 65 6c 74 61 25 32 43 72 65 76 6c |eraldelta%2Crevl|
439 0060: 6f 67 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a |og-compression-z|
456 0060: 6f 67 2d 63 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a |og-compression-z|
440 0070: 73 74 64 25 32 43 72 65 76 6c 6f 67 76 31 25 32 |std%2Crevlogv1%2|
457 0070: 73 74 64 25 32 43 72 65 76 6c 6f 67 76 31 25 32 |std%2Crevlogv1%2|
441 0080: 43 73 70 61 72 73 65 72 65 76 6c 6f 67 00 00 80 |Csparserevlog...|
458 0080: 43 73 70 61 72 73 65 72 65 76 6c 6f 67 00 00 80 |Csparserevlog...|
442 0090: 00 73 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 |.s.Bdata/0.i....|
459 0090: 00 73 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 |.s.Bdata/0.i....|
443 00a0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
460 00a0: 00 00 00 00 00 00 00 02 00 00 00 01 00 00 00 00 |................|
444 00b0: 00 00 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 |.............)c.|
461 00b0: 00 00 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 |.............)c.|
445 00c0: 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 |I.#....Vg.g,i..9|
462 00c0: 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 |I.#....Vg.g,i..9|
446 00d0: 00 00 00 00 00 00 00 00 00 00 00 00 75 30 73 26 |............u0s&|
463 00d0: 00 00 00 00 00 00 00 00 00 00 00 00 75 30 73 26 |............u0s&|
447 00e0: 45 64 61 74 61 2f 30 30 63 68 61 6e 67 65 6c 6f |Edata/00changelo|
464 00e0: 45 64 61 74 61 2f 30 30 63 68 61 6e 67 65 6c 6f |Edata/00changelo|
448 00f0: 67 2d 61 62 33 34 39 31 38 30 61 30 34 30 35 30 |g-ab349180a04050|
465 00f0: 67 2d 61 62 33 34 39 31 38 30 61 30 34 30 35 30 |g-ab349180a04050|
449 #endif
466 #endif
450 #if zstd dirstate-v2
467 #if zstd dirstate-v2
451 $ f --size --hex --bytes 256 body
468 $ f --size --hex --bytes 256 body
452 body: size=109549
469 body: size=109549
453 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
470 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......|
454 0010: c0 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
471 0010: c0 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......|
455 0020: 05 09 04 0c 85 62 79 74 65 63 6f 75 6e 74 39 35 |.....bytecount95|
472 0020: 05 09 04 0c 85 62 79 74 65 63 6f 75 6e 74 39 35 |.....bytecount95|
456 0030: 38 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |897filecount1030|
473 0030: 38 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |897filecount1030|
457 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote|
474 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote|
458 0050: 6e 63 6f 64 65 25 32 43 65 78 70 2d 64 69 72 73 |ncode%2Cexp-dirs|
475 0050: 6e 63 6f 64 65 25 32 43 65 78 70 2d 64 69 72 73 |ncode%2Cexp-dirs|
459 0060: 74 61 74 65 2d 76 32 25 32 43 66 6e 63 61 63 68 |tate-v2%2Cfncach|
476 0060: 74 61 74 65 2d 76 32 25 32 43 66 6e 63 61 63 68 |tate-v2%2Cfncach|
460 0070: 65 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 |e%2Cgeneraldelta|
477 0070: 65 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 |e%2Cgeneraldelta|
461 0080: 25 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f |%2Cpersistent-no|
478 0080: 25 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f |%2Cpersistent-no|
462 0090: 64 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 |demap%2Crevlog-c|
479 0090: 64 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 |demap%2Crevlog-c|
463 00a0: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 |ompression-zstd%|
480 00a0: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 |ompression-zstd%|
464 00b0: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa|
481 00b0: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa|
465 00c0: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor|
482 00c0: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor|
466 00d0: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i|
483 00d0: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i|
467 00e0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................|
484 00e0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................|
468 00f0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................|
485 00f0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................|
469 #endif
486 #endif
470
487
471 --uncompressed is an alias to --stream
488 --uncompressed is an alias to --stream
472
489
473 #if stream-legacy
490 #if stream-legacy
474 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
491 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
475 streaming all changes
492 streaming all changes
476 1090 files to transfer, 102 KB of data (no-zstd !)
493 1091 files to transfer, 102 KB of data (no-zstd !)
477 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
494 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
478 1090 files to transfer, 98.8 KB of data (zstd !)
495 1091 files to transfer, 98.8 KB of data (zstd !)
479 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
496 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
480 searching for changes
497 searching for changes
481 no changes found
498 no changes found
482 #endif
499 #endif
483 #if stream-bundle2-v2
500 #if stream-bundle2-v2
484 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
501 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
485 streaming all changes
502 streaming all changes
486 1093 files to transfer, 102 KB of data (no-zstd !)
503 1094 files to transfer, 102 KB of data (no-zstd !)
487 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
504 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
488 1093 files to transfer, 98.9 KB of data (zstd !)
505 1094 files to transfer, 98.9 KB of data (zstd no-rust !)
489 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
506 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
507 1096 files to transfer, 99.0 KB of data (zstd rust !)
508 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
490 #endif
509 #endif
491 #if stream-bundle2-v3
510 #if stream-bundle2-v3
492 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
511 $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed
493 streaming all changes
512 streaming all changes
494 1093 entries to transfer
513 1093 entries to transfer
495 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
514 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
496 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
515 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
516 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
497 #endif
517 #endif
498
518
499 Clone with background file closing enabled
519 Clone with background file closing enabled
500
520
501 #if stream-legacy
521 #if stream-legacy
502 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
522 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
503 using http://localhost:$HGPORT/
523 using http://localhost:$HGPORT/
504 sending capabilities command
524 sending capabilities command
505 sending branchmap command
525 sending branchmap command
506 streaming all changes
526 streaming all changes
507 sending stream_out command
527 sending stream_out command
508 1090 files to transfer, 102 KB of data (no-zstd !)
528 1091 files to transfer, 102 KB of data (no-zstd !)
509 1090 files to transfer, 98.8 KB of data (zstd !)
529 1091 files to transfer, 98.8 KB of data (zstd !)
510 starting 4 threads for background file closing
530 starting 4 threads for background file closing
511 updating the branch cache
531 updating the branch cache
512 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
532 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
513 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
533 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
514 query 1; heads
534 query 1; heads
515 sending batch command
535 sending batch command
516 searching for changes
536 searching for changes
517 all remote heads known locally
537 all remote heads known locally
518 no changes found
538 no changes found
519 sending getbundle command
539 sending getbundle command
520 bundle2-input-bundle: with-transaction
540 bundle2-input-bundle: with-transaction
521 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
541 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
522 bundle2-input-part: "phase-heads" supported
542 bundle2-input-part: "phase-heads" supported
523 bundle2-input-part: total payload size 24
543 bundle2-input-part: total payload size 24
524 bundle2-input-bundle: 2 parts total
544 bundle2-input-bundle: 2 parts total
525 checking for updated bookmarks
545 checking for updated bookmarks
526 updating the branch cache
546 updating the branch cache
527 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
547 (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob)
528 #endif
548 #endif
529 #if stream-bundle2-v2
549 #if stream-bundle2-v2
530 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
550 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
531 using http://localhost:$HGPORT/
551 using http://localhost:$HGPORT/
532 sending capabilities command
552 sending capabilities command
533 query 1; heads
553 query 1; heads
534 sending batch command
554 sending batch command
535 streaming all changes
555 streaming all changes
536 sending getbundle command
556 sending getbundle command
537 bundle2-input-bundle: with-transaction
557 bundle2-input-bundle: with-transaction
538 bundle2-input-part: "stream2" (params: 3 mandatory) supported
558 bundle2-input-part: "stream2" (params: 3 mandatory) supported
539 applying stream bundle
559 applying stream bundle
540 1093 files to transfer, 102 KB of data (no-zstd !)
560 1094 files to transfer, 102 KB of data (no-zstd !)
541 1093 files to transfer, 98.9 KB of data (zstd !)
561 1094 files to transfer, 98.9 KB of data (zstd no-rust !)
562 1096 files to transfer, 99.0 KB of data (zstd rust !)
542 starting 4 threads for background file closing
563 starting 4 threads for background file closing
543 starting 4 threads for background file closing
564 starting 4 threads for background file closing
544 updating the branch cache
565 updating the branch cache
545 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
566 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
546 bundle2-input-part: total payload size 118984 (no-zstd !)
567 bundle2-input-part: total payload size 119001 (no-zstd !)
547 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
568 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
548 bundle2-input-part: total payload size 116145 (zstd no-bigendian !)
569 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
549 bundle2-input-part: total payload size 116140 (zstd bigendian !)
570 bundle2-input-part: total payload size 116162 (zstd no-bigendian no-rust !)
571 bundle2-input-part: total payload size 116330 (zstd no-bigendian rust !)
572 bundle2-input-part: total payload size 116157 (zstd bigendian no-rust !)
573 bundle2-input-part: total payload size 116325 (zstd bigendian rust !)
550 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
574 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
551 bundle2-input-bundle: 2 parts total
575 bundle2-input-bundle: 2 parts total
552 checking for updated bookmarks
576 checking for updated bookmarks
553 updating the branch cache
577 updating the branch cache
554 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
578 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
555 #endif
579 #endif
556 #if stream-bundle2-v3
580 #if stream-bundle2-v3
557 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
581 $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding
558 using http://localhost:$HGPORT/
582 using http://localhost:$HGPORT/
559 sending capabilities command
583 sending capabilities command
560 query 1; heads
584 query 1; heads
561 sending batch command
585 sending batch command
562 streaming all changes
586 streaming all changes
563 sending getbundle command
587 sending getbundle command
564 bundle2-input-bundle: with-transaction
588 bundle2-input-bundle: with-transaction
565 bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported
589 bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported
566 applying stream bundle
590 applying stream bundle
567 1093 entries to transfer
591 1093 entries to transfer
568 starting 4 threads for background file closing
592 starting 4 threads for background file closing
569 starting 4 threads for background file closing
593 starting 4 threads for background file closing
570 updating the branch cache
594 updating the branch cache
571 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
595 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
572 bundle2-input-part: total payload size 120079 (no-zstd !)
596 bundle2-input-part: total payload size 120096 (no-zstd !)
573 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
597 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
574 bundle2-input-part: total payload size 117240 (zstd no-bigendian !)
598 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
575 bundle2-input-part: total payload size 116138 (zstd bigendian !)
599 bundle2-input-part: total payload size 117257 (zstd no-rust no-bigendian !)
600 bundle2-input-part: total payload size 117425 (zstd rust no-bigendian !)
601 bundle2-input-part: total payload size 117252 (zstd bigendian no-rust !)
602 bundle2-input-part: total payload size 117420 (zstd bigendian rust !)
576 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
603 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
577 bundle2-input-bundle: 2 parts total
604 bundle2-input-bundle: 2 parts total
578 checking for updated bookmarks
605 checking for updated bookmarks
579 updating the branch cache
606 updating the branch cache
580 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
607 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
581 #endif
608 #endif
582
609
583 Cannot stream clone when there are secret changesets
610 Cannot stream clone when there are secret changesets
584
611
585 $ hg -R server phase --force --secret -r tip
612 $ hg -R server phase --force --secret -r tip
586 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
613 $ hg clone --stream -U http://localhost:$HGPORT secret-denied
587 warning: stream clone requested but server has them disabled
614 warning: stream clone requested but server has them disabled
588 requesting all changes
615 requesting all changes
589 adding changesets
616 adding changesets
590 adding manifests
617 adding manifests
591 adding file changes
618 adding file changes
592 added 2 changesets with 1025 changes to 1025 files
619 added 2 changesets with 1025 changes to 1025 files
593 new changesets 96ee1d7354c4:c17445101a72
620 new changesets 96ee1d7354c4:c17445101a72
594
621
595 $ killdaemons.py
622 $ killdaemons.py
596
623
597 Streaming of secrets can be overridden by server config
624 Streaming of secrets can be overridden by server config
598
625
599 $ cd server
626 $ cd server
600 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
627 $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid
601 $ cat hg.pid > $DAEMON_PIDS
628 $ cat hg.pid > $DAEMON_PIDS
602 $ cd ..
629 $ cd ..
603
630
604 #if stream-legacy
631 #if stream-legacy
605 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
632 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
606 streaming all changes
633 streaming all changes
607 1090 files to transfer, 102 KB of data (no-zstd !)
634 1091 files to transfer, 102 KB of data (no-zstd !)
608 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
635 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
609 1090 files to transfer, 98.8 KB of data (zstd !)
636 1091 files to transfer, 98.8 KB of data (zstd !)
610 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
637 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
611 searching for changes
638 searching for changes
612 no changes found
639 no changes found
613 #endif
640 #endif
614 #if stream-bundle2-v2
641 #if stream-bundle2-v2
615 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
642 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
616 streaming all changes
643 streaming all changes
617 1093 files to transfer, 102 KB of data (no-zstd !)
644 1094 files to transfer, 102 KB of data (no-zstd !)
618 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
645 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
619 1093 files to transfer, 98.9 KB of data (zstd !)
646 1094 files to transfer, 98.9 KB of data (zstd no-rust !)
620 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
647 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
648 1096 files to transfer, 99.0 KB of data (zstd rust !)
649 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
621 #endif
650 #endif
622 #if stream-bundle2-v3
651 #if stream-bundle2-v3
623 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
652 $ hg clone --stream -U http://localhost:$HGPORT secret-allowed
624 streaming all changes
653 streaming all changes
625 1093 entries to transfer
654 1093 entries to transfer
626 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
655 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
627 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !)
656 transferred 98.9 KB in * seconds (* */sec) (glob) (zstd no-rust !)
657 transferred 99.0 KB in * seconds (* */sec) (glob) (zstd rust !)
628 #endif
658 #endif
629
659
630 $ killdaemons.py
660 $ killdaemons.py
631
661
632 Verify interaction between preferuncompressed and secret presence
662 Verify interaction between preferuncompressed and secret presence
633
663
634 $ cd server
664 $ cd server
635 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
665 $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid
636 $ cat hg.pid > $DAEMON_PIDS
666 $ cat hg.pid > $DAEMON_PIDS
637 $ cd ..
667 $ cd ..
638
668
639 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
669 $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret
640 requesting all changes
670 requesting all changes
641 adding changesets
671 adding changesets
642 adding manifests
672 adding manifests
643 adding file changes
673 adding file changes
644 added 2 changesets with 1025 changes to 1025 files
674 added 2 changesets with 1025 changes to 1025 files
645 new changesets 96ee1d7354c4:c17445101a72
675 new changesets 96ee1d7354c4:c17445101a72
646
676
647 $ killdaemons.py
677 $ killdaemons.py
648
678
649 Clone not allowed when full bundles disabled and can't serve secrets
679 Clone not allowed when full bundles disabled and can't serve secrets
650
680
651 $ cd server
681 $ cd server
652 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
682 $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid
653 $ cat hg.pid > $DAEMON_PIDS
683 $ cat hg.pid > $DAEMON_PIDS
654 $ cd ..
684 $ cd ..
655
685
656 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
686 $ hg clone --stream http://localhost:$HGPORT secret-full-disabled
657 warning: stream clone requested but server has them disabled
687 warning: stream clone requested but server has them disabled
658 requesting all changes
688 requesting all changes
659 remote: abort: server has pull-based clones disabled
689 remote: abort: server has pull-based clones disabled
660 abort: pull failed on remote
690 abort: pull failed on remote
661 (remove --pull if specified or upgrade Mercurial)
691 (remove --pull if specified or upgrade Mercurial)
662 [100]
692 [100]
663
693
664 Local stream clone with secrets involved
694 Local stream clone with secrets involved
665 (This is just a test over behavior: if you have access to the repo's files,
695 (This is just a test over behavior: if you have access to the repo's files,
666 there is no security so it isn't important to prevent a clone here.)
696 there is no security so it isn't important to prevent a clone here.)
667
697
668 $ hg clone -U --stream server local-secret
698 $ hg clone -U --stream server local-secret
669 warning: stream clone requested but server has them disabled
699 warning: stream clone requested but server has them disabled
670 requesting all changes
700 requesting all changes
671 adding changesets
701 adding changesets
672 adding manifests
702 adding manifests
673 adding file changes
703 adding file changes
674 added 2 changesets with 1025 changes to 1025 files
704 added 2 changesets with 1025 changes to 1025 files
675 new changesets 96ee1d7354c4:c17445101a72
705 new changesets 96ee1d7354c4:c17445101a72
676
706
677 Stream clone while repo is changing:
707 Stream clone while repo is changing:
678
708
679 $ mkdir changing
709 $ mkdir changing
680 $ cd changing
710 $ cd changing
681
711
682 prepare repo with small and big file to cover both code paths in emitrevlogdata
712 prepare repo with small and big file to cover both code paths in emitrevlogdata
683
713
684 $ hg init repo
714 $ hg init repo
685 $ touch repo/f1
715 $ touch repo/f1
686 $ $TESTDIR/seq.py 50000 > repo/f2
716 $ $TESTDIR/seq.py 50000 > repo/f2
687 $ hg -R repo ci -Aqm "0"
717 $ hg -R repo ci -Aqm "0"
688 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
718 $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1"
689 $ export HG_TEST_STREAM_WALKED_FILE_1
719 $ export HG_TEST_STREAM_WALKED_FILE_1
690 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
720 $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2"
691 $ export HG_TEST_STREAM_WALKED_FILE_2
721 $ export HG_TEST_STREAM_WALKED_FILE_2
692 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
722 $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3"
693 $ export HG_TEST_STREAM_WALKED_FILE_3
723 $ export HG_TEST_STREAM_WALKED_FILE_3
694 # $ cat << EOF >> $HGRCPATH
724 # $ cat << EOF >> $HGRCPATH
695 # > [hooks]
725 # > [hooks]
696 # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*"
726 # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*"
697 # > EOF
727 # > EOF
698 $ hg serve -R repo -p $HGPORT1 -d --error errors.log --pid-file=hg.pid --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py"
728 $ hg serve -R repo -p $HGPORT1 -d --error errors.log --pid-file=hg.pid --config extensions.stream_steps="$RUNTESTDIR/testlib/ext-stream-clone-steps.py"
699 $ cat hg.pid >> $DAEMON_PIDS
729 $ cat hg.pid >> $DAEMON_PIDS
700
730
701 clone while modifying the repo between stating file with write lock and
731 clone while modifying the repo between stating file with write lock and
702 actually serving file content
732 actually serving file content
703
733
704 $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") &
734 $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") &
705 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
735 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1
706 $ echo >> repo/f1
736 $ echo >> repo/f1
707 $ echo >> repo/f2
737 $ echo >> repo/f2
708 $ hg -R repo ci -m "1" --config ui.timeout.warn=-1
738 $ hg -R repo ci -m "1" --config ui.timeout.warn=-1
709 $ touch $HG_TEST_STREAM_WALKED_FILE_2
739 $ touch $HG_TEST_STREAM_WALKED_FILE_2
710 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
740 $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3
711 $ hg -R clone id
741 $ hg -R clone id
712 000000000000
742 000000000000
713 $ cat errors.log
743 $ cat errors.log
714 $ cd ..
744 $ cd ..
715
745
716 Stream repository with bookmarks
746 Stream repository with bookmarks
717 --------------------------------
747 --------------------------------
718
748
719 (revert introduction of secret changeset)
749 (revert introduction of secret changeset)
720
750
721 $ hg -R server phase --draft 'secret()'
751 $ hg -R server phase --draft 'secret()'
722
752
723 add a bookmark
753 add a bookmark
724
754
725 $ hg -R server bookmark -r tip some-bookmark
755 $ hg -R server bookmark -r tip some-bookmark
726
756
727 clone it
757 clone it
728
758
729 #if stream-legacy
759 #if stream-legacy
730 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
760 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
731 streaming all changes
761 streaming all changes
732 1090 files to transfer, 102 KB of data (no-zstd !)
762 1091 files to transfer, 102 KB of data (no-zstd !)
733 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
763 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
734 1090 files to transfer, 98.8 KB of data (zstd !)
764 1091 files to transfer, 98.8 KB of data (zstd !)
735 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
765 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
736 searching for changes
766 searching for changes
737 no changes found
767 no changes found
738 updating to branch default
768 updating to branch default
739 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
769 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
740 #endif
770 #endif
741 #if stream-bundle2-v2
771 #if stream-bundle2-v2
742 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
772 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
743 streaming all changes
773 streaming all changes
744 1096 files to transfer, 102 KB of data (no-zstd !)
774 1097 files to transfer, 102 KB of data (no-zstd !)
745 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
775 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
746 1096 files to transfer, 99.1 KB of data (zstd !)
776 1097 files to transfer, 99.1 KB of data (zstd no-rust !)
747 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
777 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
778 1099 files to transfer, 99.2 KB of data (zstd rust !)
779 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
748 updating to branch default
780 updating to branch default
749 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
781 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
750 #endif
782 #endif
751 #if stream-bundle2-v3
783 #if stream-bundle2-v3
752 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
784 $ hg clone --stream http://localhost:$HGPORT with-bookmarks
753 streaming all changes
785 streaming all changes
754 1096 entries to transfer
786 1096 entries to transfer
755 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
787 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
756 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
788 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
789 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
757 updating to branch default
790 updating to branch default
758 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
791 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
759 #endif
792 #endif
760 $ hg verify -R with-bookmarks -q
793 $ hg verify -R with-bookmarks -q
761 $ hg -R with-bookmarks bookmarks
794 $ hg -R with-bookmarks bookmarks
762 some-bookmark 2:5223b5e3265f
795 some-bookmark 2:5223b5e3265f
763
796
764 Stream repository with phases
797 Stream repository with phases
765 -----------------------------
798 -----------------------------
766
799
767 Clone as publishing
800 Clone as publishing
768
801
769 $ hg -R server phase -r 'all()'
802 $ hg -R server phase -r 'all()'
770 0: draft
803 0: draft
771 1: draft
804 1: draft
772 2: draft
805 2: draft
773
806
774 #if stream-legacy
807 #if stream-legacy
775 $ hg clone --stream http://localhost:$HGPORT phase-publish
808 $ hg clone --stream http://localhost:$HGPORT phase-publish
776 streaming all changes
809 streaming all changes
777 1090 files to transfer, 102 KB of data (no-zstd !)
810 1091 files to transfer, 102 KB of data (no-zstd !)
778 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
811 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
779 1090 files to transfer, 98.8 KB of data (zstd !)
812 1091 files to transfer, 98.8 KB of data (zstd !)
780 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
813 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
781 searching for changes
814 searching for changes
782 no changes found
815 no changes found
783 updating to branch default
816 updating to branch default
784 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
817 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
785 #endif
818 #endif
786 #if stream-bundle2-v2
819 #if stream-bundle2-v2
787 $ hg clone --stream http://localhost:$HGPORT phase-publish
820 $ hg clone --stream http://localhost:$HGPORT phase-publish
788 streaming all changes
821 streaming all changes
789 1096 files to transfer, 102 KB of data (no-zstd !)
822 1097 files to transfer, 102 KB of data (no-zstd !)
790 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
823 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
791 1096 files to transfer, 99.1 KB of data (zstd !)
824 1097 files to transfer, 99.1 KB of data (zstd no-rust !)
792 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
825 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
826 1099 files to transfer, 99.2 KB of data (zstd rust !)
827 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
793 updating to branch default
828 updating to branch default
794 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
829 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
795 #endif
830 #endif
796 #if stream-bundle2-v3
831 #if stream-bundle2-v3
797 $ hg clone --stream http://localhost:$HGPORT phase-publish
832 $ hg clone --stream http://localhost:$HGPORT phase-publish
798 streaming all changes
833 streaming all changes
799 1096 entries to transfer
834 1096 entries to transfer
800 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
835 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
801 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
836 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
837 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
802 updating to branch default
838 updating to branch default
803 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
839 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
804 #endif
840 #endif
805 $ hg verify -R phase-publish -q
841 $ hg verify -R phase-publish -q
806 $ hg -R phase-publish phase -r 'all()'
842 $ hg -R phase-publish phase -r 'all()'
807 0: public
843 0: public
808 1: public
844 1: public
809 2: public
845 2: public
810
846
811 Clone as non publishing
847 Clone as non publishing
812
848
813 $ cat << EOF >> server/.hg/hgrc
849 $ cat << EOF >> server/.hg/hgrc
814 > [phases]
850 > [phases]
815 > publish = False
851 > publish = False
816 > EOF
852 > EOF
817 $ killdaemons.py
853 $ killdaemons.py
818 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
854 $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid
819 $ cat hg.pid > $DAEMON_PIDS
855 $ cat hg.pid > $DAEMON_PIDS
820
856
821 #if stream-legacy
857 #if stream-legacy
822
858
823 With v1 of the stream protocol, changeset are always cloned as public. It make
859 With v1 of the stream protocol, changeset are always cloned as public. It make
824 stream v1 unsuitable for non-publishing repository.
860 stream v1 unsuitable for non-publishing repository.
825
861
826 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
862 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
827 streaming all changes
863 streaming all changes
828 1090 files to transfer, 102 KB of data (no-zstd !)
864 1091 files to transfer, 102 KB of data (no-zstd !)
829 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
865 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
830 1090 files to transfer, 98.8 KB of data (zstd !)
866 1091 files to transfer, 98.8 KB of data (zstd !)
831 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
867 transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !)
832 searching for changes
868 searching for changes
833 no changes found
869 no changes found
834 updating to branch default
870 updating to branch default
835 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
871 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
836 $ hg -R phase-no-publish phase -r 'all()'
872 $ hg -R phase-no-publish phase -r 'all()'
837 0: public
873 0: public
838 1: public
874 1: public
839 2: public
875 2: public
840 #endif
876 #endif
841 #if stream-bundle2-v2
877 #if stream-bundle2-v2
842 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
878 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
843 streaming all changes
879 streaming all changes
844 1097 files to transfer, 102 KB of data (no-zstd !)
880 1098 files to transfer, 102 KB of data (no-zstd !)
845 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
881 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
846 1097 files to transfer, 99.1 KB of data (zstd !)
882 1098 files to transfer, 99.1 KB of data (zstd no-rust !)
847 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
883 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
884 1100 files to transfer, 99.2 KB of data (zstd rust !)
885 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
848 updating to branch default
886 updating to branch default
849 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
887 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
850 $ hg -R phase-no-publish phase -r 'all()'
888 $ hg -R phase-no-publish phase -r 'all()'
851 0: draft
889 0: draft
852 1: draft
890 1: draft
853 2: draft
891 2: draft
854 #endif
892 #endif
855 #if stream-bundle2-v3
893 #if stream-bundle2-v3
856 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
894 $ hg clone --stream http://localhost:$HGPORT phase-no-publish
857 streaming all changes
895 streaming all changes
858 1097 entries to transfer
896 1097 entries to transfer
859 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
897 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
860 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !)
898 transferred 99.1 KB in * seconds (* */sec) (glob) (zstd no-rust !)
899 transferred 99.2 KB in * seconds (* */sec) (glob) (zstd rust !)
861 updating to branch default
900 updating to branch default
862 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
901 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved
863 $ hg -R phase-no-publish phase -r 'all()'
902 $ hg -R phase-no-publish phase -r 'all()'
864 0: draft
903 0: draft
865 1: draft
904 1: draft
866 2: draft
905 2: draft
867 #endif
906 #endif
868 $ hg verify -R phase-no-publish -q
907 $ hg verify -R phase-no-publish -q
869
908
870 $ killdaemons.py
909 $ killdaemons.py
871
910
872 #if stream-legacy
911 #if stream-legacy
873
912
874 With v1 of the stream protocol, changeset are always cloned as public. There's
913 With v1 of the stream protocol, changeset are always cloned as public. There's
875 no obsolescence markers exchange in stream v1.
914 no obsolescence markers exchange in stream v1.
876
915
877 #endif
916 #endif
878 #if stream-bundle2-v2
917 #if stream-bundle2-v2
879
918
880 Stream repository with obsolescence
919 Stream repository with obsolescence
881 -----------------------------------
920 -----------------------------------
882
921
883 Clone non-publishing with obsolescence
922 Clone non-publishing with obsolescence
884
923
885 $ cat >> $HGRCPATH << EOF
924 $ cat >> $HGRCPATH << EOF
886 > [experimental]
925 > [experimental]
887 > evolution=all
926 > evolution=all
888 > EOF
927 > EOF
889
928
890 $ cd server
929 $ cd server
891 $ echo foo > foo
930 $ echo foo > foo
892 $ hg -q commit -m 'about to be pruned'
931 $ hg -q commit -m 'about to be pruned'
893 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
932 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
894 1 new obsolescence markers
933 1 new obsolescence markers
895 obsoleted 1 changesets
934 obsoleted 1 changesets
896 $ hg up null -q
935 $ hg up null -q
897 $ hg log -T '{rev}: {phase}\n'
936 $ hg log -T '{rev}: {phase}\n'
898 2: draft
937 2: draft
899 1: draft
938 1: draft
900 0: draft
939 0: draft
901 $ hg serve -p $HGPORT -d --pid-file=hg.pid
940 $ hg serve -p $HGPORT -d --pid-file=hg.pid
902 $ cat hg.pid > $DAEMON_PIDS
941 $ cat hg.pid > $DAEMON_PIDS
903 $ cd ..
942 $ cd ..
904
943
905 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
944 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
906 streaming all changes
945 streaming all changes
907 1098 files to transfer, 102 KB of data (no-zstd !)
946 1099 files to transfer, 102 KB of data (no-zstd !)
908 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
947 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
909 1098 files to transfer, 99.5 KB of data (zstd !)
948 1099 files to transfer, 99.5 KB of data (zstd no-rust !)
910 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd !)
949 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !)
950 1101 files to transfer, 99.6 KB of data (zstd rust !)
951 transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !)
911 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
952 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
912 2: draft
953 2: draft
913 1: draft
954 1: draft
914 0: draft
955 0: draft
915 $ hg debugobsolete -R with-obsolescence
956 $ hg debugobsolete -R with-obsolescence
916 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
957 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
917 $ hg verify -R with-obsolescence -q
958 $ hg verify -R with-obsolescence -q
918
959
919 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
960 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
920 streaming all changes
961 streaming all changes
921 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
962 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
922 abort: pull failed on remote
963 abort: pull failed on remote
923 [100]
964 [100]
924
965
925 $ killdaemons.py
966 $ killdaemons.py
926
967
927 #endif
968 #endif
928 #if stream-bundle2-v3
969 #if stream-bundle2-v3
929
970
930 Stream repository with obsolescence
971 Stream repository with obsolescence
931 -----------------------------------
972 -----------------------------------
932
973
933 Clone non-publishing with obsolescence
974 Clone non-publishing with obsolescence
934
975
935 $ cat >> $HGRCPATH << EOF
976 $ cat >> $HGRCPATH << EOF
936 > [experimental]
977 > [experimental]
937 > evolution=all
978 > evolution=all
938 > EOF
979 > EOF
939
980
940 $ cd server
981 $ cd server
941 $ echo foo > foo
982 $ echo foo > foo
942 $ hg -q commit -m 'about to be pruned'
983 $ hg -q commit -m 'about to be pruned'
943 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
984 $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents
944 1 new obsolescence markers
985 1 new obsolescence markers
945 obsoleted 1 changesets
986 obsoleted 1 changesets
946 $ hg up null -q
987 $ hg up null -q
947 $ hg log -T '{rev}: {phase}\n'
988 $ hg log -T '{rev}: {phase}\n'
948 2: draft
989 2: draft
949 1: draft
990 1: draft
950 0: draft
991 0: draft
951 $ hg serve -p $HGPORT -d --pid-file=hg.pid
992 $ hg serve -p $HGPORT -d --pid-file=hg.pid
952 $ cat hg.pid > $DAEMON_PIDS
993 $ cat hg.pid > $DAEMON_PIDS
953 $ cd ..
994 $ cd ..
954
995
955 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
996 $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence
956 streaming all changes
997 streaming all changes
957 1098 entries to transfer
998 1098 entries to transfer
958 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
999 transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !)
959 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd !)
1000 transferred 99.5 KB in * seconds (* */sec) (glob) (zstd no-rust !)
1001 transferred 99.6 KB in * seconds (* */sec) (glob) (zstd rust !)
960 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
1002 $ hg -R with-obsolescence log -T '{rev}: {phase}\n'
961 2: draft
1003 2: draft
962 1: draft
1004 1: draft
963 0: draft
1005 0: draft
964 $ hg debugobsolete -R with-obsolescence
1006 $ hg debugobsolete -R with-obsolescence
965 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
1007 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
966 $ hg verify -R with-obsolescence -q
1008 $ hg verify -R with-obsolescence -q
967
1009
968 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
1010 $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution
969 streaming all changes
1011 streaming all changes
970 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
1012 remote: abort: server has obsolescence markers, but client cannot receive them via stream clone
971 abort: pull failed on remote
1013 abort: pull failed on remote
972 [100]
1014 [100]
973
1015
974 $ killdaemons.py
1016 $ killdaemons.py
975
1017
976 #endif
1018 #endif
977
1019
978 Cloning a repo with no requirements doesn't give some obscure error
1020 Cloning a repo with no requirements doesn't give some obscure error
979
1021
980 $ mkdir -p empty-repo/.hg
1022 $ mkdir -p empty-repo/.hg
981 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo2
1023 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo2
982 $ hg --cwd empty-repo2 verify -q
1024 $ hg --cwd empty-repo2 verify -q
983
1025
984 Cloning a repo with an empty manifestlog doesn't give some weird error
1026 Cloning a repo with an empty manifestlog doesn't give some weird error
985
1027
986 $ rm -r empty-repo; hg init empty-repo
1028 $ rm -r empty-repo; hg init empty-repo
987 $ (cd empty-repo; touch x; hg commit -Am empty; hg debugstrip -r 0) > /dev/null
1029 $ (cd empty-repo; touch x; hg commit -Am empty; hg debugstrip -r 0) > /dev/null
988 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo3
1030 $ hg clone -q --stream ssh://user@dummy/empty-repo empty-repo3
989 $ hg --cwd empty-repo3 verify -q 2>&1 | grep -v warning
1031 $ hg --cwd empty-repo3 verify -q 2>&1 | grep -v warning
990 [1]
1032 [1]
991
1033
992 The warnings filtered out here are talking about zero-length 'orphan' data files.
1034 The warnings filtered out here are talking about zero-length 'orphan' data files.
993 Those are harmless, so that's fine.
1035 Those are harmless, so that's fine.
994
1036
@@ -1,1296 +1,1316 b''
1 Prepare repo a:
1 Prepare repo a:
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo a > a
5 $ echo a > a
6 $ hg add a
6 $ hg add a
7 $ hg commit -m test
7 $ hg commit -m test
8 $ echo first line > b
8 $ echo first line > b
9 $ hg add b
9 $ hg add b
10
10
11 Create a non-inlined filelog:
11 Create a non-inlined filelog:
12
12
13 $ "$PYTHON" -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
13 $ "$PYTHON" -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
14 $ for j in 0 1 2 3 4 5 6 7 8 9; do
15 > cat data1 >> b
15 > cat data1 >> b
16 > hg commit -m test
16 > hg commit -m test
17 > done
17 > done
18
18
19 List files in store/data (should show a 'b.d'):
19 List files in store/data (should show a 'b.d'):
20
20
21 #if reporevlogstore
21 #if reporevlogstore
22 $ for i in .hg/store/data/*; do
22 $ for i in .hg/store/data/*; do
23 > echo $i
23 > echo $i
24 > done
24 > done
25 .hg/store/data/a.i
25 .hg/store/data/a.i
26 .hg/store/data/b.d
26 .hg/store/data/b.d
27 .hg/store/data/b.i
27 .hg/store/data/b.i
28 #endif
28 #endif
29
29
30 Trigger branchcache creation:
30 Trigger branchcache creation:
31
31
32 $ hg branches
32 $ hg branches
33 default 10:a7949464abda
33 default 10:a7949464abda
34 $ ls .hg/cache
34 $ ls .hg/cache
35 branch2-served
35 branch2-served
36 rbc-names-v1
36 rbc-names-v1
37 rbc-revs-v1
37 rbc-revs-v1
38
38
39 Default operation:
39 Default operation:
40
40
41 $ hg clone . ../b
41 $ hg clone . ../b
42 updating to branch default
42 updating to branch default
43 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 $ cd ../b
44 $ cd ../b
45
45
46 Ensure branchcache got copied over:
46 Ensure branchcache got copied over:
47
47
48 $ ls .hg/cache
48 $ ls .hg/cache
49 branch2-base
49 branch2-base
50 branch2-immutable
50 branch2-immutable
51 branch2-served
51 branch2-served
52 branch2-served.hidden
52 branch2-served.hidden
53 branch2-visible
53 branch2-visible
54 branch2-visible-hidden
54 branch2-visible-hidden
55 rbc-names-v1
55 rbc-names-v1
56 rbc-revs-v1
56 rbc-revs-v1
57 tags2
57 tags2
58 tags2-served
58 tags2-served
59
59
60 $ cat a
60 $ cat a
61 a
61 a
62 $ hg verify -q
62 $ hg verify -q
63
63
64 Invalid dest '' must abort:
64 Invalid dest '' must abort:
65
65
66 $ hg clone . ''
66 $ hg clone . ''
67 abort: empty destination path is not valid
67 abort: empty destination path is not valid
68 [10]
68 [10]
69
69
70 No update, with debug option:
70 No update, with debug option:
71
71
72 #if hardlink
72 #if hardlink
73 $ hg --debug clone -U . ../c --config progress.debug=true
73 $ hg --debug clone -U . ../c --config progress.debug=true
74 linking: 1/15 files (6.67%)
74 linking: 1/16 files (6.25%) (no-rust !)
75 linking: 2/15 files (13.33%)
75 linking: 2/16 files (12.50%) (no-rust !)
76 linking: 3/15 files (20.00%)
76 linking: 3/16 files (18.75%) (no-rust !)
77 linking: 4/15 files (26.67%)
77 linking: 4/16 files (25.00%) (no-rust !)
78 linking: 5/15 files (33.33%)
78 linking: 5/16 files (31.25%) (no-rust !)
79 linking: 6/15 files (40.00%)
79 linking: 6/16 files (37.50%) (no-rust !)
80 linking: 7/15 files (46.67%)
80 linking: 7/16 files (43.75%) (no-rust !)
81 linking: 8/15 files (53.33%)
81 linking: 8/16 files (50.00%) (no-rust !)
82 linking: 9/15 files (60.00%)
82 linking: 9/16 files (56.25%) (no-rust !)
83 linking: 10/15 files (66.67%)
83 linking: 10/16 files (62.50%) (no-rust !)
84 linking: 11/15 files (73.33%)
84 linking: 11/16 files (68.75%) (no-rust !)
85 linking: 12/15 files (80.00%)
85 linking: 12/16 files (75.00%) (no-rust !)
86 linking: 13/15 files (86.67%)
86 linking: 13/16 files (81.25%) (no-rust !)
87 linking: 14/15 files (93.33%)
87 linking: 14/16 files (87.50%) (no-rust !)
88 linking: 15/15 files (100.00%)
88 linking: 15/16 files (93.75%) (no-rust !)
89 linked 15 files
89 linking: 16/16 files (100.00%) (no-rust !)
90 linked 16 files (no-rust !)
91 linking: 1/18 files (5.56%) (rust !)
92 linking: 2/18 files (11.11%) (rust !)
93 linking: 3/18 files (16.67%) (rust !)
94 linking: 4/18 files (22.22%) (rust !)
95 linking: 5/18 files (27.78%) (rust !)
96 linking: 6/18 files (33.33%) (rust !)
97 linking: 7/18 files (38.89%) (rust !)
98 linking: 8/18 files (44.44%) (rust !)
99 linking: 9/18 files (50.00%) (rust !)
100 linking: 10/18 files (55.56%) (rust !)
101 linking: 11/18 files (61.11%) (rust !)
102 linking: 12/18 files (66.67%) (rust !)
103 linking: 13/18 files (72.22%) (rust !)
104 linking: 14/18 files (77.78%) (rust !)
105 linking: 15/18 files (83.33%) (rust !)
106 linking: 16/18 files (88.89%) (rust !)
107 linking: 17/18 files (94.44%) (rust !)
108 linking: 18/18 files (100.00%) (rust !)
109 linked 18 files (rust !)
90 updating the branch cache
110 updating the branch cache
91 #else
111 #else
92 $ hg --debug clone -U . ../c --config progress.debug=true
112 $ hg --debug clone -U . ../c --config progress.debug=true
93 linking: 1 files
113 linking: 1 files
94 copying: 2 files
114 copying: 2 files
95 copying: 3 files
115 copying: 3 files
96 copying: 4 files
116 copying: 4 files
97 copying: 5 files
117 copying: 5 files
98 copying: 6 files
118 copying: 6 files
99 copying: 7 files
119 copying: 7 files
100 copying: 8 files
120 copying: 8 files
101 #endif
121 #endif
102 $ cd ../c
122 $ cd ../c
103
123
104 Ensure branchcache got copied over:
124 Ensure branchcache got copied over:
105
125
106 $ ls .hg/cache
126 $ ls .hg/cache
107 branch2-base
127 branch2-base
108 branch2-immutable
128 branch2-immutable
109 branch2-served
129 branch2-served
110 branch2-served.hidden
130 branch2-served.hidden
111 branch2-visible
131 branch2-visible
112 branch2-visible-hidden
132 branch2-visible-hidden
113 rbc-names-v1
133 rbc-names-v1
114 rbc-revs-v1
134 rbc-revs-v1
115 tags2
135 tags2
116 tags2-served
136 tags2-served
117
137
118 $ cat a 2>/dev/null || echo "a not present"
138 $ cat a 2>/dev/null || echo "a not present"
119 a not present
139 a not present
120 $ hg verify -q
140 $ hg verify -q
121
141
122 Default destination:
142 Default destination:
123
143
124 $ mkdir ../d
144 $ mkdir ../d
125 $ cd ../d
145 $ cd ../d
126 $ hg clone ../a
146 $ hg clone ../a
127 destination directory: a
147 destination directory: a
128 updating to branch default
148 updating to branch default
129 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 $ cd a
150 $ cd a
131 $ hg cat a
151 $ hg cat a
132 a
152 a
133 $ cd ../..
153 $ cd ../..
134
154
135 Check that we drop the 'file:' from the path before writing the .hgrc:
155 Check that we drop the 'file:' from the path before writing the .hgrc:
136
156
137 $ hg clone file:a e
157 $ hg clone file:a e
138 updating to branch default
158 updating to branch default
139 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 $ grep 'file:' e/.hg/hgrc
160 $ grep 'file:' e/.hg/hgrc
141 [1]
161 [1]
142
162
143 Check that path aliases are expanded:
163 Check that path aliases are expanded:
144
164
145 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
165 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
146 $ hg -R f showconfig paths.default
166 $ hg -R f showconfig paths.default
147 $TESTTMP/a#0
167 $TESTTMP/a#0
148
168
149 Use --pull:
169 Use --pull:
150
170
151 $ hg clone --pull a g
171 $ hg clone --pull a g
152 requesting all changes
172 requesting all changes
153 adding changesets
173 adding changesets
154 adding manifests
174 adding manifests
155 adding file changes
175 adding file changes
156 added 11 changesets with 11 changes to 2 files
176 added 11 changesets with 11 changes to 2 files
157 new changesets acb14030fe0a:a7949464abda
177 new changesets acb14030fe0a:a7949464abda
158 updating to branch default
178 updating to branch default
159 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 $ hg -R g verify -q
180 $ hg -R g verify -q
161
181
162 Invalid dest '' with --pull must abort (issue2528):
182 Invalid dest '' with --pull must abort (issue2528):
163
183
164 $ hg clone --pull a ''
184 $ hg clone --pull a ''
165 abort: empty destination path is not valid
185 abort: empty destination path is not valid
166 [10]
186 [10]
167
187
168 Clone to '.':
188 Clone to '.':
169
189
170 $ mkdir h
190 $ mkdir h
171 $ cd h
191 $ cd h
172 $ hg clone ../a .
192 $ hg clone ../a .
173 updating to branch default
193 updating to branch default
174 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 $ cd ..
195 $ cd ..
176
196
177
197
178 *** Tests for option -u ***
198 *** Tests for option -u ***
179
199
180 Adding some more history to repo a:
200 Adding some more history to repo a:
181
201
182 $ cd a
202 $ cd a
183 $ hg tag ref1
203 $ hg tag ref1
184 $ echo the quick brown fox >a
204 $ echo the quick brown fox >a
185 $ hg ci -m "hacked default"
205 $ hg ci -m "hacked default"
186 $ hg up ref1
206 $ hg up ref1
187 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
207 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
188 $ hg branch stable
208 $ hg branch stable
189 marked working directory as branch stable
209 marked working directory as branch stable
190 (branches are permanent and global, did you want a bookmark?)
210 (branches are permanent and global, did you want a bookmark?)
191 $ echo some text >a
211 $ echo some text >a
192 $ hg ci -m "starting branch stable"
212 $ hg ci -m "starting branch stable"
193 $ hg tag ref2
213 $ hg tag ref2
194 $ echo some more text >a
214 $ echo some more text >a
195 $ hg ci -m "another change for branch stable"
215 $ hg ci -m "another change for branch stable"
196 $ hg up ref2
216 $ hg up ref2
197 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
217 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
198 $ hg parents
218 $ hg parents
199 changeset: 13:e8ece76546a6
219 changeset: 13:e8ece76546a6
200 branch: stable
220 branch: stable
201 tag: ref2
221 tag: ref2
202 parent: 10:a7949464abda
222 parent: 10:a7949464abda
203 user: test
223 user: test
204 date: Thu Jan 01 00:00:00 1970 +0000
224 date: Thu Jan 01 00:00:00 1970 +0000
205 summary: starting branch stable
225 summary: starting branch stable
206
226
207
227
208 Repo a has two heads:
228 Repo a has two heads:
209
229
210 $ hg heads
230 $ hg heads
211 changeset: 15:0aae7cf88f0d
231 changeset: 15:0aae7cf88f0d
212 branch: stable
232 branch: stable
213 tag: tip
233 tag: tip
214 user: test
234 user: test
215 date: Thu Jan 01 00:00:00 1970 +0000
235 date: Thu Jan 01 00:00:00 1970 +0000
216 summary: another change for branch stable
236 summary: another change for branch stable
217
237
218 changeset: 12:f21241060d6a
238 changeset: 12:f21241060d6a
219 user: test
239 user: test
220 date: Thu Jan 01 00:00:00 1970 +0000
240 date: Thu Jan 01 00:00:00 1970 +0000
221 summary: hacked default
241 summary: hacked default
222
242
223
243
224 $ cd ..
244 $ cd ..
225
245
226
246
227 Testing --noupdate with --updaterev (must abort):
247 Testing --noupdate with --updaterev (must abort):
228
248
229 $ hg clone --noupdate --updaterev 1 a ua
249 $ hg clone --noupdate --updaterev 1 a ua
230 abort: cannot specify both --noupdate and --updaterev
250 abort: cannot specify both --noupdate and --updaterev
231 [10]
251 [10]
232
252
233
253
234 Testing clone -u:
254 Testing clone -u:
235
255
236 $ hg clone -u . a ua
256 $ hg clone -u . a ua
237 updating to branch stable
257 updating to branch stable
238 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
239
259
240 Repo ua has both heads:
260 Repo ua has both heads:
241
261
242 $ hg -R ua heads
262 $ hg -R ua heads
243 changeset: 15:0aae7cf88f0d
263 changeset: 15:0aae7cf88f0d
244 branch: stable
264 branch: stable
245 tag: tip
265 tag: tip
246 user: test
266 user: test
247 date: Thu Jan 01 00:00:00 1970 +0000
267 date: Thu Jan 01 00:00:00 1970 +0000
248 summary: another change for branch stable
268 summary: another change for branch stable
249
269
250 changeset: 12:f21241060d6a
270 changeset: 12:f21241060d6a
251 user: test
271 user: test
252 date: Thu Jan 01 00:00:00 1970 +0000
272 date: Thu Jan 01 00:00:00 1970 +0000
253 summary: hacked default
273 summary: hacked default
254
274
255
275
256 Same revision checked out in repo a and ua:
276 Same revision checked out in repo a and ua:
257
277
258 $ hg -R a parents --template "{node|short}\n"
278 $ hg -R a parents --template "{node|short}\n"
259 e8ece76546a6
279 e8ece76546a6
260 $ hg -R ua parents --template "{node|short}\n"
280 $ hg -R ua parents --template "{node|short}\n"
261 e8ece76546a6
281 e8ece76546a6
262
282
263 $ rm -r ua
283 $ rm -r ua
264
284
265
285
266 Testing clone --pull -u:
286 Testing clone --pull -u:
267
287
268 $ hg clone --pull -u . a ua
288 $ hg clone --pull -u . a ua
269 requesting all changes
289 requesting all changes
270 adding changesets
290 adding changesets
271 adding manifests
291 adding manifests
272 adding file changes
292 adding file changes
273 added 16 changesets with 16 changes to 3 files (+1 heads)
293 added 16 changesets with 16 changes to 3 files (+1 heads)
274 new changesets acb14030fe0a:0aae7cf88f0d
294 new changesets acb14030fe0a:0aae7cf88f0d
275 updating to branch stable
295 updating to branch stable
276 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
296 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
277
297
278 Repo ua has both heads:
298 Repo ua has both heads:
279
299
280 $ hg -R ua heads
300 $ hg -R ua heads
281 changeset: 15:0aae7cf88f0d
301 changeset: 15:0aae7cf88f0d
282 branch: stable
302 branch: stable
283 tag: tip
303 tag: tip
284 user: test
304 user: test
285 date: Thu Jan 01 00:00:00 1970 +0000
305 date: Thu Jan 01 00:00:00 1970 +0000
286 summary: another change for branch stable
306 summary: another change for branch stable
287
307
288 changeset: 12:f21241060d6a
308 changeset: 12:f21241060d6a
289 user: test
309 user: test
290 date: Thu Jan 01 00:00:00 1970 +0000
310 date: Thu Jan 01 00:00:00 1970 +0000
291 summary: hacked default
311 summary: hacked default
292
312
293
313
294 Same revision checked out in repo a and ua:
314 Same revision checked out in repo a and ua:
295
315
296 $ hg -R a parents --template "{node|short}\n"
316 $ hg -R a parents --template "{node|short}\n"
297 e8ece76546a6
317 e8ece76546a6
298 $ hg -R ua parents --template "{node|short}\n"
318 $ hg -R ua parents --template "{node|short}\n"
299 e8ece76546a6
319 e8ece76546a6
300
320
301 $ rm -r ua
321 $ rm -r ua
302
322
303
323
304 Testing clone -u <branch>:
324 Testing clone -u <branch>:
305
325
306 $ hg clone -u stable a ua
326 $ hg clone -u stable a ua
307 updating to branch stable
327 updating to branch stable
308 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
328 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
309
329
310 Repo ua has both heads:
330 Repo ua has both heads:
311
331
312 $ hg -R ua heads
332 $ hg -R ua heads
313 changeset: 15:0aae7cf88f0d
333 changeset: 15:0aae7cf88f0d
314 branch: stable
334 branch: stable
315 tag: tip
335 tag: tip
316 user: test
336 user: test
317 date: Thu Jan 01 00:00:00 1970 +0000
337 date: Thu Jan 01 00:00:00 1970 +0000
318 summary: another change for branch stable
338 summary: another change for branch stable
319
339
320 changeset: 12:f21241060d6a
340 changeset: 12:f21241060d6a
321 user: test
341 user: test
322 date: Thu Jan 01 00:00:00 1970 +0000
342 date: Thu Jan 01 00:00:00 1970 +0000
323 summary: hacked default
343 summary: hacked default
324
344
325
345
326 Branch 'stable' is checked out:
346 Branch 'stable' is checked out:
327
347
328 $ hg -R ua parents
348 $ hg -R ua parents
329 changeset: 15:0aae7cf88f0d
349 changeset: 15:0aae7cf88f0d
330 branch: stable
350 branch: stable
331 tag: tip
351 tag: tip
332 user: test
352 user: test
333 date: Thu Jan 01 00:00:00 1970 +0000
353 date: Thu Jan 01 00:00:00 1970 +0000
334 summary: another change for branch stable
354 summary: another change for branch stable
335
355
336
356
337 $ rm -r ua
357 $ rm -r ua
338
358
339
359
340 Testing default checkout:
360 Testing default checkout:
341
361
342 $ hg clone a ua
362 $ hg clone a ua
343 updating to branch default
363 updating to branch default
344 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
364 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
345
365
346 Repo ua has both heads:
366 Repo ua has both heads:
347
367
348 $ hg -R ua heads
368 $ hg -R ua heads
349 changeset: 15:0aae7cf88f0d
369 changeset: 15:0aae7cf88f0d
350 branch: stable
370 branch: stable
351 tag: tip
371 tag: tip
352 user: test
372 user: test
353 date: Thu Jan 01 00:00:00 1970 +0000
373 date: Thu Jan 01 00:00:00 1970 +0000
354 summary: another change for branch stable
374 summary: another change for branch stable
355
375
356 changeset: 12:f21241060d6a
376 changeset: 12:f21241060d6a
357 user: test
377 user: test
358 date: Thu Jan 01 00:00:00 1970 +0000
378 date: Thu Jan 01 00:00:00 1970 +0000
359 summary: hacked default
379 summary: hacked default
360
380
361
381
362 Branch 'default' is checked out:
382 Branch 'default' is checked out:
363
383
364 $ hg -R ua parents
384 $ hg -R ua parents
365 changeset: 12:f21241060d6a
385 changeset: 12:f21241060d6a
366 user: test
386 user: test
367 date: Thu Jan 01 00:00:00 1970 +0000
387 date: Thu Jan 01 00:00:00 1970 +0000
368 summary: hacked default
388 summary: hacked default
369
389
370 Test clone with a branch named "@" (issue3677)
390 Test clone with a branch named "@" (issue3677)
371
391
372 $ hg -R ua branch @
392 $ hg -R ua branch @
373 marked working directory as branch @
393 marked working directory as branch @
374 $ hg -R ua commit -m 'created branch @'
394 $ hg -R ua commit -m 'created branch @'
375 $ hg clone ua atbranch
395 $ hg clone ua atbranch
376 updating to branch default
396 updating to branch default
377 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
397 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
378 $ hg -R atbranch heads
398 $ hg -R atbranch heads
379 changeset: 16:798b6d97153e
399 changeset: 16:798b6d97153e
380 branch: @
400 branch: @
381 tag: tip
401 tag: tip
382 parent: 12:f21241060d6a
402 parent: 12:f21241060d6a
383 user: test
403 user: test
384 date: Thu Jan 01 00:00:00 1970 +0000
404 date: Thu Jan 01 00:00:00 1970 +0000
385 summary: created branch @
405 summary: created branch @
386
406
387 changeset: 15:0aae7cf88f0d
407 changeset: 15:0aae7cf88f0d
388 branch: stable
408 branch: stable
389 user: test
409 user: test
390 date: Thu Jan 01 00:00:00 1970 +0000
410 date: Thu Jan 01 00:00:00 1970 +0000
391 summary: another change for branch stable
411 summary: another change for branch stable
392
412
393 changeset: 12:f21241060d6a
413 changeset: 12:f21241060d6a
394 user: test
414 user: test
395 date: Thu Jan 01 00:00:00 1970 +0000
415 date: Thu Jan 01 00:00:00 1970 +0000
396 summary: hacked default
416 summary: hacked default
397
417
398 $ hg -R atbranch parents
418 $ hg -R atbranch parents
399 changeset: 12:f21241060d6a
419 changeset: 12:f21241060d6a
400 user: test
420 user: test
401 date: Thu Jan 01 00:00:00 1970 +0000
421 date: Thu Jan 01 00:00:00 1970 +0000
402 summary: hacked default
422 summary: hacked default
403
423
404
424
405 $ rm -r ua atbranch
425 $ rm -r ua atbranch
406
426
407
427
408 Testing #<branch>:
428 Testing #<branch>:
409
429
410 $ hg clone -u . a#stable ua
430 $ hg clone -u . a#stable ua
411 adding changesets
431 adding changesets
412 adding manifests
432 adding manifests
413 adding file changes
433 adding file changes
414 added 14 changesets with 14 changes to 3 files
434 added 14 changesets with 14 changes to 3 files
415 new changesets acb14030fe0a:0aae7cf88f0d
435 new changesets acb14030fe0a:0aae7cf88f0d
416 updating to branch stable
436 updating to branch stable
417 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
437 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
418
438
419 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
439 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
420
440
421 $ hg -R ua heads
441 $ hg -R ua heads
422 changeset: 13:0aae7cf88f0d
442 changeset: 13:0aae7cf88f0d
423 branch: stable
443 branch: stable
424 tag: tip
444 tag: tip
425 user: test
445 user: test
426 date: Thu Jan 01 00:00:00 1970 +0000
446 date: Thu Jan 01 00:00:00 1970 +0000
427 summary: another change for branch stable
447 summary: another change for branch stable
428
448
429 changeset: 10:a7949464abda
449 changeset: 10:a7949464abda
430 user: test
450 user: test
431 date: Thu Jan 01 00:00:00 1970 +0000
451 date: Thu Jan 01 00:00:00 1970 +0000
432 summary: test
452 summary: test
433
453
434
454
435 Same revision checked out in repo a and ua:
455 Same revision checked out in repo a and ua:
436
456
437 $ hg -R a parents --template "{node|short}\n"
457 $ hg -R a parents --template "{node|short}\n"
438 e8ece76546a6
458 e8ece76546a6
439 $ hg -R ua parents --template "{node|short}\n"
459 $ hg -R ua parents --template "{node|short}\n"
440 e8ece76546a6
460 e8ece76546a6
441
461
442 $ rm -r ua
462 $ rm -r ua
443
463
444
464
445 Testing -u -r <branch>:
465 Testing -u -r <branch>:
446
466
447 $ hg clone -u . -r stable a ua
467 $ hg clone -u . -r stable a ua
448 adding changesets
468 adding changesets
449 adding manifests
469 adding manifests
450 adding file changes
470 adding file changes
451 added 14 changesets with 14 changes to 3 files
471 added 14 changesets with 14 changes to 3 files
452 new changesets acb14030fe0a:0aae7cf88f0d
472 new changesets acb14030fe0a:0aae7cf88f0d
453 updating to branch stable
473 updating to branch stable
454 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
474 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
455
475
456 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
476 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
457
477
458 $ hg -R ua heads
478 $ hg -R ua heads
459 changeset: 13:0aae7cf88f0d
479 changeset: 13:0aae7cf88f0d
460 branch: stable
480 branch: stable
461 tag: tip
481 tag: tip
462 user: test
482 user: test
463 date: Thu Jan 01 00:00:00 1970 +0000
483 date: Thu Jan 01 00:00:00 1970 +0000
464 summary: another change for branch stable
484 summary: another change for branch stable
465
485
466 changeset: 10:a7949464abda
486 changeset: 10:a7949464abda
467 user: test
487 user: test
468 date: Thu Jan 01 00:00:00 1970 +0000
488 date: Thu Jan 01 00:00:00 1970 +0000
469 summary: test
489 summary: test
470
490
471
491
472 Same revision checked out in repo a and ua:
492 Same revision checked out in repo a and ua:
473
493
474 $ hg -R a parents --template "{node|short}\n"
494 $ hg -R a parents --template "{node|short}\n"
475 e8ece76546a6
495 e8ece76546a6
476 $ hg -R ua parents --template "{node|short}\n"
496 $ hg -R ua parents --template "{node|short}\n"
477 e8ece76546a6
497 e8ece76546a6
478
498
479 $ rm -r ua
499 $ rm -r ua
480
500
481
501
482 Testing -r <branch>:
502 Testing -r <branch>:
483
503
484 $ hg clone -r stable a ua
504 $ hg clone -r stable a ua
485 adding changesets
505 adding changesets
486 adding manifests
506 adding manifests
487 adding file changes
507 adding file changes
488 added 14 changesets with 14 changes to 3 files
508 added 14 changesets with 14 changes to 3 files
489 new changesets acb14030fe0a:0aae7cf88f0d
509 new changesets acb14030fe0a:0aae7cf88f0d
490 updating to branch stable
510 updating to branch stable
491 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
511 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
492
512
493 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
513 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
494
514
495 $ hg -R ua heads
515 $ hg -R ua heads
496 changeset: 13:0aae7cf88f0d
516 changeset: 13:0aae7cf88f0d
497 branch: stable
517 branch: stable
498 tag: tip
518 tag: tip
499 user: test
519 user: test
500 date: Thu Jan 01 00:00:00 1970 +0000
520 date: Thu Jan 01 00:00:00 1970 +0000
501 summary: another change for branch stable
521 summary: another change for branch stable
502
522
503 changeset: 10:a7949464abda
523 changeset: 10:a7949464abda
504 user: test
524 user: test
505 date: Thu Jan 01 00:00:00 1970 +0000
525 date: Thu Jan 01 00:00:00 1970 +0000
506 summary: test
526 summary: test
507
527
508
528
509 Branch 'stable' is checked out:
529 Branch 'stable' is checked out:
510
530
511 $ hg -R ua parents
531 $ hg -R ua parents
512 changeset: 13:0aae7cf88f0d
532 changeset: 13:0aae7cf88f0d
513 branch: stable
533 branch: stable
514 tag: tip
534 tag: tip
515 user: test
535 user: test
516 date: Thu Jan 01 00:00:00 1970 +0000
536 date: Thu Jan 01 00:00:00 1970 +0000
517 summary: another change for branch stable
537 summary: another change for branch stable
518
538
519
539
520 $ rm -r ua
540 $ rm -r ua
521
541
522
542
523 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
543 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
524 iterable in addbranchrevs()
544 iterable in addbranchrevs()
525
545
526 $ cat <<EOF > simpleclone.py
546 $ cat <<EOF > simpleclone.py
527 > from mercurial import hg, ui as uimod
547 > from mercurial import hg, ui as uimod
528 > myui = uimod.ui.load()
548 > myui = uimod.ui.load()
529 > repo = hg.repository(myui, b'a')
549 > repo = hg.repository(myui, b'a')
530 > hg.clone(myui, {}, repo, dest=b"ua")
550 > hg.clone(myui, {}, repo, dest=b"ua")
531 > EOF
551 > EOF
532
552
533 $ "$PYTHON" simpleclone.py
553 $ "$PYTHON" simpleclone.py
534 updating to branch default
554 updating to branch default
535 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
555 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
536
556
537 $ rm -r ua
557 $ rm -r ua
538
558
539 $ cat <<EOF > branchclone.py
559 $ cat <<EOF > branchclone.py
540 > from mercurial import extensions, hg, ui as uimod
560 > from mercurial import extensions, hg, ui as uimod
541 > myui = uimod.ui.load()
561 > myui = uimod.ui.load()
542 > extensions.loadall(myui)
562 > extensions.loadall(myui)
543 > extensions.populateui(myui)
563 > extensions.populateui(myui)
544 > repo = hg.repository(myui, b'a')
564 > repo = hg.repository(myui, b'a')
545 > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable"])
565 > hg.clone(myui, {}, repo, dest=b"ua", branch=[b"stable"])
546 > EOF
566 > EOF
547
567
548 $ "$PYTHON" branchclone.py
568 $ "$PYTHON" branchclone.py
549 adding changesets
569 adding changesets
550 adding manifests
570 adding manifests
551 adding file changes
571 adding file changes
552 added 14 changesets with 14 changes to 3 files
572 added 14 changesets with 14 changes to 3 files
553 new changesets acb14030fe0a:0aae7cf88f0d
573 new changesets acb14030fe0a:0aae7cf88f0d
554 updating to branch stable
574 updating to branch stable
555 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
575 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
556 $ rm -r ua
576 $ rm -r ua
557
577
558 Local clones don't get confused by unusual experimental.evolution options
578 Local clones don't get confused by unusual experimental.evolution options
559
579
560 $ hg clone \
580 $ hg clone \
561 > --config experimental.evolution=allowunstable,allowdivergence,exchange \
581 > --config experimental.evolution=allowunstable,allowdivergence,exchange \
562 > a ua
582 > a ua
563 updating to branch default
583 updating to branch default
564 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
584 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
565 $ rm -r ua
585 $ rm -r ua
566
586
567 $ hg clone \
587 $ hg clone \
568 > --config experimental.evolution.createmarkers=no \
588 > --config experimental.evolution.createmarkers=no \
569 > --config experimental.evolution.allowunstable=yes \
589 > --config experimental.evolution.allowunstable=yes \
570 > --config experimental.evolution.allowdivergence=yes \
590 > --config experimental.evolution.allowdivergence=yes \
571 > --config experimental.evolution.exchange=yes \
591 > --config experimental.evolution.exchange=yes \
572 > a ua
592 > a ua
573 updating to branch default
593 updating to branch default
574 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
594 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
575 $ rm -r ua
595 $ rm -r ua
576
596
577 Test clone with special '@' bookmark:
597 Test clone with special '@' bookmark:
578 $ cd a
598 $ cd a
579 $ hg bookmark -r a7949464abda @ # branch point of stable from default
599 $ hg bookmark -r a7949464abda @ # branch point of stable from default
580 $ hg clone . ../i
600 $ hg clone . ../i
581 updating to bookmark @
601 updating to bookmark @
582 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
602 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 $ hg id -i ../i
603 $ hg id -i ../i
584 a7949464abda
604 a7949464abda
585 $ rm -r ../i
605 $ rm -r ../i
586
606
587 $ hg bookmark -f -r stable @
607 $ hg bookmark -f -r stable @
588 $ hg bookmarks
608 $ hg bookmarks
589 @ 15:0aae7cf88f0d
609 @ 15:0aae7cf88f0d
590 $ hg clone . ../i
610 $ hg clone . ../i
591 updating to bookmark @ on branch stable
611 updating to bookmark @ on branch stable
592 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
612 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
593 $ hg id -i ../i
613 $ hg id -i ../i
594 0aae7cf88f0d
614 0aae7cf88f0d
595 $ cd "$TESTTMP"
615 $ cd "$TESTTMP"
596
616
597
617
598 Testing failures:
618 Testing failures:
599
619
600 $ mkdir fail
620 $ mkdir fail
601 $ cd fail
621 $ cd fail
602
622
603 No local source
623 No local source
604
624
605 $ hg clone a b
625 $ hg clone a b
606 abort: repository a not found
626 abort: repository a not found
607 [255]
627 [255]
608
628
609 Invalid URL
629 Invalid URL
610
630
611 $ hg clone http://invalid:url/a b
631 $ hg clone http://invalid:url/a b
612 abort: error: nonnumeric port: 'url'
632 abort: error: nonnumeric port: 'url'
613 [100]
633 [100]
614
634
615 No remote source
635 No remote source
616
636
617 #if windows
637 #if windows
618 $ hg clone http://$LOCALIP:3121/a b
638 $ hg clone http://$LOCALIP:3121/a b
619 abort: error: * (glob)
639 abort: error: * (glob)
620 [100]
640 [100]
621 #else
641 #else
622 $ hg clone http://$LOCALIP:3121/a b
642 $ hg clone http://$LOCALIP:3121/a b
623 abort: error: *refused* (glob)
643 abort: error: *refused* (glob)
624 [100]
644 [100]
625 #endif
645 #endif
626 $ rm -rf b # work around bug with http clone
646 $ rm -rf b # work around bug with http clone
627
647
628
648
629 #if unix-permissions no-root
649 #if unix-permissions no-root
630
650
631 Inaccessible source
651 Inaccessible source
632
652
633 $ mkdir a
653 $ mkdir a
634 $ chmod 000 a
654 $ chmod 000 a
635 $ hg clone a b
655 $ hg clone a b
636 abort: $EACCES$: *$TESTTMP/fail/a/.hg* (glob)
656 abort: $EACCES$: *$TESTTMP/fail/a/.hg* (glob)
637 [255]
657 [255]
638
658
639 Inaccessible destination
659 Inaccessible destination
640
660
641 $ hg init b
661 $ hg init b
642 $ cd b
662 $ cd b
643 $ hg clone . ../a
663 $ hg clone . ../a
644 abort: $EACCES$: *../a* (glob)
664 abort: $EACCES$: *../a* (glob)
645 [255]
665 [255]
646 $ cd ..
666 $ cd ..
647 $ chmod 700 a
667 $ chmod 700 a
648 $ rm -r a b
668 $ rm -r a b
649
669
650 #endif
670 #endif
651
671
652
672
653 #if fifo
673 #if fifo
654
674
655 Source of wrong type
675 Source of wrong type
656
676
657 $ mkfifo a
677 $ mkfifo a
658 $ hg clone a b
678 $ hg clone a b
659 abort: $ENOTDIR$: *$TESTTMP/fail/a/.hg* (glob)
679 abort: $ENOTDIR$: *$TESTTMP/fail/a/.hg* (glob)
660 [255]
680 [255]
661 $ rm a
681 $ rm a
662
682
663 #endif
683 #endif
664
684
665 Default destination, same directory
685 Default destination, same directory
666
686
667 $ hg init q
687 $ hg init q
668 $ hg clone q
688 $ hg clone q
669 destination directory: q
689 destination directory: q
670 abort: destination 'q' is not empty
690 abort: destination 'q' is not empty
671 [10]
691 [10]
672
692
673 destination directory not empty
693 destination directory not empty
674
694
675 $ mkdir a
695 $ mkdir a
676 $ echo stuff > a/a
696 $ echo stuff > a/a
677 $ hg clone q a
697 $ hg clone q a
678 abort: destination 'a' is not empty
698 abort: destination 'a' is not empty
679 [10]
699 [10]
680
700
681
701
682 #if unix-permissions no-root
702 #if unix-permissions no-root
683
703
684 leave existing directory in place after clone failure
704 leave existing directory in place after clone failure
685
705
686 $ hg init c
706 $ hg init c
687 $ cd c
707 $ cd c
688 $ echo c > c
708 $ echo c > c
689 $ hg commit -A -m test
709 $ hg commit -A -m test
690 adding c
710 adding c
691 $ chmod -rx .hg/store/data
711 $ chmod -rx .hg/store/data
692 $ cd ..
712 $ cd ..
693 $ mkdir d
713 $ mkdir d
694 $ hg clone c d 2> err
714 $ hg clone c d 2> err
695 [255]
715 [255]
696 $ test -d d
716 $ test -d d
697 $ test -d d/.hg
717 $ test -d d/.hg
698 [1]
718 [1]
699
719
700 re-enable perm to allow deletion
720 re-enable perm to allow deletion
701
721
702 $ chmod +rx c/.hg/store/data
722 $ chmod +rx c/.hg/store/data
703
723
704 #endif
724 #endif
705
725
706 $ cd ..
726 $ cd ..
707
727
708 Test clone from the repository in (emulated) revlog format 0 (issue4203):
728 Test clone from the repository in (emulated) revlog format 0 (issue4203):
709
729
710 $ mkdir issue4203
730 $ mkdir issue4203
711 $ mkdir -p src/.hg
731 $ mkdir -p src/.hg
712 $ echo foo > src/foo
732 $ echo foo > src/foo
713 $ hg -R src add src/foo
733 $ hg -R src add src/foo
714 $ hg -R src commit -m '#0'
734 $ hg -R src commit -m '#0'
715 $ hg -R src log -q
735 $ hg -R src log -q
716 0:e1bab28bca43
736 0:e1bab28bca43
717 $ hg -R src debugrevlog -c | grep -E 'format|flags'
737 $ hg -R src debugrevlog -c | grep -E 'format|flags'
718 format : 0
738 format : 0
719 flags : (none)
739 flags : (none)
720 $ hg root -R src -T json | sed 's|\\\\|\\|g'
740 $ hg root -R src -T json | sed 's|\\\\|\\|g'
721 [
741 [
722 {
742 {
723 "hgpath": "$TESTTMP/src/.hg",
743 "hgpath": "$TESTTMP/src/.hg",
724 "reporoot": "$TESTTMP/src",
744 "reporoot": "$TESTTMP/src",
725 "storepath": "$TESTTMP/src/.hg"
745 "storepath": "$TESTTMP/src/.hg"
726 }
746 }
727 ]
747 ]
728 $ hg clone -U -q src dst
748 $ hg clone -U -q src dst
729 $ hg -R dst log -q
749 $ hg -R dst log -q
730 0:e1bab28bca43
750 0:e1bab28bca43
731
751
732 Create repositories to test auto sharing functionality
752 Create repositories to test auto sharing functionality
733
753
734 $ cat >> $HGRCPATH << EOF
754 $ cat >> $HGRCPATH << EOF
735 > [extensions]
755 > [extensions]
736 > share=
756 > share=
737 > EOF
757 > EOF
738
758
739 $ hg init empty
759 $ hg init empty
740 $ hg init source1a
760 $ hg init source1a
741 $ cd source1a
761 $ cd source1a
742 $ echo initial1 > foo
762 $ echo initial1 > foo
743 $ hg -q commit -A -m initial
763 $ hg -q commit -A -m initial
744 $ echo second > foo
764 $ echo second > foo
745 $ hg commit -m second
765 $ hg commit -m second
746 $ cd ..
766 $ cd ..
747
767
748 $ hg init filteredrev0
768 $ hg init filteredrev0
749 $ cd filteredrev0
769 $ cd filteredrev0
750 $ cat >> .hg/hgrc << EOF
770 $ cat >> .hg/hgrc << EOF
751 > [experimental]
771 > [experimental]
752 > evolution.createmarkers=True
772 > evolution.createmarkers=True
753 > EOF
773 > EOF
754 $ echo initial1 > foo
774 $ echo initial1 > foo
755 $ hg -q commit -A -m initial0
775 $ hg -q commit -A -m initial0
756 $ hg -q up -r null
776 $ hg -q up -r null
757 $ echo initial2 > foo
777 $ echo initial2 > foo
758 $ hg -q commit -A -m initial1
778 $ hg -q commit -A -m initial1
759 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
779 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
760 1 new obsolescence markers
780 1 new obsolescence markers
761 obsoleted 1 changesets
781 obsoleted 1 changesets
762 $ cd ..
782 $ cd ..
763
783
764 $ hg -q clone --pull source1a source1b
784 $ hg -q clone --pull source1a source1b
765 $ cd source1a
785 $ cd source1a
766 $ hg bookmark bookA
786 $ hg bookmark bookA
767 $ echo 1a > foo
787 $ echo 1a > foo
768 $ hg commit -m 1a
788 $ hg commit -m 1a
769 $ cd ../source1b
789 $ cd ../source1b
770 $ hg -q up -r 0
790 $ hg -q up -r 0
771 $ echo head1 > foo
791 $ echo head1 > foo
772 $ hg commit -m head1
792 $ hg commit -m head1
773 created new head
793 created new head
774 $ hg bookmark head1
794 $ hg bookmark head1
775 $ hg -q up -r 0
795 $ hg -q up -r 0
776 $ echo head2 > foo
796 $ echo head2 > foo
777 $ hg commit -m head2
797 $ hg commit -m head2
778 created new head
798 created new head
779 $ hg bookmark head2
799 $ hg bookmark head2
780 $ hg -q up -r 0
800 $ hg -q up -r 0
781 $ hg branch branch1
801 $ hg branch branch1
782 marked working directory as branch branch1
802 marked working directory as branch branch1
783 (branches are permanent and global, did you want a bookmark?)
803 (branches are permanent and global, did you want a bookmark?)
784 $ echo branch1 > foo
804 $ echo branch1 > foo
785 $ hg commit -m branch1
805 $ hg commit -m branch1
786 $ hg -q up -r 0
806 $ hg -q up -r 0
787 $ hg branch branch2
807 $ hg branch branch2
788 marked working directory as branch branch2
808 marked working directory as branch branch2
789 $ echo branch2 > foo
809 $ echo branch2 > foo
790 $ hg commit -m branch2
810 $ hg commit -m branch2
791 $ cd ..
811 $ cd ..
792 $ hg init source2
812 $ hg init source2
793 $ cd source2
813 $ cd source2
794 $ echo initial2 > foo
814 $ echo initial2 > foo
795 $ hg -q commit -A -m initial2
815 $ hg -q commit -A -m initial2
796 $ echo second > foo
816 $ echo second > foo
797 $ hg commit -m second
817 $ hg commit -m second
798 $ cd ..
818 $ cd ..
799
819
800 Clone with auto share from an empty repo should not result in share
820 Clone with auto share from an empty repo should not result in share
801
821
802 $ mkdir share
822 $ mkdir share
803 $ hg --config share.pool=share clone empty share-empty
823 $ hg --config share.pool=share clone empty share-empty
804 (not using pooled storage: remote appears to be empty)
824 (not using pooled storage: remote appears to be empty)
805 updating to branch default
825 updating to branch default
806 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
826 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
807 $ ls share
827 $ ls share
808 $ test -d share-empty/.hg/store
828 $ test -d share-empty/.hg/store
809 $ test -f share-empty/.hg/sharedpath
829 $ test -f share-empty/.hg/sharedpath
810 [1]
830 [1]
811
831
812 Clone with auto share from a repo with filtered revision 0 should not result in share
832 Clone with auto share from a repo with filtered revision 0 should not result in share
813
833
814 $ hg --config share.pool=share clone filteredrev0 share-filtered
834 $ hg --config share.pool=share clone filteredrev0 share-filtered
815 (not using pooled storage: unable to resolve identity of remote)
835 (not using pooled storage: unable to resolve identity of remote)
816 requesting all changes
836 requesting all changes
817 adding changesets
837 adding changesets
818 adding manifests
838 adding manifests
819 adding file changes
839 adding file changes
820 added 1 changesets with 1 changes to 1 files
840 added 1 changesets with 1 changes to 1 files
821 new changesets e082c1832e09
841 new changesets e082c1832e09
822 updating to branch default
842 updating to branch default
823 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
824
844
825 Clone from repo with content should result in shared store being created
845 Clone from repo with content should result in shared store being created
826
846
827 $ hg --config share.pool=share clone source1a share-dest1a
847 $ hg --config share.pool=share clone source1a share-dest1a
828 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
848 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
829 requesting all changes
849 requesting all changes
830 adding changesets
850 adding changesets
831 adding manifests
851 adding manifests
832 adding file changes
852 adding file changes
833 added 3 changesets with 3 changes to 1 files
853 added 3 changesets with 3 changes to 1 files
834 new changesets b5f04eac9d8f:e5bfe23c0b47
854 new changesets b5f04eac9d8f:e5bfe23c0b47
835 searching for changes
855 searching for changes
836 no changes found
856 no changes found
837 adding remote bookmark bookA
857 adding remote bookmark bookA
838 updating working directory
858 updating working directory
839 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
859 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
840
860
841 The shared repo should have been created
861 The shared repo should have been created
842
862
843 $ ls share
863 $ ls share
844 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
864 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
845
865
846 The destination should point to it
866 The destination should point to it
847
867
848 $ cat share-dest1a/.hg/sharedpath; echo
868 $ cat share-dest1a/.hg/sharedpath; echo
849 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
869 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
850
870
851 The destination should have bookmarks
871 The destination should have bookmarks
852
872
853 $ hg -R share-dest1a bookmarks
873 $ hg -R share-dest1a bookmarks
854 bookA 2:e5bfe23c0b47
874 bookA 2:e5bfe23c0b47
855
875
856 The default path should be the remote, not the share
876 The default path should be the remote, not the share
857
877
858 $ hg -R share-dest1a config paths.default
878 $ hg -R share-dest1a config paths.default
859 $TESTTMP/source1a
879 $TESTTMP/source1a
860
880
861 Clone with existing share dir should result in pull + share
881 Clone with existing share dir should result in pull + share
862
882
863 $ hg --config share.pool=share clone source1b share-dest1b
883 $ hg --config share.pool=share clone source1b share-dest1b
864 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
884 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
865 searching for changes
885 searching for changes
866 adding changesets
886 adding changesets
867 adding manifests
887 adding manifests
868 adding file changes
888 adding file changes
869 adding remote bookmark head1
889 adding remote bookmark head1
870 adding remote bookmark head2
890 adding remote bookmark head2
871 added 4 changesets with 4 changes to 1 files (+4 heads)
891 added 4 changesets with 4 changes to 1 files (+4 heads)
872 new changesets 4a8dc1ab4c13:6bacf4683960
892 new changesets 4a8dc1ab4c13:6bacf4683960
873 updating working directory
893 updating working directory
874 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
894 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
875
895
876 $ ls share
896 $ ls share
877 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
897 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
878
898
879 $ cat share-dest1b/.hg/sharedpath; echo
899 $ cat share-dest1b/.hg/sharedpath; echo
880 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
900 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
881
901
882 We only get bookmarks from the remote, not everything in the share
902 We only get bookmarks from the remote, not everything in the share
883
903
884 $ hg -R share-dest1b bookmarks
904 $ hg -R share-dest1b bookmarks
885 head1 3:4a8dc1ab4c13
905 head1 3:4a8dc1ab4c13
886 head2 4:99f71071f117
906 head2 4:99f71071f117
887
907
888 Default path should be source, not share.
908 Default path should be source, not share.
889
909
890 $ hg -R share-dest1b config paths.default
910 $ hg -R share-dest1b config paths.default
891 $TESTTMP/source1b
911 $TESTTMP/source1b
892
912
893 Checked out revision should be head of default branch
913 Checked out revision should be head of default branch
894
914
895 $ hg -R share-dest1b log -r .
915 $ hg -R share-dest1b log -r .
896 changeset: 4:99f71071f117
916 changeset: 4:99f71071f117
897 bookmark: head2
917 bookmark: head2
898 parent: 0:b5f04eac9d8f
918 parent: 0:b5f04eac9d8f
899 user: test
919 user: test
900 date: Thu Jan 01 00:00:00 1970 +0000
920 date: Thu Jan 01 00:00:00 1970 +0000
901 summary: head2
921 summary: head2
902
922
903
923
904 Clone from unrelated repo should result in new share
924 Clone from unrelated repo should result in new share
905
925
906 $ hg --config share.pool=share clone source2 share-dest2
926 $ hg --config share.pool=share clone source2 share-dest2
907 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
927 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
908 requesting all changes
928 requesting all changes
909 adding changesets
929 adding changesets
910 adding manifests
930 adding manifests
911 adding file changes
931 adding file changes
912 added 2 changesets with 2 changes to 1 files
932 added 2 changesets with 2 changes to 1 files
913 new changesets 22aeff664783:63cf6c3dba4a
933 new changesets 22aeff664783:63cf6c3dba4a
914 searching for changes
934 searching for changes
915 no changes found
935 no changes found
916 updating working directory
936 updating working directory
917 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
937 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
918
938
919 $ ls share
939 $ ls share
920 22aeff664783fd44c6d9b435618173c118c3448e
940 22aeff664783fd44c6d9b435618173c118c3448e
921 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
941 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
922
942
923 remote naming mode works as advertised
943 remote naming mode works as advertised
924
944
925 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
945 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
926 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
946 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
927 requesting all changes
947 requesting all changes
928 adding changesets
948 adding changesets
929 adding manifests
949 adding manifests
930 adding file changes
950 adding file changes
931 added 3 changesets with 3 changes to 1 files
951 added 3 changesets with 3 changes to 1 files
932 new changesets b5f04eac9d8f:e5bfe23c0b47
952 new changesets b5f04eac9d8f:e5bfe23c0b47
933 searching for changes
953 searching for changes
934 no changes found
954 no changes found
935 adding remote bookmark bookA
955 adding remote bookmark bookA
936 updating working directory
956 updating working directory
937 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
957 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
938
958
939 $ ls shareremote
959 $ ls shareremote
940 195bb1fcdb595c14a6c13e0269129ed78f6debde
960 195bb1fcdb595c14a6c13e0269129ed78f6debde
941
961
942 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
962 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
943 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
963 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
944 requesting all changes
964 requesting all changes
945 adding changesets
965 adding changesets
946 adding manifests
966 adding manifests
947 adding file changes
967 adding file changes
948 added 6 changesets with 6 changes to 1 files (+4 heads)
968 added 6 changesets with 6 changes to 1 files (+4 heads)
949 new changesets b5f04eac9d8f:6bacf4683960
969 new changesets b5f04eac9d8f:6bacf4683960
950 searching for changes
970 searching for changes
951 no changes found
971 no changes found
952 adding remote bookmark head1
972 adding remote bookmark head1
953 adding remote bookmark head2
973 adding remote bookmark head2
954 updating working directory
974 updating working directory
955 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
975 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
956
976
957 $ ls shareremote
977 $ ls shareremote
958 195bb1fcdb595c14a6c13e0269129ed78f6debde
978 195bb1fcdb595c14a6c13e0269129ed78f6debde
959 c0d4f83847ca2a873741feb7048a45085fd47c46
979 c0d4f83847ca2a873741feb7048a45085fd47c46
960
980
961 request to clone a single revision is respected in sharing mode
981 request to clone a single revision is respected in sharing mode
962
982
963 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
983 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
964 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
984 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
965 adding changesets
985 adding changesets
966 adding manifests
986 adding manifests
967 adding file changes
987 adding file changes
968 added 2 changesets with 2 changes to 1 files
988 added 2 changesets with 2 changes to 1 files
969 new changesets b5f04eac9d8f:4a8dc1ab4c13
989 new changesets b5f04eac9d8f:4a8dc1ab4c13
970 no changes found
990 no changes found
971 adding remote bookmark head1
991 adding remote bookmark head1
972 updating working directory
992 updating working directory
973 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
993 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
974
994
975 $ hg -R share-1arev log -G
995 $ hg -R share-1arev log -G
976 @ changeset: 1:4a8dc1ab4c13
996 @ changeset: 1:4a8dc1ab4c13
977 | bookmark: head1
997 | bookmark: head1
978 | tag: tip
998 | tag: tip
979 | user: test
999 | user: test
980 | date: Thu Jan 01 00:00:00 1970 +0000
1000 | date: Thu Jan 01 00:00:00 1970 +0000
981 | summary: head1
1001 | summary: head1
982 |
1002 |
983 o changeset: 0:b5f04eac9d8f
1003 o changeset: 0:b5f04eac9d8f
984 user: test
1004 user: test
985 date: Thu Jan 01 00:00:00 1970 +0000
1005 date: Thu Jan 01 00:00:00 1970 +0000
986 summary: initial
1006 summary: initial
987
1007
988
1008
989 making another clone should only pull down requested rev
1009 making another clone should only pull down requested rev
990
1010
991 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
1011 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
992 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1012 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
993 searching for changes
1013 searching for changes
994 adding changesets
1014 adding changesets
995 adding manifests
1015 adding manifests
996 adding file changes
1016 adding file changes
997 adding remote bookmark head1
1017 adding remote bookmark head1
998 adding remote bookmark head2
1018 adding remote bookmark head2
999 added 1 changesets with 1 changes to 1 files (+1 heads)
1019 added 1 changesets with 1 changes to 1 files (+1 heads)
1000 new changesets 99f71071f117
1020 new changesets 99f71071f117
1001 updating working directory
1021 updating working directory
1002 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1022 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1003
1023
1004 $ hg -R share-1brev log -G
1024 $ hg -R share-1brev log -G
1005 @ changeset: 2:99f71071f117
1025 @ changeset: 2:99f71071f117
1006 | bookmark: head2
1026 | bookmark: head2
1007 | tag: tip
1027 | tag: tip
1008 | parent: 0:b5f04eac9d8f
1028 | parent: 0:b5f04eac9d8f
1009 | user: test
1029 | user: test
1010 | date: Thu Jan 01 00:00:00 1970 +0000
1030 | date: Thu Jan 01 00:00:00 1970 +0000
1011 | summary: head2
1031 | summary: head2
1012 |
1032 |
1013 | o changeset: 1:4a8dc1ab4c13
1033 | o changeset: 1:4a8dc1ab4c13
1014 |/ bookmark: head1
1034 |/ bookmark: head1
1015 | user: test
1035 | user: test
1016 | date: Thu Jan 01 00:00:00 1970 +0000
1036 | date: Thu Jan 01 00:00:00 1970 +0000
1017 | summary: head1
1037 | summary: head1
1018 |
1038 |
1019 o changeset: 0:b5f04eac9d8f
1039 o changeset: 0:b5f04eac9d8f
1020 user: test
1040 user: test
1021 date: Thu Jan 01 00:00:00 1970 +0000
1041 date: Thu Jan 01 00:00:00 1970 +0000
1022 summary: initial
1042 summary: initial
1023
1043
1024
1044
1025 Request to clone a single branch is respected in sharing mode
1045 Request to clone a single branch is respected in sharing mode
1026
1046
1027 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1047 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1028 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1048 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1029 adding changesets
1049 adding changesets
1030 adding manifests
1050 adding manifests
1031 adding file changes
1051 adding file changes
1032 added 2 changesets with 2 changes to 1 files
1052 added 2 changesets with 2 changes to 1 files
1033 new changesets b5f04eac9d8f:5f92a6c1a1b1
1053 new changesets b5f04eac9d8f:5f92a6c1a1b1
1034 no changes found
1054 no changes found
1035 updating working directory
1055 updating working directory
1036 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1056 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1037
1057
1038 $ hg -R share-1bbranch1 log -G
1058 $ hg -R share-1bbranch1 log -G
1039 o changeset: 1:5f92a6c1a1b1
1059 o changeset: 1:5f92a6c1a1b1
1040 | branch: branch1
1060 | branch: branch1
1041 | tag: tip
1061 | tag: tip
1042 | user: test
1062 | user: test
1043 | date: Thu Jan 01 00:00:00 1970 +0000
1063 | date: Thu Jan 01 00:00:00 1970 +0000
1044 | summary: branch1
1064 | summary: branch1
1045 |
1065 |
1046 @ changeset: 0:b5f04eac9d8f
1066 @ changeset: 0:b5f04eac9d8f
1047 user: test
1067 user: test
1048 date: Thu Jan 01 00:00:00 1970 +0000
1068 date: Thu Jan 01 00:00:00 1970 +0000
1049 summary: initial
1069 summary: initial
1050
1070
1051
1071
1052 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1072 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1053 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1073 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1054 searching for changes
1074 searching for changes
1055 adding changesets
1075 adding changesets
1056 adding manifests
1076 adding manifests
1057 adding file changes
1077 adding file changes
1058 added 1 changesets with 1 changes to 1 files (+1 heads)
1078 added 1 changesets with 1 changes to 1 files (+1 heads)
1059 new changesets 6bacf4683960
1079 new changesets 6bacf4683960
1060 updating working directory
1080 updating working directory
1061 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1081 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1062
1082
1063 $ hg -R share-1bbranch2 log -G
1083 $ hg -R share-1bbranch2 log -G
1064 o changeset: 2:6bacf4683960
1084 o changeset: 2:6bacf4683960
1065 | branch: branch2
1085 | branch: branch2
1066 | tag: tip
1086 | tag: tip
1067 | parent: 0:b5f04eac9d8f
1087 | parent: 0:b5f04eac9d8f
1068 | user: test
1088 | user: test
1069 | date: Thu Jan 01 00:00:00 1970 +0000
1089 | date: Thu Jan 01 00:00:00 1970 +0000
1070 | summary: branch2
1090 | summary: branch2
1071 |
1091 |
1072 | o changeset: 1:5f92a6c1a1b1
1092 | o changeset: 1:5f92a6c1a1b1
1073 |/ branch: branch1
1093 |/ branch: branch1
1074 | user: test
1094 | user: test
1075 | date: Thu Jan 01 00:00:00 1970 +0000
1095 | date: Thu Jan 01 00:00:00 1970 +0000
1076 | summary: branch1
1096 | summary: branch1
1077 |
1097 |
1078 @ changeset: 0:b5f04eac9d8f
1098 @ changeset: 0:b5f04eac9d8f
1079 user: test
1099 user: test
1080 date: Thu Jan 01 00:00:00 1970 +0000
1100 date: Thu Jan 01 00:00:00 1970 +0000
1081 summary: initial
1101 summary: initial
1082
1102
1083
1103
1084 -U is respected in share clone mode
1104 -U is respected in share clone mode
1085
1105
1086 $ hg --config share.pool=share clone -U source1a share-1anowc
1106 $ hg --config share.pool=share clone -U source1a share-1anowc
1087 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1107 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1088 searching for changes
1108 searching for changes
1089 no changes found
1109 no changes found
1090 adding remote bookmark bookA
1110 adding remote bookmark bookA
1091
1111
1092 $ ls -A share-1anowc
1112 $ ls -A share-1anowc
1093 .hg
1113 .hg
1094
1114
1095 Test that auto sharing doesn't cause failure of "hg clone local remote"
1115 Test that auto sharing doesn't cause failure of "hg clone local remote"
1096
1116
1097 $ cd $TESTTMP
1117 $ cd $TESTTMP
1098 $ hg -R a id -r 0
1118 $ hg -R a id -r 0
1099 acb14030fe0a
1119 acb14030fe0a
1100 $ hg id -R remote -r 0
1120 $ hg id -R remote -r 0
1101 abort: repository remote not found
1121 abort: repository remote not found
1102 [255]
1122 [255]
1103 $ hg --config share.pool=share -q clone a ssh://user@dummy/remote
1123 $ hg --config share.pool=share -q clone a ssh://user@dummy/remote
1104 $ hg -R remote id -r 0
1124 $ hg -R remote id -r 0
1105 acb14030fe0a
1125 acb14030fe0a
1106
1126
1107 Cloning into pooled storage doesn't race (issue5104)
1127 Cloning into pooled storage doesn't race (issue5104)
1108
1128
1109 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1129 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1110 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1130 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1111 $ wait
1131 $ wait
1112
1132
1113 $ hg -R share-destrace1 log -r tip
1133 $ hg -R share-destrace1 log -r tip
1114 changeset: 2:e5bfe23c0b47
1134 changeset: 2:e5bfe23c0b47
1115 bookmark: bookA
1135 bookmark: bookA
1116 tag: tip
1136 tag: tip
1117 user: test
1137 user: test
1118 date: Thu Jan 01 00:00:00 1970 +0000
1138 date: Thu Jan 01 00:00:00 1970 +0000
1119 summary: 1a
1139 summary: 1a
1120
1140
1121
1141
1122 $ hg -R share-destrace2 log -r tip
1142 $ hg -R share-destrace2 log -r tip
1123 changeset: 2:e5bfe23c0b47
1143 changeset: 2:e5bfe23c0b47
1124 bookmark: bookA
1144 bookmark: bookA
1125 tag: tip
1145 tag: tip
1126 user: test
1146 user: test
1127 date: Thu Jan 01 00:00:00 1970 +0000
1147 date: Thu Jan 01 00:00:00 1970 +0000
1128 summary: 1a
1148 summary: 1a
1129
1149
1130 One repo should be new, the other should be shared from the pool. We
1150 One repo should be new, the other should be shared from the pool. We
1131 don't care which is which, so we just make sure we always print the
1151 don't care which is which, so we just make sure we always print the
1132 one containing "new pooled" first, then one one containing "existing
1152 one containing "new pooled" first, then one one containing "existing
1133 pooled".
1153 pooled".
1134
1154
1135 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1155 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1136 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1156 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1137 requesting all changes
1157 requesting all changes
1138 adding changesets
1158 adding changesets
1139 adding manifests
1159 adding manifests
1140 adding file changes
1160 adding file changes
1141 added 3 changesets with 3 changes to 1 files
1161 added 3 changesets with 3 changes to 1 files
1142 new changesets b5f04eac9d8f:e5bfe23c0b47
1162 new changesets b5f04eac9d8f:e5bfe23c0b47
1143 searching for changes
1163 searching for changes
1144 no changes found
1164 no changes found
1145 adding remote bookmark bookA
1165 adding remote bookmark bookA
1146 updating working directory
1166 updating working directory
1147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1167 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1148
1168
1149 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1169 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1150 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1170 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1151 searching for changes
1171 searching for changes
1152 no changes found
1172 no changes found
1153 adding remote bookmark bookA
1173 adding remote bookmark bookA
1154 updating working directory
1174 updating working directory
1155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1175 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1156
1176
1157 SEC: check for unsafe ssh url
1177 SEC: check for unsafe ssh url
1158
1178
1159 $ cat >> $HGRCPATH << EOF
1179 $ cat >> $HGRCPATH << EOF
1160 > [ui]
1180 > [ui]
1161 > ssh = sh -c "read l; read l; read l"
1181 > ssh = sh -c "read l; read l; read l"
1162 > EOF
1182 > EOF
1163
1183
1164 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1184 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1165 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1185 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1166 [255]
1186 [255]
1167 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1187 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1168 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1188 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1169 [255]
1189 [255]
1170 $ hg clone 'ssh://fakehost|touch%20owned/path'
1190 $ hg clone 'ssh://fakehost|touch%20owned/path'
1171 abort: no suitable response from remote hg
1191 abort: no suitable response from remote hg
1172 [255]
1192 [255]
1173 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1193 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1174 abort: no suitable response from remote hg
1194 abort: no suitable response from remote hg
1175 [255]
1195 [255]
1176
1196
1177 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1197 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1178 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1198 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1179 [255]
1199 [255]
1180
1200
1181 #if windows
1201 #if windows
1182 $ hg clone "ssh://%26touch%20owned%20/" --debug
1202 $ hg clone "ssh://%26touch%20owned%20/" --debug
1183 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1203 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1184 sending hello command
1204 sending hello command
1185 sending between command
1205 sending between command
1186 abort: no suitable response from remote hg
1206 abort: no suitable response from remote hg
1187 [255]
1207 [255]
1188 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1208 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1189 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1209 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1190 sending hello command
1210 sending hello command
1191 sending between command
1211 sending between command
1192 abort: no suitable response from remote hg
1212 abort: no suitable response from remote hg
1193 [255]
1213 [255]
1194 #else
1214 #else
1195 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1215 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1196 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1216 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1197 sending hello command
1217 sending hello command
1198 sending between command
1218 sending between command
1199 abort: no suitable response from remote hg
1219 abort: no suitable response from remote hg
1200 [255]
1220 [255]
1201 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1221 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1202 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1222 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1203 sending hello command
1223 sending hello command
1204 sending between command
1224 sending between command
1205 abort: no suitable response from remote hg
1225 abort: no suitable response from remote hg
1206 [255]
1226 [255]
1207 #endif
1227 #endif
1208
1228
1209 $ hg clone "ssh://v-alid.example.com/" --debug
1229 $ hg clone "ssh://v-alid.example.com/" --debug
1210 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1230 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1211 sending hello command
1231 sending hello command
1212 sending between command
1232 sending between command
1213 abort: no suitable response from remote hg
1233 abort: no suitable response from remote hg
1214 [255]
1234 [255]
1215
1235
1216 We should not have created a file named owned - if it exists, the
1236 We should not have created a file named owned - if it exists, the
1217 attack succeeded.
1237 attack succeeded.
1218 $ if test -f owned; then echo 'you got owned'; fi
1238 $ if test -f owned; then echo 'you got owned'; fi
1219
1239
1220 Cloning without fsmonitor enabled does not print a warning for small repos
1240 Cloning without fsmonitor enabled does not print a warning for small repos
1221
1241
1222 $ hg clone a fsmonitor-default
1242 $ hg clone a fsmonitor-default
1223 updating to bookmark @ on branch stable
1243 updating to bookmark @ on branch stable
1224 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1244 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1225
1245
1226 Lower the warning threshold to simulate a large repo
1246 Lower the warning threshold to simulate a large repo
1227
1247
1228 $ cat >> $HGRCPATH << EOF
1248 $ cat >> $HGRCPATH << EOF
1229 > [fsmonitor]
1249 > [fsmonitor]
1230 > warn_update_file_count = 2
1250 > warn_update_file_count = 2
1231 > warn_update_file_count_rust = 2
1251 > warn_update_file_count_rust = 2
1232 > EOF
1252 > EOF
1233
1253
1234 We should see a warning about no fsmonitor on supported platforms
1254 We should see a warning about no fsmonitor on supported platforms
1235
1255
1236 #if linuxormacos no-fsmonitor
1256 #if linuxormacos no-fsmonitor
1237 $ hg clone a nofsmonitor
1257 $ hg clone a nofsmonitor
1238 updating to bookmark @ on branch stable
1258 updating to bookmark @ on branch stable
1239 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1259 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1240 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1260 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1241 #else
1261 #else
1242 $ hg clone a nofsmonitor
1262 $ hg clone a nofsmonitor
1243 updating to bookmark @ on branch stable
1263 updating to bookmark @ on branch stable
1244 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1264 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1245 #endif
1265 #endif
1246
1266
1247 We should not see warning about fsmonitor when it is enabled
1267 We should not see warning about fsmonitor when it is enabled
1248
1268
1249 #if fsmonitor
1269 #if fsmonitor
1250 $ hg clone a fsmonitor-enabled
1270 $ hg clone a fsmonitor-enabled
1251 updating to bookmark @ on branch stable
1271 updating to bookmark @ on branch stable
1252 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1272 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1253 #endif
1273 #endif
1254
1274
1255 We can disable the fsmonitor warning
1275 We can disable the fsmonitor warning
1256
1276
1257 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1277 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1258 updating to bookmark @ on branch stable
1278 updating to bookmark @ on branch stable
1259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1279 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1260
1280
1261 Loaded fsmonitor but disabled in config should still print warning
1281 Loaded fsmonitor but disabled in config should still print warning
1262
1282
1263 #if linuxormacos fsmonitor
1283 #if linuxormacos fsmonitor
1264 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1284 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1265 updating to bookmark @ on branch stable
1285 updating to bookmark @ on branch stable
1266 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1286 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1267 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1287 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1268 #endif
1288 #endif
1269
1289
1270 Warning not printed if working directory isn't empty
1290 Warning not printed if working directory isn't empty
1271
1291
1272 $ hg -q clone a fsmonitor-update
1292 $ hg -q clone a fsmonitor-update
1273 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1293 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1274 $ cd fsmonitor-update
1294 $ cd fsmonitor-update
1275 $ hg up acb14030fe0a
1295 $ hg up acb14030fe0a
1276 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1296 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1277 (leaving bookmark @)
1297 (leaving bookmark @)
1278 $ hg up cf0fe1914066
1298 $ hg up cf0fe1914066
1279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1299 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1280
1300
1281 `hg update` from null revision also prints
1301 `hg update` from null revision also prints
1282
1302
1283 $ hg up null
1303 $ hg up null
1284 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1304 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1285
1305
1286 #if linuxormacos no-fsmonitor
1306 #if linuxormacos no-fsmonitor
1287 $ hg up cf0fe1914066
1307 $ hg up cf0fe1914066
1288 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1308 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1289 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1309 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1290 #else
1310 #else
1291 $ hg up cf0fe1914066
1311 $ hg up cf0fe1914066
1292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1312 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1293 #endif
1313 #endif
1294
1314
1295 $ cd ..
1315 $ cd ..
1296
1316
@@ -1,852 +1,869 b''
1 #require no-reposimplestore no-chg
1 #require no-reposimplestore no-chg
2
2
3 Set up a server
3 Set up a server
4
4
5 $ hg init server
5 $ hg init server
6 $ cd server
6 $ cd server
7 $ cat >> .hg/hgrc << EOF
7 $ cat >> .hg/hgrc << EOF
8 > [extensions]
8 > [extensions]
9 > clonebundles =
9 > clonebundles =
10 > EOF
10 > EOF
11
11
12 $ touch foo
12 $ touch foo
13 $ hg -q commit -A -m 'add foo'
13 $ hg -q commit -A -m 'add foo'
14 $ touch bar
14 $ touch bar
15 $ hg -q commit -A -m 'add bar'
15 $ hg -q commit -A -m 'add bar'
16
16
17 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
17 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
18 $ cat hg.pid >> $DAEMON_PIDS
18 $ cat hg.pid >> $DAEMON_PIDS
19 $ cd ..
19 $ cd ..
20
20
21 Missing manifest should not result in server lookup
21 Missing manifest should not result in server lookup
22
22
23 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
23 $ hg --verbose clone -U http://localhost:$HGPORT no-manifest
24 requesting all changes
24 requesting all changes
25 adding changesets
25 adding changesets
26 adding manifests
26 adding manifests
27 adding file changes
27 adding file changes
28 added 2 changesets with 2 changes to 2 files
28 added 2 changesets with 2 changes to 2 files
29 new changesets 53245c60e682:aaff8d2ffbbf
29 new changesets 53245c60e682:aaff8d2ffbbf
30 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
30 (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob)
31
31
32 $ cat server/access.log
32 $ cat server/access.log
33 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
33 * - - [*] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
34 $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$ partial-pull (glob)
34 $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$ partial-pull (glob)
35 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
35 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=aaff8d2ffbbf07a46dd1f05d8ae7877e3f56e2a2&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
36
36
37 Empty manifest file results in retrieval
37 Empty manifest file results in retrieval
38 (the extension only checks if the manifest file exists)
38 (the extension only checks if the manifest file exists)
39
39
40 $ touch server/.hg/clonebundles.manifest
40 $ touch server/.hg/clonebundles.manifest
41 $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest
41 $ hg --verbose clone -U http://localhost:$HGPORT empty-manifest
42 no clone bundles available on remote; falling back to regular clone
42 no clone bundles available on remote; falling back to regular clone
43 requesting all changes
43 requesting all changes
44 adding changesets
44 adding changesets
45 adding manifests
45 adding manifests
46 adding file changes
46 adding file changes
47 added 2 changesets with 2 changes to 2 files
47 added 2 changesets with 2 changes to 2 files
48 new changesets 53245c60e682:aaff8d2ffbbf
48 new changesets 53245c60e682:aaff8d2ffbbf
49 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
49 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
50
50
51 Manifest file with invalid URL aborts
51 Manifest file with invalid URL aborts
52
52
53 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
53 $ echo 'http://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
54 $ hg clone http://localhost:$HGPORT 404-url
54 $ hg clone http://localhost:$HGPORT 404-url
55 applying clone bundle from http://does.not.exist/bundle.hg
55 applying clone bundle from http://does.not.exist/bundle.hg
56 error fetching bundle: (.* not known|(\[Errno -?\d+] )?([Nn]o address associated with (host)?name|Temporary failure in name resolution|Name does not resolve)) (re) (no-windows !)
56 error fetching bundle: (.* not known|(\[Errno -?\d+] )?([Nn]o address associated with (host)?name|Temporary failure in name resolution|Name does not resolve)) (re) (no-windows !)
57 error fetching bundle: [Errno 1100*] getaddrinfo failed (glob) (windows !)
57 error fetching bundle: [Errno 1100*] getaddrinfo failed (glob) (windows !)
58 abort: error applying bundle
58 abort: error applying bundle
59 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
59 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
60 [255]
60 [255]
61
61
62 Manifest file with URL with unknown scheme skips the URL
62 Manifest file with URL with unknown scheme skips the URL
63 $ echo 'weirdscheme://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
63 $ echo 'weirdscheme://does.not.exist/bundle.hg' > server/.hg/clonebundles.manifest
64 $ hg clone http://localhost:$HGPORT unknown-scheme
64 $ hg clone http://localhost:$HGPORT unknown-scheme
65 no compatible clone bundles available on server; falling back to regular clone
65 no compatible clone bundles available on server; falling back to regular clone
66 (you may want to report this to the server operator)
66 (you may want to report this to the server operator)
67 requesting all changes
67 requesting all changes
68 adding changesets
68 adding changesets
69 adding manifests
69 adding manifests
70 adding file changes
70 adding file changes
71 added 2 changesets with 2 changes to 2 files
71 added 2 changesets with 2 changes to 2 files
72 new changesets 53245c60e682:aaff8d2ffbbf
72 new changesets 53245c60e682:aaff8d2ffbbf
73 updating to branch default
73 updating to branch default
74 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
75
75
76 Server is not running aborts
76 Server is not running aborts
77
77
78 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
78 $ echo "http://localhost:$HGPORT1/bundle.hg" > server/.hg/clonebundles.manifest
79 $ hg clone http://localhost:$HGPORT server-not-runner
79 $ hg clone http://localhost:$HGPORT server-not-runner
80 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
80 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
81 error fetching bundle: (.* refused.*|Protocol not supported|(.* )?\$EADDRNOTAVAIL\$|.* No route to host) (re)
81 error fetching bundle: (.* refused.*|Protocol not supported|(.* )?\$EADDRNOTAVAIL\$|.* No route to host) (re)
82 abort: error applying bundle
82 abort: error applying bundle
83 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
83 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
84 [255]
84 [255]
85
85
86 Server returns 404
86 Server returns 404
87
87
88 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
88 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
89 $ cat http.pid >> $DAEMON_PIDS
89 $ cat http.pid >> $DAEMON_PIDS
90 $ hg clone http://localhost:$HGPORT running-404
90 $ hg clone http://localhost:$HGPORT running-404
91 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
91 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
92 HTTP error fetching bundle: HTTP Error 404: File not found
92 HTTP error fetching bundle: HTTP Error 404: File not found
93 abort: error applying bundle
93 abort: error applying bundle
94 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
94 (if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false")
95 [255]
95 [255]
96
96
97 We can override failure to fall back to regular clone
97 We can override failure to fall back to regular clone
98
98
99 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
99 $ hg --config ui.clonebundlefallback=true clone -U http://localhost:$HGPORT 404-fallback
100 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
100 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
101 HTTP error fetching bundle: HTTP Error 404: File not found
101 HTTP error fetching bundle: HTTP Error 404: File not found
102 falling back to normal clone
102 falling back to normal clone
103 requesting all changes
103 requesting all changes
104 adding changesets
104 adding changesets
105 adding manifests
105 adding manifests
106 adding file changes
106 adding file changes
107 added 2 changesets with 2 changes to 2 files
107 added 2 changesets with 2 changes to 2 files
108 new changesets 53245c60e682:aaff8d2ffbbf
108 new changesets 53245c60e682:aaff8d2ffbbf
109
109
110 Bundle with partial content works
110 Bundle with partial content works
111
111
112 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
112 $ hg -R server bundle --type gzip-v1 --base null -r 53245c60e682 partial.hg
113 1 changesets found
113 1 changesets found
114
114
115 We verify exact bundle content as an extra check against accidental future
115 We verify exact bundle content as an extra check against accidental future
116 changes. If this output changes, we could break old clients.
116 changes. If this output changes, we could break old clients.
117
117
118 $ f --size --hexdump partial.hg
118 $ f --size --hexdump partial.hg
119 partial.hg: size=207
119 partial.hg: size=207
120 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
120 0000: 48 47 31 30 47 5a 78 9c 63 60 60 98 17 ac 12 93 |HG10GZx.c``.....|
121 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
121 0010: f0 ac a9 23 45 70 cb bf 0d 5f 59 4e 4a 7f 79 21 |...#Ep..._YNJ.y!|
122 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
122 0020: 9b cc 40 24 20 a0 d7 ce 2c d1 38 25 cd 24 25 d5 |..@$ ...,.8%.$%.|
123 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
123 0030: d8 c2 22 cd 38 d9 24 cd 22 d5 c8 22 cd 24 cd 32 |..".8.$."..".$.2|
124 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
124 0040: d1 c2 d0 c4 c8 d2 32 d1 38 39 29 c9 34 cd d4 80 |......2.89).4...|
125 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
125 0050: ab 24 b5 b8 84 cb 40 c1 80 2b 2d 3f 9f 8b 2b 31 |.$....@..+-?..+1|
126 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
126 0060: 25 45 01 c8 80 9a d2 9b 65 fb e5 9e 45 bf 8d 7f |%E......e...E...|
127 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
127 0070: 9f c6 97 9f 2b 44 34 67 d9 ec 8e 0f a0 92 0b 75 |....+D4g.......u|
128 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
128 0080: 41 d6 24 59 18 a4 a4 9a a6 18 1a 5b 98 9b 5a 98 |A.$Y.......[..Z.|
129 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
129 0090: 9a 18 26 9b a6 19 98 1a 99 99 26 a6 18 9a 98 24 |..&.......&....$|
130 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
130 00a0: 26 59 a6 25 5a 98 a5 18 a6 24 71 41 35 b1 43 dc |&Y.%Z....$qA5.C.|
131 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
131 00b0: 16 b2 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 d7 8a |.....E..V....R..|
132 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.|
132 00c0: 78 ed fc d5 76 f1 36 35 dc 05 00 36 ed 5e c7 |x...v.65...6.^.|
133
133
134 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
134 $ echo "http://localhost:$HGPORT1/partial.hg" > server/.hg/clonebundles.manifest
135 $ hg clone -U http://localhost:$HGPORT partial-bundle
135 $ hg clone -U http://localhost:$HGPORT partial-bundle
136 applying clone bundle from http://localhost:$HGPORT1/partial.hg
136 applying clone bundle from http://localhost:$HGPORT1/partial.hg
137 adding changesets
137 adding changesets
138 adding manifests
138 adding manifests
139 adding file changes
139 adding file changes
140 added 1 changesets with 1 changes to 1 files
140 added 1 changesets with 1 changes to 1 files
141 finished applying clone bundle
141 finished applying clone bundle
142 searching for changes
142 searching for changes
143 adding changesets
143 adding changesets
144 adding manifests
144 adding manifests
145 adding file changes
145 adding file changes
146 added 1 changesets with 1 changes to 1 files
146 added 1 changesets with 1 changes to 1 files
147 new changesets aaff8d2ffbbf
147 new changesets aaff8d2ffbbf
148 1 local changesets published
148 1 local changesets published
149
149
150 Incremental pull doesn't fetch bundle
150 Incremental pull doesn't fetch bundle
151
151
152 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
152 $ hg clone -r 53245c60e682 -U http://localhost:$HGPORT partial-clone
153 adding changesets
153 adding changesets
154 adding manifests
154 adding manifests
155 adding file changes
155 adding file changes
156 added 1 changesets with 1 changes to 1 files
156 added 1 changesets with 1 changes to 1 files
157 new changesets 53245c60e682
157 new changesets 53245c60e682
158
158
159 $ cd partial-clone
159 $ cd partial-clone
160 $ hg pull
160 $ hg pull
161 pulling from http://localhost:$HGPORT/
161 pulling from http://localhost:$HGPORT/
162 searching for changes
162 searching for changes
163 adding changesets
163 adding changesets
164 adding manifests
164 adding manifests
165 adding file changes
165 adding file changes
166 added 1 changesets with 1 changes to 1 files
166 added 1 changesets with 1 changes to 1 files
167 new changesets aaff8d2ffbbf
167 new changesets aaff8d2ffbbf
168 (run 'hg update' to get a working copy)
168 (run 'hg update' to get a working copy)
169 $ cd ..
169 $ cd ..
170
170
171 Bundle with full content works
171 Bundle with full content works
172
172
173 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
173 $ hg -R server bundle --type gzip-v2 --base null -r tip full.hg
174 2 changesets found
174 2 changesets found
175
175
176 Again, we perform an extra check against bundle content changes. If this content
176 Again, we perform an extra check against bundle content changes. If this content
177 changes, clone bundles produced by new Mercurial versions may not be readable
177 changes, clone bundles produced by new Mercurial versions may not be readable
178 by old clients.
178 by old clients.
179
179
180 $ f --size --hexdump full.hg
180 $ f --size --hexdump full.hg
181 full.hg: size=442
181 full.hg: size=442
182 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
182 0000: 48 47 32 30 00 00 00 0e 43 6f 6d 70 72 65 73 73 |HG20....Compress|
183 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p|
183 0010: 69 6f 6e 3d 47 5a 78 9c 63 60 60 d0 e4 76 f6 70 |ion=GZx.c``..v.p|
184 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N|
184 0020: f4 73 77 75 0f f2 0f 0d 60 00 02 46 46 76 26 4e |.swu....`..FFv&N|
185 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........|
185 0030: c6 b2 d4 a2 e2 cc fc 3c 03 a3 bc a4 e4 8c c4 bc |.......<........|
186 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..|
186 0040: f4 d4 62 23 06 06 e6 19 40 f9 4d c1 2a 31 09 cf |..b#....@.M.*1..|
187 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............|
187 0050: 9a 3a 52 04 b7 fc db f0 95 e5 a4 f4 97 17 b2 c9 |.:R.............|
188 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[|
188 0060: 0c 14 00 02 e6 d9 99 25 1a a7 a4 99 a4 a4 1a 5b |.......%.......[|
189 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z|
189 0070: 58 a4 19 27 9b a4 59 a4 1a 59 a4 99 a4 59 26 5a |X..'..Y..Y...Y&Z|
190 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.|
190 0080: 18 9a 18 59 5a 26 1a 27 27 25 99 a6 99 1a 70 95 |...YZ&.''%....p.|
191 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..|
191 0090: a4 16 97 70 19 28 18 70 a5 e5 e7 73 71 25 a6 a4 |...p.(.p...sq%..|
192 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....|
192 00a0: 28 00 19 20 17 af fa df ab ff 7b 3f fb 92 dc 8b |(.. ......{?....|
193 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...|
193 00b0: 1f 62 bb 9e b7 d7 d9 87 3d 5a 44 89 2f b0 99 87 |.b......=ZD./...|
194 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c|
194 00c0: ec e2 54 63 43 e3 b4 64 43 73 23 33 43 53 0b 63 |..TcC..dCs#3CS.c|
195 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.|
195 00d0: d3 14 23 03 a0 fb 2c 2c 0c d3 80 1e 30 49 49 b1 |..#...,,....0II.|
196 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b|
196 00e0: 4c 4a 32 48 33 30 b0 34 42 b8 38 29 b1 08 e2 62 |LJ2H30.4B.8)...b|
197 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.|
197 00f0: 20 03 6a ca c2 2c db 2f f7 2c fa 6d fc fb 34 be | .j..,./.,.m..4.|
198 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X|
198 0100: fc 5c 21 a2 39 cb 66 77 7c 00 0d c3 59 17 14 58 |.\!.9.fw|...Y..X|
199 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.|
199 0110: 49 16 06 29 a9 a6 29 86 c6 16 e6 a6 16 a6 26 86 |I..)..).......&.|
200 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.|
200 0120: c9 a6 69 06 a6 46 66 a6 89 29 86 26 26 89 49 96 |..i..Ff..).&&.I.|
201 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.|
201 0130: 69 89 16 66 29 86 29 49 5c 20 07 3e 16 fe 23 ae |i..f).)I\ .>..#.|
202 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............|
202 0140: 26 da 1c ab 10 1f d1 f8 e3 b3 ef cd dd fc 0c 93 |&...............|
203 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...|
203 0150: 88 75 34 36 75 04 82 55 17 14 36 a4 38 10 04 d8 |.u46u..U..6.8...|
204 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R|
204 0160: 21 01 9a b1 83 f7 e9 45 8b d2 56 c7 a3 1f 82 52 |!......E..V....R|
205 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......|
205 0170: d7 8a 78 ed fc d5 76 f1 36 25 81 89 c7 ad ec 90 |..x...v.6%......|
206 0180: 54 47 75 2b 89 48 b1 b2 62 c9 89 c9 19 a9 56 45 |TGu+.H..b.....VE|
206 0180: 54 47 75 2b 89 48 b1 b2 62 c9 89 c9 19 a9 56 45 |TGu+.H..b.....VE|
207 0190: a9 65 ba 49 45 89 79 c9 19 ba 60 01 a0 14 23 58 |.e.IE.y...`...#X|
207 0190: a9 65 ba 49 45 89 79 c9 19 ba 60 01 a0 14 23 58 |.e.IE.y...`...#X|
208 01a0: 81 35 c8 7d 40 cc 04 e2 a4 a4 a6 25 96 e6 94 60 |.5.}@......%...`|
208 01a0: 81 35 c8 7d 40 cc 04 e2 a4 a4 a6 25 96 e6 94 60 |.5.}@......%...`|
209 01b0: 33 17 5f 54 00 00 d3 1b 0d 4c |3._T.....L|
209 01b0: 33 17 5f 54 00 00 d3 1b 0d 4c |3._T.....L|
210
210
211 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
211 $ echo "http://localhost:$HGPORT1/full.hg" > server/.hg/clonebundles.manifest
212 $ hg clone -U http://localhost:$HGPORT full-bundle
212 $ hg clone -U http://localhost:$HGPORT full-bundle
213 applying clone bundle from http://localhost:$HGPORT1/full.hg
213 applying clone bundle from http://localhost:$HGPORT1/full.hg
214 adding changesets
214 adding changesets
215 adding manifests
215 adding manifests
216 adding file changes
216 adding file changes
217 added 2 changesets with 2 changes to 2 files
217 added 2 changesets with 2 changes to 2 files
218 finished applying clone bundle
218 finished applying clone bundle
219 searching for changes
219 searching for changes
220 no changes found
220 no changes found
221 2 local changesets published
221 2 local changesets published
222
222
223 Feature works over SSH
223 Feature works over SSH
224
224
225 $ hg clone -U ssh://user@dummy/server ssh-full-clone
225 $ hg clone -U ssh://user@dummy/server ssh-full-clone
226 applying clone bundle from http://localhost:$HGPORT1/full.hg
226 applying clone bundle from http://localhost:$HGPORT1/full.hg
227 adding changesets
227 adding changesets
228 adding manifests
228 adding manifests
229 adding file changes
229 adding file changes
230 added 2 changesets with 2 changes to 2 files
230 added 2 changesets with 2 changes to 2 files
231 finished applying clone bundle
231 finished applying clone bundle
232 searching for changes
232 searching for changes
233 no changes found
233 no changes found
234 2 local changesets published
234 2 local changesets published
235
235
236 Inline bundle
236 Inline bundle
237 =============
237 =============
238
238
239 Checking bundle retrieved over the wireprotocol
239 Checking bundle retrieved over the wireprotocol
240
240
241 Feature works over SSH with inline bundle
241 Feature works over SSH with inline bundle
242 -----------------------------------------
242 -----------------------------------------
243
243
244 $ mkdir server/.hg/bundle-cache/
244 $ mkdir server/.hg/bundle-cache/
245 $ cp full.hg server/.hg/bundle-cache/
245 $ cp full.hg server/.hg/bundle-cache/
246 $ echo "peer-bundle-cache://full.hg" > server/.hg/clonebundles.manifest
246 $ echo "peer-bundle-cache://full.hg" > server/.hg/clonebundles.manifest
247 $ hg clone -U ssh://user@dummy/server ssh-inline-clone
247 $ hg clone -U ssh://user@dummy/server ssh-inline-clone
248 applying clone bundle from peer-bundle-cache://full.hg
248 applying clone bundle from peer-bundle-cache://full.hg
249 adding changesets
249 adding changesets
250 adding manifests
250 adding manifests
251 adding file changes
251 adding file changes
252 added 2 changesets with 2 changes to 2 files
252 added 2 changesets with 2 changes to 2 files
253 finished applying clone bundle
253 finished applying clone bundle
254 searching for changes
254 searching for changes
255 no changes found
255 no changes found
256 2 local changesets published
256 2 local changesets published
257
257
258 HTTP Supports
258 HTTP Supports
259 -------------
259 -------------
260
260
261 $ hg clone -U http://localhost:$HGPORT http-inline-clone
261 $ hg clone -U http://localhost:$HGPORT http-inline-clone
262 applying clone bundle from peer-bundle-cache://full.hg
262 applying clone bundle from peer-bundle-cache://full.hg
263 adding changesets
263 adding changesets
264 adding manifests
264 adding manifests
265 adding file changes
265 adding file changes
266 added 2 changesets with 2 changes to 2 files
266 added 2 changesets with 2 changes to 2 files
267 finished applying clone bundle
267 finished applying clone bundle
268 searching for changes
268 searching for changes
269 no changes found
269 no changes found
270 2 local changesets published
270 2 local changesets published
271
271
272
272
273 Check local behavior
273 Check local behavior
274 --------------------
274 --------------------
275
275
276 We don't use the clone bundle, but we do not crash either.
276 We don't use the clone bundle, but we do not crash either.
277
277
278 $ hg clone -U ./server local-inline-clone-default
278 $ hg clone -U ./server local-inline-clone-default
279 $ hg clone -U ./server local-inline-clone-pull --pull
279 $ hg clone -U ./server local-inline-clone-pull --pull
280 requesting all changes
280 requesting all changes
281 adding changesets
281 adding changesets
282 adding manifests
282 adding manifests
283 adding file changes
283 adding file changes
284 added 2 changesets with 2 changes to 2 files
284 added 2 changesets with 2 changes to 2 files
285 new changesets 53245c60e682:aaff8d2ffbbf
285 new changesets 53245c60e682:aaff8d2ffbbf
286
286
287 Pre-transmit Hook
287 Pre-transmit Hook
288 -----------------
288 -----------------
289
289
290 Hooks work with inline bundle
290 Hooks work with inline bundle
291
291
292 $ cp server/.hg/hgrc server/.hg/hgrc-beforeinlinehooks
292 $ cp server/.hg/hgrc server/.hg/hgrc-beforeinlinehooks
293 $ echo "[hooks]" >> server/.hg/hgrc
293 $ echo "[hooks]" >> server/.hg/hgrc
294 $ echo "pretransmit-inline-clone-bundle=echo foo" >> server/.hg/hgrc
294 $ echo "pretransmit-inline-clone-bundle=echo foo" >> server/.hg/hgrc
295 $ hg clone -U ssh://user@dummy/server ssh-inline-clone-hook
295 $ hg clone -U ssh://user@dummy/server ssh-inline-clone-hook
296 applying clone bundle from peer-bundle-cache://full.hg
296 applying clone bundle from peer-bundle-cache://full.hg
297 remote: foo
297 remote: foo
298 adding changesets
298 adding changesets
299 adding manifests
299 adding manifests
300 adding file changes
300 adding file changes
301 added 2 changesets with 2 changes to 2 files
301 added 2 changesets with 2 changes to 2 files
302 finished applying clone bundle
302 finished applying clone bundle
303 searching for changes
303 searching for changes
304 no changes found
304 no changes found
305 2 local changesets published
305 2 local changesets published
306
306
307 Hooks can make an inline bundle fail
307 Hooks can make an inline bundle fail
308
308
309 $ cp server/.hg/hgrc-beforeinlinehooks server/.hg/hgrc
309 $ cp server/.hg/hgrc-beforeinlinehooks server/.hg/hgrc
310 $ echo "[hooks]" >> server/.hg/hgrc
310 $ echo "[hooks]" >> server/.hg/hgrc
311 $ echo "pretransmit-inline-clone-bundle=echo bar && false" >> server/.hg/hgrc
311 $ echo "pretransmit-inline-clone-bundle=echo bar && false" >> server/.hg/hgrc
312 $ hg clone -U ssh://user@dummy/server ssh-inline-clone-hook-fail
312 $ hg clone -U ssh://user@dummy/server ssh-inline-clone-hook-fail
313 applying clone bundle from peer-bundle-cache://full.hg
313 applying clone bundle from peer-bundle-cache://full.hg
314 remote: bar
314 remote: bar
315 remote: abort: pretransmit-inline-clone-bundle hook exited with status 1
315 remote: abort: pretransmit-inline-clone-bundle hook exited with status 1
316 abort: stream ended unexpectedly (got 0 bytes, expected 1)
316 abort: stream ended unexpectedly (got 0 bytes, expected 1)
317 [255]
317 [255]
318 $ cp server/.hg/hgrc-beforeinlinehooks server/.hg/hgrc
318 $ cp server/.hg/hgrc-beforeinlinehooks server/.hg/hgrc
319
319
320 Other tests
320 Other tests
321 ===========
321 ===========
322
322
323 Entry with unknown BUNDLESPEC is filtered and not used
323 Entry with unknown BUNDLESPEC is filtered and not used
324
324
325 $ cat > server/.hg/clonebundles.manifest << EOF
325 $ cat > server/.hg/clonebundles.manifest << EOF
326 > http://bad.entry1 BUNDLESPEC=UNKNOWN
326 > http://bad.entry1 BUNDLESPEC=UNKNOWN
327 > http://bad.entry2 BUNDLESPEC=xz-v1
327 > http://bad.entry2 BUNDLESPEC=xz-v1
328 > http://bad.entry3 BUNDLESPEC=none-v100
328 > http://bad.entry3 BUNDLESPEC=none-v100
329 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
329 > http://localhost:$HGPORT1/full.hg BUNDLESPEC=gzip-v2
330 > EOF
330 > EOF
331
331
332 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
332 $ hg clone -U http://localhost:$HGPORT filter-unknown-type
333 applying clone bundle from http://localhost:$HGPORT1/full.hg
333 applying clone bundle from http://localhost:$HGPORT1/full.hg
334 adding changesets
334 adding changesets
335 adding manifests
335 adding manifests
336 adding file changes
336 adding file changes
337 added 2 changesets with 2 changes to 2 files
337 added 2 changesets with 2 changes to 2 files
338 finished applying clone bundle
338 finished applying clone bundle
339 searching for changes
339 searching for changes
340 no changes found
340 no changes found
341 2 local changesets published
341 2 local changesets published
342
342
343 Automatic fallback when all entries are filtered
343 Automatic fallback when all entries are filtered
344
344
345 $ cat > server/.hg/clonebundles.manifest << EOF
345 $ cat > server/.hg/clonebundles.manifest << EOF
346 > http://bad.entry BUNDLESPEC=UNKNOWN
346 > http://bad.entry BUNDLESPEC=UNKNOWN
347 > EOF
347 > EOF
348
348
349 $ hg clone -U http://localhost:$HGPORT filter-all
349 $ hg clone -U http://localhost:$HGPORT filter-all
350 no compatible clone bundles available on server; falling back to regular clone
350 no compatible clone bundles available on server; falling back to regular clone
351 (you may want to report this to the server operator)
351 (you may want to report this to the server operator)
352 requesting all changes
352 requesting all changes
353 adding changesets
353 adding changesets
354 adding manifests
354 adding manifests
355 adding file changes
355 adding file changes
356 added 2 changesets with 2 changes to 2 files
356 added 2 changesets with 2 changes to 2 files
357 new changesets 53245c60e682:aaff8d2ffbbf
357 new changesets 53245c60e682:aaff8d2ffbbf
358
358
359 We require a Python version that supports SNI. Therefore, URLs requiring SNI
359 We require a Python version that supports SNI. Therefore, URLs requiring SNI
360 are not filtered.
360 are not filtered.
361
361
362 $ cp full.hg sni.hg
362 $ cp full.hg sni.hg
363 $ cat > server/.hg/clonebundles.manifest << EOF
363 $ cat > server/.hg/clonebundles.manifest << EOF
364 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
364 > http://localhost:$HGPORT1/sni.hg REQUIRESNI=true
365 > http://localhost:$HGPORT1/full.hg
365 > http://localhost:$HGPORT1/full.hg
366 > EOF
366 > EOF
367
367
368 $ hg clone -U http://localhost:$HGPORT sni-supported
368 $ hg clone -U http://localhost:$HGPORT sni-supported
369 applying clone bundle from http://localhost:$HGPORT1/sni.hg
369 applying clone bundle from http://localhost:$HGPORT1/sni.hg
370 adding changesets
370 adding changesets
371 adding manifests
371 adding manifests
372 adding file changes
372 adding file changes
373 added 2 changesets with 2 changes to 2 files
373 added 2 changesets with 2 changes to 2 files
374 finished applying clone bundle
374 finished applying clone bundle
375 searching for changes
375 searching for changes
376 no changes found
376 no changes found
377 2 local changesets published
377 2 local changesets published
378
378
379 Stream clone bundles are supported
379 Stream clone bundles are supported
380
380
381 $ hg -R server debugcreatestreamclonebundle packed.hg
381 $ hg -R server debugcreatestreamclonebundle packed.hg
382 writing 613 bytes for 4 files
382 writing 613 bytes for 5 files (no-rust !)
383 writing 739 bytes for 7 files (rust !)
383 bundle requirements: generaldelta, revlogv1, sparserevlog (no-rust no-zstd !)
384 bundle requirements: generaldelta, revlogv1, sparserevlog (no-rust no-zstd !)
384 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog (no-rust zstd !)
385 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog (no-rust zstd !)
385 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog (rust !)
386 bundle requirements: generaldelta, revlog-compression-zstd, revlogv1, sparserevlog (rust !)
386
387
387 No bundle spec should work
388 No bundle spec should work
388
389
389 $ cat > server/.hg/clonebundles.manifest << EOF
390 $ cat > server/.hg/clonebundles.manifest << EOF
390 > http://localhost:$HGPORT1/packed.hg
391 > http://localhost:$HGPORT1/packed.hg
391 > EOF
392 > EOF
392
393
393 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
394 $ hg clone -U http://localhost:$HGPORT stream-clone-no-spec
394 applying clone bundle from http://localhost:$HGPORT1/packed.hg
395 applying clone bundle from http://localhost:$HGPORT1/packed.hg
395 4 files to transfer, 613 bytes of data
396 5 files to transfer, 613 bytes of data (no-rust !)
396 transferred 613 bytes in *.* seconds (*) (glob)
397 transferred 613 bytes in *.* seconds (*) (glob) (no-rust !)
398 7 files to transfer, 739 bytes of data (rust !)
399 transferred 739 bytes in *.* seconds (*) (glob) (rust !)
397 finished applying clone bundle
400 finished applying clone bundle
398 searching for changes
401 searching for changes
399 no changes found
402 no changes found
400
403
401 Bundle spec without parameters should work
404 Bundle spec without parameters should work
402
405
403 $ cat > server/.hg/clonebundles.manifest << EOF
406 $ cat > server/.hg/clonebundles.manifest << EOF
404 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
407 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
405 > EOF
408 > EOF
406
409
407 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
410 $ hg clone -U http://localhost:$HGPORT stream-clone-vanilla-spec
408 applying clone bundle from http://localhost:$HGPORT1/packed.hg
411 applying clone bundle from http://localhost:$HGPORT1/packed.hg
409 4 files to transfer, 613 bytes of data
412 5 files to transfer, 613 bytes of data (no-rust !)
410 transferred 613 bytes in *.* seconds (*) (glob)
413 transferred 613 bytes in *.* seconds (*) (glob) (no-rust !)
414 7 files to transfer, 739 bytes of data (rust !)
415 transferred 739 bytes in *.* seconds (*) (glob) (rust !)
411 finished applying clone bundle
416 finished applying clone bundle
412 searching for changes
417 searching for changes
413 no changes found
418 no changes found
414
419
415 Bundle spec with format requirements should work
420 Bundle spec with format requirements should work
416
421
417 $ cat > server/.hg/clonebundles.manifest << EOF
422 $ cat > server/.hg/clonebundles.manifest << EOF
418 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
423 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
419 > EOF
424 > EOF
420
425
421 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
426 $ hg clone -U http://localhost:$HGPORT stream-clone-supported-requirements
422 applying clone bundle from http://localhost:$HGPORT1/packed.hg
427 applying clone bundle from http://localhost:$HGPORT1/packed.hg
423 4 files to transfer, 613 bytes of data
428 5 files to transfer, 613 bytes of data (no-rust !)
424 transferred 613 bytes in *.* seconds (*) (glob)
429 transferred 613 bytes in *.* seconds (*) (glob) (no-rust !)
430 7 files to transfer, 739 bytes of data (rust !)
431 transferred 739 bytes in *.* seconds (*) (glob) (rust !)
425 finished applying clone bundle
432 finished applying clone bundle
426 searching for changes
433 searching for changes
427 no changes found
434 no changes found
428
435
429 Stream bundle spec with unknown requirements should be filtered out
436 Stream bundle spec with unknown requirements should be filtered out
430
437
431 $ cat > server/.hg/clonebundles.manifest << EOF
438 $ cat > server/.hg/clonebundles.manifest << EOF
432 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
439 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
433 > EOF
440 > EOF
434
441
435 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
442 $ hg clone -U http://localhost:$HGPORT stream-clone-unsupported-requirements
436 no compatible clone bundles available on server; falling back to regular clone
443 no compatible clone bundles available on server; falling back to regular clone
437 (you may want to report this to the server operator)
444 (you may want to report this to the server operator)
438 requesting all changes
445 requesting all changes
439 adding changesets
446 adding changesets
440 adding manifests
447 adding manifests
441 adding file changes
448 adding file changes
442 added 2 changesets with 2 changes to 2 files
449 added 2 changesets with 2 changes to 2 files
443 new changesets 53245c60e682:aaff8d2ffbbf
450 new changesets 53245c60e682:aaff8d2ffbbf
444
451
445 Set up manifest for testing preferences
452 Set up manifest for testing preferences
446 (Remember, the TYPE does not have to match reality - the URL is
453 (Remember, the TYPE does not have to match reality - the URL is
447 important)
454 important)
448
455
449 $ cp full.hg gz-a.hg
456 $ cp full.hg gz-a.hg
450 $ cp full.hg gz-b.hg
457 $ cp full.hg gz-b.hg
451 $ cp full.hg bz2-a.hg
458 $ cp full.hg bz2-a.hg
452 $ cp full.hg bz2-b.hg
459 $ cp full.hg bz2-b.hg
453 $ cat > server/.hg/clonebundles.manifest << EOF
460 $ cat > server/.hg/clonebundles.manifest << EOF
454 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
461 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 extra=a
455 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
462 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2 extra=a
456 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
463 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
457 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
464 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
458 > EOF
465 > EOF
459
466
460 Preferring an undefined attribute will take first entry
467 Preferring an undefined attribute will take first entry
461
468
462 $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
469 $ hg --config ui.clonebundleprefers=foo=bar clone -U http://localhost:$HGPORT prefer-foo
463 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
470 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
464 adding changesets
471 adding changesets
465 adding manifests
472 adding manifests
466 adding file changes
473 adding file changes
467 added 2 changesets with 2 changes to 2 files
474 added 2 changesets with 2 changes to 2 files
468 finished applying clone bundle
475 finished applying clone bundle
469 searching for changes
476 searching for changes
470 no changes found
477 no changes found
471 2 local changesets published
478 2 local changesets published
472
479
473 Preferring bz2 type will download first entry of that type
480 Preferring bz2 type will download first entry of that type
474
481
475 $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
482 $ hg --config ui.clonebundleprefers=COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-bz
476 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
483 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
477 adding changesets
484 adding changesets
478 adding manifests
485 adding manifests
479 adding file changes
486 adding file changes
480 added 2 changesets with 2 changes to 2 files
487 added 2 changesets with 2 changes to 2 files
481 finished applying clone bundle
488 finished applying clone bundle
482 searching for changes
489 searching for changes
483 no changes found
490 no changes found
484 2 local changesets published
491 2 local changesets published
485
492
486 Preferring multiple values of an option works
493 Preferring multiple values of an option works
487
494
488 $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
495 $ hg --config ui.clonebundleprefers=COMPRESSION=unknown,COMPRESSION=bzip2 clone -U http://localhost:$HGPORT prefer-multiple-bz
489 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
496 applying clone bundle from http://localhost:$HGPORT1/bz2-a.hg
490 adding changesets
497 adding changesets
491 adding manifests
498 adding manifests
492 adding file changes
499 adding file changes
493 added 2 changesets with 2 changes to 2 files
500 added 2 changesets with 2 changes to 2 files
494 finished applying clone bundle
501 finished applying clone bundle
495 searching for changes
502 searching for changes
496 no changes found
503 no changes found
497 2 local changesets published
504 2 local changesets published
498
505
499 Sorting multiple values should get us back to original first entry
506 Sorting multiple values should get us back to original first entry
500
507
501 $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
508 $ hg --config ui.clonebundleprefers=BUNDLESPEC=unknown,BUNDLESPEC=gzip-v2,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-multiple-gz
502 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
509 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
503 adding changesets
510 adding changesets
504 adding manifests
511 adding manifests
505 adding file changes
512 adding file changes
506 added 2 changesets with 2 changes to 2 files
513 added 2 changesets with 2 changes to 2 files
507 finished applying clone bundle
514 finished applying clone bundle
508 searching for changes
515 searching for changes
509 no changes found
516 no changes found
510 2 local changesets published
517 2 local changesets published
511
518
512 Preferring multiple attributes has correct order
519 Preferring multiple attributes has correct order
513
520
514 $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
521 $ hg --config ui.clonebundleprefers=extra=b,BUNDLESPEC=bzip2-v2 clone -U http://localhost:$HGPORT prefer-separate-attributes
515 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
522 applying clone bundle from http://localhost:$HGPORT1/bz2-b.hg
516 adding changesets
523 adding changesets
517 adding manifests
524 adding manifests
518 adding file changes
525 adding file changes
519 added 2 changesets with 2 changes to 2 files
526 added 2 changesets with 2 changes to 2 files
520 finished applying clone bundle
527 finished applying clone bundle
521 searching for changes
528 searching for changes
522 no changes found
529 no changes found
523 2 local changesets published
530 2 local changesets published
524
531
525 Test where attribute is missing from some entries
532 Test where attribute is missing from some entries
526
533
527 $ cat > server/.hg/clonebundles.manifest << EOF
534 $ cat > server/.hg/clonebundles.manifest << EOF
528 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
535 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
529 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
536 > http://localhost:$HGPORT1/bz2-a.hg BUNDLESPEC=bzip2-v2
530 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
537 > http://localhost:$HGPORT1/gz-b.hg BUNDLESPEC=gzip-v2 extra=b
531 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
538 > http://localhost:$HGPORT1/bz2-b.hg BUNDLESPEC=bzip2-v2 extra=b
532 > EOF
539 > EOF
533
540
534 $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
541 $ hg --config ui.clonebundleprefers=extra=b clone -U http://localhost:$HGPORT prefer-partially-defined-attribute
535 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
542 applying clone bundle from http://localhost:$HGPORT1/gz-b.hg
536 adding changesets
543 adding changesets
537 adding manifests
544 adding manifests
538 adding file changes
545 adding file changes
539 added 2 changesets with 2 changes to 2 files
546 added 2 changesets with 2 changes to 2 files
540 finished applying clone bundle
547 finished applying clone bundle
541 searching for changes
548 searching for changes
542 no changes found
549 no changes found
543 2 local changesets published
550 2 local changesets published
544
551
545 Test a bad attribute list
552 Test a bad attribute list
546
553
547 $ hg --config ui.clonebundleprefers=bad clone -U http://localhost:$HGPORT bad-input
554 $ hg --config ui.clonebundleprefers=bad clone -U http://localhost:$HGPORT bad-input
548 abort: invalid ui.clonebundleprefers item: bad
555 abort: invalid ui.clonebundleprefers item: bad
549 (each comma separated item should be key=value pairs)
556 (each comma separated item should be key=value pairs)
550 [255]
557 [255]
551 $ hg --config ui.clonebundleprefers=key=val,bad,key2=val2 clone \
558 $ hg --config ui.clonebundleprefers=key=val,bad,key2=val2 clone \
552 > -U http://localhost:$HGPORT bad-input
559 > -U http://localhost:$HGPORT bad-input
553 abort: invalid ui.clonebundleprefers item: bad
560 abort: invalid ui.clonebundleprefers item: bad
554 (each comma separated item should be key=value pairs)
561 (each comma separated item should be key=value pairs)
555 [255]
562 [255]
556
563
557
564
558 Test interaction between clone bundles and --stream
565 Test interaction between clone bundles and --stream
559
566
560 A manifest with just a gzip bundle
567 A manifest with just a gzip bundle
561
568
562 $ cat > server/.hg/clonebundles.manifest << EOF
569 $ cat > server/.hg/clonebundles.manifest << EOF
563 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
570 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
564 > EOF
571 > EOF
565
572
566 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip
573 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip
567 no compatible clone bundles available on server; falling back to regular clone
574 no compatible clone bundles available on server; falling back to regular clone
568 (you may want to report this to the server operator)
575 (you may want to report this to the server operator)
569 streaming all changes
576 streaming all changes
570 9 files to transfer, 816 bytes of data
577 10 files to transfer, 816 bytes of data (no-rust !)
571 transferred 816 bytes in * seconds (*) (glob)
578 transferred 816 bytes in * seconds (*) (glob) (no-rust !)
579 12 files to transfer, 942 bytes of data (rust !)
580 transferred 942 bytes in *.* seconds (*) (glob) (rust !)
572
581
573 A manifest with a stream clone but no BUNDLESPEC
582 A manifest with a stream clone but no BUNDLESPEC
574
583
575 $ cat > server/.hg/clonebundles.manifest << EOF
584 $ cat > server/.hg/clonebundles.manifest << EOF
576 > http://localhost:$HGPORT1/packed.hg
585 > http://localhost:$HGPORT1/packed.hg
577 > EOF
586 > EOF
578
587
579 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-no-bundlespec
588 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-no-bundlespec
580 no compatible clone bundles available on server; falling back to regular clone
589 no compatible clone bundles available on server; falling back to regular clone
581 (you may want to report this to the server operator)
590 (you may want to report this to the server operator)
582 streaming all changes
591 streaming all changes
583 9 files to transfer, 816 bytes of data
592 10 files to transfer, 816 bytes of data (no-rust !)
584 transferred 816 bytes in * seconds (*) (glob)
593 transferred 816 bytes in * seconds (*) (glob) (no-rust !)
594 12 files to transfer, 942 bytes of data (rust !)
595 transferred 942 bytes in *.* seconds (*) (glob) (rust !)
585
596
586 A manifest with a gzip bundle and a stream clone
597 A manifest with a gzip bundle and a stream clone
587
598
588 $ cat > server/.hg/clonebundles.manifest << EOF
599 $ cat > server/.hg/clonebundles.manifest << EOF
589 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
600 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
590 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
601 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1
591 > EOF
602 > EOF
592
603
593 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed
604 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed
594 applying clone bundle from http://localhost:$HGPORT1/packed.hg
605 applying clone bundle from http://localhost:$HGPORT1/packed.hg
595 4 files to transfer, 613 bytes of data
606 5 files to transfer, 613 bytes of data (no-rust !)
596 transferred 613 bytes in * seconds (*) (glob)
607 transferred 613 bytes in *.* seconds (*) (glob) (no-rust !)
608 7 files to transfer, 739 bytes of data (rust !)
609 transferred 739 bytes in *.* seconds (*) (glob) (rust !)
597 finished applying clone bundle
610 finished applying clone bundle
598 searching for changes
611 searching for changes
599 no changes found
612 no changes found
600
613
601 A manifest with a gzip bundle and stream clone with supported requirements
614 A manifest with a gzip bundle and stream clone with supported requirements
602
615
603 $ cat > server/.hg/clonebundles.manifest << EOF
616 $ cat > server/.hg/clonebundles.manifest << EOF
604 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
617 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
605 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
618 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv1
606 > EOF
619 > EOF
607
620
608 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-requirements
621 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-requirements
609 applying clone bundle from http://localhost:$HGPORT1/packed.hg
622 applying clone bundle from http://localhost:$HGPORT1/packed.hg
610 4 files to transfer, 613 bytes of data
623 5 files to transfer, 613 bytes of data (no-rust !)
611 transferred 613 bytes in * seconds (*) (glob)
624 transferred 613 bytes in *.* seconds (*) (glob) (no-rust !)
625 7 files to transfer, 739 bytes of data (rust !)
626 transferred 739 bytes in *.* seconds (*) (glob) (rust !)
612 finished applying clone bundle
627 finished applying clone bundle
613 searching for changes
628 searching for changes
614 no changes found
629 no changes found
615
630
616 A manifest with a gzip bundle and a stream clone with unsupported requirements
631 A manifest with a gzip bundle and a stream clone with unsupported requirements
617
632
618 $ cat > server/.hg/clonebundles.manifest << EOF
633 $ cat > server/.hg/clonebundles.manifest << EOF
619 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
634 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2
620 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
635 > http://localhost:$HGPORT1/packed.hg BUNDLESPEC=none-packed1;requirements%3Drevlogv42
621 > EOF
636 > EOF
622
637
623 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-unsupported-requirements
638 $ hg clone -U --stream http://localhost:$HGPORT uncompressed-gzip-packed-unsupported-requirements
624 no compatible clone bundles available on server; falling back to regular clone
639 no compatible clone bundles available on server; falling back to regular clone
625 (you may want to report this to the server operator)
640 (you may want to report this to the server operator)
626 streaming all changes
641 streaming all changes
627 9 files to transfer, 816 bytes of data
642 10 files to transfer, 816 bytes of data (no-rust !)
628 transferred 816 bytes in * seconds (*) (glob)
643 transferred 816 bytes in * seconds (*) (glob) (no-rust !)
644 12 files to transfer, 942 bytes of data (rust !)
645 transferred 942 bytes in *.* seconds (*) (glob) (rust !)
629
646
630 Test clone bundle retrieved through bundle2
647 Test clone bundle retrieved through bundle2
631
648
632 $ cat << EOF >> $HGRCPATH
649 $ cat << EOF >> $HGRCPATH
633 > [extensions]
650 > [extensions]
634 > largefiles=
651 > largefiles=
635 > EOF
652 > EOF
636 $ killdaemons.py
653 $ killdaemons.py
637 $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
654 $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
638 $ cat hg.pid >> $DAEMON_PIDS
655 $ cat hg.pid >> $DAEMON_PIDS
639
656
640 $ hg -R server debuglfput gz-a.hg
657 $ hg -R server debuglfput gz-a.hg
641 1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae
658 1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae
642
659
643 $ cat > server/.hg/clonebundles.manifest << EOF
660 $ cat > server/.hg/clonebundles.manifest << EOF
644 > largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae BUNDLESPEC=gzip-v2
661 > largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae BUNDLESPEC=gzip-v2
645 > EOF
662 > EOF
646
663
647 $ hg clone -U http://localhost:$HGPORT largefile-provided --traceback
664 $ hg clone -U http://localhost:$HGPORT largefile-provided --traceback
648 applying clone bundle from largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae
665 applying clone bundle from largefile://1f74b3d08286b9b3a16fb3fa185dd29219cbc6ae
649 adding changesets
666 adding changesets
650 adding manifests
667 adding manifests
651 adding file changes
668 adding file changes
652 added 2 changesets with 2 changes to 2 files
669 added 2 changesets with 2 changes to 2 files
653 finished applying clone bundle
670 finished applying clone bundle
654 searching for changes
671 searching for changes
655 no changes found
672 no changes found
656 2 local changesets published
673 2 local changesets published
657 $ killdaemons.py
674 $ killdaemons.py
658
675
659 A manifest with a gzip bundle requiring too much memory for a 16MB system and working
676 A manifest with a gzip bundle requiring too much memory for a 16MB system and working
660 on a 32MB system.
677 on a 32MB system.
661
678
662 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
679 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
663 $ cat http.pid >> $DAEMON_PIDS
680 $ cat http.pid >> $DAEMON_PIDS
664 $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
681 $ hg -R server serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
665 $ cat hg.pid >> $DAEMON_PIDS
682 $ cat hg.pid >> $DAEMON_PIDS
666
683
667 $ cat > server/.hg/clonebundles.manifest << EOF
684 $ cat > server/.hg/clonebundles.manifest << EOF
668 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 REQUIREDRAM=12MB
685 > http://localhost:$HGPORT1/gz-a.hg BUNDLESPEC=gzip-v2 REQUIREDRAM=12MB
669 > EOF
686 > EOF
670
687
671 $ hg clone -U --debug --config ui.available-memory=16MB http://localhost:$HGPORT gzip-too-large
688 $ hg clone -U --debug --config ui.available-memory=16MB http://localhost:$HGPORT gzip-too-large
672 using http://localhost:$HGPORT/
689 using http://localhost:$HGPORT/
673 sending capabilities command
690 sending capabilities command
674 sending clonebundles_manifest command
691 sending clonebundles_manifest command
675 filtering http://localhost:$HGPORT1/gz-a.hg as it needs more than 2/3 of system memory
692 filtering http://localhost:$HGPORT1/gz-a.hg as it needs more than 2/3 of system memory
676 no compatible clone bundles available on server; falling back to regular clone
693 no compatible clone bundles available on server; falling back to regular clone
677 (you may want to report this to the server operator)
694 (you may want to report this to the server operator)
678 query 1; heads
695 query 1; heads
679 sending batch command
696 sending batch command
680 requesting all changes
697 requesting all changes
681 sending getbundle command
698 sending getbundle command
682 bundle2-input-bundle: with-transaction
699 bundle2-input-bundle: with-transaction
683 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
700 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
684 adding changesets
701 adding changesets
685 add changeset 53245c60e682
702 add changeset 53245c60e682
686 add changeset aaff8d2ffbbf
703 add changeset aaff8d2ffbbf
687 adding manifests
704 adding manifests
688 adding file changes
705 adding file changes
689 adding bar revisions
706 adding bar revisions
690 adding foo revisions
707 adding foo revisions
691 bundle2-input-part: total payload size 936
708 bundle2-input-part: total payload size 936
692 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
709 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
693 bundle2-input-part: "phase-heads" supported
710 bundle2-input-part: "phase-heads" supported
694 bundle2-input-part: total payload size 24
711 bundle2-input-part: total payload size 24
695 bundle2-input-bundle: 3 parts total
712 bundle2-input-bundle: 3 parts total
696 checking for updated bookmarks
713 checking for updated bookmarks
697 updating the branch cache
714 updating the branch cache
698 added 2 changesets with 2 changes to 2 files
715 added 2 changesets with 2 changes to 2 files
699 new changesets 53245c60e682:aaff8d2ffbbf
716 new changesets 53245c60e682:aaff8d2ffbbf
700 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
717 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
701 updating the branch cache
718 updating the branch cache
702 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
719 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
703
720
704 $ hg clone -U --debug --config ui.available-memory=32MB http://localhost:$HGPORT gzip-too-large2
721 $ hg clone -U --debug --config ui.available-memory=32MB http://localhost:$HGPORT gzip-too-large2
705 using http://localhost:$HGPORT/
722 using http://localhost:$HGPORT/
706 sending capabilities command
723 sending capabilities command
707 sending clonebundles_manifest command
724 sending clonebundles_manifest command
708 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
725 applying clone bundle from http://localhost:$HGPORT1/gz-a.hg
709 bundle2-input-bundle: 1 params with-transaction
726 bundle2-input-bundle: 1 params with-transaction
710 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
727 bundle2-input-part: "changegroup" (params: 1 mandatory 1 advisory) supported
711 adding changesets
728 adding changesets
712 add changeset 53245c60e682
729 add changeset 53245c60e682
713 add changeset aaff8d2ffbbf
730 add changeset aaff8d2ffbbf
714 adding manifests
731 adding manifests
715 adding file changes
732 adding file changes
716 adding bar revisions
733 adding bar revisions
717 adding foo revisions
734 adding foo revisions
718 bundle2-input-part: total payload size 920
735 bundle2-input-part: total payload size 920
719 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
736 bundle2-input-part: "cache:rev-branch-cache" (advisory) supported
720 bundle2-input-part: total payload size 59
737 bundle2-input-part: total payload size 59
721 bundle2-input-bundle: 2 parts total
738 bundle2-input-bundle: 2 parts total
722 updating the branch cache
739 updating the branch cache
723 added 2 changesets with 2 changes to 2 files
740 added 2 changesets with 2 changes to 2 files
724 finished applying clone bundle
741 finished applying clone bundle
725 query 1; heads
742 query 1; heads
726 sending batch command
743 sending batch command
727 searching for changes
744 searching for changes
728 all remote heads known locally
745 all remote heads known locally
729 no changes found
746 no changes found
730 sending getbundle command
747 sending getbundle command
731 bundle2-input-bundle: with-transaction
748 bundle2-input-bundle: with-transaction
732 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
749 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
733 bundle2-input-part: "phase-heads" supported
750 bundle2-input-part: "phase-heads" supported
734 bundle2-input-part: total payload size 24
751 bundle2-input-part: total payload size 24
735 bundle2-input-bundle: 2 parts total
752 bundle2-input-bundle: 2 parts total
736 checking for updated bookmarks
753 checking for updated bookmarks
737 2 local changesets published
754 2 local changesets published
738 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
755 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
739 updating the branch cache
756 updating the branch cache
740 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
757 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
741 $ killdaemons.py
758 $ killdaemons.py
742
759
743 Testing a clone bundles that involves revlog splitting (issue6811)
760 Testing a clone bundles that involves revlog splitting (issue6811)
744 ==================================================================
761 ==================================================================
745
762
746 $ cat >> $HGRCPATH << EOF
763 $ cat >> $HGRCPATH << EOF
747 > [format]
764 > [format]
748 > revlog-compression=none
765 > revlog-compression=none
749 > use-persistent-nodemap=no
766 > use-persistent-nodemap=no
750 > EOF
767 > EOF
751
768
752 $ hg init server-revlog-split/
769 $ hg init server-revlog-split/
753 $ cd server-revlog-split
770 $ cd server-revlog-split
754 $ cat >> .hg/hgrc << EOF
771 $ cat >> .hg/hgrc << EOF
755 > [extensions]
772 > [extensions]
756 > clonebundles =
773 > clonebundles =
757 > EOF
774 > EOF
758 $ echo foo > A
775 $ echo foo > A
759 $ hg add A
776 $ hg add A
760 $ hg commit -m 'initial commit'
777 $ hg commit -m 'initial commit'
761 IMPORTANT: the revlogs must not be split
778 IMPORTANT: the revlogs must not be split
762 $ ls -1 .hg/store/00manifest.*
779 $ ls -1 .hg/store/00manifest.*
763 .hg/store/00manifest.i
780 .hg/store/00manifest.i
764 $ ls -1 .hg/store/data/_a.*
781 $ ls -1 .hg/store/data/_a.*
765 .hg/store/data/_a.i
782 .hg/store/data/_a.i
766
783
767 do big enough update to split the revlogs
784 do big enough update to split the revlogs
768
785
769 $ $TESTDIR/seq.py 100000 > A
786 $ $TESTDIR/seq.py 100000 > A
770 $ mkdir foo
787 $ mkdir foo
771 $ cd foo
788 $ cd foo
772 $ touch `$TESTDIR/seq.py 10000`
789 $ touch `$TESTDIR/seq.py 10000`
773 $ cd ..
790 $ cd ..
774 $ hg add -q foo
791 $ hg add -q foo
775 $ hg commit -m 'split the manifest and one filelog'
792 $ hg commit -m 'split the manifest and one filelog'
776
793
777 IMPORTANT: now the revlogs must be split
794 IMPORTANT: now the revlogs must be split
778 $ ls -1 .hg/store/00manifest.*
795 $ ls -1 .hg/store/00manifest.*
779 .hg/store/00manifest.d
796 .hg/store/00manifest.d
780 .hg/store/00manifest.i
797 .hg/store/00manifest.i
781 $ ls -1 .hg/store/data/_a.*
798 $ ls -1 .hg/store/data/_a.*
782 .hg/store/data/_a.d
799 .hg/store/data/_a.d
783 .hg/store/data/_a.i
800 .hg/store/data/_a.i
784
801
785 Add an extra commit on top of that
802 Add an extra commit on top of that
786
803
787 $ echo foo >> A
804 $ echo foo >> A
788 $ hg commit -m 'one extra commit'
805 $ hg commit -m 'one extra commit'
789
806
790 $ cd ..
807 $ cd ..
791
808
792 Do a bundle that contains the split, but not the update
809 Do a bundle that contains the split, but not the update
793
810
794 $ hg bundle --exact --rev '::(default~1)' -R server-revlog-split/ --type gzip-v2 split-test.hg
811 $ hg bundle --exact --rev '::(default~1)' -R server-revlog-split/ --type gzip-v2 split-test.hg
795 2 changesets found
812 2 changesets found
796
813
797 $ cat > server-revlog-split/.hg/clonebundles.manifest << EOF
814 $ cat > server-revlog-split/.hg/clonebundles.manifest << EOF
798 > http://localhost:$HGPORT1/split-test.hg BUNDLESPEC=gzip-v2
815 > http://localhost:$HGPORT1/split-test.hg BUNDLESPEC=gzip-v2
799 > EOF
816 > EOF
800
817
801 start the necessary server
818 start the necessary server
802
819
803 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
820 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
804 $ cat http.pid >> $DAEMON_PIDS
821 $ cat http.pid >> $DAEMON_PIDS
805 $ hg -R server-revlog-split serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
822 $ hg -R server-revlog-split serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
806 $ cat hg.pid >> $DAEMON_PIDS
823 $ cat hg.pid >> $DAEMON_PIDS
807
824
808 Check that clone works fine
825 Check that clone works fine
809 ===========================
826 ===========================
810
827
811 Here, the initial clone will trigger a revlog split (which is a bit clowny it
828 Here, the initial clone will trigger a revlog split (which is a bit clowny it
812 itself, but whatever). The split revlogs will see additionnal data added to
829 itself, but whatever). The split revlogs will see additionnal data added to
813 them in the subsequent pull. This should not be a problem
830 them in the subsequent pull. This should not be a problem
814
831
815 $ hg clone http://localhost:$HGPORT revlog-split-in-the-bundle
832 $ hg clone http://localhost:$HGPORT revlog-split-in-the-bundle
816 applying clone bundle from http://localhost:$HGPORT1/split-test.hg
833 applying clone bundle from http://localhost:$HGPORT1/split-test.hg
817 adding changesets
834 adding changesets
818 adding manifests
835 adding manifests
819 adding file changes
836 adding file changes
820 added 2 changesets with 10002 changes to 10001 files
837 added 2 changesets with 10002 changes to 10001 files
821 finished applying clone bundle
838 finished applying clone bundle
822 searching for changes
839 searching for changes
823 adding changesets
840 adding changesets
824 adding manifests
841 adding manifests
825 adding file changes
842 adding file changes
826 added 1 changesets with 1 changes to 1 files
843 added 1 changesets with 1 changes to 1 files
827 new changesets e3879eaa1db7
844 new changesets e3879eaa1db7
828 2 local changesets published
845 2 local changesets published
829 updating to branch default
846 updating to branch default
830 10001 files updated, 0 files merged, 0 files removed, 0 files unresolved
847 10001 files updated, 0 files merged, 0 files removed, 0 files unresolved
831
848
832 check the results
849 check the results
833
850
834 $ cd revlog-split-in-the-bundle
851 $ cd revlog-split-in-the-bundle
835 $ f --size .hg/store/00manifest.*
852 $ f --size .hg/store/00manifest.*
836 .hg/store/00manifest.d: size=499037
853 .hg/store/00manifest.d: size=499037
837 .hg/store/00manifest.i: size=192
854 .hg/store/00manifest.i: size=192
838 $ f --size .hg/store/data/_a.*
855 $ f --size .hg/store/data/_a.*
839 .hg/store/data/_a.d: size=588917
856 .hg/store/data/_a.d: size=588917
840 .hg/store/data/_a.i: size=192
857 .hg/store/data/_a.i: size=192
841
858
842 manifest should work
859 manifest should work
843
860
844 $ hg files -r tip | wc -l
861 $ hg files -r tip | wc -l
845 \s*10001 (re)
862 \s*10001 (re)
846
863
847 file content should work
864 file content should work
848
865
849 $ hg cat -r tip A | wc -l
866 $ hg cat -r tip A | wc -l
850 \s*100001 (re)
867 \s*100001 (re)
851
868
852
869
@@ -1,39 +1,39 b''
1 #require rust
1 #require rust
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [format]
4 > [format]
5 > use-dirstate-v2=1
5 > use-dirstate-v2=1
6 > [storage]
6 > [storage]
7 > dirstate-v2.slow-path=allow
7 > dirstate-v2.slow-path=allow
8 > EOF
8 > EOF
9
9
10 $ hg init t
10 $ hg init t
11 $ cd t
11 $ cd t
12
12
13 $ for i in 1 2 3 4 5 6 7 8 9 10; do touch foobar$i; done
13 $ for i in 1 2 3 4 5 6 7 8 9 10; do touch foobar$i; done
14 $ hg add .
14 $ hg add .
15 adding foobar1
15 adding foobar1
16 adding foobar10
16 adding foobar10
17 adding foobar2
17 adding foobar2
18 adding foobar3
18 adding foobar3
19 adding foobar4
19 adding foobar4
20 adding foobar5
20 adding foobar5
21 adding foobar6
21 adding foobar6
22 adding foobar7
22 adding foobar7
23 adding foobar8
23 adding foobar8
24 adding foobar9
24 adding foobar9
25 $ hg commit -m "1"
25 $ hg commit -m "1"
26
26
27 Check that there's no space leak on debugrebuilddirstate
27 Check that there's no space leak on debugrebuilddirstate
28
28
29 $ f --size .hg/dirstate*
29 $ f --size .hg/dirstate*
30 .hg/dirstate: size=133
30 .hg/dirstate: size=133
31 .hg/dirstate.b870a51b: size=511
32 $ hg debugrebuilddirstate
33 $ f --size .hg/dirstate*
34 .hg/dirstate: size=133
35 .hg/dirstate.88698448: size=511
31 .hg/dirstate.88698448: size=511
36 $ hg debugrebuilddirstate
32 $ hg debugrebuilddirstate
37 $ f --size .hg/dirstate*
33 $ f --size .hg/dirstate*
38 .hg/dirstate: size=133
34 .hg/dirstate: size=133
39 .hg/dirstate.6b8ab34b: size=511
35 .hg/dirstate.6b8ab34b: size=511
36 $ hg debugrebuilddirstate
37 $ f --size .hg/dirstate*
38 .hg/dirstate: size=133
39 .hg/dirstate.b875dfc5: size=511
@@ -1,818 +1,818 b''
1 $ cat << EOF >> $HGRCPATH
1 $ cat << EOF >> $HGRCPATH
2 > [ui]
2 > [ui]
3 > interactive=yes
3 > interactive=yes
4 > EOF
4 > EOF
5
5
6 $ hg init debugrevlog
6 $ hg init debugrevlog
7 $ cd debugrevlog
7 $ cd debugrevlog
8 $ echo a > a
8 $ echo a > a
9 $ hg ci -Am adda
9 $ hg ci -Am adda
10 adding a
10 adding a
11 $ hg rm .
11 $ hg rm .
12 removing a
12 removing a
13 $ hg ci -Am make-it-empty
13 $ hg ci -Am make-it-empty
14 $ hg revert --all -r 0
14 $ hg revert --all -r 0
15 adding a
15 adding a
16 $ hg ci -Am make-it-full
16 $ hg ci -Am make-it-full
17 #if reporevlogstore
17 #if reporevlogstore
18 $ hg debugrevlog -c
18 $ hg debugrevlog -c
19 format : 1
19 format : 1
20 flags : inline
20 flags : (none)
21
21
22 revisions : 3
22 revisions : 3
23 merges : 0 ( 0.00%)
23 merges : 0 ( 0.00%)
24 normal : 3 (100.00%)
24 normal : 3 (100.00%)
25 revisions : 3
25 revisions : 3
26 empty : 0 ( 0.00%)
26 empty : 0 ( 0.00%)
27 text : 0 (100.00%)
27 text : 0 (100.00%)
28 delta : 0 (100.00%)
28 delta : 0 (100.00%)
29 snapshot : 3 (100.00%)
29 snapshot : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
30 lvl-0 : 3 (100.00%)
31 deltas : 0 ( 0.00%)
31 deltas : 0 ( 0.00%)
32 revision size : 191
32 revision size : 191
33 snapshot : 191 (100.00%)
33 snapshot : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
34 lvl-0 : 191 (100.00%)
35 deltas : 0 ( 0.00%)
35 deltas : 0 ( 0.00%)
36
36
37 chunks : 3
37 chunks : 3
38 0x75 (u) : 3 (100.00%)
38 0x75 (u) : 3 (100.00%)
39 chunks size : 191
39 chunks size : 191
40 0x75 (u) : 191 (100.00%)
40 0x75 (u) : 191 (100.00%)
41
41
42
42
43 total-stored-content: 188 bytes
43 total-stored-content: 188 bytes
44
44
45 avg chain length : 0
45 avg chain length : 0
46 max chain length : 0
46 max chain length : 0
47 max chain reach : 67
47 max chain reach : 67
48 compression ratio : 0
48 compression ratio : 0
49
49
50 uncompressed data size (min/max/avg) : 57 / 66 / 62
50 uncompressed data size (min/max/avg) : 57 / 66 / 62
51 full revision size (min/max/avg) : 58 / 67 / 63
51 full revision size (min/max/avg) : 58 / 67 / 63
52 inter-snapshot size (min/max/avg) : 0 / 0 / 0
52 inter-snapshot size (min/max/avg) : 0 / 0 / 0
53 delta size (min/max/avg) : 0 / 0 / 0
53 delta size (min/max/avg) : 0 / 0 / 0
54 $ hg debugrevlog -m
54 $ hg debugrevlog -m
55 format : 1
55 format : 1
56 flags : inline, generaldelta
56 flags : inline, generaldelta
57
57
58 revisions : 3
58 revisions : 3
59 merges : 0 ( 0.00%)
59 merges : 0 ( 0.00%)
60 normal : 3 (100.00%)
60 normal : 3 (100.00%)
61 revisions : 3
61 revisions : 3
62 empty : 1 (33.33%)
62 empty : 1 (33.33%)
63 text : 1 (100.00%)
63 text : 1 (100.00%)
64 delta : 0 ( 0.00%)
64 delta : 0 ( 0.00%)
65 snapshot : 2 (66.67%)
65 snapshot : 2 (66.67%)
66 lvl-0 : 2 (66.67%)
66 lvl-0 : 2 (66.67%)
67 deltas : 0 ( 0.00%)
67 deltas : 0 ( 0.00%)
68 revision size : 88
68 revision size : 88
69 snapshot : 88 (100.00%)
69 snapshot : 88 (100.00%)
70 lvl-0 : 88 (100.00%)
70 lvl-0 : 88 (100.00%)
71 deltas : 0 ( 0.00%)
71 deltas : 0 ( 0.00%)
72
72
73 chunks : 3
73 chunks : 3
74 empty : 1 (33.33%)
74 empty : 1 (33.33%)
75 0x75 (u) : 2 (66.67%)
75 0x75 (u) : 2 (66.67%)
76 chunks size : 88
76 chunks size : 88
77 empty : 0 ( 0.00%)
77 empty : 0 ( 0.00%)
78 0x75 (u) : 88 (100.00%)
78 0x75 (u) : 88 (100.00%)
79
79
80
80
81 total-stored-content: 86 bytes
81 total-stored-content: 86 bytes
82
82
83 avg chain length : 0
83 avg chain length : 0
84 max chain length : 0
84 max chain length : 0
85 max chain reach : 44
85 max chain reach : 44
86 compression ratio : 0
86 compression ratio : 0
87
87
88 uncompressed data size (min/max/avg) : 0 / 43 / 28
88 uncompressed data size (min/max/avg) : 0 / 43 / 28
89 full revision size (min/max/avg) : 44 / 44 / 44
89 full revision size (min/max/avg) : 44 / 44 / 44
90 inter-snapshot size (min/max/avg) : 0 / 0 / 0
90 inter-snapshot size (min/max/avg) : 0 / 0 / 0
91 delta size (min/max/avg) : 0 / 0 / 0
91 delta size (min/max/avg) : 0 / 0 / 0
92 $ hg debugrevlog a
92 $ hg debugrevlog a
93 format : 1
93 format : 1
94 flags : inline, generaldelta
94 flags : inline, generaldelta
95
95
96 revisions : 1
96 revisions : 1
97 merges : 0 ( 0.00%)
97 merges : 0 ( 0.00%)
98 normal : 1 (100.00%)
98 normal : 1 (100.00%)
99 revisions : 1
99 revisions : 1
100 empty : 0 ( 0.00%)
100 empty : 0 ( 0.00%)
101 text : 0 (100.00%)
101 text : 0 (100.00%)
102 delta : 0 (100.00%)
102 delta : 0 (100.00%)
103 snapshot : 1 (100.00%)
103 snapshot : 1 (100.00%)
104 lvl-0 : 1 (100.00%)
104 lvl-0 : 1 (100.00%)
105 deltas : 0 ( 0.00%)
105 deltas : 0 ( 0.00%)
106 revision size : 3
106 revision size : 3
107 snapshot : 3 (100.00%)
107 snapshot : 3 (100.00%)
108 lvl-0 : 3 (100.00%)
108 lvl-0 : 3 (100.00%)
109 deltas : 0 ( 0.00%)
109 deltas : 0 ( 0.00%)
110
110
111 chunks : 1
111 chunks : 1
112 0x75 (u) : 1 (100.00%)
112 0x75 (u) : 1 (100.00%)
113 chunks size : 3
113 chunks size : 3
114 0x75 (u) : 3 (100.00%)
114 0x75 (u) : 3 (100.00%)
115
115
116
116
117 total-stored-content: 2 bytes
117 total-stored-content: 2 bytes
118
118
119 avg chain length : 0
119 avg chain length : 0
120 max chain length : 0
120 max chain length : 0
121 max chain reach : 3
121 max chain reach : 3
122 compression ratio : 0
122 compression ratio : 0
123
123
124 uncompressed data size (min/max/avg) : 2 / 2 / 2
124 uncompressed data size (min/max/avg) : 2 / 2 / 2
125 full revision size (min/max/avg) : 3 / 3 / 3
125 full revision size (min/max/avg) : 3 / 3 / 3
126 inter-snapshot size (min/max/avg) : 0 / 0 / 0
126 inter-snapshot size (min/max/avg) : 0 / 0 / 0
127 delta size (min/max/avg) : 0 / 0 / 0
127 delta size (min/max/avg) : 0 / 0 / 0
128 #endif
128 #endif
129
129
130 Test debugindex, with and without the --verbose/--debug flag
130 Test debugindex, with and without the --verbose/--debug flag
131 $ hg debugrevlogindex a
131 $ hg debugrevlogindex a
132 rev linkrev nodeid p1 p2
132 rev linkrev nodeid p1 p2
133 0 0 b789fdd96dc2 000000000000 000000000000
133 0 0 b789fdd96dc2 000000000000 000000000000
134
134
135 #if no-reposimplestore
135 #if no-reposimplestore
136 $ hg --verbose debugrevlogindex a
136 $ hg --verbose debugrevlogindex a
137 rev offset length linkrev nodeid p1 p2
137 rev offset length linkrev nodeid p1 p2
138 0 0 3 0 b789fdd96dc2 000000000000 000000000000
138 0 0 3 0 b789fdd96dc2 000000000000 000000000000
139
139
140 $ hg --debug debugrevlogindex a
140 $ hg --debug debugrevlogindex a
141 rev offset length linkrev nodeid p1 p2
141 rev offset length linkrev nodeid p1 p2
142 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
142 0 0 3 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000
143 #endif
143 #endif
144
144
145 $ hg debugrevlogindex -f 1 a
145 $ hg debugrevlogindex -f 1 a
146 rev flag size link p1 p2 nodeid
146 rev flag size link p1 p2 nodeid
147 0 0000 2 0 -1 -1 b789fdd96dc2
147 0 0000 2 0 -1 -1 b789fdd96dc2
148
148
149 #if no-reposimplestore
149 #if no-reposimplestore
150 $ hg --verbose debugrevlogindex -f 1 a
150 $ hg --verbose debugrevlogindex -f 1 a
151 rev flag offset length size link p1 p2 nodeid
151 rev flag offset length size link p1 p2 nodeid
152 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
152 0 0000 0 3 2 0 -1 -1 b789fdd96dc2
153
153
154 $ hg --debug debugrevlogindex -f 1 a
154 $ hg --debug debugrevlogindex -f 1 a
155 rev flag offset length size link p1 p2 nodeid
155 rev flag offset length size link p1 p2 nodeid
156 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
156 0 0000 0 3 2 0 -1 -1 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3
157 #endif
157 #endif
158
158
159 $ hg debugindex -c
159 $ hg debugindex -c
160 rev linkrev nodeid p1-nodeid p2-nodeid
160 rev linkrev nodeid p1-nodeid p2-nodeid
161 0 0 07f494440405 000000000000 000000000000
161 0 0 07f494440405 000000000000 000000000000
162 1 1 8cccb4b5fec2 07f494440405 000000000000
162 1 1 8cccb4b5fec2 07f494440405 000000000000
163 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
163 2 2 b1e228c512c5 8cccb4b5fec2 000000000000
164 $ hg debugindex -c --debug
164 $ hg debugindex -c --debug
165 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
165 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
166 0 -1 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 57 0 0 2 0 58 inline 0 0
166 0 -1 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 57 0 0 2 0 58 inline 0 0
167 1 -1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 66 1 0 2 58 67 inline 0 0
167 1 -1 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a 0 07f4944404050f47db2e5c5071e0e84e7a27bba9 -1 0000000000000000000000000000000000000000 66 1 0 2 58 67 inline 0 0
168 2 -1 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a -1 0000000000000000000000000000000000000000 65 2 0 2 125 66 inline 0 0
168 2 -1 2 b1e228c512c5d7066d70562ed839c3323a62d6d2 1 8cccb4b5fec20cafeb99dd01c26d4dee8ea4388a -1 0000000000000000000000000000000000000000 65 2 0 2 125 66 inline 0 0
169 $ hg debugindex -m
169 $ hg debugindex -m
170 rev linkrev nodeid p1-nodeid p2-nodeid
170 rev linkrev nodeid p1-nodeid p2-nodeid
171 0 0 a0c8bcbbb45c 000000000000 000000000000
171 0 0 a0c8bcbbb45c 000000000000 000000000000
172 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
172 1 1 57faf8a737ae a0c8bcbbb45c 000000000000
173 2 2 a35b10320954 57faf8a737ae 000000000000
173 2 2 a35b10320954 57faf8a737ae 000000000000
174 $ hg debugindex -m --debug
174 $ hg debugindex -m --debug
175 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
175 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
176 0 -1 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 43 0 0 2 0 44 inline 0 0
176 0 -1 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 43 0 0 2 0 44 inline 0 0
177 1 -1 1 57faf8a737ae7faf490582941a82319ba6529dca 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 0 1 0 2 44 0 inline 0 0
177 1 -1 1 57faf8a737ae7faf490582941a82319ba6529dca 0 a0c8bcbbb45c63b90b70ad007bf38961f64f2af0 -1 0000000000000000000000000000000000000000 0 1 0 2 44 0 inline 0 0
178 2 -1 2 a35b103209548032201c16c7688cb2657f037a38 1 57faf8a737ae7faf490582941a82319ba6529dca -1 0000000000000000000000000000000000000000 43 2 0 2 44 44 inline 0 0
178 2 -1 2 a35b103209548032201c16c7688cb2657f037a38 1 57faf8a737ae7faf490582941a82319ba6529dca -1 0000000000000000000000000000000000000000 43 2 0 2 44 44 inline 0 0
179 $ hg debugindex a
179 $ hg debugindex a
180 rev linkrev nodeid p1-nodeid p2-nodeid
180 rev linkrev nodeid p1-nodeid p2-nodeid
181 0 0 b789fdd96dc2 000000000000 000000000000
181 0 0 b789fdd96dc2 000000000000 000000000000
182 $ hg debugindex --debug a
182 $ hg debugindex --debug a
183 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
183 rev rank linkrev nodeid p1-rev p1-nodeid p2-rev p2-nodeid full-size delta-base flags comp-mode data-offset chunk-size sd-comp-mode sidedata-offset sd-chunk-size
184 0 -1 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 2 0 0 2 0 3 inline 0 0
184 0 -1 0 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 -1 0000000000000000000000000000000000000000 -1 0000000000000000000000000000000000000000 2 0 0 2 0 3 inline 0 0
185
185
186 debugdelta chain basic output
186 debugdelta chain basic output
187
187
188 #if reporevlogstore pure
188 #if reporevlogstore pure
189 $ hg debugindexstats
189 $ hg debugindexstats
190 abort: debugindexstats only works with native code
190 abort: debugindexstats only works with native code
191 [255]
191 [255]
192 #endif
192 #endif
193 #if reporevlogstore no-pure
193 #if reporevlogstore no-pure
194 $ hg debugindexstats
194 $ hg debugindexstats
195 node trie capacity: 4
195 node trie capacity: 4
196 node trie count: 2
196 node trie count: 2
197 node trie depth: 1
197 node trie depth: 1
198 node trie last rev scanned: -1 (no-rust !)
198 node trie last rev scanned: -1 (no-rust !)
199 node trie last rev scanned: 3 (rust !)
199 node trie last rev scanned: 3 (rust !)
200 node trie lookups: 4 (no-rust !)
200 node trie lookups: 4 (no-rust !)
201 node trie lookups: 2 (rust !)
201 node trie lookups: 2 (rust !)
202 node trie misses: 1
202 node trie misses: 1
203 node trie splits: 1
203 node trie splits: 1
204 revs in memory: 3
204 revs in memory: 3
205 #endif
205 #endif
206
206
207 #if reporevlogstore no-pure
207 #if reporevlogstore no-pure
208 $ hg debugdeltachain -m --all-info
208 $ hg debugdeltachain -m --all-info
209 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
209 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
210 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
210 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
211 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
211 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
212 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
212 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
213
213
214 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
214 $ hg debugdeltachain -m -T '{rev} {chainid} {chainlen}\n'
215 0 1 1
215 0 1 1
216 1 2 1
216 1 2 1
217 2 3 1
217 2 3 1
218
218
219 $ hg debugdeltachain -m -Tjson --size-info
219 $ hg debugdeltachain -m -Tjson --size-info
220 [
220 [
221 {
221 {
222 "chainid": 1,
222 "chainid": 1,
223 "chainlen": 1,
223 "chainlen": 1,
224 "chainratio": 1.0232558139534884,
224 "chainratio": 1.0232558139534884,
225 "chainsize": 44,
225 "chainsize": 44,
226 "compsize": 44,
226 "compsize": 44,
227 "deltatype": "base",
227 "deltatype": "base",
228 "p1": -1,
228 "p1": -1,
229 "p2": -1,
229 "p2": -1,
230 "prevrev": -1,
230 "prevrev": -1,
231 "rev": 0,
231 "rev": 0,
232 "uncompsize": 43
232 "uncompsize": 43
233 },
233 },
234 {
234 {
235 "chainid": 2,
235 "chainid": 2,
236 "chainlen": 1,
236 "chainlen": 1,
237 "chainratio": 0,
237 "chainratio": 0,
238 "chainsize": 0,
238 "chainsize": 0,
239 "compsize": 0,
239 "compsize": 0,
240 "deltatype": "base",
240 "deltatype": "base",
241 "p1": 0,
241 "p1": 0,
242 "p2": -1,
242 "p2": -1,
243 "prevrev": -1,
243 "prevrev": -1,
244 "rev": 1,
244 "rev": 1,
245 "uncompsize": 0
245 "uncompsize": 0
246 },
246 },
247 {
247 {
248 "chainid": 3,
248 "chainid": 3,
249 "chainlen": 1,
249 "chainlen": 1,
250 "chainratio": 1.0232558139534884,
250 "chainratio": 1.0232558139534884,
251 "chainsize": 44,
251 "chainsize": 44,
252 "compsize": 44,
252 "compsize": 44,
253 "deltatype": "base",
253 "deltatype": "base",
254 "p1": 1,
254 "p1": 1,
255 "p2": -1,
255 "p2": -1,
256 "prevrev": -1,
256 "prevrev": -1,
257 "rev": 2,
257 "rev": 2,
258 "uncompsize": 43
258 "uncompsize": 43
259 }
259 }
260 ]
260 ]
261
261
262 $ hg debugdeltachain -m -Tjson --all-info
262 $ hg debugdeltachain -m -Tjson --all-info
263 [
263 [
264 {
264 {
265 "chainid": 1,
265 "chainid": 1,
266 "chainlen": 1,
266 "chainlen": 1,
267 "chainratio": 1.0232558139534884,
267 "chainratio": 1.0232558139534884,
268 "chainsize": 44,
268 "chainsize": 44,
269 "compsize": 44,
269 "compsize": 44,
270 "deltatype": "base",
270 "deltatype": "base",
271 "extradist": 0,
271 "extradist": 0,
272 "extraratio": 0.0,
272 "extraratio": 0.0,
273 "largestblock": 44,
273 "largestblock": 44,
274 "lindist": 44,
274 "lindist": 44,
275 "p1": -1,
275 "p1": -1,
276 "p2": -1,
276 "p2": -1,
277 "prevrev": -1,
277 "prevrev": -1,
278 "readdensity": 1.0,
278 "readdensity": 1.0,
279 "readsize": 44,
279 "readsize": 44,
280 "rev": 0,
280 "rev": 0,
281 "srchunks": 1,
281 "srchunks": 1,
282 "uncompsize": 43
282 "uncompsize": 43
283 },
283 },
284 {
284 {
285 "chainid": 2,
285 "chainid": 2,
286 "chainlen": 1,
286 "chainlen": 1,
287 "chainratio": 0,
287 "chainratio": 0,
288 "chainsize": 0,
288 "chainsize": 0,
289 "compsize": 0,
289 "compsize": 0,
290 "deltatype": "base",
290 "deltatype": "base",
291 "extradist": 0,
291 "extradist": 0,
292 "extraratio": 0,
292 "extraratio": 0,
293 "largestblock": 0,
293 "largestblock": 0,
294 "lindist": 0,
294 "lindist": 0,
295 "p1": 0,
295 "p1": 0,
296 "p2": -1,
296 "p2": -1,
297 "prevrev": -1,
297 "prevrev": -1,
298 "readdensity": 1,
298 "readdensity": 1,
299 "readsize": 0,
299 "readsize": 0,
300 "rev": 1,
300 "rev": 1,
301 "srchunks": 1,
301 "srchunks": 1,
302 "uncompsize": 0
302 "uncompsize": 0
303 },
303 },
304 {
304 {
305 "chainid": 3,
305 "chainid": 3,
306 "chainlen": 1,
306 "chainlen": 1,
307 "chainratio": 1.0232558139534884,
307 "chainratio": 1.0232558139534884,
308 "chainsize": 44,
308 "chainsize": 44,
309 "compsize": 44,
309 "compsize": 44,
310 "deltatype": "base",
310 "deltatype": "base",
311 "extradist": 0,
311 "extradist": 0,
312 "extraratio": 0.0,
312 "extraratio": 0.0,
313 "largestblock": 44,
313 "largestblock": 44,
314 "lindist": 44,
314 "lindist": 44,
315 "p1": 1,
315 "p1": 1,
316 "p2": -1,
316 "p2": -1,
317 "prevrev": -1,
317 "prevrev": -1,
318 "readdensity": 1.0,
318 "readdensity": 1.0,
319 "readsize": 44,
319 "readsize": 44,
320 "rev": 2,
320 "rev": 2,
321 "srchunks": 1,
321 "srchunks": 1,
322 "uncompsize": 43
322 "uncompsize": 43
323 }
323 }
324 ]
324 ]
325
325
326 debugdelta chain with sparse read enabled
326 debugdelta chain with sparse read enabled
327
327
328 $ cat >> $HGRCPATH <<EOF
328 $ cat >> $HGRCPATH <<EOF
329 > [experimental]
329 > [experimental]
330 > sparse-read = True
330 > sparse-read = True
331 > EOF
331 > EOF
332 $ hg debugdeltachain -m --all-info
332 $ hg debugdeltachain -m --all-info
333 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
333 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
334 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
334 0 -1 -1 1 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
335 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
335 1 0 -1 2 1 -1 base 0 0 0 0.00000 0 0 0.00000 0 0 1.00000 1
336 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
336 2 1 -1 3 1 -1 base 44 43 44 1.02326 44 0 0.00000 44 44 1.00000 1
337
337
338 $ hg debugdeltachain -m --sparse-info -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
338 $ hg debugdeltachain -m --sparse-info -T '{rev} {chainid} {chainlen} {readsize} {largestblock} {readdensity}\n'
339 0 1 1 44 44 1.0
339 0 1 1 44 44 1.0
340 1 2 1 0 0 1
340 1 2 1 0 0 1
341 2 3 1 44 44 1.0
341 2 3 1 44 44 1.0
342
342
343 $ hg debugdeltachain -m -Tjson --sparse-info
343 $ hg debugdeltachain -m -Tjson --sparse-info
344 [
344 [
345 {
345 {
346 "chainid": 1,
346 "chainid": 1,
347 "chainlen": 1,
347 "chainlen": 1,
348 "deltatype": "base",
348 "deltatype": "base",
349 "largestblock": 44,
349 "largestblock": 44,
350 "p1": -1,
350 "p1": -1,
351 "p2": -1,
351 "p2": -1,
352 "prevrev": -1,
352 "prevrev": -1,
353 "readdensity": 1.0,
353 "readdensity": 1.0,
354 "readsize": 44,
354 "readsize": 44,
355 "rev": 0,
355 "rev": 0,
356 "srchunks": 1
356 "srchunks": 1
357 },
357 },
358 {
358 {
359 "chainid": 2,
359 "chainid": 2,
360 "chainlen": 1,
360 "chainlen": 1,
361 "deltatype": "base",
361 "deltatype": "base",
362 "largestblock": 0,
362 "largestblock": 0,
363 "p1": 0,
363 "p1": 0,
364 "p2": -1,
364 "p2": -1,
365 "prevrev": -1,
365 "prevrev": -1,
366 "readdensity": 1,
366 "readdensity": 1,
367 "readsize": 0,
367 "readsize": 0,
368 "rev": 1,
368 "rev": 1,
369 "srchunks": 1
369 "srchunks": 1
370 },
370 },
371 {
371 {
372 "chainid": 3,
372 "chainid": 3,
373 "chainlen": 1,
373 "chainlen": 1,
374 "deltatype": "base",
374 "deltatype": "base",
375 "largestblock": 44,
375 "largestblock": 44,
376 "p1": 1,
376 "p1": 1,
377 "p2": -1,
377 "p2": -1,
378 "prevrev": -1,
378 "prevrev": -1,
379 "readdensity": 1.0,
379 "readdensity": 1.0,
380 "readsize": 44,
380 "readsize": 44,
381 "rev": 2,
381 "rev": 2,
382 "srchunks": 1
382 "srchunks": 1
383 }
383 }
384 ]
384 ]
385
385
386 $ hg debugdeltachain -m -Tjson --all-info
386 $ hg debugdeltachain -m -Tjson --all-info
387 [
387 [
388 {
388 {
389 "chainid": 1,
389 "chainid": 1,
390 "chainlen": 1,
390 "chainlen": 1,
391 "chainratio": 1.0232558139534884,
391 "chainratio": 1.0232558139534884,
392 "chainsize": 44,
392 "chainsize": 44,
393 "compsize": 44,
393 "compsize": 44,
394 "deltatype": "base",
394 "deltatype": "base",
395 "extradist": 0,
395 "extradist": 0,
396 "extraratio": 0.0,
396 "extraratio": 0.0,
397 "largestblock": 44,
397 "largestblock": 44,
398 "lindist": 44,
398 "lindist": 44,
399 "p1": -1,
399 "p1": -1,
400 "p2": -1,
400 "p2": -1,
401 "prevrev": -1,
401 "prevrev": -1,
402 "readdensity": 1.0,
402 "readdensity": 1.0,
403 "readsize": 44,
403 "readsize": 44,
404 "rev": 0,
404 "rev": 0,
405 "srchunks": 1,
405 "srchunks": 1,
406 "uncompsize": 43
406 "uncompsize": 43
407 },
407 },
408 {
408 {
409 "chainid": 2,
409 "chainid": 2,
410 "chainlen": 1,
410 "chainlen": 1,
411 "chainratio": 0,
411 "chainratio": 0,
412 "chainsize": 0,
412 "chainsize": 0,
413 "compsize": 0,
413 "compsize": 0,
414 "deltatype": "base",
414 "deltatype": "base",
415 "extradist": 0,
415 "extradist": 0,
416 "extraratio": 0,
416 "extraratio": 0,
417 "largestblock": 0,
417 "largestblock": 0,
418 "lindist": 0,
418 "lindist": 0,
419 "p1": 0,
419 "p1": 0,
420 "p2": -1,
420 "p2": -1,
421 "prevrev": -1,
421 "prevrev": -1,
422 "readdensity": 1,
422 "readdensity": 1,
423 "readsize": 0,
423 "readsize": 0,
424 "rev": 1,
424 "rev": 1,
425 "srchunks": 1,
425 "srchunks": 1,
426 "uncompsize": 0
426 "uncompsize": 0
427 },
427 },
428 {
428 {
429 "chainid": 3,
429 "chainid": 3,
430 "chainlen": 1,
430 "chainlen": 1,
431 "chainratio": 1.0232558139534884,
431 "chainratio": 1.0232558139534884,
432 "chainsize": 44,
432 "chainsize": 44,
433 "compsize": 44,
433 "compsize": 44,
434 "deltatype": "base",
434 "deltatype": "base",
435 "extradist": 0,
435 "extradist": 0,
436 "extraratio": 0.0,
436 "extraratio": 0.0,
437 "largestblock": 44,
437 "largestblock": 44,
438 "lindist": 44,
438 "lindist": 44,
439 "p1": 1,
439 "p1": 1,
440 "p2": -1,
440 "p2": -1,
441 "prevrev": -1,
441 "prevrev": -1,
442 "readdensity": 1.0,
442 "readdensity": 1.0,
443 "readsize": 44,
443 "readsize": 44,
444 "rev": 2,
444 "rev": 2,
445 "srchunks": 1,
445 "srchunks": 1,
446 "uncompsize": 43
446 "uncompsize": 43
447 }
447 }
448 ]
448 ]
449
449
450 $ printf "This test checks things.\n" >> a
450 $ printf "This test checks things.\n" >> a
451 $ hg ci -m a
451 $ hg ci -m a
452 $ hg branch other
452 $ hg branch other
453 marked working directory as branch other
453 marked working directory as branch other
454 (branches are permanent and global, did you want a bookmark?)
454 (branches are permanent and global, did you want a bookmark?)
455 $ for i in `$TESTDIR/seq.py 5`; do
455 $ for i in `$TESTDIR/seq.py 5`; do
456 > printf "shorter ${i}" >> a
456 > printf "shorter ${i}" >> a
457 > hg ci -m "a other:$i"
457 > hg ci -m "a other:$i"
458 > hg up -q default
458 > hg up -q default
459 > printf "for the branch default we want longer chains: ${i}" >> a
459 > printf "for the branch default we want longer chains: ${i}" >> a
460 > hg ci -m "a default:$i"
460 > hg ci -m "a default:$i"
461 > hg up -q other
461 > hg up -q other
462 > done
462 > done
463 $ hg debugdeltachain a -T '{rev} {srchunks}\n' --all-info\
463 $ hg debugdeltachain a -T '{rev} {srchunks}\n' --all-info\
464 > --config experimental.sparse-read.density-threshold=0.50 \
464 > --config experimental.sparse-read.density-threshold=0.50 \
465 > --config experimental.sparse-read.min-gap-size=0
465 > --config experimental.sparse-read.min-gap-size=0
466 0 1
466 0 1
467 1 1
467 1 1
468 2 1
468 2 1
469 3 1
469 3 1
470 4 1
470 4 1
471 5 1
471 5 1
472 6 1
472 6 1
473 7 1
473 7 1
474 8 1
474 8 1
475 9 1
475 9 1
476 10 2 (no-zstd !)
476 10 2 (no-zstd !)
477 10 1 (zstd !)
477 10 1 (zstd !)
478 11 1
478 11 1
479 $ hg --config extensions.strip= strip --no-backup -r 1
479 $ hg --config extensions.strip= strip --no-backup -r 1
480 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
480 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
481
481
482 Test max chain len
482 Test max chain len
483 $ cat >> $HGRCPATH << EOF
483 $ cat >> $HGRCPATH << EOF
484 > [format]
484 > [format]
485 > maxchainlen=4
485 > maxchainlen=4
486 > EOF
486 > EOF
487
487
488 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
488 $ printf "This test checks if maxchainlen config value is respected also it can serve as basic test for debugrevlog -d <file>.\n" >> a
489 $ hg ci -m a
489 $ hg ci -m a
490 $ printf "b\n" >> a
490 $ printf "b\n" >> a
491 $ hg ci -m a
491 $ hg ci -m a
492 $ printf "c\n" >> a
492 $ printf "c\n" >> a
493 $ hg ci -m a
493 $ hg ci -m a
494 $ printf "d\n" >> a
494 $ printf "d\n" >> a
495 $ hg ci -m a
495 $ hg ci -m a
496 $ printf "e\n" >> a
496 $ printf "e\n" >> a
497 $ hg ci -m a
497 $ hg ci -m a
498 $ printf "f\n" >> a
498 $ printf "f\n" >> a
499 $ hg ci -m a
499 $ hg ci -m a
500 $ printf 'g\n' >> a
500 $ printf 'g\n' >> a
501 $ hg ci -m a
501 $ hg ci -m a
502 $ printf 'h\n' >> a
502 $ printf 'h\n' >> a
503 $ hg ci -m a
503 $ hg ci -m a
504
504
505 $ hg debugrevlog -d a
505 $ hg debugrevlog -d a
506 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
506 # rev p1rev p2rev start end deltastart base p1 p2 rawsize totalsize compression heads chainlen
507 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
507 0 -1 -1 0 ??? 0 0 0 0 ??? ???? ? 1 0 (glob)
508 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
508 1 0 -1 ??? ??? 0 0 0 0 ??? ???? ? 1 1 (glob)
509 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
509 2 1 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
510 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
510 3 2 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
511 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
511 4 3 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 4 (glob)
512 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
512 5 4 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 0 (glob)
513 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
513 6 5 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 1 (glob)
514 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
514 7 6 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 2 (glob)
515 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
515 8 7 -1 ??? ??? ??? ??? ??? 0 ??? ???? ? 1 3 (glob)
516 #endif
516 #endif
517
517
518 Test debuglocks command:
518 Test debuglocks command:
519
519
520 $ hg debuglocks
520 $ hg debuglocks
521 lock: free
521 lock: free
522 wlock: free
522 wlock: free
523
523
524 * Test setting the lock
524 * Test setting the lock
525
525
526 waitlock <file> will wait for file to be created. If it isn't in a reasonable
526 waitlock <file> will wait for file to be created. If it isn't in a reasonable
527 amount of time, displays error message and returns 1
527 amount of time, displays error message and returns 1
528 $ waitlock() {
528 $ waitlock() {
529 > start=`date +%s`
529 > start=`date +%s`
530 > timeout=5
530 > timeout=5
531 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
531 > while [ \( ! -f $1 \) -a \( ! -L $1 \) ]; do
532 > now=`date +%s`
532 > now=`date +%s`
533 > if [ "`expr $now - $start`" -gt $timeout ]; then
533 > if [ "`expr $now - $start`" -gt $timeout ]; then
534 > echo "timeout: $1 was not created in $timeout seconds"
534 > echo "timeout: $1 was not created in $timeout seconds"
535 > return 1
535 > return 1
536 > fi
536 > fi
537 > sleep 0.1
537 > sleep 0.1
538 > done
538 > done
539 > }
539 > }
540 $ dolock() {
540 $ dolock() {
541 > {
541 > {
542 > waitlock .hg/unlock
542 > waitlock .hg/unlock
543 > rm -f .hg/unlock
543 > rm -f .hg/unlock
544 > echo y
544 > echo y
545 > } | hg debuglocks "$@" > /dev/null
545 > } | hg debuglocks "$@" > /dev/null
546 > }
546 > }
547 $ dolock -s &
547 $ dolock -s &
548 $ waitlock .hg/store/lock
548 $ waitlock .hg/store/lock
549
549
550 $ hg debuglocks
550 $ hg debuglocks
551 lock: user *, process * (*s) (glob)
551 lock: user *, process * (*s) (glob)
552 wlock: free
552 wlock: free
553 [1]
553 [1]
554 $ touch .hg/unlock
554 $ touch .hg/unlock
555 $ wait
555 $ wait
556 $ [ -f .hg/store/lock ] || echo "There is no lock"
556 $ [ -f .hg/store/lock ] || echo "There is no lock"
557 There is no lock
557 There is no lock
558
558
559 * Test setting the wlock
559 * Test setting the wlock
560
560
561 $ dolock -S &
561 $ dolock -S &
562 $ waitlock .hg/wlock
562 $ waitlock .hg/wlock
563
563
564 $ hg debuglocks
564 $ hg debuglocks
565 lock: free
565 lock: free
566 wlock: user *, process * (*s) (glob)
566 wlock: user *, process * (*s) (glob)
567 [1]
567 [1]
568 $ touch .hg/unlock
568 $ touch .hg/unlock
569 $ wait
569 $ wait
570 $ [ -f .hg/wlock ] || echo "There is no wlock"
570 $ [ -f .hg/wlock ] || echo "There is no wlock"
571 There is no wlock
571 There is no wlock
572
572
573 * Test setting both locks
573 * Test setting both locks
574
574
575 $ dolock -Ss &
575 $ dolock -Ss &
576 $ waitlock .hg/wlock && waitlock .hg/store/lock
576 $ waitlock .hg/wlock && waitlock .hg/store/lock
577
577
578 $ hg debuglocks
578 $ hg debuglocks
579 lock: user *, process * (*s) (glob)
579 lock: user *, process * (*s) (glob)
580 wlock: user *, process * (*s) (glob)
580 wlock: user *, process * (*s) (glob)
581 [2]
581 [2]
582
582
583 * Test failing to set a lock
583 * Test failing to set a lock
584
584
585 $ hg debuglocks -s
585 $ hg debuglocks -s
586 abort: lock is already held
586 abort: lock is already held
587 [255]
587 [255]
588
588
589 $ hg debuglocks -S
589 $ hg debuglocks -S
590 abort: wlock is already held
590 abort: wlock is already held
591 [255]
591 [255]
592
592
593 $ touch .hg/unlock
593 $ touch .hg/unlock
594 $ wait
594 $ wait
595
595
596 $ hg debuglocks
596 $ hg debuglocks
597 lock: free
597 lock: free
598 wlock: free
598 wlock: free
599
599
600 * Test forcing the lock
600 * Test forcing the lock
601
601
602 $ dolock -s &
602 $ dolock -s &
603 $ waitlock .hg/store/lock
603 $ waitlock .hg/store/lock
604
604
605 $ hg debuglocks
605 $ hg debuglocks
606 lock: user *, process * (*s) (glob)
606 lock: user *, process * (*s) (glob)
607 wlock: free
607 wlock: free
608 [1]
608 [1]
609
609
610 $ hg debuglocks -L
610 $ hg debuglocks -L
611
611
612 $ hg debuglocks
612 $ hg debuglocks
613 lock: free
613 lock: free
614 wlock: free
614 wlock: free
615
615
616 $ touch .hg/unlock
616 $ touch .hg/unlock
617 $ wait
617 $ wait
618
618
619 * Test forcing the wlock
619 * Test forcing the wlock
620
620
621 $ dolock -S &
621 $ dolock -S &
622 $ waitlock .hg/wlock
622 $ waitlock .hg/wlock
623
623
624 $ hg debuglocks
624 $ hg debuglocks
625 lock: free
625 lock: free
626 wlock: user *, process * (*s) (glob)
626 wlock: user *, process * (*s) (glob)
627 [1]
627 [1]
628
628
629 $ hg debuglocks -W
629 $ hg debuglocks -W
630
630
631 $ hg debuglocks
631 $ hg debuglocks
632 lock: free
632 lock: free
633 wlock: free
633 wlock: free
634
634
635 $ touch .hg/unlock
635 $ touch .hg/unlock
636 $ wait
636 $ wait
637
637
638 Test WdirUnsupported exception
638 Test WdirUnsupported exception
639
639
640 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
640 $ hg debugdata -c ffffffffffffffffffffffffffffffffffffffff
641 abort: working directory revision cannot be specified
641 abort: working directory revision cannot be specified
642 [255]
642 [255]
643
643
644 Test cache warming command
644 Test cache warming command
645
645
646 $ rm -rf .hg/cache/
646 $ rm -rf .hg/cache/
647 $ hg debugupdatecaches --debug
647 $ hg debugupdatecaches --debug
648 updating the branch cache
648 updating the branch cache
649 $ ls -r .hg/cache/*
649 $ ls -r .hg/cache/*
650 .hg/cache/tags2-served
650 .hg/cache/tags2-served
651 .hg/cache/tags2
651 .hg/cache/tags2
652 .hg/cache/rbc-revs-v1
652 .hg/cache/rbc-revs-v1
653 .hg/cache/rbc-names-v1
653 .hg/cache/rbc-names-v1
654 .hg/cache/hgtagsfnodes1
654 .hg/cache/hgtagsfnodes1
655 .hg/cache/branch2-visible-hidden
655 .hg/cache/branch2-visible-hidden
656 .hg/cache/branch2-visible
656 .hg/cache/branch2-visible
657 .hg/cache/branch2-served.hidden
657 .hg/cache/branch2-served.hidden
658 .hg/cache/branch2-served
658 .hg/cache/branch2-served
659 .hg/cache/branch2-immutable
659 .hg/cache/branch2-immutable
660 .hg/cache/branch2-base
660 .hg/cache/branch2-base
661
661
662 Test debugcolor
662 Test debugcolor
663
663
664 #if no-windows
664 #if no-windows
665 $ hg debugcolor --style --color always | grep -E 'mode|style|log\.'
665 $ hg debugcolor --style --color always | grep -E 'mode|style|log\.'
666 color mode: 'ansi'
666 color mode: 'ansi'
667 available style:
667 available style:
668 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
668 \x1b[0;33mlog.changeset\x1b[0m: \x1b[0;33myellow\x1b[0m (esc)
669 #endif
669 #endif
670
670
671 $ hg debugcolor --style --color never
671 $ hg debugcolor --style --color never
672 color mode: None
672 color mode: None
673 available style:
673 available style:
674
674
675 $ cd ..
675 $ cd ..
676
676
677 Test internal debugstacktrace command
677 Test internal debugstacktrace command
678
678
679 $ cat > debugstacktrace.py << EOF
679 $ cat > debugstacktrace.py << EOF
680 > from mercurial import (
680 > from mercurial import (
681 > util,
681 > util,
682 > )
682 > )
683 > from mercurial.utils import (
683 > from mercurial.utils import (
684 > procutil,
684 > procutil,
685 > )
685 > )
686 > def f():
686 > def f():
687 > util.debugstacktrace(f=procutil.stdout)
687 > util.debugstacktrace(f=procutil.stdout)
688 > g()
688 > g()
689 > def g():
689 > def g():
690 > util.dst(b'hello from g\\n', skip=1)
690 > util.dst(b'hello from g\\n', skip=1)
691 > h()
691 > h()
692 > def h():
692 > def h():
693 > util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
693 > util.dst(b'hi ...\\nfrom h hidden in g', 1, depth=2)
694 > f()
694 > f()
695 > EOF
695 > EOF
696 $ "$PYTHON" debugstacktrace.py
696 $ "$PYTHON" debugstacktrace.py
697 stacktrace at:
697 stacktrace at:
698 *debugstacktrace.py:15 in * (glob)
698 *debugstacktrace.py:15 in * (glob)
699 *debugstacktrace.py:8 in f (glob)
699 *debugstacktrace.py:8 in f (glob)
700 hello from g at:
700 hello from g at:
701 *debugstacktrace.py:15 in * (glob)
701 *debugstacktrace.py:15 in * (glob)
702 *debugstacktrace.py:9 in f (glob)
702 *debugstacktrace.py:9 in f (glob)
703 hi ...
703 hi ...
704 from h hidden in g at:
704 from h hidden in g at:
705 *debugstacktrace.py:9 in f (glob)
705 *debugstacktrace.py:9 in f (glob)
706 *debugstacktrace.py:12 in g (glob)
706 *debugstacktrace.py:12 in g (glob)
707
707
708 Test debugcapabilities command:
708 Test debugcapabilities command:
709
709
710 $ hg debugcapabilities ./debugrevlog/
710 $ hg debugcapabilities ./debugrevlog/
711 Main capabilities:
711 Main capabilities:
712 branchmap
712 branchmap
713 $USUAL_BUNDLE2_CAPS$
713 $USUAL_BUNDLE2_CAPS$
714 getbundle
714 getbundle
715 known
715 known
716 lookup
716 lookup
717 pushkey
717 pushkey
718 unbundle
718 unbundle
719 Bundle2 capabilities:
719 Bundle2 capabilities:
720 HG20
720 HG20
721 bookmarks
721 bookmarks
722 changegroup
722 changegroup
723 01
723 01
724 02
724 02
725 03
725 03
726 checkheads
726 checkheads
727 related
727 related
728 digests
728 digests
729 md5
729 md5
730 sha1
730 sha1
731 sha512
731 sha512
732 error
732 error
733 abort
733 abort
734 unsupportedcontent
734 unsupportedcontent
735 pushraced
735 pushraced
736 pushkey
736 pushkey
737 hgtagsfnodes
737 hgtagsfnodes
738 listkeys
738 listkeys
739 phases
739 phases
740 heads
740 heads
741 pushkey
741 pushkey
742 remote-changegroup
742 remote-changegroup
743 http
743 http
744 https
744 https
745 stream
745 stream
746 v2
746 v2
747
747
748 Test debugpeer
748 Test debugpeer
749
749
750 $ hg debugpeer ssh://user@dummy/debugrevlog
750 $ hg debugpeer ssh://user@dummy/debugrevlog
751 url: ssh://user@dummy/debugrevlog
751 url: ssh://user@dummy/debugrevlog
752 local: no
752 local: no
753 pushable: yes
753 pushable: yes
754
754
755 #if rust
755 #if rust
756
756
757 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
757 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
758 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
758 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
759 devel-peer-request: hello+between
759 devel-peer-request: hello+between
760 devel-peer-request: pairs: 81 bytes
760 devel-peer-request: pairs: 81 bytes
761 sending hello command
761 sending hello command
762 sending between command
762 sending between command
763 remote: 473
763 remote: 473
764 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
764 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
765 remote: 1
765 remote: 1
766 devel-peer-request: protocaps
766 devel-peer-request: protocaps
767 devel-peer-request: caps: * bytes (glob)
767 devel-peer-request: caps: * bytes (glob)
768 sending protocaps command
768 sending protocaps command
769 url: ssh://user@dummy/debugrevlog
769 url: ssh://user@dummy/debugrevlog
770 local: no
770 local: no
771 pushable: yes
771 pushable: yes
772
772
773 #endif
773 #endif
774
774
775 #if no-rust zstd
775 #if no-rust zstd
776
776
777 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
777 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
778 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
778 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
779 devel-peer-request: hello+between
779 devel-peer-request: hello+between
780 devel-peer-request: pairs: 81 bytes
780 devel-peer-request: pairs: 81 bytes
781 sending hello command
781 sending hello command
782 sending between command
782 sending between command
783 remote: 473
783 remote: 473
784 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
784 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlog-compression-zstd,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
785 remote: 1
785 remote: 1
786 devel-peer-request: protocaps
786 devel-peer-request: protocaps
787 devel-peer-request: caps: * bytes (glob)
787 devel-peer-request: caps: * bytes (glob)
788 sending protocaps command
788 sending protocaps command
789 url: ssh://user@dummy/debugrevlog
789 url: ssh://user@dummy/debugrevlog
790 local: no
790 local: no
791 pushable: yes
791 pushable: yes
792
792
793 #endif
793 #endif
794
794
795 #if no-rust no-zstd
795 #if no-rust no-zstd
796
796
797 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
797 $ hg --debug debugpeer ssh://user@dummy/debugrevlog
798 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
798 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R debugrevlog serve --stdio['"] (re)
799 devel-peer-request: hello+between
799 devel-peer-request: hello+between
800 devel-peer-request: pairs: 81 bytes
800 devel-peer-request: pairs: 81 bytes
801 sending hello command
801 sending hello command
802 sending between command
802 sending between command
803 remote: 449
803 remote: 449
804 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
804 remote: capabilities: batch branchmap $USUAL_BUNDLE2_CAPS$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=generaldelta,revlogv1,sparserevlog unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash
805 remote: 1
805 remote: 1
806 devel-peer-request: protocaps
806 devel-peer-request: protocaps
807 devel-peer-request: caps: * bytes (glob)
807 devel-peer-request: caps: * bytes (glob)
808 sending protocaps command
808 sending protocaps command
809 url: ssh://user@dummy/debugrevlog
809 url: ssh://user@dummy/debugrevlog
810 local: no
810 local: no
811 pushable: yes
811 pushable: yes
812
812
813 #endif
813 #endif
814
814
815 Test debugshell
815 Test debugshell
816
816
817 $ hg debugshell -c 'ui.write(b"%s\n" % ui.username())'
817 $ hg debugshell -c 'ui.write(b"%s\n" % ui.username())'
818 test
818 test
@@ -1,121 +1,122 b''
1 Testing cloning with the EOL extension
1 Testing cloning with the EOL extension
2
2
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > eol =
5 > eol =
6 >
6 >
7 > [eol]
7 > [eol]
8 > native = CRLF
8 > native = CRLF
9 > EOF
9 > EOF
10
10
11 setup repository
11 setup repository
12
12
13 $ hg init repo
13 $ hg init repo
14 $ cd repo
14 $ cd repo
15 $ cat > .hgeol <<EOF
15 $ cat > .hgeol <<EOF
16 > [patterns]
16 > [patterns]
17 > **.txt = native
17 > **.txt = native
18 > EOF
18 > EOF
19 $ printf "first\r\nsecond\r\nthird\r\n" > a.txt
19 $ printf "first\r\nsecond\r\nthird\r\n" > a.txt
20 $ hg commit --addremove -m 'checkin'
20 $ hg commit --addremove -m 'checkin'
21 adding .hgeol
21 adding .hgeol
22 adding a.txt
22 adding a.txt
23
23
24 Test commit of removed .hgeol and how it immediately makes the automatic
24 Test commit of removed .hgeol and how it immediately makes the automatic
25 changes explicit and committable.
25 changes explicit and committable.
26
26
27 $ cd ..
27 $ cd ..
28 $ hg clone repo repo-2
28 $ hg clone repo repo-2
29 updating to branch default
29 updating to branch default
30 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 $ cd repo-2
31 $ cd repo-2
32 $ cat a.txt
32 $ cat a.txt
33 first\r (esc)
33 first\r (esc)
34 second\r (esc)
34 second\r (esc)
35 third\r (esc)
35 third\r (esc)
36 $ hg cat a.txt
36 $ hg cat a.txt
37 first
37 first
38 second
38 second
39 third
39 third
40 $ hg remove .hgeol
40 $ hg remove .hgeol
41 $ touch a.txt * # ensure consistent st dirtyness checks, ignoring dirstate timing
41 $ touch a.txt * # ensure consistent st dirtyness checks, ignoring dirstate timing
42 $ hg st -v --debug
42 $ hg st -v --debug
43 M a.txt
43 M a.txt
44 R .hgeol
44 R .hgeol
45 $ hg commit -m 'remove eol'
45 $ hg commit -m 'remove eol'
46 $ hg exp
46 $ hg exp
47 # HG changeset patch
47 # HG changeset patch
48 # User test
48 # User test
49 # Date 0 0
49 # Date 0 0
50 # Thu Jan 01 00:00:00 1970 +0000
50 # Thu Jan 01 00:00:00 1970 +0000
51 # Node ID 3c20c2d90333b6ecdc8f7aa8f9b73223c7c7a608
51 # Node ID 3c20c2d90333b6ecdc8f7aa8f9b73223c7c7a608
52 # Parent 90f94e2cf4e24628afddd641688dfe4cd476d6e4
52 # Parent 90f94e2cf4e24628afddd641688dfe4cd476d6e4
53 remove eol
53 remove eol
54
54
55 diff -r 90f94e2cf4e2 -r 3c20c2d90333 .hgeol
55 diff -r 90f94e2cf4e2 -r 3c20c2d90333 .hgeol
56 --- a/.hgeol Thu Jan 01 00:00:00 1970 +0000
56 --- a/.hgeol Thu Jan 01 00:00:00 1970 +0000
57 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
57 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
58 @@ -1,2 +0,0 @@
58 @@ -1,2 +0,0 @@
59 -[patterns]
59 -[patterns]
60 -**.txt = native
60 -**.txt = native
61 diff -r 90f94e2cf4e2 -r 3c20c2d90333 a.txt
61 diff -r 90f94e2cf4e2 -r 3c20c2d90333 a.txt
62 --- a/a.txt Thu Jan 01 00:00:00 1970 +0000
62 --- a/a.txt Thu Jan 01 00:00:00 1970 +0000
63 +++ b/a.txt Thu Jan 01 00:00:00 1970 +0000
63 +++ b/a.txt Thu Jan 01 00:00:00 1970 +0000
64 @@ -1,3 +1,3 @@
64 @@ -1,3 +1,3 @@
65 -first
65 -first
66 -second
66 -second
67 -third
67 -third
68 +first\r (esc)
68 +first\r (esc)
69 +second\r (esc)
69 +second\r (esc)
70 +third\r (esc)
70 +third\r (esc)
71 $ hg push --quiet
71 $ hg push --quiet
72 $ cd ..
72 $ cd ..
73
73
74 Test clone of repo with .hgeol in working dir, but no .hgeol in default
74 Test clone of repo with .hgeol in working dir, but no .hgeol in default
75 checkout revision tip. The repo is correctly updated to be consistent and have
75 checkout revision tip. The repo is correctly updated to be consistent and have
76 the exact content checked out without filtering, ignoring the current .hgeol in
76 the exact content checked out without filtering, ignoring the current .hgeol in
77 the source repo:
77 the source repo:
78
78
79 $ cat repo/.hgeol
79 $ cat repo/.hgeol
80 [patterns]
80 [patterns]
81 **.txt = native
81 **.txt = native
82 $ hg clone repo repo-3 -v --debug
82 $ hg clone repo repo-3 -v --debug
83 linked 7 files
83 linked 8 files (no-rust !)
84 linked 10 files (rust !)
84 updating to branch default
85 updating to branch default
85 resolving manifests
86 resolving manifests
86 branchmerge: False, force: False, partial: False
87 branchmerge: False, force: False, partial: False
87 ancestor: 000000000000, local: 000000000000+, remote: 3c20c2d90333
88 ancestor: 000000000000, local: 000000000000+, remote: 3c20c2d90333
88 calling hook preupdate.eol: hgext.eol.preupdate
89 calling hook preupdate.eol: hgext.eol.preupdate
89 a.txt: remote created -> g
90 a.txt: remote created -> g
90 getting a.txt
91 getting a.txt
91 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 updating the branch cache
93 updating the branch cache
93 $ cd repo-3
94 $ cd repo-3
94
95
95 $ cat a.txt
96 $ cat a.txt
96 first\r (esc)
97 first\r (esc)
97 second\r (esc)
98 second\r (esc)
98 third\r (esc)
99 third\r (esc)
99
100
100 Test clone of revision with .hgeol
101 Test clone of revision with .hgeol
101
102
102 $ cd ..
103 $ cd ..
103 $ hg clone -r 0 repo repo-4
104 $ hg clone -r 0 repo repo-4
104 adding changesets
105 adding changesets
105 adding manifests
106 adding manifests
106 adding file changes
107 adding file changes
107 added 1 changesets with 2 changes to 2 files
108 added 1 changesets with 2 changes to 2 files
108 new changesets 90f94e2cf4e2
109 new changesets 90f94e2cf4e2
109 updating to branch default
110 updating to branch default
110 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 $ cd repo-4
112 $ cd repo-4
112 $ cat .hgeol
113 $ cat .hgeol
113 [patterns]
114 [patterns]
114 **.txt = native
115 **.txt = native
115
116
116 $ cat a.txt
117 $ cat a.txt
117 first\r (esc)
118 first\r (esc)
118 second\r (esc)
119 second\r (esc)
119 third\r (esc)
120 third\r (esc)
120
121
121 $ cd ..
122 $ cd ..
@@ -1,532 +1,538 b''
1 #require repofncache
1 #require repofncache
2
2
3 An extension which will set fncache chunksize to 1 byte to make sure that logic
3 An extension which will set fncache chunksize to 1 byte to make sure that logic
4 does not break
4 does not break
5
5
6 $ cat > chunksize.py <<EOF
6 $ cat > chunksize.py <<EOF
7 > from mercurial import store
7 > from mercurial import store
8 > store.fncache_chunksize = 1
8 > store.fncache_chunksize = 1
9 > EOF
9 > EOF
10
10
11 $ cat >> $HGRCPATH <<EOF
11 $ cat >> $HGRCPATH <<EOF
12 > [extensions]
12 > [extensions]
13 > chunksize = $TESTTMP/chunksize.py
13 > chunksize = $TESTTMP/chunksize.py
14 > EOF
14 > EOF
15
15
16 Init repo1:
16 Init repo1:
17
17
18 $ hg init repo1
18 $ hg init repo1
19 $ cd repo1
19 $ cd repo1
20 $ echo "some text" > a
20 $ echo "some text" > a
21 $ hg add
21 $ hg add
22 adding a
22 adding a
23 $ hg ci -m first
23 $ hg ci -m first
24 $ cat .hg/store/fncache | sort
24 $ cat .hg/store/fncache | sort
25 data/a.i
25 data/a.i
26
26
27 Testing a.i/b:
27 Testing a.i/b:
28
28
29 $ mkdir a.i
29 $ mkdir a.i
30 $ echo "some other text" > a.i/b
30 $ echo "some other text" > a.i/b
31 $ hg add
31 $ hg add
32 adding a.i/b
32 adding a.i/b
33 $ hg ci -m second
33 $ hg ci -m second
34 $ cat .hg/store/fncache | sort
34 $ cat .hg/store/fncache | sort
35 data/a.i
35 data/a.i
36 data/a.i.hg/b.i
36 data/a.i.hg/b.i
37
37
38 Testing a.i.hg/c:
38 Testing a.i.hg/c:
39
39
40 $ mkdir a.i.hg
40 $ mkdir a.i.hg
41 $ echo "yet another text" > a.i.hg/c
41 $ echo "yet another text" > a.i.hg/c
42 $ hg add
42 $ hg add
43 adding a.i.hg/c
43 adding a.i.hg/c
44 $ hg ci -m third
44 $ hg ci -m third
45 $ cat .hg/store/fncache | sort
45 $ cat .hg/store/fncache | sort
46 data/a.i
46 data/a.i
47 data/a.i.hg.hg/c.i
47 data/a.i.hg.hg/c.i
48 data/a.i.hg/b.i
48 data/a.i.hg/b.i
49
49
50 Testing verify:
50 Testing verify:
51
51
52 $ hg verify -q
52 $ hg verify -q
53
53
54 $ rm .hg/store/fncache
54 $ rm .hg/store/fncache
55
55
56 $ hg verify
56 $ hg verify
57 checking changesets
57 checking changesets
58 checking manifests
58 checking manifests
59 crosschecking files in changesets and manifests
59 crosschecking files in changesets and manifests
60 checking files
60 checking files
61 warning: revlog 'data/a.i' not in fncache!
61 warning: revlog 'data/a.i' not in fncache!
62 warning: revlog 'data/a.i.hg/c.i' not in fncache!
62 warning: revlog 'data/a.i.hg/c.i' not in fncache!
63 warning: revlog 'data/a.i/b.i' not in fncache!
63 warning: revlog 'data/a.i/b.i' not in fncache!
64 checking dirstate
64 checking dirstate
65 checked 3 changesets with 3 changes to 3 files
65 checked 3 changesets with 3 changes to 3 files
66 3 warnings encountered!
66 3 warnings encountered!
67 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
67 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
68
68
69 Follow the hint to make sure it works
69 Follow the hint to make sure it works
70
70
71 $ hg debugrebuildfncache
71 $ hg debugrebuildfncache
72 adding data/a.i
72 adding data/a.i
73 adding data/a.i.hg/c.i
73 adding data/a.i.hg/c.i
74 adding data/a.i/b.i
74 adding data/a.i/b.i
75 3 items added, 0 removed from fncache
75 3 items added, 0 removed from fncache
76
76
77 $ hg verify -q
77 $ hg verify -q
78
78
79 $ cd ..
79 $ cd ..
80
80
81 Non store repo:
81 Non store repo:
82
82
83 $ hg --config format.usestore=False init foo
83 $ hg --config format.usestore=False init foo
84 $ cd foo
84 $ cd foo
85 $ mkdir tst.d
85 $ mkdir tst.d
86 $ echo foo > tst.d/foo
86 $ echo foo > tst.d/foo
87 $ hg ci -Amfoo
87 $ hg ci -Amfoo
88 adding tst.d/foo
88 adding tst.d/foo
89 $ find .hg | sort
89 $ find .hg | sort
90 .hg
90 .hg
91 .hg/00changelog-6b8ab34b.nd (rust !)
92 .hg/00changelog.d
91 .hg/00changelog.i
93 .hg/00changelog.i
94 .hg/00changelog.n (rust !)
92 .hg/00manifest.i
95 .hg/00manifest.i
93 .hg/branch
96 .hg/branch
94 .hg/cache
97 .hg/cache
95 .hg/cache/branch2-served
98 .hg/cache/branch2-served
96 .hg/cache/rbc-names-v1
99 .hg/cache/rbc-names-v1
97 .hg/cache/rbc-revs-v1
100 .hg/cache/rbc-revs-v1
98 .hg/data
101 .hg/data
99 .hg/data/tst.d.hg
102 .hg/data/tst.d.hg
100 .hg/data/tst.d.hg/foo.i
103 .hg/data/tst.d.hg/foo.i
101 .hg/dirstate
104 .hg/dirstate
102 .hg/fsmonitor.state (fsmonitor !)
105 .hg/fsmonitor.state (fsmonitor !)
103 .hg/last-message.txt
106 .hg/last-message.txt
104 .hg/phaseroots
107 .hg/phaseroots
105 .hg/requires
108 .hg/requires
106 .hg/undo
109 .hg/undo
107 .hg/undo.backup.branch.bck
110 .hg/undo.backup.branch.bck
108 .hg/undo.backupfiles
111 .hg/undo.backupfiles
109 .hg/undo.desc
112 .hg/undo.desc
110 .hg/wcache
113 .hg/wcache
111 .hg/wcache/checkisexec (execbit !)
114 .hg/wcache/checkisexec (execbit !)
112 .hg/wcache/checklink (symlink !)
115 .hg/wcache/checklink (symlink !)
113 .hg/wcache/checklink-target (symlink !)
116 .hg/wcache/checklink-target (symlink !)
114 .hg/wcache/manifestfulltextcache (reporevlogstore !)
117 .hg/wcache/manifestfulltextcache (reporevlogstore !)
115 $ cd ..
118 $ cd ..
116
119
117 Non fncache repo:
120 Non fncache repo:
118
121
119 $ hg --config format.usefncache=False init bar
122 $ hg --config format.usefncache=False init bar
120 $ cd bar
123 $ cd bar
121 $ mkdir tst.d
124 $ mkdir tst.d
122 $ echo foo > tst.d/Foo
125 $ echo foo > tst.d/Foo
123 $ hg ci -Amfoo
126 $ hg ci -Amfoo
124 adding tst.d/Foo
127 adding tst.d/Foo
125 $ find .hg | sort
128 $ find .hg | sort
126 .hg
129 .hg
127 .hg/00changelog.i
130 .hg/00changelog.i
128 .hg/branch
131 .hg/branch
129 .hg/cache
132 .hg/cache
130 .hg/cache/branch2-served
133 .hg/cache/branch2-served
131 .hg/cache/rbc-names-v1
134 .hg/cache/rbc-names-v1
132 .hg/cache/rbc-revs-v1
135 .hg/cache/rbc-revs-v1
133 .hg/dirstate
136 .hg/dirstate
134 .hg/fsmonitor.state (fsmonitor !)
137 .hg/fsmonitor.state (fsmonitor !)
135 .hg/last-message.txt
138 .hg/last-message.txt
136 .hg/requires
139 .hg/requires
137 .hg/store
140 .hg/store
141 .hg/store/00changelog-b875dfc5.nd (rust !)
142 .hg/store/00changelog.d
138 .hg/store/00changelog.i
143 .hg/store/00changelog.i
144 .hg/store/00changelog.n (rust !)
139 .hg/store/00manifest.i
145 .hg/store/00manifest.i
140 .hg/store/data
146 .hg/store/data
141 .hg/store/data/tst.d.hg
147 .hg/store/data/tst.d.hg
142 .hg/store/data/tst.d.hg/_foo.i
148 .hg/store/data/tst.d.hg/_foo.i
143 .hg/store/phaseroots
149 .hg/store/phaseroots
144 .hg/store/requires
150 .hg/store/requires
145 .hg/store/undo
151 .hg/store/undo
146 .hg/store/undo.backupfiles
152 .hg/store/undo.backupfiles
147 .hg/undo.backup.branch.bck
153 .hg/undo.backup.branch.bck
148 .hg/undo.desc
154 .hg/undo.desc
149 .hg/wcache
155 .hg/wcache
150 .hg/wcache/checkisexec (execbit !)
156 .hg/wcache/checkisexec (execbit !)
151 .hg/wcache/checklink (symlink !)
157 .hg/wcache/checklink (symlink !)
152 .hg/wcache/checklink-target (symlink !)
158 .hg/wcache/checklink-target (symlink !)
153 .hg/wcache/manifestfulltextcache (reporevlogstore !)
159 .hg/wcache/manifestfulltextcache (reporevlogstore !)
154 $ cd ..
160 $ cd ..
155
161
156 Encoding of reserved / long paths in the store
162 Encoding of reserved / long paths in the store
157
163
158 $ hg init r2
164 $ hg init r2
159 $ cd r2
165 $ cd r2
160 $ cat <<EOF > .hg/hgrc
166 $ cat <<EOF > .hg/hgrc
161 > [ui]
167 > [ui]
162 > portablefilenames = ignore
168 > portablefilenames = ignore
163 > EOF
169 > EOF
164
170
165 $ hg import -q --bypass - <<EOF
171 $ hg import -q --bypass - <<EOF
166 > # HG changeset patch
172 > # HG changeset patch
167 > # User test
173 > # User test
168 > # Date 0 0
174 > # Date 0 0
169 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
175 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
170 > # Parent 0000000000000000000000000000000000000000
176 > # Parent 0000000000000000000000000000000000000000
171 > 1
177 > 1
172 >
178 >
173 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
179 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
174 > new file mode 100644
180 > new file mode 100644
175 > --- /dev/null
181 > --- /dev/null
176 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
182 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
177 > @@ -0,0 +1,1 @@
183 > @@ -0,0 +1,1 @@
178 > +foo
184 > +foo
179 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
185 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
180 > new file mode 100644
186 > new file mode 100644
181 > --- /dev/null
187 > --- /dev/null
182 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
188 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
183 > @@ -0,0 +1,1 @@
189 > @@ -0,0 +1,1 @@
184 > +foo
190 > +foo
185 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
191 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
186 > new file mode 100644
192 > new file mode 100644
187 > --- /dev/null
193 > --- /dev/null
188 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
194 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
189 > @@ -0,0 +1,1 @@
195 > @@ -0,0 +1,1 @@
190 > +foo
196 > +foo
191 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
197 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
192 > new file mode 100644
198 > new file mode 100644
193 > --- /dev/null
199 > --- /dev/null
194 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
200 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
195 > @@ -0,0 +1,1 @@
201 > @@ -0,0 +1,1 @@
196 > +foo
202 > +foo
197 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
203 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
198 > new file mode 100644
204 > new file mode 100644
199 > --- /dev/null
205 > --- /dev/null
200 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
206 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
201 > @@ -0,0 +1,1 @@
207 > @@ -0,0 +1,1 @@
202 > +foo
208 > +foo
203 > EOF
209 > EOF
204
210
205 $ find .hg/store -name *.i | sort
211 $ find .hg/store -name *.i | sort
206 .hg/store/00changelog.i
212 .hg/store/00changelog.i
207 .hg/store/00manifest.i
213 .hg/store/00manifest.i
208 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
214 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
209 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
215 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
210 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
216 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
211 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
217 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
212 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
218 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
213
219
214 $ cd ..
220 $ cd ..
215
221
216 Aborting lock does not prevent fncache writes
222 Aborting lock does not prevent fncache writes
217
223
218 $ cat > exceptionext.py <<EOF
224 $ cat > exceptionext.py <<EOF
219 > import os
225 > import os
220 > from mercurial import commands, error, extensions
226 > from mercurial import commands, error, extensions
221 >
227 >
222 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
228 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
223 > def releasewrap():
229 > def releasewrap():
224 > l.held = False # ensure __del__ is a noop
230 > l.held = False # ensure __del__ is a noop
225 > raise error.Abort(b"forced lock failure")
231 > raise error.Abort(b"forced lock failure")
226 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
232 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
227 > return l
233 > return l
228 >
234 >
229 > def reposetup(ui, repo):
235 > def reposetup(ui, repo):
230 > extensions.wrapfunction(repo, '_lock', lockexception)
236 > extensions.wrapfunction(repo, '_lock', lockexception)
231 >
237 >
232 > cmdtable = {}
238 > cmdtable = {}
233 >
239 >
234 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
240 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
235 > # at the end of dispatching (for intentional "forced lcok failure")
241 > # at the end of dispatching (for intentional "forced lcok failure")
236 > def commitwrap(orig, ui, repo, *pats, **opts):
242 > def commitwrap(orig, ui, repo, *pats, **opts):
237 > repo = repo.unfiltered() # to use replaced repo._lock certainly
243 > repo = repo.unfiltered() # to use replaced repo._lock certainly
238 > wlock = repo.wlock()
244 > wlock = repo.wlock()
239 > try:
245 > try:
240 > return orig(ui, repo, *pats, **opts)
246 > return orig(ui, repo, *pats, **opts)
241 > finally:
247 > finally:
242 > # multiple 'relase()' is needed for complete releasing wlock,
248 > # multiple 'relase()' is needed for complete releasing wlock,
243 > # because "forced" abort at last releasing store lock
249 > # because "forced" abort at last releasing store lock
244 > # prevents wlock from being released at same 'lockmod.release()'
250 > # prevents wlock from being released at same 'lockmod.release()'
245 > for i in range(wlock.held):
251 > for i in range(wlock.held):
246 > wlock.release()
252 > wlock.release()
247 >
253 >
248 > def extsetup(ui):
254 > def extsetup(ui):
249 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
255 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
250 > EOF
256 > EOF
251 $ extpath=`pwd`/exceptionext.py
257 $ extpath=`pwd`/exceptionext.py
252 $ hg init fncachetxn
258 $ hg init fncachetxn
253 $ cd fncachetxn
259 $ cd fncachetxn
254 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
260 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
255 $ touch y
261 $ touch y
256 $ hg ci -qAm y
262 $ hg ci -qAm y
257 abort: forced lock failure
263 abort: forced lock failure
258 [255]
264 [255]
259 $ cat .hg/store/fncache
265 $ cat .hg/store/fncache
260 data/y.i
266 data/y.i
261
267
262 Aborting transaction prevents fncache change
268 Aborting transaction prevents fncache change
263
269
264 $ cat > ../exceptionext.py <<EOF
270 $ cat > ../exceptionext.py <<EOF
265 > import os
271 > import os
266 > from mercurial import commands, error, extensions, localrepo
272 > from mercurial import commands, error, extensions, localrepo
267 >
273 >
268 > def wrapper(orig, self, *args, **kwargs):
274 > def wrapper(orig, self, *args, **kwargs):
269 > tr = orig(self, *args, **kwargs)
275 > tr = orig(self, *args, **kwargs)
270 > def fail(tr):
276 > def fail(tr):
271 > raise error.Abort(b"forced transaction failure")
277 > raise error.Abort(b"forced transaction failure")
272 > # zzz prefix to ensure it sorted after store.write
278 > # zzz prefix to ensure it sorted after store.write
273 > tr.addfinalize(b'zzz-forcefails', fail)
279 > tr.addfinalize(b'zzz-forcefails', fail)
274 > return tr
280 > return tr
275 >
281 >
276 > def uisetup(ui):
282 > def uisetup(ui):
277 > extensions.wrapfunction(
283 > extensions.wrapfunction(
278 > localrepo.localrepository, 'transaction', wrapper)
284 > localrepo.localrepository, 'transaction', wrapper)
279 >
285 >
280 > cmdtable = {}
286 > cmdtable = {}
281 >
287 >
282 > EOF
288 > EOF
283
289
284 Clean cached version
290 Clean cached version
285 $ rm -f "${extpath}c"
291 $ rm -f "${extpath}c"
286 $ rm -Rf "`dirname $extpath`/__pycache__"
292 $ rm -Rf "`dirname $extpath`/__pycache__"
287
293
288 $ touch z
294 $ touch z
289 $ hg ci -qAm z
295 $ hg ci -qAm z
290 transaction abort!
296 transaction abort!
291 rollback completed
297 rollback completed
292 abort: forced transaction failure
298 abort: forced transaction failure
293 [255]
299 [255]
294 $ cat .hg/store/fncache
300 $ cat .hg/store/fncache
295 data/y.i
301 data/y.i
296
302
297 Aborted transactions can be recovered later
303 Aborted transactions can be recovered later
298
304
299 $ cat > ../exceptionext.py <<EOF
305 $ cat > ../exceptionext.py <<EOF
300 > import os
306 > import os
301 > import signal
307 > import signal
302 > from mercurial import (
308 > from mercurial import (
303 > commands,
309 > commands,
304 > error,
310 > error,
305 > extensions,
311 > extensions,
306 > localrepo,
312 > localrepo,
307 > transaction,
313 > transaction,
308 > )
314 > )
309 >
315 >
310 > def trwrapper(orig, self, *args, **kwargs):
316 > def trwrapper(orig, self, *args, **kwargs):
311 > tr = orig(self, *args, **kwargs)
317 > tr = orig(self, *args, **kwargs)
312 > def fail(tr):
318 > def fail(tr):
313 > os.kill(os.getpid(), signal.SIGKILL)
319 > os.kill(os.getpid(), signal.SIGKILL)
314 > # zzz prefix to ensure it sorted after store.write
320 > # zzz prefix to ensure it sorted after store.write
315 > tr.addfinalize(b'zzz-forcefails', fail)
321 > tr.addfinalize(b'zzz-forcefails', fail)
316 > return tr
322 > return tr
317 >
323 >
318 > def uisetup(ui):
324 > def uisetup(ui):
319 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
325 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
320 > trwrapper)
326 > trwrapper)
321 >
327 >
322 > cmdtable = {}
328 > cmdtable = {}
323 >
329 >
324 > EOF
330 > EOF
325
331
326 Clean cached versions
332 Clean cached versions
327 $ rm -f "${extpath}c"
333 $ rm -f "${extpath}c"
328 $ rm -Rf "`dirname $extpath`/__pycache__"
334 $ rm -Rf "`dirname $extpath`/__pycache__"
329
335
330 $ hg up -q 1
336 $ hg up -q 1
331 $ touch z
337 $ touch z
332 # Cannot rely on the return code value as chg use a different one.
338 # Cannot rely on the return code value as chg use a different one.
333 # So we use a `|| echo` trick
339 # So we use a `|| echo` trick
334 # XXX-CHG fixing chg behavior would be nice here.
340 # XXX-CHG fixing chg behavior would be nice here.
335 $ hg ci -qAm z || echo "He's Dead, Jim." 2>/dev/null
341 $ hg ci -qAm z || echo "He's Dead, Jim." 2>/dev/null
336 *Killed* (glob) (?)
342 *Killed* (glob) (?)
337 He's Dead, Jim.
343 He's Dead, Jim.
338 $ cat .hg/store/fncache | sort
344 $ cat .hg/store/fncache | sort
339 data/y.i
345 data/y.i
340 data/z.i
346 data/z.i
341 $ hg recover --verify
347 $ hg recover --verify
342 rolling back interrupted transaction
348 rolling back interrupted transaction
343 checking changesets
349 checking changesets
344 checking manifests
350 checking manifests
345 crosschecking files in changesets and manifests
351 crosschecking files in changesets and manifests
346 checking files
352 checking files
347 checking dirstate
353 checking dirstate
348 checked 1 changesets with 1 changes to 1 files
354 checked 1 changesets with 1 changes to 1 files
349 $ cat .hg/store/fncache
355 $ cat .hg/store/fncache
350 data/y.i
356 data/y.i
351
357
352 $ cd ..
358 $ cd ..
353
359
354 debugrebuildfncache does nothing unless repo has fncache requirement
360 debugrebuildfncache does nothing unless repo has fncache requirement
355
361
356 $ hg --config format.usefncache=false init nofncache
362 $ hg --config format.usefncache=false init nofncache
357 $ cd nofncache
363 $ cd nofncache
358 $ hg debugrebuildfncache
364 $ hg debugrebuildfncache
359 (not rebuilding fncache because repository does not support fncache)
365 (not rebuilding fncache because repository does not support fncache)
360
366
361 $ cd ..
367 $ cd ..
362
368
363 debugrebuildfncache works on empty repository
369 debugrebuildfncache works on empty repository
364
370
365 $ hg init empty
371 $ hg init empty
366 $ cd empty
372 $ cd empty
367 $ hg debugrebuildfncache
373 $ hg debugrebuildfncache
368 fncache already up to date
374 fncache already up to date
369 $ cd ..
375 $ cd ..
370
376
371 debugrebuildfncache on an up to date repository no-ops
377 debugrebuildfncache on an up to date repository no-ops
372
378
373 $ hg init repo
379 $ hg init repo
374 $ cd repo
380 $ cd repo
375 $ echo initial > foo
381 $ echo initial > foo
376 $ echo initial > .bar
382 $ echo initial > .bar
377 $ hg commit -A -m initial
383 $ hg commit -A -m initial
378 adding .bar
384 adding .bar
379 adding foo
385 adding foo
380
386
381 $ cat .hg/store/fncache | sort
387 $ cat .hg/store/fncache | sort
382 data/.bar.i
388 data/.bar.i
383 data/foo.i
389 data/foo.i
384
390
385 $ hg debugrebuildfncache
391 $ hg debugrebuildfncache
386 fncache already up to date
392 fncache already up to date
387
393
388 debugrebuildfncache restores deleted fncache file
394 debugrebuildfncache restores deleted fncache file
389
395
390 $ rm -f .hg/store/fncache
396 $ rm -f .hg/store/fncache
391 $ hg debugrebuildfncache
397 $ hg debugrebuildfncache
392 adding data/.bar.i
398 adding data/.bar.i
393 adding data/foo.i
399 adding data/foo.i
394 2 items added, 0 removed from fncache
400 2 items added, 0 removed from fncache
395
401
396 $ cat .hg/store/fncache | sort
402 $ cat .hg/store/fncache | sort
397 data/.bar.i
403 data/.bar.i
398 data/foo.i
404 data/foo.i
399
405
400 Rebuild after rebuild should no-op
406 Rebuild after rebuild should no-op
401
407
402 $ hg debugrebuildfncache
408 $ hg debugrebuildfncache
403 fncache already up to date
409 fncache already up to date
404
410
405 A single missing file should get restored, an extra file should be removed
411 A single missing file should get restored, an extra file should be removed
406
412
407 $ cat > .hg/store/fncache << EOF
413 $ cat > .hg/store/fncache << EOF
408 > data/foo.i
414 > data/foo.i
409 > data/bad-entry.i
415 > data/bad-entry.i
410 > EOF
416 > EOF
411
417
412 $ hg debugrebuildfncache
418 $ hg debugrebuildfncache
413 removing data/bad-entry.i
419 removing data/bad-entry.i
414 adding data/.bar.i
420 adding data/.bar.i
415 1 items added, 1 removed from fncache
421 1 items added, 1 removed from fncache
416
422
417 $ cat .hg/store/fncache | sort
423 $ cat .hg/store/fncache | sort
418 data/.bar.i
424 data/.bar.i
419 data/foo.i
425 data/foo.i
420
426
421 debugrebuildfncache recovers from truncated line in fncache
427 debugrebuildfncache recovers from truncated line in fncache
422
428
423 $ printf a > .hg/store/fncache
429 $ printf a > .hg/store/fncache
424 $ hg debugrebuildfncache
430 $ hg debugrebuildfncache
425 fncache does not ends with a newline
431 fncache does not ends with a newline
426 adding data/.bar.i
432 adding data/.bar.i
427 adding data/foo.i
433 adding data/foo.i
428 2 items added, 0 removed from fncache
434 2 items added, 0 removed from fncache
429
435
430 $ cat .hg/store/fncache | sort
436 $ cat .hg/store/fncache | sort
431 data/.bar.i
437 data/.bar.i
432 data/foo.i
438 data/foo.i
433
439
434 $ cd ..
440 $ cd ..
435
441
436 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
442 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
437
443
438 $ hg --config format.dotencode=false init nodotencode
444 $ hg --config format.dotencode=false init nodotencode
439 $ cd nodotencode
445 $ cd nodotencode
440 $ echo initial > foo
446 $ echo initial > foo
441 $ echo initial > .bar
447 $ echo initial > .bar
442 $ hg commit -A -m initial
448 $ hg commit -A -m initial
443 adding .bar
449 adding .bar
444 adding foo
450 adding foo
445
451
446 $ cat .hg/store/fncache | sort
452 $ cat .hg/store/fncache | sort
447 data/.bar.i
453 data/.bar.i
448 data/foo.i
454 data/foo.i
449
455
450 $ rm .hg/store/fncache
456 $ rm .hg/store/fncache
451 $ hg debugrebuildfncache
457 $ hg debugrebuildfncache
452 adding data/.bar.i
458 adding data/.bar.i
453 adding data/foo.i
459 adding data/foo.i
454 2 items added, 0 removed from fncache
460 2 items added, 0 removed from fncache
455
461
456 $ cat .hg/store/fncache | sort
462 $ cat .hg/store/fncache | sort
457 data/.bar.i
463 data/.bar.i
458 data/foo.i
464 data/foo.i
459
465
460 $ cd ..
466 $ cd ..
461
467
462 In repositories that have accumulated a large number of files over time, the
468 In repositories that have accumulated a large number of files over time, the
463 fncache file is going to be large. If we possibly can avoid loading it, so much the better.
469 fncache file is going to be large. If we possibly can avoid loading it, so much the better.
464 The cache should not loaded when committing changes to existing files, or when unbundling
470 The cache should not loaded when committing changes to existing files, or when unbundling
465 changesets that only contain changes to existing files:
471 changesets that only contain changes to existing files:
466
472
467 $ cat > fncacheloadwarn.py << EOF
473 $ cat > fncacheloadwarn.py << EOF
468 > from mercurial import extensions, localrepo
474 > from mercurial import extensions, localrepo
469 >
475 >
470 > def extsetup(ui):
476 > def extsetup(ui):
471 > def wrapstore(orig, requirements, *args):
477 > def wrapstore(orig, requirements, *args):
472 > store = orig(requirements, *args)
478 > store = orig(requirements, *args)
473 > if b'store' in requirements and b'fncache' in requirements:
479 > if b'store' in requirements and b'fncache' in requirements:
474 > instrumentfncachestore(store, ui)
480 > instrumentfncachestore(store, ui)
475 > return store
481 > return store
476 > extensions.wrapfunction(localrepo, 'makestore', wrapstore)
482 > extensions.wrapfunction(localrepo, 'makestore', wrapstore)
477 >
483 >
478 > def instrumentfncachestore(fncachestore, ui):
484 > def instrumentfncachestore(fncachestore, ui):
479 > class instrumentedfncache(type(fncachestore.fncache)):
485 > class instrumentedfncache(type(fncachestore.fncache)):
480 > def _load(self):
486 > def _load(self):
481 > ui.warn(b'fncache load triggered!\n')
487 > ui.warn(b'fncache load triggered!\n')
482 > super(instrumentedfncache, self)._load()
488 > super(instrumentedfncache, self)._load()
483 > fncachestore.fncache.__class__ = instrumentedfncache
489 > fncachestore.fncache.__class__ = instrumentedfncache
484 > EOF
490 > EOF
485
491
486 $ fncachextpath=`pwd`/fncacheloadwarn.py
492 $ fncachextpath=`pwd`/fncacheloadwarn.py
487 $ hg init nofncacheload
493 $ hg init nofncacheload
488 $ cd nofncacheload
494 $ cd nofncacheload
489 $ printf "[extensions]\nfncacheloadwarn=$fncachextpath\n" >> .hg/hgrc
495 $ printf "[extensions]\nfncacheloadwarn=$fncachextpath\n" >> .hg/hgrc
490
496
491 A new file should trigger a load, as we'd want to update the fncache set in that case:
497 A new file should trigger a load, as we'd want to update the fncache set in that case:
492
498
493 $ touch foo
499 $ touch foo
494 $ hg ci -qAm foo
500 $ hg ci -qAm foo
495 fncache load triggered!
501 fncache load triggered!
496
502
497 But modifying that file should not:
503 But modifying that file should not:
498
504
499 $ echo bar >> foo
505 $ echo bar >> foo
500 $ hg ci -qm foo
506 $ hg ci -qm foo
501
507
502 If a transaction has been aborted, the zero-size truncated index file will
508 If a transaction has been aborted, the zero-size truncated index file will
503 not prevent the fncache from being loaded; rather than actually abort
509 not prevent the fncache from being loaded; rather than actually abort
504 a transaction, we simulate the situation by creating a zero-size index file:
510 a transaction, we simulate the situation by creating a zero-size index file:
505
511
506 $ touch .hg/store/data/bar.i
512 $ touch .hg/store/data/bar.i
507 $ touch bar
513 $ touch bar
508 $ hg ci -qAm bar
514 $ hg ci -qAm bar
509 fncache load triggered!
515 fncache load triggered!
510
516
511 Unbundling should follow the same rules; existing files should not cause a load:
517 Unbundling should follow the same rules; existing files should not cause a load:
512
518
513 (loading during the clone is expected)
519 (loading during the clone is expected)
514 $ hg clone -q . tobundle
520 $ hg clone -q . tobundle
515 fncache load triggered!
521 fncache load triggered!
516 fncache load triggered!
522 fncache load triggered!
517 fncache load triggered!
523 fncache load triggered!
518
524
519 $ echo 'new line' > tobundle/bar
525 $ echo 'new line' > tobundle/bar
520 $ hg -R tobundle ci -qm bar
526 $ hg -R tobundle ci -qm bar
521 $ hg -R tobundle bundle -q barupdated.hg
527 $ hg -R tobundle bundle -q barupdated.hg
522 $ hg unbundle -q barupdated.hg
528 $ hg unbundle -q barupdated.hg
523
529
524 but adding new files should:
530 but adding new files should:
525
531
526 $ touch tobundle/newfile
532 $ touch tobundle/newfile
527 $ hg -R tobundle ci -qAm newfile
533 $ hg -R tobundle ci -qAm newfile
528 $ hg -R tobundle bundle -q newfile.hg
534 $ hg -R tobundle bundle -q newfile.hg
529 $ hg unbundle -q newfile.hg
535 $ hg unbundle -q newfile.hg
530 fncache load triggered!
536 fncache load triggered!
531
537
532 $ cd ..
538 $ cd ..
@@ -1,425 +1,469 b''
1 #require hardlink reporevlogstore
1 #require hardlink reporevlogstore
2
2
3 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
4 > import sys
4 > import sys
5 > from mercurial import pycompat, util
5 > from mercurial import pycompat, util
6 > for f in sorted(sys.stdin.readlines()):
6 > for f in sorted(sys.stdin.readlines()):
7 > f = f[:-1]
7 > f = f[:-1]
8 > print(util.nlinks(pycompat.fsencode(f)), f)
8 > print(util.nlinks(pycompat.fsencode(f)), f)
9 > EOF
9 > EOF
10
10
11 $ nlinksdir()
11 $ nlinksdir()
12 > {
12 > {
13 > find "$@" -type f | "$PYTHON" $TESTTMP/nlinks.py
13 > find "$@" -type f | "$PYTHON" $TESTTMP/nlinks.py
14 > }
14 > }
15
15
16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
16 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
17
17
18 $ cat > linkcp.py <<EOF
18 $ cat > linkcp.py <<EOF
19 > import sys
19 > import sys
20 > from mercurial import pycompat, util
20 > from mercurial import pycompat, util
21 > util.copyfiles(pycompat.fsencode(sys.argv[1]),
21 > util.copyfiles(pycompat.fsencode(sys.argv[1]),
22 > pycompat.fsencode(sys.argv[2]), hardlink=True)
22 > pycompat.fsencode(sys.argv[2]), hardlink=True)
23 > EOF
23 > EOF
24
24
25 $ linkcp()
25 $ linkcp()
26 > {
26 > {
27 > "$PYTHON" $TESTTMP/linkcp.py $1 $2
27 > "$PYTHON" $TESTTMP/linkcp.py $1 $2
28 > }
28 > }
29
29
30 Prepare repo r1:
30 Prepare repo r1:
31
31
32 $ hg init r1
32 $ hg init r1
33 $ cd r1
33 $ cd r1
34
34
35 $ echo c1 > f1
35 $ echo c1 > f1
36 $ hg add f1
36 $ hg add f1
37 $ hg ci -m0
37 $ hg ci -m0
38
38
39 $ mkdir d1
39 $ mkdir d1
40 $ cd d1
40 $ cd d1
41 $ echo c2 > f2
41 $ echo c2 > f2
42 $ hg add f2
42 $ hg add f2
43 $ hg ci -m1
43 $ hg ci -m1
44 $ cd ../..
44 $ cd ../..
45
45
46 $ nlinksdir r1/.hg/store
46 $ nlinksdir r1/.hg/store
47 1 r1/.hg/store/00changelog-b870a51b.nd (rust !)
48 1 r1/.hg/store/00changelog.d
47 1 r1/.hg/store/00changelog.i
49 1 r1/.hg/store/00changelog.i
50 1 r1/.hg/store/00changelog.n (rust !)
48 1 r1/.hg/store/00manifest.i
51 1 r1/.hg/store/00manifest.i
49 1 r1/.hg/store/data/d1/f2.i
52 1 r1/.hg/store/data/d1/f2.i
50 1 r1/.hg/store/data/f1.i
53 1 r1/.hg/store/data/f1.i
51 1 r1/.hg/store/fncache (repofncache !)
54 1 r1/.hg/store/fncache (repofncache !)
52 1 r1/.hg/store/phaseroots
55 1 r1/.hg/store/phaseroots
53 1 r1/.hg/store/requires
56 1 r1/.hg/store/requires
54 1 r1/.hg/store/undo
57 1 r1/.hg/store/undo
58 1 r1/.hg/store/undo.backup.00changelog.n.bck (rust !)
55 1 r1/.hg/store/undo.backup.fncache.bck (repofncache !)
59 1 r1/.hg/store/undo.backup.fncache.bck (repofncache !)
56 1 r1/.hg/store/undo.backupfiles
60 1 r1/.hg/store/undo.backupfiles
57
61
58
62
59 Create hardlinked clone r2:
63 Create hardlinked clone r2:
60
64
61 $ hg clone -U --debug r1 r2 --config progress.debug=true
65 $ hg clone -U --debug r1 r2 --config progress.debug=true
62 linking: 1/7 files (14.29%)
66 linking: 1/8 files (12.50%) (no-rust !)
63 linking: 2/7 files (28.57%)
67 linking: 2/8 files (25.00%) (no-rust !)
64 linking: 3/7 files (42.86%)
68 linking: 3/8 files (37.50%) (no-rust !)
65 linking: 4/7 files (57.14%)
69 linking: 4/8 files (50.00%) (no-rust !)
66 linking: 5/7 files (71.43%)
70 linking: 5/8 files (62.50%) (no-rust !)
67 linking: 6/7 files (85.71%)
71 linking: 6/8 files (75.00%) (no-rust !)
68 linking: 7/7 files (100.00%)
72 linking: 7/8 files (87.50%) (no-rust !)
69 linked 7 files
73 linking: 8/8 files (100.00%) (no-rust !)
74 linked 8 files (no-rust !)
75 linking: 1/10 files (10.00%) (rust !)
76 linking: 2/10 files (20.00%) (rust !)
77 linking: 3/10 files (30.00%) (rust !)
78 linking: 4/10 files (40.00%) (rust !)
79 linking: 5/10 files (50.00%) (rust !)
80 linking: 6/10 files (60.00%) (rust !)
81 linking: 7/10 files (70.00%) (rust !)
82 linking: 8/10 files (80.00%) (rust !)
83 linking: 9/10 files (90.00%) (rust !)
84 linking: 10/10 files (100.00%) (rust !)
85 linked 10 files (rust !)
70 updating the branch cache
86 updating the branch cache
71
87
72 Create non-hardlinked clone r3:
88 Create non-hardlinked clone r3:
73
89
74 $ hg clone --pull r1 r3
90 $ hg clone --pull r1 r3
75 requesting all changes
91 requesting all changes
76 adding changesets
92 adding changesets
77 adding manifests
93 adding manifests
78 adding file changes
94 adding file changes
79 added 2 changesets with 2 changes to 2 files
95 added 2 changesets with 2 changes to 2 files
80 new changesets 40d85e9847f2:7069c422939c
96 new changesets 40d85e9847f2:7069c422939c
81 updating to branch default
97 updating to branch default
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83
99
84
100
85 Repos r1 and r2 should now contain hardlinked files:
101 Repos r1 and r2 should now contain hardlinked files:
86
102
87 $ nlinksdir r1/.hg/store
103 $ nlinksdir r1/.hg/store
104 1 r1/.hg/store/00changelog-b870a51b.nd (rust !)
105 2 r1/.hg/store/00changelog.d
88 2 r1/.hg/store/00changelog.i
106 2 r1/.hg/store/00changelog.i
107 1 r1/.hg/store/00changelog.n (rust !)
89 2 r1/.hg/store/00manifest.i
108 2 r1/.hg/store/00manifest.i
90 2 r1/.hg/store/data/d1/f2.i
109 2 r1/.hg/store/data/d1/f2.i
91 2 r1/.hg/store/data/f1.i
110 2 r1/.hg/store/data/f1.i
92 1 r1/.hg/store/fncache (repofncache !)
111 1 r1/.hg/store/fncache (repofncache !)
93 1 r1/.hg/store/phaseroots
112 1 r1/.hg/store/phaseroots
94 1 r1/.hg/store/requires
113 1 r1/.hg/store/requires
95 1 r1/.hg/store/undo
114 1 r1/.hg/store/undo
115 1 r1/.hg/store/undo.backup.00changelog.n.bck (rust !)
96 1 r1/.hg/store/undo.backup.fncache.bck (repofncache !)
116 1 r1/.hg/store/undo.backup.fncache.bck (repofncache !)
97 1 r1/.hg/store/undo.backupfiles
117 1 r1/.hg/store/undo.backupfiles
98
118
99 $ nlinksdir r2/.hg/store
119 $ nlinksdir r2/.hg/store
120 1 r2/.hg/store/00changelog-b870a51b.nd (rust !)
121 2 r2/.hg/store/00changelog.d
100 2 r2/.hg/store/00changelog.i
122 2 r2/.hg/store/00changelog.i
123 1 r2/.hg/store/00changelog.n (rust !)
101 2 r2/.hg/store/00manifest.i
124 2 r2/.hg/store/00manifest.i
102 2 r2/.hg/store/data/d1/f2.i
125 2 r2/.hg/store/data/d1/f2.i
103 2 r2/.hg/store/data/f1.i
126 2 r2/.hg/store/data/f1.i
104 1 r2/.hg/store/fncache (repofncache !)
127 1 r2/.hg/store/fncache (repofncache !)
105 1 r2/.hg/store/requires
128 1 r2/.hg/store/requires
106
129
107 Repo r3 should not be hardlinked:
130 Repo r3 should not be hardlinked:
108
131
109 $ nlinksdir r3/.hg/store
132 $ nlinksdir r3/.hg/store
133 1 r3/.hg/store/00changelog-88698448.nd (rust !)
134 1 r3/.hg/store/00changelog.d
110 1 r3/.hg/store/00changelog.i
135 1 r3/.hg/store/00changelog.i
136 1 r3/.hg/store/00changelog.n (rust !)
111 1 r3/.hg/store/00manifest.i
137 1 r3/.hg/store/00manifest.i
112 1 r3/.hg/store/data/d1/f2.i
138 1 r3/.hg/store/data/d1/f2.i
113 1 r3/.hg/store/data/f1.i
139 1 r3/.hg/store/data/f1.i
114 1 r3/.hg/store/fncache (repofncache !)
140 1 r3/.hg/store/fncache (repofncache !)
115 1 r3/.hg/store/phaseroots
141 1 r3/.hg/store/phaseroots
116 1 r3/.hg/store/requires
142 1 r3/.hg/store/requires
117 1 r3/.hg/store/undo
143 1 r3/.hg/store/undo
118 1 r3/.hg/store/undo.backupfiles
144 1 r3/.hg/store/undo.backupfiles
119
145
120
146
121 Create a non-inlined filelog in r3:
147 Create a non-inlined filelog in r3:
122
148
123 $ cd r3/d1
149 $ cd r3/d1
124 >>> f = open('data1', 'wb')
150 >>> f = open('data1', 'wb')
125 >>> for x in range(10000):
151 >>> for x in range(10000):
126 ... f.write(b"%d\n" % x) and None
152 ... f.write(b"%d\n" % x) and None
127 >>> f.close()
153 >>> f.close()
128 $ for j in 0 1 2 3 4 5 6 7 8 9; do
154 $ for j in 0 1 2 3 4 5 6 7 8 9; do
129 > cat data1 >> f2
155 > cat data1 >> f2
130 > hg commit -m$j
156 > hg commit -m$j
131 > done
157 > done
132 $ cd ../..
158 $ cd ../..
133
159
134 $ nlinksdir r3/.hg/store
160 $ nlinksdir r3/.hg/store
161 1 r3/.hg/store/00changelog-ea337809.nd (rust !)
162 1 r3/.hg/store/00changelog.d
135 1 r3/.hg/store/00changelog.i
163 1 r3/.hg/store/00changelog.i
164 1 r3/.hg/store/00changelog.n (rust !)
136 1 r3/.hg/store/00manifest.i
165 1 r3/.hg/store/00manifest.i
137 1 r3/.hg/store/data/d1/f2.d
166 1 r3/.hg/store/data/d1/f2.d
138 1 r3/.hg/store/data/d1/f2.i
167 1 r3/.hg/store/data/d1/f2.i
139 1 r3/.hg/store/data/f1.i
168 1 r3/.hg/store/data/f1.i
140 1 r3/.hg/store/fncache (repofncache !)
169 1 r3/.hg/store/fncache (repofncache !)
141 1 r3/.hg/store/phaseroots
170 1 r3/.hg/store/phaseroots
142 1 r3/.hg/store/requires
171 1 r3/.hg/store/requires
143 1 r3/.hg/store/undo
172 1 r3/.hg/store/undo
173 1 r3/.hg/store/undo.backup.00changelog.n.bck (rust !)
144 1 r3/.hg/store/undo.backupfiles
174 1 r3/.hg/store/undo.backupfiles
145
175
146 Push to repo r1 should break up most hardlinks in r2:
176 Push to repo r1 should break up most hardlinks in r2:
147
177
148 $ hg -R r2 verify -q
178 $ hg -R r2 verify -q
149
179
150 $ cd r3
180 $ cd r3
151 $ hg push
181 $ hg push
152 pushing to $TESTTMP/r1
182 pushing to $TESTTMP/r1
153 searching for changes
183 searching for changes
154 adding changesets
184 adding changesets
155 adding manifests
185 adding manifests
156 adding file changes
186 adding file changes
157 added 10 changesets with 10 changes to 1 files
187 added 10 changesets with 10 changes to 1 files
158
188
159 $ cd ..
189 $ cd ..
160
190
161 $ nlinksdir r2/.hg/store
191 $ nlinksdir r2/.hg/store
192 1 r2/.hg/store/00changelog-b870a51b.nd (rust !)
193 1 r2/.hg/store/00changelog.d
162 1 r2/.hg/store/00changelog.i
194 1 r2/.hg/store/00changelog.i
195 1 r2/.hg/store/00changelog.n (rust !)
163 1 r2/.hg/store/00manifest.i
196 1 r2/.hg/store/00manifest.i
164 1 r2/.hg/store/data/d1/f2.i
197 1 r2/.hg/store/data/d1/f2.i
165 2 r2/.hg/store/data/f1.i
198 2 r2/.hg/store/data/f1.i
166 [12] r2/\.hg/store/fncache (re) (repofncache !)
199 [12] r2/\.hg/store/fncache (re) (repofncache !)
167 1 r2/.hg/store/requires
200 1 r2/.hg/store/requires
168
201
169 #if hardlink-whitelisted repofncache
202 #if hardlink-whitelisted repofncache
170 $ nlinksdir r2/.hg/store/fncache
203 $ nlinksdir r2/.hg/store/fncache
171 1 r2/.hg/store/fncache
204 1 r2/.hg/store/fncache
172 #endif
205 #endif
173
206
174 $ hg -R r2 verify -q
207 $ hg -R r2 verify -q
175
208
176 $ cd r1
209 $ cd r1
177 $ hg up
210 $ hg up
178 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
179
212
180 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
213 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
181
214
182 $ echo c1c1 >> f1
215 $ echo c1c1 >> f1
183 $ hg ci -m00
216 $ hg ci -m00
184 $ cd ..
217 $ cd ..
185
218
186 $ nlinksdir r2/.hg/store
219 $ nlinksdir r2/.hg/store
220 1 r2/.hg/store/00changelog-b870a51b.nd (rust !)
221 1 r2/.hg/store/00changelog.d
187 1 r2/.hg/store/00changelog.i
222 1 r2/.hg/store/00changelog.i
223 1 r2/.hg/store/00changelog.n (rust !)
188 1 r2/.hg/store/00manifest.i
224 1 r2/.hg/store/00manifest.i
189 1 r2/.hg/store/data/d1/f2.i
225 1 r2/.hg/store/data/d1/f2.i
190 1 r2/.hg/store/data/f1.i
226 1 r2/.hg/store/data/f1.i
191 1 r2/.hg/store/fncache (repofncache !)
227 1 r2/.hg/store/fncache (repofncache !)
192 1 r2/.hg/store/requires
228 1 r2/.hg/store/requires
193
229
194 #if hardlink-whitelisted repofncache
230 #if hardlink-whitelisted repofncache
195 $ nlinksdir r2/.hg/store/fncache
231 $ nlinksdir r2/.hg/store/fncache
196 1 r2/.hg/store/fncache
232 1 r2/.hg/store/fncache
197 #endif
233 #endif
198
234
199 Create a file which exec permissions we will change
235 Create a file which exec permissions we will change
200 $ cd r3
236 $ cd r3
201 $ echo "echo hello world" > f3
237 $ echo "echo hello world" > f3
202 $ hg add f3
238 $ hg add f3
203 $ hg ci -mf3
239 $ hg ci -mf3
204 $ cd ..
240 $ cd ..
205
241
206 $ cd r3
242 $ cd r3
207 $ hg tip --template '{rev}:{node|short}\n'
243 $ hg tip --template '{rev}:{node|short}\n'
208 12:d3b77733a28a
244 12:d3b77733a28a
209 $ echo bla > f1
245 $ echo bla > f1
210 $ chmod +x f3
246 $ chmod +x f3
211 $ hg ci -m1
247 $ hg ci -m1
212 $ cd ..
248 $ cd ..
213
249
214 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
250 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
215
251
216 $ linkcp r3 r4
252 $ linkcp r3 r4
217
253
218 'checklink' is produced by hardlinking a symlink, which is undefined whether
254 'checklink' is produced by hardlinking a symlink, which is undefined whether
219 the symlink should be followed or not. It does behave differently on Linux and
255 the symlink should be followed or not. It does behave differently on Linux and
220 BSD. Just remove it so the test pass on both platforms.
256 BSD. Just remove it so the test pass on both platforms.
221
257
222 $ rm -f r4/.hg/wcache/checklink
258 $ rm -f r4/.hg/wcache/checklink
223
259
224 r4 has hardlinks in the working dir (not just inside .hg):
260 r4 has hardlinks in the working dir (not just inside .hg):
225
261
226 $ nlinksdir r4
262 $ nlinksdir r4
227 2 r4/.hg/00changelog.i
263 2 r4/.hg/00changelog.i
228 [24] r4/.hg/branch (re)
264 [24] r4/.hg/branch (re)
229 2 r4/.hg/cache/branch2-base
265 2 r4/.hg/cache/branch2-base
230 2 r4/.hg/cache/branch2-immutable
266 2 r4/.hg/cache/branch2-immutable
231 2 r4/.hg/cache/branch2-served
267 2 r4/.hg/cache/branch2-served
232 2 r4/.hg/cache/branch2-served.hidden
268 2 r4/.hg/cache/branch2-served.hidden
233 2 r4/.hg/cache/branch2-visible
269 2 r4/.hg/cache/branch2-visible
234 2 r4/.hg/cache/branch2-visible-hidden
270 2 r4/.hg/cache/branch2-visible-hidden
235 2 r4/.hg/cache/rbc-names-v1
271 2 r4/.hg/cache/rbc-names-v1
236 2 r4/.hg/cache/rbc-revs-v1
272 2 r4/.hg/cache/rbc-revs-v1
237 2 r4/.hg/cache/tags2
273 2 r4/.hg/cache/tags2
238 2 r4/.hg/cache/tags2-served
274 2 r4/.hg/cache/tags2-served
239 2 r4/.hg/dirstate
275 2 r4/.hg/dirstate
240 2 r4/.hg/fsmonitor.state (fsmonitor !)
276 2 r4/.hg/fsmonitor.state (fsmonitor !)
241 2 r4/.hg/hgrc
277 2 r4/.hg/hgrc
242 2 r4/.hg/last-message.txt
278 2 r4/.hg/last-message.txt
243 2 r4/.hg/requires
279 2 r4/.hg/requires
280 2 r4/.hg/store/00changelog-7f2eb713.nd (rust !)
281 2 r4/.hg/store/00changelog.d
244 2 r4/.hg/store/00changelog.i
282 2 r4/.hg/store/00changelog.i
283 2 r4/.hg/store/00changelog.n (rust !)
245 2 r4/.hg/store/00manifest.i
284 2 r4/.hg/store/00manifest.i
246 2 r4/.hg/store/data/d1/f2.d
285 2 r4/.hg/store/data/d1/f2.d
247 2 r4/.hg/store/data/d1/f2.i
286 2 r4/.hg/store/data/d1/f2.i
248 2 r4/.hg/store/data/f1.i
287 2 r4/.hg/store/data/f1.i
249 2 r4/.hg/store/data/f3.i
288 2 r4/.hg/store/data/f3.i
250 2 r4/.hg/store/fncache (repofncache !)
289 2 r4/.hg/store/fncache (repofncache !)
251 2 r4/.hg/store/phaseroots
290 2 r4/.hg/store/phaseroots
252 2 r4/.hg/store/requires
291 2 r4/.hg/store/requires
253 2 r4/.hg/store/undo
292 2 r4/.hg/store/undo
293 2 r4/.hg/store/undo.backup.00changelog.n.bck (rust !)
254 2 r4/.hg/store/undo.backupfiles
294 2 r4/.hg/store/undo.backupfiles
255 [24] r4/.hg/undo.backup.branch.bck (re)
295 [24] r4/.hg/undo.backup.branch.bck (re)
256 2 r4/\.hg/undo\.backup\.dirstate.bck (re)
296 2 r4/\.hg/undo\.backup\.dirstate.bck (re)
257 2 r4/.hg/undo.desc
297 2 r4/.hg/undo.desc
258 2 r4/.hg/wcache/checkisexec (execbit !)
298 2 r4/.hg/wcache/checkisexec (execbit !)
259 2 r4/.hg/wcache/checklink-target (symlink !)
299 2 r4/.hg/wcache/checklink-target (symlink !)
260 2 r4/.hg/wcache/checknoexec (execbit !)
300 2 r4/.hg/wcache/checknoexec (execbit !)
261 2 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
301 2 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
262 2 r4/d1/data1
302 2 r4/d1/data1
263 2 r4/d1/f2
303 2 r4/d1/f2
264 2 r4/f1
304 2 r4/f1
265 2 r4/f3
305 2 r4/f3
266
306
267 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
307 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
268 #if hardlink-whitelisted
308 #if hardlink-whitelisted
269 $ nlinksdir r4/.hg/undo.backup.dirstate.bck r4/.hg/dirstate
309 $ nlinksdir r4/.hg/undo.backup.dirstate.bck r4/.hg/dirstate
270 2 r4/.hg/dirstate
310 2 r4/.hg/dirstate
271 2 r4/.hg/undo.backup.dirstate.bck
311 2 r4/.hg/undo.backup.dirstate.bck
272 #endif
312 #endif
273
313
274
314
275 $ hg -R r4 up 12
315 $ hg -R r4 up 12
276 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
316 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
317 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
278
318
279 $ nlinksdir r4
319 $ nlinksdir r4
280 2 r4/.hg/00changelog.i
320 2 r4/.hg/00changelog.i
281 1 r4/.hg/branch
321 1 r4/.hg/branch
282 2 r4/.hg/cache/branch2-base
322 2 r4/.hg/cache/branch2-base
283 2 r4/.hg/cache/branch2-immutable
323 2 r4/.hg/cache/branch2-immutable
284 2 r4/.hg/cache/branch2-served
324 2 r4/.hg/cache/branch2-served
285 2 r4/.hg/cache/branch2-served.hidden
325 2 r4/.hg/cache/branch2-served.hidden
286 2 r4/.hg/cache/branch2-visible
326 2 r4/.hg/cache/branch2-visible
287 2 r4/.hg/cache/branch2-visible-hidden
327 2 r4/.hg/cache/branch2-visible-hidden
288 2 r4/.hg/cache/rbc-names-v1
328 2 r4/.hg/cache/rbc-names-v1
289 2 r4/.hg/cache/rbc-revs-v1
329 2 r4/.hg/cache/rbc-revs-v1
290 2 r4/.hg/cache/tags2
330 2 r4/.hg/cache/tags2
291 2 r4/.hg/cache/tags2-served
331 2 r4/.hg/cache/tags2-served
292 1 r4/.hg/dirstate
332 1 r4/.hg/dirstate
293 1 r4/.hg/fsmonitor.state (fsmonitor !)
333 1 r4/.hg/fsmonitor.state (fsmonitor !)
294 2 r4/.hg/hgrc
334 2 r4/.hg/hgrc
295 2 r4/.hg/last-message.txt
335 2 r4/.hg/last-message.txt
296 2 r4/.hg/requires
336 2 r4/.hg/requires
337 2 r4/.hg/store/00changelog-7f2eb713.nd (rust !)
338 2 r4/.hg/store/00changelog.d
297 2 r4/.hg/store/00changelog.i
339 2 r4/.hg/store/00changelog.i
340 2 r4/.hg/store/00changelog.n (rust !)
298 2 r4/.hg/store/00manifest.i
341 2 r4/.hg/store/00manifest.i
299 2 r4/.hg/store/data/d1/f2.d
342 2 r4/.hg/store/data/d1/f2.d
300 2 r4/.hg/store/data/d1/f2.i
343 2 r4/.hg/store/data/d1/f2.i
301 2 r4/.hg/store/data/f1.i
344 2 r4/.hg/store/data/f1.i
302 2 r4/.hg/store/data/f3.i
345 2 r4/.hg/store/data/f3.i
303 2 r4/.hg/store/fncache
346 2 r4/.hg/store/fncache
304 2 r4/.hg/store/phaseroots
347 2 r4/.hg/store/phaseroots
305 2 r4/.hg/store/requires
348 2 r4/.hg/store/requires
306 2 r4/.hg/store/undo
349 2 r4/.hg/store/undo
350 2 r4/.hg/store/undo.backup.00changelog.n.bck (rust !)
307 2 r4/.hg/store/undo.backupfiles
351 2 r4/.hg/store/undo.backupfiles
308 [23] r4/.hg/undo.backup.branch.bck (re)
352 [23] r4/.hg/undo.backup.branch.bck (re)
309 2 r4/\.hg/undo\.backup\.dirstate.bck (re)
353 2 r4/\.hg/undo\.backup\.dirstate.bck (re)
310 2 r4/.hg/undo.desc
354 2 r4/.hg/undo.desc
311 2 r4/.hg/wcache/checkisexec (execbit !)
355 2 r4/.hg/wcache/checkisexec (execbit !)
312 2 r4/.hg/wcache/checklink-target (symlink !)
356 2 r4/.hg/wcache/checklink-target (symlink !)
313 2 r4/.hg/wcache/checknoexec (execbit !)
357 2 r4/.hg/wcache/checknoexec (execbit !)
314 1 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
358 1 r4/.hg/wcache/manifestfulltextcache (reporevlogstore !)
315 2 r4/d1/data1
359 2 r4/d1/data1
316 2 r4/d1/f2
360 2 r4/d1/f2
317 1 r4/f1
361 1 r4/f1
318 1 r4/f3 (execbit !)
362 1 r4/f3 (execbit !)
319 2 r4/f3 (no-execbit !)
363 2 r4/f3 (no-execbit !)
320
364
321 #if hardlink-whitelisted
365 #if hardlink-whitelisted
322 $ nlinksdir r4/.hg/undo.backup.dirstate.bck r4/.hg/dirstate
366 $ nlinksdir r4/.hg/undo.backup.dirstate.bck r4/.hg/dirstate
323 1 r4/.hg/dirstate
367 1 r4/.hg/dirstate
324 2 r4/.hg/undo.backup.dirstate.bck
368 2 r4/.hg/undo.backup.dirstate.bck
325 #endif
369 #endif
326
370
327 Test hardlinking outside hg:
371 Test hardlinking outside hg:
328
372
329 $ mkdir x
373 $ mkdir x
330 $ echo foo > x/a
374 $ echo foo > x/a
331
375
332 $ linkcp x y
376 $ linkcp x y
333 $ echo bar >> y/a
377 $ echo bar >> y/a
334
378
335 No diff if hardlink:
379 No diff if hardlink:
336
380
337 $ diff x/a y/a
381 $ diff x/a y/a
338
382
339 Test mq hardlinking:
383 Test mq hardlinking:
340
384
341 $ echo "[extensions]" >> $HGRCPATH
385 $ echo "[extensions]" >> $HGRCPATH
342 $ echo "mq=" >> $HGRCPATH
386 $ echo "mq=" >> $HGRCPATH
343
387
344 $ hg init a
388 $ hg init a
345 $ cd a
389 $ cd a
346
390
347 $ hg qimport -n foo - << EOF
391 $ hg qimport -n foo - << EOF
348 > # HG changeset patch
392 > # HG changeset patch
349 > # Date 1 0
393 > # Date 1 0
350 > diff -r 2588a8b53d66 a
394 > diff -r 2588a8b53d66 a
351 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
395 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
352 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
396 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
353 > @@ -0,0 +1,1 @@
397 > @@ -0,0 +1,1 @@
354 > +a
398 > +a
355 > EOF
399 > EOF
356 adding foo to series file
400 adding foo to series file
357
401
358 $ hg qpush
402 $ hg qpush
359 applying foo
403 applying foo
360 now at: foo
404 now at: foo
361
405
362 $ cd ..
406 $ cd ..
363 $ linkcp a b
407 $ linkcp a b
364 $ cd b
408 $ cd b
365
409
366 $ hg qimport -n bar - << EOF
410 $ hg qimport -n bar - << EOF
367 > # HG changeset patch
411 > # HG changeset patch
368 > # Date 2 0
412 > # Date 2 0
369 > diff -r 2588a8b53d66 a
413 > diff -r 2588a8b53d66 a
370 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
414 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
371 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
415 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
372 > @@ -0,0 +1,1 @@
416 > @@ -0,0 +1,1 @@
373 > +b
417 > +b
374 > EOF
418 > EOF
375 adding bar to series file
419 adding bar to series file
376
420
377 $ hg qpush
421 $ hg qpush
378 applying bar
422 applying bar
379 now at: bar
423 now at: bar
380
424
381 $ cat .hg/patches/status
425 $ cat .hg/patches/status
382 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
426 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
383 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
427 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
384
428
385 $ cat .hg/patches/series
429 $ cat .hg/patches/series
386 foo
430 foo
387 bar
431 bar
388
432
389 $ cat ../a/.hg/patches/status
433 $ cat ../a/.hg/patches/status
390 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
434 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
391
435
392 $ cat ../a/.hg/patches/series
436 $ cat ../a/.hg/patches/series
393 foo
437 foo
394
438
395 Test tags hardlinking:
439 Test tags hardlinking:
396
440
397 $ hg qdel -r qbase:qtip
441 $ hg qdel -r qbase:qtip
398 patch foo finalized without changeset message
442 patch foo finalized without changeset message
399 patch bar finalized without changeset message
443 patch bar finalized without changeset message
400
444
401 $ hg tag -l lfoo
445 $ hg tag -l lfoo
402 $ hg tag foo
446 $ hg tag foo
403
447
404 $ cd ..
448 $ cd ..
405 $ linkcp b c
449 $ linkcp b c
406 $ cd c
450 $ cd c
407
451
408 $ hg tag -l -r 0 lbar
452 $ hg tag -l -r 0 lbar
409 $ hg tag -r 0 bar
453 $ hg tag -r 0 bar
410
454
411 $ cat .hgtags
455 $ cat .hgtags
412 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
456 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
413 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
457 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
414
458
415 $ cat .hg/localtags
459 $ cat .hg/localtags
416 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
460 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
417 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
461 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
418
462
419 $ cat ../b/.hgtags
463 $ cat ../b/.hgtags
420 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
464 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
421
465
422 $ cat ../b/.hg/localtags
466 $ cat ../b/.hg/localtags
423 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
467 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
424
468
425 $ cd ..
469 $ cd ..
@@ -1,1463 +1,1467 b''
1 commit hooks can see env vars
1 commit hooks can see env vars
2 (and post-transaction one are run unlocked)
2 (and post-transaction one are run unlocked)
3
3
4
4
5 $ cat > $TESTTMP/txnabort.checkargs.py <<EOF
5 $ cat > $TESTTMP/txnabort.checkargs.py <<EOF
6 > from mercurial import pycompat
6 > from mercurial import pycompat
7 > def showargs(ui, repo, hooktype, **kwargs):
7 > def showargs(ui, repo, hooktype, **kwargs):
8 > kwargs = pycompat.byteskwargs(kwargs)
8 > kwargs = pycompat.byteskwargs(kwargs)
9 > ui.write(b'%s Python hook: %s\n' % (hooktype,
9 > ui.write(b'%s Python hook: %s\n' % (hooktype,
10 > b','.join(sorted(kwargs))))
10 > b','.join(sorted(kwargs))))
11 > EOF
11 > EOF
12
12
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15 $ cat > .hg/hgrc <<EOF
15 $ cat > .hg/hgrc <<EOF
16 > [hooks]
16 > [hooks]
17 > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py --line commit"
17 > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py --line commit"
18 > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py --line commit.b"
18 > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py --line commit.b"
19 > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py --line precommit"
19 > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py --line precommit"
20 > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxncommit"
20 > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxncommit"
21 > pretxncommit.tip = hg -q tip
21 > pretxncommit.tip = hg -q tip
22 > pre-identify = sh -c "printenv.py --line pre-identify 1"
22 > pre-identify = sh -c "printenv.py --line pre-identify 1"
23 > pre-cat = sh -c "printenv.py --line pre-cat"
23 > pre-cat = sh -c "printenv.py --line pre-cat"
24 > post-cat = sh -c "printenv.py --line post-cat"
24 > post-cat = sh -c "printenv.py --line post-cat"
25 > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxnopen"
25 > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxnopen"
26 > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxnclose"
26 > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py --line pretxnclose"
27 > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py --line txnclose"
27 > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py --line txnclose"
28 > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs
28 > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs
29 > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py --line txnabort"
29 > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py --line txnabort"
30 > txnclose.checklock = sh -c "hg debuglock > /dev/null"
30 > txnclose.checklock = sh -c "hg debuglock > /dev/null"
31 > EOF
31 > EOF
32 $ echo a > a
32 $ echo a > a
33 $ hg add a
33 $ hg add a
34 $ hg commit -m a
34 $ hg commit -m a
35 precommit hook: HG_HOOKNAME=precommit
35 precommit hook: HG_HOOKNAME=precommit
36 HG_HOOKTYPE=precommit
36 HG_HOOKTYPE=precommit
37 HG_PARENT1=0000000000000000000000000000000000000000
37 HG_PARENT1=0000000000000000000000000000000000000000
38
38
39 pretxnopen hook: HG_HOOKNAME=pretxnopen
39 pretxnopen hook: HG_HOOKNAME=pretxnopen
40 HG_HOOKTYPE=pretxnopen
40 HG_HOOKTYPE=pretxnopen
41 HG_TXNID=TXN:$ID$
41 HG_TXNID=TXN:$ID$
42 HG_TXNNAME=commit
42 HG_TXNNAME=commit
43
43
44 pretxncommit hook: HG_HOOKNAME=pretxncommit
44 pretxncommit hook: HG_HOOKNAME=pretxncommit
45 HG_HOOKTYPE=pretxncommit
45 HG_HOOKTYPE=pretxncommit
46 HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
46 HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
47 HG_PARENT1=0000000000000000000000000000000000000000
47 HG_PARENT1=0000000000000000000000000000000000000000
48 HG_PENDING=$TESTTMP/a
48 HG_PENDING=$TESTTMP/a
49
49
50 0:cb9a9f314b8b
50 0:cb9a9f314b8b
51 pretxnclose hook: HG_HOOKNAME=pretxnclose
51 pretxnclose hook: HG_HOOKNAME=pretxnclose
52 HG_HOOKTYPE=pretxnclose
52 HG_HOOKTYPE=pretxnclose
53 HG_PENDING=$TESTTMP/a
53 HG_PENDING=$TESTTMP/a
54 HG_PHASES_MOVED=1
54 HG_PHASES_MOVED=1
55 HG_TXNID=TXN:$ID$
55 HG_TXNID=TXN:$ID$
56 HG_TXNNAME=commit
56 HG_TXNNAME=commit
57
57
58 txnclose hook: HG_HOOKNAME=txnclose
58 txnclose hook: HG_HOOKNAME=txnclose
59 HG_HOOKTYPE=txnclose
59 HG_HOOKTYPE=txnclose
60 HG_PHASES_MOVED=1
60 HG_PHASES_MOVED=1
61 HG_TXNID=TXN:$ID$
61 HG_TXNID=TXN:$ID$
62 HG_TXNNAME=commit
62 HG_TXNNAME=commit
63
63
64 commit hook: HG_HOOKNAME=commit
64 commit hook: HG_HOOKNAME=commit
65 HG_HOOKTYPE=commit
65 HG_HOOKTYPE=commit
66 HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
66 HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
67 HG_PARENT1=0000000000000000000000000000000000000000
67 HG_PARENT1=0000000000000000000000000000000000000000
68
68
69 commit.b hook: HG_HOOKNAME=commit.b
69 commit.b hook: HG_HOOKNAME=commit.b
70 HG_HOOKTYPE=commit
70 HG_HOOKTYPE=commit
71 HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
71 HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
72 HG_PARENT1=0000000000000000000000000000000000000000
72 HG_PARENT1=0000000000000000000000000000000000000000
73
73
74
74
75 $ hg clone . ../b
75 $ hg clone . ../b
76 updating to branch default
76 updating to branch default
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ cd ../b
78 $ cd ../b
79
79
80 changegroup hooks can see env vars
80 changegroup hooks can see env vars
81
81
82 $ cat > .hg/hgrc <<EOF
82 $ cat > .hg/hgrc <<EOF
83 > [hooks]
83 > [hooks]
84 > prechangegroup = sh -c "printenv.py --line prechangegroup"
84 > prechangegroup = sh -c "printenv.py --line prechangegroup"
85 > changegroup = sh -c "printenv.py --line changegroup"
85 > changegroup = sh -c "printenv.py --line changegroup"
86 > incoming = sh -c "printenv.py --line incoming"
86 > incoming = sh -c "printenv.py --line incoming"
87 > EOF
87 > EOF
88
88
89 pretxncommit and commit hooks can see both parents of merge
89 pretxncommit and commit hooks can see both parents of merge
90
90
91 $ cd ../a
91 $ cd ../a
92 $ echo b >> a
92 $ echo b >> a
93 $ hg commit -m a1 -d "1 0"
93 $ hg commit -m a1 -d "1 0"
94 precommit hook: HG_HOOKNAME=precommit
94 precommit hook: HG_HOOKNAME=precommit
95 HG_HOOKTYPE=precommit
95 HG_HOOKTYPE=precommit
96 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
96 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
97
97
98 pretxnopen hook: HG_HOOKNAME=pretxnopen
98 pretxnopen hook: HG_HOOKNAME=pretxnopen
99 HG_HOOKTYPE=pretxnopen
99 HG_HOOKTYPE=pretxnopen
100 HG_TXNID=TXN:$ID$
100 HG_TXNID=TXN:$ID$
101 HG_TXNNAME=commit
101 HG_TXNNAME=commit
102
102
103 pretxncommit hook: HG_HOOKNAME=pretxncommit
103 pretxncommit hook: HG_HOOKNAME=pretxncommit
104 HG_HOOKTYPE=pretxncommit
104 HG_HOOKTYPE=pretxncommit
105 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
105 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
106 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
106 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
107 HG_PENDING=$TESTTMP/a
107 HG_PENDING=$TESTTMP/a
108
108
109 1:ab228980c14d
109 1:ab228980c14d
110 pretxnclose hook: HG_HOOKNAME=pretxnclose
110 pretxnclose hook: HG_HOOKNAME=pretxnclose
111 HG_HOOKTYPE=pretxnclose
111 HG_HOOKTYPE=pretxnclose
112 HG_PENDING=$TESTTMP/a
112 HG_PENDING=$TESTTMP/a
113 HG_TXNID=TXN:$ID$
113 HG_TXNID=TXN:$ID$
114 HG_TXNNAME=commit
114 HG_TXNNAME=commit
115
115
116 txnclose hook: HG_HOOKNAME=txnclose
116 txnclose hook: HG_HOOKNAME=txnclose
117 HG_HOOKTYPE=txnclose
117 HG_HOOKTYPE=txnclose
118 HG_TXNID=TXN:$ID$
118 HG_TXNID=TXN:$ID$
119 HG_TXNNAME=commit
119 HG_TXNNAME=commit
120
120
121 commit hook: HG_HOOKNAME=commit
121 commit hook: HG_HOOKNAME=commit
122 HG_HOOKTYPE=commit
122 HG_HOOKTYPE=commit
123 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
123 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
124 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
124 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
125
125
126 commit.b hook: HG_HOOKNAME=commit.b
126 commit.b hook: HG_HOOKNAME=commit.b
127 HG_HOOKTYPE=commit
127 HG_HOOKTYPE=commit
128 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
128 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
129 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
129 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
130
130
131 $ hg update -C 0
131 $ hg update -C 0
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 $ echo b > b
133 $ echo b > b
134 $ hg add b
134 $ hg add b
135 $ hg commit -m b -d '1 0'
135 $ hg commit -m b -d '1 0'
136 precommit hook: HG_HOOKNAME=precommit
136 precommit hook: HG_HOOKNAME=precommit
137 HG_HOOKTYPE=precommit
137 HG_HOOKTYPE=precommit
138 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
138 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
139
139
140 pretxnopen hook: HG_HOOKNAME=pretxnopen
140 pretxnopen hook: HG_HOOKNAME=pretxnopen
141 HG_HOOKTYPE=pretxnopen
141 HG_HOOKTYPE=pretxnopen
142 HG_TXNID=TXN:$ID$
142 HG_TXNID=TXN:$ID$
143 HG_TXNNAME=commit
143 HG_TXNNAME=commit
144
144
145 pretxncommit hook: HG_HOOKNAME=pretxncommit
145 pretxncommit hook: HG_HOOKNAME=pretxncommit
146 HG_HOOKTYPE=pretxncommit
146 HG_HOOKTYPE=pretxncommit
147 HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
147 HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
148 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
148 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
149 HG_PENDING=$TESTTMP/a
149 HG_PENDING=$TESTTMP/a
150
150
151 2:ee9deb46ab31
151 2:ee9deb46ab31
152 pretxnclose hook: HG_HOOKNAME=pretxnclose
152 pretxnclose hook: HG_HOOKNAME=pretxnclose
153 HG_HOOKTYPE=pretxnclose
153 HG_HOOKTYPE=pretxnclose
154 HG_PENDING=$TESTTMP/a
154 HG_PENDING=$TESTTMP/a
155 HG_TXNID=TXN:$ID$
155 HG_TXNID=TXN:$ID$
156 HG_TXNNAME=commit
156 HG_TXNNAME=commit
157
157
158 created new head
158 created new head
159 txnclose hook: HG_HOOKNAME=txnclose
159 txnclose hook: HG_HOOKNAME=txnclose
160 HG_HOOKTYPE=txnclose
160 HG_HOOKTYPE=txnclose
161 HG_TXNID=TXN:$ID$
161 HG_TXNID=TXN:$ID$
162 HG_TXNNAME=commit
162 HG_TXNNAME=commit
163
163
164 commit hook: HG_HOOKNAME=commit
164 commit hook: HG_HOOKNAME=commit
165 HG_HOOKTYPE=commit
165 HG_HOOKTYPE=commit
166 HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
166 HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
167 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
167 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
168
168
169 commit.b hook: HG_HOOKNAME=commit.b
169 commit.b hook: HG_HOOKNAME=commit.b
170 HG_HOOKTYPE=commit
170 HG_HOOKTYPE=commit
171 HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
171 HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
172 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
172 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
173
173
174 $ hg merge 1
174 $ hg merge 1
175 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 (branch merge, don't forget to commit)
176 (branch merge, don't forget to commit)
177 $ hg commit -m merge -d '2 0'
177 $ hg commit -m merge -d '2 0'
178 precommit hook: HG_HOOKNAME=precommit
178 precommit hook: HG_HOOKNAME=precommit
179 HG_HOOKTYPE=precommit
179 HG_HOOKTYPE=precommit
180 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
180 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
181 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
181 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
182
182
183 pretxnopen hook: HG_HOOKNAME=pretxnopen
183 pretxnopen hook: HG_HOOKNAME=pretxnopen
184 HG_HOOKTYPE=pretxnopen
184 HG_HOOKTYPE=pretxnopen
185 HG_TXNID=TXN:$ID$
185 HG_TXNID=TXN:$ID$
186 HG_TXNNAME=commit
186 HG_TXNNAME=commit
187
187
188 pretxncommit hook: HG_HOOKNAME=pretxncommit
188 pretxncommit hook: HG_HOOKNAME=pretxncommit
189 HG_HOOKTYPE=pretxncommit
189 HG_HOOKTYPE=pretxncommit
190 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
190 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
191 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
191 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
192 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
192 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
193 HG_PENDING=$TESTTMP/a
193 HG_PENDING=$TESTTMP/a
194
194
195 3:07f3376c1e65
195 3:07f3376c1e65
196 pretxnclose hook: HG_HOOKNAME=pretxnclose
196 pretxnclose hook: HG_HOOKNAME=pretxnclose
197 HG_HOOKTYPE=pretxnclose
197 HG_HOOKTYPE=pretxnclose
198 HG_PENDING=$TESTTMP/a
198 HG_PENDING=$TESTTMP/a
199 HG_TXNID=TXN:$ID$
199 HG_TXNID=TXN:$ID$
200 HG_TXNNAME=commit
200 HG_TXNNAME=commit
201
201
202 txnclose hook: HG_HOOKNAME=txnclose
202 txnclose hook: HG_HOOKNAME=txnclose
203 HG_HOOKTYPE=txnclose
203 HG_HOOKTYPE=txnclose
204 HG_TXNID=TXN:$ID$
204 HG_TXNID=TXN:$ID$
205 HG_TXNNAME=commit
205 HG_TXNNAME=commit
206
206
207 commit hook: HG_HOOKNAME=commit
207 commit hook: HG_HOOKNAME=commit
208 HG_HOOKTYPE=commit
208 HG_HOOKTYPE=commit
209 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
209 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
210 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
210 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
211 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
211 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
212
212
213 commit.b hook: HG_HOOKNAME=commit.b
213 commit.b hook: HG_HOOKNAME=commit.b
214 HG_HOOKTYPE=commit
214 HG_HOOKTYPE=commit
215 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
215 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
216 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
216 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
217 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
217 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
218
218
219
219
220 test generic hooks
220 test generic hooks
221
221
222 $ hg id
222 $ hg id
223 pre-identify hook: HG_ARGS=id
223 pre-identify hook: HG_ARGS=id
224 HG_HOOKNAME=pre-identify
224 HG_HOOKNAME=pre-identify
225 HG_HOOKTYPE=pre-identify
225 HG_HOOKTYPE=pre-identify
226 HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None, 'template': ''}
226 HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None, 'template': ''}
227 HG_PATS=[]
227 HG_PATS=[]
228
228
229 abort: pre-identify hook exited with status 1
229 abort: pre-identify hook exited with status 1
230 [40]
230 [40]
231 $ hg cat b
231 $ hg cat b
232 pre-cat hook: HG_ARGS=cat b
232 pre-cat hook: HG_ARGS=cat b
233 HG_HOOKNAME=pre-cat
233 HG_HOOKNAME=pre-cat
234 HG_HOOKTYPE=pre-cat
234 HG_HOOKTYPE=pre-cat
235 HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''}
235 HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''}
236 HG_PATS=['b']
236 HG_PATS=['b']
237
237
238 b
238 b
239 post-cat hook: HG_ARGS=cat b
239 post-cat hook: HG_ARGS=cat b
240 HG_HOOKNAME=post-cat
240 HG_HOOKNAME=post-cat
241 HG_HOOKTYPE=post-cat
241 HG_HOOKTYPE=post-cat
242 HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''}
242 HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''}
243 HG_PATS=['b']
243 HG_PATS=['b']
244 HG_RESULT=0
244 HG_RESULT=0
245
245
246
246
247 $ cd ../b
247 $ cd ../b
248 $ hg pull ../a
248 $ hg pull ../a
249 pulling from ../a
249 pulling from ../a
250 searching for changes
250 searching for changes
251 prechangegroup hook: HG_HOOKNAME=prechangegroup
251 prechangegroup hook: HG_HOOKNAME=prechangegroup
252 HG_HOOKTYPE=prechangegroup
252 HG_HOOKTYPE=prechangegroup
253 HG_SOURCE=pull
253 HG_SOURCE=pull
254 HG_TXNID=TXN:$ID$
254 HG_TXNID=TXN:$ID$
255 HG_TXNNAME=pull
255 HG_TXNNAME=pull
256 file:/*/$TESTTMP/a (glob)
256 file:/*/$TESTTMP/a (glob)
257 HG_URL=file:$TESTTMP/a
257 HG_URL=file:$TESTTMP/a
258
258
259 adding changesets
259 adding changesets
260 adding manifests
260 adding manifests
261 adding file changes
261 adding file changes
262 added 3 changesets with 2 changes to 2 files
262 added 3 changesets with 2 changes to 2 files
263 new changesets ab228980c14d:07f3376c1e65
263 new changesets ab228980c14d:07f3376c1e65
264 changegroup hook: HG_HOOKNAME=changegroup
264 changegroup hook: HG_HOOKNAME=changegroup
265 HG_HOOKTYPE=changegroup
265 HG_HOOKTYPE=changegroup
266 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
266 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
267 HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2
267 HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2
268 HG_SOURCE=pull
268 HG_SOURCE=pull
269 HG_TXNID=TXN:$ID$
269 HG_TXNID=TXN:$ID$
270 HG_TXNNAME=pull
270 HG_TXNNAME=pull
271 file:/*/$TESTTMP/a (glob)
271 file:/*/$TESTTMP/a (glob)
272 HG_URL=file:$TESTTMP/a
272 HG_URL=file:$TESTTMP/a
273
273
274 incoming hook: HG_HOOKNAME=incoming
274 incoming hook: HG_HOOKNAME=incoming
275 HG_HOOKTYPE=incoming
275 HG_HOOKTYPE=incoming
276 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
276 HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd
277 HG_SOURCE=pull
277 HG_SOURCE=pull
278 HG_TXNID=TXN:$ID$
278 HG_TXNID=TXN:$ID$
279 HG_TXNNAME=pull
279 HG_TXNNAME=pull
280 file:/*/$TESTTMP/a (glob)
280 file:/*/$TESTTMP/a (glob)
281 HG_URL=file:$TESTTMP/a
281 HG_URL=file:$TESTTMP/a
282
282
283 incoming hook: HG_HOOKNAME=incoming
283 incoming hook: HG_HOOKNAME=incoming
284 HG_HOOKTYPE=incoming
284 HG_HOOKTYPE=incoming
285 HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
285 HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2
286 HG_SOURCE=pull
286 HG_SOURCE=pull
287 HG_TXNID=TXN:$ID$
287 HG_TXNID=TXN:$ID$
288 HG_TXNNAME=pull
288 HG_TXNNAME=pull
289 file:/*/$TESTTMP/a (glob)
289 file:/*/$TESTTMP/a (glob)
290 HG_URL=file:$TESTTMP/a
290 HG_URL=file:$TESTTMP/a
291
291
292 incoming hook: HG_HOOKNAME=incoming
292 incoming hook: HG_HOOKNAME=incoming
293 HG_HOOKTYPE=incoming
293 HG_HOOKTYPE=incoming
294 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
294 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
295 HG_SOURCE=pull
295 HG_SOURCE=pull
296 HG_TXNID=TXN:$ID$
296 HG_TXNID=TXN:$ID$
297 HG_TXNNAME=pull
297 HG_TXNNAME=pull
298 file:/*/$TESTTMP/a (glob)
298 file:/*/$TESTTMP/a (glob)
299 HG_URL=file:$TESTTMP/a
299 HG_URL=file:$TESTTMP/a
300
300
301 (run 'hg update' to get a working copy)
301 (run 'hg update' to get a working copy)
302
302
303 tag hooks can see env vars
303 tag hooks can see env vars
304
304
305 $ cd ../a
305 $ cd ../a
306 $ cat >> .hg/hgrc <<EOF
306 $ cat >> .hg/hgrc <<EOF
307 > pretag = sh -c "printenv.py --line pretag"
307 > pretag = sh -c "printenv.py --line pretag"
308 > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py --line tag"
308 > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py --line tag"
309 > EOF
309 > EOF
310 $ hg tag -d '3 0' a
310 $ hg tag -d '3 0' a
311 pretag hook: HG_HOOKNAME=pretag
311 pretag hook: HG_HOOKNAME=pretag
312 HG_HOOKTYPE=pretag
312 HG_HOOKTYPE=pretag
313 HG_LOCAL=0
313 HG_LOCAL=0
314 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
314 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
315 HG_TAG=a
315 HG_TAG=a
316
316
317 precommit hook: HG_HOOKNAME=precommit
317 precommit hook: HG_HOOKNAME=precommit
318 HG_HOOKTYPE=precommit
318 HG_HOOKTYPE=precommit
319 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
319 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
320
320
321 pretxnopen hook: HG_HOOKNAME=pretxnopen
321 pretxnopen hook: HG_HOOKNAME=pretxnopen
322 HG_HOOKTYPE=pretxnopen
322 HG_HOOKTYPE=pretxnopen
323 HG_TXNID=TXN:$ID$
323 HG_TXNID=TXN:$ID$
324 HG_TXNNAME=commit
324 HG_TXNNAME=commit
325
325
326 pretxncommit hook: HG_HOOKNAME=pretxncommit
326 pretxncommit hook: HG_HOOKNAME=pretxncommit
327 HG_HOOKTYPE=pretxncommit
327 HG_HOOKTYPE=pretxncommit
328 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
328 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
329 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
329 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
330 HG_PENDING=$TESTTMP/a
330 HG_PENDING=$TESTTMP/a
331
331
332 4:539e4b31b6dc
332 4:539e4b31b6dc
333 pretxnclose hook: HG_HOOKNAME=pretxnclose
333 pretxnclose hook: HG_HOOKNAME=pretxnclose
334 HG_HOOKTYPE=pretxnclose
334 HG_HOOKTYPE=pretxnclose
335 HG_PENDING=$TESTTMP/a
335 HG_PENDING=$TESTTMP/a
336 HG_TXNID=TXN:$ID$
336 HG_TXNID=TXN:$ID$
337 HG_TXNNAME=commit
337 HG_TXNNAME=commit
338
338
339 tag hook: HG_HOOKNAME=tag
339 tag hook: HG_HOOKNAME=tag
340 HG_HOOKTYPE=tag
340 HG_HOOKTYPE=tag
341 HG_LOCAL=0
341 HG_LOCAL=0
342 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
342 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2
343 HG_TAG=a
343 HG_TAG=a
344
344
345 txnclose hook: HG_HOOKNAME=txnclose
345 txnclose hook: HG_HOOKNAME=txnclose
346 HG_HOOKTYPE=txnclose
346 HG_HOOKTYPE=txnclose
347 HG_TXNID=TXN:$ID$
347 HG_TXNID=TXN:$ID$
348 HG_TXNNAME=commit
348 HG_TXNNAME=commit
349
349
350 commit hook: HG_HOOKNAME=commit
350 commit hook: HG_HOOKNAME=commit
351 HG_HOOKTYPE=commit
351 HG_HOOKTYPE=commit
352 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
352 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
353 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
353 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
354
354
355 commit.b hook: HG_HOOKNAME=commit.b
355 commit.b hook: HG_HOOKNAME=commit.b
356 HG_HOOKTYPE=commit
356 HG_HOOKTYPE=commit
357 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
357 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
358 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
358 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
359
359
360 $ hg tag -l la
360 $ hg tag -l la
361 pretag hook: HG_HOOKNAME=pretag
361 pretag hook: HG_HOOKNAME=pretag
362 HG_HOOKTYPE=pretag
362 HG_HOOKTYPE=pretag
363 HG_LOCAL=1
363 HG_LOCAL=1
364 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
364 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
365 HG_TAG=la
365 HG_TAG=la
366
366
367 tag hook: HG_HOOKNAME=tag
367 tag hook: HG_HOOKNAME=tag
368 HG_HOOKTYPE=tag
368 HG_HOOKTYPE=tag
369 HG_LOCAL=1
369 HG_LOCAL=1
370 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
370 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
371 HG_TAG=la
371 HG_TAG=la
372
372
373
373
374 pretag hook can forbid tagging
374 pretag hook can forbid tagging
375
375
376 $ cat >> .hg/hgrc <<EOF
376 $ cat >> .hg/hgrc <<EOF
377 > pretag.forbid = sh -c "printenv.py --line pretag.forbid 1"
377 > pretag.forbid = sh -c "printenv.py --line pretag.forbid 1"
378 > EOF
378 > EOF
379 $ hg tag -d '4 0' fa
379 $ hg tag -d '4 0' fa
380 pretag hook: HG_HOOKNAME=pretag
380 pretag hook: HG_HOOKNAME=pretag
381 HG_HOOKTYPE=pretag
381 HG_HOOKTYPE=pretag
382 HG_LOCAL=0
382 HG_LOCAL=0
383 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
383 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
384 HG_TAG=fa
384 HG_TAG=fa
385
385
386 pretag.forbid hook: HG_HOOKNAME=pretag.forbid
386 pretag.forbid hook: HG_HOOKNAME=pretag.forbid
387 HG_HOOKTYPE=pretag
387 HG_HOOKTYPE=pretag
388 HG_LOCAL=0
388 HG_LOCAL=0
389 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
389 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
390 HG_TAG=fa
390 HG_TAG=fa
391
391
392 abort: pretag.forbid hook exited with status 1
392 abort: pretag.forbid hook exited with status 1
393 [40]
393 [40]
394 $ hg tag -l fla
394 $ hg tag -l fla
395 pretag hook: HG_HOOKNAME=pretag
395 pretag hook: HG_HOOKNAME=pretag
396 HG_HOOKTYPE=pretag
396 HG_HOOKTYPE=pretag
397 HG_LOCAL=1
397 HG_LOCAL=1
398 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
398 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
399 HG_TAG=fla
399 HG_TAG=fla
400
400
401 pretag.forbid hook: HG_HOOKNAME=pretag.forbid
401 pretag.forbid hook: HG_HOOKNAME=pretag.forbid
402 HG_HOOKTYPE=pretag
402 HG_HOOKTYPE=pretag
403 HG_LOCAL=1
403 HG_LOCAL=1
404 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
404 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
405 HG_TAG=fla
405 HG_TAG=fla
406
406
407 abort: pretag.forbid hook exited with status 1
407 abort: pretag.forbid hook exited with status 1
408 [40]
408 [40]
409
409
410 pretxncommit hook can see changeset, can roll back txn, changeset no
410 pretxncommit hook can see changeset, can roll back txn, changeset no
411 more there after
411 more there after
412
412
413 $ cat >> .hg/hgrc <<EOF
413 $ cat >> .hg/hgrc <<EOF
414 > pretxncommit.forbid0 = sh -c "hg tip -q"
414 > pretxncommit.forbid0 = sh -c "hg tip -q"
415 > pretxncommit.forbid1 = sh -c "printenv.py --line pretxncommit.forbid 1"
415 > pretxncommit.forbid1 = sh -c "printenv.py --line pretxncommit.forbid 1"
416 > EOF
416 > EOF
417 $ echo z > z
417 $ echo z > z
418 $ hg add z
418 $ hg add z
419 $ hg -q tip
419 $ hg -q tip
420 4:539e4b31b6dc
420 4:539e4b31b6dc
421 $ hg commit -m 'fail' -d '4 0'
421 $ hg commit -m 'fail' -d '4 0'
422 precommit hook: HG_HOOKNAME=precommit
422 precommit hook: HG_HOOKNAME=precommit
423 HG_HOOKTYPE=precommit
423 HG_HOOKTYPE=precommit
424 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
424 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
425
425
426 pretxnopen hook: HG_HOOKNAME=pretxnopen
426 pretxnopen hook: HG_HOOKNAME=pretxnopen
427 HG_HOOKTYPE=pretxnopen
427 HG_HOOKTYPE=pretxnopen
428 HG_TXNID=TXN:$ID$
428 HG_TXNID=TXN:$ID$
429 HG_TXNNAME=commit
429 HG_TXNNAME=commit
430
430
431 pretxncommit hook: HG_HOOKNAME=pretxncommit
431 pretxncommit hook: HG_HOOKNAME=pretxncommit
432 HG_HOOKTYPE=pretxncommit
432 HG_HOOKTYPE=pretxncommit
433 HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567
433 HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567
434 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
434 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
435 HG_PENDING=$TESTTMP/a
435 HG_PENDING=$TESTTMP/a
436
436
437 5:6f611f8018c1
437 5:6f611f8018c1
438 5:6f611f8018c1
438 5:6f611f8018c1
439 pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1
439 pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1
440 HG_HOOKTYPE=pretxncommit
440 HG_HOOKTYPE=pretxncommit
441 HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567
441 HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567
442 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
442 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
443 HG_PENDING=$TESTTMP/a
443 HG_PENDING=$TESTTMP/a
444
444
445 transaction abort!
445 transaction abort!
446 txnabort Python hook: changes,txnid,txnname
446 txnabort Python hook: changes,txnid,txnname
447 txnabort hook: HG_HOOKNAME=txnabort.1
447 txnabort hook: HG_HOOKNAME=txnabort.1
448 HG_HOOKTYPE=txnabort
448 HG_HOOKTYPE=txnabort
449 HG_TXNID=TXN:$ID$
449 HG_TXNID=TXN:$ID$
450 HG_TXNNAME=commit
450 HG_TXNNAME=commit
451
451
452 rollback completed
452 rollback completed
453 abort: pretxncommit.forbid1 hook exited with status 1
453 abort: pretxncommit.forbid1 hook exited with status 1
454 [40]
454 [40]
455 $ hg -q tip
455 $ hg -q tip
456 4:539e4b31b6dc
456 4:539e4b31b6dc
457
457
458 (Check that no 'changelog.i.a' file were left behind)
458 (Check that no 'changelog.i.a' file were left behind)
459
459
460 $ ls -1 .hg/store/
460 $ ls -1 .hg/store/
461 00changelog-1335303a.nd (rust !)
462 00changelog.d
461 00changelog.i
463 00changelog.i
464 00changelog.n (rust !)
462 00manifest.i
465 00manifest.i
463 data
466 data
464 fncache (repofncache !)
467 fncache
465 phaseroots
468 phaseroots
466 requires
469 requires
467 undo
470 undo
468 undo.backup.fncache.bck (repofncache !)
471 undo.backup.00changelog.n.bck (rust !)
472 undo.backup.fncache.bck
469 undo.backupfiles
473 undo.backupfiles
470
474
471
475
472 precommit hook can prevent commit
476 precommit hook can prevent commit
473
477
474 $ cat >> .hg/hgrc <<EOF
478 $ cat >> .hg/hgrc <<EOF
475 > precommit.forbid = sh -c "printenv.py --line precommit.forbid 1"
479 > precommit.forbid = sh -c "printenv.py --line precommit.forbid 1"
476 > EOF
480 > EOF
477 $ hg commit -m 'fail' -d '4 0'
481 $ hg commit -m 'fail' -d '4 0'
478 precommit hook: HG_HOOKNAME=precommit
482 precommit hook: HG_HOOKNAME=precommit
479 HG_HOOKTYPE=precommit
483 HG_HOOKTYPE=precommit
480 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
484 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
481
485
482 precommit.forbid hook: HG_HOOKNAME=precommit.forbid
486 precommit.forbid hook: HG_HOOKNAME=precommit.forbid
483 HG_HOOKTYPE=precommit
487 HG_HOOKTYPE=precommit
484 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
488 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
485
489
486 abort: precommit.forbid hook exited with status 1
490 abort: precommit.forbid hook exited with status 1
487 [40]
491 [40]
488 $ hg -q tip
492 $ hg -q tip
489 4:539e4b31b6dc
493 4:539e4b31b6dc
490
494
491 preupdate hook can prevent update
495 preupdate hook can prevent update
492
496
493 $ cat >> .hg/hgrc <<EOF
497 $ cat >> .hg/hgrc <<EOF
494 > preupdate = sh -c "printenv.py --line preupdate"
498 > preupdate = sh -c "printenv.py --line preupdate"
495 > EOF
499 > EOF
496 $ hg update 1
500 $ hg update 1
497 preupdate hook: HG_HOOKNAME=preupdate
501 preupdate hook: HG_HOOKNAME=preupdate
498 HG_HOOKTYPE=preupdate
502 HG_HOOKTYPE=preupdate
499 HG_PARENT1=ab228980c14d
503 HG_PARENT1=ab228980c14d
500
504
501 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
505 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
502
506
503 update hook
507 update hook
504
508
505 $ cat >> .hg/hgrc <<EOF
509 $ cat >> .hg/hgrc <<EOF
506 > update = sh -c "printenv.py --line update"
510 > update = sh -c "printenv.py --line update"
507 > EOF
511 > EOF
508 $ hg update
512 $ hg update
509 preupdate hook: HG_HOOKNAME=preupdate
513 preupdate hook: HG_HOOKNAME=preupdate
510 HG_HOOKTYPE=preupdate
514 HG_HOOKTYPE=preupdate
511 HG_PARENT1=539e4b31b6dc
515 HG_PARENT1=539e4b31b6dc
512
516
513 update hook: HG_ERROR=0
517 update hook: HG_ERROR=0
514 HG_HOOKNAME=update
518 HG_HOOKNAME=update
515 HG_HOOKTYPE=update
519 HG_HOOKTYPE=update
516 HG_PARENT1=539e4b31b6dc
520 HG_PARENT1=539e4b31b6dc
517
521
518 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
522 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
519
523
520 pushkey hook
524 pushkey hook
521
525
522 $ cat >> .hg/hgrc <<EOF
526 $ cat >> .hg/hgrc <<EOF
523 > pushkey = sh -c "printenv.py --line pushkey"
527 > pushkey = sh -c "printenv.py --line pushkey"
524 > EOF
528 > EOF
525 $ cd ../b
529 $ cd ../b
526 $ hg bookmark -r null foo
530 $ hg bookmark -r null foo
527 $ hg push -B foo ../a
531 $ hg push -B foo ../a
528 pushing to ../a
532 pushing to ../a
529 searching for changes
533 searching for changes
530 no changes found
534 no changes found
531 pretxnopen hook: HG_HOOKNAME=pretxnopen
535 pretxnopen hook: HG_HOOKNAME=pretxnopen
532 HG_HOOKTYPE=pretxnopen
536 HG_HOOKTYPE=pretxnopen
533 HG_TXNID=TXN:$ID$
537 HG_TXNID=TXN:$ID$
534 HG_TXNNAME=push
538 HG_TXNNAME=push
535
539
536 pretxnclose hook: HG_BOOKMARK_MOVED=1
540 pretxnclose hook: HG_BOOKMARK_MOVED=1
537 HG_BUNDLE2=1
541 HG_BUNDLE2=1
538 HG_HOOKNAME=pretxnclose
542 HG_HOOKNAME=pretxnclose
539 HG_HOOKTYPE=pretxnclose
543 HG_HOOKTYPE=pretxnclose
540 HG_PENDING=$TESTTMP/a
544 HG_PENDING=$TESTTMP/a
541 HG_SOURCE=push
545 HG_SOURCE=push
542 HG_TXNID=TXN:$ID$
546 HG_TXNID=TXN:$ID$
543 HG_TXNNAME=push
547 HG_TXNNAME=push
544 HG_URL=file:$TESTTMP/a
548 HG_URL=file:$TESTTMP/a
545
549
546 pushkey hook: HG_BUNDLE2=1
550 pushkey hook: HG_BUNDLE2=1
547 HG_HOOKNAME=pushkey
551 HG_HOOKNAME=pushkey
548 HG_HOOKTYPE=pushkey
552 HG_HOOKTYPE=pushkey
549 HG_KEY=foo
553 HG_KEY=foo
550 HG_NAMESPACE=bookmarks
554 HG_NAMESPACE=bookmarks
551 HG_NEW=0000000000000000000000000000000000000000
555 HG_NEW=0000000000000000000000000000000000000000
552 HG_PUSHKEYCOMPAT=1
556 HG_PUSHKEYCOMPAT=1
553 HG_SOURCE=push
557 HG_SOURCE=push
554 HG_TXNID=TXN:$ID$
558 HG_TXNID=TXN:$ID$
555 HG_TXNNAME=push
559 HG_TXNNAME=push
556 HG_URL=file:$TESTTMP/a
560 HG_URL=file:$TESTTMP/a
557
561
558 txnclose hook: HG_BOOKMARK_MOVED=1
562 txnclose hook: HG_BOOKMARK_MOVED=1
559 HG_BUNDLE2=1
563 HG_BUNDLE2=1
560 HG_HOOKNAME=txnclose
564 HG_HOOKNAME=txnclose
561 HG_HOOKTYPE=txnclose
565 HG_HOOKTYPE=txnclose
562 HG_SOURCE=push
566 HG_SOURCE=push
563 HG_TXNID=TXN:$ID$
567 HG_TXNID=TXN:$ID$
564 HG_TXNNAME=push
568 HG_TXNNAME=push
565 HG_URL=file:$TESTTMP/a
569 HG_URL=file:$TESTTMP/a
566
570
567 exporting bookmark foo
571 exporting bookmark foo
568 [1]
572 [1]
569 $ cd ../a
573 $ cd ../a
570
574
571 listkeys hook
575 listkeys hook
572
576
573 $ cat >> .hg/hgrc <<EOF
577 $ cat >> .hg/hgrc <<EOF
574 > listkeys = sh -c "printenv.py --line listkeys"
578 > listkeys = sh -c "printenv.py --line listkeys"
575 > EOF
579 > EOF
576 $ hg bookmark -r null bar
580 $ hg bookmark -r null bar
577 pretxnopen hook: HG_HOOKNAME=pretxnopen
581 pretxnopen hook: HG_HOOKNAME=pretxnopen
578 HG_HOOKTYPE=pretxnopen
582 HG_HOOKTYPE=pretxnopen
579 HG_TXNID=TXN:$ID$
583 HG_TXNID=TXN:$ID$
580 HG_TXNNAME=bookmark
584 HG_TXNNAME=bookmark
581
585
582 pretxnclose hook: HG_BOOKMARK_MOVED=1
586 pretxnclose hook: HG_BOOKMARK_MOVED=1
583 HG_HOOKNAME=pretxnclose
587 HG_HOOKNAME=pretxnclose
584 HG_HOOKTYPE=pretxnclose
588 HG_HOOKTYPE=pretxnclose
585 HG_PENDING=$TESTTMP/a
589 HG_PENDING=$TESTTMP/a
586 HG_TXNID=TXN:$ID$
590 HG_TXNID=TXN:$ID$
587 HG_TXNNAME=bookmark
591 HG_TXNNAME=bookmark
588
592
589 txnclose hook: HG_BOOKMARK_MOVED=1
593 txnclose hook: HG_BOOKMARK_MOVED=1
590 HG_HOOKNAME=txnclose
594 HG_HOOKNAME=txnclose
591 HG_HOOKTYPE=txnclose
595 HG_HOOKTYPE=txnclose
592 HG_TXNID=TXN:$ID$
596 HG_TXNID=TXN:$ID$
593 HG_TXNNAME=bookmark
597 HG_TXNNAME=bookmark
594
598
595 $ cd ../b
599 $ cd ../b
596 $ hg pull -B bar ../a
600 $ hg pull -B bar ../a
597 pulling from ../a
601 pulling from ../a
598 listkeys hook: HG_HOOKNAME=listkeys
602 listkeys hook: HG_HOOKNAME=listkeys
599 HG_HOOKTYPE=listkeys
603 HG_HOOKTYPE=listkeys
600 HG_NAMESPACE=bookmarks
604 HG_NAMESPACE=bookmarks
601 HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
605 HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
602
606
603 no changes found
607 no changes found
604 adding remote bookmark bar
608 adding remote bookmark bar
605 $ cd ../a
609 $ cd ../a
606
610
607 test that prepushkey can prevent incoming keys
611 test that prepushkey can prevent incoming keys
608
612
609 $ cat >> .hg/hgrc <<EOF
613 $ cat >> .hg/hgrc <<EOF
610 > prepushkey = sh -c "printenv.py --line prepushkey.forbid 1"
614 > prepushkey = sh -c "printenv.py --line prepushkey.forbid 1"
611 > EOF
615 > EOF
612 $ cd ../b
616 $ cd ../b
613 $ hg bookmark -r null baz
617 $ hg bookmark -r null baz
614 $ hg push -B baz ../a
618 $ hg push -B baz ../a
615 pushing to ../a
619 pushing to ../a
616 searching for changes
620 searching for changes
617 listkeys hook: HG_HOOKNAME=listkeys
621 listkeys hook: HG_HOOKNAME=listkeys
618 HG_HOOKTYPE=listkeys
622 HG_HOOKTYPE=listkeys
619 HG_NAMESPACE=phases
623 HG_NAMESPACE=phases
620 HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
624 HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
621
625
622 listkeys hook: HG_HOOKNAME=listkeys
626 listkeys hook: HG_HOOKNAME=listkeys
623 HG_HOOKTYPE=listkeys
627 HG_HOOKTYPE=listkeys
624 HG_NAMESPACE=bookmarks
628 HG_NAMESPACE=bookmarks
625 HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
629 HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
626
630
627 no changes found
631 no changes found
628 pretxnopen hook: HG_HOOKNAME=pretxnopen
632 pretxnopen hook: HG_HOOKNAME=pretxnopen
629 HG_HOOKTYPE=pretxnopen
633 HG_HOOKTYPE=pretxnopen
630 HG_TXNID=TXN:$ID$
634 HG_TXNID=TXN:$ID$
631 HG_TXNNAME=push
635 HG_TXNNAME=push
632
636
633 prepushkey.forbid hook: HG_BUNDLE2=1
637 prepushkey.forbid hook: HG_BUNDLE2=1
634 HG_HOOKNAME=prepushkey
638 HG_HOOKNAME=prepushkey
635 HG_HOOKTYPE=prepushkey
639 HG_HOOKTYPE=prepushkey
636 HG_KEY=baz
640 HG_KEY=baz
637 HG_NAMESPACE=bookmarks
641 HG_NAMESPACE=bookmarks
638 HG_NEW=0000000000000000000000000000000000000000
642 HG_NEW=0000000000000000000000000000000000000000
639 HG_PUSHKEYCOMPAT=1
643 HG_PUSHKEYCOMPAT=1
640 HG_SOURCE=push
644 HG_SOURCE=push
641 HG_TXNID=TXN:$ID$
645 HG_TXNID=TXN:$ID$
642 HG_TXNNAME=push
646 HG_TXNNAME=push
643 HG_URL=file:$TESTTMP/a
647 HG_URL=file:$TESTTMP/a
644
648
645 txnabort Python hook: bundle2,changes,source,txnid,txnname,url
649 txnabort Python hook: bundle2,changes,source,txnid,txnname,url
646 txnabort hook: HG_BUNDLE2=1
650 txnabort hook: HG_BUNDLE2=1
647 HG_HOOKNAME=txnabort.1
651 HG_HOOKNAME=txnabort.1
648 HG_HOOKTYPE=txnabort
652 HG_HOOKTYPE=txnabort
649 HG_SOURCE=push
653 HG_SOURCE=push
650 HG_TXNID=TXN:$ID$
654 HG_TXNID=TXN:$ID$
651 HG_TXNNAME=push
655 HG_TXNNAME=push
652 HG_URL=file:$TESTTMP/a
656 HG_URL=file:$TESTTMP/a
653
657
654 abort: prepushkey hook exited with status 1
658 abort: prepushkey hook exited with status 1
655 [40]
659 [40]
656 $ cd ../a
660 $ cd ../a
657
661
658 test that prelistkeys can prevent listing keys
662 test that prelistkeys can prevent listing keys
659
663
660 $ cat >> .hg/hgrc <<EOF
664 $ cat >> .hg/hgrc <<EOF
661 > prelistkeys = sh -c "printenv.py --line prelistkeys.forbid 1"
665 > prelistkeys = sh -c "printenv.py --line prelistkeys.forbid 1"
662 > EOF
666 > EOF
663 $ hg bookmark -r null quux
667 $ hg bookmark -r null quux
664 pretxnopen hook: HG_HOOKNAME=pretxnopen
668 pretxnopen hook: HG_HOOKNAME=pretxnopen
665 HG_HOOKTYPE=pretxnopen
669 HG_HOOKTYPE=pretxnopen
666 HG_TXNID=TXN:$ID$
670 HG_TXNID=TXN:$ID$
667 HG_TXNNAME=bookmark
671 HG_TXNNAME=bookmark
668
672
669 pretxnclose hook: HG_BOOKMARK_MOVED=1
673 pretxnclose hook: HG_BOOKMARK_MOVED=1
670 HG_HOOKNAME=pretxnclose
674 HG_HOOKNAME=pretxnclose
671 HG_HOOKTYPE=pretxnclose
675 HG_HOOKTYPE=pretxnclose
672 HG_PENDING=$TESTTMP/a
676 HG_PENDING=$TESTTMP/a
673 HG_TXNID=TXN:$ID$
677 HG_TXNID=TXN:$ID$
674 HG_TXNNAME=bookmark
678 HG_TXNNAME=bookmark
675
679
676 txnclose hook: HG_BOOKMARK_MOVED=1
680 txnclose hook: HG_BOOKMARK_MOVED=1
677 HG_HOOKNAME=txnclose
681 HG_HOOKNAME=txnclose
678 HG_HOOKTYPE=txnclose
682 HG_HOOKTYPE=txnclose
679 HG_TXNID=TXN:$ID$
683 HG_TXNID=TXN:$ID$
680 HG_TXNNAME=bookmark
684 HG_TXNNAME=bookmark
681
685
682 $ cd ../b
686 $ cd ../b
683 $ hg pull -B quux ../a
687 $ hg pull -B quux ../a
684 pulling from ../a
688 pulling from ../a
685 prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys
689 prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys
686 HG_HOOKTYPE=prelistkeys
690 HG_HOOKTYPE=prelistkeys
687 HG_NAMESPACE=bookmarks
691 HG_NAMESPACE=bookmarks
688
692
689 abort: prelistkeys hook exited with status 1
693 abort: prelistkeys hook exited with status 1
690 [40]
694 [40]
691 $ cd ../a
695 $ cd ../a
692 $ rm .hg/hgrc
696 $ rm .hg/hgrc
693
697
694 prechangegroup hook can prevent incoming changes
698 prechangegroup hook can prevent incoming changes
695
699
696 $ cd ../b
700 $ cd ../b
697 $ hg -q tip
701 $ hg -q tip
698 3:07f3376c1e65
702 3:07f3376c1e65
699 $ cat > .hg/hgrc <<EOF
703 $ cat > .hg/hgrc <<EOF
700 > [hooks]
704 > [hooks]
701 > prechangegroup.forbid = sh -c "printenv.py --line prechangegroup.forbid 1"
705 > prechangegroup.forbid = sh -c "printenv.py --line prechangegroup.forbid 1"
702 > EOF
706 > EOF
703 $ hg pull ../a
707 $ hg pull ../a
704 pulling from ../a
708 pulling from ../a
705 searching for changes
709 searching for changes
706 prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid
710 prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid
707 HG_HOOKTYPE=prechangegroup
711 HG_HOOKTYPE=prechangegroup
708 HG_SOURCE=pull
712 HG_SOURCE=pull
709 HG_TXNID=TXN:$ID$
713 HG_TXNID=TXN:$ID$
710 HG_TXNNAME=pull
714 HG_TXNNAME=pull
711 file:/*/$TESTTMP/a (glob)
715 file:/*/$TESTTMP/a (glob)
712 HG_URL=file:$TESTTMP/a
716 HG_URL=file:$TESTTMP/a
713
717
714 abort: prechangegroup.forbid hook exited with status 1
718 abort: prechangegroup.forbid hook exited with status 1
715 [40]
719 [40]
716
720
717 pretxnchangegroup hook can see incoming changes, can roll back txn,
721 pretxnchangegroup hook can see incoming changes, can roll back txn,
718 incoming changes no longer there after
722 incoming changes no longer there after
719
723
720 $ cat > .hg/hgrc <<EOF
724 $ cat > .hg/hgrc <<EOF
721 > [hooks]
725 > [hooks]
722 > pretxnchangegroup.forbid0 = hg tip -q
726 > pretxnchangegroup.forbid0 = hg tip -q
723 > pretxnchangegroup.forbid1 = sh -c "printenv.py --line pretxnchangegroup.forbid 1"
727 > pretxnchangegroup.forbid1 = sh -c "printenv.py --line pretxnchangegroup.forbid 1"
724 > EOF
728 > EOF
725 $ hg pull ../a
729 $ hg pull ../a
726 pulling from ../a
730 pulling from ../a
727 searching for changes
731 searching for changes
728 adding changesets
732 adding changesets
729 adding manifests
733 adding manifests
730 adding file changes
734 adding file changes
731 4:539e4b31b6dc
735 4:539e4b31b6dc
732 pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1
736 pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1
733 HG_HOOKTYPE=pretxnchangegroup
737 HG_HOOKTYPE=pretxnchangegroup
734 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
738 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
735 HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
739 HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
736 HG_PENDING=$TESTTMP/b
740 HG_PENDING=$TESTTMP/b
737 HG_SOURCE=pull
741 HG_SOURCE=pull
738 HG_TXNID=TXN:$ID$
742 HG_TXNID=TXN:$ID$
739 HG_TXNNAME=pull
743 HG_TXNNAME=pull
740 file:/*/$TESTTMP/a (glob)
744 file:/*/$TESTTMP/a (glob)
741 HG_URL=file:$TESTTMP/a
745 HG_URL=file:$TESTTMP/a
742
746
743 transaction abort!
747 transaction abort!
744 rollback completed
748 rollback completed
745 abort: pretxnchangegroup.forbid1 hook exited with status 1
749 abort: pretxnchangegroup.forbid1 hook exited with status 1
746 [40]
750 [40]
747 $ hg -q tip
751 $ hg -q tip
748 3:07f3376c1e65
752 3:07f3376c1e65
749
753
750 outgoing hooks can see env vars
754 outgoing hooks can see env vars
751
755
752 $ rm .hg/hgrc
756 $ rm .hg/hgrc
753 $ cat > ../a/.hg/hgrc <<EOF
757 $ cat > ../a/.hg/hgrc <<EOF
754 > [hooks]
758 > [hooks]
755 > preoutgoing = sh -c "printenv.py --line preoutgoing"
759 > preoutgoing = sh -c "printenv.py --line preoutgoing"
756 > outgoing = sh -c "printenv.py --line outgoing"
760 > outgoing = sh -c "printenv.py --line outgoing"
757 > EOF
761 > EOF
758 $ hg pull ../a
762 $ hg pull ../a
759 pulling from ../a
763 pulling from ../a
760 searching for changes
764 searching for changes
761 preoutgoing hook: HG_HOOKNAME=preoutgoing
765 preoutgoing hook: HG_HOOKNAME=preoutgoing
762 HG_HOOKTYPE=preoutgoing
766 HG_HOOKTYPE=preoutgoing
763 HG_SOURCE=pull
767 HG_SOURCE=pull
764
768
765 outgoing hook: HG_HOOKNAME=outgoing
769 outgoing hook: HG_HOOKNAME=outgoing
766 HG_HOOKTYPE=outgoing
770 HG_HOOKTYPE=outgoing
767 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
771 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
768 HG_SOURCE=pull
772 HG_SOURCE=pull
769
773
770 adding changesets
774 adding changesets
771 adding manifests
775 adding manifests
772 adding file changes
776 adding file changes
773 adding remote bookmark quux
777 adding remote bookmark quux
774 added 1 changesets with 1 changes to 1 files
778 added 1 changesets with 1 changes to 1 files
775 new changesets 539e4b31b6dc
779 new changesets 539e4b31b6dc
776 (run 'hg update' to get a working copy)
780 (run 'hg update' to get a working copy)
777 $ hg rollback
781 $ hg rollback
778 repository tip rolled back to revision 3 (undo pull)
782 repository tip rolled back to revision 3 (undo pull)
779
783
780 preoutgoing hook can prevent outgoing changes
784 preoutgoing hook can prevent outgoing changes
781
785
782 $ cat >> ../a/.hg/hgrc <<EOF
786 $ cat >> ../a/.hg/hgrc <<EOF
783 > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1"
787 > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1"
784 > EOF
788 > EOF
785 $ hg pull ../a
789 $ hg pull ../a
786 pulling from ../a
790 pulling from ../a
787 searching for changes
791 searching for changes
788 preoutgoing hook: HG_HOOKNAME=preoutgoing
792 preoutgoing hook: HG_HOOKNAME=preoutgoing
789 HG_HOOKTYPE=preoutgoing
793 HG_HOOKTYPE=preoutgoing
790 HG_SOURCE=pull
794 HG_SOURCE=pull
791
795
792 preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid
796 preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid
793 HG_HOOKTYPE=preoutgoing
797 HG_HOOKTYPE=preoutgoing
794 HG_SOURCE=pull
798 HG_SOURCE=pull
795
799
796 abort: preoutgoing.forbid hook exited with status 1
800 abort: preoutgoing.forbid hook exited with status 1
797 [40]
801 [40]
798
802
799 outgoing hooks work for local clones
803 outgoing hooks work for local clones
800
804
801 $ cd ..
805 $ cd ..
802 $ cat > a/.hg/hgrc <<EOF
806 $ cat > a/.hg/hgrc <<EOF
803 > [hooks]
807 > [hooks]
804 > preoutgoing = sh -c "printenv.py --line preoutgoing"
808 > preoutgoing = sh -c "printenv.py --line preoutgoing"
805 > outgoing = sh -c "printenv.py --line outgoing"
809 > outgoing = sh -c "printenv.py --line outgoing"
806 > EOF
810 > EOF
807 $ hg clone a c
811 $ hg clone a c
808 preoutgoing hook: HG_HOOKNAME=preoutgoing
812 preoutgoing hook: HG_HOOKNAME=preoutgoing
809 HG_HOOKTYPE=preoutgoing
813 HG_HOOKTYPE=preoutgoing
810 HG_SOURCE=clone
814 HG_SOURCE=clone
811
815
812 outgoing hook: HG_HOOKNAME=outgoing
816 outgoing hook: HG_HOOKNAME=outgoing
813 HG_HOOKTYPE=outgoing
817 HG_HOOKTYPE=outgoing
814 HG_NODE=0000000000000000000000000000000000000000
818 HG_NODE=0000000000000000000000000000000000000000
815 HG_SOURCE=clone
819 HG_SOURCE=clone
816
820
817 updating to branch default
821 updating to branch default
818 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
822 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
819 $ rm -rf c
823 $ rm -rf c
820
824
821 preoutgoing hook can prevent outgoing changes for local clones
825 preoutgoing hook can prevent outgoing changes for local clones
822
826
823 $ cat >> a/.hg/hgrc <<EOF
827 $ cat >> a/.hg/hgrc <<EOF
824 > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1"
828 > preoutgoing.forbid = sh -c "printenv.py --line preoutgoing.forbid 1"
825 > EOF
829 > EOF
826 $ hg clone a zzz
830 $ hg clone a zzz
827 preoutgoing hook: HG_HOOKNAME=preoutgoing
831 preoutgoing hook: HG_HOOKNAME=preoutgoing
828 HG_HOOKTYPE=preoutgoing
832 HG_HOOKTYPE=preoutgoing
829 HG_SOURCE=clone
833 HG_SOURCE=clone
830
834
831 preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid
835 preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid
832 HG_HOOKTYPE=preoutgoing
836 HG_HOOKTYPE=preoutgoing
833 HG_SOURCE=clone
837 HG_SOURCE=clone
834
838
835 abort: preoutgoing.forbid hook exited with status 1
839 abort: preoutgoing.forbid hook exited with status 1
836 [40]
840 [40]
837
841
838 $ cd "$TESTTMP/b"
842 $ cd "$TESTTMP/b"
839
843
840 $ cat > hooktests.py <<EOF
844 $ cat > hooktests.py <<EOF
841 > from mercurial import (
845 > from mercurial import (
842 > error,
846 > error,
843 > pycompat,
847 > pycompat,
844 > )
848 > )
845 >
849 >
846 > uncallable = 0
850 > uncallable = 0
847 >
851 >
848 > def printargs(ui, args):
852 > def printargs(ui, args):
849 > a = list(pycompat.byteskwargs(args).items())
853 > a = list(pycompat.byteskwargs(args).items())
850 > a.sort()
854 > a.sort()
851 > ui.write(b'hook args:\n')
855 > ui.write(b'hook args:\n')
852 > for k, v in a:
856 > for k, v in a:
853 > ui.write(b' %s %s\n' % (k, v))
857 > ui.write(b' %s %s\n' % (k, v))
854 >
858 >
855 > def passhook(ui, repo, **args):
859 > def passhook(ui, repo, **args):
856 > printargs(ui, args)
860 > printargs(ui, args)
857 >
861 >
858 > def failhook(ui, repo, **args):
862 > def failhook(ui, repo, **args):
859 > printargs(ui, args)
863 > printargs(ui, args)
860 > return True
864 > return True
861 >
865 >
862 > class LocalException(Exception):
866 > class LocalException(Exception):
863 > pass
867 > pass
864 >
868 >
865 > def raisehook(**args):
869 > def raisehook(**args):
866 > raise LocalException('exception from hook')
870 > raise LocalException('exception from hook')
867 >
871 >
868 > def aborthook(**args):
872 > def aborthook(**args):
869 > raise error.Abort(b'raise abort from hook')
873 > raise error.Abort(b'raise abort from hook')
870 >
874 >
871 > def brokenhook(**args):
875 > def brokenhook(**args):
872 > return 1 + {}
876 > return 1 + {}
873 >
877 >
874 > def verbosehook(ui, **args):
878 > def verbosehook(ui, **args):
875 > ui.note(b'verbose output from hook\n')
879 > ui.note(b'verbose output from hook\n')
876 >
880 >
877 > def printtags(ui, repo, **args):
881 > def printtags(ui, repo, **args):
878 > ui.write(b'[%s]\n' % b', '.join(sorted(repo.tags())))
882 > ui.write(b'[%s]\n' % b', '.join(sorted(repo.tags())))
879 >
883 >
880 > class container(object):
884 > class container(object):
881 > unreachable = 1
885 > unreachable = 1
882 > EOF
886 > EOF
883
887
884 $ cat > syntaxerror.py << NO_CHECK_EOF
888 $ cat > syntaxerror.py << NO_CHECK_EOF
885 > (foo
889 > (foo
886 > NO_CHECK_EOF
890 > NO_CHECK_EOF
887
891
888 test python hooks
892 test python hooks
889
893
890 #if windows
894 #if windows
891 $ PYTHONPATH="$TESTTMP/b;$PYTHONPATH"
895 $ PYTHONPATH="$TESTTMP/b;$PYTHONPATH"
892 #else
896 #else
893 $ PYTHONPATH="$TESTTMP/b:$PYTHONPATH"
897 $ PYTHONPATH="$TESTTMP/b:$PYTHONPATH"
894 #endif
898 #endif
895 $ export PYTHONPATH
899 $ export PYTHONPATH
896
900
897 $ echo '[hooks]' > ../a/.hg/hgrc
901 $ echo '[hooks]' > ../a/.hg/hgrc
898 $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
902 $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
899 $ hg pull ../a 2>&1 | grep 'raised an exception'
903 $ hg pull ../a 2>&1 | grep 'raised an exception'
900 error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
904 error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
901
905
902 $ echo '[hooks]' > ../a/.hg/hgrc
906 $ echo '[hooks]' > ../a/.hg/hgrc
903 $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
907 $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
904 $ hg pull ../a 2>&1 | grep 'raised an exception'
908 $ hg pull ../a 2>&1 | grep 'raised an exception'
905 error: preoutgoing.raise hook raised an exception: exception from hook
909 error: preoutgoing.raise hook raised an exception: exception from hook
906
910
907 $ echo '[hooks]' > ../a/.hg/hgrc
911 $ echo '[hooks]' > ../a/.hg/hgrc
908 $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
912 $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
909 $ hg pull ../a
913 $ hg pull ../a
910 pulling from ../a
914 pulling from ../a
911 searching for changes
915 searching for changes
912 error: preoutgoing.abort hook failed: raise abort from hook
916 error: preoutgoing.abort hook failed: raise abort from hook
913 abort: raise abort from hook
917 abort: raise abort from hook
914 [255]
918 [255]
915
919
916 $ echo '[hooks]' > ../a/.hg/hgrc
920 $ echo '[hooks]' > ../a/.hg/hgrc
917 $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
921 $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
918 $ hg pull ../a
922 $ hg pull ../a
919 pulling from ../a
923 pulling from ../a
920 searching for changes
924 searching for changes
921 hook args:
925 hook args:
922 hooktype preoutgoing
926 hooktype preoutgoing
923 source pull
927 source pull
924 abort: preoutgoing.fail hook failed
928 abort: preoutgoing.fail hook failed
925 [40]
929 [40]
926
930
927 $ echo '[hooks]' > ../a/.hg/hgrc
931 $ echo '[hooks]' > ../a/.hg/hgrc
928 $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
932 $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
929 $ hg pull ../a
933 $ hg pull ../a
930 pulling from ../a
934 pulling from ../a
931 searching for changes
935 searching for changes
932 abort: preoutgoing.uncallable hook is invalid: "hooktests.uncallable" is not callable
936 abort: preoutgoing.uncallable hook is invalid: "hooktests.uncallable" is not callable
933 [255]
937 [255]
934
938
935 $ echo '[hooks]' > ../a/.hg/hgrc
939 $ echo '[hooks]' > ../a/.hg/hgrc
936 $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
940 $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
937 $ hg pull ../a
941 $ hg pull ../a
938 pulling from ../a
942 pulling from ../a
939 searching for changes
943 searching for changes
940 abort: preoutgoing.nohook hook is invalid: "hooktests.nohook" is not defined
944 abort: preoutgoing.nohook hook is invalid: "hooktests.nohook" is not defined
941 [255]
945 [255]
942
946
943 $ echo '[hooks]' > ../a/.hg/hgrc
947 $ echo '[hooks]' > ../a/.hg/hgrc
944 $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
948 $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
945 $ hg pull ../a
949 $ hg pull ../a
946 pulling from ../a
950 pulling from ../a
947 searching for changes
951 searching for changes
948 abort: preoutgoing.nomodule hook is invalid: "nomodule" not in a module
952 abort: preoutgoing.nomodule hook is invalid: "nomodule" not in a module
949 [255]
953 [255]
950
954
951 $ echo '[hooks]' > ../a/.hg/hgrc
955 $ echo '[hooks]' > ../a/.hg/hgrc
952 $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
956 $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
953 $ hg pull ../a
957 $ hg pull ../a
954 pulling from ../a
958 pulling from ../a
955 searching for changes
959 searching for changes
956 abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed
960 abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed
957 (run with --traceback for stack trace)
961 (run with --traceback for stack trace)
958 [255]
962 [255]
959
963
960 $ echo '[hooks]' > ../a/.hg/hgrc
964 $ echo '[hooks]' > ../a/.hg/hgrc
961 $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
965 $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
962 $ hg pull ../a
966 $ hg pull ../a
963 pulling from ../a
967 pulling from ../a
964 searching for changes
968 searching for changes
965 abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed
969 abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed
966 (run with --traceback for stack trace)
970 (run with --traceback for stack trace)
967 [255]
971 [255]
968
972
969 $ echo '[hooks]' > ../a/.hg/hgrc
973 $ echo '[hooks]' > ../a/.hg/hgrc
970 $ echo 'preoutgoing.syntaxerror = python:syntaxerror.syntaxerror' >> ../a/.hg/hgrc
974 $ echo 'preoutgoing.syntaxerror = python:syntaxerror.syntaxerror' >> ../a/.hg/hgrc
971 $ hg pull ../a
975 $ hg pull ../a
972 pulling from ../a
976 pulling from ../a
973 searching for changes
977 searching for changes
974 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
978 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
975 (run with --traceback for stack trace)
979 (run with --traceback for stack trace)
976 [255]
980 [255]
977
981
978 $ hg pull ../a --traceback 2>&1 | grep -E 'pulling|searching|^exception|Traceback|SyntaxError|ImportError|ModuleNotFoundError|HookLoadError|abort'
982 $ hg pull ../a --traceback 2>&1 | grep -E 'pulling|searching|^exception|Traceback|SyntaxError|ImportError|ModuleNotFoundError|HookLoadError|abort'
979 pulling from ../a
983 pulling from ../a
980 searching for changes
984 searching for changes
981 exception from first failed import attempt:
985 exception from first failed import attempt:
982 Traceback (most recent call last):
986 Traceback (most recent call last):
983 SyntaxError: * (glob)
987 SyntaxError: * (glob)
984 exception from second failed import attempt:
988 exception from second failed import attempt:
985 Traceback (most recent call last):
989 Traceback (most recent call last):
986 SyntaxError: * (glob)
990 SyntaxError: * (glob)
987 Traceback (most recent call last):
991 Traceback (most recent call last):
988 ModuleNotFoundError: No module named 'hgext_syntaxerror'
992 ModuleNotFoundError: No module named 'hgext_syntaxerror'
989 Traceback (most recent call last):
993 Traceback (most recent call last):
990 SyntaxError: * (glob)
994 SyntaxError: * (glob)
991 Traceback (most recent call last):
995 Traceback (most recent call last):
992 ModuleNotFoundError: No module named 'hgext_syntaxerror'
996 ModuleNotFoundError: No module named 'hgext_syntaxerror'
993 Traceback (most recent call last):
997 Traceback (most recent call last):
994 raise error.HookLoadError(msg, hint=tracebackhint) (py37 !)
998 raise error.HookLoadError(msg, hint=tracebackhint) (py37 !)
995 mercurial.error.HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
999 mercurial.error.HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
996 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
1000 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
997
1001
998 $ echo '[hooks]' > ../a/.hg/hgrc
1002 $ echo '[hooks]' > ../a/.hg/hgrc
999 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
1003 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
1000 $ hg pull ../a
1004 $ hg pull ../a
1001 pulling from ../a
1005 pulling from ../a
1002 searching for changes
1006 searching for changes
1003 hook args:
1007 hook args:
1004 hooktype preoutgoing
1008 hooktype preoutgoing
1005 source pull
1009 source pull
1006 adding changesets
1010 adding changesets
1007 adding manifests
1011 adding manifests
1008 adding file changes
1012 adding file changes
1009 adding remote bookmark quux
1013 adding remote bookmark quux
1010 added 1 changesets with 1 changes to 1 files
1014 added 1 changesets with 1 changes to 1 files
1011 new changesets 539e4b31b6dc
1015 new changesets 539e4b31b6dc
1012 (run 'hg update' to get a working copy)
1016 (run 'hg update' to get a working copy)
1013
1017
1014 post- python hooks that fail to *run* don't cause an abort
1018 post- python hooks that fail to *run* don't cause an abort
1015 $ rm ../a/.hg/hgrc
1019 $ rm ../a/.hg/hgrc
1016 $ echo '[hooks]' > .hg/hgrc
1020 $ echo '[hooks]' > .hg/hgrc
1017 $ echo 'post-pull.broken = python:hooktests.brokenhook' >> .hg/hgrc
1021 $ echo 'post-pull.broken = python:hooktests.brokenhook' >> .hg/hgrc
1018 $ hg pull ../a
1022 $ hg pull ../a
1019 pulling from ../a
1023 pulling from ../a
1020 searching for changes
1024 searching for changes
1021 no changes found
1025 no changes found
1022 error: post-pull.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
1026 error: post-pull.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
1023 (run with --traceback for stack trace)
1027 (run with --traceback for stack trace)
1024
1028
1025 but post- python hooks that fail to *load* do
1029 but post- python hooks that fail to *load* do
1026 $ echo '[hooks]' > .hg/hgrc
1030 $ echo '[hooks]' > .hg/hgrc
1027 $ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc
1031 $ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc
1028 $ hg pull ../a
1032 $ hg pull ../a
1029 pulling from ../a
1033 pulling from ../a
1030 searching for changes
1034 searching for changes
1031 no changes found
1035 no changes found
1032 abort: post-pull.nomodule hook is invalid: "nomodule" not in a module
1036 abort: post-pull.nomodule hook is invalid: "nomodule" not in a module
1033 [255]
1037 [255]
1034
1038
1035 $ echo '[hooks]' > .hg/hgrc
1039 $ echo '[hooks]' > .hg/hgrc
1036 $ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc
1040 $ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc
1037 $ hg pull ../a
1041 $ hg pull ../a
1038 pulling from ../a
1042 pulling from ../a
1039 searching for changes
1043 searching for changes
1040 no changes found
1044 no changes found
1041 abort: post-pull.badmodule hook is invalid: import of "nomodule" failed
1045 abort: post-pull.badmodule hook is invalid: import of "nomodule" failed
1042 (run with --traceback for stack trace)
1046 (run with --traceback for stack trace)
1043 [255]
1047 [255]
1044
1048
1045 $ echo '[hooks]' > .hg/hgrc
1049 $ echo '[hooks]' > .hg/hgrc
1046 $ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc
1050 $ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc
1047 $ hg pull ../a
1051 $ hg pull ../a
1048 pulling from ../a
1052 pulling from ../a
1049 searching for changes
1053 searching for changes
1050 no changes found
1054 no changes found
1051 abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined
1055 abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined
1052 [255]
1056 [255]
1053
1057
1054 make sure --traceback works
1058 make sure --traceback works
1055
1059
1056 $ echo '[hooks]' > .hg/hgrc
1060 $ echo '[hooks]' > .hg/hgrc
1057 $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
1061 $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
1058
1062
1059 $ echo aa > a
1063 $ echo aa > a
1060 $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback'
1064 $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback'
1061 Traceback (most recent call last):
1065 Traceback (most recent call last):
1062
1066
1063 $ cd ..
1067 $ cd ..
1064 $ hg init c
1068 $ hg init c
1065 $ cd c
1069 $ cd c
1066
1070
1067 $ cat > hookext.py <<EOF
1071 $ cat > hookext.py <<EOF
1068 > def autohook(ui, **args):
1072 > def autohook(ui, **args):
1069 > ui.write(b'Automatically installed hook\n')
1073 > ui.write(b'Automatically installed hook\n')
1070 >
1074 >
1071 > def reposetup(ui, repo):
1075 > def reposetup(ui, repo):
1072 > repo.ui.setconfig(b"hooks", b"commit.auto", autohook)
1076 > repo.ui.setconfig(b"hooks", b"commit.auto", autohook)
1073 > EOF
1077 > EOF
1074 $ echo '[extensions]' >> .hg/hgrc
1078 $ echo '[extensions]' >> .hg/hgrc
1075 $ echo 'hookext = hookext.py' >> .hg/hgrc
1079 $ echo 'hookext = hookext.py' >> .hg/hgrc
1076
1080
1077 $ touch foo
1081 $ touch foo
1078 $ hg add foo
1082 $ hg add foo
1079 $ hg ci -d '0 0' -m 'add foo'
1083 $ hg ci -d '0 0' -m 'add foo'
1080 Automatically installed hook
1084 Automatically installed hook
1081 $ echo >> foo
1085 $ echo >> foo
1082 $ hg ci --debug -d '0 0' -m 'change foo'
1086 $ hg ci --debug -d '0 0' -m 'change foo'
1083 committing files:
1087 committing files:
1084 foo
1088 foo
1085 committing manifest
1089 committing manifest
1086 committing changelog
1090 committing changelog
1087 updating the branch cache
1091 updating the branch cache
1088 committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
1092 committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
1089 calling hook commit.auto: hgext_hookext.autohook
1093 calling hook commit.auto: hgext_hookext.autohook
1090 Automatically installed hook
1094 Automatically installed hook
1091
1095
1092 $ hg showconfig hooks
1096 $ hg showconfig hooks
1093 hooks.commit.auto=<function autohook at *> (glob)
1097 hooks.commit.auto=<function autohook at *> (glob)
1094
1098
1095 test python hook configured with python:[file]:[hook] syntax
1099 test python hook configured with python:[file]:[hook] syntax
1096
1100
1097 $ cd ..
1101 $ cd ..
1098 $ mkdir d
1102 $ mkdir d
1099 $ cd d
1103 $ cd d
1100 $ hg init repo
1104 $ hg init repo
1101 $ mkdir hooks
1105 $ mkdir hooks
1102
1106
1103 $ cd hooks
1107 $ cd hooks
1104 $ cat > testhooks.py <<EOF
1108 $ cat > testhooks.py <<EOF
1105 > def testhook(ui, **args):
1109 > def testhook(ui, **args):
1106 > ui.write(b'hook works\n')
1110 > ui.write(b'hook works\n')
1107 > EOF
1111 > EOF
1108 $ echo '[hooks]' > ../repo/.hg/hgrc
1112 $ echo '[hooks]' > ../repo/.hg/hgrc
1109 $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc
1113 $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc
1110
1114
1111 $ cd ../repo
1115 $ cd ../repo
1112 $ hg commit -d '0 0'
1116 $ hg commit -d '0 0'
1113 hook works
1117 hook works
1114 nothing changed
1118 nothing changed
1115 [1]
1119 [1]
1116
1120
1117 $ echo '[hooks]' > .hg/hgrc
1121 $ echo '[hooks]' > .hg/hgrc
1118 $ echo "update.ne = python:`pwd`/nonexistent.py:testhook" >> .hg/hgrc
1122 $ echo "update.ne = python:`pwd`/nonexistent.py:testhook" >> .hg/hgrc
1119 $ echo "pre-identify.npmd = python:`pwd`/:no_python_module_dir" >> .hg/hgrc
1123 $ echo "pre-identify.npmd = python:`pwd`/:no_python_module_dir" >> .hg/hgrc
1120
1124
1121 $ hg up null
1125 $ hg up null
1122 loading update.ne hook failed:
1126 loading update.ne hook failed:
1123 abort: $ENOENT$: '$TESTTMP/d/repo/nonexistent.py'
1127 abort: $ENOENT$: '$TESTTMP/d/repo/nonexistent.py'
1124 [255]
1128 [255]
1125
1129
1126 $ hg id
1130 $ hg id
1127 loading pre-identify.npmd hook failed:
1131 loading pre-identify.npmd hook failed:
1128 abort: No module named 'repo'
1132 abort: No module named 'repo'
1129 [255]
1133 [255]
1130
1134
1131 $ cd ../../b
1135 $ cd ../../b
1132
1136
1133 make sure --traceback works on hook import failure
1137 make sure --traceback works on hook import failure
1134
1138
1135 $ cat > importfail.py <<EOF
1139 $ cat > importfail.py <<EOF
1136 > import somebogusmodule
1140 > import somebogusmodule
1137 > # dereference something in the module to force demandimport to load it
1141 > # dereference something in the module to force demandimport to load it
1138 > somebogusmodule.whatever
1142 > somebogusmodule.whatever
1139 > EOF
1143 > EOF
1140
1144
1141 $ echo '[hooks]' > .hg/hgrc
1145 $ echo '[hooks]' > .hg/hgrc
1142 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
1146 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
1143
1147
1144 $ echo a >> a
1148 $ echo a >> a
1145 $ hg --traceback commit -ma 2>&1 | grep -E '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort'
1149 $ hg --traceback commit -ma 2>&1 | grep -E '^exception|ImportError|ModuleNotFoundError|Traceback|HookLoadError|abort'
1146 exception from first failed import attempt:
1150 exception from first failed import attempt:
1147 Traceback (most recent call last):
1151 Traceback (most recent call last):
1148 ModuleNotFoundError: No module named 'somebogusmodule'
1152 ModuleNotFoundError: No module named 'somebogusmodule'
1149 exception from second failed import attempt:
1153 exception from second failed import attempt:
1150 Traceback (most recent call last):
1154 Traceback (most recent call last):
1151 ModuleNotFoundError: No module named 'somebogusmodule'
1155 ModuleNotFoundError: No module named 'somebogusmodule'
1152 Traceback (most recent call last):
1156 Traceback (most recent call last):
1153 ModuleNotFoundError: No module named 'hgext_importfail'
1157 ModuleNotFoundError: No module named 'hgext_importfail'
1154 Traceback (most recent call last):
1158 Traceback (most recent call last):
1155 ModuleNotFoundError: No module named 'somebogusmodule'
1159 ModuleNotFoundError: No module named 'somebogusmodule'
1156 Traceback (most recent call last):
1160 Traceback (most recent call last):
1157 ModuleNotFoundError: No module named 'hgext_importfail'
1161 ModuleNotFoundError: No module named 'hgext_importfail'
1158 Traceback (most recent call last):
1162 Traceback (most recent call last):
1159 raise error.HookLoadError(msg, hint=tracebackhint) (py37 !)
1163 raise error.HookLoadError(msg, hint=tracebackhint) (py37 !)
1160 mercurial.error.HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed
1164 mercurial.error.HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed
1161 abort: precommit.importfail hook is invalid: import of "importfail" failed
1165 abort: precommit.importfail hook is invalid: import of "importfail" failed
1162
1166
1163 Issue1827: Hooks Update & Commit not completely post operation
1167 Issue1827: Hooks Update & Commit not completely post operation
1164
1168
1165 commit and update hooks should run after command completion. The largefiles
1169 commit and update hooks should run after command completion. The largefiles
1166 use demonstrates a recursive wlock, showing the hook doesn't run until the
1170 use demonstrates a recursive wlock, showing the hook doesn't run until the
1167 final release (and dirstate flush).
1171 final release (and dirstate flush).
1168
1172
1169 $ echo '[hooks]' > .hg/hgrc
1173 $ echo '[hooks]' > .hg/hgrc
1170 $ echo 'commit = hg id' >> .hg/hgrc
1174 $ echo 'commit = hg id' >> .hg/hgrc
1171 $ echo 'update = hg id' >> .hg/hgrc
1175 $ echo 'update = hg id' >> .hg/hgrc
1172 $ echo bb > a
1176 $ echo bb > a
1173 $ hg ci -ma
1177 $ hg ci -ma
1174 223eafe2750c tip
1178 223eafe2750c tip
1175 $ hg up 0 --config extensions.largefiles=
1179 $ hg up 0 --config extensions.largefiles=
1176 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
1180 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
1177 cb9a9f314b8b
1181 cb9a9f314b8b
1178 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1182 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1179
1183
1180 make sure --verbose (and --quiet/--debug etc.) are propagated to the local ui
1184 make sure --verbose (and --quiet/--debug etc.) are propagated to the local ui
1181 that is passed to pre/post hooks
1185 that is passed to pre/post hooks
1182
1186
1183 $ echo '[hooks]' > .hg/hgrc
1187 $ echo '[hooks]' > .hg/hgrc
1184 $ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc
1188 $ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc
1185 $ hg id
1189 $ hg id
1186 cb9a9f314b8b
1190 cb9a9f314b8b
1187 $ hg id --verbose
1191 $ hg id --verbose
1188 calling hook pre-identify: hooktests.verbosehook
1192 calling hook pre-identify: hooktests.verbosehook
1189 verbose output from hook
1193 verbose output from hook
1190 cb9a9f314b8b
1194 cb9a9f314b8b
1191
1195
1192 Ensure hooks can be prioritized
1196 Ensure hooks can be prioritized
1193
1197
1194 $ echo '[hooks]' > .hg/hgrc
1198 $ echo '[hooks]' > .hg/hgrc
1195 $ echo 'pre-identify.a = python:hooktests.verbosehook' >> .hg/hgrc
1199 $ echo 'pre-identify.a = python:hooktests.verbosehook' >> .hg/hgrc
1196 $ echo 'pre-identify.b = python:hooktests.verbosehook' >> .hg/hgrc
1200 $ echo 'pre-identify.b = python:hooktests.verbosehook' >> .hg/hgrc
1197 $ echo 'priority.pre-identify.b = 1' >> .hg/hgrc
1201 $ echo 'priority.pre-identify.b = 1' >> .hg/hgrc
1198 $ echo 'pre-identify.c = python:hooktests.verbosehook' >> .hg/hgrc
1202 $ echo 'pre-identify.c = python:hooktests.verbosehook' >> .hg/hgrc
1199 $ hg id --verbose
1203 $ hg id --verbose
1200 calling hook pre-identify.b: hooktests.verbosehook
1204 calling hook pre-identify.b: hooktests.verbosehook
1201 verbose output from hook
1205 verbose output from hook
1202 calling hook pre-identify.a: hooktests.verbosehook
1206 calling hook pre-identify.a: hooktests.verbosehook
1203 verbose output from hook
1207 verbose output from hook
1204 calling hook pre-identify.c: hooktests.verbosehook
1208 calling hook pre-identify.c: hooktests.verbosehook
1205 verbose output from hook
1209 verbose output from hook
1206 cb9a9f314b8b
1210 cb9a9f314b8b
1207
1211
1208 new tags must be visible in pretxncommit (issue3210)
1212 new tags must be visible in pretxncommit (issue3210)
1209
1213
1210 $ echo 'pretxncommit.printtags = python:hooktests.printtags' >> .hg/hgrc
1214 $ echo 'pretxncommit.printtags = python:hooktests.printtags' >> .hg/hgrc
1211 $ hg tag -f foo
1215 $ hg tag -f foo
1212 [a, foo, tip]
1216 [a, foo, tip]
1213
1217
1214 post-init hooks must not crash (issue4983)
1218 post-init hooks must not crash (issue4983)
1215 This also creates the `to` repo for the next test block.
1219 This also creates the `to` repo for the next test block.
1216
1220
1217 $ cd ..
1221 $ cd ..
1218 $ cat << EOF >> hgrc-with-post-init-hook
1222 $ cat << EOF >> hgrc-with-post-init-hook
1219 > [hooks]
1223 > [hooks]
1220 > post-init = sh -c "printenv.py --line post-init"
1224 > post-init = sh -c "printenv.py --line post-init"
1221 > EOF
1225 > EOF
1222 $ HGRCPATH=hgrc-with-post-init-hook hg init to
1226 $ HGRCPATH=hgrc-with-post-init-hook hg init to
1223 post-init hook: HG_ARGS=init to
1227 post-init hook: HG_ARGS=init to
1224 HG_HOOKNAME=post-init
1228 HG_HOOKNAME=post-init
1225 HG_HOOKTYPE=post-init
1229 HG_HOOKTYPE=post-init
1226 HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''}
1230 HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''}
1227 HG_PATS=['to']
1231 HG_PATS=['to']
1228 HG_RESULT=0
1232 HG_RESULT=0
1229
1233
1230
1234
1231 new commits must be visible in pretxnchangegroup (issue3428)
1235 new commits must be visible in pretxnchangegroup (issue3428)
1232
1236
1233 $ echo '[hooks]' >> to/.hg/hgrc
1237 $ echo '[hooks]' >> to/.hg/hgrc
1234 $ echo 'prechangegroup = hg --traceback tip' >> to/.hg/hgrc
1238 $ echo 'prechangegroup = hg --traceback tip' >> to/.hg/hgrc
1235 $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc
1239 $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc
1236 $ echo a >> to/a
1240 $ echo a >> to/a
1237 $ hg --cwd to ci -Ama
1241 $ hg --cwd to ci -Ama
1238 adding a
1242 adding a
1239 $ hg clone to from
1243 $ hg clone to from
1240 updating to branch default
1244 updating to branch default
1241 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1245 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1242 $ echo aa >> from/a
1246 $ echo aa >> from/a
1243 $ hg --cwd from ci -mb
1247 $ hg --cwd from ci -mb
1244 $ hg --cwd from push
1248 $ hg --cwd from push
1245 pushing to $TESTTMP/to
1249 pushing to $TESTTMP/to
1246 searching for changes
1250 searching for changes
1247 changeset: 0:cb9a9f314b8b
1251 changeset: 0:cb9a9f314b8b
1248 tag: tip
1252 tag: tip
1249 user: test
1253 user: test
1250 date: Thu Jan 01 00:00:00 1970 +0000
1254 date: Thu Jan 01 00:00:00 1970 +0000
1251 summary: a
1255 summary: a
1252
1256
1253 adding changesets
1257 adding changesets
1254 adding manifests
1258 adding manifests
1255 adding file changes
1259 adding file changes
1256 changeset: 1:9836a07b9b9d
1260 changeset: 1:9836a07b9b9d
1257 tag: tip
1261 tag: tip
1258 user: test
1262 user: test
1259 date: Thu Jan 01 00:00:00 1970 +0000
1263 date: Thu Jan 01 00:00:00 1970 +0000
1260 summary: b
1264 summary: b
1261
1265
1262 added 1 changesets with 1 changes to 1 files
1266 added 1 changesets with 1 changes to 1 files
1263
1267
1264 pretxnclose hook failure should abort the transaction
1268 pretxnclose hook failure should abort the transaction
1265
1269
1266 $ hg init txnfailure
1270 $ hg init txnfailure
1267 $ cd txnfailure
1271 $ cd txnfailure
1268 $ touch a && hg commit -Aqm a
1272 $ touch a && hg commit -Aqm a
1269 $ cat >> .hg/hgrc <<EOF
1273 $ cat >> .hg/hgrc <<EOF
1270 > [hooks]
1274 > [hooks]
1271 > pretxnclose.error = exit 1
1275 > pretxnclose.error = exit 1
1272 > EOF
1276 > EOF
1273 $ hg strip -r 0 --config extensions.strip=
1277 $ hg strip -r 0 --config extensions.strip=
1274 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1278 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1275 saved backup bundle to * (glob)
1279 saved backup bundle to * (glob)
1276 transaction abort!
1280 transaction abort!
1277 rollback completed
1281 rollback completed
1278 strip failed, backup bundle stored in * (glob)
1282 strip failed, backup bundle stored in * (glob)
1279 abort: pretxnclose.error hook exited with status 1
1283 abort: pretxnclose.error hook exited with status 1
1280 [40]
1284 [40]
1281 $ hg recover
1285 $ hg recover
1282 no interrupted transaction available
1286 no interrupted transaction available
1283 [1]
1287 [1]
1284 $ cd ..
1288 $ cd ..
1285
1289
1286 check whether HG_PENDING makes pending changes only in related
1290 check whether HG_PENDING makes pending changes only in related
1287 repositories visible to an external hook.
1291 repositories visible to an external hook.
1288
1292
1289 (emulate a transaction running concurrently by copied
1293 (emulate a transaction running concurrently by copied
1290 .hg/store/00changelog.i.a in subsequent test)
1294 .hg/store/00changelog.i.a in subsequent test)
1291
1295
1292 $ cat > $TESTTMP/savepending.sh <<EOF
1296 $ cat > $TESTTMP/savepending.sh <<EOF
1293 > cp .hg/store/00changelog.i.a .hg/store/00changelog.i.a.saved
1297 > cp .hg/store/00changelog.i.a .hg/store/00changelog.i.a.saved
1294 > exit 1 # to avoid adding new revision for subsequent tests
1298 > exit 1 # to avoid adding new revision for subsequent tests
1295 > EOF
1299 > EOF
1296 $ cd a
1300 $ cd a
1297 $ hg tip -q
1301 $ hg tip -q
1298 4:539e4b31b6dc
1302 4:539e4b31b6dc
1299 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" commit -m "invisible"
1303 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" commit -m "invisible"
1300 transaction abort!
1304 transaction abort!
1301 rollback completed
1305 rollback completed
1302 abort: pretxnclose hook exited with status 1
1306 abort: pretxnclose hook exited with status 1
1303 [40]
1307 [40]
1304 $ cp .hg/store/00changelog.i.a.saved .hg/store/00changelog.i.a
1308 $ cp .hg/store/00changelog.i.a.saved .hg/store/00changelog.i.a
1305
1309
1306 (check (in)visibility of new changeset while transaction running in
1310 (check (in)visibility of new changeset while transaction running in
1307 repo)
1311 repo)
1308
1312
1309 $ cat > $TESTTMP/checkpending.sh <<EOF
1313 $ cat > $TESTTMP/checkpending.sh <<EOF
1310 > echo '@a'
1314 > echo '@a'
1311 > hg -R "$TESTTMP/a" tip -q
1315 > hg -R "$TESTTMP/a" tip -q
1312 > echo '@a/nested'
1316 > echo '@a/nested'
1313 > hg -R "$TESTTMP/a/nested" tip -q
1317 > hg -R "$TESTTMP/a/nested" tip -q
1314 > exit 1 # to avoid adding new revision for subsequent tests
1318 > exit 1 # to avoid adding new revision for subsequent tests
1315 > EOF
1319 > EOF
1316 $ hg init nested
1320 $ hg init nested
1317 $ cd nested
1321 $ cd nested
1318 $ echo a > a
1322 $ echo a > a
1319 $ hg add a
1323 $ hg add a
1320 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" commit -m '#0'
1324 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" commit -m '#0'
1321 @a
1325 @a
1322 4:539e4b31b6dc
1326 4:539e4b31b6dc
1323 @a/nested
1327 @a/nested
1324 0:bf5e395ced2c
1328 0:bf5e395ced2c
1325 transaction abort!
1329 transaction abort!
1326 rollback completed
1330 rollback completed
1327 abort: pretxnclose hook exited with status 1
1331 abort: pretxnclose hook exited with status 1
1328 [40]
1332 [40]
1329
1333
1330 Hook from untrusted hgrc are reported as failure
1334 Hook from untrusted hgrc are reported as failure
1331 ================================================
1335 ================================================
1332
1336
1333 $ cat << EOF > $TESTTMP/untrusted.py
1337 $ cat << EOF > $TESTTMP/untrusted.py
1334 > from mercurial import scmutil, util
1338 > from mercurial import scmutil, util
1335 > def uisetup(ui):
1339 > def uisetup(ui):
1336 > class untrustedui(ui.__class__):
1340 > class untrustedui(ui.__class__):
1337 > def _trusted(self, fp, f):
1341 > def _trusted(self, fp, f):
1338 > if util.normpath(fp.name).endswith(b'untrusted/.hg/hgrc'):
1342 > if util.normpath(fp.name).endswith(b'untrusted/.hg/hgrc'):
1339 > return False
1343 > return False
1340 > return super(untrustedui, self)._trusted(fp, f)
1344 > return super(untrustedui, self)._trusted(fp, f)
1341 > ui.__class__ = untrustedui
1345 > ui.__class__ = untrustedui
1342 > EOF
1346 > EOF
1343 $ cat << EOF >> $HGRCPATH
1347 $ cat << EOF >> $HGRCPATH
1344 > [extensions]
1348 > [extensions]
1345 > untrusted=$TESTTMP/untrusted.py
1349 > untrusted=$TESTTMP/untrusted.py
1346 > EOF
1350 > EOF
1347 $ hg init untrusted
1351 $ hg init untrusted
1348 $ cd untrusted
1352 $ cd untrusted
1349
1353
1350 Non-blocking hook
1354 Non-blocking hook
1351 -----------------
1355 -----------------
1352
1356
1353 $ cat << EOF >> .hg/hgrc
1357 $ cat << EOF >> .hg/hgrc
1354 > [hooks]
1358 > [hooks]
1355 > txnclose.testing=echo txnclose hook called
1359 > txnclose.testing=echo txnclose hook called
1356 > EOF
1360 > EOF
1357 $ touch a && hg commit -Aqm a
1361 $ touch a && hg commit -Aqm a
1358 warning: untrusted hook txnclose.testing not executed
1362 warning: untrusted hook txnclose.testing not executed
1359 $ hg log
1363 $ hg log
1360 changeset: 0:3903775176ed
1364 changeset: 0:3903775176ed
1361 tag: tip
1365 tag: tip
1362 user: test
1366 user: test
1363 date: Thu Jan 01 00:00:00 1970 +0000
1367 date: Thu Jan 01 00:00:00 1970 +0000
1364 summary: a
1368 summary: a
1365
1369
1366
1370
1367 Non-blocking hook
1371 Non-blocking hook
1368 -----------------
1372 -----------------
1369
1373
1370 $ cat << EOF >> .hg/hgrc
1374 $ cat << EOF >> .hg/hgrc
1371 > [hooks]
1375 > [hooks]
1372 > pretxnclose.testing=echo pre-txnclose hook called
1376 > pretxnclose.testing=echo pre-txnclose hook called
1373 > EOF
1377 > EOF
1374 $ touch b && hg commit -Aqm a
1378 $ touch b && hg commit -Aqm a
1375 transaction abort!
1379 transaction abort!
1376 rollback completed
1380 rollback completed
1377 abort: untrusted hook pretxnclose.testing not executed
1381 abort: untrusted hook pretxnclose.testing not executed
1378 (see 'hg help config.trusted')
1382 (see 'hg help config.trusted')
1379 [40]
1383 [40]
1380 $ hg log
1384 $ hg log
1381 changeset: 0:3903775176ed
1385 changeset: 0:3903775176ed
1382 tag: tip
1386 tag: tip
1383 user: test
1387 user: test
1384 date: Thu Jan 01 00:00:00 1970 +0000
1388 date: Thu Jan 01 00:00:00 1970 +0000
1385 summary: a
1389 summary: a
1386
1390
1387
1391
1388 unsetup the test
1392 unsetup the test
1389 ----------------
1393 ----------------
1390
1394
1391 # touch the file to unconfuse chg with a diffrent mtime
1395 # touch the file to unconfuse chg with a diffrent mtime
1392 $ sleep 1
1396 $ sleep 1
1393 $ touch $TESTTMP/untrusted.py
1397 $ touch $TESTTMP/untrusted.py
1394 $ cat << EOF >> $HGRCPATH
1398 $ cat << EOF >> $HGRCPATH
1395 > [extensions]
1399 > [extensions]
1396 > untrusted=!
1400 > untrusted=!
1397 > EOF
1401 > EOF
1398
1402
1399 HGPLAIN setting in hooks
1403 HGPLAIN setting in hooks
1400 ========================
1404 ========================
1401
1405
1402 $ cat << EOF >> .hg/hgrc
1406 $ cat << EOF >> .hg/hgrc
1403 > [hooks]
1407 > [hooks]
1404 > pre-version.testing-default=sh -c "echo '### default ###' plain: \${HGPLAIN:-'<unset>'}"
1408 > pre-version.testing-default=sh -c "echo '### default ###' plain: \${HGPLAIN:-'<unset>'}"
1405 > pre-version.testing-yes=sh -c "echo '### yes #######' plain: \${HGPLAIN:-'<unset>'}"
1409 > pre-version.testing-yes=sh -c "echo '### yes #######' plain: \${HGPLAIN:-'<unset>'}"
1406 > pre-version.testing-yes:run-with-plain=yes
1410 > pre-version.testing-yes:run-with-plain=yes
1407 > pre-version.testing-no=sh -c "echo '### no ########' plain: \${HGPLAIN:-'<unset>'}"
1411 > pre-version.testing-no=sh -c "echo '### no ########' plain: \${HGPLAIN:-'<unset>'}"
1408 > pre-version.testing-no:run-with-plain=no
1412 > pre-version.testing-no:run-with-plain=no
1409 > pre-version.testing-auto=sh -c "echo '### auto ######' plain: \${HGPLAIN:-'<unset>'}"
1413 > pre-version.testing-auto=sh -c "echo '### auto ######' plain: \${HGPLAIN:-'<unset>'}"
1410 > pre-version.testing-auto:run-with-plain=auto
1414 > pre-version.testing-auto:run-with-plain=auto
1411 > EOF
1415 > EOF
1412
1416
1413 $ (unset HGPLAIN; hg version --quiet)
1417 $ (unset HGPLAIN; hg version --quiet)
1414 ### default ### plain: 1
1418 ### default ### plain: 1
1415 ### yes ####### plain: 1
1419 ### yes ####### plain: 1
1416 ### no ######## plain: <unset>
1420 ### no ######## plain: <unset>
1417 ### auto ###### plain: <unset>
1421 ### auto ###### plain: <unset>
1418 Mercurial Distributed SCM (*) (glob)
1422 Mercurial Distributed SCM (*) (glob)
1419
1423
1420 $ HGPLAIN=1 hg version --quiet
1424 $ HGPLAIN=1 hg version --quiet
1421 ### default ### plain: 1
1425 ### default ### plain: 1
1422 ### yes ####### plain: 1
1426 ### yes ####### plain: 1
1423 ### no ######## plain: <unset>
1427 ### no ######## plain: <unset>
1424 ### auto ###### plain: 1
1428 ### auto ###### plain: 1
1425 Mercurial Distributed SCM (*) (glob)
1429 Mercurial Distributed SCM (*) (glob)
1426
1430
1427 Test hook that change the underlying repo
1431 Test hook that change the underlying repo
1428 =========================================
1432 =========================================
1429
1433
1430 blackbox access the dirstate afterward and can see a changelog / dirstate
1434 blackbox access the dirstate afterward and can see a changelog / dirstate
1431 desync.
1435 desync.
1432
1436
1433
1437
1434 $ cd $TESTTMP
1438 $ cd $TESTTMP
1435 $ cat <<EOF >> $HGRCPATH
1439 $ cat <<EOF >> $HGRCPATH
1436 > [extensions]
1440 > [extensions]
1437 > blackbox=
1441 > blackbox=
1438 > [hooks]
1442 > [hooks]
1439 > post-merge = hg commit -m "auto merge"
1443 > post-merge = hg commit -m "auto merge"
1440 > EOF
1444 > EOF
1441
1445
1442 $ hg init t
1446 $ hg init t
1443 $ cd t
1447 $ cd t
1444 $ touch ".hgignore"
1448 $ touch ".hgignore"
1445 $ hg commit -Am "initial" -d'0 0'
1449 $ hg commit -Am "initial" -d'0 0'
1446 adding .hgignore
1450 adding .hgignore
1447
1451
1448 $ echo This is file a1 > a
1452 $ echo This is file a1 > a
1449 $ hg commit -Am "commit #1" -d'0 0'
1453 $ hg commit -Am "commit #1" -d'0 0'
1450 adding a
1454 adding a
1451
1455
1452 $ hg update 0
1456 $ hg update 0
1453 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1457 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1454 $ echo This is file b1 > b
1458 $ echo This is file b1 > b
1455 $ hg commit -Am "commit #2" -d'0 0'
1459 $ hg commit -Am "commit #2" -d'0 0'
1456 adding b
1460 adding b
1457 created new head
1461 created new head
1458
1462
1459 $ hg merge 1
1463 $ hg merge 1
1460 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1464 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1461 (branch merge, don't forget to commit)
1465 (branch merge, don't forget to commit)
1462
1466
1463 $ cd ..
1467 $ cd ..
@@ -1,946 +1,952 b''
1 #require serve zstd
1 #require serve zstd
2
2
3 Client version is embedded in HTTP request and is effectively dynamic. Pin the
3 Client version is embedded in HTTP request and is effectively dynamic. Pin the
4 version so behavior is deterministic.
4 version so behavior is deterministic.
5
5
6 $ cat > fakeversion.py << EOF
6 $ cat > fakeversion.py << EOF
7 > from mercurial import util
7 > from mercurial import util
8 > util.version = lambda: b'4.2'
8 > util.version = lambda: b'4.2'
9 > EOF
9 > EOF
10
10
11 $ cat >> $HGRCPATH << EOF
11 $ cat >> $HGRCPATH << EOF
12 > [extensions]
12 > [extensions]
13 > fakeversion = `pwd`/fakeversion.py
13 > fakeversion = `pwd`/fakeversion.py
14 > [format]
14 > [format]
15 > sparse-revlog = no
15 > sparse-revlog = no
16 > use-persistent-nodemap = no
16 > use-persistent-nodemap = no
17 > [devel]
17 > [devel]
18 > legacy.exchange = phases
18 > legacy.exchange = phases
19 > [server]
19 > [server]
20 > concurrent-push-mode = strict
20 > concurrent-push-mode = strict
21 > EOF
21 > EOF
22
22
23 $ hg init server0
23 $ hg init server0
24 $ cd server0
24 $ cd server0
25 $ touch foo
25 $ touch foo
26 $ hg -q commit -A -m initial
26 $ hg -q commit -A -m initial
27
27
28 Also disable compression because zstd is optional and causes output to vary
28 Also disable compression because zstd is optional and causes output to vary
29 and because debugging partial responses is hard when compression is involved
29 and because debugging partial responses is hard when compression is involved
30
30
31 $ cat > .hg/hgrc << EOF
31 $ cat > .hg/hgrc << EOF
32 > [extensions]
32 > [extensions]
33 > badserver = $TESTDIR/testlib/badserverext.py
33 > badserver = $TESTDIR/testlib/badserverext.py
34 > [server]
34 > [server]
35 > compressionengines = none
35 > compressionengines = none
36 > EOF
36 > EOF
37
37
38 Failure to accept() socket should result in connection related error message
38 Failure to accept() socket should result in connection related error message
39 ----------------------------------------------------------------------------
39 ----------------------------------------------------------------------------
40
40
41 $ hg serve --config badserver.close-before-accept=true -p $HGPORT -d --pid-file=hg.pid
41 $ hg serve --config badserver.close-before-accept=true -p $HGPORT -d --pid-file=hg.pid
42 $ cat hg.pid > $DAEMON_PIDS
42 $ cat hg.pid > $DAEMON_PIDS
43
43
44 $ hg clone http://localhost:$HGPORT/ clone
44 $ hg clone http://localhost:$HGPORT/ clone
45 abort: error: (\$ECONNRESET\$|\$EADDRNOTAVAIL\$) (re)
45 abort: error: (\$ECONNRESET\$|\$EADDRNOTAVAIL\$) (re)
46 [100]
46 [100]
47
47
48 (The server exits on its own, but there is a race between that and starting a new server.
48 (The server exits on its own, but there is a race between that and starting a new server.
49 So ensure the process is dead.)
49 So ensure the process is dead.)
50
50
51 $ killdaemons.py $DAEMON_PIDS
51 $ killdaemons.py $DAEMON_PIDS
52
52
53 Failure immediately after accept() should yield connection related error message
53 Failure immediately after accept() should yield connection related error message
54 --------------------------------------------------------------------------------
54 --------------------------------------------------------------------------------
55
55
56 $ hg serve --config badserver.close-after-accept=true -p $HGPORT -d --pid-file=hg.pid
56 $ hg serve --config badserver.close-after-accept=true -p $HGPORT -d --pid-file=hg.pid
57 $ cat hg.pid > $DAEMON_PIDS
57 $ cat hg.pid > $DAEMON_PIDS
58
58
59 TODO: this usually outputs good results, but sometimes emits abort:
59 TODO: this usually outputs good results, but sometimes emits abort:
60 error: '' on FreeBSD and OS X.
60 error: '' on FreeBSD and OS X.
61 What we ideally want are:
61 What we ideally want are:
62
62
63 abort: error: $ECONNRESET$
63 abort: error: $ECONNRESET$
64
64
65 The flakiness in this output was observable easily with
65 The flakiness in this output was observable easily with
66 --runs-per-test=20 on macOS 10.12 during the freeze for 4.2.
66 --runs-per-test=20 on macOS 10.12 during the freeze for 4.2.
67 $ hg clone http://localhost:$HGPORT/ clone
67 $ hg clone http://localhost:$HGPORT/ clone
68 abort: error: * (glob)
68 abort: error: * (glob)
69 [100]
69 [100]
70
70
71 $ killdaemons.py $DAEMON_PIDS
71 $ killdaemons.py $DAEMON_PIDS
72
72
73 Failure to read all bytes in initial HTTP request should yield connection related error message
73 Failure to read all bytes in initial HTTP request should yield connection related error message
74 -----------------------------------------------------------------------------------------------
74 -----------------------------------------------------------------------------------------------
75
75
76 $ hg serve --config badserver.close-after-recv-bytes=1 -p $HGPORT -d --pid-file=hg.pid -E error.log
76 $ hg serve --config badserver.close-after-recv-bytes=1 -p $HGPORT -d --pid-file=hg.pid -E error.log
77 $ cat hg.pid > $DAEMON_PIDS
77 $ cat hg.pid > $DAEMON_PIDS
78
78
79 $ hg clone http://localhost:$HGPORT/ clone
79 $ hg clone http://localhost:$HGPORT/ clone
80 abort: error: bad HTTP status line: * (glob)
80 abort: error: bad HTTP status line: * (glob)
81 [100]
81 [100]
82
82
83 $ killdaemons.py $DAEMON_PIDS
83 $ killdaemons.py $DAEMON_PIDS
84
84
85 $ cat error.log
85 $ cat error.log
86 readline(1 from ~) -> (1) G
86 readline(1 from ~) -> (1) G
87 read limit reached; closing socket
87 read limit reached; closing socket
88
88
89 $ rm -f error.log
89 $ rm -f error.log
90
90
91 Same failure, but server reads full HTTP request line
91 Same failure, but server reads full HTTP request line
92 -----------------------------------------------------
92 -----------------------------------------------------
93
93
94 $ hg serve \
94 $ hg serve \
95 > --config badserver.close-after-recv-patterns="GET /\?cmd=capabilities" \
95 > --config badserver.close-after-recv-patterns="GET /\?cmd=capabilities" \
96 > --config badserver.close-after-recv-bytes=7 \
96 > --config badserver.close-after-recv-bytes=7 \
97 > -p $HGPORT -d --pid-file=hg.pid -E error.log
97 > -p $HGPORT -d --pid-file=hg.pid -E error.log
98 $ cat hg.pid > $DAEMON_PIDS
98 $ cat hg.pid > $DAEMON_PIDS
99 $ hg clone http://localhost:$HGPORT/ clone
99 $ hg clone http://localhost:$HGPORT/ clone
100 abort: error: bad HTTP status line: * (glob)
100 abort: error: bad HTTP status line: * (glob)
101 [100]
101 [100]
102
102
103 $ killdaemons.py $DAEMON_PIDS
103 $ killdaemons.py $DAEMON_PIDS
104
104
105 $ cat error.log
105 $ cat error.log
106 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
106 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
107 readline(7 from *) -> (7) Accept- (glob)
107 readline(7 from *) -> (7) Accept- (glob)
108 read limit reached; closing socket
108 read limit reached; closing socket
109
109
110 $ rm -f error.log
110 $ rm -f error.log
111
111
112 Failure on subsequent HTTP request on the same socket (cmd?batch)
112 Failure on subsequent HTTP request on the same socket (cmd?batch)
113 -----------------------------------------------------------------
113 -----------------------------------------------------------------
114
114
115 $ hg serve \
115 $ hg serve \
116 > --config badserver.close-after-recv-patterns="GET /\?cmd=batch,GET /\?cmd=batch" \
116 > --config badserver.close-after-recv-patterns="GET /\?cmd=batch,GET /\?cmd=batch" \
117 > --config badserver.close-after-recv-bytes=15,197 \
117 > --config badserver.close-after-recv-bytes=15,197 \
118 > -p $HGPORT -d --pid-file=hg.pid -E error.log
118 > -p $HGPORT -d --pid-file=hg.pid -E error.log
119 $ cat hg.pid > $DAEMON_PIDS
119 $ cat hg.pid > $DAEMON_PIDS
120 $ hg clone http://localhost:$HGPORT/ clone
120 $ hg clone http://localhost:$HGPORT/ clone
121 abort: error: bad HTTP status line: * (glob)
121 abort: error: bad HTTP status line: * (glob)
122 [100]
122 [100]
123
123
124 $ killdaemons.py $DAEMON_PIDS
124 $ killdaemons.py $DAEMON_PIDS
125
125
126 $ cat error.log
126 $ cat error.log
127 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
127 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
128 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
128 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
129 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
129 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
130 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
130 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
131 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
131 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
132 readline(*) -> (2) \r\n (glob)
132 readline(*) -> (2) \r\n (glob)
133 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
133 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
134 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
134 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
135 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob)
135 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob)
136 readline(*) -> (1?) Accept-Encoding* (glob)
136 readline(*) -> (1?) Accept-Encoding* (glob)
137 read limit reached; closing socket
137 read limit reached; closing socket
138 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
138 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
139 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
139 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
140 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
140 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
141 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
141 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
142 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
142 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
143 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
143 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
144 readline(4 from *) -> (4) host (glob)
144 readline(4 from *) -> (4) host (glob)
145 read limit reached; closing socket
145 read limit reached; closing socket
146
146
147 $ rm -f error.log
147 $ rm -f error.log
148
148
149 Failure to read getbundle HTTP request
149 Failure to read getbundle HTTP request
150 --------------------------------------
150 --------------------------------------
151
151
152 $ hg serve \
152 $ hg serve \
153 > --config badserver.close-after-recv-patterns="GET /\?cmd=batch,user-agent: mercurial/proto-1.0,GET /\?cmd=getbundle" \
153 > --config badserver.close-after-recv-patterns="GET /\?cmd=batch,user-agent: mercurial/proto-1.0,GET /\?cmd=getbundle" \
154 > --config badserver.close-after-recv-bytes=110,26,281 \
154 > --config badserver.close-after-recv-bytes=110,26,281 \
155 > -p $HGPORT -d --pid-file=hg.pid -E error.log
155 > -p $HGPORT -d --pid-file=hg.pid -E error.log
156 $ cat hg.pid > $DAEMON_PIDS
156 $ cat hg.pid > $DAEMON_PIDS
157 $ hg clone http://localhost:$HGPORT/ clone
157 $ hg clone http://localhost:$HGPORT/ clone
158 requesting all changes
158 requesting all changes
159 abort: error: bad HTTP status line: * (glob)
159 abort: error: bad HTTP status line: * (glob)
160 [100]
160 [100]
161
161
162 $ killdaemons.py $DAEMON_PIDS
162 $ killdaemons.py $DAEMON_PIDS
163
163
164 $ cat error.log
164 $ cat error.log
165 readline(1 from -1) -> (1) x (?)
165 readline(1 from -1) -> (1) x (?)
166 readline(1 from -1) -> (1) x (?)
166 readline(1 from -1) -> (1) x (?)
167 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
167 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
168 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
168 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
169 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
169 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
170 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
170 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
171 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
171 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
172 readline(*) -> (2) \r\n (glob)
172 readline(*) -> (2) \r\n (glob)
173 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
173 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
174 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
174 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
175 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob)
175 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n (glob)
176 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
176 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
177 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
177 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
178 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
178 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
179 readline(*) -> (1?) x-hgproto-1:* (glob)
179 readline(*) -> (1?) x-hgproto-1:* (glob)
180 read limit reached; closing socket
180 read limit reached; closing socket
181 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
181 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
182 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
182 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
183 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
183 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
184 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
184 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
185 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
185 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
186 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
186 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
187 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
187 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
188 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
188 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
189 readline(*) -> (2) \r\n (glob)
189 readline(*) -> (2) \r\n (glob)
190 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
190 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
191 sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
191 sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
192 readline(24 from ~) -> (*) GET /?cmd=getbundle HTTP* (glob)
192 readline(24 from ~) -> (*) GET /?cmd=getbundle HTTP* (glob)
193 read limit reached; closing socket
193 read limit reached; closing socket
194 readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
194 readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
195 readline(281 from *) -> (27) Accept-Encoding: identity\r\n (glob)
195 readline(281 from *) -> (27) Accept-Encoding: identity\r\n (glob)
196 readline(254 from *) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
196 readline(254 from *) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
197 readline(225 from *) -> (225) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtag (glob)
197 readline(225 from *) -> (225) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtag (glob)
198 read limit reached; closing socket
198 read limit reached; closing socket
199
199
200 $ rm -f error.log
200 $ rm -f error.log
201
201
202 Now do a variation using POST to send arguments
202 Now do a variation using POST to send arguments
203 ===============================================
203 ===============================================
204
204
205 $ hg serve \
205 $ hg serve \
206 > --config badserver.close-after-recv-patterns="x-hgargs-post:,user-agent: mercurial/proto-1.0" \
206 > --config badserver.close-after-recv-patterns="x-hgargs-post:,user-agent: mercurial/proto-1.0" \
207 > --config badserver.close-after-recv-bytes="14,26" \
207 > --config badserver.close-after-recv-bytes="14,26" \
208 > --config experimental.httppostargs=true \
208 > --config experimental.httppostargs=true \
209 > -p $HGPORT -d --pid-file=hg.pid -E error.log
209 > -p $HGPORT -d --pid-file=hg.pid -E error.log
210 $ cat hg.pid > $DAEMON_PIDS
210 $ cat hg.pid > $DAEMON_PIDS
211
211
212 $ hg clone http://localhost:$HGPORT/ clone
212 $ hg clone http://localhost:$HGPORT/ clone
213 abort: error: bad HTTP status line: * (glob)
213 abort: error: bad HTTP status line: * (glob)
214 [100]
214 [100]
215
215
216 $ killdaemons.py $DAEMON_PIDS
216 $ killdaemons.py $DAEMON_PIDS
217
217
218 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
218 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
219 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
219 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
220 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
220 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
221 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
221 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
222 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
222 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
223 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
223 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
224 readline(*) -> (2) \r\n (glob)
224 readline(*) -> (2) \r\n (glob)
225 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
225 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
226 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
226 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx httppostargs known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
227 readline(~) -> (27) POST /?cmd=batch HTTP/1.1\r\n (glob)
227 readline(~) -> (27) POST /?cmd=batch HTTP/1.1\r\n (glob)
228 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
228 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
229 readline(*) -> (41) content-type: application/mercurial-0.1\r\n (glob)
229 readline(*) -> (41) content-type: application/mercurial-0.1\r\n (glob)
230 readline(*) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob)
230 readline(*) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob)
231 readline(*) -> (19) x-hgargs-post: 28\r\n (glob)
231 readline(*) -> (19) x-hgargs-post: 28\r\n (glob)
232 readline(*) -> (1?) x-hgproto-1: * (glob)
232 readline(*) -> (1?) x-hgproto-1: * (glob)
233 read limit reached; closing socket
233 read limit reached; closing socket
234 readline(~) -> (27) POST /?cmd=batch HTTP/1.1\r\n
234 readline(~) -> (27) POST /?cmd=batch HTTP/1.1\r\n
235 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
235 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
236 readline(*) -> (41) content-type: application/mercurial-0.1\r\n (glob)
236 readline(*) -> (41) content-type: application/mercurial-0.1\r\n (glob)
237 readline(*) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob)
237 readline(*) -> (33) vary: X-HgArgs-Post,X-HgProto-1\r\n (glob)
238 readline(*) -> (19) x-hgargs-post: 28\r\n (glob)
238 readline(*) -> (19) x-hgargs-post: 28\r\n (glob)
239 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
239 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
240 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
240 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
241 readline(*) -> (20) content-length: 28\r\n (glob)
241 readline(*) -> (20) content-length: 28\r\n (glob)
242 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
242 readline(*) -> (*) host: localhost:$HGPORT\r\n (glob)
243 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
243 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
244 readline(*) -> (2) \r\n (glob)
244 readline(*) -> (2) \r\n (glob)
245 read(24 from 28) -> (*) cmds=* (glob)
245 read(24 from 28) -> (*) cmds=* (glob)
246 read limit reached; closing socket
246 read limit reached; closing socket
247 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
247 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
248 Traceback (most recent call last):
248 Traceback (most recent call last):
249 Exception: connection closed after receiving N bytes
249 Exception: connection closed after receiving N bytes
250
250
251
251
252 $ rm -f error.log
252 $ rm -f error.log
253
253
254 Now move on to partial server responses
254 Now move on to partial server responses
255 =======================================
255 =======================================
256
256
257 Server sends a single character from the HTTP response line
257 Server sends a single character from the HTTP response line
258 -----------------------------------------------------------
258 -----------------------------------------------------------
259
259
260 $ hg serve --config badserver.close-after-send-bytes=1 -p $HGPORT -d --pid-file=hg.pid -E error.log
260 $ hg serve --config badserver.close-after-send-bytes=1 -p $HGPORT -d --pid-file=hg.pid -E error.log
261 $ cat hg.pid > $DAEMON_PIDS
261 $ cat hg.pid > $DAEMON_PIDS
262
262
263 $ hg clone http://localhost:$HGPORT/ clone
263 $ hg clone http://localhost:$HGPORT/ clone
264 abort: error: bad HTTP status line: H
264 abort: error: bad HTTP status line: H
265 [100]
265 [100]
266
266
267 $ killdaemons.py $DAEMON_PIDS
267 $ killdaemons.py $DAEMON_PIDS
268
268
269 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
269 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
270 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
270 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
271 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
271 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
272 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
272 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
273 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
273 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
274 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
274 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
275 readline(*) -> (2) \r\n (glob)
275 readline(*) -> (2) \r\n (glob)
276 sendall(1 from 160) -> (0) H
276 sendall(1 from 160) -> (0) H
277 write limit reached; closing socket
277 write limit reached; closing socket
278 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=capabilities': (glob)
278 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=capabilities': (glob)
279 Traceback (most recent call last):
279 Traceback (most recent call last):
280 Exception: connection closed after sending N bytes
280 Exception: connection closed after sending N bytes
281
281
282
282
283 $ rm -f error.log
283 $ rm -f error.log
284
284
285 Server sends an incomplete capabilities response body
285 Server sends an incomplete capabilities response body
286 -----------------------------------------------------
286 -----------------------------------------------------
287
287
288 $ hg serve \
288 $ hg serve \
289 > --config badserver.close-after-send-patterns='batch branchmap bund' \
289 > --config badserver.close-after-send-patterns='batch branchmap bund' \
290 > -p $HGPORT -d --pid-file=hg.pid -E error.log
290 > -p $HGPORT -d --pid-file=hg.pid -E error.log
291 $ cat hg.pid > $DAEMON_PIDS
291 $ cat hg.pid > $DAEMON_PIDS
292
292
293 $ hg clone http://localhost:$HGPORT/ clone
293 $ hg clone http://localhost:$HGPORT/ clone
294 abort: HTTP request error (incomplete response; expected * bytes got 20) (glob)
294 abort: HTTP request error (incomplete response; expected * bytes got 20) (glob)
295 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
295 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
296 [255]
296 [255]
297
297
298 $ killdaemons.py $DAEMON_PIDS
298 $ killdaemons.py $DAEMON_PIDS
299
299
300 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
300 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
301 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
301 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
302 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
302 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
303 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
303 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
304 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
304 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
305 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
305 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
306 readline(*) -> (2) \r\n (glob)
306 readline(*) -> (2) \r\n (glob)
307 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
307 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
308 sendall(20 from *) -> (0) batch branchmap bund (glob)
308 sendall(20 from *) -> (0) batch branchmap bund (glob)
309 write limit reached; closing socket
309 write limit reached; closing socket
310 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=capabilities': (glob)
310 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=capabilities': (glob)
311 Traceback (most recent call last):
311 Traceback (most recent call last):
312 Exception: connection closed after sending N bytes
312 Exception: connection closed after sending N bytes
313
313
314
314
315 $ rm -f error.log
315 $ rm -f error.log
316
316
317 Server sends incomplete headers for batch request
317 Server sends incomplete headers for batch request
318 -------------------------------------------------
318 -------------------------------------------------
319
319
320 $ hg serve \
320 $ hg serve \
321 > --config badserver.close-after-send-patterns='(.*Content-Type: applicat){2}' \
321 > --config badserver.close-after-send-patterns='(.*Content-Type: applicat){2}' \
322 > -p $HGPORT -d --pid-file=hg.pid -E error.log
322 > -p $HGPORT -d --pid-file=hg.pid -E error.log
323 $ cat hg.pid > $DAEMON_PIDS
323 $ cat hg.pid > $DAEMON_PIDS
324
324
325 TODO this output is horrible
325 TODO this output is horrible
326
326
327 $ hg clone http://localhost:$HGPORT/ clone
327 $ hg clone http://localhost:$HGPORT/ clone
328 abort: 'http://localhost:$HGPORT/' does not appear to be an hg repository:
328 abort: 'http://localhost:$HGPORT/' does not appear to be an hg repository:
329 ---%<--- (applicat)
329 ---%<--- (applicat)
330
330
331 ---%<---
331 ---%<---
332
332
333 [255]
333 [255]
334
334
335 $ killdaemons.py $DAEMON_PIDS
335 $ killdaemons.py $DAEMON_PIDS
336
336
337 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
337 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
338 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
338 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
339 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
339 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
340 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
340 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
341 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
341 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
342 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
342 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
343 readline(*) -> (2) \r\n (glob)
343 readline(*) -> (2) \r\n (glob)
344 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
344 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
345 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
345 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
346 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
346 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
347 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
347 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
348 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
348 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
349 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
349 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
350 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
350 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
351 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
351 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
352 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
352 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
353 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
353 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
354 readline(*) -> (2) \r\n (glob)
354 readline(*) -> (2) \r\n (glob)
355 sendall(118 from 159) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: applicat
355 sendall(118 from 159) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: applicat
356 write limit reached; closing socket
356 write limit reached; closing socket
357 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
357 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
358 Traceback (most recent call last):
358 Traceback (most recent call last):
359 Exception: connection closed after sending N bytes
359 Exception: connection closed after sending N bytes
360
360
361
361
362 $ rm -f error.log
362 $ rm -f error.log
363
363
364 Server sends an incomplete HTTP response body to batch request
364 Server sends an incomplete HTTP response body to batch request
365 --------------------------------------------------------------
365 --------------------------------------------------------------
366
366
367 $ hg serve \
367 $ hg serve \
368 > --config badserver.close-after-send-patterns=96ee1d7354c4ad7372047672 \
368 > --config badserver.close-after-send-patterns=96ee1d7354c4ad7372047672 \
369 > -p $HGPORT -d --pid-file=hg.pid -E error.log
369 > -p $HGPORT -d --pid-file=hg.pid -E error.log
370 $ cat hg.pid > $DAEMON_PIDS
370 $ cat hg.pid > $DAEMON_PIDS
371
371
372 $ hg clone http://localhost:$HGPORT/ clone
372 $ hg clone http://localhost:$HGPORT/ clone
373 abort: unexpected response:
373 abort: unexpected response:
374 '96ee1d7354c4ad7372047672'
374 '96ee1d7354c4ad7372047672'
375 [255]
375 [255]
376
376
377 $ killdaemons.py $DAEMON_PIDS
377 $ killdaemons.py $DAEMON_PIDS
378
378
379 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
379 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
380 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
380 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
381 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
381 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
382 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
382 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
383 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
383 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
384 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
384 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
385 readline(*) -> (2) \r\n (glob)
385 readline(*) -> (2) \r\n (glob)
386 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
386 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
387 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
387 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
388 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
388 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
389 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
389 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
390 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
390 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
391 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
391 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
392 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
392 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
393 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
393 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
394 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
394 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
395 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
395 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
396 readline(*) -> (2) \r\n (glob)
396 readline(*) -> (2) \r\n (glob)
397 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
397 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
398 sendall(24 from 42) -> (0) 96ee1d7354c4ad7372047672
398 sendall(24 from 42) -> (0) 96ee1d7354c4ad7372047672
399 write limit reached; closing socket
399 write limit reached; closing socket
400 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
400 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=batch': (glob)
401 Traceback (most recent call last):
401 Traceback (most recent call last):
402 Exception: connection closed after sending N bytes
402 Exception: connection closed after sending N bytes
403
403
404
404
405 $ rm -f error.log
405 $ rm -f error.log
406
406
407 Server sends incomplete headers for getbundle response
407 Server sends incomplete headers for getbundle response
408 ------------------------------------------------------
408 ------------------------------------------------------
409
409
410 $ hg serve \
410 $ hg serve \
411 > --config badserver.close-after-send-patterns='(.*Content-Type: application/mercuri){3}' \
411 > --config badserver.close-after-send-patterns='(.*Content-Type: application/mercuri){3}' \
412 > -p $HGPORT -d --pid-file=hg.pid -E error.log
412 > -p $HGPORT -d --pid-file=hg.pid -E error.log
413 $ cat hg.pid > $DAEMON_PIDS
413 $ cat hg.pid > $DAEMON_PIDS
414
414
415 TODO this output is terrible
415 TODO this output is terrible
416
416
417 $ hg clone http://localhost:$HGPORT/ clone
417 $ hg clone http://localhost:$HGPORT/ clone
418 requesting all changes
418 requesting all changes
419 abort: 'http://localhost:$HGPORT/' does not appear to be an hg repository:
419 abort: 'http://localhost:$HGPORT/' does not appear to be an hg repository:
420 ---%<--- (application/mercuri)
420 ---%<--- (application/mercuri)
421
421
422 ---%<---
422 ---%<---
423
423
424 [255]
424 [255]
425
425
426 $ killdaemons.py $DAEMON_PIDS
426 $ killdaemons.py $DAEMON_PIDS
427
427
428 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
428 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
429 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
429 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
430 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
430 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
431 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
431 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
432 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
432 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
433 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
433 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
434 readline(*) -> (2) \r\n (glob)
434 readline(*) -> (2) \r\n (glob)
435 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
435 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
436 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
436 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
437 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
437 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
438 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
438 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
439 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
439 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
440 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
440 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
441 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
441 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
442 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
442 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
443 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
443 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
444 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
444 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
445 readline(*) -> (2) \r\n (glob)
445 readline(*) -> (2) \r\n (glob)
446 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
446 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
447 sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
447 sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
448 readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
448 readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
449 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
449 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
450 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
450 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
451 readline(*) -> (447) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n (glob)
451 readline(*) -> (447) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n (glob)
452 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
452 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
453 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
453 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
454 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
454 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
455 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
455 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
456 readline(*) -> (2) \r\n (glob)
456 readline(*) -> (2) \r\n (glob)
457 sendall(129 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercuri
457 sendall(129 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercuri
458 write limit reached; closing socket
458 write limit reached; closing socket
459 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
459 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
460 Traceback (most recent call last):
460 Traceback (most recent call last):
461 Exception: connection closed after sending N bytes
461 Exception: connection closed after sending N bytes
462
462
463
463
464 $ rm -f error.log
464 $ rm -f error.log
465
465
466 Server stops before it sends transfer encoding
466 Server stops before it sends transfer encoding
467 ----------------------------------------------
467 ----------------------------------------------
468
468
469 $ hg serve \
469 $ hg serve \
470 > --config badserver.close-after-send-patterns="Transfer-Encoding: chunke" \
470 > --config badserver.close-after-send-patterns="Transfer-Encoding: chunke" \
471 > -p $HGPORT -d --pid-file=hg.pid -E error.log
471 > -p $HGPORT -d --pid-file=hg.pid -E error.log
472 $ cat hg.pid > $DAEMON_PIDS
472 $ cat hg.pid > $DAEMON_PIDS
473
473
474 $ hg clone http://localhost:$HGPORT/ clone
474 $ hg clone http://localhost:$HGPORT/ clone
475 requesting all changes
475 requesting all changes
476 abort: stream ended unexpectedly (got 0 bytes, expected 1)
476 abort: stream ended unexpectedly (got 0 bytes, expected 1)
477 [255]
477 [255]
478
478
479 $ killdaemons.py $DAEMON_PIDS
479 $ killdaemons.py $DAEMON_PIDS
480
480
481 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -6
481 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -6
482 sendall(162 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunke
482 sendall(162 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunke
483 write limit reached; closing socket
483 write limit reached; closing socket
484 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
484 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
485 Traceback (most recent call last):
485 Traceback (most recent call last):
486 Exception: connection closed after sending N bytes
486 Exception: connection closed after sending N bytes
487
487
488 $ rm -f error.log
488 $ rm -f error.log
489
489
490 Server sends empty HTTP body for getbundle
490 Server sends empty HTTP body for getbundle
491 ------------------------------------------
491 ------------------------------------------
492
492
493 $ hg serve \
493 $ hg serve \
494 > --config badserver.close-after-send-patterns='Transfer-Encoding: chunked\r\n\r\n' \
494 > --config badserver.close-after-send-patterns='Transfer-Encoding: chunked\r\n\r\n' \
495 > -p $HGPORT -d --pid-file=hg.pid -E error.log
495 > -p $HGPORT -d --pid-file=hg.pid -E error.log
496 $ cat hg.pid > $DAEMON_PIDS
496 $ cat hg.pid > $DAEMON_PIDS
497
497
498 $ hg clone http://localhost:$HGPORT/ clone
498 $ hg clone http://localhost:$HGPORT/ clone
499 requesting all changes
499 requesting all changes
500 abort: HTTP request error (incomplete response)
500 abort: HTTP request error (incomplete response)
501 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
501 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
502 [255]
502 [255]
503
503
504 $ killdaemons.py $DAEMON_PIDS
504 $ killdaemons.py $DAEMON_PIDS
505
505
506 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
506 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
507 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
507 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
508 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
508 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
509 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
509 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
510 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
510 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
511 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
511 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
512 readline(*) -> (2) \r\n (glob)
512 readline(*) -> (2) \r\n (glob)
513 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
513 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
514 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
514 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
515 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
515 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
516 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
516 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
517 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
517 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
518 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
518 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
519 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
519 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
520 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
520 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
521 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
521 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
522 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
522 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
523 readline(*) -> (2) \r\n (glob)
523 readline(*) -> (2) \r\n (glob)
524 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
524 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
525 sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
525 sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
526 readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
526 readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
527 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
527 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
528 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
528 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
529 readline(*) -> (447) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n (glob)
529 readline(*) -> (447) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n (glob)
530 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
530 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
531 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
531 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
532 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
532 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
533 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
533 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
534 readline(*) -> (2) \r\n (glob)
534 readline(*) -> (2) \r\n (glob)
535 sendall(167 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
535 sendall(167 from 167) -> (0) HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
536 write limit reached; closing socket
536 write limit reached; closing socket
537 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
537 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
538 Traceback (most recent call last):
538 Traceback (most recent call last):
539 Exception: connection closed after sending N bytes
539 Exception: connection closed after sending N bytes
540
540
541
541
542 $ rm -f error.log
542 $ rm -f error.log
543
543
544 Server sends partial compression string
544 Server sends partial compression string
545 ---------------------------------------
545 ---------------------------------------
546
546
547 $ hg serve \
547 $ hg serve \
548 > --config badserver.close-after-send-patterns='4\r\nHG20\r\n' \
548 > --config badserver.close-after-send-patterns='4\r\nHG20\r\n' \
549 > -p $HGPORT -d --pid-file=hg.pid -E error.log
549 > -p $HGPORT -d --pid-file=hg.pid -E error.log
550 $ cat hg.pid > $DAEMON_PIDS
550 $ cat hg.pid > $DAEMON_PIDS
551
551
552 $ hg clone http://localhost:$HGPORT/ clone
552 $ hg clone http://localhost:$HGPORT/ clone
553 requesting all changes
553 requesting all changes
554 abort: HTTP request error (incomplete response)
554 abort: HTTP request error (incomplete response)
555 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
555 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
556 [255]
556 [255]
557
557
558 $ killdaemons.py $DAEMON_PIDS
558 $ killdaemons.py $DAEMON_PIDS
559
559
560 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
560 $ cat error.log | "$PYTHON" $TESTDIR/filtertraceback.py
561 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
561 readline(~) -> (33) GET /?cmd=capabilities HTTP/1.1\r\n
562 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
562 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
563 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
563 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
564 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
564 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
565 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
565 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
566 readline(*) -> (2) \r\n (glob)
566 readline(*) -> (2) \r\n (glob)
567 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
567 sendall(160) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: *\r\n\r\n (glob)
568 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
568 sendall(*) -> batch branchmap $USUAL_BUNDLE2_CAPS_NO_PHASES$ changegroupsubset compression=none getbundle httpheader=1024 httpmediatype=0.1rx,0.1tx,0.2tx known lookup pushkey streamreqs=* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (glob)
569 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
569 readline(~) -> (26) GET /?cmd=batch HTTP/1.1\r\n
570 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
570 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
571 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
571 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
572 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
572 readline(*) -> (41) x-hgarg-1: cmds=heads+%3Bknown+nodes%3D\r\n (glob)
573 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
573 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
574 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
574 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
575 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
575 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
576 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
576 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
577 readline(*) -> (2) \r\n (glob)
577 readline(*) -> (2) \r\n (glob)
578 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
578 sendall(159) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.1\r\nContent-Length: 42\r\n\r\n
579 sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
579 sendall(42) -> 96ee1d7354c4ad7372047672c36a1f561e3a6a4c\n;
580 readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
580 readline(~) -> (30) GET /?cmd=getbundle HTTP/1.1\r\n
581 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
581 readline(*) -> (27) Accept-Encoding: identity\r\n (glob)
582 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
582 readline(*) -> (29) vary: X-HgArg-1,X-HgProto-1\r\n (glob)
583 readline(*) -> (447) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n (glob)
583 readline(*) -> (447) x-hgarg-1: bookmarks=1&bundlecaps=HG20%2Cbundle2%3DHG20%250Abookmarks%250Achangegroup%253D01%252C02%252C03%250Adigests%253Dmd5%252Csha1%252Csha512%250Aerror%253Dabort%252Cunsupportedcontent%252Cpushraced%252Cpushkey%250Ahgtagsfnodes%250Alistkeys%250Apushkey%250Aremote-changegroup%253Dhttp%252Chttps%250Astream%253Dv2&cg=1&common=0000000000000000000000000000000000000000&heads=96ee1d7354c4ad7372047672c36a1f561e3a6a4c&listkeys=phases%2Cbookmarks\r\n (glob)
584 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
584 readline(*) -> (61) x-hgproto-1: 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull\r\n (glob)
585 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
585 readline(*) -> (35) accept: application/mercurial-0.1\r\n (glob)
586 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
586 readline(*) -> (2?) host: localhost:$HGPORT\r\n (glob)
587 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
587 readline(*) -> (49) user-agent: mercurial/proto-1.0 (Mercurial 4.2)\r\n (glob)
588 readline(*) -> (2) \r\n (glob)
588 readline(*) -> (2) \r\n (glob)
589 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
589 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
590 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
590 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
591 sendall(9) -> 4\r\nnone\r\n
591 sendall(9) -> 4\r\nnone\r\n
592 sendall(9 from 9) -> (0) 4\r\nHG20\r\n
592 sendall(9 from 9) -> (0) 4\r\nHG20\r\n
593 write limit reached; closing socket
593 write limit reached; closing socket
594 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
594 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
595 Traceback (most recent call last):
595 Traceback (most recent call last):
596 Exception: connection closed after sending N bytes
596 Exception: connection closed after sending N bytes
597
597
598
598
599 $ rm -f error.log
599 $ rm -f error.log
600
600
601 Server sends partial bundle2 header magic
601 Server sends partial bundle2 header magic
602 -----------------------------------------
602 -----------------------------------------
603
603
604 $ hg serve \
604 $ hg serve \
605 > --config badserver.close-after-send-patterns='4\r\nHG2' \
605 > --config badserver.close-after-send-patterns='4\r\nHG2' \
606 > -p $HGPORT -d --pid-file=hg.pid -E error.log
606 > -p $HGPORT -d --pid-file=hg.pid -E error.log
607 $ cat hg.pid > $DAEMON_PIDS
607 $ cat hg.pid > $DAEMON_PIDS
608
608
609 $ hg clone http://localhost:$HGPORT/ clone
609 $ hg clone http://localhost:$HGPORT/ clone
610 requesting all changes
610 requesting all changes
611 abort: HTTP request error (incomplete response*) (glob)
611 abort: HTTP request error (incomplete response*) (glob)
612 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
612 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
613 [255]
613 [255]
614
614
615 $ killdaemons.py $DAEMON_PIDS
615 $ killdaemons.py $DAEMON_PIDS
616
616
617 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -9
617 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -9
618 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
618 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
619 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
619 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
620 sendall(9) -> 4\r\nnone\r\n
620 sendall(9) -> 4\r\nnone\r\n
621 sendall(6 from 9) -> (0) 4\r\nHG2
621 sendall(6 from 9) -> (0) 4\r\nHG2
622 write limit reached; closing socket
622 write limit reached; closing socket
623 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
623 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
624 Traceback (most recent call last):
624 Traceback (most recent call last):
625 Exception: connection closed after sending N bytes
625 Exception: connection closed after sending N bytes
626
626
627 $ rm -f error.log
627 $ rm -f error.log
628
628
629 Server sends incomplete bundle2 stream params length
629 Server sends incomplete bundle2 stream params length
630 ----------------------------------------------------
630 ----------------------------------------------------
631
631
632 $ hg serve \
632 $ hg serve \
633 > --config badserver.close-after-send-patterns='4\r\n\0\0\0' \
633 > --config badserver.close-after-send-patterns='4\r\n\0\0\0' \
634 > -p $HGPORT -d --pid-file=hg.pid -E error.log
634 > -p $HGPORT -d --pid-file=hg.pid -E error.log
635 $ cat hg.pid > $DAEMON_PIDS
635 $ cat hg.pid > $DAEMON_PIDS
636
636
637 $ hg clone http://localhost:$HGPORT/ clone
637 $ hg clone http://localhost:$HGPORT/ clone
638 requesting all changes
638 requesting all changes
639 abort: HTTP request error (incomplete response*) (glob)
639 abort: HTTP request error (incomplete response*) (glob)
640 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
640 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
641 [255]
641 [255]
642
642
643 $ killdaemons.py $DAEMON_PIDS
643 $ killdaemons.py $DAEMON_PIDS
644
644
645 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -10
645 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -10
646 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
646 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
647 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
647 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
648 sendall(9) -> 4\r\nnone\r\n
648 sendall(9) -> 4\r\nnone\r\n
649 sendall(9) -> 4\r\nHG20\r\n
649 sendall(9) -> 4\r\nHG20\r\n
650 sendall(6 from 9) -> (0) 4\\r\\n\x00\x00\x00 (esc)
650 sendall(6 from 9) -> (0) 4\\r\\n\x00\x00\x00 (esc)
651 write limit reached; closing socket
651 write limit reached; closing socket
652 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
652 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
653 Traceback (most recent call last):
653 Traceback (most recent call last):
654 Exception: connection closed after sending N bytes
654 Exception: connection closed after sending N bytes
655
655
656 $ rm -f error.log
656 $ rm -f error.log
657
657
658 Servers stops after bundle2 stream params header
658 Servers stops after bundle2 stream params header
659 ------------------------------------------------
659 ------------------------------------------------
660
660
661 $ hg serve \
661 $ hg serve \
662 > --config badserver.close-after-send-patterns='4\r\n\0\0\0\0\r\n' \
662 > --config badserver.close-after-send-patterns='4\r\n\0\0\0\0\r\n' \
663 > -p $HGPORT -d --pid-file=hg.pid -E error.log
663 > -p $HGPORT -d --pid-file=hg.pid -E error.log
664 $ cat hg.pid > $DAEMON_PIDS
664 $ cat hg.pid > $DAEMON_PIDS
665
665
666 $ hg clone http://localhost:$HGPORT/ clone
666 $ hg clone http://localhost:$HGPORT/ clone
667 requesting all changes
667 requesting all changes
668 abort: HTTP request error (incomplete response)
668 abort: HTTP request error (incomplete response)
669 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
669 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
670 [255]
670 [255]
671
671
672 $ killdaemons.py $DAEMON_PIDS
672 $ killdaemons.py $DAEMON_PIDS
673
673
674 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -10
674 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -10
675 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
675 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
676 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
676 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
677 sendall(9) -> 4\r\nnone\r\n
677 sendall(9) -> 4\r\nnone\r\n
678 sendall(9) -> 4\r\nHG20\r\n
678 sendall(9) -> 4\r\nHG20\r\n
679 sendall(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
679 sendall(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
680 write limit reached; closing socket
680 write limit reached; closing socket
681 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
681 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
682 Traceback (most recent call last):
682 Traceback (most recent call last):
683 Exception: connection closed after sending N bytes
683 Exception: connection closed after sending N bytes
684
684
685 $ rm -f error.log
685 $ rm -f error.log
686
686
687 Server stops sending after bundle2 part header length
687 Server stops sending after bundle2 part header length
688 -----------------------------------------------------
688 -----------------------------------------------------
689
689
690 $ hg serve \
690 $ hg serve \
691 > --config badserver.close-after-send-patterns='4\r\n\0\0\0\)\r\n' \
691 > --config badserver.close-after-send-patterns='4\r\n\0\0\0\)\r\n' \
692 > -p $HGPORT -d --pid-file=hg.pid -E error.log
692 > -p $HGPORT -d --pid-file=hg.pid -E error.log
693 $ cat hg.pid > $DAEMON_PIDS
693 $ cat hg.pid > $DAEMON_PIDS
694
694
695 $ hg clone http://localhost:$HGPORT/ clone
695 $ hg clone http://localhost:$HGPORT/ clone
696 requesting all changes
696 requesting all changes
697 abort: HTTP request error (incomplete response)
697 abort: HTTP request error (incomplete response)
698 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
698 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
699 [255]
699 [255]
700
700
701 $ killdaemons.py $DAEMON_PIDS
701 $ killdaemons.py $DAEMON_PIDS
702
702
703 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -11
703 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -11
704 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
704 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
705 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
705 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
706 sendall(9) -> 4\r\nnone\r\n
706 sendall(9) -> 4\r\nnone\r\n
707 sendall(9) -> 4\r\nHG20\r\n
707 sendall(9) -> 4\r\nHG20\r\n
708 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
708 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
709 sendall(9 from 9) -> (0) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
709 sendall(9 from 9) -> (0) 4\\r\\n\x00\x00\x00)\\r\\n (esc)
710 write limit reached; closing socket
710 write limit reached; closing socket
711 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
711 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
712 Traceback (most recent call last):
712 Traceback (most recent call last):
713 Exception: connection closed after sending N bytes
713 Exception: connection closed after sending N bytes
714
714
715 $ rm -f error.log
715 $ rm -f error.log
716
716
717 Server stops sending after bundle2 part header
717 Server stops sending after bundle2 part header
718 ----------------------------------------------
718 ----------------------------------------------
719
719
720 $ hg serve \
720 $ hg serve \
721 > --config badserver.close-after-send-patterns="version03nbchanges1\\r\\n" \
721 > --config badserver.close-after-send-patterns="version03nbchanges1\\r\\n" \
722 > -p $HGPORT -d --pid-file=hg.pid -E error.log
722 > -p $HGPORT -d --pid-file=hg.pid -E error.log
723 $ cat hg.pid > $DAEMON_PIDS
723 $ cat hg.pid > $DAEMON_PIDS
724
724
725 $ hg clone http://localhost:$HGPORT/ clone
725 $ hg clone http://localhost:$HGPORT/ clone
726 requesting all changes
726 requesting all changes
727 adding changesets
727 adding changesets
728 transaction abort!
729 rollback completed
728 abort: HTTP request error (incomplete response)
730 abort: HTTP request error (incomplete response)
729 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
731 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
730 [255]
732 [255]
731
733
732 $ killdaemons.py $DAEMON_PIDS
734 $ killdaemons.py $DAEMON_PIDS
733
735
734 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -12
736 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -12
735 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
737 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
736 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
738 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
737 sendall(9) -> 4\r\nnone\r\n
739 sendall(9) -> 4\r\nnone\r\n
738 sendall(9) -> 4\r\nHG20\r\n
740 sendall(9) -> 4\r\nHG20\r\n
739 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
741 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
740 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
742 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
741 sendall(47 from 47) -> (0) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
743 sendall(47 from 47) -> (0) 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
742 write limit reached; closing socket
744 write limit reached; closing socket
743 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
745 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
744 Traceback (most recent call last):
746 Traceback (most recent call last):
745 Exception: connection closed after sending N bytes
747 Exception: connection closed after sending N bytes
746
748
747 $ rm -f error.log
749 $ rm -f error.log
748
750
749 Server stops after bundle2 part payload chunk size
751 Server stops after bundle2 part payload chunk size
750 --------------------------------------------------
752 --------------------------------------------------
751
753
752 $ hg serve \
754 $ hg serve \
753 > --config badserver.close-after-send-patterns='1dc\r\n.......' \
755 > --config badserver.close-after-send-patterns='1dc\r\n.......' \
754 > -p $HGPORT -d --pid-file=hg.pid -E error.log
756 > -p $HGPORT -d --pid-file=hg.pid -E error.log
755 $ cat hg.pid > $DAEMON_PIDS
757 $ cat hg.pid > $DAEMON_PIDS
756
758
757 $ hg clone http://localhost:$HGPORT/ clone
759 $ hg clone http://localhost:$HGPORT/ clone
758 requesting all changes
760 requesting all changes
759 adding changesets
761 adding changesets
762 transaction abort!
763 rollback completed
760 abort: HTTP request error (incomplete response*) (glob)
764 abort: HTTP request error (incomplete response*) (glob)
761 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
765 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
762 [255]
766 [255]
763
767
764 $ killdaemons.py $DAEMON_PIDS
768 $ killdaemons.py $DAEMON_PIDS
765
769
766 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -14
770 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -14
767 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
771 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
768 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
772 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
769 sendall(9) -> 4\r\nnone\r\n
773 sendall(9) -> 4\r\nnone\r\n
770 sendall(9) -> 4\r\nHG20\r\n
774 sendall(9) -> 4\r\nHG20\r\n
771 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
775 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
772 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
776 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
773 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
777 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
774 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
778 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
775 sendall(12 from 483) -> (0) 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1d (esc)
779 sendall(12 from 483) -> (0) 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1d (esc)
776 write limit reached; closing socket
780 write limit reached; closing socket
777 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
781 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
778 Traceback (most recent call last):
782 Traceback (most recent call last):
779 Exception: connection closed after sending N bytes
783 Exception: connection closed after sending N bytes
780
784
781 $ rm -f error.log
785 $ rm -f error.log
782
786
783 Server stops sending in middle of bundle2 payload chunk
787 Server stops sending in middle of bundle2 payload chunk
784 -------------------------------------------------------
788 -------------------------------------------------------
785
789
786 $ hg serve \
790 $ hg serve \
787 > --config badserver.close-after-send-patterns=':jL\0\0\x00\0\0\0\0\0\0\0\r\n' \
791 > --config badserver.close-after-send-patterns=':jL\0\0\x00\0\0\0\0\0\0\0\r\n' \
788 > -p $HGPORT -d --pid-file=hg.pid -E error.log
792 > -p $HGPORT -d --pid-file=hg.pid -E error.log
789 $ cat hg.pid > $DAEMON_PIDS
793 $ cat hg.pid > $DAEMON_PIDS
790
794
791 $ hg clone http://localhost:$HGPORT/ clone
795 $ hg clone http://localhost:$HGPORT/ clone
792 requesting all changes
796 requesting all changes
793 adding changesets
797 adding changesets
798 transaction abort!
799 rollback completed
794 abort: HTTP request error (incomplete response)
800 abort: HTTP request error (incomplete response)
795 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
801 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
796 [255]
802 [255]
797
803
798 $ killdaemons.py $DAEMON_PIDS
804 $ killdaemons.py $DAEMON_PIDS
799
805
800 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -14
806 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -14
801 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
807 sendall(167) -> HTTP/1.1 200 Script output follows\r\nServer: badhttpserver\r\nDate: $HTTP_DATE$\r\nContent-Type: application/mercurial-0.2\r\nTransfer-Encoding: chunked\r\n\r\n
802 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
808 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
803 sendall(9) -> 4\r\nnone\r\n
809 sendall(9) -> 4\r\nnone\r\n
804 sendall(9) -> 4\r\nHG20\r\n
810 sendall(9) -> 4\r\nHG20\r\n
805 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
811 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
806 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
812 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
807 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
813 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
808 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
814 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
809 sendall(483 from 483) -> (0) 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa3j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00j\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
815 sendall(483 from 483) -> (0) 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa3j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00j\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
810 write limit reached; closing socket
816 write limit reached; closing socket
811 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
817 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
812 Traceback (most recent call last):
818 Traceback (most recent call last):
813 Exception: connection closed after sending N bytes
819 Exception: connection closed after sending N bytes
814
820
815 $ rm -f error.log
821 $ rm -f error.log
816
822
817 Server stops sending after 0 length payload chunk size
823 Server stops sending after 0 length payload chunk size
818 ------------------------------------------------------
824 ------------------------------------------------------
819
825
820 $ hg serve \
826 $ hg serve \
821 > --config badserver.close-after-send-patterns=LISTKEYS \
827 > --config badserver.close-after-send-patterns=LISTKEYS \
822 > -p $HGPORT -d --pid-file=hg.pid -E error.log
828 > -p $HGPORT -d --pid-file=hg.pid -E error.log
823 $ cat hg.pid > $DAEMON_PIDS
829 $ cat hg.pid > $DAEMON_PIDS
824
830
825 $ hg clone http://localhost:$HGPORT/ clone
831 $ hg clone http://localhost:$HGPORT/ clone
826 requesting all changes
832 requesting all changes
827 adding changesets
833 adding changesets
828 adding manifests
834 adding manifests
829 adding file changes
835 adding file changes
830 transaction abort!
836 transaction abort!
831 rollback completed
837 rollback completed
832 abort: HTTP request error (incomplete response*) (glob)
838 abort: HTTP request error (incomplete response*) (glob)
833 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
839 (this may be an intermittent network failure; if the error persists, consider contacting the network or server operator)
834 [255]
840 [255]
835
841
836 $ killdaemons.py $DAEMON_PIDS
842 $ killdaemons.py $DAEMON_PIDS
837
843
838 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -16
844 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -16
839 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
845 sendall(6) -> 1\\r\\n\x04\\r\\n (esc)
840 sendall(9) -> 4\r\nnone\r\n
846 sendall(9) -> 4\r\nnone\r\n
841 sendall(9) -> 4\r\nHG20\r\n
847 sendall(9) -> 4\r\nHG20\r\n
842 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
848 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
843 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
849 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
844 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
850 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
845 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
851 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
846 sendall(483) -> 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa3j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00j\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
852 sendall(483) -> 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa3j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00j\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
847 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
853 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
848 sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
854 sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
849 sendall(13 from 38) -> (0) 20\\r\\n\x08LISTKEYS (esc)
855 sendall(13 from 38) -> (0) 20\\r\\n\x08LISTKEYS (esc)
850 write limit reached; closing socket
856 write limit reached; closing socket
851 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
857 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
852 Traceback (most recent call last):
858 Traceback (most recent call last):
853 Exception: connection closed after sending N bytes
859 Exception: connection closed after sending N bytes
854
860
855 $ rm -f error.log
861 $ rm -f error.log
856
862
857 Server stops sending after 0 part bundle part header (indicating end of bundle2 payload)
863 Server stops sending after 0 part bundle part header (indicating end of bundle2 payload)
858 ----------------------------------------------------------------------------------------
864 ----------------------------------------------------------------------------------------
859
865
860 This is before the 0 size chunked transfer part that signals end of HTTP response.
866 This is before the 0 size chunked transfer part that signals end of HTTP response.
861
867
862 $ hg serve \
868 $ hg serve \
863 > --config badserver.close-after-send-patterns='(.*4\r\n\0\0\0\0\r\n){5}' \
869 > --config badserver.close-after-send-patterns='(.*4\r\n\0\0\0\0\r\n){5}' \
864 > -p $HGPORT -d --pid-file=hg.pid -E error.log
870 > -p $HGPORT -d --pid-file=hg.pid -E error.log
865 $ cat hg.pid > $DAEMON_PIDS
871 $ cat hg.pid > $DAEMON_PIDS
866
872
867 $ hg clone http://localhost:$HGPORT/ clone
873 $ hg clone http://localhost:$HGPORT/ clone
868 requesting all changes
874 requesting all changes
869 adding changesets
875 adding changesets
870 adding manifests
876 adding manifests
871 adding file changes
877 adding file changes
872 added 1 changesets with 1 changes to 1 files
878 added 1 changesets with 1 changes to 1 files
873 new changesets 96ee1d7354c4
879 new changesets 96ee1d7354c4
874 updating to branch default
880 updating to branch default
875 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
881 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
876
882
877 $ killdaemons.py $DAEMON_PIDS
883 $ killdaemons.py $DAEMON_PIDS
878
884
879 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -20
885 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -20
880 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
886 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
881 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
887 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
882 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
888 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
883 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
889 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
884 sendall(483) -> 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa3j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00j\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
890 sendall(483) -> 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa3j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00j\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
885 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
891 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
886 sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
892 sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
887 sendall(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc)
893 sendall(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc)
888 sendall(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc)
894 sendall(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc)
889 sendall(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n
895 sendall(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n
890 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
896 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
891 sendall(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc)
897 sendall(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc)
892 sendall(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc)
898 sendall(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc)
893 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
899 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
894 sendall(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
900 sendall(9 from 9) -> (0) 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
895 write limit reached; closing socket
901 write limit reached; closing socket
896 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
902 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
897 Traceback (most recent call last):
903 Traceback (most recent call last):
898 Exception: connection closed after sending N bytes
904 Exception: connection closed after sending N bytes
899
905
900 $ rm -f error.log
906 $ rm -f error.log
901 $ rm -rf clone
907 $ rm -rf clone
902
908
903 Server sends a size 0 chunked-transfer size without terminating \r\n
909 Server sends a size 0 chunked-transfer size without terminating \r\n
904 --------------------------------------------------------------------
910 --------------------------------------------------------------------
905
911
906 $ hg serve \
912 $ hg serve \
907 > --config badserver.close-after-send-patterns="(.*4\\r\\n\0\0\0\0\\r\\n0\r\n)" \
913 > --config badserver.close-after-send-patterns="(.*4\\r\\n\0\0\0\0\\r\\n0\r\n)" \
908 > -p $HGPORT -d --pid-file=hg.pid -E error.log
914 > -p $HGPORT -d --pid-file=hg.pid -E error.log
909 $ cat hg.pid > $DAEMON_PIDS
915 $ cat hg.pid > $DAEMON_PIDS
910
916
911 $ hg clone http://localhost:$HGPORT/ clone
917 $ hg clone http://localhost:$HGPORT/ clone
912 requesting all changes
918 requesting all changes
913 adding changesets
919 adding changesets
914 adding manifests
920 adding manifests
915 adding file changes
921 adding file changes
916 added 1 changesets with 1 changes to 1 files
922 added 1 changesets with 1 changes to 1 files
917 new changesets 96ee1d7354c4
923 new changesets 96ee1d7354c4
918 updating to branch default
924 updating to branch default
919 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
925 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
920
926
921 $ killdaemons.py $DAEMON_PIDS
927 $ killdaemons.py $DAEMON_PIDS
922
928
923 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -21
929 $ "$PYTHON" $TESTDIR/filtertraceback.py < error.log | tail -21
924 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
930 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
925 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
931 sendall(9) -> 4\\r\\n\x00\x00\x00)\\r\\n (esc)
926 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
932 sendall(47) -> 29\\r\\n\x0bCHANGEGROUP\x00\x00\x00\x00\x01\x01\x07\x02 \x01version03nbchanges1\\r\\n (esc)
927 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
933 sendall(9) -> 4\\r\\n\x00\x00\x01\xdc\\r\\n (esc)
928 sendall(483) -> 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa3j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00j\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
934 sendall(483) -> 1dc\\r\\n\x00\x00\x00\xb4\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00>6a3df4de388f3c4f8e28f4f9a814299a3cbb5f50\\ntest\\n0 0\\nfoo\\n\\ninitial\x00\x00\x00\x00\x00\x00\x00\xa3j=\xf4\xde8\x8f<O\x8e(\xf4\xf9\xa8\x14)\x9a<\xbb_P\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00-foo\x00b80de5d138758541c5f05265ad144ab9fa86d1db\\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x07foo\x00\x00\x00j\xb8\\r\xe5\xd18u\x85A\xc5\xf0Re\xad\x14J\xb9\xfa\x86\xd1\xdb\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x96\xee\x1dsT\xc4\xadsr\x04vr\xc3j\x1fV\x1e:jL\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\\r\\n (esc)
929 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
935 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
930 sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
936 sendall(9) -> 4\\r\\n\x00\x00\x00 \\r\\n (esc)
931 sendall(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc)
937 sendall(38) -> 20\\r\\n\x08LISTKEYS\x00\x00\x00\x01\x01\x00 \x06namespacephases\\r\\n (esc)
932 sendall(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc)
938 sendall(9) -> 4\\r\\n\x00\x00\x00:\\r\\n (esc)
933 sendall(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n
939 sendall(64) -> 3a\r\n96ee1d7354c4ad7372047672c36a1f561e3a6a4c 1\npublishing True\r\n
934 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
940 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
935 sendall(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc)
941 sendall(9) -> 4\\r\\n\x00\x00\x00#\\r\\n (esc)
936 sendall(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc)
942 sendall(41) -> 23\\r\\n\x08LISTKEYS\x00\x00\x00\x02\x01\x00 namespacebookmarks\\r\\n (esc)
937 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
943 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
938 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
944 sendall(9) -> 4\\r\\n\x00\x00\x00\x00\\r\\n (esc)
939 sendall(3 from 5) -> (0) 0\r\n
945 sendall(3 from 5) -> (0) 0\r\n
940 write limit reached; closing socket
946 write limit reached; closing socket
941 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
947 $LOCALIP - - [$ERRDATE$] Exception happened during processing request '/?cmd=getbundle': (glob)
942 Traceback (most recent call last):
948 Traceback (most recent call last):
943 Exception: connection closed after sending N bytes
949 Exception: connection closed after sending N bytes
944
950
945 $ rm -f error.log
951 $ rm -f error.log
946 $ rm -rf clone
952 $ rm -rf clone
@@ -1,405 +1,408 b''
1 #require serve
1 #require serve
2
2
3 This test is a duplicate of 'test-http.t', feel free to factor out
3 This test is a duplicate of 'test-http.t', feel free to factor out
4 parts that are not bundle1/bundle2 specific.
4 parts that are not bundle1/bundle2 specific.
5
5
6 $ cat << EOF >> $HGRCPATH
6 $ cat << EOF >> $HGRCPATH
7 > [devel]
7 > [devel]
8 > # This test is dedicated to interaction through old bundle
8 > # This test is dedicated to interaction through old bundle
9 > legacy.exchange = bundle1
9 > legacy.exchange = bundle1
10 > EOF
10 > EOF
11
11
12 $ hg init test
12 $ hg init test
13 $ cd test
13 $ cd test
14 $ echo foo>foo
14 $ echo foo>foo
15 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
15 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
16 $ echo foo>foo.d/foo
16 $ echo foo>foo.d/foo
17 $ echo bar>foo.d/bAr.hg.d/BaR
17 $ echo bar>foo.d/bAr.hg.d/BaR
18 $ echo bar>foo.d/baR.d.hg/bAR
18 $ echo bar>foo.d/baR.d.hg/bAR
19 $ hg commit -A -m 1
19 $ hg commit -A -m 1
20 adding foo
20 adding foo
21 adding foo.d/bAr.hg.d/BaR
21 adding foo.d/bAr.hg.d/BaR
22 adding foo.d/baR.d.hg/bAR
22 adding foo.d/baR.d.hg/bAR
23 adding foo.d/foo
23 adding foo.d/foo
24 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
24 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
25 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
25 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
26
26
27 Test server address cannot be reused
27 Test server address cannot be reused
28
28
29 $ hg serve -p $HGPORT1 2>&1
29 $ hg serve -p $HGPORT1 2>&1
30 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
30 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
31 [255]
31 [255]
32
32
33 $ cd ..
33 $ cd ..
34 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
34 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
35
35
36 clone via stream
36 clone via stream
37
37
38 #if no-reposimplestore
38 #if no-reposimplestore
39 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
39 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
40 streaming all changes
40 streaming all changes
41 6 files to transfer, 606 bytes of data (no-zstd !)
41 7 files to transfer, 606 bytes of data (no-zstd !)
42 6 files to transfer, 608 bytes of data (zstd !)
42 7 files to transfer, 608 bytes of data (zstd no-rust !)
43 9 files to transfer, 734 bytes of data (zstd rust !)
43 transferred * bytes in * seconds (*/sec) (glob)
44 transferred * bytes in * seconds (*/sec) (glob)
44 searching for changes
45 searching for changes
45 no changes found
46 no changes found
46 updating to branch default
47 updating to branch default
47 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 $ hg verify -R copy -q
49 $ hg verify -R copy -q
49 #endif
50 #endif
50
51
51 try to clone via stream, should use pull instead
52 try to clone via stream, should use pull instead
52
53
53 $ hg clone --stream http://localhost:$HGPORT1/ copy2
54 $ hg clone --stream http://localhost:$HGPORT1/ copy2
54 warning: stream clone requested but server has them disabled
55 warning: stream clone requested but server has them disabled
55 requesting all changes
56 requesting all changes
56 adding changesets
57 adding changesets
57 adding manifests
58 adding manifests
58 adding file changes
59 adding file changes
59 added 1 changesets with 4 changes to 4 files
60 added 1 changesets with 4 changes to 4 files
60 new changesets 8b6053c928fe
61 new changesets 8b6053c928fe
61 updating to branch default
62 updating to branch default
62 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
63
64
64 try to clone via stream but missing requirements, so should use pull instead
65 try to clone via stream but missing requirements, so should use pull instead
65
66
66 $ cat > $TESTTMP/removesupportedformat.py << EOF
67 $ cat > $TESTTMP/removesupportedformat.py << EOF
67 > from mercurial import localrepo
68 > from mercurial import localrepo
68 > def reposetup(ui, repo):
69 > def reposetup(ui, repo):
69 > local = repo.local()
70 > local = repo.local()
70 > if local is not None:
71 > if local is not None:
71 > local.supported.remove(b'generaldelta')
72 > local.supported.remove(b'generaldelta')
72 > EOF
73 > EOF
73
74
74 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
75 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
75 warning: stream clone requested but client is missing requirements: generaldelta
76 warning: stream clone requested but client is missing requirements: generaldelta
76 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
77 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
77 requesting all changes
78 requesting all changes
78 adding changesets
79 adding changesets
79 adding manifests
80 adding manifests
80 adding file changes
81 adding file changes
81 added 1 changesets with 4 changes to 4 files
82 added 1 changesets with 4 changes to 4 files
82 new changesets 8b6053c928fe
83 new changesets 8b6053c928fe
83 updating to branch default
84 updating to branch default
84 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
85 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
85
86
86 clone via pull
87 clone via pull
87
88
88 $ hg clone http://localhost:$HGPORT1/ copy-pull
89 $ hg clone http://localhost:$HGPORT1/ copy-pull
89 requesting all changes
90 requesting all changes
90 adding changesets
91 adding changesets
91 adding manifests
92 adding manifests
92 adding file changes
93 adding file changes
93 added 1 changesets with 4 changes to 4 files
94 added 1 changesets with 4 changes to 4 files
94 new changesets 8b6053c928fe
95 new changesets 8b6053c928fe
95 updating to branch default
96 updating to branch default
96 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 $ hg verify -R copy-pull -q
98 $ hg verify -R copy-pull -q
98 $ cd test
99 $ cd test
99 $ echo bar > bar
100 $ echo bar > bar
100 $ hg commit -A -d '1 0' -m 2
101 $ hg commit -A -d '1 0' -m 2
101 adding bar
102 adding bar
102 $ cd ..
103 $ cd ..
103
104
104 clone over http with --update
105 clone over http with --update
105
106
106 $ hg clone http://localhost:$HGPORT1/ updated --update 0
107 $ hg clone http://localhost:$HGPORT1/ updated --update 0
107 requesting all changes
108 requesting all changes
108 adding changesets
109 adding changesets
109 adding manifests
110 adding manifests
110 adding file changes
111 adding file changes
111 added 2 changesets with 5 changes to 5 files
112 added 2 changesets with 5 changes to 5 files
112 new changesets 8b6053c928fe:5fed3813f7f5
113 new changesets 8b6053c928fe:5fed3813f7f5
113 updating to branch default
114 updating to branch default
114 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
115 $ hg log -r . -R updated
116 $ hg log -r . -R updated
116 changeset: 0:8b6053c928fe
117 changeset: 0:8b6053c928fe
117 user: test
118 user: test
118 date: Thu Jan 01 00:00:00 1970 +0000
119 date: Thu Jan 01 00:00:00 1970 +0000
119 summary: 1
120 summary: 1
120
121
121 $ rm -rf updated
122 $ rm -rf updated
122
123
123 incoming via HTTP
124 incoming via HTTP
124
125
125 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
126 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
126 adding changesets
127 adding changesets
127 adding manifests
128 adding manifests
128 adding file changes
129 adding file changes
129 added 1 changesets with 4 changes to 4 files
130 added 1 changesets with 4 changes to 4 files
130 new changesets 8b6053c928fe
131 new changesets 8b6053c928fe
131 updating to branch default
132 updating to branch default
132 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 $ cd partial
134 $ cd partial
134 $ touch LOCAL
135 $ touch LOCAL
135 $ hg ci -qAm LOCAL
136 $ hg ci -qAm LOCAL
136 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
137 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
137 comparing with http://localhost:$HGPORT1/
138 comparing with http://localhost:$HGPORT1/
138 searching for changes
139 searching for changes
139 2
140 2
140 $ cd ..
141 $ cd ..
141
142
142 pull
143 pull
143
144
144 $ cd copy-pull
145 $ cd copy-pull
145 $ cat >> .hg/hgrc <<EOF
146 $ cat >> .hg/hgrc <<EOF
146 > [hooks]
147 > [hooks]
147 > changegroup = sh -c "printenv.py --line changegroup"
148 > changegroup = sh -c "printenv.py --line changegroup"
148 > EOF
149 > EOF
149 $ hg pull
150 $ hg pull
150 pulling from http://localhost:$HGPORT1/
151 pulling from http://localhost:$HGPORT1/
151 searching for changes
152 searching for changes
152 adding changesets
153 adding changesets
153 adding manifests
154 adding manifests
154 adding file changes
155 adding file changes
155 added 1 changesets with 1 changes to 1 files
156 added 1 changesets with 1 changes to 1 files
156 new changesets 5fed3813f7f5
157 new changesets 5fed3813f7f5
157 changegroup hook: HG_HOOKNAME=changegroup
158 changegroup hook: HG_HOOKNAME=changegroup
158 HG_HOOKTYPE=changegroup
159 HG_HOOKTYPE=changegroup
159 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
160 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
160 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
161 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
161 HG_SOURCE=pull
162 HG_SOURCE=pull
162 HG_TXNID=TXN:$ID$
163 HG_TXNID=TXN:$ID$
163 HG_TXNNAME=pull
164 HG_TXNNAME=pull
164 http://localhost:$HGPORT1/
165 http://localhost:$HGPORT1/
165 HG_URL=http://localhost:$HGPORT1/
166 HG_URL=http://localhost:$HGPORT1/
166
167
167 (run 'hg update' to get a working copy)
168 (run 'hg update' to get a working copy)
168 $ cd ..
169 $ cd ..
169
170
170 clone from invalid URL
171 clone from invalid URL
171
172
172 $ hg clone http://localhost:$HGPORT/bad
173 $ hg clone http://localhost:$HGPORT/bad
173 abort: HTTP Error 404: Not Found
174 abort: HTTP Error 404: Not Found
174 [100]
175 [100]
175
176
176 test http authentication
177 test http authentication
177 + use the same server to test server side streaming preference
178 + use the same server to test server side streaming preference
178
179
179 $ cd test
180 $ cd test
180
181
181 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -p $HGPORT2 -d \
182 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -p $HGPORT2 -d \
182 > --pid-file=pid --config server.preferuncompressed=True \
183 > --pid-file=pid --config server.preferuncompressed=True \
183 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
184 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
184 $ cat pid >> $DAEMON_PIDS
185 $ cat pid >> $DAEMON_PIDS
185
186
186 $ cat << EOF > get_pass.py
187 $ cat << EOF > get_pass.py
187 > from mercurial import util
188 > from mercurial import util
188 > def newgetpass():
189 > def newgetpass():
189 > return "pass"
190 > return "pass"
190 > util.get_password = newgetpass
191 > util.get_password = newgetpass
191 > EOF
192 > EOF
192
193
193 $ hg id http://localhost:$HGPORT2/
194 $ hg id http://localhost:$HGPORT2/
194 abort: http authorization required for http://localhost:$HGPORT2/
195 abort: http authorization required for http://localhost:$HGPORT2/
195 [255]
196 [255]
196 $ hg id http://localhost:$HGPORT2/
197 $ hg id http://localhost:$HGPORT2/
197 abort: http authorization required for http://localhost:$HGPORT2/
198 abort: http authorization required for http://localhost:$HGPORT2/
198 [255]
199 [255]
199 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
200 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
200 http authorization required for http://localhost:$HGPORT2/
201 http authorization required for http://localhost:$HGPORT2/
201 realm: mercurial
202 realm: mercurial
202 user: user
203 user: user
203 password: 5fed3813f7f5
204 password: 5fed3813f7f5
204 $ hg id http://user:pass@localhost:$HGPORT2/
205 $ hg id http://user:pass@localhost:$HGPORT2/
205 5fed3813f7f5
206 5fed3813f7f5
206 $ echo '[auth]' >> .hg/hgrc
207 $ echo '[auth]' >> .hg/hgrc
207 $ echo 'l.schemes=http' >> .hg/hgrc
208 $ echo 'l.schemes=http' >> .hg/hgrc
208 $ echo 'l.prefix=lo' >> .hg/hgrc
209 $ echo 'l.prefix=lo' >> .hg/hgrc
209 $ echo 'l.username=user' >> .hg/hgrc
210 $ echo 'l.username=user' >> .hg/hgrc
210 $ echo 'l.password=pass' >> .hg/hgrc
211 $ echo 'l.password=pass' >> .hg/hgrc
211 $ hg id http://localhost:$HGPORT2/
212 $ hg id http://localhost:$HGPORT2/
212 5fed3813f7f5
213 5fed3813f7f5
213 $ hg id http://localhost:$HGPORT2/
214 $ hg id http://localhost:$HGPORT2/
214 5fed3813f7f5
215 5fed3813f7f5
215 $ hg id http://user@localhost:$HGPORT2/
216 $ hg id http://user@localhost:$HGPORT2/
216 5fed3813f7f5
217 5fed3813f7f5
217
218
218 #if no-reposimplestore
219 #if no-reposimplestore
219 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
220 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
220 streaming all changes
221 streaming all changes
221 7 files to transfer, 916 bytes of data (no-zstd !)
222 8 files to transfer, 916 bytes of data (no-zstd !)
222 7 files to transfer, 919 bytes of data (zstd !)
223 8 files to transfer, 919 bytes of data (zstd no-rust !)
223 transferred * bytes in * seconds (*/sec) (glob)
224 10 files to transfer, 1.02 KB of data (zstd rust !)
225 transferred * in * seconds (*/sec) (glob)
224 searching for changes
226 searching for changes
225 no changes found
227 no changes found
226 updating to branch default
228 updating to branch default
227 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
229 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
228 #endif
230 #endif
229
231
230 --pull should override server's preferuncompressed
232 --pull should override server's preferuncompressed
231
233
232 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
234 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
233 requesting all changes
235 requesting all changes
234 adding changesets
236 adding changesets
235 adding manifests
237 adding manifests
236 adding file changes
238 adding file changes
237 added 2 changesets with 5 changes to 5 files
239 added 2 changesets with 5 changes to 5 files
238 new changesets 8b6053c928fe:5fed3813f7f5
240 new changesets 8b6053c928fe:5fed3813f7f5
239 updating to branch default
241 updating to branch default
240 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
242 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
241
243
242 $ hg id http://user2@localhost:$HGPORT2/
244 $ hg id http://user2@localhost:$HGPORT2/
243 abort: http authorization required for http://localhost:$HGPORT2/
245 abort: http authorization required for http://localhost:$HGPORT2/
244 [255]
246 [255]
245 $ hg id http://user:pass2@localhost:$HGPORT2/
247 $ hg id http://user:pass2@localhost:$HGPORT2/
246 abort: HTTP Error 403: no
248 abort: HTTP Error 403: no
247 [100]
249 [100]
248
250
249 $ hg -R dest-pull tag -r tip top
251 $ hg -R dest-pull tag -r tip top
250 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
252 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
251 pushing to http://user:***@localhost:$HGPORT2/
253 pushing to http://user:***@localhost:$HGPORT2/
252 searching for changes
254 searching for changes
253 remote: adding changesets
255 remote: adding changesets
254 remote: adding manifests
256 remote: adding manifests
255 remote: adding file changes
257 remote: adding file changes
256 remote: added 1 changesets with 1 changes to 1 files
258 remote: added 1 changesets with 1 changes to 1 files
257 $ hg rollback -q
259 $ hg rollback -q
258
260
259 $ sed 's/.*] "/"/' < ../access.log
261 $ sed 's/.*] "/"/' < ../access.log
260 "GET /?cmd=capabilities HTTP/1.1" 401 -
262 "GET /?cmd=capabilities HTTP/1.1" 401 -
261 "GET /?cmd=capabilities HTTP/1.1" 401 -
263 "GET /?cmd=capabilities HTTP/1.1" 401 -
262 "GET /?cmd=capabilities HTTP/1.1" 401 -
264 "GET /?cmd=capabilities HTTP/1.1" 401 -
263 "GET /?cmd=capabilities HTTP/1.1" 200 -
265 "GET /?cmd=capabilities HTTP/1.1" 200 -
264 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
266 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
265 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
267 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
266 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
268 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
267 "GET /?cmd=capabilities HTTP/1.1" 401 -
269 "GET /?cmd=capabilities HTTP/1.1" 401 -
268 "GET /?cmd=capabilities HTTP/1.1" 200 -
270 "GET /?cmd=capabilities HTTP/1.1" 200 -
269 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
271 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
270 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
272 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
271 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
273 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
272 "GET /?cmd=capabilities HTTP/1.1" 401 -
274 "GET /?cmd=capabilities HTTP/1.1" 401 -
273 "GET /?cmd=capabilities HTTP/1.1" 200 -
275 "GET /?cmd=capabilities HTTP/1.1" 200 -
274 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
276 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
275 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
277 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
276 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
278 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
277 "GET /?cmd=capabilities HTTP/1.1" 401 -
279 "GET /?cmd=capabilities HTTP/1.1" 401 -
278 "GET /?cmd=capabilities HTTP/1.1" 200 -
280 "GET /?cmd=capabilities HTTP/1.1" 200 -
279 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
281 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
280 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
282 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
281 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
283 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
282 "GET /?cmd=capabilities HTTP/1.1" 401 -
284 "GET /?cmd=capabilities HTTP/1.1" 401 -
283 "GET /?cmd=capabilities HTTP/1.1" 200 -
285 "GET /?cmd=capabilities HTTP/1.1" 200 -
284 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
286 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
285 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
287 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
286 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
288 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
287 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
289 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
288 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
290 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
289 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
291 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
290 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
292 "GET /?cmd=stream_out HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
291 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
293 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
292 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
294 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
293 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
295 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
294 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
296 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
295 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
297 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
296 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
298 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
297 "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$ partial-pull
299 "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$ partial-pull
298 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
300 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
299 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
301 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
300 "GET /?cmd=capabilities HTTP/1.1" 401 -
302 "GET /?cmd=capabilities HTTP/1.1" 401 -
301 "GET /?cmd=capabilities HTTP/1.1" 401 -
303 "GET /?cmd=capabilities HTTP/1.1" 401 -
302 "GET /?cmd=capabilities HTTP/1.1" 403 -
304 "GET /?cmd=capabilities HTTP/1.1" 403 -
303 "GET /?cmd=capabilities HTTP/1.1" 401 -
305 "GET /?cmd=capabilities HTTP/1.1" 401 -
304 "GET /?cmd=capabilities HTTP/1.1" 200 -
306 "GET /?cmd=capabilities HTTP/1.1" 200 -
305 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
307 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
306 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
308 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
307 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
309 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
308 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
310 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
309 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
311 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
310 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob)
312 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=686173686564+5eb5abfefeea63c80dd7553bcc3783f37e0c5524* (glob)
311 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
313 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
312
314
313 $ cd ..
315 $ cd ..
314
316
315 clone of serve with repo in root and unserved subrepo (issue2970)
317 clone of serve with repo in root and unserved subrepo (issue2970)
316
318
317 $ hg --cwd test init sub
319 $ hg --cwd test init sub
318 $ echo empty > test/sub/empty
320 $ echo empty > test/sub/empty
319 $ hg --cwd test/sub add empty
321 $ hg --cwd test/sub add empty
320 $ hg --cwd test/sub commit -qm 'add empty'
322 $ hg --cwd test/sub commit -qm 'add empty'
321 $ hg --cwd test/sub tag -r 0 something
323 $ hg --cwd test/sub tag -r 0 something
322 $ echo sub = sub > test/.hgsub
324 $ echo sub = sub > test/.hgsub
323 $ hg --cwd test add .hgsub
325 $ hg --cwd test add .hgsub
324 $ hg --cwd test commit -qm 'add subrepo'
326 $ hg --cwd test commit -qm 'add subrepo'
325 $ hg clone http://localhost:$HGPORT noslash-clone
327 $ hg clone http://localhost:$HGPORT noslash-clone
326 requesting all changes
328 requesting all changes
327 adding changesets
329 adding changesets
328 adding manifests
330 adding manifests
329 adding file changes
331 adding file changes
330 added 3 changesets with 7 changes to 7 files
332 added 3 changesets with 7 changes to 7 files
331 new changesets 8b6053c928fe:56f9bc90cce6
333 new changesets 8b6053c928fe:56f9bc90cce6
332 updating to branch default
334 updating to branch default
333 cloning subrepo sub from http://localhost:$HGPORT/sub
335 cloning subrepo sub from http://localhost:$HGPORT/sub
334 abort: HTTP Error 404: Not Found
336 abort: HTTP Error 404: Not Found
335 [100]
337 [100]
336 $ hg clone http://localhost:$HGPORT/ slash-clone
338 $ hg clone http://localhost:$HGPORT/ slash-clone
337 requesting all changes
339 requesting all changes
338 adding changesets
340 adding changesets
339 adding manifests
341 adding manifests
340 adding file changes
342 adding file changes
341 added 3 changesets with 7 changes to 7 files
343 added 3 changesets with 7 changes to 7 files
342 new changesets 8b6053c928fe:56f9bc90cce6
344 new changesets 8b6053c928fe:56f9bc90cce6
343 updating to branch default
345 updating to branch default
344 cloning subrepo sub from http://localhost:$HGPORT/sub
346 cloning subrepo sub from http://localhost:$HGPORT/sub
345 abort: HTTP Error 404: Not Found
347 abort: HTTP Error 404: Not Found
346 [100]
348 [100]
347
349
348 check error log
350 check error log
349
351
350 $ cat error.log
352 $ cat error.log
351
353
352 Check error reporting while pulling/cloning
354 Check error reporting while pulling/cloning
353
355
354 $ $RUNTESTDIR/killdaemons.py
356 $ $RUNTESTDIR/killdaemons.py
355 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
357 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
356 $ cat hg3.pid >> $DAEMON_PIDS
358 $ cat hg3.pid >> $DAEMON_PIDS
357 $ hg clone http://localhost:$HGPORT/ abort-clone
359 $ hg clone http://localhost:$HGPORT/ abort-clone
358 requesting all changes
360 requesting all changes
359 abort: remote error:
361 abort: remote error:
360 this is an exercise
362 this is an exercise
361 [100]
363 [100]
362 $ cat error.log
364 $ cat error.log
363
365
364 disable pull-based clones
366 disable pull-based clones
365
367
366 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
368 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
367 $ cat hg4.pid >> $DAEMON_PIDS
369 $ cat hg4.pid >> $DAEMON_PIDS
368 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
370 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
369 requesting all changes
371 requesting all changes
370 abort: remote error:
372 abort: remote error:
371 server has pull-based clones disabled
373 server has pull-based clones disabled
372 [100]
374 [100]
373
375
374 #if no-reposimplestore
376 #if no-reposimplestore
375 ... but keep stream clones working
377 ... but keep stream clones working
376
378
377 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
379 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
378 streaming all changes
380 streaming all changes
379 * files to transfer, * of data (glob)
381 * files to transfer, * of data (glob)
380 transferred 1.36 KB in * seconds (* */sec) (glob) (no-zstd !)
382 transferred 1.36 KB in * seconds (* */sec) (glob) (no-zstd !)
381 transferred 1.38 KB in * seconds (* */sec) (glob) (zstd !)
383 transferred 1.38 KB in * seconds (* */sec) (glob) (zstd no-rust !)
384 transferred 1.56 KB in * seconds (* */sec) (glob) (zstd rust !)
382 searching for changes
385 searching for changes
383 no changes found
386 no changes found
384 #endif
387 #endif
385
388
386 ... and also keep partial clones and pulls working
389 ... and also keep partial clones and pulls working
387 $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone
390 $ hg clone http://localhost:$HGPORT1 --rev 0 test-partial-clone
388 adding changesets
391 adding changesets
389 adding manifests
392 adding manifests
390 adding file changes
393 adding file changes
391 added 1 changesets with 4 changes to 4 files
394 added 1 changesets with 4 changes to 4 files
392 new changesets 8b6053c928fe
395 new changesets 8b6053c928fe
393 updating to branch default
396 updating to branch default
394 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
397 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
395 $ hg pull -R test-partial-clone
398 $ hg pull -R test-partial-clone
396 pulling from http://localhost:$HGPORT1/
399 pulling from http://localhost:$HGPORT1/
397 searching for changes
400 searching for changes
398 adding changesets
401 adding changesets
399 adding manifests
402 adding manifests
400 adding file changes
403 adding file changes
401 added 2 changesets with 3 changes to 3 files
404 added 2 changesets with 3 changes to 3 files
402 new changesets 5fed3813f7f5:56f9bc90cce6
405 new changesets 5fed3813f7f5:56f9bc90cce6
403 (run 'hg update' to get a working copy)
406 (run 'hg update' to get a working copy)
404
407
405 $ cat error.log
408 $ cat error.log
@@ -1,121 +1,122 b''
1 #require serve
1 #require serve
2
2
3 $ hg init a
3 $ hg init a
4 $ cd a
4 $ cd a
5 $ echo a > a
5 $ echo a > a
6 $ hg ci -Ama -d '1123456789 0'
6 $ hg ci -Ama -d '1123456789 0'
7 adding a
7 adding a
8 $ hg serve --config server.uncompressed=True -p $HGPORT -d --pid-file=hg.pid
8 $ hg serve --config server.uncompressed=True -p $HGPORT -d --pid-file=hg.pid
9 $ cat hg.pid >> $DAEMON_PIDS
9 $ cat hg.pid >> $DAEMON_PIDS
10 $ cd ..
10 $ cd ..
11 $ tinyproxy.py $HGPORT1 localhost 2>proxy.log >/dev/null </dev/null &
11 $ tinyproxy.py $HGPORT1 localhost 2>proxy.log >/dev/null </dev/null &
12 $ while [ ! -f proxy.pid ]; do sleep 0; done
12 $ while [ ! -f proxy.pid ]; do sleep 0; done
13 $ cat proxy.pid >> $DAEMON_PIDS
13 $ cat proxy.pid >> $DAEMON_PIDS
14
14
15 url for proxy, stream
15 url for proxy, stream
16
16
17 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --stream http://localhost:$HGPORT/ b
17 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone --stream http://localhost:$HGPORT/ b
18 streaming all changes
18 streaming all changes
19 6 files to transfer, 412 bytes of data (reporevlogstore !)
19 7 files to transfer, 412 bytes of data (reporevlogstore no-rust !)
20 9 files to transfer, 538 bytes of data (reporevlogstore rust !)
20 4 files to transfer, 330 bytes of data (reposimplestore !)
21 4 files to transfer, 330 bytes of data (reposimplestore !)
21 transferred * bytes in * seconds (*/sec) (glob)
22 transferred * bytes in * seconds (*/sec) (glob)
22 updating to branch default
23 updating to branch default
23 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
24 $ cd b
25 $ cd b
25 $ hg verify -q
26 $ hg verify -q
26 $ cd ..
27 $ cd ..
27
28
28 url for proxy, pull
29 url for proxy, pull
29
30
30 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
31 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT/ b-pull
31 requesting all changes
32 requesting all changes
32 adding changesets
33 adding changesets
33 adding manifests
34 adding manifests
34 adding file changes
35 adding file changes
35 added 1 changesets with 1 changes to 1 files
36 added 1 changesets with 1 changes to 1 files
36 new changesets 83180e7845de
37 new changesets 83180e7845de
37 updating to branch default
38 updating to branch default
38 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 $ cd b-pull
40 $ cd b-pull
40 $ hg verify -q
41 $ hg verify -q
41 $ cd ..
42 $ cd ..
42
43
43 host:port for proxy
44 host:port for proxy
44
45
45 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
46 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ c
46 requesting all changes
47 requesting all changes
47 adding changesets
48 adding changesets
48 adding manifests
49 adding manifests
49 adding file changes
50 adding file changes
50 added 1 changesets with 1 changes to 1 files
51 added 1 changesets with 1 changes to 1 files
51 new changesets 83180e7845de
52 new changesets 83180e7845de
52 updating to branch default
53 updating to branch default
53 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
54
55
55 proxy url with user name and password
56 proxy url with user name and password
56
57
57 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
58 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ d
58 requesting all changes
59 requesting all changes
59 adding changesets
60 adding changesets
60 adding manifests
61 adding manifests
61 adding file changes
62 adding file changes
62 added 1 changesets with 1 changes to 1 files
63 added 1 changesets with 1 changes to 1 files
63 new changesets 83180e7845de
64 new changesets 83180e7845de
64 updating to branch default
65 updating to branch default
65 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66
67
67 url with user name and password
68 url with user name and password
68
69
69 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
70 $ http_proxy=http://user:passwd@localhost:$HGPORT1 hg clone --config http_proxy.always=True http://user:passwd@localhost:$HGPORT/ e
70 requesting all changes
71 requesting all changes
71 adding changesets
72 adding changesets
72 adding manifests
73 adding manifests
73 adding file changes
74 adding file changes
74 added 1 changesets with 1 changes to 1 files
75 added 1 changesets with 1 changes to 1 files
75 new changesets 83180e7845de
76 new changesets 83180e7845de
76 updating to branch default
77 updating to branch default
77 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
78
79
79 bad host:port for proxy ("Protocol not supported" can happen on
80 bad host:port for proxy ("Protocol not supported" can happen on
80 misconfigured hosts)
81 misconfigured hosts)
81
82
82 $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
83 $ http_proxy=localhost:$HGPORT2 hg clone --config http_proxy.always=True http://localhost:$HGPORT/ f
83 abort: error: (Connection refused|Protocol not supported|.* actively refused it|\$EADDRNOTAVAIL\$|No route to host) (re)
84 abort: error: (Connection refused|Protocol not supported|.* actively refused it|\$EADDRNOTAVAIL\$|No route to host) (re)
84 [100]
85 [100]
85
86
86 do not use the proxy if it is in the no list
87 do not use the proxy if it is in the no list
87
88
88 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
89 $ http_proxy=localhost:$HGPORT1 hg clone --config http_proxy.no=localhost http://localhost:$HGPORT/ g
89 requesting all changes
90 requesting all changes
90 adding changesets
91 adding changesets
91 adding manifests
92 adding manifests
92 adding file changes
93 adding file changes
93 added 1 changesets with 1 changes to 1 files
94 added 1 changesets with 1 changes to 1 files
94 new changesets 83180e7845de
95 new changesets 83180e7845de
95 updating to branch default
96 updating to branch default
96 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
97
98
98 proxy can't connect to server
99 proxy can't connect to server
99
100
100 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT2/ h
101 $ http_proxy=http://localhost:$HGPORT1/ hg --config http_proxy.always=True clone http://localhost:$HGPORT2/ h
101 abort: HTTP Error 404: Connection refused
102 abort: HTTP Error 404: Connection refused
102 [100]
103 [100]
103
104
104 $ cat proxy.log
105 $ cat proxy.log
105 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
106 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
106 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
107 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
107 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
108 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
108 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
109 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
109 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
110 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
110 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
111 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
111 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
112 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
112 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
113 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
113 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
114 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
114 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
115 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
115 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
116 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
116 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
117 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
117 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
118 * - - [*] "GET http://localhost:$HGPORT/?cmd=capabilities HTTP/1.1" - - (glob)
118 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
119 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=batch HTTP/1.1" - - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
119 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
120 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT/?cmd=getbundle HTTP/1.1" - - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=83180e7845de420a1bb46896fd5fe05294f8d629&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (glob)
120 * - - [*] code 404, message Connection refused (glob)
121 * - - [*] code 404, message Connection refused (glob)
121 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT2/?cmd=capabilities HTTP/1.1" 404 - (glob)
122 $LOCALIP - - [$LOGDATE$] "GET http://localhost:$HGPORT2/?cmd=capabilities HTTP/1.1" 404 - (glob)
@@ -1,609 +1,611 b''
1 #require serve
1 #require serve
2
2
3 $ hg init test
3 $ hg init test
4 $ cd test
4 $ cd test
5 $ echo foo>foo
5 $ echo foo>foo
6 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
6 $ mkdir foo.d foo.d/bAr.hg.d foo.d/baR.d.hg
7 $ echo foo>foo.d/foo
7 $ echo foo>foo.d/foo
8 $ echo bar>foo.d/bAr.hg.d/BaR
8 $ echo bar>foo.d/bAr.hg.d/BaR
9 $ echo bar>foo.d/baR.d.hg/bAR
9 $ echo bar>foo.d/baR.d.hg/bAR
10 $ hg commit -A -m 1
10 $ hg commit -A -m 1
11 adding foo
11 adding foo
12 adding foo.d/bAr.hg.d/BaR
12 adding foo.d/bAr.hg.d/BaR
13 adding foo.d/baR.d.hg/bAR
13 adding foo.d/baR.d.hg/bAR
14 adding foo.d/foo
14 adding foo.d/foo
15 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
15 $ hg serve -p $HGPORT -d --pid-file=../hg1.pid -E ../error.log
16 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
16 $ hg serve --config server.uncompressed=False -p $HGPORT1 -d --pid-file=../hg2.pid
17
17
18 Test server address cannot be reused
18 Test server address cannot be reused
19
19
20 $ hg serve -p $HGPORT1 2>&1
20 $ hg serve -p $HGPORT1 2>&1
21 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
21 abort: cannot start server at 'localhost:$HGPORT1': $EADDRINUSE$
22 [255]
22 [255]
23
23
24 $ cd ..
24 $ cd ..
25 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
25 $ cat hg1.pid hg2.pid >> $DAEMON_PIDS
26
26
27 clone via stream
27 clone via stream
28
28
29 #if no-reposimplestore
29 #if no-reposimplestore
30 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
30 $ hg clone --stream http://localhost:$HGPORT/ copy 2>&1
31 streaming all changes
31 streaming all changes
32 9 files to transfer, 715 bytes of data (no-zstd !)
32 10 files to transfer, 715 bytes of data (no-zstd !)
33 9 files to transfer, 717 bytes of data (zstd !)
33 10 files to transfer, 717 bytes of data (zstd no-rust !)
34 12 files to transfer, 843 bytes of data (zstd rust !)
34 transferred * bytes in * seconds (*/sec) (glob)
35 transferred * bytes in * seconds (*/sec) (glob)
35 updating to branch default
36 updating to branch default
36 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 $ hg verify -R copy -q
38 $ hg verify -R copy -q
38 #endif
39 #endif
39
40
40 try to clone via stream, should use pull instead
41 try to clone via stream, should use pull instead
41
42
42 $ hg clone --stream http://localhost:$HGPORT1/ copy2
43 $ hg clone --stream http://localhost:$HGPORT1/ copy2
43 warning: stream clone requested but server has them disabled
44 warning: stream clone requested but server has them disabled
44 requesting all changes
45 requesting all changes
45 adding changesets
46 adding changesets
46 adding manifests
47 adding manifests
47 adding file changes
48 adding file changes
48 added 1 changesets with 4 changes to 4 files
49 added 1 changesets with 4 changes to 4 files
49 new changesets 8b6053c928fe
50 new changesets 8b6053c928fe
50 updating to branch default
51 updating to branch default
51 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
52
53
53 try to clone via stream but missing requirements, so should use pull instead
54 try to clone via stream but missing requirements, so should use pull instead
54
55
55 $ cat > $TESTTMP/removesupportedformat.py << EOF
56 $ cat > $TESTTMP/removesupportedformat.py << EOF
56 > from mercurial import localrepo
57 > from mercurial import localrepo
57 > def reposetup(ui, repo):
58 > def reposetup(ui, repo):
58 > local = repo.local()
59 > local = repo.local()
59 > if local is not None:
60 > if local is not None:
60 > local.supported.remove(b'generaldelta')
61 > local.supported.remove(b'generaldelta')
61 > EOF
62 > EOF
62
63
63 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
64 $ hg clone --config extensions.rsf=$TESTTMP/removesupportedformat.py --stream http://localhost:$HGPORT/ copy3
64 warning: stream clone requested but client is missing requirements: generaldelta
65 warning: stream clone requested but client is missing requirements: generaldelta
65 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
66 (see https://www.mercurial-scm.org/wiki/MissingRequirement for more information)
66 requesting all changes
67 requesting all changes
67 adding changesets
68 adding changesets
68 adding manifests
69 adding manifests
69 adding file changes
70 adding file changes
70 added 1 changesets with 4 changes to 4 files
71 added 1 changesets with 4 changes to 4 files
71 new changesets 8b6053c928fe
72 new changesets 8b6053c928fe
72 updating to branch default
73 updating to branch default
73 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
74
75
75 clone via pull
76 clone via pull
76
77
77 $ hg clone http://localhost:$HGPORT1/ copy-pull
78 $ hg clone http://localhost:$HGPORT1/ copy-pull
78 requesting all changes
79 requesting all changes
79 adding changesets
80 adding changesets
80 adding manifests
81 adding manifests
81 adding file changes
82 adding file changes
82 added 1 changesets with 4 changes to 4 files
83 added 1 changesets with 4 changes to 4 files
83 new changesets 8b6053c928fe
84 new changesets 8b6053c928fe
84 updating to branch default
85 updating to branch default
85 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 $ hg verify -R copy-pull -q
87 $ hg verify -R copy-pull -q
87 $ cd test
88 $ cd test
88 $ echo bar > bar
89 $ echo bar > bar
89 $ hg commit -A -d '1 0' -m 2
90 $ hg commit -A -d '1 0' -m 2
90 adding bar
91 adding bar
91 $ cd ..
92 $ cd ..
92
93
93 clone over http with --update
94 clone over http with --update
94
95
95 $ hg clone http://localhost:$HGPORT1/ updated --update 0
96 $ hg clone http://localhost:$HGPORT1/ updated --update 0
96 requesting all changes
97 requesting all changes
97 adding changesets
98 adding changesets
98 adding manifests
99 adding manifests
99 adding file changes
100 adding file changes
100 added 2 changesets with 5 changes to 5 files
101 added 2 changesets with 5 changes to 5 files
101 new changesets 8b6053c928fe:5fed3813f7f5
102 new changesets 8b6053c928fe:5fed3813f7f5
102 updating to branch default
103 updating to branch default
103 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 $ hg log -r . -R updated
105 $ hg log -r . -R updated
105 changeset: 0:8b6053c928fe
106 changeset: 0:8b6053c928fe
106 user: test
107 user: test
107 date: Thu Jan 01 00:00:00 1970 +0000
108 date: Thu Jan 01 00:00:00 1970 +0000
108 summary: 1
109 summary: 1
109
110
110 $ rm -rf updated
111 $ rm -rf updated
111
112
112 incoming via HTTP
113 incoming via HTTP
113
114
114 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
115 $ hg clone http://localhost:$HGPORT1/ --rev 0 partial
115 adding changesets
116 adding changesets
116 adding manifests
117 adding manifests
117 adding file changes
118 adding file changes
118 added 1 changesets with 4 changes to 4 files
119 added 1 changesets with 4 changes to 4 files
119 new changesets 8b6053c928fe
120 new changesets 8b6053c928fe
120 updating to branch default
121 updating to branch default
121 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 $ cd partial
123 $ cd partial
123 $ touch LOCAL
124 $ touch LOCAL
124 $ hg ci -qAm LOCAL
125 $ hg ci -qAm LOCAL
125 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
126 $ hg incoming http://localhost:$HGPORT1/ --template '{desc}\n'
126 comparing with http://localhost:$HGPORT1/
127 comparing with http://localhost:$HGPORT1/
127 searching for changes
128 searching for changes
128 2
129 2
129 $ cd ..
130 $ cd ..
130
131
131 pull
132 pull
132
133
133 $ cd copy-pull
134 $ cd copy-pull
134 $ cat >> .hg/hgrc <<EOF
135 $ cat >> .hg/hgrc <<EOF
135 > [hooks]
136 > [hooks]
136 > changegroup = sh -c "printenv.py --line changegroup"
137 > changegroup = sh -c "printenv.py --line changegroup"
137 > EOF
138 > EOF
138 $ hg pull
139 $ hg pull
139 pulling from http://localhost:$HGPORT1/
140 pulling from http://localhost:$HGPORT1/
140 searching for changes
141 searching for changes
141 adding changesets
142 adding changesets
142 adding manifests
143 adding manifests
143 adding file changes
144 adding file changes
144 added 1 changesets with 1 changes to 1 files
145 added 1 changesets with 1 changes to 1 files
145 new changesets 5fed3813f7f5
146 new changesets 5fed3813f7f5
146 changegroup hook: HG_HOOKNAME=changegroup
147 changegroup hook: HG_HOOKNAME=changegroup
147 HG_HOOKTYPE=changegroup
148 HG_HOOKTYPE=changegroup
148 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
149 HG_NODE=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
149 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
150 HG_NODE_LAST=5fed3813f7f5e1824344fdc9cf8f63bb662c292d
150 HG_SOURCE=pull
151 HG_SOURCE=pull
151 HG_TXNID=TXN:$ID$
152 HG_TXNID=TXN:$ID$
152 HG_TXNNAME=pull
153 HG_TXNNAME=pull
153 http://localhost:$HGPORT1/
154 http://localhost:$HGPORT1/
154 HG_URL=http://localhost:$HGPORT1/
155 HG_URL=http://localhost:$HGPORT1/
155
156
156 (run 'hg update' to get a working copy)
157 (run 'hg update' to get a working copy)
157 $ cd ..
158 $ cd ..
158
159
159 clone from invalid URL
160 clone from invalid URL
160
161
161 $ hg clone http://localhost:$HGPORT/bad
162 $ hg clone http://localhost:$HGPORT/bad
162 abort: HTTP Error 404: Not Found
163 abort: HTTP Error 404: Not Found
163 [100]
164 [100]
164
165
165 test http authentication
166 test http authentication
166 + use the same server to test server side streaming preference
167 + use the same server to test server side streaming preference
167
168
168 $ cd test
169 $ cd test
169
170
170 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -p $HGPORT2 -d \
171 $ hg serve --config extensions.x=$TESTDIR/httpserverauth.py -p $HGPORT2 -d \
171 > --pid-file=pid --config server.preferuncompressed=True -E ../errors2.log \
172 > --pid-file=pid --config server.preferuncompressed=True -E ../errors2.log \
172 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
173 > --config web.push_ssl=False --config web.allow_push=* -A ../access.log
173 $ cat pid >> $DAEMON_PIDS
174 $ cat pid >> $DAEMON_PIDS
174
175
175 $ cat << EOF > get_pass.py
176 $ cat << EOF > get_pass.py
176 > from mercurial import util
177 > from mercurial import util
177 > def newgetpass():
178 > def newgetpass():
178 > return "pass"
179 > return "pass"
179 > util.get_password = newgetpass
180 > util.get_password = newgetpass
180 > EOF
181 > EOF
181
182
182 $ hg id http://localhost:$HGPORT2/
183 $ hg id http://localhost:$HGPORT2/
183 abort: http authorization required for http://localhost:$HGPORT2/
184 abort: http authorization required for http://localhost:$HGPORT2/
184 [255]
185 [255]
185 $ hg id http://localhost:$HGPORT2/
186 $ hg id http://localhost:$HGPORT2/
186 abort: http authorization required for http://localhost:$HGPORT2/
187 abort: http authorization required for http://localhost:$HGPORT2/
187 [255]
188 [255]
188 $ hg id --config ui.interactive=true --debug http://localhost:$HGPORT2/
189 $ hg id --config ui.interactive=true --debug http://localhost:$HGPORT2/
189 using http://localhost:$HGPORT2/
190 using http://localhost:$HGPORT2/
190 sending capabilities command
191 sending capabilities command
191 http authorization required for http://localhost:$HGPORT2/
192 http authorization required for http://localhost:$HGPORT2/
192 realm: mercurial
193 realm: mercurial
193 user: abort: response expected
194 user: abort: response expected
194 [255]
195 [255]
195 $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/
196 $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/
196 >
197 >
197 > EOF
198 > EOF
198 using http://localhost:$HGPORT2/
199 using http://localhost:$HGPORT2/
199 sending capabilities command
200 sending capabilities command
200 http authorization required for http://localhost:$HGPORT2/
201 http authorization required for http://localhost:$HGPORT2/
201 realm: mercurial
202 realm: mercurial
202 user:
203 user:
203 password: abort: response expected
204 password: abort: response expected
204 [255]
205 [255]
205 $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/
206 $ cat <<'EOF' | hg id --config ui.interactive=true --config ui.nontty=true --debug http://localhost:$HGPORT2/
206 >
207 >
207 >
208 >
208 > EOF
209 > EOF
209 using http://localhost:$HGPORT2/
210 using http://localhost:$HGPORT2/
210 sending capabilities command
211 sending capabilities command
211 http authorization required for http://localhost:$HGPORT2/
212 http authorization required for http://localhost:$HGPORT2/
212 realm: mercurial
213 realm: mercurial
213 user:
214 user:
214 password: abort: authorization failed
215 password: abort: authorization failed
215 [255]
216 [255]
216 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
217 $ hg id --config ui.interactive=true --config extensions.getpass=get_pass.py http://user@localhost:$HGPORT2/
217 http authorization required for http://localhost:$HGPORT2/
218 http authorization required for http://localhost:$HGPORT2/
218 realm: mercurial
219 realm: mercurial
219 user: user
220 user: user
220 password: 5fed3813f7f5
221 password: 5fed3813f7f5
221 $ hg id http://user:pass@localhost:$HGPORT2/
222 $ hg id http://user:pass@localhost:$HGPORT2/
222 5fed3813f7f5
223 5fed3813f7f5
223 $ echo '[auth]' >> .hg/hgrc
224 $ echo '[auth]' >> .hg/hgrc
224 $ echo 'l.schemes=http' >> .hg/hgrc
225 $ echo 'l.schemes=http' >> .hg/hgrc
225 $ echo 'l.prefix=lo' >> .hg/hgrc
226 $ echo 'l.prefix=lo' >> .hg/hgrc
226 $ echo 'l.username=user' >> .hg/hgrc
227 $ echo 'l.username=user' >> .hg/hgrc
227 $ echo 'l.password=pass' >> .hg/hgrc
228 $ echo 'l.password=pass' >> .hg/hgrc
228 $ hg id http://localhost:$HGPORT2/
229 $ hg id http://localhost:$HGPORT2/
229 5fed3813f7f5
230 5fed3813f7f5
230 $ hg id http://localhost:$HGPORT2/
231 $ hg id http://localhost:$HGPORT2/
231 5fed3813f7f5
232 5fed3813f7f5
232 $ hg id http://user@localhost:$HGPORT2/
233 $ hg id http://user@localhost:$HGPORT2/
233 5fed3813f7f5
234 5fed3813f7f5
234
235
235 $ cat > use_digests.py << EOF
236 $ cat > use_digests.py << EOF
236 > from mercurial import (
237 > from mercurial import (
237 > exthelper,
238 > exthelper,
238 > url,
239 > url,
239 > )
240 > )
240 >
241 >
241 > eh = exthelper.exthelper()
242 > eh = exthelper.exthelper()
242 > uisetup = eh.finaluisetup
243 > uisetup = eh.finaluisetup
243 >
244 >
244 > @eh.wrapfunction(url, 'opener')
245 > @eh.wrapfunction(url, 'opener')
245 > def urlopener(orig, *args, **kwargs):
246 > def urlopener(orig, *args, **kwargs):
246 > opener = orig(*args, **kwargs)
247 > opener = orig(*args, **kwargs)
247 > opener.addheaders.append((r'X-HgTest-AuthType', r'Digest'))
248 > opener.addheaders.append((r'X-HgTest-AuthType', r'Digest'))
248 > return opener
249 > return opener
249 > EOF
250 > EOF
250
251
251 $ hg id http://localhost:$HGPORT2/ --config extensions.x=use_digests.py
252 $ hg id http://localhost:$HGPORT2/ --config extensions.x=use_digests.py
252 5fed3813f7f5
253 5fed3813f7f5
253
254
254 #if no-reposimplestore
255 #if no-reposimplestore
255 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
256 $ hg clone http://user:pass@localhost:$HGPORT2/ dest 2>&1
256 streaming all changes
257 streaming all changes
257 10 files to transfer, 1.01 KB of data
258 11 files to transfer, 1.01 KB of data (no-rust !)
259 13 files to transfer, 1.13 KB of data (rust !)
258 transferred * KB in * seconds (*/sec) (glob)
260 transferred * KB in * seconds (*/sec) (glob)
259 updating to branch default
261 updating to branch default
260 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
262 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
261 #endif
263 #endif
262
264
263 --pull should override server's preferuncompressed
265 --pull should override server's preferuncompressed
264 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
266 $ hg clone --pull http://user:pass@localhost:$HGPORT2/ dest-pull 2>&1
265 requesting all changes
267 requesting all changes
266 adding changesets
268 adding changesets
267 adding manifests
269 adding manifests
268 adding file changes
270 adding file changes
269 added 2 changesets with 5 changes to 5 files
271 added 2 changesets with 5 changes to 5 files
270 new changesets 8b6053c928fe:5fed3813f7f5
272 new changesets 8b6053c928fe:5fed3813f7f5
271 updating to branch default
273 updating to branch default
272 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
273
275
274 $ hg id http://user2@localhost:$HGPORT2/
276 $ hg id http://user2@localhost:$HGPORT2/
275 abort: http authorization required for http://localhost:$HGPORT2/
277 abort: http authorization required for http://localhost:$HGPORT2/
276 [255]
278 [255]
277 $ hg id http://user:pass2@localhost:$HGPORT2/
279 $ hg id http://user:pass2@localhost:$HGPORT2/
278 abort: HTTP Error 403: no
280 abort: HTTP Error 403: no
279 [100]
281 [100]
280
282
281 $ hg -R dest-pull tag -r tip top
283 $ hg -R dest-pull tag -r tip top
282 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
284 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/
283 pushing to http://user:***@localhost:$HGPORT2/
285 pushing to http://user:***@localhost:$HGPORT2/
284 searching for changes
286 searching for changes
285 remote: adding changesets
287 remote: adding changesets
286 remote: adding manifests
288 remote: adding manifests
287 remote: adding file changes
289 remote: adding file changes
288 remote: added 1 changesets with 1 changes to 1 files
290 remote: added 1 changesets with 1 changes to 1 files
289 $ hg rollback -q
291 $ hg rollback -q
290 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes
292 $ hg -R dest-pull push http://user:pass@localhost:$HGPORT2/ --debug --config devel.debug.peer-request=yes
291 pushing to http://user:***@localhost:$HGPORT2/
293 pushing to http://user:***@localhost:$HGPORT2/
292 using http://localhost:$HGPORT2/
294 using http://localhost:$HGPORT2/
293 http auth: user user, password ****
295 http auth: user user, password ****
294 sending capabilities command
296 sending capabilities command
295 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
297 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=capabilities
296 http auth: user user, password ****
298 http auth: user user, password ****
297 devel-peer-request: finished in *.???? seconds (200) (glob)
299 devel-peer-request: finished in *.???? seconds (200) (glob)
298 query 1; heads
300 query 1; heads
299 devel-peer-request: batched-content
301 devel-peer-request: batched-content
300 devel-peer-request: - heads (0 arguments)
302 devel-peer-request: - heads (0 arguments)
301 devel-peer-request: - known (1 arguments)
303 devel-peer-request: - known (1 arguments)
302 sending batch command
304 sending batch command
303 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
305 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=batch
304 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
306 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
305 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
307 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
306 devel-peer-request: 68 bytes of commands arguments in headers
308 devel-peer-request: 68 bytes of commands arguments in headers
307 devel-peer-request: finished in *.???? seconds (200) (glob)
309 devel-peer-request: finished in *.???? seconds (200) (glob)
308 searching for changes
310 searching for changes
309 all remote heads known locally
311 all remote heads known locally
310 preparing listkeys for "phases"
312 preparing listkeys for "phases"
311 sending listkeys command
313 sending listkeys command
312 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
314 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
313 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
315 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
314 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
316 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
315 devel-peer-request: 16 bytes of commands arguments in headers
317 devel-peer-request: 16 bytes of commands arguments in headers
316 devel-peer-request: finished in *.???? seconds (200) (glob)
318 devel-peer-request: finished in *.???? seconds (200) (glob)
317 received listkey for "phases": 58 bytes
319 received listkey for "phases": 58 bytes
318 checking for updated bookmarks
320 checking for updated bookmarks
319 preparing listkeys for "bookmarks"
321 preparing listkeys for "bookmarks"
320 sending listkeys command
322 sending listkeys command
321 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
323 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
322 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
324 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
323 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
325 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
324 devel-peer-request: 19 bytes of commands arguments in headers
326 devel-peer-request: 19 bytes of commands arguments in headers
325 devel-peer-request: finished in *.???? seconds (200) (glob)
327 devel-peer-request: finished in *.???? seconds (200) (glob)
326 received listkey for "bookmarks": 0 bytes
328 received listkey for "bookmarks": 0 bytes
327 sending branchmap command
329 sending branchmap command
328 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
330 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=branchmap
329 devel-peer-request: Vary X-HgProto-1
331 devel-peer-request: Vary X-HgProto-1
330 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
332 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
331 devel-peer-request: finished in *.???? seconds (200) (glob)
333 devel-peer-request: finished in *.???? seconds (200) (glob)
332 preparing listkeys for "bookmarks"
334 preparing listkeys for "bookmarks"
333 sending listkeys command
335 sending listkeys command
334 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
336 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
335 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
337 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
336 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
338 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
337 devel-peer-request: 19 bytes of commands arguments in headers
339 devel-peer-request: 19 bytes of commands arguments in headers
338 devel-peer-request: finished in *.???? seconds (200) (glob)
340 devel-peer-request: finished in *.???? seconds (200) (glob)
339 received listkey for "bookmarks": 0 bytes
341 received listkey for "bookmarks": 0 bytes
340 1 changesets found
342 1 changesets found
341 list of changesets:
343 list of changesets:
342 7f4e523d01f2cc3765ac8934da3d14db775ff872
344 7f4e523d01f2cc3765ac8934da3d14db775ff872
343 bundle2-output-bundle: "HG20", 5 parts total
345 bundle2-output-bundle: "HG20", 5 parts total
344 bundle2-output-part: "replycaps" 210 bytes payload
346 bundle2-output-part: "replycaps" 210 bytes payload
345 bundle2-output-part: "check:phases" 24 bytes payload
347 bundle2-output-part: "check:phases" 24 bytes payload
346 bundle2-output-part: "check:updated-heads" streamed payload
348 bundle2-output-part: "check:updated-heads" streamed payload
347 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
349 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
348 bundle2-output-part: "phase-heads" 24 bytes payload
350 bundle2-output-part: "phase-heads" 24 bytes payload
349 sending unbundle command
351 sending unbundle command
350 sending 1036 bytes
352 sending 1036 bytes
351 devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle
353 devel-peer-request: POST http://localhost:$HGPORT2/?cmd=unbundle
352 devel-peer-request: Content-length 1036
354 devel-peer-request: Content-length 1036
353 devel-peer-request: Content-type application/mercurial-0.1
355 devel-peer-request: Content-type application/mercurial-0.1
354 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
356 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
355 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
357 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
356 devel-peer-request: 16 bytes of commands arguments in headers
358 devel-peer-request: 16 bytes of commands arguments in headers
357 devel-peer-request: 1036 bytes of data
359 devel-peer-request: 1036 bytes of data
358 devel-peer-request: finished in *.???? seconds (200) (glob)
360 devel-peer-request: finished in *.???? seconds (200) (glob)
359 bundle2-input-bundle: no-transaction
361 bundle2-input-bundle: no-transaction
360 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
362 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
361 bundle2-input-part: "output" (advisory) (params: 0 advisory) supported
363 bundle2-input-part: "output" (advisory) (params: 0 advisory) supported
362 bundle2-input-part: total payload size 55
364 bundle2-input-part: total payload size 55
363 remote: adding changesets
365 remote: adding changesets
364 remote: adding manifests
366 remote: adding manifests
365 remote: adding file changes
367 remote: adding file changes
366 bundle2-input-part: "output" (advisory) supported
368 bundle2-input-part: "output" (advisory) supported
367 bundle2-input-part: total payload size 45
369 bundle2-input-part: total payload size 45
368 remote: added 1 changesets with 1 changes to 1 files
370 remote: added 1 changesets with 1 changes to 1 files
369 bundle2-input-bundle: 3 parts total
371 bundle2-input-bundle: 3 parts total
370 preparing listkeys for "phases"
372 preparing listkeys for "phases"
371 sending listkeys command
373 sending listkeys command
372 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
374 devel-peer-request: GET http://localhost:$HGPORT2/?cmd=listkeys
373 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
375 devel-peer-request: Vary X-HgArg-1,X-HgProto-1
374 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
376 devel-peer-request: X-hgproto-1 0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
375 devel-peer-request: 16 bytes of commands arguments in headers
377 devel-peer-request: 16 bytes of commands arguments in headers
376 devel-peer-request: finished in *.???? seconds (200) (glob)
378 devel-peer-request: finished in *.???? seconds (200) (glob)
377 received listkey for "phases": 15 bytes
379 received listkey for "phases": 15 bytes
378 (sent 9 HTTP requests and * bytes; received * bytes in responses) (glob) (?)
380 (sent 9 HTTP requests and * bytes; received * bytes in responses) (glob) (?)
379 $ hg rollback -q
381 $ hg rollback -q
380
382
381 $ sed 's/.*] "/"/' < ../access.log
383 $ sed 's/.*] "/"/' < ../access.log
382 "GET /?cmd=capabilities HTTP/1.1" 401 -
384 "GET /?cmd=capabilities HTTP/1.1" 401 -
383 "GET /?cmd=capabilities HTTP/1.1" 401 -
385 "GET /?cmd=capabilities HTTP/1.1" 401 -
384 "GET /?cmd=capabilities HTTP/1.1" 401 -
386 "GET /?cmd=capabilities HTTP/1.1" 401 -
385 "GET /?cmd=capabilities HTTP/1.1" 401 -
387 "GET /?cmd=capabilities HTTP/1.1" 401 -
386 "GET /?cmd=capabilities HTTP/1.1" 401 -
388 "GET /?cmd=capabilities HTTP/1.1" 401 -
387 "GET /?cmd=capabilities HTTP/1.1" 401 -
389 "GET /?cmd=capabilities HTTP/1.1" 401 -
388 "GET /?cmd=capabilities HTTP/1.1" 200 -
390 "GET /?cmd=capabilities HTTP/1.1" 200 -
389 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
391 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
390 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
392 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
391 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
393 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
392 "GET /?cmd=capabilities HTTP/1.1" 401 -
394 "GET /?cmd=capabilities HTTP/1.1" 401 -
393 "GET /?cmd=capabilities HTTP/1.1" 200 -
395 "GET /?cmd=capabilities HTTP/1.1" 200 -
394 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
396 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
395 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
397 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
396 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
398 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
397 "GET /?cmd=capabilities HTTP/1.1" 401 -
399 "GET /?cmd=capabilities HTTP/1.1" 401 -
398 "GET /?cmd=capabilities HTTP/1.1" 200 -
400 "GET /?cmd=capabilities HTTP/1.1" 200 -
399 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
401 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
400 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
402 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
401 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
403 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
402 "GET /?cmd=capabilities HTTP/1.1" 401 -
404 "GET /?cmd=capabilities HTTP/1.1" 401 -
403 "GET /?cmd=capabilities HTTP/1.1" 200 -
405 "GET /?cmd=capabilities HTTP/1.1" 200 -
404 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
406 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
405 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
407 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
406 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
408 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
407 "GET /?cmd=capabilities HTTP/1.1" 401 -
409 "GET /?cmd=capabilities HTTP/1.1" 401 -
408 "GET /?cmd=capabilities HTTP/1.1" 200 -
410 "GET /?cmd=capabilities HTTP/1.1" 200 -
409 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
411 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
410 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
412 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
411 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
413 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
412 "GET /?cmd=capabilities HTTP/1.1" 401 - x-hgtest-authtype:Digest
414 "GET /?cmd=capabilities HTTP/1.1" 401 - x-hgtest-authtype:Digest
413 "GET /?cmd=capabilities HTTP/1.1" 200 - x-hgtest-authtype:Digest
415 "GET /?cmd=capabilities HTTP/1.1" 200 - x-hgtest-authtype:Digest
414 "GET /?cmd=lookup HTTP/1.1" 401 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
416 "GET /?cmd=lookup HTTP/1.1" 401 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
415 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
417 "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=tip x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
416 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
418 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
417 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
419 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=namespaces x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
418 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
420 "GET /?cmd=listkeys HTTP/1.1" 401 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
419 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
421 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull x-hgtest-authtype:Digest
420 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
422 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
421 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
423 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
422 "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$ partial-pull (no-reposimplestore !)
424 "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$ partial-pull (no-reposimplestore !)
423 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
425 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&stream=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull (no-reposimplestore !)
424 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
426 "GET /?cmd=capabilities HTTP/1.1" 401 - (no-reposimplestore !)
425 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
427 "GET /?cmd=capabilities HTTP/1.1" 200 - (no-reposimplestore !)
426 "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$ partial-pull
428 "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$ partial-pull
427 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
429 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=5fed3813f7f5e1824344fdc9cf8f63bb662c292d&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
428 "GET /?cmd=capabilities HTTP/1.1" 401 -
430 "GET /?cmd=capabilities HTTP/1.1" 401 -
429 "GET /?cmd=capabilities HTTP/1.1" 401 -
431 "GET /?cmd=capabilities HTTP/1.1" 401 -
430 "GET /?cmd=capabilities HTTP/1.1" 403 -
432 "GET /?cmd=capabilities HTTP/1.1" 403 -
431 "GET /?cmd=capabilities HTTP/1.1" 401 -
433 "GET /?cmd=capabilities HTTP/1.1" 401 -
432 "GET /?cmd=capabilities HTTP/1.1" 200 -
434 "GET /?cmd=capabilities HTTP/1.1" 200 -
433 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
435 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
434 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
436 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
435 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
437 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
436 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
438 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
437 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
439 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
438 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
440 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365* (glob)
439 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
441 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
440 "GET /?cmd=capabilities HTTP/1.1" 401 -
442 "GET /?cmd=capabilities HTTP/1.1" 401 -
441 "GET /?cmd=capabilities HTTP/1.1" 200 -
443 "GET /?cmd=capabilities HTTP/1.1" 200 -
442 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
444 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D7f4e523d01f2cc3765ac8934da3d14db775ff872 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
443 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
445 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
444 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
446 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
445 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
447 "GET /?cmd=branchmap HTTP/1.1" 200 - x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
446 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
448 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=bookmarks x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
447 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
449 "POST /?cmd=unbundle HTTP/1.1" 200 - x-hgarg-1:heads=666f726365 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
448 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
450 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
449
451
450 $ cd ..
452 $ cd ..
451
453
452 clone of serve with repo in root and unserved subrepo (issue2970)
454 clone of serve with repo in root and unserved subrepo (issue2970)
453
455
454 $ hg --cwd test init sub
456 $ hg --cwd test init sub
455 $ echo empty > test/sub/empty
457 $ echo empty > test/sub/empty
456 $ hg --cwd test/sub add empty
458 $ hg --cwd test/sub add empty
457 $ hg --cwd test/sub commit -qm 'add empty'
459 $ hg --cwd test/sub commit -qm 'add empty'
458 $ hg --cwd test/sub tag -r 0 something
460 $ hg --cwd test/sub tag -r 0 something
459 $ echo sub = sub > test/.hgsub
461 $ echo sub = sub > test/.hgsub
460 $ hg --cwd test add .hgsub
462 $ hg --cwd test add .hgsub
461 $ hg --cwd test commit -qm 'add subrepo'
463 $ hg --cwd test commit -qm 'add subrepo'
462 $ hg clone http://localhost:$HGPORT noslash-clone
464 $ hg clone http://localhost:$HGPORT noslash-clone
463 requesting all changes
465 requesting all changes
464 adding changesets
466 adding changesets
465 adding manifests
467 adding manifests
466 adding file changes
468 adding file changes
467 added 3 changesets with 7 changes to 7 files
469 added 3 changesets with 7 changes to 7 files
468 new changesets 8b6053c928fe:56f9bc90cce6
470 new changesets 8b6053c928fe:56f9bc90cce6
469 updating to branch default
471 updating to branch default
470 cloning subrepo sub from http://localhost:$HGPORT/sub
472 cloning subrepo sub from http://localhost:$HGPORT/sub
471 abort: HTTP Error 404: Not Found
473 abort: HTTP Error 404: Not Found
472 [100]
474 [100]
473 $ hg clone http://localhost:$HGPORT/ slash-clone
475 $ hg clone http://localhost:$HGPORT/ slash-clone
474 requesting all changes
476 requesting all changes
475 adding changesets
477 adding changesets
476 adding manifests
478 adding manifests
477 adding file changes
479 adding file changes
478 added 3 changesets with 7 changes to 7 files
480 added 3 changesets with 7 changes to 7 files
479 new changesets 8b6053c928fe:56f9bc90cce6
481 new changesets 8b6053c928fe:56f9bc90cce6
480 updating to branch default
482 updating to branch default
481 cloning subrepo sub from http://localhost:$HGPORT/sub
483 cloning subrepo sub from http://localhost:$HGPORT/sub
482 abort: HTTP Error 404: Not Found
484 abort: HTTP Error 404: Not Found
483 [100]
485 [100]
484
486
485 check error log
487 check error log
486
488
487 $ cat error.log
489 $ cat error.log
488
490
489 $ cat errors2.log
491 $ cat errors2.log
490
492
491 check abort error reporting while pulling/cloning
493 check abort error reporting while pulling/cloning
492
494
493 $ $RUNTESTDIR/killdaemons.py
495 $ $RUNTESTDIR/killdaemons.py
494 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
496 $ hg serve -R test -p $HGPORT -d --pid-file=hg3.pid -E error.log --config extensions.crash=${TESTDIR}/crashgetbundler.py
495 $ cat hg3.pid >> $DAEMON_PIDS
497 $ cat hg3.pid >> $DAEMON_PIDS
496 $ hg clone http://localhost:$HGPORT/ abort-clone
498 $ hg clone http://localhost:$HGPORT/ abort-clone
497 requesting all changes
499 requesting all changes
498 remote: abort: this is an exercise
500 remote: abort: this is an exercise
499 abort: pull failed on remote
501 abort: pull failed on remote
500 [100]
502 [100]
501 $ cat error.log
503 $ cat error.log
502
504
503 disable pull-based clones
505 disable pull-based clones
504
506
505 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
507 $ hg serve -R test -p $HGPORT1 -d --pid-file=hg4.pid -E error.log --config server.disablefullbundle=True
506 $ cat hg4.pid >> $DAEMON_PIDS
508 $ cat hg4.pid >> $DAEMON_PIDS
507 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
509 $ hg clone http://localhost:$HGPORT1/ disable-pull-clone
508 requesting all changes
510 requesting all changes
509 remote: abort: server has pull-based clones disabled
511 remote: abort: server has pull-based clones disabled
510 abort: pull failed on remote
512 abort: pull failed on remote
511 (remove --pull if specified or upgrade Mercurial)
513 (remove --pull if specified or upgrade Mercurial)
512 [100]
514 [100]
513
515
514 #if no-reposimplestore
516 #if no-reposimplestore
515 ... but keep stream clones working
517 ... but keep stream clones working
516
518
517 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
519 $ hg clone --stream --noupdate http://localhost:$HGPORT1/ test-stream-clone
518 streaming all changes
520 streaming all changes
519 * files to transfer, * of data (glob)
521 * files to transfer, * of data (glob)
520 transferred * in * seconds (*/sec) (glob)
522 transferred * in * seconds (*/sec) (glob)
521 $ cat error.log
523 $ cat error.log
522 #endif
524 #endif
523
525
524 ... and also keep partial clones and pulls working
526 ... and also keep partial clones and pulls working
525 $ hg clone http://localhost:$HGPORT1 --rev 0 test/partial/clone
527 $ hg clone http://localhost:$HGPORT1 --rev 0 test/partial/clone
526 adding changesets
528 adding changesets
527 adding manifests
529 adding manifests
528 adding file changes
530 adding file changes
529 added 1 changesets with 4 changes to 4 files
531 added 1 changesets with 4 changes to 4 files
530 new changesets 8b6053c928fe
532 new changesets 8b6053c928fe
531 updating to branch default
533 updating to branch default
532 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
534 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
533 $ hg pull -R test/partial/clone
535 $ hg pull -R test/partial/clone
534 pulling from http://localhost:$HGPORT1/
536 pulling from http://localhost:$HGPORT1/
535 searching for changes
537 searching for changes
536 adding changesets
538 adding changesets
537 adding manifests
539 adding manifests
538 adding file changes
540 adding file changes
539 added 2 changesets with 3 changes to 3 files
541 added 2 changesets with 3 changes to 3 files
540 new changesets 5fed3813f7f5:56f9bc90cce6
542 new changesets 5fed3813f7f5:56f9bc90cce6
541 (run 'hg update' to get a working copy)
543 (run 'hg update' to get a working copy)
542
544
543 $ hg clone -U -r 0 test/partial/clone test/another/clone
545 $ hg clone -U -r 0 test/partial/clone test/another/clone
544 adding changesets
546 adding changesets
545 adding manifests
547 adding manifests
546 adding file changes
548 adding file changes
547 added 1 changesets with 4 changes to 4 files
549 added 1 changesets with 4 changes to 4 files
548 new changesets 8b6053c928fe
550 new changesets 8b6053c928fe
549
551
550 corrupt cookies file should yield a warning
552 corrupt cookies file should yield a warning
551
553
552 $ cat > $TESTTMP/cookies.txt << EOF
554 $ cat > $TESTTMP/cookies.txt << EOF
553 > bad format
555 > bad format
554 > EOF
556 > EOF
555
557
556 $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/
558 $ hg --config auth.cookiefile=$TESTTMP/cookies.txt id http://localhost:$HGPORT/
557 (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob)
559 (error loading cookie file $TESTTMP/cookies.txt: '*/cookies.txt' does not look like a Netscape format cookies file; continuing without cookies) (glob)
558 56f9bc90cce6
560 56f9bc90cce6
559
561
560 $ killdaemons.py
562 $ killdaemons.py
561
563
562 Create dummy authentication handler that looks for cookies. It doesn't do anything
564 Create dummy authentication handler that looks for cookies. It doesn't do anything
563 useful. It just raises an HTTP 500 with details about the Cookie request header.
565 useful. It just raises an HTTP 500 with details about the Cookie request header.
564 We raise HTTP 500 because its message is printed in the abort message.
566 We raise HTTP 500 because its message is printed in the abort message.
565
567
566 $ cat > cookieauth.py << EOF
568 $ cat > cookieauth.py << EOF
567 > from mercurial import util
569 > from mercurial import util
568 > from mercurial.hgweb import common
570 > from mercurial.hgweb import common
569 > def perform_authentication(hgweb, req, op):
571 > def perform_authentication(hgweb, req, op):
570 > cookie = req.headers.get(b'Cookie')
572 > cookie = req.headers.get(b'Cookie')
571 > if not cookie:
573 > if not cookie:
572 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
574 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'no-cookie')
573 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie)
575 > raise common.ErrorResponse(common.HTTP_SERVER_ERROR, b'Cookie: %s' % cookie)
574 > def extsetup(ui):
576 > def extsetup(ui):
575 > common.permhooks.insert(0, perform_authentication)
577 > common.permhooks.insert(0, perform_authentication)
576 > EOF
578 > EOF
577
579
578 $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid
580 $ hg serve --config extensions.cookieauth=cookieauth.py -R test -p $HGPORT -d --pid-file=pid
579 $ cat pid > $DAEMON_PIDS
581 $ cat pid > $DAEMON_PIDS
580
582
581 Request without cookie sent should fail due to lack of cookie
583 Request without cookie sent should fail due to lack of cookie
582
584
583 $ hg id http://localhost:$HGPORT
585 $ hg id http://localhost:$HGPORT
584 abort: HTTP Error 500: no-cookie
586 abort: HTTP Error 500: no-cookie
585 [100]
587 [100]
586
588
587 Populate a cookies file
589 Populate a cookies file
588
590
589 $ cat > cookies.txt << EOF
591 $ cat > cookies.txt << EOF
590 > # HTTP Cookie File
592 > # HTTP Cookie File
591 > # Expiration is 2030-01-01 at midnight
593 > # Expiration is 2030-01-01 at midnight
592 > .example.com TRUE / FALSE 1893456000 hgkey examplevalue
594 > .example.com TRUE / FALSE 1893456000 hgkey examplevalue
593 > EOF
595 > EOF
594
596
595 Should not send a cookie for another domain
597 Should not send a cookie for another domain
596
598
597 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
599 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
598 abort: HTTP Error 500: no-cookie
600 abort: HTTP Error 500: no-cookie
599 [100]
601 [100]
600
602
601 Add a cookie entry for our test server and verify it is sent
603 Add a cookie entry for our test server and verify it is sent
602
604
603 $ cat >> cookies.txt << EOF
605 $ cat >> cookies.txt << EOF
604 > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue
606 > localhost.local FALSE / FALSE 1893456000 hgkey localhostvalue
605 > EOF
607 > EOF
606
608
607 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
609 $ hg --config auth.cookiefile=cookies.txt id http://localhost:$HGPORT/
608 abort: HTTP Error 500: Cookie: hgkey=localhostvalue
610 abort: HTTP Error 500: Cookie: hgkey=localhostvalue
609 [100]
611 [100]
@@ -1,180 +1,186 b''
1 #require unix-permissions
1 #require unix-permissions
2
2
3 test that new files created in .hg inherit the permissions from .hg/store
3 test that new files created in .hg inherit the permissions from .hg/store
4
4
5 $ mkdir dir
5 $ mkdir dir
6
6
7 just in case somebody has a strange $TMPDIR
7 just in case somebody has a strange $TMPDIR
8
8
9 $ chmod g-s dir
9 $ chmod g-s dir
10 $ cd dir
10 $ cd dir
11
11
12 $ cat >printmodes.py <<EOF
12 $ cat >printmodes.py <<EOF
13 > import os
13 > import os
14 > import sys
14 > import sys
15 >
15 >
16 > allnames = []
16 > allnames = []
17 > isdir = {}
17 > isdir = {}
18 > for root, dirs, files in os.walk(sys.argv[1]):
18 > for root, dirs, files in os.walk(sys.argv[1]):
19 > for d in dirs:
19 > for d in dirs:
20 > name = os.path.join(root, d)
20 > name = os.path.join(root, d)
21 > isdir[name] = 1
21 > isdir[name] = 1
22 > allnames.append(name)
22 > allnames.append(name)
23 > for f in files:
23 > for f in files:
24 > name = os.path.join(root, f)
24 > name = os.path.join(root, f)
25 > allnames.append(name)
25 > allnames.append(name)
26 > allnames.sort()
26 > allnames.sort()
27 > for name in allnames:
27 > for name in allnames:
28 > suffix = name in isdir and '/' or ''
28 > suffix = name in isdir and '/' or ''
29 > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix))
29 > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix))
30 > EOF
30 > EOF
31
31
32 $ cat >mode.py <<EOF
32 $ cat >mode.py <<EOF
33 > import os
33 > import os
34 > import sys
34 > import sys
35 > print('%05o' % os.lstat(sys.argv[1]).st_mode)
35 > print('%05o' % os.lstat(sys.argv[1]).st_mode)
36 > EOF
36 > EOF
37
37
38 $ umask 077
38 $ umask 077
39
39
40 $ hg init repo
40 $ hg init repo
41 $ cd repo
41 $ cd repo
42
42
43 $ chmod 0770 .hg/store .hg/cache .hg/wcache
43 $ chmod 0770 .hg/store .hg/cache .hg/wcache
44
44
45 before commit
45 before commit
46 store can be written by the group, other files cannot
46 store can be written by the group, other files cannot
47 store is setgid
47 store is setgid
48
48
49 $ "$PYTHON" ../printmodes.py .
49 $ "$PYTHON" ../printmodes.py .
50 00700 ./.hg/
50 00700 ./.hg/
51 00600 ./.hg/00changelog.i
51 00600 ./.hg/00changelog.i
52 00770 ./.hg/cache/
52 00770 ./.hg/cache/
53 00600 ./.hg/requires
53 00600 ./.hg/requires
54 00770 ./.hg/store/
54 00770 ./.hg/store/
55 00600 ./.hg/store/requires
55 00600 ./.hg/store/requires
56 00770 ./.hg/wcache/
56 00770 ./.hg/wcache/
57
57
58 $ mkdir dir
58 $ mkdir dir
59 $ touch foo dir/bar
59 $ touch foo dir/bar
60 $ hg ci -qAm 'add files'
60 $ hg ci -qAm 'add files'
61
61
62 after commit
62 after commit
63 working dir files can only be written by the owner
63 working dir files can only be written by the owner
64 files created in .hg can be written by the group
64 files created in .hg can be written by the group
65 (in particular, store/**, dirstate, branch cache file, undo files)
65 (in particular, store/**, dirstate, branch cache file, undo files)
66 new directories are setgid
66 new directories are setgid
67
67
68 $ "$PYTHON" ../printmodes.py .
68 $ "$PYTHON" ../printmodes.py .
69 00700 ./.hg/
69 00700 ./.hg/
70 00600 ./.hg/00changelog.i
70 00600 ./.hg/00changelog.i
71 00660 ./.hg/branch
71 00660 ./.hg/branch
72 00770 ./.hg/cache/
72 00770 ./.hg/cache/
73 00660 ./.hg/cache/branch2-served
73 00660 ./.hg/cache/branch2-served
74 00660 ./.hg/cache/rbc-names-v1
74 00660 ./.hg/cache/rbc-names-v1
75 00660 ./.hg/cache/rbc-revs-v1
75 00660 ./.hg/cache/rbc-revs-v1
76 00660 ./.hg/dirstate
76 00660 ./.hg/dirstate
77 00660 ./.hg/fsmonitor.state (fsmonitor !)
77 00660 ./.hg/fsmonitor.state (fsmonitor !)
78 00660 ./.hg/last-message.txt
78 00660 ./.hg/last-message.txt
79 00600 ./.hg/requires
79 00600 ./.hg/requires
80 00770 ./.hg/store/
80 00770 ./.hg/store/
81 00660 ./.hg/store/00changelog-150e1cfc.nd (rust !)
82 00660 ./.hg/store/00changelog.d
81 00660 ./.hg/store/00changelog.i
83 00660 ./.hg/store/00changelog.i
84 00660 ./.hg/store/00changelog.n (rust !)
82 00660 ./.hg/store/00manifest.i
85 00660 ./.hg/store/00manifest.i
83 00770 ./.hg/store/data/
86 00770 ./.hg/store/data/
84 00770 ./.hg/store/data/dir/
87 00770 ./.hg/store/data/dir/
85 00660 ./.hg/store/data/dir/bar.i (reporevlogstore !)
88 00660 ./.hg/store/data/dir/bar.i (reporevlogstore !)
86 00660 ./.hg/store/data/foo.i (reporevlogstore !)
89 00660 ./.hg/store/data/foo.i (reporevlogstore !)
87 00770 ./.hg/store/data/dir/bar/ (reposimplestore !)
90 00770 ./.hg/store/data/dir/bar/ (reposimplestore !)
88 00660 ./.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
91 00660 ./.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
89 00660 ./.hg/store/data/dir/bar/index (reposimplestore !)
92 00660 ./.hg/store/data/dir/bar/index (reposimplestore !)
90 00770 ./.hg/store/data/foo/ (reposimplestore !)
93 00770 ./.hg/store/data/foo/ (reposimplestore !)
91 00660 ./.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
94 00660 ./.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
92 00660 ./.hg/store/data/foo/index (reposimplestore !)
95 00660 ./.hg/store/data/foo/index (reposimplestore !)
93 00660 ./.hg/store/fncache (repofncache !)
96 00660 ./.hg/store/fncache (repofncache !)
94 00660 ./.hg/store/phaseroots
97 00660 ./.hg/store/phaseroots
95 00600 ./.hg/store/requires
98 00600 ./.hg/store/requires
96 00660 ./.hg/store/undo
99 00660 ./.hg/store/undo
97 00660 ./.hg/store/undo.backupfiles
100 00660 ./.hg/store/undo.backupfiles
98 00660 ./.hg/undo.backup.branch.bck
101 00660 ./.hg/undo.backup.branch.bck
99 00660 ./.hg/undo.desc
102 00660 ./.hg/undo.desc
100 00770 ./.hg/wcache/
103 00770 ./.hg/wcache/
101 00711 ./.hg/wcache/checkisexec
104 00711 ./.hg/wcache/checkisexec
102 007.. ./.hg/wcache/checklink (re)
105 007.. ./.hg/wcache/checklink (re)
103 00600 ./.hg/wcache/checklink-target
106 00600 ./.hg/wcache/checklink-target
104 00660 ./.hg/wcache/manifestfulltextcache (reporevlogstore !)
107 00660 ./.hg/wcache/manifestfulltextcache (reporevlogstore !)
105 00700 ./dir/
108 00700 ./dir/
106 00600 ./dir/bar
109 00600 ./dir/bar
107 00600 ./foo
110 00600 ./foo
108
111
109 $ umask 007
112 $ umask 007
110 $ hg init ../push
113 $ hg init ../push
111
114
112 before push
115 before push
113 group can write everything
116 group can write everything
114
117
115 $ "$PYTHON" ../printmodes.py ../push
118 $ "$PYTHON" ../printmodes.py ../push
116 00770 ../push/.hg/
119 00770 ../push/.hg/
117 00660 ../push/.hg/00changelog.i
120 00660 ../push/.hg/00changelog.i
118 00770 ../push/.hg/cache/
121 00770 ../push/.hg/cache/
119 00660 ../push/.hg/requires
122 00660 ../push/.hg/requires
120 00770 ../push/.hg/store/
123 00770 ../push/.hg/store/
121 00660 ../push/.hg/store/requires
124 00660 ../push/.hg/store/requires
122 00770 ../push/.hg/wcache/
125 00770 ../push/.hg/wcache/
123
126
124 $ umask 077
127 $ umask 077
125 $ hg -q push ../push
128 $ hg -q push ../push
126
129
127 after push
130 after push
128 group can still write everything
131 group can still write everything
129
132
130 $ "$PYTHON" ../printmodes.py ../push
133 $ "$PYTHON" ../printmodes.py ../push
131 00770 ../push/.hg/
134 00770 ../push/.hg/
132 00660 ../push/.hg/00changelog.i
135 00660 ../push/.hg/00changelog.i
133 00660 ../push/.hg/branch
136 00660 ../push/.hg/branch
134 00770 ../push/.hg/cache/
137 00770 ../push/.hg/cache/
135 00660 ../push/.hg/cache/branch2-base
138 00660 ../push/.hg/cache/branch2-base
136 00660 ../push/.hg/cache/rbc-names-v1
139 00660 ../push/.hg/cache/rbc-names-v1
137 00660 ../push/.hg/cache/rbc-revs-v1
140 00660 ../push/.hg/cache/rbc-revs-v1
138 00660 ../push/.hg/requires
141 00660 ../push/.hg/requires
139 00770 ../push/.hg/store/
142 00770 ../push/.hg/store/
143 00660 ../push/.hg/store/00changelog-b870a51b.nd (rust !)
144 00660 ../push/.hg/store/00changelog.d
140 00660 ../push/.hg/store/00changelog.i
145 00660 ../push/.hg/store/00changelog.i
146 00660 ../push/.hg/store/00changelog.n (rust !)
141 00660 ../push/.hg/store/00manifest.i
147 00660 ../push/.hg/store/00manifest.i
142 00770 ../push/.hg/store/data/
148 00770 ../push/.hg/store/data/
143 00770 ../push/.hg/store/data/dir/
149 00770 ../push/.hg/store/data/dir/
144 00660 ../push/.hg/store/data/dir/bar.i (reporevlogstore !)
150 00660 ../push/.hg/store/data/dir/bar.i (reporevlogstore !)
145 00660 ../push/.hg/store/data/foo.i (reporevlogstore !)
151 00660 ../push/.hg/store/data/foo.i (reporevlogstore !)
146 00770 ../push/.hg/store/data/dir/bar/ (reposimplestore !)
152 00770 ../push/.hg/store/data/dir/bar/ (reposimplestore !)
147 00660 ../push/.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
153 00660 ../push/.hg/store/data/dir/bar/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
148 00660 ../push/.hg/store/data/dir/bar/index (reposimplestore !)
154 00660 ../push/.hg/store/data/dir/bar/index (reposimplestore !)
149 00770 ../push/.hg/store/data/foo/ (reposimplestore !)
155 00770 ../push/.hg/store/data/foo/ (reposimplestore !)
150 00660 ../push/.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
156 00660 ../push/.hg/store/data/foo/b80de5d138758541c5f05265ad144ab9fa86d1db (reposimplestore !)
151 00660 ../push/.hg/store/data/foo/index (reposimplestore !)
157 00660 ../push/.hg/store/data/foo/index (reposimplestore !)
152 00660 ../push/.hg/store/fncache (repofncache !)
158 00660 ../push/.hg/store/fncache (repofncache !)
153 00660 ../push/.hg/store/requires
159 00660 ../push/.hg/store/requires
154 00660 ../push/.hg/store/undo
160 00660 ../push/.hg/store/undo
155 00660 ../push/.hg/store/undo.backupfiles
161 00660 ../push/.hg/store/undo.backupfiles
156 00660 ../push/.hg/undo.backup.branch.bck
162 00660 ../push/.hg/undo.backup.branch.bck
157 00660 ../push/.hg/undo.desc
163 00660 ../push/.hg/undo.desc
158 00770 ../push/.hg/wcache/
164 00770 ../push/.hg/wcache/
159
165
160
166
161 Test that we don't lose the setgid bit when we call chmod.
167 Test that we don't lose the setgid bit when we call chmod.
162 Not all systems support setgid directories (e.g. HFS+), so
168 Not all systems support setgid directories (e.g. HFS+), so
163 just check that directories have the same mode.
169 just check that directories have the same mode.
164
170
165 $ cd ..
171 $ cd ..
166 $ hg init setgid
172 $ hg init setgid
167 $ cd setgid
173 $ cd setgid
168 $ chmod g+rwx .hg/store
174 $ chmod g+rwx .hg/store
169 $ chmod g+s .hg/store 2> /dev/null || true
175 $ chmod g+s .hg/store 2> /dev/null || true
170 $ mkdir dir
176 $ mkdir dir
171 $ touch dir/file
177 $ touch dir/file
172 $ hg ci -qAm 'add dir/file'
178 $ hg ci -qAm 'add dir/file'
173 $ storemode=`"$PYTHON" ../mode.py .hg/store`
179 $ storemode=`"$PYTHON" ../mode.py .hg/store`
174 $ dirmode=`"$PYTHON" ../mode.py .hg/store/data/dir`
180 $ dirmode=`"$PYTHON" ../mode.py .hg/store/data/dir`
175 $ if [ "$storemode" != "$dirmode" ]; then
181 $ if [ "$storemode" != "$dirmode" ]; then
176 > echo "$storemode != $dirmode"
182 > echo "$storemode != $dirmode"
177 > fi
183 > fi
178 $ cd ..
184 $ cd ..
179
185
180 $ cd .. # g-s dir
186 $ cd .. # g-s dir
@@ -1,611 +1,611 b''
1 ===============================================================
1 ===============================================================
2 Test non-regression on the corruption associated with issue6528
2 Test non-regression on the corruption associated with issue6528
3 ===============================================================
3 ===============================================================
4
4
5 Setup
5 Setup
6 =====
6 =====
7
7
8 $ hg init base-repo
8 $ hg init base-repo
9 $ cd base-repo
9 $ cd base-repo
10
10
11 $ cat <<EOF > a.txt
11 $ cat <<EOF > a.txt
12 > 1
12 > 1
13 > 2
13 > 2
14 > 3
14 > 3
15 > 4
15 > 4
16 > 5
16 > 5
17 > 6
17 > 6
18 > EOF
18 > EOF
19
19
20 $ hg add a.txt
20 $ hg add a.txt
21 $ hg commit -m 'c_base_c - create a.txt'
21 $ hg commit -m 'c_base_c - create a.txt'
22
22
23 Modify a.txt
23 Modify a.txt
24
24
25 $ sed -e 's/1/foo/' a.txt > a.tmp; mv a.tmp a.txt
25 $ sed -e 's/1/foo/' a.txt > a.tmp; mv a.tmp a.txt
26 $ hg commit -m 'c_modify_c - modify a.txt'
26 $ hg commit -m 'c_modify_c - modify a.txt'
27
27
28 Modify and rename a.txt to b.txt
28 Modify and rename a.txt to b.txt
29
29
30 $ hg up -r "desc('c_base_c')"
30 $ hg up -r "desc('c_base_c')"
31 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
32 $ sed -e 's/6/bar/' a.txt > a.tmp; mv a.tmp a.txt
32 $ sed -e 's/6/bar/' a.txt > a.tmp; mv a.tmp a.txt
33 $ hg mv a.txt b.txt
33 $ hg mv a.txt b.txt
34 $ hg commit -m 'c_rename_c - rename and modify a.txt to b.txt'
34 $ hg commit -m 'c_rename_c - rename and modify a.txt to b.txt'
35 created new head
35 created new head
36
36
37 Merge each branch
37 Merge each branch
38
38
39 $ hg merge -r "desc('c_modify_c')"
39 $ hg merge -r "desc('c_modify_c')"
40 merging b.txt and a.txt to b.txt
40 merging b.txt and a.txt to b.txt
41 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
41 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
42 (branch merge, don't forget to commit)
42 (branch merge, don't forget to commit)
43 $ hg commit -m 'c_merge_c: commit merge'
43 $ hg commit -m 'c_merge_c: commit merge'
44
44
45 $ hg debugrevlogindex b.txt
45 $ hg debugrevlogindex b.txt
46 rev linkrev nodeid p1 p2
46 rev linkrev nodeid p1 p2
47 0 2 05b806ebe5ea 000000000000 000000000000
47 0 2 05b806ebe5ea 000000000000 000000000000
48 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
48 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
49
49
50 Check commit Graph
50 Check commit Graph
51
51
52 $ hg log -G
52 $ hg log -G
53 @ changeset: 3:a1cc2bdca0aa
53 @ changeset: 3:a1cc2bdca0aa
54 |\ tag: tip
54 |\ tag: tip
55 | | parent: 2:615c6ccefd15
55 | | parent: 2:615c6ccefd15
56 | | parent: 1:373d507f4667
56 | | parent: 1:373d507f4667
57 | | user: test
57 | | user: test
58 | | date: Thu Jan 01 00:00:00 1970 +0000
58 | | date: Thu Jan 01 00:00:00 1970 +0000
59 | | summary: c_merge_c: commit merge
59 | | summary: c_merge_c: commit merge
60 | |
60 | |
61 | o changeset: 2:615c6ccefd15
61 | o changeset: 2:615c6ccefd15
62 | | parent: 0:f5a5a568022f
62 | | parent: 0:f5a5a568022f
63 | | user: test
63 | | user: test
64 | | date: Thu Jan 01 00:00:00 1970 +0000
64 | | date: Thu Jan 01 00:00:00 1970 +0000
65 | | summary: c_rename_c - rename and modify a.txt to b.txt
65 | | summary: c_rename_c - rename and modify a.txt to b.txt
66 | |
66 | |
67 o | changeset: 1:373d507f4667
67 o | changeset: 1:373d507f4667
68 |/ user: test
68 |/ user: test
69 | date: Thu Jan 01 00:00:00 1970 +0000
69 | date: Thu Jan 01 00:00:00 1970 +0000
70 | summary: c_modify_c - modify a.txt
70 | summary: c_modify_c - modify a.txt
71 |
71 |
72 o changeset: 0:f5a5a568022f
72 o changeset: 0:f5a5a568022f
73 user: test
73 user: test
74 date: Thu Jan 01 00:00:00 1970 +0000
74 date: Thu Jan 01 00:00:00 1970 +0000
75 summary: c_base_c - create a.txt
75 summary: c_base_c - create a.txt
76
76
77
77
78 $ hg cat -r . b.txt
78 $ hg cat -r . b.txt
79 foo
79 foo
80 2
80 2
81 3
81 3
82 4
82 4
83 5
83 5
84 bar
84 bar
85 $ cat b.txt
85 $ cat b.txt
86 foo
86 foo
87 2
87 2
88 3
88 3
89 4
89 4
90 5
90 5
91 bar
91 bar
92 $ cd ..
92 $ cd ..
93
93
94
94
95 Check the lack of corruption
95 Check the lack of corruption
96 ============================
96 ============================
97
97
98 $ hg clone --pull base-repo cloned
98 $ hg clone --pull base-repo cloned
99 requesting all changes
99 requesting all changes
100 adding changesets
100 adding changesets
101 adding manifests
101 adding manifests
102 adding file changes
102 adding file changes
103 added 4 changesets with 4 changes to 2 files
103 added 4 changesets with 4 changes to 2 files
104 new changesets f5a5a568022f:a1cc2bdca0aa
104 new changesets f5a5a568022f:a1cc2bdca0aa
105 updating to branch default
105 updating to branch default
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 $ cd cloned
107 $ cd cloned
108 $ hg up -r "desc('c_merge_c')"
108 $ hg up -r "desc('c_merge_c')"
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
109 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
110
110
111
111
112 Status is buggy, even with debugrebuilddirstate
112 Status is buggy, even with debugrebuilddirstate
113
113
114 $ hg cat -r . b.txt
114 $ hg cat -r . b.txt
115 foo
115 foo
116 2
116 2
117 3
117 3
118 4
118 4
119 5
119 5
120 bar
120 bar
121 $ cat b.txt
121 $ cat b.txt
122 foo
122 foo
123 2
123 2
124 3
124 3
125 4
125 4
126 5
126 5
127 bar
127 bar
128 $ hg status
128 $ hg status
129 $ hg debugrebuilddirstate
129 $ hg debugrebuilddirstate
130 $ hg status
130 $ hg status
131
131
132 the history was altered
132 the history was altered
133
133
134 in theory p1/p2 order does not matter but in practice p1 == nullid is used as a
134 in theory p1/p2 order does not matter but in practice p1 == nullid is used as a
135 marker that some metadata are present and should be fetched.
135 marker that some metadata are present and should be fetched.
136
136
137 $ hg debugrevlogindex b.txt
137 $ hg debugrevlogindex b.txt
138 rev linkrev nodeid p1 p2
138 rev linkrev nodeid p1 p2
139 0 2 05b806ebe5ea 000000000000 000000000000
139 0 2 05b806ebe5ea 000000000000 000000000000
140 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
140 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
141
141
142 Check commit Graph
142 Check commit Graph
143
143
144 $ hg log -G
144 $ hg log -G
145 @ changeset: 3:a1cc2bdca0aa
145 @ changeset: 3:a1cc2bdca0aa
146 |\ tag: tip
146 |\ tag: tip
147 | | parent: 2:615c6ccefd15
147 | | parent: 2:615c6ccefd15
148 | | parent: 1:373d507f4667
148 | | parent: 1:373d507f4667
149 | | user: test
149 | | user: test
150 | | date: Thu Jan 01 00:00:00 1970 +0000
150 | | date: Thu Jan 01 00:00:00 1970 +0000
151 | | summary: c_merge_c: commit merge
151 | | summary: c_merge_c: commit merge
152 | |
152 | |
153 | o changeset: 2:615c6ccefd15
153 | o changeset: 2:615c6ccefd15
154 | | parent: 0:f5a5a568022f
154 | | parent: 0:f5a5a568022f
155 | | user: test
155 | | user: test
156 | | date: Thu Jan 01 00:00:00 1970 +0000
156 | | date: Thu Jan 01 00:00:00 1970 +0000
157 | | summary: c_rename_c - rename and modify a.txt to b.txt
157 | | summary: c_rename_c - rename and modify a.txt to b.txt
158 | |
158 | |
159 o | changeset: 1:373d507f4667
159 o | changeset: 1:373d507f4667
160 |/ user: test
160 |/ user: test
161 | date: Thu Jan 01 00:00:00 1970 +0000
161 | date: Thu Jan 01 00:00:00 1970 +0000
162 | summary: c_modify_c - modify a.txt
162 | summary: c_modify_c - modify a.txt
163 |
163 |
164 o changeset: 0:f5a5a568022f
164 o changeset: 0:f5a5a568022f
165 user: test
165 user: test
166 date: Thu Jan 01 00:00:00 1970 +0000
166 date: Thu Jan 01 00:00:00 1970 +0000
167 summary: c_base_c - create a.txt
167 summary: c_base_c - create a.txt
168
168
169
169
170 Test the command that fixes the issue
170 Test the command that fixes the issue
171 =====================================
171 =====================================
172
172
173 Restore a broken repository with multiple broken revisions and a filename that
173 Restore a broken repository with multiple broken revisions and a filename that
174 would get encoded to test the `report` options.
174 would get encoded to test the `report` options.
175 It's a tarball because unbundle might magically fix the issue later.
175 It's a tarball because unbundle might magically fix the issue later.
176
176
177 $ cd ..
177 $ cd ..
178 $ mkdir repo-to-fix
178 $ mkdir repo-to-fix
179 $ cd repo-to-fix
179 $ cd repo-to-fix
180 $ tar -xf - < "$TESTDIR"/bundles/issue6528.tar
180 $ tar -xf - < "$TESTDIR"/bundles/issue6528.tar
181
181
182 Check that the issue is present
182 Check that the issue is present
183 (It is currently not present with rhg but will be when optimizations are added
183 (It is currently not present with rhg but will be when optimizations are added
184 to resolve ambiguous files at the end of status without reading their content
184 to resolve ambiguous files at the end of status without reading their content
185 if the size differs, and reading the expected size without resolving filelog
185 if the size differs, and reading the expected size without resolving filelog
186 deltas where possible.)
186 deltas where possible.)
187
187
188 $ hg st
188 $ hg st
189 M D.txt
189 M D.txt
190 M b.txt
190 M b.txt
191 $ hg debugrevlogindex b.txt
191 $ hg debugrevlogindex b.txt
192 rev linkrev nodeid p1 p2
192 rev linkrev nodeid p1 p2
193 0 2 05b806ebe5ea 000000000000 000000000000
193 0 2 05b806ebe5ea 000000000000 000000000000
194 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
194 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
195 2 6 216a5fe8b8ed 000000000000 000000000000
195 2 6 216a5fe8b8ed 000000000000 000000000000
196 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
196 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
197 $ hg debugrevlogindex D.txt
197 $ hg debugrevlogindex D.txt
198 rev linkrev nodeid p1 p2
198 rev linkrev nodeid p1 p2
199 0 6 2a8d3833f2fb 000000000000 000000000000
199 0 6 2a8d3833f2fb 000000000000 000000000000
200 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
200 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
201
201
202 Dry-run the fix
202 Dry-run the fix
203 $ hg debug-repair-issue6528 --dry-run
203 $ hg debug-repair-issue6528 --dry-run
204 found affected revision 1 for file 'D.txt'
204 found affected revision 1 for file 'D.txt'
205 found affected revision 1 for file 'b.txt'
205 found affected revision 1 for file 'b.txt'
206 found affected revision 3 for file 'b.txt'
206 found affected revision 3 for file 'b.txt'
207 $ hg st
207 $ hg st
208 M D.txt
208 M D.txt
209 M b.txt
209 M b.txt
210 $ hg debugrevlogindex b.txt
210 $ hg debugrevlogindex b.txt
211 rev linkrev nodeid p1 p2
211 rev linkrev nodeid p1 p2
212 0 2 05b806ebe5ea 000000000000 000000000000
212 0 2 05b806ebe5ea 000000000000 000000000000
213 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
213 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
214 2 6 216a5fe8b8ed 000000000000 000000000000
214 2 6 216a5fe8b8ed 000000000000 000000000000
215 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
215 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
216 $ hg debugrevlogindex D.txt
216 $ hg debugrevlogindex D.txt
217 rev linkrev nodeid p1 p2
217 rev linkrev nodeid p1 p2
218 0 6 2a8d3833f2fb 000000000000 000000000000
218 0 6 2a8d3833f2fb 000000000000 000000000000
219 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
219 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
220
220
221 Test the --paranoid option
221 Test the --paranoid option
222 $ hg debug-repair-issue6528 --dry-run --paranoid
222 $ hg debug-repair-issue6528 --dry-run --paranoid
223 found affected revision 1 for file 'D.txt'
223 found affected revision 1 for file 'D.txt'
224 found affected revision 1 for file 'b.txt'
224 found affected revision 1 for file 'b.txt'
225 found affected revision 3 for file 'b.txt'
225 found affected revision 3 for file 'b.txt'
226 $ hg st
226 $ hg st
227 M D.txt
227 M D.txt
228 M b.txt
228 M b.txt
229 $ hg debugrevlogindex b.txt
229 $ hg debugrevlogindex b.txt
230 rev linkrev nodeid p1 p2
230 rev linkrev nodeid p1 p2
231 0 2 05b806ebe5ea 000000000000 000000000000
231 0 2 05b806ebe5ea 000000000000 000000000000
232 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
232 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
233 2 6 216a5fe8b8ed 000000000000 000000000000
233 2 6 216a5fe8b8ed 000000000000 000000000000
234 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
234 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
235 $ hg debugrevlogindex D.txt
235 $ hg debugrevlogindex D.txt
236 rev linkrev nodeid p1 p2
236 rev linkrev nodeid p1 p2
237 0 6 2a8d3833f2fb 000000000000 000000000000
237 0 6 2a8d3833f2fb 000000000000 000000000000
238 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
238 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
239
239
240 Run the fix
240 Run the fix
241 $ hg debug-repair-issue6528
241 $ hg debug-repair-issue6528
242 found affected revision 1 for file 'D.txt'
242 found affected revision 1 for file 'D.txt'
243 repaired revision 1 of 'filelog data/D.txt.i'
243 repaired revision 1 of 'filelog data/D.txt.i'
244 found affected revision 1 for file 'b.txt'
244 found affected revision 1 for file 'b.txt'
245 found affected revision 3 for file 'b.txt'
245 found affected revision 3 for file 'b.txt'
246 repaired revision 1 of 'filelog data/b.txt.i'
246 repaired revision 1 of 'filelog data/b.txt.i'
247 repaired revision 3 of 'filelog data/b.txt.i'
247 repaired revision 3 of 'filelog data/b.txt.i'
248
248
249 Check that the fix worked and that running it twice does nothing
249 Check that the fix worked and that running it twice does nothing
250 $ hg st
250 $ hg st
251 $ hg debugrevlogindex b.txt
251 $ hg debugrevlogindex b.txt
252 rev linkrev nodeid p1 p2
252 rev linkrev nodeid p1 p2
253 0 2 05b806ebe5ea 000000000000 000000000000
253 0 2 05b806ebe5ea 000000000000 000000000000
254 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
254 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
255 2 6 216a5fe8b8ed 000000000000 000000000000
255 2 6 216a5fe8b8ed 000000000000 000000000000
256 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
256 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
257 $ hg debugrevlogindex D.txt
257 $ hg debugrevlogindex D.txt
258 rev linkrev nodeid p1 p2
258 rev linkrev nodeid p1 p2
259 0 6 2a8d3833f2fb 000000000000 000000000000
259 0 6 2a8d3833f2fb 000000000000 000000000000
260 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
260 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
261 $ hg debug-repair-issue6528
261 $ hg debug-repair-issue6528
262 no affected revisions were found
262 no affected revisions were found
263 $ hg st
263 $ hg st
264 $ hg debugrevlogindex b.txt
264 $ hg debugrevlogindex b.txt
265 rev linkrev nodeid p1 p2
265 rev linkrev nodeid p1 p2
266 0 2 05b806ebe5ea 000000000000 000000000000
266 0 2 05b806ebe5ea 000000000000 000000000000
267 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
267 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
268 2 6 216a5fe8b8ed 000000000000 000000000000
268 2 6 216a5fe8b8ed 000000000000 000000000000
269 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
269 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
270 $ hg debugrevlogindex D.txt
270 $ hg debugrevlogindex D.txt
271 rev linkrev nodeid p1 p2
271 rev linkrev nodeid p1 p2
272 0 6 2a8d3833f2fb 000000000000 000000000000
272 0 6 2a8d3833f2fb 000000000000 000000000000
273 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
273 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
274
274
275 Try the using the report options
275 Try the using the report options
276 --------------------------------
276 --------------------------------
277
277
278 $ cd ..
278 $ cd ..
279 $ mkdir repo-to-fix-report
279 $ mkdir repo-to-fix-report
280 $ cd repo-to-fix
280 $ cd repo-to-fix
281 $ tar -xf - < "$TESTDIR"/bundles/issue6528.tar
281 $ tar -xf - < "$TESTDIR"/bundles/issue6528.tar
282
282
283 $ hg debug-repair-issue6528 --to-report $TESTTMP/report.txt
283 $ hg debug-repair-issue6528 --to-report $TESTTMP/report.txt
284 found affected revision 1 for file 'D.txt'
284 found affected revision 1 for file 'D.txt'
285 found affected revision 1 for file 'b.txt'
285 found affected revision 1 for file 'b.txt'
286 found affected revision 3 for file 'b.txt'
286 found affected revision 3 for file 'b.txt'
287 $ cat $TESTTMP/report.txt
287 $ cat $TESTTMP/report.txt
288 2a80419dfc31d7dfb308ac40f3f138282de7d73b D.txt
288 2a80419dfc31d7dfb308ac40f3f138282de7d73b D.txt
289 a58b36ad6b6545195952793099613c2116f3563b,ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 b.txt
289 a58b36ad6b6545195952793099613c2116f3563b,ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 b.txt
290
290
291 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt --dry-run
291 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt --dry-run
292 loading report file '$TESTTMP/report.txt'
292 loading report file '$TESTTMP/report.txt'
293 found affected revision 1 for filelog 'D.txt'
293 found affected revision 1 for filelog 'D.txt'
294 found affected revision 1 for filelog 'b.txt'
294 found affected revision 1 for filelog 'b.txt'
295 found affected revision 3 for filelog 'b.txt'
295 found affected revision 3 for filelog 'b.txt'
296 $ hg st
296 $ hg st
297 M D.txt
297 M D.txt
298 M b.txt
298 M b.txt
299 $ hg debugrevlogindex b.txt
299 $ hg debugrevlogindex b.txt
300 rev linkrev nodeid p1 p2
300 rev linkrev nodeid p1 p2
301 0 2 05b806ebe5ea 000000000000 000000000000
301 0 2 05b806ebe5ea 000000000000 000000000000
302 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
302 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
303 2 6 216a5fe8b8ed 000000000000 000000000000
303 2 6 216a5fe8b8ed 000000000000 000000000000
304 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
304 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
305 $ hg debugrevlogindex D.txt
305 $ hg debugrevlogindex D.txt
306 rev linkrev nodeid p1 p2
306 rev linkrev nodeid p1 p2
307 0 6 2a8d3833f2fb 000000000000 000000000000
307 0 6 2a8d3833f2fb 000000000000 000000000000
308 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
308 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
309
309
310 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt
310 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt
311 loading report file '$TESTTMP/report.txt'
311 loading report file '$TESTTMP/report.txt'
312 found affected revision 1 for filelog 'D.txt'
312 found affected revision 1 for filelog 'D.txt'
313 repaired revision 1 of 'filelog data/D.txt.i'
313 repaired revision 1 of 'filelog data/D.txt.i'
314 found affected revision 1 for filelog 'b.txt'
314 found affected revision 1 for filelog 'b.txt'
315 found affected revision 3 for filelog 'b.txt'
315 found affected revision 3 for filelog 'b.txt'
316 repaired revision 1 of 'filelog data/b.txt.i'
316 repaired revision 1 of 'filelog data/b.txt.i'
317 repaired revision 3 of 'filelog data/b.txt.i'
317 repaired revision 3 of 'filelog data/b.txt.i'
318 $ hg st
318 $ hg st
319 $ hg debugrevlogindex b.txt
319 $ hg debugrevlogindex b.txt
320 rev linkrev nodeid p1 p2
320 rev linkrev nodeid p1 p2
321 0 2 05b806ebe5ea 000000000000 000000000000
321 0 2 05b806ebe5ea 000000000000 000000000000
322 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
322 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
323 2 6 216a5fe8b8ed 000000000000 000000000000
323 2 6 216a5fe8b8ed 000000000000 000000000000
324 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
324 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
325 $ hg debugrevlogindex D.txt
325 $ hg debugrevlogindex D.txt
326 rev linkrev nodeid p1 p2
326 rev linkrev nodeid p1 p2
327 0 6 2a8d3833f2fb 000000000000 000000000000
327 0 6 2a8d3833f2fb 000000000000 000000000000
328 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
328 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
329
329
330 Check that the revision is not "fixed" again
330 Check that the revision is not "fixed" again
331
331
332 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt
332 $ hg debug-repair-issue6528 --from-report $TESTTMP/report.txt
333 loading report file '$TESTTMP/report.txt'
333 loading report file '$TESTTMP/report.txt'
334 revision 2a80419dfc31d7dfb308ac40f3f138282de7d73b of file 'D.txt' is not affected
334 revision 2a80419dfc31d7dfb308ac40f3f138282de7d73b of file 'D.txt' is not affected
335 no affected revisions were found for 'D.txt'
335 no affected revisions were found for 'D.txt'
336 revision a58b36ad6b6545195952793099613c2116f3563b of file 'b.txt' is not affected
336 revision a58b36ad6b6545195952793099613c2116f3563b of file 'b.txt' is not affected
337 revision ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 of file 'b.txt' is not affected
337 revision ea4f2f2463cca5b29ddf3461012b8ce5c6dac175 of file 'b.txt' is not affected
338 no affected revisions were found for 'b.txt'
338 no affected revisions were found for 'b.txt'
339 $ hg st
339 $ hg st
340 $ hg debugrevlogindex b.txt
340 $ hg debugrevlogindex b.txt
341 rev linkrev nodeid p1 p2
341 rev linkrev nodeid p1 p2
342 0 2 05b806ebe5ea 000000000000 000000000000
342 0 2 05b806ebe5ea 000000000000 000000000000
343 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
343 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
344 2 6 216a5fe8b8ed 000000000000 000000000000
344 2 6 216a5fe8b8ed 000000000000 000000000000
345 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
345 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
346 $ hg debugrevlogindex D.txt
346 $ hg debugrevlogindex D.txt
347 rev linkrev nodeid p1 p2
347 rev linkrev nodeid p1 p2
348 0 6 2a8d3833f2fb 000000000000 000000000000
348 0 6 2a8d3833f2fb 000000000000 000000000000
349 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
349 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
350
350
351 Try it with a non-inline revlog
351 Try it with a non-inline revlog
352 -------------------------------
352 -------------------------------
353
353
354 $ cd ..
354 $ cd ..
355 $ mkdir $TESTTMP/ext
355 $ mkdir $TESTTMP/ext
356 $ cat << EOF > $TESTTMP/ext/small_inline.py
356 $ cat << EOF > $TESTTMP/ext/small_inline.py
357 > from mercurial import revlog
357 > from mercurial import revlog
358 > revlog._maxinline = 8
358 > revlog._maxinline = 8
359 > EOF
359 > EOF
360
360
361 $ cat << EOF >> $HGRCPATH
361 $ cat << EOF >> $HGRCPATH
362 > [extensions]
362 > [extensions]
363 > small_inline=$TESTTMP/ext/small_inline.py
363 > small_inline=$TESTTMP/ext/small_inline.py
364 > EOF
364 > EOF
365
365
366 $ mkdir repo-to-fix-not-inline
366 $ mkdir repo-to-fix-not-inline
367 $ cd repo-to-fix-not-inline
367 $ cd repo-to-fix-not-inline
368 $ tar -xf - < "$TESTDIR"/bundles/issue6528.tar
368 $ tar -xf - < "$TESTDIR"/bundles/issue6528.tar
369 $ echo b >> b.txt
369 $ echo b >> b.txt
370 $ hg commit -qm "inline -> separate"
370 $ hg commit -qm "inline -> separate" --traceback
371 $ find .hg -name *b.txt.d
371 $ find .hg -name *b.txt.d
372 .hg/store/data/b.txt.d
372 .hg/store/data/b.txt.d
373
373
374 Status is correct, but the problem is still there, in the earlier revision
374 Status is correct, but the problem is still there, in the earlier revision
375 $ hg st
375 $ hg st
376 $ hg up 3
376 $ hg up 3
377 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
377 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
378 $ hg st
378 $ hg st
379 M b.txt
379 M b.txt
380 $ hg debugrevlogindex b.txt
380 $ hg debugrevlogindex b.txt
381 rev linkrev nodeid p1 p2
381 rev linkrev nodeid p1 p2
382 0 2 05b806ebe5ea 000000000000 000000000000
382 0 2 05b806ebe5ea 000000000000 000000000000
383 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
383 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
384 2 6 216a5fe8b8ed 000000000000 000000000000
384 2 6 216a5fe8b8ed 000000000000 000000000000
385 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
385 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
386 4 8 db234885e2fe ea4f2f2463cc 000000000000
386 4 8 db234885e2fe ea4f2f2463cc 000000000000
387 $ hg debugrevlogindex D.txt
387 $ hg debugrevlogindex D.txt
388 rev linkrev nodeid p1 p2
388 rev linkrev nodeid p1 p2
389 0 6 2a8d3833f2fb 000000000000 000000000000
389 0 6 2a8d3833f2fb 000000000000 000000000000
390 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
390 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
391 2 8 65aecc89bb5d 2a80419dfc31 000000000000
391 2 8 65aecc89bb5d 2a80419dfc31 000000000000
392
392
393 Run the fix on the non-inline revlog
393 Run the fix on the non-inline revlog
394 $ hg debug-repair-issue6528
394 $ hg debug-repair-issue6528
395 found affected revision 1 for file 'D.txt'
395 found affected revision 1 for file 'D.txt'
396 repaired revision 1 of 'filelog data/D.txt.i'
396 repaired revision 1 of 'filelog data/D.txt.i'
397 found affected revision 1 for file 'b.txt'
397 found affected revision 1 for file 'b.txt'
398 found affected revision 3 for file 'b.txt'
398 found affected revision 3 for file 'b.txt'
399 repaired revision 1 of 'filelog data/b.txt.i'
399 repaired revision 1 of 'filelog data/b.txt.i'
400 repaired revision 3 of 'filelog data/b.txt.i'
400 repaired revision 3 of 'filelog data/b.txt.i'
401
401
402 Check that it worked
402 Check that it worked
403 $ hg debugrevlogindex b.txt
403 $ hg debugrevlogindex b.txt
404 rev linkrev nodeid p1 p2
404 rev linkrev nodeid p1 p2
405 0 2 05b806ebe5ea 000000000000 000000000000
405 0 2 05b806ebe5ea 000000000000 000000000000
406 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
406 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
407 2 6 216a5fe8b8ed 000000000000 000000000000
407 2 6 216a5fe8b8ed 000000000000 000000000000
408 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
408 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
409 4 8 db234885e2fe ea4f2f2463cc 000000000000
409 4 8 db234885e2fe ea4f2f2463cc 000000000000
410 $ hg debugrevlogindex D.txt
410 $ hg debugrevlogindex D.txt
411 rev linkrev nodeid p1 p2
411 rev linkrev nodeid p1 p2
412 0 6 2a8d3833f2fb 000000000000 000000000000
412 0 6 2a8d3833f2fb 000000000000 000000000000
413 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
413 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
414 2 8 65aecc89bb5d 2a80419dfc31 000000000000
414 2 8 65aecc89bb5d 2a80419dfc31 000000000000
415 $ hg debug-repair-issue6528
415 $ hg debug-repair-issue6528
416 no affected revisions were found
416 no affected revisions were found
417 $ hg st
417 $ hg st
418
418
419 $ cd ..
419 $ cd ..
420
420
421 Applying a bad bundle should fix it on the fly
421 Applying a bad bundle should fix it on the fly
422 ----------------------------------------------
422 ----------------------------------------------
423
423
424 from a v1 bundle
424 from a v1 bundle
425 ~~~~~~~~~~~~~~~~
425 ~~~~~~~~~~~~~~~~
426
426
427 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v1
427 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v1
428 bzip2-v1
428 bzip2-v1
429
429
430 $ hg init unbundle-v1
430 $ hg init unbundle-v1
431 $ cd unbundle-v1
431 $ cd unbundle-v1
432
432
433 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v1
433 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v1
434 adding changesets
434 adding changesets
435 adding manifests
435 adding manifests
436 adding file changes
436 adding file changes
437 added 8 changesets with 12 changes to 4 files
437 added 8 changesets with 12 changes to 4 files
438 new changesets f5a5a568022f:3beabb508514 (8 drafts)
438 new changesets f5a5a568022f:3beabb508514 (8 drafts)
439 (run 'hg update' to get a working copy)
439 (run 'hg update' to get a working copy)
440
440
441 Check that revision were fixed on the fly
441 Check that revision were fixed on the fly
442
442
443 $ hg debugrevlogindex b.txt
443 $ hg debugrevlogindex b.txt
444 rev linkrev nodeid p1 p2
444 rev linkrev nodeid p1 p2
445 0 2 05b806ebe5ea 000000000000 000000000000
445 0 2 05b806ebe5ea 000000000000 000000000000
446 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
446 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
447 2 6 216a5fe8b8ed 000000000000 000000000000
447 2 6 216a5fe8b8ed 000000000000 000000000000
448 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
448 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
449
449
450 $ hg debugrevlogindex D.txt
450 $ hg debugrevlogindex D.txt
451 rev linkrev nodeid p1 p2
451 rev linkrev nodeid p1 p2
452 0 6 2a8d3833f2fb 000000000000 000000000000
452 0 6 2a8d3833f2fb 000000000000 000000000000
453 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
453 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
454
454
455 That we don't see the symptoms of the bug
455 That we don't see the symptoms of the bug
456
456
457 $ hg up -- -1
457 $ hg up -- -1
458 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
458 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
459 $ hg status
459 $ hg status
460
460
461 And that the repair command does not find anything to fix
461 And that the repair command does not find anything to fix
462
462
463 $ hg debug-repair-issue6528
463 $ hg debug-repair-issue6528
464 no affected revisions were found
464 no affected revisions were found
465
465
466 $ cd ..
466 $ cd ..
467
467
468 from a v2 bundle
468 from a v2 bundle
469 ~~~~~~~~~~~~~~~~
469 ~~~~~~~~~~~~~~~~
470
470
471 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v2
471 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v2
472 bzip2-v2
472 bzip2-v2
473
473
474 $ hg init unbundle-v2
474 $ hg init unbundle-v2
475 $ cd unbundle-v2
475 $ cd unbundle-v2
476
476
477 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v2
477 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v2
478 adding changesets
478 adding changesets
479 adding manifests
479 adding manifests
480 adding file changes
480 adding file changes
481 added 8 changesets with 12 changes to 4 files
481 added 8 changesets with 12 changes to 4 files
482 new changesets f5a5a568022f:3beabb508514 (8 drafts)
482 new changesets f5a5a568022f:3beabb508514 (8 drafts)
483 (run 'hg update' to get a working copy)
483 (run 'hg update' to get a working copy)
484
484
485 Check that revision were fixed on the fly
485 Check that revision were fixed on the fly
486
486
487 $ hg debugrevlogindex b.txt
487 $ hg debugrevlogindex b.txt
488 rev linkrev nodeid p1 p2
488 rev linkrev nodeid p1 p2
489 0 2 05b806ebe5ea 000000000000 000000000000
489 0 2 05b806ebe5ea 000000000000 000000000000
490 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
490 1 3 a58b36ad6b65 000000000000 05b806ebe5ea
491 2 6 216a5fe8b8ed 000000000000 000000000000
491 2 6 216a5fe8b8ed 000000000000 000000000000
492 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
492 3 7 ea4f2f2463cc 000000000000 216a5fe8b8ed
493
493
494 $ hg debugrevlogindex D.txt
494 $ hg debugrevlogindex D.txt
495 rev linkrev nodeid p1 p2
495 rev linkrev nodeid p1 p2
496 0 6 2a8d3833f2fb 000000000000 000000000000
496 0 6 2a8d3833f2fb 000000000000 000000000000
497 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
497 1 7 2a80419dfc31 000000000000 2a8d3833f2fb
498
498
499 That we don't see the symptoms of the bug
499 That we don't see the symptoms of the bug
500
500
501 $ hg up -- -1
501 $ hg up -- -1
502 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
502 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
503 $ hg status
503 $ hg status
504
504
505 And that the repair command does not find anything to fix
505 And that the repair command does not find anything to fix
506
506
507 $ hg debug-repair-issue6528
507 $ hg debug-repair-issue6528
508 no affected revisions were found
508 no affected revisions were found
509
509
510 $ cd ..
510 $ cd ..
511
511
512 A config option can disable the fixing of the bad bundle on the fly
512 A config option can disable the fixing of the bad bundle on the fly
513 -------------------------------------------------------------------
513 -------------------------------------------------------------------
514
514
515
515
516
516
517 from a v1 bundle
517 from a v1 bundle
518 ~~~~~~~~~~~~~~~~
518 ~~~~~~~~~~~~~~~~
519
519
520 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v1
520 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v1
521 bzip2-v1
521 bzip2-v1
522
522
523 $ hg init unbundle-v1-no-fix
523 $ hg init unbundle-v1-no-fix
524 $ cd unbundle-v1-no-fix
524 $ cd unbundle-v1-no-fix
525
525
526 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v1 --config storage.revlog.issue6528.fix-incoming=no
526 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v1 --config storage.revlog.issue6528.fix-incoming=no
527 adding changesets
527 adding changesets
528 adding manifests
528 adding manifests
529 adding file changes
529 adding file changes
530 added 8 changesets with 12 changes to 4 files
530 added 8 changesets with 12 changes to 4 files
531 new changesets f5a5a568022f:3beabb508514 (8 drafts)
531 new changesets f5a5a568022f:3beabb508514 (8 drafts)
532 (run 'hg update' to get a working copy)
532 (run 'hg update' to get a working copy)
533
533
534 Check that revision were not fixed on the fly
534 Check that revision were not fixed on the fly
535
535
536 $ hg debugrevlogindex b.txt
536 $ hg debugrevlogindex b.txt
537 rev linkrev nodeid p1 p2
537 rev linkrev nodeid p1 p2
538 0 2 05b806ebe5ea 000000000000 000000000000
538 0 2 05b806ebe5ea 000000000000 000000000000
539 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
539 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
540 2 6 216a5fe8b8ed 000000000000 000000000000
540 2 6 216a5fe8b8ed 000000000000 000000000000
541 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
541 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
542
542
543 $ hg debugrevlogindex D.txt
543 $ hg debugrevlogindex D.txt
544 rev linkrev nodeid p1 p2
544 rev linkrev nodeid p1 p2
545 0 6 2a8d3833f2fb 000000000000 000000000000
545 0 6 2a8d3833f2fb 000000000000 000000000000
546 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
546 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
547
547
548 That we do see the symptoms of the bug
548 That we do see the symptoms of the bug
549
549
550 $ hg up -- -1
550 $ hg up -- -1
551 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
551 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
552 $ hg status
552 $ hg status
553 M D.txt (?)
553 M D.txt (?)
554 M b.txt (?)
554 M b.txt (?)
555
555
556 And that the repair command find issue to fix.
556 And that the repair command find issue to fix.
557
557
558 $ hg debug-repair-issue6528 --dry-run
558 $ hg debug-repair-issue6528 --dry-run
559 found affected revision 1 for file 'D.txt'
559 found affected revision 1 for file 'D.txt'
560 found affected revision 1 for file 'b.txt'
560 found affected revision 1 for file 'b.txt'
561 found affected revision 3 for file 'b.txt'
561 found affected revision 3 for file 'b.txt'
562
562
563 $ cd ..
563 $ cd ..
564
564
565 from a v2 bundle
565 from a v2 bundle
566 ~~~~~~~~~~~~~~~~
566 ~~~~~~~~~~~~~~~~
567
567
568 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v2
568 $ hg debugbundle --spec "$TESTDIR"/bundles/issue6528.hg-v2
569 bzip2-v2
569 bzip2-v2
570
570
571 $ hg init unbundle-v2-no-fix
571 $ hg init unbundle-v2-no-fix
572 $ cd unbundle-v2-no-fix
572 $ cd unbundle-v2-no-fix
573
573
574 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v2 --config storage.revlog.issue6528.fix-incoming=no
574 $ hg unbundle "$TESTDIR"/bundles/issue6528.hg-v2 --config storage.revlog.issue6528.fix-incoming=no
575 adding changesets
575 adding changesets
576 adding manifests
576 adding manifests
577 adding file changes
577 adding file changes
578 added 8 changesets with 12 changes to 4 files
578 added 8 changesets with 12 changes to 4 files
579 new changesets f5a5a568022f:3beabb508514 (8 drafts)
579 new changesets f5a5a568022f:3beabb508514 (8 drafts)
580 (run 'hg update' to get a working copy)
580 (run 'hg update' to get a working copy)
581
581
582 Check that revision were not fixed on the fly
582 Check that revision were not fixed on the fly
583
583
584 $ hg debugrevlogindex b.txt
584 $ hg debugrevlogindex b.txt
585 rev linkrev nodeid p1 p2
585 rev linkrev nodeid p1 p2
586 0 2 05b806ebe5ea 000000000000 000000000000
586 0 2 05b806ebe5ea 000000000000 000000000000
587 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
587 1 3 a58b36ad6b65 05b806ebe5ea 000000000000
588 2 6 216a5fe8b8ed 000000000000 000000000000
588 2 6 216a5fe8b8ed 000000000000 000000000000
589 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
589 3 7 ea4f2f2463cc 216a5fe8b8ed 000000000000
590
590
591 $ hg debugrevlogindex D.txt
591 $ hg debugrevlogindex D.txt
592 rev linkrev nodeid p1 p2
592 rev linkrev nodeid p1 p2
593 0 6 2a8d3833f2fb 000000000000 000000000000
593 0 6 2a8d3833f2fb 000000000000 000000000000
594 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
594 1 7 2a80419dfc31 2a8d3833f2fb 000000000000
595
595
596 That we do see the symptoms of the bug
596 That we do see the symptoms of the bug
597
597
598 $ hg up -- -1
598 $ hg up -- -1
599 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
599 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
600 $ hg status
600 $ hg status
601 M D.txt (?)
601 M D.txt (?)
602 M b.txt (?)
602 M b.txt (?)
603
603
604 And that the repair command find issue to fix.
604 And that the repair command find issue to fix.
605
605
606 $ hg debug-repair-issue6528 --dry-run
606 $ hg debug-repair-issue6528 --dry-run
607 found affected revision 1 for file 'D.txt'
607 found affected revision 1 for file 'D.txt'
608 found affected revision 1 for file 'b.txt'
608 found affected revision 1 for file 'b.txt'
609 found affected revision 3 for file 'b.txt'
609 found affected revision 3 for file 'b.txt'
610
610
611 $ cd ..
611 $ cd ..
@@ -1,55 +1,57 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ echo a > a
3 $ echo a > a
4 $ hg ci -Am0
4 $ hg ci -Am0
5 adding a
5 adding a
6
6
7 $ hg -q clone . foo
7 $ hg -q clone . foo
8
8
9 $ touch .hg/store/journal
9 $ touch .hg/store/journal
10
10
11 $ echo foo > a
11 $ echo foo > a
12 $ hg ci -Am0
12 $ hg ci -Am0
13 abort: abandoned transaction found
13 abort: abandoned transaction found
14 (run 'hg recover' to clean up transaction)
14 (run 'hg recover' to clean up transaction)
15 [255]
15 [255]
16
16
17 $ hg recover
17 $ hg recover
18 rolling back interrupted transaction
18 rolling back interrupted transaction
19 (verify step skipped, run `hg verify` to check your repository content)
19 (verify step skipped, run `hg verify` to check your repository content)
20
20
21 recover, explicit verify
21 recover, explicit verify
22
22
23 $ touch .hg/store/journal
23 $ touch .hg/store/journal
24 $ hg ci -Am0
24 $ hg ci -Am0
25 abort: abandoned transaction found
25 abort: abandoned transaction found
26 (run 'hg recover' to clean up transaction)
26 (run 'hg recover' to clean up transaction)
27 [255]
27 [255]
28 $ hg recover --verify -q
28 $ hg recover --verify -q
29
29
30 recover, no verify
30 recover, no verify
31
31
32 $ touch .hg/store/journal
32 $ touch .hg/store/journal
33 $ hg ci -Am0
33 $ hg ci -Am0
34 abort: abandoned transaction found
34 abort: abandoned transaction found
35 (run 'hg recover' to clean up transaction)
35 (run 'hg recover' to clean up transaction)
36 [255]
36 [255]
37 $ hg recover --no-verify
37 $ hg recover --no-verify
38 rolling back interrupted transaction
38 rolling back interrupted transaction
39 (verify step skipped, run `hg verify` to check your repository content)
39 (verify step skipped, run `hg verify` to check your repository content)
40
40
41
41
42 Check that zero-size journals are correctly aborted:
42 Check that zero-size journals are correctly aborted:
43
43
44 #if unix-permissions no-root
44 #if unix-permissions no-root
45 $ hg bundle -qa repo.hg
45 $ hg bundle -qa repo.hg
46 $ chmod -w foo/.hg/store/00changelog.i
46 $ chmod -w foo/.hg/store/00changelog.i
47
47
48 $ hg -R foo unbundle repo.hg
48 $ hg -R foo unbundle repo.hg
49 adding changesets
49 adding changesets
50 transaction abort!
51 rollback completed
50 abort: $EACCES$: '$TESTTMP/repo/foo/.hg/store/.00changelog.i-*' (glob)
52 abort: $EACCES$: '$TESTTMP/repo/foo/.hg/store/.00changelog.i-*' (glob)
51 [255]
53 [255]
52
54
53 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
55 $ if test -f foo/.hg/store/journal; then echo 'journal exists :-('; fi
54 #endif
56 #endif
55
57
@@ -1,948 +1,949 b''
1 #require no-reposimplestore no-chg
1 #require no-reposimplestore no-chg
2 #testcases git-server hg-server
2 #testcases git-server hg-server
3
3
4 #if git-server
4 #if git-server
5 #require lfs-test-server
5 #require lfs-test-server
6 #else
6 #else
7 #require serve
7 #require serve
8 #endif
8 #endif
9
9
10 #if git-server
10 #if git-server
11 $ LFS_LISTEN="tcp://:$HGPORT"
11 $ LFS_LISTEN="tcp://:$HGPORT"
12 $ LFS_HOST="localhost:$HGPORT"
12 $ LFS_HOST="localhost:$HGPORT"
13 $ LFS_PUBLIC=1
13 $ LFS_PUBLIC=1
14 $ export LFS_LISTEN LFS_HOST LFS_PUBLIC
14 $ export LFS_LISTEN LFS_HOST LFS_PUBLIC
15 #else
15 #else
16 $ LFS_HOST="localhost:$HGPORT/.git/info/lfs"
16 $ LFS_HOST="localhost:$HGPORT/.git/info/lfs"
17 #endif
17 #endif
18
18
19 #if no-windows git-server
19 #if no-windows git-server
20 $ lfs-test-server > lfs-server.log 2>&1 &
20 $ lfs-test-server > lfs-server.log 2>&1 &
21 $ echo $! >> $DAEMON_PIDS
21 $ echo $! >> $DAEMON_PIDS
22 #endif
22 #endif
23
23
24 #if windows git-server
24 #if windows git-server
25 $ cat >> $TESTTMP/spawn.py <<EOF
25 $ cat >> $TESTTMP/spawn.py <<EOF
26 > import os
26 > import os
27 > import subprocess
27 > import subprocess
28 > import sys
28 > import sys
29 >
29 >
30 > for path in os.environ["PATH"].split(os.pathsep):
30 > for path in os.environ["PATH"].split(os.pathsep):
31 > exe = os.path.join(path, 'lfs-test-server.exe')
31 > exe = os.path.join(path, 'lfs-test-server.exe')
32 > if os.path.exists(exe):
32 > if os.path.exists(exe):
33 > with open('lfs-server.log', 'wb') as out:
33 > with open('lfs-server.log', 'wb') as out:
34 > p = subprocess.Popen(exe, stdout=out, stderr=out)
34 > p = subprocess.Popen(exe, stdout=out, stderr=out)
35 > sys.stdout.write('%s\n' % p.pid)
35 > sys.stdout.write('%s\n' % p.pid)
36 > sys.exit(0)
36 > sys.exit(0)
37 > sys.exit(1)
37 > sys.exit(1)
38 > EOF
38 > EOF
39 $ "$PYTHON" $TESTTMP/spawn.py >> $DAEMON_PIDS
39 $ "$PYTHON" $TESTTMP/spawn.py >> $DAEMON_PIDS
40 #endif
40 #endif
41
41
42 $ cat >> $HGRCPATH <<EOF
42 $ cat >> $HGRCPATH <<EOF
43 > [ui]
43 > [ui]
44 > paginate=no
44 > paginate=no
45 > [experimental]
45 > [experimental]
46 > lfs.worker-enable = False
46 > lfs.worker-enable = False
47 > [extensions]
47 > [extensions]
48 > lfs=
48 > lfs=
49 > [lfs]
49 > [lfs]
50 > url=http://foo:bar@$LFS_HOST
50 > url=http://foo:bar@$LFS_HOST
51 > track=all()
51 > track=all()
52 > [web]
52 > [web]
53 > push_ssl = False
53 > push_ssl = False
54 > allow-push = *
54 > allow-push = *
55 > EOF
55 > EOF
56
56
57 Use a separate usercache, otherwise the server sees what the client commits, and
57 Use a separate usercache, otherwise the server sees what the client commits, and
58 never requests a transfer.
58 never requests a transfer.
59
59
60 #if hg-server
60 #if hg-server
61 $ hg init server
61 $ hg init server
62 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server serve -d \
62 $ hg --config "lfs.usercache=$TESTTMP/servercache" -R server serve -d \
63 > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
63 > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
64 $ cat hg.pid >> $DAEMON_PIDS
64 $ cat hg.pid >> $DAEMON_PIDS
65 #endif
65 #endif
66
66
67 $ hg init repo1
67 $ hg init repo1
68 $ cd repo1
68 $ cd repo1
69 $ echo THIS-IS-LFS > a
69 $ echo THIS-IS-LFS > a
70 $ hg commit -m a -A a
70 $ hg commit -m a -A a
71
71
72 A push can be serviced directly from the usercache if it isn't in the local
72 A push can be serviced directly from the usercache if it isn't in the local
73 store.
73 store.
74
74
75 $ hg init ../repo2
75 $ hg init ../repo2
76 $ mv .hg/store/lfs .hg/store/lfs_
76 $ mv .hg/store/lfs .hg/store/lfs_
77 $ hg push ../repo2 --debug
77 $ hg push ../repo2 --debug
78 http auth: user foo, password ***
78 http auth: user foo, password ***
79 pushing to ../repo2
79 pushing to ../repo2
80 http auth: user foo, password ***
80 http auth: user foo, password ***
81 http auth: user foo, password ***
81 http auth: user foo, password ***
82 query 1; heads
82 query 1; heads
83 searching for changes
83 searching for changes
84 1 total queries in *s (glob)
84 1 total queries in *s (glob)
85 listing keys for "phases"
85 listing keys for "phases"
86 checking for updated bookmarks
86 checking for updated bookmarks
87 listing keys for "bookmarks"
87 listing keys for "bookmarks"
88 lfs: computing set of blobs to upload
88 lfs: computing set of blobs to upload
89 Status: 200
89 Status: 200
90 Content-Length: 309 (git-server !)
90 Content-Length: 309 (git-server !)
91 Content-Length: 350 (hg-server !)
91 Content-Length: 350 (hg-server !)
92 Content-Type: application/vnd.git-lfs+json
92 Content-Type: application/vnd.git-lfs+json
93 Date: $HTTP_DATE$
93 Date: $HTTP_DATE$
94 Server: testing stub value (hg-server !)
94 Server: testing stub value (hg-server !)
95 {
95 {
96 "objects": [
96 "objects": [
97 {
97 {
98 "actions": {
98 "actions": {
99 "upload": {
99 "upload": {
100 "expires_at": "$ISO_8601_DATE_TIME$"
100 "expires_at": "$ISO_8601_DATE_TIME$"
101 "header": {
101 "header": {
102 "Accept": "application/vnd.git-lfs"
102 "Accept": "application/vnd.git-lfs"
103 }
103 }
104 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (git-server !)
104 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (git-server !)
105 "href": "http://localhost:$HGPORT/.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (hg-server !)
105 "href": "http://localhost:$HGPORT/.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (hg-server !)
106 }
106 }
107 }
107 }
108 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
108 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
109 "size": 12
109 "size": 12
110 }
110 }
111 ]
111 ]
112 "transfer": "basic" (hg-server !)
112 "transfer": "basic" (hg-server !)
113 }
113 }
114 lfs: uploading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
114 lfs: uploading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
115 Status: 200 (git-server !)
115 Status: 200 (git-server !)
116 Status: 201 (hg-server !)
116 Status: 201 (hg-server !)
117 Content-Length: 0
117 Content-Length: 0
118 Content-Type: text/plain; charset=utf-8 (hg-server !)
118 Content-Type: text/plain; charset=utf-8 (hg-server !)
119 Date: $HTTP_DATE$
119 Date: $HTTP_DATE$
120 Server: testing stub value (hg-server !)
120 Server: testing stub value (hg-server !)
121 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
121 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
122 lfs: uploaded 1 files (12 bytes)
122 lfs: uploaded 1 files (12 bytes)
123 1 changesets found
123 1 changesets found
124 list of changesets:
124 list of changesets:
125 99a7098854a3984a5c9eab0fc7a2906697b7cb5c
125 99a7098854a3984a5c9eab0fc7a2906697b7cb5c
126 bundle2-output-bundle: "HG20", 4 parts total
126 bundle2-output-bundle: "HG20", 4 parts total
127 bundle2-output-part: "replycaps" * bytes payload (glob)
127 bundle2-output-part: "replycaps" * bytes payload (glob)
128 bundle2-output-part: "check:heads" streamed payload
128 bundle2-output-part: "check:heads" streamed payload
129 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
129 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
130 bundle2-output-part: "phase-heads" 24 bytes payload
130 bundle2-output-part: "phase-heads" 24 bytes payload
131 bundle2-input-bundle: with-transaction
131 bundle2-input-bundle: with-transaction
132 bundle2-input-part: "replycaps" supported
132 bundle2-input-part: "replycaps" supported
133 bundle2-input-part: total payload size * (glob)
133 bundle2-input-part: total payload size * (glob)
134 bundle2-input-part: "check:heads" supported
134 bundle2-input-part: "check:heads" supported
135 bundle2-input-part: total payload size 20
135 bundle2-input-part: total payload size 20
136 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
136 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
137 adding changesets
137 adding changesets
138 add changeset 99a7098854a3
138 add changeset 99a7098854a3
139 adding manifests
139 adding manifests
140 adding file changes
140 adding file changes
141 adding a revisions
141 adding a revisions
142 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
142 calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs
143 bundle2-input-part: total payload size 617
143 bundle2-input-part: total payload size 617
144 bundle2-input-part: "phase-heads" supported
144 bundle2-input-part: "phase-heads" supported
145 bundle2-input-part: total payload size 24
145 bundle2-input-part: total payload size 24
146 bundle2-input-bundle: 4 parts total
146 bundle2-input-bundle: 4 parts total
147 updating the branch cache
147 updating the branch cache
148 added 1 changesets with 1 changes to 1 files
148 added 1 changesets with 1 changes to 1 files
149 bundle2-output-bundle: "HG20", 1 parts total
149 bundle2-output-bundle: "HG20", 1 parts total
150 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
150 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
151 bundle2-input-bundle: no-transaction
151 bundle2-input-bundle: no-transaction
152 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
152 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
153 bundle2-input-bundle: 1 parts total
153 bundle2-input-bundle: 1 parts total
154 listing keys for "phases"
154 listing keys for "phases"
155 $ mv .hg/store/lfs_ .hg/store/lfs
155 $ mv .hg/store/lfs_ .hg/store/lfs
156
156
157 Clear the cache to force a download
157 Clear the cache to force a download
158 $ rm -rf `hg config lfs.usercache`
158 $ rm -rf `hg config lfs.usercache`
159 $ cd ../repo2
159 $ cd ../repo2
160 $ hg update tip --debug
160 $ hg update tip --debug
161 http auth: user foo, password ***
161 http auth: user foo, password ***
162 resolving manifests
162 resolving manifests
163 branchmerge: False, force: False, partial: False
163 branchmerge: False, force: False, partial: False
164 ancestor: 000000000000, local: 000000000000+, remote: 99a7098854a3
164 ancestor: 000000000000, local: 000000000000+, remote: 99a7098854a3
165 http auth: user foo, password ***
165 http auth: user foo, password ***
166 Status: 200
166 Status: 200
167 Content-Length: 311 (git-server !)
167 Content-Length: 311 (git-server !)
168 Content-Length: 352 (hg-server !)
168 Content-Length: 352 (hg-server !)
169 Content-Type: application/vnd.git-lfs+json
169 Content-Type: application/vnd.git-lfs+json
170 Date: $HTTP_DATE$
170 Date: $HTTP_DATE$
171 Server: testing stub value (hg-server !)
171 Server: testing stub value (hg-server !)
172 {
172 {
173 "objects": [
173 "objects": [
174 {
174 {
175 "actions": {
175 "actions": {
176 "download": {
176 "download": {
177 "expires_at": "$ISO_8601_DATE_TIME$"
177 "expires_at": "$ISO_8601_DATE_TIME$"
178 "header": {
178 "header": {
179 "Accept": "application/vnd.git-lfs"
179 "Accept": "application/vnd.git-lfs"
180 }
180 }
181 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob)
181 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob)
182 }
182 }
183 }
183 }
184 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
184 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
185 "size": 12
185 "size": 12
186 }
186 }
187 ]
187 ]
188 "transfer": "basic" (hg-server !)
188 "transfer": "basic" (hg-server !)
189 }
189 }
190 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
190 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
191 Status: 200
191 Status: 200
192 Content-Length: 12
192 Content-Length: 12
193 Content-Type: text/plain; charset=utf-8 (git-server !)
193 Content-Type: text/plain; charset=utf-8 (git-server !)
194 Content-Type: application/octet-stream (hg-server !)
194 Content-Type: application/octet-stream (hg-server !)
195 Date: $HTTP_DATE$
195 Date: $HTTP_DATE$
196 Server: testing stub value (hg-server !)
196 Server: testing stub value (hg-server !)
197 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache
197 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache
198 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
198 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
199 lfs: downloaded 1 files (12 bytes)
199 lfs: downloaded 1 files (12 bytes)
200 a: remote created -> g
200 a: remote created -> g
201 getting a
201 getting a
202 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
202 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
204
204
205 When the server has some blobs already. `hg serve` doesn't offer to upload
205 When the server has some blobs already. `hg serve` doesn't offer to upload
206 blobs that it already knows about. Note that lfs-test-server is simply
206 blobs that it already knows about. Note that lfs-test-server is simply
207 toggling the action to 'download'. The Batch API spec says it should omit the
207 toggling the action to 'download'. The Batch API spec says it should omit the
208 actions property completely.
208 actions property completely.
209
209
210 $ hg mv a b
210 $ hg mv a b
211 $ echo ANOTHER-LARGE-FILE > c
211 $ echo ANOTHER-LARGE-FILE > c
212 $ echo ANOTHER-LARGE-FILE2 > d
212 $ echo ANOTHER-LARGE-FILE2 > d
213 $ hg commit -m b-and-c -A b c d
213 $ hg commit -m b-and-c -A b c d
214 $ hg push ../repo1 --debug
214 $ hg push ../repo1 --debug
215 http auth: user foo, password ***
215 http auth: user foo, password ***
216 pushing to ../repo1
216 pushing to ../repo1
217 http auth: user foo, password ***
217 http auth: user foo, password ***
218 http auth: user foo, password ***
218 http auth: user foo, password ***
219 query 1; heads
219 query 1; heads
220 searching for changes
220 searching for changes
221 all remote heads known locally
221 all remote heads known locally
222 listing keys for "phases"
222 listing keys for "phases"
223 checking for updated bookmarks
223 checking for updated bookmarks
224 listing keys for "bookmarks"
224 listing keys for "bookmarks"
225 listing keys for "bookmarks"
225 listing keys for "bookmarks"
226 lfs: computing set of blobs to upload
226 lfs: computing set of blobs to upload
227 Status: 200
227 Status: 200
228 Content-Length: 901 (git-server !)
228 Content-Length: 901 (git-server !)
229 Content-Length: 755 (hg-server !)
229 Content-Length: 755 (hg-server !)
230 Content-Type: application/vnd.git-lfs+json
230 Content-Type: application/vnd.git-lfs+json
231 Date: $HTTP_DATE$
231 Date: $HTTP_DATE$
232 Server: testing stub value (hg-server !)
232 Server: testing stub value (hg-server !)
233 {
233 {
234 "objects": [
234 "objects": [
235 {
235 {
236 "actions": { (git-server !)
236 "actions": { (git-server !)
237 "download": { (git-server !)
237 "download": { (git-server !)
238 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !)
238 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !)
239 "header": { (git-server !)
239 "header": { (git-server !)
240 "Accept": "application/vnd.git-lfs" (git-server !)
240 "Accept": "application/vnd.git-lfs" (git-server !)
241 } (git-server !)
241 } (git-server !)
242 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (git-server !)
242 "href": "http://localhost:$HGPORT/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (git-server !)
243 } (git-server !)
243 } (git-server !)
244 } (git-server !)
244 } (git-server !)
245 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
245 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
246 "size": 12
246 "size": 12
247 }
247 }
248 {
248 {
249 "actions": {
249 "actions": {
250 "upload": {
250 "upload": {
251 "expires_at": "$ISO_8601_DATE_TIME$"
251 "expires_at": "$ISO_8601_DATE_TIME$"
252 "header": {
252 "header": {
253 "Accept": "application/vnd.git-lfs"
253 "Accept": "application/vnd.git-lfs"
254 }
254 }
255 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob)
255 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob)
256 }
256 }
257 }
257 }
258 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
258 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
259 "size": 20
259 "size": 20
260 }
260 }
261 {
261 {
262 "actions": {
262 "actions": {
263 "upload": {
263 "upload": {
264 "expires_at": "$ISO_8601_DATE_TIME$"
264 "expires_at": "$ISO_8601_DATE_TIME$"
265 "header": {
265 "header": {
266 "Accept": "application/vnd.git-lfs"
266 "Accept": "application/vnd.git-lfs"
267 }
267 }
268 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
268 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
269 }
269 }
270 }
270 }
271 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
271 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
272 "size": 19
272 "size": 19
273 }
273 }
274 ]
274 ]
275 "transfer": "basic" (hg-server !)
275 "transfer": "basic" (hg-server !)
276 }
276 }
277 lfs: need to transfer 2 objects (39 bytes)
277 lfs: need to transfer 2 objects (39 bytes)
278 lfs: uploading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes)
278 lfs: uploading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes)
279 Status: 200 (git-server !)
279 Status: 200 (git-server !)
280 Status: 201 (hg-server !)
280 Status: 201 (hg-server !)
281 Content-Length: 0
281 Content-Length: 0
282 Content-Type: text/plain; charset=utf-8 (hg-server !)
282 Content-Type: text/plain; charset=utf-8 (hg-server !)
283 Date: $HTTP_DATE$
283 Date: $HTTP_DATE$
284 Server: testing stub value (hg-server !)
284 Server: testing stub value (hg-server !)
285 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
285 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
286 lfs: uploading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
286 lfs: uploading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
287 Status: 200 (git-server !)
287 Status: 200 (git-server !)
288 Status: 201 (hg-server !)
288 Status: 201 (hg-server !)
289 Content-Length: 0
289 Content-Length: 0
290 Content-Type: text/plain; charset=utf-8 (hg-server !)
290 Content-Type: text/plain; charset=utf-8 (hg-server !)
291 Date: $HTTP_DATE$
291 Date: $HTTP_DATE$
292 Server: testing stub value (hg-server !)
292 Server: testing stub value (hg-server !)
293 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
293 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
294 lfs: uploaded 2 files (39 bytes)
294 lfs: uploaded 2 files (39 bytes)
295 1 changesets found
295 1 changesets found
296 list of changesets:
296 list of changesets:
297 dfca2c9e2ef24996aa61ba2abd99277d884b3d63
297 dfca2c9e2ef24996aa61ba2abd99277d884b3d63
298 bundle2-output-bundle: "HG20", 5 parts total
298 bundle2-output-bundle: "HG20", 5 parts total
299 bundle2-output-part: "replycaps" * bytes payload (glob)
299 bundle2-output-part: "replycaps" * bytes payload (glob)
300 bundle2-output-part: "check:phases" 24 bytes payload
300 bundle2-output-part: "check:phases" 24 bytes payload
301 bundle2-output-part: "check:updated-heads" streamed payload
301 bundle2-output-part: "check:updated-heads" streamed payload
302 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
302 bundle2-output-part: "changegroup" (params: 1 mandatory) streamed payload
303 bundle2-output-part: "phase-heads" 24 bytes payload
303 bundle2-output-part: "phase-heads" 24 bytes payload
304 bundle2-input-bundle: with-transaction
304 bundle2-input-bundle: with-transaction
305 bundle2-input-part: "replycaps" supported
305 bundle2-input-part: "replycaps" supported
306 bundle2-input-part: total payload size * (glob)
306 bundle2-input-part: total payload size * (glob)
307 bundle2-input-part: "check:phases" supported
307 bundle2-input-part: "check:phases" supported
308 bundle2-input-part: total payload size 24
308 bundle2-input-part: total payload size 24
309 bundle2-input-part: "check:updated-heads" supported
309 bundle2-input-part: "check:updated-heads" supported
310 bundle2-input-part: total payload size 20
310 bundle2-input-part: total payload size 20
311 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
311 bundle2-input-part: "changegroup" (params: 1 mandatory) supported
312 adding changesets
312 adding changesets
313 add changeset dfca2c9e2ef2
313 add changeset dfca2c9e2ef2
314 adding manifests
314 adding manifests
315 adding file changes
315 adding file changes
316 adding b revisions
316 adding b revisions
317 adding c revisions
317 adding c revisions
318 adding d revisions
318 adding d revisions
319 bundle2-input-part: total payload size 1315
319 bundle2-input-part: total payload size 1315
320 bundle2-input-part: "phase-heads" supported
320 bundle2-input-part: "phase-heads" supported
321 bundle2-input-part: total payload size 24
321 bundle2-input-part: total payload size 24
322 bundle2-input-bundle: 5 parts total
322 bundle2-input-bundle: 5 parts total
323 updating the branch cache
323 updating the branch cache
324 added 1 changesets with 3 changes to 3 files
324 added 1 changesets with 3 changes to 3 files
325 bundle2-output-bundle: "HG20", 1 parts total
325 bundle2-output-bundle: "HG20", 1 parts total
326 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
326 bundle2-output-part: "reply:changegroup" (advisory) (params: 0 advisory) empty payload
327 bundle2-input-bundle: no-transaction
327 bundle2-input-bundle: no-transaction
328 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
328 bundle2-input-part: "reply:changegroup" (advisory) (params: 0 advisory) supported
329 bundle2-input-bundle: 1 parts total
329 bundle2-input-bundle: 1 parts total
330 listing keys for "phases"
330 listing keys for "phases"
331
331
332 Clear the cache to force a download
332 Clear the cache to force a download
333 $ rm -rf `hg config lfs.usercache`
333 $ rm -rf `hg config lfs.usercache`
334 $ hg --repo ../repo1 update tip --debug
334 $ hg --repo ../repo1 update tip --debug
335 http auth: user foo, password ***
335 http auth: user foo, password ***
336 resolving manifests
336 resolving manifests
337 branchmerge: False, force: False, partial: False
337 branchmerge: False, force: False, partial: False
338 ancestor: 99a7098854a3, local: 99a7098854a3+, remote: dfca2c9e2ef2
338 ancestor: 99a7098854a3, local: 99a7098854a3+, remote: dfca2c9e2ef2
339 http auth: user foo, password ***
339 http auth: user foo, password ***
340 Status: 200
340 Status: 200
341 Content-Length: 608 (git-server !)
341 Content-Length: 608 (git-server !)
342 Content-Length: 670 (hg-server !)
342 Content-Length: 670 (hg-server !)
343 Content-Type: application/vnd.git-lfs+json
343 Content-Type: application/vnd.git-lfs+json
344 Date: $HTTP_DATE$
344 Date: $HTTP_DATE$
345 Server: testing stub value (hg-server !)
345 Server: testing stub value (hg-server !)
346 {
346 {
347 "objects": [
347 "objects": [
348 {
348 {
349 "actions": {
349 "actions": {
350 "download": {
350 "download": {
351 "expires_at": "$ISO_8601_DATE_TIME$"
351 "expires_at": "$ISO_8601_DATE_TIME$"
352 "header": {
352 "header": {
353 "Accept": "application/vnd.git-lfs"
353 "Accept": "application/vnd.git-lfs"
354 }
354 }
355 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob)
355 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob)
356 }
356 }
357 }
357 }
358 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
358 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
359 "size": 20
359 "size": 20
360 }
360 }
361 {
361 {
362 "actions": {
362 "actions": {
363 "download": {
363 "download": {
364 "expires_at": "$ISO_8601_DATE_TIME$"
364 "expires_at": "$ISO_8601_DATE_TIME$"
365 "header": {
365 "header": {
366 "Accept": "application/vnd.git-lfs"
366 "Accept": "application/vnd.git-lfs"
367 }
367 }
368 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
368 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
369 }
369 }
370 }
370 }
371 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
371 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
372 "size": 19
372 "size": 19
373 }
373 }
374 ]
374 ]
375 "transfer": "basic" (hg-server !)
375 "transfer": "basic" (hg-server !)
376 }
376 }
377 lfs: need to transfer 2 objects (39 bytes)
377 lfs: need to transfer 2 objects (39 bytes)
378 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes)
378 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes)
379 Status: 200
379 Status: 200
380 Content-Length: 20
380 Content-Length: 20
381 Content-Type: text/plain; charset=utf-8 (git-server !)
381 Content-Type: text/plain; charset=utf-8 (git-server !)
382 Content-Type: application/octet-stream (hg-server !)
382 Content-Type: application/octet-stream (hg-server !)
383 Date: $HTTP_DATE$
383 Date: $HTTP_DATE$
384 Server: testing stub value (hg-server !)
384 Server: testing stub value (hg-server !)
385 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache
385 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache
386 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
386 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
387 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
387 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
388 Status: 200
388 Status: 200
389 Content-Length: 19
389 Content-Length: 19
390 Content-Type: text/plain; charset=utf-8 (git-server !)
390 Content-Type: text/plain; charset=utf-8 (git-server !)
391 Content-Type: application/octet-stream (hg-server !)
391 Content-Type: application/octet-stream (hg-server !)
392 Date: $HTTP_DATE$
392 Date: $HTTP_DATE$
393 Server: testing stub value (hg-server !)
393 Server: testing stub value (hg-server !)
394 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache
394 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache
395 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
395 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
396 lfs: downloaded 2 files (39 bytes)
396 lfs: downloaded 2 files (39 bytes)
397 b: remote created -> g
397 b: remote created -> g
398 getting b
398 getting b
399 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
399 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
400 c: remote created -> g
400 c: remote created -> g
401 getting c
401 getting c
402 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store
402 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store
403 d: remote created -> g
403 d: remote created -> g
404 getting d
404 getting d
405 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store
405 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store
406 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
407
407
408 Test a corrupt file download, but clear the cache first to force a download.
408 Test a corrupt file download, but clear the cache first to force a download.
409 `hg serve` indicates a corrupt file without transferring it, unlike
409 `hg serve` indicates a corrupt file without transferring it, unlike
410 lfs-test-server.
410 lfs-test-server.
411
411
412 $ rm -rf `hg config lfs.usercache`
412 $ rm -rf `hg config lfs.usercache`
413 #if git-server
413 #if git-server
414 $ cp $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob
414 $ cp $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob
415 $ echo 'damage' > $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
415 $ echo 'damage' > $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
416 #else
416 #else
417 $ cp $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob
417 $ cp $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob
418 $ echo 'damage' > $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
418 $ echo 'damage' > $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
419 #endif
419 #endif
420 $ rm ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
420 $ rm ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
421 $ rm ../repo1/*
421 $ rm ../repo1/*
422
422
423 TODO: give the proper error indication from `hg serve`
423 TODO: give the proper error indication from `hg serve`
424
424
425 TODO: reconsider the except base class so that the git and hg errors yield the
425 TODO: reconsider the except base class so that the git and hg errors yield the
426 same exit status.
426 same exit status.
427
427
428 $ hg --repo ../repo1 update -C tip --debug --config ui.detailed-exit-code=False
428 $ hg --repo ../repo1 update -C tip --debug --config ui.detailed-exit-code=False
429 http auth: user foo, password ***
429 http auth: user foo, password ***
430 resolving manifests
430 resolving manifests
431 branchmerge: False, force: True, partial: False
431 branchmerge: False, force: True, partial: False
432 ancestor: dfca2c9e2ef2+, local: dfca2c9e2ef2+, remote: dfca2c9e2ef2
432 ancestor: dfca2c9e2ef2+, local: dfca2c9e2ef2+, remote: dfca2c9e2ef2
433 http auth: user foo, password ***
433 http auth: user foo, password ***
434 Status: 200
434 Status: 200
435 Content-Length: 311 (git-server !)
435 Content-Length: 311 (git-server !)
436 Content-Length: 183 (hg-server !)
436 Content-Length: 183 (hg-server !)
437 Content-Type: application/vnd.git-lfs+json
437 Content-Type: application/vnd.git-lfs+json
438 Date: $HTTP_DATE$
438 Date: $HTTP_DATE$
439 Server: testing stub value (hg-server !)
439 Server: testing stub value (hg-server !)
440 {
440 {
441 "objects": [
441 "objects": [
442 {
442 {
443 "actions": { (git-server !)
443 "actions": { (git-server !)
444 "download": { (git-server !)
444 "download": { (git-server !)
445 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !)
445 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !)
446 "header": { (git-server !)
446 "header": { (git-server !)
447 "Accept": "application/vnd.git-lfs" (git-server !)
447 "Accept": "application/vnd.git-lfs" (git-server !)
448 } (git-server !)
448 } (git-server !)
449 "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (git-server !)
449 "href": "http://localhost:$HGPORT/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (git-server !)
450 } (git-server !)
450 } (git-server !)
451 "error": { (hg-server !)
451 "error": { (hg-server !)
452 "code": 422 (hg-server !)
452 "code": 422 (hg-server !)
453 "message": "The object is corrupt" (hg-server !)
453 "message": "The object is corrupt" (hg-server !)
454 }
454 }
455 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
455 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
456 "size": 19
456 "size": 19
457 }
457 }
458 ]
458 ]
459 "transfer": "basic" (hg-server !)
459 "transfer": "basic" (hg-server !)
460 }
460 }
461 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) (git-server !)
461 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) (git-server !)
462 Status: 200 (git-server !)
462 Status: 200 (git-server !)
463 Content-Length: 7 (git-server !)
463 Content-Length: 7 (git-server !)
464 Content-Type: text/plain; charset=utf-8 (git-server !)
464 Content-Type: text/plain; charset=utf-8 (git-server !)
465 Date: $HTTP_DATE$ (git-server !)
465 Date: $HTTP_DATE$ (git-server !)
466 abort: corrupt remote lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (git-server !)
466 abort: corrupt remote lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (git-server !)
467 abort: LFS server error for "c": Validation error (hg-server !)
467 abort: LFS server error for "c": Validation error (hg-server !)
468 [255]
468 [255]
469
469
470 The corrupted blob is not added to the usercache or local store
470 The corrupted blob is not added to the usercache or local store
471
471
472 $ test -f ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
472 $ test -f ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
473 [1]
473 [1]
474 $ test -f `hg config lfs.usercache`/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
474 $ test -f `hg config lfs.usercache`/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
475 [1]
475 [1]
476 #if git-server
476 #if git-server
477 $ cp blob $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
477 $ cp blob $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
478 #else
478 #else
479 $ cp blob $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
479 $ cp blob $TESTTMP/server/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
480 #endif
480 #endif
481
481
482 Test a corrupted file upload
482 Test a corrupted file upload
483
483
484 $ echo 'another lfs blob' > b
484 $ echo 'another lfs blob' > b
485 $ hg ci -m 'another blob'
485 $ hg ci -m 'another blob'
486 $ echo 'damage' > .hg/store/lfs/objects/e6/59058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0
486 $ echo 'damage' > .hg/store/lfs/objects/e6/59058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0
487 $ hg push --debug ../repo1
487 $ hg push --debug ../repo1
488 http auth: user foo, password ***
488 http auth: user foo, password ***
489 pushing to ../repo1
489 pushing to ../repo1
490 http auth: user foo, password ***
490 http auth: user foo, password ***
491 http auth: user foo, password ***
491 http auth: user foo, password ***
492 query 1; heads
492 query 1; heads
493 searching for changes
493 searching for changes
494 all remote heads known locally
494 all remote heads known locally
495 listing keys for "phases"
495 listing keys for "phases"
496 checking for updated bookmarks
496 checking for updated bookmarks
497 listing keys for "bookmarks"
497 listing keys for "bookmarks"
498 listing keys for "bookmarks"
498 listing keys for "bookmarks"
499 lfs: computing set of blobs to upload
499 lfs: computing set of blobs to upload
500 Status: 200
500 Status: 200
501 Content-Length: 309 (git-server !)
501 Content-Length: 309 (git-server !)
502 Content-Length: 350 (hg-server !)
502 Content-Length: 350 (hg-server !)
503 Content-Type: application/vnd.git-lfs+json
503 Content-Type: application/vnd.git-lfs+json
504 Date: $HTTP_DATE$
504 Date: $HTTP_DATE$
505 Server: testing stub value (hg-server !)
505 Server: testing stub value (hg-server !)
506 {
506 {
507 "objects": [
507 "objects": [
508 {
508 {
509 "actions": {
509 "actions": {
510 "upload": {
510 "upload": {
511 "expires_at": "$ISO_8601_DATE_TIME$"
511 "expires_at": "$ISO_8601_DATE_TIME$"
512 "header": {
512 "header": {
513 "Accept": "application/vnd.git-lfs"
513 "Accept": "application/vnd.git-lfs"
514 }
514 }
515 "href": "http://localhost:$HGPORT/*/e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0" (glob)
515 "href": "http://localhost:$HGPORT/*/e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0" (glob)
516 }
516 }
517 }
517 }
518 "oid": "e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0"
518 "oid": "e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0"
519 "size": 17
519 "size": 17
520 }
520 }
521 ]
521 ]
522 "transfer": "basic" (hg-server !)
522 "transfer": "basic" (hg-server !)
523 }
523 }
524 lfs: uploading e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 (17 bytes)
524 lfs: uploading e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 (17 bytes)
525 abort: detected corrupt lfs object: e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0
525 abort: detected corrupt lfs object: e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0
526 (run hg verify)
526 (run hg verify)
527 [255]
527 [255]
528
528
529 Archive will prefetch blobs in a group
529 Archive will prefetch blobs in a group
530
530
531 $ rm -rf .hg/store/lfs `hg config lfs.usercache`
531 $ rm -rf .hg/store/lfs `hg config lfs.usercache`
532 $ hg archive --debug -r 1 ../archive
532 $ hg archive --debug -r 1 ../archive
533 http auth: user foo, password ***
533 http auth: user foo, password ***
534 http auth: user foo, password ***
534 http auth: user foo, password ***
535 Status: 200
535 Status: 200
536 Content-Length: 905 (git-server !)
536 Content-Length: 905 (git-server !)
537 Content-Length: 988 (hg-server !)
537 Content-Length: 988 (hg-server !)
538 Content-Type: application/vnd.git-lfs+json
538 Content-Type: application/vnd.git-lfs+json
539 Date: $HTTP_DATE$
539 Date: $HTTP_DATE$
540 Server: testing stub value (hg-server !)
540 Server: testing stub value (hg-server !)
541 {
541 {
542 "objects": [
542 "objects": [
543 {
543 {
544 "actions": {
544 "actions": {
545 "download": {
545 "download": {
546 "expires_at": "$ISO_8601_DATE_TIME$"
546 "expires_at": "$ISO_8601_DATE_TIME$"
547 "header": {
547 "header": {
548 "Accept": "application/vnd.git-lfs"
548 "Accept": "application/vnd.git-lfs"
549 }
549 }
550 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob)
550 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob)
551 }
551 }
552 }
552 }
553 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
553 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
554 "size": 12
554 "size": 12
555 }
555 }
556 {
556 {
557 "actions": {
557 "actions": {
558 "download": {
558 "download": {
559 "expires_at": "$ISO_8601_DATE_TIME$"
559 "expires_at": "$ISO_8601_DATE_TIME$"
560 "header": {
560 "header": {
561 "Accept": "application/vnd.git-lfs"
561 "Accept": "application/vnd.git-lfs"
562 }
562 }
563 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob)
563 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob)
564 }
564 }
565 }
565 }
566 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
566 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
567 "size": 20
567 "size": 20
568 }
568 }
569 {
569 {
570 "actions": {
570 "actions": {
571 "download": {
571 "download": {
572 "expires_at": "$ISO_8601_DATE_TIME$"
572 "expires_at": "$ISO_8601_DATE_TIME$"
573 "header": {
573 "header": {
574 "Accept": "application/vnd.git-lfs"
574 "Accept": "application/vnd.git-lfs"
575 }
575 }
576 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
576 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
577 }
577 }
578 }
578 }
579 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
579 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
580 "size": 19
580 "size": 19
581 }
581 }
582 ]
582 ]
583 "transfer": "basic" (hg-server !)
583 "transfer": "basic" (hg-server !)
584 }
584 }
585 lfs: need to transfer 3 objects (51 bytes)
585 lfs: need to transfer 3 objects (51 bytes)
586 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
586 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
587 Status: 200
587 Status: 200
588 Content-Length: 12
588 Content-Length: 12
589 Content-Type: text/plain; charset=utf-8 (git-server !)
589 Content-Type: text/plain; charset=utf-8 (git-server !)
590 Content-Type: application/octet-stream (hg-server !)
590 Content-Type: application/octet-stream (hg-server !)
591 Date: $HTTP_DATE$
591 Date: $HTTP_DATE$
592 Server: testing stub value (hg-server !)
592 Server: testing stub value (hg-server !)
593 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache
593 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache
594 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
594 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
595 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes)
595 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes)
596 Status: 200
596 Status: 200
597 Content-Length: 20
597 Content-Length: 20
598 Content-Type: text/plain; charset=utf-8 (git-server !)
598 Content-Type: text/plain; charset=utf-8 (git-server !)
599 Content-Type: application/octet-stream (hg-server !)
599 Content-Type: application/octet-stream (hg-server !)
600 Date: $HTTP_DATE$
600 Date: $HTTP_DATE$
601 Server: testing stub value (hg-server !)
601 Server: testing stub value (hg-server !)
602 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache
602 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache
603 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
603 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
604 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
604 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
605 Status: 200
605 Status: 200
606 Content-Length: 19
606 Content-Length: 19
607 Content-Type: text/plain; charset=utf-8 (git-server !)
607 Content-Type: text/plain; charset=utf-8 (git-server !)
608 Content-Type: application/octet-stream (hg-server !)
608 Content-Type: application/octet-stream (hg-server !)
609 Date: $HTTP_DATE$
609 Date: $HTTP_DATE$
610 Server: testing stub value (hg-server !)
610 Server: testing stub value (hg-server !)
611 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache
611 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache
612 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
612 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
613 lfs: downloaded 3 files (51 bytes)
613 lfs: downloaded 3 files (51 bytes)
614 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
614 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
615 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
615 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
616 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store
616 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store
617 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store
617 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store
618 $ find ../archive | sort
618 $ find ../archive | sort
619 ../archive
619 ../archive
620 ../archive/.hg_archival.txt
620 ../archive/.hg_archival.txt
621 ../archive/a
621 ../archive/a
622 ../archive/b
622 ../archive/b
623 ../archive/c
623 ../archive/c
624 ../archive/d
624 ../archive/d
625
625
626 Cat will prefetch blobs in a group
626 Cat will prefetch blobs in a group
627
627
628 $ rm -rf .hg/store/lfs `hg config lfs.usercache`
628 $ rm -rf .hg/store/lfs `hg config lfs.usercache`
629 $ hg cat --debug -r 1 a b c nonexistent
629 $ hg cat --debug -r 1 a b c nonexistent
630 http auth: user foo, password ***
630 http auth: user foo, password ***
631 http auth: user foo, password ***
631 http auth: user foo, password ***
632 Status: 200
632 Status: 200
633 Content-Length: 608 (git-server !)
633 Content-Length: 608 (git-server !)
634 Content-Length: 670 (hg-server !)
634 Content-Length: 670 (hg-server !)
635 Content-Type: application/vnd.git-lfs+json
635 Content-Type: application/vnd.git-lfs+json
636 Date: $HTTP_DATE$
636 Date: $HTTP_DATE$
637 Server: testing stub value (hg-server !)
637 Server: testing stub value (hg-server !)
638 {
638 {
639 "objects": [
639 "objects": [
640 {
640 {
641 "actions": {
641 "actions": {
642 "download": {
642 "download": {
643 "expires_at": "$ISO_8601_DATE_TIME$"
643 "expires_at": "$ISO_8601_DATE_TIME$"
644 "header": {
644 "header": {
645 "Accept": "application/vnd.git-lfs"
645 "Accept": "application/vnd.git-lfs"
646 }
646 }
647 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob)
647 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob)
648 }
648 }
649 }
649 }
650 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
650 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
651 "size": 12
651 "size": 12
652 }
652 }
653 {
653 {
654 "actions": {
654 "actions": {
655 "download": {
655 "download": {
656 "expires_at": "$ISO_8601_DATE_TIME$"
656 "expires_at": "$ISO_8601_DATE_TIME$"
657 "header": {
657 "header": {
658 "Accept": "application/vnd.git-lfs"
658 "Accept": "application/vnd.git-lfs"
659 }
659 }
660 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
660 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
661 }
661 }
662 }
662 }
663 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
663 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
664 "size": 19
664 "size": 19
665 }
665 }
666 ]
666 ]
667 "transfer": "basic" (hg-server !)
667 "transfer": "basic" (hg-server !)
668 }
668 }
669 lfs: need to transfer 2 objects (31 bytes)
669 lfs: need to transfer 2 objects (31 bytes)
670 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
670 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
671 Status: 200
671 Status: 200
672 Content-Length: 12
672 Content-Length: 12
673 Content-Type: text/plain; charset=utf-8 (git-server !)
673 Content-Type: text/plain; charset=utf-8 (git-server !)
674 Content-Type: application/octet-stream (hg-server !)
674 Content-Type: application/octet-stream (hg-server !)
675 Date: $HTTP_DATE$
675 Date: $HTTP_DATE$
676 Server: testing stub value (hg-server !)
676 Server: testing stub value (hg-server !)
677 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache
677 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache
678 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
678 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
679 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
679 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
680 Status: 200
680 Status: 200
681 Content-Length: 19
681 Content-Length: 19
682 Content-Type: text/plain; charset=utf-8 (git-server !)
682 Content-Type: text/plain; charset=utf-8 (git-server !)
683 Content-Type: application/octet-stream (hg-server !)
683 Content-Type: application/octet-stream (hg-server !)
684 Date: $HTTP_DATE$
684 Date: $HTTP_DATE$
685 Server: testing stub value (hg-server !)
685 Server: testing stub value (hg-server !)
686 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache
686 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache
687 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
687 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
688 lfs: downloaded 2 files (31 bytes)
688 lfs: downloaded 2 files (31 bytes)
689 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
689 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
690 THIS-IS-LFS
690 THIS-IS-LFS
691 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
691 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
692 THIS-IS-LFS
692 THIS-IS-LFS
693 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store
693 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store
694 ANOTHER-LARGE-FILE
694 ANOTHER-LARGE-FILE
695 nonexistent: no such file in rev dfca2c9e2ef2
695 nonexistent: no such file in rev dfca2c9e2ef2
696
696
697 Revert will prefetch blobs in a group
697 Revert will prefetch blobs in a group
698
698
699 $ rm -rf .hg/store/lfs
699 $ rm -rf .hg/store/lfs
700 $ rm -rf `hg config lfs.usercache`
700 $ rm -rf `hg config lfs.usercache`
701 $ rm *
701 $ rm *
702 $ hg revert --all -r 1 --debug
702 $ hg revert --all -r 1 --debug
703 http auth: user foo, password ***
703 http auth: user foo, password ***
704 http auth: user foo, password ***
704 http auth: user foo, password ***
705 Status: 200
705 Status: 200
706 Content-Length: 905 (git-server !)
706 Content-Length: 905 (git-server !)
707 Content-Length: 988 (hg-server !)
707 Content-Length: 988 (hg-server !)
708 Content-Type: application/vnd.git-lfs+json
708 Content-Type: application/vnd.git-lfs+json
709 Date: $HTTP_DATE$
709 Date: $HTTP_DATE$
710 Server: testing stub value (hg-server !)
710 Server: testing stub value (hg-server !)
711 {
711 {
712 "objects": [
712 "objects": [
713 {
713 {
714 "actions": {
714 "actions": {
715 "download": {
715 "download": {
716 "expires_at": "$ISO_8601_DATE_TIME$"
716 "expires_at": "$ISO_8601_DATE_TIME$"
717 "header": {
717 "header": {
718 "Accept": "application/vnd.git-lfs"
718 "Accept": "application/vnd.git-lfs"
719 }
719 }
720 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob)
720 "href": "http://localhost:$HGPORT/*/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b" (glob)
721 }
721 }
722 }
722 }
723 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
723 "oid": "31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b"
724 "size": 12
724 "size": 12
725 }
725 }
726 {
726 {
727 "actions": {
727 "actions": {
728 "download": {
728 "download": {
729 "expires_at": "$ISO_8601_DATE_TIME$"
729 "expires_at": "$ISO_8601_DATE_TIME$"
730 "header": {
730 "header": {
731 "Accept": "application/vnd.git-lfs"
731 "Accept": "application/vnd.git-lfs"
732 }
732 }
733 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob)
733 "href": "http://localhost:$HGPORT/*/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19" (glob)
734 }
734 }
735 }
735 }
736 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
736 "oid": "37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19"
737 "size": 20
737 "size": 20
738 }
738 }
739 {
739 {
740 "actions": {
740 "actions": {
741 "download": {
741 "download": {
742 "expires_at": "$ISO_8601_DATE_TIME$"
742 "expires_at": "$ISO_8601_DATE_TIME$"
743 "header": {
743 "header": {
744 "Accept": "application/vnd.git-lfs"
744 "Accept": "application/vnd.git-lfs"
745 }
745 }
746 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
746 "href": "http://localhost:$HGPORT/*/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998" (glob)
747 }
747 }
748 }
748 }
749 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
749 "oid": "d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998"
750 "size": 19
750 "size": 19
751 }
751 }
752 ]
752 ]
753 "transfer": "basic" (hg-server !)
753 "transfer": "basic" (hg-server !)
754 }
754 }
755 lfs: need to transfer 3 objects (51 bytes)
755 lfs: need to transfer 3 objects (51 bytes)
756 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
756 lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes)
757 Status: 200
757 Status: 200
758 Content-Length: 12
758 Content-Length: 12
759 Content-Type: text/plain; charset=utf-8 (git-server !)
759 Content-Type: text/plain; charset=utf-8 (git-server !)
760 Content-Type: application/octet-stream (hg-server !)
760 Content-Type: application/octet-stream (hg-server !)
761 Date: $HTTP_DATE$
761 Date: $HTTP_DATE$
762 Server: testing stub value (hg-server !)
762 Server: testing stub value (hg-server !)
763 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache
763 lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache
764 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
764 lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b
765 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes)
765 lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes)
766 Status: 200
766 Status: 200
767 Content-Length: 20
767 Content-Length: 20
768 Content-Type: text/plain; charset=utf-8 (git-server !)
768 Content-Type: text/plain; charset=utf-8 (git-server !)
769 Content-Type: application/octet-stream (hg-server !)
769 Content-Type: application/octet-stream (hg-server !)
770 Date: $HTTP_DATE$
770 Date: $HTTP_DATE$
771 Server: testing stub value (hg-server !)
771 Server: testing stub value (hg-server !)
772 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache
772 lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache
773 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
773 lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19
774 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
774 lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes)
775 Status: 200
775 Status: 200
776 Content-Length: 19
776 Content-Length: 19
777 Content-Type: text/plain; charset=utf-8 (git-server !)
777 Content-Type: text/plain; charset=utf-8 (git-server !)
778 Content-Type: application/octet-stream (hg-server !)
778 Content-Type: application/octet-stream (hg-server !)
779 Date: $HTTP_DATE$
779 Date: $HTTP_DATE$
780 Server: testing stub value (hg-server !)
780 Server: testing stub value (hg-server !)
781 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache
781 lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache
782 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
782 lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998
783 lfs: downloaded 3 files (51 bytes)
783 lfs: downloaded 3 files (51 bytes)
784 reverting b
784 reverting b
785 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
785 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
786 reverting c
786 reverting c
787 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store
787 lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store
788 reverting d
788 reverting d
789 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store
789 lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store
790 adding a
790 adding a
791 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
791 lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store
792
792
793 Check error message when the remote missed a blob:
793 Check error message when the remote missed a blob:
794
794
795 $ echo FFFFF > b
795 $ echo FFFFF > b
796 $ hg commit -m b -A b
796 $ hg commit -m b -A b
797 $ echo FFFFF >> b
797 $ echo FFFFF >> b
798 $ hg commit -m b b
798 $ hg commit -m b b
799 $ rm -rf .hg/store/lfs
799 $ rm -rf .hg/store/lfs
800 $ rm -rf `hg config lfs.usercache`
800 $ rm -rf `hg config lfs.usercache`
801 $ hg update -C '.^' --debug
801 $ hg update -C '.^' --debug
802 http auth: user foo, password ***
802 http auth: user foo, password ***
803 resolving manifests
803 resolving manifests
804 branchmerge: False, force: True, partial: False
804 branchmerge: False, force: True, partial: False
805 ancestor: 62fdbaf221c6+, local: 62fdbaf221c6+, remote: ef0564edf47e
805 ancestor: 62fdbaf221c6+, local: 62fdbaf221c6+, remote: ef0564edf47e
806 http auth: user foo, password ***
806 http auth: user foo, password ***
807 Status: 200
807 Status: 200
808 Content-Length: 308 (git-server !)
808 Content-Length: 308 (git-server !)
809 Content-Length: 186 (hg-server !)
809 Content-Length: 186 (hg-server !)
810 Content-Type: application/vnd.git-lfs+json
810 Content-Type: application/vnd.git-lfs+json
811 Date: $HTTP_DATE$
811 Date: $HTTP_DATE$
812 Server: testing stub value (hg-server !)
812 Server: testing stub value (hg-server !)
813 {
813 {
814 "objects": [
814 "objects": [
815 {
815 {
816 "actions": { (git-server !)
816 "actions": { (git-server !)
817 "upload": { (git-server !)
817 "upload": { (git-server !)
818 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !)
818 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !)
819 "header": { (git-server !)
819 "header": { (git-server !)
820 "Accept": "application/vnd.git-lfs" (git-server !)
820 "Accept": "application/vnd.git-lfs" (git-server !)
821 } (git-server !)
821 } (git-server !)
822 "href": "http://localhost:$HGPORT/objects/8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13" (git-server !)
822 "href": "http://localhost:$HGPORT/objects/8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13" (git-server !)
823 } (git-server !)
823 } (git-server !)
824 "error": { (hg-server !)
824 "error": { (hg-server !)
825 "code": 404 (hg-server !)
825 "code": 404 (hg-server !)
826 "message": "The object does not exist" (hg-server !)
826 "message": "The object does not exist" (hg-server !)
827 }
827 }
828 "oid": "8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13"
828 "oid": "8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13"
829 "size": 6
829 "size": 6
830 }
830 }
831 ]
831 ]
832 "transfer": "basic" (hg-server !)
832 "transfer": "basic" (hg-server !)
833 }
833 }
834 abort: LFS server error for "b": The object does not exist
834 abort: LFS server error for "b": The object does not exist
835 [50]
835 [50]
836
836
837 Check error message when object does not exist:
837 Check error message when object does not exist:
838
838
839 $ cd $TESTTMP
839 $ cd $TESTTMP
840 $ hg init test && cd test
840 $ hg init test && cd test
841 $ echo "[extensions]" >> .hg/hgrc
841 $ echo "[extensions]" >> .hg/hgrc
842 $ echo "lfs=" >> .hg/hgrc
842 $ echo "lfs=" >> .hg/hgrc
843 $ echo "[lfs]" >> .hg/hgrc
843 $ echo "[lfs]" >> .hg/hgrc
844 $ echo "threshold=1" >> .hg/hgrc
844 $ echo "threshold=1" >> .hg/hgrc
845 $ echo a > a
845 $ echo a > a
846 $ hg add a
846 $ hg add a
847 $ hg commit -m 'test'
847 $ hg commit -m 'test'
848 $ echo aaaaa > a
848 $ echo aaaaa > a
849 $ hg commit -m 'largefile'
849 $ hg commit -m 'largefile'
850 $ hg debugdata a 1 # verify this is no the file content but includes "oid", the LFS "pointer".
850 $ hg debugdata a 1 # verify this is no the file content but includes "oid", the LFS "pointer".
851 version https://git-lfs.github.com/spec/v1
851 version https://git-lfs.github.com/spec/v1
852 oid sha256:bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a
852 oid sha256:bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a
853 size 6
853 size 6
854 x-is-binary 0
854 x-is-binary 0
855 $ cd ..
855 $ cd ..
856 $ rm -rf `hg config lfs.usercache`
856 $ rm -rf `hg config lfs.usercache`
857
857
858 (Restart the server in a different location so it no longer has the content)
858 (Restart the server in a different location so it no longer has the content)
859
859
860 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
860 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
861
861
862 #if hg-server
862 #if hg-server
863 $ cat $TESTTMP/access.log $TESTTMP/errors.log
863 $ cat $TESTTMP/access.log $TESTTMP/errors.log
864 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
864 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
865 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 201 - (glob)
865 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 201 - (glob)
866 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
866 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
867 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob)
867 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob)
868 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
868 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
869 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 201 - (glob)
869 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 201 - (glob)
870 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 201 - (glob)
870 $LOCALIP - - [$LOGDATE$] "PUT /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 201 - (glob)
871 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
871 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
872 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob)
872 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob)
873 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob)
873 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob)
874 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
874 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
875 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
875 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
876 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
876 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
877 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob)
877 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob)
878 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob)
878 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob)
879 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob)
879 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob)
880 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
880 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
881 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob)
881 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob)
882 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob)
882 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob)
883 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
883 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
884 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob)
884 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b HTTP/1.1" 200 - (glob)
885 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob)
885 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 HTTP/1.1" 200 - (glob)
886 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob)
886 $LOCALIP - - [$LOGDATE$] "GET /.hg/lfs/objects/d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 HTTP/1.1" 200 - (glob)
887 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
887 $LOCALIP - - [$LOGDATE$] "POST /.git/info/lfs/objects/batch HTTP/1.1" 200 - (glob)
888 #endif
888 #endif
889
889
890 $ mkdir $TESTTMP/lfs-server2
890 $ mkdir $TESTTMP/lfs-server2
891 $ cd $TESTTMP/lfs-server2
891 $ cd $TESTTMP/lfs-server2
892 #if no-windows git-server
892 #if no-windows git-server
893 $ lfs-test-server > lfs-server.log 2>&1 &
893 $ lfs-test-server > lfs-server.log 2>&1 &
894 $ echo $! >> $DAEMON_PIDS
894 $ echo $! >> $DAEMON_PIDS
895 #endif
895 #endif
896
896
897 #if windows git-server
897 #if windows git-server
898 $ "$PYTHON" $TESTTMP/spawn.py >> $DAEMON_PIDS
898 $ "$PYTHON" $TESTTMP/spawn.py >> $DAEMON_PIDS
899 #endif
899 #endif
900
900
901 #if hg-server
901 #if hg-server
902 $ hg init server2
902 $ hg init server2
903 $ hg --config "lfs.usercache=$TESTTMP/servercache2" -R server2 serve -d \
903 $ hg --config "lfs.usercache=$TESTTMP/servercache2" -R server2 serve -d \
904 > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
904 > -p $HGPORT --pid-file=hg.pid -A $TESTTMP/access.log -E $TESTTMP/errors.log
905 $ cat hg.pid >> $DAEMON_PIDS
905 $ cat hg.pid >> $DAEMON_PIDS
906 #endif
906 #endif
907
907
908 $ cd $TESTTMP
908 $ cd $TESTTMP
909 $ hg --debug clone test test2
909 $ hg --debug clone test test2
910 http auth: user foo, password ***
910 http auth: user foo, password ***
911 linked 6 files
911 linked 7 files (no-rust !)
912 linked 9 files (rust !)
912 http auth: user foo, password ***
913 http auth: user foo, password ***
913 updating to branch default
914 updating to branch default
914 resolving manifests
915 resolving manifests
915 branchmerge: False, force: False, partial: False
916 branchmerge: False, force: False, partial: False
916 ancestor: 000000000000, local: 000000000000+, remote: d2a338f184a8
917 ancestor: 000000000000, local: 000000000000+, remote: d2a338f184a8
917 http auth: user foo, password ***
918 http auth: user foo, password ***
918 Status: 200
919 Status: 200
919 Content-Length: 308 (git-server !)
920 Content-Length: 308 (git-server !)
920 Content-Length: 186 (hg-server !)
921 Content-Length: 186 (hg-server !)
921 Content-Type: application/vnd.git-lfs+json
922 Content-Type: application/vnd.git-lfs+json
922 Date: $HTTP_DATE$
923 Date: $HTTP_DATE$
923 Server: testing stub value (hg-server !)
924 Server: testing stub value (hg-server !)
924 {
925 {
925 "objects": [
926 "objects": [
926 {
927 {
927 "actions": { (git-server !)
928 "actions": { (git-server !)
928 "upload": { (git-server !)
929 "upload": { (git-server !)
929 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !)
930 "expires_at": "$ISO_8601_DATE_TIME$" (git-server !)
930 "header": { (git-server !)
931 "header": { (git-server !)
931 "Accept": "application/vnd.git-lfs" (git-server !)
932 "Accept": "application/vnd.git-lfs" (git-server !)
932 } (git-server !)
933 } (git-server !)
933 "href": "http://localhost:$HGPORT/objects/bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a" (git-server !)
934 "href": "http://localhost:$HGPORT/objects/bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a" (git-server !)
934 } (git-server !)
935 } (git-server !)
935 "error": { (hg-server !)
936 "error": { (hg-server !)
936 "code": 404 (hg-server !)
937 "code": 404 (hg-server !)
937 "message": "The object does not exist" (hg-server !)
938 "message": "The object does not exist" (hg-server !)
938 }
939 }
939 "oid": "bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a"
940 "oid": "bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a"
940 "size": 6
941 "size": 6
941 }
942 }
942 ]
943 ]
943 "transfer": "basic" (hg-server !)
944 "transfer": "basic" (hg-server !)
944 }
945 }
945 abort: LFS server error for "a": The object does not exist
946 abort: LFS server error for "a": The object does not exist
946 [50]
947 [50]
947
948
948 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
949 $ "$PYTHON" $RUNTESTDIR/killdaemons.py $DAEMON_PIDS
@@ -1,103 +1,106 b''
1 #testcases tree flat-fncache flat-nofncache
1 #testcases tree flat-fncache flat-nofncache
2
2
3 Tests narrow stream clones
3 Tests narrow stream clones
4
4
5 $ . "$TESTDIR/narrow-library.sh"
5 $ . "$TESTDIR/narrow-library.sh"
6
6
7 #if tree
7 #if tree
8 $ cat << EOF >> $HGRCPATH
8 $ cat << EOF >> $HGRCPATH
9 > [experimental]
9 > [experimental]
10 > treemanifest = 1
10 > treemanifest = 1
11 > EOF
11 > EOF
12 #endif
12 #endif
13
13
14 #if flat-nofncache
14 #if flat-nofncache
15 $ cat << EOF >> $HGRCPATH
15 $ cat << EOF >> $HGRCPATH
16 > [format]
16 > [format]
17 > usefncache = 0
17 > usefncache = 0
18 > EOF
18 > EOF
19 #endif
19 #endif
20
20
21 Server setup
21 Server setup
22
22
23 $ hg init master
23 $ hg init master
24 $ cd master
24 $ cd master
25 $ mkdir dir
25 $ mkdir dir
26 $ mkdir dir/src
26 $ mkdir dir/src
27 $ cd dir/src
27 $ cd dir/src
28 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done
28 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done
29
29
30 $ cd ..
30 $ cd ..
31 $ mkdir tests
31 $ mkdir tests
32 $ cd tests
32 $ cd tests
33 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done
33 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "F$x"; hg add "F$x"; hg commit -m "Commit src $x"; done
34 $ cd ../../..
34 $ cd ../../..
35
35
36 Trying to stream clone when the server does not support it
36 Trying to stream clone when the server does not support it
37
37
38 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream
38 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream
39 streaming all changes
39 streaming all changes
40 remote: abort: server does not support narrow stream clones
40 remote: abort: server does not support narrow stream clones
41 abort: pull failed on remote
41 abort: pull failed on remote
42 [100]
42 [100]
43
43
44 Enable stream clone on the server
44 Enable stream clone on the server
45
45
46 $ echo "[experimental]" >> master/.hg/hgrc
46 $ echo "[experimental]" >> master/.hg/hgrc
47 $ echo "server.stream-narrow-clones=True" >> master/.hg/hgrc
47 $ echo "server.stream-narrow-clones=True" >> master/.hg/hgrc
48
48
49 Cloning a specific file when stream clone is supported
49 Cloning a specific file when stream clone is supported
50
50
51 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream
51 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/F10" --stream
52 streaming all changes
52 streaming all changes
53 * files to transfer, * KB of data (glob)
53 * files to transfer, * KB of data (glob)
54 transferred * KB in * seconds (* */sec) (glob)
54 transferred * KB in * seconds (* */sec) (glob)
55
55
56 $ cd narrow
56 $ cd narrow
57 $ ls -A
57 $ ls -A
58 .hg
58 .hg
59 $ hg tracked
59 $ hg tracked
60 I path:dir/src/F10
60 I path:dir/src/F10
61
61
62 Making sure we have the correct set of requirements
62 Making sure we have the correct set of requirements
63
63
64 $ hg debugrequires
64 $ hg debugrequires
65 dotencode (tree !)
65 dotencode (tree !)
66 dotencode (flat-fncache !)
66 dotencode (flat-fncache !)
67 dirstate-v2 (dirstate-v2 !)
67 dirstate-v2 (dirstate-v2 !)
68 fncache (tree !)
68 fncache (tree !)
69 fncache (flat-fncache !)
69 fncache (flat-fncache !)
70 generaldelta
70 generaldelta
71 narrowhg-experimental
71 narrowhg-experimental
72 persistent-nodemap (rust !)
72 persistent-nodemap (rust !)
73 revlog-compression-zstd (zstd !)
73 revlog-compression-zstd (zstd !)
74 revlogv1
74 revlogv1
75 share-safe
75 share-safe
76 sparserevlog
76 sparserevlog
77 store
77 store
78 treemanifest (tree !)
78 treemanifest (tree !)
79
79
80 Making sure store has the required files
80 Making sure store has the required files
81
81
82 $ ls .hg/store/
82 $ ls .hg/store/
83 00changelog-????????.nd (glob) (rust !)
84 00changelog.d
83 00changelog.i
85 00changelog.i
86 00changelog.n (rust !)
84 00manifest.i
87 00manifest.i
85 data
88 data
86 fncache (tree !)
89 fncache (tree !)
87 fncache (flat-fncache !)
90 fncache (flat-fncache !)
88 meta (tree !)
91 meta (tree !)
89 narrowspec
92 narrowspec
90 requires
93 requires
91 undo
94 undo
92 undo.backupfiles
95 undo.backupfiles
93
96
94 Checking that repository has all the required data and not broken
97 Checking that repository has all the required data and not broken
95
98
96 $ hg verify
99 $ hg verify
97 checking changesets
100 checking changesets
98 checking manifests
101 checking manifests
99 checking directory manifests (tree !)
102 checking directory manifests (tree !)
100 crosschecking files in changesets and manifests
103 crosschecking files in changesets and manifests
101 checking files
104 checking files
102 checking dirstate
105 checking dirstate
103 checked 40 changesets with 1 changes to 1 files
106 checked 40 changesets with 1 changes to 1 files
@@ -1,225 +1,225 b''
1 revlog.parseindex must be able to parse the index file even if
1 revlog.parseindex must be able to parse the index file even if
2 an index entry is split between two 64k blocks. The ideal test
2 an index entry is split between two 64k blocks. The ideal test
3 would be to create an index file with inline data where
3 would be to create an index file with inline data where
4 64k < size < 64k + 64 (64k is the size of the read buffer, 64 is
4 64k < size < 64k + 64 (64k is the size of the read buffer, 64 is
5 the size of an index entry) and with an index entry starting right
5 the size of an index entry) and with an index entry starting right
6 before the 64k block boundary, and try to read it.
6 before the 64k block boundary, and try to read it.
7 We approximate that by reducing the read buffer to 1 byte.
7 We approximate that by reducing the read buffer to 1 byte.
8
8
9 $ hg init a
9 $ hg init a
10 $ cd a
10 $ cd a
11 $ echo abc > foo
11 $ echo abc > foo
12 $ hg add foo
12 $ hg add foo
13 $ hg commit -m 'add foo'
13 $ hg commit -m 'add foo'
14 $ echo >> foo
14 $ echo >> foo
15 $ hg commit -m 'change foo'
15 $ hg commit -m 'change foo'
16 $ hg log -r 0:
16 $ hg log -r 0:
17 changeset: 0:7c31755bf9b5
17 changeset: 0:7c31755bf9b5
18 user: test
18 user: test
19 date: Thu Jan 01 00:00:00 1970 +0000
19 date: Thu Jan 01 00:00:00 1970 +0000
20 summary: add foo
20 summary: add foo
21
21
22 changeset: 1:26333235a41c
22 changeset: 1:26333235a41c
23 tag: tip
23 tag: tip
24 user: test
24 user: test
25 date: Thu Jan 01 00:00:00 1970 +0000
25 date: Thu Jan 01 00:00:00 1970 +0000
26 summary: change foo
26 summary: change foo
27
27
28 $ cat >> test.py << EOF
28 $ cat >> test.py << EOF
29 > from mercurial import changelog, node, pycompat, vfs
29 > from mercurial import changelog, node, pycompat, vfs
30 >
30 >
31 > class singlebyteread(object):
31 > class singlebyteread(object):
32 > def __init__(self, real):
32 > def __init__(self, real):
33 > self.real = real
33 > self.real = real
34 >
34 >
35 > def read(self, size=-1):
35 > def read(self, size=-1):
36 > if size == 65536:
36 > if size == 65536:
37 > size = 1
37 > size = 1
38 > return self.real.read(size)
38 > return self.real.read(size)
39 >
39 >
40 > def __getattr__(self, key):
40 > def __getattr__(self, key):
41 > return getattr(self.real, key)
41 > return getattr(self.real, key)
42 >
42 >
43 > def __enter__(self):
43 > def __enter__(self):
44 > self.real.__enter__()
44 > self.real.__enter__()
45 > return self
45 > return self
46 >
46 >
47 > def __exit__(self, *args, **kwargs):
47 > def __exit__(self, *args, **kwargs):
48 > return self.real.__exit__(*args, **kwargs)
48 > return self.real.__exit__(*args, **kwargs)
49 >
49 >
50 > def opener(*args):
50 > def opener(*args):
51 > o = vfs.vfs(*args)
51 > o = vfs.vfs(*args)
52 > def wrapper(*a, **kwargs):
52 > def wrapper(*a, **kwargs):
53 > f = o(*a, **kwargs)
53 > f = o(*a, **kwargs)
54 > return singlebyteread(f)
54 > return singlebyteread(f)
55 > wrapper.options = o.options
55 > wrapper.options = o.options
56 > return wrapper
56 > return wrapper
57 >
57 >
58 > cl = changelog.changelog(opener(b'.hg/store'))
58 > cl = changelog.changelog(opener(b'.hg/store'))
59 > print(len(cl), 'revisions:')
59 > print(len(cl), 'revisions:')
60 > for r in cl:
60 > for r in cl:
61 > print(pycompat.sysstr(node.short(cl.node(r))))
61 > print(pycompat.sysstr(node.short(cl.node(r))))
62 > EOF
62 > EOF
63 $ "$PYTHON" test.py
63 $ "$PYTHON" test.py
64 2 revisions:
64 2 revisions:
65 7c31755bf9b5
65 7c31755bf9b5
66 26333235a41c
66 26333235a41c
67
67
68 $ cd ..
68 $ cd ..
69
69
70 #if no-pure
70 #if no-pure
71
71
72 Test SEGV caused by bad revision passed to reachableroots() (issue4775):
72 Test SEGV caused by bad revision passed to reachableroots() (issue4775):
73
73
74 $ cd a
74 $ cd a
75
75
76 $ "$PYTHON" <<EOF
76 $ "$PYTHON" <<EOF
77 > from mercurial import changelog, vfs
77 > from mercurial import changelog, vfs
78 > cl = changelog.changelog(vfs.vfs(b'.hg/store'))
78 > cl = changelog.changelog(vfs.vfs(b'.hg/store'))
79 > print('good heads:')
79 > print('good heads:')
80 > for head in [0, len(cl) - 1, -1]:
80 > for head in [0, len(cl) - 1, -1]:
81 > print('%s: %r' % (head, cl.reachableroots(0, [head], [0])))
81 > print('%s: %r' % (head, cl.reachableroots(0, [head], [0])))
82 > print('bad heads:')
82 > print('bad heads:')
83 > for head in [len(cl), 10000, -2, -10000, None]:
83 > for head in [len(cl), 10000, -2, -10000, None]:
84 > print('%s:' % head, end=' ')
84 > print('%s:' % head, end=' ')
85 > try:
85 > try:
86 > cl.reachableroots(0, [head], [0])
86 > cl.reachableroots(0, [head], [0])
87 > print('uncaught buffer overflow?')
87 > print('uncaught buffer overflow?')
88 > except (IndexError, TypeError) as inst:
88 > except (IndexError, TypeError) as inst:
89 > print(inst)
89 > print(inst)
90 > print('good roots:')
90 > print('good roots:')
91 > for root in [0, len(cl) - 1, -1]:
91 > for root in [0, len(cl) - 1, -1]:
92 > print('%s: %r' % (root, cl.reachableroots(root, [len(cl) - 1], [root])))
92 > print('%s: %r' % (root, cl.reachableroots(root, [len(cl) - 1], [root])))
93 > print('out-of-range roots are ignored:')
93 > print('out-of-range roots are ignored:')
94 > for root in [len(cl), 10000, -2, -10000]:
94 > for root in [len(cl), 10000, -2, -10000]:
95 > print('%s: %r' % (root, cl.reachableroots(root, [len(cl) - 1], [root])))
95 > print('%s: %r' % (root, cl.reachableroots(root, [len(cl) - 1], [root])))
96 > print('bad roots:')
96 > print('bad roots:')
97 > for root in [None]:
97 > for root in [None]:
98 > print('%s:' % root, end=' ')
98 > print('%s:' % root, end=' ')
99 > try:
99 > try:
100 > cl.reachableroots(root, [len(cl) - 1], [root])
100 > cl.reachableroots(root, [len(cl) - 1], [root])
101 > print('uncaught error?')
101 > print('uncaught error?')
102 > except TypeError as inst:
102 > except TypeError as inst:
103 > print(inst)
103 > print(inst)
104 > EOF
104 > EOF
105 good heads:
105 good heads:
106 0: [0]
106 0: [0]
107 1: [0]
107 1: [0]
108 -1: []
108 -1: []
109 bad heads:
109 bad heads:
110 2: head out of range
110 2: head out of range
111 10000: head out of range
111 10000: head out of range
112 -2: head out of range
112 -2: head out of range
113 -10000: head out of range
113 -10000: head out of range
114 None: (an integer is required( .got type NoneType.)?|'NoneType' object cannot be interpreted as an integer) (re)
114 None: (an integer is required( .got type NoneType.)?|'NoneType' object cannot be interpreted as an integer) (re)
115 good roots:
115 good roots:
116 0: [0]
116 0: [0]
117 1: [1]
117 1: [1]
118 -1: [-1]
118 -1: [-1]
119 out-of-range roots are ignored:
119 out-of-range roots are ignored:
120 2: []
120 2: []
121 10000: []
121 10000: []
122 -2: []
122 -2: []
123 -10000: []
123 -10000: []
124 bad roots:
124 bad roots:
125 None: (an integer is required( .got type NoneType.)?|'NoneType' object cannot be interpreted as an integer) (re)
125 None: (an integer is required( .got type NoneType.)?|'NoneType' object cannot be interpreted as an integer) (re)
126
126
127 $ cd ..
127 $ cd ..
128
128
129 Test corrupted p1/p2 fields that could cause SEGV at parsers.c:
129 Test corrupted p1/p2 fields that could cause SEGV at parsers.c:
130
130
131 $ mkdir invalidparent
131 $ mkdir invalidparent
132 $ cd invalidparent
132 $ cd invalidparent
133
133
134 $ hg clone --pull -q --config phases.publish=False ../a limit --config format.sparse-revlog=no
134 $ hg clone --pull -q --config phases.publish=False ../a limit --config format.sparse-revlog=no
135 $ hg clone --pull -q --config phases.publish=False ../a neglimit --config format.sparse-revlog=no
135 $ hg clone --pull -q --config phases.publish=False ../a neglimit --config format.sparse-revlog=no
136 $ hg clone --pull -q --config phases.publish=False ../a segv --config format.sparse-revlog=no
136 $ hg clone --pull -q --config phases.publish=False ../a segv --config format.sparse-revlog=no
137 $ rm -R limit/.hg/cache neglimit/.hg/cache segv/.hg/cache
137 $ rm -R limit/.hg/cache neglimit/.hg/cache segv/.hg/cache
138
138
139 $ "$PYTHON" <<EOF
139 $ "$PYTHON" <<EOF
140 > data = open("limit/.hg/store/00changelog.i", "rb").read()
140 > data = open("limit/.hg/store/00changelog.i", "rb").read()
141 > poisons = [
141 > poisons = [
142 > (b'limit', b'\0\0\0\x02'),
142 > (b'limit', b'\0\0\0\x02'),
143 > (b'neglimit', b'\xff\xff\xff\xfe'),
143 > (b'neglimit', b'\xff\xff\xff\xfe'),
144 > (b'segv', b'\0\x01\0\0'),
144 > (b'segv', b'\0\x01\0\0'),
145 > ]
145 > ]
146 > for n, p in poisons:
146 > for n, p in poisons:
147 > # corrupt p1 at rev0 and p2 at rev1
147 > # corrupt p1 at rev0 and p2 at rev1
148 > rev_0 = data[:64 + 63]
148 > rev_0 = data[:64]
149 > rev_1 = data[64 + 63:]
149 > rev_1 = data[64:]
150 > altered_rev_0 = rev_0[:24] + p + rev_0[24 + 4:]
150 > altered_rev_0 = rev_0[:24] + p + rev_0[24 + 4:]
151 > altered_rev_1 = rev_1[:28] + p + rev_1[28 + 4:]
151 > altered_rev_1 = rev_1[:28] + p + rev_1[28 + 4:]
152 > new_data = altered_rev_0 + altered_rev_1
152 > new_data = altered_rev_0 + altered_rev_1
153 > with open(n + b"/.hg/store/00changelog.i", "wb") as f:
153 > with open(n + b"/.hg/store/00changelog.i", "wb") as f:
154 > f.write(new_data)
154 > f.write(new_data)
155 > EOF
155 > EOF
156
156
157 $ hg -R limit debugrevlogindex -f1 -c
157 $ hg -R limit debugrevlogindex -f1 -c
158 rev flag size link p1 p2 nodeid
158 rev flag size link p1 p2 nodeid
159 0 0000 62 0 2 -1 7c31755bf9b5
159 0 0000 62 0 2 -1 7c31755bf9b5
160 1 0000 65 1 0 2 26333235a41c
160 1 0000 65 1 0 2 26333235a41c
161
161
162 $ hg -R limit debugdeltachain -c
162 $ hg -R limit debugdeltachain -c
163 rev p1 p2 chain# chainlen prev delta
163 rev p1 p2 chain# chainlen prev delta
164 0 2 -1 1 1 -1 base
164 0 2 -1 1 1 -1 base
165 1 0 2 2 1 -1 base
165 1 0 2 2 1 -1 base
166
166
167 $ hg -R neglimit debugrevlogindex -f1 -c
167 $ hg -R neglimit debugrevlogindex -f1 -c
168 rev flag size link p1 p2 nodeid
168 rev flag size link p1 p2 nodeid
169 0 0000 62 0 -2 -1 7c31755bf9b5
169 0 0000 62 0 -2 -1 7c31755bf9b5
170 1 0000 65 1 0 -2 26333235a41c
170 1 0000 65 1 0 -2 26333235a41c
171
171
172 $ hg -R segv debugrevlogindex -f1 -c
172 $ hg -R segv debugrevlogindex -f1 -c
173 rev flag size link p1 p2 nodeid
173 rev flag size link p1 p2 nodeid
174 0 0000 62 0 65536 -1 7c31755bf9b5
174 0 0000 62 0 65536 -1 7c31755bf9b5
175 1 0000 65 1 0 65536 26333235a41c
175 1 0000 65 1 0 65536 26333235a41c
176
176
177 $ hg -R segv debugdeltachain -c
177 $ hg -R segv debugdeltachain -c
178 rev p1 p2 chain# chainlen prev delta
178 rev p1 p2 chain# chainlen prev delta
179 0 65536 -1 1 1 -1 base
179 0 65536 -1 1 1 -1 base
180 1 0 65536 2 1 -1 base
180 1 0 65536 2 1 -1 base
181
181
182 $ cat <<EOF > test.py
182 $ cat <<EOF > test.py
183 > import sys
183 > import sys
184 > from mercurial import changelog, pycompat, vfs
184 > from mercurial import changelog, pycompat, vfs
185 > cl = changelog.changelog(vfs.vfs(pycompat.fsencode(sys.argv[1])))
185 > cl = changelog.changelog(vfs.vfs(pycompat.fsencode(sys.argv[1])))
186 > n0, n1 = cl.node(0), cl.node(1)
186 > n0, n1 = cl.node(0), cl.node(1)
187 > ops = [
187 > ops = [
188 > ('reachableroots',
188 > ('reachableroots',
189 > lambda: cl.index.reachableroots2(0, [1], [0], False)),
189 > lambda: cl.index.reachableroots2(0, [1], [0], False)),
190 > ('compute_phases_map_sets', lambda: cl.computephases({1: {cl.node(0)}})),
190 > ('compute_phases_map_sets', lambda: cl.computephases({1: {cl.node(0)}})),
191 > ('index_headrevs', lambda: cl.headrevs()),
191 > ('index_headrevs', lambda: cl.headrevs()),
192 > ('find_gca_candidates', lambda: cl.commonancestorsheads(n0, n1)),
192 > ('find_gca_candidates', lambda: cl.commonancestorsheads(n0, n1)),
193 > ('find_deepest', lambda: cl.ancestor(n0, n1)),
193 > ('find_deepest', lambda: cl.ancestor(n0, n1)),
194 > ]
194 > ]
195 > for l, f in ops:
195 > for l, f in ops:
196 > print(l + ':', end=' ')
196 > print(l + ':', end=' ')
197 > try:
197 > try:
198 > f()
198 > f()
199 > print('uncaught buffer overflow?')
199 > print('uncaught buffer overflow?')
200 > except ValueError as inst:
200 > except ValueError as inst:
201 > print(inst)
201 > print(inst)
202 > EOF
202 > EOF
203
203
204 $ "$PYTHON" test.py limit/.hg/store
204 $ "$PYTHON" test.py limit/.hg/store
205 reachableroots: parent out of range
205 reachableroots: parent out of range
206 compute_phases_map_sets: parent out of range
206 compute_phases_map_sets: parent out of range
207 index_headrevs: parent out of range
207 index_headrevs: parent out of range
208 find_gca_candidates: parent out of range
208 find_gca_candidates: parent out of range
209 find_deepest: parent out of range
209 find_deepest: parent out of range
210 $ "$PYTHON" test.py neglimit/.hg/store
210 $ "$PYTHON" test.py neglimit/.hg/store
211 reachableroots: parent out of range
211 reachableroots: parent out of range
212 compute_phases_map_sets: parent out of range
212 compute_phases_map_sets: parent out of range
213 index_headrevs: parent out of range
213 index_headrevs: parent out of range
214 find_gca_candidates: parent out of range
214 find_gca_candidates: parent out of range
215 find_deepest: parent out of range
215 find_deepest: parent out of range
216 $ "$PYTHON" test.py segv/.hg/store
216 $ "$PYTHON" test.py segv/.hg/store
217 reachableroots: parent out of range
217 reachableroots: parent out of range
218 compute_phases_map_sets: parent out of range
218 compute_phases_map_sets: parent out of range
219 index_headrevs: parent out of range
219 index_headrevs: parent out of range
220 find_gca_candidates: parent out of range
220 find_gca_candidates: parent out of range
221 find_deepest: parent out of range
221 find_deepest: parent out of range
222
222
223 $ cd ..
223 $ cd ..
224
224
225 #endif
225 #endif
@@ -1,125 +1,125 b''
1 #testcases skip-detection fail-if-detected
1 #testcases skip-detection fail-if-detected
2
2
3 Test situations that "should" only be reproducible:
3 Test situations that "should" only be reproducible:
4 - on networked filesystems, or
4 - on networked filesystems, or
5 - user using `hg debuglocks` to eliminate the lock file, or
5 - user using `hg debuglocks` to eliminate the lock file, or
6 - something (that doesn't respect the lock file) writing to the .hg directory
6 - something (that doesn't respect the lock file) writing to the .hg directory
7 while we're running
7 while we're running
8
8
9
9
10 Initial setup
10 Initial setup
11 -------------
11 -------------
12
12
13 $ hg init base-repo
13 $ hg init base-repo
14 $ cd base-repo
14 $ cd base-repo
15
15
16 $ cat > "$TESTTMP_FORWARD_SLASH/waitlock_editor.sh" <<EOF
16 $ cat > "$TESTTMP_FORWARD_SLASH/waitlock_editor.sh" <<EOF
17 > [ -n "\${WAITLOCK_ANNOUNCE:-}" ] && touch "\${WAITLOCK_ANNOUNCE}"
17 > [ -n "\${WAITLOCK_ANNOUNCE:-}" ] && touch "\${WAITLOCK_ANNOUNCE}"
18 > f="\${WAITLOCK_FILE}"
18 > f="\${WAITLOCK_FILE}"
19 > start=\`date +%s\`
19 > start=\`date +%s\`
20 > timeout=5
20 > timeout=5
21 > "$RUNTESTDIR_FORWARD_SLASH/testlib/wait-on-file" "\$timeout" "\$f"
21 > "$RUNTESTDIR_FORWARD_SLASH/testlib/wait-on-file" "\$timeout" "\$f"
22 > if [ \$# -gt 1 ]; then
22 > if [ \$# -gt 1 ]; then
23 > cat "\$@"
23 > cat "\$@"
24 > fi
24 > fi
25 > EOF
25 > EOF
26
26
27 Things behave differently if we don't already have a 00changelog.i file when
27 Things behave differently if we don't already have a 00changelog.i file when
28 this all starts, so let's make one.
28 this all starts, so let's make one.
29
29
30 $ echo r0 > r0
30 $ echo r0 > r0
31 $ hg commit -qAm 'r0'
31 $ hg commit -qAm 'r0'
32
32
33 $ cd ..
33 $ cd ..
34 $ cp -R base-repo main-client
34 $ cp -R base-repo main-client
35 $ cp -R base-repo racing-client
35 $ cp -R base-repo racing-client
36
36
37 $ mkdir sync
37 $ mkdir sync
38 $ EDITOR_STARTED="$TESTTMP_FORWARD_SLASH/sync/.editor_started"
38 $ EDITOR_STARTED="$TESTTMP_FORWARD_SLASH/sync/.editor_started"
39 $ MISCHIEF_MANAGED="$TESTTMP_FORWARD_SLASH/sync/.mischief_managed"
39 $ MISCHIEF_MANAGED="$TESTTMP_FORWARD_SLASH/sync/.mischief_managed"
40 $ JOBS_FINISHED="$TESTTMP_FORWARD_SLASH/sync/.jobs_finished"
40 $ JOBS_FINISHED="$TESTTMP_FORWARD_SLASH/sync/.jobs_finished"
41
41
42 Actual test
42 Actual test
43 -----------
43 -----------
44
44
45 Start an hg commit that will take a while
45 Start an hg commit that will take a while
46
46
47 $ cd main-client
47 $ cd main-client
48
48
49 #if fail-if-detected
49 #if fail-if-detected
50 $ cat >> $HGRCPATH << EOF
50 $ cat >> $HGRCPATH << EOF
51 > [debug]
51 > [debug]
52 > revlog.verifyposition.changelog = fail
52 > revlog.verifyposition.changelog = fail
53 > EOF
53 > EOF
54 #endif
54 #endif
55
55
56 $ echo foo > foo
56 $ echo foo > foo
57 $ (
57 $ (
58 > unset HGEDITOR;
58 > unset HGEDITOR;
59 > WAITLOCK_ANNOUNCE="${EDITOR_STARTED}" \
59 > WAITLOCK_ANNOUNCE="${EDITOR_STARTED}" \
60 > WAITLOCK_FILE="${MISCHIEF_MANAGED}" \
60 > WAITLOCK_FILE="${MISCHIEF_MANAGED}" \
61 > hg commit -qAm 'r1 (foo)' --edit foo \
61 > hg commit -qAm 'r1 (foo)' --edit foo \
62 > --config ui.editor="sh $TESTTMP_FORWARD_SLASH/waitlock_editor.sh" \
62 > --config ui.editor="sh $TESTTMP_FORWARD_SLASH/waitlock_editor.sh" \
63 > > .foo_commit_out 2>&1 ;\
63 > > .foo_commit_out 2>&1 ;\
64 > touch "${JOBS_FINISHED}"
64 > touch "${JOBS_FINISHED}"
65 > ) &
65 > ) &
66
66
67 Wait for the "editor" to actually start
67 Wait for the "editor" to actually start
68 $ sh "$RUNTESTDIR_FORWARD_SLASH/testlib/wait-on-file" 5 "${EDITOR_STARTED}"
68 $ sh "$RUNTESTDIR_FORWARD_SLASH/testlib/wait-on-file" 5 "${EDITOR_STARTED}"
69
69
70
70
71 Do a concurrent edition
71 Do a concurrent edition
72 $ cd ../racing-client
72 $ cd ../racing-client
73 $ touch ../pre-race
73 $ touch ../pre-race
74 $ sleep 1
74 $ sleep 1
75 $ echo bar > bar
75 $ echo bar > bar
76 $ hg --repository ../racing-client commit -qAm 'r2 (bar)' bar
76 $ hg --repository ../racing-client commit -qAm 'r2 (bar)' bar
77 $ hg --repository ../racing-client debugrevlogindex -c
77 $ hg --repository ../racing-client debugrevlogindex -c
78 rev linkrev nodeid p1 p2
78 rev linkrev nodeid p1 p2
79 0 0 222799e2f90b 000000000000 000000000000
79 0 0 222799e2f90b 000000000000 000000000000
80 1 1 6f124f6007a0 222799e2f90b 000000000000
80 1 1 6f124f6007a0 222799e2f90b 000000000000
81
81
82 We simulate an network FS race by overwriting raced repo content with the new
82 We simulate an network FS race by overwriting raced repo content with the new
83 content of the files changed in the racing repository
83 content of the files changed in the racing repository
84
84
85 $ for x in `find . -type f -newer ../pre-race`; do
85 $ for x in `find . -type f -newer ../pre-race`; do
86 > cp $x ../main-client/$x
86 > cp $x ../main-client/$x
87 > done
87 > done
88 $ cd ../main-client
88 $ cd ../main-client
89
89
90 Awaken the editor from that first commit
90 Awaken the editor from that first commit
91 $ touch "${MISCHIEF_MANAGED}"
91 $ touch "${MISCHIEF_MANAGED}"
92 And wait for it to finish
92 And wait for it to finish
93 $ WAITLOCK_FILE="${JOBS_FINISHED}" sh "$TESTTMP_FORWARD_SLASH/waitlock_editor.sh"
93 $ WAITLOCK_FILE="${JOBS_FINISHED}" sh "$TESTTMP_FORWARD_SLASH/waitlock_editor.sh"
94
94
95 #if skip-detection
95 #if skip-detection
96 (Ensure there was no output)
96 (Ensure there was no output)
97 $ cat .foo_commit_out
97 $ cat .foo_commit_out
98 And observe a corrupted repository -- rev 2's linkrev is 1, which should never
98 And observe a corrupted repository -- rev 2's linkrev is 1, which should never
99 happen for the changelog (the linkrev should always refer to itself).
99 happen for the changelog (the linkrev should always refer to itself).
100 $ hg debugrevlogindex -c
100 $ hg debugrevlogindex -c
101 rev linkrev nodeid p1 p2
101 rev linkrev nodeid p1 p2
102 0 0 222799e2f90b 000000000000 000000000000
102 0 0 222799e2f90b 000000000000 000000000000
103 1 1 6f124f6007a0 222799e2f90b 000000000000
103 1 1 6f124f6007a0 222799e2f90b 000000000000
104 2 1 ac80e6205bb2 222799e2f90b 000000000000
104 2 1 ac80e6205bb2 222799e2f90b 000000000000
105 #endif
105 #endif
106
106
107 #if fail-if-detected
107 #if fail-if-detected
108 $ cat .foo_commit_out
108 $ cat .foo_commit_out
109 note: commit message saved in .hg/last-message.txt
109 note: commit message saved in .hg/last-message.txt
110 note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it
110 note: use 'hg commit --logfile .hg/last-message.txt --edit' to reuse it
111 transaction abort!
111 transaction abort!
112 rollback completed
112 rollback completed
113 abort: 00changelog.i: file cursor at position 249, expected 121
113 abort: 00changelog.i: file cursor at position 128, expected 64
114 And no corruption in the changelog.
114 And no corruption in the changelog.
115 $ hg debugrevlogindex -c
115 $ hg debugrevlogindex -c
116 rev linkrev nodeid p1 p2
116 rev linkrev nodeid p1 p2
117 0 0 222799e2f90b 000000000000 000000000000
117 0 0 222799e2f90b 000000000000 000000000000
118 1 1 6f124f6007a0 222799e2f90b 000000000000 (missing-correct-output !)
118 1 1 6f124f6007a0 222799e2f90b 000000000000 (missing-correct-output !)
119 And, because of transactions, there's none in the manifestlog either.
119 And, because of transactions, there's none in the manifestlog either.
120 $ hg debugrevlogindex -m
120 $ hg debugrevlogindex -m
121 rev linkrev nodeid p1 p2
121 rev linkrev nodeid p1 p2
122 0 0 7b7020262a56 000000000000 000000000000
122 0 0 7b7020262a56 000000000000 000000000000
123 1 1 ad3fe36d86d9 7b7020262a56 000000000000
123 1 1 ad3fe36d86d9 7b7020262a56 000000000000
124 #endif
124 #endif
125
125
@@ -1,108 +1,110 b''
1 #require hardlink
1 #require hardlink
2
2
3 $ echo "[extensions]" >> $HGRCPATH
3 $ echo "[extensions]" >> $HGRCPATH
4 $ echo "relink=" >> $HGRCPATH
4 $ echo "relink=" >> $HGRCPATH
5
5
6 $ fix_path() {
6 $ fix_path() {
7 > tr '\\' /
7 > tr '\\' /
8 > }
8 > }
9
9
10 $ cat > arelinked.py <<EOF
10 $ cat > arelinked.py <<EOF
11 > import os
11 > import os
12 > import sys
12 > import sys
13 > from mercurial import (
13 > from mercurial import (
14 > pycompat,
14 > pycompat,
15 > util,
15 > util,
16 > )
16 > )
17 > path1, path2 = sys.argv[1:3]
17 > path1, path2 = sys.argv[1:3]
18 > if util.samefile(pycompat.fsencode(path1), pycompat.fsencode(path2)):
18 > if util.samefile(pycompat.fsencode(path1), pycompat.fsencode(path2)):
19 > print('%s == %s' % (path1, path2))
19 > print('%s == %s' % (path1, path2))
20 > else:
20 > else:
21 > print('%s != %s' % (path1, path2))
21 > print('%s != %s' % (path1, path2))
22 > EOF
22 > EOF
23
23
24
24
25 create source repository
25 create source repository
26
26
27 $ hg init repo
27 $ hg init repo
28 $ cd repo
28 $ cd repo
29 $ echo a > a
29 $ echo a > a
30 $ echo b > b
30 $ echo b > b
31 $ hg ci -Am addfile
31 $ hg ci -Am addfile
32 adding a
32 adding a
33 adding b
33 adding b
34 $ cat "$TESTDIR/binfile.bin" >> a
34 $ cat "$TESTDIR/binfile.bin" >> a
35 $ cat "$TESTDIR/binfile.bin" >> b
35 $ cat "$TESTDIR/binfile.bin" >> b
36 $ hg ci -Am changefiles
36 $ hg ci -Am changefiles
37
37
38 make another commit to create files larger than 1 KB to test
38 make another commit to create files larger than 1 KB to test
39 formatting of final byte count
39 formatting of final byte count
40
40
41 $ cat "$TESTDIR/binfile.bin" >> a
41 $ cat "$TESTDIR/binfile.bin" >> a
42 $ cat "$TESTDIR/binfile.bin" >> b
42 $ cat "$TESTDIR/binfile.bin" >> b
43 $ hg ci -m anotherchange
43 $ hg ci -m anotherchange
44
44
45 don't sit forever trying to double-lock the source repo
45 don't sit forever trying to double-lock the source repo
46
46
47 $ hg relink .
47 $ hg relink .
48 relinking $TESTTMP/repo/.hg/store to $TESTTMP/repo/.hg/store
48 relinking $TESTTMP/repo/.hg/store to $TESTTMP/repo/.hg/store
49 there is nothing to relink
49 there is nothing to relink
50
50
51
51
52 Test files are read in binary mode
52 Test files are read in binary mode
53
53
54 $ "$PYTHON" -c "open('.hg/store/data/dummy.i', 'wb').write(b'a\r\nb\n')"
54 $ "$PYTHON" -c "open('.hg/store/data/dummy.i', 'wb').write(b'a\r\nb\n')"
55 $ cd ..
55 $ cd ..
56
56
57
57
58 clone and pull to break links
58 clone and pull to break links
59
59
60 $ hg clone --pull -r0 repo clone
60 $ hg clone --pull -r0 repo clone
61 adding changesets
61 adding changesets
62 adding manifests
62 adding manifests
63 adding file changes
63 adding file changes
64 added 1 changesets with 2 changes to 2 files
64 added 1 changesets with 2 changes to 2 files
65 new changesets 008c0c271c47
65 new changesets 008c0c271c47
66 updating to branch default
66 updating to branch default
67 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
67 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 $ cd clone
68 $ cd clone
69 $ hg pull -q
69 $ hg pull -q
70 $ echo b >> b
70 $ echo b >> b
71 $ hg ci -m changeb
71 $ hg ci -m changeb
72 created new head
72 created new head
73 $ "$PYTHON" -c "open('.hg/store/data/dummy.i', 'wb').write(b'a\nb\r\n')"
73 $ "$PYTHON" -c "open('.hg/store/data/dummy.i', 'wb').write(b'a\nb\r\n')"
74
74
75
75
76 relink
76 relink
77
77
78 #if no-reposimplestore
78 #if no-reposimplestore
79
79
80 $ hg relink --debug --config progress.debug=true | fix_path
80 $ hg relink --debug --config progress.debug=true | fix_path
81 relinking $TESTTMP/repo/.hg/store to $TESTTMP/clone/.hg/store
81 relinking $TESTTMP/repo/.hg/store to $TESTTMP/clone/.hg/store
82 tip has 2 files, estimated total number of files: 3
82 tip has 2 files, estimated total number of files: 3
83 collecting: 00changelog.i 1/3 files (33.33%)
83 collecting: 00changelog.d 1/3 files (33.33%)
84 collecting: 00manifest.i 2/3 files (66.67%)
84 collecting: 00changelog.i 2/3 files (66.67%)
85 collecting: a.i 3/3 files (100.00%)
85 collecting: 00manifest.i 3/3 files (100.00%)
86 collecting: b.i 4/3 files (133.33%)
86 collecting: a.i 4/3 files (133.33%)
87 collecting: dummy.i 5/3 files (166.67%)
87 collecting: b.i 5/3 files (166.67%)
88 collected 5 candidate storage files
88 collecting: dummy.i 6/3 files (200.00%)
89 collected 6 candidate storage files
90 not linkable: 00changelog.d
89 not linkable: 00changelog.i
91 not linkable: 00changelog.i
90 not linkable: 00manifest.i
92 not linkable: 00manifest.i
91 pruning: data/a.i 3/5 files (60.00%)
93 pruning: data/a.i 4/6 files (66.67%)
92 not linkable: data/b.i
94 not linkable: data/b.i
93 pruning: data/dummy.i 5/5 files (100.00%)
95 pruning: data/dummy.i 6/6 files (100.00%)
94 pruned down to 2 probably relinkable files
96 pruned down to 2 probably relinkable files
95 relinking: data/a.i 1/2 files (50.00%)
97 relinking: data/a.i 1/2 files (50.00%)
96 not linkable: data/dummy.i
98 not linkable: data/dummy.i
97 relinked 1 files (1.36 KB reclaimed)
99 relinked 1 files (1.36 KB reclaimed)
98 $ cd ..
100 $ cd ..
99
101
100
102
101 check hardlinks
103 check hardlinks
102
104
103 $ "$PYTHON" arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
105 $ "$PYTHON" arelinked.py repo/.hg/store/data/a.i clone/.hg/store/data/a.i
104 repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
106 repo/.hg/store/data/a.i == clone/.hg/store/data/a.i
105 $ "$PYTHON" arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
107 $ "$PYTHON" arelinked.py repo/.hg/store/data/b.i clone/.hg/store/data/b.i
106 repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
108 repo/.hg/store/data/b.i != clone/.hg/store/data/b.i
107
109
108 #endif
110 #endif
@@ -1,356 +1,358 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
5 > [devel]
5 > [devel]
6 > remotefilelog.bg-wait=True
6 > remotefilelog.bg-wait=True
7 > EOF
7 > EOF
8
8
9 $ hg init master
9 $ hg init master
10 $ cd master
10 $ cd master
11 $ cat >> .hg/hgrc <<EOF
11 $ cat >> .hg/hgrc <<EOF
12 > [remotefilelog]
12 > [remotefilelog]
13 > server=True
13 > server=True
14 > EOF
14 > EOF
15 $ echo x > x
15 $ echo x > x
16 $ echo z > z
16 $ echo z > z
17 $ hg commit -qAm x
17 $ hg commit -qAm x
18 $ echo x2 > x
18 $ echo x2 > x
19 $ echo y > y
19 $ echo y > y
20 $ hg commit -qAm y
20 $ hg commit -qAm y
21 $ echo w > w
21 $ echo w > w
22 $ rm z
22 $ rm z
23 $ hg commit -qAm w
23 $ hg commit -qAm w
24 $ hg bookmark foo
24 $ hg bookmark foo
25
25
26 $ cd ..
26 $ cd ..
27
27
28 # clone the repo
28 # clone the repo
29
29
30 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
30 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
31 streaming all changes
31 streaming all changes
32 2 files to transfer, 776 bytes of data (no-zstd !)
32 3 files to transfer, 776 bytes of data (no-zstd !)
33 transferred 776 bytes in * seconds (*/sec) (glob) (no-zstd !)
33 transferred 776 bytes in * seconds (*/sec) (glob) (no-zstd !)
34 2 files to transfer, 784 bytes of data (zstd !)
34 3 files to transfer, 784 bytes of data (zstd no-rust !)
35 transferred 784 bytes in * seconds (* */sec) (glob) (zstd !)
35 transferred 784 bytes in * seconds (*/sec) (glob) (zstd no-rust !)
36 5 files to transfer, 910 bytes of data (rust !)
37 transferred 910 bytes in * seconds (*/sec) (glob) (rust !)
36 searching for changes
38 searching for changes
37 no changes found
39 no changes found
38
40
39 # Set the prefetchdays config to zero so that all commits are prefetched
41 # Set the prefetchdays config to zero so that all commits are prefetched
40 # no matter what their creation date is. Also set prefetchdelay config
42 # no matter what their creation date is. Also set prefetchdelay config
41 # to zero so that there is no delay between prefetches.
43 # to zero so that there is no delay between prefetches.
42 $ cd shallow
44 $ cd shallow
43 $ cat >> .hg/hgrc <<EOF
45 $ cat >> .hg/hgrc <<EOF
44 > [remotefilelog]
46 > [remotefilelog]
45 > prefetchdays=0
47 > prefetchdays=0
46 > prefetchdelay=0
48 > prefetchdelay=0
47 > EOF
49 > EOF
48 $ cd ..
50 $ cd ..
49
51
50 # prefetch a revision
52 # prefetch a revision
51 $ cd shallow
53 $ cd shallow
52
54
53 $ hg prefetch -r 0
55 $ hg prefetch -r 0
54 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
56 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
55
57
56 $ hg cat -r 0 x
58 $ hg cat -r 0 x
57 x
59 x
58
60
59 # background prefetch on pull when configured
61 # background prefetch on pull when configured
60
62
61 $ cat >> .hg/hgrc <<EOF
63 $ cat >> .hg/hgrc <<EOF
62 > [remotefilelog]
64 > [remotefilelog]
63 > pullprefetch=bookmark()
65 > pullprefetch=bookmark()
64 > backgroundprefetch=True
66 > backgroundprefetch=True
65 > EOF
67 > EOF
66 $ hg strip tip
68 $ hg strip tip
67 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
69 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
68 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
70 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
69
71
70 $ clearcache
72 $ clearcache
71 $ hg pull
73 $ hg pull
72 pulling from ssh://user@dummy/master
74 pulling from ssh://user@dummy/master
73 searching for changes
75 searching for changes
74 adding changesets
76 adding changesets
75 adding manifests
77 adding manifests
76 adding file changes
78 adding file changes
77 updating bookmark foo
79 updating bookmark foo
78 added 1 changesets with 0 changes to 0 files
80 added 1 changesets with 0 changes to 0 files
79 new changesets 6b4b6f66ef8c
81 new changesets 6b4b6f66ef8c
80 (run 'hg update' to get a working copy)
82 (run 'hg update' to get a working copy)
81 prefetching file contents
83 prefetching file contents
82 $ find $CACHEDIR -type f | sort
84 $ find $CACHEDIR -type f | sort
83 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
85 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
84 $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
86 $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
85 $TESTTMP/hgcache/master/af/f024fe4ab0fece4091de044c58c9ae4233383a/bb6ccd5dceaa5e9dc220e0dad65e051b94f69a2c
87 $TESTTMP/hgcache/master/af/f024fe4ab0fece4091de044c58c9ae4233383a/bb6ccd5dceaa5e9dc220e0dad65e051b94f69a2c
86 $TESTTMP/hgcache/repos
88 $TESTTMP/hgcache/repos
87
89
88 # background prefetch with repack on pull when configured
90 # background prefetch with repack on pull when configured
89
91
90 $ cat >> .hg/hgrc <<EOF
92 $ cat >> .hg/hgrc <<EOF
91 > [remotefilelog]
93 > [remotefilelog]
92 > backgroundrepack=True
94 > backgroundrepack=True
93 > EOF
95 > EOF
94 $ hg strip tip
96 $ hg strip tip
95 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
97 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/6b4b6f66ef8c-b4b8bdaf-backup.hg (glob)
96
98
97 $ clearcache
99 $ clearcache
98 $ hg pull
100 $ hg pull
99 pulling from ssh://user@dummy/master
101 pulling from ssh://user@dummy/master
100 searching for changes
102 searching for changes
101 adding changesets
103 adding changesets
102 adding manifests
104 adding manifests
103 adding file changes
105 adding file changes
104 updating bookmark foo
106 updating bookmark foo
105 added 1 changesets with 0 changes to 0 files
107 added 1 changesets with 0 changes to 0 files
106 new changesets 6b4b6f66ef8c
108 new changesets 6b4b6f66ef8c
107 (run 'hg update' to get a working copy)
109 (run 'hg update' to get a working copy)
108 prefetching file contents
110 prefetching file contents
109 $ find $CACHEDIR -type f | sort
111 $ find $CACHEDIR -type f | sort
110 $TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histidx
112 $TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histidx
111 $TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histpack
113 $TESTTMP/hgcache/master/packs/6e8633deba6e544e5f8edbd7b996d6e31a2c42ae.histpack
112 $TESTTMP/hgcache/master/packs/8ce5ab3745465ab83bba30a7b9c295e0c8404652.dataidx
114 $TESTTMP/hgcache/master/packs/8ce5ab3745465ab83bba30a7b9c295e0c8404652.dataidx
113 $TESTTMP/hgcache/master/packs/8ce5ab3745465ab83bba30a7b9c295e0c8404652.datapack
115 $TESTTMP/hgcache/master/packs/8ce5ab3745465ab83bba30a7b9c295e0c8404652.datapack
114 $TESTTMP/hgcache/repos
116 $TESTTMP/hgcache/repos
115
117
116 # background prefetch with repack on update when wcprevset configured
118 # background prefetch with repack on update when wcprevset configured
117
119
118 $ clearcache
120 $ clearcache
119 $ hg up -r 0
121 $ hg up -r 0
120 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
123 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
122 $ find $CACHEDIR -type f | sort
124 $ find $CACHEDIR -type f | sort
123 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
125 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/1406e74118627694268417491f018a4a883152f0
124 $TESTTMP/hgcache/master/39/5df8f7c51f007019cb30201c49e884b46b92fa/69a1b67522704ec122181c0890bd16e9d3e7516a
126 $TESTTMP/hgcache/master/39/5df8f7c51f007019cb30201c49e884b46b92fa/69a1b67522704ec122181c0890bd16e9d3e7516a
125 $TESTTMP/hgcache/repos
127 $TESTTMP/hgcache/repos
126
128
127 $ hg up -r 1
129 $ hg up -r 1
128 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
129 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
131 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
130
132
131 $ cat >> .hg/hgrc <<EOF
133 $ cat >> .hg/hgrc <<EOF
132 > [remotefilelog]
134 > [remotefilelog]
133 > bgprefetchrevs=.::
135 > bgprefetchrevs=.::
134 > EOF
136 > EOF
135
137
136 $ clearcache
138 $ clearcache
137 $ hg up -r 0
139 $ hg up -r 0
138 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
140 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
139 * files fetched over * fetches - (* misses, 0.00% hit ratio) over *s (glob)
141 * files fetched over * fetches - (* misses, 0.00% hit ratio) over *s (glob)
140 $ find $CACHEDIR -type f | sort
142 $ find $CACHEDIR -type f | sort
141 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
143 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
142 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
144 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
143 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
145 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
144 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
146 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
145 $TESTTMP/hgcache/repos
147 $TESTTMP/hgcache/repos
146
148
147 # Ensure that file 'w' was prefetched - it was not part of the update operation and therefore
149 # Ensure that file 'w' was prefetched - it was not part of the update operation and therefore
148 # could only be downloaded by the background prefetch
150 # could only be downloaded by the background prefetch
149
151
150 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
152 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
151 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
153 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
152 w:
154 w:
153 Node Delta Base Delta Length Blob Size
155 Node Delta Base Delta Length Blob Size
154 bb6ccd5dceaa 000000000000 2 2
156 bb6ccd5dceaa 000000000000 2 2
155
157
156 Total: 2 2 (0.0% bigger)
158 Total: 2 2 (0.0% bigger)
157 x:
159 x:
158 Node Delta Base Delta Length Blob Size
160 Node Delta Base Delta Length Blob Size
159 ef95c5376f34 000000000000 3 3
161 ef95c5376f34 000000000000 3 3
160 1406e7411862 ef95c5376f34 14 2
162 1406e7411862 ef95c5376f34 14 2
161
163
162 Total: 17 5 (240.0% bigger)
164 Total: 17 5 (240.0% bigger)
163 y:
165 y:
164 Node Delta Base Delta Length Blob Size
166 Node Delta Base Delta Length Blob Size
165 076f5e2225b3 000000000000 2 2
167 076f5e2225b3 000000000000 2 2
166
168
167 Total: 2 2 (0.0% bigger)
169 Total: 2 2 (0.0% bigger)
168 z:
170 z:
169 Node Delta Base Delta Length Blob Size
171 Node Delta Base Delta Length Blob Size
170 69a1b6752270 000000000000 2 2
172 69a1b6752270 000000000000 2 2
171
173
172 Total: 2 2 (0.0% bigger)
174 Total: 2 2 (0.0% bigger)
173
175
174 # background prefetch with repack on commit when wcprevset configured
176 # background prefetch with repack on commit when wcprevset configured
175
177
176 $ cat >> .hg/hgrc <<EOF
178 $ cat >> .hg/hgrc <<EOF
177 > [remotefilelog]
179 > [remotefilelog]
178 > bgprefetchrevs=0::
180 > bgprefetchrevs=0::
179 > EOF
181 > EOF
180
182
181 $ clearcache
183 $ clearcache
182 $ find $CACHEDIR -type f | sort
184 $ find $CACHEDIR -type f | sort
183 $ echo b > b
185 $ echo b > b
184 .. The following output line about files fetches is globed because it is
186 .. The following output line about files fetches is globed because it is
185 .. flaky, the core the test is checked when checking the cache dir, so
187 .. flaky, the core the test is checked when checking the cache dir, so
186 .. hopefully this flakyness is not hiding any actual bug.
188 .. hopefully this flakyness is not hiding any actual bug.
187 $ hg commit -qAm b
189 $ hg commit -qAm b
188 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
190 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
189 $ hg bookmark temporary
191 $ hg bookmark temporary
190 $ find $CACHEDIR -type f | sort
192 $ find $CACHEDIR -type f | sort
191 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
193 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
192 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
194 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
193 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
195 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
194 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
196 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
195 $TESTTMP/hgcache/repos
197 $TESTTMP/hgcache/repos
196
198
197 # Ensure that file 'w' was prefetched - it was not part of the commit operation and therefore
199 # Ensure that file 'w' was prefetched - it was not part of the commit operation and therefore
198 # could only be downloaded by the background prefetch
200 # could only be downloaded by the background prefetch
199
201
200 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
202 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
201 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
203 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
202 w:
204 w:
203 Node Delta Base Delta Length Blob Size
205 Node Delta Base Delta Length Blob Size
204 bb6ccd5dceaa 000000000000 2 2
206 bb6ccd5dceaa 000000000000 2 2
205
207
206 Total: 2 2 (0.0% bigger)
208 Total: 2 2 (0.0% bigger)
207 x:
209 x:
208 Node Delta Base Delta Length Blob Size
210 Node Delta Base Delta Length Blob Size
209 ef95c5376f34 000000000000 3 3
211 ef95c5376f34 000000000000 3 3
210 1406e7411862 ef95c5376f34 14 2
212 1406e7411862 ef95c5376f34 14 2
211
213
212 Total: 17 5 (240.0% bigger)
214 Total: 17 5 (240.0% bigger)
213 y:
215 y:
214 Node Delta Base Delta Length Blob Size
216 Node Delta Base Delta Length Blob Size
215 076f5e2225b3 000000000000 2 2
217 076f5e2225b3 000000000000 2 2
216
218
217 Total: 2 2 (0.0% bigger)
219 Total: 2 2 (0.0% bigger)
218 z:
220 z:
219 Node Delta Base Delta Length Blob Size
221 Node Delta Base Delta Length Blob Size
220 69a1b6752270 000000000000 2 2
222 69a1b6752270 000000000000 2 2
221
223
222 Total: 2 2 (0.0% bigger)
224 Total: 2 2 (0.0% bigger)
223
225
224 # background prefetch with repack on rebase when wcprevset configured
226 # background prefetch with repack on rebase when wcprevset configured
225
227
226 $ hg up -r 2
228 $ hg up -r 2
227 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
229 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
228 (leaving bookmark temporary)
230 (leaving bookmark temporary)
229 $ clearcache
231 $ clearcache
230 $ find $CACHEDIR -type f | sort
232 $ find $CACHEDIR -type f | sort
231 .. The following output line about files fetches is globed because it is
233 .. The following output line about files fetches is globed because it is
232 .. flaky, the core the test is checked when checking the cache dir, so
234 .. flaky, the core the test is checked when checking the cache dir, so
233 .. hopefully this flakyness is not hiding any actual bug.
235 .. hopefully this flakyness is not hiding any actual bug.
234 $ hg rebase -s temporary -d foo
236 $ hg rebase -s temporary -d foo
235 rebasing 3:d9cf06e3b5b6 temporary tip "b"
237 rebasing 3:d9cf06e3b5b6 temporary tip "b"
236 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/d9cf06e3b5b6-e5c3dc63-rebase.hg
238 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/d9cf06e3b5b6-e5c3dc63-rebase.hg
237 ? files fetched over ? fetches - (? misses, 0.00% hit ratio) over *s (glob)
239 ? files fetched over ? fetches - (? misses, 0.00% hit ratio) over *s (glob)
238 $ find $CACHEDIR -type f | sort
240 $ find $CACHEDIR -type f | sort
239 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
241 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
240 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
242 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
241 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
243 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
242 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
244 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
243 $TESTTMP/hgcache/repos
245 $TESTTMP/hgcache/repos
244
246
245 # Ensure that file 'y' was prefetched - it was not part of the rebase operation and therefore
247 # Ensure that file 'y' was prefetched - it was not part of the rebase operation and therefore
246 # could only be downloaded by the background prefetch
248 # could only be downloaded by the background prefetch
247
249
248 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
250 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
249 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
251 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
250 w:
252 w:
251 Node Delta Base Delta Length Blob Size
253 Node Delta Base Delta Length Blob Size
252 bb6ccd5dceaa 000000000000 2 2
254 bb6ccd5dceaa 000000000000 2 2
253
255
254 Total: 2 2 (0.0% bigger)
256 Total: 2 2 (0.0% bigger)
255 x:
257 x:
256 Node Delta Base Delta Length Blob Size
258 Node Delta Base Delta Length Blob Size
257 ef95c5376f34 000000000000 3 3
259 ef95c5376f34 000000000000 3 3
258 1406e7411862 ef95c5376f34 14 2
260 1406e7411862 ef95c5376f34 14 2
259
261
260 Total: 17 5 (240.0% bigger)
262 Total: 17 5 (240.0% bigger)
261 y:
263 y:
262 Node Delta Base Delta Length Blob Size
264 Node Delta Base Delta Length Blob Size
263 076f5e2225b3 000000000000 2 2
265 076f5e2225b3 000000000000 2 2
264
266
265 Total: 2 2 (0.0% bigger)
267 Total: 2 2 (0.0% bigger)
266 z:
268 z:
267 Node Delta Base Delta Length Blob Size
269 Node Delta Base Delta Length Blob Size
268 69a1b6752270 000000000000 2 2
270 69a1b6752270 000000000000 2 2
269
271
270 Total: 2 2 (0.0% bigger)
272 Total: 2 2 (0.0% bigger)
271
273
272 # Check that foregound prefetch with no arguments blocks until background prefetches finish
274 # Check that foregound prefetch with no arguments blocks until background prefetches finish
273
275
274 $ hg up -r 3
276 $ hg up -r 3
275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 $ clearcache
278 $ clearcache
277 $ hg prefetch --repack --config ui.timeout.warn=-1
279 $ hg prefetch --repack --config ui.timeout.warn=-1
278 (running background incremental repack)
280 (running background incremental repack)
279 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
281 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
280
282
281 $ find $CACHEDIR -type f | sort
283 $ find $CACHEDIR -type f | sort
282 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
284 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
283 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
285 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
284 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
286 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
285 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
287 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
286 $TESTTMP/hgcache/repos
288 $TESTTMP/hgcache/repos
287
289
288 # Ensure that files were prefetched
290 # Ensure that files were prefetched
289 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
291 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
290 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
292 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
291 w:
293 w:
292 Node Delta Base Delta Length Blob Size
294 Node Delta Base Delta Length Blob Size
293 bb6ccd5dceaa 000000000000 2 2
295 bb6ccd5dceaa 000000000000 2 2
294
296
295 Total: 2 2 (0.0% bigger)
297 Total: 2 2 (0.0% bigger)
296 x:
298 x:
297 Node Delta Base Delta Length Blob Size
299 Node Delta Base Delta Length Blob Size
298 ef95c5376f34 000000000000 3 3
300 ef95c5376f34 000000000000 3 3
299 1406e7411862 ef95c5376f34 14 2
301 1406e7411862 ef95c5376f34 14 2
300
302
301 Total: 17 5 (240.0% bigger)
303 Total: 17 5 (240.0% bigger)
302 y:
304 y:
303 Node Delta Base Delta Length Blob Size
305 Node Delta Base Delta Length Blob Size
304 076f5e2225b3 000000000000 2 2
306 076f5e2225b3 000000000000 2 2
305
307
306 Total: 2 2 (0.0% bigger)
308 Total: 2 2 (0.0% bigger)
307 z:
309 z:
308 Node Delta Base Delta Length Blob Size
310 Node Delta Base Delta Length Blob Size
309 69a1b6752270 000000000000 2 2
311 69a1b6752270 000000000000 2 2
310
312
311 Total: 2 2 (0.0% bigger)
313 Total: 2 2 (0.0% bigger)
312
314
313 # Check that foreground prefetch fetches revs specified by '. + draft() + bgprefetchrevs + pullprefetch'
315 # Check that foreground prefetch fetches revs specified by '. + draft() + bgprefetchrevs + pullprefetch'
314
316
315 $ clearcache
317 $ clearcache
316 $ hg prefetch --repack --config ui.timeout.warn=-1
318 $ hg prefetch --repack --config ui.timeout.warn=-1
317 (running background incremental repack)
319 (running background incremental repack)
318 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
320 * files fetched over 1 fetches - (* misses, 0.00% hit ratio) over *s (glob) (?)
319
321
320 $ find $CACHEDIR -type f | sort
322 $ find $CACHEDIR -type f | sort
321 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
323 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histidx
322 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
324 $TESTTMP/hgcache/master/packs/8f1443d44e57fec96f72fb2412e01d2818767ef2.histpack
323 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
325 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.dataidx
324 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
326 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407.datapack
325 $TESTTMP/hgcache/repos
327 $TESTTMP/hgcache/repos
326
328
327 # Ensure that files were prefetched
329 # Ensure that files were prefetched
328 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
330 $ hg debugdatapack `ls -ct $TESTTMP/hgcache/master/packs/*.datapack | head -n 1`
329 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
331 $TESTTMP/hgcache/master/packs/f4d50848e0b465e9bfd2875f213044c06cfd7407:
330 w:
332 w:
331 Node Delta Base Delta Length Blob Size
333 Node Delta Base Delta Length Blob Size
332 bb6ccd5dceaa 000000000000 2 2
334 bb6ccd5dceaa 000000000000 2 2
333
335
334 Total: 2 2 (0.0% bigger)
336 Total: 2 2 (0.0% bigger)
335 x:
337 x:
336 Node Delta Base Delta Length Blob Size
338 Node Delta Base Delta Length Blob Size
337 ef95c5376f34 000000000000 3 3
339 ef95c5376f34 000000000000 3 3
338 1406e7411862 ef95c5376f34 14 2
340 1406e7411862 ef95c5376f34 14 2
339
341
340 Total: 17 5 (240.0% bigger)
342 Total: 17 5 (240.0% bigger)
341 y:
343 y:
342 Node Delta Base Delta Length Blob Size
344 Node Delta Base Delta Length Blob Size
343 076f5e2225b3 000000000000 2 2
345 076f5e2225b3 000000000000 2 2
344
346
345 Total: 2 2 (0.0% bigger)
347 Total: 2 2 (0.0% bigger)
346 z:
348 z:
347 Node Delta Base Delta Length Blob Size
349 Node Delta Base Delta Length Blob Size
348 69a1b6752270 000000000000 2 2
350 69a1b6752270 000000000000 2 2
349
351
350 Total: 2 2 (0.0% bigger)
352 Total: 2 2 (0.0% bigger)
351
353
352 # Test that if data was prefetched and repacked we dont need to prefetch it again
354 # Test that if data was prefetched and repacked we dont need to prefetch it again
353 # It ensures that Mercurial looks not only in loose files but in packs as well
355 # It ensures that Mercurial looks not only in loose files but in packs as well
354
356
355 $ hg prefetch --repack
357 $ hg prefetch --repack
356 (running background incremental repack)
358 (running background incremental repack)
@@ -1,130 +1,134 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ echo treemanifest >> .hg/requires
7 $ echo treemanifest >> .hg/requires
8 $ cat >> .hg/hgrc <<EOF
8 $ cat >> .hg/hgrc <<EOF
9 > [remotefilelog]
9 > [remotefilelog]
10 > server=True
10 > server=True
11 > EOF
11 > EOF
12 # uppercase directory name to test encoding
12 # uppercase directory name to test encoding
13 $ mkdir -p A/B
13 $ mkdir -p A/B
14 $ echo x > A/B/x
14 $ echo x > A/B/x
15 $ hg commit -qAm x
15 $ hg commit -qAm x
16
16
17 $ cd ..
17 $ cd ..
18
18
19 # shallow clone from full
19 # shallow clone from full
20
20
21 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
21 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
22 streaming all changes
22 streaming all changes
23 4 files to transfer, 449 bytes of data
23 5 files to transfer, 449 bytes of data (no-rust !)
24 transferred 449 bytes in * seconds (*/sec) (glob)
24 transferred 449 bytes in * seconds (*/sec) (glob) (no-rust !)
25 7 files to transfer, 575 bytes of data (rust !)
26 transferred 575 bytes in *.* seconds (*) (glob) (rust !)
25 searching for changes
27 searching for changes
26 no changes found
28 no changes found
27 $ cd shallow
29 $ cd shallow
28 $ hg debugrequires
30 $ hg debugrequires
29 dotencode
31 dotencode
30 dirstate-v2 (dirstate-v2 !)
32 dirstate-v2 (dirstate-v2 !)
31 exp-remotefilelog-repo-req-1
33 exp-remotefilelog-repo-req-1
32 fncache
34 fncache
33 generaldelta
35 generaldelta
34 persistent-nodemap (rust !)
36 persistent-nodemap (rust !)
35 revlog-compression-zstd (zstd !)
37 revlog-compression-zstd (zstd !)
36 revlogv1
38 revlogv1
37 share-safe
39 share-safe
38 sparserevlog
40 sparserevlog
39 store
41 store
40 treemanifest
42 treemanifest
41 $ find .hg/store/meta | sort
43 $ find .hg/store/meta | sort
42 .hg/store/meta
44 .hg/store/meta
43 .hg/store/meta/_a
45 .hg/store/meta/_a
44 .hg/store/meta/_a/00manifest.i
46 .hg/store/meta/_a/00manifest.i
45 .hg/store/meta/_a/_b
47 .hg/store/meta/_a/_b
46 .hg/store/meta/_a/_b/00manifest.i
48 .hg/store/meta/_a/_b/00manifest.i
47
49
48 $ hg update
50 $ hg update
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
52 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
51
53
52 $ cat A/B/x
54 $ cat A/B/x
53 x
55 x
54
56
55 $ ls .hg/store/data
57 $ ls .hg/store/data
56 $ echo foo > A/B/F
58 $ echo foo > A/B/F
57 $ hg add A/B/F
59 $ hg add A/B/F
58 $ hg ci -m 'local content'
60 $ hg ci -m 'local content'
59 $ ls .hg/store/data
61 $ ls .hg/store/data
60 ca31988f085bfb945cb8115b78fabdee40f741aa
62 ca31988f085bfb945cb8115b78fabdee40f741aa
61
63
62 $ cd ..
64 $ cd ..
63
65
64 # shallow clone from shallow
66 # shallow clone from shallow
65
67
66 $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate
68 $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate
67 streaming all changes
69 streaming all changes
68 5 files to transfer, 1008 bytes of data
70 6 files to transfer, 1008 bytes of data (no-rust !)
69 transferred 1008 bytes in * seconds (*/sec) (glob)
71 transferred 1008 bytes in * seconds (*/sec) (glob) (no-rust !)
72 8 files to transfer, 1.11 KB of data (rust !)
73 transferred 1.11 KB in * seconds (* */sec) (glob) (rust !)
70 searching for changes
74 searching for changes
71 no changes found
75 no changes found
72 $ cd shallow2
76 $ cd shallow2
73 $ hg debugrequires
77 $ hg debugrequires
74 dotencode
78 dotencode
75 dirstate-v2 (dirstate-v2 !)
79 dirstate-v2 (dirstate-v2 !)
76 exp-remotefilelog-repo-req-1
80 exp-remotefilelog-repo-req-1
77 fncache
81 fncache
78 generaldelta
82 generaldelta
79 persistent-nodemap (rust !)
83 persistent-nodemap (rust !)
80 revlog-compression-zstd (zstd !)
84 revlog-compression-zstd (zstd !)
81 revlogv1
85 revlogv1
82 share-safe
86 share-safe
83 sparserevlog
87 sparserevlog
84 store
88 store
85 treemanifest
89 treemanifest
86 $ ls .hg/store/data
90 $ ls .hg/store/data
87 ca31988f085bfb945cb8115b78fabdee40f741aa
91 ca31988f085bfb945cb8115b78fabdee40f741aa
88
92
89 $ hg update
93 $ hg update
90 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
94 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
91
95
92 $ cat A/B/x
96 $ cat A/B/x
93 x
97 x
94
98
95 $ cd ..
99 $ cd ..
96
100
97 # full clone from shallow
101 # full clone from shallow
98 # - send stderr to /dev/null because the order of stdout/err causes
102 # - send stderr to /dev/null because the order of stdout/err causes
99 # flakiness here
103 # flakiness here
100 $ hg clone --noupdate ssh://user@dummy/shallow full 2>/dev/null
104 $ hg clone --noupdate ssh://user@dummy/shallow full 2>/dev/null
101 streaming all changes
105 streaming all changes
102 [100]
106 [100]
103
107
104 # getbundle full clone
108 # getbundle full clone
105
109
106 $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc
110 $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc
107 $ hgcloneshallow ssh://user@dummy/master shallow3
111 $ hgcloneshallow ssh://user@dummy/master shallow3
108 requesting all changes
112 requesting all changes
109 adding changesets
113 adding changesets
110 adding manifests
114 adding manifests
111 adding file changes
115 adding file changes
112 added 1 changesets with 0 changes to 0 files
116 added 1 changesets with 0 changes to 0 files
113 new changesets 18d955ee7ba0
117 new changesets 18d955ee7ba0
114 updating to branch default
118 updating to branch default
115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
116
120
117 $ ls shallow3/.hg/store/data
121 $ ls shallow3/.hg/store/data
118 $ hg debugrequires -R shallow3/
122 $ hg debugrequires -R shallow3/
119 dotencode
123 dotencode
120 dirstate-v2 (dirstate-v2 !)
124 dirstate-v2 (dirstate-v2 !)
121 exp-remotefilelog-repo-req-1
125 exp-remotefilelog-repo-req-1
122 fncache
126 fncache
123 generaldelta
127 generaldelta
124 persistent-nodemap (rust !)
128 persistent-nodemap (rust !)
125 revlog-compression-zstd (zstd !)
129 revlog-compression-zstd (zstd !)
126 revlogv1
130 revlogv1
127 share-safe
131 share-safe
128 sparserevlog
132 sparserevlog
129 store
133 store
130 treemanifest
134 treemanifest
@@ -1,127 +1,131 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
8 > [remotefilelog]
9 > server=True
9 > server=True
10 > EOF
10 > EOF
11 $ echo x > x
11 $ echo x > x
12 $ hg commit -qAm x
12 $ hg commit -qAm x
13
13
14 $ cd ..
14 $ cd ..
15
15
16 # shallow clone from full
16 # shallow clone from full
17
17
18 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
18 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
19 streaming all changes
19 streaming all changes
20 2 files to transfer, 227 bytes of data
20 3 files to transfer, 227 bytes of data (no-rust !)
21 transferred 227 bytes in * seconds (*/sec) (glob)
21 transferred 227 bytes in * seconds (*/sec) (glob) (no-rust !)
22 5 files to transfer, 353 bytes of data (rust !)
23 transferred 353 bytes in *.* seconds (*) (glob) (rust !)
22 searching for changes
24 searching for changes
23 no changes found
25 no changes found
24 $ cd shallow
26 $ cd shallow
25 $ hg debugrequires
27 $ hg debugrequires
26 dotencode
28 dotencode
27 dirstate-v2 (dirstate-v2 !)
29 dirstate-v2 (dirstate-v2 !)
28 exp-remotefilelog-repo-req-1
30 exp-remotefilelog-repo-req-1
29 fncache
31 fncache
30 generaldelta
32 generaldelta
31 persistent-nodemap (rust !)
33 persistent-nodemap (rust !)
32 revlog-compression-zstd (zstd !)
34 revlog-compression-zstd (zstd !)
33 revlogv1
35 revlogv1
34 share-safe
36 share-safe
35 sparserevlog
37 sparserevlog
36 store
38 store
37
39
38 $ hg update
40 $ hg update
39 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
41 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
42 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
41
43
42 $ cat x
44 $ cat x
43 x
45 x
44
46
45 $ ls .hg/store/data
47 $ ls .hg/store/data
46 $ echo foo > f
48 $ echo foo > f
47 $ hg add f
49 $ hg add f
48 $ hg ci -m 'local content'
50 $ hg ci -m 'local content'
49 $ ls .hg/store/data
51 $ ls .hg/store/data
50 4a0a19218e082a343a1b17e5333409af9d98f0f5
52 4a0a19218e082a343a1b17e5333409af9d98f0f5
51
53
52 $ cd ..
54 $ cd ..
53
55
54 # shallow clone from shallow
56 # shallow clone from shallow
55
57
56 $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate
58 $ hgcloneshallow ssh://user@dummy/shallow shallow2 --noupdate
57 streaming all changes
59 streaming all changes
58 3 files to transfer, 564 bytes of data
60 4 files to transfer, 564 bytes of data (no-rust !)
59 transferred 564 bytes in * seconds (*/sec) (glob)
61 transferred 564 bytes in * seconds (*/sec) (glob) (no-rust !)
62 6 files to transfer, 690 bytes of data (rust !)
63 transferred 690 bytes in * seconds (*/sec) (glob) (rust !)
60 searching for changes
64 searching for changes
61 no changes found
65 no changes found
62 $ cd shallow2
66 $ cd shallow2
63 $ hg debugrequires
67 $ hg debugrequires
64 dotencode
68 dotencode
65 dirstate-v2 (dirstate-v2 !)
69 dirstate-v2 (dirstate-v2 !)
66 exp-remotefilelog-repo-req-1
70 exp-remotefilelog-repo-req-1
67 fncache
71 fncache
68 generaldelta
72 generaldelta
69 persistent-nodemap (rust !)
73 persistent-nodemap (rust !)
70 revlog-compression-zstd (zstd !)
74 revlog-compression-zstd (zstd !)
71 revlogv1
75 revlogv1
72 share-safe
76 share-safe
73 sparserevlog
77 sparserevlog
74 store
78 store
75 $ ls .hg/store/data
79 $ ls .hg/store/data
76 4a0a19218e082a343a1b17e5333409af9d98f0f5
80 4a0a19218e082a343a1b17e5333409af9d98f0f5
77
81
78 $ hg update
82 $ hg update
79 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
80
84
81 $ cat x
85 $ cat x
82 x
86 x
83
87
84 $ cd ..
88 $ cd ..
85
89
86 # full clone from shallow
90 # full clone from shallow
87
91
88 Note: the output to STDERR comes from a different process to the output on
92 Note: the output to STDERR comes from a different process to the output on
89 STDOUT and their relative ordering is not deterministic. As a result, the test
93 STDOUT and their relative ordering is not deterministic. As a result, the test
90 was failing sporadically. To avoid this, we capture STDERR to a file and
94 was failing sporadically. To avoid this, we capture STDERR to a file and
91 check its contents separately.
95 check its contents separately.
92
96
93 $ TEMP_STDERR=full-clone-from-shallow.stderr.tmp
97 $ TEMP_STDERR=full-clone-from-shallow.stderr.tmp
94 $ hg clone --noupdate ssh://user@dummy/shallow full 2>$TEMP_STDERR
98 $ hg clone --noupdate ssh://user@dummy/shallow full 2>$TEMP_STDERR
95 streaming all changes
99 streaming all changes
96 [100]
100 [100]
97 $ cat $TEMP_STDERR
101 $ cat $TEMP_STDERR
98 remote: abort: Cannot clone from a shallow repo to a full repo.
102 remote: abort: Cannot clone from a shallow repo to a full repo.
99 abort: pull failed on remote
103 abort: pull failed on remote
100 $ rm $TEMP_STDERR
104 $ rm $TEMP_STDERR
101
105
102 # getbundle full clone
106 # getbundle full clone
103
107
104 $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc
108 $ printf '[server]\npreferuncompressed=False\n' >> master/.hg/hgrc
105 $ hgcloneshallow ssh://user@dummy/master shallow3
109 $ hgcloneshallow ssh://user@dummy/master shallow3
106 requesting all changes
110 requesting all changes
107 adding changesets
111 adding changesets
108 adding manifests
112 adding manifests
109 adding file changes
113 adding file changes
110 added 1 changesets with 0 changes to 0 files
114 added 1 changesets with 0 changes to 0 files
111 new changesets b292c1e3311f
115 new changesets b292c1e3311f
112 updating to branch default
116 updating to branch default
113 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
114
118
115 $ ls shallow3/.hg/store/data
119 $ ls shallow3/.hg/store/data
116 $ hg debugrequires -R shallow3/
120 $ hg debugrequires -R shallow3/
117 dotencode
121 dotencode
118 dirstate-v2 (dirstate-v2 !)
122 dirstate-v2 (dirstate-v2 !)
119 exp-remotefilelog-repo-req-1
123 exp-remotefilelog-repo-req-1
120 fncache
124 fncache
121 generaldelta
125 generaldelta
122 persistent-nodemap (rust !)
126 persistent-nodemap (rust !)
123 revlog-compression-zstd (zstd !)
127 revlog-compression-zstd (zstd !)
124 revlogv1
128 revlogv1
125 share-safe
129 share-safe
126 sparserevlog
130 sparserevlog
127 store
131 store
@@ -1,122 +1,124 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
8 > [remotefilelog]
9 > server=True
9 > server=True
10 > EOF
10 > EOF
11 $ echo x > x
11 $ echo x > x
12 $ hg commit -qAm x
12 $ hg commit -qAm x
13 $ mkdir dir
13 $ mkdir dir
14 $ echo y > dir/y
14 $ echo y > dir/y
15 $ hg commit -qAm y
15 $ hg commit -qAm y
16
16
17 $ cd ..
17 $ cd ..
18
18
19 Shallow clone from full
19 Shallow clone from full
20
20
21 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
21 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
22 streaming all changes
22 streaming all changes
23 2 files to transfer, 473 bytes of data
23 3 files to transfer, 473 bytes of data (no-rust !)
24 transferred 473 bytes in * seconds (*/sec) (glob)
24 transferred 473 bytes in * seconds (*/sec) (glob) (no-rust !)
25 5 files to transfer, 599 bytes of data (rust !)
26 transferred 599 bytes in * seconds (*/sec) (glob) (rust !)
25 searching for changes
27 searching for changes
26 no changes found
28 no changes found
27 $ cd shallow
29 $ cd shallow
28 $ hg debugrequires
30 $ hg debugrequires
29 dotencode
31 dotencode
30 dirstate-v2 (dirstate-v2 !)
32 dirstate-v2 (dirstate-v2 !)
31 exp-remotefilelog-repo-req-1
33 exp-remotefilelog-repo-req-1
32 fncache
34 fncache
33 generaldelta
35 generaldelta
34 persistent-nodemap (rust !)
36 persistent-nodemap (rust !)
35 revlog-compression-zstd (zstd !)
37 revlog-compression-zstd (zstd !)
36 revlogv1
38 revlogv1
37 share-safe
39 share-safe
38 sparserevlog
40 sparserevlog
39 store
41 store
40
42
41 $ hg update
43 $ hg update
42 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
45 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
44
46
45 Log on a file without -f
47 Log on a file without -f
46
48
47 $ hg log dir/y
49 $ hg log dir/y
48 warning: file log can be slow on large repos - use -f to speed it up
50 warning: file log can be slow on large repos - use -f to speed it up
49 changeset: 1:2e73264fab97
51 changeset: 1:2e73264fab97
50 tag: tip
52 tag: tip
51 user: test
53 user: test
52 date: Thu Jan 01 00:00:00 1970 +0000
54 date: Thu Jan 01 00:00:00 1970 +0000
53 summary: y
55 summary: y
54
56
55 Log on a file with -f
57 Log on a file with -f
56
58
57 $ hg log -f dir/y
59 $ hg log -f dir/y
58 changeset: 1:2e73264fab97
60 changeset: 1:2e73264fab97
59 tag: tip
61 tag: tip
60 user: test
62 user: test
61 date: Thu Jan 01 00:00:00 1970 +0000
63 date: Thu Jan 01 00:00:00 1970 +0000
62 summary: y
64 summary: y
63
65
64 Log on a file with kind in path
66 Log on a file with kind in path
65 $ hg log -r "filelog('path:dir/y')"
67 $ hg log -r "filelog('path:dir/y')"
66 changeset: 1:2e73264fab97
68 changeset: 1:2e73264fab97
67 tag: tip
69 tag: tip
68 user: test
70 user: test
69 date: Thu Jan 01 00:00:00 1970 +0000
71 date: Thu Jan 01 00:00:00 1970 +0000
70 summary: y
72 summary: y
71
73
72 Log on multiple files with -f
74 Log on multiple files with -f
73
75
74 $ hg log -f dir/y x
76 $ hg log -f dir/y x
75 changeset: 1:2e73264fab97
77 changeset: 1:2e73264fab97
76 tag: tip
78 tag: tip
77 user: test
79 user: test
78 date: Thu Jan 01 00:00:00 1970 +0000
80 date: Thu Jan 01 00:00:00 1970 +0000
79 summary: y
81 summary: y
80
82
81 changeset: 0:b292c1e3311f
83 changeset: 0:b292c1e3311f
82 user: test
84 user: test
83 date: Thu Jan 01 00:00:00 1970 +0000
85 date: Thu Jan 01 00:00:00 1970 +0000
84 summary: x
86 summary: x
85
87
86 Log on a directory
88 Log on a directory
87
89
88 $ hg log dir
90 $ hg log dir
89 changeset: 1:2e73264fab97
91 changeset: 1:2e73264fab97
90 tag: tip
92 tag: tip
91 user: test
93 user: test
92 date: Thu Jan 01 00:00:00 1970 +0000
94 date: Thu Jan 01 00:00:00 1970 +0000
93 summary: y
95 summary: y
94
96
95 Log on a file from inside a directory
97 Log on a file from inside a directory
96
98
97 $ cd dir
99 $ cd dir
98 $ hg log y
100 $ hg log y
99 warning: file log can be slow on large repos - use -f to speed it up
101 warning: file log can be slow on large repos - use -f to speed it up
100 changeset: 1:2e73264fab97
102 changeset: 1:2e73264fab97
101 tag: tip
103 tag: tip
102 user: test
104 user: test
103 date: Thu Jan 01 00:00:00 1970 +0000
105 date: Thu Jan 01 00:00:00 1970 +0000
104 summary: y
106 summary: y
105
107
106 Log on a file via -fr
108 Log on a file via -fr
107 $ cd ..
109 $ cd ..
108 $ hg log -fr tip dir/ --template '{rev}\n'
110 $ hg log -fr tip dir/ --template '{rev}\n'
109 1
111 1
110
112
111 Trace renames
113 Trace renames
112 $ hg mv x z
114 $ hg mv x z
113 $ hg commit -m move
115 $ hg commit -m move
114 $ hg log -f z -T '{desc} {file_copies}\n' -G
116 $ hg log -f z -T '{desc} {file_copies}\n' -G
115 @ move z (x)
117 @ move z (x)
116 :
118 :
117 o x
119 o x
118
120
119
121
120 Verify remotefilelog handles rename metadata stripping when comparing file sizes
122 Verify remotefilelog handles rename metadata stripping when comparing file sizes
121 $ hg debugrebuilddirstate
123 $ hg debugrebuilddirstate
122 $ hg status
124 $ hg status
@@ -1,77 +1,79 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
8 > [remotefilelog]
9 > server=True
9 > server=True
10 > EOF
10 > EOF
11 $ echo x > foo
11 $ echo x > foo
12 $ echo y > bar
12 $ echo y > bar
13 $ hg commit -qAm one
13 $ hg commit -qAm one
14
14
15 $ cd ..
15 $ cd ..
16
16
17 # partial shallow clone
17 # partial shallow clone
18
18
19 $ hg clone --shallow ssh://user@dummy/master shallow --noupdate --config remotefilelog.includepattern=foo
19 $ hg clone --shallow ssh://user@dummy/master shallow --noupdate --config remotefilelog.includepattern=foo
20 streaming all changes
20 streaming all changes
21 3 files to transfer, 336 bytes of data (no-zstd !)
21 4 files to transfer, 336 bytes of data (no-zstd !)
22 transferred 336 bytes in * seconds (* */sec) (glob) (no-zstd !)
22 transferred 336 bytes in * seconds (* */sec) (glob) (no-zstd !)
23 3 files to transfer, 338 bytes of data (zstd !)
23 4 files to transfer, 338 bytes of data (zstd no-rust !)
24 transferred 338 bytes in * seconds (* */sec) (glob) (zstd !)
24 transferred 338 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
25 6 files to transfer, 464 bytes of data (zstd rust !)
26 transferred 464 bytes in * seconds (*/sec) (glob) (zstd rust !)
25 searching for changes
27 searching for changes
26 no changes found
28 no changes found
27 $ cat >> shallow/.hg/hgrc <<EOF
29 $ cat >> shallow/.hg/hgrc <<EOF
28 > [remotefilelog]
30 > [remotefilelog]
29 > cachepath=$PWD/hgcache
31 > cachepath=$PWD/hgcache
30 > debug=True
32 > debug=True
31 > includepattern=foo
33 > includepattern=foo
32 > reponame = master
34 > reponame = master
33 > [extensions]
35 > [extensions]
34 > remotefilelog=
36 > remotefilelog=
35 > EOF
37 > EOF
36 $ ls shallow/.hg/store/data
38 $ ls shallow/.hg/store/data
37 bar.i
39 bar.i
38
40
39 # update partial clone
41 # update partial clone
40
42
41 $ cd shallow
43 $ cd shallow
42 $ hg update
44 $ hg update
43 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
46 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
45 $ cat foo
47 $ cat foo
46 x
48 x
47 $ cat bar
49 $ cat bar
48 y
50 y
49 $ cd ..
51 $ cd ..
50
52
51 # pull partial clone
53 # pull partial clone
52
54
53 $ cd master
55 $ cd master
54 $ echo a >> foo
56 $ echo a >> foo
55 $ echo b >> bar
57 $ echo b >> bar
56 $ hg commit -qm two
58 $ hg commit -qm two
57 $ cd ../shallow
59 $ cd ../shallow
58 $ hg pull
60 $ hg pull
59 pulling from ssh://user@dummy/master
61 pulling from ssh://user@dummy/master
60 searching for changes
62 searching for changes
61 adding changesets
63 adding changesets
62 adding manifests
64 adding manifests
63 adding file changes
65 adding file changes
64 added 1 changesets with 0 changes to 0 files
66 added 1 changesets with 0 changes to 0 files
65 new changesets a9688f18cb91
67 new changesets a9688f18cb91
66 (run 'hg update' to get a working copy)
68 (run 'hg update' to get a working copy)
67 $ hg update
69 $ hg update
68 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
71 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
70 $ cat foo
72 $ cat foo
71 x
73 x
72 a
74 a
73 $ cat bar
75 $ cat bar
74 y
76 y
75 b
77 b
76
78
77 $ cd ..
79 $ cd ..
@@ -1,286 +1,290 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
8 > [remotefilelog]
9 > server=True
9 > server=True
10 > EOF
10 > EOF
11 $ echo x > x
11 $ echo x > x
12 $ echo z > z
12 $ echo z > z
13 $ hg commit -qAm x
13 $ hg commit -qAm x
14 $ echo x2 > x
14 $ echo x2 > x
15 $ echo y > y
15 $ echo y > y
16 $ hg commit -qAm y
16 $ hg commit -qAm y
17 $ hg bookmark foo
17 $ hg bookmark foo
18
18
19 $ cd ..
19 $ cd ..
20
20
21 # prefetch a revision
21 # prefetch a revision
22
22
23 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
23 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
24 streaming all changes
24 streaming all changes
25 2 files to transfer, 528 bytes of data (no-zstd !)
25 3 files to transfer, 528 bytes of data (no-zstd !)
26 transferred 528 bytes in * seconds (* */sec) (glob) (no-zstd !)
26 transferred 528 bytes in * seconds (* */sec) (glob) (no-zstd !)
27 2 files to transfer, 532 bytes of data (zstd !)
27 3 files to transfer, 532 bytes of data (zstd no-rust !)
28 transferred 532 bytes in * seconds (* */sec) (glob) (zstd !)
28 transferred 532 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
29 5 files to transfer, 658 bytes of data (zstd rust !)
30 transferred 658 bytes in * seconds (*/sec) (glob) (zstd rust !)
29 searching for changes
31 searching for changes
30 no changes found
32 no changes found
31 $ cd shallow
33 $ cd shallow
32
34
33 $ hg prefetch -r 0
35 $ hg prefetch -r 0
34 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
36 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
35
37
36 $ hg cat -r 0 x
38 $ hg cat -r 0 x
37 x
39 x
38
40
39 # prefetch with base
41 # prefetch with base
40
42
41 $ clearcache
43 $ clearcache
42 $ hg prefetch -r 0::1 -b 0
44 $ hg prefetch -r 0::1 -b 0
43 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
45 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
44
46
45 $ hg cat -r 1 x
47 $ hg cat -r 1 x
46 x2
48 x2
47 $ hg cat -r 1 y
49 $ hg cat -r 1 y
48 y
50 y
49
51
50 $ hg cat -r 0 x
52 $ hg cat -r 0 x
51 x
53 x
52 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
54 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
53
55
54 $ hg cat -r 0 z
56 $ hg cat -r 0 z
55 z
57 z
56 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
58 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
57
59
58 $ hg prefetch -r 0::1 --base 0
60 $ hg prefetch -r 0::1 --base 0
59 $ hg prefetch -r 0::1 -b 1
61 $ hg prefetch -r 0::1 -b 1
60 $ hg prefetch -r 0::1
62 $ hg prefetch -r 0::1
61
63
62 # prefetch a range of revisions
64 # prefetch a range of revisions
63
65
64 $ clearcache
66 $ clearcache
65 $ hg prefetch -r 0::1
67 $ hg prefetch -r 0::1
66 4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over *s (glob)
68 4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over *s (glob)
67
69
68 $ hg cat -r 0 x
70 $ hg cat -r 0 x
69 x
71 x
70 $ hg cat -r 1 x
72 $ hg cat -r 1 x
71 x2
73 x2
72
74
73 # prefetch certain files
75 # prefetch certain files
74
76
75 $ clearcache
77 $ clearcache
76 $ hg prefetch -r 1 x
78 $ hg prefetch -r 1 x
77 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
79 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
78
80
79 $ hg cat -r 1 x
81 $ hg cat -r 1 x
80 x2
82 x2
81
83
82 $ hg cat -r 1 y
84 $ hg cat -r 1 y
83 y
85 y
84 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
86 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
85
87
86 # prefetch on pull when configured
88 # prefetch on pull when configured
87
89
88 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
90 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
89 $ hg strip tip
91 $ hg strip tip
90 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/109c3a557a73-3f43405e-backup.hg (glob)
92 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/109c3a557a73-3f43405e-backup.hg (glob)
91 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
93 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
92
94
93 $ clearcache
95 $ clearcache
94 $ hg pull
96 $ hg pull
95 pulling from ssh://user@dummy/master
97 pulling from ssh://user@dummy/master
96 searching for changes
98 searching for changes
97 adding changesets
99 adding changesets
98 adding manifests
100 adding manifests
99 adding file changes
101 adding file changes
100 updating bookmark foo
102 updating bookmark foo
101 added 1 changesets with 0 changes to 0 files
103 added 1 changesets with 0 changes to 0 files
102 new changesets 109c3a557a73
104 new changesets 109c3a557a73
103 (run 'hg update' to get a working copy)
105 (run 'hg update' to get a working copy)
104 prefetching file contents
106 prefetching file contents
105 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
107 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over *s (glob)
106
108
107 $ hg up tip
109 $ hg up tip
108 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
109
111
110 # prefetch only fetches changes not in working copy
112 # prefetch only fetches changes not in working copy
111
113
112 $ hg strip tip
114 $ hg strip tip
113 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
115 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
114 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/109c3a557a73-3f43405e-backup.hg (glob)
116 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/109c3a557a73-3f43405e-backup.hg (glob)
115 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
117 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
116 $ clearcache
118 $ clearcache
117
119
118 $ hg pull
120 $ hg pull
119 pulling from ssh://user@dummy/master
121 pulling from ssh://user@dummy/master
120 searching for changes
122 searching for changes
121 adding changesets
123 adding changesets
122 adding manifests
124 adding manifests
123 adding file changes
125 adding file changes
124 updating bookmark foo
126 updating bookmark foo
125 added 1 changesets with 0 changes to 0 files
127 added 1 changesets with 0 changes to 0 files
126 new changesets 109c3a557a73
128 new changesets 109c3a557a73
127 (run 'hg update' to get a working copy)
129 (run 'hg update' to get a working copy)
128 prefetching file contents
130 prefetching file contents
129 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
131 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
130
132
131 # Make some local commits that produce the same file versions as are on the
133 # Make some local commits that produce the same file versions as are on the
132 # server. To simulate a situation where we have local commits that were somehow
134 # server. To simulate a situation where we have local commits that were somehow
133 # pushed, and we will soon pull.
135 # pushed, and we will soon pull.
134
136
135 $ hg prefetch -r 'all()'
137 $ hg prefetch -r 'all()'
136 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
138 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
137 $ hg strip -q -r 0
139 $ hg strip -q -r 0
138 $ echo x > x
140 $ echo x > x
139 $ echo z > z
141 $ echo z > z
140 $ hg commit -qAm x
142 $ hg commit -qAm x
141 $ echo x2 > x
143 $ echo x2 > x
142 $ echo y > y
144 $ echo y > y
143 $ hg commit -qAm y
145 $ hg commit -qAm y
144
146
145 # prefetch server versions, even if local versions are available
147 # prefetch server versions, even if local versions are available
146
148
147 $ clearcache
149 $ clearcache
148 $ hg strip -q tip
150 $ hg strip -q tip
149 $ hg pull
151 $ hg pull
150 pulling from ssh://user@dummy/master
152 pulling from ssh://user@dummy/master
151 searching for changes
153 searching for changes
152 adding changesets
154 adding changesets
153 adding manifests
155 adding manifests
154 adding file changes
156 adding file changes
155 updating bookmark foo
157 updating bookmark foo
156 added 1 changesets with 0 changes to 0 files
158 added 1 changesets with 0 changes to 0 files
157 new changesets 109c3a557a73
159 new changesets 109c3a557a73
158 1 local changesets published (?)
160 1 local changesets published (?)
159 (run 'hg update' to get a working copy)
161 (run 'hg update' to get a working copy)
160 prefetching file contents
162 prefetching file contents
161 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
163 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
162
164
163 $ cd ..
165 $ cd ..
164
166
165 # Prefetch unknown files during checkout
167 # Prefetch unknown files during checkout
166
168
167 $ hgcloneshallow ssh://user@dummy/master shallow2
169 $ hgcloneshallow ssh://user@dummy/master shallow2
168 streaming all changes
170 streaming all changes
169 2 files to transfer, 528 bytes of data (no-zstd !)
171 3 files to transfer, 528 bytes of data (no-zstd !)
170 transferred 528 bytes in * seconds * (glob) (no-zstd !)
172 transferred 528 bytes in * seconds * (glob) (no-zstd !)
171 2 files to transfer, 532 bytes of data (zstd !)
173 3 files to transfer, 532 bytes of data (zstd no-rust !)
172 transferred 532 bytes in * seconds (* */sec) (glob) (zstd !)
174 transferred 532 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
175 5 files to transfer, 658 bytes of data (zstd rust !)
176 transferred 658 bytes in * seconds (*/sec) (glob) (zstd rust !)
173 searching for changes
177 searching for changes
174 no changes found
178 no changes found
175 updating to branch default
179 updating to branch default
176 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
180 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
177 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
181 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over * (glob)
178 $ cd shallow2
182 $ cd shallow2
179 $ hg up -q null
183 $ hg up -q null
180 $ echo x > x
184 $ echo x > x
181 $ echo y > y
185 $ echo y > y
182 $ echo z > z
186 $ echo z > z
183 $ clearcache
187 $ clearcache
184 $ hg up tip
188 $ hg up tip
185 x: untracked file differs
189 x: untracked file differs
186 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
190 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
187 abort: untracked files in working directory differ from files in requested revision
191 abort: untracked files in working directory differ from files in requested revision
188 [20]
192 [20]
189 $ hg revert --all
193 $ hg revert --all
190
194
191 # Test batch fetching of lookup files during hg status
195 # Test batch fetching of lookup files during hg status
192 $ hg up --clean tip
196 $ hg up --clean tip
193 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
197 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 $ hg debugrebuilddirstate
198 $ hg debugrebuilddirstate
195 $ clearcache
199 $ clearcache
196 $ hg status
200 $ hg status
197 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
201 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
198
202
199 # Prefetch during addrename detection
203 # Prefetch during addrename detection
200 $ hg up -q --clean tip
204 $ hg up -q --clean tip
201 $ hg revert --all
205 $ hg revert --all
202 $ mv x x2
206 $ mv x x2
203 $ mv y y2
207 $ mv y y2
204 $ mv z z2
208 $ mv z z2
205 $ echo a > a
209 $ echo a > a
206 $ hg add a
210 $ hg add a
207 $ rm a
211 $ rm a
208 $ clearcache
212 $ clearcache
209 $ hg addremove -s 50 > /dev/null
213 $ hg addremove -s 50 > /dev/null
210 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
214 3 files fetched over 1 fetches - (3 misses, 0.00% hit ratio) over * (glob)
211 $ hg revert --all
215 $ hg revert --all
212 forgetting x2
216 forgetting x2
213 forgetting y2
217 forgetting y2
214 forgetting z2
218 forgetting z2
215 undeleting x
219 undeleting x
216 undeleting y
220 undeleting y
217 undeleting z
221 undeleting z
218
222
219
223
220 # Revert across double renames. Note: the scary "abort", error is because
224 # Revert across double renames. Note: the scary "abort", error is because
221 # https://bz.mercurial-scm.org/5419 .
225 # https://bz.mercurial-scm.org/5419 .
222
226
223 $ cd ../master
227 $ cd ../master
224 $ hg mv z z2
228 $ hg mv z z2
225 $ hg commit -m 'move z -> z2'
229 $ hg commit -m 'move z -> z2'
226 $ cd ../shallow2
230 $ cd ../shallow2
227 $ hg pull -q
231 $ hg pull -q
228 $ clearcache
232 $ clearcache
229 $ hg mv y y2
233 $ hg mv y y2
230 y2: not overwriting - file exists
234 y2: not overwriting - file exists
231 ('hg rename --after' to record the rename)
235 ('hg rename --after' to record the rename)
232 [1]
236 [1]
233 $ hg mv x x2
237 $ hg mv x x2
234 x2: not overwriting - file exists
238 x2: not overwriting - file exists
235 ('hg rename --after' to record the rename)
239 ('hg rename --after' to record the rename)
236 [1]
240 [1]
237 $ hg mv z2 z3
241 $ hg mv z2 z3
238 z2: not copying - file is not managed
242 z2: not copying - file is not managed
239 abort: no files to copy
243 abort: no files to copy
240 (maybe you meant to use --after --at-rev=.)
244 (maybe you meant to use --after --at-rev=.)
241 [10]
245 [10]
242 $ find $CACHEDIR -type f | sort
246 $ find $CACHEDIR -type f | sort
243 .. The following output line about files fetches is globed because it is
247 .. The following output line about files fetches is globed because it is
244 .. flaky, the core the test is checked when checking the cache dir, so
248 .. flaky, the core the test is checked when checking the cache dir, so
245 .. hopefully this flakyness is not hiding any actual bug.
249 .. hopefully this flakyness is not hiding any actual bug.
246 $ hg revert -a -r 1 || true
250 $ hg revert -a -r 1 || true
247 ? files fetched over 1 fetches - (? misses, 0.00% hit ratio) over * (glob)
251 ? files fetched over 1 fetches - (? misses, 0.00% hit ratio) over * (glob)
248 abort: z2@109c3a557a73: not found in manifest (?)
252 abort: z2@109c3a557a73: not found in manifest (?)
249 $ find $CACHEDIR -type f | sort
253 $ find $CACHEDIR -type f | sort
250 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
254 $TESTTMP/hgcache/master/11/f6ad8ec52a2984abaafd7c3b516503785c2072/ef95c5376f34698742fe34f315fd82136f8f68c0
251 $TESTTMP/hgcache/master/39/5df8f7c51f007019cb30201c49e884b46b92fa/69a1b67522704ec122181c0890bd16e9d3e7516a
255 $TESTTMP/hgcache/master/39/5df8f7c51f007019cb30201c49e884b46b92fa/69a1b67522704ec122181c0890bd16e9d3e7516a
252 $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
256 $TESTTMP/hgcache/master/95/cb0bfd2977c761298d9624e4b4d4c72a39974a/076f5e2225b3ff0400b98c92aa6cdf403ee24cca
253 $TESTTMP/hgcache/repos
257 $TESTTMP/hgcache/repos
254
258
255 # warning when we have excess remotefilelog fetching
259 # warning when we have excess remotefilelog fetching
256
260
257 $ cat > repeated_fetch.py << EOF
261 $ cat > repeated_fetch.py << EOF
258 > import binascii
262 > import binascii
259 > from mercurial import extensions, registrar
263 > from mercurial import extensions, registrar
260 > cmdtable = {}
264 > cmdtable = {}
261 > command = registrar.command(cmdtable)
265 > command = registrar.command(cmdtable)
262 > @command(b'repeated-fetch', [], b'', inferrepo=True)
266 > @command(b'repeated-fetch', [], b'', inferrepo=True)
263 > def repeated_fetch(ui, repo, *args, **opts):
267 > def repeated_fetch(ui, repo, *args, **opts):
264 > for i in range(20):
268 > for i in range(20):
265 > try:
269 > try:
266 > hexid = (b'%02x' % (i + 1)) * 20
270 > hexid = (b'%02x' % (i + 1)) * 20
267 > repo.fileservice.prefetch([(b'somefile.txt', hexid)])
271 > repo.fileservice.prefetch([(b'somefile.txt', hexid)])
268 > except Exception:
272 > except Exception:
269 > pass
273 > pass
270 > EOF
274 > EOF
271
275
272 We should only output to the user once. We're ignoring most of the output
276 We should only output to the user once. We're ignoring most of the output
273 because we're not actually fetching anything real here, all the hashes are
277 because we're not actually fetching anything real here, all the hashes are
274 bogus, so it's just going to be errors and a final summary of all the misses.
278 bogus, so it's just going to be errors and a final summary of all the misses.
275 $ hg --config extensions.repeated_fetch=repeated_fetch.py \
279 $ hg --config extensions.repeated_fetch=repeated_fetch.py \
276 > --config remotefilelog.fetchwarning="fetch warning!" \
280 > --config remotefilelog.fetchwarning="fetch warning!" \
277 > --config extensions.blackbox= \
281 > --config extensions.blackbox= \
278 > repeated-fetch 2>&1 | grep 'fetch warning'
282 > repeated-fetch 2>&1 | grep 'fetch warning'
279 fetch warning!
283 fetch warning!
280
284
281 We should output to blackbox three times, with a stack trace on each (though
285 We should output to blackbox three times, with a stack trace on each (though
282 that isn't tested here).
286 that isn't tested here).
283 $ grep 'excess remotefilelog fetching' .hg/blackbox.log
287 $ grep 'excess remotefilelog fetching' .hg/blackbox.log
284 .* excess remotefilelog fetching: (re)
288 .* excess remotefilelog fetching: (re)
285 .* excess remotefilelog fetching: (re)
289 .* excess remotefilelog fetching: (re)
286 .* excess remotefilelog fetching: (re)
290 .* excess remotefilelog fetching: (re)
@@ -1,107 +1,111 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
8 > [remotefilelog]
9 > server=True
9 > server=True
10 > EOF
10 > EOF
11 $ echo x > x
11 $ echo x > x
12 $ echo z > z
12 $ echo z > z
13 $ hg commit -qAm x1
13 $ hg commit -qAm x1
14 $ echo x2 > x
14 $ echo x2 > x
15 $ echo z2 > z
15 $ echo z2 > z
16 $ hg commit -qAm x2
16 $ hg commit -qAm x2
17 $ hg bookmark foo
17 $ hg bookmark foo
18
18
19 $ cd ..
19 $ cd ..
20
20
21 # prefetch a revision w/ a sparse checkout
21 # prefetch a revision w/ a sparse checkout
22
22
23 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
23 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
24 streaming all changes
24 streaming all changes
25 2 files to transfer, 527 bytes of data (no-zstd !)
25 3 files to transfer, 527 bytes of data (no-zstd !)
26 transferred 527 bytes in * seconds (* */sec) (glob) (no-zstd !)
26 transferred 527 bytes in * seconds (* */sec) (glob) (no-zstd !)
27 2 files to transfer, 534 bytes of data (zstd !)
27 3 files to transfer, 534 bytes of data (zstd no-rust !)
28 transferred 534 bytes in * seconds (* */sec) (glob) (zstd !)
28 transferred 534 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
29 5 files to transfer, 660 bytes of data (zstd rust !)
30 transferred 660 bytes in * seconds (*/sec) (glob) (zstd rust !)
29 searching for changes
31 searching for changes
30 no changes found
32 no changes found
31 $ cd shallow
33 $ cd shallow
32 $ printf "[extensions]\nsparse=\n" >> .hg/hgrc
34 $ printf "[extensions]\nsparse=\n" >> .hg/hgrc
33
35
34 $ hg debugsparse -I x
36 $ hg debugsparse -I x
35 $ hg prefetch -r 0
37 $ hg prefetch -r 0
36 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
38 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
37
39
38 $ hg cat -r 0 x
40 $ hg cat -r 0 x
39 x
41 x
40
42
41 $ hg debugsparse -I z
43 $ hg debugsparse -I z
42 $ hg prefetch -r 0
44 $ hg prefetch -r 0
43 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
45 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
44
46
45 $ hg cat -r 0 z
47 $ hg cat -r 0 z
46 z
48 z
47
49
48 # prefetch sparse only on pull when configured
50 # prefetch sparse only on pull when configured
49
51
50 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
52 $ printf "[remotefilelog]\npullprefetch=bookmark()\n" >> .hg/hgrc
51 $ hg strip tip
53 $ hg strip tip
52 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/876b1317060d-b2e91d8d-backup.hg (glob)
54 saved backup bundle to $TESTTMP/shallow/.hg/strip-backup/876b1317060d-b2e91d8d-backup.hg (glob)
53 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
55 2 files fetched over 2 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
54
56
55 $ hg debugsparse --delete z
57 $ hg debugsparse --delete z
56
58
57 $ clearcache
59 $ clearcache
58 $ hg pull
60 $ hg pull
59 pulling from ssh://user@dummy/master
61 pulling from ssh://user@dummy/master
60 searching for changes
62 searching for changes
61 adding changesets
63 adding changesets
62 adding manifests
64 adding manifests
63 adding file changes
65 adding file changes
64 updating bookmark foo
66 updating bookmark foo
65 added 1 changesets with 0 changes to 0 files
67 added 1 changesets with 0 changes to 0 files
66 new changesets 876b1317060d
68 new changesets 876b1317060d
67 (run 'hg update' to get a working copy)
69 (run 'hg update' to get a working copy)
68 prefetching file contents
70 prefetching file contents
69 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
71 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
70
72
71 # Dont consider filtered files when doing copy tracing
73 # Dont consider filtered files when doing copy tracing
72
74
73 ## Push an unrelated commit
75 ## Push an unrelated commit
74 $ cd ../
76 $ cd ../
75
77
76 $ hgcloneshallow ssh://user@dummy/master shallow2
78 $ hgcloneshallow ssh://user@dummy/master shallow2
77 streaming all changes
79 streaming all changes
78 2 files to transfer, 527 bytes of data (no-zstd !)
80 3 files to transfer, 527 bytes of data (no-zstd !)
79 transferred 527 bytes in * seconds (*) (glob) (no-zstd !)
81 transferred 527 bytes in * seconds (*) (glob) (no-zstd !)
80 2 files to transfer, 534 bytes of data (zstd !)
82 3 files to transfer, 534 bytes of data (zstd no-rust !)
81 transferred 534 bytes in * seconds (* */sec) (glob) (zstd !)
83 transferred 534 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
84 5 files to transfer, 660 bytes of data (zstd rust !)
85 transferred 660 bytes in * seconds (*/sec) (glob) (zstd rust !)
82 searching for changes
86 searching for changes
83 no changes found
87 no changes found
84 updating to branch default
88 updating to branch default
85 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
89 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
86 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
90 1 files fetched over 1 fetches - (1 misses, 0.00% hit ratio) over *s (glob)
87 $ cd shallow2
91 $ cd shallow2
88 $ printf "[extensions]\nsparse=\n" >> .hg/hgrc
92 $ printf "[extensions]\nsparse=\n" >> .hg/hgrc
89
93
90 $ hg up -q 0
94 $ hg up -q 0
91 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
95 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
92 $ touch a
96 $ touch a
93 $ hg ci -Aqm a
97 $ hg ci -Aqm a
94 $ hg push -q -f
98 $ hg push -q -f
95
99
96 ## Pull the unrelated commit and rebase onto it - verify unrelated file was not
100 ## Pull the unrelated commit and rebase onto it - verify unrelated file was not
97 pulled
101 pulled
98
102
99 $ cd ../shallow
103 $ cd ../shallow
100 $ hg up -q 1
104 $ hg up -q 1
101 $ hg pull -q
105 $ hg pull -q
102 $ hg debugsparse -I z
106 $ hg debugsparse -I z
103 $ clearcache
107 $ clearcache
104 $ hg prefetch -r '. + .^' -I x -I z
108 $ hg prefetch -r '. + .^' -I x -I z
105 4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over * (glob)
109 4 files fetched over 1 fetches - (4 misses, 0.00% hit ratio) over * (glob)
106 $ hg rebase -d 2 --keep
110 $ hg rebase -d 2 --keep
107 rebasing 1:876b1317060d foo "x2"
111 rebasing 1:876b1317060d foo "x2"
@@ -1,80 +1,82 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
8 > [remotefilelog]
9 > server=True
9 > server=True
10 > EOF
10 > EOF
11 $ echo x > foo
11 $ echo x > foo
12 $ echo y > bar
12 $ echo y > bar
13 $ hg commit -qAm one
13 $ hg commit -qAm one
14 $ hg tag tag1
14 $ hg tag tag1
15 $ cd ..
15 $ cd ..
16
16
17 # clone with tags
17 # clone with tags
18
18
19 $ hg clone --shallow ssh://user@dummy/master shallow --noupdate --config remotefilelog.excludepattern=.hgtags
19 $ hg clone --shallow ssh://user@dummy/master shallow --noupdate --config remotefilelog.excludepattern=.hgtags
20 streaming all changes
20 streaming all changes
21 3 files to transfer, 662 bytes of data (no-zstd !)
21 4 files to transfer, 662 bytes of data (no-zstd !)
22 transferred 662 bytes in * seconds (* */sec) (glob) (no-zstd !)
22 transferred 662 bytes in * seconds (* */sec) (glob) (no-zstd !)
23 3 files to transfer, 665 bytes of data (zstd !)
23 4 files to transfer, 665 bytes of data (zstd no-rust !)
24 transferred 665 bytes in * seconds (* */sec) (glob) (zstd !)
24 transferred 665 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
25 6 files to transfer, 791 bytes of data (zstd rust !)
26 transferred 791 bytes in * seconds (*/sec) (glob) (zstd rust !)
25 searching for changes
27 searching for changes
26 no changes found
28 no changes found
27 $ cat >> shallow/.hg/hgrc <<EOF
29 $ cat >> shallow/.hg/hgrc <<EOF
28 > [remotefilelog]
30 > [remotefilelog]
29 > cachepath=$PWD/hgcache
31 > cachepath=$PWD/hgcache
30 > debug=True
32 > debug=True
31 > reponame = master
33 > reponame = master
32 > excludepattern=.hgtags
34 > excludepattern=.hgtags
33 > [extensions]
35 > [extensions]
34 > remotefilelog=
36 > remotefilelog=
35 > EOF
37 > EOF
36
38
37 $ cd shallow
39 $ cd shallow
38 $ ls .hg/store/data
40 $ ls .hg/store/data
39 ~2ehgtags.i
41 ~2ehgtags.i
40 $ hg tags
42 $ hg tags
41 tip 1:6ce44dcfda68
43 tip 1:6ce44dcfda68
42 tag1 0:e0360bc0d9e1
44 tag1 0:e0360bc0d9e1
43 $ hg update
45 $ hg update
44 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
46 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
45 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
47 2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
46
48
47 # pull with tags
49 # pull with tags
48
50
49 $ cd ../master
51 $ cd ../master
50 $ hg tag tag2
52 $ hg tag tag2
51 $ cd ../shallow
53 $ cd ../shallow
52 $ hg pull
54 $ hg pull
53 pulling from ssh://user@dummy/master
55 pulling from ssh://user@dummy/master
54 searching for changes
56 searching for changes
55 adding changesets
57 adding changesets
56 adding manifests
58 adding manifests
57 adding file changes
59 adding file changes
58 added 1 changesets with 0 changes to 0 files
60 added 1 changesets with 0 changes to 0 files
59 new changesets 6a22dfa4fd34
61 new changesets 6a22dfa4fd34
60 (run 'hg update' to get a working copy)
62 (run 'hg update' to get a working copy)
61 $ hg tags
63 $ hg tags
62 tip 2:6a22dfa4fd34
64 tip 2:6a22dfa4fd34
63 tag2 1:6ce44dcfda68
65 tag2 1:6ce44dcfda68
64 tag1 0:e0360bc0d9e1
66 tag1 0:e0360bc0d9e1
65 $ hg update
67 $ hg update
66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
67
69
68 $ ls .hg/store/data
70 $ ls .hg/store/data
69 ~2ehgtags.i
71 ~2ehgtags.i
70
72
71 $ hg log -l 1 --stat
73 $ hg log -l 1 --stat
72 changeset: 2:6a22dfa4fd34
74 changeset: 2:6a22dfa4fd34
73 tag: tip
75 tag: tip
74 user: test
76 user: test
75 date: Thu Jan 01 00:00:00 1970 +0000
77 date: Thu Jan 01 00:00:00 1970 +0000
76 summary: Added tag tag2 for changeset 6ce44dcfda68
78 summary: Added tag tag2 for changeset 6ce44dcfda68
77
79
78 .hgtags | 1 +
80 .hgtags | 1 +
79 1 files changed, 1 insertions(+), 0 deletions(-)
81 1 files changed, 1 insertions(+), 0 deletions(-)
80
82
@@ -1,48 +1,50 b''
1 #require no-windows
1 #require no-windows
2
2
3 $ . "$TESTDIR/remotefilelog-library.sh"
3 $ . "$TESTDIR/remotefilelog-library.sh"
4
4
5 $ hg init master
5 $ hg init master
6 $ cd master
6 $ cd master
7 $ cat >> .hg/hgrc <<EOF
7 $ cat >> .hg/hgrc <<EOF
8 > [remotefilelog]
8 > [remotefilelog]
9 > server=True
9 > server=True
10 > EOF
10 > EOF
11 $ echo x > x
11 $ echo x > x
12 $ hg commit -qAm x
12 $ hg commit -qAm x
13 $ echo y >> x
13 $ echo y >> x
14 $ hg commit -qAm y
14 $ hg commit -qAm y
15 $ echo z >> x
15 $ echo z >> x
16 $ hg commit -qAm z
16 $ hg commit -qAm z
17 $ hg update 1
17 $ hg update 1
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
18 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
19 $ echo w >> x
19 $ echo w >> x
20 $ hg commit -qAm w
20 $ hg commit -qAm w
21
21
22 $ cd ..
22 $ cd ..
23
23
24 Shallow clone and activate getflogheads testing extension
24 Shallow clone and activate getflogheads testing extension
25
25
26 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
26 $ hgcloneshallow ssh://user@dummy/master shallow --noupdate
27 streaming all changes
27 streaming all changes
28 2 files to transfer, 908 bytes of data
28 3 files to transfer, 908 bytes of data (no-rust !)
29 transferred 908 bytes in * seconds (*/sec) (glob)
29 transferred 908 bytes in * seconds (*/sec) (glob) (no-rust !)
30 5 files to transfer, 1.01 KB of data (rust !)
31 transferred 1.01 KB in * seconds (* */sec) (glob) (rust !)
30 searching for changes
32 searching for changes
31 no changes found
33 no changes found
32 $ cd shallow
34 $ cd shallow
33
35
34 $ cat >> .hg/hgrc <<EOF
36 $ cat >> .hg/hgrc <<EOF
35 > [extensions]
37 > [extensions]
36 > getflogheads=$TESTDIR/remotefilelog-getflogheads.py
38 > getflogheads=$TESTDIR/remotefilelog-getflogheads.py
37 > EOF
39 > EOF
38
40
39 Get heads of a remotefilelog
41 Get heads of a remotefilelog
40
42
41 $ hg getflogheads x
43 $ hg getflogheads x
42 2797809ca5e9c2f307d82b1345e832f655fb99a2
44 2797809ca5e9c2f307d82b1345e832f655fb99a2
43 ca758b402ddc91e37e3113e1a97791b537e1b7bb
45 ca758b402ddc91e37e3113e1a97791b537e1b7bb
44
46
45 Get heads of a non-existing remotefilelog
47 Get heads of a non-existing remotefilelog
46
48
47 $ hg getflogheads y
49 $ hg getflogheads y
48 EMPTY
50 EMPTY
@@ -1,148 +1,150 b''
1 #require unix-permissions no-root reporevlogstore
1 #require unix-permissions no-root reporevlogstore
2
2
3 $ cat > $TESTTMP/dumpjournal.py <<EOF
3 $ cat > $TESTTMP/dumpjournal.py <<EOF
4 > import sys
4 > import sys
5 > for entry in sys.stdin.read().split('\n'):
5 > for entry in sys.stdin.read().split('\n'):
6 > if entry:
6 > if entry:
7 > print(entry.split('\x00')[0])
7 > print(entry.split('\x00')[0])
8 > EOF
8 > EOF
9
9
10 $ echo "[extensions]" >> $HGRCPATH
10 $ echo "[extensions]" >> $HGRCPATH
11 $ echo "mq=">> $HGRCPATH
11 $ echo "mq=">> $HGRCPATH
12
12
13 $ teststrip() {
13 $ teststrip() {
14 > hg -q up -C $1
14 > hg -q up -C $1
15 > echo % before update $1, strip $2
15 > echo % before update $1, strip $2
16 > hg parents
16 > hg parents
17 > chmod -$3 $4
17 > chmod -$3 $4
18 > hg strip $2 2>&1 | sed 's/\(bundle\).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/'
18 > hg strip $2 2>&1 | sed 's/\(bundle\).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/'
19 > echo % after update $1, strip $2
19 > echo % after update $1, strip $2
20 > chmod +$3 $4
20 > chmod +$3 $4
21 > hg verify
21 > hg verify
22 > echo % journal contents
22 > echo % journal contents
23 > if [ -f .hg/store/journal ]; then
23 > if [ -f .hg/store/journal ]; then
24 > cat .hg/store/journal | "$PYTHON" $TESTTMP/dumpjournal.py
24 > cat .hg/store/journal | "$PYTHON" $TESTTMP/dumpjournal.py
25 > else
25 > else
26 > echo "(no journal)"
26 > echo "(no journal)"
27 > fi
27 > fi
28 > if ls .hg/store/journal >/dev/null 2>&1; then
28 > if ls .hg/store/journal >/dev/null 2>&1; then
29 > hg recover --verify
29 > hg recover --verify
30 > fi
30 > fi
31 > ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/*
31 > ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/*
32 > rm -rf .hg/strip-backup
32 > rm -rf .hg/strip-backup
33 > }
33 > }
34
34
35 $ hg init test
35 $ hg init test
36 $ cd test
36 $ cd test
37 $ echo a > a
37 $ echo a > a
38 $ hg -q ci -m "a" -A
38 $ hg -q ci -m "a" -A
39 $ echo b > b
39 $ echo b > b
40 $ hg -q ci -m "b" -A
40 $ hg -q ci -m "b" -A
41 $ echo b2 >> b
41 $ echo b2 >> b
42 $ hg -q ci -m "b2" -A
42 $ hg -q ci -m "b2" -A
43 $ echo c > c
43 $ echo c > c
44 $ hg -q ci -m "c" -A
44 $ hg -q ci -m "c" -A
45 $ teststrip 0 2 w .hg/store/data/b.i
45 $ teststrip 0 2 w .hg/store/data/b.i
46 % before update 0, strip 2
46 % before update 0, strip 2
47 changeset: 0:cb9a9f314b8b
47 changeset: 0:cb9a9f314b8b
48 user: test
48 user: test
49 date: Thu Jan 01 00:00:00 1970 +0000
49 date: Thu Jan 01 00:00:00 1970 +0000
50 summary: a
50 summary: a
51
51
52 saved backup bundle
52 saved backup bundle
53 transaction abort!
53 transaction abort!
54 failed to truncate data/b.i
54 failed to truncate data/b.i
55 rollback failed - please run hg recover
55 rollback failed - please run hg recover
56 (failure reason: [Errno *] $EACCES$ .hg/store/data/b.i') (glob)
56 (failure reason: [Errno *] $EACCES$ .hg/store/data/b.i') (glob)
57 strip failed, backup bundle
57 strip failed, backup bundle
58 abort: $EACCES$ .hg/store/data/b.i'
58 abort: $EACCES$ .hg/store/data/b.i'
59 % after update 0, strip 2
59 % after update 0, strip 2
60 abandoned transaction found - run hg recover
60 abandoned transaction found - run hg recover
61 checking changesets
61 checking changesets
62 checking manifests
62 checking manifests
63 crosschecking files in changesets and manifests
63 crosschecking files in changesets and manifests
64 checking files
64 checking files
65 b@?: rev 1 points to nonexistent changeset 2
65 b@?: rev 1 points to nonexistent changeset 2
66 (expected 1)
66 (expected 1)
67 b@?: 736c29771fba not in manifests
67 b@?: 736c29771fba not in manifests
68 warning: orphan data file 'data/c.i'
68 warning: orphan data file 'data/c.i'
69 not checking dirstate because of previous errors
69 not checking dirstate because of previous errors
70 checked 2 changesets with 3 changes to 2 files
70 checked 2 changesets with 3 changes to 2 files
71 2 warnings encountered!
71 2 warnings encountered!
72 2 integrity errors encountered!
72 2 integrity errors encountered!
73 % journal contents
73 % journal contents
74 00changelog.d
74 00changelog.i
75 00changelog.i
75 00manifest.i
76 00manifest.i
76 data/b.i
77 data/b.i
77 data/c.i
78 data/c.i
78 rolling back interrupted transaction
79 rolling back interrupted transaction
79 checking changesets
80 checking changesets
80 checking manifests
81 checking manifests
81 crosschecking files in changesets and manifests
82 crosschecking files in changesets and manifests
82 checking files
83 checking files
83 checking dirstate
84 checking dirstate
84 checked 2 changesets with 2 changes to 2 files
85 checked 2 changesets with 2 changes to 2 files
85 $ teststrip 0 2 r .hg/store/data/b.i
86 $ teststrip 0 2 r .hg/store/data/b.i
86 % before update 0, strip 2
87 % before update 0, strip 2
87 changeset: 0:cb9a9f314b8b
88 changeset: 0:cb9a9f314b8b
88 user: test
89 user: test
89 date: Thu Jan 01 00:00:00 1970 +0000
90 date: Thu Jan 01 00:00:00 1970 +0000
90 summary: a
91 summary: a
91
92
92 abort: $EACCES$ .hg/store/data/b.i'
93 abort: $EACCES$ .hg/store/data/b.i'
93 % after update 0, strip 2
94 % after update 0, strip 2
94 checking changesets
95 checking changesets
95 checking manifests
96 checking manifests
96 crosschecking files in changesets and manifests
97 crosschecking files in changesets and manifests
97 checking files
98 checking files
98 checking dirstate
99 checking dirstate
99 checked 4 changesets with 4 changes to 3 files
100 checked 4 changesets with 4 changes to 3 files
100 % journal contents
101 % journal contents
101 (no journal)
102 (no journal)
102 $ teststrip 0 2 w .hg/store/00manifest.i
103 $ teststrip 0 2 w .hg/store/00manifest.i
103 % before update 0, strip 2
104 % before update 0, strip 2
104 changeset: 0:cb9a9f314b8b
105 changeset: 0:cb9a9f314b8b
105 user: test
106 user: test
106 date: Thu Jan 01 00:00:00 1970 +0000
107 date: Thu Jan 01 00:00:00 1970 +0000
107 summary: a
108 summary: a
108
109
109 saved backup bundle
110 saved backup bundle
110 transaction abort!
111 transaction abort!
111 failed to truncate 00manifest.i
112 failed to truncate 00manifest.i
112 rollback failed - please run hg recover
113 rollback failed - please run hg recover
113 (failure reason: [Errno *] $EACCES$ .hg/store/00manifest.i') (glob)
114 (failure reason: [Errno *] $EACCES$ .hg/store/00manifest.i') (glob)
114 strip failed, backup bundle
115 strip failed, backup bundle
115 abort: $EACCES$ .hg/store/00manifest.i'
116 abort: $EACCES$ .hg/store/00manifest.i'
116 % after update 0, strip 2
117 % after update 0, strip 2
117 abandoned transaction found - run hg recover
118 abandoned transaction found - run hg recover
118 checking changesets
119 checking changesets
119 checking manifests
120 checking manifests
120 manifest@?: rev 2 points to nonexistent changeset 2
121 manifest@?: rev 2 points to nonexistent changeset 2
121 manifest@?: 3362547cdf64 not in changesets
122 manifest@?: 3362547cdf64 not in changesets
122 manifest@?: rev 3 points to nonexistent changeset 3
123 manifest@?: rev 3 points to nonexistent changeset 3
123 manifest@?: 265a85892ecb not in changesets
124 manifest@?: 265a85892ecb not in changesets
124 crosschecking files in changesets and manifests
125 crosschecking files in changesets and manifests
125 c@3: in manifest but not in changeset
126 c@3: in manifest but not in changeset
126 checking files
127 checking files
127 b@?: rev 1 points to nonexistent changeset 2
128 b@?: rev 1 points to nonexistent changeset 2
128 (expected 1)
129 (expected 1)
129 c@?: rev 0 points to nonexistent changeset 3
130 c@?: rev 0 points to nonexistent changeset 3
130 not checking dirstate because of previous errors
131 not checking dirstate because of previous errors
131 checked 2 changesets with 4 changes to 3 files
132 checked 2 changesets with 4 changes to 3 files
132 1 warnings encountered!
133 1 warnings encountered!
133 7 integrity errors encountered!
134 7 integrity errors encountered!
134 (first damaged changeset appears to be 3)
135 (first damaged changeset appears to be 3)
135 % journal contents
136 % journal contents
137 00changelog.d
136 00changelog.i
138 00changelog.i
137 00manifest.i
139 00manifest.i
138 data/b.i
140 data/b.i
139 data/c.i
141 data/c.i
140 rolling back interrupted transaction
142 rolling back interrupted transaction
141 checking changesets
143 checking changesets
142 checking manifests
144 checking manifests
143 crosschecking files in changesets and manifests
145 crosschecking files in changesets and manifests
144 checking files
146 checking files
145 checking dirstate
147 checking dirstate
146 checked 2 changesets with 2 changes to 2 files
148 checked 2 changesets with 2 changes to 2 files
147
149
148 $ cd ..
150 $ cd ..
@@ -1,55 +1,57 b''
1 create verbosemmap.py
1 create verbosemmap.py
2 $ cat << EOF > verbosemmap.py
2 $ cat << EOF > verbosemmap.py
3 > # extension to make util.mmapread verbose
3 > # extension to make util.mmapread verbose
4 >
4 >
5 >
5 >
6 > from mercurial import (
6 > from mercurial import (
7 > extensions,
7 > extensions,
8 > pycompat,
8 > pycompat,
9 > util,
9 > util,
10 > )
10 > )
11 >
11 >
12 > def extsetup(ui):
12 > def extsetup(ui):
13 > def mmapread(orig, fp):
13 > def mmapread(orig, fp, *args):
14 > ui.write(b"mmapping %s\n" % pycompat.bytestr(fp.name))
14 > ui.write(b"mmapping %s\n" % pycompat.bytestr(fp.name))
15 > ui.flush()
15 > ui.flush()
16 > return orig(fp)
16 > return orig(fp, *args)
17 >
17 >
18 > extensions.wrapfunction(util, 'mmapread', mmapread)
18 > extensions.wrapfunction(util, 'mmapread', mmapread)
19 > EOF
19 > EOF
20
20
21 setting up base repo
21 setting up base repo
22 $ hg init a
22 $ hg init a
23 $ cd a
23 $ cd a
24 $ touch a
24 $ touch a
25 $ hg add a
25 $ hg add a
26 $ hg commit -qm base
26 $ hg commit -qm base
27 $ for i in `$TESTDIR/seq.py 1 100` ; do
27 $ for i in `$TESTDIR/seq.py 1 100` ; do
28 > echo $i > a
28 > echo $i > a
29 > hg commit -qm $i
29 > hg commit -qm $i
30 > done
30 > done
31
31
32 set up verbosemmap extension
32 set up verbosemmap extension
33 $ cat << EOF >> $HGRCPATH
33 $ cat << EOF >> $HGRCPATH
34 > [extensions]
34 > [extensions]
35 > verbosemmap=$TESTTMP/verbosemmap.py
35 > verbosemmap=$TESTTMP/verbosemmap.py
36 > EOF
36 > EOF
37
37
38 mmap index which is now more than 4k long
38 mmap index which is now more than 4k long
39 $ hg log -l 5 -T '{rev}\n' --config experimental.mmapindexthreshold=4k
39 $ hg log -l 5 -T '{rev}\n' --config experimental.mmapindexthreshold=4k
40 mmapping $TESTTMP/a/.hg/store/00changelog.i
40 mmapping $TESTTMP/a/.hg/store/00changelog.i
41 mmapping $TESTTMP/a/.hg/store/00changelog-????????.nd (glob) (rust !)
41 100
42 100
42 99
43 99
43 98
44 98
44 97
45 97
45 96
46 96
46
47
47 do not mmap index which is still less than 32k
48 do not mmap index which is still less than 32k
48 $ hg log -l 5 -T '{rev}\n' --config experimental.mmapindexthreshold=32k
49 $ hg log -l 5 -T '{rev}\n' --config experimental.mmapindexthreshold=32k
50 mmapping $TESTTMP/a/.hg/store/00changelog-????????.nd (glob) (rust !)
49 100
51 100
50 99
52 99
51 98
53 98
52 97
54 97
53 96
55 96
54
56
55 $ cd ..
57 $ cd ..
@@ -1,581 +1,585 b''
1 This test is a duplicate of 'test-http.t' feel free to factor out
1 This test is a duplicate of 'test-http.t' feel free to factor out
2 parts that are not bundle1/bundle2 specific.
2 parts that are not bundle1/bundle2 specific.
3
3
4 $ cat << EOF >> $HGRCPATH
4 $ cat << EOF >> $HGRCPATH
5 > [devel]
5 > [devel]
6 > # This test is dedicated to interaction through old bundle
6 > # This test is dedicated to interaction through old bundle
7 > legacy.exchange = bundle1
7 > legacy.exchange = bundle1
8 > EOF
8 > EOF
9
9
10
10
11 This test tries to exercise the ssh functionality with a dummy script
11 This test tries to exercise the ssh functionality with a dummy script
12
12
13 creating 'remote' repo
13 creating 'remote' repo
14
14
15 $ hg init remote
15 $ hg init remote
16 $ cd remote
16 $ cd remote
17 $ echo this > foo
17 $ echo this > foo
18 $ echo this > fooO
18 $ echo this > fooO
19 $ hg ci -A -m "init" foo fooO
19 $ hg ci -A -m "init" foo fooO
20
20
21 insert a closed branch (issue4428)
21 insert a closed branch (issue4428)
22
22
23 $ hg up null
23 $ hg up null
24 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
24 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
25 $ hg branch closed
25 $ hg branch closed
26 marked working directory as branch closed
26 marked working directory as branch closed
27 (branches are permanent and global, did you want a bookmark?)
27 (branches are permanent and global, did you want a bookmark?)
28 $ hg ci -mc0
28 $ hg ci -mc0
29 $ hg ci --close-branch -mc1
29 $ hg ci --close-branch -mc1
30 $ hg up -q default
30 $ hg up -q default
31
31
32 configure for serving
32 configure for serving
33
33
34 $ cat <<EOF > .hg/hgrc
34 $ cat <<EOF > .hg/hgrc
35 > [server]
35 > [server]
36 > uncompressed = True
36 > uncompressed = True
37 >
37 >
38 > [hooks]
38 > [hooks]
39 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
39 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
40 > EOF
40 > EOF
41 $ cd $TESTTMP
41 $ cd $TESTTMP
42
42
43 repo not found error
43 repo not found error
44
44
45 $ hg clone ssh://user@dummy/nonexistent local
45 $ hg clone ssh://user@dummy/nonexistent local
46 remote: abort: repository nonexistent not found
46 remote: abort: repository nonexistent not found
47 abort: no suitable response from remote hg
47 abort: no suitable response from remote hg
48 [255]
48 [255]
49
49
50 non-existent absolute path
50 non-existent absolute path
51
51
52 #if no-msys
52 #if no-msys
53 $ hg clone ssh://user@dummy//`pwd`/nonexistent local
53 $ hg clone ssh://user@dummy//`pwd`/nonexistent local
54 remote: abort: repository /$TESTTMP/nonexistent not found
54 remote: abort: repository /$TESTTMP/nonexistent not found
55 abort: no suitable response from remote hg
55 abort: no suitable response from remote hg
56 [255]
56 [255]
57 #endif
57 #endif
58
58
59 clone remote via stream
59 clone remote via stream
60
60
61 #if no-reposimplestore
61 #if no-reposimplestore
62
62
63 $ hg clone --stream ssh://user@dummy/remote local-stream
63 $ hg clone --stream ssh://user@dummy/remote local-stream
64 streaming all changes
64 streaming all changes
65 4 files to transfer, 602 bytes of data (no-zstd !)
65 5 files to transfer, 602 bytes of data (no-zstd !)
66 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
66 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
67 4 files to transfer, 621 bytes of data (zstd !)
67 5 files to transfer, 621 bytes of data (zstd no-rust !)
68 transferred 621 bytes in * seconds (* */sec) (glob) (zstd !)
68 transferred 621 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
69 7 files to transfer, 747 bytes of data (zstd rust !)
70 transferred 747 bytes in * seconds (*/sec) (glob) (zstd rust !)
69 searching for changes
71 searching for changes
70 no changes found
72 no changes found
71 updating to branch default
73 updating to branch default
72 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 $ cd local-stream
75 $ cd local-stream
74 $ hg verify -q
76 $ hg verify -q
75 $ hg branches
77 $ hg branches
76 default 0:1160648e36ce
78 default 0:1160648e36ce
77 $ cd $TESTTMP
79 $ cd $TESTTMP
78
80
79 clone bookmarks via stream
81 clone bookmarks via stream
80
82
81 $ hg -R local-stream book mybook
83 $ hg -R local-stream book mybook
82 $ hg clone --stream ssh://user@dummy/local-stream stream2
84 $ hg clone --stream ssh://user@dummy/local-stream stream2
83 streaming all changes
85 streaming all changes
84 4 files to transfer, 602 bytes of data (no-zstd !)
86 5 files to transfer, 602 bytes of data (no-zstd !)
85 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
87 transferred 602 bytes in * seconds (*) (glob) (no-zstd !)
86 4 files to transfer, 621 bytes of data (zstd !)
88 5 files to transfer, 621 bytes of data (zstd no-rust !)
87 transferred 621 bytes in * seconds (* */sec) (glob) (zstd !)
89 transferred 621 bytes in * seconds (* */sec) (glob) (zstd no-rust !)
90 7 files to transfer, 747 bytes of data (zstd rust !)
91 transferred 747 bytes in * seconds (*/sec) (glob) (zstd rust !)
88 searching for changes
92 searching for changes
89 no changes found
93 no changes found
90 updating to branch default
94 updating to branch default
91 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
95 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
92 $ cd stream2
96 $ cd stream2
93 $ hg book
97 $ hg book
94 mybook 0:1160648e36ce
98 mybook 0:1160648e36ce
95 $ cd $TESTTMP
99 $ cd $TESTTMP
96 $ rm -rf local-stream stream2
100 $ rm -rf local-stream stream2
97
101
98 #endif
102 #endif
99
103
100 clone remote via pull
104 clone remote via pull
101
105
102 $ hg clone ssh://user@dummy/remote local
106 $ hg clone ssh://user@dummy/remote local
103 requesting all changes
107 requesting all changes
104 adding changesets
108 adding changesets
105 adding manifests
109 adding manifests
106 adding file changes
110 adding file changes
107 added 3 changesets with 2 changes to 2 files
111 added 3 changesets with 2 changes to 2 files
108 new changesets 1160648e36ce:ad076bfb429d
112 new changesets 1160648e36ce:ad076bfb429d
109 updating to branch default
113 updating to branch default
110 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
114 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
111
115
112 verify
116 verify
113
117
114 $ cd local
118 $ cd local
115 $ hg verify -q
119 $ hg verify -q
116 $ cat >> .hg/hgrc <<EOF
120 $ cat >> .hg/hgrc <<EOF
117 > [hooks]
121 > [hooks]
118 > changegroup = sh -c "printenv.py --line changegroup-in-local 0 ../dummylog"
122 > changegroup = sh -c "printenv.py --line changegroup-in-local 0 ../dummylog"
119 > EOF
123 > EOF
120
124
121 empty default pull
125 empty default pull
122
126
123 $ hg paths
127 $ hg paths
124 default = ssh://user@dummy/remote
128 default = ssh://user@dummy/remote
125 $ hg pull
129 $ hg pull
126 pulling from ssh://user@dummy/remote
130 pulling from ssh://user@dummy/remote
127 searching for changes
131 searching for changes
128 no changes found
132 no changes found
129
133
130 pull from wrong ssh URL
134 pull from wrong ssh URL
131
135
132 $ hg pull ssh://user@dummy/doesnotexist
136 $ hg pull ssh://user@dummy/doesnotexist
133 pulling from ssh://user@dummy/doesnotexist
137 pulling from ssh://user@dummy/doesnotexist
134 remote: abort: repository doesnotexist not found
138 remote: abort: repository doesnotexist not found
135 abort: no suitable response from remote hg
139 abort: no suitable response from remote hg
136 [255]
140 [255]
137
141
138 local change
142 local change
139
143
140 $ echo bleah > foo
144 $ echo bleah > foo
141 $ hg ci -m "add"
145 $ hg ci -m "add"
142
146
143 updating rc
147 updating rc
144
148
145 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
149 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
146
150
147 find outgoing
151 find outgoing
148
152
149 $ hg out ssh://user@dummy/remote
153 $ hg out ssh://user@dummy/remote
150 comparing with ssh://user@dummy/remote
154 comparing with ssh://user@dummy/remote
151 searching for changes
155 searching for changes
152 changeset: 3:a28a9d1a809c
156 changeset: 3:a28a9d1a809c
153 tag: tip
157 tag: tip
154 parent: 0:1160648e36ce
158 parent: 0:1160648e36ce
155 user: test
159 user: test
156 date: Thu Jan 01 00:00:00 1970 +0000
160 date: Thu Jan 01 00:00:00 1970 +0000
157 summary: add
161 summary: add
158
162
159
163
160 find incoming on the remote side
164 find incoming on the remote side
161
165
162 $ hg incoming -R ../remote ssh://user@dummy/local
166 $ hg incoming -R ../remote ssh://user@dummy/local
163 comparing with ssh://user@dummy/local
167 comparing with ssh://user@dummy/local
164 searching for changes
168 searching for changes
165 changeset: 3:a28a9d1a809c
169 changeset: 3:a28a9d1a809c
166 tag: tip
170 tag: tip
167 parent: 0:1160648e36ce
171 parent: 0:1160648e36ce
168 user: test
172 user: test
169 date: Thu Jan 01 00:00:00 1970 +0000
173 date: Thu Jan 01 00:00:00 1970 +0000
170 summary: add
174 summary: add
171
175
172
176
173 find incoming on the remote side (using absolute path)
177 find incoming on the remote side (using absolute path)
174
178
175 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
179 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
176 comparing with ssh://user@dummy/$TESTTMP/local
180 comparing with ssh://user@dummy/$TESTTMP/local
177 searching for changes
181 searching for changes
178 changeset: 3:a28a9d1a809c
182 changeset: 3:a28a9d1a809c
179 tag: tip
183 tag: tip
180 parent: 0:1160648e36ce
184 parent: 0:1160648e36ce
181 user: test
185 user: test
182 date: Thu Jan 01 00:00:00 1970 +0000
186 date: Thu Jan 01 00:00:00 1970 +0000
183 summary: add
187 summary: add
184
188
185
189
186 push
190 push
187
191
188 $ hg push
192 $ hg push
189 pushing to ssh://user@dummy/remote
193 pushing to ssh://user@dummy/remote
190 searching for changes
194 searching for changes
191 remote: adding changesets
195 remote: adding changesets
192 remote: adding manifests
196 remote: adding manifests
193 remote: adding file changes
197 remote: adding file changes
194 remote: added 1 changesets with 1 changes to 1 files
198 remote: added 1 changesets with 1 changes to 1 files
195 $ cd $TESTTMP/remote
199 $ cd $TESTTMP/remote
196
200
197 check remote tip
201 check remote tip
198
202
199 $ hg tip
203 $ hg tip
200 changeset: 3:a28a9d1a809c
204 changeset: 3:a28a9d1a809c
201 tag: tip
205 tag: tip
202 parent: 0:1160648e36ce
206 parent: 0:1160648e36ce
203 user: test
207 user: test
204 date: Thu Jan 01 00:00:00 1970 +0000
208 date: Thu Jan 01 00:00:00 1970 +0000
205 summary: add
209 summary: add
206
210
207 $ hg verify -q
211 $ hg verify -q
208 $ hg cat -r tip foo
212 $ hg cat -r tip foo
209 bleah
213 bleah
210 $ echo z > z
214 $ echo z > z
211 $ hg ci -A -m z z
215 $ hg ci -A -m z z
212 created new head
216 created new head
213
217
214 test pushkeys and bookmarks
218 test pushkeys and bookmarks
215
219
216 $ cd $TESTTMP/local
220 $ cd $TESTTMP/local
217 $ hg debugpushkey ssh://user@dummy/remote namespaces
221 $ hg debugpushkey ssh://user@dummy/remote namespaces
218 bookmarks
222 bookmarks
219 namespaces
223 namespaces
220 phases
224 phases
221 $ hg book foo -r 0
225 $ hg book foo -r 0
222 $ hg out -B
226 $ hg out -B
223 comparing with ssh://user@dummy/remote
227 comparing with ssh://user@dummy/remote
224 searching for changed bookmarks
228 searching for changed bookmarks
225 foo 1160648e36ce
229 foo 1160648e36ce
226 $ hg push -B foo
230 $ hg push -B foo
227 pushing to ssh://user@dummy/remote
231 pushing to ssh://user@dummy/remote
228 searching for changes
232 searching for changes
229 no changes found
233 no changes found
230 exporting bookmark foo
234 exporting bookmark foo
231 [1]
235 [1]
232 $ hg debugpushkey ssh://user@dummy/remote bookmarks
236 $ hg debugpushkey ssh://user@dummy/remote bookmarks
233 foo 1160648e36cec0054048a7edc4110c6f84fde594
237 foo 1160648e36cec0054048a7edc4110c6f84fde594
234 $ hg book -f foo
238 $ hg book -f foo
235 $ hg push --traceback
239 $ hg push --traceback
236 pushing to ssh://user@dummy/remote
240 pushing to ssh://user@dummy/remote
237 searching for changes
241 searching for changes
238 no changes found
242 no changes found
239 updating bookmark foo
243 updating bookmark foo
240 [1]
244 [1]
241 $ hg book -d foo
245 $ hg book -d foo
242 $ hg in -B
246 $ hg in -B
243 comparing with ssh://user@dummy/remote
247 comparing with ssh://user@dummy/remote
244 searching for changed bookmarks
248 searching for changed bookmarks
245 foo a28a9d1a809c
249 foo a28a9d1a809c
246 $ hg book -f -r 0 foo
250 $ hg book -f -r 0 foo
247 $ hg pull -B foo
251 $ hg pull -B foo
248 pulling from ssh://user@dummy/remote
252 pulling from ssh://user@dummy/remote
249 no changes found
253 no changes found
250 updating bookmark foo
254 updating bookmark foo
251 $ hg book -d foo
255 $ hg book -d foo
252 $ hg push -B foo
256 $ hg push -B foo
253 pushing to ssh://user@dummy/remote
257 pushing to ssh://user@dummy/remote
254 searching for changes
258 searching for changes
255 no changes found
259 no changes found
256 deleting remote bookmark foo
260 deleting remote bookmark foo
257 [1]
261 [1]
258
262
259 a bad, evil hook that prints to stdout
263 a bad, evil hook that prints to stdout
260
264
261 $ cat <<EOF > $TESTTMP/badhook
265 $ cat <<EOF > $TESTTMP/badhook
262 > import sys
266 > import sys
263 > sys.stdout.write("KABOOM\n")
267 > sys.stdout.write("KABOOM\n")
264 > EOF
268 > EOF
265
269
266 $ echo '[hooks]' >> ../remote/.hg/hgrc
270 $ echo '[hooks]' >> ../remote/.hg/hgrc
267 $ echo "changegroup.stdout = \"$PYTHON\" $TESTTMP/badhook" >> ../remote/.hg/hgrc
271 $ echo "changegroup.stdout = \"$PYTHON\" $TESTTMP/badhook" >> ../remote/.hg/hgrc
268 $ echo r > r
272 $ echo r > r
269 $ hg ci -A -m z r
273 $ hg ci -A -m z r
270
274
271 push should succeed even though it has an unexpected response
275 push should succeed even though it has an unexpected response
272
276
273 $ hg push
277 $ hg push
274 pushing to ssh://user@dummy/remote
278 pushing to ssh://user@dummy/remote
275 searching for changes
279 searching for changes
276 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
280 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
277 remote: adding changesets
281 remote: adding changesets
278 remote: adding manifests
282 remote: adding manifests
279 remote: adding file changes
283 remote: adding file changes
280 remote: added 1 changesets with 1 changes to 1 files
284 remote: added 1 changesets with 1 changes to 1 files
281 remote: KABOOM
285 remote: KABOOM
282 $ hg -R ../remote heads
286 $ hg -R ../remote heads
283 changeset: 5:1383141674ec
287 changeset: 5:1383141674ec
284 tag: tip
288 tag: tip
285 parent: 3:a28a9d1a809c
289 parent: 3:a28a9d1a809c
286 user: test
290 user: test
287 date: Thu Jan 01 00:00:00 1970 +0000
291 date: Thu Jan 01 00:00:00 1970 +0000
288 summary: z
292 summary: z
289
293
290 changeset: 4:6c0482d977a3
294 changeset: 4:6c0482d977a3
291 parent: 0:1160648e36ce
295 parent: 0:1160648e36ce
292 user: test
296 user: test
293 date: Thu Jan 01 00:00:00 1970 +0000
297 date: Thu Jan 01 00:00:00 1970 +0000
294 summary: z
298 summary: z
295
299
296
300
297 clone bookmarks
301 clone bookmarks
298
302
299 $ hg -R ../remote bookmark test
303 $ hg -R ../remote bookmark test
300 $ hg -R ../remote bookmarks
304 $ hg -R ../remote bookmarks
301 * test 4:6c0482d977a3
305 * test 4:6c0482d977a3
302 $ hg clone ssh://user@dummy/remote local-bookmarks
306 $ hg clone ssh://user@dummy/remote local-bookmarks
303 requesting all changes
307 requesting all changes
304 adding changesets
308 adding changesets
305 adding manifests
309 adding manifests
306 adding file changes
310 adding file changes
307 added 6 changesets with 5 changes to 4 files (+1 heads)
311 added 6 changesets with 5 changes to 4 files (+1 heads)
308 new changesets 1160648e36ce:1383141674ec
312 new changesets 1160648e36ce:1383141674ec
309 updating to branch default
313 updating to branch default
310 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
314 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
311 $ hg -R local-bookmarks bookmarks
315 $ hg -R local-bookmarks bookmarks
312 test 4:6c0482d977a3
316 test 4:6c0482d977a3
313
317
314 passwords in ssh urls are not supported
318 passwords in ssh urls are not supported
315 (we use a glob here because different Python versions give different
319 (we use a glob here because different Python versions give different
316 results here)
320 results here)
317
321
318 $ hg push ssh://user:erroneouspwd@dummy/remote
322 $ hg push ssh://user:erroneouspwd@dummy/remote
319 pushing to ssh://user:*@dummy/remote (glob)
323 pushing to ssh://user:*@dummy/remote (glob)
320 abort: password in URL not supported
324 abort: password in URL not supported
321 [255]
325 [255]
322
326
323 $ cd $TESTTMP
327 $ cd $TESTTMP
324
328
325 hide outer repo
329 hide outer repo
326 $ hg init
330 $ hg init
327
331
328 Test remote paths with spaces (issue2983):
332 Test remote paths with spaces (issue2983):
329
333
330 $ hg init "ssh://user@dummy/a repo"
334 $ hg init "ssh://user@dummy/a repo"
331 $ touch "$TESTTMP/a repo/test"
335 $ touch "$TESTTMP/a repo/test"
332 $ hg -R 'a repo' commit -A -m "test"
336 $ hg -R 'a repo' commit -A -m "test"
333 adding test
337 adding test
334 $ hg -R 'a repo' tag tag
338 $ hg -R 'a repo' tag tag
335 $ hg id "ssh://user@dummy/a repo"
339 $ hg id "ssh://user@dummy/a repo"
336 73649e48688a
340 73649e48688a
337
341
338 $ hg id "ssh://user@dummy/a repo#noNoNO"
342 $ hg id "ssh://user@dummy/a repo#noNoNO"
339 abort: unknown revision 'noNoNO'
343 abort: unknown revision 'noNoNO'
340 [255]
344 [255]
341
345
342 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
346 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
343
347
344 $ hg clone "ssh://user@dummy/a repo"
348 $ hg clone "ssh://user@dummy/a repo"
345 destination directory: a repo
349 destination directory: a repo
346 abort: destination 'a repo' is not empty
350 abort: destination 'a repo' is not empty
347 [10]
351 [10]
348
352
349 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
353 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
350 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
354 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
351 parameters:
355 parameters:
352
356
353 $ cat > ssh.sh << EOF
357 $ cat > ssh.sh << EOF
354 > userhost="\$1"
358 > userhost="\$1"
355 > SSH_ORIGINAL_COMMAND="\$2"
359 > SSH_ORIGINAL_COMMAND="\$2"
356 > export SSH_ORIGINAL_COMMAND
360 > export SSH_ORIGINAL_COMMAND
357 > PYTHONPATH="$PYTHONPATH"
361 > PYTHONPATH="$PYTHONPATH"
358 > export PYTHONPATH
362 > export PYTHONPATH
359 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
363 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
360 > EOF
364 > EOF
361
365
362 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
366 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
363 73649e48688a
367 73649e48688a
364
368
365 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
369 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
366 remote: Illegal repository "$TESTTMP/a'repo"
370 remote: Illegal repository "$TESTTMP/a'repo"
367 abort: no suitable response from remote hg
371 abort: no suitable response from remote hg
368 [255]
372 [255]
369
373
370 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
374 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
371 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
375 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
372 abort: no suitable response from remote hg
376 abort: no suitable response from remote hg
373 [255]
377 [255]
374
378
375 $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
379 $ SSH_ORIGINAL_COMMAND="'hg' serve -R 'a'repo' --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
376 Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation
380 Illegal command "'hg' serve -R 'a'repo' --stdio": No closing quotation
377 [255]
381 [255]
378
382
379 Test hg-ssh in read-only mode:
383 Test hg-ssh in read-only mode:
380
384
381 $ cat > ssh.sh << EOF
385 $ cat > ssh.sh << EOF
382 > userhost="\$1"
386 > userhost="\$1"
383 > SSH_ORIGINAL_COMMAND="\$2"
387 > SSH_ORIGINAL_COMMAND="\$2"
384 > export SSH_ORIGINAL_COMMAND
388 > export SSH_ORIGINAL_COMMAND
385 > PYTHONPATH="$PYTHONPATH"
389 > PYTHONPATH="$PYTHONPATH"
386 > export PYTHONPATH
390 > export PYTHONPATH
387 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
391 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
388 > EOF
392 > EOF
389
393
390 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
394 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
391 requesting all changes
395 requesting all changes
392 adding changesets
396 adding changesets
393 adding manifests
397 adding manifests
394 adding file changes
398 adding file changes
395 added 6 changesets with 5 changes to 4 files (+1 heads)
399 added 6 changesets with 5 changes to 4 files (+1 heads)
396 new changesets 1160648e36ce:1383141674ec
400 new changesets 1160648e36ce:1383141674ec
397 updating to branch default
401 updating to branch default
398 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
402 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
399
403
400 $ cd read-only-local
404 $ cd read-only-local
401 $ echo "baz" > bar
405 $ echo "baz" > bar
402 $ hg ci -A -m "unpushable commit" bar
406 $ hg ci -A -m "unpushable commit" bar
403 $ hg push --ssh "sh ../ssh.sh"
407 $ hg push --ssh "sh ../ssh.sh"
404 pushing to ssh://user@dummy/*/remote (glob)
408 pushing to ssh://user@dummy/*/remote (glob)
405 searching for changes
409 searching for changes
406 remote: $EACCES$
410 remote: $EACCES$
407 remote: abort: pretxnopen.hg-ssh hook failed
411 remote: abort: pretxnopen.hg-ssh hook failed
408 remote: $EACCES$
412 remote: $EACCES$
409 remote: pushkey-abort: prepushkey.hg-ssh hook failed
413 remote: pushkey-abort: prepushkey.hg-ssh hook failed
410 updating 6c0482d977a3 to public failed!
414 updating 6c0482d977a3 to public failed!
411 [1]
415 [1]
412
416
413 $ cd $TESTTMP
417 $ cd $TESTTMP
414
418
415 stderr from remote commands should be printed before stdout from local code (issue4336)
419 stderr from remote commands should be printed before stdout from local code (issue4336)
416
420
417 $ hg clone remote stderr-ordering
421 $ hg clone remote stderr-ordering
418 updating to branch default
422 updating to branch default
419 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
423 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
420 $ cd stderr-ordering
424 $ cd stderr-ordering
421 $ cat >> localwrite.py << EOF
425 $ cat >> localwrite.py << EOF
422 > from mercurial import exchange, extensions
426 > from mercurial import exchange, extensions
423 >
427 >
424 > def wrappedpush(orig, repo, *args, **kwargs):
428 > def wrappedpush(orig, repo, *args, **kwargs):
425 > res = orig(repo, *args, **kwargs)
429 > res = orig(repo, *args, **kwargs)
426 > repo.ui.write(b'local stdout\n')
430 > repo.ui.write(b'local stdout\n')
427 > return res
431 > return res
428 >
432 >
429 > def extsetup(ui):
433 > def extsetup(ui):
430 > extensions.wrapfunction(exchange, 'push', wrappedpush)
434 > extensions.wrapfunction(exchange, 'push', wrappedpush)
431 > EOF
435 > EOF
432
436
433 $ cat >> .hg/hgrc << EOF
437 $ cat >> .hg/hgrc << EOF
434 > [paths]
438 > [paths]
435 > default-push = ssh://user@dummy/remote
439 > default-push = ssh://user@dummy/remote
436 > [extensions]
440 > [extensions]
437 > localwrite = localwrite.py
441 > localwrite = localwrite.py
438 > EOF
442 > EOF
439
443
440 $ echo localwrite > foo
444 $ echo localwrite > foo
441 $ hg commit -m 'testing localwrite'
445 $ hg commit -m 'testing localwrite'
442 $ hg push
446 $ hg push
443 pushing to ssh://user@dummy/remote
447 pushing to ssh://user@dummy/remote
444 searching for changes
448 searching for changes
445 remote: adding changesets
449 remote: adding changesets
446 remote: adding manifests
450 remote: adding manifests
447 remote: adding file changes
451 remote: adding file changes
448 remote: added 1 changesets with 1 changes to 1 files
452 remote: added 1 changesets with 1 changes to 1 files
449 remote: KABOOM
453 remote: KABOOM
450 local stdout
454 local stdout
451
455
452 debug output
456 debug output
453
457
454 $ hg pull --debug ssh://user@dummy/remote
458 $ hg pull --debug ssh://user@dummy/remote
455 pulling from ssh://user@dummy/remote
459 pulling from ssh://user@dummy/remote
456 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
460 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
457 sending hello command
461 sending hello command
458 sending between command
462 sending between command
459 remote: \d+ (re)
463 remote: \d+ (re)
460 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
464 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
461 remote: 1
465 remote: 1
462 sending protocaps command
466 sending protocaps command
463 preparing listkeys for "bookmarks"
467 preparing listkeys for "bookmarks"
464 sending listkeys command
468 sending listkeys command
465 received listkey for "bookmarks": 45 bytes
469 received listkey for "bookmarks": 45 bytes
466 query 1; heads
470 query 1; heads
467 sending batch command
471 sending batch command
468 searching for changes
472 searching for changes
469 all remote heads known locally
473 all remote heads known locally
470 no changes found
474 no changes found
471 preparing listkeys for "phases"
475 preparing listkeys for "phases"
472 sending listkeys command
476 sending listkeys command
473 received listkey for "phases": 15 bytes
477 received listkey for "phases": 15 bytes
474 checking for updated bookmarks
478 checking for updated bookmarks
475
479
476 $ cd $TESTTMP
480 $ cd $TESTTMP
477
481
478 $ cat dummylog
482 $ cat dummylog
479 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
483 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
480 Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio (no-msys !)
484 Got arguments 1:user@dummy 2:hg -R /$TESTTMP/nonexistent serve --stdio (no-msys !)
481 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
485 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
482 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
486 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
483 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
487 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
484 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
488 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
485 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
489 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
486 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
490 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
487 Got arguments 1:user@dummy 2:hg -R local serve --stdio
491 Got arguments 1:user@dummy 2:hg -R local serve --stdio
488 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
492 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
489 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
493 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
490 changegroup-in-remote hook: HG_HOOKNAME=changegroup
494 changegroup-in-remote hook: HG_HOOKNAME=changegroup
491 HG_HOOKTYPE=changegroup
495 HG_HOOKTYPE=changegroup
492 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
496 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
493 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
497 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
494 HG_SOURCE=serve
498 HG_SOURCE=serve
495 HG_TXNID=TXN:$ID$
499 HG_TXNID=TXN:$ID$
496 HG_TXNNAME=serve
500 HG_TXNNAME=serve
497 remote:ssh:$LOCALIP
501 remote:ssh:$LOCALIP
498 HG_URL=remote:ssh:$LOCALIP
502 HG_URL=remote:ssh:$LOCALIP
499
503
500 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
504 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
501 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
505 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
502 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
506 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
503 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
507 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
504 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
508 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
505 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
509 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
506 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
510 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
507 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
511 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
508 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
512 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
509 changegroup-in-remote hook: HG_HOOKNAME=changegroup
513 changegroup-in-remote hook: HG_HOOKNAME=changegroup
510 HG_HOOKTYPE=changegroup
514 HG_HOOKTYPE=changegroup
511 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
515 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
512 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
516 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
513 HG_SOURCE=serve
517 HG_SOURCE=serve
514 HG_TXNID=TXN:$ID$
518 HG_TXNID=TXN:$ID$
515 HG_TXNNAME=serve
519 HG_TXNNAME=serve
516 remote:ssh:$LOCALIP
520 remote:ssh:$LOCALIP
517 HG_URL=remote:ssh:$LOCALIP
521 HG_URL=remote:ssh:$LOCALIP
518
522
519 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
523 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
520 Got arguments 1:user@dummy 2:hg init 'a repo'
524 Got arguments 1:user@dummy 2:hg init 'a repo'
521 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
525 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
522 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
526 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
523 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
527 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
524 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
528 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
525 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
529 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
526 changegroup-in-remote hook: HG_HOOKNAME=changegroup
530 changegroup-in-remote hook: HG_HOOKNAME=changegroup
527 HG_HOOKTYPE=changegroup
531 HG_HOOKTYPE=changegroup
528 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
532 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
529 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
533 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
530 HG_SOURCE=serve
534 HG_SOURCE=serve
531 HG_TXNID=TXN:$ID$
535 HG_TXNID=TXN:$ID$
532 HG_TXNNAME=serve
536 HG_TXNNAME=serve
533 remote:ssh:$LOCALIP
537 remote:ssh:$LOCALIP
534 HG_URL=remote:ssh:$LOCALIP
538 HG_URL=remote:ssh:$LOCALIP
535
539
536 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
540 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
537
541
538 remote hook failure is attributed to remote
542 remote hook failure is attributed to remote
539
543
540 $ cat > $TESTTMP/failhook << EOF
544 $ cat > $TESTTMP/failhook << EOF
541 > def hook(ui, repo, **kwargs):
545 > def hook(ui, repo, **kwargs):
542 > ui.write(b'hook failure!\n')
546 > ui.write(b'hook failure!\n')
543 > ui.flush()
547 > ui.flush()
544 > return 1
548 > return 1
545 > EOF
549 > EOF
546
550
547 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
551 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
548
552
549 $ hg -q clone ssh://user@dummy/remote hookout
553 $ hg -q clone ssh://user@dummy/remote hookout
550 $ cd hookout
554 $ cd hookout
551 $ touch hookfailure
555 $ touch hookfailure
552 $ hg -q commit -A -m 'remote hook failure'
556 $ hg -q commit -A -m 'remote hook failure'
553 $ hg push
557 $ hg push
554 pushing to ssh://user@dummy/remote
558 pushing to ssh://user@dummy/remote
555 searching for changes
559 searching for changes
556 remote: adding changesets
560 remote: adding changesets
557 remote: adding manifests
561 remote: adding manifests
558 remote: adding file changes
562 remote: adding file changes
559 remote: hook failure!
563 remote: hook failure!
560 remote: transaction abort!
564 remote: transaction abort!
561 remote: rollback completed
565 remote: rollback completed
562 remote: abort: pretxnchangegroup.fail hook failed
566 remote: abort: pretxnchangegroup.fail hook failed
563 [1]
567 [1]
564
568
565 abort during pull is properly reported as such
569 abort during pull is properly reported as such
566
570
567 $ echo morefoo >> ../remote/foo
571 $ echo morefoo >> ../remote/foo
568 $ hg -R ../remote commit --message "more foo to be pulled"
572 $ hg -R ../remote commit --message "more foo to be pulled"
569 $ cat >> ../remote/.hg/hgrc << EOF
573 $ cat >> ../remote/.hg/hgrc << EOF
570 > [extensions]
574 > [extensions]
571 > crash = ${TESTDIR}/crashgetbundler.py
575 > crash = ${TESTDIR}/crashgetbundler.py
572 > EOF
576 > EOF
573 $ hg pull
577 $ hg pull
574 pulling from ssh://user@dummy/remote
578 pulling from ssh://user@dummy/remote
575 searching for changes
579 searching for changes
576 adding changesets
580 adding changesets
577 remote: abort: this is an exercise
581 remote: abort: this is an exercise
578 transaction abort!
582 transaction abort!
579 rollback completed
583 rollback completed
580 abort: stream ended unexpectedly (got 0 bytes, expected 4)
584 abort: stream ended unexpectedly (got 0 bytes, expected 4)
581 [255]
585 [255]
@@ -1,699 +1,701 b''
1 This test tries to exercise the ssh functionality with a dummy script
1 This test tries to exercise the ssh functionality with a dummy script
2
2
3 creating 'remote' repo
3 creating 'remote' repo
4
4
5 $ hg init remote
5 $ hg init remote
6 $ cd remote
6 $ cd remote
7 $ echo this > foo
7 $ echo this > foo
8 $ echo this > fooO
8 $ echo this > fooO
9 $ hg ci -A -m "init" foo fooO
9 $ hg ci -A -m "init" foo fooO
10
10
11 insert a closed branch (issue4428)
11 insert a closed branch (issue4428)
12
12
13 $ hg up null
13 $ hg up null
14 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
14 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
15 $ hg branch closed
15 $ hg branch closed
16 marked working directory as branch closed
16 marked working directory as branch closed
17 (branches are permanent and global, did you want a bookmark?)
17 (branches are permanent and global, did you want a bookmark?)
18 $ hg ci -mc0
18 $ hg ci -mc0
19 $ hg ci --close-branch -mc1
19 $ hg ci --close-branch -mc1
20 $ hg up -q default
20 $ hg up -q default
21
21
22 configure for serving
22 configure for serving
23
23
24 $ cat <<EOF > .hg/hgrc
24 $ cat <<EOF > .hg/hgrc
25 > [server]
25 > [server]
26 > uncompressed = True
26 > uncompressed = True
27 >
27 >
28 > [hooks]
28 > [hooks]
29 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
29 > changegroup = sh -c "printenv.py --line changegroup-in-remote 0 ../dummylog"
30 > EOF
30 > EOF
31 $ cd $TESTTMP
31 $ cd $TESTTMP
32
32
33 repo not found error
33 repo not found error
34
34
35 $ hg clone ssh://user@dummy/nonexistent local
35 $ hg clone ssh://user@dummy/nonexistent local
36 remote: abort: repository nonexistent not found
36 remote: abort: repository nonexistent not found
37 abort: no suitable response from remote hg
37 abort: no suitable response from remote hg
38 [255]
38 [255]
39 $ hg clone -q ssh://user@dummy/nonexistent local
39 $ hg clone -q ssh://user@dummy/nonexistent local
40 remote: abort: repository nonexistent not found
40 remote: abort: repository nonexistent not found
41 abort: no suitable response from remote hg
41 abort: no suitable response from remote hg
42 [255]
42 [255]
43
43
44 non-existent absolute path
44 non-existent absolute path
45
45
46 $ hg clone ssh://user@dummy/`pwd`/nonexistent local
46 $ hg clone ssh://user@dummy/`pwd`/nonexistent local
47 remote: abort: repository $TESTTMP/nonexistent not found
47 remote: abort: repository $TESTTMP/nonexistent not found
48 abort: no suitable response from remote hg
48 abort: no suitable response from remote hg
49 [255]
49 [255]
50
50
51 clone remote via stream
51 clone remote via stream
52
52
53 #if no-reposimplestore
53 #if no-reposimplestore
54
54
55 $ hg clone --stream ssh://user@dummy/remote local-stream
55 $ hg clone --stream ssh://user@dummy/remote local-stream
56 streaming all changes
56 streaming all changes
57 8 files to transfer, 827 bytes of data (no-zstd !)
57 9 files to transfer, 827 bytes of data (no-zstd !)
58 transferred 827 bytes in * seconds (*) (glob) (no-zstd !)
58 transferred 827 bytes in * seconds (*) (glob) (no-zstd !)
59 8 files to transfer, 846 bytes of data (zstd !)
59 9 files to transfer, 846 bytes of data (zstd no-rust !)
60 11 files to transfer, 972 bytes of data (zstd rust !)
60 transferred * bytes in * seconds (* */sec) (glob) (zstd !)
61 transferred * bytes in * seconds (* */sec) (glob) (zstd !)
61 updating to branch default
62 updating to branch default
62 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
63 $ cd local-stream
64 $ cd local-stream
64 $ hg verify -q
65 $ hg verify -q
65 $ hg branches
66 $ hg branches
66 default 0:1160648e36ce
67 default 0:1160648e36ce
67 $ cd $TESTTMP
68 $ cd $TESTTMP
68
69
69 clone bookmarks via stream
70 clone bookmarks via stream
70
71
71 $ hg -R local-stream book mybook
72 $ hg -R local-stream book mybook
72 $ hg clone --stream ssh://user@dummy/local-stream stream2
73 $ hg clone --stream ssh://user@dummy/local-stream stream2
73 streaming all changes
74 streaming all changes
74 15 files to transfer, * of data (glob)
75 16 files to transfer, * of data (glob) (no-rust !)
76 18 files to transfer, * of data (glob) (rust !)
75 transferred * in * seconds (*) (glob)
77 transferred * in * seconds (*) (glob)
76 updating to branch default
78 updating to branch default
77 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
78 $ cd stream2
80 $ cd stream2
79 $ hg book
81 $ hg book
80 mybook 0:1160648e36ce
82 mybook 0:1160648e36ce
81 $ cd $TESTTMP
83 $ cd $TESTTMP
82 $ rm -rf local-stream stream2
84 $ rm -rf local-stream stream2
83
85
84 #endif
86 #endif
85
87
86 clone remote via pull
88 clone remote via pull
87
89
88 $ hg clone ssh://user@dummy/remote local
90 $ hg clone ssh://user@dummy/remote local
89 requesting all changes
91 requesting all changes
90 adding changesets
92 adding changesets
91 adding manifests
93 adding manifests
92 adding file changes
94 adding file changes
93 added 3 changesets with 2 changes to 2 files
95 added 3 changesets with 2 changes to 2 files
94 new changesets 1160648e36ce:ad076bfb429d
96 new changesets 1160648e36ce:ad076bfb429d
95 updating to branch default
97 updating to branch default
96 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
97
99
98 verify
100 verify
99
101
100 $ cd local
102 $ cd local
101 $ hg verify -q
103 $ hg verify -q
102 $ cat >> .hg/hgrc <<EOF
104 $ cat >> .hg/hgrc <<EOF
103 > [hooks]
105 > [hooks]
104 > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog"
106 > changegroup = sh -c "printenv.py changegroup-in-local 0 ../dummylog"
105 > EOF
107 > EOF
106
108
107 empty default pull
109 empty default pull
108
110
109 $ hg paths
111 $ hg paths
110 default = ssh://user@dummy/remote
112 default = ssh://user@dummy/remote
111 $ hg pull
113 $ hg pull
112 pulling from ssh://user@dummy/remote
114 pulling from ssh://user@dummy/remote
113 searching for changes
115 searching for changes
114 no changes found
116 no changes found
115
117
116 pull from wrong ssh URL
118 pull from wrong ssh URL
117
119
118 $ hg pull ssh://user@dummy/doesnotexist
120 $ hg pull ssh://user@dummy/doesnotexist
119 pulling from ssh://user@dummy/doesnotexist
121 pulling from ssh://user@dummy/doesnotexist
120 remote: abort: repository doesnotexist not found
122 remote: abort: repository doesnotexist not found
121 abort: no suitable response from remote hg
123 abort: no suitable response from remote hg
122 [255]
124 [255]
123
125
124 local change
126 local change
125
127
126 $ echo bleah > foo
128 $ echo bleah > foo
127 $ hg ci -m "add"
129 $ hg ci -m "add"
128
130
129 updating rc
131 updating rc
130
132
131 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
133 $ echo "default-push = ssh://user@dummy/remote" >> .hg/hgrc
132
134
133 find outgoing
135 find outgoing
134
136
135 $ hg out ssh://user@dummy/remote
137 $ hg out ssh://user@dummy/remote
136 comparing with ssh://user@dummy/remote
138 comparing with ssh://user@dummy/remote
137 searching for changes
139 searching for changes
138 changeset: 3:a28a9d1a809c
140 changeset: 3:a28a9d1a809c
139 tag: tip
141 tag: tip
140 parent: 0:1160648e36ce
142 parent: 0:1160648e36ce
141 user: test
143 user: test
142 date: Thu Jan 01 00:00:00 1970 +0000
144 date: Thu Jan 01 00:00:00 1970 +0000
143 summary: add
145 summary: add
144
146
145
147
146 find incoming on the remote side
148 find incoming on the remote side
147
149
148 $ hg incoming -R ../remote ssh://user@dummy/local
150 $ hg incoming -R ../remote ssh://user@dummy/local
149 comparing with ssh://user@dummy/local
151 comparing with ssh://user@dummy/local
150 searching for changes
152 searching for changes
151 changeset: 3:a28a9d1a809c
153 changeset: 3:a28a9d1a809c
152 tag: tip
154 tag: tip
153 parent: 0:1160648e36ce
155 parent: 0:1160648e36ce
154 user: test
156 user: test
155 date: Thu Jan 01 00:00:00 1970 +0000
157 date: Thu Jan 01 00:00:00 1970 +0000
156 summary: add
158 summary: add
157
159
158
160
159 find incoming on the remote side (using absolute path)
161 find incoming on the remote side (using absolute path)
160
162
161 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
163 $ hg incoming -R ../remote "ssh://user@dummy/`pwd`"
162 comparing with ssh://user@dummy/$TESTTMP/local
164 comparing with ssh://user@dummy/$TESTTMP/local
163 searching for changes
165 searching for changes
164 changeset: 3:a28a9d1a809c
166 changeset: 3:a28a9d1a809c
165 tag: tip
167 tag: tip
166 parent: 0:1160648e36ce
168 parent: 0:1160648e36ce
167 user: test
169 user: test
168 date: Thu Jan 01 00:00:00 1970 +0000
170 date: Thu Jan 01 00:00:00 1970 +0000
169 summary: add
171 summary: add
170
172
171
173
172 push
174 push
173
175
174 $ hg push
176 $ hg push
175 pushing to ssh://user@dummy/remote
177 pushing to ssh://user@dummy/remote
176 searching for changes
178 searching for changes
177 remote: adding changesets
179 remote: adding changesets
178 remote: adding manifests
180 remote: adding manifests
179 remote: adding file changes
181 remote: adding file changes
180 remote: added 1 changesets with 1 changes to 1 files
182 remote: added 1 changesets with 1 changes to 1 files
181 $ cd $TESTTMP/remote
183 $ cd $TESTTMP/remote
182
184
183 check remote tip
185 check remote tip
184
186
185 $ hg tip
187 $ hg tip
186 changeset: 3:a28a9d1a809c
188 changeset: 3:a28a9d1a809c
187 tag: tip
189 tag: tip
188 parent: 0:1160648e36ce
190 parent: 0:1160648e36ce
189 user: test
191 user: test
190 date: Thu Jan 01 00:00:00 1970 +0000
192 date: Thu Jan 01 00:00:00 1970 +0000
191 summary: add
193 summary: add
192
194
193 $ hg verify -q
195 $ hg verify -q
194 $ hg cat -r tip foo
196 $ hg cat -r tip foo
195 bleah
197 bleah
196 $ echo z > z
198 $ echo z > z
197 $ hg ci -A -m z z
199 $ hg ci -A -m z z
198 created new head
200 created new head
199
201
200 test pushkeys and bookmarks
202 test pushkeys and bookmarks
201
203
202 $ cd $TESTTMP/local
204 $ cd $TESTTMP/local
203 $ hg debugpushkey ssh://user@dummy/remote namespaces
205 $ hg debugpushkey ssh://user@dummy/remote namespaces
204 bookmarks
206 bookmarks
205 namespaces
207 namespaces
206 phases
208 phases
207 $ hg book foo -r 0
209 $ hg book foo -r 0
208 $ hg out -B --config paths.default=bogus://invalid --config paths.default:pushurl=`hg paths default`
210 $ hg out -B --config paths.default=bogus://invalid --config paths.default:pushurl=`hg paths default`
209 comparing with ssh://user@dummy/remote
211 comparing with ssh://user@dummy/remote
210 searching for changed bookmarks
212 searching for changed bookmarks
211 foo 1160648e36ce
213 foo 1160648e36ce
212 $ hg push -B foo
214 $ hg push -B foo
213 pushing to ssh://user@dummy/remote
215 pushing to ssh://user@dummy/remote
214 searching for changes
216 searching for changes
215 no changes found
217 no changes found
216 exporting bookmark foo
218 exporting bookmark foo
217 [1]
219 [1]
218 $ hg debugpushkey ssh://user@dummy/remote bookmarks
220 $ hg debugpushkey ssh://user@dummy/remote bookmarks
219 foo 1160648e36cec0054048a7edc4110c6f84fde594
221 foo 1160648e36cec0054048a7edc4110c6f84fde594
220 $ hg book -f foo
222 $ hg book -f foo
221 $ hg push --traceback
223 $ hg push --traceback
222 pushing to ssh://user@dummy/remote
224 pushing to ssh://user@dummy/remote
223 searching for changes
225 searching for changes
224 no changes found
226 no changes found
225 updating bookmark foo
227 updating bookmark foo
226 [1]
228 [1]
227 $ hg book -d foo
229 $ hg book -d foo
228 $ hg in -B
230 $ hg in -B
229 comparing with ssh://user@dummy/remote
231 comparing with ssh://user@dummy/remote
230 searching for changed bookmarks
232 searching for changed bookmarks
231 foo a28a9d1a809c
233 foo a28a9d1a809c
232 $ hg book -f -r 0 foo
234 $ hg book -f -r 0 foo
233 $ hg pull -B foo
235 $ hg pull -B foo
234 pulling from ssh://user@dummy/remote
236 pulling from ssh://user@dummy/remote
235 no changes found
237 no changes found
236 updating bookmark foo
238 updating bookmark foo
237 $ hg book -d foo
239 $ hg book -d foo
238 $ hg push -B foo
240 $ hg push -B foo
239 pushing to ssh://user@dummy/remote
241 pushing to ssh://user@dummy/remote
240 searching for changes
242 searching for changes
241 no changes found
243 no changes found
242 deleting remote bookmark foo
244 deleting remote bookmark foo
243 [1]
245 [1]
244
246
245 a bad, evil hook that prints to stdout
247 a bad, evil hook that prints to stdout
246
248
247 $ cat <<EOF > $TESTTMP/badhook
249 $ cat <<EOF > $TESTTMP/badhook
248 > import sys
250 > import sys
249 > sys.stdout.write("KABOOM\n")
251 > sys.stdout.write("KABOOM\n")
250 > sys.stdout.flush()
252 > sys.stdout.flush()
251 > EOF
253 > EOF
252
254
253 $ cat <<EOF > $TESTTMP/badpyhook.py
255 $ cat <<EOF > $TESTTMP/badpyhook.py
254 > import sys
256 > import sys
255 > def hook(ui, repo, hooktype, **kwargs):
257 > def hook(ui, repo, hooktype, **kwargs):
256 > sys.stdout.write("KABOOM IN PROCESS\n")
258 > sys.stdout.write("KABOOM IN PROCESS\n")
257 > sys.stdout.flush()
259 > sys.stdout.flush()
258 > EOF
260 > EOF
259
261
260 $ cat <<EOF >> ../remote/.hg/hgrc
262 $ cat <<EOF >> ../remote/.hg/hgrc
261 > [hooks]
263 > [hooks]
262 > changegroup.stdout = "$PYTHON" $TESTTMP/badhook
264 > changegroup.stdout = "$PYTHON" $TESTTMP/badhook
263 > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook
265 > changegroup.pystdout = python:$TESTTMP/badpyhook.py:hook
264 > EOF
266 > EOF
265 $ echo r > r
267 $ echo r > r
266 $ hg ci -A -m z r
268 $ hg ci -A -m z r
267
269
268 push should succeed even though it has an unexpected response
270 push should succeed even though it has an unexpected response
269
271
270 $ hg push
272 $ hg push
271 pushing to ssh://user@dummy/remote
273 pushing to ssh://user@dummy/remote
272 searching for changes
274 searching for changes
273 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
275 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
274 remote: adding changesets
276 remote: adding changesets
275 remote: adding manifests
277 remote: adding manifests
276 remote: adding file changes
278 remote: adding file changes
277 remote: added 1 changesets with 1 changes to 1 files
279 remote: added 1 changesets with 1 changes to 1 files
278 remote: KABOOM
280 remote: KABOOM
279 remote: KABOOM IN PROCESS
281 remote: KABOOM IN PROCESS
280 $ hg -R ../remote heads
282 $ hg -R ../remote heads
281 changeset: 5:1383141674ec
283 changeset: 5:1383141674ec
282 tag: tip
284 tag: tip
283 parent: 3:a28a9d1a809c
285 parent: 3:a28a9d1a809c
284 user: test
286 user: test
285 date: Thu Jan 01 00:00:00 1970 +0000
287 date: Thu Jan 01 00:00:00 1970 +0000
286 summary: z
288 summary: z
287
289
288 changeset: 4:6c0482d977a3
290 changeset: 4:6c0482d977a3
289 parent: 0:1160648e36ce
291 parent: 0:1160648e36ce
290 user: test
292 user: test
291 date: Thu Jan 01 00:00:00 1970 +0000
293 date: Thu Jan 01 00:00:00 1970 +0000
292 summary: z
294 summary: z
293
295
294
296
295 #if chg
297 #if chg
296
298
297 try again with remote chg, which should succeed as well
299 try again with remote chg, which should succeed as well
298
300
299 $ hg rollback -R ../remote
301 $ hg rollback -R ../remote
300 repository tip rolled back to revision 4 (undo serve)
302 repository tip rolled back to revision 4 (undo serve)
301
303
302 $ hg push --config ui.remotecmd=chg
304 $ hg push --config ui.remotecmd=chg
303 pushing to ssh://user@dummy/remote
305 pushing to ssh://user@dummy/remote
304 searching for changes
306 searching for changes
305 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
307 remote has heads on branch 'default' that are not known locally: 6c0482d977a3
306 remote: adding changesets
308 remote: adding changesets
307 remote: adding manifests
309 remote: adding manifests
308 remote: adding file changes
310 remote: adding file changes
309 remote: added 1 changesets with 1 changes to 1 files
311 remote: added 1 changesets with 1 changes to 1 files
310 remote: KABOOM
312 remote: KABOOM
311 remote: KABOOM IN PROCESS
313 remote: KABOOM IN PROCESS
312
314
313 #endif
315 #endif
314
316
315 clone bookmarks
317 clone bookmarks
316
318
317 $ hg -R ../remote bookmark test
319 $ hg -R ../remote bookmark test
318 $ hg -R ../remote bookmarks
320 $ hg -R ../remote bookmarks
319 * test 4:6c0482d977a3
321 * test 4:6c0482d977a3
320 $ hg clone ssh://user@dummy/remote local-bookmarks
322 $ hg clone ssh://user@dummy/remote local-bookmarks
321 requesting all changes
323 requesting all changes
322 adding changesets
324 adding changesets
323 adding manifests
325 adding manifests
324 adding file changes
326 adding file changes
325 added 6 changesets with 5 changes to 4 files (+1 heads)
327 added 6 changesets with 5 changes to 4 files (+1 heads)
326 new changesets 1160648e36ce:1383141674ec
328 new changesets 1160648e36ce:1383141674ec
327 updating to branch default
329 updating to branch default
328 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
329 $ hg -R local-bookmarks bookmarks
331 $ hg -R local-bookmarks bookmarks
330 test 4:6c0482d977a3
332 test 4:6c0482d977a3
331
333
332 passwords in ssh urls are not supported
334 passwords in ssh urls are not supported
333 (we use a glob here because different Python versions give different
335 (we use a glob here because different Python versions give different
334 results here)
336 results here)
335
337
336 $ hg push ssh://user:erroneouspwd@dummy/remote
338 $ hg push ssh://user:erroneouspwd@dummy/remote
337 pushing to ssh://user:*@dummy/remote (glob)
339 pushing to ssh://user:*@dummy/remote (glob)
338 abort: password in URL not supported
340 abort: password in URL not supported
339 [255]
341 [255]
340
342
341 $ cd $TESTTMP
343 $ cd $TESTTMP
342
344
343 hide outer repo
345 hide outer repo
344 $ hg init
346 $ hg init
345
347
346 Test remote paths with spaces (issue2983):
348 Test remote paths with spaces (issue2983):
347
349
348 $ hg init "ssh://user@dummy/a repo"
350 $ hg init "ssh://user@dummy/a repo"
349 $ touch "$TESTTMP/a repo/test"
351 $ touch "$TESTTMP/a repo/test"
350 $ hg -R 'a repo' commit -A -m "test"
352 $ hg -R 'a repo' commit -A -m "test"
351 adding test
353 adding test
352 $ hg -R 'a repo' tag tag
354 $ hg -R 'a repo' tag tag
353 $ hg id "ssh://user@dummy/a repo"
355 $ hg id "ssh://user@dummy/a repo"
354 73649e48688a
356 73649e48688a
355
357
356 $ hg id "ssh://user@dummy/a repo#noNoNO"
358 $ hg id "ssh://user@dummy/a repo#noNoNO"
357 abort: unknown revision 'noNoNO'
359 abort: unknown revision 'noNoNO'
358 [255]
360 [255]
359
361
360 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
362 Test (non-)escaping of remote paths with spaces when cloning (issue3145):
361
363
362 $ hg clone "ssh://user@dummy/a repo"
364 $ hg clone "ssh://user@dummy/a repo"
363 destination directory: a repo
365 destination directory: a repo
364 abort: destination 'a repo' is not empty
366 abort: destination 'a repo' is not empty
365 [10]
367 [10]
366
368
367 #if no-rhg
369 #if no-rhg
368 Make sure hg is really paranoid in serve --stdio mode. It used to be
370 Make sure hg is really paranoid in serve --stdio mode. It used to be
369 possible to get a debugger REPL by specifying a repo named --debugger.
371 possible to get a debugger REPL by specifying a repo named --debugger.
370 $ hg -R --debugger serve --stdio
372 $ hg -R --debugger serve --stdio
371 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio']
373 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio']
372 [255]
374 [255]
373 $ hg -R --config=ui.debugger=yes serve --stdio
375 $ hg -R --config=ui.debugger=yes serve --stdio
374 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio']
376 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio']
375 [255]
377 [255]
376 Abbreviations of 'serve' also don't work, to avoid shenanigans.
378 Abbreviations of 'serve' also don't work, to avoid shenanigans.
377 $ hg -R narf serv --stdio
379 $ hg -R narf serv --stdio
378 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
380 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
379 [255]
381 [255]
380 #else
382 #else
381 rhg aborts early on -R without a repository at that path
383 rhg aborts early on -R without a repository at that path
382 $ hg -R --debugger serve --stdio
384 $ hg -R --debugger serve --stdio
383 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio'] (missing-correct-output !)
385 abort: potentially unsafe serve --stdio invocation: ['-R', '--debugger', 'serve', '--stdio'] (missing-correct-output !)
384 abort: repository --debugger not found (known-bad-output !)
386 abort: repository --debugger not found (known-bad-output !)
385 [255]
387 [255]
386 $ hg -R --config=ui.debugger=yes serve --stdio
388 $ hg -R --config=ui.debugger=yes serve --stdio
387 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio'] (missing-correct-output !)
389 abort: potentially unsafe serve --stdio invocation: ['-R', '--config=ui.debugger=yes', 'serve', '--stdio'] (missing-correct-output !)
388 abort: repository --config=ui.debugger=yes not found (known-bad-output !)
390 abort: repository --config=ui.debugger=yes not found (known-bad-output !)
389 [255]
391 [255]
390 $ hg -R narf serv --stdio
392 $ hg -R narf serv --stdio
391 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio'] (missing-correct-output !)
393 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio'] (missing-correct-output !)
392 abort: repository narf not found (known-bad-output !)
394 abort: repository narf not found (known-bad-output !)
393 [255]
395 [255]
394 If the repo does exist, rhg finds an unsupported command and falls back to Python
396 If the repo does exist, rhg finds an unsupported command and falls back to Python
395 which still does the right thing
397 which still does the right thing
396 $ hg init narf
398 $ hg init narf
397 $ hg -R narf serv --stdio
399 $ hg -R narf serv --stdio
398 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
400 abort: potentially unsafe serve --stdio invocation: ['-R', 'narf', 'serv', '--stdio']
399 [255]
401 [255]
400 #endif
402 #endif
401
403
402 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
404 Test hg-ssh using a helper script that will restore PYTHONPATH (which might
403 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
405 have been cleared by a hg.exe wrapper) and invoke hg-ssh with the right
404 parameters:
406 parameters:
405
407
406 $ cat > ssh.sh << EOF
408 $ cat > ssh.sh << EOF
407 > userhost="\$1"
409 > userhost="\$1"
408 > SSH_ORIGINAL_COMMAND="\$2"
410 > SSH_ORIGINAL_COMMAND="\$2"
409 > export SSH_ORIGINAL_COMMAND
411 > export SSH_ORIGINAL_COMMAND
410 > PYTHONPATH="$PYTHONPATH"
412 > PYTHONPATH="$PYTHONPATH"
411 > export PYTHONPATH
413 > export PYTHONPATH
412 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
414 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" "$TESTTMP/a repo"
413 > EOF
415 > EOF
414
416
415 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
417 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a repo"
416 73649e48688a
418 73649e48688a
417
419
418 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
420 $ hg id --ssh "sh ssh.sh" "ssh://user@dummy/a'repo"
419 remote: Illegal repository "$TESTTMP/a'repo"
421 remote: Illegal repository "$TESTTMP/a'repo"
420 abort: no suitable response from remote hg
422 abort: no suitable response from remote hg
421 [255]
423 [255]
422
424
423 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
425 $ hg id --ssh "sh ssh.sh" --remotecmd hacking "ssh://user@dummy/a'repo"
424 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
426 remote: Illegal command "hacking -R 'a'\''repo' serve --stdio"
425 abort: no suitable response from remote hg
427 abort: no suitable response from remote hg
426 [255]
428 [255]
427
429
428 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
430 $ SSH_ORIGINAL_COMMAND="'hg' -R 'a'repo' serve --stdio" "$PYTHON" "$TESTDIR/../contrib/hg-ssh"
429 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
431 Illegal command "'hg' -R 'a'repo' serve --stdio": No closing quotation
430 [255]
432 [255]
431
433
432 Test hg-ssh in read-only mode:
434 Test hg-ssh in read-only mode:
433
435
434 $ cat > ssh.sh << EOF
436 $ cat > ssh.sh << EOF
435 > userhost="\$1"
437 > userhost="\$1"
436 > SSH_ORIGINAL_COMMAND="\$2"
438 > SSH_ORIGINAL_COMMAND="\$2"
437 > export SSH_ORIGINAL_COMMAND
439 > export SSH_ORIGINAL_COMMAND
438 > PYTHONPATH="$PYTHONPATH"
440 > PYTHONPATH="$PYTHONPATH"
439 > export PYTHONPATH
441 > export PYTHONPATH
440 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
442 > "$PYTHON" "$TESTDIR/../contrib/hg-ssh" --read-only "$TESTTMP/remote"
441 > EOF
443 > EOF
442
444
443 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
445 $ hg clone --ssh "sh ssh.sh" "ssh://user@dummy/$TESTTMP/remote" read-only-local
444 requesting all changes
446 requesting all changes
445 adding changesets
447 adding changesets
446 adding manifests
448 adding manifests
447 adding file changes
449 adding file changes
448 added 6 changesets with 5 changes to 4 files (+1 heads)
450 added 6 changesets with 5 changes to 4 files (+1 heads)
449 new changesets 1160648e36ce:1383141674ec
451 new changesets 1160648e36ce:1383141674ec
450 updating to branch default
452 updating to branch default
451 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
453 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
452
454
453 $ cd read-only-local
455 $ cd read-only-local
454 $ echo "baz" > bar
456 $ echo "baz" > bar
455 $ hg ci -A -m "unpushable commit" bar
457 $ hg ci -A -m "unpushable commit" bar
456 $ hg push --ssh "sh ../ssh.sh"
458 $ hg push --ssh "sh ../ssh.sh"
457 pushing to ssh://user@dummy/*/remote (glob)
459 pushing to ssh://user@dummy/*/remote (glob)
458 searching for changes
460 searching for changes
459 remote: $EACCES$
461 remote: $EACCES$
460 remote: pretxnopen.hg-ssh hook failed
462 remote: pretxnopen.hg-ssh hook failed
461 abort: push failed on remote
463 abort: push failed on remote
462 [100]
464 [100]
463
465
464 $ cd $TESTTMP
466 $ cd $TESTTMP
465
467
466 stderr from remote commands should be printed before stdout from local code (issue4336)
468 stderr from remote commands should be printed before stdout from local code (issue4336)
467
469
468 $ hg clone remote stderr-ordering
470 $ hg clone remote stderr-ordering
469 updating to branch default
471 updating to branch default
470 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
472 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
471 $ cd stderr-ordering
473 $ cd stderr-ordering
472 $ cat >> localwrite.py << EOF
474 $ cat >> localwrite.py << EOF
473 > from mercurial import exchange, extensions
475 > from mercurial import exchange, extensions
474 >
476 >
475 > def wrappedpush(orig, repo, *args, **kwargs):
477 > def wrappedpush(orig, repo, *args, **kwargs):
476 > res = orig(repo, *args, **kwargs)
478 > res = orig(repo, *args, **kwargs)
477 > repo.ui.write(b'local stdout\n')
479 > repo.ui.write(b'local stdout\n')
478 > repo.ui.flush()
480 > repo.ui.flush()
479 > return res
481 > return res
480 >
482 >
481 > def extsetup(ui):
483 > def extsetup(ui):
482 > extensions.wrapfunction(exchange, 'push', wrappedpush)
484 > extensions.wrapfunction(exchange, 'push', wrappedpush)
483 > EOF
485 > EOF
484
486
485 $ cat >> .hg/hgrc << EOF
487 $ cat >> .hg/hgrc << EOF
486 > [paths]
488 > [paths]
487 > default-push = ssh://user@dummy/remote
489 > default-push = ssh://user@dummy/remote
488 > [extensions]
490 > [extensions]
489 > localwrite = localwrite.py
491 > localwrite = localwrite.py
490 > EOF
492 > EOF
491
493
492 $ echo localwrite > foo
494 $ echo localwrite > foo
493 $ hg commit -m 'testing localwrite'
495 $ hg commit -m 'testing localwrite'
494 $ hg push
496 $ hg push
495 pushing to ssh://user@dummy/remote
497 pushing to ssh://user@dummy/remote
496 searching for changes
498 searching for changes
497 remote: adding changesets
499 remote: adding changesets
498 remote: adding manifests
500 remote: adding manifests
499 remote: adding file changes
501 remote: adding file changes
500 remote: added 1 changesets with 1 changes to 1 files
502 remote: added 1 changesets with 1 changes to 1 files
501 remote: KABOOM
503 remote: KABOOM
502 remote: KABOOM IN PROCESS
504 remote: KABOOM IN PROCESS
503 local stdout
505 local stdout
504
506
505 debug output
507 debug output
506
508
507 $ hg pull --debug ssh://user@dummy/remote --config devel.debug.peer-request=yes
509 $ hg pull --debug ssh://user@dummy/remote --config devel.debug.peer-request=yes
508 pulling from ssh://user@dummy/remote
510 pulling from ssh://user@dummy/remote
509 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
511 running .* ".*[/\\]dummyssh" ['"]user@dummy['"] ['"]hg -R remote serve --stdio['"] (re)
510 devel-peer-request: hello+between
512 devel-peer-request: hello+between
511 devel-peer-request: pairs: 81 bytes
513 devel-peer-request: pairs: 81 bytes
512 sending hello command
514 sending hello command
513 sending between command
515 sending between command
514 remote: \d+ (re)
516 remote: \d+ (re)
515 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
517 remote: capabilities: batch branchmap \$USUAL_BUNDLE2_CAPS\$ changegroupsubset getbundle known lookup protocaps pushkey streamreqs=[^ ,]+(,[^ ,]+)* unbundle=HG10GZ,HG10BZ,HG10UN unbundlehash (re)
516 remote: 1
518 remote: 1
517 devel-peer-request: protocaps
519 devel-peer-request: protocaps
518 devel-peer-request: caps: * bytes (glob)
520 devel-peer-request: caps: * bytes (glob)
519 sending protocaps command
521 sending protocaps command
520 query 1; heads
522 query 1; heads
521 devel-peer-request: batched-content
523 devel-peer-request: batched-content
522 devel-peer-request: - heads (0 arguments)
524 devel-peer-request: - heads (0 arguments)
523 devel-peer-request: - known (1 arguments)
525 devel-peer-request: - known (1 arguments)
524 devel-peer-request: batch
526 devel-peer-request: batch
525 devel-peer-request: cmds: 141 bytes
527 devel-peer-request: cmds: 141 bytes
526 sending batch command
528 sending batch command
527 searching for changes
529 searching for changes
528 all remote heads known locally
530 all remote heads known locally
529 no changes found
531 no changes found
530 devel-peer-request: getbundle
532 devel-peer-request: getbundle
531 devel-peer-request: bookmarks: 1 bytes
533 devel-peer-request: bookmarks: 1 bytes
532 devel-peer-request: bundlecaps: 275 bytes
534 devel-peer-request: bundlecaps: 275 bytes
533 devel-peer-request: cg: 1 bytes
535 devel-peer-request: cg: 1 bytes
534 devel-peer-request: common: 122 bytes
536 devel-peer-request: common: 122 bytes
535 devel-peer-request: heads: 122 bytes
537 devel-peer-request: heads: 122 bytes
536 devel-peer-request: listkeys: 9 bytes
538 devel-peer-request: listkeys: 9 bytes
537 devel-peer-request: phases: 1 bytes
539 devel-peer-request: phases: 1 bytes
538 sending getbundle command
540 sending getbundle command
539 bundle2-input-bundle: with-transaction
541 bundle2-input-bundle: with-transaction
540 bundle2-input-part: "bookmarks" supported
542 bundle2-input-part: "bookmarks" supported
541 bundle2-input-part: total payload size 26
543 bundle2-input-part: total payload size 26
542 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
544 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
543 bundle2-input-part: total payload size 45
545 bundle2-input-part: total payload size 45
544 bundle2-input-part: "phase-heads" supported
546 bundle2-input-part: "phase-heads" supported
545 bundle2-input-part: total payload size 72
547 bundle2-input-part: total payload size 72
546 bundle2-input-bundle: 3 parts total
548 bundle2-input-bundle: 3 parts total
547 checking for updated bookmarks
549 checking for updated bookmarks
548
550
549 $ cd $TESTTMP
551 $ cd $TESTTMP
550
552
551 $ cat dummylog
553 $ cat dummylog
552 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
554 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
553 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
555 Got arguments 1:user@dummy 2:hg -R nonexistent serve --stdio
554 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
556 Got arguments 1:user@dummy 2:hg -R $TESTTMP/nonexistent serve --stdio
555 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
557 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
556 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
558 Got arguments 1:user@dummy 2:hg -R local-stream serve --stdio (no-reposimplestore !)
557 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
559 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
558 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
560 Got arguments 1:user@dummy 2:hg -R remote serve --stdio (no-reposimplestore !)
559 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
561 Got arguments 1:user@dummy 2:hg -R doesnotexist serve --stdio
560 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
562 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
561 Got arguments 1:user@dummy 2:hg -R local serve --stdio
563 Got arguments 1:user@dummy 2:hg -R local serve --stdio
562 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
564 Got arguments 1:user@dummy 2:hg -R $TESTTMP/local serve --stdio
563 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
565 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
564 changegroup-in-remote hook: HG_BUNDLE2=1
566 changegroup-in-remote hook: HG_BUNDLE2=1
565 HG_HOOKNAME=changegroup
567 HG_HOOKNAME=changegroup
566 HG_HOOKTYPE=changegroup
568 HG_HOOKTYPE=changegroup
567 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
569 HG_NODE=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
568 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
570 HG_NODE_LAST=a28a9d1a809cab7d4e2fde4bee738a9ede948b60
569 HG_SOURCE=serve
571 HG_SOURCE=serve
570 HG_TXNID=TXN:$ID$
572 HG_TXNID=TXN:$ID$
571 HG_TXNNAME=serve
573 HG_TXNNAME=serve
572 HG_URL=remote:ssh:$LOCALIP
574 HG_URL=remote:ssh:$LOCALIP
573
575
574 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
576 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
575 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
577 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
576 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
578 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
577 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
579 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
578 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
580 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
579 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
581 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
580 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
582 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
581 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
583 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
582 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
584 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
583 changegroup-in-remote hook: HG_BUNDLE2=1
585 changegroup-in-remote hook: HG_BUNDLE2=1
584 HG_HOOKNAME=changegroup
586 HG_HOOKNAME=changegroup
585 HG_HOOKTYPE=changegroup
587 HG_HOOKTYPE=changegroup
586 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
588 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6
587 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
589 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6
588 HG_SOURCE=serve
590 HG_SOURCE=serve
589 HG_TXNID=TXN:$ID$
591 HG_TXNID=TXN:$ID$
590 HG_TXNNAME=serve
592 HG_TXNNAME=serve
591 HG_URL=remote:ssh:$LOCALIP
593 HG_URL=remote:ssh:$LOCALIP
592
594
593 Got arguments 1:user@dummy 2:chg -R remote serve --stdio (chg !)
595 Got arguments 1:user@dummy 2:chg -R remote serve --stdio (chg !)
594 changegroup-in-remote hook: HG_BUNDLE2=1 (chg !)
596 changegroup-in-remote hook: HG_BUNDLE2=1 (chg !)
595 HG_HOOKNAME=changegroup (chg !)
597 HG_HOOKNAME=changegroup (chg !)
596 HG_HOOKTYPE=changegroup (chg !)
598 HG_HOOKTYPE=changegroup (chg !)
597 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
599 HG_NODE=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
598 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
600 HG_NODE_LAST=1383141674ec756a6056f6a9097618482fe0f4a6 (chg !)
599 HG_SOURCE=serve (chg !)
601 HG_SOURCE=serve (chg !)
600 HG_TXNID=TXN:$ID$ (chg !)
602 HG_TXNID=TXN:$ID$ (chg !)
601 HG_TXNNAME=serve (chg !)
603 HG_TXNNAME=serve (chg !)
602 HG_URL=remote:ssh:$LOCALIP (chg !)
604 HG_URL=remote:ssh:$LOCALIP (chg !)
603 (chg !)
605 (chg !)
604 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
606 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
605 Got arguments 1:user@dummy 2:hg init 'a repo'
607 Got arguments 1:user@dummy 2:hg init 'a repo'
606 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
608 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
607 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
609 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
608 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
610 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
609 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
611 Got arguments 1:user@dummy 2:hg -R 'a repo' serve --stdio
610 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
612 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
611 changegroup-in-remote hook: HG_BUNDLE2=1
613 changegroup-in-remote hook: HG_BUNDLE2=1
612 HG_HOOKNAME=changegroup
614 HG_HOOKNAME=changegroup
613 HG_HOOKTYPE=changegroup
615 HG_HOOKTYPE=changegroup
614 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
616 HG_NODE=65c38f4125f9602c8db4af56530cc221d93b8ef8
615 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
617 HG_NODE_LAST=65c38f4125f9602c8db4af56530cc221d93b8ef8
616 HG_SOURCE=serve
618 HG_SOURCE=serve
617 HG_TXNID=TXN:$ID$
619 HG_TXNID=TXN:$ID$
618 HG_TXNNAME=serve
620 HG_TXNNAME=serve
619 HG_URL=remote:ssh:$LOCALIP
621 HG_URL=remote:ssh:$LOCALIP
620
622
621 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
623 Got arguments 1:user@dummy 2:hg -R remote serve --stdio
622
624
623
625
624 remote hook failure is attributed to remote
626 remote hook failure is attributed to remote
625
627
626 $ cat > $TESTTMP/failhook << EOF
628 $ cat > $TESTTMP/failhook << EOF
627 > def hook(ui, repo, **kwargs):
629 > def hook(ui, repo, **kwargs):
628 > ui.write(b'hook failure!\n')
630 > ui.write(b'hook failure!\n')
629 > ui.flush()
631 > ui.flush()
630 > return 1
632 > return 1
631 > EOF
633 > EOF
632
634
633 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
635 $ echo "pretxnchangegroup.fail = python:$TESTTMP/failhook:hook" >> remote/.hg/hgrc
634
636
635 $ hg -q clone ssh://user@dummy/remote hookout
637 $ hg -q clone ssh://user@dummy/remote hookout
636 $ cd hookout
638 $ cd hookout
637 $ touch hookfailure
639 $ touch hookfailure
638 $ hg -q commit -A -m 'remote hook failure'
640 $ hg -q commit -A -m 'remote hook failure'
639 $ hg push
641 $ hg push
640 pushing to ssh://user@dummy/remote
642 pushing to ssh://user@dummy/remote
641 searching for changes
643 searching for changes
642 remote: adding changesets
644 remote: adding changesets
643 remote: adding manifests
645 remote: adding manifests
644 remote: adding file changes
646 remote: adding file changes
645 remote: hook failure!
647 remote: hook failure!
646 remote: transaction abort!
648 remote: transaction abort!
647 remote: rollback completed
649 remote: rollback completed
648 remote: pretxnchangegroup.fail hook failed
650 remote: pretxnchangegroup.fail hook failed
649 abort: push failed on remote
651 abort: push failed on remote
650 [100]
652 [100]
651
653
652 abort during pull is properly reported as such
654 abort during pull is properly reported as such
653
655
654 $ echo morefoo >> ../remote/foo
656 $ echo morefoo >> ../remote/foo
655 $ hg -R ../remote commit --message "more foo to be pulled"
657 $ hg -R ../remote commit --message "more foo to be pulled"
656 $ cat >> ../remote/.hg/hgrc << EOF
658 $ cat >> ../remote/.hg/hgrc << EOF
657 > [extensions]
659 > [extensions]
658 > crash = ${TESTDIR}/crashgetbundler.py
660 > crash = ${TESTDIR}/crashgetbundler.py
659 > EOF
661 > EOF
660 $ hg pull
662 $ hg pull
661 pulling from ssh://user@dummy/remote
663 pulling from ssh://user@dummy/remote
662 searching for changes
664 searching for changes
663 remote: abort: this is an exercise
665 remote: abort: this is an exercise
664 abort: pull failed on remote
666 abort: pull failed on remote
665 [100]
667 [100]
666
668
667 abort with no error hint when there is a ssh problem when pulling
669 abort with no error hint when there is a ssh problem when pulling
668
670
669 $ hg pull ssh://brokenrepository
671 $ hg pull ssh://brokenrepository
670 pulling from ssh://brokenrepository/
672 pulling from ssh://brokenrepository/
671 abort: no suitable response from remote hg
673 abort: no suitable response from remote hg
672 [255]
674 [255]
673
675
674 abort with configured error hint when there is a ssh problem when pulling
676 abort with configured error hint when there is a ssh problem when pulling
675
677
676 $ hg pull ssh://brokenrepository \
678 $ hg pull ssh://brokenrepository \
677 > --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html"
679 > --config ui.ssherrorhint="Please see http://company/internalwiki/ssh.html"
678 pulling from ssh://brokenrepository/
680 pulling from ssh://brokenrepository/
679 abort: no suitable response from remote hg
681 abort: no suitable response from remote hg
680 (Please see http://company/internalwiki/ssh.html)
682 (Please see http://company/internalwiki/ssh.html)
681 [255]
683 [255]
682
684
683 test that custom environment is passed down to ssh executable
685 test that custom environment is passed down to ssh executable
684 $ cat >>dumpenv <<EOF
686 $ cat >>dumpenv <<EOF
685 > #! /bin/sh
687 > #! /bin/sh
686 > echo \$VAR >&2
688 > echo \$VAR >&2
687 > EOF
689 > EOF
688 $ chmod +x dumpenv
690 $ chmod +x dumpenv
689 $ hg pull ssh://something --config ui.ssh="sh dumpenv"
691 $ hg pull ssh://something --config ui.ssh="sh dumpenv"
690 pulling from ssh://something/
692 pulling from ssh://something/
691 remote:
693 remote:
692 abort: no suitable response from remote hg
694 abort: no suitable response from remote hg
693 [255]
695 [255]
694 $ hg pull ssh://something --config ui.ssh="sh dumpenv" --config sshenv.VAR=17
696 $ hg pull ssh://something --config ui.ssh="sh dumpenv" --config sshenv.VAR=17
695 pulling from ssh://something/
697 pulling from ssh://something/
696 remote: 17
698 remote: 17
697 abort: no suitable response from remote hg
699 abort: no suitable response from remote hg
698 [255]
700 [255]
699
701
@@ -1,300 +1,304 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ hg clone http://localhost:$HGPORT/ copy
3 $ hg clone http://localhost:$HGPORT/ copy
4 abort: * (glob)
4 abort: * (glob)
5 [100]
5 [100]
6 $ test -d copy
6 $ test -d copy
7 [1]
7 [1]
8
8
9 This server doesn't do range requests so it's basically only good for
9 This server doesn't do range requests so it's basically only good for
10 one pull
10 one pull
11
11
12 $ "$PYTHON" "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid \
12 $ "$PYTHON" "$TESTDIR/dumbhttp.py" -p $HGPORT --pid dumb.pid \
13 > --logfile server.log
13 > --logfile server.log
14 $ cat dumb.pid >> $DAEMON_PIDS
14 $ cat dumb.pid >> $DAEMON_PIDS
15 $ hg init remote
15 $ hg init remote
16 $ cd remote
16 $ cd remote
17 $ echo foo > bar
17 $ echo foo > bar
18 $ echo c2 > '.dotfile with spaces'
18 $ echo c2 > '.dotfile with spaces'
19 $ hg add
19 $ hg add
20 adding .dotfile with spaces
20 adding .dotfile with spaces
21 adding bar
21 adding bar
22 $ hg commit -m"test"
22 $ hg commit -m"test"
23 $ hg tip
23 $ hg tip
24 changeset: 0:02770d679fb8
24 changeset: 0:02770d679fb8
25 tag: tip
25 tag: tip
26 user: test
26 user: test
27 date: Thu Jan 01 00:00:00 1970 +0000
27 date: Thu Jan 01 00:00:00 1970 +0000
28 summary: test
28 summary: test
29
29
30 $ cd ..
30 $ cd ..
31 $ hg clone static-http://localhost:$HGPORT/remote local
31 $ hg clone static-http://localhost:$HGPORT/remote local
32 requesting all changes
32 requesting all changes
33 adding changesets
33 adding changesets
34 adding manifests
34 adding manifests
35 adding file changes
35 adding file changes
36 added 1 changesets with 2 changes to 2 files
36 added 1 changesets with 2 changes to 2 files
37 new changesets 02770d679fb8
37 new changesets 02770d679fb8
38 updating to branch default
38 updating to branch default
39 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
39 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
40 $ cd local
40 $ cd local
41 $ hg verify -q
41 $ hg verify -q
42 $ cat bar
42 $ cat bar
43 foo
43 foo
44 $ cd ../remote
44 $ cd ../remote
45 $ echo baz > quux
45 $ echo baz > quux
46 $ hg commit -A -mtest2
46 $ hg commit -A -mtest2
47 adding quux
47 adding quux
48
48
49 check for HTTP opener failures when cachefile does not exist
49 check for HTTP opener failures when cachefile does not exist
50
50
51 $ rm .hg/cache/*
51 $ rm .hg/cache/*
52 $ cd ../local
52 $ cd ../local
53 $ cat >> .hg/hgrc <<EOF
53 $ cat >> .hg/hgrc <<EOF
54 > [hooks]
54 > [hooks]
55 > changegroup = sh -c "printenv.py --line changegroup"
55 > changegroup = sh -c "printenv.py --line changegroup"
56 > EOF
56 > EOF
57 $ hg pull
57 $ hg pull
58 pulling from static-http://localhost:$HGPORT/remote
58 pulling from static-http://localhost:$HGPORT/remote
59 searching for changes
59 searching for changes
60 adding changesets
60 adding changesets
61 adding manifests
61 adding manifests
62 adding file changes
62 adding file changes
63 added 1 changesets with 1 changes to 1 files
63 added 1 changesets with 1 changes to 1 files
64 new changesets 4ac2e3648604
64 new changesets 4ac2e3648604
65 changegroup hook: HG_HOOKNAME=changegroup
65 changegroup hook: HG_HOOKNAME=changegroup
66 HG_HOOKTYPE=changegroup
66 HG_HOOKTYPE=changegroup
67 HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432
67 HG_NODE=4ac2e3648604439c580c69b09ec9d93a88d93432
68 HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432
68 HG_NODE_LAST=4ac2e3648604439c580c69b09ec9d93a88d93432
69 HG_SOURCE=pull
69 HG_SOURCE=pull
70 HG_TXNID=TXN:$ID$
70 HG_TXNID=TXN:$ID$
71 HG_TXNNAME=pull
71 HG_TXNNAME=pull
72 http://localhost:$HGPORT/remote
72 http://localhost:$HGPORT/remote
73 HG_URL=http://localhost:$HGPORT/remote
73 HG_URL=http://localhost:$HGPORT/remote
74
74
75 (run 'hg update' to get a working copy)
75 (run 'hg update' to get a working copy)
76
76
77 trying to push
77 trying to push
78
78
79 $ hg update
79 $ hg update
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 $ echo more foo >> bar
81 $ echo more foo >> bar
82 $ hg commit -m"test"
82 $ hg commit -m"test"
83 $ hg push
83 $ hg push
84 pushing to static-http://localhost:$HGPORT/remote
84 pushing to static-http://localhost:$HGPORT/remote
85 abort: destination does not support push
85 abort: destination does not support push
86 [255]
86 [255]
87
87
88 trying clone -r
88 trying clone -r
89
89
90 $ cd ..
90 $ cd ..
91 $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0
91 $ hg clone -r doesnotexist static-http://localhost:$HGPORT/remote local0
92 abort: unknown revision 'doesnotexist'
92 abort: unknown revision 'doesnotexist'
93 [10]
93 [10]
94 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
94 $ hg clone -r 0 static-http://localhost:$HGPORT/remote local0
95 adding changesets
95 adding changesets
96 adding manifests
96 adding manifests
97 adding file changes
97 adding file changes
98 added 1 changesets with 2 changes to 2 files
98 added 1 changesets with 2 changes to 2 files
99 new changesets 02770d679fb8
99 new changesets 02770d679fb8
100 updating to branch default
100 updating to branch default
101 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
102
102
103 test with "/" URI (issue747) and subrepo
103 test with "/" URI (issue747) and subrepo
104
104
105 $ hg init
105 $ hg init
106 $ hg init sub
106 $ hg init sub
107 $ touch sub/test
107 $ touch sub/test
108 $ hg -R sub commit -A -m "test"
108 $ hg -R sub commit -A -m "test"
109 adding test
109 adding test
110 $ hg -R sub tag not-empty
110 $ hg -R sub tag not-empty
111 $ echo sub=sub > .hgsub
111 $ echo sub=sub > .hgsub
112 $ echo a > a
112 $ echo a > a
113 $ hg add a .hgsub
113 $ hg add a .hgsub
114 $ hg -q ci -ma
114 $ hg -q ci -ma
115 $ hg clone static-http://localhost:$HGPORT/ local2
115 $ hg clone static-http://localhost:$HGPORT/ local2
116 requesting all changes
116 requesting all changes
117 adding changesets
117 adding changesets
118 adding manifests
118 adding manifests
119 adding file changes
119 adding file changes
120 added 1 changesets with 3 changes to 3 files
120 added 1 changesets with 3 changes to 3 files
121 new changesets a9ebfbe8e587
121 new changesets a9ebfbe8e587
122 updating to branch default
122 updating to branch default
123 cloning subrepo sub from static-http://localhost:$HGPORT/sub
123 cloning subrepo sub from static-http://localhost:$HGPORT/sub
124 requesting all changes
124 requesting all changes
125 adding changesets
125 adding changesets
126 adding manifests
126 adding manifests
127 adding file changes
127 adding file changes
128 added 2 changesets with 2 changes to 2 files
128 added 2 changesets with 2 changes to 2 files
129 new changesets be090ea66256:322ea90975df
129 new changesets be090ea66256:322ea90975df
130 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
130 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
131 $ cd local2
131 $ cd local2
132 $ hg verify -q
132 $ hg verify -q
133 $ cat a
133 $ cat a
134 a
134 a
135 $ hg paths
135 $ hg paths
136 default = static-http://localhost:$HGPORT/
136 default = static-http://localhost:$HGPORT/
137
137
138 test with empty repo (issue965)
138 test with empty repo (issue965)
139
139
140 $ cd ..
140 $ cd ..
141 $ hg init remotempty
141 $ hg init remotempty
142 $ hg clone static-http://localhost:$HGPORT/remotempty local3
142 $ hg clone static-http://localhost:$HGPORT/remotempty local3
143 no changes found
143 no changes found
144 updating to branch default
144 updating to branch default
145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 $ cd local3
146 $ cd local3
147 $ hg verify -q
147 $ hg verify -q
148 $ hg paths
148 $ hg paths
149 default = static-http://localhost:$HGPORT/remotempty
149 default = static-http://localhost:$HGPORT/remotempty
150
150
151 test autodetecting static-http: scheme (issue6833)
151 test autodetecting static-http: scheme (issue6833)
152
152
153 $ cd ..
153 $ cd ..
154 $ hg init actually-static
154 $ hg init actually-static
155 $ hg clone http://localhost:$HGPORT/actually-static local4
155 $ hg clone http://localhost:$HGPORT/actually-static local4
156 no changes found
156 no changes found
157 updating to branch default
157 updating to branch default
158 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
159
159
160 test with non-repo
160 test with non-repo
161
161
162 $ mkdir notarepo
162 $ mkdir notarepo
163 $ hg clone static-http://localhost:$HGPORT/notarepo local3
163 $ hg clone static-http://localhost:$HGPORT/notarepo local3
164 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository
164 abort: 'http://localhost:$HGPORT/notarepo' does not appear to be an hg repository
165 [255]
165 [255]
166
166
167 Clone with tags and branches works
167 Clone with tags and branches works
168
168
169 $ hg init remote-with-names
169 $ hg init remote-with-names
170 $ cd remote-with-names
170 $ cd remote-with-names
171 $ echo 0 > foo
171 $ echo 0 > foo
172 $ hg -q commit -A -m initial
172 $ hg -q commit -A -m initial
173 $ echo 1 > foo
173 $ echo 1 > foo
174 $ hg commit -m 'commit 1'
174 $ hg commit -m 'commit 1'
175 $ hg -q up 0
175 $ hg -q up 0
176 $ hg branch mybranch
176 $ hg branch mybranch
177 marked working directory as branch mybranch
177 marked working directory as branch mybranch
178 (branches are permanent and global, did you want a bookmark?)
178 (branches are permanent and global, did you want a bookmark?)
179 $ echo 2 > foo
179 $ echo 2 > foo
180 $ hg commit -m 'commit 2 (mybranch)'
180 $ hg commit -m 'commit 2 (mybranch)'
181 $ hg tag -r 1 'default-tag'
181 $ hg tag -r 1 'default-tag'
182 $ hg tag -r 2 'branch-tag'
182 $ hg tag -r 2 'branch-tag'
183
183
184 $ cd ..
184 $ cd ..
185
185
186 $ hg clone static-http://localhost:$HGPORT/remote-with-names local-with-names
186 $ hg clone static-http://localhost:$HGPORT/remote-with-names local-with-names
187 requesting all changes
187 requesting all changes
188 adding changesets
188 adding changesets
189 adding manifests
189 adding manifests
190 adding file changes
190 adding file changes
191 added 5 changesets with 5 changes to 2 files (+1 heads)
191 added 5 changesets with 5 changes to 2 files (+1 heads)
192 new changesets 68986213bd44:0c325bd2b5a7
192 new changesets 68986213bd44:0c325bd2b5a7
193 updating to branch default
193 updating to branch default
194 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
194 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
195
195
196 Clone a specific branch works
196 Clone a specific branch works
197
197
198 $ hg clone -r mybranch static-http://localhost:$HGPORT/remote-with-names local-with-names-branch
198 $ hg clone -r mybranch static-http://localhost:$HGPORT/remote-with-names local-with-names-branch
199 adding changesets
199 adding changesets
200 adding manifests
200 adding manifests
201 adding file changes
201 adding file changes
202 added 4 changesets with 4 changes to 2 files
202 added 4 changesets with 4 changes to 2 files
203 new changesets 68986213bd44:0c325bd2b5a7
203 new changesets 68986213bd44:0c325bd2b5a7
204 updating to branch mybranch
204 updating to branch mybranch
205 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
206
206
207 Clone a specific tag works
207 Clone a specific tag works
208
208
209 $ hg clone -r default-tag static-http://localhost:$HGPORT/remote-with-names local-with-names-tag
209 $ hg clone -r default-tag static-http://localhost:$HGPORT/remote-with-names local-with-names-tag
210 adding changesets
210 adding changesets
211 adding manifests
211 adding manifests
212 adding file changes
212 adding file changes
213 added 2 changesets with 2 changes to 1 files
213 added 2 changesets with 2 changes to 1 files
214 new changesets 68986213bd44:4ee3fcef1c80
214 new changesets 68986213bd44:4ee3fcef1c80
215 updating to branch default
215 updating to branch default
216 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
216 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
217
217
218 $ killdaemons.py
218 $ killdaemons.py
219
219
220 List of files accessed over HTTP:
220 List of files accessed over HTTP:
221
221
222 $ cat server.log | sed -n -e 's|.*GET \(/[^ ]*\).*|\1|p' | sort -u
222 $ cat server.log | sed -n -e 's|.*GET \(/[^ ]*\).*|\1|p' | sort -u
223 /.hg/bookmarks
223 /.hg/bookmarks
224 /.hg/bookmarks.current
224 /.hg/bookmarks.current
225 /.hg/cache/hgtagsfnodes1
225 /.hg/cache/hgtagsfnodes1
226 /.hg/dirstate
226 /.hg/dirstate
227 /.hg/requires
227 /.hg/requires
228 /.hg/store/00changelog.d
228 /.hg/store/00changelog.i
229 /.hg/store/00changelog.i
229 /.hg/store/00manifest.i
230 /.hg/store/00manifest.i
230 /.hg/store/data/%7E2ehgsub.i (no-py37 !)
231 /.hg/store/data/%7E2ehgsub.i (no-py37 !)
231 /.hg/store/data/%7E2ehgsubstate.i (no-py37 !)
232 /.hg/store/data/%7E2ehgsubstate.i (no-py37 !)
232 /.hg/store/data/a.i
233 /.hg/store/data/a.i
233 /.hg/store/data/~2ehgsub.i (py37 !)
234 /.hg/store/data/~2ehgsub.i (py37 !)
234 /.hg/store/data/~2ehgsubstate.i (py37 !)
235 /.hg/store/data/~2ehgsubstate.i (py37 !)
235 /.hg/store/requires
236 /.hg/store/requires
236 /actually-static/.hg/bookmarks
237 /actually-static/.hg/bookmarks
237 /actually-static/.hg/bookmarks.current
238 /actually-static/.hg/bookmarks.current
238 /actually-static/.hg/dirstate
239 /actually-static/.hg/dirstate
239 /actually-static/.hg/requires
240 /actually-static/.hg/requires
240 /actually-static/.hg/store/00changelog.i
241 /actually-static/.hg/store/00changelog.i
241 /actually-static/.hg/store/00manifest.i
242 /actually-static/.hg/store/00manifest.i
242 /actually-static/.hg/store/requires
243 /actually-static/.hg/store/requires
243 /actually-static/?cmd=capabilities
244 /actually-static/?cmd=capabilities
244 /actually-static?cmd=capabilities
245 /actually-static?cmd=capabilities
245 /notarepo/.hg/00changelog.i
246 /notarepo/.hg/00changelog.i
246 /notarepo/.hg/requires
247 /notarepo/.hg/requires
247 /remote-with-names/.hg/bookmarks
248 /remote-with-names/.hg/bookmarks
248 /remote-with-names/.hg/bookmarks.current
249 /remote-with-names/.hg/bookmarks.current
249 /remote-with-names/.hg/cache/branch2-served
250 /remote-with-names/.hg/cache/branch2-served
250 /remote-with-names/.hg/cache/hgtagsfnodes1
251 /remote-with-names/.hg/cache/hgtagsfnodes1
251 /remote-with-names/.hg/cache/tags2-served
252 /remote-with-names/.hg/cache/tags2-served
252 /remote-with-names/.hg/dirstate
253 /remote-with-names/.hg/dirstate
253 /remote-with-names/.hg/localtags
254 /remote-with-names/.hg/localtags
254 /remote-with-names/.hg/requires
255 /remote-with-names/.hg/requires
256 /remote-with-names/.hg/store/00changelog.d
255 /remote-with-names/.hg/store/00changelog.i
257 /remote-with-names/.hg/store/00changelog.i
256 /remote-with-names/.hg/store/00manifest.i
258 /remote-with-names/.hg/store/00manifest.i
257 /remote-with-names/.hg/store/data/%7E2ehgtags.i (no-py37 !)
259 /remote-with-names/.hg/store/data/%7E2ehgtags.i (no-py37 !)
258 /remote-with-names/.hg/store/data/foo.i
260 /remote-with-names/.hg/store/data/foo.i
259 /remote-with-names/.hg/store/data/~2ehgtags.i (py37 !)
261 /remote-with-names/.hg/store/data/~2ehgtags.i (py37 !)
260 /remote-with-names/.hg/store/obsstore
262 /remote-with-names/.hg/store/obsstore
261 /remote-with-names/.hg/store/requires
263 /remote-with-names/.hg/store/requires
262 /remote/.hg/bookmarks
264 /remote/.hg/bookmarks
263 /remote/.hg/bookmarks.current
265 /remote/.hg/bookmarks.current
264 /remote/.hg/cache/branch2-base
266 /remote/.hg/cache/branch2-base
265 /remote/.hg/cache/branch2-immutable
267 /remote/.hg/cache/branch2-immutable
266 /remote/.hg/cache/branch2-served
268 /remote/.hg/cache/branch2-served
267 /remote/.hg/cache/hgtagsfnodes1
269 /remote/.hg/cache/hgtagsfnodes1
268 /remote/.hg/cache/rbc-names-v1
270 /remote/.hg/cache/rbc-names-v1
269 /remote/.hg/cache/tags2-served
271 /remote/.hg/cache/tags2-served
270 /remote/.hg/dirstate
272 /remote/.hg/dirstate
271 /remote/.hg/localtags
273 /remote/.hg/localtags
272 /remote/.hg/requires
274 /remote/.hg/requires
275 /remote/.hg/store/00changelog.d
273 /remote/.hg/store/00changelog.i
276 /remote/.hg/store/00changelog.i
274 /remote/.hg/store/00manifest.i
277 /remote/.hg/store/00manifest.i
275 /remote/.hg/store/data/%7E2edotfile%20with%20spaces.i (no-py37 !)
278 /remote/.hg/store/data/%7E2edotfile%20with%20spaces.i (no-py37 !)
276 /remote/.hg/store/data/%7E2ehgtags.i (no-py37 !)
279 /remote/.hg/store/data/%7E2ehgtags.i (no-py37 !)
277 /remote/.hg/store/data/bar.i
280 /remote/.hg/store/data/bar.i
278 /remote/.hg/store/data/quux.i
281 /remote/.hg/store/data/quux.i
279 /remote/.hg/store/data/~2edotfile%20with%20spaces.i (py37 !)
282 /remote/.hg/store/data/~2edotfile%20with%20spaces.i (py37 !)
280 /remote/.hg/store/data/~2ehgtags.i (py37 !)
283 /remote/.hg/store/data/~2ehgtags.i (py37 !)
281 /remote/.hg/store/obsstore
284 /remote/.hg/store/obsstore
282 /remote/.hg/store/requires
285 /remote/.hg/store/requires
283 /remotempty/.hg/bookmarks
286 /remotempty/.hg/bookmarks
284 /remotempty/.hg/bookmarks.current
287 /remotempty/.hg/bookmarks.current
285 /remotempty/.hg/dirstate
288 /remotempty/.hg/dirstate
286 /remotempty/.hg/requires
289 /remotempty/.hg/requires
287 /remotempty/.hg/store/00changelog.i
290 /remotempty/.hg/store/00changelog.i
288 /remotempty/.hg/store/00manifest.i
291 /remotempty/.hg/store/00manifest.i
289 /remotempty/.hg/store/requires
292 /remotempty/.hg/store/requires
290 /sub/.hg/bookmarks
293 /sub/.hg/bookmarks
291 /sub/.hg/bookmarks.current
294 /sub/.hg/bookmarks.current
292 /sub/.hg/cache/hgtagsfnodes1
295 /sub/.hg/cache/hgtagsfnodes1
293 /sub/.hg/dirstate
296 /sub/.hg/dirstate
294 /sub/.hg/requires
297 /sub/.hg/requires
298 /sub/.hg/store/00changelog.d
295 /sub/.hg/store/00changelog.i
299 /sub/.hg/store/00changelog.i
296 /sub/.hg/store/00manifest.i
300 /sub/.hg/store/00manifest.i
297 /sub/.hg/store/data/%7E2ehgtags.i (no-py37 !)
301 /sub/.hg/store/data/%7E2ehgtags.i (no-py37 !)
298 /sub/.hg/store/data/test.i
302 /sub/.hg/store/data/test.i
299 /sub/.hg/store/data/~2ehgtags.i (py37 !)
303 /sub/.hg/store/data/~2ehgtags.i (py37 !)
300 /sub/.hg/store/requires
304 /sub/.hg/store/requires
@@ -1,323 +1,345 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 #testcases stream-v2 stream-v3
3 #testcases stream-v2 stream-v3
4
4
5 #if stream-v2
5 #if stream-v2
6 $ bundle_format="streamv2"
6 $ bundle_format="streamv2"
7 $ stream_version="v2"
7 $ stream_version="v2"
8 #endif
8 #endif
9 #if stream-v3
9 #if stream-v3
10 $ bundle_format="streamv3-exp"
10 $ bundle_format="streamv3-exp"
11 $ stream_version="v3-exp"
11 $ stream_version="v3-exp"
12 $ cat << EOF >> $HGRCPATH
12 $ cat << EOF >> $HGRCPATH
13 > [experimental]
13 > [experimental]
14 > stream-v3=yes
14 > stream-v3=yes
15 > EOF
15 > EOF
16 #endif
16 #endif
17
17
18 Test creating a consuming stream bundle v2 and v3
18 Test creating a consuming stream bundle v2 and v3
19
19
20 $ getmainid() {
20 $ getmainid() {
21 > hg -R main log --template '{node}\n' --rev "$1"
21 > hg -R main log --template '{node}\n' --rev "$1"
22 > }
22 > }
23
23
24 $ cp $HGRCPATH $TESTTMP/hgrc.orig
24 $ cp $HGRCPATH $TESTTMP/hgrc.orig
25
25
26 $ cat >> $HGRCPATH << EOF
26 $ cat >> $HGRCPATH << EOF
27 > [experimental]
27 > [experimental]
28 > evolution.createmarkers=True
28 > evolution.createmarkers=True
29 > evolution.exchange=True
29 > evolution.exchange=True
30 > bundle2-output-capture=True
30 > bundle2-output-capture=True
31 > [ui]
31 > [ui]
32 > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
32 > logtemplate={rev}:{node|short} {phase} {author} {bookmarks} {desc|firstline}
33 > [web]
33 > [web]
34 > push_ssl = false
34 > push_ssl = false
35 > allow_push = *
35 > allow_push = *
36 > [phases]
36 > [phases]
37 > publish=False
37 > publish=False
38 > [extensions]
38 > [extensions]
39 > drawdag=$TESTDIR/drawdag.py
39 > drawdag=$TESTDIR/drawdag.py
40 > clonebundles=
40 > clonebundles=
41 > EOF
41 > EOF
42
42
43 The extension requires a repo (currently unused)
43 The extension requires a repo (currently unused)
44
44
45 $ hg init main
45 $ hg init main
46 $ cd main
46 $ cd main
47
47
48 $ hg debugdrawdag <<'EOF'
48 $ hg debugdrawdag <<'EOF'
49 > E
49 > E
50 > |
50 > |
51 > D
51 > D
52 > |
52 > |
53 > C
53 > C
54 > |
54 > |
55 > B
55 > B
56 > |
56 > |
57 > A
57 > A
58 > EOF
58 > EOF
59
59
60 $ hg bundle -a --type="none-v2;stream=$stream_version" bundle.hg
60 $ hg bundle -a --type="none-v2;stream=$stream_version" bundle.hg
61 $ hg debugbundle bundle.hg
61 $ hg debugbundle bundle.hg
62 Stream params: {}
62 Stream params: {}
63 stream2 -- {bytecount: 1693, filecount: 11, requirements: generaldelta%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v2 no-zstd !)
63 stream2 -- {bytecount: 1693, filecount: 12, requirements: generaldelta%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v2 no-zstd !)
64 stream2 -- {bytecount: 1693, filecount: 11, requirements: generaldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v2 zstd no-rust !)
64 stream2 -- {bytecount: 1693, filecount: 12, requirements: generaldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v2 zstd no-rust !)
65 stream2 -- {bytecount: 1693, filecount: 11, requirements: generaldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v2 rust !)
65 stream2 -- {bytecount: 1819, filecount: 14, requirements: generaldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v2 rust !)
66 stream3-exp -- {requirements: generaldelta%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v3 no-zstd !)
66 stream3-exp -- {requirements: generaldelta%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v3 no-zstd !)
67 stream3-exp -- {requirements: generaldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v3 zstd no-rust !)
67 stream3-exp -- {requirements: generaldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v3 zstd no-rust !)
68 stream3-exp -- {requirements: generaldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v3 rust !)
68 stream3-exp -- {requirements: generaldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog} (mandatory: True) (stream-v3 rust !)
69 $ hg debugbundle --spec bundle.hg
69 $ hg debugbundle --spec bundle.hg
70 none-v2;stream=v2;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog (stream-v2 no-zstd !)
70 none-v2;stream=v2;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog (stream-v2 no-zstd !)
71 none-v2;stream=v2;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog (stream-v2 zstd no-rust !)
71 none-v2;stream=v2;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog (stream-v2 zstd no-rust !)
72 none-v2;stream=v2;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog (stream-v2 rust !)
72 none-v2;stream=v2;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog (stream-v2 rust !)
73 none-v2;stream=v3-exp;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog (stream-v3 no-zstd !)
73 none-v2;stream=v3-exp;requirements%3Dgeneraldelta%2Crevlogv1%2Csparserevlog (stream-v3 no-zstd !)
74 none-v2;stream=v3-exp;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog (stream-v3 zstd no-rust !)
74 none-v2;stream=v3-exp;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog (stream-v3 zstd no-rust !)
75 none-v2;stream=v3-exp;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog (stream-v3 rust !)
75 none-v2;stream=v3-exp;requirements%3Dgeneraldelta%2Crevlog-compression-zstd%2Crevlogv1%2Csparserevlog (stream-v3 rust !)
76
76
77 Test that we can apply the bundle as a stream clone bundle
77 Test that we can apply the bundle as a stream clone bundle
78
78
79 $ cat > .hg/clonebundles.manifest << EOF
79 $ cat > .hg/clonebundles.manifest << EOF
80 > http://localhost:$HGPORT1/bundle.hg BUNDLESPEC=`hg debugbundle --spec bundle.hg`
80 > http://localhost:$HGPORT1/bundle.hg BUNDLESPEC=`hg debugbundle --spec bundle.hg`
81 > EOF
81 > EOF
82
82
83 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
83 $ hg serve -d -p $HGPORT --pid-file hg.pid --accesslog access.log
84 $ cat hg.pid >> $DAEMON_PIDS
84 $ cat hg.pid >> $DAEMON_PIDS
85
85
86 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
86 $ "$PYTHON" $TESTDIR/dumbhttp.py -p $HGPORT1 --pid http.pid
87 $ cat http.pid >> $DAEMON_PIDS
87 $ cat http.pid >> $DAEMON_PIDS
88
88
89 $ cd ..
89 $ cd ..
90
90
91 #if stream-v2
91 #if stream-v2
92 $ hg clone http://localhost:$HGPORT stream-clone-implicit --debug
92 $ hg clone http://localhost:$HGPORT stream-clone-implicit --debug
93 using http://localhost:$HGPORT/
93 using http://localhost:$HGPORT/
94 sending capabilities command
94 sending capabilities command
95 sending clonebundles_manifest command
95 sending clonebundles_manifest command
96 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
96 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
97 bundle2-input-bundle: with-transaction
97 bundle2-input-bundle: with-transaction
98 bundle2-input-part: "stream2" (params: 3 mandatory) supported
98 bundle2-input-part: "stream2" (params: 3 mandatory) supported
99 applying stream bundle
99 applying stream bundle
100 11 files to transfer, 1.65 KB of data
100 12 files to transfer, 1.65 KB of data (no-rust !)
101 14 files to transfer, 1.78 KB of data (rust !)
101 starting 4 threads for background file closing (?)
102 starting 4 threads for background file closing (?)
102 starting 4 threads for background file closing (?)
103 starting 4 threads for background file closing (?)
103 adding [s] data/A.i (66 bytes)
104 adding [s] data/A.i (66 bytes)
104 adding [s] data/B.i (66 bytes)
105 adding [s] data/B.i (66 bytes)
105 adding [s] data/C.i (66 bytes)
106 adding [s] data/C.i (66 bytes)
106 adding [s] data/D.i (66 bytes)
107 adding [s] data/D.i (66 bytes)
107 adding [s] data/E.i (66 bytes)
108 adding [s] data/E.i (66 bytes)
108 adding [s] phaseroots (43 bytes)
109 adding [s] phaseroots (43 bytes)
109 adding [s] 00manifest.i (584 bytes)
110 adding [s] 00manifest.i (584 bytes)
110 adding [s] 00changelog.i (595 bytes)
111 adding [s] 00changelog.n (62 bytes) (rust !)
112 adding [s] 00changelog-b875dfc5.nd (64 bytes) (rust !)
113 adding [s] 00changelog.d (275 bytes)
114 adding [s] 00changelog.i (320 bytes)
111 adding [c] branch2-served (94 bytes)
115 adding [c] branch2-served (94 bytes)
112 adding [c] rbc-names-v1 (7 bytes)
116 adding [c] rbc-names-v1 (7 bytes)
113 adding [c] rbc-revs-v1 (40 bytes)
117 adding [c] rbc-revs-v1 (40 bytes)
114 transferred 1.65 KB in * seconds (* */sec) (glob)
118 transferred 1.65 KB in * seconds (* */sec) (glob) (no-rust !)
115 bundle2-input-part: total payload size 1840
119 bundle2-input-part: total payload size 1857 (no-rust !)
120 transferred 1.78 KB in * seconds (* */sec) (glob) (rust !)
121 bundle2-input-part: total payload size 2025 (rust !)
116 bundle2-input-bundle: 1 parts total
122 bundle2-input-bundle: 1 parts total
117 updating the branch cache
123 updating the branch cache
118 finished applying clone bundle
124 finished applying clone bundle
119 query 1; heads
125 query 1; heads
120 sending batch command
126 sending batch command
121 searching for changes
127 searching for changes
122 all remote heads known locally
128 all remote heads known locally
123 no changes found
129 no changes found
124 sending getbundle command
130 sending getbundle command
125 bundle2-input-bundle: with-transaction
131 bundle2-input-bundle: with-transaction
126 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
132 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
127 bundle2-input-part: "phase-heads" supported
133 bundle2-input-part: "phase-heads" supported
128 bundle2-input-part: total payload size 24
134 bundle2-input-part: total payload size 24
129 bundle2-input-bundle: 2 parts total
135 bundle2-input-bundle: 2 parts total
130 checking for updated bookmarks
136 checking for updated bookmarks
131 updating to branch default
137 updating to branch default
132 resolving manifests
138 resolving manifests
133 branchmerge: False, force: False, partial: False
139 branchmerge: False, force: False, partial: False
134 ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041
140 ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041
135 A: remote created -> g
141 A: remote created -> g
136 getting A
142 getting A
137 B: remote created -> g
143 B: remote created -> g
138 getting B
144 getting B
139 C: remote created -> g
145 C: remote created -> g
140 getting C
146 getting C
141 D: remote created -> g
147 D: remote created -> g
142 getting D
148 getting D
143 E: remote created -> g
149 E: remote created -> g
144 getting E
150 getting E
145 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
151 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 updating the branch cache
152 updating the branch cache
147 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
153 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
148
154
149 $ hg clone --stream http://localhost:$HGPORT stream-clone-explicit --debug
155 $ hg clone --stream http://localhost:$HGPORT stream-clone-explicit --debug
150 using http://localhost:$HGPORT/
156 using http://localhost:$HGPORT/
151 sending capabilities command
157 sending capabilities command
152 sending clonebundles_manifest command
158 sending clonebundles_manifest command
153 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
159 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
154 bundle2-input-bundle: with-transaction
160 bundle2-input-bundle: with-transaction
155 bundle2-input-part: "stream2" (params: 3 mandatory) supported
161 bundle2-input-part: "stream2" (params: 3 mandatory) supported
156 applying stream bundle
162 applying stream bundle
157 11 files to transfer, 1.65 KB of data
163 12 files to transfer, 1.65 KB of data (no-rust !)
164 14 files to transfer, 1.78 KB of data (rust !)
158 starting 4 threads for background file closing (?)
165 starting 4 threads for background file closing (?)
159 starting 4 threads for background file closing (?)
166 starting 4 threads for background file closing (?)
160 adding [s] data/A.i (66 bytes)
167 adding [s] data/A.i (66 bytes)
161 adding [s] data/B.i (66 bytes)
168 adding [s] data/B.i (66 bytes)
162 adding [s] data/C.i (66 bytes)
169 adding [s] data/C.i (66 bytes)
163 adding [s] data/D.i (66 bytes)
170 adding [s] data/D.i (66 bytes)
164 adding [s] data/E.i (66 bytes)
171 adding [s] data/E.i (66 bytes)
165 adding [s] phaseroots (43 bytes)
172 adding [s] phaseroots (43 bytes)
166 adding [s] 00manifest.i (584 bytes)
173 adding [s] 00manifest.i (584 bytes)
167 adding [s] 00changelog.i (595 bytes)
174 adding [s] 00changelog.n (62 bytes) (rust !)
175 adding [s] 00changelog-b875dfc5.nd (64 bytes) (rust !)
176 adding [s] 00changelog.d (275 bytes)
177 adding [s] 00changelog.i (320 bytes)
168 adding [c] branch2-served (94 bytes)
178 adding [c] branch2-served (94 bytes)
169 adding [c] rbc-names-v1 (7 bytes)
179 adding [c] rbc-names-v1 (7 bytes)
170 adding [c] rbc-revs-v1 (40 bytes)
180 adding [c] rbc-revs-v1 (40 bytes)
171 transferred 1.65 KB in * seconds (* */sec) (glob)
181 transferred 1.65 KB in * seconds (* */sec) (glob) (no-rust !)
172 bundle2-input-part: total payload size 1840
182 bundle2-input-part: total payload size 1857 (no-rust !)
183 transferred 1.78 KB in * seconds (* */sec) (glob) (rust !)
184 bundle2-input-part: total payload size 2025 (rust !)
173 bundle2-input-bundle: 1 parts total
185 bundle2-input-bundle: 1 parts total
174 updating the branch cache
186 updating the branch cache
175 finished applying clone bundle
187 finished applying clone bundle
176 query 1; heads
188 query 1; heads
177 sending batch command
189 sending batch command
178 searching for changes
190 searching for changes
179 all remote heads known locally
191 all remote heads known locally
180 no changes found
192 no changes found
181 sending getbundle command
193 sending getbundle command
182 bundle2-input-bundle: with-transaction
194 bundle2-input-bundle: with-transaction
183 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
195 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
184 bundle2-input-part: "phase-heads" supported
196 bundle2-input-part: "phase-heads" supported
185 bundle2-input-part: total payload size 24
197 bundle2-input-part: total payload size 24
186 bundle2-input-bundle: 2 parts total
198 bundle2-input-bundle: 2 parts total
187 checking for updated bookmarks
199 checking for updated bookmarks
188 updating to branch default
200 updating to branch default
189 resolving manifests
201 resolving manifests
190 branchmerge: False, force: False, partial: False
202 branchmerge: False, force: False, partial: False
191 ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041
203 ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041
192 A: remote created -> g
204 A: remote created -> g
193 getting A
205 getting A
194 B: remote created -> g
206 B: remote created -> g
195 getting B
207 getting B
196 C: remote created -> g
208 C: remote created -> g
197 getting C
209 getting C
198 D: remote created -> g
210 D: remote created -> g
199 getting D
211 getting D
200 E: remote created -> g
212 E: remote created -> g
201 getting E
213 getting E
202 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
214 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 updating the branch cache
215 updating the branch cache
204 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
216 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
205
217
206 #endif
218 #endif
207
219
208 #if stream-v3
220 #if stream-v3
209 $ hg clone http://localhost:$HGPORT stream-clone-implicit --debug
221 $ hg clone http://localhost:$HGPORT stream-clone-implicit --debug
210 using http://localhost:$HGPORT/
222 using http://localhost:$HGPORT/
211 sending capabilities command
223 sending capabilities command
212 sending clonebundles_manifest command
224 sending clonebundles_manifest command
213 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
225 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
214 bundle2-input-bundle: with-transaction
226 bundle2-input-bundle: with-transaction
215 bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported
227 bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported
216 applying stream bundle
228 applying stream bundle
217 11 entries to transfer
229 11 entries to transfer
218 starting 4 threads for background file closing (?)
230 starting 4 threads for background file closing (?)
219 starting 4 threads for background file closing (?)
231 starting 4 threads for background file closing (?)
220 adding [s] data/A.i (66 bytes)
232 adding [s] data/A.i (66 bytes)
221 adding [s] data/B.i (66 bytes)
233 adding [s] data/B.i (66 bytes)
222 adding [s] data/C.i (66 bytes)
234 adding [s] data/C.i (66 bytes)
223 adding [s] data/D.i (66 bytes)
235 adding [s] data/D.i (66 bytes)
224 adding [s] data/E.i (66 bytes)
236 adding [s] data/E.i (66 bytes)
225 adding [s] phaseroots (43 bytes)
237 adding [s] phaseroots (43 bytes)
226 adding [s] 00manifest.i (584 bytes)
238 adding [s] 00manifest.i (584 bytes)
227 adding [s] 00changelog.i (595 bytes)
239 adding [s] 00changelog.n (62 bytes) (rust !)
240 adding [s] 00changelog-b875dfc5.nd (64 bytes) (rust !)
241 adding [s] 00changelog.d (275 bytes)
242 adding [s] 00changelog.i (320 bytes)
228 adding [c] branch2-served (94 bytes)
243 adding [c] branch2-served (94 bytes)
229 adding [c] rbc-names-v1 (7 bytes)
244 adding [c] rbc-names-v1 (7 bytes)
230 adding [c] rbc-revs-v1 (40 bytes)
245 adding [c] rbc-revs-v1 (40 bytes)
231 transferred 1.65 KB in * seconds (* */sec) (glob)
246 transferred 1.65 KB in * seconds (* */sec) (glob) (no-rust !)
232 bundle2-input-part: total payload size 1852
247 bundle2-input-part: total payload size 1869 (no-rust !)
248 transferred 1.78 KB in * seconds (* */sec) (glob) (rust !)
249 bundle2-input-part: total payload size 2037 (rust !)
233 bundle2-input-bundle: 1 parts total
250 bundle2-input-bundle: 1 parts total
234 updating the branch cache
251 updating the branch cache
235 finished applying clone bundle
252 finished applying clone bundle
236 query 1; heads
253 query 1; heads
237 sending batch command
254 sending batch command
238 searching for changes
255 searching for changes
239 all remote heads known locally
256 all remote heads known locally
240 no changes found
257 no changes found
241 sending getbundle command
258 sending getbundle command
242 bundle2-input-bundle: with-transaction
259 bundle2-input-bundle: with-transaction
243 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
260 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
244 bundle2-input-part: "phase-heads" supported
261 bundle2-input-part: "phase-heads" supported
245 bundle2-input-part: total payload size 24
262 bundle2-input-part: total payload size 24
246 bundle2-input-bundle: 2 parts total
263 bundle2-input-bundle: 2 parts total
247 checking for updated bookmarks
264 checking for updated bookmarks
248 updating to branch default
265 updating to branch default
249 resolving manifests
266 resolving manifests
250 branchmerge: False, force: False, partial: False
267 branchmerge: False, force: False, partial: False
251 ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041
268 ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041
252 A: remote created -> g
269 A: remote created -> g
253 getting A
270 getting A
254 B: remote created -> g
271 B: remote created -> g
255 getting B
272 getting B
256 C: remote created -> g
273 C: remote created -> g
257 getting C
274 getting C
258 D: remote created -> g
275 D: remote created -> g
259 getting D
276 getting D
260 E: remote created -> g
277 E: remote created -> g
261 getting E
278 getting E
262 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
279 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
263 updating the branch cache
280 updating the branch cache
264 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
281 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
265
282
266 $ hg clone --stream http://localhost:$HGPORT stream-clone-explicit --debug
283 $ hg clone --stream http://localhost:$HGPORT stream-clone-explicit --debug
267 using http://localhost:$HGPORT/
284 using http://localhost:$HGPORT/
268 sending capabilities command
285 sending capabilities command
269 sending clonebundles_manifest command
286 sending clonebundles_manifest command
270 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
287 applying clone bundle from http://localhost:$HGPORT1/bundle.hg
271 bundle2-input-bundle: with-transaction
288 bundle2-input-bundle: with-transaction
272 bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported
289 bundle2-input-part: "stream3-exp" (params: 1 mandatory) supported
273 applying stream bundle
290 applying stream bundle
274 11 entries to transfer
291 11 entries to transfer
275 starting 4 threads for background file closing (?)
292 starting 4 threads for background file closing (?)
276 starting 4 threads for background file closing (?)
293 starting 4 threads for background file closing (?)
277 adding [s] data/A.i (66 bytes)
294 adding [s] data/A.i (66 bytes)
278 adding [s] data/B.i (66 bytes)
295 adding [s] data/B.i (66 bytes)
279 adding [s] data/C.i (66 bytes)
296 adding [s] data/C.i (66 bytes)
280 adding [s] data/D.i (66 bytes)
297 adding [s] data/D.i (66 bytes)
281 adding [s] data/E.i (66 bytes)
298 adding [s] data/E.i (66 bytes)
282 adding [s] phaseroots (43 bytes)
299 adding [s] phaseroots (43 bytes)
283 adding [s] 00manifest.i (584 bytes)
300 adding [s] 00manifest.i (584 bytes)
284 adding [s] 00changelog.i (595 bytes)
301 adding [s] 00changelog.n (62 bytes) (rust !)
302 adding [s] 00changelog-b875dfc5.nd (64 bytes) (rust !)
303 adding [s] 00changelog.d (275 bytes)
304 adding [s] 00changelog.i (320 bytes)
285 adding [c] branch2-served (94 bytes)
305 adding [c] branch2-served (94 bytes)
286 adding [c] rbc-names-v1 (7 bytes)
306 adding [c] rbc-names-v1 (7 bytes)
287 adding [c] rbc-revs-v1 (40 bytes)
307 adding [c] rbc-revs-v1 (40 bytes)
288 transferred 1.65 KB in * seconds (* */sec) (glob)
308 transferred 1.65 KB in * seconds (* */sec) (glob) (no-rust !)
289 bundle2-input-part: total payload size 1852
309 bundle2-input-part: total payload size 1869 (no-rust !)
310 transferred 1.78 KB in * seconds (* */sec) (glob) (rust !)
311 bundle2-input-part: total payload size 2037 (rust !)
290 bundle2-input-bundle: 1 parts total
312 bundle2-input-bundle: 1 parts total
291 updating the branch cache
313 updating the branch cache
292 finished applying clone bundle
314 finished applying clone bundle
293 query 1; heads
315 query 1; heads
294 sending batch command
316 sending batch command
295 searching for changes
317 searching for changes
296 all remote heads known locally
318 all remote heads known locally
297 no changes found
319 no changes found
298 sending getbundle command
320 sending getbundle command
299 bundle2-input-bundle: with-transaction
321 bundle2-input-bundle: with-transaction
300 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
322 bundle2-input-part: "listkeys" (params: 1 mandatory) supported
301 bundle2-input-part: "phase-heads" supported
323 bundle2-input-part: "phase-heads" supported
302 bundle2-input-part: total payload size 24
324 bundle2-input-part: total payload size 24
303 bundle2-input-bundle: 2 parts total
325 bundle2-input-bundle: 2 parts total
304 checking for updated bookmarks
326 checking for updated bookmarks
305 updating to branch default
327 updating to branch default
306 resolving manifests
328 resolving manifests
307 branchmerge: False, force: False, partial: False
329 branchmerge: False, force: False, partial: False
308 ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041
330 ancestor: 000000000000, local: 000000000000+, remote: 9bc730a19041
309 A: remote created -> g
331 A: remote created -> g
310 getting A
332 getting A
311 B: remote created -> g
333 B: remote created -> g
312 getting B
334 getting B
313 C: remote created -> g
335 C: remote created -> g
314 getting C
336 getting C
315 D: remote created -> g
337 D: remote created -> g
316 getting D
338 getting D
317 E: remote created -> g
339 E: remote created -> g
318 getting E
340 getting E
319 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
320 updating the branch cache
342 updating the branch cache
321 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
343 (sent 4 HTTP requests and * bytes; received * bytes in responses) (glob)
322
344
323 #endif
345 #endif
@@ -1,1170 +1,1280 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extdiff]
2 > [extdiff]
3 > # for portability:
3 > # for portability:
4 > pdiff = sh "$RUNTESTDIR/pdiff"
4 > pdiff = sh "$RUNTESTDIR/pdiff"
5 > [progress]
5 > [progress]
6 > disable=False
6 > disable=False
7 > assume-tty = 1
7 > assume-tty = 1
8 > delay = 0
8 > delay = 0
9 > # set changedelay really large so we don't see nested topics
9 > # set changedelay really large so we don't see nested topics
10 > changedelay = 30000
10 > changedelay = 30000
11 > format = topic bar number
11 > format = topic bar number
12 > refresh = 0
12 > refresh = 0
13 > width = 60
13 > width = 60
14 > EOF
14 > EOF
15
15
16 Preparing the subrepository 'sub2'
16 Preparing the subrepository 'sub2'
17
17
18 $ hg init sub2
18 $ hg init sub2
19 $ echo sub2 > sub2/sub2
19 $ echo sub2 > sub2/sub2
20 $ hg add -R sub2
20 $ hg add -R sub2
21 adding sub2/sub2
21 adding sub2/sub2
22 $ hg commit -R sub2 -m "sub2 import"
22 $ hg commit -R sub2 -m "sub2 import"
23
23
24 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
24 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
25
25
26 $ hg init sub1
26 $ hg init sub1
27 $ echo sub1 > sub1/sub1
27 $ echo sub1 > sub1/sub1
28 $ echo "sub2 = ../sub2" > sub1/.hgsub
28 $ echo "sub2 = ../sub2" > sub1/.hgsub
29 $ hg clone sub2 sub1/sub2
29 $ hg clone sub2 sub1/sub2
30 \r (no-eol) (esc)
30 \r (no-eol) (esc)
31 linking [======> ] 1/6\r (no-eol) (esc)
31 linking [=====> ] 1/7\r (no-eol) (esc) (no-rust !)
32 linking [==============> ] 2/6\r (no-eol) (esc)
32 linking [===========> ] 2/7\r (no-eol) (esc) (no-rust !)
33 linking [=====================> ] 3/6\r (no-eol) (esc)
33 linking [==================> ] 3/7\r (no-eol) (esc) (no-rust !)
34 linking [=============================> ] 4/6\r (no-eol) (esc)
34 linking [========================> ] 4/7\r (no-eol) (esc) (no-rust !)
35 linking [====================================> ] 5/6\r (no-eol) (esc)
35 linking [===============================> ] 5/7\r (no-eol) (esc) (no-rust !)
36 linking [============================================>] 6/6\r (no-eol) (esc)
36 linking [=====================================> ] 6/7\r (no-eol) (esc) (no-rust !)
37 linking [============================================>] 7/7\r (no-eol) (esc) (no-rust !)
38 linking [====> ] 1/9\r (no-eol) (esc) (rust !)
39 linking [=========> ] 2/9\r (no-eol) (esc) (rust !)
40 linking [==============> ] 3/9\r (no-eol) (esc) (rust !)
41 linking [===================> ] 4/9\r (no-eol) (esc) (rust !)
42 linking [========================> ] 5/9\r (no-eol) (esc) (rust !)
43 linking [=============================> ] 6/9\r (no-eol) (esc) (rust !)
44 linking [==================================> ] 7/9\r (no-eol) (esc) (rust !)
45 linking [=======================================> ] 8/9\r (no-eol) (esc) (rust !)
46 linking [============================================>] 9/9\r (no-eol) (esc) (rust !)
37 \r (no-eol) (esc)
47 \r (no-eol) (esc)
38 \r (no-eol) (esc)
48 \r (no-eol) (esc)
39 updating [===========================================>] 1/1\r (no-eol) (esc)
49 updating [===========================================>] 1/1\r (no-eol) (esc)
40 \r (no-eol) (esc)
50 \r (no-eol) (esc)
41 updating to branch default
51 updating to branch default
42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 $ hg add -R sub1
53 $ hg add -R sub1
44 adding sub1/.hgsub
54 adding sub1/.hgsub
45 adding sub1/sub1
55 adding sub1/sub1
46 $ hg commit -R sub1 -m "sub1 import"
56 $ hg commit -R sub1 -m "sub1 import"
47
57
48 Preparing the 'main' repo which depends on the subrepo 'sub1'
58 Preparing the 'main' repo which depends on the subrepo 'sub1'
49
59
50 $ hg init main
60 $ hg init main
51 $ echo main > main/main
61 $ echo main > main/main
52 $ echo "sub1 = ../sub1" > main/.hgsub
62 $ echo "sub1 = ../sub1" > main/.hgsub
63
64 #if rust
53 $ hg clone sub1 main/sub1
65 $ hg clone sub1 main/sub1
54 \r (no-eol) (esc)
66 \r (no-eol) (esc)
55 linking [====> ] 1/8\r (no-eol) (esc)
67 linking [==> ] 1/11\r (no-eol) (esc)
56 linking [==========> ] 2/8\r (no-eol) (esc)
68 linking [======> ] 2/11\r (no-eol) (esc)
57 linking [===============> ] 3/8\r (no-eol) (esc)
69 linking [==========> ] 3/11\r (no-eol) (esc)
58 linking [=====================> ] 4/8\r (no-eol) (esc)
70 linking [==============> ] 4/11\r (no-eol) (esc)
59 linking [===========================> ] 5/8\r (no-eol) (esc)
71 linking [==================> ] 5/11\r (no-eol) (esc)
60 linking [================================> ] 6/8\r (no-eol) (esc)
72 linking [======================> ] 6/11\r (no-eol) (esc)
61 linking [======================================> ] 7/8\r (no-eol) (esc)
73 linking [==========================> ] 7/11\r (no-eol) (esc)
62 linking [============================================>] 8/8\r (no-eol) (esc)
74 linking [==============================> ] 8/11\r (no-eol) (esc)
75 linking [==================================> ] 9/11\r (no-eol) (esc)
76 linking [======================================> ] 10/11\r (no-eol) (esc)
77 linking [==========================================>] 11/11\r (no-eol) (esc)
63 \r (no-eol) (esc)
78 \r (no-eol) (esc)
64 \r (no-eol) (esc)
79 \r (no-eol) (esc)
65 updating [===========================================>] 3/3\r (no-eol) (esc)
80 updating [===========================================>] 3/3\r (no-eol) (esc)
66 \r (no-eol) (esc)
81 \r (no-eol) (esc)
67 \r (no-eol) (esc)
82 \r (no-eol) (esc)
68 linking [======> ] 1/6\r (no-eol) (esc)
83 linking [====> ] 1/9\r (no-eol) (esc)
69 linking [==============> ] 2/6\r (no-eol) (esc)
84 linking [=========> ] 2/9\r (no-eol) (esc)
70 linking [=====================> ] 3/6\r (no-eol) (esc)
85 linking [==============> ] 3/9\r (no-eol) (esc)
71 linking [=============================> ] 4/6\r (no-eol) (esc)
86 linking [===================> ] 4/9\r (no-eol) (esc)
72 linking [====================================> ] 5/6\r (no-eol) (esc)
87 linking [========================> ] 5/9\r (no-eol) (esc)
73 linking [============================================>] 6/6\r (no-eol) (esc)
88 linking [=============================> ] 6/9\r (no-eol) (esc)
89 linking [==================================> ] 7/9\r (no-eol) (esc)
90 linking [=======================================> ] 8/9\r (no-eol) (esc)
91 linking [============================================>] 9/9\r (no-eol) (esc)
74 updating [===========================================>] 1/1\r (no-eol) (esc)
92 updating [===========================================>] 1/1\r (no-eol) (esc)
75 \r (no-eol) (esc)
93 \r (no-eol) (esc)
76 updating to branch default
94 updating to branch default
77 cloning subrepo sub2 from $TESTTMP/sub2
95 cloning subrepo sub2 from $TESTTMP/sub2
78 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 #else
98 $ hg clone sub1 main/sub1
99 \r (no-eol) (esc)
100 linking [====> ] 1/9\r (no-eol) (esc)
101 linking [=========> ] 2/9\r (no-eol) (esc)
102 linking [==============> ] 3/9\r (no-eol) (esc)
103 linking [===================> ] 4/9\r (no-eol) (esc)
104 linking [========================> ] 5/9\r (no-eol) (esc)
105 linking [=============================> ] 6/9\r (no-eol) (esc)
106 linking [==================================> ] 7/9\r (no-eol) (esc)
107 linking [=======================================> ] 8/9\r (no-eol) (esc)
108 linking [============================================>] 9/9\r (no-eol) (esc)
109 \r (no-eol) (esc)
110 \r (no-eol) (esc)
111 updating [===========================================>] 3/3\r (no-eol) (esc)
112 \r (no-eol) (esc)
113 \r (no-eol) (esc)
114 linking [=====> ] 1/7\r (no-eol) (esc)
115 linking [===========> ] 2/7\r (no-eol) (esc)
116 linking [==================> ] 3/7\r (no-eol) (esc)
117 linking [========================> ] 4/7\r (no-eol) (esc)
118 linking [===============================> ] 5/7\r (no-eol) (esc)
119 linking [=====================================> ] 6/7\r (no-eol) (esc)
120 linking [============================================>] 7/7\r (no-eol) (esc)
121 updating [===========================================>] 1/1\r (no-eol) (esc)
122 \r (no-eol) (esc)
123 updating to branch default
124 cloning subrepo sub2 from $TESTTMP/sub2
125 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 #endif
79 $ hg add -R main
127 $ hg add -R main
80 adding main/.hgsub
128 adding main/.hgsub
81 adding main/main
129 adding main/main
82 $ hg commit -R main -m "main import"
130 $ hg commit -R main -m "main import"
83
131
84 #if serve
132 #if serve
85
133
86 Unfortunately, subrepos not at their nominal location cannot be cloned. But
134 Unfortunately, subrepos not at their nominal location cannot be cloned. But
87 they are still served from their location within the local repository. The only
135 they are still served from their location within the local repository. The only
88 reason why 'main' can be cloned via the filesystem is because 'sub1' and 'sub2'
136 reason why 'main' can be cloned via the filesystem is because 'sub1' and 'sub2'
89 are also available as siblings of 'main'.
137 are also available as siblings of 'main'.
90
138
91 $ hg serve -R main --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log
139 $ hg serve -R main --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log
92 adding = $TESTTMP/main
140 adding = $TESTTMP/main
93 adding sub1 = $TESTTMP/main/sub1
141 adding sub1 = $TESTTMP/main/sub1
94 adding sub1/sub2 = $TESTTMP/main/sub1/sub2
142 adding sub1/sub2 = $TESTTMP/main/sub1/sub2
95 listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?)
143 listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?)
96 adding = $TESTTMP/main (?)
144 adding = $TESTTMP/main (?)
97 adding sub1 = $TESTTMP/main/sub1 (?)
145 adding sub1 = $TESTTMP/main/sub1 (?)
98 adding sub1/sub2 = $TESTTMP/main/sub1/sub2 (?)
146 adding sub1/sub2 = $TESTTMP/main/sub1/sub2 (?)
99 $ cat hg1.pid >> $DAEMON_PIDS
147 $ cat hg1.pid >> $DAEMON_PIDS
100
148
101 $ hg clone http://localhost:$HGPORT httpclone --config progress.disable=True
149 $ hg clone http://localhost:$HGPORT httpclone --config progress.disable=True
102 requesting all changes
150 requesting all changes
103 adding changesets
151 adding changesets
104 adding manifests
152 adding manifests
105 adding file changes
153 adding file changes
106 added 1 changesets with 3 changes to 3 files
154 added 1 changesets with 3 changes to 3 files
107 new changesets 7f491f53a367
155 new changesets 7f491f53a367
108 updating to branch default
156 updating to branch default
109 cloning subrepo sub1 from http://localhost:$HGPORT/../sub1
157 cloning subrepo sub1 from http://localhost:$HGPORT/../sub1
110 abort: HTTP Error 404: Not Found
158 abort: HTTP Error 404: Not Found
111 [100]
159 [100]
112
160
113 $ cat access.log
161 $ cat access.log
114 * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
162 * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
115 * "GET /?cmd=batch HTTP/1.1" 200 - * (glob)
163 * "GET /?cmd=batch HTTP/1.1" 200 - * (glob)
116 * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob)
164 * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob)
117 * "GET /../sub1?cmd=capabilities HTTP/1.1" 404 - (glob)
165 * "GET /../sub1?cmd=capabilities HTTP/1.1" 404 - (glob)
118 $ cat error.log
166 $ cat error.log
119
167
120 $ killdaemons.py
168 $ killdaemons.py
121 $ rm hg1.pid error.log access.log
169 $ rm hg1.pid error.log access.log
122 #endif
170 #endif
123
171
124 Cleaning both repositories, just as a clone -U
172 Cleaning both repositories, just as a clone -U
125
173
126 $ hg up -C -R sub2 null
174 $ hg up -C -R sub2 null
127 \r (no-eol) (esc)
175 \r (no-eol) (esc)
128 updating [===========================================>] 1/1\r (no-eol) (esc)
176 updating [===========================================>] 1/1\r (no-eol) (esc)
129 \r (no-eol) (esc)
177 \r (no-eol) (esc)
130 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
178 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
131 $ hg up -C -R sub1 null
179 $ hg up -C -R sub1 null
132 \r (no-eol) (esc)
180 \r (no-eol) (esc)
133 updating [===========================================>] 1/1\r (no-eol) (esc)
181 updating [===========================================>] 1/1\r (no-eol) (esc)
134 \r (no-eol) (esc)
182 \r (no-eol) (esc)
135 \r (no-eol) (esc)
183 \r (no-eol) (esc)
136 updating [===========================================>] 3/3\r (no-eol) (esc)
184 updating [===========================================>] 3/3\r (no-eol) (esc)
137 \r (no-eol) (esc)
185 \r (no-eol) (esc)
138 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
186 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
139 $ hg up -C -R main null
187 $ hg up -C -R main null
140 \r (no-eol) (esc)
188 \r (no-eol) (esc)
141 updating [===========================================>] 1/1\r (no-eol) (esc)
189 updating [===========================================>] 1/1\r (no-eol) (esc)
142 \r (no-eol) (esc)
190 \r (no-eol) (esc)
143 \r (no-eol) (esc)
191 \r (no-eol) (esc)
144 updating [===========================================>] 3/3\r (no-eol) (esc)
192 updating [===========================================>] 3/3\r (no-eol) (esc)
145 \r (no-eol) (esc)
193 \r (no-eol) (esc)
146 \r (no-eol) (esc)
194 \r (no-eol) (esc)
147 updating [===========================================>] 3/3\r (no-eol) (esc)
195 updating [===========================================>] 3/3\r (no-eol) (esc)
148 \r (no-eol) (esc)
196 \r (no-eol) (esc)
149 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
197 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
150 $ rm -rf main/sub1
198 $ rm -rf main/sub1
151 $ rm -rf sub1/sub2
199 $ rm -rf sub1/sub2
152
200
153 Clone main
201 Clone main
154
202
203 #if rust
155 $ hg --config extensions.largefiles= clone main cloned
204 $ hg --config extensions.largefiles= clone main cloned
156 \r (no-eol) (esc)
205 \r (no-eol) (esc)
157 linking [====> ] 1/8\r (no-eol) (esc)
206 linking [====> ] 1/9\r (no-eol) (esc) (no-rust !)
158 linking [==========> ] 2/8\r (no-eol) (esc)
207 linking [=========> ] 2/9\r (no-eol) (esc) (no-rust !)
159 linking [===============> ] 3/8\r (no-eol) (esc)
208 linking [==============> ] 3/9\r (no-eol) (esc) (no-rust !)
160 linking [=====================> ] 4/8\r (no-eol) (esc)
209 linking [===================> ] 4/9\r (no-eol) (esc) (no-rust !)
161 linking [===========================> ] 5/8\r (no-eol) (esc)
210 linking [========================> ] 5/9\r (no-eol) (esc) (no-rust !)
162 linking [================================> ] 6/8\r (no-eol) (esc)
211 linking [=============================> ] 6/9\r (no-eol) (esc) (no-rust !)
163 linking [======================================> ] 7/8\r (no-eol) (esc)
212 linking [==================================> ] 7/9\r (no-eol) (esc) (no-rust !)
164 linking [============================================>] 8/8\r (no-eol) (esc)
213 linking [=======================================> ] 8/9\r (no-eol) (esc) (no-rust !)
214 linking [============================================>] 9/9\r (no-eol) (esc) (no-rust !)
215 linking [==> ] 1/11\r (no-eol) (esc) (rust !)
216 linking [======> ] 2/11\r (no-eol) (esc) (rust !)
217 linking [==========> ] 3/11\r (no-eol) (esc) (rust !)
218 linking [==============> ] 4/11\r (no-eol) (esc) (rust !)
219 linking [==================> ] 5/11\r (no-eol) (esc) (rust !)
220 linking [======================> ] 6/11\r (no-eol) (esc) (rust !)
221 linking [==========================> ] 7/11\r (no-eol) (esc) (rust !)
222 linking [==============================> ] 8/11\r (no-eol) (esc) (rust !)
223 linking [==================================> ] 9/11\r (no-eol) (esc) (rust !)
224 linking [======================================> ] 10/11\r (no-eol) (esc) (rust !)
225 linking [==========================================>] 11/11\r (no-eol) (esc) (rust !)
165 \r (no-eol) (esc)
226 \r (no-eol) (esc)
166 \r (no-eol) (esc)
227 \r (no-eol) (esc)
167 updating [===========================================>] 3/3\r (no-eol) (esc)
228 updating [===========================================>] 3/3\r (no-eol) (esc)
168 \r (no-eol) (esc)
229 \r (no-eol) (esc)
169 \r (no-eol) (esc)
230 \r (no-eol) (esc)
170 linking [====> ] 1/8\r (no-eol) (esc)
231 linking [==> ] 1/11\r (no-eol) (esc)
171 linking [==========> ] 2/8\r (no-eol) (esc)
232 linking [======> ] 2/11\r (no-eol) (esc)
172 linking [===============> ] 3/8\r (no-eol) (esc)
233 linking [==========> ] 3/11\r (no-eol) (esc)
173 linking [=====================> ] 4/8\r (no-eol) (esc)
234 linking [==============> ] 4/11\r (no-eol) (esc)
174 linking [===========================> ] 5/8\r (no-eol) (esc)
235 linking [==================> ] 5/11\r (no-eol) (esc)
175 linking [================================> ] 6/8\r (no-eol) (esc)
236 linking [======================> ] 6/11\r (no-eol) (esc)
176 linking [======================================> ] 7/8\r (no-eol) (esc)
237 linking [==========================> ] 7/11\r (no-eol) (esc)
177 linking [============================================>] 8/8\r (no-eol) (esc)
238 linking [==============================> ] 8/11\r (no-eol) (esc)
239 linking [==================================> ] 9/11\r (no-eol) (esc)
240 linking [======================================> ] 10/11\r (no-eol) (esc)
241 linking [==========================================>] 11/11\r (no-eol) (esc)
178 updating [===========================================>] 3/3\r (no-eol) (esc)
242 updating [===========================================>] 3/3\r (no-eol) (esc)
179 \r (no-eol) (esc)
243 \r (no-eol) (esc)
180 \r (no-eol) (esc)
244 \r (no-eol) (esc)
181 linking [======> ] 1/6\r (no-eol) (esc)
245 linking [====> ] 1/9\r (no-eol) (esc)
182 linking [==============> ] 2/6\r (no-eol) (esc)
246 linking [=========> ] 2/9\r (no-eol) (esc)
183 linking [=====================> ] 3/6\r (no-eol) (esc)
247 linking [==============> ] 3/9\r (no-eol) (esc)
184 linking [=============================> ] 4/6\r (no-eol) (esc)
248 linking [===================> ] 4/9\r (no-eol) (esc)
185 linking [====================================> ] 5/6\r (no-eol) (esc)
249 linking [========================> ] 5/9\r (no-eol) (esc)
186 linking [============================================>] 6/6\r (no-eol) (esc)
250 linking [=============================> ] 6/9\r (no-eol) (esc)
251 linking [==================================> ] 7/9\r (no-eol) (esc)
252 linking [=======================================> ] 8/9\r (no-eol) (esc)
253 linking [============================================>] 9/9\r (no-eol) (esc)
187 updating [===========================================>] 1/1\r (no-eol) (esc)
254 updating [===========================================>] 1/1\r (no-eol) (esc)
188 \r (no-eol) (esc)
255 \r (no-eol) (esc)
189 updating to branch default
256 updating to branch default
190 cloning subrepo sub1 from $TESTTMP/sub1
257 cloning subrepo sub1 from $TESTTMP/sub1
191 cloning subrepo sub1/sub2 from $TESTTMP/sub2
258 cloning subrepo sub1/sub2 from $TESTTMP/sub2
192 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
259 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
260 #else
261 $ hg --config extensions.largefiles= clone main cloned
262 \r (no-eol) (esc)
263 linking [====> ] 1/9\r (no-eol) (esc)
264 linking [=========> ] 2/9\r (no-eol) (esc)
265 linking [==============> ] 3/9\r (no-eol) (esc)
266 linking [===================> ] 4/9\r (no-eol) (esc)
267 linking [========================> ] 5/9\r (no-eol) (esc)
268 linking [=============================> ] 6/9\r (no-eol) (esc)
269 linking [==================================> ] 7/9\r (no-eol) (esc)
270 linking [=======================================> ] 8/9\r (no-eol) (esc)
271 linking [============================================>] 9/9\r (no-eol) (esc)
272 \r (no-eol) (esc)
273 \r (no-eol) (esc)
274 updating [===========================================>] 3/3\r (no-eol) (esc)
275 \r (no-eol) (esc)
276 \r (no-eol) (esc)
277 linking [====> ] 1/9\r (no-eol) (esc)
278 linking [=========> ] 2/9\r (no-eol) (esc)
279 linking [==============> ] 3/9\r (no-eol) (esc)
280 linking [===================> ] 4/9\r (no-eol) (esc)
281 linking [========================> ] 5/9\r (no-eol) (esc)
282 linking [=============================> ] 6/9\r (no-eol) (esc)
283 linking [==================================> ] 7/9\r (no-eol) (esc)
284 linking [=======================================> ] 8/9\r (no-eol) (esc)
285 linking [============================================>] 9/9\r (no-eol) (esc)
286 updating [===========================================>] 3/3\r (no-eol) (esc)
287 \r (no-eol) (esc)
288 \r (no-eol) (esc)
289 linking [=====> ] 1/7\r (no-eol) (esc)
290 linking [===========> ] 2/7\r (no-eol) (esc)
291 linking [==================> ] 3/7\r (no-eol) (esc)
292 linking [========================> ] 4/7\r (no-eol) (esc)
293 linking [===============================> ] 5/7\r (no-eol) (esc)
294 linking [=====================================> ] 6/7\r (no-eol) (esc)
295 linking [============================================>] 7/7\r (no-eol) (esc)
296 updating [===========================================>] 1/1\r (no-eol) (esc)
297 \r (no-eol) (esc)
298 updating to branch default
299 cloning subrepo sub1 from $TESTTMP/sub1
300 cloning subrepo sub1/sub2 from $TESTTMP/sub2
301 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
302 #endif
193
303
194 Largefiles is NOT enabled in the clone if the source repo doesn't require it
304 Largefiles is NOT enabled in the clone if the source repo doesn't require it
195 $ hg debugrequires -R cloned | grep largefiles
305 $ hg debugrequires -R cloned | grep largefiles
196 [1]
306 [1]
197
307
198 Checking cloned repo ids
308 Checking cloned repo ids
199
309
200 $ printf "cloned " ; hg id -R cloned
310 $ printf "cloned " ; hg id -R cloned
201 cloned 7f491f53a367 tip
311 cloned 7f491f53a367 tip
202 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
312 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
203 cloned/sub1 fc3b4ce2696f tip
313 cloned/sub1 fc3b4ce2696f tip
204 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
314 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
205 cloned/sub1/sub2 c57a0840e3ba tip
315 cloned/sub1/sub2 c57a0840e3ba tip
206
316
207 debugsub output for main and sub1
317 debugsub output for main and sub1
208
318
209 $ hg debugsub -R cloned
319 $ hg debugsub -R cloned
210 path sub1
320 path sub1
211 source ../sub1
321 source ../sub1
212 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
322 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
213 $ hg debugsub -R cloned/sub1
323 $ hg debugsub -R cloned/sub1
214 path sub2
324 path sub2
215 source ../sub2
325 source ../sub2
216 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
326 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
217
327
218 Modifying deeply nested 'sub2'
328 Modifying deeply nested 'sub2'
219
329
220 $ echo modified > cloned/sub1/sub2/sub2
330 $ echo modified > cloned/sub1/sub2/sub2
221 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
331 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
222 committing subrepository sub1
332 committing subrepository sub1
223 committing subrepository sub1/sub2
333 committing subrepository sub1/sub2
224
334
225 Checking modified node ids
335 Checking modified node ids
226
336
227 $ printf "cloned " ; hg id -R cloned
337 $ printf "cloned " ; hg id -R cloned
228 cloned ffe6649062fe tip
338 cloned ffe6649062fe tip
229 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
339 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
230 cloned/sub1 2ecb03bf44a9 tip
340 cloned/sub1 2ecb03bf44a9 tip
231 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
341 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
232 cloned/sub1/sub2 53dd3430bcaf tip
342 cloned/sub1/sub2 53dd3430bcaf tip
233
343
234 debugsub output for main and sub1
344 debugsub output for main and sub1
235
345
236 $ hg debugsub -R cloned
346 $ hg debugsub -R cloned
237 path sub1
347 path sub1
238 source ../sub1
348 source ../sub1
239 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
349 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
240 $ hg debugsub -R cloned/sub1
350 $ hg debugsub -R cloned/sub1
241 path sub2
351 path sub2
242 source ../sub2
352 source ../sub2
243 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
353 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
244
354
245 Check that deep archiving works
355 Check that deep archiving works
246
356
247 $ cd cloned
357 $ cd cloned
248 $ echo 'test' > sub1/sub2/test.txt
358 $ echo 'test' > sub1/sub2/test.txt
249 $ hg --config extensions.largefiles=! add sub1/sub2/test.txt
359 $ hg --config extensions.largefiles=! add sub1/sub2/test.txt
250 $ mkdir sub1/sub2/folder
360 $ mkdir sub1/sub2/folder
251 $ echo 'subfolder' > sub1/sub2/folder/test.txt
361 $ echo 'subfolder' > sub1/sub2/folder/test.txt
252 $ hg ci -ASm "add test.txt"
362 $ hg ci -ASm "add test.txt"
253 adding sub1/sub2/folder/test.txt
363 adding sub1/sub2/folder/test.txt
254 committing subrepository sub1
364 committing subrepository sub1
255 committing subrepository sub1/sub2
365 committing subrepository sub1/sub2
256
366
257 $ rm -r main
367 $ rm -r main
258 $ hg archive -S -qr 'wdir()' ../wdir
368 $ hg archive -S -qr 'wdir()' ../wdir
259 $ cat ../wdir/.hg_archival.txt
369 $ cat ../wdir/.hg_archival.txt
260 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
370 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
261 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
371 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
262 branch: default
372 branch: default
263 latesttag: null
373 latesttag: null
264 latesttagdistance: 4
374 latesttagdistance: 4
265 changessincelatesttag: 4
375 changessincelatesttag: 4
266 $ hg update -Cq .
376 $ hg update -Cq .
267
377
268 A deleted subrepo file is flagged as dirty, like the top level repo
378 A deleted subrepo file is flagged as dirty, like the top level repo
269
379
270 $ rm -r ../wdir sub1/sub2/folder/test.txt
380 $ rm -r ../wdir sub1/sub2/folder/test.txt
271 $ hg archive -S -qr 'wdir()' ../wdir
381 $ hg archive -S -qr 'wdir()' ../wdir
272 $ cat ../wdir/.hg_archival.txt
382 $ cat ../wdir/.hg_archival.txt
273 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
383 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
274 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
384 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
275 branch: default
385 branch: default
276 latesttag: null
386 latesttag: null
277 latesttagdistance: 4
387 latesttagdistance: 4
278 changessincelatesttag: 4
388 changessincelatesttag: 4
279 $ hg update -Cq .
389 $ hg update -Cq .
280 $ rm -r ../wdir
390 $ rm -r ../wdir
281
391
282 $ hg archive -S -qr 'wdir()' ../wdir \
392 $ hg archive -S -qr 'wdir()' ../wdir \
283 > --config 'experimental.archivemetatemplate=archived {node|short}\n'
393 > --config 'experimental.archivemetatemplate=archived {node|short}\n'
284 $ cat ../wdir/.hg_archival.txt
394 $ cat ../wdir/.hg_archival.txt
285 archived ffffffffffff
395 archived ffffffffffff
286 $ rm -r ../wdir
396 $ rm -r ../wdir
287
397
288 .. but first take a detour through some deep removal testing
398 .. but first take a detour through some deep removal testing
289
399
290 $ hg remove -S -I 're:.*.txt' .
400 $ hg remove -S -I 're:.*.txt' .
291 \r (no-eol) (esc)
401 \r (no-eol) (esc)
292 searching [==========================================>] 1/1\r (no-eol) (esc)
402 searching [==========================================>] 1/1\r (no-eol) (esc)
293 searching [==========================================>] 1/1\r (no-eol) (esc)
403 searching [==========================================>] 1/1\r (no-eol) (esc)
294 \r (no-eol) (esc)
404 \r (no-eol) (esc)
295 \r (no-eol) (esc)
405 \r (no-eol) (esc)
296 deleting [=====================> ] 1/2\r (no-eol) (esc)
406 deleting [=====================> ] 1/2\r (no-eol) (esc)
297 \r (no-eol) (esc)
407 \r (no-eol) (esc)
298 \r (no-eol) (esc)
408 \r (no-eol) (esc)
299 deleting [===========================================>] 2/2\r (no-eol) (esc)
409 deleting [===========================================>] 2/2\r (no-eol) (esc)
300 \r (no-eol) (esc)
410 \r (no-eol) (esc)
301 removing sub1/sub2/folder/test.txt
411 removing sub1/sub2/folder/test.txt
302 removing sub1/sub2/test.txt
412 removing sub1/sub2/test.txt
303 $ hg status -S
413 $ hg status -S
304 R sub1/sub2/folder/test.txt
414 R sub1/sub2/folder/test.txt
305 R sub1/sub2/test.txt
415 R sub1/sub2/test.txt
306 $ hg update -Cq
416 $ hg update -Cq
307 $ hg remove -I 're:.*.txt' sub1
417 $ hg remove -I 're:.*.txt' sub1
308 \r (no-eol) (esc)
418 \r (no-eol) (esc)
309 searching [==========================================>] 1/1\r (no-eol) (esc)
419 searching [==========================================>] 1/1\r (no-eol) (esc)
310 \r (no-eol) (esc)
420 \r (no-eol) (esc)
311 \r (no-eol) (esc)
421 \r (no-eol) (esc)
312 deleting [===========================================>] 1/1\r (no-eol) (esc)
422 deleting [===========================================>] 1/1\r (no-eol) (esc)
313 \r (no-eol) (esc)
423 \r (no-eol) (esc)
314 $ hg status -S
424 $ hg status -S
315 $ hg remove sub1/sub2/folder/test.txt
425 $ hg remove sub1/sub2/folder/test.txt
316 \r (no-eol) (esc)
426 \r (no-eol) (esc)
317 searching [==========================================>] 1/1\r (no-eol) (esc)
427 searching [==========================================>] 1/1\r (no-eol) (esc)
318 searching [==========================================>] 1/1\r (no-eol) (esc)
428 searching [==========================================>] 1/1\r (no-eol) (esc)
319 \r (no-eol) (esc)
429 \r (no-eol) (esc)
320 \r (no-eol) (esc)
430 \r (no-eol) (esc)
321 deleting [===========================================>] 1/1\r (no-eol) (esc)
431 deleting [===========================================>] 1/1\r (no-eol) (esc)
322 \r (no-eol) (esc)
432 \r (no-eol) (esc)
323 \r (no-eol) (esc)
433 \r (no-eol) (esc)
324 deleting [===========================================>] 1/1\r (no-eol) (esc)
434 deleting [===========================================>] 1/1\r (no-eol) (esc)
325 \r (no-eol) (esc)
435 \r (no-eol) (esc)
326 \r (no-eol) (esc)
436 \r (no-eol) (esc)
327 deleting [===========================================>] 1/1\r (no-eol) (esc)
437 deleting [===========================================>] 1/1\r (no-eol) (esc)
328 \r (no-eol) (esc)
438 \r (no-eol) (esc)
329 $ hg remove sub1/.hgsubstate
439 $ hg remove sub1/.hgsubstate
330 \r (no-eol) (esc)
440 \r (no-eol) (esc)
331 searching [==========================================>] 1/1\r (no-eol) (esc)
441 searching [==========================================>] 1/1\r (no-eol) (esc)
332 \r (no-eol) (esc)
442 \r (no-eol) (esc)
333 \r (no-eol) (esc)
443 \r (no-eol) (esc)
334 deleting [===========================================>] 1/1\r (no-eol) (esc)
444 deleting [===========================================>] 1/1\r (no-eol) (esc)
335 \r (no-eol) (esc)
445 \r (no-eol) (esc)
336 \r (no-eol) (esc)
446 \r (no-eol) (esc)
337 deleting [===========================================>] 1/1\r (no-eol) (esc)
447 deleting [===========================================>] 1/1\r (no-eol) (esc)
338 \r (no-eol) (esc)
448 \r (no-eol) (esc)
339 $ mv sub1/.hgsub sub1/x.hgsub
449 $ mv sub1/.hgsub sub1/x.hgsub
340 $ hg status -S
450 $ hg status -S
341 warning: subrepo spec file 'sub1/.hgsub' not found
451 warning: subrepo spec file 'sub1/.hgsub' not found
342 R sub1/.hgsubstate
452 R sub1/.hgsubstate
343 R sub1/sub2/folder/test.txt
453 R sub1/sub2/folder/test.txt
344 ! sub1/.hgsub
454 ! sub1/.hgsub
345 ? sub1/x.hgsub
455 ? sub1/x.hgsub
346 $ hg status -R sub1
456 $ hg status -R sub1
347 warning: subrepo spec file 'sub1/.hgsub' not found
457 warning: subrepo spec file 'sub1/.hgsub' not found
348 R .hgsubstate
458 R .hgsubstate
349 ! .hgsub
459 ! .hgsub
350 ? x.hgsub
460 ? x.hgsub
351 $ mv sub1/x.hgsub sub1/.hgsub
461 $ mv sub1/x.hgsub sub1/.hgsub
352 $ hg update -Cq
462 $ hg update -Cq
353 $ touch sub1/foo
463 $ touch sub1/foo
354 $ hg forget sub1/sub2/folder/test.txt
464 $ hg forget sub1/sub2/folder/test.txt
355 $ rm sub1/sub2/test.txt
465 $ rm sub1/sub2/test.txt
356
466
357 Test relative path printing + subrepos
467 Test relative path printing + subrepos
358 $ mkdir -p foo/bar
468 $ mkdir -p foo/bar
359 $ cd foo
469 $ cd foo
360 $ touch bar/abc
470 $ touch bar/abc
361 $ hg addremove -S ..
471 $ hg addremove -S ..
362 \r (no-eol) (esc)
472 \r (no-eol) (esc)
363 searching for exact renames [========================>] 1/1\r (no-eol) (esc)
473 searching for exact renames [========================>] 1/1\r (no-eol) (esc)
364 \r (no-eol) (esc)
474 \r (no-eol) (esc)
365 adding ../sub1/sub2/folder/test.txt
475 adding ../sub1/sub2/folder/test.txt
366 removing ../sub1/sub2/test.txt
476 removing ../sub1/sub2/test.txt
367 adding ../sub1/foo
477 adding ../sub1/foo
368 adding bar/abc
478 adding bar/abc
369 $ cd ..
479 $ cd ..
370 $ hg status -S
480 $ hg status -S
371 A foo/bar/abc
481 A foo/bar/abc
372 A sub1/foo
482 A sub1/foo
373 R sub1/sub2/test.txt
483 R sub1/sub2/test.txt
374
484
375 Archive wdir() with subrepos
485 Archive wdir() with subrepos
376 $ hg rm main
486 $ hg rm main
377 \r (no-eol) (esc)
487 \r (no-eol) (esc)
378 deleting [===========================================>] 1/1\r (no-eol) (esc)
488 deleting [===========================================>] 1/1\r (no-eol) (esc)
379 \r (no-eol) (esc)
489 \r (no-eol) (esc)
380 $ hg archive -S -r 'wdir()' ../wdir
490 $ hg archive -S -r 'wdir()' ../wdir
381 \r (no-eol) (esc)
491 \r (no-eol) (esc)
382 archiving [ ] 0/3\r (no-eol) (esc)
492 archiving [ ] 0/3\r (no-eol) (esc)
383 archiving [=============> ] 1/3\r (no-eol) (esc)
493 archiving [=============> ] 1/3\r (no-eol) (esc)
384 archiving [===========================> ] 2/3\r (no-eol) (esc)
494 archiving [===========================> ] 2/3\r (no-eol) (esc)
385 archiving [==========================================>] 3/3\r (no-eol) (esc)
495 archiving [==========================================>] 3/3\r (no-eol) (esc)
386 \r (no-eol) (esc)
496 \r (no-eol) (esc)
387 \r (no-eol) (esc)
497 \r (no-eol) (esc)
388 archiving (sub1) [ ] 0/4\r (no-eol) (esc)
498 archiving (sub1) [ ] 0/4\r (no-eol) (esc)
389 archiving (sub1) [========> ] 1/4\r (no-eol) (esc)
499 archiving (sub1) [========> ] 1/4\r (no-eol) (esc)
390 archiving (sub1) [=================> ] 2/4\r (no-eol) (esc)
500 archiving (sub1) [=================> ] 2/4\r (no-eol) (esc)
391 archiving (sub1) [==========================> ] 3/4\r (no-eol) (esc)
501 archiving (sub1) [==========================> ] 3/4\r (no-eol) (esc)
392 archiving (sub1) [===================================>] 4/4\r (no-eol) (esc)
502 archiving (sub1) [===================================>] 4/4\r (no-eol) (esc)
393 \r (no-eol) (esc)
503 \r (no-eol) (esc)
394 \r (no-eol) (esc)
504 \r (no-eol) (esc)
395 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
505 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
396 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
506 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
397 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
507 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
398 \r (no-eol) (esc)
508 \r (no-eol) (esc)
399 $ diff -r . ../wdir | grep -E -v '\.hg$|^Common subdirectories:'
509 $ diff -r . ../wdir | grep -E -v '\.hg$|^Common subdirectories:'
400 Only in ../wdir: .hg_archival.txt
510 Only in ../wdir: .hg_archival.txt
401
511
402 $ find ../wdir -type f | sort
512 $ find ../wdir -type f | sort
403 ../wdir/.hg_archival.txt
513 ../wdir/.hg_archival.txt
404 ../wdir/.hgsub
514 ../wdir/.hgsub
405 ../wdir/.hgsubstate
515 ../wdir/.hgsubstate
406 ../wdir/foo/bar/abc
516 ../wdir/foo/bar/abc
407 ../wdir/sub1/.hgsub
517 ../wdir/sub1/.hgsub
408 ../wdir/sub1/.hgsubstate
518 ../wdir/sub1/.hgsubstate
409 ../wdir/sub1/foo
519 ../wdir/sub1/foo
410 ../wdir/sub1/sub1
520 ../wdir/sub1/sub1
411 ../wdir/sub1/sub2/folder/test.txt
521 ../wdir/sub1/sub2/folder/test.txt
412 ../wdir/sub1/sub2/sub2
522 ../wdir/sub1/sub2/sub2
413
523
414 $ cat ../wdir/.hg_archival.txt
524 $ cat ../wdir/.hg_archival.txt
415 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
525 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
416 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
526 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
417 branch: default
527 branch: default
418 latesttag: null
528 latesttag: null
419 latesttagdistance: 4
529 latesttagdistance: 4
420 changessincelatesttag: 4
530 changessincelatesttag: 4
421
531
422 Attempting to archive 'wdir()' with a missing file is handled gracefully
532 Attempting to archive 'wdir()' with a missing file is handled gracefully
423 $ rm sub1/sub1
533 $ rm sub1/sub1
424 $ rm -r ../wdir
534 $ rm -r ../wdir
425 $ hg archive -v -S -r 'wdir()' ../wdir
535 $ hg archive -v -S -r 'wdir()' ../wdir
426 \r (no-eol) (esc)
536 \r (no-eol) (esc)
427 archiving [ ] 0/3\r (no-eol) (esc)
537 archiving [ ] 0/3\r (no-eol) (esc)
428 archiving [=============> ] 1/3\r (no-eol) (esc)
538 archiving [=============> ] 1/3\r (no-eol) (esc)
429 archiving [===========================> ] 2/3\r (no-eol) (esc)
539 archiving [===========================> ] 2/3\r (no-eol) (esc)
430 archiving [==========================================>] 3/3\r (no-eol) (esc)
540 archiving [==========================================>] 3/3\r (no-eol) (esc)
431 \r (no-eol) (esc)
541 \r (no-eol) (esc)
432 \r (no-eol) (esc)
542 \r (no-eol) (esc)
433 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
543 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
434 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
544 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
435 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
545 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
436 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
546 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
437 \r (no-eol) (esc)
547 \r (no-eol) (esc)
438 \r (no-eol) (esc)
548 \r (no-eol) (esc)
439 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
549 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
440 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
550 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
441 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
551 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
442 \r (no-eol) (esc)
552 \r (no-eol) (esc)
443 $ find ../wdir -type f | sort
553 $ find ../wdir -type f | sort
444 ../wdir/.hg_archival.txt
554 ../wdir/.hg_archival.txt
445 ../wdir/.hgsub
555 ../wdir/.hgsub
446 ../wdir/.hgsubstate
556 ../wdir/.hgsubstate
447 ../wdir/foo/bar/abc
557 ../wdir/foo/bar/abc
448 ../wdir/sub1/.hgsub
558 ../wdir/sub1/.hgsub
449 ../wdir/sub1/.hgsubstate
559 ../wdir/sub1/.hgsubstate
450 ../wdir/sub1/foo
560 ../wdir/sub1/foo
451 ../wdir/sub1/sub2/folder/test.txt
561 ../wdir/sub1/sub2/folder/test.txt
452 ../wdir/sub1/sub2/sub2
562 ../wdir/sub1/sub2/sub2
453
563
454 Continue relative path printing + subrepos
564 Continue relative path printing + subrepos
455 $ hg update -Cq
565 $ hg update -Cq
456 $ rm -r ../wdir
566 $ rm -r ../wdir
457 $ hg archive -S -r 'wdir()' ../wdir
567 $ hg archive -S -r 'wdir()' ../wdir
458 \r (no-eol) (esc)
568 \r (no-eol) (esc)
459 archiving [ ] 0/3\r (no-eol) (esc)
569 archiving [ ] 0/3\r (no-eol) (esc)
460 archiving [=============> ] 1/3\r (no-eol) (esc)
570 archiving [=============> ] 1/3\r (no-eol) (esc)
461 archiving [===========================> ] 2/3\r (no-eol) (esc)
571 archiving [===========================> ] 2/3\r (no-eol) (esc)
462 archiving [==========================================>] 3/3\r (no-eol) (esc)
572 archiving [==========================================>] 3/3\r (no-eol) (esc)
463 \r (no-eol) (esc)
573 \r (no-eol) (esc)
464 \r (no-eol) (esc)
574 \r (no-eol) (esc)
465 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
575 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
466 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
576 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
467 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
577 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
468 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
578 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
469 \r (no-eol) (esc)
579 \r (no-eol) (esc)
470 \r (no-eol) (esc)
580 \r (no-eol) (esc)
471 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
581 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
472 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
582 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
473 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
583 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
474 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
584 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
475 \r (no-eol) (esc)
585 \r (no-eol) (esc)
476 $ cat ../wdir/.hg_archival.txt
586 $ cat ../wdir/.hg_archival.txt
477 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
587 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
478 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd
588 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd
479 branch: default
589 branch: default
480 latesttag: null
590 latesttag: null
481 latesttagdistance: 4
591 latesttagdistance: 4
482 changessincelatesttag: 4
592 changessincelatesttag: 4
483
593
484 $ touch sub1/sub2/folder/bar
594 $ touch sub1/sub2/folder/bar
485 $ hg addremove sub1/sub2
595 $ hg addremove sub1/sub2
486 adding sub1/sub2/folder/bar
596 adding sub1/sub2/folder/bar
487 $ hg status -S
597 $ hg status -S
488 A sub1/sub2/folder/bar
598 A sub1/sub2/folder/bar
489 ? foo/bar/abc
599 ? foo/bar/abc
490 ? sub1/foo
600 ? sub1/foo
491 $ hg update -Cq
601 $ hg update -Cq
492 $ hg addremove sub1
602 $ hg addremove sub1
493 adding sub1/sub2/folder/bar
603 adding sub1/sub2/folder/bar
494 adding sub1/foo
604 adding sub1/foo
495 $ hg update -Cq
605 $ hg update -Cq
496 $ rm sub1/sub2/folder/test.txt
606 $ rm sub1/sub2/folder/test.txt
497 $ rm sub1/sub2/test.txt
607 $ rm sub1/sub2/test.txt
498 $ hg ci -ASm "remove test.txt"
608 $ hg ci -ASm "remove test.txt"
499 adding sub1/sub2/folder/bar
609 adding sub1/sub2/folder/bar
500 removing sub1/sub2/folder/test.txt
610 removing sub1/sub2/folder/test.txt
501 removing sub1/sub2/test.txt
611 removing sub1/sub2/test.txt
502 adding sub1/foo
612 adding sub1/foo
503 adding foo/bar/abc
613 adding foo/bar/abc
504 committing subrepository sub1
614 committing subrepository sub1
505 committing subrepository sub1/sub2
615 committing subrepository sub1/sub2
506
616
507 $ hg forget sub1/sub2/sub2
617 $ hg forget sub1/sub2/sub2
508 $ echo x > sub1/sub2/x.txt
618 $ echo x > sub1/sub2/x.txt
509 $ hg add sub1/sub2/x.txt
619 $ hg add sub1/sub2/x.txt
510
620
511 Files sees uncommitted adds and removes in subrepos
621 Files sees uncommitted adds and removes in subrepos
512 $ hg files -S
622 $ hg files -S
513 .hgsub
623 .hgsub
514 .hgsubstate
624 .hgsubstate
515 foo/bar/abc
625 foo/bar/abc
516 main
626 main
517 sub1/.hgsub
627 sub1/.hgsub
518 sub1/.hgsubstate
628 sub1/.hgsubstate
519 sub1/foo
629 sub1/foo
520 sub1/sub1
630 sub1/sub1
521 sub1/sub2/folder/bar
631 sub1/sub2/folder/bar
522 sub1/sub2/x.txt
632 sub1/sub2/x.txt
523
633
524 $ hg files -S "set:eol('dos') or eol('unix') or size('<= 0')"
634 $ hg files -S "set:eol('dos') or eol('unix') or size('<= 0')"
525 .hgsub
635 .hgsub
526 .hgsubstate
636 .hgsubstate
527 foo/bar/abc
637 foo/bar/abc
528 main
638 main
529 sub1/.hgsub
639 sub1/.hgsub
530 sub1/.hgsubstate
640 sub1/.hgsubstate
531 sub1/foo
641 sub1/foo
532 sub1/sub1
642 sub1/sub1
533 sub1/sub2/folder/bar
643 sub1/sub2/folder/bar
534 sub1/sub2/x.txt
644 sub1/sub2/x.txt
535
645
536 $ hg files -r '.^' -S "set:eol('dos') or eol('unix')"
646 $ hg files -r '.^' -S "set:eol('dos') or eol('unix')"
537 .hgsub
647 .hgsub
538 .hgsubstate
648 .hgsubstate
539 main
649 main
540 sub1/.hgsub
650 sub1/.hgsub
541 sub1/.hgsubstate
651 sub1/.hgsubstate
542 sub1/sub1
652 sub1/sub1
543 sub1/sub2/folder/test.txt
653 sub1/sub2/folder/test.txt
544 sub1/sub2/sub2
654 sub1/sub2/sub2
545 sub1/sub2/test.txt
655 sub1/sub2/test.txt
546
656
547 $ hg files sub1
657 $ hg files sub1
548 sub1/.hgsub
658 sub1/.hgsub
549 sub1/.hgsubstate
659 sub1/.hgsubstate
550 sub1/foo
660 sub1/foo
551 sub1/sub1
661 sub1/sub1
552 sub1/sub2/folder/bar
662 sub1/sub2/folder/bar
553 sub1/sub2/x.txt
663 sub1/sub2/x.txt
554
664
555 $ hg files sub1/sub2
665 $ hg files sub1/sub2
556 sub1/sub2/folder/bar
666 sub1/sub2/folder/bar
557 sub1/sub2/x.txt
667 sub1/sub2/x.txt
558
668
559 $ hg files
669 $ hg files
560 .hgsub
670 .hgsub
561 .hgsubstate
671 .hgsubstate
562 foo/bar/abc
672 foo/bar/abc
563 main
673 main
564
674
565 $ hg files -S -r '.^' sub1/sub2/folder
675 $ hg files -S -r '.^' sub1/sub2/folder
566 sub1/sub2/folder/test.txt
676 sub1/sub2/folder/test.txt
567
677
568 $ hg files -S -r '.^' sub1/sub2/missing
678 $ hg files -S -r '.^' sub1/sub2/missing
569 sub1/sub2/missing: no such file in rev 78026e779ea6
679 sub1/sub2/missing: no such file in rev 78026e779ea6
570 [1]
680 [1]
571
681
572 $ hg files -r '.^' sub1/
682 $ hg files -r '.^' sub1/
573 sub1/.hgsub
683 sub1/.hgsub
574 sub1/.hgsubstate
684 sub1/.hgsubstate
575 sub1/sub1
685 sub1/sub1
576 sub1/sub2/folder/test.txt
686 sub1/sub2/folder/test.txt
577 sub1/sub2/sub2
687 sub1/sub2/sub2
578 sub1/sub2/test.txt
688 sub1/sub2/test.txt
579
689
580 $ hg files -r '.^' sub1/sub2
690 $ hg files -r '.^' sub1/sub2
581 sub1/sub2/folder/test.txt
691 sub1/sub2/folder/test.txt
582 sub1/sub2/sub2
692 sub1/sub2/sub2
583 sub1/sub2/test.txt
693 sub1/sub2/test.txt
584
694
585 $ hg rollback -q
695 $ hg rollback -q
586 $ hg up -Cq
696 $ hg up -Cq
587
697
588 $ hg --config extensions.largefiles=! archive -S ../archive_all
698 $ hg --config extensions.largefiles=! archive -S ../archive_all
589 \r (no-eol) (esc)
699 \r (no-eol) (esc)
590 archiving [ ] 0/3\r (no-eol) (esc)
700 archiving [ ] 0/3\r (no-eol) (esc)
591 archiving [=============> ] 1/3\r (no-eol) (esc)
701 archiving [=============> ] 1/3\r (no-eol) (esc)
592 archiving [===========================> ] 2/3\r (no-eol) (esc)
702 archiving [===========================> ] 2/3\r (no-eol) (esc)
593 archiving [==========================================>] 3/3\r (no-eol) (esc)
703 archiving [==========================================>] 3/3\r (no-eol) (esc)
594 \r (no-eol) (esc)
704 \r (no-eol) (esc)
595 \r (no-eol) (esc)
705 \r (no-eol) (esc)
596 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
706 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
597 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
707 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
598 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
708 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
599 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
709 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
600 \r (no-eol) (esc)
710 \r (no-eol) (esc)
601 \r (no-eol) (esc)
711 \r (no-eol) (esc)
602 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
712 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
603 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
713 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
604 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
714 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
605 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
715 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
606 \r (no-eol) (esc)
716 \r (no-eol) (esc)
607 $ find ../archive_all | sort
717 $ find ../archive_all | sort
608 ../archive_all
718 ../archive_all
609 ../archive_all/.hg_archival.txt
719 ../archive_all/.hg_archival.txt
610 ../archive_all/.hgsub
720 ../archive_all/.hgsub
611 ../archive_all/.hgsubstate
721 ../archive_all/.hgsubstate
612 ../archive_all/main
722 ../archive_all/main
613 ../archive_all/sub1
723 ../archive_all/sub1
614 ../archive_all/sub1/.hgsub
724 ../archive_all/sub1/.hgsub
615 ../archive_all/sub1/.hgsubstate
725 ../archive_all/sub1/.hgsubstate
616 ../archive_all/sub1/sub1
726 ../archive_all/sub1/sub1
617 ../archive_all/sub1/sub2
727 ../archive_all/sub1/sub2
618 ../archive_all/sub1/sub2/folder
728 ../archive_all/sub1/sub2/folder
619 ../archive_all/sub1/sub2/folder/test.txt
729 ../archive_all/sub1/sub2/folder/test.txt
620 ../archive_all/sub1/sub2/sub2
730 ../archive_all/sub1/sub2/sub2
621 ../archive_all/sub1/sub2/test.txt
731 ../archive_all/sub1/sub2/test.txt
622
732
623 Check that archive -X works in deep subrepos
733 Check that archive -X works in deep subrepos
624
734
625 $ hg --config extensions.largefiles=! archive -S -X '**test*' ../archive_exclude
735 $ hg --config extensions.largefiles=! archive -S -X '**test*' ../archive_exclude
626 \r (no-eol) (esc)
736 \r (no-eol) (esc)
627 archiving [ ] 0/3\r (no-eol) (esc)
737 archiving [ ] 0/3\r (no-eol) (esc)
628 archiving [=============> ] 1/3\r (no-eol) (esc)
738 archiving [=============> ] 1/3\r (no-eol) (esc)
629 archiving [===========================> ] 2/3\r (no-eol) (esc)
739 archiving [===========================> ] 2/3\r (no-eol) (esc)
630 archiving [==========================================>] 3/3\r (no-eol) (esc)
740 archiving [==========================================>] 3/3\r (no-eol) (esc)
631 \r (no-eol) (esc)
741 \r (no-eol) (esc)
632 \r (no-eol) (esc)
742 \r (no-eol) (esc)
633 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
743 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
634 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
744 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
635 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
745 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
636 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
746 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
637 \r (no-eol) (esc)
747 \r (no-eol) (esc)
638 \r (no-eol) (esc)
748 \r (no-eol) (esc)
639 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
749 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
640 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
750 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
641 \r (no-eol) (esc)
751 \r (no-eol) (esc)
642 $ find ../archive_exclude | sort
752 $ find ../archive_exclude | sort
643 ../archive_exclude
753 ../archive_exclude
644 ../archive_exclude/.hg_archival.txt
754 ../archive_exclude/.hg_archival.txt
645 ../archive_exclude/.hgsub
755 ../archive_exclude/.hgsub
646 ../archive_exclude/.hgsubstate
756 ../archive_exclude/.hgsubstate
647 ../archive_exclude/main
757 ../archive_exclude/main
648 ../archive_exclude/sub1
758 ../archive_exclude/sub1
649 ../archive_exclude/sub1/.hgsub
759 ../archive_exclude/sub1/.hgsub
650 ../archive_exclude/sub1/.hgsubstate
760 ../archive_exclude/sub1/.hgsubstate
651 ../archive_exclude/sub1/sub1
761 ../archive_exclude/sub1/sub1
652 ../archive_exclude/sub1/sub2
762 ../archive_exclude/sub1/sub2
653 ../archive_exclude/sub1/sub2/sub2
763 ../archive_exclude/sub1/sub2/sub2
654
764
655 $ hg --config extensions.largefiles=! archive -S -I '**test*' ../archive_include
765 $ hg --config extensions.largefiles=! archive -S -I '**test*' ../archive_include
656 \r (no-eol) (esc)
766 \r (no-eol) (esc)
657 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
767 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
658 \r (no-eol) (esc)
768 \r (no-eol) (esc)
659 \r (no-eol) (esc)
769 \r (no-eol) (esc)
660 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
770 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
661 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
771 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
662 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
772 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
663 \r (no-eol) (esc)
773 \r (no-eol) (esc)
664 $ find ../archive_include | sort
774 $ find ../archive_include | sort
665 ../archive_include
775 ../archive_include
666 ../archive_include/sub1
776 ../archive_include/sub1
667 ../archive_include/sub1/sub2
777 ../archive_include/sub1/sub2
668 ../archive_include/sub1/sub2/folder
778 ../archive_include/sub1/sub2/folder
669 ../archive_include/sub1/sub2/folder/test.txt
779 ../archive_include/sub1/sub2/folder/test.txt
670 ../archive_include/sub1/sub2/test.txt
780 ../archive_include/sub1/sub2/test.txt
671
781
672 Check that deep archive works with largefiles (which overrides hgsubrepo impl)
782 Check that deep archive works with largefiles (which overrides hgsubrepo impl)
673 This also tests the repo.ui regression in 43fb170a23bd, and that lf subrepo
783 This also tests the repo.ui regression in 43fb170a23bd, and that lf subrepo
674 subrepos are archived properly.
784 subrepos are archived properly.
675 Note that add --large through a subrepo currently adds the file as a normal file
785 Note that add --large through a subrepo currently adds the file as a normal file
676
786
677 $ echo "large" > sub1/sub2/large.bin
787 $ echo "large" > sub1/sub2/large.bin
678 $ hg --config extensions.largefiles= add --large -R sub1/sub2 sub1/sub2/large.bin
788 $ hg --config extensions.largefiles= add --large -R sub1/sub2 sub1/sub2/large.bin
679 $ echo "large" > large.bin
789 $ echo "large" > large.bin
680 $ hg --config extensions.largefiles= add --large large.bin
790 $ hg --config extensions.largefiles= add --large large.bin
681 $ hg --config extensions.largefiles= ci -S -m "add large files"
791 $ hg --config extensions.largefiles= ci -S -m "add large files"
682 committing subrepository sub1
792 committing subrepository sub1
683 committing subrepository sub1/sub2
793 committing subrepository sub1/sub2
684
794
685 $ hg --config extensions.largefiles= archive -S ../archive_lf
795 $ hg --config extensions.largefiles= archive -S ../archive_lf
686 $ find ../archive_lf | sort
796 $ find ../archive_lf | sort
687 ../archive_lf
797 ../archive_lf
688 ../archive_lf/.hg_archival.txt
798 ../archive_lf/.hg_archival.txt
689 ../archive_lf/.hgsub
799 ../archive_lf/.hgsub
690 ../archive_lf/.hgsubstate
800 ../archive_lf/.hgsubstate
691 ../archive_lf/large.bin
801 ../archive_lf/large.bin
692 ../archive_lf/main
802 ../archive_lf/main
693 ../archive_lf/sub1
803 ../archive_lf/sub1
694 ../archive_lf/sub1/.hgsub
804 ../archive_lf/sub1/.hgsub
695 ../archive_lf/sub1/.hgsubstate
805 ../archive_lf/sub1/.hgsubstate
696 ../archive_lf/sub1/sub1
806 ../archive_lf/sub1/sub1
697 ../archive_lf/sub1/sub2
807 ../archive_lf/sub1/sub2
698 ../archive_lf/sub1/sub2/folder
808 ../archive_lf/sub1/sub2/folder
699 ../archive_lf/sub1/sub2/folder/test.txt
809 ../archive_lf/sub1/sub2/folder/test.txt
700 ../archive_lf/sub1/sub2/large.bin
810 ../archive_lf/sub1/sub2/large.bin
701 ../archive_lf/sub1/sub2/sub2
811 ../archive_lf/sub1/sub2/sub2
702 ../archive_lf/sub1/sub2/test.txt
812 ../archive_lf/sub1/sub2/test.txt
703 $ rm -rf ../archive_lf
813 $ rm -rf ../archive_lf
704
814
705 Exclude large files from main and sub-sub repo
815 Exclude large files from main and sub-sub repo
706
816
707 $ hg --config extensions.largefiles= archive -S -X '**.bin' ../archive_lf
817 $ hg --config extensions.largefiles= archive -S -X '**.bin' ../archive_lf
708 $ find ../archive_lf | sort
818 $ find ../archive_lf | sort
709 ../archive_lf
819 ../archive_lf
710 ../archive_lf/.hg_archival.txt
820 ../archive_lf/.hg_archival.txt
711 ../archive_lf/.hgsub
821 ../archive_lf/.hgsub
712 ../archive_lf/.hgsubstate
822 ../archive_lf/.hgsubstate
713 ../archive_lf/main
823 ../archive_lf/main
714 ../archive_lf/sub1
824 ../archive_lf/sub1
715 ../archive_lf/sub1/.hgsub
825 ../archive_lf/sub1/.hgsub
716 ../archive_lf/sub1/.hgsubstate
826 ../archive_lf/sub1/.hgsubstate
717 ../archive_lf/sub1/sub1
827 ../archive_lf/sub1/sub1
718 ../archive_lf/sub1/sub2
828 ../archive_lf/sub1/sub2
719 ../archive_lf/sub1/sub2/folder
829 ../archive_lf/sub1/sub2/folder
720 ../archive_lf/sub1/sub2/folder/test.txt
830 ../archive_lf/sub1/sub2/folder/test.txt
721 ../archive_lf/sub1/sub2/sub2
831 ../archive_lf/sub1/sub2/sub2
722 ../archive_lf/sub1/sub2/test.txt
832 ../archive_lf/sub1/sub2/test.txt
723 $ rm -rf ../archive_lf
833 $ rm -rf ../archive_lf
724
834
725 Exclude normal files from main and sub-sub repo
835 Exclude normal files from main and sub-sub repo
726
836
727 $ hg --config extensions.largefiles= archive -S -X '**.txt' -p '.' ../archive_lf.tgz
837 $ hg --config extensions.largefiles= archive -S -X '**.txt' -p '.' ../archive_lf.tgz
728 $ tar -tzf ../archive_lf.tgz | sort
838 $ tar -tzf ../archive_lf.tgz | sort
729 .hgsub
839 .hgsub
730 .hgsubstate
840 .hgsubstate
731 large.bin
841 large.bin
732 main
842 main
733 sub1/.hgsub
843 sub1/.hgsub
734 sub1/.hgsubstate
844 sub1/.hgsubstate
735 sub1/sub1
845 sub1/sub1
736 sub1/sub2/large.bin
846 sub1/sub2/large.bin
737 sub1/sub2/sub2
847 sub1/sub2/sub2
738
848
739 Include normal files from within a largefiles subrepo
849 Include normal files from within a largefiles subrepo
740
850
741 $ hg --config extensions.largefiles= archive -S -I '**.txt' ../archive_lf
851 $ hg --config extensions.largefiles= archive -S -I '**.txt' ../archive_lf
742 $ find ../archive_lf | sort
852 $ find ../archive_lf | sort
743 ../archive_lf
853 ../archive_lf
744 ../archive_lf/.hg_archival.txt
854 ../archive_lf/.hg_archival.txt
745 ../archive_lf/sub1
855 ../archive_lf/sub1
746 ../archive_lf/sub1/sub2
856 ../archive_lf/sub1/sub2
747 ../archive_lf/sub1/sub2/folder
857 ../archive_lf/sub1/sub2/folder
748 ../archive_lf/sub1/sub2/folder/test.txt
858 ../archive_lf/sub1/sub2/folder/test.txt
749 ../archive_lf/sub1/sub2/test.txt
859 ../archive_lf/sub1/sub2/test.txt
750 $ rm -rf ../archive_lf
860 $ rm -rf ../archive_lf
751
861
752 Include large files from within a largefiles subrepo
862 Include large files from within a largefiles subrepo
753
863
754 $ hg --config extensions.largefiles= archive -S -I '**.bin' ../archive_lf
864 $ hg --config extensions.largefiles= archive -S -I '**.bin' ../archive_lf
755 $ find ../archive_lf | sort
865 $ find ../archive_lf | sort
756 ../archive_lf
866 ../archive_lf
757 ../archive_lf/large.bin
867 ../archive_lf/large.bin
758 ../archive_lf/sub1
868 ../archive_lf/sub1
759 ../archive_lf/sub1/sub2
869 ../archive_lf/sub1/sub2
760 ../archive_lf/sub1/sub2/large.bin
870 ../archive_lf/sub1/sub2/large.bin
761 $ rm -rf ../archive_lf
871 $ rm -rf ../archive_lf
762
872
763 Find an exact largefile match in a largefiles subrepo
873 Find an exact largefile match in a largefiles subrepo
764
874
765 $ hg --config extensions.largefiles= archive -S -I 'sub1/sub2/large.bin' ../archive_lf
875 $ hg --config extensions.largefiles= archive -S -I 'sub1/sub2/large.bin' ../archive_lf
766 $ find ../archive_lf | sort
876 $ find ../archive_lf | sort
767 ../archive_lf
877 ../archive_lf
768 ../archive_lf/sub1
878 ../archive_lf/sub1
769 ../archive_lf/sub1/sub2
879 ../archive_lf/sub1/sub2
770 ../archive_lf/sub1/sub2/large.bin
880 ../archive_lf/sub1/sub2/large.bin
771 $ rm -rf ../archive_lf
881 $ rm -rf ../archive_lf
772
882
773 The local repo enables largefiles if a largefiles repo is cloned
883 The local repo enables largefiles if a largefiles repo is cloned
774
884
775 $ hg showconfig extensions
885 $ hg showconfig extensions
776 extensions.largefiles=
886 extensions.largefiles=
777
887
778 $ hg --config extensions.largefiles= clone -qU . ../lfclone
888 $ hg --config extensions.largefiles= clone -qU . ../lfclone
779 $ hg debugrequires -R ../lfclone | grep largefiles
889 $ hg debugrequires -R ../lfclone | grep largefiles
780 largefiles
890 largefiles
781
891
782 Find an exact match to a standin (should archive nothing)
892 Find an exact match to a standin (should archive nothing)
783 $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
893 $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
784 $ find ../archive_lf 2> /dev/null | sort
894 $ find ../archive_lf 2> /dev/null | sort
785
895
786 $ cat >> $HGRCPATH <<EOF
896 $ cat >> $HGRCPATH <<EOF
787 > [extensions]
897 > [extensions]
788 > largefiles=
898 > largefiles=
789 > [largefiles]
899 > [largefiles]
790 > patterns=glob:**.dat
900 > patterns=glob:**.dat
791 > EOF
901 > EOF
792
902
793 Test forget through a deep subrepo with the largefiles extension, both a
903 Test forget through a deep subrepo with the largefiles extension, both a
794 largefile and a normal file. Then a largefile that hasn't been committed yet.
904 largefile and a normal file. Then a largefile that hasn't been committed yet.
795 $ touch sub1/sub2/untracked.txt
905 $ touch sub1/sub2/untracked.txt
796 $ touch sub1/sub2/large.dat
906 $ touch sub1/sub2/large.dat
797 $ hg forget sub1/sub2/large.bin sub1/sub2/test.txt sub1/sub2/untracked.txt
907 $ hg forget sub1/sub2/large.bin sub1/sub2/test.txt sub1/sub2/untracked.txt
798 not removing sub1/sub2/untracked.txt: file is already untracked
908 not removing sub1/sub2/untracked.txt: file is already untracked
799 [1]
909 [1]
800 $ hg add --large --dry-run -v sub1/sub2/untracked.txt
910 $ hg add --large --dry-run -v sub1/sub2/untracked.txt
801 adding sub1/sub2/untracked.txt as a largefile
911 adding sub1/sub2/untracked.txt as a largefile
802 $ hg add --large -v sub1/sub2/untracked.txt
912 $ hg add --large -v sub1/sub2/untracked.txt
803 adding sub1/sub2/untracked.txt as a largefile
913 adding sub1/sub2/untracked.txt as a largefile
804 $ hg add --normal -v sub1/sub2/large.dat
914 $ hg add --normal -v sub1/sub2/large.dat
805 adding sub1/sub2/large.dat
915 adding sub1/sub2/large.dat
806 $ hg forget -v sub1/sub2/untracked.txt
916 $ hg forget -v sub1/sub2/untracked.txt
807 removing sub1/sub2/untracked.txt
917 removing sub1/sub2/untracked.txt
808 $ hg status -S
918 $ hg status -S
809 A sub1/sub2/large.dat
919 A sub1/sub2/large.dat
810 R sub1/sub2/large.bin
920 R sub1/sub2/large.bin
811 R sub1/sub2/test.txt
921 R sub1/sub2/test.txt
812 ? foo/bar/abc
922 ? foo/bar/abc
813 ? sub1/sub2/untracked.txt
923 ? sub1/sub2/untracked.txt
814 ? sub1/sub2/x.txt
924 ? sub1/sub2/x.txt
815 $ hg add sub1/sub2
925 $ hg add sub1/sub2
816
926
817 $ hg archive -S -r 'wdir()' ../wdir2
927 $ hg archive -S -r 'wdir()' ../wdir2
818 $ diff -r . ../wdir2 | grep -E -v '\.hg$|^Common subdirectories:'
928 $ diff -r . ../wdir2 | grep -E -v '\.hg$|^Common subdirectories:'
819 Only in ../wdir2: .hg_archival.txt
929 Only in ../wdir2: .hg_archival.txt
820 Only in .: .hglf
930 Only in .: .hglf
821 Only in .: foo
931 Only in .: foo
822 Only in ./sub1/sub2: large.bin
932 Only in ./sub1/sub2: large.bin
823 Only in ./sub1/sub2: test.txt
933 Only in ./sub1/sub2: test.txt
824 Only in ./sub1/sub2: untracked.txt
934 Only in ./sub1/sub2: untracked.txt
825 Only in ./sub1/sub2: x.txt
935 Only in ./sub1/sub2: x.txt
826 $ find ../wdir2 -type f | sort
936 $ find ../wdir2 -type f | sort
827 ../wdir2/.hg_archival.txt
937 ../wdir2/.hg_archival.txt
828 ../wdir2/.hgsub
938 ../wdir2/.hgsub
829 ../wdir2/.hgsubstate
939 ../wdir2/.hgsubstate
830 ../wdir2/large.bin
940 ../wdir2/large.bin
831 ../wdir2/main
941 ../wdir2/main
832 ../wdir2/sub1/.hgsub
942 ../wdir2/sub1/.hgsub
833 ../wdir2/sub1/.hgsubstate
943 ../wdir2/sub1/.hgsubstate
834 ../wdir2/sub1/sub1
944 ../wdir2/sub1/sub1
835 ../wdir2/sub1/sub2/folder/test.txt
945 ../wdir2/sub1/sub2/folder/test.txt
836 ../wdir2/sub1/sub2/large.dat
946 ../wdir2/sub1/sub2/large.dat
837 ../wdir2/sub1/sub2/sub2
947 ../wdir2/sub1/sub2/sub2
838 $ hg status -S -mac -n | sort
948 $ hg status -S -mac -n | sort
839 .hgsub
949 .hgsub
840 .hgsubstate
950 .hgsubstate
841 large.bin
951 large.bin
842 main
952 main
843 sub1/.hgsub
953 sub1/.hgsub
844 sub1/.hgsubstate
954 sub1/.hgsubstate
845 sub1/sub1
955 sub1/sub1
846 sub1/sub2/folder/test.txt
956 sub1/sub2/folder/test.txt
847 sub1/sub2/large.dat
957 sub1/sub2/large.dat
848 sub1/sub2/sub2
958 sub1/sub2/sub2
849
959
850 $ hg ci -Sqm 'forget testing'
960 $ hg ci -Sqm 'forget testing'
851
961
852 Test 'wdir()' modified file archiving with largefiles
962 Test 'wdir()' modified file archiving with largefiles
853 $ echo 'mod' > main
963 $ echo 'mod' > main
854 $ echo 'mod' > large.bin
964 $ echo 'mod' > large.bin
855 $ echo 'mod' > sub1/sub2/large.dat
965 $ echo 'mod' > sub1/sub2/large.dat
856 $ hg archive -S -r 'wdir()' ../wdir3
966 $ hg archive -S -r 'wdir()' ../wdir3
857 $ diff -r . ../wdir3 | grep -E -v '\.hg$|^Common subdirectories'
967 $ diff -r . ../wdir3 | grep -E -v '\.hg$|^Common subdirectories'
858 Only in ../wdir3: .hg_archival.txt
968 Only in ../wdir3: .hg_archival.txt
859 Only in .: .hglf
969 Only in .: .hglf
860 Only in .: foo
970 Only in .: foo
861 Only in ./sub1/sub2: large.bin
971 Only in ./sub1/sub2: large.bin
862 Only in ./sub1/sub2: test.txt
972 Only in ./sub1/sub2: test.txt
863 Only in ./sub1/sub2: untracked.txt
973 Only in ./sub1/sub2: untracked.txt
864 Only in ./sub1/sub2: x.txt
974 Only in ./sub1/sub2: x.txt
865 $ find ../wdir3 -type f | sort
975 $ find ../wdir3 -type f | sort
866 ../wdir3/.hg_archival.txt
976 ../wdir3/.hg_archival.txt
867 ../wdir3/.hgsub
977 ../wdir3/.hgsub
868 ../wdir3/.hgsubstate
978 ../wdir3/.hgsubstate
869 ../wdir3/large.bin
979 ../wdir3/large.bin
870 ../wdir3/main
980 ../wdir3/main
871 ../wdir3/sub1/.hgsub
981 ../wdir3/sub1/.hgsub
872 ../wdir3/sub1/.hgsubstate
982 ../wdir3/sub1/.hgsubstate
873 ../wdir3/sub1/sub1
983 ../wdir3/sub1/sub1
874 ../wdir3/sub1/sub2/folder/test.txt
984 ../wdir3/sub1/sub2/folder/test.txt
875 ../wdir3/sub1/sub2/large.dat
985 ../wdir3/sub1/sub2/large.dat
876 ../wdir3/sub1/sub2/sub2
986 ../wdir3/sub1/sub2/sub2
877 $ hg up -Cq
987 $ hg up -Cq
878
988
879 Test issue4330: commit a directory where only normal files have changed
989 Test issue4330: commit a directory where only normal files have changed
880 $ touch foo/bar/large.dat
990 $ touch foo/bar/large.dat
881 $ hg add --large foo/bar/large.dat
991 $ hg add --large foo/bar/large.dat
882 $ hg ci -m 'add foo/bar/large.dat'
992 $ hg ci -m 'add foo/bar/large.dat'
883 $ touch a.txt
993 $ touch a.txt
884 $ touch a.dat
994 $ touch a.dat
885 $ hg add -v foo/bar/abc a.txt a.dat
995 $ hg add -v foo/bar/abc a.txt a.dat
886 adding a.dat as a largefile
996 adding a.dat as a largefile
887 adding a.txt
997 adding a.txt
888 adding foo/bar/abc
998 adding foo/bar/abc
889 $ hg ci -m 'dir commit with only normal file deltas' foo/bar
999 $ hg ci -m 'dir commit with only normal file deltas' foo/bar
890 $ hg status
1000 $ hg status
891 A a.dat
1001 A a.dat
892 A a.txt
1002 A a.txt
893
1003
894 Test a directory commit with a changed largefile and a changed normal file
1004 Test a directory commit with a changed largefile and a changed normal file
895 $ echo changed > foo/bar/large.dat
1005 $ echo changed > foo/bar/large.dat
896 $ echo changed > foo/bar/abc
1006 $ echo changed > foo/bar/abc
897 $ hg ci -m 'dir commit with normal and lf file deltas' foo
1007 $ hg ci -m 'dir commit with normal and lf file deltas' foo
898 $ hg status
1008 $ hg status
899 A a.dat
1009 A a.dat
900 A a.txt
1010 A a.txt
901
1011
902 $ hg ci -m "add a.*"
1012 $ hg ci -m "add a.*"
903 $ hg mv a.dat b.dat
1013 $ hg mv a.dat b.dat
904 $ hg mv foo/bar/abc foo/bar/def
1014 $ hg mv foo/bar/abc foo/bar/def
905 $ hg status -C
1015 $ hg status -C
906 A b.dat
1016 A b.dat
907 a.dat
1017 a.dat
908 A foo/bar/def
1018 A foo/bar/def
909 foo/bar/abc
1019 foo/bar/abc
910 R a.dat
1020 R a.dat
911 R foo/bar/abc
1021 R foo/bar/abc
912
1022
913 $ hg ci -m "move large and normal"
1023 $ hg ci -m "move large and normal"
914 $ hg status -C --rev '.^' --rev .
1024 $ hg status -C --rev '.^' --rev .
915 A b.dat
1025 A b.dat
916 a.dat
1026 a.dat
917 A foo/bar/def
1027 A foo/bar/def
918 foo/bar/abc
1028 foo/bar/abc
919 R a.dat
1029 R a.dat
920 R foo/bar/abc
1030 R foo/bar/abc
921
1031
922
1032
923 $ echo foo > main
1033 $ echo foo > main
924 $ hg ci -m "mod parent only"
1034 $ hg ci -m "mod parent only"
925 $ hg init sub3
1035 $ hg init sub3
926 $ echo "sub3 = sub3" >> .hgsub
1036 $ echo "sub3 = sub3" >> .hgsub
927 $ echo xyz > sub3/a.txt
1037 $ echo xyz > sub3/a.txt
928 $ hg add sub3/a.txt
1038 $ hg add sub3/a.txt
929 $ hg ci -Sm "add sub3"
1039 $ hg ci -Sm "add sub3"
930 committing subrepository sub3
1040 committing subrepository sub3
931 $ cat .hgsub | grep -v sub3 > .hgsub1
1041 $ cat .hgsub | grep -v sub3 > .hgsub1
932 $ mv .hgsub1 .hgsub
1042 $ mv .hgsub1 .hgsub
933 $ hg ci -m "remove sub3"
1043 $ hg ci -m "remove sub3"
934
1044
935 $ hg log -r "subrepo()" --style compact
1045 $ hg log -r "subrepo()" --style compact
936 0 7f491f53a367 1970-01-01 00:00 +0000 test
1046 0 7f491f53a367 1970-01-01 00:00 +0000 test
937 main import
1047 main import
938
1048
939 1 ffe6649062fe 1970-01-01 00:00 +0000 test
1049 1 ffe6649062fe 1970-01-01 00:00 +0000 test
940 deep nested modif should trigger a commit
1050 deep nested modif should trigger a commit
941
1051
942 2 9bb10eebee29 1970-01-01 00:00 +0000 test
1052 2 9bb10eebee29 1970-01-01 00:00 +0000 test
943 add test.txt
1053 add test.txt
944
1054
945 3 7c64f035294f 1970-01-01 00:00 +0000 test
1055 3 7c64f035294f 1970-01-01 00:00 +0000 test
946 add large files
1056 add large files
947
1057
948 4 f734a59e2e35 1970-01-01 00:00 +0000 test
1058 4 f734a59e2e35 1970-01-01 00:00 +0000 test
949 forget testing
1059 forget testing
950
1060
951 11 9685a22af5db 1970-01-01 00:00 +0000 test
1061 11 9685a22af5db 1970-01-01 00:00 +0000 test
952 add sub3
1062 add sub3
953
1063
954 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
1064 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
955 remove sub3
1065 remove sub3
956
1066
957 $ hg log -r "subrepo('sub3')" --style compact
1067 $ hg log -r "subrepo('sub3')" --style compact
958 11 9685a22af5db 1970-01-01 00:00 +0000 test
1068 11 9685a22af5db 1970-01-01 00:00 +0000 test
959 add sub3
1069 add sub3
960
1070
961 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
1071 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
962 remove sub3
1072 remove sub3
963
1073
964 $ hg log -r "subrepo('bogus')" --style compact
1074 $ hg log -r "subrepo('bogus')" --style compact
965
1075
966
1076
967 Test .hgsubstate in the R state
1077 Test .hgsubstate in the R state
968
1078
969 $ hg rm .hgsub .hgsubstate
1079 $ hg rm .hgsub .hgsubstate
970 \r (no-eol) (esc)
1080 \r (no-eol) (esc)
971 deleting [=====================> ] 1/2\r (no-eol) (esc)
1081 deleting [=====================> ] 1/2\r (no-eol) (esc)
972 deleting [===========================================>] 2/2\r (no-eol) (esc)
1082 deleting [===========================================>] 2/2\r (no-eol) (esc)
973 \r (no-eol) (esc)
1083 \r (no-eol) (esc)
974 $ hg ci -m 'trash subrepo tracking'
1084 $ hg ci -m 'trash subrepo tracking'
975
1085
976 $ hg log -r "subrepo('re:sub\d+')" --style compact
1086 $ hg log -r "subrepo('re:sub\d+')" --style compact
977 0 7f491f53a367 1970-01-01 00:00 +0000 test
1087 0 7f491f53a367 1970-01-01 00:00 +0000 test
978 main import
1088 main import
979
1089
980 1 ffe6649062fe 1970-01-01 00:00 +0000 test
1090 1 ffe6649062fe 1970-01-01 00:00 +0000 test
981 deep nested modif should trigger a commit
1091 deep nested modif should trigger a commit
982
1092
983 2 9bb10eebee29 1970-01-01 00:00 +0000 test
1093 2 9bb10eebee29 1970-01-01 00:00 +0000 test
984 add test.txt
1094 add test.txt
985
1095
986 3 7c64f035294f 1970-01-01 00:00 +0000 test
1096 3 7c64f035294f 1970-01-01 00:00 +0000 test
987 add large files
1097 add large files
988
1098
989 4 f734a59e2e35 1970-01-01 00:00 +0000 test
1099 4 f734a59e2e35 1970-01-01 00:00 +0000 test
990 forget testing
1100 forget testing
991
1101
992 11 9685a22af5db 1970-01-01 00:00 +0000 test
1102 11 9685a22af5db 1970-01-01 00:00 +0000 test
993 add sub3
1103 add sub3
994
1104
995 12 2e0485b475b9 1970-01-01 00:00 +0000 test
1105 12 2e0485b475b9 1970-01-01 00:00 +0000 test
996 remove sub3
1106 remove sub3
997
1107
998 13[tip] a68b2c361653 1970-01-01 00:00 +0000 test
1108 13[tip] a68b2c361653 1970-01-01 00:00 +0000 test
999 trash subrepo tracking
1109 trash subrepo tracking
1000
1110
1001
1111
1002 Restore the trashed subrepo tracking
1112 Restore the trashed subrepo tracking
1003
1113
1004 $ hg rollback -q
1114 $ hg rollback -q
1005 $ hg update -Cq .
1115 $ hg update -Cq .
1006
1116
1007 Interaction with extdiff, largefiles and subrepos
1117 Interaction with extdiff, largefiles and subrepos
1008
1118
1009 $ hg --config extensions.extdiff= pdiff -S
1119 $ hg --config extensions.extdiff= pdiff -S
1010
1120
1011 $ hg --config extensions.extdiff= pdiff -r '.^' -S
1121 $ hg --config extensions.extdiff= pdiff -r '.^' -S
1012 \r (no-eol) (esc)
1122 \r (no-eol) (esc)
1013 archiving [ ] 0/2\r (no-eol) (esc)
1123 archiving [ ] 0/2\r (no-eol) (esc)
1014 archiving [====================> ] 1/2\r (no-eol) (esc)
1124 archiving [====================> ] 1/2\r (no-eol) (esc)
1015 archiving [==========================================>] 2/2\r (no-eol) (esc)
1125 archiving [==========================================>] 2/2\r (no-eol) (esc)
1016 \r (no-eol) (esc)
1126 \r (no-eol) (esc)
1017 \r (no-eol) (esc)
1127 \r (no-eol) (esc)
1018 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1128 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1019 \r (no-eol) (esc)
1129 \r (no-eol) (esc)
1020 \r (no-eol) (esc)
1130 \r (no-eol) (esc)
1021 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1131 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1022 \r (no-eol) (esc)
1132 \r (no-eol) (esc)
1023 \r (no-eol) (esc)
1133 \r (no-eol) (esc)
1024 archiving (sub3) [ <=> ] 0\r (no-eol) (esc)
1134 archiving (sub3) [ <=> ] 0\r (no-eol) (esc)
1025 \r (no-eol) (esc)
1135 \r (no-eol) (esc)
1026 \r (no-eol) (esc)
1136 \r (no-eol) (esc)
1027 archiving [ ] 0/2\r (no-eol) (esc)
1137 archiving [ ] 0/2\r (no-eol) (esc)
1028 archiving [====================> ] 1/2\r (no-eol) (esc)
1138 archiving [====================> ] 1/2\r (no-eol) (esc)
1029 archiving [==========================================>] 2/2\r (no-eol) (esc)
1139 archiving [==========================================>] 2/2\r (no-eol) (esc)
1030 \r (no-eol) (esc)
1140 \r (no-eol) (esc)
1031 \r (no-eol) (esc)
1141 \r (no-eol) (esc)
1032 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1142 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1033 \r (no-eol) (esc)
1143 \r (no-eol) (esc)
1034 \r (no-eol) (esc)
1144 \r (no-eol) (esc)
1035 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1145 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1036 \r (no-eol) (esc)
1146 \r (no-eol) (esc)
1037 diff -Nru cloned.*/.hgsub cloned/.hgsub (glob)
1147 diff -Nru cloned.*/.hgsub cloned/.hgsub (glob)
1038 --- cloned.*/.hgsub * (glob)
1148 --- cloned.*/.hgsub * (glob)
1039 +++ cloned/.hgsub * (glob)
1149 +++ cloned/.hgsub * (glob)
1040 @@ -1,2 +1* @@ (glob)
1150 @@ -1,2 +1* @@ (glob)
1041 sub1 = ../sub1
1151 sub1 = ../sub1
1042 -sub3 = sub3
1152 -sub3 = sub3
1043 diff -Nru cloned.*/.hgsubstate cloned/.hgsubstate (glob)
1153 diff -Nru cloned.*/.hgsubstate cloned/.hgsubstate (glob)
1044 --- cloned.*/.hgsubstate * (glob)
1154 --- cloned.*/.hgsubstate * (glob)
1045 +++ cloned/.hgsubstate * (glob)
1155 +++ cloned/.hgsubstate * (glob)
1046 @@ -1,2 +1* @@ (glob)
1156 @@ -1,2 +1* @@ (glob)
1047 7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1157 7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1048 -b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1158 -b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1049 [1]
1159 [1]
1050
1160
1051 $ hg --config extensions.extdiff= pdiff -r 0 -r '.^' -S
1161 $ hg --config extensions.extdiff= pdiff -r 0 -r '.^' -S
1052 \r (no-eol) (esc)
1162 \r (no-eol) (esc)
1053 archiving [ ] 0/3\r (no-eol) (esc)
1163 archiving [ ] 0/3\r (no-eol) (esc)
1054 archiving [=============> ] 1/3\r (no-eol) (esc)
1164 archiving [=============> ] 1/3\r (no-eol) (esc)
1055 archiving [===========================> ] 2/3\r (no-eol) (esc)
1165 archiving [===========================> ] 2/3\r (no-eol) (esc)
1056 archiving [==========================================>] 3/3\r (no-eol) (esc)
1166 archiving [==========================================>] 3/3\r (no-eol) (esc)
1057 \r (no-eol) (esc)
1167 \r (no-eol) (esc)
1058 \r (no-eol) (esc)
1168 \r (no-eol) (esc)
1059 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1169 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1060 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1170 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1061 \r (no-eol) (esc)
1171 \r (no-eol) (esc)
1062 \r (no-eol) (esc)
1172 \r (no-eol) (esc)
1063 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1173 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1064 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1174 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1065 \r (no-eol) (esc)
1175 \r (no-eol) (esc)
1066 \r (no-eol) (esc)
1176 \r (no-eol) (esc)
1067 archiving [ ] 0/8\r (no-eol) (esc)
1177 archiving [ ] 0/8\r (no-eol) (esc)
1068 archiving [====> ] 1/8\r (no-eol) (esc)
1178 archiving [====> ] 1/8\r (no-eol) (esc)
1069 archiving [=========> ] 2/8\r (no-eol) (esc)
1179 archiving [=========> ] 2/8\r (no-eol) (esc)
1070 archiving [===============> ] 3/8\r (no-eol) (esc)
1180 archiving [===============> ] 3/8\r (no-eol) (esc)
1071 archiving [====================> ] 4/8\r (no-eol) (esc)
1181 archiving [====================> ] 4/8\r (no-eol) (esc)
1072 archiving [=========================> ] 5/8\r (no-eol) (esc)
1182 archiving [=========================> ] 5/8\r (no-eol) (esc)
1073 archiving [===============================> ] 6/8\r (no-eol) (esc)
1183 archiving [===============================> ] 6/8\r (no-eol) (esc)
1074 archiving [====================================> ] 7/8\r (no-eol) (esc)
1184 archiving [====================================> ] 7/8\r (no-eol) (esc)
1075 archiving [==========================================>] 8/8\r (no-eol) (esc)
1185 archiving [==========================================>] 8/8\r (no-eol) (esc)
1076 \r (no-eol) (esc)
1186 \r (no-eol) (esc)
1077 \r (no-eol) (esc)
1187 \r (no-eol) (esc)
1078 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1188 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1079 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1189 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1080 \r (no-eol) (esc)
1190 \r (no-eol) (esc)
1081 \r (no-eol) (esc)
1191 \r (no-eol) (esc)
1082 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
1192 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
1083 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
1193 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
1084 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
1194 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
1085 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
1195 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
1086 \r (no-eol) (esc)
1196 \r (no-eol) (esc)
1087 \r (no-eol) (esc)
1197 \r (no-eol) (esc)
1088 archiving (sub3) [ ] 0/1\r (no-eol) (esc)
1198 archiving (sub3) [ ] 0/1\r (no-eol) (esc)
1089 archiving (sub3) [===================================>] 1/1\r (no-eol) (esc)
1199 archiving (sub3) [===================================>] 1/1\r (no-eol) (esc)
1090 \r (no-eol) (esc)
1200 \r (no-eol) (esc)
1091 diff -Nru cloned.*/.hglf/b.dat cloned.*/.hglf/b.dat (glob)
1201 diff -Nru cloned.*/.hglf/b.dat cloned.*/.hglf/b.dat (glob)
1092 --- cloned.*/.hglf/b.dat * (glob)
1202 --- cloned.*/.hglf/b.dat * (glob)
1093 +++ cloned.*/.hglf/b.dat * (glob)
1203 +++ cloned.*/.hglf/b.dat * (glob)
1094 @@ -*,0 +1* @@ (glob)
1204 @@ -*,0 +1* @@ (glob)
1095 +da39a3ee5e6b4b0d3255bfef95601890afd80709
1205 +da39a3ee5e6b4b0d3255bfef95601890afd80709
1096 diff -Nru cloned.*/.hglf/foo/bar/large.dat cloned.*/.hglf/foo/bar/large.dat (glob)
1206 diff -Nru cloned.*/.hglf/foo/bar/large.dat cloned.*/.hglf/foo/bar/large.dat (glob)
1097 --- cloned.*/.hglf/foo/bar/large.dat * (glob)
1207 --- cloned.*/.hglf/foo/bar/large.dat * (glob)
1098 +++ cloned.*/.hglf/foo/bar/large.dat * (glob)
1208 +++ cloned.*/.hglf/foo/bar/large.dat * (glob)
1099 @@ -*,0 +1* @@ (glob)
1209 @@ -*,0 +1* @@ (glob)
1100 +2f6933b5ee0f5fdd823d9717d8729f3c2523811b
1210 +2f6933b5ee0f5fdd823d9717d8729f3c2523811b
1101 diff -Nru cloned.*/.hglf/large.bin cloned.*/.hglf/large.bin (glob)
1211 diff -Nru cloned.*/.hglf/large.bin cloned.*/.hglf/large.bin (glob)
1102 --- cloned.*/.hglf/large.bin * (glob)
1212 --- cloned.*/.hglf/large.bin * (glob)
1103 +++ cloned.*/.hglf/large.bin * (glob)
1213 +++ cloned.*/.hglf/large.bin * (glob)
1104 @@ -*,0 +1* @@ (glob)
1214 @@ -*,0 +1* @@ (glob)
1105 +7f7097b041ccf68cc5561e9600da4655d21c6d18
1215 +7f7097b041ccf68cc5561e9600da4655d21c6d18
1106 diff -Nru cloned.*/.hgsub cloned.*/.hgsub (glob)
1216 diff -Nru cloned.*/.hgsub cloned.*/.hgsub (glob)
1107 --- cloned.*/.hgsub * (glob)
1217 --- cloned.*/.hgsub * (glob)
1108 +++ cloned.*/.hgsub * (glob)
1218 +++ cloned.*/.hgsub * (glob)
1109 @@ -1* +1,2 @@ (glob)
1219 @@ -1* +1,2 @@ (glob)
1110 sub1 = ../sub1
1220 sub1 = ../sub1
1111 +sub3 = sub3
1221 +sub3 = sub3
1112 diff -Nru cloned.*/.hgsubstate cloned.*/.hgsubstate (glob)
1222 diff -Nru cloned.*/.hgsubstate cloned.*/.hgsubstate (glob)
1113 --- cloned.*/.hgsubstate * (glob)
1223 --- cloned.*/.hgsubstate * (glob)
1114 +++ cloned.*/.hgsubstate * (glob)
1224 +++ cloned.*/.hgsubstate * (glob)
1115 @@ -1* +1,2 @@ (glob)
1225 @@ -1* +1,2 @@ (glob)
1116 -fc3b4ce2696f7741438c79207583768f2ce6b0dd sub1
1226 -fc3b4ce2696f7741438c79207583768f2ce6b0dd sub1
1117 +7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1227 +7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1118 +b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1228 +b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1119 diff -Nru cloned.*/foo/bar/def cloned.*/foo/bar/def (glob)
1229 diff -Nru cloned.*/foo/bar/def cloned.*/foo/bar/def (glob)
1120 --- cloned.*/foo/bar/def * (glob)
1230 --- cloned.*/foo/bar/def * (glob)
1121 +++ cloned.*/foo/bar/def * (glob)
1231 +++ cloned.*/foo/bar/def * (glob)
1122 @@ -*,0 +1* @@ (glob)
1232 @@ -*,0 +1* @@ (glob)
1123 +changed
1233 +changed
1124 diff -Nru cloned.*/main cloned.*/main (glob)
1234 diff -Nru cloned.*/main cloned.*/main (glob)
1125 --- cloned.*/main * (glob)
1235 --- cloned.*/main * (glob)
1126 +++ cloned.*/main * (glob)
1236 +++ cloned.*/main * (glob)
1127 @@ -1* +1* @@ (glob)
1237 @@ -1* +1* @@ (glob)
1128 -main
1238 -main
1129 +foo
1239 +foo
1130 diff -Nru cloned.*/sub1/.hgsubstate cloned.*/sub1/.hgsubstate (glob)
1240 diff -Nru cloned.*/sub1/.hgsubstate cloned.*/sub1/.hgsubstate (glob)
1131 --- cloned.*/sub1/.hgsubstate * (glob)
1241 --- cloned.*/sub1/.hgsubstate * (glob)
1132 +++ cloned.*/sub1/.hgsubstate * (glob)
1242 +++ cloned.*/sub1/.hgsubstate * (glob)
1133 @@ -1* +1* @@ (glob)
1243 @@ -1* +1* @@ (glob)
1134 -c57a0840e3badd667ef3c3ef65471609acb2ba3c sub2
1244 -c57a0840e3badd667ef3c3ef65471609acb2ba3c sub2
1135 +c77908c81ccea3794a896c79e98b0e004aee2e9e sub2
1245 +c77908c81ccea3794a896c79e98b0e004aee2e9e sub2
1136 diff -Nru cloned.*/sub1/sub2/folder/test.txt cloned.*/sub1/sub2/folder/test.txt (glob)
1246 diff -Nru cloned.*/sub1/sub2/folder/test.txt cloned.*/sub1/sub2/folder/test.txt (glob)
1137 --- cloned.*/sub1/sub2/folder/test.txt * (glob)
1247 --- cloned.*/sub1/sub2/folder/test.txt * (glob)
1138 +++ cloned.*/sub1/sub2/folder/test.txt * (glob)
1248 +++ cloned.*/sub1/sub2/folder/test.txt * (glob)
1139 @@ -*,0 +1* @@ (glob)
1249 @@ -*,0 +1* @@ (glob)
1140 +subfolder
1250 +subfolder
1141 diff -Nru cloned.*/sub1/sub2/sub2 cloned.*/sub1/sub2/sub2 (glob)
1251 diff -Nru cloned.*/sub1/sub2/sub2 cloned.*/sub1/sub2/sub2 (glob)
1142 --- cloned.*/sub1/sub2/sub2 * (glob)
1252 --- cloned.*/sub1/sub2/sub2 * (glob)
1143 +++ cloned.*/sub1/sub2/sub2 * (glob)
1253 +++ cloned.*/sub1/sub2/sub2 * (glob)
1144 @@ -1* +1* @@ (glob)
1254 @@ -1* +1* @@ (glob)
1145 -sub2
1255 -sub2
1146 +modified
1256 +modified
1147 diff -Nru cloned.*/sub3/a.txt cloned.*/sub3/a.txt (glob)
1257 diff -Nru cloned.*/sub3/a.txt cloned.*/sub3/a.txt (glob)
1148 --- cloned.*/sub3/a.txt * (glob)
1258 --- cloned.*/sub3/a.txt * (glob)
1149 +++ cloned.*/sub3/a.txt * (glob)
1259 +++ cloned.*/sub3/a.txt * (glob)
1150 @@ -*,0 +1* @@ (glob)
1260 @@ -*,0 +1* @@ (glob)
1151 +xyz
1261 +xyz
1152 [1]
1262 [1]
1153
1263
1154 $ echo mod > sub1/sub2/sub2
1264 $ echo mod > sub1/sub2/sub2
1155 $ hg --config extensions.extdiff= pdiff -S
1265 $ hg --config extensions.extdiff= pdiff -S
1156 \r (no-eol) (esc)
1266 \r (no-eol) (esc)
1157 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1267 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1158 \r (no-eol) (esc)
1268 \r (no-eol) (esc)
1159 \r (no-eol) (esc)
1269 \r (no-eol) (esc)
1160 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1270 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1161 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1271 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1162 \r (no-eol) (esc)
1272 \r (no-eol) (esc)
1163 --- */cloned.*/sub1/sub2/sub2 * (glob)
1273 --- */cloned.*/sub1/sub2/sub2 * (glob)
1164 +++ */cloned/sub1/sub2/sub2 * (glob)
1274 +++ */cloned/sub1/sub2/sub2 * (glob)
1165 @@ -1* +1* @@ (glob)
1275 @@ -1* +1* @@ (glob)
1166 -modified
1276 -modified
1167 +mod
1277 +mod
1168 [1]
1278 [1]
1169
1279
1170 $ cd ..
1280 $ cd ..
@@ -1,700 +1,761 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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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$ partial-pull (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 -- ----- | grep -E -v files$
439 $ unzip -l ../archive.zip | grep -v -- ----- | grep -E -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/10\r (no-eol) (esc) (no-rust !)
458 linking [=======> ] 2/10\r (no-eol) (esc) (no-rust !)
459 linking [===========> ] 3/10\r (no-eol) (esc) (no-rust !)
460 linking [================> ] 4/10\r (no-eol) (esc) (no-rust !)
461 linking [====================> ] 5/10\r (no-eol) (esc) (no-rust !)
462 linking [========================> ] 6/10\r (no-eol) (esc) (no-rust !)
463 linking [=============================> ] 7/10\r (no-eol) (esc) (no-rust !)
464 linking [=================================> ] 8/10\r (no-eol) (esc) (no-rust !)
465 linking [=====================================> ] 9/10\r (no-eol) (esc) (no-rust !)
466 linking [==========================================>] 10/10\r (no-eol) (esc) (no-rust !)
467 linking [==> ] 1/12\r (no-eol) (esc) (rust !)
468 linking [======> ] 2/12\r (no-eol) (esc) (rust !)
469 linking [=========> ] 3/12\r (no-eol) (esc) (rust !)
470 linking [=============> ] 4/12\r (no-eol) (esc) (rust !)
471 linking [================> ] 5/12\r (no-eol) (esc) (rust !)
472 linking [====================> ] 6/12\r (no-eol) (esc) (rust !)
473 linking [========================> ] 7/12\r (no-eol) (esc) (rust !)
474 linking [===========================> ] 8/12\r (no-eol) (esc) (rust !)
475 linking [===============================> ] 9/12\r (no-eol) (esc) (rust !)
476 linking [==================================> ] 10/12\r (no-eol) (esc) (rust !)
477 linking [======================================> ] 11/12\r (no-eol) (esc) (rust !)
478 linking [==========================================>] 12/12\r (no-eol) (esc) (rust !)
479 \r (no-eol) (esc)
480 #else
481 $ hg clone -U . ../empty
482 \r (no-eol) (esc)
483 linking [ <=> ] 1 (no-eol)
484 #endif
485
486 $ cd ../empty
487 #if hardlink
488 #if rust
489 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
490 \r (no-eol) (esc)
491 archiving [ ] 0/3\r (no-eol) (esc)
492 archiving [=============> ] 1/3\r (no-eol) (esc)
493 archiving [===========================> ] 2/3\r (no-eol) (esc)
494 archiving [==========================================>] 3/3\r (no-eol) (esc)
495 \r (no-eol) (esc)
496 \r (no-eol) (esc)
497 linking [==> ] 1/11\r (no-eol) (esc)
498 linking [======> ] 2/11\r (no-eol) (esc)
499 linking [==========> ] 3/11\r (no-eol) (esc)
500 linking [==============> ] 4/11\r (no-eol) (esc)
501 linking [==================> ] 5/11\r (no-eol) (esc)
502 linking [======================> ] 6/11\r (no-eol) (esc)
503 linking [==========================> ] 7/11\r (no-eol) (esc)
504 linking [==============================> ] 8/11\r (no-eol) (esc)
505 linking [==================================> ] 9/11\r (no-eol) (esc)
506 linking [======================================> ] 10/11\r (no-eol) (esc)
507 linking [==========================================>] 11/11\r (no-eol) (esc)
508 \r (no-eol) (esc)
509 \r (no-eol) (esc)
510 archiving (foo) [ ] 0/3\r (no-eol) (esc)
511 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
512 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
513 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
514 \r (no-eol) (esc)
515 \r (no-eol) (esc)
457 linking [====> ] 1/9\r (no-eol) (esc)
516 linking [====> ] 1/9\r (no-eol) (esc)
458 linking [=========> ] 2/9\r (no-eol) (esc)
517 linking [=========> ] 2/9\r (no-eol) (esc)
459 linking [==============> ] 3/9\r (no-eol) (esc)
518 linking [==============> ] 3/9\r (no-eol) (esc)
460 linking [===================> ] 4/9\r (no-eol) (esc)
519 linking [===================> ] 4/9\r (no-eol) (esc)
461 linking [========================> ] 5/9\r (no-eol) (esc)
520 linking [========================> ] 5/9\r (no-eol) (esc)
462 linking [=============================> ] 6/9\r (no-eol) (esc)
521 linking [=============================> ] 6/9\r (no-eol) (esc)
463 linking [==================================> ] 7/9\r (no-eol) (esc)
522 linking [==================================> ] 7/9\r (no-eol) (esc)
464 linking [=======================================> ] 8/9\r (no-eol) (esc)
523 linking [=======================================> ] 8/9\r (no-eol) (esc)
465 linking [============================================>] 9/9\r (no-eol) (esc)
524 linking [============================================>] 9/9\r (no-eol) (esc)
466 \r (no-eol) (esc)
525 \r (no-eol) (esc)
526 \r (no-eol) (esc)
527 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
528 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
529 \r (no-eol) (esc)
530 cloning subrepo foo from $TESTTMP/repo/foo
531 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
467 #else
532 #else
468 $ hg clone -U . ../empty
469 \r (no-eol) (esc)
470 linking [ <=> ] 1 (no-eol)
471 #endif
472
473 $ cd ../empty
474 #if hardlink
475 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
533 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
476 \r (no-eol) (esc)
534 \r (no-eol) (esc)
477 archiving [ ] 0/3\r (no-eol) (esc)
535 archiving [ ] 0/3\r (no-eol) (esc)
478 archiving [=============> ] 1/3\r (no-eol) (esc)
536 archiving [=============> ] 1/3\r (no-eol) (esc)
479 archiving [===========================> ] 2/3\r (no-eol) (esc)
537 archiving [===========================> ] 2/3\r (no-eol) (esc)
480 archiving [==========================================>] 3/3\r (no-eol) (esc)
538 archiving [==========================================>] 3/3\r (no-eol) (esc)
481 \r (no-eol) (esc)
539 \r (no-eol) (esc)
482 \r (no-eol) (esc)
540 \r (no-eol) (esc)
483 linking [====> ] 1/8\r (no-eol) (esc)
541 linking [====> ] 1/9\r (no-eol) (esc)
484 linking [==========> ] 2/8\r (no-eol) (esc)
542 linking [=========> ] 2/9\r (no-eol) (esc)
485 linking [===============> ] 3/8\r (no-eol) (esc)
543 linking [==============> ] 3/9\r (no-eol) (esc)
486 linking [=====================> ] 4/8\r (no-eol) (esc)
544 linking [===================> ] 4/9\r (no-eol) (esc)
487 linking [===========================> ] 5/8\r (no-eol) (esc)
545 linking [========================> ] 5/9\r (no-eol) (esc)
488 linking [================================> ] 6/8\r (no-eol) (esc)
546 linking [=============================> ] 6/9\r (no-eol) (esc)
489 linking [======================================> ] 7/8\r (no-eol) (esc)
547 linking [==================================> ] 7/9\r (no-eol) (esc)
490 linking [============================================>] 8/8\r (no-eol) (esc)
548 linking [=======================================> ] 8/9\r (no-eol) (esc)
549 linking [============================================>] 9/9\r (no-eol) (esc)
491 \r (no-eol) (esc)
550 \r (no-eol) (esc)
492 \r (no-eol) (esc)
551 \r (no-eol) (esc)
493 archiving (foo) [ ] 0/3\r (no-eol) (esc)
552 archiving (foo) [ ] 0/3\r (no-eol) (esc)
494 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
553 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
495 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
554 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
496 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
555 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
497 \r (no-eol) (esc)
556 \r (no-eol) (esc)
498 \r (no-eol) (esc)
557 \r (no-eol) (esc)
499 linking [======> ] 1/6\r (no-eol) (esc)
558 linking [=====> ] 1/7\r (no-eol) (esc)
500 linking [==============> ] 2/6\r (no-eol) (esc)
559 linking [===========> ] 2/7\r (no-eol) (esc)
501 linking [=====================> ] 3/6\r (no-eol) (esc)
560 linking [==================> ] 3/7\r (no-eol) (esc)
502 linking [=============================> ] 4/6\r (no-eol) (esc)
561 linking [========================> ] 4/7\r (no-eol) (esc)
503 linking [====================================> ] 5/6\r (no-eol) (esc)
562 linking [===============================> ] 5/7\r (no-eol) (esc)
504 linking [============================================>] 6/6\r (no-eol) (esc)
563 linking [=====================================> ] 6/7\r (no-eol) (esc)
564 linking [============================================>] 7/7\r (no-eol) (esc)
505 \r (no-eol) (esc)
565 \r (no-eol) (esc)
506 \r (no-eol) (esc)
566 \r (no-eol) (esc)
507 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
567 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
508 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
568 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
509 \r (no-eol) (esc)
569 \r (no-eol) (esc)
510 cloning subrepo foo from $TESTTMP/repo/foo
570 cloning subrepo foo from $TESTTMP/repo/foo
511 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
571 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
572 #endif
512 #else
573 #else
513 Note there's a slight output glitch on non-hardlink systems: the last
574 Note there's a slight output glitch on non-hardlink systems: the last
514 "linking" progress topic never gets closed, leading to slight output corruption on that platform.
575 "linking" progress topic never gets closed, leading to slight output corruption on that platform.
515 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
576 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
516 \r (no-eol) (esc)
577 \r (no-eol) (esc)
517 archiving [ ] 0/3\r (no-eol) (esc)
578 archiving [ ] 0/3\r (no-eol) (esc)
518 archiving [=============> ] 1/3\r (no-eol) (esc)
579 archiving [=============> ] 1/3\r (no-eol) (esc)
519 archiving [===========================> ] 2/3\r (no-eol) (esc)
580 archiving [===========================> ] 2/3\r (no-eol) (esc)
520 archiving [==========================================>] 3/3\r (no-eol) (esc)
581 archiving [==========================================>] 3/3\r (no-eol) (esc)
521 \r (no-eol) (esc)
582 \r (no-eol) (esc)
522 \r (no-eol) (esc)
583 \r (no-eol) (esc)
523 linking [ <=> ] 1\r (no-eol) (esc)
584 linking [ <=> ] 1\r (no-eol) (esc)
524 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
585 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
525 #endif
586 #endif
526
587
527 Archive + subrepos uses '/' for all component separators
588 Archive + subrepos uses '/' for all component separators
528
589
529 $ tar -tzf ../archive.tar.gz | sort
590 $ tar -tzf ../archive.tar.gz | sort
530 .hg_archival.txt
591 .hg_archival.txt
531 .hgsub
592 .hgsub
532 .hgsubstate
593 .hgsubstate
533 foo/.hgsub
594 foo/.hgsub
534 foo/.hgsubstate
595 foo/.hgsubstate
535 foo/bar/z.txt
596 foo/bar/z.txt
536 foo/y.txt
597 foo/y.txt
537 x.txt
598 x.txt
538
599
539 The newly cloned subrepos contain no working copy:
600 The newly cloned subrepos contain no working copy:
540
601
541 $ hg -R foo summary
602 $ hg -R foo summary
542 parent: -1:000000000000 (no revision checked out)
603 parent: -1:000000000000 (no revision checked out)
543 branch: default
604 branch: default
544 commit: (clean)
605 commit: (clean)
545 update: 4 new changesets (update)
606 update: 4 new changesets (update)
546
607
547 Sharing a local repo with missing local subrepos (i.e. it was never updated
608 Sharing a local repo with missing local subrepos (i.e. it was never updated
548 from null) works because the default path is copied from the source repo,
609 from null) works because the default path is copied from the source repo,
549 whereas clone should fail.
610 whereas clone should fail.
550
611
551 $ hg --config progress.disable=True clone -U ../empty ../empty2
612 $ hg --config progress.disable=True clone -U ../empty ../empty2
552
613
553 $ hg --config extensions.share= --config progress.disable=True \
614 $ hg --config extensions.share= --config progress.disable=True \
554 > share ../empty2 ../empty_share
615 > share ../empty2 ../empty_share
555 updating working directory
616 updating working directory
556 sharing subrepo foo from $TESTTMP/empty/foo
617 sharing subrepo foo from $TESTTMP/empty/foo
557 sharing subrepo foo/bar from $TESTTMP/empty/foo/bar
618 sharing subrepo foo/bar from $TESTTMP/empty/foo/bar
558 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
619 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
559
620
560 $ hg --config progress.disable=True clone ../empty2 ../empty_clone
621 $ hg --config progress.disable=True clone ../empty2 ../empty_clone
561 updating to branch default
622 updating to branch default
562 cloning subrepo foo from $TESTTMP/empty2/foo
623 cloning subrepo foo from $TESTTMP/empty2/foo
563 abort: repository $TESTTMP/empty2/foo not found
624 abort: repository $TESTTMP/empty2/foo not found
564 [255]
625 [255]
565
626
566 Disable progress extension and cleanup:
627 Disable progress extension and cleanup:
567
628
568 $ mv $HGRCPATH.no-progress $HGRCPATH
629 $ mv $HGRCPATH.no-progress $HGRCPATH
569
630
570 Test archiving when there is a directory in the way for a subrepo
631 Test archiving when there is a directory in the way for a subrepo
571 created by archive:
632 created by archive:
572
633
573 $ hg clone -U . ../almost-empty
634 $ hg clone -U . ../almost-empty
574 $ cd ../almost-empty
635 $ cd ../almost-empty
575 $ mkdir foo
636 $ mkdir foo
576 $ echo f > foo/f
637 $ echo f > foo/f
577 $ hg archive --subrepos -r tip archive
638 $ hg archive --subrepos -r tip archive
578 cloning subrepo foo from $TESTTMP/empty/foo
639 cloning subrepo foo from $TESTTMP/empty/foo
579 abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepository "foo")
640 abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepository "foo")
580 [255]
641 [255]
581
642
582 Clone and test outgoing:
643 Clone and test outgoing:
583
644
584 $ cd ..
645 $ cd ..
585 $ hg clone repo repo2
646 $ hg clone repo repo2
586 updating to branch default
647 updating to branch default
587 cloning subrepo foo from $TESTTMP/repo/foo
648 cloning subrepo foo from $TESTTMP/repo/foo
588 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
649 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
589 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
650 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
590 $ cd repo2
651 $ cd repo2
591 $ hg outgoing -S
652 $ hg outgoing -S
592 comparing with $TESTTMP/repo
653 comparing with $TESTTMP/repo
593 searching for changes
654 searching for changes
594 no changes found
655 no changes found
595 comparing with $TESTTMP/repo/foo
656 comparing with $TESTTMP/repo/foo
596 searching for changes
657 searching for changes
597 no changes found
658 no changes found
598 comparing with $TESTTMP/repo/foo/bar
659 comparing with $TESTTMP/repo/foo/bar
599 searching for changes
660 searching for changes
600 no changes found
661 no changes found
601 [1]
662 [1]
602
663
603 Make nested change:
664 Make nested change:
604
665
605 $ echo y4 >> foo/y.txt
666 $ echo y4 >> foo/y.txt
606 $ hg diff --nodates -S
667 $ hg diff --nodates -S
607 diff -r 65903cebad86 foo/y.txt
668 diff -r 65903cebad86 foo/y.txt
608 --- a/foo/y.txt
669 --- a/foo/y.txt
609 +++ b/foo/y.txt
670 +++ b/foo/y.txt
610 @@ -1,3 +1,4 @@
671 @@ -1,3 +1,4 @@
611 y1
672 y1
612 y2
673 y2
613 y3
674 y3
614 +y4
675 +y4
615 $ hg commit --subrepos -m 3-4-2
676 $ hg commit --subrepos -m 3-4-2
616 committing subrepository foo
677 committing subrepository foo
617 $ hg outgoing -S
678 $ hg outgoing -S
618 comparing with $TESTTMP/repo
679 comparing with $TESTTMP/repo
619 searching for changes
680 searching for changes
620 changeset: 3:2655b8ecc4ee
681 changeset: 3:2655b8ecc4ee
621 tag: tip
682 tag: tip
622 user: test
683 user: test
623 date: Thu Jan 01 00:00:00 1970 +0000
684 date: Thu Jan 01 00:00:00 1970 +0000
624 summary: 3-4-2
685 summary: 3-4-2
625
686
626 comparing with $TESTTMP/repo/foo
687 comparing with $TESTTMP/repo/foo
627 searching for changes
688 searching for changes
628 changeset: 4:e96193d6cb36
689 changeset: 4:e96193d6cb36
629 tag: tip
690 tag: tip
630 user: test
691 user: test
631 date: Thu Jan 01 00:00:00 1970 +0000
692 date: Thu Jan 01 00:00:00 1970 +0000
632 summary: 3-4-2
693 summary: 3-4-2
633
694
634 comparing with $TESTTMP/repo/foo/bar
695 comparing with $TESTTMP/repo/foo/bar
635 searching for changes
696 searching for changes
636 no changes found
697 no changes found
637
698
638
699
639 Switch to original repo and setup default path:
700 Switch to original repo and setup default path:
640
701
641 $ cd ../repo
702 $ cd ../repo
642 $ echo '[paths]' >> .hg/hgrc
703 $ echo '[paths]' >> .hg/hgrc
643 $ echo 'default = ../repo2' >> .hg/hgrc
704 $ echo 'default = ../repo2' >> .hg/hgrc
644
705
645 Test incoming:
706 Test incoming:
646
707
647 $ hg incoming -S
708 $ hg incoming -S
648 comparing with $TESTTMP/repo2
709 comparing with $TESTTMP/repo2
649 searching for changes
710 searching for changes
650 changeset: 3:2655b8ecc4ee
711 changeset: 3:2655b8ecc4ee
651 tag: tip
712 tag: tip
652 user: test
713 user: test
653 date: Thu Jan 01 00:00:00 1970 +0000
714 date: Thu Jan 01 00:00:00 1970 +0000
654 summary: 3-4-2
715 summary: 3-4-2
655
716
656 comparing with $TESTTMP/repo2/foo
717 comparing with $TESTTMP/repo2/foo
657 searching for changes
718 searching for changes
658 changeset: 4:e96193d6cb36
719 changeset: 4:e96193d6cb36
659 tag: tip
720 tag: tip
660 user: test
721 user: test
661 date: Thu Jan 01 00:00:00 1970 +0000
722 date: Thu Jan 01 00:00:00 1970 +0000
662 summary: 3-4-2
723 summary: 3-4-2
663
724
664 comparing with $TESTTMP/repo2/foo/bar
725 comparing with $TESTTMP/repo2/foo/bar
665 searching for changes
726 searching for changes
666 no changes found
727 no changes found
667
728
668 $ hg incoming -S --bundle incoming.hg
729 $ hg incoming -S --bundle incoming.hg
669 abort: cannot specify both --subrepos and --bundle
730 abort: cannot specify both --subrepos and --bundle
670 [10]
731 [10]
671
732
672 Test missing subrepo:
733 Test missing subrepo:
673
734
674 $ rm -r foo
735 $ rm -r foo
675 $ hg status -S
736 $ hg status -S
676 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
737 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
677
738
678 Issue2619: IndexError: list index out of range on hg add with subrepos
739 Issue2619: IndexError: list index out of range on hg add with subrepos
679 The subrepo must sorts after the explicit filename.
740 The subrepo must sorts after the explicit filename.
680
741
681 $ cd ..
742 $ cd ..
682 $ hg init test
743 $ hg init test
683 $ cd test
744 $ cd test
684 $ hg init x
745 $ hg init x
685 $ echo abc > abc.txt
746 $ echo abc > abc.txt
686 $ hg ci -Am "abc"
747 $ hg ci -Am "abc"
687 adding abc.txt
748 adding abc.txt
688 $ echo "x = x" >> .hgsub
749 $ echo "x = x" >> .hgsub
689 $ hg add .hgsub
750 $ hg add .hgsub
690 $ touch a x/a
751 $ touch a x/a
691 $ hg add a x/a
752 $ hg add a x/a
692
753
693 $ hg ci -Sm "added x"
754 $ hg ci -Sm "added x"
694 committing subrepository x
755 committing subrepository x
695 $ echo abc > x/a
756 $ echo abc > x/a
696 $ hg revert --rev '.^' "set:subrepo('glob:x*')"
757 $ hg revert --rev '.^' "set:subrepo('glob:x*')"
697 abort: subrepository 'x' does not exist in 25ac2c9b3180!
758 abort: subrepository 'x' does not exist in 25ac2c9b3180!
698 [255]
759 [255]
699
760
700 $ cd ..
761 $ cd ..
@@ -1,904 +1,908 b''
1 Set up repo
1 Set up repo
2
2
3 $ hg --config experimental.treemanifest=True init repo
3 $ hg --config experimental.treemanifest=True init repo
4 $ cd repo
4 $ cd repo
5
5
6 Requirements get set on init
6 Requirements get set on init
7
7
8 $ hg debugrequires | grep treemanifest
8 $ hg debugrequires | grep treemanifest
9 treemanifest
9 treemanifest
10
10
11 Without directories, looks like any other repo
11 Without directories, looks like any other repo
12
12
13 $ echo 0 > a
13 $ echo 0 > a
14 $ echo 0 > b
14 $ echo 0 > b
15 $ hg ci -Aqm initial
15 $ hg ci -Aqm initial
16 $ hg debugdata -m 0
16 $ hg debugdata -m 0
17 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
17 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
18 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
18 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
19
19
20 Submanifest is stored in separate revlog
20 Submanifest is stored in separate revlog
21
21
22 $ mkdir dir1
22 $ mkdir dir1
23 $ echo 1 > dir1/a
23 $ echo 1 > dir1/a
24 $ echo 1 > dir1/b
24 $ echo 1 > dir1/b
25 $ echo 1 > e
25 $ echo 1 > e
26 $ hg ci -Aqm 'add dir1'
26 $ hg ci -Aqm 'add dir1'
27 $ hg debugdata -m 1
27 $ hg debugdata -m 1
28 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
28 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
29 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
29 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
30 dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc)
30 dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc)
31 e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
31 e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
32 $ hg debugdata --dir dir1 0
32 $ hg debugdata --dir dir1 0
33 a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
33 a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
34 b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
34 b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
35
35
36 Can add nested directories
36 Can add nested directories
37
37
38 $ mkdir dir1/dir1
38 $ mkdir dir1/dir1
39 $ echo 2 > dir1/dir1/a
39 $ echo 2 > dir1/dir1/a
40 $ echo 2 > dir1/dir1/b
40 $ echo 2 > dir1/dir1/b
41 $ mkdir dir1/dir2
41 $ mkdir dir1/dir2
42 $ echo 2 > dir1/dir2/a
42 $ echo 2 > dir1/dir2/a
43 $ echo 2 > dir1/dir2/b
43 $ echo 2 > dir1/dir2/b
44 $ hg ci -Aqm 'add dir1/dir1'
44 $ hg ci -Aqm 'add dir1/dir1'
45 $ hg files -r .
45 $ hg files -r .
46 a
46 a
47 b
47 b
48 dir1/a
48 dir1/a
49 dir1/b
49 dir1/b
50 dir1/dir1/a
50 dir1/dir1/a
51 dir1/dir1/b
51 dir1/dir1/b
52 dir1/dir2/a
52 dir1/dir2/a
53 dir1/dir2/b
53 dir1/dir2/b
54 e
54 e
55
55
56 The manifest command works
56 The manifest command works
57
57
58 $ hg manifest
58 $ hg manifest
59 a
59 a
60 b
60 b
61 dir1/a
61 dir1/a
62 dir1/b
62 dir1/b
63 dir1/dir1/a
63 dir1/dir1/a
64 dir1/dir1/b
64 dir1/dir1/b
65 dir1/dir2/a
65 dir1/dir2/a
66 dir1/dir2/b
66 dir1/dir2/b
67 e
67 e
68
68
69 Revision is not created for unchanged directory
69 Revision is not created for unchanged directory
70
70
71 $ mkdir dir2
71 $ mkdir dir2
72 $ echo 3 > dir2/a
72 $ echo 3 > dir2/a
73 $ hg add dir2
73 $ hg add dir2
74 adding dir2/a
74 adding dir2/a
75 $ hg debugindex --dir dir1 > before
75 $ hg debugindex --dir dir1 > before
76 $ hg ci -qm 'add dir2'
76 $ hg ci -qm 'add dir2'
77 $ hg debugindex --dir dir1 > after
77 $ hg debugindex --dir dir1 > after
78 $ diff before after
78 $ diff before after
79 $ rm before after
79 $ rm before after
80
80
81 Removing directory does not create an revlog entry
81 Removing directory does not create an revlog entry
82
82
83 $ hg rm dir1/dir1
83 $ hg rm dir1/dir1
84 removing dir1/dir1/a
84 removing dir1/dir1/a
85 removing dir1/dir1/b
85 removing dir1/dir1/b
86 $ hg debugindex --dir dir1/dir1 > before
86 $ hg debugindex --dir dir1/dir1 > before
87 $ hg ci -qm 'remove dir1/dir1'
87 $ hg ci -qm 'remove dir1/dir1'
88 $ hg debugindex --dir dir1/dir1 > after
88 $ hg debugindex --dir dir1/dir1 > after
89 $ diff before after
89 $ diff before after
90 $ rm before after
90 $ rm before after
91
91
92 Check that hg files (calls treemanifest.walk()) works
92 Check that hg files (calls treemanifest.walk()) works
93 without loading all directory revlogs
93 without loading all directory revlogs
94
94
95 $ hg co 'desc("add dir2")'
95 $ hg co 'desc("add dir2")'
96 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
96 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
97 $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup
97 $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup
98 $ hg files -r . dir1
98 $ hg files -r . dir1
99 dir1/a
99 dir1/a
100 dir1/b
100 dir1/b
101 dir1/dir1/a
101 dir1/dir1/a
102 dir1/dir1/b
102 dir1/dir1/b
103 dir1/dir2/a
103 dir1/dir2/a
104 dir1/dir2/b
104 dir1/dir2/b
105
105
106 Check that status between revisions works (calls treemanifest.matches())
106 Check that status between revisions works (calls treemanifest.matches())
107 without loading all directory revlogs
107 without loading all directory revlogs
108
108
109 $ hg status --rev 'desc("add dir1")' --rev . dir1
109 $ hg status --rev 'desc("add dir1")' --rev . dir1
110 A dir1/dir1/a
110 A dir1/dir1/a
111 A dir1/dir1/b
111 A dir1/dir1/b
112 A dir1/dir2/a
112 A dir1/dir2/a
113 A dir1/dir2/b
113 A dir1/dir2/b
114 $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2
114 $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2
115
115
116 Merge creates 2-parent revision of directory revlog
116 Merge creates 2-parent revision of directory revlog
117
117
118 $ echo 5 > dir1/a
118 $ echo 5 > dir1/a
119 $ hg ci -Aqm 'modify dir1/a'
119 $ hg ci -Aqm 'modify dir1/a'
120 $ hg co '.^'
120 $ hg co '.^'
121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
121 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 $ echo 6 > dir1/b
122 $ echo 6 > dir1/b
123 $ hg ci -Aqm 'modify dir1/b'
123 $ hg ci -Aqm 'modify dir1/b'
124 $ hg merge 'desc("modify dir1/a")'
124 $ hg merge 'desc("modify dir1/a")'
125 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
125 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 (branch merge, don't forget to commit)
126 (branch merge, don't forget to commit)
127 $ hg ci -m 'conflict-free merge involving dir1/'
127 $ hg ci -m 'conflict-free merge involving dir1/'
128 $ cat dir1/a
128 $ cat dir1/a
129 5
129 5
130 $ cat dir1/b
130 $ cat dir1/b
131 6
131 6
132 $ hg debugindex --dir dir1
132 $ hg debugindex --dir dir1
133 rev linkrev nodeid p1-nodeid p2-nodeid
133 rev linkrev nodeid p1-nodeid p2-nodeid
134 0 1 8b3ffd73f901 000000000000 000000000000
134 0 1 8b3ffd73f901 000000000000 000000000000
135 1 2 68e9d057c5a8 8b3ffd73f901 000000000000
135 1 2 68e9d057c5a8 8b3ffd73f901 000000000000
136 2 4 4698198d2624 68e9d057c5a8 000000000000
136 2 4 4698198d2624 68e9d057c5a8 000000000000
137 3 5 44844058ccce 68e9d057c5a8 000000000000
137 3 5 44844058ccce 68e9d057c5a8 000000000000
138 4 6 bf3d9b744927 68e9d057c5a8 000000000000
138 4 6 bf3d9b744927 68e9d057c5a8 000000000000
139 5 7 dde7c0af2a03 bf3d9b744927 44844058ccce
139 5 7 dde7c0af2a03 bf3d9b744927 44844058ccce
140
140
141 Merge keeping directory from parent 1 does not create revlog entry. (Note that
141 Merge keeping directory from parent 1 does not create revlog entry. (Note that
142 dir1's manifest does change, but only because dir1/a's filelog changes.)
142 dir1's manifest does change, but only because dir1/a's filelog changes.)
143
143
144 $ hg co 'desc("add dir2")'
144 $ hg co 'desc("add dir2")'
145 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
145 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 $ echo 8 > dir2/a
146 $ echo 8 > dir2/a
147 $ hg ci -m 'modify dir2/a'
147 $ hg ci -m 'modify dir2/a'
148 created new head
148 created new head
149
149
150 $ hg debugindex --dir dir2 > before
150 $ hg debugindex --dir dir2 > before
151 $ hg merge 'desc("modify dir1/a")'
151 $ hg merge 'desc("modify dir1/a")'
152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 (branch merge, don't forget to commit)
153 (branch merge, don't forget to commit)
154 $ hg revert -r 'desc("modify dir2/a")' .
154 $ hg revert -r 'desc("modify dir2/a")' .
155 reverting dir1/a
155 reverting dir1/a
156 $ hg ci -m 'merge, keeping parent 1'
156 $ hg ci -m 'merge, keeping parent 1'
157 $ hg debugindex --dir dir2 > after
157 $ hg debugindex --dir dir2 > after
158 $ diff before after
158 $ diff before after
159 $ rm before after
159 $ rm before after
160
160
161 Merge keeping directory from parent 2 does not create revlog entry. (Note that
161 Merge keeping directory from parent 2 does not create revlog entry. (Note that
162 dir2's manifest does change, but only because dir2/a's filelog changes.)
162 dir2's manifest does change, but only because dir2/a's filelog changes.)
163
163
164 $ hg co 'desc("modify dir2/a")'
164 $ hg co 'desc("modify dir2/a")'
165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 $ hg debugindex --dir dir1 > before
166 $ hg debugindex --dir dir1 > before
167 $ hg merge 'desc("modify dir1/a")'
167 $ hg merge 'desc("modify dir1/a")'
168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
169 (branch merge, don't forget to commit)
169 (branch merge, don't forget to commit)
170 $ hg revert -r 'desc("modify dir1/a")' .
170 $ hg revert -r 'desc("modify dir1/a")' .
171 reverting dir2/a
171 reverting dir2/a
172 $ hg ci -m 'merge, keeping parent 2'
172 $ hg ci -m 'merge, keeping parent 2'
173 created new head
173 created new head
174 $ hg debugindex --dir dir1 > after
174 $ hg debugindex --dir dir1 > after
175 $ diff before after
175 $ diff before after
176 $ rm before after
176 $ rm before after
177
177
178 Create flat source repo for tests with mixed flat/tree manifests
178 Create flat source repo for tests with mixed flat/tree manifests
179
179
180 $ cd ..
180 $ cd ..
181 $ hg init repo-flat
181 $ hg init repo-flat
182 $ cd repo-flat
182 $ cd repo-flat
183
183
184 Create a few commits with flat manifest
184 Create a few commits with flat manifest
185
185
186 $ echo 0 > a
186 $ echo 0 > a
187 $ echo 0 > b
187 $ echo 0 > b
188 $ echo 0 > e
188 $ echo 0 > e
189 $ for d in dir1 dir1/dir1 dir1/dir2 dir2
189 $ for d in dir1 dir1/dir1 dir1/dir2 dir2
190 > do
190 > do
191 > mkdir $d
191 > mkdir $d
192 > echo 0 > $d/a
192 > echo 0 > $d/a
193 > echo 0 > $d/b
193 > echo 0 > $d/b
194 > done
194 > done
195 $ hg ci -Aqm initial
195 $ hg ci -Aqm initial
196
196
197 $ echo 1 > a
197 $ echo 1 > a
198 $ echo 1 > dir1/a
198 $ echo 1 > dir1/a
199 $ echo 1 > dir1/dir1/a
199 $ echo 1 > dir1/dir1/a
200 $ hg ci -Aqm 'modify on branch 1'
200 $ hg ci -Aqm 'modify on branch 1'
201
201
202 $ hg co 0
202 $ hg co 0
203 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 $ echo 2 > b
204 $ echo 2 > b
205 $ echo 2 > dir1/b
205 $ echo 2 > dir1/b
206 $ echo 2 > dir1/dir1/b
206 $ echo 2 > dir1/dir1/b
207 $ hg ci -Aqm 'modify on branch 2'
207 $ hg ci -Aqm 'modify on branch 2'
208
208
209 $ hg merge 1
209 $ hg merge 1
210 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 (branch merge, don't forget to commit)
211 (branch merge, don't forget to commit)
212 $ hg ci -m 'merge of flat manifests to new flat manifest'
212 $ hg ci -m 'merge of flat manifests to new flat manifest'
213
213
214 $ cd ..
214 $ cd ..
215 $ hg -R repo-flat serve -p $HGPORT -d \
215 $ hg -R repo-flat serve -p $HGPORT -d \
216 > --pid-file=port-0-hg.pid \
216 > --pid-file=port-0-hg.pid \
217 > --errorlog=port-0-errors.log
217 > --errorlog=port-0-errors.log
218 $ cat port-0-hg.pid >> $DAEMON_PIDS
218 $ cat port-0-hg.pid >> $DAEMON_PIDS
219
219
220 Create clone with tree manifests enabled
220 Create clone with tree manifests enabled
221
221
222 $ hg clone --config experimental.treemanifest=1 \
222 $ hg clone --config experimental.treemanifest=1 \
223 > http://localhost:$HGPORT repo-mixed -r 1
223 > http://localhost:$HGPORT repo-mixed -r 1
224 adding changesets
224 adding changesets
225 adding manifests
225 adding manifests
226 adding file changes
226 adding file changes
227 added 2 changesets with 14 changes to 11 files
227 added 2 changesets with 14 changes to 11 files
228 new changesets 5b02a3e8db7e:581ef6037d8b
228 new changesets 5b02a3e8db7e:581ef6037d8b
229 updating to branch default
229 updating to branch default
230 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
230 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
231 $ cat port-0-errors.log
231 $ cat port-0-errors.log
232 $ cd repo-mixed
232 $ cd repo-mixed
233 $ test -d .hg/store/meta
233 $ test -d .hg/store/meta
234 [1]
234 [1]
235 $ hg debugrequires | grep treemanifest
235 $ hg debugrequires | grep treemanifest
236 treemanifest
236 treemanifest
237
237
238 Should be possible to push updates from flat to tree manifest repo
238 Should be possible to push updates from flat to tree manifest repo
239
239
240 $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed
240 $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed
241 pushing to ssh://user@dummy/repo-mixed
241 pushing to ssh://user@dummy/repo-mixed
242 searching for changes
242 searching for changes
243 remote: adding changesets
243 remote: adding changesets
244 remote: adding manifests
244 remote: adding manifests
245 remote: adding file changes
245 remote: adding file changes
246 remote: added 2 changesets with 3 changes to 3 files
246 remote: added 2 changesets with 3 changes to 3 files
247
247
248 Commit should store revlog per directory
248 Commit should store revlog per directory
249
249
250 $ hg co 1
250 $ hg co 1
251 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
251 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
252 $ echo 3 > a
252 $ echo 3 > a
253 $ echo 3 > dir1/a
253 $ echo 3 > dir1/a
254 $ echo 3 > dir1/dir1/a
254 $ echo 3 > dir1/dir1/a
255 $ hg ci -m 'first tree'
255 $ hg ci -m 'first tree'
256 created new head
256 created new head
257 $ find .hg/store/meta | sort
257 $ find .hg/store/meta | sort
258 .hg/store/meta
258 .hg/store/meta
259 .hg/store/meta/dir1
259 .hg/store/meta/dir1
260 .hg/store/meta/dir1/00manifest.i
260 .hg/store/meta/dir1/00manifest.i
261 .hg/store/meta/dir1/dir1
261 .hg/store/meta/dir1/dir1
262 .hg/store/meta/dir1/dir1/00manifest.i
262 .hg/store/meta/dir1/dir1/00manifest.i
263 .hg/store/meta/dir1/dir2
263 .hg/store/meta/dir1/dir2
264 .hg/store/meta/dir1/dir2/00manifest.i
264 .hg/store/meta/dir1/dir2/00manifest.i
265 .hg/store/meta/dir2
265 .hg/store/meta/dir2
266 .hg/store/meta/dir2/00manifest.i
266 .hg/store/meta/dir2/00manifest.i
267
267
268 Merge of two trees
268 Merge of two trees
269
269
270 $ hg co 2
270 $ hg co 2
271 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
271 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
272 $ hg merge 1
272 $ hg merge 1
273 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 (branch merge, don't forget to commit)
274 (branch merge, don't forget to commit)
275 $ hg ci -m 'merge of flat manifests to new tree manifest'
275 $ hg ci -m 'merge of flat manifests to new tree manifest'
276 created new head
276 created new head
277 $ hg diff -r 3
277 $ hg diff -r 3
278
278
279 Parent of tree root manifest should be flat manifest, and two for merge
279 Parent of tree root manifest should be flat manifest, and two for merge
280
280
281 $ hg debugindex -m
281 $ hg debugindex -m
282 rev linkrev nodeid p1-nodeid p2-nodeid
282 rev linkrev nodeid p1-nodeid p2-nodeid
283 0 0 40536115ed9e 000000000000 000000000000
283 0 0 40536115ed9e 000000000000 000000000000
284 1 1 f3376063c255 40536115ed9e 000000000000
284 1 1 f3376063c255 40536115ed9e 000000000000
285 2 2 5d9b9da231a2 40536115ed9e 000000000000
285 2 2 5d9b9da231a2 40536115ed9e 000000000000
286 3 3 d17d663cbd8a 5d9b9da231a2 f3376063c255
286 3 3 d17d663cbd8a 5d9b9da231a2 f3376063c255
287 4 4 51e32a8c60ee f3376063c255 000000000000
287 4 4 51e32a8c60ee f3376063c255 000000000000
288 5 5 cc5baa78b230 5d9b9da231a2 f3376063c255
288 5 5 cc5baa78b230 5d9b9da231a2 f3376063c255
289
289
290
290
291 Status across flat/tree boundary should work
291 Status across flat/tree boundary should work
292
292
293 $ hg status --rev '.^' --rev .
293 $ hg status --rev '.^' --rev .
294 M a
294 M a
295 M dir1/a
295 M dir1/a
296 M dir1/dir1/a
296 M dir1/dir1/a
297
297
298
298
299 Turning off treemanifest config has no effect
299 Turning off treemanifest config has no effect
300
300
301 $ hg debugindex --dir dir1
301 $ hg debugindex --dir dir1
302 rev linkrev nodeid p1-nodeid p2-nodeid
302 rev linkrev nodeid p1-nodeid p2-nodeid
303 0 4 064927a0648a 000000000000 000000000000
303 0 4 064927a0648a 000000000000 000000000000
304 1 5 25ecb8cb8618 000000000000 000000000000
304 1 5 25ecb8cb8618 000000000000 000000000000
305 $ echo 2 > dir1/a
305 $ echo 2 > dir1/a
306 $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a'
306 $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a'
307 $ hg debugindex --dir dir1
307 $ hg debugindex --dir dir1
308 rev linkrev nodeid p1-nodeid p2-nodeid
308 rev linkrev nodeid p1-nodeid p2-nodeid
309 0 4 064927a0648a 000000000000 000000000000
309 0 4 064927a0648a 000000000000 000000000000
310 1 5 25ecb8cb8618 000000000000 000000000000
310 1 5 25ecb8cb8618 000000000000 000000000000
311 2 6 5b16163a30c6 25ecb8cb8618 000000000000
311 2 6 5b16163a30c6 25ecb8cb8618 000000000000
312
312
313 Stripping and recovering changes should work
313 Stripping and recovering changes should work
314
314
315 $ hg st --change tip
315 $ hg st --change tip
316 M dir1/a
316 M dir1/a
317 $ hg --config extensions.strip= strip tip
317 $ hg --config extensions.strip= strip tip
318 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
318 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
319 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg
319 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg
320 $ hg debugindex --dir dir1
320 $ hg debugindex --dir dir1
321 rev linkrev nodeid p1-nodeid p2-nodeid
321 rev linkrev nodeid p1-nodeid p2-nodeid
322 0 4 064927a0648a 000000000000 000000000000
322 0 4 064927a0648a 000000000000 000000000000
323 1 5 25ecb8cb8618 000000000000 000000000000
323 1 5 25ecb8cb8618 000000000000 000000000000
324
324
325 #if repobundlerepo
325 #if repobundlerepo
326 $ hg incoming .hg/strip-backup/*
326 $ hg incoming .hg/strip-backup/*
327 comparing with .hg/strip-backup/*-backup.hg (glob)
327 comparing with .hg/strip-backup/*-backup.hg (glob)
328 searching for changes
328 searching for changes
329 changeset: 6:51cfd7b1e13b
329 changeset: 6:51cfd7b1e13b
330 tag: tip
330 tag: tip
331 user: test
331 user: test
332 date: Thu Jan 01 00:00:00 1970 +0000
332 date: Thu Jan 01 00:00:00 1970 +0000
333 summary: modify dir1/a
333 summary: modify dir1/a
334
334
335 #endif
335 #endif
336
336
337 $ hg unbundle .hg/strip-backup/*
337 $ hg unbundle .hg/strip-backup/*
338 adding changesets
338 adding changesets
339 adding manifests
339 adding manifests
340 adding file changes
340 adding file changes
341 added 1 changesets with 1 changes to 1 files
341 added 1 changesets with 1 changes to 1 files
342 new changesets 51cfd7b1e13b (1 drafts)
342 new changesets 51cfd7b1e13b (1 drafts)
343 (run 'hg update' to get a working copy)
343 (run 'hg update' to get a working copy)
344 $ hg --config extensions.strip= strip tip
344 $ hg --config extensions.strip= strip tip
345 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/*-backup.hg (glob)
345 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/*-backup.hg (glob)
346 $ hg unbundle -q .hg/strip-backup/*
346 $ hg unbundle -q .hg/strip-backup/*
347 $ hg debugindex --dir dir1
347 $ hg debugindex --dir dir1
348 rev linkrev nodeid p1-nodeid p2-nodeid
348 rev linkrev nodeid p1-nodeid p2-nodeid
349 0 4 064927a0648a 000000000000 000000000000
349 0 4 064927a0648a 000000000000 000000000000
350 1 5 25ecb8cb8618 000000000000 000000000000
350 1 5 25ecb8cb8618 000000000000 000000000000
351 2 6 5b16163a30c6 25ecb8cb8618 000000000000
351 2 6 5b16163a30c6 25ecb8cb8618 000000000000
352 $ hg st --change tip
352 $ hg st --change tip
353 M dir1/a
353 M dir1/a
354
354
355 Shelving and unshelving should work
355 Shelving and unshelving should work
356
356
357 $ echo foo >> dir1/a
357 $ echo foo >> dir1/a
358 $ hg shelve
358 $ hg shelve
359 shelved as default
359 shelved as default
360 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
360 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
361 $ hg unshelve
361 $ hg unshelve
362 unshelving change 'default'
362 unshelving change 'default'
363 $ hg diff --nodates
363 $ hg diff --nodates
364 diff -r 708a273da119 dir1/a
364 diff -r 708a273da119 dir1/a
365 --- a/dir1/a
365 --- a/dir1/a
366 +++ b/dir1/a
366 +++ b/dir1/a
367 @@ -1,1 +1,2 @@
367 @@ -1,1 +1,2 @@
368 1
368 1
369 +foo
369 +foo
370
370
371 Pushing from treemanifest repo to an empty repo makes that a treemanifest repo
371 Pushing from treemanifest repo to an empty repo makes that a treemanifest repo
372
372
373 $ cd ..
373 $ cd ..
374 $ hg init empty-repo
374 $ hg init empty-repo
375 $ cat << EOF >> empty-repo/.hg/hgrc
375 $ cat << EOF >> empty-repo/.hg/hgrc
376 > [experimental]
376 > [experimental]
377 > changegroup3=yes
377 > changegroup3=yes
378 > EOF
378 > EOF
379 $ hg debugrequires -R empty-repo | grep treemanifest
379 $ hg debugrequires -R empty-repo | grep treemanifest
380 [1]
380 [1]
381 $ hg push -R repo -r 0 empty-repo
381 $ hg push -R repo -r 0 empty-repo
382 pushing to empty-repo
382 pushing to empty-repo
383 searching for changes
383 searching for changes
384 adding changesets
384 adding changesets
385 adding manifests
385 adding manifests
386 adding file changes
386 adding file changes
387 added 1 changesets with 2 changes to 2 files
387 added 1 changesets with 2 changes to 2 files
388 $ hg debugrequires -R empty-repo | grep treemanifest
388 $ hg debugrequires -R empty-repo | grep treemanifest
389 treemanifest
389 treemanifest
390
390
391 Pushing to an empty repo works
391 Pushing to an empty repo works
392
392
393 $ hg --config experimental.treemanifest=1 init clone
393 $ hg --config experimental.treemanifest=1 init clone
394 $ hg debugrequires -R clone | grep treemanifest
394 $ hg debugrequires -R clone | grep treemanifest
395 treemanifest
395 treemanifest
396 $ hg push -R repo clone
396 $ hg push -R repo clone
397 pushing to clone
397 pushing to clone
398 searching for changes
398 searching for changes
399 adding changesets
399 adding changesets
400 adding manifests
400 adding manifests
401 adding file changes
401 adding file changes
402 added 11 changesets with 15 changes to 10 files (+3 heads)
402 added 11 changesets with 15 changes to 10 files (+3 heads)
403 $ hg debugrequires -R clone | grep treemanifest
403 $ hg debugrequires -R clone | grep treemanifest
404 treemanifest
404 treemanifest
405 $ hg -R clone verify -q
405 $ hg -R clone verify -q
406
406
407 Create deeper repo with tree manifests.
407 Create deeper repo with tree manifests.
408
408
409 $ hg --config experimental.treemanifest=True init deeprepo
409 $ hg --config experimental.treemanifest=True init deeprepo
410 $ cd deeprepo
410 $ cd deeprepo
411
411
412 $ mkdir .A
412 $ mkdir .A
413 $ mkdir b
413 $ mkdir b
414 $ mkdir b/bar
414 $ mkdir b/bar
415 $ mkdir b/bar/orange
415 $ mkdir b/bar/orange
416 $ mkdir b/bar/orange/fly
416 $ mkdir b/bar/orange/fly
417 $ mkdir b/foo
417 $ mkdir b/foo
418 $ mkdir b/foo/apple
418 $ mkdir b/foo/apple
419 $ mkdir b/foo/apple/bees
419 $ mkdir b/foo/apple/bees
420
420
421 $ touch .A/one.txt
421 $ touch .A/one.txt
422 $ touch .A/two.txt
422 $ touch .A/two.txt
423 $ touch b/bar/fruits.txt
423 $ touch b/bar/fruits.txt
424 $ touch b/bar/orange/fly/gnat.py
424 $ touch b/bar/orange/fly/gnat.py
425 $ touch b/bar/orange/fly/housefly.txt
425 $ touch b/bar/orange/fly/housefly.txt
426 $ touch b/foo/apple/bees/flower.py
426 $ touch b/foo/apple/bees/flower.py
427 $ touch c.txt
427 $ touch c.txt
428 $ touch d.py
428 $ touch d.py
429
429
430 $ hg ci -Aqm 'initial'
430 $ hg ci -Aqm 'initial'
431
431
432 $ echo >> .A/one.txt
432 $ echo >> .A/one.txt
433 $ echo >> .A/two.txt
433 $ echo >> .A/two.txt
434 $ echo >> b/bar/fruits.txt
434 $ echo >> b/bar/fruits.txt
435 $ echo >> b/bar/orange/fly/gnat.py
435 $ echo >> b/bar/orange/fly/gnat.py
436 $ echo >> b/bar/orange/fly/housefly.txt
436 $ echo >> b/bar/orange/fly/housefly.txt
437 $ echo >> b/foo/apple/bees/flower.py
437 $ echo >> b/foo/apple/bees/flower.py
438 $ echo >> c.txt
438 $ echo >> c.txt
439 $ echo >> d.py
439 $ echo >> d.py
440 $ hg ci -Aqm 'second'
440 $ hg ci -Aqm 'second'
441
441
442 We'll see that visitdir works by removing some treemanifest revlogs and running
442 We'll see that visitdir works by removing some treemanifest revlogs and running
443 the files command with various parameters.
443 the files command with various parameters.
444
444
445 Test files from the root.
445 Test files from the root.
446
446
447 $ hg files -r .
447 $ hg files -r .
448 .A/one.txt
448 .A/one.txt
449 .A/two.txt
449 .A/two.txt
450 b/bar/fruits.txt
450 b/bar/fruits.txt
451 b/bar/orange/fly/gnat.py
451 b/bar/orange/fly/gnat.py
452 b/bar/orange/fly/housefly.txt
452 b/bar/orange/fly/housefly.txt
453 b/foo/apple/bees/flower.py
453 b/foo/apple/bees/flower.py
454 c.txt
454 c.txt
455 d.py
455 d.py
456
456
457 Excludes with a glob should not exclude everything from the glob's root
457 Excludes with a glob should not exclude everything from the glob's root
458
458
459 $ hg files -r . -X 'b/fo?' b
459 $ hg files -r . -X 'b/fo?' b
460 b/bar/fruits.txt
460 b/bar/fruits.txt
461 b/bar/orange/fly/gnat.py
461 b/bar/orange/fly/gnat.py
462 b/bar/orange/fly/housefly.txt
462 b/bar/orange/fly/housefly.txt
463 $ cp -R .hg/store .hg/store-copy
463 $ cp -R .hg/store .hg/store-copy
464
464
465 Test files for a subdirectory.
465 Test files for a subdirectory.
466
466
467 #if reporevlogstore
467 #if reporevlogstore
468 $ rm -r .hg/store/meta/~2e_a
468 $ rm -r .hg/store/meta/~2e_a
469 #endif
469 #endif
470 #if reposimplestore
470 #if reposimplestore
471 $ rm -r .hg/store/meta/._a
471 $ rm -r .hg/store/meta/._a
472 #endif
472 #endif
473 $ hg files -r . b
473 $ hg files -r . b
474 b/bar/fruits.txt
474 b/bar/fruits.txt
475 b/bar/orange/fly/gnat.py
475 b/bar/orange/fly/gnat.py
476 b/bar/orange/fly/housefly.txt
476 b/bar/orange/fly/housefly.txt
477 b/foo/apple/bees/flower.py
477 b/foo/apple/bees/flower.py
478 $ hg diff -r '.^' -r . --stat b
478 $ hg diff -r '.^' -r . --stat b
479 b/bar/fruits.txt | 1 +
479 b/bar/fruits.txt | 1 +
480 b/bar/orange/fly/gnat.py | 1 +
480 b/bar/orange/fly/gnat.py | 1 +
481 b/bar/orange/fly/housefly.txt | 1 +
481 b/bar/orange/fly/housefly.txt | 1 +
482 b/foo/apple/bees/flower.py | 1 +
482 b/foo/apple/bees/flower.py | 1 +
483 4 files changed, 4 insertions(+), 0 deletions(-)
483 4 files changed, 4 insertions(+), 0 deletions(-)
484 $ cp -R .hg/store-copy/. .hg/store
484 $ cp -R .hg/store-copy/. .hg/store
485
485
486 Test files with just includes and excludes.
486 Test files with just includes and excludes.
487
487
488 #if reporevlogstore
488 #if reporevlogstore
489 $ rm -r .hg/store/meta/~2e_a
489 $ rm -r .hg/store/meta/~2e_a
490 #endif
490 #endif
491 #if reposimplestore
491 #if reposimplestore
492 $ rm -r .hg/store/meta/._a
492 $ rm -r .hg/store/meta/._a
493 #endif
493 #endif
494 $ rm -r .hg/store/meta/b/bar/orange/fly
494 $ rm -r .hg/store/meta/b/bar/orange/fly
495 $ rm -r .hg/store/meta/b/foo/apple/bees
495 $ rm -r .hg/store/meta/b/foo/apple/bees
496 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
496 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
497 b/bar/fruits.txt
497 b/bar/fruits.txt
498 $ hg diff -r '.^' -r . --stat -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
498 $ hg diff -r '.^' -r . --stat -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
499 b/bar/fruits.txt | 1 +
499 b/bar/fruits.txt | 1 +
500 1 files changed, 1 insertions(+), 0 deletions(-)
500 1 files changed, 1 insertions(+), 0 deletions(-)
501 $ cp -R .hg/store-copy/. .hg/store
501 $ cp -R .hg/store-copy/. .hg/store
502
502
503 Test files for a subdirectory, excluding a directory within it.
503 Test files for a subdirectory, excluding a directory within it.
504
504
505 #if reporevlogstore
505 #if reporevlogstore
506 $ rm -r .hg/store/meta/~2e_a
506 $ rm -r .hg/store/meta/~2e_a
507 #endif
507 #endif
508 #if reposimplestore
508 #if reposimplestore
509 $ rm -r .hg/store/meta/._a
509 $ rm -r .hg/store/meta/._a
510 #endif
510 #endif
511 $ rm -r .hg/store/meta/b/foo
511 $ rm -r .hg/store/meta/b/foo
512 $ hg files -r . -X path:b/foo b
512 $ hg files -r . -X path:b/foo b
513 b/bar/fruits.txt
513 b/bar/fruits.txt
514 b/bar/orange/fly/gnat.py
514 b/bar/orange/fly/gnat.py
515 b/bar/orange/fly/housefly.txt
515 b/bar/orange/fly/housefly.txt
516 $ hg diff -r '.^' -r . --stat -X path:b/foo b
516 $ hg diff -r '.^' -r . --stat -X path:b/foo b
517 b/bar/fruits.txt | 1 +
517 b/bar/fruits.txt | 1 +
518 b/bar/orange/fly/gnat.py | 1 +
518 b/bar/orange/fly/gnat.py | 1 +
519 b/bar/orange/fly/housefly.txt | 1 +
519 b/bar/orange/fly/housefly.txt | 1 +
520 3 files changed, 3 insertions(+), 0 deletions(-)
520 3 files changed, 3 insertions(+), 0 deletions(-)
521 $ cp -R .hg/store-copy/. .hg/store
521 $ cp -R .hg/store-copy/. .hg/store
522
522
523 Test files for a sub directory, including only a directory within it, and
523 Test files for a sub directory, including only a directory within it, and
524 including an unrelated directory.
524 including an unrelated directory.
525
525
526 #if reporevlogstore
526 #if reporevlogstore
527 $ rm -r .hg/store/meta/~2e_a
527 $ rm -r .hg/store/meta/~2e_a
528 #endif
528 #endif
529 #if reposimplestore
529 #if reposimplestore
530 $ rm -r .hg/store/meta/._a
530 $ rm -r .hg/store/meta/._a
531 #endif
531 #endif
532 $ rm -r .hg/store/meta/b/foo
532 $ rm -r .hg/store/meta/b/foo
533 $ hg files -r . -I path:b/bar/orange -I path:a b
533 $ hg files -r . -I path:b/bar/orange -I path:a b
534 b/bar/orange/fly/gnat.py
534 b/bar/orange/fly/gnat.py
535 b/bar/orange/fly/housefly.txt
535 b/bar/orange/fly/housefly.txt
536 $ hg diff -r '.^' -r . --stat -I path:b/bar/orange -I path:a b
536 $ hg diff -r '.^' -r . --stat -I path:b/bar/orange -I path:a b
537 b/bar/orange/fly/gnat.py | 1 +
537 b/bar/orange/fly/gnat.py | 1 +
538 b/bar/orange/fly/housefly.txt | 1 +
538 b/bar/orange/fly/housefly.txt | 1 +
539 2 files changed, 2 insertions(+), 0 deletions(-)
539 2 files changed, 2 insertions(+), 0 deletions(-)
540 $ cp -R .hg/store-copy/. .hg/store
540 $ cp -R .hg/store-copy/. .hg/store
541
541
542 Test files for a pattern, including a directory, and excluding a directory
542 Test files for a pattern, including a directory, and excluding a directory
543 within that.
543 within that.
544
544
545 #if reporevlogstore
545 #if reporevlogstore
546 $ rm -r .hg/store/meta/~2e_a
546 $ rm -r .hg/store/meta/~2e_a
547 #endif
547 #endif
548 #if reposimplestore
548 #if reposimplestore
549 $ rm -r .hg/store/meta/._a
549 $ rm -r .hg/store/meta/._a
550 #endif
550 #endif
551 $ rm -r .hg/store/meta/b/foo
551 $ rm -r .hg/store/meta/b/foo
552 $ rm -r .hg/store/meta/b/bar/orange
552 $ rm -r .hg/store/meta/b/bar/orange
553 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
553 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
554 b/bar/fruits.txt
554 b/bar/fruits.txt
555 $ hg diff -r '.^' -r . --stat glob:**.txt -I path:b/bar -X path:b/bar/orange
555 $ hg diff -r '.^' -r . --stat glob:**.txt -I path:b/bar -X path:b/bar/orange
556 b/bar/fruits.txt | 1 +
556 b/bar/fruits.txt | 1 +
557 1 files changed, 1 insertions(+), 0 deletions(-)
557 1 files changed, 1 insertions(+), 0 deletions(-)
558 $ cp -R .hg/store-copy/. .hg/store
558 $ cp -R .hg/store-copy/. .hg/store
559
559
560 Add some more changes to the deep repo
560 Add some more changes to the deep repo
561 $ echo narf >> b/bar/fruits.txt
561 $ echo narf >> b/bar/fruits.txt
562 $ hg ci -m narf
562 $ hg ci -m narf
563 $ echo troz >> b/bar/orange/fly/gnat.py
563 $ echo troz >> b/bar/orange/fly/gnat.py
564 $ hg ci -m troz
564 $ hg ci -m troz
565
565
566 Verify works
566 Verify works
567 $ hg verify -q
567 $ hg verify -q
568
568
569 #if repofncache
569 #if repofncache
570 Dirlogs are included in fncache
570 Dirlogs are included in fncache
571 $ grep meta/.A/00manifest.i .hg/store/fncache
571 $ grep meta/.A/00manifest.i .hg/store/fncache
572 meta/.A/00manifest.i
572 meta/.A/00manifest.i
573
573
574 Rebuilt fncache includes dirlogs
574 Rebuilt fncache includes dirlogs
575 $ rm .hg/store/fncache
575 $ rm .hg/store/fncache
576 $ hg debugrebuildfncache
576 $ hg debugrebuildfncache
577 adding data/.A/one.txt.i
577 adding data/.A/one.txt.i
578 adding data/.A/two.txt.i
578 adding data/.A/two.txt.i
579 adding data/b/bar/fruits.txt.i
579 adding data/b/bar/fruits.txt.i
580 adding data/b/bar/orange/fly/gnat.py.i
580 adding data/b/bar/orange/fly/gnat.py.i
581 adding data/b/bar/orange/fly/housefly.txt.i
581 adding data/b/bar/orange/fly/housefly.txt.i
582 adding data/b/foo/apple/bees/flower.py.i
582 adding data/b/foo/apple/bees/flower.py.i
583 adding data/c.txt.i
583 adding data/c.txt.i
584 adding data/d.py.i
584 adding data/d.py.i
585 adding meta/.A/00manifest.i
585 adding meta/.A/00manifest.i
586 adding meta/b/00manifest.i
586 adding meta/b/00manifest.i
587 adding meta/b/bar/00manifest.i
587 adding meta/b/bar/00manifest.i
588 adding meta/b/bar/orange/00manifest.i
588 adding meta/b/bar/orange/00manifest.i
589 adding meta/b/bar/orange/fly/00manifest.i
589 adding meta/b/bar/orange/fly/00manifest.i
590 adding meta/b/foo/00manifest.i
590 adding meta/b/foo/00manifest.i
591 adding meta/b/foo/apple/00manifest.i
591 adding meta/b/foo/apple/00manifest.i
592 adding meta/b/foo/apple/bees/00manifest.i
592 adding meta/b/foo/apple/bees/00manifest.i
593 16 items added, 0 removed from fncache
593 16 items added, 0 removed from fncache
594 #endif
594 #endif
595
595
596 Finish first server
596 Finish first server
597 $ killdaemons.py
597 $ killdaemons.py
598
598
599 Back up the recently added revlogs
599 Back up the recently added revlogs
600 $ cp -R .hg/store .hg/store-newcopy
600 $ cp -R .hg/store .hg/store-newcopy
601
601
602 Verify reports missing dirlog
602 Verify reports missing dirlog
603 $ rm .hg/store/meta/b/00manifest.*
603 $ rm .hg/store/meta/b/00manifest.*
604 $ hg verify
604 $ hg verify
605 checking changesets
605 checking changesets
606 checking manifests
606 checking manifests
607 checking directory manifests
607 checking directory manifests
608 0: empty or missing b/
608 0: empty or missing b/
609 b/@0: parent-directory manifest refers to unknown revision 67688a370455
609 b/@0: parent-directory manifest refers to unknown revision 67688a370455
610 b/@1: parent-directory manifest refers to unknown revision f065da70369e
610 b/@1: parent-directory manifest refers to unknown revision f065da70369e
611 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
611 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
612 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
612 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
613 warning: orphan data file 'meta/b/bar/00manifest.i' (reporevlogstore !)
613 warning: orphan data file 'meta/b/bar/00manifest.i' (reporevlogstore !)
614 warning: orphan data file 'meta/b/bar/orange/00manifest.i' (reporevlogstore !)
614 warning: orphan data file 'meta/b/bar/orange/00manifest.i' (reporevlogstore !)
615 warning: orphan data file 'meta/b/bar/orange/fly/00manifest.i' (reporevlogstore !)
615 warning: orphan data file 'meta/b/bar/orange/fly/00manifest.i' (reporevlogstore !)
616 warning: orphan data file 'meta/b/foo/00manifest.i' (reporevlogstore !)
616 warning: orphan data file 'meta/b/foo/00manifest.i' (reporevlogstore !)
617 warning: orphan data file 'meta/b/foo/apple/00manifest.i' (reporevlogstore !)
617 warning: orphan data file 'meta/b/foo/apple/00manifest.i' (reporevlogstore !)
618 warning: orphan data file 'meta/b/foo/apple/bees/00manifest.i' (reporevlogstore !)
618 warning: orphan data file 'meta/b/foo/apple/bees/00manifest.i' (reporevlogstore !)
619 crosschecking files in changesets and manifests
619 crosschecking files in changesets and manifests
620 b/bar/fruits.txt@0: in changeset but not in manifest
620 b/bar/fruits.txt@0: in changeset but not in manifest
621 b/bar/orange/fly/gnat.py@0: in changeset but not in manifest
621 b/bar/orange/fly/gnat.py@0: in changeset but not in manifest
622 b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest
622 b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest
623 b/foo/apple/bees/flower.py@0: in changeset but not in manifest
623 b/foo/apple/bees/flower.py@0: in changeset but not in manifest
624 checking files
624 checking files
625 not checking dirstate because of previous errors
625 not checking dirstate because of previous errors
626 checked 4 changesets with 18 changes to 8 files
626 checked 4 changesets with 18 changes to 8 files
627 6 warnings encountered! (reporevlogstore !)
627 6 warnings encountered! (reporevlogstore !)
628 9 integrity errors encountered!
628 9 integrity errors encountered!
629 (first damaged changeset appears to be 0)
629 (first damaged changeset appears to be 0)
630 [1]
630 [1]
631 $ cp -R .hg/store-newcopy/. .hg/store
631 $ cp -R .hg/store-newcopy/. .hg/store
632
632
633 Verify reports missing dirlog entry
633 Verify reports missing dirlog entry
634 $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
634 $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
635 $ hg verify
635 $ hg verify
636 checking changesets
636 checking changesets
637 checking manifests
637 checking manifests
638 checking directory manifests
638 checking directory manifests
639 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
639 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
640 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
640 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
641 b/bar/@?: rev 2 points to unexpected changeset 2
641 b/bar/@?: rev 2 points to unexpected changeset 2
642 b/bar/@?: 44d7e1146e0d not in parent-directory manifest
642 b/bar/@?: 44d7e1146e0d not in parent-directory manifest
643 b/bar/@?: rev 3 points to unexpected changeset 3
643 b/bar/@?: rev 3 points to unexpected changeset 3
644 b/bar/@?: 70b10c6b17b7 not in parent-directory manifest
644 b/bar/@?: 70b10c6b17b7 not in parent-directory manifest
645 b/bar/orange/@?: rev 2 points to unexpected changeset 3
645 b/bar/orange/@?: rev 2 points to unexpected changeset 3
646 (expected None)
646 (expected None)
647 b/bar/orange/fly/@?: rev 2 points to unexpected changeset 3
647 b/bar/orange/fly/@?: rev 2 points to unexpected changeset 3
648 (expected None)
648 (expected None)
649 crosschecking files in changesets and manifests
649 crosschecking files in changesets and manifests
650 checking files
650 checking files
651 not checking dirstate because of previous errors
651 not checking dirstate because of previous errors
652 checked 4 changesets with 18 changes to 8 files
652 checked 4 changesets with 18 changes to 8 files
653 2 warnings encountered!
653 2 warnings encountered!
654 8 integrity errors encountered!
654 8 integrity errors encountered!
655 (first damaged changeset appears to be 2)
655 (first damaged changeset appears to be 2)
656 [1]
656 [1]
657 $ cp -R .hg/store-newcopy/. .hg/store
657 $ cp -R .hg/store-newcopy/. .hg/store
658
658
659 Test cloning a treemanifest repo over http.
659 Test cloning a treemanifest repo over http.
660 $ cd ..
660 $ cd ..
661 $ hg -R deeprepo serve -p $HGPORT -d \
661 $ hg -R deeprepo serve -p $HGPORT -d \
662 > --pid-file=port-0-hg.pid \
662 > --pid-file=port-0-hg.pid \
663 > --errorlog=port-0-errors.log
663 > --errorlog=port-0-errors.log
664 $ cat port-0-hg.pid >> $DAEMON_PIDS
664 $ cat port-0-hg.pid >> $DAEMON_PIDS
665
665
666 We can clone even with the knob turned off and we'll get a treemanifest repo.
666 We can clone even with the knob turned off and we'll get a treemanifest repo.
667 $ hg clone --config experimental.treemanifest=False \
667 $ hg clone --config experimental.treemanifest=False \
668 > --config experimental.changegroup3=True \
668 > --config experimental.changegroup3=True \
669 > http://localhost:$HGPORT deepclone
669 > http://localhost:$HGPORT deepclone
670 requesting all changes
670 requesting all changes
671 adding changesets
671 adding changesets
672 adding manifests
672 adding manifests
673 adding file changes
673 adding file changes
674 added 4 changesets with 18 changes to 8 files
674 added 4 changesets with 18 changes to 8 files
675 new changesets 775704be6f52:523e5c631710
675 new changesets 775704be6f52:523e5c631710
676 updating to branch default
676 updating to branch default
677 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
677 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
678 No server errors.
678 No server errors.
679 $ cat port-0-errors.log
679 $ cat port-0-errors.log
680
680
681 requires got updated to include treemanifest
681 requires got updated to include treemanifest
682 $ hg debugrequires -R deepclone | grep treemanifest
682 $ hg debugrequires -R deepclone | grep treemanifest
683 treemanifest
683 treemanifest
684 Tree manifest revlogs exist.
684 Tree manifest revlogs exist.
685 $ find deepclone/.hg/store/meta | sort
685 $ find deepclone/.hg/store/meta | sort
686 deepclone/.hg/store/meta
686 deepclone/.hg/store/meta
687 deepclone/.hg/store/meta/._a (reposimplestore !)
687 deepclone/.hg/store/meta/._a (reposimplestore !)
688 deepclone/.hg/store/meta/._a/00manifest.i (reposimplestore !)
688 deepclone/.hg/store/meta/._a/00manifest.i (reposimplestore !)
689 deepclone/.hg/store/meta/b
689 deepclone/.hg/store/meta/b
690 deepclone/.hg/store/meta/b/00manifest.i
690 deepclone/.hg/store/meta/b/00manifest.i
691 deepclone/.hg/store/meta/b/bar
691 deepclone/.hg/store/meta/b/bar
692 deepclone/.hg/store/meta/b/bar/00manifest.i
692 deepclone/.hg/store/meta/b/bar/00manifest.i
693 deepclone/.hg/store/meta/b/bar/orange
693 deepclone/.hg/store/meta/b/bar/orange
694 deepclone/.hg/store/meta/b/bar/orange/00manifest.i
694 deepclone/.hg/store/meta/b/bar/orange/00manifest.i
695 deepclone/.hg/store/meta/b/bar/orange/fly
695 deepclone/.hg/store/meta/b/bar/orange/fly
696 deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i
696 deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i
697 deepclone/.hg/store/meta/b/foo
697 deepclone/.hg/store/meta/b/foo
698 deepclone/.hg/store/meta/b/foo/00manifest.i
698 deepclone/.hg/store/meta/b/foo/00manifest.i
699 deepclone/.hg/store/meta/b/foo/apple
699 deepclone/.hg/store/meta/b/foo/apple
700 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
700 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
701 deepclone/.hg/store/meta/b/foo/apple/bees
701 deepclone/.hg/store/meta/b/foo/apple/bees
702 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
702 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
703 deepclone/.hg/store/meta/~2e_a (reporevlogstore !)
703 deepclone/.hg/store/meta/~2e_a (reporevlogstore !)
704 deepclone/.hg/store/meta/~2e_a/00manifest.i (reporevlogstore !)
704 deepclone/.hg/store/meta/~2e_a/00manifest.i (reporevlogstore !)
705 Verify passes.
705 Verify passes.
706 $ cd deepclone
706 $ cd deepclone
707 $ hg verify -q
707 $ hg verify -q
708 $ cd ..
708 $ cd ..
709
709
710 #if reporevlogstore
710 #if reporevlogstore
711 Create clones using old repo formats to use in later tests
711 Create clones using old repo formats to use in later tests
712 $ hg clone --config format.usestore=False \
712 $ hg clone --config format.usestore=False \
713 > --config experimental.changegroup3=True \
713 > --config experimental.changegroup3=True \
714 > http://localhost:$HGPORT deeprepo-basicstore
714 > http://localhost:$HGPORT deeprepo-basicstore
715 requesting all changes
715 requesting all changes
716 adding changesets
716 adding changesets
717 adding manifests
717 adding manifests
718 adding file changes
718 adding file changes
719 added 4 changesets with 18 changes to 8 files
719 added 4 changesets with 18 changes to 8 files
720 new changesets 775704be6f52:523e5c631710
720 new changesets 775704be6f52:523e5c631710
721 updating to branch default
721 updating to branch default
722 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
722 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
723 $ hg -R deeprepo-basicstore debugrequires | grep store
723 $ hg -R deeprepo-basicstore debugrequires | grep store
724 [1]
724 [1]
725 $ hg -R deeprepo-basicstore serve -p $HGPORT1 -d \
725 $ hg -R deeprepo-basicstore serve -p $HGPORT1 -d \
726 > --pid-file=port-1-hg.pid \
726 > --pid-file=port-1-hg.pid \
727 > --errorlog=port-1-errors.log
727 > --errorlog=port-1-errors.log
728 $ cat port-1-hg.pid >> $DAEMON_PIDS
728 $ cat port-1-hg.pid >> $DAEMON_PIDS
729
729
730 $ hg clone --config format.usefncache=False \
730 $ hg clone --config format.usefncache=False \
731 > --config experimental.changegroup3=True \
731 > --config experimental.changegroup3=True \
732 > http://localhost:$HGPORT deeprepo-encodedstore
732 > http://localhost:$HGPORT deeprepo-encodedstore
733 requesting all changes
733 requesting all changes
734 adding changesets
734 adding changesets
735 adding manifests
735 adding manifests
736 adding file changes
736 adding file changes
737 added 4 changesets with 18 changes to 8 files
737 added 4 changesets with 18 changes to 8 files
738 new changesets 775704be6f52:523e5c631710
738 new changesets 775704be6f52:523e5c631710
739 updating to branch default
739 updating to branch default
740 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
740 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
741 $ hg -R deeprepo-encodedstore debugrequires | grep fncache
741 $ hg -R deeprepo-encodedstore debugrequires | grep fncache
742 [1]
742 [1]
743 $ hg -R deeprepo-encodedstore serve -p $HGPORT2 -d \
743 $ hg -R deeprepo-encodedstore serve -p $HGPORT2 -d \
744 > --pid-file=port-2-hg.pid \
744 > --pid-file=port-2-hg.pid \
745 > --errorlog=port-2-errors.log
745 > --errorlog=port-2-errors.log
746 $ cat port-2-hg.pid >> $DAEMON_PIDS
746 $ cat port-2-hg.pid >> $DAEMON_PIDS
747
747
748 Local clone with basicstore
748 Local clone with basicstore
749 $ hg clone -U deeprepo-basicstore local-clone-basicstore
749 $ hg clone -U deeprepo-basicstore local-clone-basicstore
750 $ hg -R local-clone-basicstore verify -q
750 $ hg -R local-clone-basicstore verify -q
751
751
752 Local clone with encodedstore
752 Local clone with encodedstore
753 $ hg clone -U deeprepo-encodedstore local-clone-encodedstore
753 $ hg clone -U deeprepo-encodedstore local-clone-encodedstore
754 $ hg -R local-clone-encodedstore verify -q
754 $ hg -R local-clone-encodedstore verify -q
755
755
756 Local clone with fncachestore
756 Local clone with fncachestore
757 $ hg clone -U deeprepo local-clone-fncachestore
757 $ hg clone -U deeprepo local-clone-fncachestore
758 $ hg -R local-clone-fncachestore verify -q
758 $ hg -R local-clone-fncachestore verify -q
759
759
760 Stream clone with basicstore
760 Stream clone with basicstore
761 $ hg clone --config experimental.changegroup3=True --stream -U \
761 $ hg clone --config experimental.changegroup3=True --stream -U \
762 > http://localhost:$HGPORT1 stream-clone-basicstore
762 > http://localhost:$HGPORT1 stream-clone-basicstore
763 streaming all changes
763 streaming all changes
764 28 files to transfer, * of data (glob)
764 29 files to transfer, * of data (glob) (no-rust !)
765 31 files to transfer, * of data (glob) (rust !)
765 transferred * in * seconds (*) (glob)
766 transferred * in * seconds (*) (glob)
766 $ hg -R stream-clone-basicstore verify -q
767 $ hg -R stream-clone-basicstore verify -q
767 $ cat port-1-errors.log
768 $ cat port-1-errors.log
768
769
769 Stream clone with encodedstore
770 Stream clone with encodedstore
770 $ hg clone --config experimental.changegroup3=True --stream -U \
771 $ hg clone --config experimental.changegroup3=True --stream -U \
771 > http://localhost:$HGPORT2 stream-clone-encodedstore
772 > http://localhost:$HGPORT2 stream-clone-encodedstore
772 streaming all changes
773 streaming all changes
773 28 files to transfer, * of data (glob)
774 29 files to transfer, * of data (glob) (no-rust !)
775 31 files to transfer, * of data (glob) (rust !)
774 transferred * in * seconds (*) (glob)
776 transferred * in * seconds (*) (glob)
775 $ hg -R stream-clone-encodedstore verify -q
777 $ hg -R stream-clone-encodedstore verify -q
776 $ cat port-2-errors.log
778 $ cat port-2-errors.log
777
779
778 Stream clone with fncachestore
780 Stream clone with fncachestore
779 $ hg clone --config experimental.changegroup3=True --stream -U \
781 $ hg clone --config experimental.changegroup3=True --stream -U \
780 > http://localhost:$HGPORT stream-clone-fncachestore
782 > http://localhost:$HGPORT stream-clone-fncachestore
781 streaming all changes
783 streaming all changes
782 22 files to transfer, * of data (glob)
784 23 files to transfer, * of data (glob) (no-rust !)
785 25 files to transfer, * of data (glob) (rust !)
783 transferred * in * seconds (*) (glob)
786 transferred * in * seconds (*) (glob)
784 $ hg -R stream-clone-fncachestore verify -q
787 $ hg -R stream-clone-fncachestore verify -q
785 $ cat port-0-errors.log
788 $ cat port-0-errors.log
786
789
787 Packed bundle
790 Packed bundle
788 $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg
791 $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg
789 writing 5330 bytes for 18 files (no-zstd !)
792 writing 5330 bytes for 19 files (no-zstd !)
790 writing 5400 bytes for 18 files (zstd !)
793 writing 5400 bytes for 19 files (zstd no-rust !)
794 writing 5654 bytes for 21 files (zstd rust !)
791 bundle requirements:.* treemanifest(,.*)? (re)
795 bundle requirements:.* treemanifest(,.*)? (re)
792 $ hg debugbundle --spec repo-packed.hg
796 $ hg debugbundle --spec repo-packed.hg
793 none-packed1;requirements%3D(.*%2C)?treemanifest(%2C.*)? (re)
797 none-packed1;requirements%3D(.*%2C)?treemanifest(%2C.*)? (re)
794
798
795 #endif
799 #endif
796
800
797 Bundle with changegroup2 is not supported
801 Bundle with changegroup2 is not supported
798
802
799 $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle
803 $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle
800 abort: repository does not support bundle version 02
804 abort: repository does not support bundle version 02
801 [255]
805 [255]
802
806
803 Pull does not include changegroup for manifest the client already has from
807 Pull does not include changegroup for manifest the client already has from
804 other branch
808 other branch
805
809
806 $ mkdir grafted-dir-repo
810 $ mkdir grafted-dir-repo
807 $ cd grafted-dir-repo
811 $ cd grafted-dir-repo
808 $ hg --config experimental.treemanifest=1 init
812 $ hg --config experimental.treemanifest=1 init
809 $ mkdir dir
813 $ mkdir dir
810 $ echo a > dir/file
814 $ echo a > dir/file
811 $ echo a > file
815 $ echo a > file
812 $ hg ci -Am initial
816 $ hg ci -Am initial
813 adding dir/file
817 adding dir/file
814 adding file
818 adding file
815 $ echo b > dir/file
819 $ echo b > dir/file
816 $ hg ci -m updated
820 $ hg ci -m updated
817 $ hg co '.^'
821 $ hg co '.^'
818 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
822 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
819 $ hg revert -r tip dir/
823 $ hg revert -r tip dir/
820 reverting dir/file
824 reverting dir/file
821 $ echo b > file # to make sure root manifest is sent
825 $ echo b > file # to make sure root manifest is sent
822 $ hg ci -m grafted
826 $ hg ci -m grafted
823 created new head
827 created new head
824 $ cd ..
828 $ cd ..
825
829
826 $ hg --config experimental.treemanifest=1 clone --pull -r 1 \
830 $ hg --config experimental.treemanifest=1 clone --pull -r 1 \
827 > grafted-dir-repo grafted-dir-repo-clone
831 > grafted-dir-repo grafted-dir-repo-clone
828 adding changesets
832 adding changesets
829 adding manifests
833 adding manifests
830 adding file changes
834 adding file changes
831 added 2 changesets with 3 changes to 2 files
835 added 2 changesets with 3 changes to 2 files
832 new changesets d84f4c419457:09ab742f3b0f
836 new changesets d84f4c419457:09ab742f3b0f
833 updating to branch default
837 updating to branch default
834 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
838 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
835 $ cd grafted-dir-repo-clone
839 $ cd grafted-dir-repo-clone
836 $ hg pull -r 2
840 $ hg pull -r 2
837 pulling from $TESTTMP/grafted-dir-repo
841 pulling from $TESTTMP/grafted-dir-repo
838 searching for changes
842 searching for changes
839 adding changesets
843 adding changesets
840 adding manifests
844 adding manifests
841 adding file changes
845 adding file changes
842 added 1 changesets with 1 changes to 1 files (+1 heads)
846 added 1 changesets with 1 changes to 1 files (+1 heads)
843 new changesets 73699489fb7c
847 new changesets 73699489fb7c
844 (run 'hg heads' to see heads, 'hg merge' to merge)
848 (run 'hg heads' to see heads, 'hg merge' to merge)
845
849
846 Committing a empty commit does not duplicate root treemanifest
850 Committing a empty commit does not duplicate root treemanifest
847 $ echo z >> z
851 $ echo z >> z
848 $ hg commit -Aqm 'pre-empty commit'
852 $ hg commit -Aqm 'pre-empty commit'
849 $ hg rm z
853 $ hg rm z
850 $ hg commit --amend -m 'empty commit'
854 $ hg commit --amend -m 'empty commit'
851 saved backup bundle to $TESTTMP/grafted-dir-repo-clone/.hg/strip-backup/cb99d5717cea-9e3b6b02-amend.hg
855 saved backup bundle to $TESTTMP/grafted-dir-repo-clone/.hg/strip-backup/cb99d5717cea-9e3b6b02-amend.hg
852 $ hg log -r 'tip + tip^' -T '{manifest}\n'
856 $ hg log -r 'tip + tip^' -T '{manifest}\n'
853 1:678d3574b88c
857 1:678d3574b88c
854 1:678d3574b88c
858 1:678d3574b88c
855 $ hg --config extensions.strip= strip -r . -q
859 $ hg --config extensions.strip= strip -r . -q
856
860
857 Testing repository upgrade
861 Testing repository upgrade
858 --------------------------
862 --------------------------
859
863
860 $ for x in 1 2 3 4 5 6 7 8 9; do
864 $ for x in 1 2 3 4 5 6 7 8 9; do
861 > echo $x > file-$x # make sure we have interresting compression
865 > echo $x > file-$x # make sure we have interresting compression
862 > echo $x > dir/foo-$x # make sure we have interresting compression
866 > echo $x > dir/foo-$x # make sure we have interresting compression
863 > hg add file-$x
867 > hg add file-$x
864 > hg add dir/foo-$x
868 > hg add dir/foo-$x
865 > done
869 > done
866 $ hg ci -m 'have some content'
870 $ hg ci -m 'have some content'
867 $ f -s .hg/store/00manifest.*
871 $ f -s .hg/store/00manifest.*
868 .hg/store/00manifest.i: size=798 (no-pure !)
872 .hg/store/00manifest.i: size=798 (no-pure !)
869 .hg/store/00manifest.i: size=784 (pure !)
873 .hg/store/00manifest.i: size=784 (pure !)
870 $ f -s .hg/store/meta/dir/00manifest*
874 $ f -s .hg/store/meta/dir/00manifest*
871 .hg/store/meta/dir/00manifest.i: size=556 (no-pure !)
875 .hg/store/meta/dir/00manifest.i: size=556 (no-pure !)
872 .hg/store/meta/dir/00manifest.i: size=544 (pure !)
876 .hg/store/meta/dir/00manifest.i: size=544 (pure !)
873 $ hg debugupgraderepo --config format.revlog-compression=none --config experimental.treemanifest=yes --run --quiet --no-backup
877 $ hg debugupgraderepo --config format.revlog-compression=none --config experimental.treemanifest=yes --run --quiet --no-backup
874 upgrade will perform the following actions:
878 upgrade will perform the following actions:
875
879
876 requirements
880 requirements
877 preserved: * (glob)
881 preserved: * (glob)
878 removed: revlog-compression-zstd (no-pure !)
882 removed: revlog-compression-zstd (no-pure !)
879 added: exp-compression-none
883 added: exp-compression-none
880
884
881 processed revlogs:
885 processed revlogs:
882 - all-filelogs
886 - all-filelogs
883 - changelog
887 - changelog
884 - manifest
888 - manifest
885
889
886 $ hg verify
890 $ hg verify
887 checking changesets
891 checking changesets
888 checking manifests
892 checking manifests
889 checking directory manifests
893 checking directory manifests
890 crosschecking files in changesets and manifests
894 crosschecking files in changesets and manifests
891 checking files
895 checking files
892 checking dirstate
896 checking dirstate
893 checked 4 changesets with 22 changes to 20 files
897 checked 4 changesets with 22 changes to 20 files
894 $ f -s .hg/store/00manifest.*
898 $ f -s .hg/store/00manifest.*
895 .hg/store/00manifest.i: size=1002
899 .hg/store/00manifest.i: size=1002
896 $ f -s .hg/store/meta/dir/00manifest*
900 $ f -s .hg/store/meta/dir/00manifest*
897 .hg/store/meta/dir/00manifest.i: size=721
901 .hg/store/meta/dir/00manifest.i: size=721
898 $ hg files --rev tip | wc -l
902 $ hg files --rev tip | wc -l
899 \s*20 (re)
903 \s*20 (re)
900
904
901 testing cache update warming persistent nodemaps
905 testing cache update warming persistent nodemaps
902 ------------------------------------------------
906 ------------------------------------------------
903
907
904 $ hg debugupdatecache
908 $ hg debugupdatecache
@@ -1,2103 +1,2110 b''
1 #require no-reposimplestore
1 #require no-reposimplestore
2
2
3 $ cat >> $HGRCPATH << EOF
3 $ cat >> $HGRCPATH << EOF
4 > [extensions]
4 > [extensions]
5 > share =
5 > share =
6 > [format]
6 > [format]
7 > # stabilize test accross variant
7 > # stabilize test accross variant
8 > revlog-compression=zlib
8 > revlog-compression=zlib
9 > [storage]
9 > [storage]
10 > dirstate-v2.slow-path=allow
10 > dirstate-v2.slow-path=allow
11 > EOF
11 > EOF
12
12
13 store and revlogv1 are required in source
13 store and revlogv1 are required in source
14
14
15 $ hg --config format.usestore=false init no-store
15 $ hg --config format.usestore=false init no-store
16 $ hg -R no-store debugupgraderepo
16 $ hg -R no-store debugupgraderepo
17 abort: cannot upgrade repository; requirement missing: store
17 abort: cannot upgrade repository; requirement missing: store
18 [255]
18 [255]
19
19
20 $ hg init no-revlogv1
20 $ hg init no-revlogv1
21 $ cat > no-revlogv1/.hg/requires << EOF
21 $ cat > no-revlogv1/.hg/requires << EOF
22 > dotencode
22 > dotencode
23 > fncache
23 > fncache
24 > generaldelta
24 > generaldelta
25 > store
25 > store
26 > EOF
26 > EOF
27
27
28 $ hg -R no-revlogv1 debugupgraderepo
28 $ hg -R no-revlogv1 debugupgraderepo
29 abort: cannot upgrade repository; missing a revlog version
29 abort: cannot upgrade repository; missing a revlog version
30 [255]
30 [255]
31
31
32 Cannot upgrade shared repositories
32 Cannot upgrade shared repositories
33
33
34 $ hg init share-parent
34 $ hg init share-parent
35 $ hg -R share-parent debugbuilddag -n .+9
35 $ hg -R share-parent debugbuilddag -n .+9
36 $ hg -R share-parent up tip
36 $ hg -R share-parent up tip
37 10 files updated, 0 files merged, 0 files removed, 0 files unresolved
37 10 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 $ hg -q share share-parent share-child
38 $ hg -q share share-parent share-child
39
39
40 $ hg -R share-child debugupgraderepo --config format.sparse-revlog=no
40 $ hg -R share-child debugupgraderepo --config format.sparse-revlog=no
41 abort: cannot use these actions on a share repository: sparserevlog
41 abort: cannot use these actions on a share repository: sparserevlog
42 (upgrade the main repository directly)
42 (upgrade the main repository directly)
43 [255]
43 [255]
44
44
45 Unless the action is compatible with share
45 Unless the action is compatible with share
46
46
47 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet
47 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet
48 requirements
48 requirements
49 preserved: * (glob)
49 preserved: * (glob)
50 added: dirstate-v2
50 added: dirstate-v2
51
51
52 no revlogs to process
52 no revlogs to process
53
53
54
54
55 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet --run
55 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=yes --quiet --run
56 upgrade will perform the following actions:
56 upgrade will perform the following actions:
57
57
58 requirements
58 requirements
59 preserved: * (glob)
59 preserved: * (glob)
60 added: dirstate-v2
60 added: dirstate-v2
61
61
62 no revlogs to process
62 no revlogs to process
63
63
64 $ hg debugformat -R share-child | grep dirstate-v2
64 $ hg debugformat -R share-child | grep dirstate-v2
65 dirstate-v2: yes
65 dirstate-v2: yes
66 $ hg debugformat -R share-parent | grep dirstate-v2
66 $ hg debugformat -R share-parent | grep dirstate-v2
67 dirstate-v2: no
67 dirstate-v2: no
68 $ hg status --all -R share-child
68 $ hg status --all -R share-child
69 C nf0
69 C nf0
70 C nf1
70 C nf1
71 C nf2
71 C nf2
72 C nf3
72 C nf3
73 C nf4
73 C nf4
74 C nf5
74 C nf5
75 C nf6
75 C nf6
76 C nf7
76 C nf7
77 C nf8
77 C nf8
78 C nf9
78 C nf9
79 $ hg log -l 3 -R share-child
79 $ hg log -l 3 -R share-child
80 changeset: 9:0059eb38e4a4
80 changeset: 9:0059eb38e4a4
81 tag: tip
81 tag: tip
82 user: debugbuilddag
82 user: debugbuilddag
83 date: Thu Jan 01 00:00:09 1970 +0000
83 date: Thu Jan 01 00:00:09 1970 +0000
84 summary: r9
84 summary: r9
85
85
86 changeset: 8:4d5be70c8130
86 changeset: 8:4d5be70c8130
87 user: debugbuilddag
87 user: debugbuilddag
88 date: Thu Jan 01 00:00:08 1970 +0000
88 date: Thu Jan 01 00:00:08 1970 +0000
89 summary: r8
89 summary: r8
90
90
91 changeset: 7:e60bfe72517e
91 changeset: 7:e60bfe72517e
92 user: debugbuilddag
92 user: debugbuilddag
93 date: Thu Jan 01 00:00:07 1970 +0000
93 date: Thu Jan 01 00:00:07 1970 +0000
94 summary: r7
94 summary: r7
95
95
96 $ hg status --all -R share-parent
96 $ hg status --all -R share-parent
97 C nf0
97 C nf0
98 C nf1
98 C nf1
99 C nf2
99 C nf2
100 C nf3
100 C nf3
101 C nf4
101 C nf4
102 C nf5
102 C nf5
103 C nf6
103 C nf6
104 C nf7
104 C nf7
105 C nf8
105 C nf8
106 C nf9
106 C nf9
107 $ hg log -l 3 -R share-parent
107 $ hg log -l 3 -R share-parent
108 changeset: 9:0059eb38e4a4
108 changeset: 9:0059eb38e4a4
109 tag: tip
109 tag: tip
110 user: debugbuilddag
110 user: debugbuilddag
111 date: Thu Jan 01 00:00:09 1970 +0000
111 date: Thu Jan 01 00:00:09 1970 +0000
112 summary: r9
112 summary: r9
113
113
114 changeset: 8:4d5be70c8130
114 changeset: 8:4d5be70c8130
115 user: debugbuilddag
115 user: debugbuilddag
116 date: Thu Jan 01 00:00:08 1970 +0000
116 date: Thu Jan 01 00:00:08 1970 +0000
117 summary: r8
117 summary: r8
118
118
119 changeset: 7:e60bfe72517e
119 changeset: 7:e60bfe72517e
120 user: debugbuilddag
120 user: debugbuilddag
121 date: Thu Jan 01 00:00:07 1970 +0000
121 date: Thu Jan 01 00:00:07 1970 +0000
122 summary: r7
122 summary: r7
123
123
124
124
125 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=no --quiet --run
125 $ hg -R share-child debugupgraderepo --config format.use-dirstate-v2=no --quiet --run
126 upgrade will perform the following actions:
126 upgrade will perform the following actions:
127
127
128 requirements
128 requirements
129 preserved: * (glob)
129 preserved: * (glob)
130 removed: dirstate-v2
130 removed: dirstate-v2
131
131
132 no revlogs to process
132 no revlogs to process
133
133
134 $ hg debugformat -R share-child | grep dirstate-v2
134 $ hg debugformat -R share-child | grep dirstate-v2
135 dirstate-v2: no
135 dirstate-v2: no
136 $ hg debugformat -R share-parent | grep dirstate-v2
136 $ hg debugformat -R share-parent | grep dirstate-v2
137 dirstate-v2: no
137 dirstate-v2: no
138 $ hg status --all -R share-child
138 $ hg status --all -R share-child
139 C nf0
139 C nf0
140 C nf1
140 C nf1
141 C nf2
141 C nf2
142 C nf3
142 C nf3
143 C nf4
143 C nf4
144 C nf5
144 C nf5
145 C nf6
145 C nf6
146 C nf7
146 C nf7
147 C nf8
147 C nf8
148 C nf9
148 C nf9
149 $ hg log -l 3 -R share-child
149 $ hg log -l 3 -R share-child
150 changeset: 9:0059eb38e4a4
150 changeset: 9:0059eb38e4a4
151 tag: tip
151 tag: tip
152 user: debugbuilddag
152 user: debugbuilddag
153 date: Thu Jan 01 00:00:09 1970 +0000
153 date: Thu Jan 01 00:00:09 1970 +0000
154 summary: r9
154 summary: r9
155
155
156 changeset: 8:4d5be70c8130
156 changeset: 8:4d5be70c8130
157 user: debugbuilddag
157 user: debugbuilddag
158 date: Thu Jan 01 00:00:08 1970 +0000
158 date: Thu Jan 01 00:00:08 1970 +0000
159 summary: r8
159 summary: r8
160
160
161 changeset: 7:e60bfe72517e
161 changeset: 7:e60bfe72517e
162 user: debugbuilddag
162 user: debugbuilddag
163 date: Thu Jan 01 00:00:07 1970 +0000
163 date: Thu Jan 01 00:00:07 1970 +0000
164 summary: r7
164 summary: r7
165
165
166 $ hg status --all -R share-parent
166 $ hg status --all -R share-parent
167 C nf0
167 C nf0
168 C nf1
168 C nf1
169 C nf2
169 C nf2
170 C nf3
170 C nf3
171 C nf4
171 C nf4
172 C nf5
172 C nf5
173 C nf6
173 C nf6
174 C nf7
174 C nf7
175 C nf8
175 C nf8
176 C nf9
176 C nf9
177 $ hg log -l 3 -R share-parent
177 $ hg log -l 3 -R share-parent
178 changeset: 9:0059eb38e4a4
178 changeset: 9:0059eb38e4a4
179 tag: tip
179 tag: tip
180 user: debugbuilddag
180 user: debugbuilddag
181 date: Thu Jan 01 00:00:09 1970 +0000
181 date: Thu Jan 01 00:00:09 1970 +0000
182 summary: r9
182 summary: r9
183
183
184 changeset: 8:4d5be70c8130
184 changeset: 8:4d5be70c8130
185 user: debugbuilddag
185 user: debugbuilddag
186 date: Thu Jan 01 00:00:08 1970 +0000
186 date: Thu Jan 01 00:00:08 1970 +0000
187 summary: r8
187 summary: r8
188
188
189 changeset: 7:e60bfe72517e
189 changeset: 7:e60bfe72517e
190 user: debugbuilddag
190 user: debugbuilddag
191 date: Thu Jan 01 00:00:07 1970 +0000
191 date: Thu Jan 01 00:00:07 1970 +0000
192 summary: r7
192 summary: r7
193
193
194
194
195 Do not yet support downgrading treemanifest repos
195 Do not yet support downgrading treemanifest repos
196
196
197 $ hg --config experimental.treemanifest=true init treemanifest
197 $ hg --config experimental.treemanifest=true init treemanifest
198 $ hg -R treemanifest debugupgraderepo
198 $ hg -R treemanifest debugupgraderepo
199 abort: cannot upgrade repository; requirement would be removed: treemanifest
199 abort: cannot upgrade repository; requirement would be removed: treemanifest
200 [255]
200 [255]
201
201
202 Cannot add treemanifest requirement during upgrade
202 Cannot add treemanifest requirement during upgrade
203
203
204 $ hg init disallowaddedreq
204 $ hg init disallowaddedreq
205 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
205 $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
206 abort: cannot upgrade repository; do not support adding requirement: treemanifest
206 abort: cannot upgrade repository; do not support adding requirement: treemanifest
207 [255]
207 [255]
208
208
209 An upgrade of a repository created with recommended settings only suggests optimizations
209 An upgrade of a repository created with recommended settings only suggests optimizations
210
210
211 $ hg init empty
211 $ hg init empty
212 $ cd empty
212 $ cd empty
213 $ hg debugformat
213 $ hg debugformat
214 format-variant repo
214 format-variant repo
215 fncache: yes
215 fncache: yes
216 dirstate-v2: no
216 dirstate-v2: no
217 tracked-hint: no
217 tracked-hint: no
218 dotencode: yes
218 dotencode: yes
219 generaldelta: yes
219 generaldelta: yes
220 share-safe: yes
220 share-safe: yes
221 sparserevlog: yes
221 sparserevlog: yes
222 persistent-nodemap: no (no-rust !)
222 persistent-nodemap: no (no-rust !)
223 persistent-nodemap: yes (rust !)
223 persistent-nodemap: yes (rust !)
224 copies-sdc: no
224 copies-sdc: no
225 revlog-v2: no
225 revlog-v2: no
226 changelog-v2: no
226 changelog-v2: no
227 plain-cl-delta: yes
227 plain-cl-delta: yes
228 compression: zlib
228 compression: zlib
229 compression-level: default
229 compression-level: default
230 $ hg debugformat --verbose
230 $ hg debugformat --verbose
231 format-variant repo config default
231 format-variant repo config default
232 fncache: yes yes yes
232 fncache: yes yes yes
233 dirstate-v2: no no no
233 dirstate-v2: no no no
234 tracked-hint: no no no
234 tracked-hint: no no no
235 dotencode: yes yes yes
235 dotencode: yes yes yes
236 generaldelta: yes yes yes
236 generaldelta: yes yes yes
237 share-safe: yes yes yes
237 share-safe: yes yes yes
238 sparserevlog: yes yes yes
238 sparserevlog: yes yes yes
239 persistent-nodemap: no no no (no-rust !)
239 persistent-nodemap: no no no (no-rust !)
240 persistent-nodemap: yes yes no (rust !)
240 persistent-nodemap: yes yes no (rust !)
241 copies-sdc: no no no
241 copies-sdc: no no no
242 revlog-v2: no no no
242 revlog-v2: no no no
243 changelog-v2: no no no
243 changelog-v2: no no no
244 plain-cl-delta: yes yes yes
244 plain-cl-delta: yes yes yes
245 compression: zlib zlib zlib (no-zstd !)
245 compression: zlib zlib zlib (no-zstd !)
246 compression: zlib zlib zstd (zstd !)
246 compression: zlib zlib zstd (zstd !)
247 compression-level: default default default
247 compression-level: default default default
248 $ hg debugformat --verbose --config format.usefncache=no
248 $ hg debugformat --verbose --config format.usefncache=no
249 format-variant repo config default
249 format-variant repo config default
250 fncache: yes no yes
250 fncache: yes no yes
251 dirstate-v2: no no no
251 dirstate-v2: no no no
252 tracked-hint: no no no
252 tracked-hint: no no no
253 dotencode: yes no yes
253 dotencode: yes no yes
254 generaldelta: yes yes yes
254 generaldelta: yes yes yes
255 share-safe: yes yes yes
255 share-safe: yes yes yes
256 sparserevlog: yes yes yes
256 sparserevlog: yes yes yes
257 persistent-nodemap: no no no (no-rust !)
257 persistent-nodemap: no no no (no-rust !)
258 persistent-nodemap: yes yes no (rust !)
258 persistent-nodemap: yes yes no (rust !)
259 copies-sdc: no no no
259 copies-sdc: no no no
260 revlog-v2: no no no
260 revlog-v2: no no no
261 changelog-v2: no no no
261 changelog-v2: no no no
262 plain-cl-delta: yes yes yes
262 plain-cl-delta: yes yes yes
263 compression: zlib zlib zlib (no-zstd !)
263 compression: zlib zlib zlib (no-zstd !)
264 compression: zlib zlib zstd (zstd !)
264 compression: zlib zlib zstd (zstd !)
265 compression-level: default default default
265 compression-level: default default default
266 $ hg debugformat --verbose --config format.usefncache=no --color=debug
266 $ hg debugformat --verbose --config format.usefncache=no --color=debug
267 format-variant repo config default
267 format-variant repo config default
268 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
268 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
269 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
269 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
270 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
270 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
271 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
271 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| yes][formatvariant.config.special| no][formatvariant.default| yes]
272 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
272 [formatvariant.name.uptodate|generaldelta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
273 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
273 [formatvariant.name.uptodate|share-safe: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
274 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
274 [formatvariant.name.uptodate|sparserevlog: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
275 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
275 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
276 [formatvariant.name.mismatchdefault|persistent-nodemap:][formatvariant.repo.mismatchdefault| yes][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
276 [formatvariant.name.mismatchdefault|persistent-nodemap:][formatvariant.repo.mismatchdefault| yes][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
277 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
277 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
278 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
278 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
279 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
279 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
280 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
280 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
281 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
281 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
282 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
282 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
283 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
283 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
284 $ hg debugformat -Tjson
284 $ hg debugformat -Tjson
285 [
285 [
286 {
286 {
287 "config": true,
287 "config": true,
288 "default": true,
288 "default": true,
289 "name": "fncache",
289 "name": "fncache",
290 "repo": true
290 "repo": true
291 },
291 },
292 {
292 {
293 "config": false,
293 "config": false,
294 "default": false,
294 "default": false,
295 "name": "dirstate-v2",
295 "name": "dirstate-v2",
296 "repo": false
296 "repo": false
297 },
297 },
298 {
298 {
299 "config": false,
299 "config": false,
300 "default": false,
300 "default": false,
301 "name": "tracked-hint",
301 "name": "tracked-hint",
302 "repo": false
302 "repo": false
303 },
303 },
304 {
304 {
305 "config": true,
305 "config": true,
306 "default": true,
306 "default": true,
307 "name": "dotencode",
307 "name": "dotencode",
308 "repo": true
308 "repo": true
309 },
309 },
310 {
310 {
311 "config": true,
311 "config": true,
312 "default": true,
312 "default": true,
313 "name": "generaldelta",
313 "name": "generaldelta",
314 "repo": true
314 "repo": true
315 },
315 },
316 {
316 {
317 "config": true,
317 "config": true,
318 "default": true,
318 "default": true,
319 "name": "share-safe",
319 "name": "share-safe",
320 "repo": true
320 "repo": true
321 },
321 },
322 {
322 {
323 "config": true,
323 "config": true,
324 "default": true,
324 "default": true,
325 "name": "sparserevlog",
325 "name": "sparserevlog",
326 "repo": true
326 "repo": true
327 },
327 },
328 {
328 {
329 "config": false, (no-rust !)
329 "config": false, (no-rust !)
330 "config": true, (rust !)
330 "config": true, (rust !)
331 "default": false,
331 "default": false,
332 "name": "persistent-nodemap",
332 "name": "persistent-nodemap",
333 "repo": false (no-rust !)
333 "repo": false (no-rust !)
334 "repo": true (rust !)
334 "repo": true (rust !)
335 },
335 },
336 {
336 {
337 "config": false,
337 "config": false,
338 "default": false,
338 "default": false,
339 "name": "copies-sdc",
339 "name": "copies-sdc",
340 "repo": false
340 "repo": false
341 },
341 },
342 {
342 {
343 "config": false,
343 "config": false,
344 "default": false,
344 "default": false,
345 "name": "revlog-v2",
345 "name": "revlog-v2",
346 "repo": false
346 "repo": false
347 },
347 },
348 {
348 {
349 "config": false,
349 "config": false,
350 "default": false,
350 "default": false,
351 "name": "changelog-v2",
351 "name": "changelog-v2",
352 "repo": false
352 "repo": false
353 },
353 },
354 {
354 {
355 "config": true,
355 "config": true,
356 "default": true,
356 "default": true,
357 "name": "plain-cl-delta",
357 "name": "plain-cl-delta",
358 "repo": true
358 "repo": true
359 },
359 },
360 {
360 {
361 "config": "zlib",
361 "config": "zlib",
362 "default": "zlib", (no-zstd !)
362 "default": "zlib", (no-zstd !)
363 "default": "zstd", (zstd !)
363 "default": "zstd", (zstd !)
364 "name": "compression",
364 "name": "compression",
365 "repo": "zlib"
365 "repo": "zlib"
366 },
366 },
367 {
367 {
368 "config": "default",
368 "config": "default",
369 "default": "default",
369 "default": "default",
370 "name": "compression-level",
370 "name": "compression-level",
371 "repo": "default"
371 "repo": "default"
372 }
372 }
373 ]
373 ]
374 $ hg debugupgraderepo
374 $ hg debugupgraderepo
375 (no format upgrades found in existing repository)
375 (no format upgrades found in existing repository)
376 performing an upgrade with "--run" will make the following changes:
376 performing an upgrade with "--run" will make the following changes:
377
377
378 requirements
378 requirements
379 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
379 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
380 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
380 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
381
381
382 no revlogs to process
382 no revlogs to process
383
383
384 additional optimizations are available by specifying "--optimize <name>":
384 additional optimizations are available by specifying "--optimize <name>":
385
385
386 re-delta-parent
386 re-delta-parent
387 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
387 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
388
388
389 re-delta-multibase
389 re-delta-multibase
390 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
390 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
391
391
392 re-delta-all
392 re-delta-all
393 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
393 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
394
394
395 re-delta-fulladd
395 re-delta-fulladd
396 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
396 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
397
397
398
398
399 $ hg debugupgraderepo --quiet
399 $ hg debugupgraderepo --quiet
400 requirements
400 requirements
401 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
401 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
402 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
402 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
403
403
404 no revlogs to process
404 no revlogs to process
405
405
406
406
407 --optimize can be used to add optimizations
407 --optimize can be used to add optimizations
408
408
409 $ hg debugupgrade --optimize 're-delta-parent'
409 $ hg debugupgrade --optimize 're-delta-parent'
410 (no format upgrades found in existing repository)
410 (no format upgrades found in existing repository)
411 performing an upgrade with "--run" will make the following changes:
411 performing an upgrade with "--run" will make the following changes:
412
412
413 requirements
413 requirements
414 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
414 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
415 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
415 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
416
416
417 optimisations: re-delta-parent
417 optimisations: re-delta-parent
418
418
419 re-delta-parent
419 re-delta-parent
420 deltas within internal storage will choose a new base revision if needed
420 deltas within internal storage will choose a new base revision if needed
421
421
422 processed revlogs:
422 processed revlogs:
423 - all-filelogs
423 - all-filelogs
424 - changelog
424 - changelog
425 - manifest
425 - manifest
426
426
427 additional optimizations are available by specifying "--optimize <name>":
427 additional optimizations are available by specifying "--optimize <name>":
428
428
429 re-delta-multibase
429 re-delta-multibase
430 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
430 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
431
431
432 re-delta-all
432 re-delta-all
433 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
433 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
434
434
435 re-delta-fulladd
435 re-delta-fulladd
436 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
436 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
437
437
438
438
439 modern form of the option
439 modern form of the option
440
440
441 $ hg debugupgrade --optimize re-delta-parent
441 $ hg debugupgrade --optimize re-delta-parent
442 (no format upgrades found in existing repository)
442 (no format upgrades found in existing repository)
443 performing an upgrade with "--run" will make the following changes:
443 performing an upgrade with "--run" will make the following changes:
444
444
445 requirements
445 requirements
446 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
446 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
447 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
447 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
448
448
449 optimisations: re-delta-parent
449 optimisations: re-delta-parent
450
450
451 re-delta-parent
451 re-delta-parent
452 deltas within internal storage will choose a new base revision if needed
452 deltas within internal storage will choose a new base revision if needed
453
453
454 processed revlogs:
454 processed revlogs:
455 - all-filelogs
455 - all-filelogs
456 - changelog
456 - changelog
457 - manifest
457 - manifest
458
458
459 additional optimizations are available by specifying "--optimize <name>":
459 additional optimizations are available by specifying "--optimize <name>":
460
460
461 re-delta-multibase
461 re-delta-multibase
462 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
462 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
463
463
464 re-delta-all
464 re-delta-all
465 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
465 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
466
466
467 re-delta-fulladd
467 re-delta-fulladd
468 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
468 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
469
469
470
470
471 $ hg debugupgrade --optimize re-delta-parent --quiet
471 $ hg debugupgrade --optimize re-delta-parent --quiet
472 requirements
472 requirements
473 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
473 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
474 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
474 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
475
475
476 optimisations: re-delta-parent
476 optimisations: re-delta-parent
477
477
478 processed revlogs:
478 processed revlogs:
479 - all-filelogs
479 - all-filelogs
480 - changelog
480 - changelog
481 - manifest
481 - manifest
482
482
483
483
484 passing multiple optimization:
484 passing multiple optimization:
485
485
486 $ hg debugupgrade --optimize re-delta-parent --optimize re-delta-multibase --quiet
486 $ hg debugupgrade --optimize re-delta-parent --optimize re-delta-multibase --quiet
487 requirements
487 requirements
488 preserved: * (glob)
488 preserved: * (glob)
489
489
490 optimisations: re-delta-multibase, re-delta-parent
490 optimisations: re-delta-multibase, re-delta-parent
491
491
492 processed revlogs:
492 processed revlogs:
493 - all-filelogs
493 - all-filelogs
494 - changelog
494 - changelog
495 - manifest
495 - manifest
496
496
497
497
498 unknown optimization:
498 unknown optimization:
499
499
500 $ hg debugupgrade --optimize foobar
500 $ hg debugupgrade --optimize foobar
501 abort: unknown optimization action requested: foobar
501 abort: unknown optimization action requested: foobar
502 (run without arguments to see valid optimizations)
502 (run without arguments to see valid optimizations)
503 [255]
503 [255]
504
504
505 Various sub-optimal detections work
505 Various sub-optimal detections work
506
506
507 $ cat > .hg/requires << EOF
507 $ cat > .hg/requires << EOF
508 > revlogv1
508 > revlogv1
509 > store
509 > store
510 > EOF
510 > EOF
511
511
512 $ hg debugformat
512 $ hg debugformat
513 format-variant repo
513 format-variant repo
514 fncache: no
514 fncache: no
515 dirstate-v2: no
515 dirstate-v2: no
516 tracked-hint: no
516 tracked-hint: no
517 dotencode: no
517 dotencode: no
518 generaldelta: no
518 generaldelta: no
519 share-safe: no
519 share-safe: no
520 sparserevlog: no
520 sparserevlog: no
521 persistent-nodemap: no
521 persistent-nodemap: no
522 copies-sdc: no
522 copies-sdc: no
523 revlog-v2: no
523 revlog-v2: no
524 changelog-v2: no
524 changelog-v2: no
525 plain-cl-delta: yes
525 plain-cl-delta: yes
526 compression: zlib
526 compression: zlib
527 compression-level: default
527 compression-level: default
528 $ hg debugformat --verbose
528 $ hg debugformat --verbose
529 format-variant repo config default
529 format-variant repo config default
530 fncache: no yes yes
530 fncache: no yes yes
531 dirstate-v2: no no no
531 dirstate-v2: no no no
532 tracked-hint: no no no
532 tracked-hint: no no no
533 dotencode: no yes yes
533 dotencode: no yes yes
534 generaldelta: no yes yes
534 generaldelta: no yes yes
535 share-safe: no yes yes
535 share-safe: no yes yes
536 sparserevlog: no yes yes
536 sparserevlog: no yes yes
537 persistent-nodemap: no no no (no-rust !)
537 persistent-nodemap: no no no (no-rust !)
538 persistent-nodemap: no yes no (rust !)
538 persistent-nodemap: no yes no (rust !)
539 copies-sdc: no no no
539 copies-sdc: no no no
540 revlog-v2: no no no
540 revlog-v2: no no no
541 changelog-v2: no no no
541 changelog-v2: no no no
542 plain-cl-delta: yes yes yes
542 plain-cl-delta: yes yes yes
543 compression: zlib zlib zlib (no-zstd !)
543 compression: zlib zlib zlib (no-zstd !)
544 compression: zlib zlib zstd (zstd !)
544 compression: zlib zlib zstd (zstd !)
545 compression-level: default default default
545 compression-level: default default default
546 $ hg debugformat --verbose --config format.usegeneraldelta=no
546 $ hg debugformat --verbose --config format.usegeneraldelta=no
547 format-variant repo config default
547 format-variant repo config default
548 fncache: no yes yes
548 fncache: no yes yes
549 dirstate-v2: no no no
549 dirstate-v2: no no no
550 tracked-hint: no no no
550 tracked-hint: no no no
551 dotencode: no yes yes
551 dotencode: no yes yes
552 generaldelta: no no yes
552 generaldelta: no no yes
553 share-safe: no yes yes
553 share-safe: no yes yes
554 sparserevlog: no no yes
554 sparserevlog: no no yes
555 persistent-nodemap: no no no (no-rust !)
555 persistent-nodemap: no no no (no-rust !)
556 persistent-nodemap: no yes no (rust !)
556 persistent-nodemap: no yes no (rust !)
557 copies-sdc: no no no
557 copies-sdc: no no no
558 revlog-v2: no no no
558 revlog-v2: no no no
559 changelog-v2: no no no
559 changelog-v2: no no no
560 plain-cl-delta: yes yes yes
560 plain-cl-delta: yes yes yes
561 compression: zlib zlib zlib (no-zstd !)
561 compression: zlib zlib zlib (no-zstd !)
562 compression: zlib zlib zstd (zstd !)
562 compression: zlib zlib zstd (zstd !)
563 compression-level: default default default
563 compression-level: default default default
564 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
564 $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
565 format-variant repo config default
565 format-variant repo config default
566 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
566 [formatvariant.name.mismatchconfig|fncache: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
567 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
567 [formatvariant.name.uptodate|dirstate-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
568 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
568 [formatvariant.name.uptodate|tracked-hint: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
569 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
569 [formatvariant.name.mismatchconfig|dotencode: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
570 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
570 [formatvariant.name.mismatchdefault|generaldelta: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
571 [formatvariant.name.mismatchconfig|share-safe: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
571 [formatvariant.name.mismatchconfig|share-safe: ][formatvariant.repo.mismatchconfig| no][formatvariant.config.default| yes][formatvariant.default| yes]
572 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
572 [formatvariant.name.mismatchdefault|sparserevlog: ][formatvariant.repo.mismatchdefault| no][formatvariant.config.special| no][formatvariant.default| yes]
573 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
573 [formatvariant.name.uptodate|persistent-nodemap:][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no] (no-rust !)
574 [formatvariant.name.mismatchconfig|persistent-nodemap:][formatvariant.repo.mismatchconfig| no][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
574 [formatvariant.name.mismatchconfig|persistent-nodemap:][formatvariant.repo.mismatchconfig| no][formatvariant.config.special| yes][formatvariant.default| no] (rust !)
575 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
575 [formatvariant.name.uptodate|copies-sdc: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
576 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
576 [formatvariant.name.uptodate|revlog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
577 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
577 [formatvariant.name.uptodate|changelog-v2: ][formatvariant.repo.uptodate| no][formatvariant.config.default| no][formatvariant.default| no]
578 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
578 [formatvariant.name.uptodate|plain-cl-delta: ][formatvariant.repo.uptodate| yes][formatvariant.config.default| yes][formatvariant.default| yes]
579 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
579 [formatvariant.name.uptodate|compression: ][formatvariant.repo.uptodate| zlib][formatvariant.config.default| zlib][formatvariant.default| zlib] (no-zstd !)
580 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
580 [formatvariant.name.mismatchdefault|compression: ][formatvariant.repo.mismatchdefault| zlib][formatvariant.config.special| zlib][formatvariant.default| zstd] (zstd !)
581 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
581 [formatvariant.name.uptodate|compression-level: ][formatvariant.repo.uptodate| default][formatvariant.config.default| default][formatvariant.default| default]
582 $ hg debugupgraderepo
582 $ hg debugupgraderepo
583 note: selecting all-filelogs for processing to change: dotencode
583 note: selecting all-filelogs for processing to change: dotencode
584 note: selecting all-manifestlogs for processing to change: dotencode
584 note: selecting all-manifestlogs for processing to change: dotencode
585 note: selecting changelog for processing to change: dotencode
585 note: selecting changelog for processing to change: dotencode
586
586
587 repository lacks features recommended by current config options:
587 repository lacks features recommended by current config options:
588
588
589 fncache
589 fncache
590 long and reserved filenames may not work correctly; repository performance is sub-optimal
590 long and reserved filenames may not work correctly; repository performance is sub-optimal
591
591
592 dotencode
592 dotencode
593 storage of filenames beginning with a period or space may not work correctly
593 storage of filenames beginning with a period or space may not work correctly
594
594
595 generaldelta
595 generaldelta
596 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
596 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
597
597
598 share-safe
598 share-safe
599 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
599 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
600
600
601 sparserevlog
601 sparserevlog
602 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
602 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
603
603
604 persistent-nodemap (rust !)
604 persistent-nodemap (rust !)
605 persist the node -> rev mapping on disk to speedup lookup (rust !)
605 persist the node -> rev mapping on disk to speedup lookup (rust !)
606 (rust !)
606 (rust !)
607
607
608 performing an upgrade with "--run" will make the following changes:
608 performing an upgrade with "--run" will make the following changes:
609
609
610 requirements
610 requirements
611 preserved: revlogv1, store
611 preserved: revlogv1, store
612 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
612 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
613 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
613 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
614
614
615 fncache
615 fncache
616 repository will be more resilient to storing certain paths and performance of certain operations should be improved
616 repository will be more resilient to storing certain paths and performance of certain operations should be improved
617
617
618 dotencode
618 dotencode
619 repository will be better able to store files beginning with a space or period
619 repository will be better able to store files beginning with a space or period
620
620
621 generaldelta
621 generaldelta
622 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
622 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
623
623
624 share-safe
624 share-safe
625 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
625 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
626
626
627 sparserevlog
627 sparserevlog
628 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
628 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
629
629
630 persistent-nodemap (rust !)
630 persistent-nodemap (rust !)
631 Speedup revision lookup by node id. (rust !)
631 Speedup revision lookup by node id. (rust !)
632 (rust !)
632 (rust !)
633 processed revlogs:
633 processed revlogs:
634 - all-filelogs
634 - all-filelogs
635 - changelog
635 - changelog
636 - manifest
636 - manifest
637
637
638 additional optimizations are available by specifying "--optimize <name>":
638 additional optimizations are available by specifying "--optimize <name>":
639
639
640 re-delta-parent
640 re-delta-parent
641 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
641 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
642
642
643 re-delta-multibase
643 re-delta-multibase
644 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
644 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
645
645
646 re-delta-all
646 re-delta-all
647 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
647 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
648
648
649 re-delta-fulladd
649 re-delta-fulladd
650 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
650 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
651
651
652 $ hg debugupgraderepo --quiet
652 $ hg debugupgraderepo --quiet
653 requirements
653 requirements
654 preserved: revlogv1, store
654 preserved: revlogv1, store
655 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
655 added: dotencode, fncache, generaldelta, share-safe, sparserevlog (no-rust !)
656 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
656 added: dotencode, fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
657
657
658 processed revlogs:
658 processed revlogs:
659 - all-filelogs
659 - all-filelogs
660 - changelog
660 - changelog
661 - manifest
661 - manifest
662
662
663
663
664 $ hg --config format.dotencode=false debugupgraderepo
664 $ hg --config format.dotencode=false debugupgraderepo
665 note: selecting all-filelogs for processing to change: fncache
665 note: selecting all-filelogs for processing to change: fncache
666 note: selecting all-manifestlogs for processing to change: fncache
666 note: selecting all-manifestlogs for processing to change: fncache
667 note: selecting changelog for processing to change: fncache
667 note: selecting changelog for processing to change: fncache
668
668
669 repository lacks features recommended by current config options:
669 repository lacks features recommended by current config options:
670
670
671 fncache
671 fncache
672 long and reserved filenames may not work correctly; repository performance is sub-optimal
672 long and reserved filenames may not work correctly; repository performance is sub-optimal
673
673
674 generaldelta
674 generaldelta
675 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
675 deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
676
676
677 share-safe
677 share-safe
678 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
678 old shared repositories do not share source repository requirements and config. This leads to various problems when the source repository format is upgraded or some new extensions are enabled.
679
679
680 sparserevlog
680 sparserevlog
681 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
681 in order to limit disk reading and memory usage on older version, the span of a delta chain from its root to its end is limited, whatever the relevant data in this span. This can severly limit Mercurial ability to build good chain of delta resulting is much more storage space being taken and limit reusability of on disk delta during exchange.
682
682
683 persistent-nodemap (rust !)
683 persistent-nodemap (rust !)
684 persist the node -> rev mapping on disk to speedup lookup (rust !)
684 persist the node -> rev mapping on disk to speedup lookup (rust !)
685 (rust !)
685 (rust !)
686 repository lacks features used by the default config options:
686 repository lacks features used by the default config options:
687
687
688 dotencode
688 dotencode
689 storage of filenames beginning with a period or space may not work correctly
689 storage of filenames beginning with a period or space may not work correctly
690
690
691
691
692 performing an upgrade with "--run" will make the following changes:
692 performing an upgrade with "--run" will make the following changes:
693
693
694 requirements
694 requirements
695 preserved: revlogv1, store
695 preserved: revlogv1, store
696 added: fncache, generaldelta, share-safe, sparserevlog (no-rust !)
696 added: fncache, generaldelta, share-safe, sparserevlog (no-rust !)
697 added: fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
697 added: fncache, generaldelta, persistent-nodemap, share-safe, sparserevlog (rust !)
698
698
699 fncache
699 fncache
700 repository will be more resilient to storing certain paths and performance of certain operations should be improved
700 repository will be more resilient to storing certain paths and performance of certain operations should be improved
701
701
702 generaldelta
702 generaldelta
703 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
703 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
704
704
705 share-safe
705 share-safe
706 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
706 Upgrades a repository to share-safe format so that future shares of this repository share its requirements and configs.
707
707
708 sparserevlog
708 sparserevlog
709 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
709 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
710
710
711 persistent-nodemap (rust !)
711 persistent-nodemap (rust !)
712 Speedup revision lookup by node id. (rust !)
712 Speedup revision lookup by node id. (rust !)
713 (rust !)
713 (rust !)
714 processed revlogs:
714 processed revlogs:
715 - all-filelogs
715 - all-filelogs
716 - changelog
716 - changelog
717 - manifest
717 - manifest
718
718
719 additional optimizations are available by specifying "--optimize <name>":
719 additional optimizations are available by specifying "--optimize <name>":
720
720
721 re-delta-parent
721 re-delta-parent
722 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
722 deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
723
723
724 re-delta-multibase
724 re-delta-multibase
725 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
725 deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
726
726
727 re-delta-all
727 re-delta-all
728 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
728 deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
729
729
730 re-delta-fulladd
730 re-delta-fulladd
731 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
731 every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "re-delta-all" but even slower since more logic is involved.
732
732
733
733
734 $ cd ..
734 $ cd ..
735
735
736 Upgrading a repository that is already modern essentially no-ops
736 Upgrading a repository that is already modern essentially no-ops
737
737
738 $ hg init modern
738 $ hg init modern
739 $ hg -R modern debugupgraderepo --run
739 $ hg -R modern debugupgraderepo --run
740 nothing to do
740 nothing to do
741
741
742 Upgrading a repository to generaldelta works
742 Upgrading a repository to generaldelta works
743
743
744 $ hg --config format.usegeneraldelta=false init upgradegd
744 $ hg --config format.usegeneraldelta=false init upgradegd
745 $ cd upgradegd
745 $ cd upgradegd
746 $ touch f0
746 $ touch f0
747 $ hg -q commit -A -m initial
747 $ hg -q commit -A -m initial
748 $ mkdir FooBarDirectory.d
748 $ mkdir FooBarDirectory.d
749 $ touch FooBarDirectory.d/f1
749 $ touch FooBarDirectory.d/f1
750 $ hg -q commit -A -m 'add f1'
750 $ hg -q commit -A -m 'add f1'
751 $ hg -q up -r 0
751 $ hg -q up -r 0
752 >>> import random
752 >>> import random
753 >>> random.seed(0) # have a reproducible content
753 >>> random.seed(0) # have a reproducible content
754 >>> with open("f2", "wb") as f:
754 >>> with open("f2", "wb") as f:
755 ... for i in range(100000):
755 ... for i in range(100000):
756 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
756 ... f.write(b"%d\n" % random.randint(1000000000, 9999999999)) and None
757 $ hg -q commit -A -m 'add f2'
757 $ hg -q commit -A -m 'add f2'
758
758
759 make sure we have a .d file
759 make sure we have a .d file
760
760
761 $ ls -d .hg/store/data/*
761 $ ls -d .hg/store/data/*
762 .hg/store/data/_foo_bar_directory.d.hg
762 .hg/store/data/_foo_bar_directory.d.hg
763 .hg/store/data/f0.i
763 .hg/store/data/f0.i
764 .hg/store/data/f2.d
764 .hg/store/data/f2.d
765 .hg/store/data/f2.i
765 .hg/store/data/f2.i
766
766
767 $ hg debugupgraderepo --run --config format.sparse-revlog=false
767 $ hg debugupgraderepo --run --config format.sparse-revlog=false
768 note: selecting all-filelogs for processing to change: generaldelta
768 note: selecting all-filelogs for processing to change: generaldelta
769 note: selecting all-manifestlogs for processing to change: generaldelta
769 note: selecting all-manifestlogs for processing to change: generaldelta
770 note: selecting changelog for processing to change: generaldelta
770 note: selecting changelog for processing to change: generaldelta
771
771
772 upgrade will perform the following actions:
772 upgrade will perform the following actions:
773
773
774 requirements
774 requirements
775 preserved: dotencode, fncache, revlogv1, share-safe, store (no-rust !)
775 preserved: dotencode, fncache, revlogv1, share-safe, store (no-rust !)
776 preserved: dotencode, fncache, persistent-nodemap, revlogv1, share-safe, store (rust !)
776 preserved: dotencode, fncache, persistent-nodemap, revlogv1, share-safe, store (rust !)
777 added: generaldelta
777 added: generaldelta
778
778
779 generaldelta
779 generaldelta
780 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
780 repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
781
781
782 processed revlogs:
782 processed revlogs:
783 - all-filelogs
783 - all-filelogs
784 - changelog
784 - changelog
785 - manifest
785 - manifest
786
786
787 beginning upgrade...
787 beginning upgrade...
788 repository locked and read-only
788 repository locked and read-only
789 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
789 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
790 (it is safe to interrupt this process any time before data migration completes)
790 (it is safe to interrupt this process any time before data migration completes)
791 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
791 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
792 migrating 519 KB in store; 1.05 MB tracked data
792 migrating 519 KB in store; 1.05 MB tracked data
793 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
793 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
794 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
794 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
795 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
795 migrating 1 manifests containing 3 revisions (384 bytes in store; 238 bytes tracked data)
796 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
796 finished migrating 3 manifest revisions across 1 manifests; change in size: -17 bytes
797 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
797 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
798 finished migrating 3 changelog revisions; change in size: 0 bytes
798 finished migrating 3 changelog revisions; change in size: 0 bytes
799 finished migrating 9 total revisions; total change in store size: -17 bytes
799 finished migrating 9 total revisions; total change in store size: -17 bytes
800 copying phaseroots
800 copying phaseroots
801 copying requires
801 copying requires
802 data fully upgraded in a temporary repository
802 data fully upgraded in a temporary repository
803 marking source repository as being upgraded; clients will be unable to read from repository
803 marking source repository as being upgraded; clients will be unable to read from repository
804 starting in-place swap of repository data
804 starting in-place swap of repository data
805 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
805 replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
806 replacing store...
806 replacing store...
807 store replacement complete; repository was inconsistent for *s (glob)
807 store replacement complete; repository was inconsistent for *s (glob)
808 finalizing requirements file and making repository readable again
808 finalizing requirements file and making repository readable again
809 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
809 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
810 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
810 copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
811 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
811 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
812
812
813 Original requirements backed up
813 Original requirements backed up
814
814
815 $ cat .hg/upgradebackup.*/requires
815 $ cat .hg/upgradebackup.*/requires
816 share-safe
816 share-safe
817 $ cat .hg/upgradebackup.*/store/requires
817 $ cat .hg/upgradebackup.*/store/requires
818 dotencode
818 dotencode
819 fncache
819 fncache
820 persistent-nodemap (rust !)
820 persistent-nodemap (rust !)
821 revlogv1
821 revlogv1
822 store
822 store
823 upgradeinprogress
823 upgradeinprogress
824
824
825 generaldelta added to original requirements files
825 generaldelta added to original requirements files
826
826
827 $ hg debugrequires
827 $ hg debugrequires
828 dotencode
828 dotencode
829 fncache
829 fncache
830 generaldelta
830 generaldelta
831 persistent-nodemap (rust !)
831 persistent-nodemap (rust !)
832 revlogv1
832 revlogv1
833 share-safe
833 share-safe
834 store
834 store
835
835
836 store directory has files we expect
836 store directory has files we expect
837
837
838 $ ls .hg/store
838 $ ls .hg/store
839 00changelog-????????.nd (glob) (rust !)
840 00changelog.d
839 00changelog.i
841 00changelog.i
842 00changelog.n (rust !)
840 00manifest.i
843 00manifest.i
841 data
844 data
842 data-s
845 data-s
843 fncache
846 fncache
844 phaseroots
847 phaseroots
845 requires
848 requires
846 undo
849 undo
847 undo.backupfiles
850 undo.backupfiles
848
851
849 manifest should be generaldelta
852 manifest should be generaldelta
850
853
851 $ hg debugrevlog -m | grep flags
854 $ hg debugrevlog -m | grep flags
852 flags : inline, generaldelta
855 flags : inline, generaldelta
853
856
854 verify should be happy
857 verify should be happy
855
858
856 $ hg verify -q
859 $ hg verify -q
857
860
858 old store should be backed up
861 old store should be backed up
859
862
860 $ ls -d .hg/upgradebackup.*/
863 $ ls -d .hg/upgradebackup.*/
861 .hg/upgradebackup.*/ (glob)
864 .hg/upgradebackup.*/ (glob)
862 $ ls .hg/upgradebackup.*/store
865 $ ls .hg/upgradebackup.*/store
866 00changelog-????????.nd (glob) (rust !)
867 00changelog.d
863 00changelog.i
868 00changelog.i
869 00changelog.n (rust !)
864 00manifest.i
870 00manifest.i
865 data
871 data
866 data-s
872 data-s
867 fncache
873 fncache
868 phaseroots
874 phaseroots
869 requires
875 requires
870 undo
876 undo
877 undo.backup.00changelog.n.bck (rust !)
871 undo.backup.fncache.bck
878 undo.backup.fncache.bck
872 undo.backupfiles
879 undo.backupfiles
873
880
874 unless --no-backup is passed
881 unless --no-backup is passed
875
882
876 $ rm -rf .hg/upgradebackup.*/
883 $ rm -rf .hg/upgradebackup.*/
877 $ hg debugupgraderepo --run --no-backup
884 $ hg debugupgraderepo --run --no-backup
878 note: selecting all-filelogs for processing to change: sparserevlog
885 note: selecting all-filelogs for processing to change: sparserevlog
879 note: selecting all-manifestlogs for processing to change: sparserevlog
886 note: selecting all-manifestlogs for processing to change: sparserevlog
880 note: selecting changelog for processing to change: sparserevlog
887 note: selecting changelog for processing to change: sparserevlog
881
888
882 upgrade will perform the following actions:
889 upgrade will perform the following actions:
883
890
884 requirements
891 requirements
885 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
892 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
886 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
893 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
887 added: sparserevlog
894 added: sparserevlog
888
895
889 sparserevlog
896 sparserevlog
890 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
897 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
891
898
892 processed revlogs:
899 processed revlogs:
893 - all-filelogs
900 - all-filelogs
894 - changelog
901 - changelog
895 - manifest
902 - manifest
896
903
897 beginning upgrade...
904 beginning upgrade...
898 repository locked and read-only
905 repository locked and read-only
899 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
906 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
900 (it is safe to interrupt this process any time before data migration completes)
907 (it is safe to interrupt this process any time before data migration completes)
901 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
908 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
902 migrating 519 KB in store; 1.05 MB tracked data
909 migrating 519 KB in store; 1.05 MB tracked data
903 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
910 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
904 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
911 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
905 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
912 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
906 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
913 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
907 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
914 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
908 finished migrating 3 changelog revisions; change in size: 0 bytes
915 finished migrating 3 changelog revisions; change in size: 0 bytes
909 finished migrating 9 total revisions; total change in store size: 0 bytes
916 finished migrating 9 total revisions; total change in store size: 0 bytes
910 copying phaseroots
917 copying phaseroots
911 copying requires
918 copying requires
912 data fully upgraded in a temporary repository
919 data fully upgraded in a temporary repository
913 marking source repository as being upgraded; clients will be unable to read from repository
920 marking source repository as being upgraded; clients will be unable to read from repository
914 starting in-place swap of repository data
921 starting in-place swap of repository data
915 replacing store...
922 replacing store...
916 store replacement complete; repository was inconsistent for * (glob)
923 store replacement complete; repository was inconsistent for * (glob)
917 finalizing requirements file and making repository readable again
924 finalizing requirements file and making repository readable again
918 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
925 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
919 $ ls -1 .hg/ | grep upgradebackup
926 $ ls -1 .hg/ | grep upgradebackup
920 [1]
927 [1]
921
928
922 We can restrict optimization to some revlog:
929 We can restrict optimization to some revlog:
923
930
924 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
931 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
925 upgrade will perform the following actions:
932 upgrade will perform the following actions:
926
933
927 requirements
934 requirements
928 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
935 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
929 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
936 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
930
937
931 optimisations: re-delta-parent
938 optimisations: re-delta-parent
932
939
933 re-delta-parent
940 re-delta-parent
934 deltas within internal storage will choose a new base revision if needed
941 deltas within internal storage will choose a new base revision if needed
935
942
936 processed revlogs:
943 processed revlogs:
937 - manifest
944 - manifest
938
945
939 beginning upgrade...
946 beginning upgrade...
940 repository locked and read-only
947 repository locked and read-only
941 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
948 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
942 (it is safe to interrupt this process any time before data migration completes)
949 (it is safe to interrupt this process any time before data migration completes)
943 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
950 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
944 migrating 519 KB in store; 1.05 MB tracked data
951 migrating 519 KB in store; 1.05 MB tracked data
945 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
952 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
946 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
953 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
947 blindly copying data/f0.i containing 1 revisions
954 blindly copying data/f0.i containing 1 revisions
948 blindly copying data/f2.i containing 1 revisions
955 blindly copying data/f2.i containing 1 revisions
949 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
956 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
950 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
957 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
951 cloning 3 revisions from 00manifest.i
958 cloning 3 revisions from 00manifest.i
952 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
959 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
953 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
960 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
954 blindly copying 00changelog.i containing 3 revisions
961 blindly copying 00changelog.i containing 3 revisions
955 finished migrating 3 changelog revisions; change in size: 0 bytes
962 finished migrating 3 changelog revisions; change in size: 0 bytes
956 finished migrating 9 total revisions; total change in store size: 0 bytes
963 finished migrating 9 total revisions; total change in store size: 0 bytes
957 copying phaseroots
964 copying phaseroots
958 copying requires
965 copying requires
959 data fully upgraded in a temporary repository
966 data fully upgraded in a temporary repository
960 marking source repository as being upgraded; clients will be unable to read from repository
967 marking source repository as being upgraded; clients will be unable to read from repository
961 starting in-place swap of repository data
968 starting in-place swap of repository data
962 replacing store...
969 replacing store...
963 store replacement complete; repository was inconsistent for *s (glob)
970 store replacement complete; repository was inconsistent for *s (glob)
964 finalizing requirements file and making repository readable again
971 finalizing requirements file and making repository readable again
965 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
972 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
966
973
967 Check that the repo still works fine
974 Check that the repo still works fine
968
975
969 $ hg log -G --stat
976 $ hg log -G --stat
970 @ changeset: 2:fca376863211
977 @ changeset: 2:fca376863211
971 | tag: tip
978 | tag: tip
972 | parent: 0:ba592bf28da2
979 | parent: 0:ba592bf28da2
973 | user: test
980 | user: test
974 | date: Thu Jan 01 00:00:00 1970 +0000
981 | date: Thu Jan 01 00:00:00 1970 +0000
975 | summary: add f2
982 | summary: add f2
976 |
983 |
977 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
984 | f2 | 100000 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
978 | 1 files changed, 100000 insertions(+), 0 deletions(-)
985 | 1 files changed, 100000 insertions(+), 0 deletions(-)
979 |
986 |
980 | o changeset: 1:2029ce2354e2
987 | o changeset: 1:2029ce2354e2
981 |/ user: test
988 |/ user: test
982 | date: Thu Jan 01 00:00:00 1970 +0000
989 | date: Thu Jan 01 00:00:00 1970 +0000
983 | summary: add f1
990 | summary: add f1
984 |
991 |
985 |
992 |
986 o changeset: 0:ba592bf28da2
993 o changeset: 0:ba592bf28da2
987 user: test
994 user: test
988 date: Thu Jan 01 00:00:00 1970 +0000
995 date: Thu Jan 01 00:00:00 1970 +0000
989 summary: initial
996 summary: initial
990
997
991
998
992
999
993 $ hg verify -q
1000 $ hg verify -q
994
1001
995 Check we can select negatively
1002 Check we can select negatively
996
1003
997 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
1004 $ hg debugupgrade --optimize re-delta-parent --run --no-manifest --no-backup --debug --traceback
998 upgrade will perform the following actions:
1005 upgrade will perform the following actions:
999
1006
1000 requirements
1007 requirements
1001 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1008 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1002 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1009 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1003
1010
1004 optimisations: re-delta-parent
1011 optimisations: re-delta-parent
1005
1012
1006 re-delta-parent
1013 re-delta-parent
1007 deltas within internal storage will choose a new base revision if needed
1014 deltas within internal storage will choose a new base revision if needed
1008
1015
1009 processed revlogs:
1016 processed revlogs:
1010 - all-filelogs
1017 - all-filelogs
1011 - changelog
1018 - changelog
1012
1019
1013 beginning upgrade...
1020 beginning upgrade...
1014 repository locked and read-only
1021 repository locked and read-only
1015 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1022 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1016 (it is safe to interrupt this process any time before data migration completes)
1023 (it is safe to interrupt this process any time before data migration completes)
1017 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1024 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1018 migrating 519 KB in store; 1.05 MB tracked data
1025 migrating 519 KB in store; 1.05 MB tracked data
1019 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1026 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1020 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1027 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1021 cloning 1 revisions from data/f0.i
1028 cloning 1 revisions from data/f0.i
1022 cloning 1 revisions from data/f2.i
1029 cloning 1 revisions from data/f2.i
1023 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1030 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1024 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1031 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1025 blindly copying 00manifest.i containing 3 revisions
1032 blindly copying 00manifest.i containing 3 revisions
1026 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1033 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1027 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1034 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1028 cloning 3 revisions from 00changelog.i
1035 cloning 3 revisions from 00changelog.i
1029 finished migrating 3 changelog revisions; change in size: 0 bytes
1036 finished migrating 3 changelog revisions; change in size: 0 bytes
1030 finished migrating 9 total revisions; total change in store size: 0 bytes
1037 finished migrating 9 total revisions; total change in store size: 0 bytes
1031 copying phaseroots
1038 copying phaseroots
1032 copying requires
1039 copying requires
1033 data fully upgraded in a temporary repository
1040 data fully upgraded in a temporary repository
1034 marking source repository as being upgraded; clients will be unable to read from repository
1041 marking source repository as being upgraded; clients will be unable to read from repository
1035 starting in-place swap of repository data
1042 starting in-place swap of repository data
1036 replacing store...
1043 replacing store...
1037 store replacement complete; repository was inconsistent for *s (glob)
1044 store replacement complete; repository was inconsistent for *s (glob)
1038 finalizing requirements file and making repository readable again
1045 finalizing requirements file and making repository readable again
1039 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1046 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1040 $ hg verify -q
1047 $ hg verify -q
1041
1048
1042 Check that we can select changelog only
1049 Check that we can select changelog only
1043
1050
1044 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
1051 $ hg debugupgrade --optimize re-delta-parent --run --changelog --no-backup --debug --traceback
1045 upgrade will perform the following actions:
1052 upgrade will perform the following actions:
1046
1053
1047 requirements
1054 requirements
1048 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1055 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1049 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1056 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1050
1057
1051 optimisations: re-delta-parent
1058 optimisations: re-delta-parent
1052
1059
1053 re-delta-parent
1060 re-delta-parent
1054 deltas within internal storage will choose a new base revision if needed
1061 deltas within internal storage will choose a new base revision if needed
1055
1062
1056 processed revlogs:
1063 processed revlogs:
1057 - changelog
1064 - changelog
1058
1065
1059 beginning upgrade...
1066 beginning upgrade...
1060 repository locked and read-only
1067 repository locked and read-only
1061 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1068 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1062 (it is safe to interrupt this process any time before data migration completes)
1069 (it is safe to interrupt this process any time before data migration completes)
1063 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1070 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1064 migrating 519 KB in store; 1.05 MB tracked data
1071 migrating 519 KB in store; 1.05 MB tracked data
1065 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1072 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1066 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
1073 blindly copying data/FooBarDirectory.d/f1.i containing 1 revisions
1067 blindly copying data/f0.i containing 1 revisions
1074 blindly copying data/f0.i containing 1 revisions
1068 blindly copying data/f2.i containing 1 revisions
1075 blindly copying data/f2.i containing 1 revisions
1069 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1076 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1070 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1077 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1071 blindly copying 00manifest.i containing 3 revisions
1078 blindly copying 00manifest.i containing 3 revisions
1072 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1079 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1073 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1080 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1074 cloning 3 revisions from 00changelog.i
1081 cloning 3 revisions from 00changelog.i
1075 finished migrating 3 changelog revisions; change in size: 0 bytes
1082 finished migrating 3 changelog revisions; change in size: 0 bytes
1076 finished migrating 9 total revisions; total change in store size: 0 bytes
1083 finished migrating 9 total revisions; total change in store size: 0 bytes
1077 copying phaseroots
1084 copying phaseroots
1078 copying requires
1085 copying requires
1079 data fully upgraded in a temporary repository
1086 data fully upgraded in a temporary repository
1080 marking source repository as being upgraded; clients will be unable to read from repository
1087 marking source repository as being upgraded; clients will be unable to read from repository
1081 starting in-place swap of repository data
1088 starting in-place swap of repository data
1082 replacing store...
1089 replacing store...
1083 store replacement complete; repository was inconsistent for *s (glob)
1090 store replacement complete; repository was inconsistent for *s (glob)
1084 finalizing requirements file and making repository readable again
1091 finalizing requirements file and making repository readable again
1085 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1092 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1086 $ hg verify -q
1093 $ hg verify -q
1087
1094
1088 Check that we can select filelog only
1095 Check that we can select filelog only
1089
1096
1090 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
1097 $ hg debugupgrade --optimize re-delta-parent --run --no-changelog --no-manifest --no-backup --debug --traceback
1091 upgrade will perform the following actions:
1098 upgrade will perform the following actions:
1092
1099
1093 requirements
1100 requirements
1094 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1101 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1095 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1102 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1096
1103
1097 optimisations: re-delta-parent
1104 optimisations: re-delta-parent
1098
1105
1099 re-delta-parent
1106 re-delta-parent
1100 deltas within internal storage will choose a new base revision if needed
1107 deltas within internal storage will choose a new base revision if needed
1101
1108
1102 processed revlogs:
1109 processed revlogs:
1103 - all-filelogs
1110 - all-filelogs
1104
1111
1105 beginning upgrade...
1112 beginning upgrade...
1106 repository locked and read-only
1113 repository locked and read-only
1107 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1114 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1108 (it is safe to interrupt this process any time before data migration completes)
1115 (it is safe to interrupt this process any time before data migration completes)
1109 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1116 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1110 migrating 519 KB in store; 1.05 MB tracked data
1117 migrating 519 KB in store; 1.05 MB tracked data
1111 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1118 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1112 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1119 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1113 cloning 1 revisions from data/f0.i
1120 cloning 1 revisions from data/f0.i
1114 cloning 1 revisions from data/f2.i
1121 cloning 1 revisions from data/f2.i
1115 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1122 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1116 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1123 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1117 blindly copying 00manifest.i containing 3 revisions
1124 blindly copying 00manifest.i containing 3 revisions
1118 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1125 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1119 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1126 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1120 blindly copying 00changelog.i containing 3 revisions
1127 blindly copying 00changelog.i containing 3 revisions
1121 finished migrating 3 changelog revisions; change in size: 0 bytes
1128 finished migrating 3 changelog revisions; change in size: 0 bytes
1122 finished migrating 9 total revisions; total change in store size: 0 bytes
1129 finished migrating 9 total revisions; total change in store size: 0 bytes
1123 copying phaseroots
1130 copying phaseroots
1124 copying requires
1131 copying requires
1125 data fully upgraded in a temporary repository
1132 data fully upgraded in a temporary repository
1126 marking source repository as being upgraded; clients will be unable to read from repository
1133 marking source repository as being upgraded; clients will be unable to read from repository
1127 starting in-place swap of repository data
1134 starting in-place swap of repository data
1128 replacing store...
1135 replacing store...
1129 store replacement complete; repository was inconsistent for *s (glob)
1136 store replacement complete; repository was inconsistent for *s (glob)
1130 finalizing requirements file and making repository readable again
1137 finalizing requirements file and making repository readable again
1131 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1138 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1132 $ hg verify -q
1139 $ hg verify -q
1133
1140
1134
1141
1135 Check you can't skip revlog clone during important format downgrade
1142 Check you can't skip revlog clone during important format downgrade
1136
1143
1137 $ echo "[format]" > .hg/hgrc
1144 $ echo "[format]" > .hg/hgrc
1138 $ echo "sparse-revlog=no" >> .hg/hgrc
1145 $ echo "sparse-revlog=no" >> .hg/hgrc
1139 $ hg debugupgrade --optimize re-delta-parent --no-manifest --no-backup --quiet
1146 $ hg debugupgrade --optimize re-delta-parent --no-manifest --no-backup --quiet
1140 warning: ignoring --no-manifest, as upgrade is changing: sparserevlog
1147 warning: ignoring --no-manifest, as upgrade is changing: sparserevlog
1141
1148
1142 requirements
1149 requirements
1143 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1150 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1144 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1151 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1145 removed: sparserevlog
1152 removed: sparserevlog
1146
1153
1147 optimisations: re-delta-parent
1154 optimisations: re-delta-parent
1148
1155
1149 processed revlogs:
1156 processed revlogs:
1150 - all-filelogs
1157 - all-filelogs
1151 - changelog
1158 - changelog
1152 - manifest
1159 - manifest
1153
1160
1154 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1161 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1155 note: selecting all-filelogs for processing to change: sparserevlog
1162 note: selecting all-filelogs for processing to change: sparserevlog
1156 note: selecting changelog for processing to change: sparserevlog
1163 note: selecting changelog for processing to change: sparserevlog
1157
1164
1158 upgrade will perform the following actions:
1165 upgrade will perform the following actions:
1159
1166
1160 requirements
1167 requirements
1161 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1168 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1162 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1169 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1163 removed: sparserevlog
1170 removed: sparserevlog
1164
1171
1165 optimisations: re-delta-parent
1172 optimisations: re-delta-parent
1166
1173
1167 re-delta-parent
1174 re-delta-parent
1168 deltas within internal storage will choose a new base revision if needed
1175 deltas within internal storage will choose a new base revision if needed
1169
1176
1170 processed revlogs:
1177 processed revlogs:
1171 - all-filelogs
1178 - all-filelogs
1172 - changelog
1179 - changelog
1173 - manifest
1180 - manifest
1174
1181
1175 beginning upgrade...
1182 beginning upgrade...
1176 repository locked and read-only
1183 repository locked and read-only
1177 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1184 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1178 (it is safe to interrupt this process any time before data migration completes)
1185 (it is safe to interrupt this process any time before data migration completes)
1179 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1186 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1180 migrating 519 KB in store; 1.05 MB tracked data
1187 migrating 519 KB in store; 1.05 MB tracked data
1181 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1188 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1182 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1189 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1183 cloning 1 revisions from data/f0.i
1190 cloning 1 revisions from data/f0.i
1184 cloning 1 revisions from data/f2.i
1191 cloning 1 revisions from data/f2.i
1185 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1192 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1186 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1193 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1187 cloning 3 revisions from 00manifest.i
1194 cloning 3 revisions from 00manifest.i
1188 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1195 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1189 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1196 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1190 cloning 3 revisions from 00changelog.i
1197 cloning 3 revisions from 00changelog.i
1191 finished migrating 3 changelog revisions; change in size: 0 bytes
1198 finished migrating 3 changelog revisions; change in size: 0 bytes
1192 finished migrating 9 total revisions; total change in store size: 0 bytes
1199 finished migrating 9 total revisions; total change in store size: 0 bytes
1193 copying phaseroots
1200 copying phaseroots
1194 copying requires
1201 copying requires
1195 data fully upgraded in a temporary repository
1202 data fully upgraded in a temporary repository
1196 marking source repository as being upgraded; clients will be unable to read from repository
1203 marking source repository as being upgraded; clients will be unable to read from repository
1197 starting in-place swap of repository data
1204 starting in-place swap of repository data
1198 replacing store...
1205 replacing store...
1199 store replacement complete; repository was inconsistent for *s (glob)
1206 store replacement complete; repository was inconsistent for *s (glob)
1200 finalizing requirements file and making repository readable again
1207 finalizing requirements file and making repository readable again
1201 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1208 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1202 $ hg verify -q
1209 $ hg verify -q
1203
1210
1204 Check you can't skip revlog clone during important format upgrade
1211 Check you can't skip revlog clone during important format upgrade
1205
1212
1206 $ echo "sparse-revlog=yes" >> .hg/hgrc
1213 $ echo "sparse-revlog=yes" >> .hg/hgrc
1207 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1214 $ hg debugupgrade --optimize re-delta-parent --run --manifest --no-backup --debug --traceback
1208 note: selecting all-filelogs for processing to change: sparserevlog
1215 note: selecting all-filelogs for processing to change: sparserevlog
1209 note: selecting changelog for processing to change: sparserevlog
1216 note: selecting changelog for processing to change: sparserevlog
1210
1217
1211 upgrade will perform the following actions:
1218 upgrade will perform the following actions:
1212
1219
1213 requirements
1220 requirements
1214 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1221 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1215 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1222 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1216 added: sparserevlog
1223 added: sparserevlog
1217
1224
1218 optimisations: re-delta-parent
1225 optimisations: re-delta-parent
1219
1226
1220 sparserevlog
1227 sparserevlog
1221 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
1228 Revlog supports delta chain with more unused data between payload. These gaps will be skipped at read time. This allows for better delta chains, making a better compression and faster exchange with server.
1222
1229
1223 re-delta-parent
1230 re-delta-parent
1224 deltas within internal storage will choose a new base revision if needed
1231 deltas within internal storage will choose a new base revision if needed
1225
1232
1226 processed revlogs:
1233 processed revlogs:
1227 - all-filelogs
1234 - all-filelogs
1228 - changelog
1235 - changelog
1229 - manifest
1236 - manifest
1230
1237
1231 beginning upgrade...
1238 beginning upgrade...
1232 repository locked and read-only
1239 repository locked and read-only
1233 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1240 creating temporary repository to stage upgraded data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1234 (it is safe to interrupt this process any time before data migration completes)
1241 (it is safe to interrupt this process any time before data migration completes)
1235 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1242 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1236 migrating 519 KB in store; 1.05 MB tracked data
1243 migrating 519 KB in store; 1.05 MB tracked data
1237 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1244 migrating 3 filelogs containing 3 revisions (518 KB in store; 1.05 MB tracked data)
1238 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1245 cloning 1 revisions from data/FooBarDirectory.d/f1.i
1239 cloning 1 revisions from data/f0.i
1246 cloning 1 revisions from data/f0.i
1240 cloning 1 revisions from data/f2.i
1247 cloning 1 revisions from data/f2.i
1241 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1248 finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
1242 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1249 migrating 1 manifests containing 3 revisions (367 bytes in store; 238 bytes tracked data)
1243 cloning 3 revisions from 00manifest.i
1250 cloning 3 revisions from 00manifest.i
1244 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1251 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1245 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1252 migrating changelog containing 3 revisions (394 bytes in store; 199 bytes tracked data)
1246 cloning 3 revisions from 00changelog.i
1253 cloning 3 revisions from 00changelog.i
1247 finished migrating 3 changelog revisions; change in size: 0 bytes
1254 finished migrating 3 changelog revisions; change in size: 0 bytes
1248 finished migrating 9 total revisions; total change in store size: 0 bytes
1255 finished migrating 9 total revisions; total change in store size: 0 bytes
1249 copying phaseroots
1256 copying phaseroots
1250 copying requires
1257 copying requires
1251 data fully upgraded in a temporary repository
1258 data fully upgraded in a temporary repository
1252 marking source repository as being upgraded; clients will be unable to read from repository
1259 marking source repository as being upgraded; clients will be unable to read from repository
1253 starting in-place swap of repository data
1260 starting in-place swap of repository data
1254 replacing store...
1261 replacing store...
1255 store replacement complete; repository was inconsistent for *s (glob)
1262 store replacement complete; repository was inconsistent for *s (glob)
1256 finalizing requirements file and making repository readable again
1263 finalizing requirements file and making repository readable again
1257 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1264 removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
1258 $ hg verify -q
1265 $ hg verify -q
1259
1266
1260 $ cd ..
1267 $ cd ..
1261
1268
1262 store files with special filenames aren't encoded during copy
1269 store files with special filenames aren't encoded during copy
1263
1270
1264 $ hg init store-filenames
1271 $ hg init store-filenames
1265 $ cd store-filenames
1272 $ cd store-filenames
1266 $ touch foo
1273 $ touch foo
1267 $ hg -q commit -A -m initial
1274 $ hg -q commit -A -m initial
1268 $ touch .hg/store/.XX_special_filename
1275 $ touch .hg/store/.XX_special_filename
1269
1276
1270 $ hg debugupgraderepo --run
1277 $ hg debugupgraderepo --run
1271 nothing to do
1278 nothing to do
1272 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1279 $ hg debugupgraderepo --run --optimize 're-delta-fulladd'
1273 upgrade will perform the following actions:
1280 upgrade will perform the following actions:
1274
1281
1275 requirements
1282 requirements
1276 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1283 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1277 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1284 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1278
1285
1279 optimisations: re-delta-fulladd
1286 optimisations: re-delta-fulladd
1280
1287
1281 re-delta-fulladd
1288 re-delta-fulladd
1282 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1289 each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
1283
1290
1284 processed revlogs:
1291 processed revlogs:
1285 - all-filelogs
1292 - all-filelogs
1286 - changelog
1293 - changelog
1287 - manifest
1294 - manifest
1288
1295
1289 beginning upgrade...
1296 beginning upgrade...
1290 repository locked and read-only
1297 repository locked and read-only
1291 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1298 creating temporary repository to stage upgraded data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1292 (it is safe to interrupt this process any time before data migration completes)
1299 (it is safe to interrupt this process any time before data migration completes)
1293 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1300 migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
1294 migrating 301 bytes in store; 107 bytes tracked data
1301 migrating 301 bytes in store; 107 bytes tracked data
1295 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1302 migrating 1 filelogs containing 1 revisions (64 bytes in store; 0 bytes tracked data)
1296 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1303 finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
1297 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1304 migrating 1 manifests containing 1 revisions (110 bytes in store; 45 bytes tracked data)
1298 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1305 finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
1299 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1306 migrating changelog containing 1 revisions (127 bytes in store; 62 bytes tracked data)
1300 finished migrating 1 changelog revisions; change in size: 0 bytes
1307 finished migrating 1 changelog revisions; change in size: 0 bytes
1301 finished migrating 3 total revisions; total change in store size: 0 bytes
1308 finished migrating 3 total revisions; total change in store size: 0 bytes
1302 copying .XX_special_filename
1309 copying .XX_special_filename
1303 copying phaseroots
1310 copying phaseroots
1304 copying requires
1311 copying requires
1305 data fully upgraded in a temporary repository
1312 data fully upgraded in a temporary repository
1306 marking source repository as being upgraded; clients will be unable to read from repository
1313 marking source repository as being upgraded; clients will be unable to read from repository
1307 starting in-place swap of repository data
1314 starting in-place swap of repository data
1308 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1315 replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1309 replacing store...
1316 replacing store...
1310 store replacement complete; repository was inconsistent for *s (glob)
1317 store replacement complete; repository was inconsistent for *s (glob)
1311 finalizing requirements file and making repository readable again
1318 finalizing requirements file and making repository readable again
1312 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1319 removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
1313 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1320 copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
1314 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1321 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1315
1322
1316 fncache is valid after upgrade
1323 fncache is valid after upgrade
1317
1324
1318 $ hg debugrebuildfncache
1325 $ hg debugrebuildfncache
1319 fncache already up to date
1326 fncache already up to date
1320
1327
1321 $ cd ..
1328 $ cd ..
1322
1329
1323 Check upgrading a large file repository
1330 Check upgrading a large file repository
1324 ---------------------------------------
1331 ---------------------------------------
1325
1332
1326 $ hg init largefilesrepo
1333 $ hg init largefilesrepo
1327 $ cat << EOF >> largefilesrepo/.hg/hgrc
1334 $ cat << EOF >> largefilesrepo/.hg/hgrc
1328 > [extensions]
1335 > [extensions]
1329 > largefiles =
1336 > largefiles =
1330 > EOF
1337 > EOF
1331
1338
1332 $ cd largefilesrepo
1339 $ cd largefilesrepo
1333 $ touch foo
1340 $ touch foo
1334 $ hg add --large foo
1341 $ hg add --large foo
1335 $ hg -q commit -m initial
1342 $ hg -q commit -m initial
1336 $ hg debugrequires
1343 $ hg debugrequires
1337 dotencode
1344 dotencode
1338 fncache
1345 fncache
1339 generaldelta
1346 generaldelta
1340 largefiles
1347 largefiles
1341 persistent-nodemap (rust !)
1348 persistent-nodemap (rust !)
1342 revlogv1
1349 revlogv1
1343 share-safe
1350 share-safe
1344 sparserevlog
1351 sparserevlog
1345 store
1352 store
1346
1353
1347 $ hg debugupgraderepo --run
1354 $ hg debugupgraderepo --run
1348 nothing to do
1355 nothing to do
1349 $ hg debugrequires
1356 $ hg debugrequires
1350 dotencode
1357 dotencode
1351 fncache
1358 fncache
1352 generaldelta
1359 generaldelta
1353 largefiles
1360 largefiles
1354 persistent-nodemap (rust !)
1361 persistent-nodemap (rust !)
1355 revlogv1
1362 revlogv1
1356 share-safe
1363 share-safe
1357 sparserevlog
1364 sparserevlog
1358 store
1365 store
1359
1366
1360 $ cat << EOF >> .hg/hgrc
1367 $ cat << EOF >> .hg/hgrc
1361 > [extensions]
1368 > [extensions]
1362 > lfs =
1369 > lfs =
1363 > [lfs]
1370 > [lfs]
1364 > threshold = 10
1371 > threshold = 10
1365 > EOF
1372 > EOF
1366 $ echo '123456789012345' > lfs.bin
1373 $ echo '123456789012345' > lfs.bin
1367 $ hg ci -Am 'lfs.bin'
1374 $ hg ci -Am 'lfs.bin'
1368 adding lfs.bin
1375 adding lfs.bin
1369 $ hg debugrequires | grep lfs
1376 $ hg debugrequires | grep lfs
1370 lfs
1377 lfs
1371 $ find .hg/store/lfs -type f
1378 $ find .hg/store/lfs -type f
1372 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1379 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1373
1380
1374 $ hg debugupgraderepo --run
1381 $ hg debugupgraderepo --run
1375 nothing to do
1382 nothing to do
1376
1383
1377 $ hg debugrequires | grep lfs
1384 $ hg debugrequires | grep lfs
1378 lfs
1385 lfs
1379 $ find .hg/store/lfs -type f
1386 $ find .hg/store/lfs -type f
1380 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1387 .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1381 $ hg verify -q
1388 $ hg verify -q
1382 $ hg debugdata lfs.bin 0
1389 $ hg debugdata lfs.bin 0
1383 version https://git-lfs.github.com/spec/v1
1390 version https://git-lfs.github.com/spec/v1
1384 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1391 oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
1385 size 16
1392 size 16
1386 x-is-binary 0
1393 x-is-binary 0
1387
1394
1388 $ cd ..
1395 $ cd ..
1389
1396
1390 repository config is taken in account
1397 repository config is taken in account
1391 -------------------------------------
1398 -------------------------------------
1392
1399
1393 $ cat << EOF >> $HGRCPATH
1400 $ cat << EOF >> $HGRCPATH
1394 > [format]
1401 > [format]
1395 > maxchainlen = 1
1402 > maxchainlen = 1
1396 > EOF
1403 > EOF
1397
1404
1398 $ hg init localconfig
1405 $ hg init localconfig
1399 $ cd localconfig
1406 $ cd localconfig
1400 $ cat << EOF > file
1407 $ cat << EOF > file
1401 > some content
1408 > some content
1402 > with some length
1409 > with some length
1403 > to make sure we get a delta
1410 > to make sure we get a delta
1404 > after changes
1411 > after changes
1405 > very long
1412 > very long
1406 > very long
1413 > very long
1407 > very long
1414 > very long
1408 > very long
1415 > very long
1409 > very long
1416 > very long
1410 > very long
1417 > very long
1411 > very long
1418 > very long
1412 > very long
1419 > very long
1413 > very long
1420 > very long
1414 > very long
1421 > very long
1415 > very long
1422 > very long
1416 > EOF
1423 > EOF
1417 $ hg -q commit -A -m A
1424 $ hg -q commit -A -m A
1418 $ echo "new line" >> file
1425 $ echo "new line" >> file
1419 $ hg -q commit -m B
1426 $ hg -q commit -m B
1420 $ echo "new line" >> file
1427 $ echo "new line" >> file
1421 $ hg -q commit -m C
1428 $ hg -q commit -m C
1422
1429
1423 $ cat << EOF >> .hg/hgrc
1430 $ cat << EOF >> .hg/hgrc
1424 > [format]
1431 > [format]
1425 > maxchainlen = 9001
1432 > maxchainlen = 9001
1426 > EOF
1433 > EOF
1427 $ hg config format
1434 $ hg config format
1428 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1435 format.revlog-compression=$BUNDLE2_COMPRESSIONS$
1429 format.maxchainlen=9001
1436 format.maxchainlen=9001
1430 $ hg debugdeltachain file --all-info
1437 $ hg debugdeltachain file --all-info
1431 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1438 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1432 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1439 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1433 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1440 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1434 2 1 -1 1 2 0 snap 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1441 2 1 -1 1 2 0 snap 30 200 107 0.53500 128 21 0.19626 128 128 0.83594 1
1435
1442
1436 $ hg debugupgraderepo --run --optimize 're-delta-all'
1443 $ hg debugupgraderepo --run --optimize 're-delta-all'
1437 upgrade will perform the following actions:
1444 upgrade will perform the following actions:
1438
1445
1439 requirements
1446 requirements
1440 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1447 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1441 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1448 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1442
1449
1443 optimisations: re-delta-all
1450 optimisations: re-delta-all
1444
1451
1445 re-delta-all
1452 re-delta-all
1446 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1453 deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
1447
1454
1448 processed revlogs:
1455 processed revlogs:
1449 - all-filelogs
1456 - all-filelogs
1450 - changelog
1457 - changelog
1451 - manifest
1458 - manifest
1452
1459
1453 beginning upgrade...
1460 beginning upgrade...
1454 repository locked and read-only
1461 repository locked and read-only
1455 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1462 creating temporary repository to stage upgraded data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
1456 (it is safe to interrupt this process any time before data migration completes)
1463 (it is safe to interrupt this process any time before data migration completes)
1457 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1464 migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
1458 migrating 1019 bytes in store; 882 bytes tracked data
1465 migrating 1019 bytes in store; 882 bytes tracked data
1459 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1466 migrating 1 filelogs containing 3 revisions (320 bytes in store; 573 bytes tracked data)
1460 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1467 finished migrating 3 filelog revisions across 1 filelogs; change in size: -9 bytes
1461 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1468 migrating 1 manifests containing 3 revisions (333 bytes in store; 138 bytes tracked data)
1462 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1469 finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
1463 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1470 migrating changelog containing 3 revisions (366 bytes in store; 171 bytes tracked data)
1464 finished migrating 3 changelog revisions; change in size: 0 bytes
1471 finished migrating 3 changelog revisions; change in size: 0 bytes
1465 finished migrating 9 total revisions; total change in store size: -9 bytes
1472 finished migrating 9 total revisions; total change in store size: -9 bytes
1466 copying phaseroots
1473 copying phaseroots
1467 copying requires
1474 copying requires
1468 data fully upgraded in a temporary repository
1475 data fully upgraded in a temporary repository
1469 marking source repository as being upgraded; clients will be unable to read from repository
1476 marking source repository as being upgraded; clients will be unable to read from repository
1470 starting in-place swap of repository data
1477 starting in-place swap of repository data
1471 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1478 replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1472 replacing store...
1479 replacing store...
1473 store replacement complete; repository was inconsistent for *s (glob)
1480 store replacement complete; repository was inconsistent for *s (glob)
1474 finalizing requirements file and making repository readable again
1481 finalizing requirements file and making repository readable again
1475 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1482 removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
1476 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1483 copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
1477 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1484 the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
1478 $ hg debugdeltachain file --all-info
1485 $ hg debugdeltachain file --all-info
1479 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1486 rev p1 p2 chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio readsize largestblk rddensity srchunks
1480 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1487 0 -1 -1 1 1 -1 base 77 182 77 0.42308 77 0 0.00000 77 77 1.00000 1
1481 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1488 1 0 -1 1 2 0 p1 21 191 98 0.51309 98 0 0.00000 98 98 1.00000 1
1482 2 1 -1 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1489 2 1 -1 1 3 1 p1 21 200 119 0.59500 119 0 0.00000 119 119 1.00000 1
1483 $ cd ..
1490 $ cd ..
1484
1491
1485 $ cat << EOF >> $HGRCPATH
1492 $ cat << EOF >> $HGRCPATH
1486 > [format]
1493 > [format]
1487 > maxchainlen = 9001
1494 > maxchainlen = 9001
1488 > EOF
1495 > EOF
1489
1496
1490 Check upgrading a sparse-revlog repository
1497 Check upgrading a sparse-revlog repository
1491 ---------------------------------------
1498 ---------------------------------------
1492
1499
1493 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1500 $ hg init sparserevlogrepo --config format.sparse-revlog=no
1494 $ cd sparserevlogrepo
1501 $ cd sparserevlogrepo
1495 $ touch foo
1502 $ touch foo
1496 $ hg add foo
1503 $ hg add foo
1497 $ hg -q commit -m "foo"
1504 $ hg -q commit -m "foo"
1498 $ hg debugrequires
1505 $ hg debugrequires
1499 dotencode
1506 dotencode
1500 fncache
1507 fncache
1501 generaldelta
1508 generaldelta
1502 persistent-nodemap (rust !)
1509 persistent-nodemap (rust !)
1503 revlogv1
1510 revlogv1
1504 share-safe
1511 share-safe
1505 store
1512 store
1506
1513
1507 Check that we can add the sparse-revlog format requirement
1514 Check that we can add the sparse-revlog format requirement
1508 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1515 $ hg --config format.sparse-revlog=yes debugupgraderepo --run --quiet
1509 upgrade will perform the following actions:
1516 upgrade will perform the following actions:
1510
1517
1511 requirements
1518 requirements
1512 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1519 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1513 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1520 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1514 added: sparserevlog
1521 added: sparserevlog
1515
1522
1516 processed revlogs:
1523 processed revlogs:
1517 - all-filelogs
1524 - all-filelogs
1518 - changelog
1525 - changelog
1519 - manifest
1526 - manifest
1520
1527
1521 $ hg debugrequires
1528 $ hg debugrequires
1522 dotencode
1529 dotencode
1523 fncache
1530 fncache
1524 generaldelta
1531 generaldelta
1525 persistent-nodemap (rust !)
1532 persistent-nodemap (rust !)
1526 revlogv1
1533 revlogv1
1527 share-safe
1534 share-safe
1528 sparserevlog
1535 sparserevlog
1529 store
1536 store
1530
1537
1531 Check that we can remove the sparse-revlog format requirement
1538 Check that we can remove the sparse-revlog format requirement
1532 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1539 $ hg --config format.sparse-revlog=no debugupgraderepo --run --quiet
1533 upgrade will perform the following actions:
1540 upgrade will perform the following actions:
1534
1541
1535 requirements
1542 requirements
1536 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1543 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1537 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1544 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1538 removed: sparserevlog
1545 removed: sparserevlog
1539
1546
1540 processed revlogs:
1547 processed revlogs:
1541 - all-filelogs
1548 - all-filelogs
1542 - changelog
1549 - changelog
1543 - manifest
1550 - manifest
1544
1551
1545 $ hg debugrequires
1552 $ hg debugrequires
1546 dotencode
1553 dotencode
1547 fncache
1554 fncache
1548 generaldelta
1555 generaldelta
1549 persistent-nodemap (rust !)
1556 persistent-nodemap (rust !)
1550 revlogv1
1557 revlogv1
1551 share-safe
1558 share-safe
1552 store
1559 store
1553
1560
1554 #if zstd
1561 #if zstd
1555
1562
1556 Check upgrading to a zstd revlog
1563 Check upgrading to a zstd revlog
1557 --------------------------------
1564 --------------------------------
1558
1565
1559 upgrade
1566 upgrade
1560
1567
1561 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1568 $ hg --config format.revlog-compression=zstd debugupgraderepo --run --no-backup --quiet
1562 upgrade will perform the following actions:
1569 upgrade will perform the following actions:
1563
1570
1564 requirements
1571 requirements
1565 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1572 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, store (no-rust !)
1566 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1573 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, store (rust !)
1567 added: revlog-compression-zstd, sparserevlog
1574 added: revlog-compression-zstd, sparserevlog
1568
1575
1569 processed revlogs:
1576 processed revlogs:
1570 - all-filelogs
1577 - all-filelogs
1571 - changelog
1578 - changelog
1572 - manifest
1579 - manifest
1573
1580
1574 $ hg debugformat -v
1581 $ hg debugformat -v
1575 format-variant repo config default
1582 format-variant repo config default
1576 fncache: yes yes yes
1583 fncache: yes yes yes
1577 dirstate-v2: no no no
1584 dirstate-v2: no no no
1578 tracked-hint: no no no
1585 tracked-hint: no no no
1579 dotencode: yes yes yes
1586 dotencode: yes yes yes
1580 generaldelta: yes yes yes
1587 generaldelta: yes yes yes
1581 share-safe: yes yes yes
1588 share-safe: yes yes yes
1582 sparserevlog: yes yes yes
1589 sparserevlog: yes yes yes
1583 persistent-nodemap: no no no (no-rust !)
1590 persistent-nodemap: no no no (no-rust !)
1584 persistent-nodemap: yes yes no (rust !)
1591 persistent-nodemap: yes yes no (rust !)
1585 copies-sdc: no no no
1592 copies-sdc: no no no
1586 revlog-v2: no no no
1593 revlog-v2: no no no
1587 changelog-v2: no no no
1594 changelog-v2: no no no
1588 plain-cl-delta: yes yes yes
1595 plain-cl-delta: yes yes yes
1589 compression: zlib zlib zlib (no-zstd !)
1596 compression: zlib zlib zlib (no-zstd !)
1590 compression: zstd zlib zstd (zstd !)
1597 compression: zstd zlib zstd (zstd !)
1591 compression-level: default default default
1598 compression-level: default default default
1592 $ hg debugrequires
1599 $ hg debugrequires
1593 dotencode
1600 dotencode
1594 fncache
1601 fncache
1595 generaldelta
1602 generaldelta
1596 persistent-nodemap (rust !)
1603 persistent-nodemap (rust !)
1597 revlog-compression-zstd
1604 revlog-compression-zstd
1598 revlogv1
1605 revlogv1
1599 share-safe
1606 share-safe
1600 sparserevlog
1607 sparserevlog
1601 store
1608 store
1602
1609
1603 downgrade
1610 downgrade
1604
1611
1605 $ hg debugupgraderepo --run --no-backup --quiet
1612 $ hg debugupgraderepo --run --no-backup --quiet
1606 upgrade will perform the following actions:
1613 upgrade will perform the following actions:
1607
1614
1608 requirements
1615 requirements
1609 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1616 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1610 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1617 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1611 removed: revlog-compression-zstd
1618 removed: revlog-compression-zstd
1612
1619
1613 processed revlogs:
1620 processed revlogs:
1614 - all-filelogs
1621 - all-filelogs
1615 - changelog
1622 - changelog
1616 - manifest
1623 - manifest
1617
1624
1618 $ hg debugformat -v
1625 $ hg debugformat -v
1619 format-variant repo config default
1626 format-variant repo config default
1620 fncache: yes yes yes
1627 fncache: yes yes yes
1621 dirstate-v2: no no no
1628 dirstate-v2: no no no
1622 tracked-hint: no no no
1629 tracked-hint: no no no
1623 dotencode: yes yes yes
1630 dotencode: yes yes yes
1624 generaldelta: yes yes yes
1631 generaldelta: yes yes yes
1625 share-safe: yes yes yes
1632 share-safe: yes yes yes
1626 sparserevlog: yes yes yes
1633 sparserevlog: yes yes yes
1627 persistent-nodemap: no no no (no-rust !)
1634 persistent-nodemap: no no no (no-rust !)
1628 persistent-nodemap: yes yes no (rust !)
1635 persistent-nodemap: yes yes no (rust !)
1629 copies-sdc: no no no
1636 copies-sdc: no no no
1630 revlog-v2: no no no
1637 revlog-v2: no no no
1631 changelog-v2: no no no
1638 changelog-v2: no no no
1632 plain-cl-delta: yes yes yes
1639 plain-cl-delta: yes yes yes
1633 compression: zlib zlib zlib (no-zstd !)
1640 compression: zlib zlib zlib (no-zstd !)
1634 compression: zlib zlib zstd (zstd !)
1641 compression: zlib zlib zstd (zstd !)
1635 compression-level: default default default
1642 compression-level: default default default
1636 $ hg debugrequires
1643 $ hg debugrequires
1637 dotencode
1644 dotencode
1638 fncache
1645 fncache
1639 generaldelta
1646 generaldelta
1640 persistent-nodemap (rust !)
1647 persistent-nodemap (rust !)
1641 revlogv1
1648 revlogv1
1642 share-safe
1649 share-safe
1643 sparserevlog
1650 sparserevlog
1644 store
1651 store
1645
1652
1646 upgrade from hgrc
1653 upgrade from hgrc
1647
1654
1648 $ cat >> .hg/hgrc << EOF
1655 $ cat >> .hg/hgrc << EOF
1649 > [format]
1656 > [format]
1650 > revlog-compression=zstd
1657 > revlog-compression=zstd
1651 > EOF
1658 > EOF
1652 $ hg debugupgraderepo --run --no-backup --quiet
1659 $ hg debugupgraderepo --run --no-backup --quiet
1653 upgrade will perform the following actions:
1660 upgrade will perform the following actions:
1654
1661
1655 requirements
1662 requirements
1656 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1663 preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-rust !)
1657 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1664 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (rust !)
1658 added: revlog-compression-zstd
1665 added: revlog-compression-zstd
1659
1666
1660 processed revlogs:
1667 processed revlogs:
1661 - all-filelogs
1668 - all-filelogs
1662 - changelog
1669 - changelog
1663 - manifest
1670 - manifest
1664
1671
1665 $ hg debugformat -v
1672 $ hg debugformat -v
1666 format-variant repo config default
1673 format-variant repo config default
1667 fncache: yes yes yes
1674 fncache: yes yes yes
1668 dirstate-v2: no no no
1675 dirstate-v2: no no no
1669 tracked-hint: no no no
1676 tracked-hint: no no no
1670 dotencode: yes yes yes
1677 dotencode: yes yes yes
1671 generaldelta: yes yes yes
1678 generaldelta: yes yes yes
1672 share-safe: yes yes yes
1679 share-safe: yes yes yes
1673 sparserevlog: yes yes yes
1680 sparserevlog: yes yes yes
1674 persistent-nodemap: no no no (no-rust !)
1681 persistent-nodemap: no no no (no-rust !)
1675 persistent-nodemap: yes yes no (rust !)
1682 persistent-nodemap: yes yes no (rust !)
1676 copies-sdc: no no no
1683 copies-sdc: no no no
1677 revlog-v2: no no no
1684 revlog-v2: no no no
1678 changelog-v2: no no no
1685 changelog-v2: no no no
1679 plain-cl-delta: yes yes yes
1686 plain-cl-delta: yes yes yes
1680 compression: zlib zlib zlib (no-zstd !)
1687 compression: zlib zlib zlib (no-zstd !)
1681 compression: zstd zstd zstd (zstd !)
1688 compression: zstd zstd zstd (zstd !)
1682 compression-level: default default default
1689 compression-level: default default default
1683 $ hg debugrequires
1690 $ hg debugrequires
1684 dotencode
1691 dotencode
1685 fncache
1692 fncache
1686 generaldelta
1693 generaldelta
1687 persistent-nodemap (rust !)
1694 persistent-nodemap (rust !)
1688 revlog-compression-zstd
1695 revlog-compression-zstd
1689 revlogv1
1696 revlogv1
1690 share-safe
1697 share-safe
1691 sparserevlog
1698 sparserevlog
1692 store
1699 store
1693
1700
1694 #endif
1701 #endif
1695
1702
1696 Check upgrading to a revlog format supporting sidedata
1703 Check upgrading to a revlog format supporting sidedata
1697 ------------------------------------------------------
1704 ------------------------------------------------------
1698
1705
1699 upgrade
1706 upgrade
1700
1707
1701 $ hg debugsidedata -c 0
1708 $ hg debugsidedata -c 0
1702 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1709 $ hg --config experimental.revlogv2=enable-unstable-format-and-corrupt-my-data debugupgraderepo --run --no-backup --config "extensions.sidedata=$TESTDIR/testlib/ext-sidedata.py" --quiet
1703 upgrade will perform the following actions:
1710 upgrade will perform the following actions:
1704
1711
1705 requirements
1712 requirements
1706 preserved: dotencode, fncache, generaldelta, share-safe, store (no-zstd !)
1713 preserved: dotencode, fncache, generaldelta, share-safe, store (no-zstd !)
1707 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1714 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1708 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1715 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1709 removed: revlogv1
1716 removed: revlogv1
1710 added: exp-revlogv2.2 (zstd !)
1717 added: exp-revlogv2.2 (zstd !)
1711 added: exp-revlogv2.2, sparserevlog (no-zstd !)
1718 added: exp-revlogv2.2, sparserevlog (no-zstd !)
1712
1719
1713 processed revlogs:
1720 processed revlogs:
1714 - all-filelogs
1721 - all-filelogs
1715 - changelog
1722 - changelog
1716 - manifest
1723 - manifest
1717
1724
1718 $ hg debugformat -v
1725 $ hg debugformat -v
1719 format-variant repo config default
1726 format-variant repo config default
1720 fncache: yes yes yes
1727 fncache: yes yes yes
1721 dirstate-v2: no no no
1728 dirstate-v2: no no no
1722 tracked-hint: no no no
1729 tracked-hint: no no no
1723 dotencode: yes yes yes
1730 dotencode: yes yes yes
1724 generaldelta: yes yes yes
1731 generaldelta: yes yes yes
1725 share-safe: yes yes yes
1732 share-safe: yes yes yes
1726 sparserevlog: yes yes yes
1733 sparserevlog: yes yes yes
1727 persistent-nodemap: no no no (no-rust !)
1734 persistent-nodemap: no no no (no-rust !)
1728 persistent-nodemap: yes yes no (rust !)
1735 persistent-nodemap: yes yes no (rust !)
1729 copies-sdc: no no no
1736 copies-sdc: no no no
1730 revlog-v2: yes no no
1737 revlog-v2: yes no no
1731 changelog-v2: no no no
1738 changelog-v2: no no no
1732 plain-cl-delta: yes yes yes
1739 plain-cl-delta: yes yes yes
1733 compression: zlib zlib zlib (no-zstd !)
1740 compression: zlib zlib zlib (no-zstd !)
1734 compression: zstd zstd zstd (zstd !)
1741 compression: zstd zstd zstd (zstd !)
1735 compression-level: default default default
1742 compression-level: default default default
1736 $ hg debugrequires
1743 $ hg debugrequires
1737 dotencode
1744 dotencode
1738 exp-revlogv2.2
1745 exp-revlogv2.2
1739 fncache
1746 fncache
1740 generaldelta
1747 generaldelta
1741 persistent-nodemap (rust !)
1748 persistent-nodemap (rust !)
1742 revlog-compression-zstd (zstd !)
1749 revlog-compression-zstd (zstd !)
1743 share-safe
1750 share-safe
1744 sparserevlog
1751 sparserevlog
1745 store
1752 store
1746 $ hg debugsidedata -c 0
1753 $ hg debugsidedata -c 0
1747 2 sidedata entries
1754 2 sidedata entries
1748 entry-0001 size 4
1755 entry-0001 size 4
1749 entry-0002 size 32
1756 entry-0002 size 32
1750
1757
1751 downgrade
1758 downgrade
1752
1759
1753 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
1760 $ hg debugupgraderepo --config experimental.revlogv2=no --run --no-backup --quiet
1754 upgrade will perform the following actions:
1761 upgrade will perform the following actions:
1755
1762
1756 requirements
1763 requirements
1757 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1764 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1758 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1765 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1759 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1766 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1760 removed: exp-revlogv2.2
1767 removed: exp-revlogv2.2
1761 added: revlogv1
1768 added: revlogv1
1762
1769
1763 processed revlogs:
1770 processed revlogs:
1764 - all-filelogs
1771 - all-filelogs
1765 - changelog
1772 - changelog
1766 - manifest
1773 - manifest
1767
1774
1768 $ hg debugformat -v
1775 $ hg debugformat -v
1769 format-variant repo config default
1776 format-variant repo config default
1770 fncache: yes yes yes
1777 fncache: yes yes yes
1771 dirstate-v2: no no no
1778 dirstate-v2: no no no
1772 tracked-hint: no no no
1779 tracked-hint: no no no
1773 dotencode: yes yes yes
1780 dotencode: yes yes yes
1774 generaldelta: yes yes yes
1781 generaldelta: yes yes yes
1775 share-safe: yes yes yes
1782 share-safe: yes yes yes
1776 sparserevlog: yes yes yes
1783 sparserevlog: yes yes yes
1777 persistent-nodemap: no no no (no-rust !)
1784 persistent-nodemap: no no no (no-rust !)
1778 persistent-nodemap: yes yes no (rust !)
1785 persistent-nodemap: yes yes no (rust !)
1779 copies-sdc: no no no
1786 copies-sdc: no no no
1780 revlog-v2: no no no
1787 revlog-v2: no no no
1781 changelog-v2: no no no
1788 changelog-v2: no no no
1782 plain-cl-delta: yes yes yes
1789 plain-cl-delta: yes yes yes
1783 compression: zlib zlib zlib (no-zstd !)
1790 compression: zlib zlib zlib (no-zstd !)
1784 compression: zstd zstd zstd (zstd !)
1791 compression: zstd zstd zstd (zstd !)
1785 compression-level: default default default
1792 compression-level: default default default
1786 $ hg debugrequires
1793 $ hg debugrequires
1787 dotencode
1794 dotencode
1788 fncache
1795 fncache
1789 generaldelta
1796 generaldelta
1790 persistent-nodemap (rust !)
1797 persistent-nodemap (rust !)
1791 revlog-compression-zstd (zstd !)
1798 revlog-compression-zstd (zstd !)
1792 revlogv1
1799 revlogv1
1793 share-safe
1800 share-safe
1794 sparserevlog
1801 sparserevlog
1795 store
1802 store
1796 $ hg debugsidedata -c 0
1803 $ hg debugsidedata -c 0
1797
1804
1798 upgrade from hgrc
1805 upgrade from hgrc
1799
1806
1800 $ cat >> .hg/hgrc << EOF
1807 $ cat >> .hg/hgrc << EOF
1801 > [experimental]
1808 > [experimental]
1802 > revlogv2=enable-unstable-format-and-corrupt-my-data
1809 > revlogv2=enable-unstable-format-and-corrupt-my-data
1803 > EOF
1810 > EOF
1804 $ hg debugupgraderepo --run --no-backup --quiet
1811 $ hg debugupgraderepo --run --no-backup --quiet
1805 upgrade will perform the following actions:
1812 upgrade will perform the following actions:
1806
1813
1807 requirements
1814 requirements
1808 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1815 preserved: dotencode, fncache, generaldelta, share-safe, sparserevlog, store (no-zstd !)
1809 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1816 preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, share-safe, sparserevlog, store (zstd no-rust !)
1810 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1817 preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, share-safe, sparserevlog, store (rust !)
1811 removed: revlogv1
1818 removed: revlogv1
1812 added: exp-revlogv2.2
1819 added: exp-revlogv2.2
1813
1820
1814 processed revlogs:
1821 processed revlogs:
1815 - all-filelogs
1822 - all-filelogs
1816 - changelog
1823 - changelog
1817 - manifest
1824 - manifest
1818
1825
1819 $ hg debugformat -v
1826 $ hg debugformat -v
1820 format-variant repo config default
1827 format-variant repo config default
1821 fncache: yes yes yes
1828 fncache: yes yes yes
1822 dirstate-v2: no no no
1829 dirstate-v2: no no no
1823 tracked-hint: no no no
1830 tracked-hint: no no no
1824 dotencode: yes yes yes
1831 dotencode: yes yes yes
1825 generaldelta: yes yes yes
1832 generaldelta: yes yes yes
1826 share-safe: yes yes yes
1833 share-safe: yes yes yes
1827 sparserevlog: yes yes yes
1834 sparserevlog: yes yes yes
1828 persistent-nodemap: no no no (no-rust !)
1835 persistent-nodemap: no no no (no-rust !)
1829 persistent-nodemap: yes yes no (rust !)
1836 persistent-nodemap: yes yes no (rust !)
1830 copies-sdc: no no no
1837 copies-sdc: no no no
1831 revlog-v2: yes yes no
1838 revlog-v2: yes yes no
1832 changelog-v2: no no no
1839 changelog-v2: no no no
1833 plain-cl-delta: yes yes yes
1840 plain-cl-delta: yes yes yes
1834 compression: zlib zlib zlib (no-zstd !)
1841 compression: zlib zlib zlib (no-zstd !)
1835 compression: zstd zstd zstd (zstd !)
1842 compression: zstd zstd zstd (zstd !)
1836 compression-level: default default default
1843 compression-level: default default default
1837 $ hg debugrequires
1844 $ hg debugrequires
1838 dotencode
1845 dotencode
1839 exp-revlogv2.2
1846 exp-revlogv2.2
1840 fncache
1847 fncache
1841 generaldelta
1848 generaldelta
1842 persistent-nodemap (rust !)
1849 persistent-nodemap (rust !)
1843 revlog-compression-zstd (zstd !)
1850 revlog-compression-zstd (zstd !)
1844 share-safe
1851 share-safe
1845 sparserevlog
1852 sparserevlog
1846 store
1853 store
1847 $ hg debugsidedata -c 0
1854 $ hg debugsidedata -c 0
1848
1855
1849 Demonstrate that nothing to perform upgrade will still run all the way through
1856 Demonstrate that nothing to perform upgrade will still run all the way through
1850
1857
1851 $ hg debugupgraderepo --run
1858 $ hg debugupgraderepo --run
1852 nothing to do
1859 nothing to do
1853
1860
1854 #if no-rust
1861 #if no-rust
1855
1862
1856 $ cat << EOF >> $HGRCPATH
1863 $ cat << EOF >> $HGRCPATH
1857 > [storage]
1864 > [storage]
1858 > dirstate-v2.slow-path = allow
1865 > dirstate-v2.slow-path = allow
1859 > EOF
1866 > EOF
1860
1867
1861 #endif
1868 #endif
1862
1869
1863 Upgrade to dirstate-v2
1870 Upgrade to dirstate-v2
1864
1871
1865 $ hg debugformat -v --config format.use-dirstate-v2=1 | grep dirstate-v2
1872 $ hg debugformat -v --config format.use-dirstate-v2=1 | grep dirstate-v2
1866 dirstate-v2: no yes no
1873 dirstate-v2: no yes no
1867 $ hg debugupgraderepo --config format.use-dirstate-v2=1 --run
1874 $ hg debugupgraderepo --config format.use-dirstate-v2=1 --run
1868 upgrade will perform the following actions:
1875 upgrade will perform the following actions:
1869
1876
1870 requirements
1877 requirements
1871 preserved: * (glob)
1878 preserved: * (glob)
1872 added: dirstate-v2
1879 added: dirstate-v2
1873
1880
1874 dirstate-v2
1881 dirstate-v2
1875 "hg status" will be faster
1882 "hg status" will be faster
1876
1883
1877 no revlogs to process
1884 no revlogs to process
1878
1885
1879 beginning upgrade...
1886 beginning upgrade...
1880 repository locked and read-only
1887 repository locked and read-only
1881 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1888 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1882 (it is safe to interrupt this process any time before data migration completes)
1889 (it is safe to interrupt this process any time before data migration completes)
1883 upgrading to dirstate-v2 from v1
1890 upgrading to dirstate-v2 from v1
1884 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1891 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1885 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1892 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1886 $ ls .hg/upgradebackup.*/dirstate
1893 $ ls .hg/upgradebackup.*/dirstate
1887 .hg/upgradebackup.*/dirstate (glob)
1894 .hg/upgradebackup.*/dirstate (glob)
1888 $ hg debugformat -v | grep dirstate-v2
1895 $ hg debugformat -v | grep dirstate-v2
1889 dirstate-v2: yes no no
1896 dirstate-v2: yes no no
1890 $ hg status
1897 $ hg status
1891 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
1898 $ dd bs=12 count=1 if=.hg/dirstate 2> /dev/null
1892 dirstate-v2
1899 dirstate-v2
1893
1900
1894 Downgrade from dirstate-v2
1901 Downgrade from dirstate-v2
1895
1902
1896 $ hg debugupgraderepo --run
1903 $ hg debugupgraderepo --run
1897 upgrade will perform the following actions:
1904 upgrade will perform the following actions:
1898
1905
1899 requirements
1906 requirements
1900 preserved: * (glob)
1907 preserved: * (glob)
1901 removed: dirstate-v2
1908 removed: dirstate-v2
1902
1909
1903 no revlogs to process
1910 no revlogs to process
1904
1911
1905 beginning upgrade...
1912 beginning upgrade...
1906 repository locked and read-only
1913 repository locked and read-only
1907 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1914 creating temporary repository to stage upgraded data: $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1908 (it is safe to interrupt this process any time before data migration completes)
1915 (it is safe to interrupt this process any time before data migration completes)
1909 downgrading from dirstate-v2 to v1
1916 downgrading from dirstate-v2 to v1
1910 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1917 replaced files will be backed up at $TESTTMP/sparserevlogrepo/.hg/upgradebackup.* (glob)
1911 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1918 removing temporary repository $TESTTMP/sparserevlogrepo/.hg/upgrade.* (glob)
1912 $ hg debugformat -v | grep dirstate-v2
1919 $ hg debugformat -v | grep dirstate-v2
1913 dirstate-v2: no no no
1920 dirstate-v2: no no no
1914 $ hg status
1921 $ hg status
1915
1922
1916 $ cd ..
1923 $ cd ..
1917
1924
1918 dirstate-v2: upgrade and downgrade from and empty repository:
1925 dirstate-v2: upgrade and downgrade from and empty repository:
1919 -------------------------------------------------------------
1926 -------------------------------------------------------------
1920
1927
1921 $ hg init --config format.use-dirstate-v2=no dirstate-v2-empty
1928 $ hg init --config format.use-dirstate-v2=no dirstate-v2-empty
1922 $ cd dirstate-v2-empty
1929 $ cd dirstate-v2-empty
1923 $ hg debugformat | grep dirstate-v2
1930 $ hg debugformat | grep dirstate-v2
1924 dirstate-v2: no
1931 dirstate-v2: no
1925
1932
1926 upgrade
1933 upgrade
1927
1934
1928 $ hg debugupgraderepo --run --config format.use-dirstate-v2=yes
1935 $ hg debugupgraderepo --run --config format.use-dirstate-v2=yes
1929 upgrade will perform the following actions:
1936 upgrade will perform the following actions:
1930
1937
1931 requirements
1938 requirements
1932 preserved: * (glob)
1939 preserved: * (glob)
1933 added: dirstate-v2
1940 added: dirstate-v2
1934
1941
1935 dirstate-v2
1942 dirstate-v2
1936 "hg status" will be faster
1943 "hg status" will be faster
1937
1944
1938 no revlogs to process
1945 no revlogs to process
1939
1946
1940 beginning upgrade...
1947 beginning upgrade...
1941 repository locked and read-only
1948 repository locked and read-only
1942 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1949 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1943 (it is safe to interrupt this process any time before data migration completes)
1950 (it is safe to interrupt this process any time before data migration completes)
1944 upgrading to dirstate-v2 from v1
1951 upgrading to dirstate-v2 from v1
1945 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1952 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1946 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1953 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1947 $ hg debugformat | grep dirstate-v2
1954 $ hg debugformat | grep dirstate-v2
1948 dirstate-v2: yes
1955 dirstate-v2: yes
1949
1956
1950 downgrade
1957 downgrade
1951
1958
1952 $ hg debugupgraderepo --run --config format.use-dirstate-v2=no
1959 $ hg debugupgraderepo --run --config format.use-dirstate-v2=no
1953 upgrade will perform the following actions:
1960 upgrade will perform the following actions:
1954
1961
1955 requirements
1962 requirements
1956 preserved: * (glob)
1963 preserved: * (glob)
1957 removed: dirstate-v2
1964 removed: dirstate-v2
1958
1965
1959 no revlogs to process
1966 no revlogs to process
1960
1967
1961 beginning upgrade...
1968 beginning upgrade...
1962 repository locked and read-only
1969 repository locked and read-only
1963 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1970 creating temporary repository to stage upgraded data: $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1964 (it is safe to interrupt this process any time before data migration completes)
1971 (it is safe to interrupt this process any time before data migration completes)
1965 downgrading from dirstate-v2 to v1
1972 downgrading from dirstate-v2 to v1
1966 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1973 replaced files will be backed up at $TESTTMP/dirstate-v2-empty/.hg/upgradebackup.* (glob)
1967 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1974 removing temporary repository $TESTTMP/dirstate-v2-empty/.hg/upgrade.* (glob)
1968 $ hg debugformat | grep dirstate-v2
1975 $ hg debugformat | grep dirstate-v2
1969 dirstate-v2: no
1976 dirstate-v2: no
1970
1977
1971 $ cd ..
1978 $ cd ..
1972
1979
1973 Test automatic upgrade/downgrade
1980 Test automatic upgrade/downgrade
1974 ================================
1981 ================================
1975
1982
1976
1983
1977 For dirstate v2
1984 For dirstate v2
1978 ---------------
1985 ---------------
1979
1986
1980 create an initial repository
1987 create an initial repository
1981
1988
1982 $ hg init auto-upgrade \
1989 $ hg init auto-upgrade \
1983 > --config format.use-dirstate-v2=no \
1990 > --config format.use-dirstate-v2=no \
1984 > --config format.use-dirstate-tracked-hint=yes \
1991 > --config format.use-dirstate-tracked-hint=yes \
1985 > --config format.use-share-safe=no
1992 > --config format.use-share-safe=no
1986 $ hg debugbuilddag -R auto-upgrade --new-file .+5
1993 $ hg debugbuilddag -R auto-upgrade --new-file .+5
1987 $ hg -R auto-upgrade update
1994 $ hg -R auto-upgrade update
1988 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1995 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1989 $ hg debugformat -R auto-upgrade | grep dirstate-v2
1996 $ hg debugformat -R auto-upgrade | grep dirstate-v2
1990 dirstate-v2: no
1997 dirstate-v2: no
1991
1998
1992 upgrade it to dirstate-v2 automatically
1999 upgrade it to dirstate-v2 automatically
1993
2000
1994 $ hg status -R auto-upgrade \
2001 $ hg status -R auto-upgrade \
1995 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2002 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
1996 > --config format.use-dirstate-v2=yes
2003 > --config format.use-dirstate-v2=yes
1997 automatically upgrading repository to the `dirstate-v2` feature
2004 automatically upgrading repository to the `dirstate-v2` feature
1998 (see `hg help config.format.use-dirstate-v2` for details)
2005 (see `hg help config.format.use-dirstate-v2` for details)
1999 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2006 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2000 dirstate-v2: yes
2007 dirstate-v2: yes
2001
2008
2002 downgrade it from dirstate-v2 automatically
2009 downgrade it from dirstate-v2 automatically
2003
2010
2004 $ hg status -R auto-upgrade \
2011 $ hg status -R auto-upgrade \
2005 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2012 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2006 > --config format.use-dirstate-v2=no
2013 > --config format.use-dirstate-v2=no
2007 automatically downgrading repository from the `dirstate-v2` feature
2014 automatically downgrading repository from the `dirstate-v2` feature
2008 (see `hg help config.format.use-dirstate-v2` for details)
2015 (see `hg help config.format.use-dirstate-v2` for details)
2009 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2016 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2010 dirstate-v2: no
2017 dirstate-v2: no
2011
2018
2012
2019
2013 For multiple change at the same time
2020 For multiple change at the same time
2014 ------------------------------------
2021 ------------------------------------
2015
2022
2016 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2023 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2017 dirstate-v2: no
2024 dirstate-v2: no
2018 tracked-hint: yes
2025 tracked-hint: yes
2019 share-safe: no
2026 share-safe: no
2020
2027
2021 $ hg status -R auto-upgrade \
2028 $ hg status -R auto-upgrade \
2022 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2029 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2023 > --config format.use-dirstate-v2=yes \
2030 > --config format.use-dirstate-v2=yes \
2024 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2031 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2025 > --config format.use-dirstate-tracked-hint=no\
2032 > --config format.use-dirstate-tracked-hint=no\
2026 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2033 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2027 > --config format.use-share-safe=yes
2034 > --config format.use-share-safe=yes
2028 automatically upgrading repository to the `dirstate-v2` feature
2035 automatically upgrading repository to the `dirstate-v2` feature
2029 (see `hg help config.format.use-dirstate-v2` for details)
2036 (see `hg help config.format.use-dirstate-v2` for details)
2030 automatically upgrading repository to the `share-safe` feature
2037 automatically upgrading repository to the `share-safe` feature
2031 (see `hg help config.format.use-share-safe` for details)
2038 (see `hg help config.format.use-share-safe` for details)
2032 automatically downgrading repository from the `tracked-hint` feature
2039 automatically downgrading repository from the `tracked-hint` feature
2033 (see `hg help config.format.use-dirstate-tracked-hint` for details)
2040 (see `hg help config.format.use-dirstate-tracked-hint` for details)
2034 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2041 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2035 dirstate-v2: yes
2042 dirstate-v2: yes
2036 tracked-hint: no
2043 tracked-hint: no
2037 share-safe: yes
2044 share-safe: yes
2038
2045
2039 Quiet upgrade and downgrade
2046 Quiet upgrade and downgrade
2040 ---------------------------
2047 ---------------------------
2041
2048
2042
2049
2043 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2050 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2044 dirstate-v2: yes
2051 dirstate-v2: yes
2045 tracked-hint: no
2052 tracked-hint: no
2046 share-safe: yes
2053 share-safe: yes
2047 $ hg status -R auto-upgrade \
2054 $ hg status -R auto-upgrade \
2048 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2055 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2049 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2056 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2050 > --config format.use-dirstate-v2=no \
2057 > --config format.use-dirstate-v2=no \
2051 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2058 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2052 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2059 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2053 > --config format.use-dirstate-tracked-hint=yes \
2060 > --config format.use-dirstate-tracked-hint=yes \
2054 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2061 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2055 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2062 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2056 > --config format.use-share-safe=no
2063 > --config format.use-share-safe=no
2057
2064
2058 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2065 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2059 dirstate-v2: no
2066 dirstate-v2: no
2060 tracked-hint: yes
2067 tracked-hint: yes
2061 share-safe: no
2068 share-safe: no
2062
2069
2063 $ hg status -R auto-upgrade \
2070 $ hg status -R auto-upgrade \
2064 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2071 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2065 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2072 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2066 > --config format.use-dirstate-v2=yes \
2073 > --config format.use-dirstate-v2=yes \
2067 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2074 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories=yes \
2068 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2075 > --config format.use-dirstate-tracked-hint.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2069 > --config format.use-dirstate-tracked-hint=no\
2076 > --config format.use-dirstate-tracked-hint=no\
2070 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2077 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories=yes \
2071 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2078 > --config format.use-share-safe.automatic-upgrade-of-mismatching-repositories:quiet=yes \
2072 > --config format.use-share-safe=yes
2079 > --config format.use-share-safe=yes
2073 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2080 $ hg debugformat -R auto-upgrade | grep -E '(dirstate-v2|tracked|share-safe)'
2074 dirstate-v2: yes
2081 dirstate-v2: yes
2075 tracked-hint: no
2082 tracked-hint: no
2076 share-safe: yes
2083 share-safe: yes
2077
2084
2078 Attempting Auto-upgrade on a read-only repository
2085 Attempting Auto-upgrade on a read-only repository
2079 -------------------------------------------------
2086 -------------------------------------------------
2080
2087
2081 $ chmod -R a-w auto-upgrade
2088 $ chmod -R a-w auto-upgrade
2082
2089
2083 $ hg status -R auto-upgrade \
2090 $ hg status -R auto-upgrade \
2084 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2091 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2085 > --config format.use-dirstate-v2=no
2092 > --config format.use-dirstate-v2=no
2086 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2093 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2087 dirstate-v2: yes
2094 dirstate-v2: yes
2088
2095
2089 $ chmod -R u+w auto-upgrade
2096 $ chmod -R u+w auto-upgrade
2090
2097
2091 Attempting Auto-upgrade on a locked repository
2098 Attempting Auto-upgrade on a locked repository
2092 ----------------------------------------------
2099 ----------------------------------------------
2093
2100
2094 $ hg -R auto-upgrade debuglock --set-lock --quiet &
2101 $ hg -R auto-upgrade debuglock --set-lock --quiet &
2095 $ echo $! >> $DAEMON_PIDS
2102 $ echo $! >> $DAEMON_PIDS
2096 $ $RUNTESTDIR/testlib/wait-on-file 10 auto-upgrade/.hg/store/lock
2103 $ $RUNTESTDIR/testlib/wait-on-file 10 auto-upgrade/.hg/store/lock
2097 $ hg status -R auto-upgrade \
2104 $ hg status -R auto-upgrade \
2098 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2105 > --config format.use-dirstate-v2.automatic-upgrade-of-mismatching-repositories=yes \
2099 > --config format.use-dirstate-v2=no
2106 > --config format.use-dirstate-v2=no
2100 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2107 $ hg debugformat -R auto-upgrade | grep dirstate-v2
2101 dirstate-v2: yes
2108 dirstate-v2: yes
2102
2109
2103 $ killdaemons.py
2110 $ killdaemons.py
General Comments 0
You need to be logged in to leave comments. Login now