Show More
@@ -1,1151 +1,1156 | |||||
1 | from __future__ import absolute_import, print_function |
|
1 | from __future__ import absolute_import, print_function | |
2 |
|
2 | |||
3 | import distutils.version |
|
3 | import distutils.version | |
4 | import os |
|
4 | import os | |
5 | import re |
|
5 | import re | |
6 | import socket |
|
6 | import socket | |
7 | import stat |
|
7 | import stat | |
8 | import subprocess |
|
8 | import subprocess | |
9 | import sys |
|
9 | import sys | |
10 | import tempfile |
|
10 | import tempfile | |
11 |
|
11 | |||
12 | tempprefix = 'hg-hghave-' |
|
12 | tempprefix = 'hg-hghave-' | |
13 |
|
13 | |||
14 | checks = { |
|
14 | checks = { | |
15 | "true": (lambda: True, "yak shaving"), |
|
15 | "true": (lambda: True, "yak shaving"), | |
16 | "false": (lambda: False, "nail clipper"), |
|
16 | "false": (lambda: False, "nail clipper"), | |
17 | "known-bad-output": (lambda: True, "use for currently known bad output"), |
|
17 | "known-bad-output": (lambda: True, "use for currently known bad output"), | |
18 | "missing-correct-output": (lambda: False, "use for missing good output"), |
|
18 | "missing-correct-output": (lambda: False, "use for missing good output"), | |
19 | } |
|
19 | } | |
20 |
|
20 | |||
21 | try: |
|
21 | try: | |
22 | import msvcrt |
|
22 | import msvcrt | |
23 |
|
23 | |||
24 | msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) |
|
24 | msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY) | |
25 | msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) |
|
25 | msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY) | |
26 | except ImportError: |
|
26 | except ImportError: | |
27 | pass |
|
27 | pass | |
28 |
|
28 | |||
29 | stdout = getattr(sys.stdout, 'buffer', sys.stdout) |
|
29 | stdout = getattr(sys.stdout, 'buffer', sys.stdout) | |
30 | stderr = getattr(sys.stderr, 'buffer', sys.stderr) |
|
30 | stderr = getattr(sys.stderr, 'buffer', sys.stderr) | |
31 |
|
31 | |||
32 | is_not_python2 = sys.version_info[0] >= 3 |
|
32 | is_not_python2 = sys.version_info[0] >= 3 | |
33 | if is_not_python2: |
|
33 | if is_not_python2: | |
34 |
|
34 | |||
35 | def _sys2bytes(p): |
|
35 | def _sys2bytes(p): | |
36 | if p is None: |
|
36 | if p is None: | |
37 | return p |
|
37 | return p | |
38 | return p.encode('utf-8') |
|
38 | return p.encode('utf-8') | |
39 |
|
39 | |||
40 | def _bytes2sys(p): |
|
40 | def _bytes2sys(p): | |
41 | if p is None: |
|
41 | if p is None: | |
42 | return p |
|
42 | return p | |
43 | return p.decode('utf-8') |
|
43 | return p.decode('utf-8') | |
44 |
|
44 | |||
45 |
|
45 | |||
46 | else: |
|
46 | else: | |
47 |
|
47 | |||
48 | def _sys2bytes(p): |
|
48 | def _sys2bytes(p): | |
49 | return p |
|
49 | return p | |
50 |
|
50 | |||
51 | _bytes2sys = _sys2bytes |
|
51 | _bytes2sys = _sys2bytes | |
52 |
|
52 | |||
53 |
|
53 | |||
54 | def check(name, desc): |
|
54 | def check(name, desc): | |
55 | """Registers a check function for a feature.""" |
|
55 | """Registers a check function for a feature.""" | |
56 |
|
56 | |||
57 | def decorator(func): |
|
57 | def decorator(func): | |
58 | checks[name] = (func, desc) |
|
58 | checks[name] = (func, desc) | |
59 | return func |
|
59 | return func | |
60 |
|
60 | |||
61 | return decorator |
|
61 | return decorator | |
62 |
|
62 | |||
63 |
|
63 | |||
64 | def checkvers(name, desc, vers): |
|
64 | def checkvers(name, desc, vers): | |
65 | """Registers a check function for each of a series of versions. |
|
65 | """Registers a check function for each of a series of versions. | |
66 |
|
66 | |||
67 | vers can be a list or an iterator. |
|
67 | vers can be a list or an iterator. | |
68 |
|
68 | |||
69 | Produces a series of feature checks that have the form <name><vers> without |
|
69 | Produces a series of feature checks that have the form <name><vers> without | |
70 | any punctuation (even if there's punctuation in 'vers'; i.e. this produces |
|
70 | any punctuation (even if there's punctuation in 'vers'; i.e. this produces | |
71 | 'py38', not 'py3.8' or 'py-38').""" |
|
71 | 'py38', not 'py3.8' or 'py-38').""" | |
72 |
|
72 | |||
73 | def decorator(func): |
|
73 | def decorator(func): | |
74 | def funcv(v): |
|
74 | def funcv(v): | |
75 | def f(): |
|
75 | def f(): | |
76 | return func(v) |
|
76 | return func(v) | |
77 |
|
77 | |||
78 | return f |
|
78 | return f | |
79 |
|
79 | |||
80 | for v in vers: |
|
80 | for v in vers: | |
81 | v = str(v) |
|
81 | v = str(v) | |
82 | f = funcv(v) |
|
82 | f = funcv(v) | |
83 | checks['%s%s' % (name, v.replace('.', ''))] = (f, desc % v) |
|
83 | checks['%s%s' % (name, v.replace('.', ''))] = (f, desc % v) | |
84 | return func |
|
84 | return func | |
85 |
|
85 | |||
86 | return decorator |
|
86 | return decorator | |
87 |
|
87 | |||
88 |
|
88 | |||
89 | def checkfeatures(features): |
|
89 | def checkfeatures(features): | |
90 | result = { |
|
90 | result = { | |
91 | 'error': [], |
|
91 | 'error': [], | |
92 | 'missing': [], |
|
92 | 'missing': [], | |
93 | 'skipped': [], |
|
93 | 'skipped': [], | |
94 | } |
|
94 | } | |
95 |
|
95 | |||
96 | for feature in features: |
|
96 | for feature in features: | |
97 | negate = feature.startswith('no-') |
|
97 | negate = feature.startswith('no-') | |
98 | if negate: |
|
98 | if negate: | |
99 | feature = feature[3:] |
|
99 | feature = feature[3:] | |
100 |
|
100 | |||
101 | if feature not in checks: |
|
101 | if feature not in checks: | |
102 | result['missing'].append(feature) |
|
102 | result['missing'].append(feature) | |
103 | continue |
|
103 | continue | |
104 |
|
104 | |||
105 | check, desc = checks[feature] |
|
105 | check, desc = checks[feature] | |
106 | try: |
|
106 | try: | |
107 | available = check() |
|
107 | available = check() | |
108 | except Exception as e: |
|
108 | except Exception as e: | |
109 | result['error'].append('hghave check %s failed: %r' % (feature, e)) |
|
109 | result['error'].append('hghave check %s failed: %r' % (feature, e)) | |
110 | continue |
|
110 | continue | |
111 |
|
111 | |||
112 | if not negate and not available: |
|
112 | if not negate and not available: | |
113 | result['skipped'].append('missing feature: %s' % desc) |
|
113 | result['skipped'].append('missing feature: %s' % desc) | |
114 | elif negate and available: |
|
114 | elif negate and available: | |
115 | result['skipped'].append('system supports %s' % desc) |
|
115 | result['skipped'].append('system supports %s' % desc) | |
116 |
|
116 | |||
117 | return result |
|
117 | return result | |
118 |
|
118 | |||
119 |
|
119 | |||
120 | def require(features): |
|
120 | def require(features): | |
121 | """Require that features are available, exiting if not.""" |
|
121 | """Require that features are available, exiting if not.""" | |
122 | result = checkfeatures(features) |
|
122 | result = checkfeatures(features) | |
123 |
|
123 | |||
124 | for missing in result['missing']: |
|
124 | for missing in result['missing']: | |
125 | stderr.write( |
|
125 | stderr.write( | |
126 | ('skipped: unknown feature: %s\n' % missing).encode('utf-8') |
|
126 | ('skipped: unknown feature: %s\n' % missing).encode('utf-8') | |
127 | ) |
|
127 | ) | |
128 | for msg in result['skipped']: |
|
128 | for msg in result['skipped']: | |
129 | stderr.write(('skipped: %s\n' % msg).encode('utf-8')) |
|
129 | stderr.write(('skipped: %s\n' % msg).encode('utf-8')) | |
130 | for msg in result['error']: |
|
130 | for msg in result['error']: | |
131 | stderr.write(('%s\n' % msg).encode('utf-8')) |
|
131 | stderr.write(('%s\n' % msg).encode('utf-8')) | |
132 |
|
132 | |||
133 | if result['missing']: |
|
133 | if result['missing']: | |
134 | sys.exit(2) |
|
134 | sys.exit(2) | |
135 |
|
135 | |||
136 | if result['skipped'] or result['error']: |
|
136 | if result['skipped'] or result['error']: | |
137 | sys.exit(1) |
|
137 | sys.exit(1) | |
138 |
|
138 | |||
139 |
|
139 | |||
140 | def matchoutput(cmd, regexp, ignorestatus=False): |
|
140 | def matchoutput(cmd, regexp, ignorestatus=False): | |
141 | """Return the match object if cmd executes successfully and its output |
|
141 | """Return the match object if cmd executes successfully and its output | |
142 | is matched by the supplied regular expression. |
|
142 | is matched by the supplied regular expression. | |
143 | """ |
|
143 | """ | |
144 |
|
144 | |||
145 | # Tests on Windows have to fake USERPROFILE to point to the test area so |
|
145 | # Tests on Windows have to fake USERPROFILE to point to the test area so | |
146 | # that `~` is properly expanded on py3.8+. However, some tools like black |
|
146 | # that `~` is properly expanded on py3.8+. However, some tools like black | |
147 | # make calls that need the real USERPROFILE in order to run `foo --version`. |
|
147 | # make calls that need the real USERPROFILE in order to run `foo --version`. | |
148 | env = os.environ |
|
148 | env = os.environ | |
149 | if os.name == 'nt': |
|
149 | if os.name == 'nt': | |
150 | env = os.environ.copy() |
|
150 | env = os.environ.copy() | |
151 | env['USERPROFILE'] = env['REALUSERPROFILE'] |
|
151 | env['USERPROFILE'] = env['REALUSERPROFILE'] | |
152 |
|
152 | |||
153 | r = re.compile(regexp) |
|
153 | r = re.compile(regexp) | |
154 | p = subprocess.Popen( |
|
154 | p = subprocess.Popen( | |
155 | cmd, |
|
155 | cmd, | |
156 | shell=True, |
|
156 | shell=True, | |
157 | stdout=subprocess.PIPE, |
|
157 | stdout=subprocess.PIPE, | |
158 | stderr=subprocess.STDOUT, |
|
158 | stderr=subprocess.STDOUT, | |
159 | env=env, |
|
159 | env=env, | |
160 | ) |
|
160 | ) | |
161 | s = p.communicate()[0] |
|
161 | s = p.communicate()[0] | |
162 | ret = p.returncode |
|
162 | ret = p.returncode | |
163 | return (ignorestatus or not ret) and r.search(s) |
|
163 | return (ignorestatus or not ret) and r.search(s) | |
164 |
|
164 | |||
165 |
|
165 | |||
166 | @check("baz", "GNU Arch baz client") |
|
166 | @check("baz", "GNU Arch baz client") | |
167 | def has_baz(): |
|
167 | def has_baz(): | |
168 | return matchoutput('baz --version 2>&1', br'baz Bazaar version') |
|
168 | return matchoutput('baz --version 2>&1', br'baz Bazaar version') | |
169 |
|
169 | |||
170 |
|
170 | |||
171 | @check("bzr", "Breezy library and executable version >= 3.1") |
|
171 | @check("bzr", "Breezy library and executable version >= 3.1") | |
172 | def has_bzr(): |
|
172 | def has_bzr(): | |
173 | if not is_not_python2: |
|
173 | if not is_not_python2: | |
174 | return False |
|
174 | return False | |
175 | try: |
|
175 | try: | |
176 | # Test the Breezy python lib |
|
176 | # Test the Breezy python lib | |
177 | import breezy |
|
177 | import breezy | |
178 | import breezy.bzr.bzrdir |
|
178 | import breezy.bzr.bzrdir | |
179 | import breezy.errors |
|
179 | import breezy.errors | |
180 | import breezy.revision |
|
180 | import breezy.revision | |
181 | import breezy.revisionspec |
|
181 | import breezy.revisionspec | |
182 |
|
182 | |||
183 | breezy.revisionspec.RevisionSpec |
|
183 | breezy.revisionspec.RevisionSpec | |
184 | if breezy.__doc__ is None or breezy.version_info[:2] < (3, 1): |
|
184 | if breezy.__doc__ is None or breezy.version_info[:2] < (3, 1): | |
185 | return False |
|
185 | return False | |
186 | except (AttributeError, ImportError): |
|
186 | except (AttributeError, ImportError): | |
187 | return False |
|
187 | return False | |
188 | # Test the executable |
|
188 | # Test the executable | |
189 | return matchoutput('brz --version 2>&1', br'Breezy \(brz\) ') |
|
189 | return matchoutput('brz --version 2>&1', br'Breezy \(brz\) ') | |
190 |
|
190 | |||
191 |
|
191 | |||
192 | @check("chg", "running with chg") |
|
192 | @check("chg", "running with chg") | |
193 | def has_chg(): |
|
193 | def has_chg(): | |
194 | return 'CHG_INSTALLED_AS_HG' in os.environ |
|
194 | return 'CHG_INSTALLED_AS_HG' in os.environ | |
195 |
|
195 | |||
196 |
|
196 | |||
197 | @check("rhg", "running with rhg as 'hg'") |
|
197 | @check("rhg", "running with rhg as 'hg'") | |
198 | def has_rhg(): |
|
198 | def has_rhg(): | |
199 | return 'RHG_INSTALLED_AS_HG' in os.environ |
|
199 | return 'RHG_INSTALLED_AS_HG' in os.environ | |
200 |
|
200 | |||
201 |
|
201 | |||
202 | @check("pyoxidizer", "running with pyoxidizer build as 'hg'") |
|
202 | @check("pyoxidizer", "running with pyoxidizer build as 'hg'") | |
203 | def has_rhg(): |
|
203 | def has_rhg(): | |
204 | return 'PYOXIDIZED_INSTALLED_AS_HG' in os.environ |
|
204 | return 'PYOXIDIZED_INSTALLED_AS_HG' in os.environ | |
205 |
|
205 | |||
206 |
|
206 | |||
207 | @check("cvs", "cvs client/server") |
|
207 | @check("cvs", "cvs client/server") | |
208 | def has_cvs(): |
|
208 | def has_cvs(): | |
209 | re = br'Concurrent Versions System.*?server' |
|
209 | re = br'Concurrent Versions System.*?server' | |
210 | return matchoutput('cvs --version 2>&1', re) and not has_msys() |
|
210 | return matchoutput('cvs --version 2>&1', re) and not has_msys() | |
211 |
|
211 | |||
212 |
|
212 | |||
213 | @check("cvs112", "cvs client/server 1.12.* (not cvsnt)") |
|
213 | @check("cvs112", "cvs client/server 1.12.* (not cvsnt)") | |
214 | def has_cvs112(): |
|
214 | def has_cvs112(): | |
215 | re = br'Concurrent Versions System \(CVS\) 1.12.*?server' |
|
215 | re = br'Concurrent Versions System \(CVS\) 1.12.*?server' | |
216 | return matchoutput('cvs --version 2>&1', re) and not has_msys() |
|
216 | return matchoutput('cvs --version 2>&1', re) and not has_msys() | |
217 |
|
217 | |||
218 |
|
218 | |||
219 | @check("cvsnt", "cvsnt client/server") |
|
219 | @check("cvsnt", "cvsnt client/server") | |
220 | def has_cvsnt(): |
|
220 | def has_cvsnt(): | |
221 | re = br'Concurrent Versions System \(CVSNT\) (\d+).(\d+).*\(client/server\)' |
|
221 | re = br'Concurrent Versions System \(CVSNT\) (\d+).(\d+).*\(client/server\)' | |
222 | return matchoutput('cvsnt --version 2>&1', re) |
|
222 | return matchoutput('cvsnt --version 2>&1', re) | |
223 |
|
223 | |||
224 |
|
224 | |||
225 | @check("darcs", "darcs client") |
|
225 | @check("darcs", "darcs client") | |
226 | def has_darcs(): |
|
226 | def has_darcs(): | |
227 | return matchoutput('darcs --version', br'\b2\.([2-9]|\d{2})', True) |
|
227 | return matchoutput('darcs --version', br'\b2\.([2-9]|\d{2})', True) | |
228 |
|
228 | |||
229 |
|
229 | |||
230 | @check("mtn", "monotone client (>= 1.0)") |
|
230 | @check("mtn", "monotone client (>= 1.0)") | |
231 | def has_mtn(): |
|
231 | def has_mtn(): | |
232 | return matchoutput('mtn --version', br'monotone', True) and not matchoutput( |
|
232 | return matchoutput('mtn --version', br'monotone', True) and not matchoutput( | |
233 | 'mtn --version', br'monotone 0\.', True |
|
233 | 'mtn --version', br'monotone 0\.', True | |
234 | ) |
|
234 | ) | |
235 |
|
235 | |||
236 |
|
236 | |||
237 | @check("eol-in-paths", "end-of-lines in paths") |
|
237 | @check("eol-in-paths", "end-of-lines in paths") | |
238 | def has_eol_in_paths(): |
|
238 | def has_eol_in_paths(): | |
239 | try: |
|
239 | try: | |
240 | fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix, suffix='\n\r') |
|
240 | fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix, suffix='\n\r') | |
241 | os.close(fd) |
|
241 | os.close(fd) | |
242 | os.remove(path) |
|
242 | os.remove(path) | |
243 | return True |
|
243 | return True | |
244 | except (IOError, OSError): |
|
244 | except (IOError, OSError): | |
245 | return False |
|
245 | return False | |
246 |
|
246 | |||
247 |
|
247 | |||
248 | @check("execbit", "executable bit") |
|
248 | @check("execbit", "executable bit") | |
249 | def has_executablebit(): |
|
249 | def has_executablebit(): | |
250 | try: |
|
250 | try: | |
251 | EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH |
|
251 | EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH | |
252 | fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix) |
|
252 | fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix) | |
253 | try: |
|
253 | try: | |
254 | os.close(fh) |
|
254 | os.close(fh) | |
255 | m = os.stat(fn).st_mode & 0o777 |
|
255 | m = os.stat(fn).st_mode & 0o777 | |
256 | new_file_has_exec = m & EXECFLAGS |
|
256 | new_file_has_exec = m & EXECFLAGS | |
257 | os.chmod(fn, m ^ EXECFLAGS) |
|
257 | os.chmod(fn, m ^ EXECFLAGS) | |
258 | exec_flags_cannot_flip = (os.stat(fn).st_mode & 0o777) == m |
|
258 | exec_flags_cannot_flip = (os.stat(fn).st_mode & 0o777) == m | |
259 | finally: |
|
259 | finally: | |
260 | os.unlink(fn) |
|
260 | os.unlink(fn) | |
261 | except (IOError, OSError): |
|
261 | except (IOError, OSError): | |
262 | # we don't care, the user probably won't be able to commit anyway |
|
262 | # we don't care, the user probably won't be able to commit anyway | |
263 | return False |
|
263 | return False | |
264 | return not (new_file_has_exec or exec_flags_cannot_flip) |
|
264 | return not (new_file_has_exec or exec_flags_cannot_flip) | |
265 |
|
265 | |||
266 |
|
266 | |||
267 | @check("suidbit", "setuid and setgid bit") |
|
267 | @check("suidbit", "setuid and setgid bit") | |
268 | def has_suidbit(): |
|
268 | def has_suidbit(): | |
269 | if ( |
|
269 | if ( | |
270 | getattr(os, "statvfs", None) is None |
|
270 | getattr(os, "statvfs", None) is None | |
271 | or getattr(os, "ST_NOSUID", None) is None |
|
271 | or getattr(os, "ST_NOSUID", None) is None | |
272 | ): |
|
272 | ): | |
273 | return False |
|
273 | return False | |
274 | return bool(os.statvfs('.').f_flag & os.ST_NOSUID) |
|
274 | return bool(os.statvfs('.').f_flag & os.ST_NOSUID) | |
275 |
|
275 | |||
276 |
|
276 | |||
277 | @check("icasefs", "case insensitive file system") |
|
277 | @check("icasefs", "case insensitive file system") | |
278 | def has_icasefs(): |
|
278 | def has_icasefs(): | |
279 | # Stolen from mercurial.util |
|
279 | # Stolen from mercurial.util | |
280 | fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix) |
|
280 | fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix) | |
281 | os.close(fd) |
|
281 | os.close(fd) | |
282 | try: |
|
282 | try: | |
283 | s1 = os.stat(path) |
|
283 | s1 = os.stat(path) | |
284 | d, b = os.path.split(path) |
|
284 | d, b = os.path.split(path) | |
285 | p2 = os.path.join(d, b.upper()) |
|
285 | p2 = os.path.join(d, b.upper()) | |
286 | if path == p2: |
|
286 | if path == p2: | |
287 | p2 = os.path.join(d, b.lower()) |
|
287 | p2 = os.path.join(d, b.lower()) | |
288 | try: |
|
288 | try: | |
289 | s2 = os.stat(p2) |
|
289 | s2 = os.stat(p2) | |
290 | return s2 == s1 |
|
290 | return s2 == s1 | |
291 | except OSError: |
|
291 | except OSError: | |
292 | return False |
|
292 | return False | |
293 | finally: |
|
293 | finally: | |
294 | os.remove(path) |
|
294 | os.remove(path) | |
295 |
|
295 | |||
296 |
|
296 | |||
297 | @check("fifo", "named pipes") |
|
297 | @check("fifo", "named pipes") | |
298 | def has_fifo(): |
|
298 | def has_fifo(): | |
299 | if getattr(os, "mkfifo", None) is None: |
|
299 | if getattr(os, "mkfifo", None) is None: | |
300 | return False |
|
300 | return False | |
301 | name = tempfile.mktemp(dir='.', prefix=tempprefix) |
|
301 | name = tempfile.mktemp(dir='.', prefix=tempprefix) | |
302 | try: |
|
302 | try: | |
303 | os.mkfifo(name) |
|
303 | os.mkfifo(name) | |
304 | os.unlink(name) |
|
304 | os.unlink(name) | |
305 | return True |
|
305 | return True | |
306 | except OSError: |
|
306 | except OSError: | |
307 | return False |
|
307 | return False | |
308 |
|
308 | |||
309 |
|
309 | |||
310 | @check("killdaemons", 'killdaemons.py support') |
|
310 | @check("killdaemons", 'killdaemons.py support') | |
311 | def has_killdaemons(): |
|
311 | def has_killdaemons(): | |
312 | return True |
|
312 | return True | |
313 |
|
313 | |||
314 |
|
314 | |||
315 | @check("cacheable", "cacheable filesystem") |
|
315 | @check("cacheable", "cacheable filesystem") | |
316 | def has_cacheable_fs(): |
|
316 | def has_cacheable_fs(): | |
317 | from mercurial import util |
|
317 | from mercurial import util | |
318 |
|
318 | |||
319 | fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix) |
|
319 | fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix) | |
320 | os.close(fd) |
|
320 | os.close(fd) | |
321 | try: |
|
321 | try: | |
322 | return util.cachestat(path).cacheable() |
|
322 | return util.cachestat(path).cacheable() | |
323 | finally: |
|
323 | finally: | |
324 | os.remove(path) |
|
324 | os.remove(path) | |
325 |
|
325 | |||
326 |
|
326 | |||
327 | @check("lsprof", "python lsprof module") |
|
327 | @check("lsprof", "python lsprof module") | |
328 | def has_lsprof(): |
|
328 | def has_lsprof(): | |
329 | try: |
|
329 | try: | |
330 | import _lsprof |
|
330 | import _lsprof | |
331 |
|
331 | |||
332 | _lsprof.Profiler # silence unused import warning |
|
332 | _lsprof.Profiler # silence unused import warning | |
333 | return True |
|
333 | return True | |
334 | except ImportError: |
|
334 | except ImportError: | |
335 | return False |
|
335 | return False | |
336 |
|
336 | |||
337 |
|
337 | |||
338 | def _gethgversion(): |
|
338 | def _gethgversion(): | |
339 | m = matchoutput('hg --version --quiet 2>&1', br'(\d+)\.(\d+)') |
|
339 | m = matchoutput('hg --version --quiet 2>&1', br'(\d+)\.(\d+)') | |
340 | if not m: |
|
340 | if not m: | |
341 | return (0, 0) |
|
341 | return (0, 0) | |
342 | return (int(m.group(1)), int(m.group(2))) |
|
342 | return (int(m.group(1)), int(m.group(2))) | |
343 |
|
343 | |||
344 |
|
344 | |||
345 | _hgversion = None |
|
345 | _hgversion = None | |
346 |
|
346 | |||
347 |
|
347 | |||
348 | def gethgversion(): |
|
348 | def gethgversion(): | |
349 | global _hgversion |
|
349 | global _hgversion | |
350 | if _hgversion is None: |
|
350 | if _hgversion is None: | |
351 | _hgversion = _gethgversion() |
|
351 | _hgversion = _gethgversion() | |
352 | return _hgversion |
|
352 | return _hgversion | |
353 |
|
353 | |||
354 |
|
354 | |||
355 | @checkvers( |
|
355 | @checkvers( | |
356 | "hg", "Mercurial >= %s", list([(1.0 * x) / 10 for x in range(9, 99)]) |
|
356 | "hg", "Mercurial >= %s", list([(1.0 * x) / 10 for x in range(9, 99)]) | |
357 | ) |
|
357 | ) | |
358 | def has_hg_range(v): |
|
358 | def has_hg_range(v): | |
359 | major, minor = v.split('.')[0:2] |
|
359 | major, minor = v.split('.')[0:2] | |
360 | return gethgversion() >= (int(major), int(minor)) |
|
360 | return gethgversion() >= (int(major), int(minor)) | |
361 |
|
361 | |||
362 |
|
362 | |||
363 | @check("rust", "Using the Rust extensions") |
|
363 | @check("rust", "Using the Rust extensions") | |
364 | def has_rust(): |
|
364 | def has_rust(): | |
365 | """Check is the mercurial currently running is using some rust code""" |
|
365 | """Check is the mercurial currently running is using some rust code""" | |
366 | cmd = 'hg debuginstall --quiet 2>&1' |
|
366 | cmd = 'hg debuginstall --quiet 2>&1' | |
367 | match = br'checking module policy \(([^)]+)\)' |
|
367 | match = br'checking module policy \(([^)]+)\)' | |
368 | policy = matchoutput(cmd, match) |
|
368 | policy = matchoutput(cmd, match) | |
369 | if not policy: |
|
369 | if not policy: | |
370 | return False |
|
370 | return False | |
371 | return b'rust' in policy.group(1) |
|
371 | return b'rust' in policy.group(1) | |
372 |
|
372 | |||
373 |
|
373 | |||
374 | @check("hg08", "Mercurial >= 0.8") |
|
374 | @check("hg08", "Mercurial >= 0.8") | |
375 | def has_hg08(): |
|
375 | def has_hg08(): | |
376 | if checks["hg09"][0](): |
|
376 | if checks["hg09"][0](): | |
377 | return True |
|
377 | return True | |
378 | return matchoutput('hg help annotate 2>&1', '--date') |
|
378 | return matchoutput('hg help annotate 2>&1', '--date') | |
379 |
|
379 | |||
380 |
|
380 | |||
381 | @check("hg07", "Mercurial >= 0.7") |
|
381 | @check("hg07", "Mercurial >= 0.7") | |
382 | def has_hg07(): |
|
382 | def has_hg07(): | |
383 | if checks["hg08"][0](): |
|
383 | if checks["hg08"][0](): | |
384 | return True |
|
384 | return True | |
385 | return matchoutput('hg --version --quiet 2>&1', 'Mercurial Distributed SCM') |
|
385 | return matchoutput('hg --version --quiet 2>&1', 'Mercurial Distributed SCM') | |
386 |
|
386 | |||
387 |
|
387 | |||
388 | @check("hg06", "Mercurial >= 0.6") |
|
388 | @check("hg06", "Mercurial >= 0.6") | |
389 | def has_hg06(): |
|
389 | def has_hg06(): | |
390 | if checks["hg07"][0](): |
|
390 | if checks["hg07"][0](): | |
391 | return True |
|
391 | return True | |
392 | return matchoutput('hg --version --quiet 2>&1', 'Mercurial version') |
|
392 | return matchoutput('hg --version --quiet 2>&1', 'Mercurial version') | |
393 |
|
393 | |||
394 |
|
394 | |||
395 | @check("gettext", "GNU Gettext (msgfmt)") |
|
395 | @check("gettext", "GNU Gettext (msgfmt)") | |
396 | def has_gettext(): |
|
396 | def has_gettext(): | |
397 | return matchoutput('msgfmt --version', br'GNU gettext-tools') |
|
397 | return matchoutput('msgfmt --version', br'GNU gettext-tools') | |
398 |
|
398 | |||
399 |
|
399 | |||
400 | @check("git", "git command line client") |
|
400 | @check("git", "git command line client") | |
401 | def has_git(): |
|
401 | def has_git(): | |
402 | return matchoutput('git --version 2>&1', br'^git version') |
|
402 | return matchoutput('git --version 2>&1', br'^git version') | |
403 |
|
403 | |||
404 |
|
404 | |||
405 | def getgitversion(): |
|
405 | def getgitversion(): | |
406 | m = matchoutput('git --version 2>&1', br'git version (\d+)\.(\d+)') |
|
406 | m = matchoutput('git --version 2>&1', br'git version (\d+)\.(\d+)') | |
407 | if not m: |
|
407 | if not m: | |
408 | return (0, 0) |
|
408 | return (0, 0) | |
409 | return (int(m.group(1)), int(m.group(2))) |
|
409 | return (int(m.group(1)), int(m.group(2))) | |
410 |
|
410 | |||
411 |
|
411 | |||
412 | @check("pygit2", "pygit2 Python library") |
|
412 | @check("pygit2", "pygit2 Python library") | |
413 | def has_git(): |
|
413 | def has_git(): | |
414 | try: |
|
414 | try: | |
415 | import pygit2 |
|
415 | import pygit2 | |
416 |
|
416 | |||
417 | pygit2.Oid # silence unused import |
|
417 | pygit2.Oid # silence unused import | |
418 | return True |
|
418 | return True | |
419 | except ImportError: |
|
419 | except ImportError: | |
420 | return False |
|
420 | return False | |
421 |
|
421 | |||
422 |
|
422 | |||
423 | # https://github.com/git-lfs/lfs-test-server |
|
423 | # https://github.com/git-lfs/lfs-test-server | |
424 | @check("lfs-test-server", "git-lfs test server") |
|
424 | @check("lfs-test-server", "git-lfs test server") | |
425 | def has_lfsserver(): |
|
425 | def has_lfsserver(): | |
426 | exe = 'lfs-test-server' |
|
426 | exe = 'lfs-test-server' | |
427 | if has_windows(): |
|
427 | if has_windows(): | |
428 | exe = 'lfs-test-server.exe' |
|
428 | exe = 'lfs-test-server.exe' | |
429 | return any( |
|
429 | return any( | |
430 | os.access(os.path.join(path, exe), os.X_OK) |
|
430 | os.access(os.path.join(path, exe), os.X_OK) | |
431 | for path in os.environ["PATH"].split(os.pathsep) |
|
431 | for path in os.environ["PATH"].split(os.pathsep) | |
432 | ) |
|
432 | ) | |
433 |
|
433 | |||
434 |
|
434 | |||
435 | @checkvers("git", "git client (with ext::sh support) version >= %s", (1.9,)) |
|
435 | @checkvers("git", "git client (with ext::sh support) version >= %s", (1.9,)) | |
436 | def has_git_range(v): |
|
436 | def has_git_range(v): | |
437 | major, minor = v.split('.')[0:2] |
|
437 | major, minor = v.split('.')[0:2] | |
438 | return getgitversion() >= (int(major), int(minor)) |
|
438 | return getgitversion() >= (int(major), int(minor)) | |
439 |
|
439 | |||
440 |
|
440 | |||
441 | @check("docutils", "Docutils text processing library") |
|
441 | @check("docutils", "Docutils text processing library") | |
442 | def has_docutils(): |
|
442 | def has_docutils(): | |
443 | try: |
|
443 | try: | |
444 | import docutils.core |
|
444 | import docutils.core | |
445 |
|
445 | |||
446 | docutils.core.publish_cmdline # silence unused import |
|
446 | docutils.core.publish_cmdline # silence unused import | |
447 | return True |
|
447 | return True | |
448 | except ImportError: |
|
448 | except ImportError: | |
449 | return False |
|
449 | return False | |
450 |
|
450 | |||
451 |
|
451 | |||
452 | def getsvnversion(): |
|
452 | def getsvnversion(): | |
453 | m = matchoutput('svn --version --quiet 2>&1', br'^(\d+)\.(\d+)') |
|
453 | m = matchoutput('svn --version --quiet 2>&1', br'^(\d+)\.(\d+)') | |
454 | if not m: |
|
454 | if not m: | |
455 | return (0, 0) |
|
455 | return (0, 0) | |
456 | return (int(m.group(1)), int(m.group(2))) |
|
456 | return (int(m.group(1)), int(m.group(2))) | |
457 |
|
457 | |||
458 |
|
458 | |||
459 | @checkvers("svn", "subversion client and admin tools >= %s", (1.3, 1.5)) |
|
459 | @checkvers("svn", "subversion client and admin tools >= %s", (1.3, 1.5)) | |
460 | def has_svn_range(v): |
|
460 | def has_svn_range(v): | |
461 | major, minor = v.split('.')[0:2] |
|
461 | major, minor = v.split('.')[0:2] | |
462 | return getsvnversion() >= (int(major), int(minor)) |
|
462 | return getsvnversion() >= (int(major), int(minor)) | |
463 |
|
463 | |||
464 |
|
464 | |||
465 | @check("svn", "subversion client and admin tools") |
|
465 | @check("svn", "subversion client and admin tools") | |
466 | def has_svn(): |
|
466 | def has_svn(): | |
467 | return matchoutput('svn --version 2>&1', br'^svn, version') and matchoutput( |
|
467 | return matchoutput('svn --version 2>&1', br'^svn, version') and matchoutput( | |
468 | 'svnadmin --version 2>&1', br'^svnadmin, version' |
|
468 | 'svnadmin --version 2>&1', br'^svnadmin, version' | |
469 | ) |
|
469 | ) | |
470 |
|
470 | |||
471 |
|
471 | |||
472 | @check("svn-bindings", "subversion python bindings") |
|
472 | @check("svn-bindings", "subversion python bindings") | |
473 | def has_svn_bindings(): |
|
473 | def has_svn_bindings(): | |
474 | try: |
|
474 | try: | |
475 | import svn.core |
|
475 | import svn.core | |
476 |
|
476 | |||
477 | version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR |
|
477 | version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR | |
478 | if version < (1, 4): |
|
478 | if version < (1, 4): | |
479 | return False |
|
479 | return False | |
480 | return True |
|
480 | return True | |
481 | except ImportError: |
|
481 | except ImportError: | |
482 | return False |
|
482 | return False | |
483 |
|
483 | |||
484 |
|
484 | |||
485 | @check("p4", "Perforce server and client") |
|
485 | @check("p4", "Perforce server and client") | |
486 | def has_p4(): |
|
486 | def has_p4(): | |
487 | return matchoutput('p4 -V', br'Rev\. P4/') and matchoutput( |
|
487 | return matchoutput('p4 -V', br'Rev\. P4/') and matchoutput( | |
488 | 'p4d -V', br'Rev\. P4D/' |
|
488 | 'p4d -V', br'Rev\. P4D/' | |
489 | ) |
|
489 | ) | |
490 |
|
490 | |||
491 |
|
491 | |||
492 | @check("symlink", "symbolic links") |
|
492 | @check("symlink", "symbolic links") | |
493 | def has_symlink(): |
|
493 | def has_symlink(): | |
494 | # mercurial.windows.checklink() is a hard 'no' at the moment |
|
494 | # mercurial.windows.checklink() is a hard 'no' at the moment | |
495 | if os.name == 'nt' or getattr(os, "symlink", None) is None: |
|
495 | if os.name == 'nt' or getattr(os, "symlink", None) is None: | |
496 | return False |
|
496 | return False | |
497 | name = tempfile.mktemp(dir='.', prefix=tempprefix) |
|
497 | name = tempfile.mktemp(dir='.', prefix=tempprefix) | |
498 | try: |
|
498 | try: | |
499 | os.symlink(".", name) |
|
499 | os.symlink(".", name) | |
500 | os.unlink(name) |
|
500 | os.unlink(name) | |
501 | return True |
|
501 | return True | |
502 | except (OSError, AttributeError): |
|
502 | except (OSError, AttributeError): | |
503 | return False |
|
503 | return False | |
504 |
|
504 | |||
505 |
|
505 | |||
506 | @check("hardlink", "hardlinks") |
|
506 | @check("hardlink", "hardlinks") | |
507 | def has_hardlink(): |
|
507 | def has_hardlink(): | |
508 | from mercurial import util |
|
508 | from mercurial import util | |
509 |
|
509 | |||
510 | fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix) |
|
510 | fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix) | |
511 | os.close(fh) |
|
511 | os.close(fh) | |
512 | name = tempfile.mktemp(dir='.', prefix=tempprefix) |
|
512 | name = tempfile.mktemp(dir='.', prefix=tempprefix) | |
513 | try: |
|
513 | try: | |
514 | util.oslink(_sys2bytes(fn), _sys2bytes(name)) |
|
514 | util.oslink(_sys2bytes(fn), _sys2bytes(name)) | |
515 | os.unlink(name) |
|
515 | os.unlink(name) | |
516 | return True |
|
516 | return True | |
517 | except OSError: |
|
517 | except OSError: | |
518 | return False |
|
518 | return False | |
519 | finally: |
|
519 | finally: | |
520 | os.unlink(fn) |
|
520 | os.unlink(fn) | |
521 |
|
521 | |||
522 |
|
522 | |||
523 | @check("hardlink-whitelisted", "hardlinks on whitelisted filesystems") |
|
523 | @check("hardlink-whitelisted", "hardlinks on whitelisted filesystems") | |
524 | def has_hardlink_whitelisted(): |
|
524 | def has_hardlink_whitelisted(): | |
525 | from mercurial import util |
|
525 | from mercurial import util | |
526 |
|
526 | |||
527 | try: |
|
527 | try: | |
528 | fstype = util.getfstype(b'.') |
|
528 | fstype = util.getfstype(b'.') | |
529 | except OSError: |
|
529 | except OSError: | |
530 | return False |
|
530 | return False | |
531 | return fstype in util._hardlinkfswhitelist |
|
531 | return fstype in util._hardlinkfswhitelist | |
532 |
|
532 | |||
533 |
|
533 | |||
534 | @check("rmcwd", "can remove current working directory") |
|
534 | @check("rmcwd", "can remove current working directory") | |
535 | def has_rmcwd(): |
|
535 | def has_rmcwd(): | |
536 | ocwd = os.getcwd() |
|
536 | ocwd = os.getcwd() | |
537 | temp = tempfile.mkdtemp(dir='.', prefix=tempprefix) |
|
537 | temp = tempfile.mkdtemp(dir='.', prefix=tempprefix) | |
538 | try: |
|
538 | try: | |
539 | os.chdir(temp) |
|
539 | os.chdir(temp) | |
540 | # On Linux, 'rmdir .' isn't allowed, but the other names are okay. |
|
540 | # On Linux, 'rmdir .' isn't allowed, but the other names are okay. | |
541 | # On Solaris and Windows, the cwd can't be removed by any names. |
|
541 | # On Solaris and Windows, the cwd can't be removed by any names. | |
542 | os.rmdir(os.getcwd()) |
|
542 | os.rmdir(os.getcwd()) | |
543 | return True |
|
543 | return True | |
544 | except OSError: |
|
544 | except OSError: | |
545 | return False |
|
545 | return False | |
546 | finally: |
|
546 | finally: | |
547 | os.chdir(ocwd) |
|
547 | os.chdir(ocwd) | |
548 | # clean up temp dir on platforms where cwd can't be removed |
|
548 | # clean up temp dir on platforms where cwd can't be removed | |
549 | try: |
|
549 | try: | |
550 | os.rmdir(temp) |
|
550 | os.rmdir(temp) | |
551 | except OSError: |
|
551 | except OSError: | |
552 | pass |
|
552 | pass | |
553 |
|
553 | |||
554 |
|
554 | |||
555 | @check("tla", "GNU Arch tla client") |
|
555 | @check("tla", "GNU Arch tla client") | |
556 | def has_tla(): |
|
556 | def has_tla(): | |
557 | return matchoutput('tla --version 2>&1', br'The GNU Arch Revision') |
|
557 | return matchoutput('tla --version 2>&1', br'The GNU Arch Revision') | |
558 |
|
558 | |||
559 |
|
559 | |||
560 | @check("gpg", "gpg client") |
|
560 | @check("gpg", "gpg client") | |
561 | def has_gpg(): |
|
561 | def has_gpg(): | |
562 | return matchoutput('gpg --version 2>&1', br'GnuPG') |
|
562 | return matchoutput('gpg --version 2>&1', br'GnuPG') | |
563 |
|
563 | |||
564 |
|
564 | |||
565 | @check("gpg2", "gpg client v2") |
|
565 | @check("gpg2", "gpg client v2") | |
566 | def has_gpg2(): |
|
566 | def has_gpg2(): | |
567 | return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.') |
|
567 | return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.') | |
568 |
|
568 | |||
569 |
|
569 | |||
570 | @check("gpg21", "gpg client v2.1+") |
|
570 | @check("gpg21", "gpg client v2.1+") | |
571 | def has_gpg21(): |
|
571 | def has_gpg21(): | |
572 | return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.(?!0)') |
|
572 | return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.(?!0)') | |
573 |
|
573 | |||
574 |
|
574 | |||
575 | @check("unix-permissions", "unix-style permissions") |
|
575 | @check("unix-permissions", "unix-style permissions") | |
576 | def has_unix_permissions(): |
|
576 | def has_unix_permissions(): | |
577 | d = tempfile.mkdtemp(dir='.', prefix=tempprefix) |
|
577 | d = tempfile.mkdtemp(dir='.', prefix=tempprefix) | |
578 | try: |
|
578 | try: | |
579 | fname = os.path.join(d, 'foo') |
|
579 | fname = os.path.join(d, 'foo') | |
580 | for umask in (0o77, 0o07, 0o22): |
|
580 | for umask in (0o77, 0o07, 0o22): | |
581 | os.umask(umask) |
|
581 | os.umask(umask) | |
582 | f = open(fname, 'w') |
|
582 | f = open(fname, 'w') | |
583 | f.close() |
|
583 | f.close() | |
584 | mode = os.stat(fname).st_mode |
|
584 | mode = os.stat(fname).st_mode | |
585 | os.unlink(fname) |
|
585 | os.unlink(fname) | |
586 | if mode & 0o777 != ~umask & 0o666: |
|
586 | if mode & 0o777 != ~umask & 0o666: | |
587 | return False |
|
587 | return False | |
588 | return True |
|
588 | return True | |
589 | finally: |
|
589 | finally: | |
590 | os.rmdir(d) |
|
590 | os.rmdir(d) | |
591 |
|
591 | |||
592 |
|
592 | |||
593 | @check("unix-socket", "AF_UNIX socket family") |
|
593 | @check("unix-socket", "AF_UNIX socket family") | |
594 | def has_unix_socket(): |
|
594 | def has_unix_socket(): | |
595 | return getattr(socket, 'AF_UNIX', None) is not None |
|
595 | return getattr(socket, 'AF_UNIX', None) is not None | |
596 |
|
596 | |||
597 |
|
597 | |||
598 | @check("root", "root permissions") |
|
598 | @check("root", "root permissions") | |
599 | def has_root(): |
|
599 | def has_root(): | |
600 | return getattr(os, 'geteuid', None) and os.geteuid() == 0 |
|
600 | return getattr(os, 'geteuid', None) and os.geteuid() == 0 | |
601 |
|
601 | |||
602 |
|
602 | |||
603 | @check("pyflakes", "Pyflakes python linter") |
|
603 | @check("pyflakes", "Pyflakes python linter") | |
604 | def has_pyflakes(): |
|
604 | def has_pyflakes(): | |
605 | try: |
|
605 | try: | |
606 | import pyflakes |
|
606 | import pyflakes | |
607 |
|
607 | |||
608 | pyflakes.__version__ |
|
608 | pyflakes.__version__ | |
609 | except ImportError: |
|
609 | except ImportError: | |
610 | return False |
|
610 | return False | |
611 | else: |
|
611 | else: | |
612 | return True |
|
612 | return True | |
613 |
|
613 | |||
614 |
|
614 | |||
615 | @check("pylint", "Pylint python linter") |
|
615 | @check("pylint", "Pylint python linter") | |
616 | def has_pylint(): |
|
616 | def has_pylint(): | |
617 | return matchoutput("pylint --help", br"Usage:[ ]+pylint", True) |
|
617 | return matchoutput("pylint --help", br"Usage:[ ]+pylint", True) | |
618 |
|
618 | |||
619 |
|
619 | |||
620 | @check("clang-format", "clang-format C code formatter (>= 11)") |
|
620 | @check("clang-format", "clang-format C code formatter (>= 11)") | |
621 | def has_clang_format(): |
|
621 | def has_clang_format(): | |
622 | m = matchoutput('clang-format --version', br'clang-format version (\d+)') |
|
622 | m = matchoutput('clang-format --version', br'clang-format version (\d+)') | |
623 | # style changed somewhere between 10.x and 11.x |
|
623 | # style changed somewhere between 10.x and 11.x | |
624 | if m: |
|
624 | if m: | |
625 | return int(m.group(1)) >= 11 |
|
625 | return int(m.group(1)) >= 11 | |
626 | # Assist Googler contributors, they have a centrally-maintained version of |
|
626 | # Assist Googler contributors, they have a centrally-maintained version of | |
627 | # clang-format that is generally very fresh, but unlike most builds (both |
|
627 | # clang-format that is generally very fresh, but unlike most builds (both | |
628 | # official and unofficial), it does *not* include a version number. |
|
628 | # official and unofficial), it does *not* include a version number. | |
629 | return matchoutput( |
|
629 | return matchoutput( | |
630 | 'clang-format --version', br'clang-format .*google3-trunk \([0-9a-f]+\)' |
|
630 | 'clang-format --version', br'clang-format .*google3-trunk \([0-9a-f]+\)' | |
631 | ) |
|
631 | ) | |
632 |
|
632 | |||
633 |
|
633 | |||
634 | @check("jshint", "JSHint static code analysis tool") |
|
634 | @check("jshint", "JSHint static code analysis tool") | |
635 | def has_jshint(): |
|
635 | def has_jshint(): | |
636 | return matchoutput("jshint --version 2>&1", br"jshint v") |
|
636 | return matchoutput("jshint --version 2>&1", br"jshint v") | |
637 |
|
637 | |||
638 |
|
638 | |||
639 | @check("pygments", "Pygments source highlighting library") |
|
639 | @check("pygments", "Pygments source highlighting library") | |
640 | def has_pygments(): |
|
640 | def has_pygments(): | |
641 | try: |
|
641 | try: | |
642 | import pygments |
|
642 | import pygments | |
643 |
|
643 | |||
644 | pygments.highlight # silence unused import warning |
|
644 | pygments.highlight # silence unused import warning | |
645 | return True |
|
645 | return True | |
646 | except ImportError: |
|
646 | except ImportError: | |
647 | return False |
|
647 | return False | |
648 |
|
648 | |||
649 |
|
649 | |||
650 | @check("pygments25", "Pygments version >= 2.5") |
|
650 | @check("pygments25", "Pygments version >= 2.5") | |
651 | def pygments25(): |
|
651 | def pygments25(): | |
652 | try: |
|
652 | try: | |
653 | import pygments |
|
653 | import pygments | |
654 |
|
654 | |||
655 | v = pygments.__version__ |
|
655 | v = pygments.__version__ | |
656 | except ImportError: |
|
656 | except ImportError: | |
657 | return False |
|
657 | return False | |
658 |
|
658 | |||
659 | parts = v.split(".") |
|
659 | parts = v.split(".") | |
660 | major = int(parts[0]) |
|
660 | major = int(parts[0]) | |
661 | minor = int(parts[1]) |
|
661 | minor = int(parts[1]) | |
662 |
|
662 | |||
663 | return (major, minor) >= (2, 5) |
|
663 | return (major, minor) >= (2, 5) | |
664 |
|
664 | |||
665 |
|
665 | |||
666 | @check("outer-repo", "outer repo") |
|
666 | @check("outer-repo", "outer repo") | |
667 | def has_outer_repo(): |
|
667 | def has_outer_repo(): | |
668 | # failing for other reasons than 'no repo' imply that there is a repo |
|
668 | # failing for other reasons than 'no repo' imply that there is a repo | |
669 | return not matchoutput('hg root 2>&1', br'abort: no repository found', True) |
|
669 | return not matchoutput('hg root 2>&1', br'abort: no repository found', True) | |
670 |
|
670 | |||
671 |
|
671 | |||
672 | @check("ssl", "ssl module available") |
|
672 | @check("ssl", "ssl module available") | |
673 | def has_ssl(): |
|
673 | def has_ssl(): | |
674 | try: |
|
674 | try: | |
675 | import ssl |
|
675 | import ssl | |
676 |
|
676 | |||
677 | ssl.CERT_NONE |
|
677 | ssl.CERT_NONE | |
678 | return True |
|
678 | return True | |
679 | except ImportError: |
|
679 | except ImportError: | |
680 | return False |
|
680 | return False | |
681 |
|
681 | |||
682 |
|
682 | |||
683 | @check("defaultcacertsloaded", "detected presence of loaded system CA certs") |
|
683 | @check("defaultcacertsloaded", "detected presence of loaded system CA certs") | |
684 | def has_defaultcacertsloaded(): |
|
684 | def has_defaultcacertsloaded(): | |
685 | import ssl |
|
685 | import ssl | |
686 | from mercurial import sslutil, ui as uimod |
|
686 | from mercurial import sslutil, ui as uimod | |
687 |
|
687 | |||
688 | ui = uimod.ui.load() |
|
688 | ui = uimod.ui.load() | |
689 | cafile = sslutil._defaultcacerts(ui) |
|
689 | cafile = sslutil._defaultcacerts(ui) | |
690 | ctx = ssl.create_default_context() |
|
690 | ctx = ssl.create_default_context() | |
691 | if cafile: |
|
691 | if cafile: | |
692 | ctx.load_verify_locations(cafile=cafile) |
|
692 | ctx.load_verify_locations(cafile=cafile) | |
693 | else: |
|
693 | else: | |
694 | ctx.load_default_certs() |
|
694 | ctx.load_default_certs() | |
695 |
|
695 | |||
696 | return len(ctx.get_ca_certs()) > 0 |
|
696 | return len(ctx.get_ca_certs()) > 0 | |
697 |
|
697 | |||
698 |
|
698 | |||
699 | @check("tls1.2", "TLS 1.2 protocol support") |
|
699 | @check("tls1.2", "TLS 1.2 protocol support") | |
700 | def has_tls1_2(): |
|
700 | def has_tls1_2(): | |
701 | from mercurial import sslutil |
|
701 | from mercurial import sslutil | |
702 |
|
702 | |||
703 | return b'tls1.2' in sslutil.supportedprotocols |
|
703 | return b'tls1.2' in sslutil.supportedprotocols | |
704 |
|
704 | |||
705 |
|
705 | |||
706 | @check("windows", "Windows") |
|
706 | @check("windows", "Windows") | |
707 | def has_windows(): |
|
707 | def has_windows(): | |
708 | return os.name == 'nt' |
|
708 | return os.name == 'nt' | |
709 |
|
709 | |||
710 |
|
710 | |||
711 | @check("system-sh", "system() uses sh") |
|
711 | @check("system-sh", "system() uses sh") | |
712 | def has_system_sh(): |
|
712 | def has_system_sh(): | |
713 | return os.name != 'nt' |
|
713 | return os.name != 'nt' | |
714 |
|
714 | |||
715 |
|
715 | |||
716 | @check("serve", "platform and python can manage 'hg serve -d'") |
|
716 | @check("serve", "platform and python can manage 'hg serve -d'") | |
717 | def has_serve(): |
|
717 | def has_serve(): | |
718 | return True |
|
718 | return True | |
719 |
|
719 | |||
720 |
|
720 | |||
721 | @check("setprocname", "whether osutil.setprocname is available or not") |
|
721 | @check("setprocname", "whether osutil.setprocname is available or not") | |
722 | def has_setprocname(): |
|
722 | def has_setprocname(): | |
723 | try: |
|
723 | try: | |
724 | from mercurial.utils import procutil |
|
724 | from mercurial.utils import procutil | |
725 |
|
725 | |||
726 | procutil.setprocname |
|
726 | procutil.setprocname | |
727 | return True |
|
727 | return True | |
728 | except AttributeError: |
|
728 | except AttributeError: | |
729 | return False |
|
729 | return False | |
730 |
|
730 | |||
731 |
|
731 | |||
732 | @check("test-repo", "running tests from repository") |
|
732 | @check("test-repo", "running tests from repository") | |
733 | def has_test_repo(): |
|
733 | def has_test_repo(): | |
734 | t = os.environ["TESTDIR"] |
|
734 | t = os.environ["TESTDIR"] | |
735 | return os.path.isdir(os.path.join(t, "..", ".hg")) |
|
735 | return os.path.isdir(os.path.join(t, "..", ".hg")) | |
736 |
|
736 | |||
737 |
|
737 | |||
738 | @check("network-io", "whether tests are allowed to access 3rd party services") |
|
738 | @check("network-io", "whether tests are allowed to access 3rd party services") | |
739 | def has_test_repo(): |
|
739 | def has_test_repo(): | |
740 | t = os.environ.get("HGTESTS_ALLOW_NETIO") |
|
740 | t = os.environ.get("HGTESTS_ALLOW_NETIO") | |
741 | return t == "1" |
|
741 | return t == "1" | |
742 |
|
742 | |||
743 |
|
743 | |||
744 | @check("curses", "terminfo compiler and curses module") |
|
744 | @check("curses", "terminfo compiler and curses module") | |
745 | def has_curses(): |
|
745 | def has_curses(): | |
746 | try: |
|
746 | try: | |
747 | import curses |
|
747 | import curses | |
748 |
|
748 | |||
749 | curses.COLOR_BLUE |
|
749 | curses.COLOR_BLUE | |
750 |
|
750 | |||
751 | # Windows doesn't have a `tic` executable, but the windows_curses |
|
751 | # Windows doesn't have a `tic` executable, but the windows_curses | |
752 | # package is sufficient to run the tests without it. |
|
752 | # package is sufficient to run the tests without it. | |
753 | if os.name == 'nt': |
|
753 | if os.name == 'nt': | |
754 | return True |
|
754 | return True | |
755 |
|
755 | |||
756 | return has_tic() |
|
756 | return has_tic() | |
757 |
|
757 | |||
758 | except (ImportError, AttributeError): |
|
758 | except (ImportError, AttributeError): | |
759 | return False |
|
759 | return False | |
760 |
|
760 | |||
761 |
|
761 | |||
762 | @check("tic", "terminfo compiler") |
|
762 | @check("tic", "terminfo compiler") | |
763 | def has_tic(): |
|
763 | def has_tic(): | |
764 | return matchoutput('test -x "`which tic`"', br'') |
|
764 | return matchoutput('test -x "`which tic`"', br'') | |
765 |
|
765 | |||
766 |
|
766 | |||
767 | @check("xz", "xz compression utility") |
|
767 | @check("xz", "xz compression utility") | |
768 | def has_xz(): |
|
768 | def has_xz(): | |
769 | # When Windows invokes a subprocess in shell mode, it uses `cmd.exe`, which |
|
769 | # When Windows invokes a subprocess in shell mode, it uses `cmd.exe`, which | |
770 | # only knows `where`, not `which`. So invoke MSYS shell explicitly. |
|
770 | # only knows `where`, not `which`. So invoke MSYS shell explicitly. | |
771 | return matchoutput("sh -c 'test -x \"`which xz`\"'", b'') |
|
771 | return matchoutput("sh -c 'test -x \"`which xz`\"'", b'') | |
772 |
|
772 | |||
773 |
|
773 | |||
774 | @check("msys", "Windows with MSYS") |
|
774 | @check("msys", "Windows with MSYS") | |
775 | def has_msys(): |
|
775 | def has_msys(): | |
776 | return os.getenv('MSYSTEM') |
|
776 | return os.getenv('MSYSTEM') | |
777 |
|
777 | |||
778 |
|
778 | |||
779 | @check("aix", "AIX") |
|
779 | @check("aix", "AIX") | |
780 | def has_aix(): |
|
780 | def has_aix(): | |
781 | return sys.platform.startswith("aix") |
|
781 | return sys.platform.startswith("aix") | |
782 |
|
782 | |||
783 |
|
783 | |||
784 | @check("osx", "OS X") |
|
784 | @check("osx", "OS X") | |
785 | def has_osx(): |
|
785 | def has_osx(): | |
786 | return sys.platform == 'darwin' |
|
786 | return sys.platform == 'darwin' | |
787 |
|
787 | |||
788 |
|
788 | |||
789 | @check("osxpackaging", "OS X packaging tools") |
|
789 | @check("osxpackaging", "OS X packaging tools") | |
790 | def has_osxpackaging(): |
|
790 | def has_osxpackaging(): | |
791 | try: |
|
791 | try: | |
792 | return ( |
|
792 | return ( | |
793 | matchoutput('pkgbuild', br'Usage: pkgbuild ', ignorestatus=1) |
|
793 | matchoutput('pkgbuild', br'Usage: pkgbuild ', ignorestatus=1) | |
794 | and matchoutput( |
|
794 | and matchoutput( | |
795 | 'productbuild', br'Usage: productbuild ', ignorestatus=1 |
|
795 | 'productbuild', br'Usage: productbuild ', ignorestatus=1 | |
796 | ) |
|
796 | ) | |
797 | and matchoutput('lsbom', br'Usage: lsbom', ignorestatus=1) |
|
797 | and matchoutput('lsbom', br'Usage: lsbom', ignorestatus=1) | |
798 | and matchoutput('xar --help', br'Usage: xar', ignorestatus=1) |
|
798 | and matchoutput('xar --help', br'Usage: xar', ignorestatus=1) | |
799 | ) |
|
799 | ) | |
800 | except ImportError: |
|
800 | except ImportError: | |
801 | return False |
|
801 | return False | |
802 |
|
802 | |||
803 |
|
803 | |||
804 | @check('linuxormacos', 'Linux or MacOS') |
|
804 | @check('linuxormacos', 'Linux or MacOS') | |
805 | def has_linuxormacos(): |
|
805 | def has_linuxormacos(): | |
806 | # This isn't a perfect test for MacOS. But it is sufficient for our needs. |
|
806 | # This isn't a perfect test for MacOS. But it is sufficient for our needs. | |
807 | return sys.platform.startswith(('linux', 'darwin')) |
|
807 | return sys.platform.startswith(('linux', 'darwin')) | |
808 |
|
808 | |||
809 |
|
809 | |||
810 | @check("docker", "docker support") |
|
810 | @check("docker", "docker support") | |
811 | def has_docker(): |
|
811 | def has_docker(): | |
812 | pat = br'A self-sufficient runtime for' |
|
812 | pat = br'A self-sufficient runtime for' | |
813 | if matchoutput('docker --help', pat): |
|
813 | if matchoutput('docker --help', pat): | |
814 | if 'linux' not in sys.platform: |
|
814 | if 'linux' not in sys.platform: | |
815 | # TODO: in theory we should be able to test docker-based |
|
815 | # TODO: in theory we should be able to test docker-based | |
816 | # package creation on non-linux using boot2docker, but in |
|
816 | # package creation on non-linux using boot2docker, but in | |
817 | # practice that requires extra coordination to make sure |
|
817 | # practice that requires extra coordination to make sure | |
818 | # $TESTTEMP is going to be visible at the same path to the |
|
818 | # $TESTTEMP is going to be visible at the same path to the | |
819 | # boot2docker VM. If we figure out how to verify that, we |
|
819 | # boot2docker VM. If we figure out how to verify that, we | |
820 | # can use the following instead of just saying False: |
|
820 | # can use the following instead of just saying False: | |
821 | # return 'DOCKER_HOST' in os.environ |
|
821 | # return 'DOCKER_HOST' in os.environ | |
822 | return False |
|
822 | return False | |
823 |
|
823 | |||
824 | return True |
|
824 | return True | |
825 | return False |
|
825 | return False | |
826 |
|
826 | |||
827 |
|
827 | |||
828 | @check("debhelper", "debian packaging tools") |
|
828 | @check("debhelper", "debian packaging tools") | |
829 | def has_debhelper(): |
|
829 | def has_debhelper(): | |
830 | # Some versions of dpkg say `dpkg', some say 'dpkg' (` vs ' on the first |
|
830 | # Some versions of dpkg say `dpkg', some say 'dpkg' (` vs ' on the first | |
831 | # quote), so just accept anything in that spot. |
|
831 | # quote), so just accept anything in that spot. | |
832 | dpkg = matchoutput( |
|
832 | dpkg = matchoutput( | |
833 | 'dpkg --version', br"Debian .dpkg' package management program" |
|
833 | 'dpkg --version', br"Debian .dpkg' package management program" | |
834 | ) |
|
834 | ) | |
835 | dh = matchoutput( |
|
835 | dh = matchoutput( | |
836 | 'dh --help', br'dh is a part of debhelper.', ignorestatus=True |
|
836 | 'dh --help', br'dh is a part of debhelper.', ignorestatus=True | |
837 | ) |
|
837 | ) | |
838 | dh_py2 = matchoutput( |
|
838 | dh_py2 = matchoutput( | |
839 | 'dh_python2 --help', br'other supported Python versions' |
|
839 | 'dh_python2 --help', br'other supported Python versions' | |
840 | ) |
|
840 | ) | |
841 | # debuild comes from the 'devscripts' package, though you might want |
|
841 | # debuild comes from the 'devscripts' package, though you might want | |
842 | # the 'build-debs' package instead, which has a dependency on devscripts. |
|
842 | # the 'build-debs' package instead, which has a dependency on devscripts. | |
843 | debuild = matchoutput( |
|
843 | debuild = matchoutput( | |
844 | 'debuild --help', br'to run debian/rules with given parameter' |
|
844 | 'debuild --help', br'to run debian/rules with given parameter' | |
845 | ) |
|
845 | ) | |
846 | return dpkg and dh and dh_py2 and debuild |
|
846 | return dpkg and dh and dh_py2 and debuild | |
847 |
|
847 | |||
848 |
|
848 | |||
849 | @check( |
|
849 | @check( | |
850 | "debdeps", "debian build dependencies (run dpkg-checkbuilddeps in contrib/)" |
|
850 | "debdeps", "debian build dependencies (run dpkg-checkbuilddeps in contrib/)" | |
851 | ) |
|
851 | ) | |
852 | def has_debdeps(): |
|
852 | def has_debdeps(): | |
853 | # just check exit status (ignoring output) |
|
853 | # just check exit status (ignoring output) | |
854 | path = '%s/../contrib/packaging/debian/control' % os.environ['TESTDIR'] |
|
854 | path = '%s/../contrib/packaging/debian/control' % os.environ['TESTDIR'] | |
855 | return matchoutput('dpkg-checkbuilddeps %s' % path, br'') |
|
855 | return matchoutput('dpkg-checkbuilddeps %s' % path, br'') | |
856 |
|
856 | |||
857 |
|
857 | |||
858 | @check("demandimport", "demandimport enabled") |
|
858 | @check("demandimport", "demandimport enabled") | |
859 | def has_demandimport(): |
|
859 | def has_demandimport(): | |
860 | # chg disables demandimport intentionally for performance wins. |
|
860 | # chg disables demandimport intentionally for performance wins. | |
861 | return (not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable' |
|
861 | return (not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable' | |
862 |
|
862 | |||
863 |
|
863 | |||
864 | # Add "py27", "py35", ... as possible feature checks. Note that there's no |
|
864 | # Add "py27", "py35", ... as possible feature checks. Note that there's no | |
865 | # punctuation here. |
|
865 | # punctuation here. | |
866 | @checkvers("py", "Python >= %s", (2.7, 3.5, 3.6, 3.7, 3.8, 3.9)) |
|
866 | @checkvers("py", "Python >= %s", (2.7, 3.5, 3.6, 3.7, 3.8, 3.9)) | |
867 | def has_python_range(v): |
|
867 | def has_python_range(v): | |
868 | major, minor = v.split('.')[0:2] |
|
868 | major, minor = v.split('.')[0:2] | |
869 | py_major, py_minor = sys.version_info.major, sys.version_info.minor |
|
869 | py_major, py_minor = sys.version_info.major, sys.version_info.minor | |
870 |
|
870 | |||
871 | return (py_major, py_minor) >= (int(major), int(minor)) |
|
871 | return (py_major, py_minor) >= (int(major), int(minor)) | |
872 |
|
872 | |||
873 |
|
873 | |||
874 | @check("py3", "running with Python 3.x") |
|
874 | @check("py3", "running with Python 3.x") | |
875 | def has_py3(): |
|
875 | def has_py3(): | |
876 | return 3 == sys.version_info[0] |
|
876 | return 3 == sys.version_info[0] | |
877 |
|
877 | |||
878 |
|
878 | |||
879 | @check("py3exe", "a Python 3.x interpreter is available") |
|
879 | @check("py3exe", "a Python 3.x interpreter is available") | |
880 | def has_python3exe(): |
|
880 | def has_python3exe(): | |
881 | py = 'python3' |
|
881 | py = 'python3' | |
882 | if os.name == 'nt': |
|
882 | if os.name == 'nt': | |
883 | py = 'py -3' |
|
883 | py = 'py -3' | |
884 | return matchoutput('%s -V' % py, br'^Python 3.(5|6|7|8|9)') |
|
884 | return matchoutput('%s -V' % py, br'^Python 3.(5|6|7|8|9)') | |
885 |
|
885 | |||
886 |
|
886 | |||
887 | @check("pure", "running with pure Python code") |
|
887 | @check("pure", "running with pure Python code") | |
888 | def has_pure(): |
|
888 | def has_pure(): | |
889 | return any( |
|
889 | return any( | |
890 | [ |
|
890 | [ | |
891 | os.environ.get("HGMODULEPOLICY") == "py", |
|
891 | os.environ.get("HGMODULEPOLICY") == "py", | |
892 | os.environ.get("HGTEST_RUN_TESTS_PURE") == "--pure", |
|
892 | os.environ.get("HGTEST_RUN_TESTS_PURE") == "--pure", | |
893 | ] |
|
893 | ] | |
894 | ) |
|
894 | ) | |
895 |
|
895 | |||
896 |
|
896 | |||
897 | @check("slow", "allow slow tests (use --allow-slow-tests)") |
|
897 | @check("slow", "allow slow tests (use --allow-slow-tests)") | |
898 | def has_slow(): |
|
898 | def has_slow(): | |
899 | return os.environ.get('HGTEST_SLOW') == 'slow' |
|
899 | return os.environ.get('HGTEST_SLOW') == 'slow' | |
900 |
|
900 | |||
901 |
|
901 | |||
902 | @check("hypothesis", "Hypothesis automated test generation") |
|
902 | @check("hypothesis", "Hypothesis automated test generation") | |
903 | def has_hypothesis(): |
|
903 | def has_hypothesis(): | |
904 | try: |
|
904 | try: | |
905 | import hypothesis |
|
905 | import hypothesis | |
906 |
|
906 | |||
907 | hypothesis.given |
|
907 | hypothesis.given | |
908 | return True |
|
908 | return True | |
909 | except ImportError: |
|
909 | except ImportError: | |
910 | return False |
|
910 | return False | |
911 |
|
911 | |||
912 |
|
912 | |||
913 | @check("unziplinks", "unzip(1) understands and extracts symlinks") |
|
913 | @check("unziplinks", "unzip(1) understands and extracts symlinks") | |
914 | def unzip_understands_symlinks(): |
|
914 | def unzip_understands_symlinks(): | |
915 | return matchoutput('unzip --help', br'Info-ZIP') |
|
915 | return matchoutput('unzip --help', br'Info-ZIP') | |
916 |
|
916 | |||
917 |
|
917 | |||
918 | @check("zstd", "zstd Python module available") |
|
918 | @check("zstd", "zstd Python module available") | |
919 | def has_zstd(): |
|
919 | def has_zstd(): | |
920 | try: |
|
920 | try: | |
921 | import mercurial.zstd |
|
921 | import mercurial.zstd | |
922 |
|
922 | |||
923 | mercurial.zstd.__version__ |
|
923 | mercurial.zstd.__version__ | |
924 | return True |
|
924 | return True | |
925 | except ImportError: |
|
925 | except ImportError: | |
926 | return False |
|
926 | return False | |
927 |
|
927 | |||
928 |
|
928 | |||
929 | @check("devfull", "/dev/full special file") |
|
929 | @check("devfull", "/dev/full special file") | |
930 | def has_dev_full(): |
|
930 | def has_dev_full(): | |
931 | return os.path.exists('/dev/full') |
|
931 | return os.path.exists('/dev/full') | |
932 |
|
932 | |||
933 |
|
933 | |||
934 | @check("ensurepip", "ensurepip module") |
|
934 | @check("ensurepip", "ensurepip module") | |
935 | def has_ensurepip(): |
|
935 | def has_ensurepip(): | |
936 | try: |
|
936 | try: | |
937 | import ensurepip |
|
937 | import ensurepip | |
938 |
|
938 | |||
939 | ensurepip.bootstrap |
|
939 | ensurepip.bootstrap | |
940 | return True |
|
940 | return True | |
941 | except ImportError: |
|
941 | except ImportError: | |
942 | return False |
|
942 | return False | |
943 |
|
943 | |||
944 |
|
944 | |||
945 | @check("virtualenv", "virtualenv support") |
|
945 | @check("virtualenv", "virtualenv support") | |
946 | def has_virtualenv(): |
|
946 | def has_virtualenv(): | |
947 | try: |
|
947 | try: | |
948 | import virtualenv |
|
948 | import virtualenv | |
949 |
|
949 | |||
950 | # --no-site-package became the default in 1.7 (Nov 2011), and the |
|
950 | # --no-site-package became the default in 1.7 (Nov 2011), and the | |
951 | # argument was removed in 20.0 (Feb 2020). Rather than make the |
|
951 | # argument was removed in 20.0 (Feb 2020). Rather than make the | |
952 | # script complicated, just ignore ancient versions. |
|
952 | # script complicated, just ignore ancient versions. | |
953 | return int(virtualenv.__version__.split('.')[0]) > 1 |
|
953 | return int(virtualenv.__version__.split('.')[0]) > 1 | |
954 | except (AttributeError, ImportError, IndexError): |
|
954 | except (AttributeError, ImportError, IndexError): | |
955 | return False |
|
955 | return False | |
956 |
|
956 | |||
957 |
|
957 | |||
958 | @check("fsmonitor", "running tests with fsmonitor") |
|
958 | @check("fsmonitor", "running tests with fsmonitor") | |
959 | def has_fsmonitor(): |
|
959 | def has_fsmonitor(): | |
960 | return 'HGFSMONITOR_TESTS' in os.environ |
|
960 | return 'HGFSMONITOR_TESTS' in os.environ | |
961 |
|
961 | |||
962 |
|
962 | |||
963 | @check("fuzzywuzzy", "Fuzzy string matching library") |
|
963 | @check("fuzzywuzzy", "Fuzzy string matching library") | |
964 | def has_fuzzywuzzy(): |
|
964 | def has_fuzzywuzzy(): | |
965 | try: |
|
965 | try: | |
966 | import fuzzywuzzy |
|
966 | import fuzzywuzzy | |
967 |
|
967 | |||
968 | fuzzywuzzy.__version__ |
|
968 | fuzzywuzzy.__version__ | |
969 | return True |
|
969 | return True | |
970 | except ImportError: |
|
970 | except ImportError: | |
971 | return False |
|
971 | return False | |
972 |
|
972 | |||
973 |
|
973 | |||
974 | @check("clang-libfuzzer", "clang new enough to include libfuzzer") |
|
974 | @check("clang-libfuzzer", "clang new enough to include libfuzzer") | |
975 | def has_clang_libfuzzer(): |
|
975 | def has_clang_libfuzzer(): | |
976 | mat = matchoutput('clang --version', br'clang version (\d)') |
|
976 | mat = matchoutput('clang --version', br'clang version (\d)') | |
977 | if mat: |
|
977 | if mat: | |
978 | # libfuzzer is new in clang 6 |
|
978 | # libfuzzer is new in clang 6 | |
979 | return int(mat.group(1)) > 5 |
|
979 | return int(mat.group(1)) > 5 | |
980 | return False |
|
980 | return False | |
981 |
|
981 | |||
982 |
|
982 | |||
983 | @check("clang-6.0", "clang 6.0 with version suffix (libfuzzer included)") |
|
983 | @check("clang-6.0", "clang 6.0 with version suffix (libfuzzer included)") | |
984 | def has_clang60(): |
|
984 | def has_clang60(): | |
985 | return matchoutput('clang-6.0 --version', br'clang version 6\.') |
|
985 | return matchoutput('clang-6.0 --version', br'clang version 6\.') | |
986 |
|
986 | |||
987 |
|
987 | |||
988 | @check("xdiff", "xdiff algorithm") |
|
988 | @check("xdiff", "xdiff algorithm") | |
989 | def has_xdiff(): |
|
989 | def has_xdiff(): | |
990 | try: |
|
990 | try: | |
991 | from mercurial import policy |
|
991 | from mercurial import policy | |
992 |
|
992 | |||
993 | bdiff = policy.importmod('bdiff') |
|
993 | bdiff = policy.importmod('bdiff') | |
994 | return bdiff.xdiffblocks(b'', b'') == [(0, 0, 0, 0)] |
|
994 | return bdiff.xdiffblocks(b'', b'') == [(0, 0, 0, 0)] | |
995 | except (ImportError, AttributeError): |
|
995 | except (ImportError, AttributeError): | |
996 | return False |
|
996 | return False | |
997 |
|
997 | |||
998 |
|
998 | |||
999 | @check('extraextensions', 'whether tests are running with extra extensions') |
|
999 | @check('extraextensions', 'whether tests are running with extra extensions') | |
1000 | def has_extraextensions(): |
|
1000 | def has_extraextensions(): | |
1001 | return 'HGTESTEXTRAEXTENSIONS' in os.environ |
|
1001 | return 'HGTESTEXTRAEXTENSIONS' in os.environ | |
1002 |
|
1002 | |||
1003 |
|
1003 | |||
1004 | def getrepofeatures(): |
|
1004 | def getrepofeatures(): | |
1005 | """Obtain set of repository features in use. |
|
1005 | """Obtain set of repository features in use. | |
1006 |
|
1006 | |||
1007 | HGREPOFEATURES can be used to define or remove features. It contains |
|
1007 | HGREPOFEATURES can be used to define or remove features. It contains | |
1008 | a space-delimited list of feature strings. Strings beginning with ``-`` |
|
1008 | a space-delimited list of feature strings. Strings beginning with ``-`` | |
1009 | mean to remove. |
|
1009 | mean to remove. | |
1010 | """ |
|
1010 | """ | |
1011 | # Default list provided by core. |
|
1011 | # Default list provided by core. | |
1012 | features = { |
|
1012 | features = { | |
1013 | 'bundlerepo', |
|
1013 | 'bundlerepo', | |
1014 | 'revlogstore', |
|
1014 | 'revlogstore', | |
1015 | 'fncache', |
|
1015 | 'fncache', | |
1016 | } |
|
1016 | } | |
1017 |
|
1017 | |||
1018 | # Features that imply other features. |
|
1018 | # Features that imply other features. | |
1019 | implies = { |
|
1019 | implies = { | |
1020 | 'simplestore': ['-revlogstore', '-bundlerepo', '-fncache'], |
|
1020 | 'simplestore': ['-revlogstore', '-bundlerepo', '-fncache'], | |
1021 | } |
|
1021 | } | |
1022 |
|
1022 | |||
1023 | for override in os.environ.get('HGREPOFEATURES', '').split(' '): |
|
1023 | for override in os.environ.get('HGREPOFEATURES', '').split(' '): | |
1024 | if not override: |
|
1024 | if not override: | |
1025 | continue |
|
1025 | continue | |
1026 |
|
1026 | |||
1027 | if override.startswith('-'): |
|
1027 | if override.startswith('-'): | |
1028 | if override[1:] in features: |
|
1028 | if override[1:] in features: | |
1029 | features.remove(override[1:]) |
|
1029 | features.remove(override[1:]) | |
1030 | else: |
|
1030 | else: | |
1031 | features.add(override) |
|
1031 | features.add(override) | |
1032 |
|
1032 | |||
1033 | for imply in implies.get(override, []): |
|
1033 | for imply in implies.get(override, []): | |
1034 | if imply.startswith('-'): |
|
1034 | if imply.startswith('-'): | |
1035 | if imply[1:] in features: |
|
1035 | if imply[1:] in features: | |
1036 | features.remove(imply[1:]) |
|
1036 | features.remove(imply[1:]) | |
1037 | else: |
|
1037 | else: | |
1038 | features.add(imply) |
|
1038 | features.add(imply) | |
1039 |
|
1039 | |||
1040 | return features |
|
1040 | return features | |
1041 |
|
1041 | |||
1042 |
|
1042 | |||
1043 | @check('reporevlogstore', 'repository using the default revlog store') |
|
1043 | @check('reporevlogstore', 'repository using the default revlog store') | |
1044 | def has_reporevlogstore(): |
|
1044 | def has_reporevlogstore(): | |
1045 | return 'revlogstore' in getrepofeatures() |
|
1045 | return 'revlogstore' in getrepofeatures() | |
1046 |
|
1046 | |||
1047 |
|
1047 | |||
1048 | @check('reposimplestore', 'repository using simple storage extension') |
|
1048 | @check('reposimplestore', 'repository using simple storage extension') | |
1049 | def has_reposimplestore(): |
|
1049 | def has_reposimplestore(): | |
1050 | return 'simplestore' in getrepofeatures() |
|
1050 | return 'simplestore' in getrepofeatures() | |
1051 |
|
1051 | |||
1052 |
|
1052 | |||
1053 | @check('repobundlerepo', 'whether we can open bundle files as repos') |
|
1053 | @check('repobundlerepo', 'whether we can open bundle files as repos') | |
1054 | def has_repobundlerepo(): |
|
1054 | def has_repobundlerepo(): | |
1055 | return 'bundlerepo' in getrepofeatures() |
|
1055 | return 'bundlerepo' in getrepofeatures() | |
1056 |
|
1056 | |||
1057 |
|
1057 | |||
1058 | @check('repofncache', 'repository has an fncache') |
|
1058 | @check('repofncache', 'repository has an fncache') | |
1059 | def has_repofncache(): |
|
1059 | def has_repofncache(): | |
1060 | return 'fncache' in getrepofeatures() |
|
1060 | return 'fncache' in getrepofeatures() | |
1061 |
|
1061 | |||
1062 |
|
1062 | |||
1063 | @check('dirstate-v2', 'using the v2 format of .hg/dirstate') |
|
1063 | @check('dirstate-v2', 'using the v2 format of .hg/dirstate') | |
1064 | def has_dirstate_v2(): |
|
1064 | def has_dirstate_v2(): | |
1065 | # Keep this logic in sync with `newreporequirements()` in `mercurial/localrepo.py` |
|
1065 | # Keep this logic in sync with `newreporequirements()` in `mercurial/localrepo.py` | |
1066 | return has_rust() and matchoutput( |
|
1066 | return has_rust() and matchoutput( | |
1067 | 'hg config format.exp-rc-dirstate-v2', b'(?i)1|yes|true|on|always' |
|
1067 | 'hg config format.exp-rc-dirstate-v2', b'(?i)1|yes|true|on|always' | |
1068 | ) |
|
1068 | ) | |
1069 |
|
1069 | |||
1070 |
|
1070 | |||
1071 | @check('sqlite', 'sqlite3 module and matching cli is available') |
|
1071 | @check('sqlite', 'sqlite3 module and matching cli is available') | |
1072 | def has_sqlite(): |
|
1072 | def has_sqlite(): | |
1073 | try: |
|
1073 | try: | |
1074 | import sqlite3 |
|
1074 | import sqlite3 | |
1075 |
|
1075 | |||
1076 | version = sqlite3.sqlite_version_info |
|
1076 | version = sqlite3.sqlite_version_info | |
1077 | except ImportError: |
|
1077 | except ImportError: | |
1078 | return False |
|
1078 | return False | |
1079 |
|
1079 | |||
1080 | if version < (3, 8, 3): |
|
1080 | if version < (3, 8, 3): | |
1081 | # WITH clause not supported |
|
1081 | # WITH clause not supported | |
1082 | return False |
|
1082 | return False | |
1083 |
|
1083 | |||
1084 | return matchoutput('sqlite3 -version', br'^3\.\d+') |
|
1084 | return matchoutput('sqlite3 -version', br'^3\.\d+') | |
1085 |
|
1085 | |||
1086 |
|
1086 | |||
1087 | @check('vcr', 'vcr http mocking library (pytest-vcr)') |
|
1087 | @check('vcr', 'vcr http mocking library (pytest-vcr)') | |
1088 | def has_vcr(): |
|
1088 | def has_vcr(): | |
1089 | try: |
|
1089 | try: | |
1090 | import vcr |
|
1090 | import vcr | |
1091 |
|
1091 | |||
1092 | vcr.VCR |
|
1092 | vcr.VCR | |
1093 | return True |
|
1093 | return True | |
1094 | except (ImportError, AttributeError): |
|
1094 | except (ImportError, AttributeError): | |
1095 | pass |
|
1095 | pass | |
1096 | return False |
|
1096 | return False | |
1097 |
|
1097 | |||
1098 |
|
1098 | |||
1099 | @check('emacs', 'GNU Emacs') |
|
1099 | @check('emacs', 'GNU Emacs') | |
1100 | def has_emacs(): |
|
1100 | def has_emacs(): | |
1101 | # Our emacs lisp uses `with-eval-after-load` which is new in emacs |
|
1101 | # Our emacs lisp uses `with-eval-after-load` which is new in emacs | |
1102 | # 24.4, so we allow emacs 24.4, 24.5, and 25+ (24.5 was the last |
|
1102 | # 24.4, so we allow emacs 24.4, 24.5, and 25+ (24.5 was the last | |
1103 | # 24 release) |
|
1103 | # 24 release) | |
1104 | return matchoutput('emacs --version', b'GNU Emacs 2(4.4|4.5|5|6|7|8|9)') |
|
1104 | return matchoutput('emacs --version', b'GNU Emacs 2(4.4|4.5|5|6|7|8|9)') | |
1105 |
|
1105 | |||
1106 |
|
1106 | |||
1107 | @check('black', 'the black formatter for python (>= 20.8b1)') |
|
1107 | @check('black', 'the black formatter for python (>= 20.8b1)') | |
1108 | def has_black(): |
|
1108 | def has_black(): | |
1109 | blackcmd = 'black --version' |
|
1109 | blackcmd = 'black --version' | |
1110 | version_regex = b'black, version ([0-9a-b.]+)' |
|
1110 | version_regex = b'black, version ([0-9a-b.]+)' | |
1111 | version = matchoutput(blackcmd, version_regex) |
|
1111 | version = matchoutput(blackcmd, version_regex) | |
1112 | sv = distutils.version.StrictVersion |
|
1112 | sv = distutils.version.StrictVersion | |
1113 | return version and sv(_bytes2sys(version.group(1))) >= sv('20.8b1') |
|
1113 | return version and sv(_bytes2sys(version.group(1))) >= sv('20.8b1') | |
1114 |
|
1114 | |||
1115 |
|
1115 | |||
1116 | @check('pytype', 'the pytype type checker') |
|
1116 | @check('pytype', 'the pytype type checker') | |
1117 | def has_pytype(): |
|
1117 | def has_pytype(): | |
1118 | pytypecmd = 'pytype --version' |
|
1118 | pytypecmd = 'pytype --version' | |
1119 | version = matchoutput(pytypecmd, b'[0-9a-b.]+') |
|
1119 | version = matchoutput(pytypecmd, b'[0-9a-b.]+') | |
1120 | sv = distutils.version.StrictVersion |
|
1120 | sv = distutils.version.StrictVersion | |
1121 | return version and sv(_bytes2sys(version.group(0))) >= sv('2019.10.17') |
|
1121 | return version and sv(_bytes2sys(version.group(0))) >= sv('2019.10.17') | |
1122 |
|
1122 | |||
1123 |
|
1123 | |||
1124 | @check("rustfmt", "rustfmt tool at version nightly-2020-10-04") |
|
1124 | @check("rustfmt", "rustfmt tool at version nightly-2020-10-04") | |
1125 | def has_rustfmt(): |
|
1125 | def has_rustfmt(): | |
1126 | # We use Nightly's rustfmt due to current unstable config options. |
|
1126 | # We use Nightly's rustfmt due to current unstable config options. | |
1127 | return matchoutput( |
|
1127 | return matchoutput( | |
1128 | '`rustup which --toolchain nightly-2020-10-04 rustfmt` --version', |
|
1128 | '`rustup which --toolchain nightly-2020-10-04 rustfmt` --version', | |
1129 | b'rustfmt', |
|
1129 | b'rustfmt', | |
1130 | ) |
|
1130 | ) | |
1131 |
|
1131 | |||
1132 |
|
1132 | |||
1133 | @check("cargo", "cargo tool") |
|
1133 | @check("cargo", "cargo tool") | |
1134 | def has_cargo(): |
|
1134 | def has_cargo(): | |
1135 | return matchoutput('`rustup which cargo` --version', b'cargo') |
|
1135 | return matchoutput('`rustup which cargo` --version', b'cargo') | |
1136 |
|
1136 | |||
1137 |
|
1137 | |||
1138 | @check("lzma", "python lzma module") |
|
1138 | @check("lzma", "python lzma module") | |
1139 | def has_lzma(): |
|
1139 | def has_lzma(): | |
1140 | try: |
|
1140 | try: | |
1141 | import _lzma |
|
1141 | import _lzma | |
1142 |
|
1142 | |||
1143 | _lzma.FORMAT_XZ |
|
1143 | _lzma.FORMAT_XZ | |
1144 | return True |
|
1144 | return True | |
1145 | except ImportError: |
|
1145 | except ImportError: | |
1146 | return False |
|
1146 | return False | |
1147 |
|
1147 | |||
1148 |
|
1148 | |||
1149 | @check("bash", "bash shell") |
|
1149 | @check("bash", "bash shell") | |
1150 | def has_bash(): |
|
1150 | def has_bash(): | |
1151 | return matchoutput("bash -c 'echo hi'", b'^hi$') |
|
1151 | return matchoutput("bash -c 'echo hi'", b'^hi$') | |
|
1152 | ||||
|
1153 | ||||
|
1154 | @check("bigendian", "big-endian CPU") | |||
|
1155 | def has_bigendian(): | |||
|
1156 | return sys.byteorder == 'big' |
@@ -1,904 +1,907 | |||||
1 | #require serve no-reposimplestore no-chg |
|
1 | #require serve no-reposimplestore no-chg | |
2 |
|
2 | |||
3 | #testcases stream-legacy stream-bundle2 |
|
3 | #testcases stream-legacy stream-bundle2 | |
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 | > EOF |
|
9 | > EOF | |
10 | #endif |
|
10 | #endif | |
11 |
|
11 | |||
12 | Initialize repository |
|
12 | Initialize repository | |
13 | the status call is to check for issue5130 |
|
13 | the status call is to check for issue5130 | |
14 |
|
14 | |||
15 | $ hg init server |
|
15 | $ hg init server | |
16 | $ cd server |
|
16 | $ cd server | |
17 | $ touch foo |
|
17 | $ touch foo | |
18 | $ hg -q commit -A -m initial |
|
18 | $ hg -q commit -A -m initial | |
19 | >>> for i in range(1024): |
|
19 | >>> for i in range(1024): | |
20 | ... with open(str(i), 'wb') as fh: |
|
20 | ... with open(str(i), 'wb') as fh: | |
21 | ... fh.write(b"%d" % i) and None |
|
21 | ... fh.write(b"%d" % i) and None | |
22 | $ hg -q commit -A -m 'add a lot of files' |
|
22 | $ hg -q commit -A -m 'add a lot of files' | |
23 | $ hg st |
|
23 | $ hg st | |
24 |
|
24 | |||
25 | add files with "tricky" name: |
|
25 | add files with "tricky" name: | |
26 |
|
26 | |||
27 | $ echo foo > 00changelog.i |
|
27 | $ echo foo > 00changelog.i | |
28 | $ echo foo > 00changelog.d |
|
28 | $ echo foo > 00changelog.d | |
29 | $ echo foo > 00changelog.n |
|
29 | $ echo foo > 00changelog.n | |
30 | $ echo foo > 00changelog-ab349180a0405010.nd |
|
30 | $ echo foo > 00changelog-ab349180a0405010.nd | |
31 | $ echo foo > 00manifest.i |
|
31 | $ echo foo > 00manifest.i | |
32 | $ echo foo > 00manifest.d |
|
32 | $ echo foo > 00manifest.d | |
33 | $ echo foo > foo.i |
|
33 | $ echo foo > foo.i | |
34 | $ echo foo > foo.d |
|
34 | $ echo foo > foo.d | |
35 | $ echo foo > foo.n |
|
35 | $ echo foo > foo.n | |
36 | $ echo foo > undo.py |
|
36 | $ echo foo > undo.py | |
37 | $ echo foo > undo.i |
|
37 | $ echo foo > undo.i | |
38 | $ echo foo > undo.d |
|
38 | $ echo foo > undo.d | |
39 | $ echo foo > undo.n |
|
39 | $ echo foo > undo.n | |
40 | $ echo foo > undo.foo.i |
|
40 | $ echo foo > undo.foo.i | |
41 | $ echo foo > undo.foo.d |
|
41 | $ echo foo > undo.foo.d | |
42 | $ echo foo > undo.foo.n |
|
42 | $ echo foo > undo.foo.n | |
43 | $ echo foo > undo.babar |
|
43 | $ echo foo > undo.babar | |
44 | $ mkdir savanah |
|
44 | $ mkdir savanah | |
45 | $ echo foo > savanah/foo.i |
|
45 | $ echo foo > savanah/foo.i | |
46 | $ echo foo > savanah/foo.d |
|
46 | $ echo foo > savanah/foo.d | |
47 | $ echo foo > savanah/foo.n |
|
47 | $ echo foo > savanah/foo.n | |
48 | $ echo foo > savanah/undo.py |
|
48 | $ echo foo > savanah/undo.py | |
49 | $ echo foo > savanah/undo.i |
|
49 | $ echo foo > savanah/undo.i | |
50 | $ echo foo > savanah/undo.d |
|
50 | $ echo foo > savanah/undo.d | |
51 | $ echo foo > savanah/undo.n |
|
51 | $ echo foo > savanah/undo.n | |
52 | $ echo foo > savanah/undo.foo.i |
|
52 | $ echo foo > savanah/undo.foo.i | |
53 | $ echo foo > savanah/undo.foo.d |
|
53 | $ echo foo > savanah/undo.foo.d | |
54 | $ echo foo > savanah/undo.foo.n |
|
54 | $ echo foo > savanah/undo.foo.n | |
55 | $ echo foo > savanah/undo.babar |
|
55 | $ echo foo > savanah/undo.babar | |
56 | $ mkdir data |
|
56 | $ mkdir data | |
57 | $ echo foo > data/foo.i |
|
57 | $ echo foo > data/foo.i | |
58 | $ echo foo > data/foo.d |
|
58 | $ echo foo > data/foo.d | |
59 | $ echo foo > data/foo.n |
|
59 | $ echo foo > data/foo.n | |
60 | $ echo foo > data/undo.py |
|
60 | $ echo foo > data/undo.py | |
61 | $ echo foo > data/undo.i |
|
61 | $ echo foo > data/undo.i | |
62 | $ echo foo > data/undo.d |
|
62 | $ echo foo > data/undo.d | |
63 | $ echo foo > data/undo.n |
|
63 | $ echo foo > data/undo.n | |
64 | $ echo foo > data/undo.foo.i |
|
64 | $ echo foo > data/undo.foo.i | |
65 | $ echo foo > data/undo.foo.d |
|
65 | $ echo foo > data/undo.foo.d | |
66 | $ echo foo > data/undo.foo.n |
|
66 | $ echo foo > data/undo.foo.n | |
67 | $ echo foo > data/undo.babar |
|
67 | $ echo foo > data/undo.babar | |
68 | $ mkdir meta |
|
68 | $ mkdir meta | |
69 | $ echo foo > meta/foo.i |
|
69 | $ echo foo > meta/foo.i | |
70 | $ echo foo > meta/foo.d |
|
70 | $ echo foo > meta/foo.d | |
71 | $ echo foo > meta/foo.n |
|
71 | $ echo foo > meta/foo.n | |
72 | $ echo foo > meta/undo.py |
|
72 | $ echo foo > meta/undo.py | |
73 | $ echo foo > meta/undo.i |
|
73 | $ echo foo > meta/undo.i | |
74 | $ echo foo > meta/undo.d |
|
74 | $ echo foo > meta/undo.d | |
75 | $ echo foo > meta/undo.n |
|
75 | $ echo foo > meta/undo.n | |
76 | $ echo foo > meta/undo.foo.i |
|
76 | $ echo foo > meta/undo.foo.i | |
77 | $ echo foo > meta/undo.foo.d |
|
77 | $ echo foo > meta/undo.foo.d | |
78 | $ echo foo > meta/undo.foo.n |
|
78 | $ echo foo > meta/undo.foo.n | |
79 | $ echo foo > meta/undo.babar |
|
79 | $ echo foo > meta/undo.babar | |
80 | $ mkdir store |
|
80 | $ mkdir store | |
81 | $ echo foo > store/foo.i |
|
81 | $ echo foo > store/foo.i | |
82 | $ echo foo > store/foo.d |
|
82 | $ echo foo > store/foo.d | |
83 | $ echo foo > store/foo.n |
|
83 | $ echo foo > store/foo.n | |
84 | $ echo foo > store/undo.py |
|
84 | $ echo foo > store/undo.py | |
85 | $ echo foo > store/undo.i |
|
85 | $ echo foo > store/undo.i | |
86 | $ echo foo > store/undo.d |
|
86 | $ echo foo > store/undo.d | |
87 | $ echo foo > store/undo.n |
|
87 | $ echo foo > store/undo.n | |
88 | $ echo foo > store/undo.foo.i |
|
88 | $ echo foo > store/undo.foo.i | |
89 | $ echo foo > store/undo.foo.d |
|
89 | $ echo foo > store/undo.foo.d | |
90 | $ echo foo > store/undo.foo.n |
|
90 | $ echo foo > store/undo.foo.n | |
91 | $ echo foo > store/undo.babar |
|
91 | $ echo foo > store/undo.babar | |
92 |
|
92 | |||
93 | Name with special characters |
|
93 | Name with special characters | |
94 |
|
94 | |||
95 | $ echo foo > store/CélesteVille_is_a_Capital_City |
|
95 | $ echo foo > store/CélesteVille_is_a_Capital_City | |
96 |
|
96 | |||
97 | name causing issue6581 |
|
97 | name causing issue6581 | |
98 |
|
98 | |||
99 | $ mkdir -p container/isam-build-centos7/ |
|
99 | $ mkdir -p container/isam-build-centos7/ | |
100 | $ touch container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch |
|
100 | $ touch container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch | |
101 |
|
101 | |||
102 | Add all that |
|
102 | Add all that | |
103 |
|
103 | |||
104 | $ hg add . |
|
104 | $ hg add . | |
105 | adding 00changelog-ab349180a0405010.nd |
|
105 | adding 00changelog-ab349180a0405010.nd | |
106 | adding 00changelog.d |
|
106 | adding 00changelog.d | |
107 | adding 00changelog.i |
|
107 | adding 00changelog.i | |
108 | adding 00changelog.n |
|
108 | adding 00changelog.n | |
109 | adding 00manifest.d |
|
109 | adding 00manifest.d | |
110 | adding 00manifest.i |
|
110 | adding 00manifest.i | |
111 | adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch |
|
111 | adding container/isam-build-centos7/bazel-coverage-generator-sandboxfs-compatibility-0758e3e4f6057904d44399bd666faba9e7f40686.patch | |
112 | adding data/foo.d |
|
112 | adding data/foo.d | |
113 | adding data/foo.i |
|
113 | adding data/foo.i | |
114 | adding data/foo.n |
|
114 | adding data/foo.n | |
115 | adding data/undo.babar |
|
115 | adding data/undo.babar | |
116 | adding data/undo.d |
|
116 | adding data/undo.d | |
117 | adding data/undo.foo.d |
|
117 | adding data/undo.foo.d | |
118 | adding data/undo.foo.i |
|
118 | adding data/undo.foo.i | |
119 | adding data/undo.foo.n |
|
119 | adding data/undo.foo.n | |
120 | adding data/undo.i |
|
120 | adding data/undo.i | |
121 | adding data/undo.n |
|
121 | adding data/undo.n | |
122 | adding data/undo.py |
|
122 | adding data/undo.py | |
123 | adding foo.d |
|
123 | adding foo.d | |
124 | adding foo.i |
|
124 | adding foo.i | |
125 | adding foo.n |
|
125 | adding foo.n | |
126 | adding meta/foo.d |
|
126 | adding meta/foo.d | |
127 | adding meta/foo.i |
|
127 | adding meta/foo.i | |
128 | adding meta/foo.n |
|
128 | adding meta/foo.n | |
129 | adding meta/undo.babar |
|
129 | adding meta/undo.babar | |
130 | adding meta/undo.d |
|
130 | adding meta/undo.d | |
131 | adding meta/undo.foo.d |
|
131 | adding meta/undo.foo.d | |
132 | adding meta/undo.foo.i |
|
132 | adding meta/undo.foo.i | |
133 | adding meta/undo.foo.n |
|
133 | adding meta/undo.foo.n | |
134 | adding meta/undo.i |
|
134 | adding meta/undo.i | |
135 | adding meta/undo.n |
|
135 | adding meta/undo.n | |
136 | adding meta/undo.py |
|
136 | adding meta/undo.py | |
137 | adding savanah/foo.d |
|
137 | adding savanah/foo.d | |
138 | adding savanah/foo.i |
|
138 | adding savanah/foo.i | |
139 | adding savanah/foo.n |
|
139 | adding savanah/foo.n | |
140 | adding savanah/undo.babar |
|
140 | adding savanah/undo.babar | |
141 | adding savanah/undo.d |
|
141 | adding savanah/undo.d | |
142 | adding savanah/undo.foo.d |
|
142 | adding savanah/undo.foo.d | |
143 | adding savanah/undo.foo.i |
|
143 | adding savanah/undo.foo.i | |
144 | adding savanah/undo.foo.n |
|
144 | adding savanah/undo.foo.n | |
145 | adding savanah/undo.i |
|
145 | adding savanah/undo.i | |
146 | adding savanah/undo.n |
|
146 | adding savanah/undo.n | |
147 | adding savanah/undo.py |
|
147 | adding savanah/undo.py | |
148 | adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc) |
|
148 | adding store/C\xc3\xa9lesteVille_is_a_Capital_City (esc) | |
149 | adding store/foo.d |
|
149 | adding store/foo.d | |
150 | adding store/foo.i |
|
150 | adding store/foo.i | |
151 | adding store/foo.n |
|
151 | adding store/foo.n | |
152 | adding store/undo.babar |
|
152 | adding store/undo.babar | |
153 | adding store/undo.d |
|
153 | adding store/undo.d | |
154 | adding store/undo.foo.d |
|
154 | adding store/undo.foo.d | |
155 | adding store/undo.foo.i |
|
155 | adding store/undo.foo.i | |
156 | adding store/undo.foo.n |
|
156 | adding store/undo.foo.n | |
157 | adding store/undo.i |
|
157 | adding store/undo.i | |
158 | adding store/undo.n |
|
158 | adding store/undo.n | |
159 | adding store/undo.py |
|
159 | adding store/undo.py | |
160 | adding undo.babar |
|
160 | adding undo.babar | |
161 | adding undo.d |
|
161 | adding undo.d | |
162 | adding undo.foo.d |
|
162 | adding undo.foo.d | |
163 | adding undo.foo.i |
|
163 | adding undo.foo.i | |
164 | adding undo.foo.n |
|
164 | adding undo.foo.n | |
165 | adding undo.i |
|
165 | adding undo.i | |
166 | adding undo.n |
|
166 | adding undo.n | |
167 | adding undo.py |
|
167 | adding undo.py | |
168 | $ hg ci -m 'add files with "tricky" name' |
|
168 | $ hg ci -m 'add files with "tricky" name' | |
169 | $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid |
|
169 | $ hg --config server.uncompressed=false serve -p $HGPORT -d --pid-file=hg.pid | |
170 | $ cat hg.pid > $DAEMON_PIDS |
|
170 | $ cat hg.pid > $DAEMON_PIDS | |
171 | $ cd .. |
|
171 | $ cd .. | |
172 |
|
172 | |||
173 | Check local clone |
|
173 | Check local clone | |
174 | ================== |
|
174 | ================== | |
175 |
|
175 | |||
176 | The logic is close enough of uncompressed. |
|
176 | The logic is close enough of uncompressed. | |
177 | This is present here to reuse the testing around file with "special" names. |
|
177 | This is present here to reuse the testing around file with "special" names. | |
178 |
|
178 | |||
179 | $ hg clone server local-clone |
|
179 | $ hg clone server local-clone | |
180 | updating to branch default |
|
180 | updating to branch default | |
181 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
181 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
182 |
|
182 | |||
183 | Check that the clone went well |
|
183 | Check that the clone went well | |
184 |
|
184 | |||
185 | $ hg verify -R local-clone |
|
185 | $ hg verify -R local-clone | |
186 | checking changesets |
|
186 | checking changesets | |
187 | checking manifests |
|
187 | checking manifests | |
188 | crosschecking files in changesets and manifests |
|
188 | crosschecking files in changesets and manifests | |
189 | checking files |
|
189 | checking files | |
190 | checked 3 changesets with 1088 changes to 1088 files |
|
190 | checked 3 changesets with 1088 changes to 1088 files | |
191 |
|
191 | |||
192 | Check uncompressed |
|
192 | Check uncompressed | |
193 | ================== |
|
193 | ================== | |
194 |
|
194 | |||
195 | Cannot stream clone when server.uncompressed is set |
|
195 | Cannot stream clone when server.uncompressed is set | |
196 |
|
196 | |||
197 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out' |
|
197 | $ get-with-headers.py $LOCALIP:$HGPORT '?cmd=stream_out' | |
198 | 200 Script output follows |
|
198 | 200 Script output follows | |
199 |
|
199 | |||
200 | 1 |
|
200 | 1 | |
201 |
|
201 | |||
202 | #if stream-legacy |
|
202 | #if stream-legacy | |
203 | $ hg debugcapabilities http://localhost:$HGPORT |
|
203 | $ hg debugcapabilities http://localhost:$HGPORT | |
204 | Main capabilities: |
|
204 | Main capabilities: | |
205 | batch |
|
205 | batch | |
206 | branchmap |
|
206 | branchmap | |
207 | $USUAL_BUNDLE2_CAPS_SERVER$ |
|
207 | $USUAL_BUNDLE2_CAPS_SERVER$ | |
208 | changegroupsubset |
|
208 | changegroupsubset | |
209 | compression=$BUNDLE2_COMPRESSIONS$ |
|
209 | compression=$BUNDLE2_COMPRESSIONS$ | |
210 | getbundle |
|
210 | getbundle | |
211 | httpheader=1024 |
|
211 | httpheader=1024 | |
212 | httpmediatype=0.1rx,0.1tx,0.2tx |
|
212 | httpmediatype=0.1rx,0.1tx,0.2tx | |
213 | known |
|
213 | known | |
214 | lookup |
|
214 | lookup | |
215 | pushkey |
|
215 | pushkey | |
216 | unbundle=HG10GZ,HG10BZ,HG10UN |
|
216 | unbundle=HG10GZ,HG10BZ,HG10UN | |
217 | unbundlehash |
|
217 | unbundlehash | |
218 | Bundle2 capabilities: |
|
218 | Bundle2 capabilities: | |
219 | HG20 |
|
219 | HG20 | |
220 | bookmarks |
|
220 | bookmarks | |
221 | changegroup |
|
221 | changegroup | |
222 | 01 |
|
222 | 01 | |
223 | 02 |
|
223 | 02 | |
224 | checkheads |
|
224 | checkheads | |
225 | related |
|
225 | related | |
226 | digests |
|
226 | digests | |
227 | md5 |
|
227 | md5 | |
228 | sha1 |
|
228 | sha1 | |
229 | sha512 |
|
229 | sha512 | |
230 | error |
|
230 | error | |
231 | abort |
|
231 | abort | |
232 | unsupportedcontent |
|
232 | unsupportedcontent | |
233 | pushraced |
|
233 | pushraced | |
234 | pushkey |
|
234 | pushkey | |
235 | hgtagsfnodes |
|
235 | hgtagsfnodes | |
236 | listkeys |
|
236 | listkeys | |
237 | phases |
|
237 | phases | |
238 | heads |
|
238 | heads | |
239 | pushkey |
|
239 | pushkey | |
240 | remote-changegroup |
|
240 | remote-changegroup | |
241 | http |
|
241 | http | |
242 | https |
|
242 | https | |
243 |
|
243 | |||
244 | $ hg clone --stream -U http://localhost:$HGPORT server-disabled |
|
244 | $ hg clone --stream -U http://localhost:$HGPORT server-disabled | |
245 | warning: stream clone requested but server has them disabled |
|
245 | warning: stream clone requested but server has them disabled | |
246 | requesting all changes |
|
246 | requesting all changes | |
247 | adding changesets |
|
247 | adding changesets | |
248 | adding manifests |
|
248 | adding manifests | |
249 | adding file changes |
|
249 | adding file changes | |
250 | added 3 changesets with 1088 changes to 1088 files |
|
250 | added 3 changesets with 1088 changes to 1088 files | |
251 | new changesets 96ee1d7354c4:5223b5e3265f |
|
251 | new changesets 96ee1d7354c4:5223b5e3265f | |
252 |
|
252 | |||
253 | $ 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%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" |
|
253 | $ 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%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" | |
254 | 200 Script output follows |
|
254 | 200 Script output follows | |
255 | content-type: application/mercurial-0.2 |
|
255 | content-type: application/mercurial-0.2 | |
256 |
|
256 | |||
257 |
|
257 | |||
258 | $ f --size body --hexdump --bytes 100 |
|
258 | $ f --size body --hexdump --bytes 100 | |
259 | body: size=232 |
|
259 | body: size=232 | |
260 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
260 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| | |
261 | 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| |
|
261 | 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| | |
262 | 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| |
|
262 | 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| | |
263 | 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| |
|
263 | 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| | |
264 | 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| |
|
264 | 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| | |
265 | 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| |
|
265 | 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| | |
266 | 0060: 69 73 20 66 |is f| |
|
266 | 0060: 69 73 20 66 |is f| | |
267 |
|
267 | |||
268 | #endif |
|
268 | #endif | |
269 | #if stream-bundle2 |
|
269 | #if stream-bundle2 | |
270 | $ hg debugcapabilities http://localhost:$HGPORT |
|
270 | $ hg debugcapabilities http://localhost:$HGPORT | |
271 | Main capabilities: |
|
271 | Main capabilities: | |
272 | batch |
|
272 | batch | |
273 | branchmap |
|
273 | branchmap | |
274 | $USUAL_BUNDLE2_CAPS_SERVER$ |
|
274 | $USUAL_BUNDLE2_CAPS_SERVER$ | |
275 | changegroupsubset |
|
275 | changegroupsubset | |
276 | compression=$BUNDLE2_COMPRESSIONS$ |
|
276 | compression=$BUNDLE2_COMPRESSIONS$ | |
277 | getbundle |
|
277 | getbundle | |
278 | httpheader=1024 |
|
278 | httpheader=1024 | |
279 | httpmediatype=0.1rx,0.1tx,0.2tx |
|
279 | httpmediatype=0.1rx,0.1tx,0.2tx | |
280 | known |
|
280 | known | |
281 | lookup |
|
281 | lookup | |
282 | pushkey |
|
282 | pushkey | |
283 | unbundle=HG10GZ,HG10BZ,HG10UN |
|
283 | unbundle=HG10GZ,HG10BZ,HG10UN | |
284 | unbundlehash |
|
284 | unbundlehash | |
285 | Bundle2 capabilities: |
|
285 | Bundle2 capabilities: | |
286 | HG20 |
|
286 | HG20 | |
287 | bookmarks |
|
287 | bookmarks | |
288 | changegroup |
|
288 | changegroup | |
289 | 01 |
|
289 | 01 | |
290 | 02 |
|
290 | 02 | |
291 | checkheads |
|
291 | checkheads | |
292 | related |
|
292 | related | |
293 | digests |
|
293 | digests | |
294 | md5 |
|
294 | md5 | |
295 | sha1 |
|
295 | sha1 | |
296 | sha512 |
|
296 | sha512 | |
297 | error |
|
297 | error | |
298 | abort |
|
298 | abort | |
299 | unsupportedcontent |
|
299 | unsupportedcontent | |
300 | pushraced |
|
300 | pushraced | |
301 | pushkey |
|
301 | pushkey | |
302 | hgtagsfnodes |
|
302 | hgtagsfnodes | |
303 | listkeys |
|
303 | listkeys | |
304 | phases |
|
304 | phases | |
305 | heads |
|
305 | heads | |
306 | pushkey |
|
306 | pushkey | |
307 | remote-changegroup |
|
307 | remote-changegroup | |
308 | http |
|
308 | http | |
309 | https |
|
309 | https | |
310 |
|
310 | |||
311 | $ hg clone --stream -U http://localhost:$HGPORT server-disabled |
|
311 | $ hg clone --stream -U http://localhost:$HGPORT server-disabled | |
312 | warning: stream clone requested but server has them disabled |
|
312 | warning: stream clone requested but server has them disabled | |
313 | requesting all changes |
|
313 | requesting all changes | |
314 | adding changesets |
|
314 | adding changesets | |
315 | adding manifests |
|
315 | adding manifests | |
316 | adding file changes |
|
316 | adding file changes | |
317 | added 3 changesets with 1088 changes to 1088 files |
|
317 | added 3 changesets with 1088 changes to 1088 files | |
318 | new changesets 96ee1d7354c4:5223b5e3265f |
|
318 | new changesets 96ee1d7354c4:5223b5e3265f | |
319 |
|
319 | |||
320 | $ 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%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" |
|
320 | $ 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%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" | |
321 | 200 Script output follows |
|
321 | 200 Script output follows | |
322 | content-type: application/mercurial-0.2 |
|
322 | content-type: application/mercurial-0.2 | |
323 |
|
323 | |||
324 |
|
324 | |||
325 | $ f --size body --hexdump --bytes 100 |
|
325 | $ f --size body --hexdump --bytes 100 | |
326 | body: size=232 |
|
326 | body: size=232 | |
327 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
327 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| | |
328 | 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| |
|
328 | 0010: cf 0b 45 52 52 4f 52 3a 41 42 4f 52 54 00 00 00 |..ERROR:ABORT...| | |
329 | 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| |
|
329 | 0020: 00 01 01 07 3c 04 72 6d 65 73 73 61 67 65 73 74 |....<.rmessagest| | |
330 | 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| |
|
330 | 0030: 72 65 61 6d 20 64 61 74 61 20 72 65 71 75 65 73 |ream data reques| | |
331 | 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| |
|
331 | 0040: 74 65 64 20 62 75 74 20 73 65 72 76 65 72 20 64 |ted but server d| | |
332 | 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| |
|
332 | 0050: 6f 65 73 20 6e 6f 74 20 61 6c 6c 6f 77 20 74 68 |oes not allow th| | |
333 | 0060: 69 73 20 66 |is f| |
|
333 | 0060: 69 73 20 66 |is f| | |
334 |
|
334 | |||
335 | #endif |
|
335 | #endif | |
336 |
|
336 | |||
337 | $ killdaemons.py |
|
337 | $ killdaemons.py | |
338 | $ cd server |
|
338 | $ cd server | |
339 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt |
|
339 | $ hg serve -p $HGPORT -d --pid-file=hg.pid --error errors.txt | |
340 | $ cat hg.pid > $DAEMON_PIDS |
|
340 | $ cat hg.pid > $DAEMON_PIDS | |
341 | $ cd .. |
|
341 | $ cd .. | |
342 |
|
342 | |||
343 | Basic clone |
|
343 | Basic clone | |
344 |
|
344 | |||
345 | #if stream-legacy |
|
345 | #if stream-legacy | |
346 | $ hg clone --stream -U http://localhost:$HGPORT clone1 |
|
346 | $ hg clone --stream -U http://localhost:$HGPORT clone1 | |
347 | streaming all changes |
|
347 | streaming all changes | |
348 | 1090 files to transfer, 102 KB of data (no-zstd !) |
|
348 | 1090 files to transfer, 102 KB of data (no-zstd !) | |
349 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
349 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
350 | 1090 files to transfer, 98.8 KB of data (zstd !) |
|
350 | 1090 files to transfer, 98.8 KB of data (zstd !) | |
351 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
351 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) | |
352 | searching for changes |
|
352 | searching for changes | |
353 | no changes found |
|
353 | no changes found | |
354 | $ cat server/errors.txt |
|
354 | $ cat server/errors.txt | |
355 | #endif |
|
355 | #endif | |
356 | #if stream-bundle2 |
|
356 | #if stream-bundle2 | |
357 | $ hg clone --stream -U http://localhost:$HGPORT clone1 |
|
357 | $ hg clone --stream -U http://localhost:$HGPORT clone1 | |
358 | streaming all changes |
|
358 | streaming all changes | |
359 | 1093 files to transfer, 102 KB of data (no-zstd !) |
|
359 | 1093 files to transfer, 102 KB of data (no-zstd !) | |
360 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
360 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
361 | 1093 files to transfer, 98.9 KB of data (zstd !) |
|
361 | 1093 files to transfer, 98.9 KB of data (zstd !) | |
362 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !) |
|
362 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !) | |
363 |
|
363 | |||
364 | $ ls -1 clone1/.hg/cache |
|
364 | $ ls -1 clone1/.hg/cache | |
365 | branch2-base |
|
365 | branch2-base | |
366 | branch2-immutable |
|
366 | branch2-immutable | |
367 | branch2-served |
|
367 | branch2-served | |
368 | branch2-served.hidden |
|
368 | branch2-served.hidden | |
369 | branch2-visible |
|
369 | branch2-visible | |
370 | branch2-visible-hidden |
|
370 | branch2-visible-hidden | |
371 | rbc-names-v1 |
|
371 | rbc-names-v1 | |
372 | rbc-revs-v1 |
|
372 | rbc-revs-v1 | |
373 | tags2 |
|
373 | tags2 | |
374 | tags2-served |
|
374 | tags2-served | |
375 | $ cat server/errors.txt |
|
375 | $ cat server/errors.txt | |
376 | #endif |
|
376 | #endif | |
377 |
|
377 | |||
378 | getbundle requests with stream=1 are uncompressed |
|
378 | getbundle requests with stream=1 are uncompressed | |
379 |
|
379 | |||
380 | $ 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%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" |
|
380 | $ 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%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" | |
381 | 200 Script output follows |
|
381 | 200 Script output follows | |
382 | content-type: application/mercurial-0.2 |
|
382 | content-type: application/mercurial-0.2 | |
383 |
|
383 | |||
384 |
|
384 | |||
385 | #if no-zstd no-rust |
|
385 | #if no-zstd no-rust | |
386 | $ f --size --hex --bytes 256 body |
|
386 | $ f --size --hex --bytes 256 body | |
387 | body: size=119153 |
|
387 | body: size=119153 | |
388 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
388 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| | |
389 | 0010: 80 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| |
|
389 | 0010: 80 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| | |
390 | 0020: 06 09 04 0c 44 62 79 74 65 63 6f 75 6e 74 31 30 |....Dbytecount10| |
|
390 | 0020: 06 09 04 0c 44 62 79 74 65 63 6f 75 6e 74 31 30 |....Dbytecount10| | |
391 | 0030: 34 31 31 35 66 69 6c 65 63 6f 75 6e 74 31 30 39 |4115filecount109| |
|
391 | 0030: 34 31 31 35 66 69 6c 65 63 6f 75 6e 74 31 30 39 |4115filecount109| | |
392 | 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |3requirementsdot| |
|
392 | 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |3requirementsdot| | |
393 | 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache| |
|
393 | 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache| | |
394 | 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%| |
|
394 | 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%| | |
395 | 0070: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa| |
|
395 | 0070: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa| | |
396 | 0080: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor| |
|
396 | 0080: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor| | |
397 | 0090: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i| |
|
397 | 0090: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i| | |
398 | 00a0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................| |
|
398 | 00a0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................| | |
399 | 00b0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................| |
|
399 | 00b0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................| | |
400 | 00c0: 80 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c |.)c.I.#....Vg.g,| |
|
400 | 00c0: 80 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c |.)c.I.#....Vg.g,| | |
401 | 00d0: 69 d1 ec 39 00 00 00 00 00 00 00 00 00 00 00 00 |i..9............| |
|
401 | 00d0: 69 d1 ec 39 00 00 00 00 00 00 00 00 00 00 00 00 |i..9............| | |
402 | 00e0: 75 30 73 26 45 64 61 74 61 2f 30 30 63 68 61 6e |u0s&Edata/00chan| |
|
402 | 00e0: 75 30 73 26 45 64 61 74 61 2f 30 30 63 68 61 6e |u0s&Edata/00chan| | |
403 | 00f0: 67 65 6c 6f 67 2d 61 62 33 34 39 31 38 30 61 30 |gelog-ab349180a0| |
|
403 | 00f0: 67 65 6c 6f 67 2d 61 62 33 34 39 31 38 30 61 30 |gelog-ab349180a0| | |
404 | #endif |
|
404 | #endif | |
405 | #if zstd no-rust |
|
405 | #if zstd no-rust | |
406 | $ f --size --hex --bytes 256 body |
|
406 | $ f --size --hex --bytes 256 body | |
407 | body: size=116340 |
|
407 | body: size=116340 (no-bigendian !) | |
|
408 | body: size=116335 (bigendian !) | |||
408 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
409 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| | |
409 | 0010: 9a 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| |
|
410 | 0010: 9a 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| | |
410 | 0020: 06 09 04 0c 5e 62 79 74 65 63 6f 75 6e 74 31 30 |....^bytecount10| |
|
411 | 0020: 06 09 04 0c 5e 62 79 74 65 63 6f 75 6e 74 31 30 |....^bytecount10| | |
411 | 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| |
|
412 | 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| (no-bigendian !) | |
|
413 | 0030: 31 32 37 31 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1271filecount109| (bigendian !) | |||
412 | 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |3requirementsdot| |
|
414 | 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |3requirementsdot| | |
413 | 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache| |
|
415 | 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache| | |
414 | 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%| |
|
416 | 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%| | |
415 | 0070: 32 43 72 65 76 6c 6f 67 2d 63 6f 6d 70 72 65 73 |2Crevlog-compres| |
|
417 | 0070: 32 43 72 65 76 6c 6f 67 2d 63 6f 6d 70 72 65 73 |2Crevlog-compres| | |
416 | 0080: 73 69 6f 6e 2d 7a 73 74 64 25 32 43 72 65 76 6c |sion-zstd%2Crevl| |
|
418 | 0080: 73 69 6f 6e 2d 7a 73 74 64 25 32 43 72 65 76 6c |sion-zstd%2Crevl| | |
417 | 0090: 6f 67 76 31 25 32 43 73 70 61 72 73 65 72 65 76 |ogv1%2Csparserev| |
|
419 | 0090: 6f 67 76 31 25 32 43 73 70 61 72 73 65 72 65 76 |ogv1%2Csparserev| | |
418 | 00a0: 6c 6f 67 25 32 43 73 74 6f 72 65 00 00 80 00 73 |log%2Cstore....s| |
|
420 | 00a0: 6c 6f 67 25 32 43 73 74 6f 72 65 00 00 80 00 73 |log%2Cstore....s| | |
419 | 00b0: 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 00 00 |.Bdata/0.i......| |
|
421 | 00b0: 08 42 64 61 74 61 2f 30 2e 69 00 03 00 01 00 00 |.Bdata/0.i......| | |
420 | 00c0: 00 00 00 00 00 02 00 00 00 01 00 00 00 00 00 00 |................| |
|
422 | 00c0: 00 00 00 00 00 02 00 00 00 01 00 00 00 00 00 00 |................| | |
421 | 00d0: 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 49 d3 |...........)c.I.| |
|
423 | 00d0: 00 01 ff ff ff ff ff ff ff ff 80 29 63 a0 49 d3 |...........)c.I.| | |
422 | 00e0: 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 00 00 |#....Vg.g,i..9..| |
|
424 | 00e0: 23 87 bf ce fe 56 67 92 67 2c 69 d1 ec 39 00 00 |#....Vg.g,i..9..| | |
423 | 00f0: 00 00 00 00 00 00 00 00 00 00 75 30 73 26 45 64 |..........u0s&Ed| |
|
425 | 00f0: 00 00 00 00 00 00 00 00 00 00 75 30 73 26 45 64 |..........u0s&Ed| | |
424 | #endif |
|
426 | #endif | |
425 | #if zstd rust no-dirstate-v2 |
|
427 | #if zstd rust no-dirstate-v2 | |
426 | $ f --size --hex --bytes 256 body |
|
428 | $ f --size --hex --bytes 256 body | |
427 | body: size=116361 |
|
429 | body: size=116361 | |
428 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
430 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| | |
429 | 0010: af 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| |
|
431 | 0010: af 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| | |
430 | 0020: 06 09 04 0c 73 62 79 74 65 63 6f 75 6e 74 31 30 |....sbytecount10| |
|
432 | 0020: 06 09 04 0c 73 62 79 74 65 63 6f 75 6e 74 31 30 |....sbytecount10| | |
431 | 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| |
|
433 | 0030: 31 32 37 36 66 69 6c 65 63 6f 75 6e 74 31 30 39 |1276filecount109| | |
432 | 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |3requirementsdot| |
|
434 | 0040: 33 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 |3requirementsdot| | |
433 | 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache| |
|
435 | 0050: 65 6e 63 6f 64 65 25 32 43 66 6e 63 61 63 68 65 |encode%2Cfncache| | |
434 | 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%| |
|
436 | 0060: 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 25 |%2Cgeneraldelta%| | |
435 | 0070: 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f 64 |2Cpersistent-nod| |
|
437 | 0070: 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f 64 |2Cpersistent-nod| | |
436 | 0080: 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 6f |emap%2Crevlog-co| |
|
438 | 0080: 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 6f |emap%2Crevlog-co| | |
437 | 0090: 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 32 |mpression-zstd%2| |
|
439 | 0090: 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 32 |mpression-zstd%2| | |
438 | 00a0: 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 72 |Crevlogv1%2Cspar| |
|
440 | 00a0: 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 72 |Crevlogv1%2Cspar| | |
439 | 00b0: 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 65 |serevlog%2Cstore| |
|
441 | 00b0: 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 65 |serevlog%2Cstore| | |
440 | 00c0: 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 00 |....s.Bdata/0.i.| |
|
442 | 00c0: 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 00 |....s.Bdata/0.i.| | |
441 | 00d0: 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 00 |................| |
|
443 | 00d0: 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 00 |................| | |
442 | 00e0: 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff 80 |................| |
|
444 | 00e0: 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff 80 |................| | |
443 | 00f0: 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 |)c.I.#....Vg.g,i| |
|
445 | 00f0: 29 63 a0 49 d3 23 87 bf ce fe 56 67 92 67 2c 69 |)c.I.#....Vg.g,i| | |
444 | #endif |
|
446 | #endif | |
445 | #if zstd dirstate-v2 |
|
447 | #if zstd dirstate-v2 | |
446 | $ f --size --hex --bytes 256 body |
|
448 | $ f --size --hex --bytes 256 body | |
447 | body: size=109549 |
|
449 | body: size=109549 | |
448 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| |
|
450 | 0000: 04 6e 6f 6e 65 48 47 32 30 00 00 00 00 00 00 00 |.noneHG20.......| | |
449 | 0010: c0 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| |
|
451 | 0010: c0 07 53 54 52 45 41 4d 32 00 00 00 00 03 00 09 |..STREAM2.......| | |
450 | 0020: 05 09 04 0c 85 62 79 74 65 63 6f 75 6e 74 39 35 |.....bytecount95| |
|
452 | 0020: 05 09 04 0c 85 62 79 74 65 63 6f 75 6e 74 39 35 |.....bytecount95| | |
451 | 0030: 38 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |897filecount1030| |
|
453 | 0030: 38 39 37 66 69 6c 65 63 6f 75 6e 74 31 30 33 30 |897filecount1030| | |
452 | 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote| |
|
454 | 0040: 72 65 71 75 69 72 65 6d 65 6e 74 73 64 6f 74 65 |requirementsdote| | |
453 | 0050: 6e 63 6f 64 65 25 32 43 65 78 70 2d 64 69 72 73 |ncode%2Cexp-dirs| |
|
455 | 0050: 6e 63 6f 64 65 25 32 43 65 78 70 2d 64 69 72 73 |ncode%2Cexp-dirs| | |
454 | 0060: 74 61 74 65 2d 76 32 25 32 43 66 6e 63 61 63 68 |tate-v2%2Cfncach| |
|
456 | 0060: 74 61 74 65 2d 76 32 25 32 43 66 6e 63 61 63 68 |tate-v2%2Cfncach| | |
455 | 0070: 65 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 |e%2Cgeneraldelta| |
|
457 | 0070: 65 25 32 43 67 65 6e 65 72 61 6c 64 65 6c 74 61 |e%2Cgeneraldelta| | |
456 | 0080: 25 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f |%2Cpersistent-no| |
|
458 | 0080: 25 32 43 70 65 72 73 69 73 74 65 6e 74 2d 6e 6f |%2Cpersistent-no| | |
457 | 0090: 64 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 |demap%2Crevlog-c| |
|
459 | 0090: 64 65 6d 61 70 25 32 43 72 65 76 6c 6f 67 2d 63 |demap%2Crevlog-c| | |
458 | 00a0: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 |ompression-zstd%| |
|
460 | 00a0: 6f 6d 70 72 65 73 73 69 6f 6e 2d 7a 73 74 64 25 |ompression-zstd%| | |
459 | 00b0: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa| |
|
461 | 00b0: 32 43 72 65 76 6c 6f 67 76 31 25 32 43 73 70 61 |2Crevlogv1%2Cspa| | |
460 | 00c0: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor| |
|
462 | 00c0: 72 73 65 72 65 76 6c 6f 67 25 32 43 73 74 6f 72 |rserevlog%2Cstor| | |
461 | 00d0: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i| |
|
463 | 00d0: 65 00 00 80 00 73 08 42 64 61 74 61 2f 30 2e 69 |e....s.Bdata/0.i| | |
462 | 00e0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................| |
|
464 | 00e0: 00 03 00 01 00 00 00 00 00 00 00 02 00 00 00 01 |................| | |
463 | 00f0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................| |
|
465 | 00f0: 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff |................| | |
464 | #endif |
|
466 | #endif | |
465 |
|
467 | |||
466 | --uncompressed is an alias to --stream |
|
468 | --uncompressed is an alias to --stream | |
467 |
|
469 | |||
468 | #if stream-legacy |
|
470 | #if stream-legacy | |
469 | $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed |
|
471 | $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed | |
470 | streaming all changes |
|
472 | streaming all changes | |
471 | 1090 files to transfer, 102 KB of data (no-zstd !) |
|
473 | 1090 files to transfer, 102 KB of data (no-zstd !) | |
472 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
474 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
473 | 1090 files to transfer, 98.8 KB of data (zstd !) |
|
475 | 1090 files to transfer, 98.8 KB of data (zstd !) | |
474 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
476 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) | |
475 | searching for changes |
|
477 | searching for changes | |
476 | no changes found |
|
478 | no changes found | |
477 | #endif |
|
479 | #endif | |
478 | #if stream-bundle2 |
|
480 | #if stream-bundle2 | |
479 | $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed |
|
481 | $ hg clone --uncompressed -U http://localhost:$HGPORT clone1-uncompressed | |
480 | streaming all changes |
|
482 | streaming all changes | |
481 | 1093 files to transfer, 102 KB of data (no-zstd !) |
|
483 | 1093 files to transfer, 102 KB of data (no-zstd !) | |
482 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
484 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
483 | 1093 files to transfer, 98.9 KB of data (zstd !) |
|
485 | 1093 files to transfer, 98.9 KB of data (zstd !) | |
484 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !) |
|
486 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !) | |
485 | #endif |
|
487 | #endif | |
486 |
|
488 | |||
487 | Clone with background file closing enabled |
|
489 | Clone with background file closing enabled | |
488 |
|
490 | |||
489 | #if stream-legacy |
|
491 | #if stream-legacy | |
490 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding |
|
492 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding | |
491 | using http://localhost:$HGPORT/ |
|
493 | using http://localhost:$HGPORT/ | |
492 | sending capabilities command |
|
494 | sending capabilities command | |
493 | sending branchmap command |
|
495 | sending branchmap command | |
494 | streaming all changes |
|
496 | streaming all changes | |
495 | sending stream_out command |
|
497 | sending stream_out command | |
496 | 1090 files to transfer, 102 KB of data (no-zstd !) |
|
498 | 1090 files to transfer, 102 KB of data (no-zstd !) | |
497 | 1090 files to transfer, 98.8 KB of data (zstd !) |
|
499 | 1090 files to transfer, 98.8 KB of data (zstd !) | |
498 | starting 4 threads for background file closing |
|
500 | starting 4 threads for background file closing | |
499 | updating the branch cache |
|
501 | updating the branch cache | |
500 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
502 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
501 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
503 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) | |
502 | query 1; heads |
|
504 | query 1; heads | |
503 | sending batch command |
|
505 | sending batch command | |
504 | searching for changes |
|
506 | searching for changes | |
505 | all remote heads known locally |
|
507 | all remote heads known locally | |
506 | no changes found |
|
508 | no changes found | |
507 | sending getbundle command |
|
509 | sending getbundle command | |
508 | bundle2-input-bundle: with-transaction |
|
510 | bundle2-input-bundle: with-transaction | |
509 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
|
511 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported | |
510 | bundle2-input-part: "phase-heads" supported |
|
512 | bundle2-input-part: "phase-heads" supported | |
511 | bundle2-input-part: total payload size 24 |
|
513 | bundle2-input-part: total payload size 24 | |
512 | bundle2-input-bundle: 2 parts total |
|
514 | bundle2-input-bundle: 2 parts total | |
513 | checking for updated bookmarks |
|
515 | checking for updated bookmarks | |
514 | updating the branch cache |
|
516 | updating the branch cache | |
515 | (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
517 | (sent 5 HTTP requests and * bytes; received * bytes in responses) (glob) | |
516 | #endif |
|
518 | #endif | |
517 | #if stream-bundle2 |
|
519 | #if stream-bundle2 | |
518 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding |
|
520 | $ hg --debug --config worker.backgroundclose=true --config worker.backgroundcloseminfilecount=1 clone --stream -U http://localhost:$HGPORT clone-background | grep -v adding | |
519 | using http://localhost:$HGPORT/ |
|
521 | using http://localhost:$HGPORT/ | |
520 | sending capabilities command |
|
522 | sending capabilities command | |
521 | query 1; heads |
|
523 | query 1; heads | |
522 | sending batch command |
|
524 | sending batch command | |
523 | streaming all changes |
|
525 | streaming all changes | |
524 | sending getbundle command |
|
526 | sending getbundle command | |
525 | bundle2-input-bundle: with-transaction |
|
527 | bundle2-input-bundle: with-transaction | |
526 | bundle2-input-part: "stream2" (params: 3 mandatory) supported |
|
528 | bundle2-input-part: "stream2" (params: 3 mandatory) supported | |
527 | applying stream bundle |
|
529 | applying stream bundle | |
528 | 1093 files to transfer, 102 KB of data (no-zstd !) |
|
530 | 1093 files to transfer, 102 KB of data (no-zstd !) | |
529 | 1093 files to transfer, 98.9 KB of data (zstd !) |
|
531 | 1093 files to transfer, 98.9 KB of data (zstd !) | |
530 | starting 4 threads for background file closing |
|
532 | starting 4 threads for background file closing | |
531 | starting 4 threads for background file closing |
|
533 | starting 4 threads for background file closing | |
532 | updating the branch cache |
|
534 | updating the branch cache | |
533 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
535 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
534 | bundle2-input-part: total payload size 118984 (no-zstd !) |
|
536 | bundle2-input-part: total payload size 118984 (no-zstd !) | |
535 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !) |
|
537 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !) | |
536 | bundle2-input-part: total payload size 116145 (zstd !) |
|
538 | bundle2-input-part: total payload size 116145 (zstd no-bigendian !) | |
|
539 | bundle2-input-part: total payload size 116140 (zstd bigendian !) | |||
537 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported |
|
540 | bundle2-input-part: "listkeys" (params: 1 mandatory) supported | |
538 | bundle2-input-bundle: 2 parts total |
|
541 | bundle2-input-bundle: 2 parts total | |
539 | checking for updated bookmarks |
|
542 | checking for updated bookmarks | |
540 | updating the branch cache |
|
543 | updating the branch cache | |
541 | (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob) |
|
544 | (sent 3 HTTP requests and * bytes; received * bytes in responses) (glob) | |
542 | #endif |
|
545 | #endif | |
543 |
|
546 | |||
544 | Cannot stream clone when there are secret changesets |
|
547 | Cannot stream clone when there are secret changesets | |
545 |
|
548 | |||
546 | $ hg -R server phase --force --secret -r tip |
|
549 | $ hg -R server phase --force --secret -r tip | |
547 | $ hg clone --stream -U http://localhost:$HGPORT secret-denied |
|
550 | $ hg clone --stream -U http://localhost:$HGPORT secret-denied | |
548 | warning: stream clone requested but server has them disabled |
|
551 | warning: stream clone requested but server has them disabled | |
549 | requesting all changes |
|
552 | requesting all changes | |
550 | adding changesets |
|
553 | adding changesets | |
551 | adding manifests |
|
554 | adding manifests | |
552 | adding file changes |
|
555 | adding file changes | |
553 | added 2 changesets with 1025 changes to 1025 files |
|
556 | added 2 changesets with 1025 changes to 1025 files | |
554 | new changesets 96ee1d7354c4:c17445101a72 |
|
557 | new changesets 96ee1d7354c4:c17445101a72 | |
555 |
|
558 | |||
556 | $ killdaemons.py |
|
559 | $ killdaemons.py | |
557 |
|
560 | |||
558 | Streaming of secrets can be overridden by server config |
|
561 | Streaming of secrets can be overridden by server config | |
559 |
|
562 | |||
560 | $ cd server |
|
563 | $ cd server | |
561 | $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid |
|
564 | $ hg serve --config server.uncompressedallowsecret=true -p $HGPORT -d --pid-file=hg.pid | |
562 | $ cat hg.pid > $DAEMON_PIDS |
|
565 | $ cat hg.pid > $DAEMON_PIDS | |
563 | $ cd .. |
|
566 | $ cd .. | |
564 |
|
567 | |||
565 | #if stream-legacy |
|
568 | #if stream-legacy | |
566 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed |
|
569 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed | |
567 | streaming all changes |
|
570 | streaming all changes | |
568 | 1090 files to transfer, 102 KB of data (no-zstd !) |
|
571 | 1090 files to transfer, 102 KB of data (no-zstd !) | |
569 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
572 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
570 | 1090 files to transfer, 98.8 KB of data (zstd !) |
|
573 | 1090 files to transfer, 98.8 KB of data (zstd !) | |
571 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
574 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) | |
572 | searching for changes |
|
575 | searching for changes | |
573 | no changes found |
|
576 | no changes found | |
574 | #endif |
|
577 | #endif | |
575 | #if stream-bundle2 |
|
578 | #if stream-bundle2 | |
576 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed |
|
579 | $ hg clone --stream -U http://localhost:$HGPORT secret-allowed | |
577 | streaming all changes |
|
580 | streaming all changes | |
578 | 1093 files to transfer, 102 KB of data (no-zstd !) |
|
581 | 1093 files to transfer, 102 KB of data (no-zstd !) | |
579 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
582 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
580 | 1093 files to transfer, 98.9 KB of data (zstd !) |
|
583 | 1093 files to transfer, 98.9 KB of data (zstd !) | |
581 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !) |
|
584 | transferred 98.9 KB in * seconds (* */sec) (glob) (zstd !) | |
582 | #endif |
|
585 | #endif | |
583 |
|
586 | |||
584 | $ killdaemons.py |
|
587 | $ killdaemons.py | |
585 |
|
588 | |||
586 | Verify interaction between preferuncompressed and secret presence |
|
589 | Verify interaction between preferuncompressed and secret presence | |
587 |
|
590 | |||
588 | $ cd server |
|
591 | $ cd server | |
589 | $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid |
|
592 | $ hg serve --config server.preferuncompressed=true -p $HGPORT -d --pid-file=hg.pid | |
590 | $ cat hg.pid > $DAEMON_PIDS |
|
593 | $ cat hg.pid > $DAEMON_PIDS | |
591 | $ cd .. |
|
594 | $ cd .. | |
592 |
|
595 | |||
593 | $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret |
|
596 | $ hg clone -U http://localhost:$HGPORT preferuncompressed-secret | |
594 | requesting all changes |
|
597 | requesting all changes | |
595 | adding changesets |
|
598 | adding changesets | |
596 | adding manifests |
|
599 | adding manifests | |
597 | adding file changes |
|
600 | adding file changes | |
598 | added 2 changesets with 1025 changes to 1025 files |
|
601 | added 2 changesets with 1025 changes to 1025 files | |
599 | new changesets 96ee1d7354c4:c17445101a72 |
|
602 | new changesets 96ee1d7354c4:c17445101a72 | |
600 |
|
603 | |||
601 | $ killdaemons.py |
|
604 | $ killdaemons.py | |
602 |
|
605 | |||
603 | Clone not allowed when full bundles disabled and can't serve secrets |
|
606 | Clone not allowed when full bundles disabled and can't serve secrets | |
604 |
|
607 | |||
605 | $ cd server |
|
608 | $ cd server | |
606 | $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid |
|
609 | $ hg serve --config server.disablefullbundle=true -p $HGPORT -d --pid-file=hg.pid | |
607 | $ cat hg.pid > $DAEMON_PIDS |
|
610 | $ cat hg.pid > $DAEMON_PIDS | |
608 | $ cd .. |
|
611 | $ cd .. | |
609 |
|
612 | |||
610 | $ hg clone --stream http://localhost:$HGPORT secret-full-disabled |
|
613 | $ hg clone --stream http://localhost:$HGPORT secret-full-disabled | |
611 | warning: stream clone requested but server has them disabled |
|
614 | warning: stream clone requested but server has them disabled | |
612 | requesting all changes |
|
615 | requesting all changes | |
613 | remote: abort: server has pull-based clones disabled |
|
616 | remote: abort: server has pull-based clones disabled | |
614 | abort: pull failed on remote |
|
617 | abort: pull failed on remote | |
615 | (remove --pull if specified or upgrade Mercurial) |
|
618 | (remove --pull if specified or upgrade Mercurial) | |
616 | [100] |
|
619 | [100] | |
617 |
|
620 | |||
618 | Local stream clone with secrets involved |
|
621 | Local stream clone with secrets involved | |
619 | (This is just a test over behavior: if you have access to the repo's files, |
|
622 | (This is just a test over behavior: if you have access to the repo's files, | |
620 | there is no security so it isn't important to prevent a clone here.) |
|
623 | there is no security so it isn't important to prevent a clone here.) | |
621 |
|
624 | |||
622 | $ hg clone -U --stream server local-secret |
|
625 | $ hg clone -U --stream server local-secret | |
623 | warning: stream clone requested but server has them disabled |
|
626 | warning: stream clone requested but server has them disabled | |
624 | requesting all changes |
|
627 | requesting all changes | |
625 | adding changesets |
|
628 | adding changesets | |
626 | adding manifests |
|
629 | adding manifests | |
627 | adding file changes |
|
630 | adding file changes | |
628 | added 2 changesets with 1025 changes to 1025 files |
|
631 | added 2 changesets with 1025 changes to 1025 files | |
629 | new changesets 96ee1d7354c4:c17445101a72 |
|
632 | new changesets 96ee1d7354c4:c17445101a72 | |
630 |
|
633 | |||
631 | Stream clone while repo is changing: |
|
634 | Stream clone while repo is changing: | |
632 |
|
635 | |||
633 | $ mkdir changing |
|
636 | $ mkdir changing | |
634 | $ cd changing |
|
637 | $ cd changing | |
635 |
|
638 | |||
636 | extension for delaying the server process so we reliably can modify the repo |
|
639 | extension for delaying the server process so we reliably can modify the repo | |
637 | while cloning |
|
640 | while cloning | |
638 |
|
641 | |||
639 | $ cat > stream_steps.py <<EOF |
|
642 | $ cat > stream_steps.py <<EOF | |
640 | > import os |
|
643 | > import os | |
641 | > import sys |
|
644 | > import sys | |
642 | > from mercurial import ( |
|
645 | > from mercurial import ( | |
643 | > encoding, |
|
646 | > encoding, | |
644 | > extensions, |
|
647 | > extensions, | |
645 | > streamclone, |
|
648 | > streamclone, | |
646 | > testing, |
|
649 | > testing, | |
647 | > ) |
|
650 | > ) | |
648 | > WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1'] |
|
651 | > WALKED_FILE_1 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_1'] | |
649 | > WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2'] |
|
652 | > WALKED_FILE_2 = encoding.environ[b'HG_TEST_STREAM_WALKED_FILE_2'] | |
650 | > |
|
653 | > | |
651 | > def _test_sync_point_walk_1(orig, repo): |
|
654 | > def _test_sync_point_walk_1(orig, repo): | |
652 | > testing.write_file(WALKED_FILE_1) |
|
655 | > testing.write_file(WALKED_FILE_1) | |
653 | > |
|
656 | > | |
654 | > def _test_sync_point_walk_2(orig, repo): |
|
657 | > def _test_sync_point_walk_2(orig, repo): | |
655 | > assert repo._currentlock(repo._lockref) is None |
|
658 | > assert repo._currentlock(repo._lockref) is None | |
656 | > testing.wait_file(WALKED_FILE_2) |
|
659 | > testing.wait_file(WALKED_FILE_2) | |
657 | > |
|
660 | > | |
658 | > extensions.wrapfunction( |
|
661 | > extensions.wrapfunction( | |
659 | > streamclone, |
|
662 | > streamclone, | |
660 | > '_test_sync_point_walk_1', |
|
663 | > '_test_sync_point_walk_1', | |
661 | > _test_sync_point_walk_1 |
|
664 | > _test_sync_point_walk_1 | |
662 | > ) |
|
665 | > ) | |
663 | > extensions.wrapfunction( |
|
666 | > extensions.wrapfunction( | |
664 | > streamclone, |
|
667 | > streamclone, | |
665 | > '_test_sync_point_walk_2', |
|
668 | > '_test_sync_point_walk_2', | |
666 | > _test_sync_point_walk_2 |
|
669 | > _test_sync_point_walk_2 | |
667 | > ) |
|
670 | > ) | |
668 | > EOF |
|
671 | > EOF | |
669 |
|
672 | |||
670 | prepare repo with small and big file to cover both code paths in emitrevlogdata |
|
673 | prepare repo with small and big file to cover both code paths in emitrevlogdata | |
671 |
|
674 | |||
672 | $ hg init repo |
|
675 | $ hg init repo | |
673 | $ touch repo/f1 |
|
676 | $ touch repo/f1 | |
674 | $ $TESTDIR/seq.py 50000 > repo/f2 |
|
677 | $ $TESTDIR/seq.py 50000 > repo/f2 | |
675 | $ hg -R repo ci -Aqm "0" |
|
678 | $ hg -R repo ci -Aqm "0" | |
676 | $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1" |
|
679 | $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1" | |
677 | $ export HG_TEST_STREAM_WALKED_FILE_1 |
|
680 | $ export HG_TEST_STREAM_WALKED_FILE_1 | |
678 | $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2" |
|
681 | $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2" | |
679 | $ export HG_TEST_STREAM_WALKED_FILE_2 |
|
682 | $ export HG_TEST_STREAM_WALKED_FILE_2 | |
680 | $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3" |
|
683 | $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3" | |
681 | $ export HG_TEST_STREAM_WALKED_FILE_3 |
|
684 | $ export HG_TEST_STREAM_WALKED_FILE_3 | |
682 | # $ cat << EOF >> $HGRCPATH |
|
685 | # $ cat << EOF >> $HGRCPATH | |
683 | # > [hooks] |
|
686 | # > [hooks] | |
684 | # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*" |
|
687 | # > pre-clone=rm -f "$TESTTMP/sync_file_walked_*" | |
685 | # > EOF |
|
688 | # > EOF | |
686 | $ 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" |
|
689 | $ 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" | |
687 | $ cat hg.pid >> $DAEMON_PIDS |
|
690 | $ cat hg.pid >> $DAEMON_PIDS | |
688 |
|
691 | |||
689 | clone while modifying the repo between stating file with write lock and |
|
692 | clone while modifying the repo between stating file with write lock and | |
690 | actually serving file content |
|
693 | actually serving file content | |
691 |
|
694 | |||
692 | $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") & |
|
695 | $ (hg clone -q --stream -U http://localhost:$HGPORT1 clone; touch "$HG_TEST_STREAM_WALKED_FILE_3") & | |
693 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 |
|
696 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 | |
694 | $ echo >> repo/f1 |
|
697 | $ echo >> repo/f1 | |
695 | $ echo >> repo/f2 |
|
698 | $ echo >> repo/f2 | |
696 | $ hg -R repo ci -m "1" --config ui.timeout.warn=-1 |
|
699 | $ hg -R repo ci -m "1" --config ui.timeout.warn=-1 | |
697 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 |
|
700 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 | |
698 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 |
|
701 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 | |
699 | $ hg -R clone id |
|
702 | $ hg -R clone id | |
700 | 000000000000 |
|
703 | 000000000000 | |
701 | $ cat errors.log |
|
704 | $ cat errors.log | |
702 | $ cd .. |
|
705 | $ cd .. | |
703 |
|
706 | |||
704 | Stream repository with bookmarks |
|
707 | Stream repository with bookmarks | |
705 | -------------------------------- |
|
708 | -------------------------------- | |
706 |
|
709 | |||
707 | (revert introduction of secret changeset) |
|
710 | (revert introduction of secret changeset) | |
708 |
|
711 | |||
709 | $ hg -R server phase --draft 'secret()' |
|
712 | $ hg -R server phase --draft 'secret()' | |
710 |
|
713 | |||
711 | add a bookmark |
|
714 | add a bookmark | |
712 |
|
715 | |||
713 | $ hg -R server bookmark -r tip some-bookmark |
|
716 | $ hg -R server bookmark -r tip some-bookmark | |
714 |
|
717 | |||
715 | clone it |
|
718 | clone it | |
716 |
|
719 | |||
717 | #if stream-legacy |
|
720 | #if stream-legacy | |
718 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks |
|
721 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks | |
719 | streaming all changes |
|
722 | streaming all changes | |
720 | 1090 files to transfer, 102 KB of data (no-zstd !) |
|
723 | 1090 files to transfer, 102 KB of data (no-zstd !) | |
721 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
724 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
722 | 1090 files to transfer, 98.8 KB of data (zstd !) |
|
725 | 1090 files to transfer, 98.8 KB of data (zstd !) | |
723 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
726 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) | |
724 | searching for changes |
|
727 | searching for changes | |
725 | no changes found |
|
728 | no changes found | |
726 | updating to branch default |
|
729 | updating to branch default | |
727 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
730 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
728 | #endif |
|
731 | #endif | |
729 | #if stream-bundle2 |
|
732 | #if stream-bundle2 | |
730 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks |
|
733 | $ hg clone --stream http://localhost:$HGPORT with-bookmarks | |
731 | streaming all changes |
|
734 | streaming all changes | |
732 | 1096 files to transfer, 102 KB of data (no-zstd !) |
|
735 | 1096 files to transfer, 102 KB of data (no-zstd !) | |
733 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
736 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
734 | 1096 files to transfer, 99.1 KB of data (zstd !) |
|
737 | 1096 files to transfer, 99.1 KB of data (zstd !) | |
735 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !) |
|
738 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !) | |
736 | updating to branch default |
|
739 | updating to branch default | |
737 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
740 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
738 | #endif |
|
741 | #endif | |
739 | $ hg verify -R with-bookmarks |
|
742 | $ hg verify -R with-bookmarks | |
740 | checking changesets |
|
743 | checking changesets | |
741 | checking manifests |
|
744 | checking manifests | |
742 | crosschecking files in changesets and manifests |
|
745 | crosschecking files in changesets and manifests | |
743 | checking files |
|
746 | checking files | |
744 | checked 3 changesets with 1088 changes to 1088 files |
|
747 | checked 3 changesets with 1088 changes to 1088 files | |
745 | $ hg -R with-bookmarks bookmarks |
|
748 | $ hg -R with-bookmarks bookmarks | |
746 | some-bookmark 2:5223b5e3265f |
|
749 | some-bookmark 2:5223b5e3265f | |
747 |
|
750 | |||
748 | Stream repository with phases |
|
751 | Stream repository with phases | |
749 | ----------------------------- |
|
752 | ----------------------------- | |
750 |
|
753 | |||
751 | Clone as publishing |
|
754 | Clone as publishing | |
752 |
|
755 | |||
753 | $ hg -R server phase -r 'all()' |
|
756 | $ hg -R server phase -r 'all()' | |
754 | 0: draft |
|
757 | 0: draft | |
755 | 1: draft |
|
758 | 1: draft | |
756 | 2: draft |
|
759 | 2: draft | |
757 |
|
760 | |||
758 | #if stream-legacy |
|
761 | #if stream-legacy | |
759 | $ hg clone --stream http://localhost:$HGPORT phase-publish |
|
762 | $ hg clone --stream http://localhost:$HGPORT phase-publish | |
760 | streaming all changes |
|
763 | streaming all changes | |
761 | 1090 files to transfer, 102 KB of data (no-zstd !) |
|
764 | 1090 files to transfer, 102 KB of data (no-zstd !) | |
762 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
765 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
763 | 1090 files to transfer, 98.8 KB of data (zstd !) |
|
766 | 1090 files to transfer, 98.8 KB of data (zstd !) | |
764 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
767 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) | |
765 | searching for changes |
|
768 | searching for changes | |
766 | no changes found |
|
769 | no changes found | |
767 | updating to branch default |
|
770 | updating to branch default | |
768 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
771 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
769 | #endif |
|
772 | #endif | |
770 | #if stream-bundle2 |
|
773 | #if stream-bundle2 | |
771 | $ hg clone --stream http://localhost:$HGPORT phase-publish |
|
774 | $ hg clone --stream http://localhost:$HGPORT phase-publish | |
772 | streaming all changes |
|
775 | streaming all changes | |
773 | 1096 files to transfer, 102 KB of data (no-zstd !) |
|
776 | 1096 files to transfer, 102 KB of data (no-zstd !) | |
774 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
777 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
775 | 1096 files to transfer, 99.1 KB of data (zstd !) |
|
778 | 1096 files to transfer, 99.1 KB of data (zstd !) | |
776 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !) |
|
779 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !) | |
777 | updating to branch default |
|
780 | updating to branch default | |
778 | 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 | |
779 | #endif |
|
782 | #endif | |
780 | $ hg verify -R phase-publish |
|
783 | $ hg verify -R phase-publish | |
781 | checking changesets |
|
784 | checking changesets | |
782 | checking manifests |
|
785 | checking manifests | |
783 | crosschecking files in changesets and manifests |
|
786 | crosschecking files in changesets and manifests | |
784 | checking files |
|
787 | checking files | |
785 | checked 3 changesets with 1088 changes to 1088 files |
|
788 | checked 3 changesets with 1088 changes to 1088 files | |
786 | $ hg -R phase-publish phase -r 'all()' |
|
789 | $ hg -R phase-publish phase -r 'all()' | |
787 | 0: public |
|
790 | 0: public | |
788 | 1: public |
|
791 | 1: public | |
789 | 2: public |
|
792 | 2: public | |
790 |
|
793 | |||
791 | Clone as non publishing |
|
794 | Clone as non publishing | |
792 |
|
795 | |||
793 | $ cat << EOF >> server/.hg/hgrc |
|
796 | $ cat << EOF >> server/.hg/hgrc | |
794 | > [phases] |
|
797 | > [phases] | |
795 | > publish = False |
|
798 | > publish = False | |
796 | > EOF |
|
799 | > EOF | |
797 | $ killdaemons.py |
|
800 | $ killdaemons.py | |
798 | $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid |
|
801 | $ hg -R server serve -p $HGPORT -d --pid-file=hg.pid | |
799 | $ cat hg.pid > $DAEMON_PIDS |
|
802 | $ cat hg.pid > $DAEMON_PIDS | |
800 |
|
803 | |||
801 | #if stream-legacy |
|
804 | #if stream-legacy | |
802 |
|
805 | |||
803 | With v1 of the stream protocol, changeset are always cloned as public. It make |
|
806 | With v1 of the stream protocol, changeset are always cloned as public. It make | |
804 | stream v1 unsuitable for non-publishing repository. |
|
807 | stream v1 unsuitable for non-publishing repository. | |
805 |
|
808 | |||
806 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish |
|
809 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish | |
807 | streaming all changes |
|
810 | streaming all changes | |
808 | 1090 files to transfer, 102 KB of data (no-zstd !) |
|
811 | 1090 files to transfer, 102 KB of data (no-zstd !) | |
809 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
812 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
810 | 1090 files to transfer, 98.8 KB of data (zstd !) |
|
813 | 1090 files to transfer, 98.8 KB of data (zstd !) | |
811 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) |
|
814 | transferred 98.8 KB in * seconds (* */sec) (glob) (zstd !) | |
812 | searching for changes |
|
815 | searching for changes | |
813 | no changes found |
|
816 | no changes found | |
814 | updating to branch default |
|
817 | updating to branch default | |
815 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
818 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
816 | $ hg -R phase-no-publish phase -r 'all()' |
|
819 | $ hg -R phase-no-publish phase -r 'all()' | |
817 | 0: public |
|
820 | 0: public | |
818 | 1: public |
|
821 | 1: public | |
819 | 2: public |
|
822 | 2: public | |
820 | #endif |
|
823 | #endif | |
821 | #if stream-bundle2 |
|
824 | #if stream-bundle2 | |
822 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish |
|
825 | $ hg clone --stream http://localhost:$HGPORT phase-no-publish | |
823 | streaming all changes |
|
826 | streaming all changes | |
824 | 1097 files to transfer, 102 KB of data (no-zstd !) |
|
827 | 1097 files to transfer, 102 KB of data (no-zstd !) | |
825 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
828 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
826 | 1097 files to transfer, 99.1 KB of data (zstd !) |
|
829 | 1097 files to transfer, 99.1 KB of data (zstd !) | |
827 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !) |
|
830 | transferred 99.1 KB in * seconds (* */sec) (glob) (zstd !) | |
828 | updating to branch default |
|
831 | updating to branch default | |
829 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
832 | 1088 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
830 | $ hg -R phase-no-publish phase -r 'all()' |
|
833 | $ hg -R phase-no-publish phase -r 'all()' | |
831 | 0: draft |
|
834 | 0: draft | |
832 | 1: draft |
|
835 | 1: draft | |
833 | 2: draft |
|
836 | 2: draft | |
834 | #endif |
|
837 | #endif | |
835 | $ hg verify -R phase-no-publish |
|
838 | $ hg verify -R phase-no-publish | |
836 | checking changesets |
|
839 | checking changesets | |
837 | checking manifests |
|
840 | checking manifests | |
838 | crosschecking files in changesets and manifests |
|
841 | crosschecking files in changesets and manifests | |
839 | checking files |
|
842 | checking files | |
840 | checked 3 changesets with 1088 changes to 1088 files |
|
843 | checked 3 changesets with 1088 changes to 1088 files | |
841 |
|
844 | |||
842 | $ killdaemons.py |
|
845 | $ killdaemons.py | |
843 |
|
846 | |||
844 | #if stream-legacy |
|
847 | #if stream-legacy | |
845 |
|
848 | |||
846 | With v1 of the stream protocol, changeset are always cloned as public. There's |
|
849 | With v1 of the stream protocol, changeset are always cloned as public. There's | |
847 | no obsolescence markers exchange in stream v1. |
|
850 | no obsolescence markers exchange in stream v1. | |
848 |
|
851 | |||
849 | #endif |
|
852 | #endif | |
850 | #if stream-bundle2 |
|
853 | #if stream-bundle2 | |
851 |
|
854 | |||
852 | Stream repository with obsolescence |
|
855 | Stream repository with obsolescence | |
853 | ----------------------------------- |
|
856 | ----------------------------------- | |
854 |
|
857 | |||
855 | Clone non-publishing with obsolescence |
|
858 | Clone non-publishing with obsolescence | |
856 |
|
859 | |||
857 | $ cat >> $HGRCPATH << EOF |
|
860 | $ cat >> $HGRCPATH << EOF | |
858 | > [experimental] |
|
861 | > [experimental] | |
859 | > evolution=all |
|
862 | > evolution=all | |
860 | > EOF |
|
863 | > EOF | |
861 |
|
864 | |||
862 | $ cd server |
|
865 | $ cd server | |
863 | $ echo foo > foo |
|
866 | $ echo foo > foo | |
864 | $ hg -q commit -m 'about to be pruned' |
|
867 | $ hg -q commit -m 'about to be pruned' | |
865 | $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents |
|
868 | $ hg debugobsolete `hg log -r . -T '{node}'` -d '0 0' -u test --record-parents | |
866 | 1 new obsolescence markers |
|
869 | 1 new obsolescence markers | |
867 | obsoleted 1 changesets |
|
870 | obsoleted 1 changesets | |
868 | $ hg up null -q |
|
871 | $ hg up null -q | |
869 | $ hg log -T '{rev}: {phase}\n' |
|
872 | $ hg log -T '{rev}: {phase}\n' | |
870 | 2: draft |
|
873 | 2: draft | |
871 | 1: draft |
|
874 | 1: draft | |
872 | 0: draft |
|
875 | 0: draft | |
873 | $ hg serve -p $HGPORT -d --pid-file=hg.pid |
|
876 | $ hg serve -p $HGPORT -d --pid-file=hg.pid | |
874 | $ cat hg.pid > $DAEMON_PIDS |
|
877 | $ cat hg.pid > $DAEMON_PIDS | |
875 | $ cd .. |
|
878 | $ cd .. | |
876 |
|
879 | |||
877 | $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence |
|
880 | $ hg clone -U --stream http://localhost:$HGPORT with-obsolescence | |
878 | streaming all changes |
|
881 | streaming all changes | |
879 | 1098 files to transfer, 102 KB of data (no-zstd !) |
|
882 | 1098 files to transfer, 102 KB of data (no-zstd !) | |
880 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) |
|
883 | transferred 102 KB in * seconds (* */sec) (glob) (no-zstd !) | |
881 | 1098 files to transfer, 99.5 KB of data (zstd !) |
|
884 | 1098 files to transfer, 99.5 KB of data (zstd !) | |
882 | transferred 99.5 KB in * seconds (* */sec) (glob) (zstd !) |
|
885 | transferred 99.5 KB in * seconds (* */sec) (glob) (zstd !) | |
883 | $ hg -R with-obsolescence log -T '{rev}: {phase}\n' |
|
886 | $ hg -R with-obsolescence log -T '{rev}: {phase}\n' | |
884 | 2: draft |
|
887 | 2: draft | |
885 | 1: draft |
|
888 | 1: draft | |
886 | 0: draft |
|
889 | 0: draft | |
887 | $ hg debugobsolete -R with-obsolescence |
|
890 | $ hg debugobsolete -R with-obsolescence | |
888 | 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} |
|
891 | 8c206a663911c1f97f2f9d7382e417ae55872cfa 0 {5223b5e3265f0df40bb743da62249413d74ac70f} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'} | |
889 | $ hg verify -R with-obsolescence |
|
892 | $ hg verify -R with-obsolescence | |
890 | checking changesets |
|
893 | checking changesets | |
891 | checking manifests |
|
894 | checking manifests | |
892 | crosschecking files in changesets and manifests |
|
895 | crosschecking files in changesets and manifests | |
893 | checking files |
|
896 | checking files | |
894 | checked 4 changesets with 1089 changes to 1088 files |
|
897 | checked 4 changesets with 1089 changes to 1088 files | |
895 |
|
898 | |||
896 | $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution |
|
899 | $ hg clone -U --stream --config experimental.evolution=0 http://localhost:$HGPORT with-obsolescence-no-evolution | |
897 | streaming all changes |
|
900 | streaming all changes | |
898 | remote: abort: server has obsolescence markers, but client cannot receive them via stream clone |
|
901 | remote: abort: server has obsolescence markers, but client cannot receive them via stream clone | |
899 | abort: pull failed on remote |
|
902 | abort: pull failed on remote | |
900 | [100] |
|
903 | [100] | |
901 |
|
904 | |||
902 | $ killdaemons.py |
|
905 | $ killdaemons.py | |
903 |
|
906 | |||
904 | #endif |
|
907 | #endif |
@@ -1,435 +1,441 | |||||
1 | #require no-reposimplestore |
|
1 | #require no-reposimplestore | |
2 |
|
2 | |||
3 | Check whether size of generaldelta revlog is not bigger than its |
|
3 | Check whether size of generaldelta revlog is not bigger than its | |
4 | regular equivalent. Test would fail if generaldelta was naive |
|
4 | regular equivalent. Test would fail if generaldelta was naive | |
5 | implementation of parentdelta: third manifest revision would be fully |
|
5 | implementation of parentdelta: third manifest revision would be fully | |
6 | inserted due to big distance from its paren revision (zero). |
|
6 | inserted due to big distance from its paren revision (zero). | |
7 |
|
7 | |||
8 | $ cat << EOF >> $HGRCPATH |
|
8 | $ cat << EOF >> $HGRCPATH | |
9 | > [format] |
|
9 | > [format] | |
10 | > sparse-revlog = no |
|
10 | > sparse-revlog = no | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | $ hg init repo --config format.generaldelta=no --config format.usegeneraldelta=no |
|
13 | $ hg init repo --config format.generaldelta=no --config format.usegeneraldelta=no | |
14 | $ cd repo |
|
14 | $ cd repo | |
15 | $ echo foo > foo |
|
15 | $ echo foo > foo | |
16 | $ echo bar > bar |
|
16 | $ echo bar > bar | |
17 | $ echo baz > baz |
|
17 | $ echo baz > baz | |
18 | $ hg commit -q -Am boo |
|
18 | $ hg commit -q -Am boo | |
19 | $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes |
|
19 | $ hg clone --pull . ../gdrepo -q --config format.generaldelta=yes | |
20 | $ for r in 1 2 3; do |
|
20 | $ for r in 1 2 3; do | |
21 | > echo $r > foo |
|
21 | > echo $r > foo | |
22 | > hg commit -q -m $r |
|
22 | > hg commit -q -m $r | |
23 | > hg up -q -r 0 |
|
23 | > hg up -q -r 0 | |
24 | > hg pull . -q -r $r -R ../gdrepo |
|
24 | > hg pull . -q -r $r -R ../gdrepo | |
25 | > done |
|
25 | > done | |
26 |
|
26 | |||
27 | $ cd .. |
|
27 | $ cd .. | |
28 | >>> from __future__ import print_function |
|
28 | >>> from __future__ import print_function | |
29 | >>> import os |
|
29 | >>> import os | |
30 | >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size |
|
30 | >>> regsize = os.stat("repo/.hg/store/00manifest.i").st_size | |
31 | >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size |
|
31 | >>> gdsize = os.stat("gdrepo/.hg/store/00manifest.i").st_size | |
32 | >>> if regsize < gdsize: |
|
32 | >>> if regsize < gdsize: | |
33 | ... print('generaldata increased size of manifest') |
|
33 | ... print('generaldata increased size of manifest') | |
34 |
|
34 | |||
35 | Verify rev reordering doesnt create invalid bundles (issue4462) |
|
35 | Verify rev reordering doesnt create invalid bundles (issue4462) | |
36 | This requires a commit tree that when pulled will reorder manifest revs such |
|
36 | This requires a commit tree that when pulled will reorder manifest revs such | |
37 | that the second manifest to create a file rev will be ordered before the first |
|
37 | that the second manifest to create a file rev will be ordered before the first | |
38 | manifest to create that file rev. We also need to do a partial pull to ensure |
|
38 | manifest to create that file rev. We also need to do a partial pull to ensure | |
39 | reordering happens. At the end we verify the linkrev points at the earliest |
|
39 | reordering happens. At the end we verify the linkrev points at the earliest | |
40 | commit. |
|
40 | commit. | |
41 |
|
41 | |||
42 | $ hg init server --config format.generaldelta=True |
|
42 | $ hg init server --config format.generaldelta=True | |
43 | $ cd server |
|
43 | $ cd server | |
44 | $ touch a |
|
44 | $ touch a | |
45 | $ hg commit -Aqm a |
|
45 | $ hg commit -Aqm a | |
46 | $ echo x > x |
|
46 | $ echo x > x | |
47 | $ echo y > y |
|
47 | $ echo y > y | |
48 | $ hg commit -Aqm xy |
|
48 | $ hg commit -Aqm xy | |
49 | $ hg up -q '.^' |
|
49 | $ hg up -q '.^' | |
50 | $ echo x > x |
|
50 | $ echo x > x | |
51 | $ echo z > z |
|
51 | $ echo z > z | |
52 | $ hg commit -Aqm xz |
|
52 | $ hg commit -Aqm xz | |
53 | $ hg up -q 1 |
|
53 | $ hg up -q 1 | |
54 | $ echo b > b |
|
54 | $ echo b > b | |
55 | $ hg commit -Aqm b |
|
55 | $ hg commit -Aqm b | |
56 | $ hg merge -q 2 |
|
56 | $ hg merge -q 2 | |
57 | $ hg commit -Aqm merge |
|
57 | $ hg commit -Aqm merge | |
58 | $ echo c > c |
|
58 | $ echo c > c | |
59 | $ hg commit -Aqm c |
|
59 | $ hg commit -Aqm c | |
60 | $ hg log -G -T '{rev} {shortest(node)} {desc}' |
|
60 | $ hg log -G -T '{rev} {shortest(node)} {desc}' | |
61 | @ 5 ebb8 c |
|
61 | @ 5 ebb8 c | |
62 | | |
|
62 | | | |
63 | o 4 baf7 merge |
|
63 | o 4 baf7 merge | |
64 | |\ |
|
64 | |\ | |
65 | | o 3 a129 b |
|
65 | | o 3 a129 b | |
66 | | | |
|
66 | | | | |
67 | o | 2 958c xz |
|
67 | o | 2 958c xz | |
68 | | | |
|
68 | | | | |
69 | | o 1 f00c xy |
|
69 | | o 1 f00c xy | |
70 | |/ |
|
70 | |/ | |
71 | o 0 3903 a |
|
71 | o 0 3903 a | |
72 |
|
72 | |||
73 | $ cd .. |
|
73 | $ cd .. | |
74 | $ hg init client --config format.generaldelta=false --config format.usegeneraldelta=false |
|
74 | $ hg init client --config format.generaldelta=false --config format.usegeneraldelta=false | |
75 | $ cd client |
|
75 | $ cd client | |
76 | $ hg pull -q ../server -r 4 |
|
76 | $ hg pull -q ../server -r 4 | |
77 | $ hg debugdeltachain x |
|
77 | $ hg debugdeltachain x | |
78 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
78 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio | |
79 | 0 1 1 -1 base 3 2 3 1.50000 3 0 0.00000 |
|
79 | 0 1 1 -1 base 3 2 3 1.50000 3 0 0.00000 | |
80 |
|
80 | |||
81 | $ cd .. |
|
81 | $ cd .. | |
82 |
|
82 | |||
83 | Test "usegeneraldelta" config |
|
83 | Test "usegeneraldelta" config | |
84 | (repo are general delta, but incoming bundle are not re-deltafied) |
|
84 | (repo are general delta, but incoming bundle are not re-deltafied) | |
85 |
|
85 | |||
86 | delta coming from the server base delta server are not recompressed. |
|
86 | delta coming from the server base delta server are not recompressed. | |
87 | (also include the aggressive version for comparison) |
|
87 | (also include the aggressive version for comparison) | |
88 |
|
88 | |||
89 | $ hg clone repo --pull --config format.usegeneraldelta=1 usegd |
|
89 | $ hg clone repo --pull --config format.usegeneraldelta=1 usegd | |
90 | requesting all changes |
|
90 | requesting all changes | |
91 | adding changesets |
|
91 | adding changesets | |
92 | adding manifests |
|
92 | adding manifests | |
93 | adding file changes |
|
93 | adding file changes | |
94 | added 4 changesets with 6 changes to 3 files (+2 heads) |
|
94 | added 4 changesets with 6 changes to 3 files (+2 heads) | |
95 | new changesets 0ea3fcf9d01d:bba78d330d9c |
|
95 | new changesets 0ea3fcf9d01d:bba78d330d9c | |
96 | updating to branch default |
|
96 | updating to branch default | |
97 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
97 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
98 | $ hg clone repo --pull --config format.generaldelta=1 full |
|
98 | $ hg clone repo --pull --config format.generaldelta=1 full | |
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 6 changes to 3 files (+2 heads) |
|
103 | added 4 changesets with 6 changes to 3 files (+2 heads) | |
104 | new changesets 0ea3fcf9d01d:bba78d330d9c |
|
104 | new changesets 0ea3fcf9d01d:bba78d330d9c | |
105 | updating to branch default |
|
105 | updating to branch default | |
106 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
106 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
107 | $ hg -R repo debugdeltachain -m |
|
107 | $ hg -R repo debugdeltachain -m | |
108 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
108 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio | |
109 | 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000 (no-zstd !) |
|
109 | 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000 (no-zstd !) | |
110 | 1 1 2 0 prev 57 135 161 1.19259 161 0 0.00000 (no-zstd !) |
|
110 | 1 1 2 0 prev 57 135 161 1.19259 161 0 0.00000 (no-zstd !) | |
111 | 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000 (no-zstd !) |
|
111 | 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000 (no-zstd !) | |
112 | 0 1 1 -1 base 107 135 107 0.79259 107 0 0.00000 (zstd !) |
|
112 | 0 1 1 -1 base 107 135 107 0.79259 107 0 0.00000 (zstd !) | |
113 | 1 1 2 0 prev 57 135 164 1.21481 164 0 0.00000 (zstd !) |
|
113 | 1 1 2 0 prev 57 135 164 1.21481 164 0 0.00000 (zstd !) | |
114 | 2 1 3 1 prev 57 135 221 1.63704 221 0 0.00000 (zstd !) |
|
114 | 2 1 3 1 prev 57 135 221 1.63704 221 0 0.00000 (zstd !) | |
115 | 3 2 1 -1 base 104 135 104 0.77037 104 0 0.00000 |
|
115 | 3 2 1 -1 base 104 135 104 0.77037 104 0 0.00000 | |
116 | $ hg -R usegd debugdeltachain -m |
|
116 | $ hg -R usegd debugdeltachain -m | |
117 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
117 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio | |
118 | 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000 (no-zstd !) |
|
118 | 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000 (no-zstd !) | |
119 | 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000 (no-zstd !) |
|
119 | 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000 (no-zstd !) | |
120 | 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000 (no-zstd !) |
|
120 | 2 1 3 1 prev 57 135 218 1.61481 218 0 0.00000 (no-zstd !) | |
121 | 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807 (no-zstd !) |
|
121 | 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807 (no-zstd !) | |
122 | 0 1 1 -1 base 107 135 107 0.79259 107 0 0.00000 (zstd !) |
|
122 | 0 1 1 -1 base 107 135 107 0.79259 107 0 0.00000 (zstd !) | |
123 | 1 1 2 0 p1 57 135 164 1.21481 164 0 0.00000 (zstd !) |
|
123 | 1 1 2 0 p1 57 135 164 1.21481 164 0 0.00000 (zstd !) | |
124 | 2 1 3 1 prev 57 135 221 1.63704 221 0 0.00000 (zstd !) |
|
124 | 2 1 3 1 prev 57 135 221 1.63704 221 0 0.00000 (zstd !) | |
125 | 3 1 2 0 p1 57 135 164 1.21481 278 114 0.69512 (zstd !) |
|
125 | 3 1 2 0 p1 57 135 164 1.21481 278 114 0.69512 (zstd !) | |
126 | $ hg -R full debugdeltachain -m |
|
126 | $ hg -R full debugdeltachain -m | |
127 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
127 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio | |
128 | 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000 (no-zstd !) |
|
128 | 0 1 1 -1 base 104 135 104 0.77037 104 0 0.00000 (no-zstd !) | |
129 | 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000 (no-zstd !) |
|
129 | 1 1 2 0 p1 57 135 161 1.19259 161 0 0.00000 (no-zstd !) | |
130 | 2 1 2 0 p1 57 135 161 1.19259 218 57 0.35404 (no-zstd !) |
|
130 | 2 1 2 0 p1 57 135 161 1.19259 218 57 0.35404 (no-zstd !) | |
131 | 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807 (no-zstd !) |
|
131 | 3 1 2 0 p1 57 135 161 1.19259 275 114 0.70807 (no-zstd !) | |
132 | 0 1 1 -1 base 107 135 107 0.79259 107 0 0.00000 (zstd !) |
|
132 | 0 1 1 -1 base 107 135 107 0.79259 107 0 0.00000 (zstd !) | |
133 | 1 1 2 0 p1 57 135 164 1.21481 164 0 0.00000 (zstd !) |
|
133 | 1 1 2 0 p1 57 135 164 1.21481 164 0 0.00000 (zstd !) | |
134 | 2 1 2 0 p1 57 135 164 1.21481 221 57 0.34756 (zstd !) |
|
134 | 2 1 2 0 p1 57 135 164 1.21481 221 57 0.34756 (zstd !) | |
135 | 3 1 2 0 p1 57 135 164 1.21481 278 114 0.69512 (zstd !) |
|
135 | 3 1 2 0 p1 57 135 164 1.21481 278 114 0.69512 (zstd !) | |
136 |
|
136 | |||
137 | Test revlog.optimize-delta-parent-choice |
|
137 | Test revlog.optimize-delta-parent-choice | |
138 |
|
138 | |||
139 | $ hg init --config format.generaldelta=1 aggressive |
|
139 | $ hg init --config format.generaldelta=1 aggressive | |
140 | $ cd aggressive |
|
140 | $ cd aggressive | |
141 | $ cat << EOF >> .hg/hgrc |
|
141 | $ cat << EOF >> .hg/hgrc | |
142 | > [format] |
|
142 | > [format] | |
143 | > generaldelta = 1 |
|
143 | > generaldelta = 1 | |
144 | > EOF |
|
144 | > EOF | |
145 | $ touch a b c d e |
|
145 | $ touch a b c d e | |
146 | $ hg commit -Aqm side1 |
|
146 | $ hg commit -Aqm side1 | |
147 | $ hg up -q null |
|
147 | $ hg up -q null | |
148 | $ touch x y |
|
148 | $ touch x y | |
149 | $ hg commit -Aqm side2 |
|
149 | $ hg commit -Aqm side2 | |
150 |
|
150 | |||
151 | - Verify non-aggressive merge uses p1 (commit 1) as delta parent |
|
151 | - Verify non-aggressive merge uses p1 (commit 1) as delta parent | |
152 | $ hg merge -q 0 |
|
152 | $ hg merge -q 0 | |
153 | $ hg commit -q -m merge |
|
153 | $ hg commit -q -m merge | |
154 | $ hg debugdeltachain -m |
|
154 | $ hg debugdeltachain -m | |
155 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
155 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio | |
156 | 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000 (no-zstd !) |
|
156 | 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000 (no-zstd !) | |
157 | 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000 (no-zstd !) |
|
157 | 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000 (no-zstd !) | |
158 | 2 1 2 0 p2 62 301 121 0.40199 182 61 0.50413 (no-zstd !) |
|
158 | 2 1 2 0 p2 62 301 121 0.40199 182 61 0.50413 (no-zstd !) | |
159 | 0 1 1 -1 base 68 215 68 0.31628 68 0 0.00000 (zstd !) |
|
159 | 0 1 1 -1 base 68 215 68 0.31628 68 0 0.00000 (zstd !) | |
160 | 1 1 2 0 prev 70 86 138 1.60465 138 0 0.00000 (zstd !) |
|
160 | 1 1 2 0 prev 70 86 138 1.60465 138 0 0.00000 (zstd !) | |
161 | 2 1 2 0 p2 68 301 136 0.45183 206 70 0.51471 (zstd !) |
|
161 | 2 1 2 0 p2 68 301 136 0.45183 206 70 0.51471 (zstd !) | |
162 |
|
162 | |||
163 | $ hg strip -q -r . --config extensions.strip= |
|
163 | $ hg strip -q -r . --config extensions.strip= | |
164 |
|
164 | |||
165 | - Verify aggressive merge uses p2 (commit 0) as delta parent |
|
165 | - Verify aggressive merge uses p2 (commit 0) as delta parent | |
166 | $ hg up -q -C 1 |
|
166 | $ hg up -q -C 1 | |
167 | $ hg merge -q 0 |
|
167 | $ hg merge -q 0 | |
168 | $ hg commit -q -m merge --config storage.revlog.optimize-delta-parent-choice=yes |
|
168 | $ hg commit -q -m merge --config storage.revlog.optimize-delta-parent-choice=yes | |
169 | $ hg debugdeltachain -m |
|
169 | $ hg debugdeltachain -m | |
170 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
170 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio | |
171 | 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000 (no-zstd !) |
|
171 | 0 1 1 -1 base 59 215 59 0.27442 59 0 0.00000 (no-zstd !) | |
172 | 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000 (no-zstd !) |
|
172 | 1 1 2 0 prev 61 86 120 1.39535 120 0 0.00000 (no-zstd !) | |
173 | 2 1 2 0 p2 62 301 121 0.40199 182 61 0.50413 (no-zstd !) |
|
173 | 2 1 2 0 p2 62 301 121 0.40199 182 61 0.50413 (no-zstd !) | |
174 | 0 1 1 -1 base 68 215 68 0.31628 68 0 0.00000 (zstd !) |
|
174 | 0 1 1 -1 base 68 215 68 0.31628 68 0 0.00000 (zstd !) | |
175 | 1 1 2 0 prev 70 86 138 1.60465 138 0 0.00000 (zstd !) |
|
175 | 1 1 2 0 prev 70 86 138 1.60465 138 0 0.00000 (zstd !) | |
176 | 2 1 2 0 p2 68 301 136 0.45183 206 70 0.51471 (zstd !) |
|
176 | 2 1 2 0 p2 68 301 136 0.45183 206 70 0.51471 (zstd !) | |
177 |
|
177 | |||
178 | Test that strip bundle use bundle2 |
|
178 | Test that strip bundle use bundle2 | |
179 | $ hg --config extensions.strip= strip . |
|
179 | $ hg --config extensions.strip= strip . | |
180 | 0 files updated, 0 files merged, 5 files removed, 0 files unresolved |
|
180 | 0 files updated, 0 files merged, 5 files removed, 0 files unresolved | |
181 | saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg |
|
181 | saved backup bundle to $TESTTMP/aggressive/.hg/strip-backup/1c5d4dc9a8b8-6c68e60c-backup.hg | |
182 | $ hg debugbundle .hg/strip-backup/* |
|
182 | $ hg debugbundle .hg/strip-backup/* | |
183 | Stream params: {Compression: BZ} |
|
183 | Stream params: {Compression: BZ} | |
184 | changegroup -- {nbchanges: 1, version: 02} (mandatory: True) |
|
184 | changegroup -- {nbchanges: 1, version: 02} (mandatory: True) | |
185 | 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 |
|
185 | 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 | |
186 | cache:rev-branch-cache -- {} (mandatory: False) |
|
186 | cache:rev-branch-cache -- {} (mandatory: False) | |
187 | phase-heads -- {} (mandatory: True) |
|
187 | phase-heads -- {} (mandatory: True) | |
188 | 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 draft |
|
188 | 1c5d4dc9a8b8d6e1750966d343e94db665e7a1e9 draft | |
189 |
|
189 | |||
190 | $ cd .. |
|
190 | $ cd .. | |
191 |
|
191 | |||
192 | test maxdeltachainspan |
|
192 | test maxdeltachainspan | |
193 |
|
193 | |||
194 | $ hg init source-repo |
|
194 | $ hg init source-repo | |
195 | $ cd source-repo |
|
195 | $ cd source-repo | |
196 | $ hg debugbuilddag --new-file '.+5:brancha$.+11:branchb$.+30:branchc<brancha+2<branchb+2' |
|
196 | $ hg debugbuilddag --new-file '.+5:brancha$.+11:branchb$.+30:branchc<brancha+2<branchb+2' | |
197 | # add an empty revision somewhere |
|
197 | # add an empty revision somewhere | |
198 | $ hg up tip |
|
198 | $ hg up tip | |
199 | 14 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
199 | 14 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
200 | $ hg rm . |
|
200 | $ hg rm . | |
201 | removing nf10 |
|
201 | removing nf10 | |
202 | removing nf11 |
|
202 | removing nf11 | |
203 | removing nf12 |
|
203 | removing nf12 | |
204 | removing nf13 |
|
204 | removing nf13 | |
205 | removing nf14 |
|
205 | removing nf14 | |
206 | removing nf15 |
|
206 | removing nf15 | |
207 | removing nf16 |
|
207 | removing nf16 | |
208 | removing nf17 |
|
208 | removing nf17 | |
209 | removing nf51 |
|
209 | removing nf51 | |
210 | removing nf52 |
|
210 | removing nf52 | |
211 | removing nf6 |
|
211 | removing nf6 | |
212 | removing nf7 |
|
212 | removing nf7 | |
213 | removing nf8 |
|
213 | removing nf8 | |
214 | removing nf9 |
|
214 | removing nf9 | |
215 | $ hg commit -m 'empty all' |
|
215 | $ hg commit -m 'empty all' | |
216 | $ hg revert --all --rev 'p1(.)' |
|
216 | $ hg revert --all --rev 'p1(.)' | |
217 | adding nf10 |
|
217 | adding nf10 | |
218 | adding nf11 |
|
218 | adding nf11 | |
219 | adding nf12 |
|
219 | adding nf12 | |
220 | adding nf13 |
|
220 | adding nf13 | |
221 | adding nf14 |
|
221 | adding nf14 | |
222 | adding nf15 |
|
222 | adding nf15 | |
223 | adding nf16 |
|
223 | adding nf16 | |
224 | adding nf17 |
|
224 | adding nf17 | |
225 | adding nf51 |
|
225 | adding nf51 | |
226 | adding nf52 |
|
226 | adding nf52 | |
227 | adding nf6 |
|
227 | adding nf6 | |
228 | adding nf7 |
|
228 | adding nf7 | |
229 | adding nf8 |
|
229 | adding nf8 | |
230 | adding nf9 |
|
230 | adding nf9 | |
231 | $ hg commit -m 'restore all' |
|
231 | $ hg commit -m 'restore all' | |
232 | $ hg up null |
|
232 | $ hg up null | |
233 | 0 files updated, 0 files merged, 14 files removed, 0 files unresolved |
|
233 | 0 files updated, 0 files merged, 14 files removed, 0 files unresolved | |
234 | $ |
|
234 | $ | |
235 | $ cd .. |
|
235 | $ cd .. | |
236 | $ hg -R source-repo debugdeltachain -m |
|
236 | $ hg -R source-repo debugdeltachain -m | |
237 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
237 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio | |
238 | 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000 |
|
238 | 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000 | |
239 | 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000 |
|
239 | 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000 | |
240 | 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000 |
|
240 | 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000 | |
241 | 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000 |
|
241 | 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000 | |
242 | 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000 |
|
242 | 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000 | |
243 | 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000 |
|
243 | 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000 | |
244 | 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000 |
|
244 | 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000 | |
245 | 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000 |
|
245 | 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000 | |
246 | 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000 |
|
246 | 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000 | |
247 | 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000 |
|
247 | 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000 | |
248 | 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000 |
|
248 | 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000 | |
249 | 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000 |
|
249 | 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000 | |
250 | 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000 |
|
250 | 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000 | |
251 | 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000 |
|
251 | 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000 | |
252 | 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000 |
|
252 | 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000 | |
253 | 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000 |
|
253 | 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000 | |
254 | 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000 |
|
254 | 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000 | |
255 | 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000 |
|
255 | 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000 | |
256 | 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000 |
|
256 | 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000 | |
257 | 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000 |
|
257 | 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000 | |
258 | 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000 |
|
258 | 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000 | |
259 | 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000 |
|
259 | 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000 | |
260 | 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000 |
|
260 | 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000 | |
261 | 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000 |
|
261 | 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000 | |
262 | 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000 |
|
262 | 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000 | |
263 | 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000 |
|
263 | 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000 | |
264 | 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000 |
|
264 | 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000 | |
265 | 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000 |
|
265 | 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000 | |
266 | 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000 |
|
266 | 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000 | |
267 | 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000 |
|
267 | 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000 | |
268 | 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000 |
|
268 | 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000 | |
269 | 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000 |
|
269 | 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000 | |
270 | 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000 |
|
270 | 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000 | |
271 | 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000 |
|
271 | 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000 | |
272 | 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000 |
|
272 | 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000 | |
273 | 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000 |
|
273 | 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000 | |
274 | 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000 |
|
274 | 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000 | |
275 | 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000 |
|
275 | 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000 | |
276 | 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000 |
|
276 | 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000 | |
277 | 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000 |
|
277 | 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000 | |
278 | 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000 |
|
278 | 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000 | |
279 | 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000 |
|
279 | 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000 | |
280 | 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000 |
|
280 | 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000 | |
281 | 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000 |
|
281 | 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000 | |
282 | 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000 |
|
282 | 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000 | |
283 | 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000 |
|
283 | 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000 | |
284 | 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000 |
|
284 | 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000 | |
285 | 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000 |
|
285 | 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000 | |
286 | 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000 |
|
286 | 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000 | |
287 | 49 4 1 -1 base 197 316 197 0.62342 197 0 0.00000 (no-zstd !) |
|
287 | 49 4 1 -1 base 197 316 197 0.62342 197 0 0.00000 (no-zstd !) | |
288 | 50 4 2 49 p1 58 362 255 0.70442 255 0 0.00000 (no-zstd !) |
|
288 | 50 4 2 49 p1 58 362 255 0.70442 255 0 0.00000 (no-zstd !) | |
289 | 51 4 3 50 prev 356 594 611 1.02862 611 0 0.00000 (no-zstd !) |
|
289 | 51 4 3 50 prev 356 594 611 1.02862 611 0 0.00000 (no-zstd !) | |
290 | 52 4 4 51 p1 58 640 669 1.04531 669 0 0.00000 (no-zstd !) |
|
290 | 52 4 4 51 p1 58 640 669 1.04531 669 0 0.00000 (no-zstd !) | |
291 | 49 4 1 -1 base 205 316 205 0.64873 205 0 0.00000 (zstd !) |
|
291 | 49 4 1 -1 base 205 316 205 0.64873 205 0 0.00000 (zstd !) | |
292 | 50 4 2 49 p1 58 362 263 0.72652 263 0 0.00000 (zstd !) |
|
292 | 50 4 2 49 p1 58 362 263 0.72652 263 0 0.00000 (zstd !) | |
293 | 51 4 3 50 prev 366 594 629 1.05892 629 0 0.00000 (zstd !) |
|
293 | 51 4 3 50 prev 366 594 629 1.05892 629 0 0.00000 (zstd no-bigendian !) | |
294 | 52 4 4 51 p1 58 640 687 1.07344 687 0 0.00000 (zstd !) |
|
294 | 52 4 4 51 p1 58 640 687 1.07344 687 0 0.00000 (zstd no-bigendian !) | |
|
295 | 51 4 3 50 prev 367 594 630 1.06061 630 0 0.00000 (zstd bigendian !) | |||
|
296 | 52 4 4 51 p1 58 640 688 1.07500 688 0 0.00000 (zstd bigendian !) | |||
295 | 53 5 1 -1 base 0 0 0 0.00000 0 0 0.00000 |
|
297 | 53 5 1 -1 base 0 0 0 0.00000 0 0 0.00000 | |
296 | 54 6 1 -1 base 369 640 369 0.57656 369 0 0.00000 (no-zstd !) |
|
298 | 54 6 1 -1 base 369 640 369 0.57656 369 0 0.00000 (no-zstd !) | |
297 | 54 6 1 -1 base 375 640 375 0.58594 375 0 0.00000 (zstd !) |
|
299 | 54 6 1 -1 base 375 640 375 0.58594 375 0 0.00000 (zstd no-bigendian !) | |
|
300 | 54 6 1 -1 base 376 640 376 0.58750 376 0 0.00000 (zstd bigendian !) | |||
298 | $ hg clone --pull source-repo --config experimental.maxdeltachainspan=2800 relax-chain --config format.generaldelta=yes |
|
301 | $ hg clone --pull source-repo --config experimental.maxdeltachainspan=2800 relax-chain --config format.generaldelta=yes | |
299 | requesting all changes |
|
302 | requesting all changes | |
300 | adding changesets |
|
303 | adding changesets | |
301 | adding manifests |
|
304 | adding manifests | |
302 | adding file changes |
|
305 | adding file changes | |
303 | added 55 changesets with 53 changes to 53 files (+2 heads) |
|
306 | added 55 changesets with 53 changes to 53 files (+2 heads) | |
304 | new changesets 61246295ee1e:c930ac4a5b32 |
|
307 | new changesets 61246295ee1e:c930ac4a5b32 | |
305 | updating to branch default |
|
308 | updating to branch default | |
306 | 14 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
309 | 14 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
307 | $ hg -R relax-chain debugdeltachain -m |
|
310 | $ hg -R relax-chain debugdeltachain -m | |
308 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
311 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio | |
309 | 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000 |
|
312 | 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000 | |
310 | 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000 |
|
313 | 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000 | |
311 | 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000 |
|
314 | 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000 | |
312 | 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000 |
|
315 | 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000 | |
313 | 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000 |
|
316 | 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000 | |
314 | 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000 |
|
317 | 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000 | |
315 | 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000 |
|
318 | 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000 | |
316 | 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000 |
|
319 | 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000 | |
317 | 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000 |
|
320 | 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000 | |
318 | 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000 |
|
321 | 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000 | |
319 | 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000 |
|
322 | 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000 | |
320 | 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000 |
|
323 | 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000 | |
321 | 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000 |
|
324 | 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000 | |
322 | 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000 |
|
325 | 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000 | |
323 | 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000 |
|
326 | 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000 | |
324 | 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000 |
|
327 | 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000 | |
325 | 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000 |
|
328 | 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000 | |
326 | 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000 |
|
329 | 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000 | |
327 | 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000 |
|
330 | 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000 | |
328 | 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000 |
|
331 | 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000 | |
329 | 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000 |
|
332 | 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000 | |
330 | 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000 |
|
333 | 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000 | |
331 | 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000 |
|
334 | 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000 | |
332 | 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000 |
|
335 | 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000 | |
333 | 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000 |
|
336 | 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000 | |
334 | 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000 |
|
337 | 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000 | |
335 | 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000 |
|
338 | 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000 | |
336 | 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000 |
|
339 | 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000 | |
337 | 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000 |
|
340 | 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000 | |
338 | 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000 |
|
341 | 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000 | |
339 | 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000 |
|
342 | 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000 | |
340 | 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000 |
|
343 | 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000 | |
341 | 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000 |
|
344 | 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000 | |
342 | 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000 |
|
345 | 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000 | |
343 | 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000 |
|
346 | 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000 | |
344 | 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000 |
|
347 | 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000 | |
345 | 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000 |
|
348 | 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000 | |
346 | 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000 |
|
349 | 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000 | |
347 | 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000 |
|
350 | 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000 | |
348 | 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000 |
|
351 | 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000 | |
349 | 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000 |
|
352 | 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000 | |
350 | 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000 |
|
353 | 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000 | |
351 | 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000 |
|
354 | 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000 | |
352 | 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000 |
|
355 | 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000 | |
353 | 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000 |
|
356 | 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000 | |
354 | 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000 |
|
357 | 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000 | |
355 | 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000 |
|
358 | 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000 | |
356 | 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000 |
|
359 | 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000 | |
357 | 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000 |
|
360 | 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000 | |
358 | 49 4 1 -1 base 197 316 197 0.62342 197 0 0.00000 (no-zstd !) |
|
361 | 49 4 1 -1 base 197 316 197 0.62342 197 0 0.00000 (no-zstd !) | |
359 | 50 4 2 49 p1 58 362 255 0.70442 255 0 0.00000 (no-zstd !) |
|
362 | 50 4 2 49 p1 58 362 255 0.70442 255 0 0.00000 (no-zstd !) | |
360 | 51 2 13 17 p1 58 594 739 1.24411 2781 2042 2.76319 (no-zstd !) |
|
363 | 51 2 13 17 p1 58 594 739 1.24411 2781 2042 2.76319 (no-zstd !) | |
361 | 52 5 1 -1 base 369 640 369 0.57656 369 0 0.00000 (no-zstd !) |
|
364 | 52 5 1 -1 base 369 640 369 0.57656 369 0 0.00000 (no-zstd !) | |
362 | 49 4 1 -1 base 205 316 205 0.64873 205 0 0.00000 (zstd !) |
|
365 | 49 4 1 -1 base 205 316 205 0.64873 205 0 0.00000 (zstd !) | |
363 | 50 4 2 49 p1 58 362 263 0.72652 263 0 0.00000 (zstd !) |
|
366 | 50 4 2 49 p1 58 362 263 0.72652 263 0 0.00000 (zstd !) | |
364 | 51 2 13 17 p1 58 594 739 1.24411 2789 2050 2.77402 (zstd !) |
|
367 | 51 2 13 17 p1 58 594 739 1.24411 2789 2050 2.77402 (zstd !) | |
365 | 52 5 1 -1 base 375 640 375 0.58594 375 0 0.00000 (zstd !) |
|
368 | 52 5 1 -1 base 375 640 375 0.58594 375 0 0.00000 (zstd no-bigendian !) | |
|
369 | 52 5 1 -1 base 376 640 376 0.58750 376 0 0.00000 (zstd bigendian !) | |||
366 | 53 6 1 -1 base 0 0 0 0.00000 0 0 0.00000 |
|
370 | 53 6 1 -1 base 0 0 0 0.00000 0 0 0.00000 | |
367 | 54 7 1 -1 base 369 640 369 0.57656 369 0 0.00000 (no-zstd !) |
|
371 | 54 7 1 -1 base 369 640 369 0.57656 369 0 0.00000 (no-zstd !) | |
368 | 54 7 1 -1 base 375 640 375 0.58594 375 0 0.00000 (zstd !) |
|
372 | 54 7 1 -1 base 375 640 375 0.58594 375 0 0.00000 (zstd no-bigendian !) | |
|
373 | 54 7 1 -1 base 376 640 376 0.58750 376 0 0.00000 (zstd bigendian !) | |||
369 | $ hg clone --pull source-repo --config experimental.maxdeltachainspan=0 noconst-chain --config format.usegeneraldelta=yes --config storage.revlog.reuse-external-delta-parent=no |
|
374 | $ hg clone --pull source-repo --config experimental.maxdeltachainspan=0 noconst-chain --config format.usegeneraldelta=yes --config storage.revlog.reuse-external-delta-parent=no | |
370 | requesting all changes |
|
375 | requesting all changes | |
371 | adding changesets |
|
376 | adding changesets | |
372 | adding manifests |
|
377 | adding manifests | |
373 | adding file changes |
|
378 | adding file changes | |
374 | added 55 changesets with 53 changes to 53 files (+2 heads) |
|
379 | added 55 changesets with 53 changes to 53 files (+2 heads) | |
375 | new changesets 61246295ee1e:c930ac4a5b32 |
|
380 | new changesets 61246295ee1e:c930ac4a5b32 | |
376 | updating to branch default |
|
381 | updating to branch default | |
377 | 14 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
382 | 14 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
378 | $ hg -R noconst-chain debugdeltachain -m |
|
383 | $ hg -R noconst-chain debugdeltachain -m | |
379 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio |
|
384 | rev chain# chainlen prev delta size rawsize chainsize ratio lindist extradist extraratio | |
380 | 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000 |
|
385 | 0 1 1 -1 base 46 45 46 1.02222 46 0 0.00000 | |
381 | 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000 |
|
386 | 1 1 2 0 p1 57 90 103 1.14444 103 0 0.00000 | |
382 | 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000 |
|
387 | 2 1 3 1 p1 57 135 160 1.18519 160 0 0.00000 | |
383 | 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000 |
|
388 | 3 1 4 2 p1 57 180 217 1.20556 217 0 0.00000 | |
384 | 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000 |
|
389 | 4 1 5 3 p1 57 225 274 1.21778 274 0 0.00000 | |
385 | 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000 |
|
390 | 5 1 6 4 p1 57 270 331 1.22593 331 0 0.00000 | |
386 | 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000 |
|
391 | 6 2 1 -1 base 46 45 46 1.02222 46 0 0.00000 | |
387 | 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000 |
|
392 | 7 2 2 6 p1 57 90 103 1.14444 103 0 0.00000 | |
388 | 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000 |
|
393 | 8 2 3 7 p1 57 135 160 1.18519 160 0 0.00000 | |
389 | 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000 |
|
394 | 9 2 4 8 p1 57 180 217 1.20556 217 0 0.00000 | |
390 | 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000 |
|
395 | 10 2 5 9 p1 58 226 275 1.21681 275 0 0.00000 | |
391 | 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000 |
|
396 | 11 2 6 10 p1 58 272 333 1.22426 333 0 0.00000 | |
392 | 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000 |
|
397 | 12 2 7 11 p1 58 318 391 1.22956 391 0 0.00000 | |
393 | 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000 |
|
398 | 13 2 8 12 p1 58 364 449 1.23352 449 0 0.00000 | |
394 | 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000 |
|
399 | 14 2 9 13 p1 58 410 507 1.23659 507 0 0.00000 | |
395 | 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000 |
|
400 | 15 2 10 14 p1 58 456 565 1.23904 565 0 0.00000 | |
396 | 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000 |
|
401 | 16 2 11 15 p1 58 502 623 1.24104 623 0 0.00000 | |
397 | 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000 |
|
402 | 17 2 12 16 p1 58 548 681 1.24270 681 0 0.00000 | |
398 | 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000 |
|
403 | 18 3 1 -1 base 47 46 47 1.02174 47 0 0.00000 | |
399 | 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000 |
|
404 | 19 3 2 18 p1 58 92 105 1.14130 105 0 0.00000 | |
400 | 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000 |
|
405 | 20 3 3 19 p1 58 138 163 1.18116 163 0 0.00000 | |
401 | 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000 |
|
406 | 21 3 4 20 p1 58 184 221 1.20109 221 0 0.00000 | |
402 | 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000 |
|
407 | 22 3 5 21 p1 58 230 279 1.21304 279 0 0.00000 | |
403 | 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000 |
|
408 | 23 3 6 22 p1 58 276 337 1.22101 337 0 0.00000 | |
404 | 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000 |
|
409 | 24 3 7 23 p1 58 322 395 1.22671 395 0 0.00000 | |
405 | 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000 |
|
410 | 25 3 8 24 p1 58 368 453 1.23098 453 0 0.00000 | |
406 | 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000 |
|
411 | 26 3 9 25 p1 58 414 511 1.23430 511 0 0.00000 | |
407 | 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000 |
|
412 | 27 3 10 26 p1 58 460 569 1.23696 569 0 0.00000 | |
408 | 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000 |
|
413 | 28 3 11 27 p1 58 506 627 1.23913 627 0 0.00000 | |
409 | 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000 |
|
414 | 29 3 12 28 p1 58 552 685 1.24094 685 0 0.00000 | |
410 | 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000 |
|
415 | 30 3 13 29 p1 58 598 743 1.24247 743 0 0.00000 | |
411 | 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000 |
|
416 | 31 3 14 30 p1 58 644 801 1.24379 801 0 0.00000 | |
412 | 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000 |
|
417 | 32 3 15 31 p1 58 690 859 1.24493 859 0 0.00000 | |
413 | 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000 |
|
418 | 33 3 16 32 p1 58 736 917 1.24592 917 0 0.00000 | |
414 | 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000 |
|
419 | 34 3 17 33 p1 58 782 975 1.24680 975 0 0.00000 | |
415 | 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000 |
|
420 | 35 3 18 34 p1 58 828 1033 1.24758 1033 0 0.00000 | |
416 | 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000 |
|
421 | 36 3 19 35 p1 58 874 1091 1.24828 1091 0 0.00000 | |
417 | 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000 |
|
422 | 37 3 20 36 p1 58 920 1149 1.24891 1149 0 0.00000 | |
418 | 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000 |
|
423 | 38 3 21 37 p1 58 966 1207 1.24948 1207 0 0.00000 | |
419 | 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000 |
|
424 | 39 3 22 38 p1 58 1012 1265 1.25000 1265 0 0.00000 | |
420 | 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000 |
|
425 | 40 3 23 39 p1 58 1058 1323 1.25047 1323 0 0.00000 | |
421 | 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000 |
|
426 | 41 3 24 40 p1 58 1104 1381 1.25091 1381 0 0.00000 | |
422 | 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000 |
|
427 | 42 3 25 41 p1 58 1150 1439 1.25130 1439 0 0.00000 | |
423 | 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000 |
|
428 | 43 3 26 42 p1 58 1196 1497 1.25167 1497 0 0.00000 | |
424 | 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000 |
|
429 | 44 3 27 43 p1 58 1242 1555 1.25201 1555 0 0.00000 | |
425 | 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000 |
|
430 | 45 3 28 44 p1 58 1288 1613 1.25233 1613 0 0.00000 | |
426 | 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000 |
|
431 | 46 3 29 45 p1 58 1334 1671 1.25262 1671 0 0.00000 | |
427 | 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000 |
|
432 | 47 3 30 46 p1 58 1380 1729 1.25290 1729 0 0.00000 | |
428 | 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000 |
|
433 | 48 3 31 47 p1 58 1426 1787 1.25316 1787 0 0.00000 | |
429 | 49 1 7 5 p1 58 316 389 1.23101 2857 2468 6.34447 |
|
434 | 49 1 7 5 p1 58 316 389 1.23101 2857 2468 6.34447 | |
430 | 50 1 8 49 p1 58 362 447 1.23481 2915 2468 5.52125 |
|
435 | 50 1 8 49 p1 58 362 447 1.23481 2915 2468 5.52125 | |
431 | 51 2 13 17 p1 58 594 739 1.24411 2642 1903 2.57510 |
|
436 | 51 2 13 17 p1 58 594 739 1.24411 2642 1903 2.57510 | |
432 | 52 2 14 51 p1 58 640 797 1.24531 2700 1903 2.38770 |
|
437 | 52 2 14 51 p1 58 640 797 1.24531 2700 1903 2.38770 | |
433 | 53 4 1 -1 base 0 0 0 0.00000 0 0 0.00000 |
|
438 | 53 4 1 -1 base 0 0 0 0.00000 0 0 0.00000 | |
434 | 54 5 1 -1 base 369 640 369 0.57656 369 0 0.00000 (no-zstd !) |
|
439 | 54 5 1 -1 base 369 640 369 0.57656 369 0 0.00000 (no-zstd !) | |
435 | 54 5 1 -1 base 375 640 375 0.58594 375 0 0.00000 (zstd !) |
|
440 | 54 5 1 -1 base 375 640 375 0.58594 375 0 0.00000 (zstd no-bigendian !) | |
|
441 | 54 5 1 -1 base 376 640 376 0.58750 376 0 0.00000 (zstd bigendian !) |
@@ -1,1256 +1,1262 | |||||
1 | =================================== |
|
1 | =================================== | |
2 | Test the persistent on-disk nodemap |
|
2 | Test the persistent on-disk nodemap | |
3 | =================================== |
|
3 | =================================== | |
4 |
|
4 | |||
5 |
|
5 | |||
6 | $ cat << EOF >> $HGRCPATH |
|
6 | $ cat << EOF >> $HGRCPATH | |
7 | > [format] |
|
7 | > [format] | |
8 | > use-share-safe=yes |
|
8 | > use-share-safe=yes | |
9 | > [extensions] |
|
9 | > [extensions] | |
10 | > share= |
|
10 | > share= | |
11 | > EOF |
|
11 | > EOF | |
12 |
|
12 | |||
13 | #if no-rust |
|
13 | #if no-rust | |
14 |
|
14 | |||
15 | $ cat << EOF >> $HGRCPATH |
|
15 | $ cat << EOF >> $HGRCPATH | |
16 | > [format] |
|
16 | > [format] | |
17 | > use-persistent-nodemap=yes |
|
17 | > use-persistent-nodemap=yes | |
18 | > [devel] |
|
18 | > [devel] | |
19 | > persistent-nodemap=yes |
|
19 | > persistent-nodemap=yes | |
20 | > EOF |
|
20 | > EOF | |
21 |
|
21 | |||
22 | #endif |
|
22 | #endif | |
23 |
|
23 | |||
24 | $ hg init test-repo --config storage.revlog.persistent-nodemap.slow-path=allow |
|
24 | $ hg init test-repo --config storage.revlog.persistent-nodemap.slow-path=allow | |
25 | $ cd test-repo |
|
25 | $ cd test-repo | |
26 |
|
26 | |||
27 | Check handling of the default slow-path value |
|
27 | Check handling of the default slow-path value | |
28 |
|
28 | |||
29 | #if no-pure no-rust |
|
29 | #if no-pure no-rust | |
30 |
|
30 | |||
31 | $ hg id |
|
31 | $ hg id | |
32 | abort: accessing `persistent-nodemap` repository without associated fast implementation. |
|
32 | abort: accessing `persistent-nodemap` repository without associated fast implementation. | |
33 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
33 | (check `hg help config.format.use-persistent-nodemap` for details) | |
34 | [255] |
|
34 | [255] | |
35 |
|
35 | |||
36 | Unlock further check (we are here to test the feature) |
|
36 | Unlock further check (we are here to test the feature) | |
37 |
|
37 | |||
38 | $ cat << EOF >> $HGRCPATH |
|
38 | $ cat << EOF >> $HGRCPATH | |
39 | > [storage] |
|
39 | > [storage] | |
40 | > # to avoid spamming the test |
|
40 | > # to avoid spamming the test | |
41 | > revlog.persistent-nodemap.slow-path=allow |
|
41 | > revlog.persistent-nodemap.slow-path=allow | |
42 | > EOF |
|
42 | > EOF | |
43 |
|
43 | |||
44 | #endif |
|
44 | #endif | |
45 |
|
45 | |||
46 | #if rust |
|
46 | #if rust | |
47 |
|
47 | |||
48 | Regression test for a previous bug in Rust/C FFI for the `Revlog_CAPI` capsule: |
|
48 | Regression test for a previous bug in Rust/C FFI for the `Revlog_CAPI` capsule: | |
49 | in places where `mercurial/cext/revlog.c` function signatures use `Py_ssize_t` |
|
49 | in places where `mercurial/cext/revlog.c` function signatures use `Py_ssize_t` | |
50 | (64 bits on Linux x86_64), corresponding declarations in `rust/hg-cpython/src/cindex.rs` |
|
50 | (64 bits on Linux x86_64), corresponding declarations in `rust/hg-cpython/src/cindex.rs` | |
51 | incorrectly used `libc::c_int` (32 bits). |
|
51 | incorrectly used `libc::c_int` (32 bits). | |
52 | As a result, -1 passed from Rust for the null revision became 4294967295 in C. |
|
52 | As a result, -1 passed from Rust for the null revision became 4294967295 in C. | |
53 |
|
53 | |||
54 | $ hg log -r 00000000 |
|
54 | $ hg log -r 00000000 | |
55 | changeset: -1:000000000000 |
|
55 | changeset: -1:000000000000 | |
56 | tag: tip |
|
56 | tag: tip | |
57 | user: |
|
57 | user: | |
58 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
58 | date: Thu Jan 01 00:00:00 1970 +0000 | |
59 |
|
59 | |||
60 |
|
60 | |||
61 | #endif |
|
61 | #endif | |
62 |
|
62 | |||
63 |
|
63 | |||
64 | $ hg debugformat |
|
64 | $ hg debugformat | |
65 | format-variant repo |
|
65 | format-variant repo | |
66 | fncache: yes |
|
66 | fncache: yes | |
67 | dirstate-v2: no |
|
67 | dirstate-v2: no | |
68 | dotencode: yes |
|
68 | dotencode: yes | |
69 | generaldelta: yes |
|
69 | generaldelta: yes | |
70 | share-safe: yes |
|
70 | share-safe: yes | |
71 | sparserevlog: yes |
|
71 | sparserevlog: yes | |
72 | persistent-nodemap: yes |
|
72 | persistent-nodemap: yes | |
73 | copies-sdc: no |
|
73 | copies-sdc: no | |
74 | revlog-v2: no |
|
74 | revlog-v2: no | |
75 | changelog-v2: no |
|
75 | changelog-v2: no | |
76 | plain-cl-delta: yes |
|
76 | plain-cl-delta: yes | |
77 | compression: zlib (no-zstd !) |
|
77 | compression: zlib (no-zstd !) | |
78 | compression: zstd (zstd !) |
|
78 | compression: zstd (zstd !) | |
79 | compression-level: default |
|
79 | compression-level: default | |
80 | $ hg debugbuilddag .+5000 --new-file |
|
80 | $ hg debugbuilddag .+5000 --new-file | |
81 |
|
81 | |||
82 | $ hg debugnodemap --metadata |
|
82 | $ hg debugnodemap --metadata | |
83 | uid: ???????? (glob) |
|
83 | uid: ???????? (glob) | |
84 | tip-rev: 5000 |
|
84 | tip-rev: 5000 | |
85 | tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c |
|
85 | tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c | |
86 | data-length: 121088 |
|
86 | data-length: 121088 | |
87 | data-unused: 0 |
|
87 | data-unused: 0 | |
88 | data-unused: 0.000% |
|
88 | data-unused: 0.000% | |
89 | $ f --size .hg/store/00changelog.n |
|
89 | $ f --size .hg/store/00changelog.n | |
90 | .hg/store/00changelog.n: size=62 |
|
90 | .hg/store/00changelog.n: size=62 | |
91 |
|
91 | |||
92 | Simple lookup works |
|
92 | Simple lookup works | |
93 |
|
93 | |||
94 | $ ANYNODE=`hg log --template '{node|short}\n' --rev tip` |
|
94 | $ ANYNODE=`hg log --template '{node|short}\n' --rev tip` | |
95 | $ hg log -r "$ANYNODE" --template '{rev}\n' |
|
95 | $ hg log -r "$ANYNODE" --template '{rev}\n' | |
96 | 5000 |
|
96 | 5000 | |
97 |
|
97 | |||
98 |
|
98 | |||
99 | #if rust |
|
99 | #if rust | |
100 |
|
100 | |||
101 | $ f --sha256 .hg/store/00changelog-*.nd |
|
101 | $ f --sha256 .hg/store/00changelog-*.nd | |
102 | .hg/store/00changelog-????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob) |
|
102 | .hg/store/00changelog-????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob) | |
103 |
|
103 | |||
104 | $ f --sha256 .hg/store/00manifest-*.nd |
|
104 | $ f --sha256 .hg/store/00manifest-*.nd | |
105 | .hg/store/00manifest-????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob) |
|
105 | .hg/store/00manifest-????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob) | |
106 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
106 | $ hg debugnodemap --dump-new | f --sha256 --size | |
107 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd |
|
107 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd | |
108 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size |
|
108 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size | |
109 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd |
|
109 | size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd | |
110 | 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........| |
|
110 | 0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........| | |
111 | 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."| |
|
111 | 0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."| | |
112 | 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^| |
|
112 | 0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^| | |
113 | 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....| |
|
113 | 0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....| | |
114 | 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8| |
|
114 | 0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8| | |
115 | 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i| |
|
115 | 0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i| | |
116 | 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....| |
|
116 | 0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....| | |
117 | 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........| |
|
117 | 0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........| | |
118 | 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....| |
|
118 | 0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....| | |
119 | 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................| |
|
119 | 0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................| | |
120 | 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+| |
|
120 | 00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+| | |
121 | 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................| |
|
121 | 00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................| | |
122 | 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5| |
|
122 | 00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5| | |
123 | 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U| |
|
123 | 00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U| | |
124 | 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................| |
|
124 | 00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................| | |
125 | 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................| |
|
125 | 00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................| | |
126 |
|
126 | |||
127 |
|
127 | |||
128 | #else |
|
128 | #else | |
129 |
|
129 | |||
130 | $ f --sha256 .hg/store/00changelog-*.nd |
|
130 | $ f --sha256 .hg/store/00changelog-*.nd | |
131 | .hg/store/00changelog-????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob) |
|
131 | .hg/store/00changelog-????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob) | |
132 | $ hg debugnodemap --dump-new | f --sha256 --size |
|
132 | $ hg debugnodemap --dump-new | f --sha256 --size | |
133 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 |
|
133 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 | |
134 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size |
|
134 | $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size | |
135 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 |
|
135 | size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 | |
136 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
136 | 0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
137 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
137 | 0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
138 | 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................| |
|
138 | 0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................| | |
139 | 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
139 | 0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
140 | 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
140 | 0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
141 | 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................| |
|
141 | 0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................| | |
142 | 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............| |
|
142 | 0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............| | |
143 | 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
143 | 0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
144 | 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
144 | 0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
145 | 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................| |
|
145 | 0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................| | |
146 | 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........| |
|
146 | 00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........| | |
147 | 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
147 | 00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
148 | 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
148 | 00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
149 | 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| |
|
149 | 00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................| | |
150 | 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................| |
|
150 | 00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................| | |
151 | 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................| |
|
151 | 00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................| | |
152 |
|
152 | |||
153 | #endif |
|
153 | #endif | |
154 |
|
154 | |||
155 | $ hg debugnodemap --check |
|
155 | $ hg debugnodemap --check | |
156 | revision in index: 5001 |
|
156 | revision in index: 5001 | |
157 | revision in nodemap: 5001 |
|
157 | revision in nodemap: 5001 | |
158 |
|
158 | |||
159 | add a new commit |
|
159 | add a new commit | |
160 |
|
160 | |||
161 | $ hg up |
|
161 | $ hg up | |
162 | 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
162 | 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
163 | $ echo foo > foo |
|
163 | $ echo foo > foo | |
164 | $ hg add foo |
|
164 | $ hg add foo | |
165 |
|
165 | |||
166 |
|
166 | |||
167 | Check slow-path config value handling |
|
167 | Check slow-path config value handling | |
168 | ------------------------------------- |
|
168 | ------------------------------------- | |
169 |
|
169 | |||
170 | #if no-pure no-rust |
|
170 | #if no-pure no-rust | |
171 |
|
171 | |||
172 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" |
|
172 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" | |
173 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" |
|
173 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" | |
174 | falling back to default value: abort |
|
174 | falling back to default value: abort | |
175 | abort: accessing `persistent-nodemap` repository without associated fast implementation. |
|
175 | abort: accessing `persistent-nodemap` repository without associated fast implementation. | |
176 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
176 | (check `hg help config.format.use-persistent-nodemap` for details) | |
177 | [255] |
|
177 | [255] | |
178 |
|
178 | |||
179 | $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn" |
|
179 | $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn" | |
180 | warning: accessing `persistent-nodemap` repository without associated fast implementation. |
|
180 | warning: accessing `persistent-nodemap` repository without associated fast implementation. | |
181 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
181 | (check `hg help config.format.use-persistent-nodemap` for details) | |
182 | changeset: 5000:6b02b8c7b966 |
|
182 | changeset: 5000:6b02b8c7b966 | |
183 | tag: tip |
|
183 | tag: tip | |
184 | user: debugbuilddag |
|
184 | user: debugbuilddag | |
185 | date: Thu Jan 01 01:23:20 1970 +0000 |
|
185 | date: Thu Jan 01 01:23:20 1970 +0000 | |
186 | summary: r5000 |
|
186 | summary: r5000 | |
187 |
|
187 | |||
188 | $ hg ci -m 'foo' --config "storage.revlog.persistent-nodemap.slow-path=abort" |
|
188 | $ hg ci -m 'foo' --config "storage.revlog.persistent-nodemap.slow-path=abort" | |
189 | abort: accessing `persistent-nodemap` repository without associated fast implementation. |
|
189 | abort: accessing `persistent-nodemap` repository without associated fast implementation. | |
190 | (check `hg help config.format.use-persistent-nodemap` for details) |
|
190 | (check `hg help config.format.use-persistent-nodemap` for details) | |
191 | [255] |
|
191 | [255] | |
192 |
|
192 | |||
193 | #else |
|
193 | #else | |
194 |
|
194 | |||
195 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" |
|
195 | $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value" | |
196 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" |
|
196 | unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value" | |
197 | falling back to default value: abort |
|
197 | falling back to default value: abort | |
198 | 6b02b8c7b966+ tip |
|
198 | 6b02b8c7b966+ tip | |
199 |
|
199 | |||
200 | #endif |
|
200 | #endif | |
201 |
|
201 | |||
202 | $ hg ci -m 'foo' |
|
202 | $ hg ci -m 'foo' | |
203 |
|
203 | |||
204 | #if no-pure no-rust |
|
204 | #if no-pure no-rust | |
205 | $ hg debugnodemap --metadata |
|
205 | $ hg debugnodemap --metadata | |
206 | uid: ???????? (glob) |
|
206 | uid: ???????? (glob) | |
207 | tip-rev: 5001 |
|
207 | tip-rev: 5001 | |
208 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c |
|
208 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c | |
209 | data-length: 121088 |
|
209 | data-length: 121088 | |
210 | data-unused: 0 |
|
210 | data-unused: 0 | |
211 | data-unused: 0.000% |
|
211 | data-unused: 0.000% | |
212 | #else |
|
212 | #else | |
213 | $ hg debugnodemap --metadata |
|
213 | $ hg debugnodemap --metadata | |
214 | uid: ???????? (glob) |
|
214 | uid: ???????? (glob) | |
215 | tip-rev: 5001 |
|
215 | tip-rev: 5001 | |
216 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c |
|
216 | tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c | |
217 | data-length: 121344 |
|
217 | data-length: 121344 | |
218 | data-unused: 256 |
|
218 | data-unused: 256 | |
219 | data-unused: 0.211% |
|
219 | data-unused: 0.211% | |
220 | #endif |
|
220 | #endif | |
221 |
|
221 | |||
222 | $ f --size .hg/store/00changelog.n |
|
222 | $ f --size .hg/store/00changelog.n | |
223 | .hg/store/00changelog.n: size=62 |
|
223 | .hg/store/00changelog.n: size=62 | |
224 |
|
224 | |||
225 | (The pure code use the debug code that perform incremental update, the C code reencode from scratch) |
|
225 | (The pure code use the debug code that perform incremental update, the C code reencode from scratch) | |
226 |
|
226 | |||
227 | #if pure |
|
227 | #if pure | |
228 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
228 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
229 | .hg/store/00changelog-????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob) |
|
229 | .hg/store/00changelog-????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob) | |
230 | #endif |
|
230 | #endif | |
231 |
|
231 | |||
232 | #if rust |
|
232 | #if rust | |
233 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
233 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
234 | .hg/store/00changelog-????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob) |
|
234 | .hg/store/00changelog-????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob) | |
235 | #endif |
|
235 | #endif | |
236 |
|
236 | |||
237 | #if no-pure no-rust |
|
237 | #if no-pure no-rust | |
238 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
238 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
239 | .hg/store/00changelog-????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob) |
|
239 | .hg/store/00changelog-????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob) | |
240 | #endif |
|
240 | #endif | |
241 |
|
241 | |||
242 | $ hg debugnodemap --check |
|
242 | $ hg debugnodemap --check | |
243 | revision in index: 5002 |
|
243 | revision in index: 5002 | |
244 | revision in nodemap: 5002 |
|
244 | revision in nodemap: 5002 | |
245 |
|
245 | |||
246 | Test code path without mmap |
|
246 | Test code path without mmap | |
247 | --------------------------- |
|
247 | --------------------------- | |
248 |
|
248 | |||
249 | $ echo bar > bar |
|
249 | $ echo bar > bar | |
250 | $ hg add bar |
|
250 | $ hg add bar | |
251 | $ hg ci -m 'bar' --config storage.revlog.persistent-nodemap.mmap=no |
|
251 | $ hg ci -m 'bar' --config storage.revlog.persistent-nodemap.mmap=no | |
252 |
|
252 | |||
253 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=yes |
|
253 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=yes | |
254 | revision in index: 5003 |
|
254 | revision in index: 5003 | |
255 | revision in nodemap: 5003 |
|
255 | revision in nodemap: 5003 | |
256 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=no |
|
256 | $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=no | |
257 | revision in index: 5003 |
|
257 | revision in index: 5003 | |
258 | revision in nodemap: 5003 |
|
258 | revision in nodemap: 5003 | |
259 |
|
259 | |||
260 |
|
260 | |||
261 | #if pure |
|
261 | #if pure | |
262 | $ hg debugnodemap --metadata |
|
262 | $ hg debugnodemap --metadata | |
263 | uid: ???????? (glob) |
|
263 | uid: ???????? (glob) | |
264 | tip-rev: 5002 |
|
264 | tip-rev: 5002 | |
265 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
265 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
266 | data-length: 121600 |
|
266 | data-length: 121600 | |
267 | data-unused: 512 |
|
267 | data-unused: 512 | |
268 | data-unused: 0.421% |
|
268 | data-unused: 0.421% | |
269 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
269 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
270 | .hg/store/00changelog-????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob) |
|
270 | .hg/store/00changelog-????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob) | |
271 | #endif |
|
271 | #endif | |
272 | #if rust |
|
272 | #if rust | |
273 | $ hg debugnodemap --metadata |
|
273 | $ hg debugnodemap --metadata | |
274 | uid: ???????? (glob) |
|
274 | uid: ???????? (glob) | |
275 | tip-rev: 5002 |
|
275 | tip-rev: 5002 | |
276 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
276 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
277 | data-length: 121600 |
|
277 | data-length: 121600 | |
278 | data-unused: 512 |
|
278 | data-unused: 512 | |
279 | data-unused: 0.421% |
|
279 | data-unused: 0.421% | |
280 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
280 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
281 | .hg/store/00changelog-????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob) |
|
281 | .hg/store/00changelog-????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob) | |
282 | #endif |
|
282 | #endif | |
283 | #if no-pure no-rust |
|
283 | #if no-pure no-rust | |
284 | $ hg debugnodemap --metadata |
|
284 | $ hg debugnodemap --metadata | |
285 | uid: ???????? (glob) |
|
285 | uid: ???????? (glob) | |
286 | tip-rev: 5002 |
|
286 | tip-rev: 5002 | |
287 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
287 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
288 | data-length: 121088 |
|
288 | data-length: 121088 | |
289 | data-unused: 0 |
|
289 | data-unused: 0 | |
290 | data-unused: 0.000% |
|
290 | data-unused: 0.000% | |
291 | $ f --sha256 .hg/store/00changelog-*.nd --size |
|
291 | $ f --sha256 .hg/store/00changelog-*.nd --size | |
292 | .hg/store/00changelog-????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob) |
|
292 | .hg/store/00changelog-????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob) | |
293 | #endif |
|
293 | #endif | |
294 |
|
294 | |||
295 | Test force warming the cache |
|
295 | Test force warming the cache | |
296 |
|
296 | |||
297 | $ rm .hg/store/00changelog.n |
|
297 | $ rm .hg/store/00changelog.n | |
298 | $ hg debugnodemap --metadata |
|
298 | $ hg debugnodemap --metadata | |
299 | $ hg debugupdatecache |
|
299 | $ hg debugupdatecache | |
300 | #if pure |
|
300 | #if pure | |
301 | $ hg debugnodemap --metadata |
|
301 | $ hg debugnodemap --metadata | |
302 | uid: ???????? (glob) |
|
302 | uid: ???????? (glob) | |
303 | tip-rev: 5002 |
|
303 | tip-rev: 5002 | |
304 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
304 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
305 | data-length: 121088 |
|
305 | data-length: 121088 | |
306 | data-unused: 0 |
|
306 | data-unused: 0 | |
307 | data-unused: 0.000% |
|
307 | data-unused: 0.000% | |
308 | #else |
|
308 | #else | |
309 | $ hg debugnodemap --metadata |
|
309 | $ hg debugnodemap --metadata | |
310 | uid: ???????? (glob) |
|
310 | uid: ???????? (glob) | |
311 | tip-rev: 5002 |
|
311 | tip-rev: 5002 | |
312 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
312 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
313 | data-length: 121088 |
|
313 | data-length: 121088 | |
314 | data-unused: 0 |
|
314 | data-unused: 0 | |
315 | data-unused: 0.000% |
|
315 | data-unused: 0.000% | |
316 | #endif |
|
316 | #endif | |
317 |
|
317 | |||
318 | Check out of sync nodemap |
|
318 | Check out of sync nodemap | |
319 | ========================= |
|
319 | ========================= | |
320 |
|
320 | |||
321 | First copy old data on the side. |
|
321 | First copy old data on the side. | |
322 |
|
322 | |||
323 | $ mkdir ../tmp-copies |
|
323 | $ mkdir ../tmp-copies | |
324 | $ cp .hg/store/00changelog-????????.nd .hg/store/00changelog.n ../tmp-copies |
|
324 | $ cp .hg/store/00changelog-????????.nd .hg/store/00changelog.n ../tmp-copies | |
325 |
|
325 | |||
326 | Nodemap lagging behind |
|
326 | Nodemap lagging behind | |
327 | ---------------------- |
|
327 | ---------------------- | |
328 |
|
328 | |||
329 | make a new commit |
|
329 | make a new commit | |
330 |
|
330 | |||
331 | $ echo bar2 > bar |
|
331 | $ echo bar2 > bar | |
332 | $ hg ci -m 'bar2' |
|
332 | $ hg ci -m 'bar2' | |
333 | $ NODE=`hg log -r tip -T '{node}\n'` |
|
333 | $ NODE=`hg log -r tip -T '{node}\n'` | |
334 | $ hg log -r "$NODE" -T '{rev}\n' |
|
334 | $ hg log -r "$NODE" -T '{rev}\n' | |
335 | 5003 |
|
335 | 5003 | |
336 |
|
336 | |||
337 | If the nodemap is lagging behind, it can catch up fine |
|
337 | If the nodemap is lagging behind, it can catch up fine | |
338 |
|
338 | |||
339 | $ hg debugnodemap --metadata |
|
339 | $ hg debugnodemap --metadata | |
340 | uid: ???????? (glob) |
|
340 | uid: ???????? (glob) | |
341 | tip-rev: 5003 |
|
341 | tip-rev: 5003 | |
342 | tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3 |
|
342 | tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3 | |
343 | data-length: 121344 (pure !) |
|
343 | data-length: 121344 (pure !) | |
344 | data-length: 121344 (rust !) |
|
344 | data-length: 121344 (rust !) | |
345 | data-length: 121152 (no-rust no-pure !) |
|
345 | data-length: 121152 (no-rust no-pure !) | |
346 | data-unused: 192 (pure !) |
|
346 | data-unused: 192 (pure !) | |
347 | data-unused: 192 (rust !) |
|
347 | data-unused: 192 (rust !) | |
348 | data-unused: 0 (no-rust no-pure !) |
|
348 | data-unused: 0 (no-rust no-pure !) | |
349 | data-unused: 0.158% (pure !) |
|
349 | data-unused: 0.158% (pure !) | |
350 | data-unused: 0.158% (rust !) |
|
350 | data-unused: 0.158% (rust !) | |
351 | data-unused: 0.000% (no-rust no-pure !) |
|
351 | data-unused: 0.000% (no-rust no-pure !) | |
352 | $ cp -f ../tmp-copies/* .hg/store/ |
|
352 | $ cp -f ../tmp-copies/* .hg/store/ | |
353 | $ hg debugnodemap --metadata |
|
353 | $ hg debugnodemap --metadata | |
354 | uid: ???????? (glob) |
|
354 | uid: ???????? (glob) | |
355 | tip-rev: 5002 |
|
355 | tip-rev: 5002 | |
356 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
356 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
357 | data-length: 121088 |
|
357 | data-length: 121088 | |
358 | data-unused: 0 |
|
358 | data-unused: 0 | |
359 | data-unused: 0.000% |
|
359 | data-unused: 0.000% | |
360 | $ hg log -r "$NODE" -T '{rev}\n' |
|
360 | $ hg log -r "$NODE" -T '{rev}\n' | |
361 | 5003 |
|
361 | 5003 | |
362 |
|
362 | |||
363 | changelog altered |
|
363 | changelog altered | |
364 | ----------------- |
|
364 | ----------------- | |
365 |
|
365 | |||
366 | If the nodemap is not gated behind a requirements, an unaware client can alter |
|
366 | If the nodemap is not gated behind a requirements, an unaware client can alter | |
367 | the repository so the revlog used to generate the nodemap is not longer |
|
367 | the repository so the revlog used to generate the nodemap is not longer | |
368 | compatible with the persistent nodemap. We need to detect that. |
|
368 | compatible with the persistent nodemap. We need to detect that. | |
369 |
|
369 | |||
370 | $ hg up "$NODE~5" |
|
370 | $ hg up "$NODE~5" | |
371 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved |
|
371 | 0 files updated, 0 files merged, 4 files removed, 0 files unresolved | |
372 | $ echo bar > babar |
|
372 | $ echo bar > babar | |
373 | $ hg add babar |
|
373 | $ hg add babar | |
374 | $ hg ci -m 'babar' |
|
374 | $ hg ci -m 'babar' | |
375 | created new head |
|
375 | created new head | |
376 | $ OTHERNODE=`hg log -r tip -T '{node}\n'` |
|
376 | $ OTHERNODE=`hg log -r tip -T '{node}\n'` | |
377 | $ hg log -r "$OTHERNODE" -T '{rev}\n' |
|
377 | $ hg log -r "$OTHERNODE" -T '{rev}\n' | |
378 | 5004 |
|
378 | 5004 | |
379 |
|
379 | |||
380 | $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup |
|
380 | $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup | |
381 |
|
381 | |||
382 | the nodemap should detect the changelog have been tampered with and recover. |
|
382 | the nodemap should detect the changelog have been tampered with and recover. | |
383 |
|
383 | |||
384 | $ hg debugnodemap --metadata |
|
384 | $ hg debugnodemap --metadata | |
385 | uid: ???????? (glob) |
|
385 | uid: ???????? (glob) | |
386 | tip-rev: 5002 |
|
386 | tip-rev: 5002 | |
387 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 |
|
387 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 | |
388 | data-length: 121536 (pure !) |
|
388 | data-length: 121536 (pure !) | |
389 | data-length: 121088 (rust !) |
|
389 | data-length: 121088 (rust !) | |
390 | data-length: 121088 (no-pure no-rust !) |
|
390 | data-length: 121088 (no-pure no-rust !) | |
391 | data-unused: 448 (pure !) |
|
391 | data-unused: 448 (pure !) | |
392 | data-unused: 0 (rust !) |
|
392 | data-unused: 0 (rust !) | |
393 | data-unused: 0 (no-pure no-rust !) |
|
393 | data-unused: 0 (no-pure no-rust !) | |
394 | data-unused: 0.000% (rust !) |
|
394 | data-unused: 0.000% (rust !) | |
395 | data-unused: 0.369% (pure !) |
|
395 | data-unused: 0.369% (pure !) | |
396 | data-unused: 0.000% (no-pure no-rust !) |
|
396 | data-unused: 0.000% (no-pure no-rust !) | |
397 |
|
397 | |||
398 | $ cp -f ../tmp-copies/* .hg/store/ |
|
398 | $ cp -f ../tmp-copies/* .hg/store/ | |
399 | $ hg debugnodemap --metadata |
|
399 | $ hg debugnodemap --metadata | |
400 | uid: ???????? (glob) |
|
400 | uid: ???????? (glob) | |
401 | tip-rev: 5002 |
|
401 | tip-rev: 5002 | |
402 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd |
|
402 | tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd | |
403 | data-length: 121088 |
|
403 | data-length: 121088 | |
404 | data-unused: 0 |
|
404 | data-unused: 0 | |
405 | data-unused: 0.000% |
|
405 | data-unused: 0.000% | |
406 | $ hg log -r "$OTHERNODE" -T '{rev}\n' |
|
406 | $ hg log -r "$OTHERNODE" -T '{rev}\n' | |
407 | 5002 |
|
407 | 5002 | |
408 |
|
408 | |||
409 | missing data file |
|
409 | missing data file | |
410 | ----------------- |
|
410 | ----------------- | |
411 |
|
411 | |||
412 | $ UUID=`hg debugnodemap --metadata| grep 'uid:' | \ |
|
412 | $ UUID=`hg debugnodemap --metadata| grep 'uid:' | \ | |
413 | > sed 's/uid: //'` |
|
413 | > sed 's/uid: //'` | |
414 | $ FILE=.hg/store/00changelog-"${UUID}".nd |
|
414 | $ FILE=.hg/store/00changelog-"${UUID}".nd | |
415 | $ mv $FILE ../tmp-data-file |
|
415 | $ mv $FILE ../tmp-data-file | |
416 | $ cp .hg/store/00changelog.n ../tmp-docket |
|
416 | $ cp .hg/store/00changelog.n ../tmp-docket | |
417 |
|
417 | |||
418 | mercurial don't crash |
|
418 | mercurial don't crash | |
419 |
|
419 | |||
420 | $ hg log -r . |
|
420 | $ hg log -r . | |
421 | changeset: 5002:b355ef8adce0 |
|
421 | changeset: 5002:b355ef8adce0 | |
422 | tag: tip |
|
422 | tag: tip | |
423 | parent: 4998:d918ad6d18d3 |
|
423 | parent: 4998:d918ad6d18d3 | |
424 | user: test |
|
424 | user: test | |
425 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
425 | date: Thu Jan 01 00:00:00 1970 +0000 | |
426 | summary: babar |
|
426 | summary: babar | |
427 |
|
427 | |||
428 | $ hg debugnodemap --metadata |
|
428 | $ hg debugnodemap --metadata | |
429 |
|
429 | |||
430 | $ hg debugupdatecache |
|
430 | $ hg debugupdatecache | |
431 | $ hg debugnodemap --metadata |
|
431 | $ hg debugnodemap --metadata | |
432 | uid: * (glob) |
|
432 | uid: * (glob) | |
433 | tip-rev: 5002 |
|
433 | tip-rev: 5002 | |
434 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 |
|
434 | tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944 | |
435 | data-length: 121088 |
|
435 | data-length: 121088 | |
436 | data-unused: 0 |
|
436 | data-unused: 0 | |
437 | data-unused: 0.000% |
|
437 | data-unused: 0.000% | |
438 | $ mv ../tmp-data-file $FILE |
|
438 | $ mv ../tmp-data-file $FILE | |
439 | $ mv ../tmp-docket .hg/store/00changelog.n |
|
439 | $ mv ../tmp-docket .hg/store/00changelog.n | |
440 |
|
440 | |||
441 | Check transaction related property |
|
441 | Check transaction related property | |
442 | ================================== |
|
442 | ================================== | |
443 |
|
443 | |||
444 | An up to date nodemap should be available to shell hooks, |
|
444 | An up to date nodemap should be available to shell hooks, | |
445 |
|
445 | |||
446 | $ echo dsljfl > a |
|
446 | $ echo dsljfl > a | |
447 | $ hg add a |
|
447 | $ hg add a | |
448 | $ hg ci -m a |
|
448 | $ hg ci -m a | |
449 | $ hg debugnodemap --metadata |
|
449 | $ hg debugnodemap --metadata | |
450 | uid: ???????? (glob) |
|
450 | uid: ???????? (glob) | |
451 | tip-rev: 5003 |
|
451 | tip-rev: 5003 | |
452 | tip-node: a52c5079765b5865d97b993b303a18740113bbb2 |
|
452 | tip-node: a52c5079765b5865d97b993b303a18740113bbb2 | |
453 | data-length: 121088 |
|
453 | data-length: 121088 | |
454 | data-unused: 0 |
|
454 | data-unused: 0 | |
455 | data-unused: 0.000% |
|
455 | data-unused: 0.000% | |
456 | $ echo babar2 > babar |
|
456 | $ echo babar2 > babar | |
457 | $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata" |
|
457 | $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata" | |
458 | uid: ???????? (glob) |
|
458 | uid: ???????? (glob) | |
459 | tip-rev: 5004 |
|
459 | tip-rev: 5004 | |
460 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
460 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 | |
461 | data-length: 121280 (pure !) |
|
461 | data-length: 121280 (pure !) | |
462 | data-length: 121280 (rust !) |
|
462 | data-length: 121280 (rust !) | |
463 | data-length: 121088 (no-pure no-rust !) |
|
463 | data-length: 121088 (no-pure no-rust !) | |
464 | data-unused: 192 (pure !) |
|
464 | data-unused: 192 (pure !) | |
465 | data-unused: 192 (rust !) |
|
465 | data-unused: 192 (rust !) | |
466 | data-unused: 0 (no-pure no-rust !) |
|
466 | data-unused: 0 (no-pure no-rust !) | |
467 | data-unused: 0.158% (pure !) |
|
467 | data-unused: 0.158% (pure !) | |
468 | data-unused: 0.158% (rust !) |
|
468 | data-unused: 0.158% (rust !) | |
469 | data-unused: 0.000% (no-pure no-rust !) |
|
469 | data-unused: 0.000% (no-pure no-rust !) | |
470 | $ hg debugnodemap --metadata |
|
470 | $ hg debugnodemap --metadata | |
471 | uid: ???????? (glob) |
|
471 | uid: ???????? (glob) | |
472 | tip-rev: 5004 |
|
472 | tip-rev: 5004 | |
473 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
473 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 | |
474 | data-length: 121280 (pure !) |
|
474 | data-length: 121280 (pure !) | |
475 | data-length: 121280 (rust !) |
|
475 | data-length: 121280 (rust !) | |
476 | data-length: 121088 (no-pure no-rust !) |
|
476 | data-length: 121088 (no-pure no-rust !) | |
477 | data-unused: 192 (pure !) |
|
477 | data-unused: 192 (pure !) | |
478 | data-unused: 192 (rust !) |
|
478 | data-unused: 192 (rust !) | |
479 | data-unused: 0 (no-pure no-rust !) |
|
479 | data-unused: 0 (no-pure no-rust !) | |
480 | data-unused: 0.158% (pure !) |
|
480 | data-unused: 0.158% (pure !) | |
481 | data-unused: 0.158% (rust !) |
|
481 | data-unused: 0.158% (rust !) | |
482 | data-unused: 0.000% (no-pure no-rust !) |
|
482 | data-unused: 0.000% (no-pure no-rust !) | |
483 |
|
483 | |||
484 | Another process does not see the pending nodemap content during run. |
|
484 | Another process does not see the pending nodemap content during run. | |
485 |
|
485 | |||
486 | $ echo qpoasp > a |
|
486 | $ echo qpoasp > a | |
487 | $ hg ci -m a2 \ |
|
487 | $ hg ci -m a2 \ | |
488 | > --config "hooks.pretxnclose=sh \"$RUNTESTDIR/testlib/wait-on-file\" 20 sync-repo-read sync-txn-pending" \ |
|
488 | > --config "hooks.pretxnclose=sh \"$RUNTESTDIR/testlib/wait-on-file\" 20 sync-repo-read sync-txn-pending" \ | |
489 | > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 & |
|
489 | > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 & | |
490 |
|
490 | |||
491 | (read the repository while the commit transaction is pending) |
|
491 | (read the repository while the commit transaction is pending) | |
492 |
|
492 | |||
493 | $ sh "$RUNTESTDIR/testlib/wait-on-file" 20 sync-txn-pending && \ |
|
493 | $ sh "$RUNTESTDIR/testlib/wait-on-file" 20 sync-txn-pending && \ | |
494 | > hg debugnodemap --metadata && \ |
|
494 | > hg debugnodemap --metadata && \ | |
495 | > sh "$RUNTESTDIR/testlib/wait-on-file" 20 sync-txn-close sync-repo-read |
|
495 | > sh "$RUNTESTDIR/testlib/wait-on-file" 20 sync-txn-close sync-repo-read | |
496 | uid: ???????? (glob) |
|
496 | uid: ???????? (glob) | |
497 | tip-rev: 5004 |
|
497 | tip-rev: 5004 | |
498 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 |
|
498 | tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984 | |
499 | data-length: 121280 (pure !) |
|
499 | data-length: 121280 (pure !) | |
500 | data-length: 121280 (rust !) |
|
500 | data-length: 121280 (rust !) | |
501 | data-length: 121088 (no-pure no-rust !) |
|
501 | data-length: 121088 (no-pure no-rust !) | |
502 | data-unused: 192 (pure !) |
|
502 | data-unused: 192 (pure !) | |
503 | data-unused: 192 (rust !) |
|
503 | data-unused: 192 (rust !) | |
504 | data-unused: 0 (no-pure no-rust !) |
|
504 | data-unused: 0 (no-pure no-rust !) | |
505 | data-unused: 0.158% (pure !) |
|
505 | data-unused: 0.158% (pure !) | |
506 | data-unused: 0.158% (rust !) |
|
506 | data-unused: 0.158% (rust !) | |
507 | data-unused: 0.000% (no-pure no-rust !) |
|
507 | data-unused: 0.000% (no-pure no-rust !) | |
508 | $ hg debugnodemap --metadata |
|
508 | $ hg debugnodemap --metadata | |
509 | uid: ???????? (glob) |
|
509 | uid: ???????? (glob) | |
510 | tip-rev: 5005 |
|
510 | tip-rev: 5005 | |
511 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
511 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
512 | data-length: 121536 (pure !) |
|
512 | data-length: 121536 (pure !) | |
513 | data-length: 121536 (rust !) |
|
513 | data-length: 121536 (rust !) | |
514 | data-length: 121088 (no-pure no-rust !) |
|
514 | data-length: 121088 (no-pure no-rust !) | |
515 | data-unused: 448 (pure !) |
|
515 | data-unused: 448 (pure !) | |
516 | data-unused: 448 (rust !) |
|
516 | data-unused: 448 (rust !) | |
517 | data-unused: 0 (no-pure no-rust !) |
|
517 | data-unused: 0 (no-pure no-rust !) | |
518 | data-unused: 0.369% (pure !) |
|
518 | data-unused: 0.369% (pure !) | |
519 | data-unused: 0.369% (rust !) |
|
519 | data-unused: 0.369% (rust !) | |
520 | data-unused: 0.000% (no-pure no-rust !) |
|
520 | data-unused: 0.000% (no-pure no-rust !) | |
521 |
|
521 | |||
522 | $ cat output.txt |
|
522 | $ cat output.txt | |
523 |
|
523 | |||
524 | Check that a failing transaction will properly revert the data |
|
524 | Check that a failing transaction will properly revert the data | |
525 |
|
525 | |||
526 | $ echo plakfe > a |
|
526 | $ echo plakfe > a | |
527 | $ f --size --sha256 .hg/store/00changelog-*.nd |
|
527 | $ f --size --sha256 .hg/store/00changelog-*.nd | |
528 | .hg/store/00changelog-????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) |
|
528 | .hg/store/00changelog-????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) | |
529 | .hg/store/00changelog-????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) |
|
529 | .hg/store/00changelog-????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) | |
530 | .hg/store/00changelog-????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) |
|
530 | .hg/store/00changelog-????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) | |
531 | $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py" |
|
531 | $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py" | |
532 | transaction abort! |
|
532 | transaction abort! | |
533 | rollback completed |
|
533 | rollback completed | |
534 | abort: This is a late abort |
|
534 | abort: This is a late abort | |
535 | [255] |
|
535 | [255] | |
536 | $ hg debugnodemap --metadata |
|
536 | $ hg debugnodemap --metadata | |
537 | uid: ???????? (glob) |
|
537 | uid: ???????? (glob) | |
538 | tip-rev: 5005 |
|
538 | tip-rev: 5005 | |
539 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
539 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
540 | data-length: 121536 (pure !) |
|
540 | data-length: 121536 (pure !) | |
541 | data-length: 121536 (rust !) |
|
541 | data-length: 121536 (rust !) | |
542 | data-length: 121088 (no-pure no-rust !) |
|
542 | data-length: 121088 (no-pure no-rust !) | |
543 | data-unused: 448 (pure !) |
|
543 | data-unused: 448 (pure !) | |
544 | data-unused: 448 (rust !) |
|
544 | data-unused: 448 (rust !) | |
545 | data-unused: 0 (no-pure no-rust !) |
|
545 | data-unused: 0 (no-pure no-rust !) | |
546 | data-unused: 0.369% (pure !) |
|
546 | data-unused: 0.369% (pure !) | |
547 | data-unused: 0.369% (rust !) |
|
547 | data-unused: 0.369% (rust !) | |
548 | data-unused: 0.000% (no-pure no-rust !) |
|
548 | data-unused: 0.000% (no-pure no-rust !) | |
549 | $ f --size --sha256 .hg/store/00changelog-*.nd |
|
549 | $ f --size --sha256 .hg/store/00changelog-*.nd | |
550 | .hg/store/00changelog-????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) |
|
550 | .hg/store/00changelog-????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !) | |
551 | .hg/store/00changelog-????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) |
|
551 | .hg/store/00changelog-????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !) | |
552 | .hg/store/00changelog-????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) |
|
552 | .hg/store/00changelog-????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !) | |
553 |
|
553 | |||
554 | Check that removing content does not confuse the nodemap |
|
554 | Check that removing content does not confuse the nodemap | |
555 | -------------------------------------------------------- |
|
555 | -------------------------------------------------------- | |
556 |
|
556 | |||
557 | removing data with rollback |
|
557 | removing data with rollback | |
558 |
|
558 | |||
559 | $ echo aso > a |
|
559 | $ echo aso > a | |
560 | $ hg ci -m a4 |
|
560 | $ hg ci -m a4 | |
561 | $ hg rollback |
|
561 | $ hg rollback | |
562 | repository tip rolled back to revision 5005 (undo commit) |
|
562 | repository tip rolled back to revision 5005 (undo commit) | |
563 | working directory now based on revision 5005 |
|
563 | working directory now based on revision 5005 | |
564 | $ hg id -r . |
|
564 | $ hg id -r . | |
565 | 90d5d3ba2fc4 tip |
|
565 | 90d5d3ba2fc4 tip | |
566 |
|
566 | |||
567 | removing data with strip |
|
567 | removing data with strip | |
568 |
|
568 | |||
569 | $ echo aso > a |
|
569 | $ echo aso > a | |
570 | $ hg ci -m a4 |
|
570 | $ hg ci -m a4 | |
571 | $ hg --config extensions.strip= strip -r . --no-backup |
|
571 | $ hg --config extensions.strip= strip -r . --no-backup | |
572 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
572 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
573 | $ hg id -r . --traceback |
|
573 | $ hg id -r . --traceback | |
574 | 90d5d3ba2fc4 tip |
|
574 | 90d5d3ba2fc4 tip | |
575 |
|
575 | |||
576 | (be a good citizen and regenerate the nodemap) |
|
576 | (be a good citizen and regenerate the nodemap) | |
577 | $ hg debugupdatecaches |
|
577 | $ hg debugupdatecaches | |
578 | $ hg debugnodemap --metadata |
|
578 | $ hg debugnodemap --metadata | |
579 | uid: * (glob) |
|
579 | uid: * (glob) | |
580 | tip-rev: 5005 |
|
580 | tip-rev: 5005 | |
581 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
581 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
582 | data-length: 121088 |
|
582 | data-length: 121088 | |
583 | data-unused: 0 |
|
583 | data-unused: 0 | |
584 | data-unused: 0.000% |
|
584 | data-unused: 0.000% | |
585 |
|
585 | |||
586 | Check race condition when multiple process write new data to the repository |
|
586 | Check race condition when multiple process write new data to the repository | |
587 | --------------------------------------------------------------------------- |
|
587 | --------------------------------------------------------------------------- | |
588 |
|
588 | |||
589 | In this test, we check that two writers touching the repositories will not |
|
589 | In this test, we check that two writers touching the repositories will not | |
590 | overwrite each other data. This test is prompted by the existent of issue6554. |
|
590 | overwrite each other data. This test is prompted by the existent of issue6554. | |
591 | Where a writer ended up using and outdated docket to update the repository. See |
|
591 | Where a writer ended up using and outdated docket to update the repository. See | |
592 | the dedicated extension for details on the race windows and read/write schedule |
|
592 | the dedicated extension for details on the race windows and read/write schedule | |
593 | necessary to end up in this situation: testlib/persistent-nodemap-race-ext.py |
|
593 | necessary to end up in this situation: testlib/persistent-nodemap-race-ext.py | |
594 |
|
594 | |||
595 | The issue was initially observed on a server with a high push trafic, but it |
|
595 | The issue was initially observed on a server with a high push trafic, but it | |
596 | can be reproduced using a share and two commiting process which seems simpler. |
|
596 | can be reproduced using a share and two commiting process which seems simpler. | |
597 |
|
597 | |||
598 | The test is Rust only as the other implementation does not use the same |
|
598 | The test is Rust only as the other implementation does not use the same | |
599 | read/write patterns. |
|
599 | read/write patterns. | |
600 |
|
600 | |||
601 | $ cd .. |
|
601 | $ cd .. | |
602 |
|
602 | |||
603 | #if rust |
|
603 | #if rust | |
604 |
|
604 | |||
605 | $ cp -R test-repo race-repo |
|
605 | $ cp -R test-repo race-repo | |
606 | $ hg share race-repo ./other-wc --config format.use-share-safe=yes |
|
606 | $ hg share race-repo ./other-wc --config format.use-share-safe=yes | |
607 | updating working directory |
|
607 | updating working directory | |
608 | 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
608 | 5001 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
609 | $ hg debugformat -R ./race-repo | egrep 'share-safe|persistent-nodemap' |
|
609 | $ hg debugformat -R ./race-repo | egrep 'share-safe|persistent-nodemap' | |
610 | share-safe: yes |
|
610 | share-safe: yes | |
611 | persistent-nodemap: yes |
|
611 | persistent-nodemap: yes | |
612 | $ hg debugformat -R ./other-wc/ | egrep 'share-safe|persistent-nodemap' |
|
612 | $ hg debugformat -R ./other-wc/ | egrep 'share-safe|persistent-nodemap' | |
613 | share-safe: yes |
|
613 | share-safe: yes | |
614 | persistent-nodemap: yes |
|
614 | persistent-nodemap: yes | |
615 | $ hg -R ./other-wc update 'min(head())' |
|
615 | $ hg -R ./other-wc update 'min(head())' | |
616 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
616 | 3 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
617 | $ hg -R ./race-repo debugnodemap --metadata |
|
617 | $ hg -R ./race-repo debugnodemap --metadata | |
618 | uid: 43c37dde |
|
618 | uid: 43c37dde | |
619 | tip-rev: 5005 |
|
619 | tip-rev: 5005 | |
620 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
620 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
621 | data-length: 121088 |
|
621 | data-length: 121088 | |
622 | data-unused: 0 |
|
622 | data-unused: 0 | |
623 | data-unused: 0.000% |
|
623 | data-unused: 0.000% | |
624 | $ hg -R ./race-repo log -G -r 'head()' |
|
624 | $ hg -R ./race-repo log -G -r 'head()' | |
625 | @ changeset: 5005:90d5d3ba2fc4 |
|
625 | @ changeset: 5005:90d5d3ba2fc4 | |
626 | | tag: tip |
|
626 | | tag: tip | |
627 | ~ user: test |
|
627 | ~ user: test | |
628 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
628 | date: Thu Jan 01 00:00:00 1970 +0000 | |
629 | summary: a2 |
|
629 | summary: a2 | |
630 |
|
630 | |||
631 | o changeset: 5001:16395c3cf7e2 |
|
631 | o changeset: 5001:16395c3cf7e2 | |
632 | | user: test |
|
632 | | user: test | |
633 | ~ date: Thu Jan 01 00:00:00 1970 +0000 |
|
633 | ~ date: Thu Jan 01 00:00:00 1970 +0000 | |
634 | summary: foo |
|
634 | summary: foo | |
635 |
|
635 | |||
636 | $ hg -R ./other-wc log -G -r 'head()' |
|
636 | $ hg -R ./other-wc log -G -r 'head()' | |
637 | o changeset: 5005:90d5d3ba2fc4 |
|
637 | o changeset: 5005:90d5d3ba2fc4 | |
638 | | tag: tip |
|
638 | | tag: tip | |
639 | ~ user: test |
|
639 | ~ user: test | |
640 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
640 | date: Thu Jan 01 00:00:00 1970 +0000 | |
641 | summary: a2 |
|
641 | summary: a2 | |
642 |
|
642 | |||
643 | @ changeset: 5001:16395c3cf7e2 |
|
643 | @ changeset: 5001:16395c3cf7e2 | |
644 | | user: test |
|
644 | | user: test | |
645 | ~ date: Thu Jan 01 00:00:00 1970 +0000 |
|
645 | ~ date: Thu Jan 01 00:00:00 1970 +0000 | |
646 | summary: foo |
|
646 | summary: foo | |
647 |
|
647 | |||
648 | $ echo left-side-race > race-repo/left-side-race |
|
648 | $ echo left-side-race > race-repo/left-side-race | |
649 | $ hg -R ./race-repo/ add race-repo/left-side-race |
|
649 | $ hg -R ./race-repo/ add race-repo/left-side-race | |
650 |
|
650 | |||
651 | $ echo right-side-race > ./other-wc/right-side-race |
|
651 | $ echo right-side-race > ./other-wc/right-side-race | |
652 | $ hg -R ./other-wc/ add ./other-wc/right-side-race |
|
652 | $ hg -R ./other-wc/ add ./other-wc/right-side-race | |
653 |
|
653 | |||
654 | $ mkdir sync-files |
|
654 | $ mkdir sync-files | |
655 | $ mkdir outputs |
|
655 | $ mkdir outputs | |
656 | $ ( |
|
656 | $ ( | |
657 | > hg -R ./race-repo/ commit -m left-side-commit \ |
|
657 | > hg -R ./race-repo/ commit -m left-side-commit \ | |
658 | > --config "extensions.race=${RUNTESTDIR}/testlib/persistent-nodemap-race-ext.py" \ |
|
658 | > --config "extensions.race=${RUNTESTDIR}/testlib/persistent-nodemap-race-ext.py" \ | |
659 | > --config 'devel.nodemap-race.role=left'; |
|
659 | > --config 'devel.nodemap-race.role=left'; | |
660 | > touch sync-files/left-done |
|
660 | > touch sync-files/left-done | |
661 | > ) > outputs/left.txt 2>&1 & |
|
661 | > ) > outputs/left.txt 2>&1 & | |
662 | $ ( |
|
662 | $ ( | |
663 | > hg -R ./other-wc/ commit -m right-side-commit \ |
|
663 | > hg -R ./other-wc/ commit -m right-side-commit \ | |
664 | > --config "extensions.race=${RUNTESTDIR}/testlib/persistent-nodemap-race-ext.py" \ |
|
664 | > --config "extensions.race=${RUNTESTDIR}/testlib/persistent-nodemap-race-ext.py" \ | |
665 | > --config 'devel.nodemap-race.role=right'; |
|
665 | > --config 'devel.nodemap-race.role=right'; | |
666 | > touch sync-files/right-done |
|
666 | > touch sync-files/right-done | |
667 | > ) > outputs/right.txt 2>&1 & |
|
667 | > ) > outputs/right.txt 2>&1 & | |
668 | $ ( |
|
668 | $ ( | |
669 | > hg -R ./race-repo/ check-nodemap-race \ |
|
669 | > hg -R ./race-repo/ check-nodemap-race \ | |
670 | > --config "extensions.race=${RUNTESTDIR}/testlib/persistent-nodemap-race-ext.py" \ |
|
670 | > --config "extensions.race=${RUNTESTDIR}/testlib/persistent-nodemap-race-ext.py" \ | |
671 | > --config 'devel.nodemap-race.role=reader'; |
|
671 | > --config 'devel.nodemap-race.role=reader'; | |
672 | > touch sync-files/reader-done |
|
672 | > touch sync-files/reader-done | |
673 | > ) > outputs/reader.txt 2>&1 & |
|
673 | > ) > outputs/reader.txt 2>&1 & | |
674 | $ sh "$RUNTESTDIR"/testlib/wait-on-file 10 sync-files/left-done |
|
674 | $ sh "$RUNTESTDIR"/testlib/wait-on-file 10 sync-files/left-done | |
675 | $ cat outputs/left.txt |
|
675 | $ cat outputs/left.txt | |
676 | docket-details: |
|
676 | docket-details: | |
677 | uid: 43c37dde |
|
677 | uid: 43c37dde | |
678 | actual-tip: 5005 |
|
678 | actual-tip: 5005 | |
679 | tip-rev: 5005 |
|
679 | tip-rev: 5005 | |
680 | data-length: 121088 |
|
680 | data-length: 121088 | |
681 | nodemap-race: left side locked and ready to commit |
|
681 | nodemap-race: left side locked and ready to commit | |
682 | docket-details: |
|
682 | docket-details: | |
683 | uid: 43c37dde |
|
683 | uid: 43c37dde | |
684 | actual-tip: 5005 |
|
684 | actual-tip: 5005 | |
685 | tip-rev: 5005 |
|
685 | tip-rev: 5005 | |
686 | data-length: 121088 |
|
686 | data-length: 121088 | |
687 | finalized changelog write |
|
687 | finalized changelog write | |
688 | persisting changelog nodemap |
|
688 | persisting changelog nodemap | |
689 | new data start at 121088 |
|
689 | new data start at 121088 | |
690 | persisted changelog nodemap |
|
690 | persisted changelog nodemap | |
691 | docket-details: |
|
691 | docket-details: | |
692 | uid: 43c37dde |
|
692 | uid: 43c37dde | |
693 | actual-tip: 5006 |
|
693 | actual-tip: 5006 | |
694 | tip-rev: 5006 |
|
694 | tip-rev: 5006 | |
695 | data-length: 121280 |
|
695 | data-length: 121280 | |
696 | $ sh "$RUNTESTDIR"/testlib/wait-on-file 10 sync-files/right-done |
|
696 | $ sh "$RUNTESTDIR"/testlib/wait-on-file 10 sync-files/right-done | |
697 | $ cat outputs/right.txt |
|
697 | $ cat outputs/right.txt | |
698 | nodemap-race: right side start of the locking sequence |
|
698 | nodemap-race: right side start of the locking sequence | |
699 | nodemap-race: right side reading changelog |
|
699 | nodemap-race: right side reading changelog | |
700 | nodemap-race: right side reading of changelog is done |
|
700 | nodemap-race: right side reading of changelog is done | |
701 | docket-details: |
|
701 | docket-details: | |
702 | uid: 43c37dde |
|
702 | uid: 43c37dde | |
703 | actual-tip: 5006 |
|
703 | actual-tip: 5006 | |
704 | tip-rev: 5005 |
|
704 | tip-rev: 5005 | |
705 | data-length: 121088 |
|
705 | data-length: 121088 | |
706 | nodemap-race: right side ready to wait for the lock |
|
706 | nodemap-race: right side ready to wait for the lock | |
707 | nodemap-race: right side locked and ready to commit |
|
707 | nodemap-race: right side locked and ready to commit | |
708 | docket-details: |
|
708 | docket-details: | |
709 | uid: 43c37dde |
|
709 | uid: 43c37dde | |
710 | actual-tip: 5006 |
|
710 | actual-tip: 5006 | |
711 | tip-rev: 5006 |
|
711 | tip-rev: 5006 | |
712 | data-length: 121280 |
|
712 | data-length: 121280 | |
713 | right ready to write, waiting for reader |
|
713 | right ready to write, waiting for reader | |
714 | right proceeding with writing its changelog index and nodemap |
|
714 | right proceeding with writing its changelog index and nodemap | |
715 | finalized changelog write |
|
715 | finalized changelog write | |
716 | persisting changelog nodemap |
|
716 | persisting changelog nodemap | |
717 | new data start at 121280 |
|
717 | new data start at 121280 | |
718 | persisted changelog nodemap |
|
718 | persisted changelog nodemap | |
719 | docket-details: |
|
719 | docket-details: | |
720 | uid: 43c37dde |
|
720 | uid: 43c37dde | |
721 | actual-tip: 5007 |
|
721 | actual-tip: 5007 | |
722 | tip-rev: 5007 |
|
722 | tip-rev: 5007 | |
723 | data-length: 121536 |
|
723 | data-length: 121536 | |
724 | $ sh "$RUNTESTDIR"/testlib/wait-on-file 10 sync-files/reader-done |
|
724 | $ sh "$RUNTESTDIR"/testlib/wait-on-file 10 sync-files/reader-done | |
725 | $ cat outputs/reader.txt |
|
725 | $ cat outputs/reader.txt | |
726 | reader: reading changelog |
|
726 | reader: reading changelog | |
727 | reader ready to read the changelog, waiting for right |
|
727 | reader ready to read the changelog, waiting for right | |
728 | reader: nodemap docket read |
|
728 | reader: nodemap docket read | |
729 | record-data-length: 121280 |
|
729 | record-data-length: 121280 | |
730 | actual-data-length: 121280 |
|
730 | actual-data-length: 121280 | |
731 | file-actual-length: 121536 |
|
731 | file-actual-length: 121536 | |
732 | reader: changelog read |
|
732 | reader: changelog read | |
733 | docket-details: |
|
733 | docket-details: | |
734 | uid: 43c37dde |
|
734 | uid: 43c37dde | |
735 | actual-tip: 5006 |
|
735 | actual-tip: 5006 | |
736 | tip-rev: 5006 |
|
736 | tip-rev: 5006 | |
737 | data-length: 121280 |
|
737 | data-length: 121280 | |
738 | tip-rev: 5006 |
|
738 | tip-rev: 5006 | |
739 | tip-node: 492901161367 |
|
739 | tip-node: 492901161367 | |
740 | node-rev: 5006 |
|
740 | node-rev: 5006 | |
741 |
|
741 | |||
742 | $ hg -R ./race-repo log -G -r 'head()' |
|
742 | $ hg -R ./race-repo log -G -r 'head()' | |
743 | o changeset: 5007:ac4a2abde241 |
|
743 | o changeset: 5007:ac4a2abde241 | |
744 | | tag: tip |
|
744 | | tag: tip | |
745 | ~ parent: 5001:16395c3cf7e2 |
|
745 | ~ parent: 5001:16395c3cf7e2 | |
746 | user: test |
|
746 | user: test | |
747 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
747 | date: Thu Jan 01 00:00:00 1970 +0000 | |
748 | summary: right-side-commit |
|
748 | summary: right-side-commit | |
749 |
|
749 | |||
750 | @ changeset: 5006:492901161367 |
|
750 | @ changeset: 5006:492901161367 | |
751 | | user: test |
|
751 | | user: test | |
752 | ~ date: Thu Jan 01 00:00:00 1970 +0000 |
|
752 | ~ date: Thu Jan 01 00:00:00 1970 +0000 | |
753 | summary: left-side-commit |
|
753 | summary: left-side-commit | |
754 |
|
754 | |||
755 | $ hg -R ./other-wc log -G -r 'head()' |
|
755 | $ hg -R ./other-wc log -G -r 'head()' | |
756 | @ changeset: 5007:ac4a2abde241 |
|
756 | @ changeset: 5007:ac4a2abde241 | |
757 | | tag: tip |
|
757 | | tag: tip | |
758 | ~ parent: 5001:16395c3cf7e2 |
|
758 | ~ parent: 5001:16395c3cf7e2 | |
759 | user: test |
|
759 | user: test | |
760 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
760 | date: Thu Jan 01 00:00:00 1970 +0000 | |
761 | summary: right-side-commit |
|
761 | summary: right-side-commit | |
762 |
|
762 | |||
763 | o changeset: 5006:492901161367 |
|
763 | o changeset: 5006:492901161367 | |
764 | | user: test |
|
764 | | user: test | |
765 | ~ date: Thu Jan 01 00:00:00 1970 +0000 |
|
765 | ~ date: Thu Jan 01 00:00:00 1970 +0000 | |
766 | summary: left-side-commit |
|
766 | summary: left-side-commit | |
767 |
|
767 | |||
768 | #endif |
|
768 | #endif | |
769 |
|
769 | |||
770 | Test upgrade / downgrade |
|
770 | Test upgrade / downgrade | |
771 | ======================== |
|
771 | ======================== | |
772 |
|
772 | |||
773 | $ cd ./test-repo/ |
|
773 | $ cd ./test-repo/ | |
774 |
|
774 | |||
775 | downgrading |
|
775 | downgrading | |
776 |
|
776 | |||
777 | $ cat << EOF >> .hg/hgrc |
|
777 | $ cat << EOF >> .hg/hgrc | |
778 | > [format] |
|
778 | > [format] | |
779 | > use-persistent-nodemap=no |
|
779 | > use-persistent-nodemap=no | |
780 | > EOF |
|
780 | > EOF | |
781 | $ hg debugformat -v |
|
781 | $ hg debugformat -v | |
782 | format-variant repo config default |
|
782 | format-variant repo config default | |
783 | fncache: yes yes yes |
|
783 | fncache: yes yes yes | |
784 | dirstate-v2: no no no |
|
784 | dirstate-v2: no no no | |
785 | dotencode: yes yes yes |
|
785 | dotencode: yes yes yes | |
786 | generaldelta: yes yes yes |
|
786 | generaldelta: yes yes yes | |
787 | share-safe: yes yes no |
|
787 | share-safe: yes yes no | |
788 | sparserevlog: yes yes yes |
|
788 | sparserevlog: yes yes yes | |
789 | persistent-nodemap: yes no no |
|
789 | persistent-nodemap: yes no no | |
790 | copies-sdc: no no no |
|
790 | copies-sdc: no no no | |
791 | revlog-v2: no no no |
|
791 | revlog-v2: no no no | |
792 | changelog-v2: no no no |
|
792 | changelog-v2: no no no | |
793 | plain-cl-delta: yes yes yes |
|
793 | plain-cl-delta: yes yes yes | |
794 | compression: zlib zlib zlib (no-zstd !) |
|
794 | compression: zlib zlib zlib (no-zstd !) | |
795 | compression: zstd zstd zstd (zstd !) |
|
795 | compression: zstd zstd zstd (zstd !) | |
796 | compression-level: default default default |
|
796 | compression-level: default default default | |
797 | $ hg debugupgraderepo --run --no-backup --quiet |
|
797 | $ hg debugupgraderepo --run --no-backup --quiet | |
798 | upgrade will perform the following actions: |
|
798 | upgrade will perform the following actions: | |
799 |
|
799 | |||
800 | requirements |
|
800 | requirements | |
801 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !) |
|
801 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !) | |
802 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !) |
|
802 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !) | |
803 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !) |
|
803 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !) | |
804 | removed: persistent-nodemap |
|
804 | removed: persistent-nodemap | |
805 |
|
805 | |||
806 | processed revlogs: |
|
806 | processed revlogs: | |
807 | - all-filelogs |
|
807 | - all-filelogs | |
808 | - changelog |
|
808 | - changelog | |
809 | - manifest |
|
809 | - manifest | |
810 |
|
810 | |||
811 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
811 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
812 | 00changelog-*.nd (glob) |
|
812 | 00changelog-*.nd (glob) | |
813 | 00manifest-*.nd (glob) |
|
813 | 00manifest-*.nd (glob) | |
814 | undo.backup.00changelog.n |
|
814 | undo.backup.00changelog.n | |
815 | undo.backup.00manifest.n |
|
815 | undo.backup.00manifest.n | |
816 | $ hg debugnodemap --metadata |
|
816 | $ hg debugnodemap --metadata | |
817 |
|
817 | |||
818 |
|
818 | |||
819 | upgrading |
|
819 | upgrading | |
820 |
|
820 | |||
821 | $ cat << EOF >> .hg/hgrc |
|
821 | $ cat << EOF >> .hg/hgrc | |
822 | > [format] |
|
822 | > [format] | |
823 | > use-persistent-nodemap=yes |
|
823 | > use-persistent-nodemap=yes | |
824 | > EOF |
|
824 | > EOF | |
825 | $ hg debugformat -v |
|
825 | $ hg debugformat -v | |
826 | format-variant repo config default |
|
826 | format-variant repo config default | |
827 | fncache: yes yes yes |
|
827 | fncache: yes yes yes | |
828 | dirstate-v2: no no no |
|
828 | dirstate-v2: no no no | |
829 | dotencode: yes yes yes |
|
829 | dotencode: yes yes yes | |
830 | generaldelta: yes yes yes |
|
830 | generaldelta: yes yes yes | |
831 | share-safe: yes yes no |
|
831 | share-safe: yes yes no | |
832 | sparserevlog: yes yes yes |
|
832 | sparserevlog: yes yes yes | |
833 | persistent-nodemap: no yes no |
|
833 | persistent-nodemap: no yes no | |
834 | copies-sdc: no no no |
|
834 | copies-sdc: no no no | |
835 | revlog-v2: no no no |
|
835 | revlog-v2: no no no | |
836 | changelog-v2: no no no |
|
836 | changelog-v2: no no no | |
837 | plain-cl-delta: yes yes yes |
|
837 | plain-cl-delta: yes yes yes | |
838 | compression: zlib zlib zlib (no-zstd !) |
|
838 | compression: zlib zlib zlib (no-zstd !) | |
839 | compression: zstd zstd zstd (zstd !) |
|
839 | compression: zstd zstd zstd (zstd !) | |
840 | compression-level: default default default |
|
840 | compression-level: default default default | |
841 | $ hg debugupgraderepo --run --no-backup --quiet |
|
841 | $ hg debugupgraderepo --run --no-backup --quiet | |
842 | upgrade will perform the following actions: |
|
842 | upgrade will perform the following actions: | |
843 |
|
843 | |||
844 | requirements |
|
844 | requirements | |
845 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !) |
|
845 | preserved: dotencode, fncache, generaldelta, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !) | |
846 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !) |
|
846 | preserved: dotencode, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !) | |
847 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !) |
|
847 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !) | |
848 | added: persistent-nodemap |
|
848 | added: persistent-nodemap | |
849 |
|
849 | |||
850 | processed revlogs: |
|
850 | processed revlogs: | |
851 | - all-filelogs |
|
851 | - all-filelogs | |
852 | - changelog |
|
852 | - changelog | |
853 | - manifest |
|
853 | - manifest | |
854 |
|
854 | |||
855 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
855 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
856 | 00changelog-*.nd (glob) |
|
856 | 00changelog-*.nd (glob) | |
857 | 00changelog.n |
|
857 | 00changelog.n | |
858 | 00manifest-*.nd (glob) |
|
858 | 00manifest-*.nd (glob) | |
859 | 00manifest.n |
|
859 | 00manifest.n | |
860 | undo.backup.00changelog.n |
|
860 | undo.backup.00changelog.n | |
861 | undo.backup.00manifest.n |
|
861 | undo.backup.00manifest.n | |
862 |
|
862 | |||
863 | $ hg debugnodemap --metadata |
|
863 | $ hg debugnodemap --metadata | |
864 | uid: * (glob) |
|
864 | uid: * (glob) | |
865 | tip-rev: 5005 |
|
865 | tip-rev: 5005 | |
866 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
866 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
867 | data-length: 121088 |
|
867 | data-length: 121088 | |
868 | data-unused: 0 |
|
868 | data-unused: 0 | |
869 | data-unused: 0.000% |
|
869 | data-unused: 0.000% | |
870 |
|
870 | |||
871 | Running unrelated upgrade |
|
871 | Running unrelated upgrade | |
872 |
|
872 | |||
873 | $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all |
|
873 | $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all | |
874 | upgrade will perform the following actions: |
|
874 | upgrade will perform the following actions: | |
875 |
|
875 | |||
876 | requirements |
|
876 | requirements | |
877 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !) |
|
877 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, share-safe, sparserevlog, store (no-zstd no-dirstate-v2 !) | |
878 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !) |
|
878 | preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd no-dirstate-v2 !) | |
879 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !) |
|
879 | preserved: dotencode, exp-rc-dirstate-v2, fncache, generaldelta, persistent-nodemap, revlog-compression-zstd, revlogv1, share-safe, sparserevlog, store (zstd dirstate-v2 !) | |
880 |
|
880 | |||
881 | optimisations: re-delta-all |
|
881 | optimisations: re-delta-all | |
882 |
|
882 | |||
883 | processed revlogs: |
|
883 | processed revlogs: | |
884 | - all-filelogs |
|
884 | - all-filelogs | |
885 | - changelog |
|
885 | - changelog | |
886 | - manifest |
|
886 | - manifest | |
887 |
|
887 | |||
888 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
888 | $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
889 | 00changelog-*.nd (glob) |
|
889 | 00changelog-*.nd (glob) | |
890 | 00changelog.n |
|
890 | 00changelog.n | |
891 | 00manifest-*.nd (glob) |
|
891 | 00manifest-*.nd (glob) | |
892 | 00manifest.n |
|
892 | 00manifest.n | |
893 |
|
893 | |||
894 | $ hg debugnodemap --metadata |
|
894 | $ hg debugnodemap --metadata | |
895 | uid: * (glob) |
|
895 | uid: * (glob) | |
896 | tip-rev: 5005 |
|
896 | tip-rev: 5005 | |
897 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
897 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
898 | data-length: 121088 |
|
898 | data-length: 121088 | |
899 | data-unused: 0 |
|
899 | data-unused: 0 | |
900 | data-unused: 0.000% |
|
900 | data-unused: 0.000% | |
901 |
|
901 | |||
902 | Persistent nodemap and local/streaming clone |
|
902 | Persistent nodemap and local/streaming clone | |
903 | ============================================ |
|
903 | ============================================ | |
904 |
|
904 | |||
905 | $ cd .. |
|
905 | $ cd .. | |
906 |
|
906 | |||
907 | standard clone |
|
907 | standard clone | |
908 | -------------- |
|
908 | -------------- | |
909 |
|
909 | |||
910 | The persistent nodemap should exist after a streaming clone |
|
910 | The persistent nodemap should exist after a streaming clone | |
911 |
|
911 | |||
912 | $ hg clone --pull --quiet -U test-repo standard-clone |
|
912 | $ hg clone --pull --quiet -U test-repo standard-clone | |
913 | $ ls -1 standard-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
913 | $ ls -1 standard-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
914 | 00changelog-*.nd (glob) |
|
914 | 00changelog-*.nd (glob) | |
915 | 00changelog.n |
|
915 | 00changelog.n | |
916 | 00manifest-*.nd (glob) |
|
916 | 00manifest-*.nd (glob) | |
917 | 00manifest.n |
|
917 | 00manifest.n | |
918 | $ hg -R standard-clone debugnodemap --metadata |
|
918 | $ hg -R standard-clone debugnodemap --metadata | |
919 | uid: * (glob) |
|
919 | uid: * (glob) | |
920 | tip-rev: 5005 |
|
920 | tip-rev: 5005 | |
921 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
921 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
922 | data-length: 121088 |
|
922 | data-length: 121088 | |
923 | data-unused: 0 |
|
923 | data-unused: 0 | |
924 | data-unused: 0.000% |
|
924 | data-unused: 0.000% | |
925 |
|
925 | |||
926 |
|
926 | |||
927 | local clone |
|
927 | local clone | |
928 | ------------ |
|
928 | ------------ | |
929 |
|
929 | |||
930 | The persistent nodemap should exist after a streaming clone |
|
930 | The persistent nodemap should exist after a streaming clone | |
931 |
|
931 | |||
932 | $ hg clone -U test-repo local-clone |
|
932 | $ hg clone -U test-repo local-clone | |
933 | $ ls -1 local-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
933 | $ ls -1 local-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
934 | 00changelog-*.nd (glob) |
|
934 | 00changelog-*.nd (glob) | |
935 | 00changelog.n |
|
935 | 00changelog.n | |
936 | 00manifest-*.nd (glob) |
|
936 | 00manifest-*.nd (glob) | |
937 | 00manifest.n |
|
937 | 00manifest.n | |
938 | $ hg -R local-clone debugnodemap --metadata |
|
938 | $ hg -R local-clone debugnodemap --metadata | |
939 | uid: * (glob) |
|
939 | uid: * (glob) | |
940 | tip-rev: 5005 |
|
940 | tip-rev: 5005 | |
941 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
941 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
942 | data-length: 121088 |
|
942 | data-length: 121088 | |
943 | data-unused: 0 |
|
943 | data-unused: 0 | |
944 | data-unused: 0.000% |
|
944 | data-unused: 0.000% | |
945 |
|
945 | |||
946 | Test various corruption case |
|
946 | Test various corruption case | |
947 | ============================ |
|
947 | ============================ | |
948 |
|
948 | |||
949 | Missing datafile |
|
949 | Missing datafile | |
950 | ---------------- |
|
950 | ---------------- | |
951 |
|
951 | |||
952 | Test behavior with a missing datafile |
|
952 | Test behavior with a missing datafile | |
953 |
|
953 | |||
954 | $ hg clone --quiet --pull test-repo corruption-test-repo |
|
954 | $ hg clone --quiet --pull test-repo corruption-test-repo | |
955 | $ ls -1 corruption-test-repo/.hg/store/00changelog* |
|
955 | $ ls -1 corruption-test-repo/.hg/store/00changelog* | |
956 | corruption-test-repo/.hg/store/00changelog-*.nd (glob) |
|
956 | corruption-test-repo/.hg/store/00changelog-*.nd (glob) | |
957 | corruption-test-repo/.hg/store/00changelog.d |
|
957 | corruption-test-repo/.hg/store/00changelog.d | |
958 | corruption-test-repo/.hg/store/00changelog.i |
|
958 | corruption-test-repo/.hg/store/00changelog.i | |
959 | corruption-test-repo/.hg/store/00changelog.n |
|
959 | corruption-test-repo/.hg/store/00changelog.n | |
960 | $ rm corruption-test-repo/.hg/store/00changelog*.nd |
|
960 | $ rm corruption-test-repo/.hg/store/00changelog*.nd | |
961 | $ hg log -R corruption-test-repo -r . |
|
961 | $ hg log -R corruption-test-repo -r . | |
962 | changeset: 5005:90d5d3ba2fc4 |
|
962 | changeset: 5005:90d5d3ba2fc4 | |
963 | tag: tip |
|
963 | tag: tip | |
964 | user: test |
|
964 | user: test | |
965 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
965 | date: Thu Jan 01 00:00:00 1970 +0000 | |
966 | summary: a2 |
|
966 | summary: a2 | |
967 |
|
967 | |||
968 | $ ls -1 corruption-test-repo/.hg/store/00changelog* |
|
968 | $ ls -1 corruption-test-repo/.hg/store/00changelog* | |
969 | corruption-test-repo/.hg/store/00changelog.d |
|
969 | corruption-test-repo/.hg/store/00changelog.d | |
970 | corruption-test-repo/.hg/store/00changelog.i |
|
970 | corruption-test-repo/.hg/store/00changelog.i | |
971 | corruption-test-repo/.hg/store/00changelog.n |
|
971 | corruption-test-repo/.hg/store/00changelog.n | |
972 |
|
972 | |||
973 | Truncated data file |
|
973 | Truncated data file | |
974 | ------------------- |
|
974 | ------------------- | |
975 |
|
975 | |||
976 | Test behavior with a too short datafile |
|
976 | Test behavior with a too short datafile | |
977 |
|
977 | |||
978 | rebuild the missing data |
|
978 | rebuild the missing data | |
979 | $ hg -R corruption-test-repo debugupdatecache |
|
979 | $ hg -R corruption-test-repo debugupdatecache | |
980 | $ ls -1 corruption-test-repo/.hg/store/00changelog* |
|
980 | $ ls -1 corruption-test-repo/.hg/store/00changelog* | |
981 | corruption-test-repo/.hg/store/00changelog-*.nd (glob) |
|
981 | corruption-test-repo/.hg/store/00changelog-*.nd (glob) | |
982 | corruption-test-repo/.hg/store/00changelog.d |
|
982 | corruption-test-repo/.hg/store/00changelog.d | |
983 | corruption-test-repo/.hg/store/00changelog.i |
|
983 | corruption-test-repo/.hg/store/00changelog.i | |
984 | corruption-test-repo/.hg/store/00changelog.n |
|
984 | corruption-test-repo/.hg/store/00changelog.n | |
985 |
|
985 | |||
986 | truncate the file |
|
986 | truncate the file | |
987 |
|
987 | |||
988 | $ datafilepath=`ls corruption-test-repo/.hg/store/00changelog*.nd` |
|
988 | $ datafilepath=`ls corruption-test-repo/.hg/store/00changelog*.nd` | |
989 | $ f -s $datafilepath |
|
989 | $ f -s $datafilepath | |
990 | corruption-test-repo/.hg/store/00changelog-*.nd: size=121088 (glob) |
|
990 | corruption-test-repo/.hg/store/00changelog-*.nd: size=121088 (glob) | |
991 | $ dd if=$datafilepath bs=1000 count=10 of=$datafilepath-tmp |
|
991 | $ dd if=$datafilepath bs=1000 count=10 of=$datafilepath-tmp | |
992 | 10+0 records in |
|
992 | 10+0 records in | |
993 | 10+0 records out |
|
993 | 10+0 records out | |
994 | * bytes * (glob) |
|
994 | * bytes * (glob) | |
995 | $ mv $datafilepath-tmp $datafilepath |
|
995 | $ mv $datafilepath-tmp $datafilepath | |
996 | $ f -s $datafilepath |
|
996 | $ f -s $datafilepath | |
997 | corruption-test-repo/.hg/store/00changelog-*.nd: size=10000 (glob) |
|
997 | corruption-test-repo/.hg/store/00changelog-*.nd: size=10000 (glob) | |
998 |
|
998 | |||
999 | Check that Mercurial reaction to this event |
|
999 | Check that Mercurial reaction to this event | |
1000 |
|
1000 | |||
1001 | $ hg -R corruption-test-repo log -r . --traceback |
|
1001 | $ hg -R corruption-test-repo log -r . --traceback | |
1002 | changeset: 5005:90d5d3ba2fc4 |
|
1002 | changeset: 5005:90d5d3ba2fc4 | |
1003 | tag: tip |
|
1003 | tag: tip | |
1004 | user: test |
|
1004 | user: test | |
1005 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1005 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1006 | summary: a2 |
|
1006 | summary: a2 | |
1007 |
|
1007 | |||
1008 |
|
1008 | |||
1009 |
|
1009 | |||
1010 | stream clone |
|
1010 | stream clone | |
1011 | ============ |
|
1011 | ============ | |
1012 |
|
1012 | |||
1013 | The persistent nodemap should exist after a streaming clone |
|
1013 | The persistent nodemap should exist after a streaming clone | |
1014 |
|
1014 | |||
1015 | Simple case |
|
1015 | Simple case | |
1016 | ----------- |
|
1016 | ----------- | |
1017 |
|
1017 | |||
1018 | No race condition |
|
1018 | No race condition | |
1019 |
|
1019 | |||
1020 | $ hg clone -U --stream ssh://user@dummy/test-repo stream-clone --debug | egrep '00(changelog|manifest)' |
|
1020 | $ hg clone -U --stream ssh://user@dummy/test-repo stream-clone --debug | egrep '00(changelog|manifest)' | |
1021 | adding [s] 00manifest.n (62 bytes) |
|
1021 | adding [s] 00manifest.n (62 bytes) | |
1022 | adding [s] 00manifest-*.nd (118 KB) (glob) |
|
1022 | adding [s] 00manifest-*.nd (118 KB) (glob) | |
1023 | adding [s] 00changelog.n (62 bytes) |
|
1023 | adding [s] 00changelog.n (62 bytes) | |
1024 | adding [s] 00changelog-*.nd (118 KB) (glob) |
|
1024 | adding [s] 00changelog-*.nd (118 KB) (glob) | |
1025 | adding [s] 00manifest.d (452 KB) (no-zstd !) |
|
1025 | adding [s] 00manifest.d (452 KB) (no-zstd !) | |
1026 | adding [s] 00manifest.d (491 KB) (zstd !) |
|
1026 | adding [s] 00manifest.d (491 KB) (zstd no-bigendian !) | |
|
1027 | adding [s] 00manifest.d (492 KB) (zstd bigendian !) | |||
1027 | adding [s] 00changelog.d (360 KB) (no-zstd !) |
|
1028 | adding [s] 00changelog.d (360 KB) (no-zstd !) | |
1028 | adding [s] 00changelog.d (368 KB) (zstd !) |
|
1029 | adding [s] 00changelog.d (368 KB) (zstd !) | |
1029 | adding [s] 00manifest.i (313 KB) |
|
1030 | adding [s] 00manifest.i (313 KB) | |
1030 | adding [s] 00changelog.i (313 KB) |
|
1031 | adding [s] 00changelog.i (313 KB) | |
1031 | $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' |
|
1032 | $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)' | |
1032 | 00changelog-*.nd (glob) |
|
1033 | 00changelog-*.nd (glob) | |
1033 | 00changelog.n |
|
1034 | 00changelog.n | |
1034 | 00manifest-*.nd (glob) |
|
1035 | 00manifest-*.nd (glob) | |
1035 | 00manifest.n |
|
1036 | 00manifest.n | |
1036 | $ hg -R stream-clone debugnodemap --metadata |
|
1037 | $ hg -R stream-clone debugnodemap --metadata | |
1037 | uid: * (glob) |
|
1038 | uid: * (glob) | |
1038 | tip-rev: 5005 |
|
1039 | tip-rev: 5005 | |
1039 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
1040 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
1040 | data-length: 121088 |
|
1041 | data-length: 121088 | |
1041 | data-unused: 0 |
|
1042 | data-unused: 0 | |
1042 | data-unused: 0.000% |
|
1043 | data-unused: 0.000% | |
1043 |
|
1044 | |||
1044 | new data appened |
|
1045 | new data appened | |
1045 | ----------------- |
|
1046 | ----------------- | |
1046 |
|
1047 | |||
1047 | Other commit happening on the server during the stream clone |
|
1048 | Other commit happening on the server during the stream clone | |
1048 |
|
1049 | |||
1049 | setup the step-by-step stream cloning |
|
1050 | setup the step-by-step stream cloning | |
1050 |
|
1051 | |||
1051 | $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1" |
|
1052 | $ HG_TEST_STREAM_WALKED_FILE_1="$TESTTMP/sync_file_walked_1" | |
1052 | $ export HG_TEST_STREAM_WALKED_FILE_1 |
|
1053 | $ export HG_TEST_STREAM_WALKED_FILE_1 | |
1053 | $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2" |
|
1054 | $ HG_TEST_STREAM_WALKED_FILE_2="$TESTTMP/sync_file_walked_2" | |
1054 | $ export HG_TEST_STREAM_WALKED_FILE_2 |
|
1055 | $ export HG_TEST_STREAM_WALKED_FILE_2 | |
1055 | $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3" |
|
1056 | $ HG_TEST_STREAM_WALKED_FILE_3="$TESTTMP/sync_file_walked_3" | |
1056 | $ export HG_TEST_STREAM_WALKED_FILE_3 |
|
1057 | $ export HG_TEST_STREAM_WALKED_FILE_3 | |
1057 | $ cat << EOF >> test-repo/.hg/hgrc |
|
1058 | $ cat << EOF >> test-repo/.hg/hgrc | |
1058 | > [extensions] |
|
1059 | > [extensions] | |
1059 | > steps=$RUNTESTDIR/testlib/ext-stream-clone-steps.py |
|
1060 | > steps=$RUNTESTDIR/testlib/ext-stream-clone-steps.py | |
1060 | > EOF |
|
1061 | > EOF | |
1061 |
|
1062 | |||
1062 | Check and record file state beforehand |
|
1063 | Check and record file state beforehand | |
1063 |
|
1064 | |||
1064 | $ f --size test-repo/.hg/store/00changelog* |
|
1065 | $ f --size test-repo/.hg/store/00changelog* | |
1065 | test-repo/.hg/store/00changelog-*.nd: size=121088 (glob) |
|
1066 | test-repo/.hg/store/00changelog-*.nd: size=121088 (glob) | |
1066 | test-repo/.hg/store/00changelog.d: size=376891 (zstd !) |
|
1067 | test-repo/.hg/store/00changelog.d: size=376891 (zstd no-bigendian !) | |
|
1068 | test-repo/.hg/store/00changelog.d: size=376889 (zstd bigendian !) | |||
1067 | test-repo/.hg/store/00changelog.d: size=368890 (no-zstd !) |
|
1069 | test-repo/.hg/store/00changelog.d: size=368890 (no-zstd !) | |
1068 | test-repo/.hg/store/00changelog.i: size=320384 |
|
1070 | test-repo/.hg/store/00changelog.i: size=320384 | |
1069 | test-repo/.hg/store/00changelog.n: size=62 |
|
1071 | test-repo/.hg/store/00changelog.n: size=62 | |
1070 | $ hg -R test-repo debugnodemap --metadata | tee server-metadata.txt |
|
1072 | $ hg -R test-repo debugnodemap --metadata | tee server-metadata.txt | |
1071 | uid: * (glob) |
|
1073 | uid: * (glob) | |
1072 | tip-rev: 5005 |
|
1074 | tip-rev: 5005 | |
1073 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
1075 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
1074 | data-length: 121088 |
|
1076 | data-length: 121088 | |
1075 | data-unused: 0 |
|
1077 | data-unused: 0 | |
1076 | data-unused: 0.000% |
|
1078 | data-unused: 0.000% | |
1077 |
|
1079 | |||
1078 | Prepare a commit |
|
1080 | Prepare a commit | |
1079 |
|
1081 | |||
1080 | $ echo foo >> test-repo/foo |
|
1082 | $ echo foo >> test-repo/foo | |
1081 | $ hg -R test-repo/ add test-repo/foo |
|
1083 | $ hg -R test-repo/ add test-repo/foo | |
1082 |
|
1084 | |||
1083 | Do a mix of clone and commit at the same time so that the file listed on disk differ at actual transfer time. |
|
1085 | Do a mix of clone and commit at the same time so that the file listed on disk differ at actual transfer time. | |
1084 |
|
1086 | |||
1085 | $ (hg clone -U --stream ssh://user@dummy/test-repo stream-clone-race-1 --debug 2>> clone-output | egrep '00(changelog|manifest)' >> clone-output; touch $HG_TEST_STREAM_WALKED_FILE_3) & |
|
1087 | $ (hg clone -U --stream ssh://user@dummy/test-repo stream-clone-race-1 --debug 2>> clone-output | egrep '00(changelog|manifest)' >> clone-output; touch $HG_TEST_STREAM_WALKED_FILE_3) & | |
1086 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 |
|
1088 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 | |
1087 | $ hg -R test-repo/ commit -m foo |
|
1089 | $ hg -R test-repo/ commit -m foo | |
1088 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 |
|
1090 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 | |
1089 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 |
|
1091 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 | |
1090 | $ cat clone-output |
|
1092 | $ cat clone-output | |
1091 | adding [s] 00manifest.n (62 bytes) |
|
1093 | adding [s] 00manifest.n (62 bytes) | |
1092 | adding [s] 00manifest-*.nd (118 KB) (glob) |
|
1094 | adding [s] 00manifest-*.nd (118 KB) (glob) | |
1093 | adding [s] 00changelog.n (62 bytes) |
|
1095 | adding [s] 00changelog.n (62 bytes) | |
1094 | adding [s] 00changelog-*.nd (118 KB) (glob) |
|
1096 | adding [s] 00changelog-*.nd (118 KB) (glob) | |
1095 | adding [s] 00manifest.d (452 KB) (no-zstd !) |
|
1097 | adding [s] 00manifest.d (452 KB) (no-zstd !) | |
1096 | adding [s] 00manifest.d (491 KB) (zstd !) |
|
1098 | adding [s] 00manifest.d (491 KB) (zstd no-bigendian !) | |
|
1099 | adding [s] 00manifest.d (492 KB) (zstd bigendian !) | |||
1097 | adding [s] 00changelog.d (360 KB) (no-zstd !) |
|
1100 | adding [s] 00changelog.d (360 KB) (no-zstd !) | |
1098 | adding [s] 00changelog.d (368 KB) (zstd !) |
|
1101 | adding [s] 00changelog.d (368 KB) (zstd !) | |
1099 | adding [s] 00manifest.i (313 KB) |
|
1102 | adding [s] 00manifest.i (313 KB) | |
1100 | adding [s] 00changelog.i (313 KB) |
|
1103 | adding [s] 00changelog.i (313 KB) | |
1101 |
|
1104 | |||
1102 | Check the result state |
|
1105 | Check the result state | |
1103 |
|
1106 | |||
1104 | $ f --size stream-clone-race-1/.hg/store/00changelog* |
|
1107 | $ f --size stream-clone-race-1/.hg/store/00changelog* | |
1105 | stream-clone-race-1/.hg/store/00changelog-*.nd: size=121088 (glob) |
|
1108 | stream-clone-race-1/.hg/store/00changelog-*.nd: size=121088 (glob) | |
1106 | stream-clone-race-1/.hg/store/00changelog.d: size=368890 (no-zstd !) |
|
1109 | stream-clone-race-1/.hg/store/00changelog.d: size=368890 (no-zstd !) | |
1107 | stream-clone-race-1/.hg/store/00changelog.d: size=376891 (zstd !) |
|
1110 | stream-clone-race-1/.hg/store/00changelog.d: size=376891 (zstd no-bigendian !) | |
|
1111 | stream-clone-race-1/.hg/store/00changelog.d: size=376889 (zstd bigendian !) | |||
1108 | stream-clone-race-1/.hg/store/00changelog.i: size=320384 |
|
1112 | stream-clone-race-1/.hg/store/00changelog.i: size=320384 | |
1109 | stream-clone-race-1/.hg/store/00changelog.n: size=62 |
|
1113 | stream-clone-race-1/.hg/store/00changelog.n: size=62 | |
1110 |
|
1114 | |||
1111 | $ hg -R stream-clone-race-1 debugnodemap --metadata | tee client-metadata.txt |
|
1115 | $ hg -R stream-clone-race-1 debugnodemap --metadata | tee client-metadata.txt | |
1112 | uid: * (glob) |
|
1116 | uid: * (glob) | |
1113 | tip-rev: 5005 |
|
1117 | tip-rev: 5005 | |
1114 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
1118 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
1115 | data-length: 121088 |
|
1119 | data-length: 121088 | |
1116 | data-unused: 0 |
|
1120 | data-unused: 0 | |
1117 | data-unused: 0.000% |
|
1121 | data-unused: 0.000% | |
1118 |
|
1122 | |||
1119 | We get a usable nodemap, so no rewrite would be needed and the metadata should be identical |
|
1123 | We get a usable nodemap, so no rewrite would be needed and the metadata should be identical | |
1120 | (ie: the following diff should be empty) |
|
1124 | (ie: the following diff should be empty) | |
1121 |
|
1125 | |||
1122 | This isn't the case for the `no-rust` `no-pure` implementation as it use a very minimal nodemap implementation that unconditionnaly rewrite the nodemap "all the time". |
|
1126 | This isn't the case for the `no-rust` `no-pure` implementation as it use a very minimal nodemap implementation that unconditionnaly rewrite the nodemap "all the time". | |
1123 |
|
1127 | |||
1124 | #if no-rust no-pure |
|
1128 | #if no-rust no-pure | |
1125 | $ diff -u server-metadata.txt client-metadata.txt |
|
1129 | $ diff -u server-metadata.txt client-metadata.txt | |
1126 | --- server-metadata.txt * (glob) |
|
1130 | --- server-metadata.txt * (glob) | |
1127 | +++ client-metadata.txt * (glob) |
|
1131 | +++ client-metadata.txt * (glob) | |
1128 | @@ -1,4 +1,4 @@ |
|
1132 | @@ -1,4 +1,4 @@ | |
1129 | -uid: * (glob) |
|
1133 | -uid: * (glob) | |
1130 | +uid: * (glob) |
|
1134 | +uid: * (glob) | |
1131 | tip-rev: 5005 |
|
1135 | tip-rev: 5005 | |
1132 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe |
|
1136 | tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe | |
1133 | data-length: 121088 |
|
1137 | data-length: 121088 | |
1134 | [1] |
|
1138 | [1] | |
1135 | #else |
|
1139 | #else | |
1136 | $ diff -u server-metadata.txt client-metadata.txt |
|
1140 | $ diff -u server-metadata.txt client-metadata.txt | |
1137 | #endif |
|
1141 | #endif | |
1138 |
|
1142 | |||
1139 |
|
1143 | |||
1140 | Clean up after the test. |
|
1144 | Clean up after the test. | |
1141 |
|
1145 | |||
1142 | $ rm -f "$HG_TEST_STREAM_WALKED_FILE_1" |
|
1146 | $ rm -f "$HG_TEST_STREAM_WALKED_FILE_1" | |
1143 | $ rm -f "$HG_TEST_STREAM_WALKED_FILE_2" |
|
1147 | $ rm -f "$HG_TEST_STREAM_WALKED_FILE_2" | |
1144 | $ rm -f "$HG_TEST_STREAM_WALKED_FILE_3" |
|
1148 | $ rm -f "$HG_TEST_STREAM_WALKED_FILE_3" | |
1145 |
|
1149 | |||
1146 | full regeneration |
|
1150 | full regeneration | |
1147 | ----------------- |
|
1151 | ----------------- | |
1148 |
|
1152 | |||
1149 | A full nodemap is generated |
|
1153 | A full nodemap is generated | |
1150 |
|
1154 | |||
1151 | (ideally this test would append enough data to make sure the nodemap data file |
|
1155 | (ideally this test would append enough data to make sure the nodemap data file | |
1152 | get changed, however to make thing simpler we will force the regeneration for |
|
1156 | get changed, however to make thing simpler we will force the regeneration for | |
1153 | this test. |
|
1157 | this test. | |
1154 |
|
1158 | |||
1155 | Check the initial state |
|
1159 | Check the initial state | |
1156 |
|
1160 | |||
1157 | $ f --size test-repo/.hg/store/00changelog* |
|
1161 | $ f --size test-repo/.hg/store/00changelog* | |
1158 | test-repo/.hg/store/00changelog-*.nd: size=121344 (glob) (rust !) |
|
1162 | test-repo/.hg/store/00changelog-*.nd: size=121344 (glob) (rust !) | |
1159 | test-repo/.hg/store/00changelog-*.nd: size=121344 (glob) (pure !) |
|
1163 | test-repo/.hg/store/00changelog-*.nd: size=121344 (glob) (pure !) | |
1160 | test-repo/.hg/store/00changelog-*.nd: size=121152 (glob) (no-rust no-pure !) |
|
1164 | test-repo/.hg/store/00changelog-*.nd: size=121152 (glob) (no-rust no-pure !) | |
1161 | test-repo/.hg/store/00changelog.d: size=376950 (zstd !) |
|
1165 | test-repo/.hg/store/00changelog.d: size=376950 (zstd no-bigendian !) | |
|
1166 | test-repo/.hg/store/00changelog.d: size=376948 (zstd bigendian !) | |||
1162 | test-repo/.hg/store/00changelog.d: size=368949 (no-zstd !) |
|
1167 | test-repo/.hg/store/00changelog.d: size=368949 (no-zstd !) | |
1163 | test-repo/.hg/store/00changelog.i: size=320448 |
|
1168 | test-repo/.hg/store/00changelog.i: size=320448 | |
1164 | test-repo/.hg/store/00changelog.n: size=62 |
|
1169 | test-repo/.hg/store/00changelog.n: size=62 | |
1165 | $ hg -R test-repo debugnodemap --metadata | tee server-metadata-2.txt |
|
1170 | $ hg -R test-repo debugnodemap --metadata | tee server-metadata-2.txt | |
1166 | uid: * (glob) |
|
1171 | uid: * (glob) | |
1167 | tip-rev: 5006 |
|
1172 | tip-rev: 5006 | |
1168 | tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b |
|
1173 | tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b | |
1169 | data-length: 121344 (rust !) |
|
1174 | data-length: 121344 (rust !) | |
1170 | data-length: 121344 (pure !) |
|
1175 | data-length: 121344 (pure !) | |
1171 | data-length: 121152 (no-rust no-pure !) |
|
1176 | data-length: 121152 (no-rust no-pure !) | |
1172 | data-unused: 192 (rust !) |
|
1177 | data-unused: 192 (rust !) | |
1173 | data-unused: 192 (pure !) |
|
1178 | data-unused: 192 (pure !) | |
1174 | data-unused: 0 (no-rust no-pure !) |
|
1179 | data-unused: 0 (no-rust no-pure !) | |
1175 | data-unused: 0.158% (rust !) |
|
1180 | data-unused: 0.158% (rust !) | |
1176 | data-unused: 0.158% (pure !) |
|
1181 | data-unused: 0.158% (pure !) | |
1177 | data-unused: 0.000% (no-rust no-pure !) |
|
1182 | data-unused: 0.000% (no-rust no-pure !) | |
1178 |
|
1183 | |||
1179 | Performe the mix of clone and full refresh of the nodemap, so that the files |
|
1184 | Performe the mix of clone and full refresh of the nodemap, so that the files | |
1180 | (and filenames) are different between listing time and actual transfer time. |
|
1185 | (and filenames) are different between listing time and actual transfer time. | |
1181 |
|
1186 | |||
1182 | $ (hg clone -U --stream ssh://user@dummy/test-repo stream-clone-race-2 --debug 2>> clone-output-2 | egrep '00(changelog|manifest)' >> clone-output-2; touch $HG_TEST_STREAM_WALKED_FILE_3) & |
|
1187 | $ (hg clone -U --stream ssh://user@dummy/test-repo stream-clone-race-2 --debug 2>> clone-output-2 | egrep '00(changelog|manifest)' >> clone-output-2; touch $HG_TEST_STREAM_WALKED_FILE_3) & | |
1183 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 |
|
1188 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_1 | |
1184 | $ rm test-repo/.hg/store/00changelog.n |
|
1189 | $ rm test-repo/.hg/store/00changelog.n | |
1185 | $ rm test-repo/.hg/store/00changelog-*.nd |
|
1190 | $ rm test-repo/.hg/store/00changelog-*.nd | |
1186 | $ hg -R test-repo/ debugupdatecache |
|
1191 | $ hg -R test-repo/ debugupdatecache | |
1187 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 |
|
1192 | $ touch $HG_TEST_STREAM_WALKED_FILE_2 | |
1188 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 |
|
1193 | $ $RUNTESTDIR/testlib/wait-on-file 10 $HG_TEST_STREAM_WALKED_FILE_3 | |
1189 |
|
1194 | |||
1190 | (note: the stream clone code wronly pick the `undo.` files) |
|
1195 | (note: the stream clone code wronly pick the `undo.` files) | |
1191 |
|
1196 | |||
1192 | $ cat clone-output-2 |
|
1197 | $ cat clone-output-2 | |
1193 | adding [s] undo.backup.00manifest.n (62 bytes) (known-bad-output !) |
|
1198 | adding [s] undo.backup.00manifest.n (62 bytes) (known-bad-output !) | |
1194 | adding [s] undo.backup.00changelog.n (62 bytes) (known-bad-output !) |
|
1199 | adding [s] undo.backup.00changelog.n (62 bytes) (known-bad-output !) | |
1195 | adding [s] 00manifest.n (62 bytes) |
|
1200 | adding [s] 00manifest.n (62 bytes) | |
1196 | adding [s] 00manifest-*.nd (118 KB) (glob) |
|
1201 | adding [s] 00manifest-*.nd (118 KB) (glob) | |
1197 | adding [s] 00changelog.n (62 bytes) |
|
1202 | adding [s] 00changelog.n (62 bytes) | |
1198 | adding [s] 00changelog-*.nd (118 KB) (glob) |
|
1203 | adding [s] 00changelog-*.nd (118 KB) (glob) | |
1199 | adding [s] 00manifest.d (492 KB) (zstd !) |
|
1204 | adding [s] 00manifest.d (492 KB) (zstd !) | |
1200 | adding [s] 00manifest.d (452 KB) (no-zstd !) |
|
1205 | adding [s] 00manifest.d (452 KB) (no-zstd !) | |
1201 | adding [s] 00changelog.d (360 KB) (no-zstd !) |
|
1206 | adding [s] 00changelog.d (360 KB) (no-zstd !) | |
1202 | adding [s] 00changelog.d (368 KB) (zstd !) |
|
1207 | adding [s] 00changelog.d (368 KB) (zstd !) | |
1203 | adding [s] 00manifest.i (313 KB) |
|
1208 | adding [s] 00manifest.i (313 KB) | |
1204 | adding [s] 00changelog.i (313 KB) |
|
1209 | adding [s] 00changelog.i (313 KB) | |
1205 |
|
1210 | |||
1206 | Check the result. |
|
1211 | Check the result. | |
1207 |
|
1212 | |||
1208 | $ f --size stream-clone-race-2/.hg/store/00changelog* |
|
1213 | $ f --size stream-clone-race-2/.hg/store/00changelog* | |
1209 | stream-clone-race-2/.hg/store/00changelog-*.nd: size=121344 (glob) (rust !) |
|
1214 | stream-clone-race-2/.hg/store/00changelog-*.nd: size=121344 (glob) (rust !) | |
1210 | stream-clone-race-2/.hg/store/00changelog-*.nd: size=121344 (glob) (pure !) |
|
1215 | stream-clone-race-2/.hg/store/00changelog-*.nd: size=121344 (glob) (pure !) | |
1211 | stream-clone-race-2/.hg/store/00changelog-*.nd: size=121152 (glob) (no-rust no-pure !) |
|
1216 | stream-clone-race-2/.hg/store/00changelog-*.nd: size=121152 (glob) (no-rust no-pure !) | |
1212 | stream-clone-race-2/.hg/store/00changelog.d: size=376950 (zstd !) |
|
1217 | stream-clone-race-2/.hg/store/00changelog.d: size=376950 (zstd no-bigendian !) | |
|
1218 | stream-clone-race-2/.hg/store/00changelog.d: size=376948 (zstd bigendian !) | |||
1213 | stream-clone-race-2/.hg/store/00changelog.d: size=368949 (no-zstd !) |
|
1219 | stream-clone-race-2/.hg/store/00changelog.d: size=368949 (no-zstd !) | |
1214 | stream-clone-race-2/.hg/store/00changelog.i: size=320448 |
|
1220 | stream-clone-race-2/.hg/store/00changelog.i: size=320448 | |
1215 | stream-clone-race-2/.hg/store/00changelog.n: size=62 |
|
1221 | stream-clone-race-2/.hg/store/00changelog.n: size=62 | |
1216 |
|
1222 | |||
1217 | $ hg -R stream-clone-race-2 debugnodemap --metadata | tee client-metadata-2.txt |
|
1223 | $ hg -R stream-clone-race-2 debugnodemap --metadata | tee client-metadata-2.txt | |
1218 | uid: * (glob) |
|
1224 | uid: * (glob) | |
1219 | tip-rev: 5006 |
|
1225 | tip-rev: 5006 | |
1220 | tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b |
|
1226 | tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b | |
1221 | data-length: 121344 (rust !) |
|
1227 | data-length: 121344 (rust !) | |
1222 | data-unused: 192 (rust !) |
|
1228 | data-unused: 192 (rust !) | |
1223 | data-unused: 0.158% (rust !) |
|
1229 | data-unused: 0.158% (rust !) | |
1224 | data-length: 121152 (no-rust no-pure !) |
|
1230 | data-length: 121152 (no-rust no-pure !) | |
1225 | data-unused: 0 (no-rust no-pure !) |
|
1231 | data-unused: 0 (no-rust no-pure !) | |
1226 | data-unused: 0.000% (no-rust no-pure !) |
|
1232 | data-unused: 0.000% (no-rust no-pure !) | |
1227 | data-length: 121344 (pure !) |
|
1233 | data-length: 121344 (pure !) | |
1228 | data-unused: 192 (pure !) |
|
1234 | data-unused: 192 (pure !) | |
1229 | data-unused: 0.158% (pure !) |
|
1235 | data-unused: 0.158% (pure !) | |
1230 |
|
1236 | |||
1231 | We get a usable nodemap, so no rewrite would be needed and the metadata should be identical |
|
1237 | We get a usable nodemap, so no rewrite would be needed and the metadata should be identical | |
1232 | (ie: the following diff should be empty) |
|
1238 | (ie: the following diff should be empty) | |
1233 |
|
1239 | |||
1234 | This isn't the case for the `no-rust` `no-pure` implementation as it use a very minimal nodemap implementation that unconditionnaly rewrite the nodemap "all the time". |
|
1240 | This isn't the case for the `no-rust` `no-pure` implementation as it use a very minimal nodemap implementation that unconditionnaly rewrite the nodemap "all the time". | |
1235 |
|
1241 | |||
1236 | #if no-rust no-pure |
|
1242 | #if no-rust no-pure | |
1237 | $ diff -u server-metadata-2.txt client-metadata-2.txt |
|
1243 | $ diff -u server-metadata-2.txt client-metadata-2.txt | |
1238 | --- server-metadata-2.txt * (glob) |
|
1244 | --- server-metadata-2.txt * (glob) | |
1239 | +++ client-metadata-2.txt * (glob) |
|
1245 | +++ client-metadata-2.txt * (glob) | |
1240 | @@ -1,4 +1,4 @@ |
|
1246 | @@ -1,4 +1,4 @@ | |
1241 | -uid: * (glob) |
|
1247 | -uid: * (glob) | |
1242 | +uid: * (glob) |
|
1248 | +uid: * (glob) | |
1243 | tip-rev: 5006 |
|
1249 | tip-rev: 5006 | |
1244 | tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b |
|
1250 | tip-node: ed2ec1eef9aa2a0ec5057c51483bc148d03e810b | |
1245 | data-length: 121152 |
|
1251 | data-length: 121152 | |
1246 | [1] |
|
1252 | [1] | |
1247 | #else |
|
1253 | #else | |
1248 | $ diff -u server-metadata-2.txt client-metadata-2.txt |
|
1254 | $ diff -u server-metadata-2.txt client-metadata-2.txt | |
1249 | #endif |
|
1255 | #endif | |
1250 |
|
1256 | |||
1251 | Clean up after the test |
|
1257 | Clean up after the test | |
1252 |
|
1258 | |||
1253 | $ rm -f $HG_TEST_STREAM_WALKED_FILE_1 |
|
1259 | $ rm -f $HG_TEST_STREAM_WALKED_FILE_1 | |
1254 | $ rm -f $HG_TEST_STREAM_WALKED_FILE_2 |
|
1260 | $ rm -f $HG_TEST_STREAM_WALKED_FILE_2 | |
1255 | $ rm -f $HG_TEST_STREAM_WALKED_FILE_3 |
|
1261 | $ rm -f $HG_TEST_STREAM_WALKED_FILE_3 | |
1256 |
|
1262 |
General Comments 0
You need to be logged in to leave comments.
Login now