##// END OF EJS Templates
simplestore: use a custom store for the simple store repo...
Gregory Szorc -
r37433:c2c8962a default
parent child Browse files
Show More
@@ -1,772 +1,777 b''
1 from __future__ import absolute_import
1 from __future__ import absolute_import
2
2
3 import errno
3 import errno
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 }
17 }
18
18
19 def check(name, desc):
19 def check(name, desc):
20 """Registers a check function for a feature."""
20 """Registers a check function for a feature."""
21 def decorator(func):
21 def decorator(func):
22 checks[name] = (func, desc)
22 checks[name] = (func, desc)
23 return func
23 return func
24 return decorator
24 return decorator
25
25
26 def checkvers(name, desc, vers):
26 def checkvers(name, desc, vers):
27 """Registers a check function for each of a series of versions.
27 """Registers a check function for each of a series of versions.
28
28
29 vers can be a list or an iterator"""
29 vers can be a list or an iterator"""
30 def decorator(func):
30 def decorator(func):
31 def funcv(v):
31 def funcv(v):
32 def f():
32 def f():
33 return func(v)
33 return func(v)
34 return f
34 return f
35 for v in vers:
35 for v in vers:
36 v = str(v)
36 v = str(v)
37 f = funcv(v)
37 f = funcv(v)
38 checks['%s%s' % (name, v.replace('.', ''))] = (f, desc % v)
38 checks['%s%s' % (name, v.replace('.', ''))] = (f, desc % v)
39 return func
39 return func
40 return decorator
40 return decorator
41
41
42 def checkfeatures(features):
42 def checkfeatures(features):
43 result = {
43 result = {
44 'error': [],
44 'error': [],
45 'missing': [],
45 'missing': [],
46 'skipped': [],
46 'skipped': [],
47 }
47 }
48
48
49 for feature in features:
49 for feature in features:
50 negate = feature.startswith('no-')
50 negate = feature.startswith('no-')
51 if negate:
51 if negate:
52 feature = feature[3:]
52 feature = feature[3:]
53
53
54 if feature not in checks:
54 if feature not in checks:
55 result['missing'].append(feature)
55 result['missing'].append(feature)
56 continue
56 continue
57
57
58 check, desc = checks[feature]
58 check, desc = checks[feature]
59 try:
59 try:
60 available = check()
60 available = check()
61 except Exception:
61 except Exception:
62 result['error'].append('hghave check failed: %s' % feature)
62 result['error'].append('hghave check failed: %s' % feature)
63 continue
63 continue
64
64
65 if not negate and not available:
65 if not negate and not available:
66 result['skipped'].append('missing feature: %s' % desc)
66 result['skipped'].append('missing feature: %s' % desc)
67 elif negate and available:
67 elif negate and available:
68 result['skipped'].append('system supports %s' % desc)
68 result['skipped'].append('system supports %s' % desc)
69
69
70 return result
70 return result
71
71
72 def require(features):
72 def require(features):
73 """Require that features are available, exiting if not."""
73 """Require that features are available, exiting if not."""
74 result = checkfeatures(features)
74 result = checkfeatures(features)
75
75
76 for missing in result['missing']:
76 for missing in result['missing']:
77 sys.stderr.write('skipped: unknown feature: %s\n' % missing)
77 sys.stderr.write('skipped: unknown feature: %s\n' % missing)
78 for msg in result['skipped']:
78 for msg in result['skipped']:
79 sys.stderr.write('skipped: %s\n' % msg)
79 sys.stderr.write('skipped: %s\n' % msg)
80 for msg in result['error']:
80 for msg in result['error']:
81 sys.stderr.write('%s\n' % msg)
81 sys.stderr.write('%s\n' % msg)
82
82
83 if result['missing']:
83 if result['missing']:
84 sys.exit(2)
84 sys.exit(2)
85
85
86 if result['skipped'] or result['error']:
86 if result['skipped'] or result['error']:
87 sys.exit(1)
87 sys.exit(1)
88
88
89 def matchoutput(cmd, regexp, ignorestatus=False):
89 def matchoutput(cmd, regexp, ignorestatus=False):
90 """Return the match object if cmd executes successfully and its output
90 """Return the match object if cmd executes successfully and its output
91 is matched by the supplied regular expression.
91 is matched by the supplied regular expression.
92 """
92 """
93 r = re.compile(regexp)
93 r = re.compile(regexp)
94 try:
94 try:
95 p = subprocess.Popen(
95 p = subprocess.Popen(
96 cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
96 cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
97 except OSError as e:
97 except OSError as e:
98 if e.errno != errno.ENOENT:
98 if e.errno != errno.ENOENT:
99 raise
99 raise
100 ret = -1
100 ret = -1
101 ret = p.wait()
101 ret = p.wait()
102 s = p.stdout.read()
102 s = p.stdout.read()
103 return (ignorestatus or not ret) and r.search(s)
103 return (ignorestatus or not ret) and r.search(s)
104
104
105 @check("baz", "GNU Arch baz client")
105 @check("baz", "GNU Arch baz client")
106 def has_baz():
106 def has_baz():
107 return matchoutput('baz --version 2>&1', br'baz Bazaar version')
107 return matchoutput('baz --version 2>&1', br'baz Bazaar version')
108
108
109 @check("bzr", "Canonical's Bazaar client")
109 @check("bzr", "Canonical's Bazaar client")
110 def has_bzr():
110 def has_bzr():
111 try:
111 try:
112 import bzrlib
112 import bzrlib
113 import bzrlib.bzrdir
113 import bzrlib.bzrdir
114 import bzrlib.errors
114 import bzrlib.errors
115 import bzrlib.revision
115 import bzrlib.revision
116 import bzrlib.revisionspec
116 import bzrlib.revisionspec
117 bzrlib.revisionspec.RevisionSpec
117 bzrlib.revisionspec.RevisionSpec
118 return bzrlib.__doc__ is not None
118 return bzrlib.__doc__ is not None
119 except (AttributeError, ImportError):
119 except (AttributeError, ImportError):
120 return False
120 return False
121
121
122 @checkvers("bzr", "Canonical's Bazaar client >= %s", (1.14,))
122 @checkvers("bzr", "Canonical's Bazaar client >= %s", (1.14,))
123 def has_bzr_range(v):
123 def has_bzr_range(v):
124 major, minor = v.split('.')[0:2]
124 major, minor = v.split('.')[0:2]
125 try:
125 try:
126 import bzrlib
126 import bzrlib
127 return (bzrlib.__doc__ is not None
127 return (bzrlib.__doc__ is not None
128 and bzrlib.version_info[:2] >= (int(major), int(minor)))
128 and bzrlib.version_info[:2] >= (int(major), int(minor)))
129 except ImportError:
129 except ImportError:
130 return False
130 return False
131
131
132 @check("chg", "running with chg")
132 @check("chg", "running with chg")
133 def has_chg():
133 def has_chg():
134 return 'CHGHG' in os.environ
134 return 'CHGHG' in os.environ
135
135
136 @check("cvs", "cvs client/server")
136 @check("cvs", "cvs client/server")
137 def has_cvs():
137 def has_cvs():
138 re = br'Concurrent Versions System.*?server'
138 re = br'Concurrent Versions System.*?server'
139 return matchoutput('cvs --version 2>&1', re) and not has_msys()
139 return matchoutput('cvs --version 2>&1', re) and not has_msys()
140
140
141 @check("cvs112", "cvs client/server 1.12.* (not cvsnt)")
141 @check("cvs112", "cvs client/server 1.12.* (not cvsnt)")
142 def has_cvs112():
142 def has_cvs112():
143 re = br'Concurrent Versions System \(CVS\) 1.12.*?server'
143 re = br'Concurrent Versions System \(CVS\) 1.12.*?server'
144 return matchoutput('cvs --version 2>&1', re) and not has_msys()
144 return matchoutput('cvs --version 2>&1', re) and not has_msys()
145
145
146 @check("cvsnt", "cvsnt client/server")
146 @check("cvsnt", "cvsnt client/server")
147 def has_cvsnt():
147 def has_cvsnt():
148 re = br'Concurrent Versions System \(CVSNT\) (\d+).(\d+).*\(client/server\)'
148 re = br'Concurrent Versions System \(CVSNT\) (\d+).(\d+).*\(client/server\)'
149 return matchoutput('cvsnt --version 2>&1', re)
149 return matchoutput('cvsnt --version 2>&1', re)
150
150
151 @check("darcs", "darcs client")
151 @check("darcs", "darcs client")
152 def has_darcs():
152 def has_darcs():
153 return matchoutput('darcs --version', br'\b2\.([2-9]|\d{2})', True)
153 return matchoutput('darcs --version', br'\b2\.([2-9]|\d{2})', True)
154
154
155 @check("mtn", "monotone client (>= 1.0)")
155 @check("mtn", "monotone client (>= 1.0)")
156 def has_mtn():
156 def has_mtn():
157 return matchoutput('mtn --version', br'monotone', True) and not matchoutput(
157 return matchoutput('mtn --version', br'monotone', True) and not matchoutput(
158 'mtn --version', br'monotone 0\.', True)
158 'mtn --version', br'monotone 0\.', True)
159
159
160 @check("eol-in-paths", "end-of-lines in paths")
160 @check("eol-in-paths", "end-of-lines in paths")
161 def has_eol_in_paths():
161 def has_eol_in_paths():
162 try:
162 try:
163 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix, suffix='\n\r')
163 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix, suffix='\n\r')
164 os.close(fd)
164 os.close(fd)
165 os.remove(path)
165 os.remove(path)
166 return True
166 return True
167 except (IOError, OSError):
167 except (IOError, OSError):
168 return False
168 return False
169
169
170 @check("execbit", "executable bit")
170 @check("execbit", "executable bit")
171 def has_executablebit():
171 def has_executablebit():
172 try:
172 try:
173 EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
173 EXECFLAGS = stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH
174 fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
174 fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
175 try:
175 try:
176 os.close(fh)
176 os.close(fh)
177 m = os.stat(fn).st_mode & 0o777
177 m = os.stat(fn).st_mode & 0o777
178 new_file_has_exec = m & EXECFLAGS
178 new_file_has_exec = m & EXECFLAGS
179 os.chmod(fn, m ^ EXECFLAGS)
179 os.chmod(fn, m ^ EXECFLAGS)
180 exec_flags_cannot_flip = ((os.stat(fn).st_mode & 0o777) == m)
180 exec_flags_cannot_flip = ((os.stat(fn).st_mode & 0o777) == m)
181 finally:
181 finally:
182 os.unlink(fn)
182 os.unlink(fn)
183 except (IOError, OSError):
183 except (IOError, OSError):
184 # we don't care, the user probably won't be able to commit anyway
184 # we don't care, the user probably won't be able to commit anyway
185 return False
185 return False
186 return not (new_file_has_exec or exec_flags_cannot_flip)
186 return not (new_file_has_exec or exec_flags_cannot_flip)
187
187
188 @check("icasefs", "case insensitive file system")
188 @check("icasefs", "case insensitive file system")
189 def has_icasefs():
189 def has_icasefs():
190 # Stolen from mercurial.util
190 # Stolen from mercurial.util
191 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
191 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
192 os.close(fd)
192 os.close(fd)
193 try:
193 try:
194 s1 = os.stat(path)
194 s1 = os.stat(path)
195 d, b = os.path.split(path)
195 d, b = os.path.split(path)
196 p2 = os.path.join(d, b.upper())
196 p2 = os.path.join(d, b.upper())
197 if path == p2:
197 if path == p2:
198 p2 = os.path.join(d, b.lower())
198 p2 = os.path.join(d, b.lower())
199 try:
199 try:
200 s2 = os.stat(p2)
200 s2 = os.stat(p2)
201 return s2 == s1
201 return s2 == s1
202 except OSError:
202 except OSError:
203 return False
203 return False
204 finally:
204 finally:
205 os.remove(path)
205 os.remove(path)
206
206
207 @check("fifo", "named pipes")
207 @check("fifo", "named pipes")
208 def has_fifo():
208 def has_fifo():
209 if getattr(os, "mkfifo", None) is None:
209 if getattr(os, "mkfifo", None) is None:
210 return False
210 return False
211 name = tempfile.mktemp(dir='.', prefix=tempprefix)
211 name = tempfile.mktemp(dir='.', prefix=tempprefix)
212 try:
212 try:
213 os.mkfifo(name)
213 os.mkfifo(name)
214 os.unlink(name)
214 os.unlink(name)
215 return True
215 return True
216 except OSError:
216 except OSError:
217 return False
217 return False
218
218
219 @check("killdaemons", 'killdaemons.py support')
219 @check("killdaemons", 'killdaemons.py support')
220 def has_killdaemons():
220 def has_killdaemons():
221 return True
221 return True
222
222
223 @check("cacheable", "cacheable filesystem")
223 @check("cacheable", "cacheable filesystem")
224 def has_cacheable_fs():
224 def has_cacheable_fs():
225 from mercurial import util
225 from mercurial import util
226
226
227 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
227 fd, path = tempfile.mkstemp(dir='.', prefix=tempprefix)
228 os.close(fd)
228 os.close(fd)
229 try:
229 try:
230 return util.cachestat(path).cacheable()
230 return util.cachestat(path).cacheable()
231 finally:
231 finally:
232 os.remove(path)
232 os.remove(path)
233
233
234 @check("lsprof", "python lsprof module")
234 @check("lsprof", "python lsprof module")
235 def has_lsprof():
235 def has_lsprof():
236 try:
236 try:
237 import _lsprof
237 import _lsprof
238 _lsprof.Profiler # silence unused import warning
238 _lsprof.Profiler # silence unused import warning
239 return True
239 return True
240 except ImportError:
240 except ImportError:
241 return False
241 return False
242
242
243 def gethgversion():
243 def gethgversion():
244 m = matchoutput('hg --version --quiet 2>&1', br'(\d+)\.(\d+)')
244 m = matchoutput('hg --version --quiet 2>&1', br'(\d+)\.(\d+)')
245 if not m:
245 if not m:
246 return (0, 0)
246 return (0, 0)
247 return (int(m.group(1)), int(m.group(2)))
247 return (int(m.group(1)), int(m.group(2)))
248
248
249 @checkvers("hg", "Mercurial >= %s",
249 @checkvers("hg", "Mercurial >= %s",
250 list([(1.0 * x) / 10 for x in range(9, 99)]))
250 list([(1.0 * x) / 10 for x in range(9, 99)]))
251 def has_hg_range(v):
251 def has_hg_range(v):
252 major, minor = v.split('.')[0:2]
252 major, minor = v.split('.')[0:2]
253 return gethgversion() >= (int(major), int(minor))
253 return gethgversion() >= (int(major), int(minor))
254
254
255 @check("hg08", "Mercurial >= 0.8")
255 @check("hg08", "Mercurial >= 0.8")
256 def has_hg08():
256 def has_hg08():
257 if checks["hg09"][0]():
257 if checks["hg09"][0]():
258 return True
258 return True
259 return matchoutput('hg help annotate 2>&1', '--date')
259 return matchoutput('hg help annotate 2>&1', '--date')
260
260
261 @check("hg07", "Mercurial >= 0.7")
261 @check("hg07", "Mercurial >= 0.7")
262 def has_hg07():
262 def has_hg07():
263 if checks["hg08"][0]():
263 if checks["hg08"][0]():
264 return True
264 return True
265 return matchoutput('hg --version --quiet 2>&1', 'Mercurial Distributed SCM')
265 return matchoutput('hg --version --quiet 2>&1', 'Mercurial Distributed SCM')
266
266
267 @check("hg06", "Mercurial >= 0.6")
267 @check("hg06", "Mercurial >= 0.6")
268 def has_hg06():
268 def has_hg06():
269 if checks["hg07"][0]():
269 if checks["hg07"][0]():
270 return True
270 return True
271 return matchoutput('hg --version --quiet 2>&1', 'Mercurial version')
271 return matchoutput('hg --version --quiet 2>&1', 'Mercurial version')
272
272
273 @check("gettext", "GNU Gettext (msgfmt)")
273 @check("gettext", "GNU Gettext (msgfmt)")
274 def has_gettext():
274 def has_gettext():
275 return matchoutput('msgfmt --version', br'GNU gettext-tools')
275 return matchoutput('msgfmt --version', br'GNU gettext-tools')
276
276
277 @check("git", "git command line client")
277 @check("git", "git command line client")
278 def has_git():
278 def has_git():
279 return matchoutput('git --version 2>&1', br'^git version')
279 return matchoutput('git --version 2>&1', br'^git version')
280
280
281 def getgitversion():
281 def getgitversion():
282 m = matchoutput('git --version 2>&1', br'git version (\d+)\.(\d+)')
282 m = matchoutput('git --version 2>&1', br'git version (\d+)\.(\d+)')
283 if not m:
283 if not m:
284 return (0, 0)
284 return (0, 0)
285 return (int(m.group(1)), int(m.group(2)))
285 return (int(m.group(1)), int(m.group(2)))
286
286
287 # https://github.com/git-lfs/lfs-test-server
287 # https://github.com/git-lfs/lfs-test-server
288 @check("lfs-test-server", "git-lfs test server")
288 @check("lfs-test-server", "git-lfs test server")
289 def has_lfsserver():
289 def has_lfsserver():
290 exe = 'lfs-test-server'
290 exe = 'lfs-test-server'
291 if has_windows():
291 if has_windows():
292 exe = 'lfs-test-server.exe'
292 exe = 'lfs-test-server.exe'
293 return any(
293 return any(
294 os.access(os.path.join(path, exe), os.X_OK)
294 os.access(os.path.join(path, exe), os.X_OK)
295 for path in os.environ["PATH"].split(os.pathsep)
295 for path in os.environ["PATH"].split(os.pathsep)
296 )
296 )
297
297
298 @checkvers("git", "git client (with ext::sh support) version >= %s", (1.9,))
298 @checkvers("git", "git client (with ext::sh support) version >= %s", (1.9,))
299 def has_git_range(v):
299 def has_git_range(v):
300 major, minor = v.split('.')[0:2]
300 major, minor = v.split('.')[0:2]
301 return getgitversion() >= (int(major), int(minor))
301 return getgitversion() >= (int(major), int(minor))
302
302
303 @check("docutils", "Docutils text processing library")
303 @check("docutils", "Docutils text processing library")
304 def has_docutils():
304 def has_docutils():
305 try:
305 try:
306 import docutils.core
306 import docutils.core
307 docutils.core.publish_cmdline # silence unused import
307 docutils.core.publish_cmdline # silence unused import
308 return True
308 return True
309 except ImportError:
309 except ImportError:
310 return False
310 return False
311
311
312 def getsvnversion():
312 def getsvnversion():
313 m = matchoutput('svn --version --quiet 2>&1', br'^(\d+)\.(\d+)')
313 m = matchoutput('svn --version --quiet 2>&1', br'^(\d+)\.(\d+)')
314 if not m:
314 if not m:
315 return (0, 0)
315 return (0, 0)
316 return (int(m.group(1)), int(m.group(2)))
316 return (int(m.group(1)), int(m.group(2)))
317
317
318 @checkvers("svn", "subversion client and admin tools >= %s", (1.3, 1.5))
318 @checkvers("svn", "subversion client and admin tools >= %s", (1.3, 1.5))
319 def has_svn_range(v):
319 def has_svn_range(v):
320 major, minor = v.split('.')[0:2]
320 major, minor = v.split('.')[0:2]
321 return getsvnversion() >= (int(major), int(minor))
321 return getsvnversion() >= (int(major), int(minor))
322
322
323 @check("svn", "subversion client and admin tools")
323 @check("svn", "subversion client and admin tools")
324 def has_svn():
324 def has_svn():
325 return matchoutput('svn --version 2>&1', br'^svn, version') and \
325 return matchoutput('svn --version 2>&1', br'^svn, version') and \
326 matchoutput('svnadmin --version 2>&1', br'^svnadmin, version')
326 matchoutput('svnadmin --version 2>&1', br'^svnadmin, version')
327
327
328 @check("svn-bindings", "subversion python bindings")
328 @check("svn-bindings", "subversion python bindings")
329 def has_svn_bindings():
329 def has_svn_bindings():
330 try:
330 try:
331 import svn.core
331 import svn.core
332 version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
332 version = svn.core.SVN_VER_MAJOR, svn.core.SVN_VER_MINOR
333 if version < (1, 4):
333 if version < (1, 4):
334 return False
334 return False
335 return True
335 return True
336 except ImportError:
336 except ImportError:
337 return False
337 return False
338
338
339 @check("p4", "Perforce server and client")
339 @check("p4", "Perforce server and client")
340 def has_p4():
340 def has_p4():
341 return (matchoutput('p4 -V', br'Rev\. P4/') and
341 return (matchoutput('p4 -V', br'Rev\. P4/') and
342 matchoutput('p4d -V', br'Rev\. P4D/'))
342 matchoutput('p4d -V', br'Rev\. P4D/'))
343
343
344 @check("symlink", "symbolic links")
344 @check("symlink", "symbolic links")
345 def has_symlink():
345 def has_symlink():
346 if getattr(os, "symlink", None) is None:
346 if getattr(os, "symlink", None) is None:
347 return False
347 return False
348 name = tempfile.mktemp(dir='.', prefix=tempprefix)
348 name = tempfile.mktemp(dir='.', prefix=tempprefix)
349 try:
349 try:
350 os.symlink(".", name)
350 os.symlink(".", name)
351 os.unlink(name)
351 os.unlink(name)
352 return True
352 return True
353 except (OSError, AttributeError):
353 except (OSError, AttributeError):
354 return False
354 return False
355
355
356 @check("hardlink", "hardlinks")
356 @check("hardlink", "hardlinks")
357 def has_hardlink():
357 def has_hardlink():
358 from mercurial import util
358 from mercurial import util
359 fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
359 fh, fn = tempfile.mkstemp(dir='.', prefix=tempprefix)
360 os.close(fh)
360 os.close(fh)
361 name = tempfile.mktemp(dir='.', prefix=tempprefix)
361 name = tempfile.mktemp(dir='.', prefix=tempprefix)
362 try:
362 try:
363 util.oslink(fn, name)
363 util.oslink(fn, name)
364 os.unlink(name)
364 os.unlink(name)
365 return True
365 return True
366 except OSError:
366 except OSError:
367 return False
367 return False
368 finally:
368 finally:
369 os.unlink(fn)
369 os.unlink(fn)
370
370
371 @check("hardlink-whitelisted", "hardlinks on whitelisted filesystems")
371 @check("hardlink-whitelisted", "hardlinks on whitelisted filesystems")
372 def has_hardlink_whitelisted():
372 def has_hardlink_whitelisted():
373 from mercurial import util
373 from mercurial import util
374 try:
374 try:
375 fstype = util.getfstype(b'.')
375 fstype = util.getfstype(b'.')
376 except OSError:
376 except OSError:
377 return False
377 return False
378 return fstype in util._hardlinkfswhitelist
378 return fstype in util._hardlinkfswhitelist
379
379
380 @check("rmcwd", "can remove current working directory")
380 @check("rmcwd", "can remove current working directory")
381 def has_rmcwd():
381 def has_rmcwd():
382 ocwd = os.getcwd()
382 ocwd = os.getcwd()
383 temp = tempfile.mkdtemp(dir='.', prefix=tempprefix)
383 temp = tempfile.mkdtemp(dir='.', prefix=tempprefix)
384 try:
384 try:
385 os.chdir(temp)
385 os.chdir(temp)
386 # On Linux, 'rmdir .' isn't allowed, but the other names are okay.
386 # On Linux, 'rmdir .' isn't allowed, but the other names are okay.
387 # On Solaris and Windows, the cwd can't be removed by any names.
387 # On Solaris and Windows, the cwd can't be removed by any names.
388 os.rmdir(os.getcwd())
388 os.rmdir(os.getcwd())
389 return True
389 return True
390 except OSError:
390 except OSError:
391 return False
391 return False
392 finally:
392 finally:
393 os.chdir(ocwd)
393 os.chdir(ocwd)
394 # clean up temp dir on platforms where cwd can't be removed
394 # clean up temp dir on platforms where cwd can't be removed
395 try:
395 try:
396 os.rmdir(temp)
396 os.rmdir(temp)
397 except OSError:
397 except OSError:
398 pass
398 pass
399
399
400 @check("tla", "GNU Arch tla client")
400 @check("tla", "GNU Arch tla client")
401 def has_tla():
401 def has_tla():
402 return matchoutput('tla --version 2>&1', br'The GNU Arch Revision')
402 return matchoutput('tla --version 2>&1', br'The GNU Arch Revision')
403
403
404 @check("gpg", "gpg client")
404 @check("gpg", "gpg client")
405 def has_gpg():
405 def has_gpg():
406 return matchoutput('gpg --version 2>&1', br'GnuPG')
406 return matchoutput('gpg --version 2>&1', br'GnuPG')
407
407
408 @check("gpg2", "gpg client v2")
408 @check("gpg2", "gpg client v2")
409 def has_gpg2():
409 def has_gpg2():
410 return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.')
410 return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.')
411
411
412 @check("gpg21", "gpg client v2.1+")
412 @check("gpg21", "gpg client v2.1+")
413 def has_gpg21():
413 def has_gpg21():
414 return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.(?!0)')
414 return matchoutput('gpg --version 2>&1', br'GnuPG[^0-9]+2\.(?!0)')
415
415
416 @check("unix-permissions", "unix-style permissions")
416 @check("unix-permissions", "unix-style permissions")
417 def has_unix_permissions():
417 def has_unix_permissions():
418 d = tempfile.mkdtemp(dir='.', prefix=tempprefix)
418 d = tempfile.mkdtemp(dir='.', prefix=tempprefix)
419 try:
419 try:
420 fname = os.path.join(d, 'foo')
420 fname = os.path.join(d, 'foo')
421 for umask in (0o77, 0o07, 0o22):
421 for umask in (0o77, 0o07, 0o22):
422 os.umask(umask)
422 os.umask(umask)
423 f = open(fname, 'w')
423 f = open(fname, 'w')
424 f.close()
424 f.close()
425 mode = os.stat(fname).st_mode
425 mode = os.stat(fname).st_mode
426 os.unlink(fname)
426 os.unlink(fname)
427 if mode & 0o777 != ~umask & 0o666:
427 if mode & 0o777 != ~umask & 0o666:
428 return False
428 return False
429 return True
429 return True
430 finally:
430 finally:
431 os.rmdir(d)
431 os.rmdir(d)
432
432
433 @check("unix-socket", "AF_UNIX socket family")
433 @check("unix-socket", "AF_UNIX socket family")
434 def has_unix_socket():
434 def has_unix_socket():
435 return getattr(socket, 'AF_UNIX', None) is not None
435 return getattr(socket, 'AF_UNIX', None) is not None
436
436
437 @check("root", "root permissions")
437 @check("root", "root permissions")
438 def has_root():
438 def has_root():
439 return getattr(os, 'geteuid', None) and os.geteuid() == 0
439 return getattr(os, 'geteuid', None) and os.geteuid() == 0
440
440
441 @check("pyflakes", "Pyflakes python linter")
441 @check("pyflakes", "Pyflakes python linter")
442 def has_pyflakes():
442 def has_pyflakes():
443 return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",
443 return matchoutput("sh -c \"echo 'import re' 2>&1 | pyflakes\"",
444 br"<stdin>:1: 're' imported but unused",
444 br"<stdin>:1: 're' imported but unused",
445 True)
445 True)
446
446
447 @check("pylint", "Pylint python linter")
447 @check("pylint", "Pylint python linter")
448 def has_pylint():
448 def has_pylint():
449 return matchoutput("pylint --help",
449 return matchoutput("pylint --help",
450 br"Usage: pylint",
450 br"Usage: pylint",
451 True)
451 True)
452
452
453 @check("clang-format", "clang-format C code formatter")
453 @check("clang-format", "clang-format C code formatter")
454 def has_clang_format():
454 def has_clang_format():
455 return matchoutput("clang-format --help",
455 return matchoutput("clang-format --help",
456 br"^OVERVIEW: A tool to format C/C\+\+[^ ]+ code.")
456 br"^OVERVIEW: A tool to format C/C\+\+[^ ]+ code.")
457
457
458 @check("jshint", "JSHint static code analysis tool")
458 @check("jshint", "JSHint static code analysis tool")
459 def has_jshint():
459 def has_jshint():
460 return matchoutput("jshint --version 2>&1", br"jshint v")
460 return matchoutput("jshint --version 2>&1", br"jshint v")
461
461
462 @check("pygments", "Pygments source highlighting library")
462 @check("pygments", "Pygments source highlighting library")
463 def has_pygments():
463 def has_pygments():
464 try:
464 try:
465 import pygments
465 import pygments
466 pygments.highlight # silence unused import warning
466 pygments.highlight # silence unused import warning
467 return True
467 return True
468 except ImportError:
468 except ImportError:
469 return False
469 return False
470
470
471 @check("outer-repo", "outer repo")
471 @check("outer-repo", "outer repo")
472 def has_outer_repo():
472 def has_outer_repo():
473 # failing for other reasons than 'no repo' imply that there is a repo
473 # failing for other reasons than 'no repo' imply that there is a repo
474 return not matchoutput('hg root 2>&1',
474 return not matchoutput('hg root 2>&1',
475 br'abort: no repository found', True)
475 br'abort: no repository found', True)
476
476
477 @check("ssl", "ssl module available")
477 @check("ssl", "ssl module available")
478 def has_ssl():
478 def has_ssl():
479 try:
479 try:
480 import ssl
480 import ssl
481 ssl.CERT_NONE
481 ssl.CERT_NONE
482 return True
482 return True
483 except ImportError:
483 except ImportError:
484 return False
484 return False
485
485
486 @check("sslcontext", "python >= 2.7.9 ssl")
486 @check("sslcontext", "python >= 2.7.9 ssl")
487 def has_sslcontext():
487 def has_sslcontext():
488 try:
488 try:
489 import ssl
489 import ssl
490 ssl.SSLContext
490 ssl.SSLContext
491 return True
491 return True
492 except (ImportError, AttributeError):
492 except (ImportError, AttributeError):
493 return False
493 return False
494
494
495 @check("defaultcacerts", "can verify SSL certs by system's CA certs store")
495 @check("defaultcacerts", "can verify SSL certs by system's CA certs store")
496 def has_defaultcacerts():
496 def has_defaultcacerts():
497 from mercurial import sslutil, ui as uimod
497 from mercurial import sslutil, ui as uimod
498 ui = uimod.ui.load()
498 ui = uimod.ui.load()
499 return sslutil._defaultcacerts(ui) or sslutil._canloaddefaultcerts
499 return sslutil._defaultcacerts(ui) or sslutil._canloaddefaultcerts
500
500
501 @check("defaultcacertsloaded", "detected presence of loaded system CA certs")
501 @check("defaultcacertsloaded", "detected presence of loaded system CA certs")
502 def has_defaultcacertsloaded():
502 def has_defaultcacertsloaded():
503 import ssl
503 import ssl
504 from mercurial import sslutil, ui as uimod
504 from mercurial import sslutil, ui as uimod
505
505
506 if not has_defaultcacerts():
506 if not has_defaultcacerts():
507 return False
507 return False
508 if not has_sslcontext():
508 if not has_sslcontext():
509 return False
509 return False
510
510
511 ui = uimod.ui.load()
511 ui = uimod.ui.load()
512 cafile = sslutil._defaultcacerts(ui)
512 cafile = sslutil._defaultcacerts(ui)
513 ctx = ssl.create_default_context()
513 ctx = ssl.create_default_context()
514 if cafile:
514 if cafile:
515 ctx.load_verify_locations(cafile=cafile)
515 ctx.load_verify_locations(cafile=cafile)
516 else:
516 else:
517 ctx.load_default_certs()
517 ctx.load_default_certs()
518
518
519 return len(ctx.get_ca_certs()) > 0
519 return len(ctx.get_ca_certs()) > 0
520
520
521 @check("tls1.2", "TLS 1.2 protocol support")
521 @check("tls1.2", "TLS 1.2 protocol support")
522 def has_tls1_2():
522 def has_tls1_2():
523 from mercurial import sslutil
523 from mercurial import sslutil
524 return 'tls1.2' in sslutil.supportedprotocols
524 return 'tls1.2' in sslutil.supportedprotocols
525
525
526 @check("windows", "Windows")
526 @check("windows", "Windows")
527 def has_windows():
527 def has_windows():
528 return os.name == 'nt'
528 return os.name == 'nt'
529
529
530 @check("system-sh", "system() uses sh")
530 @check("system-sh", "system() uses sh")
531 def has_system_sh():
531 def has_system_sh():
532 return os.name != 'nt'
532 return os.name != 'nt'
533
533
534 @check("serve", "platform and python can manage 'hg serve -d'")
534 @check("serve", "platform and python can manage 'hg serve -d'")
535 def has_serve():
535 def has_serve():
536 return True
536 return True
537
537
538 @check("test-repo", "running tests from repository")
538 @check("test-repo", "running tests from repository")
539 def has_test_repo():
539 def has_test_repo():
540 t = os.environ["TESTDIR"]
540 t = os.environ["TESTDIR"]
541 return os.path.isdir(os.path.join(t, "..", ".hg"))
541 return os.path.isdir(os.path.join(t, "..", ".hg"))
542
542
543 @check("tic", "terminfo compiler and curses module")
543 @check("tic", "terminfo compiler and curses module")
544 def has_tic():
544 def has_tic():
545 try:
545 try:
546 import curses
546 import curses
547 curses.COLOR_BLUE
547 curses.COLOR_BLUE
548 return matchoutput('test -x "`which tic`"', br'')
548 return matchoutput('test -x "`which tic`"', br'')
549 except ImportError:
549 except ImportError:
550 return False
550 return False
551
551
552 @check("msys", "Windows with MSYS")
552 @check("msys", "Windows with MSYS")
553 def has_msys():
553 def has_msys():
554 return os.getenv('MSYSTEM')
554 return os.getenv('MSYSTEM')
555
555
556 @check("aix", "AIX")
556 @check("aix", "AIX")
557 def has_aix():
557 def has_aix():
558 return sys.platform.startswith("aix")
558 return sys.platform.startswith("aix")
559
559
560 @check("osx", "OS X")
560 @check("osx", "OS X")
561 def has_osx():
561 def has_osx():
562 return sys.platform == 'darwin'
562 return sys.platform == 'darwin'
563
563
564 @check("osxpackaging", "OS X packaging tools")
564 @check("osxpackaging", "OS X packaging tools")
565 def has_osxpackaging():
565 def has_osxpackaging():
566 try:
566 try:
567 return (matchoutput('pkgbuild', br'Usage: pkgbuild ', ignorestatus=1)
567 return (matchoutput('pkgbuild', br'Usage: pkgbuild ', ignorestatus=1)
568 and matchoutput(
568 and matchoutput(
569 'productbuild', br'Usage: productbuild ',
569 'productbuild', br'Usage: productbuild ',
570 ignorestatus=1)
570 ignorestatus=1)
571 and matchoutput('lsbom', br'Usage: lsbom', ignorestatus=1)
571 and matchoutput('lsbom', br'Usage: lsbom', ignorestatus=1)
572 and matchoutput(
572 and matchoutput(
573 'xar --help', br'Usage: xar', ignorestatus=1))
573 'xar --help', br'Usage: xar', ignorestatus=1))
574 except ImportError:
574 except ImportError:
575 return False
575 return False
576
576
577 @check('linuxormacos', 'Linux or MacOS')
577 @check('linuxormacos', 'Linux or MacOS')
578 def has_linuxormacos():
578 def has_linuxormacos():
579 # This isn't a perfect test for MacOS. But it is sufficient for our needs.
579 # This isn't a perfect test for MacOS. But it is sufficient for our needs.
580 return sys.platform.startswith(('linux', 'darwin'))
580 return sys.platform.startswith(('linux', 'darwin'))
581
581
582 @check("docker", "docker support")
582 @check("docker", "docker support")
583 def has_docker():
583 def has_docker():
584 pat = br'A self-sufficient runtime for'
584 pat = br'A self-sufficient runtime for'
585 if matchoutput('docker --help', pat):
585 if matchoutput('docker --help', pat):
586 if 'linux' not in sys.platform:
586 if 'linux' not in sys.platform:
587 # TODO: in theory we should be able to test docker-based
587 # TODO: in theory we should be able to test docker-based
588 # package creation on non-linux using boot2docker, but in
588 # package creation on non-linux using boot2docker, but in
589 # practice that requires extra coordination to make sure
589 # practice that requires extra coordination to make sure
590 # $TESTTEMP is going to be visible at the same path to the
590 # $TESTTEMP is going to be visible at the same path to the
591 # boot2docker VM. If we figure out how to verify that, we
591 # boot2docker VM. If we figure out how to verify that, we
592 # can use the following instead of just saying False:
592 # can use the following instead of just saying False:
593 # return 'DOCKER_HOST' in os.environ
593 # return 'DOCKER_HOST' in os.environ
594 return False
594 return False
595
595
596 return True
596 return True
597 return False
597 return False
598
598
599 @check("debhelper", "debian packaging tools")
599 @check("debhelper", "debian packaging tools")
600 def has_debhelper():
600 def has_debhelper():
601 # Some versions of dpkg say `dpkg', some say 'dpkg' (` vs ' on the first
601 # Some versions of dpkg say `dpkg', some say 'dpkg' (` vs ' on the first
602 # quote), so just accept anything in that spot.
602 # quote), so just accept anything in that spot.
603 dpkg = matchoutput('dpkg --version',
603 dpkg = matchoutput('dpkg --version',
604 br"Debian .dpkg' package management program")
604 br"Debian .dpkg' package management program")
605 dh = matchoutput('dh --help',
605 dh = matchoutput('dh --help',
606 br'dh is a part of debhelper.', ignorestatus=True)
606 br'dh is a part of debhelper.', ignorestatus=True)
607 dh_py2 = matchoutput('dh_python2 --help',
607 dh_py2 = matchoutput('dh_python2 --help',
608 br'other supported Python versions')
608 br'other supported Python versions')
609 # debuild comes from the 'devscripts' package, though you might want
609 # debuild comes from the 'devscripts' package, though you might want
610 # the 'build-debs' package instead, which has a dependency on devscripts.
610 # the 'build-debs' package instead, which has a dependency on devscripts.
611 debuild = matchoutput('debuild --help',
611 debuild = matchoutput('debuild --help',
612 br'to run debian/rules with given parameter')
612 br'to run debian/rules with given parameter')
613 return dpkg and dh and dh_py2 and debuild
613 return dpkg and dh and dh_py2 and debuild
614
614
615 @check("debdeps",
615 @check("debdeps",
616 "debian build dependencies (run dpkg-checkbuilddeps in contrib/)")
616 "debian build dependencies (run dpkg-checkbuilddeps in contrib/)")
617 def has_debdeps():
617 def has_debdeps():
618 # just check exit status (ignoring output)
618 # just check exit status (ignoring output)
619 path = '%s/../contrib/debian/control' % os.environ['TESTDIR']
619 path = '%s/../contrib/debian/control' % os.environ['TESTDIR']
620 return matchoutput('dpkg-checkbuilddeps %s' % path, br'')
620 return matchoutput('dpkg-checkbuilddeps %s' % path, br'')
621
621
622 @check("demandimport", "demandimport enabled")
622 @check("demandimport", "demandimport enabled")
623 def has_demandimport():
623 def has_demandimport():
624 # chg disables demandimport intentionally for performance wins.
624 # chg disables demandimport intentionally for performance wins.
625 return ((not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable')
625 return ((not has_chg()) and os.environ.get('HGDEMANDIMPORT') != 'disable')
626
626
627 @check("py3k", "running with Python 3.x")
627 @check("py3k", "running with Python 3.x")
628 def has_py3k():
628 def has_py3k():
629 return 3 == sys.version_info[0]
629 return 3 == sys.version_info[0]
630
630
631 @check("py3exe", "a Python 3.x interpreter is available")
631 @check("py3exe", "a Python 3.x interpreter is available")
632 def has_python3exe():
632 def has_python3exe():
633 return 'PYTHON3' in os.environ
633 return 'PYTHON3' in os.environ
634
634
635 @check("py3pygments", "Pygments available on Python 3.x")
635 @check("py3pygments", "Pygments available on Python 3.x")
636 def has_py3pygments():
636 def has_py3pygments():
637 if has_py3k():
637 if has_py3k():
638 return has_pygments()
638 return has_pygments()
639 elif has_python3exe():
639 elif has_python3exe():
640 # just check exit status (ignoring output)
640 # just check exit status (ignoring output)
641 py3 = os.environ['PYTHON3']
641 py3 = os.environ['PYTHON3']
642 return matchoutput('%s -c "import pygments"' % py3, br'')
642 return matchoutput('%s -c "import pygments"' % py3, br'')
643 return False
643 return False
644
644
645 @check("pure", "running with pure Python code")
645 @check("pure", "running with pure Python code")
646 def has_pure():
646 def has_pure():
647 return any([
647 return any([
648 os.environ.get("HGMODULEPOLICY") == "py",
648 os.environ.get("HGMODULEPOLICY") == "py",
649 os.environ.get("HGTEST_RUN_TESTS_PURE") == "--pure",
649 os.environ.get("HGTEST_RUN_TESTS_PURE") == "--pure",
650 ])
650 ])
651
651
652 @check("slow", "allow slow tests (use --allow-slow-tests)")
652 @check("slow", "allow slow tests (use --allow-slow-tests)")
653 def has_slow():
653 def has_slow():
654 return os.environ.get('HGTEST_SLOW') == 'slow'
654 return os.environ.get('HGTEST_SLOW') == 'slow'
655
655
656 @check("hypothesis", "Hypothesis automated test generation")
656 @check("hypothesis", "Hypothesis automated test generation")
657 def has_hypothesis():
657 def has_hypothesis():
658 try:
658 try:
659 import hypothesis
659 import hypothesis
660 hypothesis.given
660 hypothesis.given
661 return True
661 return True
662 except ImportError:
662 except ImportError:
663 return False
663 return False
664
664
665 @check("unziplinks", "unzip(1) understands and extracts symlinks")
665 @check("unziplinks", "unzip(1) understands and extracts symlinks")
666 def unzip_understands_symlinks():
666 def unzip_understands_symlinks():
667 return matchoutput('unzip --help', br'Info-ZIP')
667 return matchoutput('unzip --help', br'Info-ZIP')
668
668
669 @check("zstd", "zstd Python module available")
669 @check("zstd", "zstd Python module available")
670 def has_zstd():
670 def has_zstd():
671 try:
671 try:
672 import mercurial.zstd
672 import mercurial.zstd
673 mercurial.zstd.__version__
673 mercurial.zstd.__version__
674 return True
674 return True
675 except ImportError:
675 except ImportError:
676 return False
676 return False
677
677
678 @check("devfull", "/dev/full special file")
678 @check("devfull", "/dev/full special file")
679 def has_dev_full():
679 def has_dev_full():
680 return os.path.exists('/dev/full')
680 return os.path.exists('/dev/full')
681
681
682 @check("virtualenv", "Python virtualenv support")
682 @check("virtualenv", "Python virtualenv support")
683 def has_virtualenv():
683 def has_virtualenv():
684 try:
684 try:
685 import virtualenv
685 import virtualenv
686 virtualenv.ACTIVATE_SH
686 virtualenv.ACTIVATE_SH
687 return True
687 return True
688 except ImportError:
688 except ImportError:
689 return False
689 return False
690
690
691 @check("fsmonitor", "running tests with fsmonitor")
691 @check("fsmonitor", "running tests with fsmonitor")
692 def has_fsmonitor():
692 def has_fsmonitor():
693 return 'HGFSMONITOR_TESTS' in os.environ
693 return 'HGFSMONITOR_TESTS' in os.environ
694
694
695 @check("fuzzywuzzy", "Fuzzy string matching library")
695 @check("fuzzywuzzy", "Fuzzy string matching library")
696 def has_fuzzywuzzy():
696 def has_fuzzywuzzy():
697 try:
697 try:
698 import fuzzywuzzy
698 import fuzzywuzzy
699 fuzzywuzzy.__version__
699 fuzzywuzzy.__version__
700 return True
700 return True
701 except ImportError:
701 except ImportError:
702 return False
702 return False
703
703
704 @check("clang-libfuzzer", "clang new enough to include libfuzzer")
704 @check("clang-libfuzzer", "clang new enough to include libfuzzer")
705 def has_clang_libfuzzer():
705 def has_clang_libfuzzer():
706 mat = matchoutput('clang --version', b'clang version (\d)')
706 mat = matchoutput('clang --version', b'clang version (\d)')
707 if mat:
707 if mat:
708 # libfuzzer is new in clang 6
708 # libfuzzer is new in clang 6
709 return int(mat.group(1)) > 5
709 return int(mat.group(1)) > 5
710 return False
710 return False
711
711
712 @check("xdiff", "xdiff algorithm")
712 @check("xdiff", "xdiff algorithm")
713 def has_xdiff():
713 def has_xdiff():
714 try:
714 try:
715 from mercurial import policy
715 from mercurial import policy
716 bdiff = policy.importmod('bdiff')
716 bdiff = policy.importmod('bdiff')
717 return bdiff.xdiffblocks(b'', b'') == [(0, 0, 0, 0)]
717 return bdiff.xdiffblocks(b'', b'') == [(0, 0, 0, 0)]
718 except (ImportError, AttributeError):
718 except (ImportError, AttributeError):
719 return False
719 return False
720
720
721 @check('extraextensions', 'whether tests are running with extra extensions')
721 @check('extraextensions', 'whether tests are running with extra extensions')
722 def has_extraextensions():
722 def has_extraextensions():
723 return 'HGTESTEXTRAEXTENSIONS' in os.environ
723 return 'HGTESTEXTRAEXTENSIONS' in os.environ
724
724
725 def getrepofeatures():
725 def getrepofeatures():
726 """Obtain set of repository features in use.
726 """Obtain set of repository features in use.
727
727
728 HGREPOFEATURES can be used to define or remove features. It contains
728 HGREPOFEATURES can be used to define or remove features. It contains
729 a space-delimited list of feature strings. Strings beginning with ``-``
729 a space-delimited list of feature strings. Strings beginning with ``-``
730 mean to remove.
730 mean to remove.
731 """
731 """
732 # Default list provided by core.
732 # Default list provided by core.
733 features = {
733 features = {
734 'bundlerepo',
734 'bundlerepo',
735 'revlogstore',
735 'revlogstore',
736 'fncache',
736 }
737 }
737
738
738 # Features that imply other features.
739 # Features that imply other features.
739 implies = {
740 implies = {
740 'simplestore': ['-revlogstore', '-bundlerepo'],
741 'simplestore': ['-revlogstore', '-bundlerepo', '-fncache'],
741 }
742 }
742
743
743 for override in os.environ.get('HGREPOFEATURES', '').split(' '):
744 for override in os.environ.get('HGREPOFEATURES', '').split(' '):
744 if not override:
745 if not override:
745 continue
746 continue
746
747
747 if override.startswith('-'):
748 if override.startswith('-'):
748 if override[1:] in features:
749 if override[1:] in features:
749 features.remove(override[1:])
750 features.remove(override[1:])
750 else:
751 else:
751 features.add(override)
752 features.add(override)
752
753
753 for imply in implies.get(override, []):
754 for imply in implies.get(override, []):
754 if imply.startswith('-'):
755 if imply.startswith('-'):
755 if imply[1:] in features:
756 if imply[1:] in features:
756 features.remove(imply[1:])
757 features.remove(imply[1:])
757 else:
758 else:
758 features.add(imply)
759 features.add(imply)
759
760
760 return features
761 return features
761
762
762 @check('reporevlogstore', 'repository using the default revlog store')
763 @check('reporevlogstore', 'repository using the default revlog store')
763 def has_reporevlogstore():
764 def has_reporevlogstore():
764 return 'revlogstore' in getrepofeatures()
765 return 'revlogstore' in getrepofeatures()
765
766
766 @check('reposimplestore', 'repository using simple storage extension')
767 @check('reposimplestore', 'repository using simple storage extension')
767 def has_reposimplestore():
768 def has_reposimplestore():
768 return 'simplestore' in getrepofeatures()
769 return 'simplestore' in getrepofeatures()
769
770
770 @check('repobundlerepo', 'whether we can open bundle files as repos')
771 @check('repobundlerepo', 'whether we can open bundle files as repos')
771 def has_repobundlerepo():
772 def has_repobundlerepo():
772 return 'bundlerepo' in getrepofeatures()
773 return 'bundlerepo' in getrepofeatures()
774
775 @check('repofncache', 'repository has an fncache')
776 def has_repofncache():
777 return 'fncache' in getrepofeatures()
@@ -1,595 +1,664 b''
1 # simplestorerepo.py - Extension that swaps in alternate repository storage.
1 # simplestorerepo.py - Extension that swaps in alternate repository storage.
2 #
2 #
3 # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com>
3 # Copyright 2018 Gregory Szorc <gregory.szorc@gmail.com>
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 # To use this with the test suite:
8 # To use this with the test suite:
9 #
9 #
10 # $ HGREPOFEATURES="simplestore" ./run-tests.py \
10 # $ HGREPOFEATURES="simplestore" ./run-tests.py \
11 # --extra-config-opt extensions.simplestore=`pwd`/simplestorerepo.py
11 # --extra-config-opt extensions.simplestore=`pwd`/simplestorerepo.py
12
12
13 from __future__ import absolute_import
13 from __future__ import absolute_import
14
14
15 import stat
16
15 from mercurial.i18n import _
17 from mercurial.i18n import _
16 from mercurial.node import (
18 from mercurial.node import (
17 bin,
19 bin,
18 hex,
20 hex,
19 nullid,
21 nullid,
20 nullrev,
22 nullrev,
21 )
23 )
22 from mercurial.thirdparty import (
24 from mercurial.thirdparty import (
23 cbor,
25 cbor,
24 )
26 )
25 from mercurial import (
27 from mercurial import (
26 ancestor,
28 ancestor,
27 bundlerepo,
29 bundlerepo,
28 error,
30 error,
31 extensions,
29 filelog,
32 filelog,
33 localrepo,
30 mdiff,
34 mdiff,
31 pycompat,
35 pycompat,
32 revlog,
36 revlog,
37 store,
33 )
38 )
34
39
35 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
40 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
36 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
41 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should
37 # be specifying the version(s) of Mercurial they are tested with, or
42 # be specifying the version(s) of Mercurial they are tested with, or
38 # leave the attribute unspecified.
43 # leave the attribute unspecified.
39 testedwith = 'ships-with-hg-core'
44 testedwith = 'ships-with-hg-core'
40
45
46 REQUIREMENT = 'testonly-simplestore'
47
41 def validatenode(node):
48 def validatenode(node):
42 if isinstance(node, int):
49 if isinstance(node, int):
43 raise ValueError('expected node; got int')
50 raise ValueError('expected node; got int')
44
51
45 if len(node) != 20:
52 if len(node) != 20:
46 raise ValueError('expected 20 byte node')
53 raise ValueError('expected 20 byte node')
47
54
48 def validaterev(rev):
55 def validaterev(rev):
49 if not isinstance(rev, int):
56 if not isinstance(rev, int):
50 raise ValueError('expected int')
57 raise ValueError('expected int')
51
58
52 class filestorage(object):
59 class filestorage(object):
53 """Implements storage for a tracked path.
60 """Implements storage for a tracked path.
54
61
55 Data is stored in the VFS in a directory corresponding to the tracked
62 Data is stored in the VFS in a directory corresponding to the tracked
56 path.
63 path.
57
64
58 Index data is stored in an ``index`` file using CBOR.
65 Index data is stored in an ``index`` file using CBOR.
59
66
60 Fulltext data is stored in files having names of the node.
67 Fulltext data is stored in files having names of the node.
61 """
68 """
62
69
63 def __init__(self, svfs, path):
70 def __init__(self, svfs, path):
64 self._svfs = svfs
71 self._svfs = svfs
65 self._path = path
72 self._path = path
66
73
67 self._storepath = b'/'.join([b'data', path])
74 self._storepath = b'/'.join([b'data', path])
68 self._indexpath = b'/'.join([self._storepath, b'index'])
75 self._indexpath = b'/'.join([self._storepath, b'index'])
69
76
70 indexdata = self._svfs.tryread(self._indexpath)
77 indexdata = self._svfs.tryread(self._indexpath)
71 if indexdata:
78 if indexdata:
72 indexdata = cbor.loads(indexdata)
79 indexdata = cbor.loads(indexdata)
73
80
74 self._indexdata = indexdata or []
81 self._indexdata = indexdata or []
75 self._indexbynode = {}
82 self._indexbynode = {}
76 self._indexbyrev = {}
83 self._indexbyrev = {}
77 self.index = []
84 self.index = []
78 self._refreshindex()
85 self._refreshindex()
79
86
80 # This is used by changegroup code :/
87 # This is used by changegroup code :/
81 self._generaldelta = True
88 self._generaldelta = True
82 self.storedeltachains = False
89 self.storedeltachains = False
83
90
84 self.version = 1
91 self.version = 1
85
92
86 def _refreshindex(self):
93 def _refreshindex(self):
87 self._indexbynode.clear()
94 self._indexbynode.clear()
88 self._indexbyrev.clear()
95 self._indexbyrev.clear()
89 self.index = []
96 self.index = []
90
97
91 for i, entry in enumerate(self._indexdata):
98 for i, entry in enumerate(self._indexdata):
92 self._indexbynode[entry[b'node']] = entry
99 self._indexbynode[entry[b'node']] = entry
93 self._indexbyrev[i] = entry
100 self._indexbyrev[i] = entry
94
101
95 self._indexbynode[nullid] = {
102 self._indexbynode[nullid] = {
96 b'node': nullid,
103 b'node': nullid,
97 b'p1': nullid,
104 b'p1': nullid,
98 b'p2': nullid,
105 b'p2': nullid,
99 b'linkrev': nullrev,
106 b'linkrev': nullrev,
100 b'flags': 0,
107 b'flags': 0,
101 }
108 }
102
109
103 self._indexbyrev[nullrev] = {
110 self._indexbyrev[nullrev] = {
104 b'node': nullid,
111 b'node': nullid,
105 b'p1': nullid,
112 b'p1': nullid,
106 b'p2': nullid,
113 b'p2': nullid,
107 b'linkrev': nullrev,
114 b'linkrev': nullrev,
108 b'flags': 0,
115 b'flags': 0,
109 }
116 }
110
117
111 for i, entry in enumerate(self._indexdata):
118 for i, entry in enumerate(self._indexdata):
112 p1rev, p2rev = self.parentrevs(self.rev(entry[b'node']))
119 p1rev, p2rev = self.parentrevs(self.rev(entry[b'node']))
113
120
114 # start, length, rawsize, chainbase, linkrev, p1, p2, node
121 # start, length, rawsize, chainbase, linkrev, p1, p2, node
115 self.index.append((0, 0, 0, -1, entry[b'linkrev'], p1rev, p2rev,
122 self.index.append((0, 0, 0, -1, entry[b'linkrev'], p1rev, p2rev,
116 entry[b'node']))
123 entry[b'node']))
117
124
118 self.index.append((0, 0, 0, -1, -1, -1, -1, nullid))
125 self.index.append((0, 0, 0, -1, -1, -1, -1, nullid))
119
126
120 def __len__(self):
127 def __len__(self):
121 return len(self._indexdata)
128 return len(self._indexdata)
122
129
123 def __iter__(self):
130 def __iter__(self):
124 return iter(range(len(self)))
131 return iter(range(len(self)))
125
132
126 def revs(self, start=0, stop=None):
133 def revs(self, start=0, stop=None):
127 step = 1
134 step = 1
128 if stop is not None:
135 if stop is not None:
129 if start > stop:
136 if start > stop:
130 step = -1
137 step = -1
131
138
132 stop += step
139 stop += step
133 else:
140 else:
134 stop = len(self)
141 stop = len(self)
135
142
136 return range(start, stop, step)
143 return range(start, stop, step)
137
144
138 def parents(self, node):
145 def parents(self, node):
139 validatenode(node)
146 validatenode(node)
140
147
141 if node not in self._indexbynode:
148 if node not in self._indexbynode:
142 raise KeyError('unknown node')
149 raise KeyError('unknown node')
143
150
144 entry = self._indexbynode[node]
151 entry = self._indexbynode[node]
145
152
146 return entry[b'p1'], entry[b'p2']
153 return entry[b'p1'], entry[b'p2']
147
154
148 def parentrevs(self, rev):
155 def parentrevs(self, rev):
149 p1, p2 = self.parents(self._indexbyrev[rev][b'node'])
156 p1, p2 = self.parents(self._indexbyrev[rev][b'node'])
150 return self.rev(p1), self.rev(p2)
157 return self.rev(p1), self.rev(p2)
151
158
152 def rev(self, node):
159 def rev(self, node):
153 validatenode(node)
160 validatenode(node)
154
161
155 try:
162 try:
156 self._indexbynode[node]
163 self._indexbynode[node]
157 except KeyError:
164 except KeyError:
158 raise error.LookupError(node, self._indexpath, _('no node'))
165 raise error.LookupError(node, self._indexpath, _('no node'))
159
166
160 for rev, entry in self._indexbyrev.items():
167 for rev, entry in self._indexbyrev.items():
161 if entry[b'node'] == node:
168 if entry[b'node'] == node:
162 return rev
169 return rev
163
170
164 raise error.ProgrammingError('this should not occur')
171 raise error.ProgrammingError('this should not occur')
165
172
166 def node(self, rev):
173 def node(self, rev):
167 validaterev(rev)
174 validaterev(rev)
168
175
169 return self._indexbyrev[rev][b'node']
176 return self._indexbyrev[rev][b'node']
170
177
171 def lookup(self, node):
178 def lookup(self, node):
172 if isinstance(node, int):
179 if isinstance(node, int):
173 return self.node(node)
180 return self.node(node)
174
181
175 if len(node) == 20:
182 if len(node) == 20:
176 self.rev(node)
183 self.rev(node)
177 return node
184 return node
178
185
179 try:
186 try:
180 rev = int(node)
187 rev = int(node)
181 if '%d' % rev != node:
188 if '%d' % rev != node:
182 raise ValueError
189 raise ValueError
183
190
184 if rev < 0:
191 if rev < 0:
185 rev = len(self) + rev
192 rev = len(self) + rev
186 if rev < 0 or rev >= len(self):
193 if rev < 0 or rev >= len(self):
187 raise ValueError
194 raise ValueError
188
195
189 return self.node(rev)
196 return self.node(rev)
190 except (ValueError, OverflowError):
197 except (ValueError, OverflowError):
191 pass
198 pass
192
199
193 if len(node) == 40:
200 if len(node) == 40:
194 try:
201 try:
195 rawnode = bin(node)
202 rawnode = bin(node)
196 self.rev(rawnode)
203 self.rev(rawnode)
197 return rawnode
204 return rawnode
198 except TypeError:
205 except TypeError:
199 pass
206 pass
200
207
201 raise error.LookupError(node, self._path, _('invalid lookup input'))
208 raise error.LookupError(node, self._path, _('invalid lookup input'))
202
209
203 def linkrev(self, rev):
210 def linkrev(self, rev):
204 validaterev(rev)
211 validaterev(rev)
205
212
206 return self._indexbyrev[rev][b'linkrev']
213 return self._indexbyrev[rev][b'linkrev']
207
214
208 def flags(self, rev):
215 def flags(self, rev):
209 validaterev(rev)
216 validaterev(rev)
210
217
211 return self._indexbyrev[rev][b'flags']
218 return self._indexbyrev[rev][b'flags']
212
219
213 def deltaparent(self, rev):
220 def deltaparent(self, rev):
214 validaterev(rev)
221 validaterev(rev)
215
222
216 p1node = self.parents(self.node(rev))[0]
223 p1node = self.parents(self.node(rev))[0]
217 return self.rev(p1node)
224 return self.rev(p1node)
218
225
219 def candelta(self, baserev, rev):
226 def candelta(self, baserev, rev):
220 validaterev(baserev)
227 validaterev(baserev)
221 validaterev(rev)
228 validaterev(rev)
222
229
223 if ((self.flags(baserev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS)
230 if ((self.flags(baserev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS)
224 or (self.flags(rev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS)):
231 or (self.flags(rev) & revlog.REVIDX_RAWTEXT_CHANGING_FLAGS)):
225 return False
232 return False
226
233
227 return True
234 return True
228
235
229 def rawsize(self, rev):
236 def rawsize(self, rev):
230 validaterev(rev)
237 validaterev(rev)
231 node = self.node(rev)
238 node = self.node(rev)
232 return len(self.revision(node, raw=True))
239 return len(self.revision(node, raw=True))
233
240
234 def _processflags(self, text, flags, operation, raw=False):
241 def _processflags(self, text, flags, operation, raw=False):
235 if flags == 0:
242 if flags == 0:
236 return text, True
243 return text, True
237
244
238 validatehash = True
245 validatehash = True
239 # Depending on the operation (read or write), the order might be
246 # Depending on the operation (read or write), the order might be
240 # reversed due to non-commutative transforms.
247 # reversed due to non-commutative transforms.
241 orderedflags = revlog.REVIDX_FLAGS_ORDER
248 orderedflags = revlog.REVIDX_FLAGS_ORDER
242 if operation == 'write':
249 if operation == 'write':
243 orderedflags = reversed(orderedflags)
250 orderedflags = reversed(orderedflags)
244
251
245 for flag in orderedflags:
252 for flag in orderedflags:
246 # If a flagprocessor has been registered for a known flag, apply the
253 # If a flagprocessor has been registered for a known flag, apply the
247 # related operation transform and update result tuple.
254 # related operation transform and update result tuple.
248 if flag & flags:
255 if flag & flags:
249 vhash = True
256 vhash = True
250
257
251 if flag not in revlog._flagprocessors:
258 if flag not in revlog._flagprocessors:
252 message = _("missing processor for flag '%#x'") % (flag)
259 message = _("missing processor for flag '%#x'") % (flag)
253 raise revlog.RevlogError(message)
260 raise revlog.RevlogError(message)
254
261
255 processor = revlog._flagprocessors[flag]
262 processor = revlog._flagprocessors[flag]
256 if processor is not None:
263 if processor is not None:
257 readtransform, writetransform, rawtransform = processor
264 readtransform, writetransform, rawtransform = processor
258
265
259 if raw:
266 if raw:
260 vhash = rawtransform(self, text)
267 vhash = rawtransform(self, text)
261 elif operation == 'read':
268 elif operation == 'read':
262 text, vhash = readtransform(self, text)
269 text, vhash = readtransform(self, text)
263 else: # write operation
270 else: # write operation
264 text, vhash = writetransform(self, text)
271 text, vhash = writetransform(self, text)
265 validatehash = validatehash and vhash
272 validatehash = validatehash and vhash
266
273
267 return text, validatehash
274 return text, validatehash
268
275
269 def checkhash(self, text, node, p1=None, p2=None, rev=None):
276 def checkhash(self, text, node, p1=None, p2=None, rev=None):
270 if p1 is None and p2 is None:
277 if p1 is None and p2 is None:
271 p1, p2 = self.parents(node)
278 p1, p2 = self.parents(node)
272 if node != revlog.hash(text, p1, p2):
279 if node != revlog.hash(text, p1, p2):
273 raise error.RevlogError(_("integrity check failed on %s") %
280 raise error.RevlogError(_("integrity check failed on %s") %
274 self._path)
281 self._path)
275
282
276 def revision(self, node, raw=False):
283 def revision(self, node, raw=False):
277 validatenode(node)
284 validatenode(node)
278
285
279 if node == nullid:
286 if node == nullid:
280 return b''
287 return b''
281
288
282 rev = self.rev(node)
289 rev = self.rev(node)
283 flags = self.flags(rev)
290 flags = self.flags(rev)
284
291
285 path = b'/'.join([self._storepath, hex(node)])
292 path = b'/'.join([self._storepath, hex(node)])
286 rawtext = self._svfs.read(path)
293 rawtext = self._svfs.read(path)
287
294
288 text, validatehash = self._processflags(rawtext, flags, 'read', raw=raw)
295 text, validatehash = self._processflags(rawtext, flags, 'read', raw=raw)
289 if validatehash:
296 if validatehash:
290 self.checkhash(text, node, rev=rev)
297 self.checkhash(text, node, rev=rev)
291
298
292 return text
299 return text
293
300
294 def read(self, node):
301 def read(self, node):
295 validatenode(node)
302 validatenode(node)
296
303
297 revision = self.revision(node)
304 revision = self.revision(node)
298
305
299 if not revision.startswith(b'\1\n'):
306 if not revision.startswith(b'\1\n'):
300 return revision
307 return revision
301
308
302 start = revision.index(b'\1\n', 2)
309 start = revision.index(b'\1\n', 2)
303 return revision[start + 2:]
310 return revision[start + 2:]
304
311
305 def renamed(self, node):
312 def renamed(self, node):
306 validatenode(node)
313 validatenode(node)
307
314
308 if self.parents(node)[0] != nullid:
315 if self.parents(node)[0] != nullid:
309 return False
316 return False
310
317
311 fulltext = self.revision(node)
318 fulltext = self.revision(node)
312 m = filelog.parsemeta(fulltext)[0]
319 m = filelog.parsemeta(fulltext)[0]
313
320
314 if m and 'copy' in m:
321 if m and 'copy' in m:
315 return m['copy'], bin(m['copyrev'])
322 return m['copy'], bin(m['copyrev'])
316
323
317 return False
324 return False
318
325
319 def cmp(self, node, text):
326 def cmp(self, node, text):
320 validatenode(node)
327 validatenode(node)
321
328
322 t = text
329 t = text
323
330
324 if text.startswith(b'\1\n'):
331 if text.startswith(b'\1\n'):
325 t = b'\1\n\1\n' + text
332 t = b'\1\n\1\n' + text
326
333
327 p1, p2 = self.parents(node)
334 p1, p2 = self.parents(node)
328
335
329 if revlog.hash(t, p1, p2) == node:
336 if revlog.hash(t, p1, p2) == node:
330 return False
337 return False
331
338
332 if self.iscensored(self.rev(node)):
339 if self.iscensored(self.rev(node)):
333 return text != b''
340 return text != b''
334
341
335 if self.renamed(node):
342 if self.renamed(node):
336 t2 = self.read(node)
343 t2 = self.read(node)
337 return t2 != text
344 return t2 != text
338
345
339 return True
346 return True
340
347
341 def size(self, rev):
348 def size(self, rev):
342 validaterev(rev)
349 validaterev(rev)
343
350
344 node = self._indexbyrev[rev][b'node']
351 node = self._indexbyrev[rev][b'node']
345
352
346 if self.renamed(node):
353 if self.renamed(node):
347 return len(self.read(node))
354 return len(self.read(node))
348
355
349 if self.iscensored(rev):
356 if self.iscensored(rev):
350 return 0
357 return 0
351
358
352 return len(self.revision(node))
359 return len(self.revision(node))
353
360
354 def iscensored(self, rev):
361 def iscensored(self, rev):
355 validaterev(rev)
362 validaterev(rev)
356
363
357 return self.flags(rev) & revlog.REVIDX_ISCENSORED
364 return self.flags(rev) & revlog.REVIDX_ISCENSORED
358
365
359 def commonancestorsheads(self, a, b):
366 def commonancestorsheads(self, a, b):
360 validatenode(a)
367 validatenode(a)
361 validatenode(b)
368 validatenode(b)
362
369
363 a = self.rev(a)
370 a = self.rev(a)
364 b = self.rev(b)
371 b = self.rev(b)
365
372
366 ancestors = ancestor.commonancestorsheads(self.parentrevs, a, b)
373 ancestors = ancestor.commonancestorsheads(self.parentrevs, a, b)
367 return pycompat.maplist(self.node, ancestors)
374 return pycompat.maplist(self.node, ancestors)
368
375
369 def descendants(self, revs):
376 def descendants(self, revs):
370 # This is a copy of revlog.descendants()
377 # This is a copy of revlog.descendants()
371 first = min(revs)
378 first = min(revs)
372 if first == nullrev:
379 if first == nullrev:
373 for i in self:
380 for i in self:
374 yield i
381 yield i
375 return
382 return
376
383
377 seen = set(revs)
384 seen = set(revs)
378 for i in self.revs(start=first + 1):
385 for i in self.revs(start=first + 1):
379 for x in self.parentrevs(i):
386 for x in self.parentrevs(i):
380 if x != nullrev and x in seen:
387 if x != nullrev and x in seen:
381 seen.add(i)
388 seen.add(i)
382 yield i
389 yield i
383 break
390 break
384
391
385 # Required by verify.
392 # Required by verify.
386 def files(self):
393 def files(self):
387 entries = self._svfs.listdir(self._storepath)
394 entries = self._svfs.listdir(self._storepath)
388
395
389 # Strip out undo.backup.* files created as part of transaction
396 # Strip out undo.backup.* files created as part of transaction
390 # recording.
397 # recording.
391 entries = [f for f in entries if not f.startswith('undo.backup.')]
398 entries = [f for f in entries if not f.startswith('undo.backup.')]
392
399
393 return [b'/'.join((self._storepath, f)) for f in entries]
400 return [b'/'.join((self._storepath, f)) for f in entries]
394
401
395 # Required by verify.
402 # Required by verify.
396 def checksize(self):
403 def checksize(self):
397 return 0, 0
404 return 0, 0
398
405
399 def add(self, text, meta, transaction, linkrev, p1, p2):
406 def add(self, text, meta, transaction, linkrev, p1, p2):
400 if meta or text.startswith(b'\1\n'):
407 if meta or text.startswith(b'\1\n'):
401 text = filelog.packmeta(meta, text)
408 text = filelog.packmeta(meta, text)
402
409
403 return self.addrevision(text, transaction, linkrev, p1, p2)
410 return self.addrevision(text, transaction, linkrev, p1, p2)
404
411
405 def addrevision(self, text, transaction, linkrev, p1, p2, node=None,
412 def addrevision(self, text, transaction, linkrev, p1, p2, node=None,
406 flags=0):
413 flags=0):
407 validatenode(p1)
414 validatenode(p1)
408 validatenode(p2)
415 validatenode(p2)
409
416
410 if flags:
417 if flags:
411 node = node or revlog.hash(text, p1, p2)
418 node = node or revlog.hash(text, p1, p2)
412
419
413 rawtext, validatehash = self._processflags(text, flags, 'write')
420 rawtext, validatehash = self._processflags(text, flags, 'write')
414
421
415 node = node or revlog.hash(text, p1, p2)
422 node = node or revlog.hash(text, p1, p2)
416
423
417 if node in self._indexbynode:
424 if node in self._indexbynode:
418 return node
425 return node
419
426
420 if validatehash:
427 if validatehash:
421 self.checkhash(rawtext, node, p1=p1, p2=p2)
428 self.checkhash(rawtext, node, p1=p1, p2=p2)
422
429
423 path = b'/'.join([self._storepath, hex(node)])
430 path = b'/'.join([self._storepath, hex(node)])
424
431
425 self._svfs.write(path, text)
432 self._svfs.write(path, text)
426
433
427 self._indexdata.append({
434 self._indexdata.append({
428 b'node': node,
435 b'node': node,
429 b'p1': p1,
436 b'p1': p1,
430 b'p2': p2,
437 b'p2': p2,
431 b'linkrev': linkrev,
438 b'linkrev': linkrev,
432 b'flags': flags,
439 b'flags': flags,
433 })
440 })
434
441
435 self._reflectindexupdate()
442 self._reflectindexupdate()
436
443
437 return node
444 return node
438
445
439 def _reflectindexupdate(self):
446 def _reflectindexupdate(self):
440 self._refreshindex()
447 self._refreshindex()
441 self._svfs.write(self._indexpath, cbor.dumps(self._indexdata))
448 self._svfs.write(self._indexpath, cbor.dumps(self._indexdata))
442
449
443 def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None):
450 def addgroup(self, deltas, linkmapper, transaction, addrevisioncb=None):
444 nodes = []
451 nodes = []
445
452
446 transaction.addbackup(self._indexpath)
453 transaction.addbackup(self._indexpath)
447
454
448 for node, p1, p2, linknode, deltabase, delta, flags in deltas:
455 for node, p1, p2, linknode, deltabase, delta, flags in deltas:
449 linkrev = linkmapper(linknode)
456 linkrev = linkmapper(linknode)
450
457
451 nodes.append(node)
458 nodes.append(node)
452
459
453 if node in self._indexbynode:
460 if node in self._indexbynode:
454 continue
461 continue
455
462
456 # Need to resolve the fulltext from the delta base.
463 # Need to resolve the fulltext from the delta base.
457 if deltabase == nullid:
464 if deltabase == nullid:
458 text = mdiff.patch(b'', delta)
465 text = mdiff.patch(b'', delta)
459 else:
466 else:
460 text = mdiff.patch(self.revision(deltabase), delta)
467 text = mdiff.patch(self.revision(deltabase), delta)
461
468
462 self.addrevision(text, transaction, linkrev, p1, p2, flags)
469 self.addrevision(text, transaction, linkrev, p1, p2, flags)
463
470
464 if addrevisioncb:
471 if addrevisioncb:
465 addrevisioncb(self, node)
472 addrevisioncb(self, node)
466
473
467 return nodes
474 return nodes
468
475
469 def revdiff(self, rev1, rev2):
476 def revdiff(self, rev1, rev2):
470 validaterev(rev1)
477 validaterev(rev1)
471 validaterev(rev2)
478 validaterev(rev2)
472
479
473 node1 = self.node(rev1)
480 node1 = self.node(rev1)
474 node2 = self.node(rev2)
481 node2 = self.node(rev2)
475
482
476 return mdiff.textdiff(self.revision(node1, raw=True),
483 return mdiff.textdiff(self.revision(node1, raw=True),
477 self.revision(node2, raw=True))
484 self.revision(node2, raw=True))
478
485
479 def headrevs(self):
486 def headrevs(self):
480 # Assume all revisions are heads by default.
487 # Assume all revisions are heads by default.
481 revishead = {rev: True for rev in self._indexbyrev}
488 revishead = {rev: True for rev in self._indexbyrev}
482
489
483 for rev, entry in self._indexbyrev.items():
490 for rev, entry in self._indexbyrev.items():
484 # Unset head flag for all seen parents.
491 # Unset head flag for all seen parents.
485 revishead[self.rev(entry[b'p1'])] = False
492 revishead[self.rev(entry[b'p1'])] = False
486 revishead[self.rev(entry[b'p2'])] = False
493 revishead[self.rev(entry[b'p2'])] = False
487
494
488 return [rev for rev, ishead in sorted(revishead.items())
495 return [rev for rev, ishead in sorted(revishead.items())
489 if ishead]
496 if ishead]
490
497
491 def heads(self, start=None, stop=None):
498 def heads(self, start=None, stop=None):
492 # This is copied from revlog.py.
499 # This is copied from revlog.py.
493 if start is None and stop is None:
500 if start is None and stop is None:
494 if not len(self):
501 if not len(self):
495 return [nullid]
502 return [nullid]
496 return [self.node(r) for r in self.headrevs()]
503 return [self.node(r) for r in self.headrevs()]
497
504
498 if start is None:
505 if start is None:
499 start = nullid
506 start = nullid
500 if stop is None:
507 if stop is None:
501 stop = []
508 stop = []
502 stoprevs = set([self.rev(n) for n in stop])
509 stoprevs = set([self.rev(n) for n in stop])
503 startrev = self.rev(start)
510 startrev = self.rev(start)
504 reachable = {startrev}
511 reachable = {startrev}
505 heads = {startrev}
512 heads = {startrev}
506
513
507 parentrevs = self.parentrevs
514 parentrevs = self.parentrevs
508 for r in self.revs(start=startrev + 1):
515 for r in self.revs(start=startrev + 1):
509 for p in parentrevs(r):
516 for p in parentrevs(r):
510 if p in reachable:
517 if p in reachable:
511 if r not in stoprevs:
518 if r not in stoprevs:
512 reachable.add(r)
519 reachable.add(r)
513 heads.add(r)
520 heads.add(r)
514 if p in heads and p not in stoprevs:
521 if p in heads and p not in stoprevs:
515 heads.remove(p)
522 heads.remove(p)
516
523
517 return [self.node(r) for r in heads]
524 return [self.node(r) for r in heads]
518
525
519 def children(self, node):
526 def children(self, node):
520 validatenode(node)
527 validatenode(node)
521
528
522 # This is a copy of revlog.children().
529 # This is a copy of revlog.children().
523 c = []
530 c = []
524 p = self.rev(node)
531 p = self.rev(node)
525 for r in self.revs(start=p + 1):
532 for r in self.revs(start=p + 1):
526 prevs = [pr for pr in self.parentrevs(r) if pr != nullrev]
533 prevs = [pr for pr in self.parentrevs(r) if pr != nullrev]
527 if prevs:
534 if prevs:
528 for pr in prevs:
535 for pr in prevs:
529 if pr == p:
536 if pr == p:
530 c.append(self.node(r))
537 c.append(self.node(r))
531 elif p == nullrev:
538 elif p == nullrev:
532 c.append(self.node(r))
539 c.append(self.node(r))
533 return c
540 return c
534
541
535 def getstrippoint(self, minlink):
542 def getstrippoint(self, minlink):
536
543
537 # This is largely a copy of revlog.getstrippoint().
544 # This is largely a copy of revlog.getstrippoint().
538 brokenrevs = set()
545 brokenrevs = set()
539 strippoint = len(self)
546 strippoint = len(self)
540
547
541 heads = {}
548 heads = {}
542 futurelargelinkrevs = set()
549 futurelargelinkrevs = set()
543 for head in self.headrevs():
550 for head in self.headrevs():
544 headlinkrev = self.linkrev(head)
551 headlinkrev = self.linkrev(head)
545 heads[head] = headlinkrev
552 heads[head] = headlinkrev
546 if headlinkrev >= minlink:
553 if headlinkrev >= minlink:
547 futurelargelinkrevs.add(headlinkrev)
554 futurelargelinkrevs.add(headlinkrev)
548
555
549 # This algorithm involves walking down the rev graph, starting at the
556 # This algorithm involves walking down the rev graph, starting at the
550 # heads. Since the revs are topologically sorted according to linkrev,
557 # heads. Since the revs are topologically sorted according to linkrev,
551 # once all head linkrevs are below the minlink, we know there are
558 # once all head linkrevs are below the minlink, we know there are
552 # no more revs that could have a linkrev greater than minlink.
559 # no more revs that could have a linkrev greater than minlink.
553 # So we can stop walking.
560 # So we can stop walking.
554 while futurelargelinkrevs:
561 while futurelargelinkrevs:
555 strippoint -= 1
562 strippoint -= 1
556 linkrev = heads.pop(strippoint)
563 linkrev = heads.pop(strippoint)
557
564
558 if linkrev < minlink:
565 if linkrev < minlink:
559 brokenrevs.add(strippoint)
566 brokenrevs.add(strippoint)
560 else:
567 else:
561 futurelargelinkrevs.remove(linkrev)
568 futurelargelinkrevs.remove(linkrev)
562
569
563 for p in self.parentrevs(strippoint):
570 for p in self.parentrevs(strippoint):
564 if p != nullrev:
571 if p != nullrev:
565 plinkrev = self.linkrev(p)
572 plinkrev = self.linkrev(p)
566 heads[p] = plinkrev
573 heads[p] = plinkrev
567 if plinkrev >= minlink:
574 if plinkrev >= minlink:
568 futurelargelinkrevs.add(plinkrev)
575 futurelargelinkrevs.add(plinkrev)
569
576
570 return strippoint, brokenrevs
577 return strippoint, brokenrevs
571
578
572 def strip(self, minlink, transaction):
579 def strip(self, minlink, transaction):
573 if not len(self):
580 if not len(self):
574 return
581 return
575
582
576 rev, _ignored = self.getstrippoint(minlink)
583 rev, _ignored = self.getstrippoint(minlink)
577 if rev == len(self):
584 if rev == len(self):
578 return
585 return
579
586
580 # Purge index data starting at the requested revision.
587 # Purge index data starting at the requested revision.
581 self._indexdata[rev:] = []
588 self._indexdata[rev:] = []
582 self._reflectindexupdate()
589 self._reflectindexupdate()
583
590
591 def issimplestorefile(f, kind, st):
592 if kind != stat.S_IFREG:
593 return False
594
595 if store.isrevlog(f, kind, st):
596 return False
597
598 # Ignore transaction undo files.
599 if f.startswith('undo.'):
600 return False
601
602 # Otherwise assume it belongs to the simple store.
603 return True
604
605 class simplestore(store.encodedstore):
606 def datafiles(self):
607 for x in super(simplestore, self).datafiles():
608 yield x
609
610 # Supplement with non-revlog files.
611 extrafiles = self._walk('data', True, filefilter=issimplestorefile)
612
613 for unencoded, encoded, size in extrafiles:
614 try:
615 unencoded = store.decodefilename(unencoded)
616 except KeyError:
617 unencoded = None
618
619 yield unencoded, encoded, size
620
584 def reposetup(ui, repo):
621 def reposetup(ui, repo):
585 if not repo.local():
622 if not repo.local():
586 return
623 return
587
624
588 if isinstance(repo, bundlerepo.bundlerepository):
625 if isinstance(repo, bundlerepo.bundlerepository):
589 raise error.Abort(_('cannot use simple store with bundlerepo'))
626 raise error.Abort(_('cannot use simple store with bundlerepo'))
590
627
591 class simplestorerepo(repo.__class__):
628 class simplestorerepo(repo.__class__):
592 def file(self, f):
629 def file(self, f):
593 return filestorage(self.svfs, f)
630 return filestorage(self.svfs, f)
594
631
595 repo.__class__ = simplestorerepo
632 repo.__class__ = simplestorerepo
633
634 def featuresetup(ui, supported):
635 supported.add(REQUIREMENT)
636
637 def newreporequirements(orig, repo):
638 """Modifies default requirements for new repos to use the simple store."""
639 requirements = orig(repo)
640
641 # These requirements are only used to affect creation of the store
642 # object. We have our own store. So we can remove them.
643 # TODO do this once we feel like taking the test hit.
644 #if 'fncache' in requirements:
645 # requirements.remove('fncache')
646 #if 'dotencode' in requirements:
647 # requirements.remove('dotencode')
648
649 requirements.add(REQUIREMENT)
650
651 return requirements
652
653 def makestore(orig, requirements, path, vfstype):
654 if REQUIREMENT not in requirements:
655 return orig(requirements, path, vfstype)
656
657 return simplestore(path, vfstype)
658
659 def extsetup(ui):
660 localrepo.featuresetupfuncs.add(featuresetup)
661
662 extensions.wrapfunction(localrepo, 'newreporequirements',
663 newreporequirements)
664 extensions.wrapfunction(store, 'store', makestore)
@@ -1,1295 +1,1293 b''
1 #testcases sshv1 sshv2
1 #testcases sshv1 sshv2
2
2
3 #if sshv2
3 #if sshv2
4 $ cat >> $HGRCPATH << EOF
4 $ cat >> $HGRCPATH << EOF
5 > [experimental]
5 > [experimental]
6 > sshpeer.advertise-v2 = true
6 > sshpeer.advertise-v2 = true
7 > sshserver.support-v2 = true
7 > sshserver.support-v2 = true
8 > EOF
8 > EOF
9 #endif
9 #endif
10
10
11 Prepare repo a:
11 Prepare repo a:
12
12
13 $ hg init a
13 $ hg init a
14 $ cd a
14 $ cd a
15 $ echo a > a
15 $ echo a > a
16 $ hg add a
16 $ hg add a
17 $ hg commit -m test
17 $ hg commit -m test
18 $ echo first line > b
18 $ echo first line > b
19 $ hg add b
19 $ hg add b
20
20
21 Create a non-inlined filelog:
21 Create a non-inlined filelog:
22
22
23 $ $PYTHON -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
23 $ $PYTHON -c 'open("data1", "wb").write(b"".join(b"%d\n" % x for x in range(10000)))'
24 $ for j in 0 1 2 3 4 5 6 7 8 9; do
24 $ for j in 0 1 2 3 4 5 6 7 8 9; do
25 > cat data1 >> b
25 > cat data1 >> b
26 > hg commit -m test
26 > hg commit -m test
27 > done
27 > done
28
28
29 List files in store/data (should show a 'b.d'):
29 List files in store/data (should show a 'b.d'):
30
30
31 #if reporevlogstore
31 #if reporevlogstore
32 $ for i in .hg/store/data/*; do
32 $ for i in .hg/store/data/*; do
33 > echo $i
33 > echo $i
34 > done
34 > done
35 .hg/store/data/a.i
35 .hg/store/data/a.i
36 .hg/store/data/b.d
36 .hg/store/data/b.d
37 .hg/store/data/b.i
37 .hg/store/data/b.i
38 #endif
38 #endif
39
39
40 Trigger branchcache creation:
40 Trigger branchcache creation:
41
41
42 $ hg branches
42 $ hg branches
43 default 10:a7949464abda
43 default 10:a7949464abda
44 $ ls .hg/cache
44 $ ls .hg/cache
45 branch2-served
45 branch2-served
46 checkisexec (execbit !)
46 checkisexec (execbit !)
47 checklink (symlink !)
47 checklink (symlink !)
48 checklink-target (symlink !)
48 checklink-target (symlink !)
49 checknoexec (execbit !)
49 checknoexec (execbit !)
50 rbc-names-v1
50 rbc-names-v1
51 rbc-revs-v1
51 rbc-revs-v1
52
52
53 Default operation:
53 Default operation:
54
54
55 $ hg clone . ../b
55 $ hg clone . ../b
56 updating to branch default
56 updating to branch default
57 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
57 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
58 $ cd ../b
58 $ cd ../b
59
59
60 Ensure branchcache got copied over:
60 Ensure branchcache got copied over:
61
61
62 $ ls .hg/cache
62 $ ls .hg/cache
63 branch2-served
63 branch2-served
64 checkisexec (execbit !)
64 checkisexec (execbit !)
65 checklink (symlink !)
65 checklink (symlink !)
66 checklink-target (symlink !)
66 checklink-target (symlink !)
67 rbc-names-v1
67 rbc-names-v1
68 rbc-revs-v1
68 rbc-revs-v1
69
69
70 $ cat a
70 $ cat a
71 a
71 a
72 $ hg verify
72 $ hg verify
73 checking changesets
73 checking changesets
74 checking manifests
74 checking manifests
75 crosschecking files in changesets and manifests
75 crosschecking files in changesets and manifests
76 checking files
76 checking files
77 2 files, 11 changesets, 11 total revisions
77 2 files, 11 changesets, 11 total revisions
78
78
79 Invalid dest '' must abort:
79 Invalid dest '' must abort:
80
80
81 $ hg clone . ''
81 $ hg clone . ''
82 abort: empty destination path is not valid
82 abort: empty destination path is not valid
83 [255]
83 [255]
84
84
85 No update, with debug option:
85 No update, with debug option:
86
86
87 #if hardlink
87 #if hardlink
88 $ hg --debug clone -U . ../c --config progress.debug=true
88 $ hg --debug clone -U . ../c --config progress.debug=true
89 linking: 1
89 linking: 1
90 linking: 2
90 linking: 2
91 linking: 3
91 linking: 3
92 linking: 4
92 linking: 4
93 linking: 5
93 linking: 5
94 linking: 6
94 linking: 6
95 linking: 7
95 linking: 7
96 linking: 8
96 linking: 8
97 linked 8 files (reporevlogstore !)
97 linked 8 files (reporevlogstore !)
98 linking: 9 (reposimplestore !)
98 linking: 9 (reposimplestore !)
99 linking: 10 (reposimplestore !)
99 linking: 10 (reposimplestore !)
100 linking: 11 (reposimplestore !)
100 linking: 11 (reposimplestore !)
101 linking: 12 (reposimplestore !)
101 linking: 12 (reposimplestore !)
102 linking: 13 (reposimplestore !)
102 linking: 13 (reposimplestore !)
103 linking: 14 (reposimplestore !)
103 linking: 14 (reposimplestore !)
104 linking: 15 (reposimplestore !)
104 linking: 15 (reposimplestore !)
105 linking: 16 (reposimplestore !)
105 linking: 16 (reposimplestore !)
106 linking: 17 (reposimplestore !)
106 linking: 17 (reposimplestore !)
107 linking: 18 (reposimplestore !)
107 linked 17 files (reposimplestore !)
108 linked 18 files (reposimplestore !)
109 #else
108 #else
110 $ hg --debug clone -U . ../c --config progress.debug=true
109 $ hg --debug clone -U . ../c --config progress.debug=true
111 linking: 1
110 linking: 1
112 copying: 2
111 copying: 2
113 copying: 3
112 copying: 3
114 copying: 4
113 copying: 4
115 copying: 5
114 copying: 5
116 copying: 6
115 copying: 6
117 copying: 7
116 copying: 7
118 copying: 8
117 copying: 8
119 copied 8 files (reporevlogstore !)
118 copied 8 files (reporevlogstore !)
120 copying: 9 (reposimplestore !)
119 copying: 9 (reposimplestore !)
121 copying: 10 (reposimplestore !)
120 copying: 10 (reposimplestore !)
122 copying: 11 (reposimplestore !)
121 copying: 11 (reposimplestore !)
123 copying: 12 (reposimplestore !)
122 copying: 12 (reposimplestore !)
124 copying: 13 (reposimplestore !)
123 copying: 13 (reposimplestore !)
125 copying: 14 (reposimplestore !)
124 copying: 14 (reposimplestore !)
126 copying: 15 (reposimplestore !)
125 copying: 15 (reposimplestore !)
127 copying: 16 (reposimplestore !)
126 copying: 16 (reposimplestore !)
128 copying: 17 (reposimplestore !)
127 copying: 17 (reposimplestore !)
129 copying: 18 (reposimplestore !)
128 copied 17 files (reposimplestore !)
130 copied 18 files (reposimplestore !)
131 #endif
129 #endif
132 $ cd ../c
130 $ cd ../c
133
131
134 Ensure branchcache got copied over:
132 Ensure branchcache got copied over:
135
133
136 $ ls .hg/cache
134 $ ls .hg/cache
137 branch2-served
135 branch2-served
138 rbc-names-v1
136 rbc-names-v1
139 rbc-revs-v1
137 rbc-revs-v1
140
138
141 $ cat a 2>/dev/null || echo "a not present"
139 $ cat a 2>/dev/null || echo "a not present"
142 a not present
140 a not present
143 $ hg verify
141 $ hg verify
144 checking changesets
142 checking changesets
145 checking manifests
143 checking manifests
146 crosschecking files in changesets and manifests
144 crosschecking files in changesets and manifests
147 checking files
145 checking files
148 2 files, 11 changesets, 11 total revisions
146 2 files, 11 changesets, 11 total revisions
149
147
150 Default destination:
148 Default destination:
151
149
152 $ mkdir ../d
150 $ mkdir ../d
153 $ cd ../d
151 $ cd ../d
154 $ hg clone ../a
152 $ hg clone ../a
155 destination directory: a
153 destination directory: a
156 updating to branch default
154 updating to branch default
157 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 $ cd a
156 $ cd a
159 $ hg cat a
157 $ hg cat a
160 a
158 a
161 $ cd ../..
159 $ cd ../..
162
160
163 Check that we drop the 'file:' from the path before writing the .hgrc:
161 Check that we drop the 'file:' from the path before writing the .hgrc:
164
162
165 $ hg clone file:a e
163 $ hg clone file:a e
166 updating to branch default
164 updating to branch default
167 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
168 $ grep 'file:' e/.hg/hgrc
166 $ grep 'file:' e/.hg/hgrc
169 [1]
167 [1]
170
168
171 Check that path aliases are expanded:
169 Check that path aliases are expanded:
172
170
173 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
171 $ hg clone -q -U --config 'paths.foobar=a#0' foobar f
174 $ hg -R f showconfig paths.default
172 $ hg -R f showconfig paths.default
175 $TESTTMP/a#0
173 $TESTTMP/a#0
176
174
177 Use --pull:
175 Use --pull:
178
176
179 $ hg clone --pull a g
177 $ hg clone --pull a g
180 requesting all changes
178 requesting all changes
181 adding changesets
179 adding changesets
182 adding manifests
180 adding manifests
183 adding file changes
181 adding file changes
184 added 11 changesets with 11 changes to 2 files
182 added 11 changesets with 11 changes to 2 files
185 new changesets acb14030fe0a:a7949464abda
183 new changesets acb14030fe0a:a7949464abda
186 updating to branch default
184 updating to branch default
187 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
185 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
188 $ hg -R g verify
186 $ hg -R g verify
189 checking changesets
187 checking changesets
190 checking manifests
188 checking manifests
191 crosschecking files in changesets and manifests
189 crosschecking files in changesets and manifests
192 checking files
190 checking files
193 2 files, 11 changesets, 11 total revisions
191 2 files, 11 changesets, 11 total revisions
194
192
195 Invalid dest '' with --pull must abort (issue2528):
193 Invalid dest '' with --pull must abort (issue2528):
196
194
197 $ hg clone --pull a ''
195 $ hg clone --pull a ''
198 abort: empty destination path is not valid
196 abort: empty destination path is not valid
199 [255]
197 [255]
200
198
201 Clone to '.':
199 Clone to '.':
202
200
203 $ mkdir h
201 $ mkdir h
204 $ cd h
202 $ cd h
205 $ hg clone ../a .
203 $ hg clone ../a .
206 updating to branch default
204 updating to branch default
207 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
205 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
208 $ cd ..
206 $ cd ..
209
207
210
208
211 *** Tests for option -u ***
209 *** Tests for option -u ***
212
210
213 Adding some more history to repo a:
211 Adding some more history to repo a:
214
212
215 $ cd a
213 $ cd a
216 $ hg tag ref1
214 $ hg tag ref1
217 $ echo the quick brown fox >a
215 $ echo the quick brown fox >a
218 $ hg ci -m "hacked default"
216 $ hg ci -m "hacked default"
219 $ hg up ref1
217 $ hg up ref1
220 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
218 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
221 $ hg branch stable
219 $ hg branch stable
222 marked working directory as branch stable
220 marked working directory as branch stable
223 (branches are permanent and global, did you want a bookmark?)
221 (branches are permanent and global, did you want a bookmark?)
224 $ echo some text >a
222 $ echo some text >a
225 $ hg ci -m "starting branch stable"
223 $ hg ci -m "starting branch stable"
226 $ hg tag ref2
224 $ hg tag ref2
227 $ echo some more text >a
225 $ echo some more text >a
228 $ hg ci -m "another change for branch stable"
226 $ hg ci -m "another change for branch stable"
229 $ hg up ref2
227 $ hg up ref2
230 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
228 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
231 $ hg parents
229 $ hg parents
232 changeset: 13:e8ece76546a6
230 changeset: 13:e8ece76546a6
233 branch: stable
231 branch: stable
234 tag: ref2
232 tag: ref2
235 parent: 10:a7949464abda
233 parent: 10:a7949464abda
236 user: test
234 user: test
237 date: Thu Jan 01 00:00:00 1970 +0000
235 date: Thu Jan 01 00:00:00 1970 +0000
238 summary: starting branch stable
236 summary: starting branch stable
239
237
240
238
241 Repo a has two heads:
239 Repo a has two heads:
242
240
243 $ hg heads
241 $ hg heads
244 changeset: 15:0aae7cf88f0d
242 changeset: 15:0aae7cf88f0d
245 branch: stable
243 branch: stable
246 tag: tip
244 tag: tip
247 user: test
245 user: test
248 date: Thu Jan 01 00:00:00 1970 +0000
246 date: Thu Jan 01 00:00:00 1970 +0000
249 summary: another change for branch stable
247 summary: another change for branch stable
250
248
251 changeset: 12:f21241060d6a
249 changeset: 12:f21241060d6a
252 user: test
250 user: test
253 date: Thu Jan 01 00:00:00 1970 +0000
251 date: Thu Jan 01 00:00:00 1970 +0000
254 summary: hacked default
252 summary: hacked default
255
253
256
254
257 $ cd ..
255 $ cd ..
258
256
259
257
260 Testing --noupdate with --updaterev (must abort):
258 Testing --noupdate with --updaterev (must abort):
261
259
262 $ hg clone --noupdate --updaterev 1 a ua
260 $ hg clone --noupdate --updaterev 1 a ua
263 abort: cannot specify both --noupdate and --updaterev
261 abort: cannot specify both --noupdate and --updaterev
264 [255]
262 [255]
265
263
266
264
267 Testing clone -u:
265 Testing clone -u:
268
266
269 $ hg clone -u . a ua
267 $ hg clone -u . a ua
270 updating to branch stable
268 updating to branch stable
271 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
269 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
272
270
273 Repo ua has both heads:
271 Repo ua has both heads:
274
272
275 $ hg -R ua heads
273 $ hg -R ua heads
276 changeset: 15:0aae7cf88f0d
274 changeset: 15:0aae7cf88f0d
277 branch: stable
275 branch: stable
278 tag: tip
276 tag: tip
279 user: test
277 user: test
280 date: Thu Jan 01 00:00:00 1970 +0000
278 date: Thu Jan 01 00:00:00 1970 +0000
281 summary: another change for branch stable
279 summary: another change for branch stable
282
280
283 changeset: 12:f21241060d6a
281 changeset: 12:f21241060d6a
284 user: test
282 user: test
285 date: Thu Jan 01 00:00:00 1970 +0000
283 date: Thu Jan 01 00:00:00 1970 +0000
286 summary: hacked default
284 summary: hacked default
287
285
288
286
289 Same revision checked out in repo a and ua:
287 Same revision checked out in repo a and ua:
290
288
291 $ hg -R a parents --template "{node|short}\n"
289 $ hg -R a parents --template "{node|short}\n"
292 e8ece76546a6
290 e8ece76546a6
293 $ hg -R ua parents --template "{node|short}\n"
291 $ hg -R ua parents --template "{node|short}\n"
294 e8ece76546a6
292 e8ece76546a6
295
293
296 $ rm -r ua
294 $ rm -r ua
297
295
298
296
299 Testing clone --pull -u:
297 Testing clone --pull -u:
300
298
301 $ hg clone --pull -u . a ua
299 $ hg clone --pull -u . a ua
302 requesting all changes
300 requesting all changes
303 adding changesets
301 adding changesets
304 adding manifests
302 adding manifests
305 adding file changes
303 adding file changes
306 added 16 changesets with 16 changes to 3 files (+1 heads)
304 added 16 changesets with 16 changes to 3 files (+1 heads)
307 new changesets acb14030fe0a:0aae7cf88f0d
305 new changesets acb14030fe0a:0aae7cf88f0d
308 updating to branch stable
306 updating to branch stable
309 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
307 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
310
308
311 Repo ua has both heads:
309 Repo ua has both heads:
312
310
313 $ hg -R ua heads
311 $ hg -R ua heads
314 changeset: 15:0aae7cf88f0d
312 changeset: 15:0aae7cf88f0d
315 branch: stable
313 branch: stable
316 tag: tip
314 tag: tip
317 user: test
315 user: test
318 date: Thu Jan 01 00:00:00 1970 +0000
316 date: Thu Jan 01 00:00:00 1970 +0000
319 summary: another change for branch stable
317 summary: another change for branch stable
320
318
321 changeset: 12:f21241060d6a
319 changeset: 12:f21241060d6a
322 user: test
320 user: test
323 date: Thu Jan 01 00:00:00 1970 +0000
321 date: Thu Jan 01 00:00:00 1970 +0000
324 summary: hacked default
322 summary: hacked default
325
323
326
324
327 Same revision checked out in repo a and ua:
325 Same revision checked out in repo a and ua:
328
326
329 $ hg -R a parents --template "{node|short}\n"
327 $ hg -R a parents --template "{node|short}\n"
330 e8ece76546a6
328 e8ece76546a6
331 $ hg -R ua parents --template "{node|short}\n"
329 $ hg -R ua parents --template "{node|short}\n"
332 e8ece76546a6
330 e8ece76546a6
333
331
334 $ rm -r ua
332 $ rm -r ua
335
333
336
334
337 Testing clone -u <branch>:
335 Testing clone -u <branch>:
338
336
339 $ hg clone -u stable a ua
337 $ hg clone -u stable a ua
340 updating to branch stable
338 updating to branch stable
341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
339 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
342
340
343 Repo ua has both heads:
341 Repo ua has both heads:
344
342
345 $ hg -R ua heads
343 $ hg -R ua heads
346 changeset: 15:0aae7cf88f0d
344 changeset: 15:0aae7cf88f0d
347 branch: stable
345 branch: stable
348 tag: tip
346 tag: tip
349 user: test
347 user: test
350 date: Thu Jan 01 00:00:00 1970 +0000
348 date: Thu Jan 01 00:00:00 1970 +0000
351 summary: another change for branch stable
349 summary: another change for branch stable
352
350
353 changeset: 12:f21241060d6a
351 changeset: 12:f21241060d6a
354 user: test
352 user: test
355 date: Thu Jan 01 00:00:00 1970 +0000
353 date: Thu Jan 01 00:00:00 1970 +0000
356 summary: hacked default
354 summary: hacked default
357
355
358
356
359 Branch 'stable' is checked out:
357 Branch 'stable' is checked out:
360
358
361 $ hg -R ua parents
359 $ hg -R ua parents
362 changeset: 15:0aae7cf88f0d
360 changeset: 15:0aae7cf88f0d
363 branch: stable
361 branch: stable
364 tag: tip
362 tag: tip
365 user: test
363 user: test
366 date: Thu Jan 01 00:00:00 1970 +0000
364 date: Thu Jan 01 00:00:00 1970 +0000
367 summary: another change for branch stable
365 summary: another change for branch stable
368
366
369
367
370 $ rm -r ua
368 $ rm -r ua
371
369
372
370
373 Testing default checkout:
371 Testing default checkout:
374
372
375 $ hg clone a ua
373 $ hg clone a ua
376 updating to branch default
374 updating to branch default
377 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
378
376
379 Repo ua has both heads:
377 Repo ua has both heads:
380
378
381 $ hg -R ua heads
379 $ hg -R ua heads
382 changeset: 15:0aae7cf88f0d
380 changeset: 15:0aae7cf88f0d
383 branch: stable
381 branch: stable
384 tag: tip
382 tag: tip
385 user: test
383 user: test
386 date: Thu Jan 01 00:00:00 1970 +0000
384 date: Thu Jan 01 00:00:00 1970 +0000
387 summary: another change for branch stable
385 summary: another change for branch stable
388
386
389 changeset: 12:f21241060d6a
387 changeset: 12:f21241060d6a
390 user: test
388 user: test
391 date: Thu Jan 01 00:00:00 1970 +0000
389 date: Thu Jan 01 00:00:00 1970 +0000
392 summary: hacked default
390 summary: hacked default
393
391
394
392
395 Branch 'default' is checked out:
393 Branch 'default' is checked out:
396
394
397 $ hg -R ua parents
395 $ hg -R ua parents
398 changeset: 12:f21241060d6a
396 changeset: 12:f21241060d6a
399 user: test
397 user: test
400 date: Thu Jan 01 00:00:00 1970 +0000
398 date: Thu Jan 01 00:00:00 1970 +0000
401 summary: hacked default
399 summary: hacked default
402
400
403 Test clone with a branch named "@" (issue3677)
401 Test clone with a branch named "@" (issue3677)
404
402
405 $ hg -R ua branch @
403 $ hg -R ua branch @
406 marked working directory as branch @
404 marked working directory as branch @
407 $ hg -R ua commit -m 'created branch @'
405 $ hg -R ua commit -m 'created branch @'
408 $ hg clone ua atbranch
406 $ hg clone ua atbranch
409 updating to branch default
407 updating to branch default
410 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
408 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
411 $ hg -R atbranch heads
409 $ hg -R atbranch heads
412 changeset: 16:798b6d97153e
410 changeset: 16:798b6d97153e
413 branch: @
411 branch: @
414 tag: tip
412 tag: tip
415 parent: 12:f21241060d6a
413 parent: 12:f21241060d6a
416 user: test
414 user: test
417 date: Thu Jan 01 00:00:00 1970 +0000
415 date: Thu Jan 01 00:00:00 1970 +0000
418 summary: created branch @
416 summary: created branch @
419
417
420 changeset: 15:0aae7cf88f0d
418 changeset: 15:0aae7cf88f0d
421 branch: stable
419 branch: stable
422 user: test
420 user: test
423 date: Thu Jan 01 00:00:00 1970 +0000
421 date: Thu Jan 01 00:00:00 1970 +0000
424 summary: another change for branch stable
422 summary: another change for branch stable
425
423
426 changeset: 12:f21241060d6a
424 changeset: 12:f21241060d6a
427 user: test
425 user: test
428 date: Thu Jan 01 00:00:00 1970 +0000
426 date: Thu Jan 01 00:00:00 1970 +0000
429 summary: hacked default
427 summary: hacked default
430
428
431 $ hg -R atbranch parents
429 $ hg -R atbranch parents
432 changeset: 12:f21241060d6a
430 changeset: 12:f21241060d6a
433 user: test
431 user: test
434 date: Thu Jan 01 00:00:00 1970 +0000
432 date: Thu Jan 01 00:00:00 1970 +0000
435 summary: hacked default
433 summary: hacked default
436
434
437
435
438 $ rm -r ua atbranch
436 $ rm -r ua atbranch
439
437
440
438
441 Testing #<branch>:
439 Testing #<branch>:
442
440
443 $ hg clone -u . a#stable ua
441 $ hg clone -u . a#stable ua
444 adding changesets
442 adding changesets
445 adding manifests
443 adding manifests
446 adding file changes
444 adding file changes
447 added 14 changesets with 14 changes to 3 files
445 added 14 changesets with 14 changes to 3 files
448 new changesets acb14030fe0a:0aae7cf88f0d
446 new changesets acb14030fe0a:0aae7cf88f0d
449 updating to branch stable
447 updating to branch stable
450 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
448 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
451
449
452 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
450 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
453
451
454 $ hg -R ua heads
452 $ hg -R ua heads
455 changeset: 13:0aae7cf88f0d
453 changeset: 13:0aae7cf88f0d
456 branch: stable
454 branch: stable
457 tag: tip
455 tag: tip
458 user: test
456 user: test
459 date: Thu Jan 01 00:00:00 1970 +0000
457 date: Thu Jan 01 00:00:00 1970 +0000
460 summary: another change for branch stable
458 summary: another change for branch stable
461
459
462 changeset: 10:a7949464abda
460 changeset: 10:a7949464abda
463 user: test
461 user: test
464 date: Thu Jan 01 00:00:00 1970 +0000
462 date: Thu Jan 01 00:00:00 1970 +0000
465 summary: test
463 summary: test
466
464
467
465
468 Same revision checked out in repo a and ua:
466 Same revision checked out in repo a and ua:
469
467
470 $ hg -R a parents --template "{node|short}\n"
468 $ hg -R a parents --template "{node|short}\n"
471 e8ece76546a6
469 e8ece76546a6
472 $ hg -R ua parents --template "{node|short}\n"
470 $ hg -R ua parents --template "{node|short}\n"
473 e8ece76546a6
471 e8ece76546a6
474
472
475 $ rm -r ua
473 $ rm -r ua
476
474
477
475
478 Testing -u -r <branch>:
476 Testing -u -r <branch>:
479
477
480 $ hg clone -u . -r stable a ua
478 $ hg clone -u . -r stable a ua
481 adding changesets
479 adding changesets
482 adding manifests
480 adding manifests
483 adding file changes
481 adding file changes
484 added 14 changesets with 14 changes to 3 files
482 added 14 changesets with 14 changes to 3 files
485 new changesets acb14030fe0a:0aae7cf88f0d
483 new changesets acb14030fe0a:0aae7cf88f0d
486 updating to branch stable
484 updating to branch stable
487 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
485 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
488
486
489 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
487 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
490
488
491 $ hg -R ua heads
489 $ hg -R ua heads
492 changeset: 13:0aae7cf88f0d
490 changeset: 13:0aae7cf88f0d
493 branch: stable
491 branch: stable
494 tag: tip
492 tag: tip
495 user: test
493 user: test
496 date: Thu Jan 01 00:00:00 1970 +0000
494 date: Thu Jan 01 00:00:00 1970 +0000
497 summary: another change for branch stable
495 summary: another change for branch stable
498
496
499 changeset: 10:a7949464abda
497 changeset: 10:a7949464abda
500 user: test
498 user: test
501 date: Thu Jan 01 00:00:00 1970 +0000
499 date: Thu Jan 01 00:00:00 1970 +0000
502 summary: test
500 summary: test
503
501
504
502
505 Same revision checked out in repo a and ua:
503 Same revision checked out in repo a and ua:
506
504
507 $ hg -R a parents --template "{node|short}\n"
505 $ hg -R a parents --template "{node|short}\n"
508 e8ece76546a6
506 e8ece76546a6
509 $ hg -R ua parents --template "{node|short}\n"
507 $ hg -R ua parents --template "{node|short}\n"
510 e8ece76546a6
508 e8ece76546a6
511
509
512 $ rm -r ua
510 $ rm -r ua
513
511
514
512
515 Testing -r <branch>:
513 Testing -r <branch>:
516
514
517 $ hg clone -r stable a ua
515 $ hg clone -r stable a ua
518 adding changesets
516 adding changesets
519 adding manifests
517 adding manifests
520 adding file changes
518 adding file changes
521 added 14 changesets with 14 changes to 3 files
519 added 14 changesets with 14 changes to 3 files
522 new changesets acb14030fe0a:0aae7cf88f0d
520 new changesets acb14030fe0a:0aae7cf88f0d
523 updating to branch stable
521 updating to branch stable
524 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
522 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
525
523
526 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
524 Repo ua has branch 'stable' and 'default' (was changed in fd511e9eeea6):
527
525
528 $ hg -R ua heads
526 $ hg -R ua heads
529 changeset: 13:0aae7cf88f0d
527 changeset: 13:0aae7cf88f0d
530 branch: stable
528 branch: stable
531 tag: tip
529 tag: tip
532 user: test
530 user: test
533 date: Thu Jan 01 00:00:00 1970 +0000
531 date: Thu Jan 01 00:00:00 1970 +0000
534 summary: another change for branch stable
532 summary: another change for branch stable
535
533
536 changeset: 10:a7949464abda
534 changeset: 10:a7949464abda
537 user: test
535 user: test
538 date: Thu Jan 01 00:00:00 1970 +0000
536 date: Thu Jan 01 00:00:00 1970 +0000
539 summary: test
537 summary: test
540
538
541
539
542 Branch 'stable' is checked out:
540 Branch 'stable' is checked out:
543
541
544 $ hg -R ua parents
542 $ hg -R ua parents
545 changeset: 13:0aae7cf88f0d
543 changeset: 13:0aae7cf88f0d
546 branch: stable
544 branch: stable
547 tag: tip
545 tag: tip
548 user: test
546 user: test
549 date: Thu Jan 01 00:00:00 1970 +0000
547 date: Thu Jan 01 00:00:00 1970 +0000
550 summary: another change for branch stable
548 summary: another change for branch stable
551
549
552
550
553 $ rm -r ua
551 $ rm -r ua
554
552
555
553
556 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
554 Issue2267: Error in 1.6 hg.py: TypeError: 'NoneType' object is not
557 iterable in addbranchrevs()
555 iterable in addbranchrevs()
558
556
559 $ cat <<EOF > simpleclone.py
557 $ cat <<EOF > simpleclone.py
560 > from mercurial import ui, hg
558 > from mercurial import ui, hg
561 > myui = ui.ui.load()
559 > myui = ui.ui.load()
562 > repo = hg.repository(myui, 'a')
560 > repo = hg.repository(myui, 'a')
563 > hg.clone(myui, {}, repo, dest="ua")
561 > hg.clone(myui, {}, repo, dest="ua")
564 > EOF
562 > EOF
565
563
566 $ $PYTHON simpleclone.py
564 $ $PYTHON simpleclone.py
567 updating to branch default
565 updating to branch default
568 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
566 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
569
567
570 $ rm -r ua
568 $ rm -r ua
571
569
572 $ cat <<EOF > branchclone.py
570 $ cat <<EOF > branchclone.py
573 > from mercurial import ui, hg, extensions
571 > from mercurial import ui, hg, extensions
574 > myui = ui.ui.load()
572 > myui = ui.ui.load()
575 > extensions.loadall(myui)
573 > extensions.loadall(myui)
576 > repo = hg.repository(myui, 'a')
574 > repo = hg.repository(myui, 'a')
577 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
575 > hg.clone(myui, {}, repo, dest="ua", branch=["stable",])
578 > EOF
576 > EOF
579
577
580 $ $PYTHON branchclone.py
578 $ $PYTHON branchclone.py
581 adding changesets
579 adding changesets
582 adding manifests
580 adding manifests
583 adding file changes
581 adding file changes
584 added 14 changesets with 14 changes to 3 files
582 added 14 changesets with 14 changes to 3 files
585 new changesets acb14030fe0a:0aae7cf88f0d
583 new changesets acb14030fe0a:0aae7cf88f0d
586 updating to branch stable
584 updating to branch stable
587 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
585 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
588 $ rm -r ua
586 $ rm -r ua
589
587
590
588
591 Test clone with special '@' bookmark:
589 Test clone with special '@' bookmark:
592 $ cd a
590 $ cd a
593 $ hg bookmark -r a7949464abda @ # branch point of stable from default
591 $ hg bookmark -r a7949464abda @ # branch point of stable from default
594 $ hg clone . ../i
592 $ hg clone . ../i
595 updating to bookmark @
593 updating to bookmark @
596 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
594 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 $ hg id -i ../i
595 $ hg id -i ../i
598 a7949464abda
596 a7949464abda
599 $ rm -r ../i
597 $ rm -r ../i
600
598
601 $ hg bookmark -f -r stable @
599 $ hg bookmark -f -r stable @
602 $ hg bookmarks
600 $ hg bookmarks
603 @ 15:0aae7cf88f0d
601 @ 15:0aae7cf88f0d
604 $ hg clone . ../i
602 $ hg clone . ../i
605 updating to bookmark @ on branch stable
603 updating to bookmark @ on branch stable
606 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
604 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
607 $ hg id -i ../i
605 $ hg id -i ../i
608 0aae7cf88f0d
606 0aae7cf88f0d
609 $ cd "$TESTTMP"
607 $ cd "$TESTTMP"
610
608
611
609
612 Testing failures:
610 Testing failures:
613
611
614 $ mkdir fail
612 $ mkdir fail
615 $ cd fail
613 $ cd fail
616
614
617 No local source
615 No local source
618
616
619 $ hg clone a b
617 $ hg clone a b
620 abort: repository a not found!
618 abort: repository a not found!
621 [255]
619 [255]
622
620
623 No remote source
621 No remote source
624
622
625 #if windows
623 #if windows
626 $ hg clone http://$LOCALIP:3121/a b
624 $ hg clone http://$LOCALIP:3121/a b
627 abort: error: * (glob)
625 abort: error: * (glob)
628 [255]
626 [255]
629 #else
627 #else
630 $ hg clone http://$LOCALIP:3121/a b
628 $ hg clone http://$LOCALIP:3121/a b
631 abort: error: *refused* (glob)
629 abort: error: *refused* (glob)
632 [255]
630 [255]
633 #endif
631 #endif
634 $ rm -rf b # work around bug with http clone
632 $ rm -rf b # work around bug with http clone
635
633
636
634
637 #if unix-permissions no-root
635 #if unix-permissions no-root
638
636
639 Inaccessible source
637 Inaccessible source
640
638
641 $ mkdir a
639 $ mkdir a
642 $ chmod 000 a
640 $ chmod 000 a
643 $ hg clone a b
641 $ hg clone a b
644 abort: repository a not found!
642 abort: repository a not found!
645 [255]
643 [255]
646
644
647 Inaccessible destination
645 Inaccessible destination
648
646
649 $ hg init b
647 $ hg init b
650 $ cd b
648 $ cd b
651 $ hg clone . ../a
649 $ hg clone . ../a
652 abort: Permission denied: '../a'
650 abort: Permission denied: '../a'
653 [255]
651 [255]
654 $ cd ..
652 $ cd ..
655 $ chmod 700 a
653 $ chmod 700 a
656 $ rm -r a b
654 $ rm -r a b
657
655
658 #endif
656 #endif
659
657
660
658
661 #if fifo
659 #if fifo
662
660
663 Source of wrong type
661 Source of wrong type
664
662
665 $ mkfifo a
663 $ mkfifo a
666 $ hg clone a b
664 $ hg clone a b
667 abort: repository a not found!
665 abort: repository a not found!
668 [255]
666 [255]
669 $ rm a
667 $ rm a
670
668
671 #endif
669 #endif
672
670
673 Default destination, same directory
671 Default destination, same directory
674
672
675 $ hg init q
673 $ hg init q
676 $ hg clone q
674 $ hg clone q
677 destination directory: q
675 destination directory: q
678 abort: destination 'q' is not empty
676 abort: destination 'q' is not empty
679 [255]
677 [255]
680
678
681 destination directory not empty
679 destination directory not empty
682
680
683 $ mkdir a
681 $ mkdir a
684 $ echo stuff > a/a
682 $ echo stuff > a/a
685 $ hg clone q a
683 $ hg clone q a
686 abort: destination 'a' is not empty
684 abort: destination 'a' is not empty
687 [255]
685 [255]
688
686
689
687
690 #if unix-permissions no-root
688 #if unix-permissions no-root
691
689
692 leave existing directory in place after clone failure
690 leave existing directory in place after clone failure
693
691
694 $ hg init c
692 $ hg init c
695 $ cd c
693 $ cd c
696 $ echo c > c
694 $ echo c > c
697 $ hg commit -A -m test
695 $ hg commit -A -m test
698 adding c
696 adding c
699 $ chmod -rx .hg/store/data
697 $ chmod -rx .hg/store/data
700 $ cd ..
698 $ cd ..
701 $ mkdir d
699 $ mkdir d
702 $ hg clone c d 2> err
700 $ hg clone c d 2> err
703 [255]
701 [255]
704 $ test -d d
702 $ test -d d
705 $ test -d d/.hg
703 $ test -d d/.hg
706 [1]
704 [1]
707
705
708 re-enable perm to allow deletion
706 re-enable perm to allow deletion
709
707
710 $ chmod +rx c/.hg/store/data
708 $ chmod +rx c/.hg/store/data
711
709
712 #endif
710 #endif
713
711
714 $ cd ..
712 $ cd ..
715
713
716 Test clone from the repository in (emulated) revlog format 0 (issue4203):
714 Test clone from the repository in (emulated) revlog format 0 (issue4203):
717
715
718 $ mkdir issue4203
716 $ mkdir issue4203
719 $ mkdir -p src/.hg
717 $ mkdir -p src/.hg
720 $ echo foo > src/foo
718 $ echo foo > src/foo
721 $ hg -R src add src/foo
719 $ hg -R src add src/foo
722 $ hg -R src commit -m '#0'
720 $ hg -R src commit -m '#0'
723 $ hg -R src log -q
721 $ hg -R src log -q
724 0:e1bab28bca43
722 0:e1bab28bca43
725 $ hg clone -U -q src dst
723 $ hg clone -U -q src dst
726 $ hg -R dst log -q
724 $ hg -R dst log -q
727 0:e1bab28bca43
725 0:e1bab28bca43
728
726
729 Create repositories to test auto sharing functionality
727 Create repositories to test auto sharing functionality
730
728
731 $ cat >> $HGRCPATH << EOF
729 $ cat >> $HGRCPATH << EOF
732 > [extensions]
730 > [extensions]
733 > share=
731 > share=
734 > EOF
732 > EOF
735
733
736 $ hg init empty
734 $ hg init empty
737 $ hg init source1a
735 $ hg init source1a
738 $ cd source1a
736 $ cd source1a
739 $ echo initial1 > foo
737 $ echo initial1 > foo
740 $ hg -q commit -A -m initial
738 $ hg -q commit -A -m initial
741 $ echo second > foo
739 $ echo second > foo
742 $ hg commit -m second
740 $ hg commit -m second
743 $ cd ..
741 $ cd ..
744
742
745 $ hg init filteredrev0
743 $ hg init filteredrev0
746 $ cd filteredrev0
744 $ cd filteredrev0
747 $ cat >> .hg/hgrc << EOF
745 $ cat >> .hg/hgrc << EOF
748 > [experimental]
746 > [experimental]
749 > evolution.createmarkers=True
747 > evolution.createmarkers=True
750 > EOF
748 > EOF
751 $ echo initial1 > foo
749 $ echo initial1 > foo
752 $ hg -q commit -A -m initial0
750 $ hg -q commit -A -m initial0
753 $ hg -q up -r null
751 $ hg -q up -r null
754 $ echo initial2 > foo
752 $ echo initial2 > foo
755 $ hg -q commit -A -m initial1
753 $ hg -q commit -A -m initial1
756 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
754 $ hg debugobsolete c05d5c47a5cf81401869999f3d05f7d699d2b29a e082c1832e09a7d1e78b7fd49a592d372de854c8
757 obsoleted 1 changesets
755 obsoleted 1 changesets
758 $ cd ..
756 $ cd ..
759
757
760 $ hg -q clone --pull source1a source1b
758 $ hg -q clone --pull source1a source1b
761 $ cd source1a
759 $ cd source1a
762 $ hg bookmark bookA
760 $ hg bookmark bookA
763 $ echo 1a > foo
761 $ echo 1a > foo
764 $ hg commit -m 1a
762 $ hg commit -m 1a
765 $ cd ../source1b
763 $ cd ../source1b
766 $ hg -q up -r 0
764 $ hg -q up -r 0
767 $ echo head1 > foo
765 $ echo head1 > foo
768 $ hg commit -m head1
766 $ hg commit -m head1
769 created new head
767 created new head
770 $ hg bookmark head1
768 $ hg bookmark head1
771 $ hg -q up -r 0
769 $ hg -q up -r 0
772 $ echo head2 > foo
770 $ echo head2 > foo
773 $ hg commit -m head2
771 $ hg commit -m head2
774 created new head
772 created new head
775 $ hg bookmark head2
773 $ hg bookmark head2
776 $ hg -q up -r 0
774 $ hg -q up -r 0
777 $ hg branch branch1
775 $ hg branch branch1
778 marked working directory as branch branch1
776 marked working directory as branch branch1
779 (branches are permanent and global, did you want a bookmark?)
777 (branches are permanent and global, did you want a bookmark?)
780 $ echo branch1 > foo
778 $ echo branch1 > foo
781 $ hg commit -m branch1
779 $ hg commit -m branch1
782 $ hg -q up -r 0
780 $ hg -q up -r 0
783 $ hg branch branch2
781 $ hg branch branch2
784 marked working directory as branch branch2
782 marked working directory as branch branch2
785 $ echo branch2 > foo
783 $ echo branch2 > foo
786 $ hg commit -m branch2
784 $ hg commit -m branch2
787 $ cd ..
785 $ cd ..
788 $ hg init source2
786 $ hg init source2
789 $ cd source2
787 $ cd source2
790 $ echo initial2 > foo
788 $ echo initial2 > foo
791 $ hg -q commit -A -m initial2
789 $ hg -q commit -A -m initial2
792 $ echo second > foo
790 $ echo second > foo
793 $ hg commit -m second
791 $ hg commit -m second
794 $ cd ..
792 $ cd ..
795
793
796 Clone with auto share from an empty repo should not result in share
794 Clone with auto share from an empty repo should not result in share
797
795
798 $ mkdir share
796 $ mkdir share
799 $ hg --config share.pool=share clone empty share-empty
797 $ hg --config share.pool=share clone empty share-empty
800 (not using pooled storage: remote appears to be empty)
798 (not using pooled storage: remote appears to be empty)
801 updating to branch default
799 updating to branch default
802 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
800 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
803 $ ls share
801 $ ls share
804 $ test -d share-empty/.hg/store
802 $ test -d share-empty/.hg/store
805 $ test -f share-empty/.hg/sharedpath
803 $ test -f share-empty/.hg/sharedpath
806 [1]
804 [1]
807
805
808 Clone with auto share from a repo with filtered revision 0 should not result in share
806 Clone with auto share from a repo with filtered revision 0 should not result in share
809
807
810 $ hg --config share.pool=share clone filteredrev0 share-filtered
808 $ hg --config share.pool=share clone filteredrev0 share-filtered
811 (not using pooled storage: unable to resolve identity of remote)
809 (not using pooled storage: unable to resolve identity of remote)
812 requesting all changes
810 requesting all changes
813 adding changesets
811 adding changesets
814 adding manifests
812 adding manifests
815 adding file changes
813 adding file changes
816 added 1 changesets with 1 changes to 1 files
814 added 1 changesets with 1 changes to 1 files
817 new changesets e082c1832e09
815 new changesets e082c1832e09
818 updating to branch default
816 updating to branch default
819 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
817 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
820
818
821 Clone from repo with content should result in shared store being created
819 Clone from repo with content should result in shared store being created
822
820
823 $ hg --config share.pool=share clone source1a share-dest1a
821 $ hg --config share.pool=share clone source1a share-dest1a
824 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
822 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
825 requesting all changes
823 requesting all changes
826 adding changesets
824 adding changesets
827 adding manifests
825 adding manifests
828 adding file changes
826 adding file changes
829 added 3 changesets with 3 changes to 1 files
827 added 3 changesets with 3 changes to 1 files
830 new changesets b5f04eac9d8f:e5bfe23c0b47
828 new changesets b5f04eac9d8f:e5bfe23c0b47
831 searching for changes
829 searching for changes
832 no changes found
830 no changes found
833 adding remote bookmark bookA
831 adding remote bookmark bookA
834 updating working directory
832 updating working directory
835 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
833 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
836
834
837 The shared repo should have been created
835 The shared repo should have been created
838
836
839 $ ls share
837 $ ls share
840 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
838 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
841
839
842 The destination should point to it
840 The destination should point to it
843
841
844 $ cat share-dest1a/.hg/sharedpath; echo
842 $ cat share-dest1a/.hg/sharedpath; echo
845 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
843 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
846
844
847 The destination should have bookmarks
845 The destination should have bookmarks
848
846
849 $ hg -R share-dest1a bookmarks
847 $ hg -R share-dest1a bookmarks
850 bookA 2:e5bfe23c0b47
848 bookA 2:e5bfe23c0b47
851
849
852 The default path should be the remote, not the share
850 The default path should be the remote, not the share
853
851
854 $ hg -R share-dest1a config paths.default
852 $ hg -R share-dest1a config paths.default
855 $TESTTMP/source1a
853 $TESTTMP/source1a
856
854
857 Clone with existing share dir should result in pull + share
855 Clone with existing share dir should result in pull + share
858
856
859 $ hg --config share.pool=share clone source1b share-dest1b
857 $ hg --config share.pool=share clone source1b share-dest1b
860 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
858 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
861 searching for changes
859 searching for changes
862 adding changesets
860 adding changesets
863 adding manifests
861 adding manifests
864 adding file changes
862 adding file changes
865 added 4 changesets with 4 changes to 1 files (+4 heads)
863 added 4 changesets with 4 changes to 1 files (+4 heads)
866 adding remote bookmark head1
864 adding remote bookmark head1
867 adding remote bookmark head2
865 adding remote bookmark head2
868 new changesets 4a8dc1ab4c13:6bacf4683960
866 new changesets 4a8dc1ab4c13:6bacf4683960
869 updating working directory
867 updating working directory
870 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
868 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
871
869
872 $ ls share
870 $ ls share
873 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
871 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
874
872
875 $ cat share-dest1b/.hg/sharedpath; echo
873 $ cat share-dest1b/.hg/sharedpath; echo
876 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
874 $TESTTMP/share/b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1/.hg
877
875
878 We only get bookmarks from the remote, not everything in the share
876 We only get bookmarks from the remote, not everything in the share
879
877
880 $ hg -R share-dest1b bookmarks
878 $ hg -R share-dest1b bookmarks
881 head1 3:4a8dc1ab4c13
879 head1 3:4a8dc1ab4c13
882 head2 4:99f71071f117
880 head2 4:99f71071f117
883
881
884 Default path should be source, not share.
882 Default path should be source, not share.
885
883
886 $ hg -R share-dest1b config paths.default
884 $ hg -R share-dest1b config paths.default
887 $TESTTMP/source1b
885 $TESTTMP/source1b
888
886
889 Checked out revision should be head of default branch
887 Checked out revision should be head of default branch
890
888
891 $ hg -R share-dest1b log -r .
889 $ hg -R share-dest1b log -r .
892 changeset: 4:99f71071f117
890 changeset: 4:99f71071f117
893 bookmark: head2
891 bookmark: head2
894 parent: 0:b5f04eac9d8f
892 parent: 0:b5f04eac9d8f
895 user: test
893 user: test
896 date: Thu Jan 01 00:00:00 1970 +0000
894 date: Thu Jan 01 00:00:00 1970 +0000
897 summary: head2
895 summary: head2
898
896
899
897
900 Clone from unrelated repo should result in new share
898 Clone from unrelated repo should result in new share
901
899
902 $ hg --config share.pool=share clone source2 share-dest2
900 $ hg --config share.pool=share clone source2 share-dest2
903 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
901 (sharing from new pooled repository 22aeff664783fd44c6d9b435618173c118c3448e)
904 requesting all changes
902 requesting all changes
905 adding changesets
903 adding changesets
906 adding manifests
904 adding manifests
907 adding file changes
905 adding file changes
908 added 2 changesets with 2 changes to 1 files
906 added 2 changesets with 2 changes to 1 files
909 new changesets 22aeff664783:63cf6c3dba4a
907 new changesets 22aeff664783:63cf6c3dba4a
910 searching for changes
908 searching for changes
911 no changes found
909 no changes found
912 updating working directory
910 updating working directory
913 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
911 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
914
912
915 $ ls share
913 $ ls share
916 22aeff664783fd44c6d9b435618173c118c3448e
914 22aeff664783fd44c6d9b435618173c118c3448e
917 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
915 b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1
918
916
919 remote naming mode works as advertised
917 remote naming mode works as advertised
920
918
921 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
919 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1a share-remote1a
922 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
920 (sharing from new pooled repository 195bb1fcdb595c14a6c13e0269129ed78f6debde)
923 requesting all changes
921 requesting all changes
924 adding changesets
922 adding changesets
925 adding manifests
923 adding manifests
926 adding file changes
924 adding file changes
927 added 3 changesets with 3 changes to 1 files
925 added 3 changesets with 3 changes to 1 files
928 new changesets b5f04eac9d8f:e5bfe23c0b47
926 new changesets b5f04eac9d8f:e5bfe23c0b47
929 searching for changes
927 searching for changes
930 no changes found
928 no changes found
931 adding remote bookmark bookA
929 adding remote bookmark bookA
932 updating working directory
930 updating working directory
933 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
931 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
934
932
935 $ ls shareremote
933 $ ls shareremote
936 195bb1fcdb595c14a6c13e0269129ed78f6debde
934 195bb1fcdb595c14a6c13e0269129ed78f6debde
937
935
938 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
936 $ hg --config share.pool=shareremote --config share.poolnaming=remote clone source1b share-remote1b
939 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
937 (sharing from new pooled repository c0d4f83847ca2a873741feb7048a45085fd47c46)
940 requesting all changes
938 requesting all changes
941 adding changesets
939 adding changesets
942 adding manifests
940 adding manifests
943 adding file changes
941 adding file changes
944 added 6 changesets with 6 changes to 1 files (+4 heads)
942 added 6 changesets with 6 changes to 1 files (+4 heads)
945 new changesets b5f04eac9d8f:6bacf4683960
943 new changesets b5f04eac9d8f:6bacf4683960
946 searching for changes
944 searching for changes
947 no changes found
945 no changes found
948 adding remote bookmark head1
946 adding remote bookmark head1
949 adding remote bookmark head2
947 adding remote bookmark head2
950 updating working directory
948 updating working directory
951 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
949 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
952
950
953 $ ls shareremote
951 $ ls shareremote
954 195bb1fcdb595c14a6c13e0269129ed78f6debde
952 195bb1fcdb595c14a6c13e0269129ed78f6debde
955 c0d4f83847ca2a873741feb7048a45085fd47c46
953 c0d4f83847ca2a873741feb7048a45085fd47c46
956
954
957 request to clone a single revision is respected in sharing mode
955 request to clone a single revision is respected in sharing mode
958
956
959 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
957 $ hg --config share.pool=sharerevs clone -r 4a8dc1ab4c13 source1b share-1arev
960 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
958 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
961 adding changesets
959 adding changesets
962 adding manifests
960 adding manifests
963 adding file changes
961 adding file changes
964 added 2 changesets with 2 changes to 1 files
962 added 2 changesets with 2 changes to 1 files
965 new changesets b5f04eac9d8f:4a8dc1ab4c13
963 new changesets b5f04eac9d8f:4a8dc1ab4c13
966 no changes found
964 no changes found
967 adding remote bookmark head1
965 adding remote bookmark head1
968 updating working directory
966 updating working directory
969 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
967 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
970
968
971 $ hg -R share-1arev log -G
969 $ hg -R share-1arev log -G
972 @ changeset: 1:4a8dc1ab4c13
970 @ changeset: 1:4a8dc1ab4c13
973 | bookmark: head1
971 | bookmark: head1
974 | tag: tip
972 | tag: tip
975 | user: test
973 | user: test
976 | date: Thu Jan 01 00:00:00 1970 +0000
974 | date: Thu Jan 01 00:00:00 1970 +0000
977 | summary: head1
975 | summary: head1
978 |
976 |
979 o changeset: 0:b5f04eac9d8f
977 o changeset: 0:b5f04eac9d8f
980 user: test
978 user: test
981 date: Thu Jan 01 00:00:00 1970 +0000
979 date: Thu Jan 01 00:00:00 1970 +0000
982 summary: initial
980 summary: initial
983
981
984
982
985 making another clone should only pull down requested rev
983 making another clone should only pull down requested rev
986
984
987 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
985 $ hg --config share.pool=sharerevs clone -r 99f71071f117 source1b share-1brev
988 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
986 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
989 searching for changes
987 searching for changes
990 adding changesets
988 adding changesets
991 adding manifests
989 adding manifests
992 adding file changes
990 adding file changes
993 added 1 changesets with 1 changes to 1 files (+1 heads)
991 added 1 changesets with 1 changes to 1 files (+1 heads)
994 adding remote bookmark head1
992 adding remote bookmark head1
995 adding remote bookmark head2
993 adding remote bookmark head2
996 new changesets 99f71071f117
994 new changesets 99f71071f117
997 updating working directory
995 updating working directory
998 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
996 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
999
997
1000 $ hg -R share-1brev log -G
998 $ hg -R share-1brev log -G
1001 @ changeset: 2:99f71071f117
999 @ changeset: 2:99f71071f117
1002 | bookmark: head2
1000 | bookmark: head2
1003 | tag: tip
1001 | tag: tip
1004 | parent: 0:b5f04eac9d8f
1002 | parent: 0:b5f04eac9d8f
1005 | user: test
1003 | user: test
1006 | date: Thu Jan 01 00:00:00 1970 +0000
1004 | date: Thu Jan 01 00:00:00 1970 +0000
1007 | summary: head2
1005 | summary: head2
1008 |
1006 |
1009 | o changeset: 1:4a8dc1ab4c13
1007 | o changeset: 1:4a8dc1ab4c13
1010 |/ bookmark: head1
1008 |/ bookmark: head1
1011 | user: test
1009 | user: test
1012 | date: Thu Jan 01 00:00:00 1970 +0000
1010 | date: Thu Jan 01 00:00:00 1970 +0000
1013 | summary: head1
1011 | summary: head1
1014 |
1012 |
1015 o changeset: 0:b5f04eac9d8f
1013 o changeset: 0:b5f04eac9d8f
1016 user: test
1014 user: test
1017 date: Thu Jan 01 00:00:00 1970 +0000
1015 date: Thu Jan 01 00:00:00 1970 +0000
1018 summary: initial
1016 summary: initial
1019
1017
1020
1018
1021 Request to clone a single branch is respected in sharing mode
1019 Request to clone a single branch is respected in sharing mode
1022
1020
1023 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1021 $ hg --config share.pool=sharebranch clone -b branch1 source1b share-1bbranch1
1024 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1022 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1025 adding changesets
1023 adding changesets
1026 adding manifests
1024 adding manifests
1027 adding file changes
1025 adding file changes
1028 added 2 changesets with 2 changes to 1 files
1026 added 2 changesets with 2 changes to 1 files
1029 new changesets b5f04eac9d8f:5f92a6c1a1b1
1027 new changesets b5f04eac9d8f:5f92a6c1a1b1
1030 no changes found
1028 no changes found
1031 updating working directory
1029 updating working directory
1032 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1030 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1033
1031
1034 $ hg -R share-1bbranch1 log -G
1032 $ hg -R share-1bbranch1 log -G
1035 o changeset: 1:5f92a6c1a1b1
1033 o changeset: 1:5f92a6c1a1b1
1036 | branch: branch1
1034 | branch: branch1
1037 | tag: tip
1035 | tag: tip
1038 | user: test
1036 | user: test
1039 | date: Thu Jan 01 00:00:00 1970 +0000
1037 | date: Thu Jan 01 00:00:00 1970 +0000
1040 | summary: branch1
1038 | summary: branch1
1041 |
1039 |
1042 @ changeset: 0:b5f04eac9d8f
1040 @ changeset: 0:b5f04eac9d8f
1043 user: test
1041 user: test
1044 date: Thu Jan 01 00:00:00 1970 +0000
1042 date: Thu Jan 01 00:00:00 1970 +0000
1045 summary: initial
1043 summary: initial
1046
1044
1047
1045
1048 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1046 $ hg --config share.pool=sharebranch clone -b branch2 source1b share-1bbranch2
1049 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1047 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1050 searching for changes
1048 searching for changes
1051 adding changesets
1049 adding changesets
1052 adding manifests
1050 adding manifests
1053 adding file changes
1051 adding file changes
1054 added 1 changesets with 1 changes to 1 files (+1 heads)
1052 added 1 changesets with 1 changes to 1 files (+1 heads)
1055 new changesets 6bacf4683960
1053 new changesets 6bacf4683960
1056 updating working directory
1054 updating working directory
1057 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1055 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1058
1056
1059 $ hg -R share-1bbranch2 log -G
1057 $ hg -R share-1bbranch2 log -G
1060 o changeset: 2:6bacf4683960
1058 o changeset: 2:6bacf4683960
1061 | branch: branch2
1059 | branch: branch2
1062 | tag: tip
1060 | tag: tip
1063 | parent: 0:b5f04eac9d8f
1061 | parent: 0:b5f04eac9d8f
1064 | user: test
1062 | user: test
1065 | date: Thu Jan 01 00:00:00 1970 +0000
1063 | date: Thu Jan 01 00:00:00 1970 +0000
1066 | summary: branch2
1064 | summary: branch2
1067 |
1065 |
1068 | o changeset: 1:5f92a6c1a1b1
1066 | o changeset: 1:5f92a6c1a1b1
1069 |/ branch: branch1
1067 |/ branch: branch1
1070 | user: test
1068 | user: test
1071 | date: Thu Jan 01 00:00:00 1970 +0000
1069 | date: Thu Jan 01 00:00:00 1970 +0000
1072 | summary: branch1
1070 | summary: branch1
1073 |
1071 |
1074 @ changeset: 0:b5f04eac9d8f
1072 @ changeset: 0:b5f04eac9d8f
1075 user: test
1073 user: test
1076 date: Thu Jan 01 00:00:00 1970 +0000
1074 date: Thu Jan 01 00:00:00 1970 +0000
1077 summary: initial
1075 summary: initial
1078
1076
1079
1077
1080 -U is respected in share clone mode
1078 -U is respected in share clone mode
1081
1079
1082 $ hg --config share.pool=share clone -U source1a share-1anowc
1080 $ hg --config share.pool=share clone -U source1a share-1anowc
1083 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1081 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1084 searching for changes
1082 searching for changes
1085 no changes found
1083 no changes found
1086 adding remote bookmark bookA
1084 adding remote bookmark bookA
1087
1085
1088 $ ls share-1anowc
1086 $ ls share-1anowc
1089
1087
1090 Test that auto sharing doesn't cause failure of "hg clone local remote"
1088 Test that auto sharing doesn't cause failure of "hg clone local remote"
1091
1089
1092 $ cd $TESTTMP
1090 $ cd $TESTTMP
1093 $ hg -R a id -r 0
1091 $ hg -R a id -r 0
1094 acb14030fe0a
1092 acb14030fe0a
1095 $ hg id -R remote -r 0
1093 $ hg id -R remote -r 0
1096 abort: repository remote not found!
1094 abort: repository remote not found!
1097 [255]
1095 [255]
1098 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1096 $ hg --config share.pool=share -q clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" a ssh://user@dummy/remote
1099 $ hg -R remote id -r 0
1097 $ hg -R remote id -r 0
1100 acb14030fe0a
1098 acb14030fe0a
1101
1099
1102 Cloning into pooled storage doesn't race (issue5104)
1100 Cloning into pooled storage doesn't race (issue5104)
1103
1101
1104 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1102 $ HGPOSTLOCKDELAY=2.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace1 > race1.log 2>&1 &
1105 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1103 $ HGPRELOCKDELAY=1.0 hg --config share.pool=racepool --config extensions.lockdelay=$TESTDIR/lockdelay.py clone source1a share-destrace2 > race2.log 2>&1
1106 $ wait
1104 $ wait
1107
1105
1108 $ hg -R share-destrace1 log -r tip
1106 $ hg -R share-destrace1 log -r tip
1109 changeset: 2:e5bfe23c0b47
1107 changeset: 2:e5bfe23c0b47
1110 bookmark: bookA
1108 bookmark: bookA
1111 tag: tip
1109 tag: tip
1112 user: test
1110 user: test
1113 date: Thu Jan 01 00:00:00 1970 +0000
1111 date: Thu Jan 01 00:00:00 1970 +0000
1114 summary: 1a
1112 summary: 1a
1115
1113
1116
1114
1117 $ hg -R share-destrace2 log -r tip
1115 $ hg -R share-destrace2 log -r tip
1118 changeset: 2:e5bfe23c0b47
1116 changeset: 2:e5bfe23c0b47
1119 bookmark: bookA
1117 bookmark: bookA
1120 tag: tip
1118 tag: tip
1121 user: test
1119 user: test
1122 date: Thu Jan 01 00:00:00 1970 +0000
1120 date: Thu Jan 01 00:00:00 1970 +0000
1123 summary: 1a
1121 summary: 1a
1124
1122
1125 One repo should be new, the other should be shared from the pool. We
1123 One repo should be new, the other should be shared from the pool. We
1126 don't care which is which, so we just make sure we always print the
1124 don't care which is which, so we just make sure we always print the
1127 one containing "new pooled" first, then one one containing "existing
1125 one containing "new pooled" first, then one one containing "existing
1128 pooled".
1126 pooled".
1129
1127
1130 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1128 $ (grep 'new pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1131 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1129 (sharing from new pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1132 requesting all changes
1130 requesting all changes
1133 adding changesets
1131 adding changesets
1134 adding manifests
1132 adding manifests
1135 adding file changes
1133 adding file changes
1136 added 3 changesets with 3 changes to 1 files
1134 added 3 changesets with 3 changes to 1 files
1137 new changesets b5f04eac9d8f:e5bfe23c0b47
1135 new changesets b5f04eac9d8f:e5bfe23c0b47
1138 searching for changes
1136 searching for changes
1139 no changes found
1137 no changes found
1140 adding remote bookmark bookA
1138 adding remote bookmark bookA
1141 updating working directory
1139 updating working directory
1142 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1140 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1143
1141
1144 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1142 $ (grep 'existing pooled' race1.log > /dev/null && cat race1.log || cat race2.log) | grep -v lock
1145 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1143 (sharing from existing pooled repository b5f04eac9d8f7a6a9fcb070243cccea7dc5ea0c1)
1146 searching for changes
1144 searching for changes
1147 no changes found
1145 no changes found
1148 adding remote bookmark bookA
1146 adding remote bookmark bookA
1149 updating working directory
1147 updating working directory
1150 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1148 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1151
1149
1152 SEC: check for unsafe ssh url
1150 SEC: check for unsafe ssh url
1153
1151
1154 $ cat >> $HGRCPATH << EOF
1152 $ cat >> $HGRCPATH << EOF
1155 > [ui]
1153 > [ui]
1156 > ssh = sh -c "read l; read l; read l"
1154 > ssh = sh -c "read l; read l; read l"
1157 > EOF
1155 > EOF
1158
1156
1159 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1157 $ hg clone 'ssh://-oProxyCommand=touch${IFS}owned/path'
1160 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1158 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1161 [255]
1159 [255]
1162 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1160 $ hg clone 'ssh://%2DoProxyCommand=touch${IFS}owned/path'
1163 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1161 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch${IFS}owned/path'
1164 [255]
1162 [255]
1165 $ hg clone 'ssh://fakehost|touch%20owned/path'
1163 $ hg clone 'ssh://fakehost|touch%20owned/path'
1166 abort: no suitable response from remote hg!
1164 abort: no suitable response from remote hg!
1167 [255]
1165 [255]
1168 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1166 $ hg clone 'ssh://fakehost%7Ctouch%20owned/path'
1169 abort: no suitable response from remote hg!
1167 abort: no suitable response from remote hg!
1170 [255]
1168 [255]
1171
1169
1172 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1170 $ hg clone 'ssh://-oProxyCommand=touch owned%20foo@example.com/nonexistent/path'
1173 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1171 abort: potentially unsafe url: 'ssh://-oProxyCommand=touch owned foo@example.com/nonexistent/path'
1174 [255]
1172 [255]
1175
1173
1176 #if windows
1174 #if windows
1177 $ hg clone "ssh://%26touch%20owned%20/" --debug
1175 $ hg clone "ssh://%26touch%20owned%20/" --debug
1178 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1176 running sh -c "read l; read l; read l" "&touch owned " "hg -R . serve --stdio"
1179 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1177 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1180 sending hello command
1178 sending hello command
1181 sending between command
1179 sending between command
1182 abort: no suitable response from remote hg!
1180 abort: no suitable response from remote hg!
1183 [255]
1181 [255]
1184 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1182 $ hg clone "ssh://example.com:%26touch%20owned%20/" --debug
1185 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1183 running sh -c "read l; read l; read l" -p "&touch owned " example.com "hg -R . serve --stdio"
1186 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1184 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1187 sending hello command
1185 sending hello command
1188 sending between command
1186 sending between command
1189 abort: no suitable response from remote hg!
1187 abort: no suitable response from remote hg!
1190 [255]
1188 [255]
1191 #else
1189 #else
1192 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1190 $ hg clone "ssh://%3btouch%20owned%20/" --debug
1193 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1191 running sh -c "read l; read l; read l" ';touch owned ' 'hg -R . serve --stdio'
1194 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1192 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1195 sending hello command
1193 sending hello command
1196 sending between command
1194 sending between command
1197 abort: no suitable response from remote hg!
1195 abort: no suitable response from remote hg!
1198 [255]
1196 [255]
1199 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1197 $ hg clone "ssh://example.com:%3btouch%20owned%20/" --debug
1200 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1198 running sh -c "read l; read l; read l" -p ';touch owned ' example.com 'hg -R . serve --stdio'
1201 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1199 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1202 sending hello command
1200 sending hello command
1203 sending between command
1201 sending between command
1204 abort: no suitable response from remote hg!
1202 abort: no suitable response from remote hg!
1205 [255]
1203 [255]
1206 #endif
1204 #endif
1207
1205
1208 $ hg clone "ssh://v-alid.example.com/" --debug
1206 $ hg clone "ssh://v-alid.example.com/" --debug
1209 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1207 running sh -c "read l; read l; read l" v-alid\.example\.com ['"]hg -R \. serve --stdio['"] (re)
1210 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1208 sending upgrade request: * proto=exp-ssh-v2-0001 (glob) (sshv2 !)
1211 sending hello command
1209 sending hello command
1212 sending between command
1210 sending between command
1213 abort: no suitable response from remote hg!
1211 abort: no suitable response from remote hg!
1214 [255]
1212 [255]
1215
1213
1216 We should not have created a file named owned - if it exists, the
1214 We should not have created a file named owned - if it exists, the
1217 attack succeeded.
1215 attack succeeded.
1218 $ if test -f owned; then echo 'you got owned'; fi
1216 $ if test -f owned; then echo 'you got owned'; fi
1219
1217
1220 Cloning without fsmonitor enabled does not print a warning for small repos
1218 Cloning without fsmonitor enabled does not print a warning for small repos
1221
1219
1222 $ hg clone a fsmonitor-default
1220 $ hg clone a fsmonitor-default
1223 updating to bookmark @ on branch stable
1221 updating to bookmark @ on branch stable
1224 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1222 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1225
1223
1226 Lower the warning threshold to simulate a large repo
1224 Lower the warning threshold to simulate a large repo
1227
1225
1228 $ cat >> $HGRCPATH << EOF
1226 $ cat >> $HGRCPATH << EOF
1229 > [fsmonitor]
1227 > [fsmonitor]
1230 > warn_update_file_count = 2
1228 > warn_update_file_count = 2
1231 > EOF
1229 > EOF
1232
1230
1233 We should see a warning about no fsmonitor on supported platforms
1231 We should see a warning about no fsmonitor on supported platforms
1234
1232
1235 #if linuxormacos no-fsmonitor
1233 #if linuxormacos no-fsmonitor
1236 $ hg clone a nofsmonitor
1234 $ hg clone a nofsmonitor
1237 updating to bookmark @ on branch stable
1235 updating to bookmark @ on branch stable
1238 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1236 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1239 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1237 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1240 #else
1238 #else
1241 $ hg clone a nofsmonitor
1239 $ hg clone a nofsmonitor
1242 updating to bookmark @ on branch stable
1240 updating to bookmark @ on branch stable
1243 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1241 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1244 #endif
1242 #endif
1245
1243
1246 We should not see warning about fsmonitor when it is enabled
1244 We should not see warning about fsmonitor when it is enabled
1247
1245
1248 #if fsmonitor
1246 #if fsmonitor
1249 $ hg clone a fsmonitor-enabled
1247 $ hg clone a fsmonitor-enabled
1250 updating to bookmark @ on branch stable
1248 updating to bookmark @ on branch stable
1251 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1249 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1252 #endif
1250 #endif
1253
1251
1254 We can disable the fsmonitor warning
1252 We can disable the fsmonitor warning
1255
1253
1256 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1254 $ hg --config fsmonitor.warn_when_unused=false clone a fsmonitor-disable-warning
1257 updating to bookmark @ on branch stable
1255 updating to bookmark @ on branch stable
1258 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1256 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1259
1257
1260 Loaded fsmonitor but disabled in config should still print warning
1258 Loaded fsmonitor but disabled in config should still print warning
1261
1259
1262 #if linuxormacos fsmonitor
1260 #if linuxormacos fsmonitor
1263 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1261 $ hg --config fsmonitor.mode=off clone a fsmonitor-mode-off
1264 updating to bookmark @ on branch stable
1262 updating to bookmark @ on branch stable
1265 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1263 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (fsmonitor !)
1266 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1264 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
1267 #endif
1265 #endif
1268
1266
1269 Warning not printed if working directory isn't empty
1267 Warning not printed if working directory isn't empty
1270
1268
1271 $ hg -q clone a fsmonitor-update
1269 $ hg -q clone a fsmonitor-update
1272 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1270 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor") (?)
1273 $ cd fsmonitor-update
1271 $ cd fsmonitor-update
1274 $ hg up acb14030fe0a
1272 $ hg up acb14030fe0a
1275 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1273 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1276 (leaving bookmark @)
1274 (leaving bookmark @)
1277 $ hg up cf0fe1914066
1275 $ hg up cf0fe1914066
1278 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1279
1277
1280 `hg update` from null revision also prints
1278 `hg update` from null revision also prints
1281
1279
1282 $ hg up null
1280 $ hg up null
1283 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1281 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1284
1282
1285 #if linuxormacos no-fsmonitor
1283 #if linuxormacos no-fsmonitor
1286 $ hg up cf0fe1914066
1284 $ hg up cf0fe1914066
1287 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1285 (warning: large working directory being used without fsmonitor enabled; enable fsmonitor to improve performance; see "hg help -e fsmonitor")
1288 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1286 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1289 #else
1287 #else
1290 $ hg up cf0fe1914066
1288 $ hg up cf0fe1914066
1291 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1289 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1292 #endif
1290 #endif
1293
1291
1294 $ cd ..
1292 $ cd ..
1295
1293
@@ -1,622 +1,618 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > convert=
3 > convert=
4 > [convert]
4 > [convert]
5 > hg.saverev=False
5 > hg.saverev=False
6 > EOF
6 > EOF
7 $ hg help convert
7 $ hg help convert
8 hg convert [OPTION]... SOURCE [DEST [REVMAP]]
8 hg convert [OPTION]... SOURCE [DEST [REVMAP]]
9
9
10 convert a foreign SCM repository to a Mercurial one.
10 convert a foreign SCM repository to a Mercurial one.
11
11
12 Accepted source formats [identifiers]:
12 Accepted source formats [identifiers]:
13
13
14 - Mercurial [hg]
14 - Mercurial [hg]
15 - CVS [cvs]
15 - CVS [cvs]
16 - Darcs [darcs]
16 - Darcs [darcs]
17 - git [git]
17 - git [git]
18 - Subversion [svn]
18 - Subversion [svn]
19 - Monotone [mtn]
19 - Monotone [mtn]
20 - GNU Arch [gnuarch]
20 - GNU Arch [gnuarch]
21 - Bazaar [bzr]
21 - Bazaar [bzr]
22 - Perforce [p4]
22 - Perforce [p4]
23
23
24 Accepted destination formats [identifiers]:
24 Accepted destination formats [identifiers]:
25
25
26 - Mercurial [hg]
26 - Mercurial [hg]
27 - Subversion [svn] (history on branches is not preserved)
27 - Subversion [svn] (history on branches is not preserved)
28
28
29 If no revision is given, all revisions will be converted. Otherwise,
29 If no revision is given, all revisions will be converted. Otherwise,
30 convert will only import up to the named revision (given in a format
30 convert will only import up to the named revision (given in a format
31 understood by the source).
31 understood by the source).
32
32
33 If no destination directory name is specified, it defaults to the basename
33 If no destination directory name is specified, it defaults to the basename
34 of the source with "-hg" appended. If the destination repository doesn't
34 of the source with "-hg" appended. If the destination repository doesn't
35 exist, it will be created.
35 exist, it will be created.
36
36
37 By default, all sources except Mercurial will use --branchsort. Mercurial
37 By default, all sources except Mercurial will use --branchsort. Mercurial
38 uses --sourcesort to preserve original revision numbers order. Sort modes
38 uses --sourcesort to preserve original revision numbers order. Sort modes
39 have the following effects:
39 have the following effects:
40
40
41 --branchsort convert from parent to child revision when possible, which
41 --branchsort convert from parent to child revision when possible, which
42 means branches are usually converted one after the other.
42 means branches are usually converted one after the other.
43 It generates more compact repositories.
43 It generates more compact repositories.
44 --datesort sort revisions by date. Converted repositories have good-
44 --datesort sort revisions by date. Converted repositories have good-
45 looking changelogs but are often an order of magnitude
45 looking changelogs but are often an order of magnitude
46 larger than the same ones generated by --branchsort.
46 larger than the same ones generated by --branchsort.
47 --sourcesort try to preserve source revisions order, only supported by
47 --sourcesort try to preserve source revisions order, only supported by
48 Mercurial sources.
48 Mercurial sources.
49 --closesort try to move closed revisions as close as possible to parent
49 --closesort try to move closed revisions as close as possible to parent
50 branches, only supported by Mercurial sources.
50 branches, only supported by Mercurial sources.
51
51
52 If "REVMAP" isn't given, it will be put in a default location
52 If "REVMAP" isn't given, it will be put in a default location
53 ("<dest>/.hg/shamap" by default). The "REVMAP" is a simple text file that
53 ("<dest>/.hg/shamap" by default). The "REVMAP" is a simple text file that
54 maps each source commit ID to the destination ID for that revision, like
54 maps each source commit ID to the destination ID for that revision, like
55 so:
55 so:
56
56
57 <source ID> <destination ID>
57 <source ID> <destination ID>
58
58
59 If the file doesn't exist, it's automatically created. It's updated on
59 If the file doesn't exist, it's automatically created. It's updated on
60 each commit copied, so 'hg convert' can be interrupted and can be run
60 each commit copied, so 'hg convert' can be interrupted and can be run
61 repeatedly to copy new commits.
61 repeatedly to copy new commits.
62
62
63 The authormap is a simple text file that maps each source commit author to
63 The authormap is a simple text file that maps each source commit author to
64 a destination commit author. It is handy for source SCMs that use unix
64 a destination commit author. It is handy for source SCMs that use unix
65 logins to identify authors (e.g.: CVS). One line per author mapping and
65 logins to identify authors (e.g.: CVS). One line per author mapping and
66 the line format is:
66 the line format is:
67
67
68 source author = destination author
68 source author = destination author
69
69
70 Empty lines and lines starting with a "#" are ignored.
70 Empty lines and lines starting with a "#" are ignored.
71
71
72 The filemap is a file that allows filtering and remapping of files and
72 The filemap is a file that allows filtering and remapping of files and
73 directories. Each line can contain one of the following directives:
73 directories. Each line can contain one of the following directives:
74
74
75 include path/to/file-or-dir
75 include path/to/file-or-dir
76
76
77 exclude path/to/file-or-dir
77 exclude path/to/file-or-dir
78
78
79 rename path/to/source path/to/destination
79 rename path/to/source path/to/destination
80
80
81 Comment lines start with "#". A specified path matches if it equals the
81 Comment lines start with "#". A specified path matches if it equals the
82 full relative name of a file or one of its parent directories. The
82 full relative name of a file or one of its parent directories. The
83 "include" or "exclude" directive with the longest matching path applies,
83 "include" or "exclude" directive with the longest matching path applies,
84 so line order does not matter.
84 so line order does not matter.
85
85
86 The "include" directive causes a file, or all files under a directory, to
86 The "include" directive causes a file, or all files under a directory, to
87 be included in the destination repository. The default if there are no
87 be included in the destination repository. The default if there are no
88 "include" statements is to include everything. If there are any "include"
88 "include" statements is to include everything. If there are any "include"
89 statements, nothing else is included. The "exclude" directive causes files
89 statements, nothing else is included. The "exclude" directive causes files
90 or directories to be omitted. The "rename" directive renames a file or
90 or directories to be omitted. The "rename" directive renames a file or
91 directory if it is converted. To rename from a subdirectory into the root
91 directory if it is converted. To rename from a subdirectory into the root
92 of the repository, use "." as the path to rename to.
92 of the repository, use "." as the path to rename to.
93
93
94 "--full" will make sure the converted changesets contain exactly the right
94 "--full" will make sure the converted changesets contain exactly the right
95 files with the right content. It will make a full conversion of all files,
95 files with the right content. It will make a full conversion of all files,
96 not just the ones that have changed. Files that already are correct will
96 not just the ones that have changed. Files that already are correct will
97 not be changed. This can be used to apply filemap changes when converting
97 not be changed. This can be used to apply filemap changes when converting
98 incrementally. This is currently only supported for Mercurial and
98 incrementally. This is currently only supported for Mercurial and
99 Subversion.
99 Subversion.
100
100
101 The splicemap is a file that allows insertion of synthetic history,
101 The splicemap is a file that allows insertion of synthetic history,
102 letting you specify the parents of a revision. This is useful if you want
102 letting you specify the parents of a revision. This is useful if you want
103 to e.g. give a Subversion merge two parents, or graft two disconnected
103 to e.g. give a Subversion merge two parents, or graft two disconnected
104 series of history together. Each entry contains a key, followed by a
104 series of history together. Each entry contains a key, followed by a
105 space, followed by one or two comma-separated values:
105 space, followed by one or two comma-separated values:
106
106
107 key parent1, parent2
107 key parent1, parent2
108
108
109 The key is the revision ID in the source revision control system whose
109 The key is the revision ID in the source revision control system whose
110 parents should be modified (same format as a key in .hg/shamap). The
110 parents should be modified (same format as a key in .hg/shamap). The
111 values are the revision IDs (in either the source or destination revision
111 values are the revision IDs (in either the source or destination revision
112 control system) that should be used as the new parents for that node. For
112 control system) that should be used as the new parents for that node. For
113 example, if you have merged "release-1.0" into "trunk", then you should
113 example, if you have merged "release-1.0" into "trunk", then you should
114 specify the revision on "trunk" as the first parent and the one on the
114 specify the revision on "trunk" as the first parent and the one on the
115 "release-1.0" branch as the second.
115 "release-1.0" branch as the second.
116
116
117 The branchmap is a file that allows you to rename a branch when it is
117 The branchmap is a file that allows you to rename a branch when it is
118 being brought in from whatever external repository. When used in
118 being brought in from whatever external repository. When used in
119 conjunction with a splicemap, it allows for a powerful combination to help
119 conjunction with a splicemap, it allows for a powerful combination to help
120 fix even the most badly mismanaged repositories and turn them into nicely
120 fix even the most badly mismanaged repositories and turn them into nicely
121 structured Mercurial repositories. The branchmap contains lines of the
121 structured Mercurial repositories. The branchmap contains lines of the
122 form:
122 form:
123
123
124 original_branch_name new_branch_name
124 original_branch_name new_branch_name
125
125
126 where "original_branch_name" is the name of the branch in the source
126 where "original_branch_name" is the name of the branch in the source
127 repository, and "new_branch_name" is the name of the branch is the
127 repository, and "new_branch_name" is the name of the branch is the
128 destination repository. No whitespace is allowed in the new branch name.
128 destination repository. No whitespace is allowed in the new branch name.
129 This can be used to (for instance) move code in one repository from
129 This can be used to (for instance) move code in one repository from
130 "default" to a named branch.
130 "default" to a named branch.
131
131
132 Mercurial Source
132 Mercurial Source
133 ################
133 ################
134
134
135 The Mercurial source recognizes the following configuration options, which
135 The Mercurial source recognizes the following configuration options, which
136 you can set on the command line with "--config":
136 you can set on the command line with "--config":
137
137
138 convert.hg.ignoreerrors
138 convert.hg.ignoreerrors
139 ignore integrity errors when reading. Use it to fix
139 ignore integrity errors when reading. Use it to fix
140 Mercurial repositories with missing revlogs, by converting
140 Mercurial repositories with missing revlogs, by converting
141 from and to Mercurial. Default is False.
141 from and to Mercurial. Default is False.
142 convert.hg.saverev
142 convert.hg.saverev
143 store original revision ID in changeset (forces target IDs
143 store original revision ID in changeset (forces target IDs
144 to change). It takes a boolean argument and defaults to
144 to change). It takes a boolean argument and defaults to
145 False.
145 False.
146 convert.hg.startrev
146 convert.hg.startrev
147 specify the initial Mercurial revision. The default is 0.
147 specify the initial Mercurial revision. The default is 0.
148 convert.hg.revs
148 convert.hg.revs
149 revset specifying the source revisions to convert.
149 revset specifying the source revisions to convert.
150
150
151 CVS Source
151 CVS Source
152 ##########
152 ##########
153
153
154 CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
154 CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
155 indicate the starting point of what will be converted. Direct access to
155 indicate the starting point of what will be converted. Direct access to
156 the repository files is not needed, unless of course the repository is
156 the repository files is not needed, unless of course the repository is
157 ":local:". The conversion uses the top level directory in the sandbox to
157 ":local:". The conversion uses the top level directory in the sandbox to
158 find the CVS repository, and then uses CVS rlog commands to find files to
158 find the CVS repository, and then uses CVS rlog commands to find files to
159 convert. This means that unless a filemap is given, all files under the
159 convert. This means that unless a filemap is given, all files under the
160 starting directory will be converted, and that any directory
160 starting directory will be converted, and that any directory
161 reorganization in the CVS sandbox is ignored.
161 reorganization in the CVS sandbox is ignored.
162
162
163 The following options can be used with "--config":
163 The following options can be used with "--config":
164
164
165 convert.cvsps.cache
165 convert.cvsps.cache
166 Set to False to disable remote log caching, for testing and
166 Set to False to disable remote log caching, for testing and
167 debugging purposes. Default is True.
167 debugging purposes. Default is True.
168 convert.cvsps.fuzz
168 convert.cvsps.fuzz
169 Specify the maximum time (in seconds) that is allowed
169 Specify the maximum time (in seconds) that is allowed
170 between commits with identical user and log message in a
170 between commits with identical user and log message in a
171 single changeset. When very large files were checked in as
171 single changeset. When very large files were checked in as
172 part of a changeset then the default may not be long enough.
172 part of a changeset then the default may not be long enough.
173 The default is 60.
173 The default is 60.
174 convert.cvsps.logencoding
174 convert.cvsps.logencoding
175 Specify encoding name to be used for transcoding CVS log
175 Specify encoding name to be used for transcoding CVS log
176 messages. Multiple encoding names can be specified as a list
176 messages. Multiple encoding names can be specified as a list
177 (see 'hg help config.Syntax'), but only the first acceptable
177 (see 'hg help config.Syntax'), but only the first acceptable
178 encoding in the list is used per CVS log entries. This
178 encoding in the list is used per CVS log entries. This
179 transcoding is executed before cvslog hook below.
179 transcoding is executed before cvslog hook below.
180 convert.cvsps.mergeto
180 convert.cvsps.mergeto
181 Specify a regular expression to which commit log messages
181 Specify a regular expression to which commit log messages
182 are matched. If a match occurs, then the conversion process
182 are matched. If a match occurs, then the conversion process
183 will insert a dummy revision merging the branch on which
183 will insert a dummy revision merging the branch on which
184 this log message occurs to the branch indicated in the
184 this log message occurs to the branch indicated in the
185 regex. Default is "{{mergetobranch ([-\w]+)}}"
185 regex. Default is "{{mergetobranch ([-\w]+)}}"
186 convert.cvsps.mergefrom
186 convert.cvsps.mergefrom
187 Specify a regular expression to which commit log messages
187 Specify a regular expression to which commit log messages
188 are matched. If a match occurs, then the conversion process
188 are matched. If a match occurs, then the conversion process
189 will add the most recent revision on the branch indicated in
189 will add the most recent revision on the branch indicated in
190 the regex as the second parent of the changeset. Default is
190 the regex as the second parent of the changeset. Default is
191 "{{mergefrombranch ([-\w]+)}}"
191 "{{mergefrombranch ([-\w]+)}}"
192 convert.localtimezone
192 convert.localtimezone
193 use local time (as determined by the TZ environment
193 use local time (as determined by the TZ environment
194 variable) for changeset date/times. The default is False
194 variable) for changeset date/times. The default is False
195 (use UTC).
195 (use UTC).
196 hooks.cvslog Specify a Python function to be called at the end of
196 hooks.cvslog Specify a Python function to be called at the end of
197 gathering the CVS log. The function is passed a list with
197 gathering the CVS log. The function is passed a list with
198 the log entries, and can modify the entries in-place, or add
198 the log entries, and can modify the entries in-place, or add
199 or delete them.
199 or delete them.
200 hooks.cvschangesets
200 hooks.cvschangesets
201 Specify a Python function to be called after the changesets
201 Specify a Python function to be called after the changesets
202 are calculated from the CVS log. The function is passed a
202 are calculated from the CVS log. The function is passed a
203 list with the changeset entries, and can modify the
203 list with the changeset entries, and can modify the
204 changesets in-place, or add or delete them.
204 changesets in-place, or add or delete them.
205
205
206 An additional "debugcvsps" Mercurial command allows the builtin changeset
206 An additional "debugcvsps" Mercurial command allows the builtin changeset
207 merging code to be run without doing a conversion. Its parameters and
207 merging code to be run without doing a conversion. Its parameters and
208 output are similar to that of cvsps 2.1. Please see the command help for
208 output are similar to that of cvsps 2.1. Please see the command help for
209 more details.
209 more details.
210
210
211 Subversion Source
211 Subversion Source
212 #################
212 #################
213
213
214 Subversion source detects classical trunk/branches/tags layouts. By
214 Subversion source detects classical trunk/branches/tags layouts. By
215 default, the supplied "svn://repo/path/" source URL is converted as a
215 default, the supplied "svn://repo/path/" source URL is converted as a
216 single branch. If "svn://repo/path/trunk" exists it replaces the default
216 single branch. If "svn://repo/path/trunk" exists it replaces the default
217 branch. If "svn://repo/path/branches" exists, its subdirectories are
217 branch. If "svn://repo/path/branches" exists, its subdirectories are
218 listed as possible branches. If "svn://repo/path/tags" exists, it is
218 listed as possible branches. If "svn://repo/path/tags" exists, it is
219 looked for tags referencing converted branches. Default "trunk",
219 looked for tags referencing converted branches. Default "trunk",
220 "branches" and "tags" values can be overridden with following options. Set
220 "branches" and "tags" values can be overridden with following options. Set
221 them to paths relative to the source URL, or leave them blank to disable
221 them to paths relative to the source URL, or leave them blank to disable
222 auto detection.
222 auto detection.
223
223
224 The following options can be set with "--config":
224 The following options can be set with "--config":
225
225
226 convert.svn.branches
226 convert.svn.branches
227 specify the directory containing branches. The default is
227 specify the directory containing branches. The default is
228 "branches".
228 "branches".
229 convert.svn.tags
229 convert.svn.tags
230 specify the directory containing tags. The default is
230 specify the directory containing tags. The default is
231 "tags".
231 "tags".
232 convert.svn.trunk
232 convert.svn.trunk
233 specify the name of the trunk branch. The default is
233 specify the name of the trunk branch. The default is
234 "trunk".
234 "trunk".
235 convert.localtimezone
235 convert.localtimezone
236 use local time (as determined by the TZ environment
236 use local time (as determined by the TZ environment
237 variable) for changeset date/times. The default is False
237 variable) for changeset date/times. The default is False
238 (use UTC).
238 (use UTC).
239
239
240 Source history can be retrieved starting at a specific revision, instead
240 Source history can be retrieved starting at a specific revision, instead
241 of being integrally converted. Only single branch conversions are
241 of being integrally converted. Only single branch conversions are
242 supported.
242 supported.
243
243
244 convert.svn.startrev
244 convert.svn.startrev
245 specify start Subversion revision number. The default is 0.
245 specify start Subversion revision number. The default is 0.
246
246
247 Git Source
247 Git Source
248 ##########
248 ##########
249
249
250 The Git importer converts commits from all reachable branches (refs in
250 The Git importer converts commits from all reachable branches (refs in
251 refs/heads) and remotes (refs in refs/remotes) to Mercurial. Branches are
251 refs/heads) and remotes (refs in refs/remotes) to Mercurial. Branches are
252 converted to bookmarks with the same name, with the leading 'refs/heads'
252 converted to bookmarks with the same name, with the leading 'refs/heads'
253 stripped. Git submodules are converted to Git subrepos in Mercurial.
253 stripped. Git submodules are converted to Git subrepos in Mercurial.
254
254
255 The following options can be set with "--config":
255 The following options can be set with "--config":
256
256
257 convert.git.similarity
257 convert.git.similarity
258 specify how similar files modified in a commit must be to be
258 specify how similar files modified in a commit must be to be
259 imported as renames or copies, as a percentage between "0"
259 imported as renames or copies, as a percentage between "0"
260 (disabled) and "100" (files must be identical). For example,
260 (disabled) and "100" (files must be identical). For example,
261 "90" means that a delete/add pair will be imported as a
261 "90" means that a delete/add pair will be imported as a
262 rename if more than 90% of the file hasn't changed. The
262 rename if more than 90% of the file hasn't changed. The
263 default is "50".
263 default is "50".
264 convert.git.findcopiesharder
264 convert.git.findcopiesharder
265 while detecting copies, look at all files in the working
265 while detecting copies, look at all files in the working
266 copy instead of just changed ones. This is very expensive
266 copy instead of just changed ones. This is very expensive
267 for large projects, and is only effective when
267 for large projects, and is only effective when
268 "convert.git.similarity" is greater than 0. The default is
268 "convert.git.similarity" is greater than 0. The default is
269 False.
269 False.
270 convert.git.renamelimit
270 convert.git.renamelimit
271 perform rename and copy detection up to this many changed
271 perform rename and copy detection up to this many changed
272 files in a commit. Increasing this will make rename and copy
272 files in a commit. Increasing this will make rename and copy
273 detection more accurate but will significantly slow down
273 detection more accurate but will significantly slow down
274 computation on large projects. The option is only relevant
274 computation on large projects. The option is only relevant
275 if "convert.git.similarity" is greater than 0. The default
275 if "convert.git.similarity" is greater than 0. The default
276 is "400".
276 is "400".
277 convert.git.committeractions
277 convert.git.committeractions
278 list of actions to take when processing author and committer
278 list of actions to take when processing author and committer
279 values.
279 values.
280
280
281 Git commits have separate author (who wrote the commit) and committer
281 Git commits have separate author (who wrote the commit) and committer
282 (who applied the commit) fields. Not all destinations support separate
282 (who applied the commit) fields. Not all destinations support separate
283 author and committer fields (including Mercurial). This config option
283 author and committer fields (including Mercurial). This config option
284 controls what to do with these author and committer fields during
284 controls what to do with these author and committer fields during
285 conversion.
285 conversion.
286
286
287 A value of "messagedifferent" will append a "committer: ..." line to
287 A value of "messagedifferent" will append a "committer: ..." line to
288 the commit message if the Git committer is different from the author.
288 the commit message if the Git committer is different from the author.
289 The prefix of that line can be specified using the syntax
289 The prefix of that line can be specified using the syntax
290 "messagedifferent=<prefix>". e.g. "messagedifferent=git-committer:".
290 "messagedifferent=<prefix>". e.g. "messagedifferent=git-committer:".
291 When a prefix is specified, a space will always be inserted between
291 When a prefix is specified, a space will always be inserted between
292 the prefix and the value.
292 the prefix and the value.
293
293
294 "messagealways" behaves like "messagedifferent" except it will always
294 "messagealways" behaves like "messagedifferent" except it will always
295 result in a "committer: ..." line being appended to the commit
295 result in a "committer: ..." line being appended to the commit
296 message. This value is mutually exclusive with "messagedifferent".
296 message. This value is mutually exclusive with "messagedifferent".
297
297
298 "dropcommitter" will remove references to the committer. Only
298 "dropcommitter" will remove references to the committer. Only
299 references to the author will remain. Actions that add references to
299 references to the author will remain. Actions that add references to
300 the committer will have no effect when this is set.
300 the committer will have no effect when this is set.
301
301
302 "replaceauthor" will replace the value of the author field with the
302 "replaceauthor" will replace the value of the author field with the
303 committer. Other actions that add references to the committer will
303 committer. Other actions that add references to the committer will
304 still take effect when this is set.
304 still take effect when this is set.
305
305
306 The default is "messagedifferent".
306 The default is "messagedifferent".
307
307
308 convert.git.extrakeys
308 convert.git.extrakeys
309 list of extra keys from commit metadata to copy to the
309 list of extra keys from commit metadata to copy to the
310 destination. Some Git repositories store extra metadata in
310 destination. Some Git repositories store extra metadata in
311 commits. By default, this non-default metadata will be lost
311 commits. By default, this non-default metadata will be lost
312 during conversion. Setting this config option can retain
312 during conversion. Setting this config option can retain
313 that metadata. Some built-in keys such as "parent" and
313 that metadata. Some built-in keys such as "parent" and
314 "branch" are not allowed to be copied.
314 "branch" are not allowed to be copied.
315 convert.git.remoteprefix
315 convert.git.remoteprefix
316 remote refs are converted as bookmarks with
316 remote refs are converted as bookmarks with
317 "convert.git.remoteprefix" as a prefix followed by a /. The
317 "convert.git.remoteprefix" as a prefix followed by a /. The
318 default is 'remote'.
318 default is 'remote'.
319 convert.git.saverev
319 convert.git.saverev
320 whether to store the original Git commit ID in the metadata
320 whether to store the original Git commit ID in the metadata
321 of the destination commit. The default is True.
321 of the destination commit. The default is True.
322 convert.git.skipsubmodules
322 convert.git.skipsubmodules
323 does not convert root level .gitmodules files or files with
323 does not convert root level .gitmodules files or files with
324 160000 mode indicating a submodule. Default is False.
324 160000 mode indicating a submodule. Default is False.
325
325
326 Perforce Source
326 Perforce Source
327 ###############
327 ###############
328
328
329 The Perforce (P4) importer can be given a p4 depot path or a client
329 The Perforce (P4) importer can be given a p4 depot path or a client
330 specification as source. It will convert all files in the source to a flat
330 specification as source. It will convert all files in the source to a flat
331 Mercurial repository, ignoring labels, branches and integrations. Note
331 Mercurial repository, ignoring labels, branches and integrations. Note
332 that when a depot path is given you then usually should specify a target
332 that when a depot path is given you then usually should specify a target
333 directory, because otherwise the target may be named "...-hg".
333 directory, because otherwise the target may be named "...-hg".
334
334
335 The following options can be set with "--config":
335 The following options can be set with "--config":
336
336
337 convert.p4.encoding
337 convert.p4.encoding
338 specify the encoding to use when decoding standard output of
338 specify the encoding to use when decoding standard output of
339 the Perforce command line tool. The default is default
339 the Perforce command line tool. The default is default
340 system encoding.
340 system encoding.
341 convert.p4.startrev
341 convert.p4.startrev
342 specify initial Perforce revision (a Perforce changelist
342 specify initial Perforce revision (a Perforce changelist
343 number).
343 number).
344
344
345 Mercurial Destination
345 Mercurial Destination
346 #####################
346 #####################
347
347
348 The Mercurial destination will recognize Mercurial subrepositories in the
348 The Mercurial destination will recognize Mercurial subrepositories in the
349 destination directory, and update the .hgsubstate file automatically if
349 destination directory, and update the .hgsubstate file automatically if
350 the destination subrepositories contain the <dest>/<sub>/.hg/shamap file.
350 the destination subrepositories contain the <dest>/<sub>/.hg/shamap file.
351 Converting a repository with subrepositories requires converting a single
351 Converting a repository with subrepositories requires converting a single
352 repository at a time, from the bottom up.
352 repository at a time, from the bottom up.
353
353
354 The following options are supported:
354 The following options are supported:
355
355
356 convert.hg.clonebranches
356 convert.hg.clonebranches
357 dispatch source branches in separate clones. The default is
357 dispatch source branches in separate clones. The default is
358 False.
358 False.
359 convert.hg.tagsbranch
359 convert.hg.tagsbranch
360 branch name for tag revisions, defaults to "default".
360 branch name for tag revisions, defaults to "default".
361 convert.hg.usebranchnames
361 convert.hg.usebranchnames
362 preserve branch names. The default is True.
362 preserve branch names. The default is True.
363 convert.hg.sourcename
363 convert.hg.sourcename
364 records the given string as a 'convert_source' extra value
364 records the given string as a 'convert_source' extra value
365 on each commit made in the target repository. The default is
365 on each commit made in the target repository. The default is
366 None.
366 None.
367
367
368 All Destinations
368 All Destinations
369 ################
369 ################
370
370
371 All destination types accept the following options:
371 All destination types accept the following options:
372
372
373 convert.skiptags
373 convert.skiptags
374 does not convert tags from the source repo to the target
374 does not convert tags from the source repo to the target
375 repo. The default is False.
375 repo. The default is False.
376
376
377 options ([+] can be repeated):
377 options ([+] can be repeated):
378
378
379 -s --source-type TYPE source repository type
379 -s --source-type TYPE source repository type
380 -d --dest-type TYPE destination repository type
380 -d --dest-type TYPE destination repository type
381 -r --rev REV [+] import up to source revision REV
381 -r --rev REV [+] import up to source revision REV
382 -A --authormap FILE remap usernames using this file
382 -A --authormap FILE remap usernames using this file
383 --filemap FILE remap file names using contents of file
383 --filemap FILE remap file names using contents of file
384 --full apply filemap changes by converting all files again
384 --full apply filemap changes by converting all files again
385 --splicemap FILE splice synthesized history into place
385 --splicemap FILE splice synthesized history into place
386 --branchmap FILE change branch names while converting
386 --branchmap FILE change branch names while converting
387 --branchsort try to sort changesets by branches
387 --branchsort try to sort changesets by branches
388 --datesort try to sort changesets by date
388 --datesort try to sort changesets by date
389 --sourcesort preserve source changesets order
389 --sourcesort preserve source changesets order
390 --closesort try to reorder closed revisions
390 --closesort try to reorder closed revisions
391
391
392 (some details hidden, use --verbose to show complete help)
392 (some details hidden, use --verbose to show complete help)
393 $ hg init a
393 $ hg init a
394 $ cd a
394 $ cd a
395 $ echo a > a
395 $ echo a > a
396 $ hg ci -d'0 0' -Ama
396 $ hg ci -d'0 0' -Ama
397 adding a
397 adding a
398 $ hg cp a b
398 $ hg cp a b
399 $ hg ci -d'1 0' -mb
399 $ hg ci -d'1 0' -mb
400 $ hg rm a
400 $ hg rm a
401 $ hg ci -d'2 0' -mc
401 $ hg ci -d'2 0' -mc
402 $ hg mv b a
402 $ hg mv b a
403 $ hg ci -d'3 0' -md
403 $ hg ci -d'3 0' -md
404 $ echo a >> a
404 $ echo a >> a
405 $ hg ci -d'4 0' -me
405 $ hg ci -d'4 0' -me
406 $ cd ..
406 $ cd ..
407 $ hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded'
407 $ hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded'
408 assuming destination a-hg
408 assuming destination a-hg
409 initializing destination a-hg repository
409 initializing destination a-hg repository
410 scanning source...
410 scanning source...
411 sorting...
411 sorting...
412 converting...
412 converting...
413 4 a
413 4 a
414 3 b
414 3 b
415 2 c
415 2 c
416 1 d
416 1 d
417 0 e
417 0 e
418 $ hg --cwd a-hg pull ../a
418 $ hg --cwd a-hg pull ../a
419 pulling from ../a
419 pulling from ../a
420 searching for changes
420 searching for changes
421 no changes found
421 no changes found
422
422
423 conversion to existing file should fail
423 conversion to existing file should fail
424
424
425 $ touch bogusfile
425 $ touch bogusfile
426 $ hg convert a bogusfile
426 $ hg convert a bogusfile
427 initializing destination bogusfile repository
427 initializing destination bogusfile repository
428 abort: cannot create new bundle repository
428 abort: cannot create new bundle repository
429 [255]
429 [255]
430
430
431 #if unix-permissions no-root
431 #if unix-permissions no-root
432
432
433 conversion to dir without permissions should fail
433 conversion to dir without permissions should fail
434
434
435 $ mkdir bogusdir
435 $ mkdir bogusdir
436 $ chmod 000 bogusdir
436 $ chmod 000 bogusdir
437
437
438 $ hg convert a bogusdir
438 $ hg convert a bogusdir
439 abort: Permission denied: 'bogusdir'
439 abort: Permission denied: 'bogusdir'
440 [255]
440 [255]
441
441
442 user permissions should succeed
442 user permissions should succeed
443
443
444 $ chmod 700 bogusdir
444 $ chmod 700 bogusdir
445 $ hg convert a bogusdir
445 $ hg convert a bogusdir
446 initializing destination bogusdir repository
446 initializing destination bogusdir repository
447 scanning source...
447 scanning source...
448 sorting...
448 sorting...
449 converting...
449 converting...
450 4 a
450 4 a
451 3 b
451 3 b
452 2 c
452 2 c
453 1 d
453 1 d
454 0 e
454 0 e
455
455
456 #endif
456 #endif
457
457
458 test pre and post conversion actions
458 test pre and post conversion actions
459
459
460 $ echo 'include b' > filemap
460 $ echo 'include b' > filemap
461 $ hg convert --debug --filemap filemap a partialb | \
461 $ hg convert --debug --filemap filemap a partialb | \
462 > grep 'run hg'
462 > grep 'run hg'
463 run hg source pre-conversion action
463 run hg source pre-conversion action
464 run hg sink pre-conversion action
464 run hg sink pre-conversion action
465 run hg sink post-conversion action
465 run hg sink post-conversion action
466 run hg source post-conversion action
466 run hg source post-conversion action
467
467
468 converting empty dir should fail "nicely
468 converting empty dir should fail "nicely
469
469
470 $ mkdir emptydir
470 $ mkdir emptydir
471
471
472 override $PATH to ensure p4 not visible; use $PYTHON in case we're
472 override $PATH to ensure p4 not visible; use $PYTHON in case we're
473 running from a devel copy, not a temp installation
473 running from a devel copy, not a temp installation
474
474
475 $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg convert emptydir
475 $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg convert emptydir
476 assuming destination emptydir-hg
476 assuming destination emptydir-hg
477 initializing destination emptydir-hg repository
477 initializing destination emptydir-hg repository
478 emptydir does not look like a CVS checkout
478 emptydir does not look like a CVS checkout
479 $TESTTMP/emptydir does not look like a Git repository
479 $TESTTMP/emptydir does not look like a Git repository
480 emptydir does not look like a Subversion repository
480 emptydir does not look like a Subversion repository
481 emptydir is not a local Mercurial repository
481 emptydir is not a local Mercurial repository
482 emptydir does not look like a darcs repository
482 emptydir does not look like a darcs repository
483 emptydir does not look like a monotone repository
483 emptydir does not look like a monotone repository
484 emptydir does not look like a GNU Arch repository
484 emptydir does not look like a GNU Arch repository
485 emptydir does not look like a Bazaar repository
485 emptydir does not look like a Bazaar repository
486 cannot find required "p4" tool
486 cannot find required "p4" tool
487 abort: emptydir: missing or unsupported repository
487 abort: emptydir: missing or unsupported repository
488 [255]
488 [255]
489
489
490 convert with imaginary source type
490 convert with imaginary source type
491
491
492 $ hg convert --source-type foo a a-foo
492 $ hg convert --source-type foo a a-foo
493 initializing destination a-foo repository
493 initializing destination a-foo repository
494 abort: foo: invalid source repository type
494 abort: foo: invalid source repository type
495 [255]
495 [255]
496
496
497 convert with imaginary sink type
497 convert with imaginary sink type
498
498
499 $ hg convert --dest-type foo a a-foo
499 $ hg convert --dest-type foo a a-foo
500 abort: foo: invalid destination repository type
500 abort: foo: invalid destination repository type
501 [255]
501 [255]
502
502
503 testing: convert must not produce duplicate entries in fncache
503 testing: convert must not produce duplicate entries in fncache
504
504
505 $ hg convert a b
505 $ hg convert a b
506 initializing destination b repository
506 initializing destination b repository
507 scanning source...
507 scanning source...
508 sorting...
508 sorting...
509 converting...
509 converting...
510 4 a
510 4 a
511 3 b
511 3 b
512 2 c
512 2 c
513 1 d
513 1 d
514 0 e
514 0 e
515
515
516 contents of fncache file:
516 contents of fncache file:
517
517
518 #if repofncache
518 $ cat b/.hg/store/fncache | sort
519 $ cat b/.hg/store/fncache | sort
519 data/a.i (reporevlogstore !)
520 data/a.i (reporevlogstore !)
520 data/b.i (reporevlogstore !)
521 data/b.i (reporevlogstore !)
521 data/a/0f3078c2d7345d887b54f7c9dab0d91bfa57fd07 (reposimplestore !)
522 #endif
522 data/a/4271c3e84237016935a176b6f282fde2128458b0 (reposimplestore !)
523 data/a/b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 (reposimplestore !)
524 data/a/index (reposimplestore !)
525 data/b/37d9b5d994eab34eda9c16b195ace52c7b129980 (reposimplestore !)
526 data/b/index (reposimplestore !)
527
523
528 test bogus URL
524 test bogus URL
529
525
530 $ hg convert -q bzr+ssh://foobar@selenic.com/baz baz
526 $ hg convert -q bzr+ssh://foobar@selenic.com/baz baz
531 abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository
527 abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository
532 [255]
528 [255]
533
529
534 test revset converted() lookup
530 test revset converted() lookup
535
531
536 $ hg --config convert.hg.saverev=True convert a c
532 $ hg --config convert.hg.saverev=True convert a c
537 initializing destination c repository
533 initializing destination c repository
538 scanning source...
534 scanning source...
539 sorting...
535 sorting...
540 converting...
536 converting...
541 4 a
537 4 a
542 3 b
538 3 b
543 2 c
539 2 c
544 1 d
540 1 d
545 0 e
541 0 e
546 $ echo f > c/f
542 $ echo f > c/f
547 $ hg -R c ci -d'0 0' -Amf
543 $ hg -R c ci -d'0 0' -Amf
548 adding f
544 adding f
549 created new head
545 created new head
550 $ hg -R c log -r "converted(09d945a62ce6)"
546 $ hg -R c log -r "converted(09d945a62ce6)"
551 changeset: 1:98c3dd46a874
547 changeset: 1:98c3dd46a874
552 user: test
548 user: test
553 date: Thu Jan 01 00:00:01 1970 +0000
549 date: Thu Jan 01 00:00:01 1970 +0000
554 summary: b
550 summary: b
555
551
556 $ hg -R c log -r "converted()"
552 $ hg -R c log -r "converted()"
557 changeset: 0:31ed57b2037c
553 changeset: 0:31ed57b2037c
558 user: test
554 user: test
559 date: Thu Jan 01 00:00:00 1970 +0000
555 date: Thu Jan 01 00:00:00 1970 +0000
560 summary: a
556 summary: a
561
557
562 changeset: 1:98c3dd46a874
558 changeset: 1:98c3dd46a874
563 user: test
559 user: test
564 date: Thu Jan 01 00:00:01 1970 +0000
560 date: Thu Jan 01 00:00:01 1970 +0000
565 summary: b
561 summary: b
566
562
567 changeset: 2:3b9ca06ef716
563 changeset: 2:3b9ca06ef716
568 user: test
564 user: test
569 date: Thu Jan 01 00:00:02 1970 +0000
565 date: Thu Jan 01 00:00:02 1970 +0000
570 summary: c
566 summary: c
571
567
572 changeset: 3:4e0debd37cf2
568 changeset: 3:4e0debd37cf2
573 user: test
569 user: test
574 date: Thu Jan 01 00:00:03 1970 +0000
570 date: Thu Jan 01 00:00:03 1970 +0000
575 summary: d
571 summary: d
576
572
577 changeset: 4:9de3bc9349c5
573 changeset: 4:9de3bc9349c5
578 user: test
574 user: test
579 date: Thu Jan 01 00:00:04 1970 +0000
575 date: Thu Jan 01 00:00:04 1970 +0000
580 summary: e
576 summary: e
581
577
582
578
583 test specifying a sourcename
579 test specifying a sourcename
584 $ echo g > a/g
580 $ echo g > a/g
585 $ hg -R a ci -d'0 0' -Amg
581 $ hg -R a ci -d'0 0' -Amg
586 adding g
582 adding g
587 $ hg --config convert.hg.sourcename=mysource --config convert.hg.saverev=True convert a c
583 $ hg --config convert.hg.sourcename=mysource --config convert.hg.saverev=True convert a c
588 scanning source...
584 scanning source...
589 sorting...
585 sorting...
590 converting...
586 converting...
591 0 g
587 0 g
592 $ hg -R c log -r tip --template '{extras % "{extra}\n"}'
588 $ hg -R c log -r tip --template '{extras % "{extra}\n"}'
593 branch=default
589 branch=default
594 convert_revision=a3bc6100aa8ec03e00aaf271f1f50046fb432072
590 convert_revision=a3bc6100aa8ec03e00aaf271f1f50046fb432072
595 convert_source=mysource
591 convert_source=mysource
596
592
597 $ cat > branchmap.txt << EOF
593 $ cat > branchmap.txt << EOF
598 > old branch new_branch
594 > old branch new_branch
599 > EOF
595 > EOF
600
596
601 $ hg -R a branch -q 'old branch'
597 $ hg -R a branch -q 'old branch'
602 $ echo gg > a/g
598 $ echo gg > a/g
603 $ hg -R a ci -m 'branch name with spaces'
599 $ hg -R a ci -m 'branch name with spaces'
604 $ hg convert --branchmap branchmap.txt a d
600 $ hg convert --branchmap branchmap.txt a d
605 initializing destination d repository
601 initializing destination d repository
606 scanning source...
602 scanning source...
607 sorting...
603 sorting...
608 converting...
604 converting...
609 6 a
605 6 a
610 5 b
606 5 b
611 4 c
607 4 c
612 3 d
608 3 d
613 2 e
609 2 e
614 1 g
610 1 g
615 0 branch name with spaces
611 0 branch name with spaces
616
612
617 $ hg -R a branches
613 $ hg -R a branches
618 old branch 6:a24a66ade009
614 old branch 6:a24a66ade009
619 default 5:a3bc6100aa8e (inactive)
615 default 5:a3bc6100aa8e (inactive)
620 $ hg -R d branches
616 $ hg -R d branches
621 new_branch 6:64ed208b732b
617 new_branch 6:64ed208b732b
622 default 5:a3bc6100aa8e (inactive)
618 default 5:a3bc6100aa8e (inactive)
@@ -1,436 +1,438 b''
1 #require repofncache
2
1 Init repo1:
3 Init repo1:
2
4
3 $ hg init repo1
5 $ hg init repo1
4 $ cd repo1
6 $ cd repo1
5 $ echo "some text" > a
7 $ echo "some text" > a
6 $ hg add
8 $ hg add
7 adding a
9 adding a
8 $ hg ci -m first
10 $ hg ci -m first
9 $ cat .hg/store/fncache | sort
11 $ cat .hg/store/fncache | sort
10 data/a.i
12 data/a.i
11
13
12 Testing a.i/b:
14 Testing a.i/b:
13
15
14 $ mkdir a.i
16 $ mkdir a.i
15 $ echo "some other text" > a.i/b
17 $ echo "some other text" > a.i/b
16 $ hg add
18 $ hg add
17 adding a.i/b
19 adding a.i/b
18 $ hg ci -m second
20 $ hg ci -m second
19 $ cat .hg/store/fncache | sort
21 $ cat .hg/store/fncache | sort
20 data/a.i
22 data/a.i
21 data/a.i.hg/b.i
23 data/a.i.hg/b.i
22
24
23 Testing a.i.hg/c:
25 Testing a.i.hg/c:
24
26
25 $ mkdir a.i.hg
27 $ mkdir a.i.hg
26 $ echo "yet another text" > a.i.hg/c
28 $ echo "yet another text" > a.i.hg/c
27 $ hg add
29 $ hg add
28 adding a.i.hg/c
30 adding a.i.hg/c
29 $ hg ci -m third
31 $ hg ci -m third
30 $ cat .hg/store/fncache | sort
32 $ cat .hg/store/fncache | sort
31 data/a.i
33 data/a.i
32 data/a.i.hg.hg/c.i
34 data/a.i.hg.hg/c.i
33 data/a.i.hg/b.i
35 data/a.i.hg/b.i
34
36
35 Testing verify:
37 Testing verify:
36
38
37 $ hg verify
39 $ hg verify
38 checking changesets
40 checking changesets
39 checking manifests
41 checking manifests
40 crosschecking files in changesets and manifests
42 crosschecking files in changesets and manifests
41 checking files
43 checking files
42 3 files, 3 changesets, 3 total revisions
44 3 files, 3 changesets, 3 total revisions
43
45
44 $ rm .hg/store/fncache
46 $ rm .hg/store/fncache
45
47
46 $ hg verify
48 $ hg verify
47 checking changesets
49 checking changesets
48 checking manifests
50 checking manifests
49 crosschecking files in changesets and manifests
51 crosschecking files in changesets and manifests
50 checking files
52 checking files
51 warning: revlog 'data/a.i' not in fncache!
53 warning: revlog 'data/a.i' not in fncache!
52 warning: revlog 'data/a.i.hg/c.i' not in fncache!
54 warning: revlog 'data/a.i.hg/c.i' not in fncache!
53 warning: revlog 'data/a.i/b.i' not in fncache!
55 warning: revlog 'data/a.i/b.i' not in fncache!
54 3 files, 3 changesets, 3 total revisions
56 3 files, 3 changesets, 3 total revisions
55 3 warnings encountered!
57 3 warnings encountered!
56 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
58 hint: run "hg debugrebuildfncache" to recover from corrupt fncache
57
59
58 Follow the hint to make sure it works
60 Follow the hint to make sure it works
59
61
60 $ hg debugrebuildfncache
62 $ hg debugrebuildfncache
61 adding data/a.i
63 adding data/a.i
62 adding data/a.i.hg/c.i
64 adding data/a.i.hg/c.i
63 adding data/a.i/b.i
65 adding data/a.i/b.i
64 3 items added, 0 removed from fncache
66 3 items added, 0 removed from fncache
65
67
66 $ hg verify
68 $ hg verify
67 checking changesets
69 checking changesets
68 checking manifests
70 checking manifests
69 crosschecking files in changesets and manifests
71 crosschecking files in changesets and manifests
70 checking files
72 checking files
71 3 files, 3 changesets, 3 total revisions
73 3 files, 3 changesets, 3 total revisions
72
74
73 $ cd ..
75 $ cd ..
74
76
75 Non store repo:
77 Non store repo:
76
78
77 $ hg --config format.usestore=False init foo
79 $ hg --config format.usestore=False init foo
78 $ cd foo
80 $ cd foo
79 $ mkdir tst.d
81 $ mkdir tst.d
80 $ echo foo > tst.d/foo
82 $ echo foo > tst.d/foo
81 $ hg ci -Amfoo
83 $ hg ci -Amfoo
82 adding tst.d/foo
84 adding tst.d/foo
83 $ find .hg | sort
85 $ find .hg | sort
84 .hg
86 .hg
85 .hg/00changelog.i
87 .hg/00changelog.i
86 .hg/00manifest.i
88 .hg/00manifest.i
87 .hg/cache
89 .hg/cache
88 .hg/cache/branch2-served
90 .hg/cache/branch2-served
89 .hg/cache/rbc-names-v1
91 .hg/cache/rbc-names-v1
90 .hg/cache/rbc-revs-v1
92 .hg/cache/rbc-revs-v1
91 .hg/data
93 .hg/data
92 .hg/data/tst.d.hg
94 .hg/data/tst.d.hg
93 .hg/data/tst.d.hg/foo.i
95 .hg/data/tst.d.hg/foo.i
94 .hg/dirstate
96 .hg/dirstate
95 .hg/fsmonitor.state (fsmonitor !)
97 .hg/fsmonitor.state (fsmonitor !)
96 .hg/last-message.txt
98 .hg/last-message.txt
97 .hg/phaseroots
99 .hg/phaseroots
98 .hg/requires
100 .hg/requires
99 .hg/undo
101 .hg/undo
100 .hg/undo.backup.dirstate
102 .hg/undo.backup.dirstate
101 .hg/undo.backupfiles
103 .hg/undo.backupfiles
102 .hg/undo.bookmarks
104 .hg/undo.bookmarks
103 .hg/undo.branch
105 .hg/undo.branch
104 .hg/undo.desc
106 .hg/undo.desc
105 .hg/undo.dirstate
107 .hg/undo.dirstate
106 .hg/undo.phaseroots
108 .hg/undo.phaseroots
107 $ cd ..
109 $ cd ..
108
110
109 Non fncache repo:
111 Non fncache repo:
110
112
111 $ hg --config format.usefncache=False init bar
113 $ hg --config format.usefncache=False init bar
112 $ cd bar
114 $ cd bar
113 $ mkdir tst.d
115 $ mkdir tst.d
114 $ echo foo > tst.d/Foo
116 $ echo foo > tst.d/Foo
115 $ hg ci -Amfoo
117 $ hg ci -Amfoo
116 adding tst.d/Foo
118 adding tst.d/Foo
117 $ find .hg | sort
119 $ find .hg | sort
118 .hg
120 .hg
119 .hg/00changelog.i
121 .hg/00changelog.i
120 .hg/cache
122 .hg/cache
121 .hg/cache/branch2-served
123 .hg/cache/branch2-served
122 .hg/cache/rbc-names-v1
124 .hg/cache/rbc-names-v1
123 .hg/cache/rbc-revs-v1
125 .hg/cache/rbc-revs-v1
124 .hg/dirstate
126 .hg/dirstate
125 .hg/fsmonitor.state (fsmonitor !)
127 .hg/fsmonitor.state (fsmonitor !)
126 .hg/last-message.txt
128 .hg/last-message.txt
127 .hg/requires
129 .hg/requires
128 .hg/store
130 .hg/store
129 .hg/store/00changelog.i
131 .hg/store/00changelog.i
130 .hg/store/00manifest.i
132 .hg/store/00manifest.i
131 .hg/store/data
133 .hg/store/data
132 .hg/store/data/tst.d.hg
134 .hg/store/data/tst.d.hg
133 .hg/store/data/tst.d.hg/_foo.i
135 .hg/store/data/tst.d.hg/_foo.i
134 .hg/store/phaseroots
136 .hg/store/phaseroots
135 .hg/store/undo
137 .hg/store/undo
136 .hg/store/undo.backupfiles
138 .hg/store/undo.backupfiles
137 .hg/store/undo.phaseroots
139 .hg/store/undo.phaseroots
138 .hg/undo.backup.dirstate
140 .hg/undo.backup.dirstate
139 .hg/undo.bookmarks
141 .hg/undo.bookmarks
140 .hg/undo.branch
142 .hg/undo.branch
141 .hg/undo.desc
143 .hg/undo.desc
142 .hg/undo.dirstate
144 .hg/undo.dirstate
143 $ cd ..
145 $ cd ..
144
146
145 Encoding of reserved / long paths in the store
147 Encoding of reserved / long paths in the store
146
148
147 $ hg init r2
149 $ hg init r2
148 $ cd r2
150 $ cd r2
149 $ cat <<EOF > .hg/hgrc
151 $ cat <<EOF > .hg/hgrc
150 > [ui]
152 > [ui]
151 > portablefilenames = ignore
153 > portablefilenames = ignore
152 > EOF
154 > EOF
153
155
154 $ hg import -q --bypass - <<EOF
156 $ hg import -q --bypass - <<EOF
155 > # HG changeset patch
157 > # HG changeset patch
156 > # User test
158 > # User test
157 > # Date 0 0
159 > # Date 0 0
158 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
160 > # Node ID 1c7a2f7cb77be1a0def34e4c7cabc562ad98fbd7
159 > # Parent 0000000000000000000000000000000000000000
161 > # Parent 0000000000000000000000000000000000000000
160 > 1
162 > 1
161 >
163 >
162 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
164 > diff --git a/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
163 > new file mode 100644
165 > new file mode 100644
164 > --- /dev/null
166 > --- /dev/null
165 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
167 > +++ b/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxxxxx-xxxxxxxxx-xxxxxxxxx-123456789-12.3456789-12345-ABCDEFGHIJKLMNOPRSTUVWXYZ-abcdefghjiklmnopqrstuvwxyz
166 > @@ -0,0 +1,1 @@
168 > @@ -0,0 +1,1 @@
167 > +foo
169 > +foo
168 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
170 > diff --git a/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
169 > new file mode 100644
171 > new file mode 100644
170 > --- /dev/null
172 > --- /dev/null
171 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
173 > +++ b/AUX/SECOND/X.PRN/FOURTH/FI:FTH/SIXTH/SEVENTH/EIGHTH/NINETH/TENTH/ELEVENTH/LOREMIPSUM.TXT
172 > @@ -0,0 +1,1 @@
174 > @@ -0,0 +1,1 @@
173 > +foo
175 > +foo
174 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
176 > diff --git a/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
175 > new file mode 100644
177 > new file mode 100644
176 > --- /dev/null
178 > --- /dev/null
177 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
179 > +++ b/Project Planning/Resources/AnotherLongDirectoryName/Followedbyanother/AndAnother/AndThenAnExtremelyLongFileName.txt
178 > @@ -0,0 +1,1 @@
180 > @@ -0,0 +1,1 @@
179 > +foo
181 > +foo
180 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
182 > diff --git a/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
181 > new file mode 100644
183 > new file mode 100644
182 > --- /dev/null
184 > --- /dev/null
183 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
185 > +++ b/bla.aux/prn/PRN/lpt/com3/nul/coma/foo.NUL/normal.c
184 > @@ -0,0 +1,1 @@
186 > @@ -0,0 +1,1 @@
185 > +foo
187 > +foo
186 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
188 > diff --git a/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
187 > new file mode 100644
189 > new file mode 100644
188 > --- /dev/null
190 > --- /dev/null
189 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
191 > +++ b/enterprise/openesbaddons/contrib-imola/corba-bc/netbeansplugin/wsdlExtension/src/main/java/META-INF/services/org.netbeans.modules.xml.wsdl.bindingsupport.spi.ExtensibilityElementTemplateProvider
190 > @@ -0,0 +1,1 @@
192 > @@ -0,0 +1,1 @@
191 > +foo
193 > +foo
192 > EOF
194 > EOF
193
195
194 $ find .hg/store -name *.i | sort
196 $ find .hg/store -name *.i | sort
195 .hg/store/00changelog.i
197 .hg/store/00changelog.i
196 .hg/store/00manifest.i
198 .hg/store/00manifest.i
197 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
199 .hg/store/data/bla.aux/pr~6e/_p_r_n/lpt/co~6d3/nu~6c/coma/foo._n_u_l/normal.c.i
198 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
200 .hg/store/dh/12345678/12345678/12345678/12345678/12345678/12345678/12345678/12345/xxxxxx168e07b38e65eff86ab579afaaa8e30bfbe0f35f.i
199 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
201 .hg/store/dh/au~78/second/x.prn/fourth/fi~3afth/sixth/seventh/eighth/nineth/tenth/loremia20419e358ddff1bf8751e38288aff1d7c32ec05.i
200 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
202 .hg/store/dh/enterpri/openesba/contrib-/corba-bc/netbeans/wsdlexte/src/main/java/org.net7018f27961fdf338a598a40c4683429e7ffb9743.i
201 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
203 .hg/store/dh/project_/resource/anotherl/followed/andanoth/andthenanextremelylongfilename0d8e1f4187c650e2f1fdca9fd90f786bc0976b6b.i
202
204
203 $ cd ..
205 $ cd ..
204
206
205 Aborting lock does not prevent fncache writes
207 Aborting lock does not prevent fncache writes
206
208
207 $ cat > exceptionext.py <<EOF
209 $ cat > exceptionext.py <<EOF
208 > from __future__ import absolute_import
210 > from __future__ import absolute_import
209 > import os
211 > import os
210 > from mercurial import commands, error, extensions
212 > from mercurial import commands, error, extensions
211 >
213 >
212 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
214 > def lockexception(orig, vfs, lockname, wait, releasefn, *args, **kwargs):
213 > def releasewrap():
215 > def releasewrap():
214 > l.held = False # ensure __del__ is a noop
216 > l.held = False # ensure __del__ is a noop
215 > raise error.Abort("forced lock failure")
217 > raise error.Abort("forced lock failure")
216 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
218 > l = orig(vfs, lockname, wait, releasewrap, *args, **kwargs)
217 > return l
219 > return l
218 >
220 >
219 > def reposetup(ui, repo):
221 > def reposetup(ui, repo):
220 > extensions.wrapfunction(repo, '_lock', lockexception)
222 > extensions.wrapfunction(repo, '_lock', lockexception)
221 >
223 >
222 > cmdtable = {}
224 > cmdtable = {}
223 >
225 >
224 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
226 > # wrap "commit" command to prevent wlock from being '__del__()'-ed
225 > # at the end of dispatching (for intentional "forced lcok failure")
227 > # at the end of dispatching (for intentional "forced lcok failure")
226 > def commitwrap(orig, ui, repo, *pats, **opts):
228 > def commitwrap(orig, ui, repo, *pats, **opts):
227 > repo = repo.unfiltered() # to use replaced repo._lock certainly
229 > repo = repo.unfiltered() # to use replaced repo._lock certainly
228 > wlock = repo.wlock()
230 > wlock = repo.wlock()
229 > try:
231 > try:
230 > return orig(ui, repo, *pats, **opts)
232 > return orig(ui, repo, *pats, **opts)
231 > finally:
233 > finally:
232 > # multiple 'relase()' is needed for complete releasing wlock,
234 > # multiple 'relase()' is needed for complete releasing wlock,
233 > # because "forced" abort at last releasing store lock
235 > # because "forced" abort at last releasing store lock
234 > # prevents wlock from being released at same 'lockmod.release()'
236 > # prevents wlock from being released at same 'lockmod.release()'
235 > for i in range(wlock.held):
237 > for i in range(wlock.held):
236 > wlock.release()
238 > wlock.release()
237 >
239 >
238 > def extsetup(ui):
240 > def extsetup(ui):
239 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
241 > extensions.wrapcommand(commands.table, b"commit", commitwrap)
240 > EOF
242 > EOF
241 $ extpath=`pwd`/exceptionext.py
243 $ extpath=`pwd`/exceptionext.py
242 $ hg init fncachetxn
244 $ hg init fncachetxn
243 $ cd fncachetxn
245 $ cd fncachetxn
244 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
246 $ printf "[extensions]\nexceptionext=$extpath\n" >> .hg/hgrc
245 $ touch y
247 $ touch y
246 $ hg ci -qAm y
248 $ hg ci -qAm y
247 abort: forced lock failure
249 abort: forced lock failure
248 [255]
250 [255]
249 $ cat .hg/store/fncache
251 $ cat .hg/store/fncache
250 data/y.i
252 data/y.i
251
253
252 Aborting transaction prevents fncache change
254 Aborting transaction prevents fncache change
253
255
254 $ cat > ../exceptionext.py <<EOF
256 $ cat > ../exceptionext.py <<EOF
255 > from __future__ import absolute_import
257 > from __future__ import absolute_import
256 > import os
258 > import os
257 > from mercurial import commands, error, extensions, localrepo
259 > from mercurial import commands, error, extensions, localrepo
258 >
260 >
259 > def wrapper(orig, self, *args, **kwargs):
261 > def wrapper(orig, self, *args, **kwargs):
260 > tr = orig(self, *args, **kwargs)
262 > tr = orig(self, *args, **kwargs)
261 > def fail(tr):
263 > def fail(tr):
262 > raise error.Abort(b"forced transaction failure")
264 > raise error.Abort(b"forced transaction failure")
263 > # zzz prefix to ensure it sorted after store.write
265 > # zzz prefix to ensure it sorted after store.write
264 > tr.addfinalize(b'zzz-forcefails', fail)
266 > tr.addfinalize(b'zzz-forcefails', fail)
265 > return tr
267 > return tr
266 >
268 >
267 > def uisetup(ui):
269 > def uisetup(ui):
268 > extensions.wrapfunction(
270 > extensions.wrapfunction(
269 > localrepo.localrepository, b'transaction', wrapper)
271 > localrepo.localrepository, b'transaction', wrapper)
270 >
272 >
271 > cmdtable = {}
273 > cmdtable = {}
272 >
274 >
273 > EOF
275 > EOF
274
276
275 Clean cached version
277 Clean cached version
276 $ rm -f "${extpath}c"
278 $ rm -f "${extpath}c"
277 $ rm -Rf "`dirname $extpath`/__pycache__"
279 $ rm -Rf "`dirname $extpath`/__pycache__"
278
280
279 $ touch z
281 $ touch z
280 $ hg ci -qAm z
282 $ hg ci -qAm z
281 transaction abort!
283 transaction abort!
282 rollback completed
284 rollback completed
283 abort: forced transaction failure
285 abort: forced transaction failure
284 [255]
286 [255]
285 $ cat .hg/store/fncache
287 $ cat .hg/store/fncache
286 data/y.i
288 data/y.i
287
289
288 Aborted transactions can be recovered later
290 Aborted transactions can be recovered later
289
291
290 $ cat > ../exceptionext.py <<EOF
292 $ cat > ../exceptionext.py <<EOF
291 > from __future__ import absolute_import
293 > from __future__ import absolute_import
292 > import os
294 > import os
293 > from mercurial import (
295 > from mercurial import (
294 > commands,
296 > commands,
295 > error,
297 > error,
296 > extensions,
298 > extensions,
297 > localrepo,
299 > localrepo,
298 > transaction,
300 > transaction,
299 > )
301 > )
300 >
302 >
301 > def trwrapper(orig, self, *args, **kwargs):
303 > def trwrapper(orig, self, *args, **kwargs):
302 > tr = orig(self, *args, **kwargs)
304 > tr = orig(self, *args, **kwargs)
303 > def fail(tr):
305 > def fail(tr):
304 > raise error.Abort("forced transaction failure")
306 > raise error.Abort("forced transaction failure")
305 > # zzz prefix to ensure it sorted after store.write
307 > # zzz prefix to ensure it sorted after store.write
306 > tr.addfinalize('zzz-forcefails', fail)
308 > tr.addfinalize('zzz-forcefails', fail)
307 > return tr
309 > return tr
308 >
310 >
309 > def abortwrapper(orig, self, *args, **kwargs):
311 > def abortwrapper(orig, self, *args, **kwargs):
310 > raise error.Abort("forced transaction failure")
312 > raise error.Abort("forced transaction failure")
311 >
313 >
312 > def uisetup(ui):
314 > def uisetup(ui):
313 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
315 > extensions.wrapfunction(localrepo.localrepository, 'transaction',
314 > trwrapper)
316 > trwrapper)
315 > extensions.wrapfunction(transaction.transaction, '_abort',
317 > extensions.wrapfunction(transaction.transaction, '_abort',
316 > abortwrapper)
318 > abortwrapper)
317 >
319 >
318 > cmdtable = {}
320 > cmdtable = {}
319 >
321 >
320 > EOF
322 > EOF
321
323
322 Clean cached versions
324 Clean cached versions
323 $ rm -f "${extpath}c"
325 $ rm -f "${extpath}c"
324 $ rm -Rf "`dirname $extpath`/__pycache__"
326 $ rm -Rf "`dirname $extpath`/__pycache__"
325
327
326 $ hg up -q 1
328 $ hg up -q 1
327 $ touch z
329 $ touch z
328 $ hg ci -qAm z 2>/dev/null
330 $ hg ci -qAm z 2>/dev/null
329 [255]
331 [255]
330 $ cat .hg/store/fncache | sort
332 $ cat .hg/store/fncache | sort
331 data/y.i
333 data/y.i
332 data/z.i
334 data/z.i
333 $ hg recover
335 $ hg recover
334 rolling back interrupted transaction
336 rolling back interrupted transaction
335 checking changesets
337 checking changesets
336 checking manifests
338 checking manifests
337 crosschecking files in changesets and manifests
339 crosschecking files in changesets and manifests
338 checking files
340 checking files
339 1 files, 1 changesets, 1 total revisions
341 1 files, 1 changesets, 1 total revisions
340 $ cat .hg/store/fncache
342 $ cat .hg/store/fncache
341 data/y.i
343 data/y.i
342
344
343 $ cd ..
345 $ cd ..
344
346
345 debugrebuildfncache does nothing unless repo has fncache requirement
347 debugrebuildfncache does nothing unless repo has fncache requirement
346
348
347 $ hg --config format.usefncache=false init nofncache
349 $ hg --config format.usefncache=false init nofncache
348 $ cd nofncache
350 $ cd nofncache
349 $ hg debugrebuildfncache
351 $ hg debugrebuildfncache
350 (not rebuilding fncache because repository does not support fncache)
352 (not rebuilding fncache because repository does not support fncache)
351
353
352 $ cd ..
354 $ cd ..
353
355
354 debugrebuildfncache works on empty repository
356 debugrebuildfncache works on empty repository
355
357
356 $ hg init empty
358 $ hg init empty
357 $ cd empty
359 $ cd empty
358 $ hg debugrebuildfncache
360 $ hg debugrebuildfncache
359 fncache already up to date
361 fncache already up to date
360 $ cd ..
362 $ cd ..
361
363
362 debugrebuildfncache on an up to date repository no-ops
364 debugrebuildfncache on an up to date repository no-ops
363
365
364 $ hg init repo
366 $ hg init repo
365 $ cd repo
367 $ cd repo
366 $ echo initial > foo
368 $ echo initial > foo
367 $ echo initial > .bar
369 $ echo initial > .bar
368 $ hg commit -A -m initial
370 $ hg commit -A -m initial
369 adding .bar
371 adding .bar
370 adding foo
372 adding foo
371
373
372 $ cat .hg/store/fncache | sort
374 $ cat .hg/store/fncache | sort
373 data/.bar.i
375 data/.bar.i
374 data/foo.i
376 data/foo.i
375
377
376 $ hg debugrebuildfncache
378 $ hg debugrebuildfncache
377 fncache already up to date
379 fncache already up to date
378
380
379 debugrebuildfncache restores deleted fncache file
381 debugrebuildfncache restores deleted fncache file
380
382
381 $ rm -f .hg/store/fncache
383 $ rm -f .hg/store/fncache
382 $ hg debugrebuildfncache
384 $ hg debugrebuildfncache
383 adding data/.bar.i
385 adding data/.bar.i
384 adding data/foo.i
386 adding data/foo.i
385 2 items added, 0 removed from fncache
387 2 items added, 0 removed from fncache
386
388
387 $ cat .hg/store/fncache | sort
389 $ cat .hg/store/fncache | sort
388 data/.bar.i
390 data/.bar.i
389 data/foo.i
391 data/foo.i
390
392
391 Rebuild after rebuild should no-op
393 Rebuild after rebuild should no-op
392
394
393 $ hg debugrebuildfncache
395 $ hg debugrebuildfncache
394 fncache already up to date
396 fncache already up to date
395
397
396 A single missing file should get restored, an extra file should be removed
398 A single missing file should get restored, an extra file should be removed
397
399
398 $ cat > .hg/store/fncache << EOF
400 $ cat > .hg/store/fncache << EOF
399 > data/foo.i
401 > data/foo.i
400 > data/bad-entry.i
402 > data/bad-entry.i
401 > EOF
403 > EOF
402
404
403 $ hg debugrebuildfncache
405 $ hg debugrebuildfncache
404 removing data/bad-entry.i
406 removing data/bad-entry.i
405 adding data/.bar.i
407 adding data/.bar.i
406 1 items added, 1 removed from fncache
408 1 items added, 1 removed from fncache
407
409
408 $ cat .hg/store/fncache | sort
410 $ cat .hg/store/fncache | sort
409 data/.bar.i
411 data/.bar.i
410 data/foo.i
412 data/foo.i
411
413
412 $ cd ..
414 $ cd ..
413
415
414 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
416 Try a simple variation without dotencode to ensure fncache is ignorant of encoding
415
417
416 $ hg --config format.dotencode=false init nodotencode
418 $ hg --config format.dotencode=false init nodotencode
417 $ cd nodotencode
419 $ cd nodotencode
418 $ echo initial > foo
420 $ echo initial > foo
419 $ echo initial > .bar
421 $ echo initial > .bar
420 $ hg commit -A -m initial
422 $ hg commit -A -m initial
421 adding .bar
423 adding .bar
422 adding foo
424 adding foo
423
425
424 $ cat .hg/store/fncache | sort
426 $ cat .hg/store/fncache | sort
425 data/.bar.i
427 data/.bar.i
426 data/foo.i
428 data/foo.i
427
429
428 $ rm .hg/store/fncache
430 $ rm .hg/store/fncache
429 $ hg debugrebuildfncache
431 $ hg debugrebuildfncache
430 adding data/.bar.i
432 adding data/.bar.i
431 adding data/foo.i
433 adding data/foo.i
432 2 items added, 0 removed from fncache
434 2 items added, 0 removed from fncache
433
435
434 $ cat .hg/store/fncache | sort
436 $ cat .hg/store/fncache | sort
435 data/.bar.i
437 data/.bar.i
436 data/foo.i
438 data/foo.i
@@ -1,429 +1,429 b''
1 #require hardlink reporevlogstore
1 #require hardlink reporevlogstore
2
2
3 $ cat > nlinks.py <<EOF
3 $ cat > nlinks.py <<EOF
4 > from __future__ import print_function
4 > from __future__ import print_function
5 > import sys
5 > import sys
6 > from mercurial import util
6 > from mercurial import util
7 > for f in sorted(sys.stdin.readlines()):
7 > for f in sorted(sys.stdin.readlines()):
8 > f = f[:-1]
8 > f = f[:-1]
9 > print(util.nlinks(f), f)
9 > print(util.nlinks(f), f)
10 > EOF
10 > EOF
11
11
12 $ nlinksdir()
12 $ nlinksdir()
13 > {
13 > {
14 > find "$@" -type f | $PYTHON $TESTTMP/nlinks.py
14 > find "$@" -type f | $PYTHON $TESTTMP/nlinks.py
15 > }
15 > }
16
16
17 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
17 Some implementations of cp can't create hardlinks (replaces 'cp -al' on Linux):
18
18
19 $ cat > linkcp.py <<EOF
19 $ cat > linkcp.py <<EOF
20 > from __future__ import absolute_import
20 > from __future__ import absolute_import
21 > import sys
21 > import sys
22 > from mercurial import util
22 > from mercurial import util
23 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
23 > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True)
24 > EOF
24 > EOF
25
25
26 $ linkcp()
26 $ linkcp()
27 > {
27 > {
28 > $PYTHON $TESTTMP/linkcp.py $1 $2
28 > $PYTHON $TESTTMP/linkcp.py $1 $2
29 > }
29 > }
30
30
31 Prepare repo r1:
31 Prepare repo r1:
32
32
33 $ hg init r1
33 $ hg init r1
34 $ cd r1
34 $ cd r1
35
35
36 $ echo c1 > f1
36 $ echo c1 > f1
37 $ hg add f1
37 $ hg add f1
38 $ hg ci -m0
38 $ hg ci -m0
39
39
40 $ mkdir d1
40 $ mkdir d1
41 $ cd d1
41 $ cd d1
42 $ echo c2 > f2
42 $ echo c2 > f2
43 $ hg add f2
43 $ hg add f2
44 $ hg ci -m1
44 $ hg ci -m1
45 $ cd ../..
45 $ cd ../..
46
46
47 $ nlinksdir r1/.hg/store
47 $ nlinksdir r1/.hg/store
48 1 r1/.hg/store/00changelog.i
48 1 r1/.hg/store/00changelog.i
49 1 r1/.hg/store/00manifest.i
49 1 r1/.hg/store/00manifest.i
50 1 r1/.hg/store/data/d1/f2.i
50 1 r1/.hg/store/data/d1/f2.i
51 1 r1/.hg/store/data/f1.i
51 1 r1/.hg/store/data/f1.i
52 1 r1/.hg/store/fncache
52 1 r1/.hg/store/fncache (repofncache !)
53 1 r1/.hg/store/phaseroots
53 1 r1/.hg/store/phaseroots
54 1 r1/.hg/store/undo
54 1 r1/.hg/store/undo
55 1 r1/.hg/store/undo.backup.fncache
55 1 r1/.hg/store/undo.backup.fncache (repofncache !)
56 1 r1/.hg/store/undo.backupfiles
56 1 r1/.hg/store/undo.backupfiles
57 1 r1/.hg/store/undo.phaseroots
57 1 r1/.hg/store/undo.phaseroots
58
58
59
59
60 Create hardlinked clone r2:
60 Create hardlinked clone r2:
61
61
62 $ hg clone -U --debug r1 r2 --config progress.debug=true
62 $ hg clone -U --debug r1 r2 --config progress.debug=true
63 linking: 1
63 linking: 1
64 linking: 2
64 linking: 2
65 linking: 3
65 linking: 3
66 linking: 4
66 linking: 4
67 linking: 5
67 linking: 5
68 linking: 6
68 linking: 6
69 linking: 7
69 linking: 7
70 linked 7 files
70 linked 7 files
71
71
72 Create non-hardlinked clone r3:
72 Create non-hardlinked clone r3:
73
73
74 $ hg clone --pull r1 r3
74 $ hg clone --pull r1 r3
75 requesting all changes
75 requesting all changes
76 adding changesets
76 adding changesets
77 adding manifests
77 adding manifests
78 adding file changes
78 adding file changes
79 added 2 changesets with 2 changes to 2 files
79 added 2 changesets with 2 changes to 2 files
80 new changesets 40d85e9847f2:7069c422939c
80 new changesets 40d85e9847f2:7069c422939c
81 updating to branch default
81 updating to branch default
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
83
83
84
84
85 Repos r1 and r2 should now contain hardlinked files:
85 Repos r1 and r2 should now contain hardlinked files:
86
86
87 $ nlinksdir r1/.hg/store
87 $ nlinksdir r1/.hg/store
88 2 r1/.hg/store/00changelog.i
88 2 r1/.hg/store/00changelog.i
89 2 r1/.hg/store/00manifest.i
89 2 r1/.hg/store/00manifest.i
90 2 r1/.hg/store/data/d1/f2.i
90 2 r1/.hg/store/data/d1/f2.i
91 2 r1/.hg/store/data/f1.i
91 2 r1/.hg/store/data/f1.i
92 2 r1/.hg/store/fncache
92 2 r1/.hg/store/fncache (repofncache !)
93 1 r1/.hg/store/phaseroots
93 1 r1/.hg/store/phaseroots
94 1 r1/.hg/store/undo
94 1 r1/.hg/store/undo
95 1 r1/.hg/store/undo.backup.fncache
95 1 r1/.hg/store/undo.backup.fncache (repofncache !)
96 1 r1/.hg/store/undo.backupfiles
96 1 r1/.hg/store/undo.backupfiles
97 1 r1/.hg/store/undo.phaseroots
97 1 r1/.hg/store/undo.phaseroots
98
98
99 $ nlinksdir r2/.hg/store
99 $ nlinksdir r2/.hg/store
100 2 r2/.hg/store/00changelog.i
100 2 r2/.hg/store/00changelog.i
101 2 r2/.hg/store/00manifest.i
101 2 r2/.hg/store/00manifest.i
102 2 r2/.hg/store/data/d1/f2.i
102 2 r2/.hg/store/data/d1/f2.i
103 2 r2/.hg/store/data/f1.i
103 2 r2/.hg/store/data/f1.i
104 2 r2/.hg/store/fncache
104 2 r2/.hg/store/fncache (repofncache !)
105
105
106 Repo r3 should not be hardlinked:
106 Repo r3 should not be hardlinked:
107
107
108 $ nlinksdir r3/.hg/store
108 $ nlinksdir r3/.hg/store
109 1 r3/.hg/store/00changelog.i
109 1 r3/.hg/store/00changelog.i
110 1 r3/.hg/store/00manifest.i
110 1 r3/.hg/store/00manifest.i
111 1 r3/.hg/store/data/d1/f2.i
111 1 r3/.hg/store/data/d1/f2.i
112 1 r3/.hg/store/data/f1.i
112 1 r3/.hg/store/data/f1.i
113 1 r3/.hg/store/fncache
113 1 r3/.hg/store/fncache (repofncache !)
114 1 r3/.hg/store/phaseroots
114 1 r3/.hg/store/phaseroots
115 1 r3/.hg/store/undo
115 1 r3/.hg/store/undo
116 1 r3/.hg/store/undo.backupfiles
116 1 r3/.hg/store/undo.backupfiles
117 1 r3/.hg/store/undo.phaseroots
117 1 r3/.hg/store/undo.phaseroots
118
118
119
119
120 Create a non-inlined filelog in r3:
120 Create a non-inlined filelog in r3:
121
121
122 $ cd r3/d1
122 $ cd r3/d1
123 >>> f = open('data1', 'wb')
123 >>> f = open('data1', 'wb')
124 >>> for x in range(10000):
124 >>> for x in range(10000):
125 ... f.write("%s\n" % str(x))
125 ... f.write("%s\n" % str(x))
126 >>> f.close()
126 >>> f.close()
127 $ for j in 0 1 2 3 4 5 6 7 8 9; do
127 $ for j in 0 1 2 3 4 5 6 7 8 9; do
128 > cat data1 >> f2
128 > cat data1 >> f2
129 > hg commit -m$j
129 > hg commit -m$j
130 > done
130 > done
131 $ cd ../..
131 $ cd ../..
132
132
133 $ nlinksdir r3/.hg/store
133 $ nlinksdir r3/.hg/store
134 1 r3/.hg/store/00changelog.i
134 1 r3/.hg/store/00changelog.i
135 1 r3/.hg/store/00manifest.i
135 1 r3/.hg/store/00manifest.i
136 1 r3/.hg/store/data/d1/f2.d
136 1 r3/.hg/store/data/d1/f2.d
137 1 r3/.hg/store/data/d1/f2.i
137 1 r3/.hg/store/data/d1/f2.i
138 1 r3/.hg/store/data/f1.i
138 1 r3/.hg/store/data/f1.i
139 1 r3/.hg/store/fncache
139 1 r3/.hg/store/fncache (repofncache !)
140 1 r3/.hg/store/phaseroots
140 1 r3/.hg/store/phaseroots
141 1 r3/.hg/store/undo
141 1 r3/.hg/store/undo
142 1 r3/.hg/store/undo.backup.fncache
142 1 r3/.hg/store/undo.backup.fncache (repofncache !)
143 1 r3/.hg/store/undo.backup.phaseroots
143 1 r3/.hg/store/undo.backup.phaseroots
144 1 r3/.hg/store/undo.backupfiles
144 1 r3/.hg/store/undo.backupfiles
145 1 r3/.hg/store/undo.phaseroots
145 1 r3/.hg/store/undo.phaseroots
146
146
147 Push to repo r1 should break up most hardlinks in r2:
147 Push to repo r1 should break up most hardlinks in r2:
148
148
149 $ hg -R r2 verify
149 $ hg -R r2 verify
150 checking changesets
150 checking changesets
151 checking manifests
151 checking manifests
152 crosschecking files in changesets and manifests
152 crosschecking files in changesets and manifests
153 checking files
153 checking files
154 2 files, 2 changesets, 2 total revisions
154 2 files, 2 changesets, 2 total revisions
155
155
156 $ cd r3
156 $ cd r3
157 $ hg push
157 $ hg push
158 pushing to $TESTTMP/r1
158 pushing to $TESTTMP/r1
159 searching for changes
159 searching for changes
160 adding changesets
160 adding changesets
161 adding manifests
161 adding manifests
162 adding file changes
162 adding file changes
163 added 10 changesets with 10 changes to 1 files
163 added 10 changesets with 10 changes to 1 files
164
164
165 $ cd ..
165 $ cd ..
166
166
167 $ nlinksdir r2/.hg/store
167 $ nlinksdir r2/.hg/store
168 1 r2/.hg/store/00changelog.i
168 1 r2/.hg/store/00changelog.i
169 1 r2/.hg/store/00manifest.i
169 1 r2/.hg/store/00manifest.i
170 1 r2/.hg/store/data/d1/f2.i
170 1 r2/.hg/store/data/d1/f2.i
171 2 r2/.hg/store/data/f1.i
171 2 r2/.hg/store/data/f1.i
172 [12] r2/\.hg/store/fncache (re)
172 [12] r2/\.hg/store/fncache (re) (repofncache !)
173
173
174 #if hardlink-whitelisted
174 #if hardlink-whitelisted repofncache
175 $ nlinksdir r2/.hg/store/fncache
175 $ nlinksdir r2/.hg/store/fncache
176 2 r2/.hg/store/fncache
176 2 r2/.hg/store/fncache
177 #endif
177 #endif
178
178
179 $ hg -R r2 verify
179 $ hg -R r2 verify
180 checking changesets
180 checking changesets
181 checking manifests
181 checking manifests
182 crosschecking files in changesets and manifests
182 crosschecking files in changesets and manifests
183 checking files
183 checking files
184 2 files, 2 changesets, 2 total revisions
184 2 files, 2 changesets, 2 total revisions
185
185
186
186
187 $ cd r1
187 $ cd r1
188 $ hg up
188 $ hg up
189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
190
190
191 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
191 Committing a change to f1 in r1 must break up hardlink f1.i in r2:
192
192
193 $ echo c1c1 >> f1
193 $ echo c1c1 >> f1
194 $ hg ci -m00
194 $ hg ci -m00
195 $ cd ..
195 $ cd ..
196
196
197 $ nlinksdir r2/.hg/store
197 $ nlinksdir r2/.hg/store
198 1 r2/.hg/store/00changelog.i
198 1 r2/.hg/store/00changelog.i
199 1 r2/.hg/store/00manifest.i
199 1 r2/.hg/store/00manifest.i
200 1 r2/.hg/store/data/d1/f2.i
200 1 r2/.hg/store/data/d1/f2.i
201 1 r2/.hg/store/data/f1.i
201 1 r2/.hg/store/data/f1.i
202 [12] r2/\.hg/store/fncache (re)
202 [12] r2/\.hg/store/fncache (re) (repofncache !)
203
203
204 #if hardlink-whitelisted
204 #if hardlink-whitelisted repofncache
205 $ nlinksdir r2/.hg/store/fncache
205 $ nlinksdir r2/.hg/store/fncache
206 2 r2/.hg/store/fncache
206 2 r2/.hg/store/fncache
207 #endif
207 #endif
208
208
209 Create a file which exec permissions we will change
209 Create a file which exec permissions we will change
210 $ cd r3
210 $ cd r3
211 $ echo "echo hello world" > f3
211 $ echo "echo hello world" > f3
212 $ hg add f3
212 $ hg add f3
213 $ hg ci -mf3
213 $ hg ci -mf3
214 $ cd ..
214 $ cd ..
215
215
216 $ cd r3
216 $ cd r3
217 $ hg tip --template '{rev}:{node|short}\n'
217 $ hg tip --template '{rev}:{node|short}\n'
218 12:d3b77733a28a
218 12:d3b77733a28a
219 $ echo bla > f1
219 $ echo bla > f1
220 $ chmod +x f3
220 $ chmod +x f3
221 $ hg ci -m1
221 $ hg ci -m1
222 $ cd ..
222 $ cd ..
223
223
224 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
224 Create hardlinked copy r4 of r3 (on Linux, we would call 'cp -al'):
225
225
226 $ linkcp r3 r4
226 $ linkcp r3 r4
227
227
228 'checklink' is produced by hardlinking a symlink, which is undefined whether
228 'checklink' is produced by hardlinking a symlink, which is undefined whether
229 the symlink should be followed or not. It does behave differently on Linux and
229 the symlink should be followed or not. It does behave differently on Linux and
230 BSD. Just remove it so the test pass on both platforms.
230 BSD. Just remove it so the test pass on both platforms.
231
231
232 $ rm -f r4/.hg/cache/checklink
232 $ rm -f r4/.hg/cache/checklink
233
233
234 r4 has hardlinks in the working dir (not just inside .hg):
234 r4 has hardlinks in the working dir (not just inside .hg):
235
235
236 $ nlinksdir r4
236 $ nlinksdir r4
237 2 r4/.hg/00changelog.i
237 2 r4/.hg/00changelog.i
238 2 r4/.hg/branch
238 2 r4/.hg/branch
239 2 r4/.hg/cache/branch2-base
239 2 r4/.hg/cache/branch2-base
240 2 r4/.hg/cache/branch2-served
240 2 r4/.hg/cache/branch2-served
241 2 r4/.hg/cache/checkisexec (execbit !)
241 2 r4/.hg/cache/checkisexec (execbit !)
242 ? r4/.hg/cache/checklink-target (glob) (symlink !)
242 ? r4/.hg/cache/checklink-target (glob) (symlink !)
243 2 r4/.hg/cache/checknoexec (execbit !)
243 2 r4/.hg/cache/checknoexec (execbit !)
244 2 r4/.hg/cache/rbc-names-v1
244 2 r4/.hg/cache/rbc-names-v1
245 2 r4/.hg/cache/rbc-revs-v1
245 2 r4/.hg/cache/rbc-revs-v1
246 2 r4/.hg/dirstate
246 2 r4/.hg/dirstate
247 2 r4/.hg/fsmonitor.state (fsmonitor !)
247 2 r4/.hg/fsmonitor.state (fsmonitor !)
248 2 r4/.hg/hgrc
248 2 r4/.hg/hgrc
249 2 r4/.hg/last-message.txt
249 2 r4/.hg/last-message.txt
250 2 r4/.hg/requires
250 2 r4/.hg/requires
251 2 r4/.hg/store/00changelog.i
251 2 r4/.hg/store/00changelog.i
252 2 r4/.hg/store/00manifest.i
252 2 r4/.hg/store/00manifest.i
253 2 r4/.hg/store/data/d1/f2.d
253 2 r4/.hg/store/data/d1/f2.d
254 2 r4/.hg/store/data/d1/f2.i
254 2 r4/.hg/store/data/d1/f2.i
255 2 r4/.hg/store/data/f1.i
255 2 r4/.hg/store/data/f1.i
256 2 r4/.hg/store/data/f3.i
256 2 r4/.hg/store/data/f3.i
257 2 r4/.hg/store/fncache
257 2 r4/.hg/store/fncache (repofncache !)
258 2 r4/.hg/store/phaseroots
258 2 r4/.hg/store/phaseroots
259 2 r4/.hg/store/undo
259 2 r4/.hg/store/undo
260 2 r4/.hg/store/undo.backup.fncache
260 2 r4/.hg/store/undo.backup.fncache (repofncache !)
261 2 r4/.hg/store/undo.backup.phaseroots
261 2 r4/.hg/store/undo.backup.phaseroots
262 2 r4/.hg/store/undo.backupfiles
262 2 r4/.hg/store/undo.backupfiles
263 2 r4/.hg/store/undo.phaseroots
263 2 r4/.hg/store/undo.phaseroots
264 [24] r4/\.hg/undo\.backup\.dirstate (re)
264 [24] r4/\.hg/undo\.backup\.dirstate (re)
265 2 r4/.hg/undo.bookmarks
265 2 r4/.hg/undo.bookmarks
266 2 r4/.hg/undo.branch
266 2 r4/.hg/undo.branch
267 2 r4/.hg/undo.desc
267 2 r4/.hg/undo.desc
268 [24] r4/\.hg/undo\.dirstate (re)
268 [24] r4/\.hg/undo\.dirstate (re)
269 2 r4/d1/data1
269 2 r4/d1/data1
270 2 r4/d1/f2
270 2 r4/d1/f2
271 2 r4/f1
271 2 r4/f1
272 2 r4/f3
272 2 r4/f3
273
273
274 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
274 Update back to revision 12 in r4 should break hardlink of file f1 and f3:
275 #if hardlink-whitelisted
275 #if hardlink-whitelisted
276 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
276 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
277 4 r4/.hg/undo.backup.dirstate
277 4 r4/.hg/undo.backup.dirstate
278 4 r4/.hg/undo.dirstate
278 4 r4/.hg/undo.dirstate
279 #endif
279 #endif
280
280
281
281
282 $ hg -R r4 up 12
282 $ hg -R r4 up 12
283 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
283 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (execbit !)
284 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
284 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-execbit !)
285
285
286 $ nlinksdir r4
286 $ nlinksdir r4
287 2 r4/.hg/00changelog.i
287 2 r4/.hg/00changelog.i
288 1 r4/.hg/branch
288 1 r4/.hg/branch
289 2 r4/.hg/cache/branch2-base
289 2 r4/.hg/cache/branch2-base
290 2 r4/.hg/cache/branch2-served
290 2 r4/.hg/cache/branch2-served
291 2 r4/.hg/cache/checkisexec (execbit !)
291 2 r4/.hg/cache/checkisexec (execbit !)
292 2 r4/.hg/cache/checklink-target (symlink !)
292 2 r4/.hg/cache/checklink-target (symlink !)
293 2 r4/.hg/cache/checknoexec (execbit !)
293 2 r4/.hg/cache/checknoexec (execbit !)
294 2 r4/.hg/cache/rbc-names-v1
294 2 r4/.hg/cache/rbc-names-v1
295 2 r4/.hg/cache/rbc-revs-v1
295 2 r4/.hg/cache/rbc-revs-v1
296 1 r4/.hg/dirstate
296 1 r4/.hg/dirstate
297 1 r4/.hg/fsmonitor.state (fsmonitor !)
297 1 r4/.hg/fsmonitor.state (fsmonitor !)
298 2 r4/.hg/hgrc
298 2 r4/.hg/hgrc
299 2 r4/.hg/last-message.txt
299 2 r4/.hg/last-message.txt
300 2 r4/.hg/requires
300 2 r4/.hg/requires
301 2 r4/.hg/store/00changelog.i
301 2 r4/.hg/store/00changelog.i
302 2 r4/.hg/store/00manifest.i
302 2 r4/.hg/store/00manifest.i
303 2 r4/.hg/store/data/d1/f2.d
303 2 r4/.hg/store/data/d1/f2.d
304 2 r4/.hg/store/data/d1/f2.i
304 2 r4/.hg/store/data/d1/f2.i
305 2 r4/.hg/store/data/f1.i
305 2 r4/.hg/store/data/f1.i
306 2 r4/.hg/store/data/f3.i
306 2 r4/.hg/store/data/f3.i
307 2 r4/.hg/store/fncache
307 2 r4/.hg/store/fncache
308 2 r4/.hg/store/phaseroots
308 2 r4/.hg/store/phaseroots
309 2 r4/.hg/store/undo
309 2 r4/.hg/store/undo
310 2 r4/.hg/store/undo.backup.fncache
310 2 r4/.hg/store/undo.backup.fncache (repofncache !)
311 2 r4/.hg/store/undo.backup.phaseroots
311 2 r4/.hg/store/undo.backup.phaseroots
312 2 r4/.hg/store/undo.backupfiles
312 2 r4/.hg/store/undo.backupfiles
313 2 r4/.hg/store/undo.phaseroots
313 2 r4/.hg/store/undo.phaseroots
314 [24] r4/\.hg/undo\.backup\.dirstate (re)
314 [24] r4/\.hg/undo\.backup\.dirstate (re)
315 2 r4/.hg/undo.bookmarks
315 2 r4/.hg/undo.bookmarks
316 2 r4/.hg/undo.branch
316 2 r4/.hg/undo.branch
317 2 r4/.hg/undo.desc
317 2 r4/.hg/undo.desc
318 [24] r4/\.hg/undo\.dirstate (re)
318 [24] r4/\.hg/undo\.dirstate (re)
319 2 r4/d1/data1
319 2 r4/d1/data1
320 2 r4/d1/f2
320 2 r4/d1/f2
321 1 r4/f1
321 1 r4/f1
322 1 r4/f3 (execbit !)
322 1 r4/f3 (execbit !)
323 2 r4/f3 (no-execbit !)
323 2 r4/f3 (no-execbit !)
324
324
325 #if hardlink-whitelisted
325 #if hardlink-whitelisted
326 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
326 $ nlinksdir r4/.hg/undo.backup.dirstate r4/.hg/undo.dirstate
327 4 r4/.hg/undo.backup.dirstate
327 4 r4/.hg/undo.backup.dirstate
328 4 r4/.hg/undo.dirstate
328 4 r4/.hg/undo.dirstate
329 #endif
329 #endif
330
330
331 Test hardlinking outside hg:
331 Test hardlinking outside hg:
332
332
333 $ mkdir x
333 $ mkdir x
334 $ echo foo > x/a
334 $ echo foo > x/a
335
335
336 $ linkcp x y
336 $ linkcp x y
337 $ echo bar >> y/a
337 $ echo bar >> y/a
338
338
339 No diff if hardlink:
339 No diff if hardlink:
340
340
341 $ diff x/a y/a
341 $ diff x/a y/a
342
342
343 Test mq hardlinking:
343 Test mq hardlinking:
344
344
345 $ echo "[extensions]" >> $HGRCPATH
345 $ echo "[extensions]" >> $HGRCPATH
346 $ echo "mq=" >> $HGRCPATH
346 $ echo "mq=" >> $HGRCPATH
347
347
348 $ hg init a
348 $ hg init a
349 $ cd a
349 $ cd a
350
350
351 $ hg qimport -n foo - << EOF
351 $ hg qimport -n foo - << EOF
352 > # HG changeset patch
352 > # HG changeset patch
353 > # Date 1 0
353 > # Date 1 0
354 > diff -r 2588a8b53d66 a
354 > diff -r 2588a8b53d66 a
355 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
355 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
356 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
356 > +++ b/a Wed Jul 23 15:54:29 2008 +0200
357 > @@ -0,0 +1,1 @@
357 > @@ -0,0 +1,1 @@
358 > +a
358 > +a
359 > EOF
359 > EOF
360 adding foo to series file
360 adding foo to series file
361
361
362 $ hg qpush
362 $ hg qpush
363 applying foo
363 applying foo
364 now at: foo
364 now at: foo
365
365
366 $ cd ..
366 $ cd ..
367 $ linkcp a b
367 $ linkcp a b
368 $ cd b
368 $ cd b
369
369
370 $ hg qimport -n bar - << EOF
370 $ hg qimport -n bar - << EOF
371 > # HG changeset patch
371 > # HG changeset patch
372 > # Date 2 0
372 > # Date 2 0
373 > diff -r 2588a8b53d66 a
373 > diff -r 2588a8b53d66 a
374 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
374 > --- /dev/null Thu Jan 01 00:00:00 1970 +0000
375 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
375 > +++ b/b Wed Jul 23 15:54:29 2008 +0200
376 > @@ -0,0 +1,1 @@
376 > @@ -0,0 +1,1 @@
377 > +b
377 > +b
378 > EOF
378 > EOF
379 adding bar to series file
379 adding bar to series file
380
380
381 $ hg qpush
381 $ hg qpush
382 applying bar
382 applying bar
383 now at: bar
383 now at: bar
384
384
385 $ cat .hg/patches/status
385 $ cat .hg/patches/status
386 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
386 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
387 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
387 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar
388
388
389 $ cat .hg/patches/series
389 $ cat .hg/patches/series
390 foo
390 foo
391 bar
391 bar
392
392
393 $ cat ../a/.hg/patches/status
393 $ cat ../a/.hg/patches/status
394 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
394 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo
395
395
396 $ cat ../a/.hg/patches/series
396 $ cat ../a/.hg/patches/series
397 foo
397 foo
398
398
399 Test tags hardlinking:
399 Test tags hardlinking:
400
400
401 $ hg qdel -r qbase:qtip
401 $ hg qdel -r qbase:qtip
402 patch foo finalized without changeset message
402 patch foo finalized without changeset message
403 patch bar finalized without changeset message
403 patch bar finalized without changeset message
404
404
405 $ hg tag -l lfoo
405 $ hg tag -l lfoo
406 $ hg tag foo
406 $ hg tag foo
407
407
408 $ cd ..
408 $ cd ..
409 $ linkcp b c
409 $ linkcp b c
410 $ cd c
410 $ cd c
411
411
412 $ hg tag -l -r 0 lbar
412 $ hg tag -l -r 0 lbar
413 $ hg tag -r 0 bar
413 $ hg tag -r 0 bar
414
414
415 $ cat .hgtags
415 $ cat .hgtags
416 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
416 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
417 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
417 430ed4828a74fa4047bc816a25500f7472ab4bfe bar
418
418
419 $ cat .hg/localtags
419 $ cat .hg/localtags
420 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
420 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
421 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
421 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar
422
422
423 $ cat ../b/.hgtags
423 $ cat ../b/.hgtags
424 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
424 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo
425
425
426 $ cat ../b/.hg/localtags
426 $ cat ../b/.hg/localtags
427 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
427 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
428
428
429 $ cd ..
429 $ cd ..
@@ -1,937 +1,937 b''
1 commit hooks can see env vars
1 commit hooks can see env vars
2 (and post-transaction one are run unlocked)
2 (and post-transaction one are run unlocked)
3
3
4
4
5 $ cat > $TESTTMP/txnabort.checkargs.py <<EOF
5 $ cat > $TESTTMP/txnabort.checkargs.py <<EOF
6 > def showargs(ui, repo, hooktype, **kwargs):
6 > def showargs(ui, repo, hooktype, **kwargs):
7 > ui.write('%s Python hook: %s\n' % (hooktype, ','.join(sorted(kwargs))))
7 > ui.write('%s Python hook: %s\n' % (hooktype, ','.join(sorted(kwargs))))
8 > EOF
8 > EOF
9
9
10 $ hg init a
10 $ hg init a
11 $ cd a
11 $ cd a
12 $ cat > .hg/hgrc <<EOF
12 $ cat > .hg/hgrc <<EOF
13 > [hooks]
13 > [hooks]
14 > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py commit"
14 > commit = sh -c "HG_LOCAL= HG_TAG= printenv.py commit"
15 > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py commit.b"
15 > commit.b = sh -c "HG_LOCAL= HG_TAG= printenv.py commit.b"
16 > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py precommit"
16 > precommit = sh -c "HG_LOCAL= HG_NODE= HG_TAG= printenv.py precommit"
17 > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxncommit"
17 > pretxncommit = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxncommit"
18 > pretxncommit.tip = hg -q tip
18 > pretxncommit.tip = hg -q tip
19 > pre-identify = sh -c "printenv.py pre-identify 1"
19 > pre-identify = sh -c "printenv.py pre-identify 1"
20 > pre-cat = sh -c "printenv.py pre-cat"
20 > pre-cat = sh -c "printenv.py pre-cat"
21 > post-cat = sh -c "printenv.py post-cat"
21 > post-cat = sh -c "printenv.py post-cat"
22 > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnopen"
22 > pretxnopen = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnopen"
23 > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnclose"
23 > pretxnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py pretxnclose"
24 > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py txnclose"
24 > txnclose = sh -c "HG_LOCAL= HG_TAG= printenv.py txnclose"
25 > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs
25 > txnabort.0 = python:$TESTTMP/txnabort.checkargs.py:showargs
26 > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py txnabort"
26 > txnabort.1 = sh -c "HG_LOCAL= HG_TAG= printenv.py txnabort"
27 > txnclose.checklock = sh -c "hg debuglock > /dev/null"
27 > txnclose.checklock = sh -c "hg debuglock > /dev/null"
28 > EOF
28 > EOF
29 $ echo a > a
29 $ echo a > a
30 $ hg add a
30 $ hg add a
31 $ hg commit -m a
31 $ hg commit -m a
32 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=0000000000000000000000000000000000000000
32 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=0000000000000000000000000000000000000000
33 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
33 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
34 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a
34 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000 HG_PENDING=$TESTTMP/a
35 0:cb9a9f314b8b
35 0:cb9a9f314b8b
36 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
36 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
37 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
37 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_PHASES_MOVED=1 HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
38 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
38 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
39 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
39 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PARENT1=0000000000000000000000000000000000000000
40
40
41 $ hg clone . ../b
41 $ hg clone . ../b
42 updating to branch default
42 updating to branch default
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 $ cd ../b
44 $ cd ../b
45
45
46 changegroup hooks can see env vars
46 changegroup hooks can see env vars
47
47
48 $ cat > .hg/hgrc <<EOF
48 $ cat > .hg/hgrc <<EOF
49 > [hooks]
49 > [hooks]
50 > prechangegroup = sh -c "printenv.py prechangegroup"
50 > prechangegroup = sh -c "printenv.py prechangegroup"
51 > changegroup = sh -c "printenv.py changegroup"
51 > changegroup = sh -c "printenv.py changegroup"
52 > incoming = sh -c "printenv.py incoming"
52 > incoming = sh -c "printenv.py incoming"
53 > EOF
53 > EOF
54
54
55 pretxncommit and commit hooks can see both parents of merge
55 pretxncommit and commit hooks can see both parents of merge
56
56
57 $ cd ../a
57 $ cd ../a
58 $ echo b >> a
58 $ echo b >> a
59 $ hg commit -m a1 -d "1 0"
59 $ hg commit -m a1 -d "1 0"
60 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
60 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
61 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
61 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
62 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
62 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
63 1:ab228980c14d
63 1:ab228980c14d
64 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
64 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
65 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
65 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
66 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
66 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
67 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
67 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
68 $ hg update -C 0
68 $ hg update -C 0
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 $ echo b > b
70 $ echo b > b
71 $ hg add b
71 $ hg add b
72 $ hg commit -m b -d '1 0'
72 $ hg commit -m b -d '1 0'
73 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
73 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
74 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
74 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
75 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
75 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b HG_PENDING=$TESTTMP/a
76 2:ee9deb46ab31
76 2:ee9deb46ab31
77 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
77 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
78 created new head
78 created new head
79 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
79 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
80 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
80 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
81 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
81 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT1=cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b
82 $ hg merge 1
82 $ hg merge 1
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 (branch merge, don't forget to commit)
84 (branch merge, don't forget to commit)
85 $ hg commit -m merge -d '2 0'
85 $ hg commit -m merge -d '2 0'
86 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
86 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
87 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
87 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
88 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a
88 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd HG_PENDING=$TESTTMP/a
89 3:07f3376c1e65
89 3:07f3376c1e65
90 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
90 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
91 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
91 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
92 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
92 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
93 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
93 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PARENT1=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_PARENT2=ab228980c14deea8b9555d91c9581127383e40fd
94
94
95 test generic hooks
95 test generic hooks
96
96
97 $ hg id
97 $ hg id
98 pre-identify hook: HG_ARGS=id HG_HOOKNAME=pre-identify HG_HOOKTYPE=pre-identify HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None, 'template': ''} HG_PATS=[]
98 pre-identify hook: HG_ARGS=id HG_HOOKNAME=pre-identify HG_HOOKTYPE=pre-identify HG_OPTS={'bookmarks': None, 'branch': None, 'id': None, 'insecure': None, 'num': None, 'remotecmd': '', 'rev': '', 'ssh': '', 'tags': None, 'template': ''} HG_PATS=[]
99 abort: pre-identify hook exited with status 1
99 abort: pre-identify hook exited with status 1
100 [255]
100 [255]
101 $ hg cat b
101 $ hg cat b
102 pre-cat hook: HG_ARGS=cat b HG_HOOKNAME=pre-cat HG_HOOKTYPE=pre-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} HG_PATS=['b']
102 pre-cat hook: HG_ARGS=cat b HG_HOOKNAME=pre-cat HG_HOOKTYPE=pre-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} HG_PATS=['b']
103 b
103 b
104 post-cat hook: HG_ARGS=cat b HG_HOOKNAME=post-cat HG_HOOKTYPE=post-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} HG_PATS=['b'] HG_RESULT=0
104 post-cat hook: HG_ARGS=cat b HG_HOOKNAME=post-cat HG_HOOKTYPE=post-cat HG_OPTS={'decode': None, 'exclude': [], 'include': [], 'output': '', 'rev': '', 'template': ''} HG_PATS=['b'] HG_RESULT=0
105
105
106 $ cd ../b
106 $ cd ../b
107 $ hg pull ../a
107 $ hg pull ../a
108 pulling from ../a
108 pulling from ../a
109 searching for changes
109 searching for changes
110 prechangegroup hook: HG_HOOKNAME=prechangegroup HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
110 prechangegroup hook: HG_HOOKNAME=prechangegroup HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
111 adding changesets
111 adding changesets
112 adding manifests
112 adding manifests
113 adding file changes
113 adding file changes
114 added 3 changesets with 2 changes to 2 files
114 added 3 changesets with 2 changes to 2 files
115 new changesets ab228980c14d:07f3376c1e65
115 new changesets ab228980c14d:07f3376c1e65
116 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
116 changegroup hook: HG_HOOKNAME=changegroup HG_HOOKTYPE=changegroup HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_NODE_LAST=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
117 incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
117 incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ab228980c14deea8b9555d91c9581127383e40fd HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
118 incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
118 incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=ee9deb46ab31e4cc3310f3cf0c3d668e4d8fffc2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
119 incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
119 incoming hook: HG_HOOKNAME=incoming HG_HOOKTYPE=incoming HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
120 (run 'hg update' to get a working copy)
120 (run 'hg update' to get a working copy)
121
121
122 tag hooks can see env vars
122 tag hooks can see env vars
123
123
124 $ cd ../a
124 $ cd ../a
125 $ cat >> .hg/hgrc <<EOF
125 $ cat >> .hg/hgrc <<EOF
126 > pretag = sh -c "printenv.py pretag"
126 > pretag = sh -c "printenv.py pretag"
127 > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py tag"
127 > tag = sh -c "HG_PARENT1= HG_PARENT2= printenv.py tag"
128 > EOF
128 > EOF
129 $ hg tag -d '3 0' a
129 $ hg tag -d '3 0' a
130 pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
130 pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
131 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
131 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
132 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
132 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
133 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a
133 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2 HG_PENDING=$TESTTMP/a
134 4:539e4b31b6dc
134 4:539e4b31b6dc
135 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
135 pretxnclose hook: HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
136 tag hook: HG_HOOKNAME=tag HG_HOOKTYPE=tag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
136 tag hook: HG_HOOKNAME=tag HG_HOOKTYPE=tag HG_LOCAL=0 HG_NODE=07f3376c1e655977439df2a814e3cc14b27abac2 HG_TAG=a
137 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
137 txnclose hook: HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
138 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
138 commit hook: HG_HOOKNAME=commit HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
139 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
139 commit.b hook: HG_HOOKNAME=commit.b HG_HOOKTYPE=commit HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PARENT1=07f3376c1e655977439df2a814e3cc14b27abac2
140 $ hg tag -l la
140 $ hg tag -l la
141 pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la
141 pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la
142 tag hook: HG_HOOKNAME=tag HG_HOOKTYPE=tag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la
142 tag hook: HG_HOOKNAME=tag HG_HOOKTYPE=tag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=la
143
143
144 pretag hook can forbid tagging
144 pretag hook can forbid tagging
145
145
146 $ cat >> .hg/hgrc <<EOF
146 $ cat >> .hg/hgrc <<EOF
147 > pretag.forbid = sh -c "printenv.py pretag.forbid 1"
147 > pretag.forbid = sh -c "printenv.py pretag.forbid 1"
148 > EOF
148 > EOF
149 $ hg tag -d '4 0' fa
149 $ hg tag -d '4 0' fa
150 pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
150 pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
151 pretag.forbid hook: HG_HOOKNAME=pretag.forbid HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
151 pretag.forbid hook: HG_HOOKNAME=pretag.forbid HG_HOOKTYPE=pretag HG_LOCAL=0 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fa
152 abort: pretag.forbid hook exited with status 1
152 abort: pretag.forbid hook exited with status 1
153 [255]
153 [255]
154 $ hg tag -l fla
154 $ hg tag -l fla
155 pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla
155 pretag hook: HG_HOOKNAME=pretag HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla
156 pretag.forbid hook: HG_HOOKNAME=pretag.forbid HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla
156 pretag.forbid hook: HG_HOOKNAME=pretag.forbid HG_HOOKTYPE=pretag HG_LOCAL=1 HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_TAG=fla
157 abort: pretag.forbid hook exited with status 1
157 abort: pretag.forbid hook exited with status 1
158 [255]
158 [255]
159
159
160 pretxncommit hook can see changeset, can roll back txn, changeset no
160 pretxncommit hook can see changeset, can roll back txn, changeset no
161 more there after
161 more there after
162
162
163 $ cat >> .hg/hgrc <<EOF
163 $ cat >> .hg/hgrc <<EOF
164 > pretxncommit.forbid0 = sh -c "hg tip -q"
164 > pretxncommit.forbid0 = sh -c "hg tip -q"
165 > pretxncommit.forbid1 = sh -c "printenv.py pretxncommit.forbid 1"
165 > pretxncommit.forbid1 = sh -c "printenv.py pretxncommit.forbid 1"
166 > EOF
166 > EOF
167 $ echo z > z
167 $ echo z > z
168 $ hg add z
168 $ hg add z
169 $ hg -q tip
169 $ hg -q tip
170 4:539e4b31b6dc
170 4:539e4b31b6dc
171 $ hg commit -m 'fail' -d '4 0'
171 $ hg commit -m 'fail' -d '4 0'
172 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
172 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
173 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
173 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
174 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a
174 pretxncommit hook: HG_HOOKNAME=pretxncommit HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a
175 5:6f611f8018c1
175 5:6f611f8018c1
176 5:6f611f8018c1
176 5:6f611f8018c1
177 pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1 HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a
177 pretxncommit.forbid hook: HG_HOOKNAME=pretxncommit.forbid1 HG_HOOKTYPE=pretxncommit HG_NODE=6f611f8018c10e827fee6bd2bc807f937e761567 HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/a
178 transaction abort!
178 transaction abort!
179 txnabort Python hook: txnid,txnname
179 txnabort Python hook: txnid,txnname
180 txnabort hook: HG_HOOKNAME=txnabort.1 HG_HOOKTYPE=txnabort HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
180 txnabort hook: HG_HOOKNAME=txnabort.1 HG_HOOKTYPE=txnabort HG_TXNID=TXN:$ID$ HG_TXNNAME=commit
181 rollback completed
181 rollback completed
182 abort: pretxncommit.forbid1 hook exited with status 1
182 abort: pretxncommit.forbid1 hook exited with status 1
183 [255]
183 [255]
184 $ hg -q tip
184 $ hg -q tip
185 4:539e4b31b6dc
185 4:539e4b31b6dc
186
186
187 (Check that no 'changelog.i.a' file were left behind)
187 (Check that no 'changelog.i.a' file were left behind)
188
188
189 $ ls -1 .hg/store/
189 $ ls -1 .hg/store/
190 00changelog.i
190 00changelog.i
191 00manifest.i
191 00manifest.i
192 data
192 data
193 fncache
193 fncache (repofncache !)
194 journal.phaseroots
194 journal.phaseroots
195 phaseroots
195 phaseroots
196 undo
196 undo
197 undo.backup.fncache
197 undo.backup.fncache (repofncache !)
198 undo.backupfiles
198 undo.backupfiles
199 undo.phaseroots
199 undo.phaseroots
200
200
201
201
202 precommit hook can prevent commit
202 precommit hook can prevent commit
203
203
204 $ cat >> .hg/hgrc <<EOF
204 $ cat >> .hg/hgrc <<EOF
205 > precommit.forbid = sh -c "printenv.py precommit.forbid 1"
205 > precommit.forbid = sh -c "printenv.py precommit.forbid 1"
206 > EOF
206 > EOF
207 $ hg commit -m 'fail' -d '4 0'
207 $ hg commit -m 'fail' -d '4 0'
208 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
208 precommit hook: HG_HOOKNAME=precommit HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
209 precommit.forbid hook: HG_HOOKNAME=precommit.forbid HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
209 precommit.forbid hook: HG_HOOKNAME=precommit.forbid HG_HOOKTYPE=precommit HG_PARENT1=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10
210 abort: precommit.forbid hook exited with status 1
210 abort: precommit.forbid hook exited with status 1
211 [255]
211 [255]
212 $ hg -q tip
212 $ hg -q tip
213 4:539e4b31b6dc
213 4:539e4b31b6dc
214
214
215 preupdate hook can prevent update
215 preupdate hook can prevent update
216
216
217 $ cat >> .hg/hgrc <<EOF
217 $ cat >> .hg/hgrc <<EOF
218 > preupdate = sh -c "printenv.py preupdate"
218 > preupdate = sh -c "printenv.py preupdate"
219 > EOF
219 > EOF
220 $ hg update 1
220 $ hg update 1
221 preupdate hook: HG_HOOKNAME=preupdate HG_HOOKTYPE=preupdate HG_PARENT1=ab228980c14d
221 preupdate hook: HG_HOOKNAME=preupdate HG_HOOKTYPE=preupdate HG_PARENT1=ab228980c14d
222 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
222 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
223
223
224 update hook
224 update hook
225
225
226 $ cat >> .hg/hgrc <<EOF
226 $ cat >> .hg/hgrc <<EOF
227 > update = sh -c "printenv.py update"
227 > update = sh -c "printenv.py update"
228 > EOF
228 > EOF
229 $ hg update
229 $ hg update
230 preupdate hook: HG_HOOKNAME=preupdate HG_HOOKTYPE=preupdate HG_PARENT1=539e4b31b6dc
230 preupdate hook: HG_HOOKNAME=preupdate HG_HOOKTYPE=preupdate HG_PARENT1=539e4b31b6dc
231 update hook: HG_ERROR=0 HG_HOOKNAME=update HG_HOOKTYPE=update HG_PARENT1=539e4b31b6dc
231 update hook: HG_ERROR=0 HG_HOOKNAME=update HG_HOOKTYPE=update HG_PARENT1=539e4b31b6dc
232 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
232 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
233
233
234 pushkey hook
234 pushkey hook
235
235
236 $ cat >> .hg/hgrc <<EOF
236 $ cat >> .hg/hgrc <<EOF
237 > pushkey = sh -c "printenv.py pushkey"
237 > pushkey = sh -c "printenv.py pushkey"
238 > EOF
238 > EOF
239 $ cd ../b
239 $ cd ../b
240 $ hg bookmark -r null foo
240 $ hg bookmark -r null foo
241 $ hg push -B foo ../a
241 $ hg push -B foo ../a
242 pushing to ../a
242 pushing to ../a
243 searching for changes
243 searching for changes
244 no changes found
244 no changes found
245 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push
245 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push
246 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
246 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
247 pushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
247 pushkey hook: HG_BUNDLE2=1 HG_HOOKNAME=pushkey HG_HOOKTYPE=pushkey HG_KEY=foo HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
248 txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
248 txnclose hook: HG_BOOKMARK_MOVED=1 HG_BUNDLE2=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_TXNNAME=push HG_URL=file:$TESTTMP/a
249 exporting bookmark foo
249 exporting bookmark foo
250 [1]
250 [1]
251 $ cd ../a
251 $ cd ../a
252
252
253 listkeys hook
253 listkeys hook
254
254
255 $ cat >> .hg/hgrc <<EOF
255 $ cat >> .hg/hgrc <<EOF
256 > listkeys = sh -c "printenv.py listkeys"
256 > listkeys = sh -c "printenv.py listkeys"
257 > EOF
257 > EOF
258 $ hg bookmark -r null bar
258 $ hg bookmark -r null bar
259 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
259 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
260 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
260 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
261 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
261 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
262 $ cd ../b
262 $ cd ../b
263 $ hg pull -B bar ../a
263 $ hg pull -B bar ../a
264 pulling from ../a
264 pulling from ../a
265 listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
265 listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
266 no changes found
266 no changes found
267 adding remote bookmark bar
267 adding remote bookmark bar
268 $ cd ../a
268 $ cd ../a
269
269
270 test that prepushkey can prevent incoming keys
270 test that prepushkey can prevent incoming keys
271
271
272 $ cat >> .hg/hgrc <<EOF
272 $ cat >> .hg/hgrc <<EOF
273 > prepushkey = sh -c "printenv.py prepushkey.forbid 1"
273 > prepushkey = sh -c "printenv.py prepushkey.forbid 1"
274 > EOF
274 > EOF
275 $ cd ../b
275 $ cd ../b
276 $ hg bookmark -r null baz
276 $ hg bookmark -r null baz
277 $ hg push -B baz ../a
277 $ hg push -B baz ../a
278 pushing to ../a
278 pushing to ../a
279 searching for changes
279 searching for changes
280 listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
280 listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=phases HG_VALUES={'cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b': '1', 'publishing': 'True'}
281 listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
281 listkeys hook: HG_HOOKNAME=listkeys HG_HOOKTYPE=listkeys HG_NAMESPACE=bookmarks HG_VALUES={'bar': '0000000000000000000000000000000000000000', 'foo': '0000000000000000000000000000000000000000'}
282 no changes found
282 no changes found
283 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push
283 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=push
284 prepushkey.forbid hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
284 prepushkey.forbid hook: HG_BUNDLE2=1 HG_HOOKNAME=prepushkey HG_HOOKTYPE=prepushkey HG_KEY=baz HG_NAMESPACE=bookmarks HG_NEW=0000000000000000000000000000000000000000 HG_PUSHKEYCOMPAT=1 HG_SOURCE=push HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
285 abort: prepushkey hook exited with status 1
285 abort: prepushkey hook exited with status 1
286 [255]
286 [255]
287 $ cd ../a
287 $ cd ../a
288
288
289 test that prelistkeys can prevent listing keys
289 test that prelistkeys can prevent listing keys
290
290
291 $ cat >> .hg/hgrc <<EOF
291 $ cat >> .hg/hgrc <<EOF
292 > prelistkeys = sh -c "printenv.py prelistkeys.forbid 1"
292 > prelistkeys = sh -c "printenv.py prelistkeys.forbid 1"
293 > EOF
293 > EOF
294 $ hg bookmark -r null quux
294 $ hg bookmark -r null quux
295 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
295 pretxnopen hook: HG_HOOKNAME=pretxnopen HG_HOOKTYPE=pretxnopen HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
296 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
296 pretxnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=pretxnclose HG_HOOKTYPE=pretxnclose HG_PENDING=$TESTTMP/a HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
297 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
297 txnclose hook: HG_BOOKMARK_MOVED=1 HG_HOOKNAME=txnclose HG_HOOKTYPE=txnclose HG_TXNID=TXN:$ID$ HG_TXNNAME=bookmark
298 $ cd ../b
298 $ cd ../b
299 $ hg pull -B quux ../a
299 $ hg pull -B quux ../a
300 pulling from ../a
300 pulling from ../a
301 prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys HG_HOOKTYPE=prelistkeys HG_NAMESPACE=bookmarks
301 prelistkeys.forbid hook: HG_HOOKNAME=prelistkeys HG_HOOKTYPE=prelistkeys HG_NAMESPACE=bookmarks
302 abort: prelistkeys hook exited with status 1
302 abort: prelistkeys hook exited with status 1
303 [255]
303 [255]
304 $ cd ../a
304 $ cd ../a
305 $ rm .hg/hgrc
305 $ rm .hg/hgrc
306
306
307 prechangegroup hook can prevent incoming changes
307 prechangegroup hook can prevent incoming changes
308
308
309 $ cd ../b
309 $ cd ../b
310 $ hg -q tip
310 $ hg -q tip
311 3:07f3376c1e65
311 3:07f3376c1e65
312 $ cat > .hg/hgrc <<EOF
312 $ cat > .hg/hgrc <<EOF
313 > [hooks]
313 > [hooks]
314 > prechangegroup.forbid = sh -c "printenv.py prechangegroup.forbid 1"
314 > prechangegroup.forbid = sh -c "printenv.py prechangegroup.forbid 1"
315 > EOF
315 > EOF
316 $ hg pull ../a
316 $ hg pull ../a
317 pulling from ../a
317 pulling from ../a
318 searching for changes
318 searching for changes
319 prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
319 prechangegroup.forbid hook: HG_HOOKNAME=prechangegroup.forbid HG_HOOKTYPE=prechangegroup HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
320 abort: prechangegroup.forbid hook exited with status 1
320 abort: prechangegroup.forbid hook exited with status 1
321 [255]
321 [255]
322
322
323 pretxnchangegroup hook can see incoming changes, can roll back txn,
323 pretxnchangegroup hook can see incoming changes, can roll back txn,
324 incoming changes no longer there after
324 incoming changes no longer there after
325
325
326 $ cat > .hg/hgrc <<EOF
326 $ cat > .hg/hgrc <<EOF
327 > [hooks]
327 > [hooks]
328 > pretxnchangegroup.forbid0 = hg tip -q
328 > pretxnchangegroup.forbid0 = hg tip -q
329 > pretxnchangegroup.forbid1 = sh -c "printenv.py pretxnchangegroup.forbid 1"
329 > pretxnchangegroup.forbid1 = sh -c "printenv.py pretxnchangegroup.forbid 1"
330 > EOF
330 > EOF
331 $ hg pull ../a
331 $ hg pull ../a
332 pulling from ../a
332 pulling from ../a
333 searching for changes
333 searching for changes
334 adding changesets
334 adding changesets
335 adding manifests
335 adding manifests
336 adding file changes
336 adding file changes
337 added 1 changesets with 1 changes to 1 files
337 added 1 changesets with 1 changes to 1 files
338 4:539e4b31b6dc
338 4:539e4b31b6dc
339 pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1 HG_HOOKTYPE=pretxnchangegroup HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
339 pretxnchangegroup.forbid hook: HG_HOOKNAME=pretxnchangegroup.forbid1 HG_HOOKTYPE=pretxnchangegroup HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_NODE_LAST=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_PENDING=$TESTTMP/b HG_SOURCE=pull HG_TXNID=TXN:$ID$ HG_URL=file:$TESTTMP/a
340 transaction abort!
340 transaction abort!
341 rollback completed
341 rollback completed
342 abort: pretxnchangegroup.forbid1 hook exited with status 1
342 abort: pretxnchangegroup.forbid1 hook exited with status 1
343 [255]
343 [255]
344 $ hg -q tip
344 $ hg -q tip
345 3:07f3376c1e65
345 3:07f3376c1e65
346
346
347 outgoing hooks can see env vars
347 outgoing hooks can see env vars
348
348
349 $ rm .hg/hgrc
349 $ rm .hg/hgrc
350 $ cat > ../a/.hg/hgrc <<EOF
350 $ cat > ../a/.hg/hgrc <<EOF
351 > [hooks]
351 > [hooks]
352 > preoutgoing = sh -c "printenv.py preoutgoing"
352 > preoutgoing = sh -c "printenv.py preoutgoing"
353 > outgoing = sh -c "printenv.py outgoing"
353 > outgoing = sh -c "printenv.py outgoing"
354 > EOF
354 > EOF
355 $ hg pull ../a
355 $ hg pull ../a
356 pulling from ../a
356 pulling from ../a
357 searching for changes
357 searching for changes
358 preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=pull
358 preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=pull
359 outgoing hook: HG_HOOKNAME=outgoing HG_HOOKTYPE=outgoing HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull
359 outgoing hook: HG_HOOKNAME=outgoing HG_HOOKTYPE=outgoing HG_NODE=539e4b31b6dc99b3cfbaa6b53cbc1c1f9a1e3a10 HG_SOURCE=pull
360 adding changesets
360 adding changesets
361 adding manifests
361 adding manifests
362 adding file changes
362 adding file changes
363 added 1 changesets with 1 changes to 1 files
363 added 1 changesets with 1 changes to 1 files
364 adding remote bookmark quux
364 adding remote bookmark quux
365 new changesets 539e4b31b6dc
365 new changesets 539e4b31b6dc
366 (run 'hg update' to get a working copy)
366 (run 'hg update' to get a working copy)
367 $ hg rollback
367 $ hg rollback
368 repository tip rolled back to revision 3 (undo pull)
368 repository tip rolled back to revision 3 (undo pull)
369
369
370 preoutgoing hook can prevent outgoing changes
370 preoutgoing hook can prevent outgoing changes
371
371
372 $ cat >> ../a/.hg/hgrc <<EOF
372 $ cat >> ../a/.hg/hgrc <<EOF
373 > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1"
373 > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1"
374 > EOF
374 > EOF
375 $ hg pull ../a
375 $ hg pull ../a
376 pulling from ../a
376 pulling from ../a
377 searching for changes
377 searching for changes
378 preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=pull
378 preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=pull
379 preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=pull
379 preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=pull
380 abort: preoutgoing.forbid hook exited with status 1
380 abort: preoutgoing.forbid hook exited with status 1
381 [255]
381 [255]
382
382
383 outgoing hooks work for local clones
383 outgoing hooks work for local clones
384
384
385 $ cd ..
385 $ cd ..
386 $ cat > a/.hg/hgrc <<EOF
386 $ cat > a/.hg/hgrc <<EOF
387 > [hooks]
387 > [hooks]
388 > preoutgoing = sh -c "printenv.py preoutgoing"
388 > preoutgoing = sh -c "printenv.py preoutgoing"
389 > outgoing = sh -c "printenv.py outgoing"
389 > outgoing = sh -c "printenv.py outgoing"
390 > EOF
390 > EOF
391 $ hg clone a c
391 $ hg clone a c
392 preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=clone
392 preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=clone
393 outgoing hook: HG_HOOKNAME=outgoing HG_HOOKTYPE=outgoing HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone
393 outgoing hook: HG_HOOKNAME=outgoing HG_HOOKTYPE=outgoing HG_NODE=0000000000000000000000000000000000000000 HG_SOURCE=clone
394 updating to branch default
394 updating to branch default
395 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
395 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
396 $ rm -rf c
396 $ rm -rf c
397
397
398 preoutgoing hook can prevent outgoing changes for local clones
398 preoutgoing hook can prevent outgoing changes for local clones
399
399
400 $ cat >> a/.hg/hgrc <<EOF
400 $ cat >> a/.hg/hgrc <<EOF
401 > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1"
401 > preoutgoing.forbid = sh -c "printenv.py preoutgoing.forbid 1"
402 > EOF
402 > EOF
403 $ hg clone a zzz
403 $ hg clone a zzz
404 preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=clone
404 preoutgoing hook: HG_HOOKNAME=preoutgoing HG_HOOKTYPE=preoutgoing HG_SOURCE=clone
405 preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=clone
405 preoutgoing.forbid hook: HG_HOOKNAME=preoutgoing.forbid HG_HOOKTYPE=preoutgoing HG_SOURCE=clone
406 abort: preoutgoing.forbid hook exited with status 1
406 abort: preoutgoing.forbid hook exited with status 1
407 [255]
407 [255]
408
408
409 $ cd "$TESTTMP/b"
409 $ cd "$TESTTMP/b"
410
410
411 $ cat > hooktests.py <<EOF
411 $ cat > hooktests.py <<EOF
412 > from __future__ import print_function
412 > from __future__ import print_function
413 > from mercurial import error
413 > from mercurial import error
414 >
414 >
415 > uncallable = 0
415 > uncallable = 0
416 >
416 >
417 > def printargs(ui, args):
417 > def printargs(ui, args):
418 > a = list(args.items())
418 > a = list(args.items())
419 > a.sort()
419 > a.sort()
420 > ui.write(b'hook args:\n')
420 > ui.write(b'hook args:\n')
421 > for k, v in a:
421 > for k, v in a:
422 > ui.write(b' %s %s\n' % (k, v))
422 > ui.write(b' %s %s\n' % (k, v))
423 >
423 >
424 > def passhook(ui, repo, **args):
424 > def passhook(ui, repo, **args):
425 > printargs(ui, args)
425 > printargs(ui, args)
426 >
426 >
427 > def failhook(ui, repo, **args):
427 > def failhook(ui, repo, **args):
428 > printargs(ui, args)
428 > printargs(ui, args)
429 > return True
429 > return True
430 >
430 >
431 > class LocalException(Exception):
431 > class LocalException(Exception):
432 > pass
432 > pass
433 >
433 >
434 > def raisehook(**args):
434 > def raisehook(**args):
435 > raise LocalException(b'exception from hook')
435 > raise LocalException(b'exception from hook')
436 >
436 >
437 > def aborthook(**args):
437 > def aborthook(**args):
438 > raise error.Abort(b'raise abort from hook')
438 > raise error.Abort(b'raise abort from hook')
439 >
439 >
440 > def brokenhook(**args):
440 > def brokenhook(**args):
441 > return 1 + {}
441 > return 1 + {}
442 >
442 >
443 > def verbosehook(ui, **args):
443 > def verbosehook(ui, **args):
444 > ui.note(b'verbose output from hook\n')
444 > ui.note(b'verbose output from hook\n')
445 >
445 >
446 > def printtags(ui, repo, **args):
446 > def printtags(ui, repo, **args):
447 > ui.write(b'%s\n' % sorted(repo.tags()))
447 > ui.write(b'%s\n' % sorted(repo.tags()))
448 >
448 >
449 > class container:
449 > class container:
450 > unreachable = 1
450 > unreachable = 1
451 > EOF
451 > EOF
452
452
453 $ cat > syntaxerror.py << EOF
453 $ cat > syntaxerror.py << EOF
454 > (foo
454 > (foo
455 > EOF
455 > EOF
456
456
457 test python hooks
457 test python hooks
458
458
459 #if windows
459 #if windows
460 $ PYTHONPATH="$TESTTMP/b;$PYTHONPATH"
460 $ PYTHONPATH="$TESTTMP/b;$PYTHONPATH"
461 #else
461 #else
462 $ PYTHONPATH="$TESTTMP/b:$PYTHONPATH"
462 $ PYTHONPATH="$TESTTMP/b:$PYTHONPATH"
463 #endif
463 #endif
464 $ export PYTHONPATH
464 $ export PYTHONPATH
465
465
466 $ echo '[hooks]' > ../a/.hg/hgrc
466 $ echo '[hooks]' > ../a/.hg/hgrc
467 $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
467 $ echo 'preoutgoing.broken = python:hooktests.brokenhook' >> ../a/.hg/hgrc
468 $ hg pull ../a 2>&1 | grep 'raised an exception'
468 $ hg pull ../a 2>&1 | grep 'raised an exception'
469 error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
469 error: preoutgoing.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
470
470
471 $ echo '[hooks]' > ../a/.hg/hgrc
471 $ echo '[hooks]' > ../a/.hg/hgrc
472 $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
472 $ echo 'preoutgoing.raise = python:hooktests.raisehook' >> ../a/.hg/hgrc
473 $ hg pull ../a 2>&1 | grep 'raised an exception'
473 $ hg pull ../a 2>&1 | grep 'raised an exception'
474 error: preoutgoing.raise hook raised an exception: exception from hook
474 error: preoutgoing.raise hook raised an exception: exception from hook
475
475
476 $ echo '[hooks]' > ../a/.hg/hgrc
476 $ echo '[hooks]' > ../a/.hg/hgrc
477 $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
477 $ echo 'preoutgoing.abort = python:hooktests.aborthook' >> ../a/.hg/hgrc
478 $ hg pull ../a
478 $ hg pull ../a
479 pulling from ../a
479 pulling from ../a
480 searching for changes
480 searching for changes
481 error: preoutgoing.abort hook failed: raise abort from hook
481 error: preoutgoing.abort hook failed: raise abort from hook
482 abort: raise abort from hook
482 abort: raise abort from hook
483 [255]
483 [255]
484
484
485 $ echo '[hooks]' > ../a/.hg/hgrc
485 $ echo '[hooks]' > ../a/.hg/hgrc
486 $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
486 $ echo 'preoutgoing.fail = python:hooktests.failhook' >> ../a/.hg/hgrc
487 $ hg pull ../a
487 $ hg pull ../a
488 pulling from ../a
488 pulling from ../a
489 searching for changes
489 searching for changes
490 hook args:
490 hook args:
491 hooktype preoutgoing
491 hooktype preoutgoing
492 source pull
492 source pull
493 abort: preoutgoing.fail hook failed
493 abort: preoutgoing.fail hook failed
494 [255]
494 [255]
495
495
496 $ echo '[hooks]' > ../a/.hg/hgrc
496 $ echo '[hooks]' > ../a/.hg/hgrc
497 $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
497 $ echo 'preoutgoing.uncallable = python:hooktests.uncallable' >> ../a/.hg/hgrc
498 $ hg pull ../a
498 $ hg pull ../a
499 pulling from ../a
499 pulling from ../a
500 searching for changes
500 searching for changes
501 abort: preoutgoing.uncallable hook is invalid: "hooktests.uncallable" is not callable
501 abort: preoutgoing.uncallable hook is invalid: "hooktests.uncallable" is not callable
502 [255]
502 [255]
503
503
504 $ echo '[hooks]' > ../a/.hg/hgrc
504 $ echo '[hooks]' > ../a/.hg/hgrc
505 $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
505 $ echo 'preoutgoing.nohook = python:hooktests.nohook' >> ../a/.hg/hgrc
506 $ hg pull ../a
506 $ hg pull ../a
507 pulling from ../a
507 pulling from ../a
508 searching for changes
508 searching for changes
509 abort: preoutgoing.nohook hook is invalid: "hooktests.nohook" is not defined
509 abort: preoutgoing.nohook hook is invalid: "hooktests.nohook" is not defined
510 [255]
510 [255]
511
511
512 $ echo '[hooks]' > ../a/.hg/hgrc
512 $ echo '[hooks]' > ../a/.hg/hgrc
513 $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
513 $ echo 'preoutgoing.nomodule = python:nomodule' >> ../a/.hg/hgrc
514 $ hg pull ../a
514 $ hg pull ../a
515 pulling from ../a
515 pulling from ../a
516 searching for changes
516 searching for changes
517 abort: preoutgoing.nomodule hook is invalid: "nomodule" not in a module
517 abort: preoutgoing.nomodule hook is invalid: "nomodule" not in a module
518 [255]
518 [255]
519
519
520 $ echo '[hooks]' > ../a/.hg/hgrc
520 $ echo '[hooks]' > ../a/.hg/hgrc
521 $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
521 $ echo 'preoutgoing.badmodule = python:nomodule.nowhere' >> ../a/.hg/hgrc
522 $ hg pull ../a
522 $ hg pull ../a
523 pulling from ../a
523 pulling from ../a
524 searching for changes
524 searching for changes
525 abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed
525 abort: preoutgoing.badmodule hook is invalid: import of "nomodule" failed
526 (run with --traceback for stack trace)
526 (run with --traceback for stack trace)
527 [255]
527 [255]
528
528
529 $ echo '[hooks]' > ../a/.hg/hgrc
529 $ echo '[hooks]' > ../a/.hg/hgrc
530 $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
530 $ echo 'preoutgoing.unreachable = python:hooktests.container.unreachable' >> ../a/.hg/hgrc
531 $ hg pull ../a
531 $ hg pull ../a
532 pulling from ../a
532 pulling from ../a
533 searching for changes
533 searching for changes
534 abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed
534 abort: preoutgoing.unreachable hook is invalid: import of "hooktests.container" failed
535 (run with --traceback for stack trace)
535 (run with --traceback for stack trace)
536 [255]
536 [255]
537
537
538 $ echo '[hooks]' > ../a/.hg/hgrc
538 $ echo '[hooks]' > ../a/.hg/hgrc
539 $ echo 'preoutgoing.syntaxerror = python:syntaxerror.syntaxerror' >> ../a/.hg/hgrc
539 $ echo 'preoutgoing.syntaxerror = python:syntaxerror.syntaxerror' >> ../a/.hg/hgrc
540 $ hg pull ../a
540 $ hg pull ../a
541 pulling from ../a
541 pulling from ../a
542 searching for changes
542 searching for changes
543 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
543 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
544 (run with --traceback for stack trace)
544 (run with --traceback for stack trace)
545 [255]
545 [255]
546
546
547 The second egrep is to filter out lines like ' ^', which are slightly
547 The second egrep is to filter out lines like ' ^', which are slightly
548 different between Python 2.6 and Python 2.7.
548 different between Python 2.6 and Python 2.7.
549 $ hg pull ../a --traceback 2>&1 | egrep -v '^( +File| [_a-zA-Z*(])' | egrep -v '^( )+(\^)?$'
549 $ hg pull ../a --traceback 2>&1 | egrep -v '^( +File| [_a-zA-Z*(])' | egrep -v '^( )+(\^)?$'
550 pulling from ../a
550 pulling from ../a
551 searching for changes
551 searching for changes
552 exception from first failed import attempt:
552 exception from first failed import attempt:
553 Traceback (most recent call last):
553 Traceback (most recent call last):
554 SyntaxError: * (glob)
554 SyntaxError: * (glob)
555 exception from second failed import attempt:
555 exception from second failed import attempt:
556 Traceback (most recent call last):
556 Traceback (most recent call last):
557 ImportError: No module named hgext_syntaxerror
557 ImportError: No module named hgext_syntaxerror
558 Traceback (most recent call last):
558 Traceback (most recent call last):
559 HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
559 HookLoadError: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
560 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
560 abort: preoutgoing.syntaxerror hook is invalid: import of "syntaxerror" failed
561
561
562 $ echo '[hooks]' > ../a/.hg/hgrc
562 $ echo '[hooks]' > ../a/.hg/hgrc
563 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
563 $ echo 'preoutgoing.pass = python:hooktests.passhook' >> ../a/.hg/hgrc
564 $ hg pull ../a
564 $ hg pull ../a
565 pulling from ../a
565 pulling from ../a
566 searching for changes
566 searching for changes
567 hook args:
567 hook args:
568 hooktype preoutgoing
568 hooktype preoutgoing
569 source pull
569 source pull
570 adding changesets
570 adding changesets
571 adding manifests
571 adding manifests
572 adding file changes
572 adding file changes
573 added 1 changesets with 1 changes to 1 files
573 added 1 changesets with 1 changes to 1 files
574 adding remote bookmark quux
574 adding remote bookmark quux
575 new changesets 539e4b31b6dc
575 new changesets 539e4b31b6dc
576 (run 'hg update' to get a working copy)
576 (run 'hg update' to get a working copy)
577
577
578 post- python hooks that fail to *run* don't cause an abort
578 post- python hooks that fail to *run* don't cause an abort
579 $ rm ../a/.hg/hgrc
579 $ rm ../a/.hg/hgrc
580 $ echo '[hooks]' > .hg/hgrc
580 $ echo '[hooks]' > .hg/hgrc
581 $ echo 'post-pull.broken = python:hooktests.brokenhook' >> .hg/hgrc
581 $ echo 'post-pull.broken = python:hooktests.brokenhook' >> .hg/hgrc
582 $ hg pull ../a
582 $ hg pull ../a
583 pulling from ../a
583 pulling from ../a
584 searching for changes
584 searching for changes
585 no changes found
585 no changes found
586 error: post-pull.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
586 error: post-pull.broken hook raised an exception: unsupported operand type(s) for +: 'int' and 'dict'
587 (run with --traceback for stack trace)
587 (run with --traceback for stack trace)
588
588
589 but post- python hooks that fail to *load* do
589 but post- python hooks that fail to *load* do
590 $ echo '[hooks]' > .hg/hgrc
590 $ echo '[hooks]' > .hg/hgrc
591 $ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc
591 $ echo 'post-pull.nomodule = python:nomodule' >> .hg/hgrc
592 $ hg pull ../a
592 $ hg pull ../a
593 pulling from ../a
593 pulling from ../a
594 searching for changes
594 searching for changes
595 no changes found
595 no changes found
596 abort: post-pull.nomodule hook is invalid: "nomodule" not in a module
596 abort: post-pull.nomodule hook is invalid: "nomodule" not in a module
597 [255]
597 [255]
598
598
599 $ echo '[hooks]' > .hg/hgrc
599 $ echo '[hooks]' > .hg/hgrc
600 $ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc
600 $ echo 'post-pull.badmodule = python:nomodule.nowhere' >> .hg/hgrc
601 $ hg pull ../a
601 $ hg pull ../a
602 pulling from ../a
602 pulling from ../a
603 searching for changes
603 searching for changes
604 no changes found
604 no changes found
605 abort: post-pull.badmodule hook is invalid: import of "nomodule" failed
605 abort: post-pull.badmodule hook is invalid: import of "nomodule" failed
606 (run with --traceback for stack trace)
606 (run with --traceback for stack trace)
607 [255]
607 [255]
608
608
609 $ echo '[hooks]' > .hg/hgrc
609 $ echo '[hooks]' > .hg/hgrc
610 $ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc
610 $ echo 'post-pull.nohook = python:hooktests.nohook' >> .hg/hgrc
611 $ hg pull ../a
611 $ hg pull ../a
612 pulling from ../a
612 pulling from ../a
613 searching for changes
613 searching for changes
614 no changes found
614 no changes found
615 abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined
615 abort: post-pull.nohook hook is invalid: "hooktests.nohook" is not defined
616 [255]
616 [255]
617
617
618 make sure --traceback works
618 make sure --traceback works
619
619
620 $ echo '[hooks]' > .hg/hgrc
620 $ echo '[hooks]' > .hg/hgrc
621 $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
621 $ echo 'commit.abort = python:hooktests.aborthook' >> .hg/hgrc
622
622
623 $ echo aa > a
623 $ echo aa > a
624 $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback'
624 $ hg --traceback commit -d '0 0' -ma 2>&1 | grep '^Traceback'
625 Traceback (most recent call last):
625 Traceback (most recent call last):
626
626
627 $ cd ..
627 $ cd ..
628 $ hg init c
628 $ hg init c
629 $ cd c
629 $ cd c
630
630
631 $ cat > hookext.py <<EOF
631 $ cat > hookext.py <<EOF
632 > def autohook(ui, **args):
632 > def autohook(ui, **args):
633 > ui.write('Automatically installed hook\n')
633 > ui.write('Automatically installed hook\n')
634 >
634 >
635 > def reposetup(ui, repo):
635 > def reposetup(ui, repo):
636 > repo.ui.setconfig("hooks", "commit.auto", autohook)
636 > repo.ui.setconfig("hooks", "commit.auto", autohook)
637 > EOF
637 > EOF
638 $ echo '[extensions]' >> .hg/hgrc
638 $ echo '[extensions]' >> .hg/hgrc
639 $ echo 'hookext = hookext.py' >> .hg/hgrc
639 $ echo 'hookext = hookext.py' >> .hg/hgrc
640
640
641 $ touch foo
641 $ touch foo
642 $ hg add foo
642 $ hg add foo
643 $ hg ci -d '0 0' -m 'add foo'
643 $ hg ci -d '0 0' -m 'add foo'
644 Automatically installed hook
644 Automatically installed hook
645 $ echo >> foo
645 $ echo >> foo
646 $ hg ci --debug -d '0 0' -m 'change foo'
646 $ hg ci --debug -d '0 0' -m 'change foo'
647 committing files:
647 committing files:
648 foo
648 foo
649 committing manifest
649 committing manifest
650 committing changelog
650 committing changelog
651 updating the branch cache
651 updating the branch cache
652 committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
652 committed changeset 1:52998019f6252a2b893452765fcb0a47351a5708
653 calling hook commit.auto: hgext_hookext.autohook
653 calling hook commit.auto: hgext_hookext.autohook
654 Automatically installed hook
654 Automatically installed hook
655
655
656 $ hg showconfig hooks
656 $ hg showconfig hooks
657 hooks.commit.auto=<function autohook at *> (glob)
657 hooks.commit.auto=<function autohook at *> (glob)
658
658
659 test python hook configured with python:[file]:[hook] syntax
659 test python hook configured with python:[file]:[hook] syntax
660
660
661 $ cd ..
661 $ cd ..
662 $ mkdir d
662 $ mkdir d
663 $ cd d
663 $ cd d
664 $ hg init repo
664 $ hg init repo
665 $ mkdir hooks
665 $ mkdir hooks
666
666
667 $ cd hooks
667 $ cd hooks
668 $ cat > testhooks.py <<EOF
668 $ cat > testhooks.py <<EOF
669 > def testhook(ui, **args):
669 > def testhook(ui, **args):
670 > ui.write(b'hook works\n')
670 > ui.write(b'hook works\n')
671 > EOF
671 > EOF
672 $ echo '[hooks]' > ../repo/.hg/hgrc
672 $ echo '[hooks]' > ../repo/.hg/hgrc
673 $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc
673 $ echo "pre-commit.test = python:`pwd`/testhooks.py:testhook" >> ../repo/.hg/hgrc
674
674
675 $ cd ../repo
675 $ cd ../repo
676 $ hg commit -d '0 0'
676 $ hg commit -d '0 0'
677 hook works
677 hook works
678 nothing changed
678 nothing changed
679 [1]
679 [1]
680
680
681 $ echo '[hooks]' > .hg/hgrc
681 $ echo '[hooks]' > .hg/hgrc
682 $ echo "update.ne = python:`pwd`/nonexistent.py:testhook" >> .hg/hgrc
682 $ echo "update.ne = python:`pwd`/nonexistent.py:testhook" >> .hg/hgrc
683 $ echo "pre-identify.npmd = python:`pwd`/:no_python_module_dir" >> .hg/hgrc
683 $ echo "pre-identify.npmd = python:`pwd`/:no_python_module_dir" >> .hg/hgrc
684
684
685 $ hg up null
685 $ hg up null
686 loading update.ne hook failed:
686 loading update.ne hook failed:
687 abort: $ENOENT$: $TESTTMP/d/repo/nonexistent.py
687 abort: $ENOENT$: $TESTTMP/d/repo/nonexistent.py
688 [255]
688 [255]
689
689
690 $ hg id
690 $ hg id
691 loading pre-identify.npmd hook failed:
691 loading pre-identify.npmd hook failed:
692 abort: No module named repo!
692 abort: No module named repo!
693 [255]
693 [255]
694
694
695 $ cd ../../b
695 $ cd ../../b
696
696
697 make sure --traceback works on hook import failure
697 make sure --traceback works on hook import failure
698
698
699 $ cat > importfail.py <<EOF
699 $ cat > importfail.py <<EOF
700 > import somebogusmodule
700 > import somebogusmodule
701 > # dereference something in the module to force demandimport to load it
701 > # dereference something in the module to force demandimport to load it
702 > somebogusmodule.whatever
702 > somebogusmodule.whatever
703 > EOF
703 > EOF
704
704
705 $ echo '[hooks]' > .hg/hgrc
705 $ echo '[hooks]' > .hg/hgrc
706 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
706 $ echo 'precommit.importfail = python:importfail.whatever' >> .hg/hgrc
707
707
708 $ echo a >> a
708 $ echo a >> a
709 $ hg --traceback commit -ma 2>&1 | egrep -v '^( +File| [a-zA-Z(])'
709 $ hg --traceback commit -ma 2>&1 | egrep -v '^( +File| [a-zA-Z(])'
710 exception from first failed import attempt:
710 exception from first failed import attempt:
711 Traceback (most recent call last):
711 Traceback (most recent call last):
712 ImportError: No module named somebogusmodule
712 ImportError: No module named somebogusmodule
713 exception from second failed import attempt:
713 exception from second failed import attempt:
714 Traceback (most recent call last):
714 Traceback (most recent call last):
715 ImportError: No module named hgext_importfail
715 ImportError: No module named hgext_importfail
716 Traceback (most recent call last):
716 Traceback (most recent call last):
717 HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed
717 HookLoadError: precommit.importfail hook is invalid: import of "importfail" failed
718 abort: precommit.importfail hook is invalid: import of "importfail" failed
718 abort: precommit.importfail hook is invalid: import of "importfail" failed
719
719
720 Issue1827: Hooks Update & Commit not completely post operation
720 Issue1827: Hooks Update & Commit not completely post operation
721
721
722 commit and update hooks should run after command completion. The largefiles
722 commit and update hooks should run after command completion. The largefiles
723 use demonstrates a recursive wlock, showing the hook doesn't run until the
723 use demonstrates a recursive wlock, showing the hook doesn't run until the
724 final release (and dirstate flush).
724 final release (and dirstate flush).
725
725
726 $ echo '[hooks]' > .hg/hgrc
726 $ echo '[hooks]' > .hg/hgrc
727 $ echo 'commit = hg id' >> .hg/hgrc
727 $ echo 'commit = hg id' >> .hg/hgrc
728 $ echo 'update = hg id' >> .hg/hgrc
728 $ echo 'update = hg id' >> .hg/hgrc
729 $ echo bb > a
729 $ echo bb > a
730 $ hg ci -ma
730 $ hg ci -ma
731 223eafe2750c tip
731 223eafe2750c tip
732 $ hg up 0 --config extensions.largefiles=
732 $ hg up 0 --config extensions.largefiles=
733 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
733 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
734 cb9a9f314b8b
734 cb9a9f314b8b
735 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
735 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
736
736
737 make sure --verbose (and --quiet/--debug etc.) are propagated to the local ui
737 make sure --verbose (and --quiet/--debug etc.) are propagated to the local ui
738 that is passed to pre/post hooks
738 that is passed to pre/post hooks
739
739
740 $ echo '[hooks]' > .hg/hgrc
740 $ echo '[hooks]' > .hg/hgrc
741 $ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc
741 $ echo 'pre-identify = python:hooktests.verbosehook' >> .hg/hgrc
742 $ hg id
742 $ hg id
743 cb9a9f314b8b
743 cb9a9f314b8b
744 $ hg id --verbose
744 $ hg id --verbose
745 calling hook pre-identify: hooktests.verbosehook
745 calling hook pre-identify: hooktests.verbosehook
746 verbose output from hook
746 verbose output from hook
747 cb9a9f314b8b
747 cb9a9f314b8b
748
748
749 Ensure hooks can be prioritized
749 Ensure hooks can be prioritized
750
750
751 $ echo '[hooks]' > .hg/hgrc
751 $ echo '[hooks]' > .hg/hgrc
752 $ echo 'pre-identify.a = python:hooktests.verbosehook' >> .hg/hgrc
752 $ echo 'pre-identify.a = python:hooktests.verbosehook' >> .hg/hgrc
753 $ echo 'pre-identify.b = python:hooktests.verbosehook' >> .hg/hgrc
753 $ echo 'pre-identify.b = python:hooktests.verbosehook' >> .hg/hgrc
754 $ echo 'priority.pre-identify.b = 1' >> .hg/hgrc
754 $ echo 'priority.pre-identify.b = 1' >> .hg/hgrc
755 $ echo 'pre-identify.c = python:hooktests.verbosehook' >> .hg/hgrc
755 $ echo 'pre-identify.c = python:hooktests.verbosehook' >> .hg/hgrc
756 $ hg id --verbose
756 $ hg id --verbose
757 calling hook pre-identify.b: hooktests.verbosehook
757 calling hook pre-identify.b: hooktests.verbosehook
758 verbose output from hook
758 verbose output from hook
759 calling hook pre-identify.a: hooktests.verbosehook
759 calling hook pre-identify.a: hooktests.verbosehook
760 verbose output from hook
760 verbose output from hook
761 calling hook pre-identify.c: hooktests.verbosehook
761 calling hook pre-identify.c: hooktests.verbosehook
762 verbose output from hook
762 verbose output from hook
763 cb9a9f314b8b
763 cb9a9f314b8b
764
764
765 new tags must be visible in pretxncommit (issue3210)
765 new tags must be visible in pretxncommit (issue3210)
766
766
767 $ echo 'pretxncommit.printtags = python:hooktests.printtags' >> .hg/hgrc
767 $ echo 'pretxncommit.printtags = python:hooktests.printtags' >> .hg/hgrc
768 $ hg tag -f foo
768 $ hg tag -f foo
769 ['a', 'foo', 'tip']
769 ['a', 'foo', 'tip']
770
770
771 post-init hooks must not crash (issue4983)
771 post-init hooks must not crash (issue4983)
772 This also creates the `to` repo for the next test block.
772 This also creates the `to` repo for the next test block.
773
773
774 $ cd ..
774 $ cd ..
775 $ cat << EOF >> hgrc-with-post-init-hook
775 $ cat << EOF >> hgrc-with-post-init-hook
776 > [hooks]
776 > [hooks]
777 > post-init = sh -c "printenv.py post-init"
777 > post-init = sh -c "printenv.py post-init"
778 > EOF
778 > EOF
779 $ HGRCPATH=hgrc-with-post-init-hook hg init to
779 $ HGRCPATH=hgrc-with-post-init-hook hg init to
780 post-init hook: HG_ARGS=init to HG_HOOKNAME=post-init HG_HOOKTYPE=post-init HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''} HG_PATS=['to'] HG_RESULT=0
780 post-init hook: HG_ARGS=init to HG_HOOKNAME=post-init HG_HOOKTYPE=post-init HG_OPTS={'insecure': None, 'remotecmd': '', 'ssh': ''} HG_PATS=['to'] HG_RESULT=0
781
781
782 new commits must be visible in pretxnchangegroup (issue3428)
782 new commits must be visible in pretxnchangegroup (issue3428)
783
783
784 $ echo '[hooks]' >> to/.hg/hgrc
784 $ echo '[hooks]' >> to/.hg/hgrc
785 $ echo 'prechangegroup = hg --traceback tip' >> to/.hg/hgrc
785 $ echo 'prechangegroup = hg --traceback tip' >> to/.hg/hgrc
786 $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc
786 $ echo 'pretxnchangegroup = hg --traceback tip' >> to/.hg/hgrc
787 $ echo a >> to/a
787 $ echo a >> to/a
788 $ hg --cwd to ci -Ama
788 $ hg --cwd to ci -Ama
789 adding a
789 adding a
790 $ hg clone to from
790 $ hg clone to from
791 updating to branch default
791 updating to branch default
792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
792 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
793 $ echo aa >> from/a
793 $ echo aa >> from/a
794 $ hg --cwd from ci -mb
794 $ hg --cwd from ci -mb
795 $ hg --cwd from push
795 $ hg --cwd from push
796 pushing to $TESTTMP/to
796 pushing to $TESTTMP/to
797 searching for changes
797 searching for changes
798 changeset: 0:cb9a9f314b8b
798 changeset: 0:cb9a9f314b8b
799 tag: tip
799 tag: tip
800 user: test
800 user: test
801 date: Thu Jan 01 00:00:00 1970 +0000
801 date: Thu Jan 01 00:00:00 1970 +0000
802 summary: a
802 summary: a
803
803
804 adding changesets
804 adding changesets
805 adding manifests
805 adding manifests
806 adding file changes
806 adding file changes
807 added 1 changesets with 1 changes to 1 files
807 added 1 changesets with 1 changes to 1 files
808 changeset: 1:9836a07b9b9d
808 changeset: 1:9836a07b9b9d
809 tag: tip
809 tag: tip
810 user: test
810 user: test
811 date: Thu Jan 01 00:00:00 1970 +0000
811 date: Thu Jan 01 00:00:00 1970 +0000
812 summary: b
812 summary: b
813
813
814
814
815 pretxnclose hook failure should abort the transaction
815 pretxnclose hook failure should abort the transaction
816
816
817 $ hg init txnfailure
817 $ hg init txnfailure
818 $ cd txnfailure
818 $ cd txnfailure
819 $ touch a && hg commit -Aqm a
819 $ touch a && hg commit -Aqm a
820 $ cat >> .hg/hgrc <<EOF
820 $ cat >> .hg/hgrc <<EOF
821 > [hooks]
821 > [hooks]
822 > pretxnclose.error = exit 1
822 > pretxnclose.error = exit 1
823 > EOF
823 > EOF
824 $ hg strip -r 0 --config extensions.strip=
824 $ hg strip -r 0 --config extensions.strip=
825 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
825 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
826 saved backup bundle to * (glob)
826 saved backup bundle to * (glob)
827 transaction abort!
827 transaction abort!
828 rollback completed
828 rollback completed
829 strip failed, backup bundle stored in * (glob)
829 strip failed, backup bundle stored in * (glob)
830 abort: pretxnclose.error hook exited with status 1
830 abort: pretxnclose.error hook exited with status 1
831 [255]
831 [255]
832 $ hg recover
832 $ hg recover
833 no interrupted transaction available
833 no interrupted transaction available
834 [1]
834 [1]
835 $ cd ..
835 $ cd ..
836
836
837 check whether HG_PENDING makes pending changes only in related
837 check whether HG_PENDING makes pending changes only in related
838 repositories visible to an external hook.
838 repositories visible to an external hook.
839
839
840 (emulate a transaction running concurrently by copied
840 (emulate a transaction running concurrently by copied
841 .hg/store/00changelog.i.a in subsequent test)
841 .hg/store/00changelog.i.a in subsequent test)
842
842
843 $ cat > $TESTTMP/savepending.sh <<EOF
843 $ cat > $TESTTMP/savepending.sh <<EOF
844 > cp .hg/store/00changelog.i.a .hg/store/00changelog.i.a.saved
844 > cp .hg/store/00changelog.i.a .hg/store/00changelog.i.a.saved
845 > exit 1 # to avoid adding new revision for subsequent tests
845 > exit 1 # to avoid adding new revision for subsequent tests
846 > EOF
846 > EOF
847 $ cd a
847 $ cd a
848 $ hg tip -q
848 $ hg tip -q
849 4:539e4b31b6dc
849 4:539e4b31b6dc
850 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" commit -m "invisible"
850 $ hg --config hooks.pretxnclose="sh $TESTTMP/savepending.sh" commit -m "invisible"
851 transaction abort!
851 transaction abort!
852 rollback completed
852 rollback completed
853 abort: pretxnclose hook exited with status 1
853 abort: pretxnclose hook exited with status 1
854 [255]
854 [255]
855 $ cp .hg/store/00changelog.i.a.saved .hg/store/00changelog.i.a
855 $ cp .hg/store/00changelog.i.a.saved .hg/store/00changelog.i.a
856
856
857 (check (in)visibility of new changeset while transaction running in
857 (check (in)visibility of new changeset while transaction running in
858 repo)
858 repo)
859
859
860 $ cat > $TESTTMP/checkpending.sh <<EOF
860 $ cat > $TESTTMP/checkpending.sh <<EOF
861 > echo '@a'
861 > echo '@a'
862 > hg -R "$TESTTMP/a" tip -q
862 > hg -R "$TESTTMP/a" tip -q
863 > echo '@a/nested'
863 > echo '@a/nested'
864 > hg -R "$TESTTMP/a/nested" tip -q
864 > hg -R "$TESTTMP/a/nested" tip -q
865 > exit 1 # to avoid adding new revision for subsequent tests
865 > exit 1 # to avoid adding new revision for subsequent tests
866 > EOF
866 > EOF
867 $ hg init nested
867 $ hg init nested
868 $ cd nested
868 $ cd nested
869 $ echo a > a
869 $ echo a > a
870 $ hg add a
870 $ hg add a
871 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" commit -m '#0'
871 $ hg --config hooks.pretxnclose="sh $TESTTMP/checkpending.sh" commit -m '#0'
872 @a
872 @a
873 4:539e4b31b6dc
873 4:539e4b31b6dc
874 @a/nested
874 @a/nested
875 0:bf5e395ced2c
875 0:bf5e395ced2c
876 transaction abort!
876 transaction abort!
877 rollback completed
877 rollback completed
878 abort: pretxnclose hook exited with status 1
878 abort: pretxnclose hook exited with status 1
879 [255]
879 [255]
880
880
881 Hook from untrusted hgrc are reported as failure
881 Hook from untrusted hgrc are reported as failure
882 ================================================
882 ================================================
883
883
884 $ cat << EOF > $TESTTMP/untrusted.py
884 $ cat << EOF > $TESTTMP/untrusted.py
885 > from mercurial import scmutil, util
885 > from mercurial import scmutil, util
886 > def uisetup(ui):
886 > def uisetup(ui):
887 > class untrustedui(ui.__class__):
887 > class untrustedui(ui.__class__):
888 > def _trusted(self, fp, f):
888 > def _trusted(self, fp, f):
889 > if util.normpath(fp.name).endswith(b'untrusted/.hg/hgrc'):
889 > if util.normpath(fp.name).endswith(b'untrusted/.hg/hgrc'):
890 > return False
890 > return False
891 > return super(untrustedui, self)._trusted(fp, f)
891 > return super(untrustedui, self)._trusted(fp, f)
892 > ui.__class__ = untrustedui
892 > ui.__class__ = untrustedui
893 > EOF
893 > EOF
894 $ cat << EOF >> $HGRCPATH
894 $ cat << EOF >> $HGRCPATH
895 > [extensions]
895 > [extensions]
896 > untrusted=$TESTTMP/untrusted.py
896 > untrusted=$TESTTMP/untrusted.py
897 > EOF
897 > EOF
898 $ hg init untrusted
898 $ hg init untrusted
899 $ cd untrusted
899 $ cd untrusted
900
900
901 Non-blocking hook
901 Non-blocking hook
902 -----------------
902 -----------------
903
903
904 $ cat << EOF >> .hg/hgrc
904 $ cat << EOF >> .hg/hgrc
905 > [hooks]
905 > [hooks]
906 > txnclose.testing=echo txnclose hook called
906 > txnclose.testing=echo txnclose hook called
907 > EOF
907 > EOF
908 $ touch a && hg commit -Aqm a
908 $ touch a && hg commit -Aqm a
909 warning: untrusted hook txnclose.testing not executed
909 warning: untrusted hook txnclose.testing not executed
910 $ hg log
910 $ hg log
911 changeset: 0:3903775176ed
911 changeset: 0:3903775176ed
912 tag: tip
912 tag: tip
913 user: test
913 user: test
914 date: Thu Jan 01 00:00:00 1970 +0000
914 date: Thu Jan 01 00:00:00 1970 +0000
915 summary: a
915 summary: a
916
916
917
917
918 Non-blocking hook
918 Non-blocking hook
919 -----------------
919 -----------------
920
920
921 $ cat << EOF >> .hg/hgrc
921 $ cat << EOF >> .hg/hgrc
922 > [hooks]
922 > [hooks]
923 > pretxnclose.testing=echo pre-txnclose hook called
923 > pretxnclose.testing=echo pre-txnclose hook called
924 > EOF
924 > EOF
925 $ touch b && hg commit -Aqm a
925 $ touch b && hg commit -Aqm a
926 transaction abort!
926 transaction abort!
927 rollback completed
927 rollback completed
928 abort: untrusted hook pretxnclose.testing not executed
928 abort: untrusted hook pretxnclose.testing not executed
929 (see 'hg help config.trusted')
929 (see 'hg help config.trusted')
930 [255]
930 [255]
931 $ hg log
931 $ hg log
932 changeset: 0:3903775176ed
932 changeset: 0:3903775176ed
933 tag: tip
933 tag: tip
934 user: test
934 user: test
935 date: Thu Jan 01 00:00:00 1970 +0000
935 date: Thu Jan 01 00:00:00 1970 +0000
936 summary: a
936 summary: a
937
937
@@ -1,160 +1,160 b''
1 #require unix-permissions
1 #require unix-permissions
2
2
3 test that new files created in .hg inherit the permissions from .hg/store
3 test that new files created in .hg inherit the permissions from .hg/store
4
4
5 $ mkdir dir
5 $ mkdir dir
6
6
7 just in case somebody has a strange $TMPDIR
7 just in case somebody has a strange $TMPDIR
8
8
9 $ chmod g-s dir
9 $ chmod g-s dir
10 $ cd dir
10 $ cd dir
11
11
12 $ cat >printmodes.py <<EOF
12 $ cat >printmodes.py <<EOF
13 > from __future__ import absolute_import, print_function
13 > from __future__ import absolute_import, print_function
14 > import os
14 > import os
15 > import sys
15 > import sys
16 >
16 >
17 > allnames = []
17 > allnames = []
18 > isdir = {}
18 > isdir = {}
19 > for root, dirs, files in os.walk(sys.argv[1]):
19 > for root, dirs, files in os.walk(sys.argv[1]):
20 > for d in dirs:
20 > for d in dirs:
21 > name = os.path.join(root, d)
21 > name = os.path.join(root, d)
22 > isdir[name] = 1
22 > isdir[name] = 1
23 > allnames.append(name)
23 > allnames.append(name)
24 > for f in files:
24 > for f in files:
25 > name = os.path.join(root, f)
25 > name = os.path.join(root, f)
26 > allnames.append(name)
26 > allnames.append(name)
27 > allnames.sort()
27 > allnames.sort()
28 > for name in allnames:
28 > for name in allnames:
29 > suffix = name in isdir and '/' or ''
29 > suffix = name in isdir and '/' or ''
30 > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix))
30 > print('%05o %s%s' % (os.lstat(name).st_mode & 0o7777, name, suffix))
31 > EOF
31 > EOF
32
32
33 $ cat >mode.py <<EOF
33 $ cat >mode.py <<EOF
34 > from __future__ import absolute_import, print_function
34 > from __future__ import absolute_import, print_function
35 > import os
35 > import os
36 > import sys
36 > import sys
37 > print('%05o' % os.lstat(sys.argv[1]).st_mode)
37 > print('%05o' % os.lstat(sys.argv[1]).st_mode)
38 > EOF
38 > EOF
39
39
40 $ umask 077
40 $ umask 077
41
41
42 $ hg init repo
42 $ hg init repo
43 $ cd repo
43 $ cd repo
44
44
45 $ chmod 0770 .hg/store
45 $ chmod 0770 .hg/store
46
46
47 before commit
47 before commit
48 store can be written by the group, other files cannot
48 store can be written by the group, other files cannot
49 store is setgid
49 store is setgid
50
50
51 $ $PYTHON ../printmodes.py .
51 $ $PYTHON ../printmodes.py .
52 00700 ./.hg/
52 00700 ./.hg/
53 00600 ./.hg/00changelog.i
53 00600 ./.hg/00changelog.i
54 00600 ./.hg/requires
54 00600 ./.hg/requires
55 00770 ./.hg/store/
55 00770 ./.hg/store/
56
56
57 $ mkdir dir
57 $ mkdir dir
58 $ touch foo dir/bar
58 $ touch foo dir/bar
59 $ hg ci -qAm 'add files'
59 $ hg ci -qAm 'add files'
60
60
61 after commit
61 after commit
62 working dir files can only be written by the owner
62 working dir files can only be written by the owner
63 files created in .hg can be written by the group
63 files created in .hg can be written by the group
64 (in particular, store/**, dirstate, branch cache file, undo files)
64 (in particular, store/**, dirstate, branch cache file, undo files)
65 new directories are setgid
65 new directories are setgid
66
66
67 $ $PYTHON ../printmodes.py .
67 $ $PYTHON ../printmodes.py .
68 00700 ./.hg/
68 00700 ./.hg/
69 00600 ./.hg/00changelog.i
69 00600 ./.hg/00changelog.i
70 00770 ./.hg/cache/
70 00770 ./.hg/cache/
71 00660 ./.hg/cache/branch2-served
71 00660 ./.hg/cache/branch2-served
72 00660 ./.hg/cache/rbc-names-v1
72 00660 ./.hg/cache/rbc-names-v1
73 00660 ./.hg/cache/rbc-revs-v1
73 00660 ./.hg/cache/rbc-revs-v1
74 00660 ./.hg/dirstate
74 00660 ./.hg/dirstate
75 00660 ./.hg/fsmonitor.state (fsmonitor !)
75 00660 ./.hg/fsmonitor.state (fsmonitor !)
76 00660 ./.hg/last-message.txt
76 00660 ./.hg/last-message.txt
77 00600 ./.hg/requires
77 00600 ./.hg/requires
78 00770 ./.hg/store/
78 00770 ./.hg/store/
79 00660 ./.hg/store/00changelog.i
79 00660 ./.hg/store/00changelog.i
80 00660 ./.hg/store/00manifest.i
80 00660 ./.hg/store/00manifest.i
81 00770 ./.hg/store/data/
81 00770 ./.hg/store/data/
82 00770 ./.hg/store/data/dir/
82 00770 ./.hg/store/data/dir/
83 00660 ./.hg/store/data/dir/bar.i
83 00660 ./.hg/store/data/dir/bar.i
84 00660 ./.hg/store/data/foo.i
84 00660 ./.hg/store/data/foo.i
85 00660 ./.hg/store/fncache
85 00660 ./.hg/store/fncache (repofncache !)
86 00660 ./.hg/store/phaseroots
86 00660 ./.hg/store/phaseroots
87 00660 ./.hg/store/undo
87 00660 ./.hg/store/undo
88 00660 ./.hg/store/undo.backupfiles
88 00660 ./.hg/store/undo.backupfiles
89 00660 ./.hg/store/undo.phaseroots
89 00660 ./.hg/store/undo.phaseroots
90 00660 ./.hg/undo.backup.dirstate
90 00660 ./.hg/undo.backup.dirstate
91 00660 ./.hg/undo.bookmarks
91 00660 ./.hg/undo.bookmarks
92 00660 ./.hg/undo.branch
92 00660 ./.hg/undo.branch
93 00660 ./.hg/undo.desc
93 00660 ./.hg/undo.desc
94 00660 ./.hg/undo.dirstate
94 00660 ./.hg/undo.dirstate
95 00700 ./dir/
95 00700 ./dir/
96 00600 ./dir/bar
96 00600 ./dir/bar
97 00600 ./foo
97 00600 ./foo
98
98
99 $ umask 007
99 $ umask 007
100 $ hg init ../push
100 $ hg init ../push
101
101
102 before push
102 before push
103 group can write everything
103 group can write everything
104
104
105 $ $PYTHON ../printmodes.py ../push
105 $ $PYTHON ../printmodes.py ../push
106 00770 ../push/.hg/
106 00770 ../push/.hg/
107 00660 ../push/.hg/00changelog.i
107 00660 ../push/.hg/00changelog.i
108 00660 ../push/.hg/requires
108 00660 ../push/.hg/requires
109 00770 ../push/.hg/store/
109 00770 ../push/.hg/store/
110
110
111 $ umask 077
111 $ umask 077
112 $ hg -q push ../push
112 $ hg -q push ../push
113
113
114 after push
114 after push
115 group can still write everything
115 group can still write everything
116
116
117 $ $PYTHON ../printmodes.py ../push
117 $ $PYTHON ../printmodes.py ../push
118 00770 ../push/.hg/
118 00770 ../push/.hg/
119 00660 ../push/.hg/00changelog.i
119 00660 ../push/.hg/00changelog.i
120 00770 ../push/.hg/cache/
120 00770 ../push/.hg/cache/
121 00660 ../push/.hg/cache/branch2-base
121 00660 ../push/.hg/cache/branch2-base
122 00660 ../push/.hg/dirstate
122 00660 ../push/.hg/dirstate
123 00660 ../push/.hg/requires
123 00660 ../push/.hg/requires
124 00770 ../push/.hg/store/
124 00770 ../push/.hg/store/
125 00660 ../push/.hg/store/00changelog.i
125 00660 ../push/.hg/store/00changelog.i
126 00660 ../push/.hg/store/00manifest.i
126 00660 ../push/.hg/store/00manifest.i
127 00770 ../push/.hg/store/data/
127 00770 ../push/.hg/store/data/
128 00770 ../push/.hg/store/data/dir/
128 00770 ../push/.hg/store/data/dir/
129 00660 ../push/.hg/store/data/dir/bar.i
129 00660 ../push/.hg/store/data/dir/bar.i
130 00660 ../push/.hg/store/data/foo.i
130 00660 ../push/.hg/store/data/foo.i
131 00660 ../push/.hg/store/fncache
131 00660 ../push/.hg/store/fncache (repofncache !)
132 00660 ../push/.hg/store/undo
132 00660 ../push/.hg/store/undo
133 00660 ../push/.hg/store/undo.backupfiles
133 00660 ../push/.hg/store/undo.backupfiles
134 00660 ../push/.hg/store/undo.phaseroots
134 00660 ../push/.hg/store/undo.phaseroots
135 00660 ../push/.hg/undo.bookmarks
135 00660 ../push/.hg/undo.bookmarks
136 00660 ../push/.hg/undo.branch
136 00660 ../push/.hg/undo.branch
137 00660 ../push/.hg/undo.desc
137 00660 ../push/.hg/undo.desc
138 00660 ../push/.hg/undo.dirstate
138 00660 ../push/.hg/undo.dirstate
139
139
140
140
141 Test that we don't lose the setgid bit when we call chmod.
141 Test that we don't lose the setgid bit when we call chmod.
142 Not all systems support setgid directories (e.g. HFS+), so
142 Not all systems support setgid directories (e.g. HFS+), so
143 just check that directories have the same mode.
143 just check that directories have the same mode.
144
144
145 $ cd ..
145 $ cd ..
146 $ hg init setgid
146 $ hg init setgid
147 $ cd setgid
147 $ cd setgid
148 $ chmod g+rwx .hg/store
148 $ chmod g+rwx .hg/store
149 $ chmod g+s .hg/store 2> /dev/null || true
149 $ chmod g+s .hg/store 2> /dev/null || true
150 $ mkdir dir
150 $ mkdir dir
151 $ touch dir/file
151 $ touch dir/file
152 $ hg ci -qAm 'add dir/file'
152 $ hg ci -qAm 'add dir/file'
153 $ storemode=`$PYTHON ../mode.py .hg/store`
153 $ storemode=`$PYTHON ../mode.py .hg/store`
154 $ dirmode=`$PYTHON ../mode.py .hg/store/data/dir`
154 $ dirmode=`$PYTHON ../mode.py .hg/store/data/dir`
155 $ if [ "$storemode" != "$dirmode" ]; then
155 $ if [ "$storemode" != "$dirmode" ]; then
156 > echo "$storemode != $dirmode"
156 > echo "$storemode != $dirmode"
157 > fi
157 > fi
158 $ cd ..
158 $ cd ..
159
159
160 $ cd .. # g-s dir
160 $ cd .. # g-s dir
@@ -1,255 +1,263 b''
1 This test tries to exercise the ssh functionality with a dummy script
1 This test tries to exercise the ssh functionality with a dummy script
2
2
3 $ checknewrepo()
3 $ checknewrepo()
4 > {
4 > {
5 > name=$1
5 > name=$1
6 > if [ -d "$name"/.hg/store ]; then
6 > if [ -d "$name"/.hg/store ]; then
7 > echo store created
7 > echo store created
8 > fi
8 > fi
9 > if [ -f "$name"/.hg/00changelog.i ]; then
9 > if [ -f "$name"/.hg/00changelog.i ]; then
10 > echo 00changelog.i created
10 > echo 00changelog.i created
11 > fi
11 > fi
12 > cat "$name"/.hg/requires
12 > cat "$name"/.hg/requires
13 > }
13 > }
14
14
15 creating 'local'
15 creating 'local'
16
16
17 $ hg init local
17 $ hg init local
18 $ checknewrepo local
18 $ checknewrepo local
19 store created
19 store created
20 00changelog.i created
20 00changelog.i created
21 dotencode
21 dotencode
22 fncache
22 fncache
23 generaldelta
23 generaldelta
24 revlogv1
24 revlogv1
25 store
25 store
26 testonly-simplestore (reposimplestore !)
26 $ echo this > local/foo
27 $ echo this > local/foo
27 $ hg ci --cwd local -A -m "init"
28 $ hg ci --cwd local -A -m "init"
28 adding foo
29 adding foo
29
30
30 test custom revlog chunk cache sizes
31 test custom revlog chunk cache sizes
31
32
32 $ hg --config format.chunkcachesize=0 log -R local -pv
33 $ hg --config format.chunkcachesize=0 log -R local -pv
33 abort: revlog chunk cache size 0 is not greater than 0!
34 abort: revlog chunk cache size 0 is not greater than 0!
34 [255]
35 [255]
35 $ hg --config format.chunkcachesize=1023 log -R local -pv
36 $ hg --config format.chunkcachesize=1023 log -R local -pv
36 abort: revlog chunk cache size 1023 is not a power of 2!
37 abort: revlog chunk cache size 1023 is not a power of 2!
37 [255]
38 [255]
38 $ hg --config format.chunkcachesize=1024 log -R local -pv
39 $ hg --config format.chunkcachesize=1024 log -R local -pv
39 changeset: 0:08b9e9f63b32
40 changeset: 0:08b9e9f63b32
40 tag: tip
41 tag: tip
41 user: test
42 user: test
42 date: Thu Jan 01 00:00:00 1970 +0000
43 date: Thu Jan 01 00:00:00 1970 +0000
43 files: foo
44 files: foo
44 description:
45 description:
45 init
46 init
46
47
47
48
48 diff -r 000000000000 -r 08b9e9f63b32 foo
49 diff -r 000000000000 -r 08b9e9f63b32 foo
49 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
50 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
50 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
51 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
51 @@ -0,0 +1,1 @@
52 @@ -0,0 +1,1 @@
52 +this
53 +this
53
54
54
55
55 creating repo with format.usestore=false
56 creating repo with format.usestore=false
56
57
57 $ hg --config format.usestore=false init old
58 $ hg --config format.usestore=false init old
58 $ checknewrepo old
59 $ checknewrepo old
59 generaldelta
60 generaldelta
60 revlogv1
61 revlogv1
62 testonly-simplestore (reposimplestore !)
61
63
62 creating repo with format.usefncache=false
64 creating repo with format.usefncache=false
63
65
64 $ hg --config format.usefncache=false init old2
66 $ hg --config format.usefncache=false init old2
65 $ checknewrepo old2
67 $ checknewrepo old2
66 store created
68 store created
67 00changelog.i created
69 00changelog.i created
68 generaldelta
70 generaldelta
69 revlogv1
71 revlogv1
70 store
72 store
73 testonly-simplestore (reposimplestore !)
71
74
72 creating repo with format.dotencode=false
75 creating repo with format.dotencode=false
73
76
74 $ hg --config format.dotencode=false init old3
77 $ hg --config format.dotencode=false init old3
75 $ checknewrepo old3
78 $ checknewrepo old3
76 store created
79 store created
77 00changelog.i created
80 00changelog.i created
78 fncache
81 fncache
79 generaldelta
82 generaldelta
80 revlogv1
83 revlogv1
81 store
84 store
85 testonly-simplestore (reposimplestore !)
82
86
83 creating repo with format.dotencode=false
87 creating repo with format.dotencode=false
84
88
85 $ hg --config format.generaldelta=false --config format.usegeneraldelta=false init old4
89 $ hg --config format.generaldelta=false --config format.usegeneraldelta=false init old4
86 $ checknewrepo old4
90 $ checknewrepo old4
87 store created
91 store created
88 00changelog.i created
92 00changelog.i created
89 dotencode
93 dotencode
90 fncache
94 fncache
91 revlogv1
95 revlogv1
92 store
96 store
97 testonly-simplestore (reposimplestore !)
93
98
94 test failure
99 test failure
95
100
96 $ hg init local
101 $ hg init local
97 abort: repository local already exists!
102 abort: repository local already exists!
98 [255]
103 [255]
99
104
100 init+push to remote2
105 init+push to remote2
101
106
102 $ hg init -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
107 $ hg init -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
103 $ hg incoming -R remote2 local
108 $ hg incoming -R remote2 local
104 comparing with local
109 comparing with local
105 changeset: 0:08b9e9f63b32
110 changeset: 0:08b9e9f63b32
106 tag: tip
111 tag: tip
107 user: test
112 user: test
108 date: Thu Jan 01 00:00:00 1970 +0000
113 date: Thu Jan 01 00:00:00 1970 +0000
109 summary: init
114 summary: init
110
115
111
116
112 $ hg push -R local -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
117 $ hg push -R local -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote2
113 pushing to ssh://user@dummy/remote2
118 pushing to ssh://user@dummy/remote2
114 searching for changes
119 searching for changes
115 remote: adding changesets
120 remote: adding changesets
116 remote: adding manifests
121 remote: adding manifests
117 remote: adding file changes
122 remote: adding file changes
118 remote: added 1 changesets with 1 changes to 1 files
123 remote: added 1 changesets with 1 changes to 1 files
119
124
120 clone to remote1
125 clone to remote1
121
126
122 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
127 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
123 searching for changes
128 searching for changes
124 remote: adding changesets
129 remote: adding changesets
125 remote: adding manifests
130 remote: adding manifests
126 remote: adding file changes
131 remote: adding file changes
127 remote: added 1 changesets with 1 changes to 1 files
132 remote: added 1 changesets with 1 changes to 1 files
128
133
129 The largefiles extension doesn't crash
134 The largefiles extension doesn't crash
130 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remotelf --config extensions.largefiles=
135 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remotelf --config extensions.largefiles=
131 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
136 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
132 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
137 The fsmonitor extension is incompatible with the largefiles extension and has been disabled. (fsmonitor !)
133 searching for changes
138 searching for changes
134 remote: adding changesets
139 remote: adding changesets
135 remote: adding manifests
140 remote: adding manifests
136 remote: adding file changes
141 remote: adding file changes
137 remote: added 1 changesets with 1 changes to 1 files
142 remote: added 1 changesets with 1 changes to 1 files
138
143
139 init to existing repo
144 init to existing repo
140
145
141 $ hg init -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
146 $ hg init -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/remote1
142 abort: repository remote1 already exists!
147 abort: repository remote1 already exists!
143 abort: could not create remote repo!
148 abort: could not create remote repo!
144 [255]
149 [255]
145
150
146 clone to existing repo
151 clone to existing repo
147
152
148 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
153 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote1
149 abort: repository remote1 already exists!
154 abort: repository remote1 already exists!
150 abort: could not create remote repo!
155 abort: could not create remote repo!
151 [255]
156 [255]
152
157
153 output of dummyssh
158 output of dummyssh
154
159
155 $ cat dummylog
160 $ cat dummylog
156 Got arguments 1:user@dummy 2:hg init remote2
161 Got arguments 1:user@dummy 2:hg init remote2
157 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
162 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
158 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
163 Got arguments 1:user@dummy 2:hg -R remote2 serve --stdio
159 Got arguments 1:user@dummy 2:hg init remote1
164 Got arguments 1:user@dummy 2:hg init remote1
160 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
165 Got arguments 1:user@dummy 2:hg -R remote1 serve --stdio
161 Got arguments 1:user@dummy 2:hg init remotelf
166 Got arguments 1:user@dummy 2:hg init remotelf
162 Got arguments 1:user@dummy 2:hg -R remotelf serve --stdio
167 Got arguments 1:user@dummy 2:hg -R remotelf serve --stdio
163 Got arguments 1:user@dummy 2:hg init remote1
168 Got arguments 1:user@dummy 2:hg init remote1
164 Got arguments 1:user@dummy 2:hg init remote1
169 Got arguments 1:user@dummy 2:hg init remote1
165
170
166 comparing repositories
171 comparing repositories
167
172
168 $ hg tip -q -R local
173 $ hg tip -q -R local
169 0:08b9e9f63b32
174 0:08b9e9f63b32
170 $ hg tip -q -R remote1
175 $ hg tip -q -R remote1
171 0:08b9e9f63b32
176 0:08b9e9f63b32
172 $ hg tip -q -R remote2
177 $ hg tip -q -R remote2
173 0:08b9e9f63b32
178 0:08b9e9f63b32
174
179
175 check names for repositories (clashes with URL schemes, special chars)
180 check names for repositories (clashes with URL schemes, special chars)
176
181
177 $ for i in bundle file hg http https old-http ssh static-http "with space"; do
182 $ for i in bundle file hg http https old-http ssh static-http "with space"; do
178 > printf "hg init \"$i\"... "
183 > printf "hg init \"$i\"... "
179 > hg init "$i"
184 > hg init "$i"
180 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
185 > test -d "$i" -a -d "$i/.hg" && echo "ok" || echo "failed"
181 > done
186 > done
182 hg init "bundle"... ok
187 hg init "bundle"... ok
183 hg init "file"... ok
188 hg init "file"... ok
184 hg init "hg"... ok
189 hg init "hg"... ok
185 hg init "http"... ok
190 hg init "http"... ok
186 hg init "https"... ok
191 hg init "https"... ok
187 hg init "old-http"... ok
192 hg init "old-http"... ok
188 hg init "ssh"... ok
193 hg init "ssh"... ok
189 hg init "static-http"... ok
194 hg init "static-http"... ok
190 hg init "with space"... ok
195 hg init "with space"... ok
191 #if eol-in-paths
196 #if eol-in-paths
192 /* " " is not a valid name for a directory on Windows */
197 /* " " is not a valid name for a directory on Windows */
193 $ hg init " "
198 $ hg init " "
194 $ test -d " "
199 $ test -d " "
195 $ test -d " /.hg"
200 $ test -d " /.hg"
196 #endif
201 #endif
197
202
198 creating 'local/sub/repo'
203 creating 'local/sub/repo'
199
204
200 $ hg init local/sub/repo
205 $ hg init local/sub/repo
201 $ checknewrepo local/sub/repo
206 $ checknewrepo local/sub/repo
202 store created
207 store created
203 00changelog.i created
208 00changelog.i created
204 dotencode
209 dotencode
205 fncache
210 fncache
206 generaldelta
211 generaldelta
207 revlogv1
212 revlogv1
208 store
213 store
214 testonly-simplestore (reposimplestore !)
209
215
210 prepare test of init of url configured from paths
216 prepare test of init of url configured from paths
211
217
212 $ echo '[paths]' >> $HGRCPATH
218 $ echo '[paths]' >> $HGRCPATH
213 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
219 $ echo "somewhere = `pwd`/url from paths" >> $HGRCPATH
214 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
220 $ echo "elsewhere = `pwd`/another paths url" >> $HGRCPATH
215
221
216 init should (for consistency with clone) expand the url
222 init should (for consistency with clone) expand the url
217
223
218 $ hg init somewhere
224 $ hg init somewhere
219 $ checknewrepo "url from paths"
225 $ checknewrepo "url from paths"
220 store created
226 store created
221 00changelog.i created
227 00changelog.i created
222 dotencode
228 dotencode
223 fncache
229 fncache
224 generaldelta
230 generaldelta
225 revlogv1
231 revlogv1
226 store
232 store
233 testonly-simplestore (reposimplestore !)
227
234
228 verify that clone also expand urls
235 verify that clone also expand urls
229
236
230 $ hg clone somewhere elsewhere
237 $ hg clone somewhere elsewhere
231 updating to branch default
238 updating to branch default
232 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
239 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
233 $ checknewrepo "another paths url"
240 $ checknewrepo "another paths url"
234 store created
241 store created
235 00changelog.i created
242 00changelog.i created
236 dotencode
243 dotencode
237 fncache
244 fncache
238 generaldelta
245 generaldelta
239 revlogv1
246 revlogv1
240 store
247 store
248 testonly-simplestore (reposimplestore !)
241
249
242 clone bookmarks
250 clone bookmarks
243
251
244 $ hg -R local bookmark test
252 $ hg -R local bookmark test
245 $ hg -R local bookmarks
253 $ hg -R local bookmarks
246 * test 0:08b9e9f63b32
254 * test 0:08b9e9f63b32
247 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
255 $ hg clone -e "\"$PYTHON\" \"$TESTDIR/dummyssh\"" local ssh://user@dummy/remote-bookmarks
248 searching for changes
256 searching for changes
249 remote: adding changesets
257 remote: adding changesets
250 remote: adding manifests
258 remote: adding manifests
251 remote: adding file changes
259 remote: adding file changes
252 remote: added 1 changesets with 1 changes to 1 files
260 remote: added 1 changesets with 1 changes to 1 files
253 exporting bookmark test
261 exporting bookmark test
254 $ hg -R remote-bookmarks bookmarks
262 $ hg -R remote-bookmarks bookmarks
255 test 0:08b9e9f63b32
263 test 0:08b9e9f63b32
@@ -1,130 +1,131 b''
1 $ . "$TESTDIR/narrow-library.sh"
1 $ . "$TESTDIR/narrow-library.sh"
2
2
3 $ hg init master
3 $ hg init master
4 $ cd master
4 $ cd master
5 $ mkdir dir
5 $ mkdir dir
6 $ mkdir dir/src
6 $ mkdir dir/src
7 $ cd dir/src
7 $ cd dir/src
8 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done
8 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done
9 $ cd ..
9 $ cd ..
10 $ mkdir tests
10 $ mkdir tests
11 $ cd tests
11 $ cd tests
12 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done
12 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done
13 $ cd ../../..
13 $ cd ../../..
14
14
15 narrow clone a file, f10
15 narrow clone a file, f10
16
16
17 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10"
17 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10"
18 requesting all changes
18 requesting all changes
19 adding changesets
19 adding changesets
20 adding manifests
20 adding manifests
21 adding file changes
21 adding file changes
22 added 40 changesets with 1 changes to 1 files
22 added 40 changesets with 1 changes to 1 files
23 new changesets *:* (glob)
23 new changesets *:* (glob)
24 $ cd narrow
24 $ cd narrow
25 $ cat .hg/requires | grep -v generaldelta
25 $ cat .hg/requires | grep -v generaldelta
26 dotencode
26 dotencode
27 fncache
27 fncache
28 narrowhg-experimental
28 narrowhg-experimental
29 revlogv1
29 revlogv1
30 store
30 store
31 testonly-simplestore (reposimplestore !)
31
32
32 $ cat .hg/narrowspec
33 $ cat .hg/narrowspec
33 [includes]
34 [includes]
34 path:dir/src/f10
35 path:dir/src/f10
35 [excludes]
36 [excludes]
36 $ hg update
37 $ hg update
37 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
38 $ find * | sort
39 $ find * | sort
39 dir
40 dir
40 dir/src
41 dir/src
41 dir/src/f10
42 dir/src/f10
42 $ cat dir/src/f10
43 $ cat dir/src/f10
43 10
44 10
44
45
45 $ cd ..
46 $ cd ..
46
47
47 narrow clone a directory, tests/, except tests/t19
48 narrow clone a directory, tests/, except tests/t19
48
49
49 $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19"
50 $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19"
50 requesting all changes
51 requesting all changes
51 adding changesets
52 adding changesets
52 adding manifests
53 adding manifests
53 adding file changes
54 adding file changes
54 added 40 changesets with 19 changes to 19 files
55 added 40 changesets with 19 changes to 19 files
55 new changesets *:* (glob)
56 new changesets *:* (glob)
56 $ cd narrowdir
57 $ cd narrowdir
57 $ cat .hg/narrowspec
58 $ cat .hg/narrowspec
58 [includes]
59 [includes]
59 path:dir/tests
60 path:dir/tests
60 [excludes]
61 [excludes]
61 path:dir/tests/t19
62 path:dir/tests/t19
62 $ hg update
63 $ hg update
63 19 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 19 files updated, 0 files merged, 0 files removed, 0 files unresolved
64 $ find * | sort
65 $ find * | sort
65 dir
66 dir
66 dir/tests
67 dir/tests
67 dir/tests/t1
68 dir/tests/t1
68 dir/tests/t10
69 dir/tests/t10
69 dir/tests/t11
70 dir/tests/t11
70 dir/tests/t12
71 dir/tests/t12
71 dir/tests/t13
72 dir/tests/t13
72 dir/tests/t14
73 dir/tests/t14
73 dir/tests/t15
74 dir/tests/t15
74 dir/tests/t16
75 dir/tests/t16
75 dir/tests/t17
76 dir/tests/t17
76 dir/tests/t18
77 dir/tests/t18
77 dir/tests/t2
78 dir/tests/t2
78 dir/tests/t20
79 dir/tests/t20
79 dir/tests/t3
80 dir/tests/t3
80 dir/tests/t4
81 dir/tests/t4
81 dir/tests/t5
82 dir/tests/t5
82 dir/tests/t6
83 dir/tests/t6
83 dir/tests/t7
84 dir/tests/t7
84 dir/tests/t8
85 dir/tests/t8
85 dir/tests/t9
86 dir/tests/t9
86
87
87 $ cd ..
88 $ cd ..
88
89
89 narrow clone everything but a directory (tests/)
90 narrow clone everything but a directory (tests/)
90
91
91 $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests"
92 $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests"
92 requesting all changes
93 requesting all changes
93 adding changesets
94 adding changesets
94 adding manifests
95 adding manifests
95 adding file changes
96 adding file changes
96 added 40 changesets with 20 changes to 20 files
97 added 40 changesets with 20 changes to 20 files
97 new changesets *:* (glob)
98 new changesets *:* (glob)
98 $ cd narrowroot
99 $ cd narrowroot
99 $ cat .hg/narrowspec
100 $ cat .hg/narrowspec
100 [includes]
101 [includes]
101 path:.
102 path:.
102 [excludes]
103 [excludes]
103 path:dir/tests
104 path:dir/tests
104 $ hg update
105 $ hg update
105 20 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 20 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 $ find * | sort
107 $ find * | sort
107 dir
108 dir
108 dir/src
109 dir/src
109 dir/src/f1
110 dir/src/f1
110 dir/src/f10
111 dir/src/f10
111 dir/src/f11
112 dir/src/f11
112 dir/src/f12
113 dir/src/f12
113 dir/src/f13
114 dir/src/f13
114 dir/src/f14
115 dir/src/f14
115 dir/src/f15
116 dir/src/f15
116 dir/src/f16
117 dir/src/f16
117 dir/src/f17
118 dir/src/f17
118 dir/src/f18
119 dir/src/f18
119 dir/src/f19
120 dir/src/f19
120 dir/src/f2
121 dir/src/f2
121 dir/src/f20
122 dir/src/f20
122 dir/src/f3
123 dir/src/f3
123 dir/src/f4
124 dir/src/f4
124 dir/src/f5
125 dir/src/f5
125 dir/src/f6
126 dir/src/f6
126 dir/src/f7
127 dir/src/f7
127 dir/src/f8
128 dir/src/f8
128 dir/src/f9
129 dir/src/f9
129
130
130 $ cd ..
131 $ cd ..
@@ -1,225 +1,226 b''
1 $ . "$TESTDIR/narrow-library.sh"
1 $ . "$TESTDIR/narrow-library.sh"
2
2
3 $ hg init master
3 $ hg init master
4 $ cd master
4 $ cd master
5 $ cat >> .hg/hgrc <<EOF
5 $ cat >> .hg/hgrc <<EOF
6 > [narrow]
6 > [narrow]
7 > serveellipses=True
7 > serveellipses=True
8 > EOF
8 > EOF
9 $ mkdir dir
9 $ mkdir dir
10 $ mkdir dir/src
10 $ mkdir dir/src
11 $ cd dir/src
11 $ cd dir/src
12 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done
12 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "f$x"; hg add "f$x"; hg commit -m "Commit src $x"; done
13 $ cd ..
13 $ cd ..
14 $ mkdir tests
14 $ mkdir tests
15 $ cd tests
15 $ cd tests
16 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done
16 $ for x in `$TESTDIR/seq.py 20`; do echo $x > "t$x"; hg add "t$x"; hg commit -m "Commit test $x"; done
17 $ cd ../../..
17 $ cd ../../..
18
18
19 narrow clone a file, f10
19 narrow clone a file, f10
20
20
21 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10"
21 $ hg clone --narrow ssh://user@dummy/master narrow --noupdate --include "dir/src/f10"
22 requesting all changes
22 requesting all changes
23 adding changesets
23 adding changesets
24 adding manifests
24 adding manifests
25 adding file changes
25 adding file changes
26 added 3 changesets with 1 changes to 1 files
26 added 3 changesets with 1 changes to 1 files
27 new changesets *:* (glob)
27 new changesets *:* (glob)
28 $ cd narrow
28 $ cd narrow
29 $ cat .hg/requires | grep -v generaldelta
29 $ cat .hg/requires | grep -v generaldelta
30 dotencode
30 dotencode
31 fncache
31 fncache
32 narrowhg-experimental
32 narrowhg-experimental
33 revlogv1
33 revlogv1
34 store
34 store
35 testonly-simplestore (reposimplestore !)
35
36
36 $ cat .hg/narrowspec
37 $ cat .hg/narrowspec
37 [includes]
38 [includes]
38 path:dir/src/f10
39 path:dir/src/f10
39 [excludes]
40 [excludes]
40 $ hg tracked
41 $ hg tracked
41 I path:dir/src/f10
42 I path:dir/src/f10
42 $ hg update
43 $ hg update
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 $ find * | sort
45 $ find * | sort
45 dir
46 dir
46 dir/src
47 dir/src
47 dir/src/f10
48 dir/src/f10
48 $ cat dir/src/f10
49 $ cat dir/src/f10
49 10
50 10
50
51
51 $ cd ..
52 $ cd ..
52
53
53 narrow clone with a newline should fail
54 narrow clone with a newline should fail
54
55
55 $ hg clone --narrow ssh://user@dummy/master narrow_fail --noupdate --include 'dir/src/f10
56 $ hg clone --narrow ssh://user@dummy/master narrow_fail --noupdate --include 'dir/src/f10
56 > '
57 > '
57 requesting all changes
58 requesting all changes
58 abort: newlines are not allowed in narrowspec paths
59 abort: newlines are not allowed in narrowspec paths
59 [255]
60 [255]
60
61
61 narrow clone a directory, tests/, except tests/t19
62 narrow clone a directory, tests/, except tests/t19
62
63
63 $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19"
64 $ hg clone --narrow ssh://user@dummy/master narrowdir --noupdate --include "dir/tests/" --exclude "dir/tests/t19"
64 requesting all changes
65 requesting all changes
65 adding changesets
66 adding changesets
66 adding manifests
67 adding manifests
67 adding file changes
68 adding file changes
68 added 21 changesets with 19 changes to 19 files
69 added 21 changesets with 19 changes to 19 files
69 new changesets *:* (glob)
70 new changesets *:* (glob)
70 $ cd narrowdir
71 $ cd narrowdir
71 $ cat .hg/narrowspec
72 $ cat .hg/narrowspec
72 [includes]
73 [includes]
73 path:dir/tests
74 path:dir/tests
74 [excludes]
75 [excludes]
75 path:dir/tests/t19
76 path:dir/tests/t19
76 $ hg tracked
77 $ hg tracked
77 I path:dir/tests
78 I path:dir/tests
78 X path:dir/tests/t19
79 X path:dir/tests/t19
79 $ hg update
80 $ hg update
80 19 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 19 files updated, 0 files merged, 0 files removed, 0 files unresolved
81 $ find * | sort
82 $ find * | sort
82 dir
83 dir
83 dir/tests
84 dir/tests
84 dir/tests/t1
85 dir/tests/t1
85 dir/tests/t10
86 dir/tests/t10
86 dir/tests/t11
87 dir/tests/t11
87 dir/tests/t12
88 dir/tests/t12
88 dir/tests/t13
89 dir/tests/t13
89 dir/tests/t14
90 dir/tests/t14
90 dir/tests/t15
91 dir/tests/t15
91 dir/tests/t16
92 dir/tests/t16
92 dir/tests/t17
93 dir/tests/t17
93 dir/tests/t18
94 dir/tests/t18
94 dir/tests/t2
95 dir/tests/t2
95 dir/tests/t20
96 dir/tests/t20
96 dir/tests/t3
97 dir/tests/t3
97 dir/tests/t4
98 dir/tests/t4
98 dir/tests/t5
99 dir/tests/t5
99 dir/tests/t6
100 dir/tests/t6
100 dir/tests/t7
101 dir/tests/t7
101 dir/tests/t8
102 dir/tests/t8
102 dir/tests/t9
103 dir/tests/t9
103
104
104 $ cd ..
105 $ cd ..
105
106
106 narrow clone everything but a directory (tests/)
107 narrow clone everything but a directory (tests/)
107
108
108 $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests"
109 $ hg clone --narrow ssh://user@dummy/master narrowroot --noupdate --exclude "dir/tests"
109 requesting all changes
110 requesting all changes
110 adding changesets
111 adding changesets
111 adding manifests
112 adding manifests
112 adding file changes
113 adding file changes
113 added 21 changesets with 20 changes to 20 files
114 added 21 changesets with 20 changes to 20 files
114 new changesets *:* (glob)
115 new changesets *:* (glob)
115 $ cd narrowroot
116 $ cd narrowroot
116 $ cat .hg/narrowspec
117 $ cat .hg/narrowspec
117 [includes]
118 [includes]
118 path:.
119 path:.
119 [excludes]
120 [excludes]
120 path:dir/tests
121 path:dir/tests
121 $ hg tracked
122 $ hg tracked
122 I path:.
123 I path:.
123 X path:dir/tests
124 X path:dir/tests
124 $ hg update
125 $ hg update
125 20 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 20 files updated, 0 files merged, 0 files removed, 0 files unresolved
126 $ find * | sort
127 $ find * | sort
127 dir
128 dir
128 dir/src
129 dir/src
129 dir/src/f1
130 dir/src/f1
130 dir/src/f10
131 dir/src/f10
131 dir/src/f11
132 dir/src/f11
132 dir/src/f12
133 dir/src/f12
133 dir/src/f13
134 dir/src/f13
134 dir/src/f14
135 dir/src/f14
135 dir/src/f15
136 dir/src/f15
136 dir/src/f16
137 dir/src/f16
137 dir/src/f17
138 dir/src/f17
138 dir/src/f18
139 dir/src/f18
139 dir/src/f19
140 dir/src/f19
140 dir/src/f2
141 dir/src/f2
141 dir/src/f20
142 dir/src/f20
142 dir/src/f3
143 dir/src/f3
143 dir/src/f4
144 dir/src/f4
144 dir/src/f5
145 dir/src/f5
145 dir/src/f6
146 dir/src/f6
146 dir/src/f7
147 dir/src/f7
147 dir/src/f8
148 dir/src/f8
148 dir/src/f9
149 dir/src/f9
149
150
150 $ cd ..
151 $ cd ..
151
152
152 narrow clone no paths at all
153 narrow clone no paths at all
153
154
154 $ hg clone --narrow ssh://user@dummy/master narrowempty --noupdate
155 $ hg clone --narrow ssh://user@dummy/master narrowempty --noupdate
155 requesting all changes
156 requesting all changes
156 adding changesets
157 adding changesets
157 adding manifests
158 adding manifests
158 adding file changes
159 adding file changes
159 added 1 changesets with 0 changes to 0 files
160 added 1 changesets with 0 changes to 0 files
160 new changesets * (glob)
161 new changesets * (glob)
161 $ cd narrowempty
162 $ cd narrowempty
162 $ hg tracked
163 $ hg tracked
163 $ hg update
164 $ hg update
164 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
165 $ ls
166 $ ls
166
167
167 $ cd ..
168 $ cd ..
168
169
169 simple clone
170 simple clone
170 $ hg clone ssh://user@dummy/master simpleclone
171 $ hg clone ssh://user@dummy/master simpleclone
171 requesting all changes
172 requesting all changes
172 adding changesets
173 adding changesets
173 adding manifests
174 adding manifests
174 adding file changes
175 adding file changes
175 added 40 changesets with 40 changes to 40 files
176 added 40 changesets with 40 changes to 40 files
176 new changesets * (glob)
177 new changesets * (glob)
177 updating to branch default
178 updating to branch default
178 40 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 40 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 $ cd simpleclone
180 $ cd simpleclone
180 $ find * | sort
181 $ find * | sort
181 dir
182 dir
182 dir/src
183 dir/src
183 dir/src/f1
184 dir/src/f1
184 dir/src/f10
185 dir/src/f10
185 dir/src/f11
186 dir/src/f11
186 dir/src/f12
187 dir/src/f12
187 dir/src/f13
188 dir/src/f13
188 dir/src/f14
189 dir/src/f14
189 dir/src/f15
190 dir/src/f15
190 dir/src/f16
191 dir/src/f16
191 dir/src/f17
192 dir/src/f17
192 dir/src/f18
193 dir/src/f18
193 dir/src/f19
194 dir/src/f19
194 dir/src/f2
195 dir/src/f2
195 dir/src/f20
196 dir/src/f20
196 dir/src/f3
197 dir/src/f3
197 dir/src/f4
198 dir/src/f4
198 dir/src/f5
199 dir/src/f5
199 dir/src/f6
200 dir/src/f6
200 dir/src/f7
201 dir/src/f7
201 dir/src/f8
202 dir/src/f8
202 dir/src/f9
203 dir/src/f9
203 dir/tests
204 dir/tests
204 dir/tests/t1
205 dir/tests/t1
205 dir/tests/t10
206 dir/tests/t10
206 dir/tests/t11
207 dir/tests/t11
207 dir/tests/t12
208 dir/tests/t12
208 dir/tests/t13
209 dir/tests/t13
209 dir/tests/t14
210 dir/tests/t14
210 dir/tests/t15
211 dir/tests/t15
211 dir/tests/t16
212 dir/tests/t16
212 dir/tests/t17
213 dir/tests/t17
213 dir/tests/t18
214 dir/tests/t18
214 dir/tests/t19
215 dir/tests/t19
215 dir/tests/t2
216 dir/tests/t2
216 dir/tests/t20
217 dir/tests/t20
217 dir/tests/t3
218 dir/tests/t3
218 dir/tests/t4
219 dir/tests/t4
219 dir/tests/t5
220 dir/tests/t5
220 dir/tests/t6
221 dir/tests/t6
221 dir/tests/t7
222 dir/tests/t7
222 dir/tests/t8
223 dir/tests/t8
223 dir/tests/t9
224 dir/tests/t9
224
225
225 $ cd ..
226 $ cd ..
@@ -1,392 +1,402 b''
1 #testcases flat tree
1 #testcases flat tree
2
2
3 $ . "$TESTDIR/narrow-library.sh"
3 $ . "$TESTDIR/narrow-library.sh"
4
4
5 #if tree
5 #if tree
6 $ cat << EOF >> $HGRCPATH
6 $ cat << EOF >> $HGRCPATH
7 > [experimental]
7 > [experimental]
8 > treemanifest = 1
8 > treemanifest = 1
9 > EOF
9 > EOF
10 #endif
10 #endif
11
11
12 $ hg init master
12 $ hg init master
13 $ cd master
13 $ cd master
14 $ cat >> .hg/hgrc <<EOF
14 $ cat >> .hg/hgrc <<EOF
15 > [narrow]
15 > [narrow]
16 > serveellipses=True
16 > serveellipses=True
17 > EOF
17 > EOF
18 $ for x in `$TESTDIR/seq.py 0 10`
18 $ for x in `$TESTDIR/seq.py 0 10`
19 > do
19 > do
20 > mkdir d$x
20 > mkdir d$x
21 > echo $x > d$x/f
21 > echo $x > d$x/f
22 > hg add d$x/f
22 > hg add d$x/f
23 > hg commit -m "add d$x/f"
23 > hg commit -m "add d$x/f"
24 > done
24 > done
25 $ hg log -T "{node|short}: {desc}\n"
25 $ hg log -T "{node|short}: {desc}\n"
26 *: add d10/f (glob)
26 *: add d10/f (glob)
27 *: add d9/f (glob)
27 *: add d9/f (glob)
28 *: add d8/f (glob)
28 *: add d8/f (glob)
29 *: add d7/f (glob)
29 *: add d7/f (glob)
30 *: add d6/f (glob)
30 *: add d6/f (glob)
31 *: add d5/f (glob)
31 *: add d5/f (glob)
32 *: add d4/f (glob)
32 *: add d4/f (glob)
33 *: add d3/f (glob)
33 *: add d3/f (glob)
34 *: add d2/f (glob)
34 *: add d2/f (glob)
35 *: add d1/f (glob)
35 *: add d1/f (glob)
36 *: add d0/f (glob)
36 *: add d0/f (glob)
37 $ cd ..
37 $ cd ..
38
38
39 Error if '.' or '..' are in the directory to track.
39 Error if '.' or '..' are in the directory to track.
40 $ hg clone --narrow ssh://user@dummy/master foo --include ./asdf
40 $ hg clone --narrow ssh://user@dummy/master foo --include ./asdf
41 requesting all changes
41 requesting all changes
42 abort: "." and ".." are not allowed in narrowspec paths
42 abort: "." and ".." are not allowed in narrowspec paths
43 [255]
43 [255]
44 $ hg clone --narrow ssh://user@dummy/master foo --include asdf/..
44 $ hg clone --narrow ssh://user@dummy/master foo --include asdf/..
45 requesting all changes
45 requesting all changes
46 abort: "." and ".." are not allowed in narrowspec paths
46 abort: "." and ".." are not allowed in narrowspec paths
47 [255]
47 [255]
48 $ hg clone --narrow ssh://user@dummy/master foo --include a/./c
48 $ hg clone --narrow ssh://user@dummy/master foo --include a/./c
49 requesting all changes
49 requesting all changes
50 abort: "." and ".." are not allowed in narrowspec paths
50 abort: "." and ".." are not allowed in narrowspec paths
51 [255]
51 [255]
52
52
53 Names with '.' in them are OK.
53 Names with '.' in them are OK.
54 $ hg clone --narrow ssh://user@dummy/master should-work --include a/.b/c
54 $ hg clone --narrow ssh://user@dummy/master should-work --include a/.b/c
55 requesting all changes
55 requesting all changes
56 adding changesets
56 adding changesets
57 adding manifests
57 adding manifests
58 adding file changes
58 adding file changes
59 added 1 changesets with 0 changes to 0 files
59 added 1 changesets with 0 changes to 0 files
60 new changesets * (glob)
60 new changesets * (glob)
61 updating to branch default
61 updating to branch default
62 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
62 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
63
63
64 Test repo with local changes
64 Test repo with local changes
65 $ hg clone --narrow ssh://user@dummy/master narrow-local-changes --include d0 --include d3 --include d6
65 $ hg clone --narrow ssh://user@dummy/master narrow-local-changes --include d0 --include d3 --include d6
66 requesting all changes
66 requesting all changes
67 adding changesets
67 adding changesets
68 adding manifests
68 adding manifests
69 adding file changes
69 adding file changes
70 added 6 changesets with 3 changes to 3 files
70 added 6 changesets with 3 changes to 3 files
71 new changesets *:* (glob)
71 new changesets *:* (glob)
72 updating to branch default
72 updating to branch default
73 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
73 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
74 $ cd narrow-local-changes
74 $ cd narrow-local-changes
75 $ cat >> $HGRCPATH << EOF
75 $ cat >> $HGRCPATH << EOF
76 > [experimental]
76 > [experimental]
77 > evolution=createmarkers
77 > evolution=createmarkers
78 > EOF
78 > EOF
79 $ echo local change >> d0/f
79 $ echo local change >> d0/f
80 $ hg ci -m 'local change to d0'
80 $ hg ci -m 'local change to d0'
81 $ hg co '.^'
81 $ hg co '.^'
82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
82 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 $ echo local change >> d3/f
83 $ echo local change >> d3/f
84 $ hg ci -m 'local hidden change to d3'
84 $ hg ci -m 'local hidden change to d3'
85 created new head
85 created new head
86 $ hg ci --amend -m 'local change to d3'
86 $ hg ci --amend -m 'local change to d3'
87 $ hg tracked --removeinclude d0
87 $ hg tracked --removeinclude d0
88 comparing with ssh://user@dummy/master
88 comparing with ssh://user@dummy/master
89 searching for changes
89 searching for changes
90 looking for local changes to affected paths
90 looking for local changes to affected paths
91 The following changeset(s) or their ancestors have local changes not on the remote:
91 The following changeset(s) or their ancestors have local changes not on the remote:
92 * (glob)
92 * (glob)
93 abort: local changes found
93 abort: local changes found
94 (use --force-delete-local-changes to ignore)
94 (use --force-delete-local-changes to ignore)
95 [255]
95 [255]
96 Check that nothing was removed by the failed attempts
96 Check that nothing was removed by the failed attempts
97 $ hg tracked
97 $ hg tracked
98 I path:d0
98 I path:d0
99 I path:d3
99 I path:d3
100 I path:d6
100 I path:d6
101 $ hg files
101 $ hg files
102 d0/f
102 d0/f
103 d3/f
103 d3/f
104 d6/f
104 d6/f
105 $ find *
105 $ find *
106 d0
106 d0
107 d0/f
107 d0/f
108 d3
108 d3
109 d3/f
109 d3/f
110 d6
110 d6
111 d6/f
111 d6/f
112 $ hg verify -q
112 $ hg verify -q
113 Force deletion of local changes
113 Force deletion of local changes
114 $ hg log -T "{node|short}: {desc} {outsidenarrow}\n"
114 $ hg log -T "{node|short}: {desc} {outsidenarrow}\n"
115 *: local change to d3 (glob)
115 *: local change to d3 (glob)
116 *: local change to d0 (glob)
116 *: local change to d0 (glob)
117 *: add d10/f outsidenarrow (glob)
117 *: add d10/f outsidenarrow (glob)
118 *: add d6/f (glob)
118 *: add d6/f (glob)
119 *: add d5/f outsidenarrow (glob)
119 *: add d5/f outsidenarrow (glob)
120 *: add d3/f (glob)
120 *: add d3/f (glob)
121 *: add d2/f outsidenarrow (glob)
121 *: add d2/f outsidenarrow (glob)
122 *: add d0/f (glob)
122 *: add d0/f (glob)
123 $ hg tracked --removeinclude d0 --force-delete-local-changes
123 $ hg tracked --removeinclude d0 --force-delete-local-changes
124 comparing with ssh://user@dummy/master
124 comparing with ssh://user@dummy/master
125 searching for changes
125 searching for changes
126 looking for local changes to affected paths
126 looking for local changes to affected paths
127 The following changeset(s) or their ancestors have local changes not on the remote:
127 The following changeset(s) or their ancestors have local changes not on the remote:
128 * (glob)
128 * (glob)
129 saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
129 saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
130 deleting data/d0/f.i (reporevlogstore !)
130 deleting data/d0/f.i (reporevlogstore !)
131 deleting meta/d0/00manifest.i (tree !)
131 deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
132 deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
132 deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !)
133 deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !)
133 deleting data/d0/f/index (reposimplestore !)
134 deleting data/d0/f/index (reposimplestore !)
134 deleting meta/d0/00manifest.i (tree !)
135
135
136 $ hg log -T "{node|short}: {desc} {outsidenarrow}\n"
136 $ hg log -T "{node|short}: {desc} {outsidenarrow}\n"
137 *: local change to d3 (glob)
137 *: local change to d3 (glob)
138 *: add d10/f outsidenarrow (glob)
138 *: add d10/f outsidenarrow (glob)
139 *: add d6/f (glob)
139 *: add d6/f (glob)
140 *: add d5/f outsidenarrow (glob)
140 *: add d5/f outsidenarrow (glob)
141 *: add d3/f (glob)
141 *: add d3/f (glob)
142 *: add d2/f outsidenarrow (glob)
142 *: add d2/f outsidenarrow (glob)
143 *: add d0/f outsidenarrow (glob)
143 *: add d0/f outsidenarrow (glob)
144 Can restore stripped local changes after widening
144 Can restore stripped local changes after widening
145 $ hg tracked --addinclude d0 -q
145 $ hg tracked --addinclude d0 -q
146 $ hg unbundle .hg/strip-backup/*-narrow.hg -q
146 $ hg unbundle .hg/strip-backup/*-narrow.hg -q
147 $ hg --hidden co -r 'desc("local change to d0")' -q
147 $ hg --hidden co -r 'desc("local change to d0")' -q
148 $ cat d0/f
148 $ cat d0/f
149 0
149 0
150 local change
150 local change
151 Pruned commits affecting removed paths should not prevent narrowing
151 Pruned commits affecting removed paths should not prevent narrowing
152 $ hg co '.^'
152 $ hg co '.^'
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
154 $ hg debugobsolete `hg log -T '{node}' -r 'desc("local change to d0")'`
154 $ hg debugobsolete `hg log -T '{node}' -r 'desc("local change to d0")'`
155 obsoleted 1 changesets
155 obsoleted 1 changesets
156 $ hg tracked --removeinclude d0
156 $ hg tracked --removeinclude d0
157 comparing with ssh://user@dummy/master
157 comparing with ssh://user@dummy/master
158 searching for changes
158 searching for changes
159 looking for local changes to affected paths
159 looking for local changes to affected paths
160 saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
160 saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
161 deleting data/d0/f.i (reporevlogstore !)
161 deleting data/d0/f.i (reporevlogstore !)
162 deleting meta/d0/00manifest.i (tree !)
162 deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
163 deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
163 deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !)
164 deleting data/d0/f/4374b5650fc5ae54ac857c0f0381971fdde376f7 (reposimplestore !)
164 deleting data/d0/f/index (reposimplestore !)
165 deleting data/d0/f/index (reposimplestore !)
165 deleting meta/d0/00manifest.i (tree !)
166
166
167 Updates off of stripped commit if necessary
167 Updates off of stripped commit if necessary
168 $ hg co -r 'desc("local change to d3")' -q
168 $ hg co -r 'desc("local change to d3")' -q
169 $ echo local change >> d6/f
169 $ echo local change >> d6/f
170 $ hg ci -m 'local change to d6'
170 $ hg ci -m 'local change to d6'
171 $ hg tracked --removeinclude d3 --force-delete-local-changes
171 $ hg tracked --removeinclude d3 --force-delete-local-changes
172 comparing with ssh://user@dummy/master
172 comparing with ssh://user@dummy/master
173 searching for changes
173 searching for changes
174 looking for local changes to affected paths
174 looking for local changes to affected paths
175 The following changeset(s) or their ancestors have local changes not on the remote:
175 The following changeset(s) or their ancestors have local changes not on the remote:
176 * (glob)
176 * (glob)
177 * (glob)
177 * (glob)
178 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
178 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
179 saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
179 saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
180 deleting data/d3/f.i (reporevlogstore !)
180 deleting data/d3/f.i (reporevlogstore !)
181 deleting meta/d3/00manifest.i (tree !)
181 deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
182 deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
182 deleting data/d3/f/99fa7136105a15e2045ce3d9152e4837c5349e4d (reposimplestore !)
183 deleting data/d3/f/99fa7136105a15e2045ce3d9152e4837c5349e4d (reposimplestore !)
183 deleting data/d3/f/index (reposimplestore !)
184 deleting data/d3/f/index (reposimplestore !)
184 deleting meta/d3/00manifest.i (tree !)
185 $ hg log -T '{desc}\n' -r .
185 $ hg log -T '{desc}\n' -r .
186 add d10/f
186 add d10/f
187 Updates to nullid if necessary
187 Updates to nullid if necessary
188 $ hg tracked --addinclude d3 -q
188 $ hg tracked --addinclude d3 -q
189 $ hg co null -q
189 $ hg co null -q
190 $ mkdir d3
190 $ mkdir d3
191 $ echo local change > d3/f
191 $ echo local change > d3/f
192 $ hg add d3/f
192 $ hg add d3/f
193 $ hg ci -m 'local change to d3'
193 $ hg ci -m 'local change to d3'
194 created new head
194 created new head
195 $ hg tracked --removeinclude d3 --force-delete-local-changes
195 $ hg tracked --removeinclude d3 --force-delete-local-changes
196 comparing with ssh://user@dummy/master
196 comparing with ssh://user@dummy/master
197 searching for changes
197 searching for changes
198 looking for local changes to affected paths
198 looking for local changes to affected paths
199 The following changeset(s) or their ancestors have local changes not on the remote:
199 The following changeset(s) or their ancestors have local changes not on the remote:
200 * (glob)
200 * (glob)
201 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
201 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
202 saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
202 saved backup bundle to $TESTTMP/narrow-local-changes/.hg/strip-backup/*-narrow.hg (glob)
203 deleting data/d3/f.i (reporevlogstore !)
203 deleting data/d3/f.i (reporevlogstore !)
204 deleting meta/d3/00manifest.i (tree !)
204 deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
205 deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
205 deleting data/d3/f/5ce0767945cbdbca3b924bb9fbf5143f72ab40ac (reposimplestore !)
206 deleting data/d3/f/5ce0767945cbdbca3b924bb9fbf5143f72ab40ac (reposimplestore !)
206 deleting data/d3/f/index (reposimplestore !)
207 deleting data/d3/f/index (reposimplestore !)
207 deleting meta/d3/00manifest.i (tree !)
208 $ hg id
208 $ hg id
209 000000000000
209 000000000000
210 $ cd ..
210 $ cd ..
211
211
212 Can remove last include, making repo empty
212 Can remove last include, making repo empty
213 $ hg clone --narrow ssh://user@dummy/master narrow-empty --include d0 -r 5
213 $ hg clone --narrow ssh://user@dummy/master narrow-empty --include d0 -r 5
214 adding changesets
214 adding changesets
215 adding manifests
215 adding manifests
216 adding file changes
216 adding file changes
217 added 2 changesets with 1 changes to 1 files
217 added 2 changesets with 1 changes to 1 files
218 new changesets *:* (glob)
218 new changesets *:* (glob)
219 updating to branch default
219 updating to branch default
220 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
220 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
221 $ cd narrow-empty
221 $ cd narrow-empty
222 $ hg tracked --removeinclude d0
222 $ hg tracked --removeinclude d0
223 comparing with ssh://user@dummy/master
223 comparing with ssh://user@dummy/master
224 searching for changes
224 searching for changes
225 looking for local changes to affected paths
225 looking for local changes to affected paths
226 deleting data/d0/f.i (reporevlogstore !)
226 deleting data/d0/f.i (reporevlogstore !)
227 deleting meta/d0/00manifest.i (tree !)
227 deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
228 deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
228 deleting data/d0/f/index (reposimplestore !)
229 deleting data/d0/f/index (reposimplestore !)
229 deleting meta/d0/00manifest.i (tree !)
230 $ hg tracked
230 $ hg tracked
231 $ hg files
231 $ hg files
232 [1]
232 [1]
233 $ test -d d0
233 $ test -d d0
234 [1]
234 [1]
235 Do some work in the empty clone
235 Do some work in the empty clone
236 $ hg diff --change .
236 $ hg diff --change .
237 $ hg branch foo
237 $ hg branch foo
238 marked working directory as branch foo
238 marked working directory as branch foo
239 (branches are permanent and global, did you want a bookmark?)
239 (branches are permanent and global, did you want a bookmark?)
240 $ hg ci -m empty
240 $ hg ci -m empty
241 $ hg pull -q
241 $ hg pull -q
242 Can widen the empty clone
242 Can widen the empty clone
243 $ hg tracked --addinclude d0
243 $ hg tracked --addinclude d0
244 comparing with ssh://user@dummy/master
244 comparing with ssh://user@dummy/master
245 searching for changes
245 searching for changes
246 no changes found
246 no changes found
247 saved backup bundle to $TESTTMP/narrow-empty/.hg/strip-backup/*-widen.hg (glob)
247 saved backup bundle to $TESTTMP/narrow-empty/.hg/strip-backup/*-widen.hg (glob)
248 adding changesets
248 adding changesets
249 adding manifests
249 adding manifests
250 adding file changes
250 adding file changes
251 added 3 changesets with 1 changes to 1 files
251 added 3 changesets with 1 changes to 1 files
252 new changesets *:* (glob)
252 new changesets *:* (glob)
253 $ hg tracked
253 $ hg tracked
254 I path:d0
254 I path:d0
255 $ hg files
255 $ hg files
256 d0/f
256 d0/f
257 $ find *
257 $ find *
258 d0
258 d0
259 d0/f
259 d0/f
260 $ cd ..
260 $ cd ..
261
261
262 TODO(martinvonz): test including e.g. d3/g and then removing it once
262 TODO(martinvonz): test including e.g. d3/g and then removing it once
263 https://bitbucket.org/Google/narrowhg/issues/6 is fixed
263 https://bitbucket.org/Google/narrowhg/issues/6 is fixed
264
264
265 $ hg clone --narrow ssh://user@dummy/master narrow --include d0 --include d3 --include d6 --include d9
265 $ hg clone --narrow ssh://user@dummy/master narrow --include d0 --include d3 --include d6 --include d9
266 requesting all changes
266 requesting all changes
267 adding changesets
267 adding changesets
268 adding manifests
268 adding manifests
269 adding file changes
269 adding file changes
270 added 8 changesets with 4 changes to 4 files
270 added 8 changesets with 4 changes to 4 files
271 new changesets *:* (glob)
271 new changesets *:* (glob)
272 updating to branch default
272 updating to branch default
273 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
273 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
274 $ cd narrow
274 $ cd narrow
275 $ hg tracked
275 $ hg tracked
276 I path:d0
276 I path:d0
277 I path:d3
277 I path:d3
278 I path:d6
278 I path:d6
279 I path:d9
279 I path:d9
280 $ hg tracked --removeinclude d6
280 $ hg tracked --removeinclude d6
281 comparing with ssh://user@dummy/master
281 comparing with ssh://user@dummy/master
282 searching for changes
282 searching for changes
283 looking for local changes to affected paths
283 looking for local changes to affected paths
284 deleting data/d6/f.i (reporevlogstore !)
284 deleting data/d6/f.i (reporevlogstore !)
285 deleting meta/d6/00manifest.i (tree !)
285 deleting data/d6/f/7339d30678f451ac8c3f38753beeb4cf2e1655c7 (reposimplestore !)
286 deleting data/d6/f/7339d30678f451ac8c3f38753beeb4cf2e1655c7 (reposimplestore !)
286 deleting data/d6/f/index (reposimplestore !)
287 deleting data/d6/f/index (reposimplestore !)
287 deleting meta/d6/00manifest.i (tree !)
288 $ hg tracked
288 $ hg tracked
289 I path:d0
289 I path:d0
290 I path:d3
290 I path:d3
291 I path:d9
291 I path:d9
292 #if repofncache
292 $ hg debugrebuildfncache
293 $ hg debugrebuildfncache
293 fncache already up to date
294 fncache already up to date
295 #endif
294 $ find *
296 $ find *
295 d0
297 d0
296 d0/f
298 d0/f
297 d3
299 d3
298 d3/f
300 d3/f
299 d9
301 d9
300 d9/f
302 d9/f
301 $ hg verify -q
303 $ hg verify -q
302 $ hg tracked --addexclude d3/f
304 $ hg tracked --addexclude d3/f
303 comparing with ssh://user@dummy/master
305 comparing with ssh://user@dummy/master
304 searching for changes
306 searching for changes
305 looking for local changes to affected paths
307 looking for local changes to affected paths
306 deleting data/d3/f.i (reporevlogstore !)
308 deleting data/d3/f.i (reporevlogstore !)
309 deleting data/d3/f/2661d26c649684b482d10f91960cc3db683c38b4 (reposimplestore !)
310 deleting data/d3/f/index (reposimplestore !)
307 $ hg tracked
311 $ hg tracked
308 I path:d0
312 I path:d0
309 I path:d3
313 I path:d3
310 I path:d9
314 I path:d9
311 X path:d3/f
315 X path:d3/f
316 #if repofncache
312 $ hg debugrebuildfncache
317 $ hg debugrebuildfncache
313 fncache already up to date
318 fncache already up to date
319 #endif
314 $ find *
320 $ find *
315 d0
321 d0
316 d0/f
322 d0/f
317 d9
323 d9
318 d9/f
324 d9/f
319 $ hg verify -q
325 $ hg verify -q
320 $ hg tracked --addexclude d0
326 $ hg tracked --addexclude d0
321 comparing with ssh://user@dummy/master
327 comparing with ssh://user@dummy/master
322 searching for changes
328 searching for changes
323 looking for local changes to affected paths
329 looking for local changes to affected paths
324 deleting data/d0/f.i (reporevlogstore !)
330 deleting data/d0/f.i (reporevlogstore !)
325 deleting meta/d0/00manifest.i (tree !)
331 deleting meta/d0/00manifest.i (tree !)
332 deleting data/d0/f/362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (reposimplestore !)
333 deleting data/d0/f/index (reposimplestore !)
326 $ hg tracked
334 $ hg tracked
327 I path:d3
335 I path:d3
328 I path:d9
336 I path:d9
329 X path:d0
337 X path:d0
330 X path:d3/f
338 X path:d3/f
339 #if repofncache
331 $ hg debugrebuildfncache
340 $ hg debugrebuildfncache
332 fncache already up to date
341 fncache already up to date
342 #endif
333 $ find *
343 $ find *
334 d9
344 d9
335 d9/f
345 d9/f
336
346
337 Make a 15 of changes to d9 to test the path without --verbose
347 Make a 15 of changes to d9 to test the path without --verbose
338 (Note: using regexes instead of "* (glob)" because if the test fails, it
348 (Note: using regexes instead of "* (glob)" because if the test fails, it
339 produces more sensible diffs)
349 produces more sensible diffs)
340 $ hg tracked
350 $ hg tracked
341 I path:d3
351 I path:d3
342 I path:d9
352 I path:d9
343 X path:d0
353 X path:d0
344 X path:d3/f
354 X path:d3/f
345 $ for x in `$TESTDIR/seq.py 1 15`
355 $ for x in `$TESTDIR/seq.py 1 15`
346 > do
356 > do
347 > echo local change >> d9/f
357 > echo local change >> d9/f
348 > hg commit -m "change $x to d9/f"
358 > hg commit -m "change $x to d9/f"
349 > done
359 > done
350 $ hg tracked --removeinclude d9
360 $ hg tracked --removeinclude d9
351 comparing with ssh://user@dummy/master
361 comparing with ssh://user@dummy/master
352 searching for changes
362 searching for changes
353 looking for local changes to affected paths
363 looking for local changes to affected paths
354 The following changeset(s) or their ancestors have local changes not on the remote:
364 The following changeset(s) or their ancestors have local changes not on the remote:
355 ^[0-9a-f]{12}$ (re)
365 ^[0-9a-f]{12}$ (re)
356 ^[0-9a-f]{12}$ (re)
366 ^[0-9a-f]{12}$ (re)
357 ^[0-9a-f]{12}$ (re)
367 ^[0-9a-f]{12}$ (re)
358 ^[0-9a-f]{12}$ (re)
368 ^[0-9a-f]{12}$ (re)
359 ^[0-9a-f]{12}$ (re)
369 ^[0-9a-f]{12}$ (re)
360 ^[0-9a-f]{12}$ (re)
370 ^[0-9a-f]{12}$ (re)
361 ^[0-9a-f]{12}$ (re)
371 ^[0-9a-f]{12}$ (re)
362 ^[0-9a-f]{12}$ (re)
372 ^[0-9a-f]{12}$ (re)
363 ^[0-9a-f]{12}$ (re)
373 ^[0-9a-f]{12}$ (re)
364 ^[0-9a-f]{12}$ (re)
374 ^[0-9a-f]{12}$ (re)
365 ...and 5 more, use --verbose to list all
375 ...and 5 more, use --verbose to list all
366 abort: local changes found
376 abort: local changes found
367 (use --force-delete-local-changes to ignore)
377 (use --force-delete-local-changes to ignore)
368 [255]
378 [255]
369 Now test it *with* verbose.
379 Now test it *with* verbose.
370 $ hg tracked --removeinclude d9 --verbose
380 $ hg tracked --removeinclude d9 --verbose
371 comparing with ssh://user@dummy/master
381 comparing with ssh://user@dummy/master
372 searching for changes
382 searching for changes
373 looking for local changes to affected paths
383 looking for local changes to affected paths
374 The following changeset(s) or their ancestors have local changes not on the remote:
384 The following changeset(s) or their ancestors have local changes not on the remote:
375 ^[0-9a-f]{12}$ (re)
385 ^[0-9a-f]{12}$ (re)
376 ^[0-9a-f]{12}$ (re)
386 ^[0-9a-f]{12}$ (re)
377 ^[0-9a-f]{12}$ (re)
387 ^[0-9a-f]{12}$ (re)
378 ^[0-9a-f]{12}$ (re)
388 ^[0-9a-f]{12}$ (re)
379 ^[0-9a-f]{12}$ (re)
389 ^[0-9a-f]{12}$ (re)
380 ^[0-9a-f]{12}$ (re)
390 ^[0-9a-f]{12}$ (re)
381 ^[0-9a-f]{12}$ (re)
391 ^[0-9a-f]{12}$ (re)
382 ^[0-9a-f]{12}$ (re)
392 ^[0-9a-f]{12}$ (re)
383 ^[0-9a-f]{12}$ (re)
393 ^[0-9a-f]{12}$ (re)
384 ^[0-9a-f]{12}$ (re)
394 ^[0-9a-f]{12}$ (re)
385 ^[0-9a-f]{12}$ (re)
395 ^[0-9a-f]{12}$ (re)
386 ^[0-9a-f]{12}$ (re)
396 ^[0-9a-f]{12}$ (re)
387 ^[0-9a-f]{12}$ (re)
397 ^[0-9a-f]{12}$ (re)
388 ^[0-9a-f]{12}$ (re)
398 ^[0-9a-f]{12}$ (re)
389 ^[0-9a-f]{12}$ (re)
399 ^[0-9a-f]{12}$ (re)
390 abort: local changes found
400 abort: local changes found
391 (use --force-delete-local-changes to ignore)
401 (use --force-delete-local-changes to ignore)
392 [255]
402 [255]
@@ -1,78 +1,81 b''
1 A new repository uses zlib storage, which doesn't need a requirement
1 A new repository uses zlib storage, which doesn't need a requirement
2
2
3 $ hg init default
3 $ hg init default
4 $ cd default
4 $ cd default
5 $ cat .hg/requires
5 $ cat .hg/requires
6 dotencode
6 dotencode
7 fncache
7 fncache
8 generaldelta
8 generaldelta
9 revlogv1
9 revlogv1
10 store
10 store
11 testonly-simplestore (reposimplestore !)
11
12
12 $ touch foo
13 $ touch foo
13 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression'
14 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text to trigger compression'
14 $ hg debugrevlog -c | grep 0x78
15 $ hg debugrevlog -c | grep 0x78
15 0x78 (x) : 1 (100.00%)
16 0x78 (x) : 1 (100.00%)
16 0x78 (x) : 110 (100.00%)
17 0x78 (x) : 110 (100.00%)
17
18
18 $ cd ..
19 $ cd ..
19
20
20 Unknown compression engine to format.compression aborts
21 Unknown compression engine to format.compression aborts
21
22
22 $ hg --config experimental.format.compression=unknown init unknown
23 $ hg --config experimental.format.compression=unknown init unknown
23 abort: compression engine unknown defined by experimental.format.compression not available
24 abort: compression engine unknown defined by experimental.format.compression not available
24 (run "hg debuginstall" to list available compression engines)
25 (run "hg debuginstall" to list available compression engines)
25 [255]
26 [255]
26
27
27 A requirement specifying an unknown compression engine results in bail
28 A requirement specifying an unknown compression engine results in bail
28
29
29 $ hg init unknownrequirement
30 $ hg init unknownrequirement
30 $ cd unknownrequirement
31 $ cd unknownrequirement
31 $ echo exp-compression-unknown >> .hg/requires
32 $ echo exp-compression-unknown >> .hg/requires
32 $ hg log
33 $ hg log
33 abort: repository requires features unknown to this Mercurial: exp-compression-unknown!
34 abort: repository requires features unknown to this Mercurial: exp-compression-unknown!
34 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
35 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
35 [255]
36 [255]
36
37
37 $ cd ..
38 $ cd ..
38
39
39 #if zstd
40 #if zstd
40
41
41 $ hg --config experimental.format.compression=zstd init zstd
42 $ hg --config experimental.format.compression=zstd init zstd
42 $ cd zstd
43 $ cd zstd
43 $ cat .hg/requires
44 $ cat .hg/requires
44 dotencode
45 dotencode
45 exp-compression-zstd
46 exp-compression-zstd
46 fncache
47 fncache
47 generaldelta
48 generaldelta
48 revlogv1
49 revlogv1
49 store
50 store
51 testonly-simplestore (reposimplestore !)
50
52
51 $ touch foo
53 $ touch foo
52 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text'
54 $ hg -q commit -A -m 'initial commit with a lot of repeated repeated repeated text'
53
55
54 $ hg debugrevlog -c | grep 0x28
56 $ hg debugrevlog -c | grep 0x28
55 0x28 : 1 (100.00%)
57 0x28 : 1 (100.00%)
56 0x28 : 98 (100.00%)
58 0x28 : 98 (100.00%)
57
59
58 $ cd ..
60 $ cd ..
59
61
60 Specifying a new format.compression on an existing repo won't introduce data
62 Specifying a new format.compression on an existing repo won't introduce data
61 with that engine or a requirement
63 with that engine or a requirement
62
64
63 $ cd default
65 $ cd default
64 $ touch bar
66 $ touch bar
65 $ hg --config experimental.format.compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text'
67 $ hg --config experimental.format.compression=zstd -q commit -A -m 'add bar with a lot of repeated repeated repeated text'
66
68
67 $ cat .hg/requires
69 $ cat .hg/requires
68 dotencode
70 dotencode
69 fncache
71 fncache
70 generaldelta
72 generaldelta
71 revlogv1
73 revlogv1
72 store
74 store
75 testonly-simplestore (reposimplestore !)
73
76
74 $ hg debugrevlog -c | grep 0x78
77 $ hg debugrevlog -c | grep 0x78
75 0x78 (x) : 2 (100.00%)
78 0x78 (x) : 2 (100.00%)
76 0x78 (x) : 199 (100.00%)
79 0x78 (x) : 199 (100.00%)
77
80
78 #endif
81 #endif
@@ -1,65 +1,68 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3
3
4 $ touch a.html b.html c.py d.py
4 $ touch a.html b.html c.py d.py
5
5
6 $ cat > frontend.sparse << EOF
6 $ cat > frontend.sparse << EOF
7 > [include]
7 > [include]
8 > *.html
8 > *.html
9 > EOF
9 > EOF
10
10
11 $ hg -q commit -A -m initial
11 $ hg -q commit -A -m initial
12
12
13 $ echo 1 > a.html
13 $ echo 1 > a.html
14 $ echo 1 > c.py
14 $ echo 1 > c.py
15 $ hg commit -m 'commit 1'
15 $ hg commit -m 'commit 1'
16
16
17 Enable sparse profile
17 Enable sparse profile
18
18
19 $ cat .hg/requires
19 $ cat .hg/requires
20 dotencode
20 dotencode
21 fncache
21 fncache
22 generaldelta
22 generaldelta
23 revlogv1
23 revlogv1
24 store
24 store
25 testonly-simplestore (reposimplestore !)
25
26
26 $ hg debugsparse --config extensions.sparse= --enable-profile frontend.sparse
27 $ hg debugsparse --config extensions.sparse= --enable-profile frontend.sparse
27 $ ls
28 $ ls
28 a.html
29 a.html
29 b.html
30 b.html
30
31
31 Requirement for sparse added when sparse is enabled
32 Requirement for sparse added when sparse is enabled
32
33
33 $ cat .hg/requires
34 $ cat .hg/requires
34 dotencode
35 dotencode
35 exp-sparse
36 exp-sparse
36 fncache
37 fncache
37 generaldelta
38 generaldelta
38 revlogv1
39 revlogv1
39 store
40 store
41 testonly-simplestore (reposimplestore !)
40
42
41 Client without sparse enabled reacts properly
43 Client without sparse enabled reacts properly
42
44
43 $ hg files
45 $ hg files
44 abort: repository is using sparse feature but sparse is not enabled; enable the "sparse" extensions to access!
46 abort: repository is using sparse feature but sparse is not enabled; enable the "sparse" extensions to access!
45 [255]
47 [255]
46
48
47 Requirement for sparse is removed when sparse is disabled
49 Requirement for sparse is removed when sparse is disabled
48
50
49 $ hg debugsparse --reset --config extensions.sparse=
51 $ hg debugsparse --reset --config extensions.sparse=
50
52
51 $ cat .hg/requires
53 $ cat .hg/requires
52 dotencode
54 dotencode
53 fncache
55 fncache
54 generaldelta
56 generaldelta
55 revlogv1
57 revlogv1
56 store
58 store
59 testonly-simplestore (reposimplestore !)
57
60
58 And client without sparse can access
61 And client without sparse can access
59
62
60 $ hg files
63 $ hg files
61 a.html
64 a.html
62 b.html
65 b.html
63 c.py
66 c.py
64 d.py
67 d.py
65 frontend.sparse
68 frontend.sparse
@@ -1,1336 +1,1340 b''
1 $ echo "[extensions]" >> $HGRCPATH
1 $ echo "[extensions]" >> $HGRCPATH
2 $ echo "strip=" >> $HGRCPATH
2 $ echo "strip=" >> $HGRCPATH
3 $ echo "drawdag=$TESTDIR/drawdag.py" >> $HGRCPATH
3 $ echo "drawdag=$TESTDIR/drawdag.py" >> $HGRCPATH
4
4
5 $ restore() {
5 $ restore() {
6 > hg unbundle -q .hg/strip-backup/*
6 > hg unbundle -q .hg/strip-backup/*
7 > rm .hg/strip-backup/*
7 > rm .hg/strip-backup/*
8 > }
8 > }
9 $ teststrip() {
9 $ teststrip() {
10 > hg up -C $1
10 > hg up -C $1
11 > echo % before update $1, strip $2
11 > echo % before update $1, strip $2
12 > hg parents
12 > hg parents
13 > hg --traceback strip $2
13 > hg --traceback strip $2
14 > echo % after update $1, strip $2
14 > echo % after update $1, strip $2
15 > hg parents
15 > hg parents
16 > restore
16 > restore
17 > }
17 > }
18
18
19 $ hg init test
19 $ hg init test
20 $ cd test
20 $ cd test
21
21
22 $ echo foo > bar
22 $ echo foo > bar
23 $ hg ci -Ama
23 $ hg ci -Ama
24 adding bar
24 adding bar
25
25
26 $ echo more >> bar
26 $ echo more >> bar
27 $ hg ci -Amb
27 $ hg ci -Amb
28
28
29 $ echo blah >> bar
29 $ echo blah >> bar
30 $ hg ci -Amc
30 $ hg ci -Amc
31
31
32 $ hg up 1
32 $ hg up 1
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
33 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
34 $ echo blah >> bar
34 $ echo blah >> bar
35 $ hg ci -Amd
35 $ hg ci -Amd
36 created new head
36 created new head
37
37
38 $ echo final >> bar
38 $ echo final >> bar
39 $ hg ci -Ame
39 $ hg ci -Ame
40
40
41 $ hg log
41 $ hg log
42 changeset: 4:443431ffac4f
42 changeset: 4:443431ffac4f
43 tag: tip
43 tag: tip
44 user: test
44 user: test
45 date: Thu Jan 01 00:00:00 1970 +0000
45 date: Thu Jan 01 00:00:00 1970 +0000
46 summary: e
46 summary: e
47
47
48 changeset: 3:65bd5f99a4a3
48 changeset: 3:65bd5f99a4a3
49 parent: 1:ef3a871183d7
49 parent: 1:ef3a871183d7
50 user: test
50 user: test
51 date: Thu Jan 01 00:00:00 1970 +0000
51 date: Thu Jan 01 00:00:00 1970 +0000
52 summary: d
52 summary: d
53
53
54 changeset: 2:264128213d29
54 changeset: 2:264128213d29
55 user: test
55 user: test
56 date: Thu Jan 01 00:00:00 1970 +0000
56 date: Thu Jan 01 00:00:00 1970 +0000
57 summary: c
57 summary: c
58
58
59 changeset: 1:ef3a871183d7
59 changeset: 1:ef3a871183d7
60 user: test
60 user: test
61 date: Thu Jan 01 00:00:00 1970 +0000
61 date: Thu Jan 01 00:00:00 1970 +0000
62 summary: b
62 summary: b
63
63
64 changeset: 0:9ab35a2d17cb
64 changeset: 0:9ab35a2d17cb
65 user: test
65 user: test
66 date: Thu Jan 01 00:00:00 1970 +0000
66 date: Thu Jan 01 00:00:00 1970 +0000
67 summary: a
67 summary: a
68
68
69
69
70 $ teststrip 4 4
70 $ teststrip 4 4
71 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
71 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
72 % before update 4, strip 4
72 % before update 4, strip 4
73 changeset: 4:443431ffac4f
73 changeset: 4:443431ffac4f
74 tag: tip
74 tag: tip
75 user: test
75 user: test
76 date: Thu Jan 01 00:00:00 1970 +0000
76 date: Thu Jan 01 00:00:00 1970 +0000
77 summary: e
77 summary: e
78
78
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
79 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
80 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
81 % after update 4, strip 4
81 % after update 4, strip 4
82 changeset: 3:65bd5f99a4a3
82 changeset: 3:65bd5f99a4a3
83 tag: tip
83 tag: tip
84 parent: 1:ef3a871183d7
84 parent: 1:ef3a871183d7
85 user: test
85 user: test
86 date: Thu Jan 01 00:00:00 1970 +0000
86 date: Thu Jan 01 00:00:00 1970 +0000
87 summary: d
87 summary: d
88
88
89 $ teststrip 4 3
89 $ teststrip 4 3
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
90 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
91 % before update 4, strip 3
91 % before update 4, strip 3
92 changeset: 4:443431ffac4f
92 changeset: 4:443431ffac4f
93 tag: tip
93 tag: tip
94 user: test
94 user: test
95 date: Thu Jan 01 00:00:00 1970 +0000
95 date: Thu Jan 01 00:00:00 1970 +0000
96 summary: e
96 summary: e
97
97
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
98 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
99 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
99 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
100 % after update 4, strip 3
100 % after update 4, strip 3
101 changeset: 1:ef3a871183d7
101 changeset: 1:ef3a871183d7
102 user: test
102 user: test
103 date: Thu Jan 01 00:00:00 1970 +0000
103 date: Thu Jan 01 00:00:00 1970 +0000
104 summary: b
104 summary: b
105
105
106 $ teststrip 1 4
106 $ teststrip 1 4
107 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
107 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
108 % before update 1, strip 4
108 % before update 1, strip 4
109 changeset: 1:ef3a871183d7
109 changeset: 1:ef3a871183d7
110 user: test
110 user: test
111 date: Thu Jan 01 00:00:00 1970 +0000
111 date: Thu Jan 01 00:00:00 1970 +0000
112 summary: b
112 summary: b
113
113
114 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
114 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
115 % after update 1, strip 4
115 % after update 1, strip 4
116 changeset: 1:ef3a871183d7
116 changeset: 1:ef3a871183d7
117 user: test
117 user: test
118 date: Thu Jan 01 00:00:00 1970 +0000
118 date: Thu Jan 01 00:00:00 1970 +0000
119 summary: b
119 summary: b
120
120
121 $ teststrip 4 2
121 $ teststrip 4 2
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
122 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
123 % before update 4, strip 2
123 % before update 4, strip 2
124 changeset: 4:443431ffac4f
124 changeset: 4:443431ffac4f
125 tag: tip
125 tag: tip
126 user: test
126 user: test
127 date: Thu Jan 01 00:00:00 1970 +0000
127 date: Thu Jan 01 00:00:00 1970 +0000
128 summary: e
128 summary: e
129
129
130 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
130 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
131 % after update 4, strip 2
131 % after update 4, strip 2
132 changeset: 3:443431ffac4f
132 changeset: 3:443431ffac4f
133 tag: tip
133 tag: tip
134 user: test
134 user: test
135 date: Thu Jan 01 00:00:00 1970 +0000
135 date: Thu Jan 01 00:00:00 1970 +0000
136 summary: e
136 summary: e
137
137
138 $ teststrip 4 1
138 $ teststrip 4 1
139 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
139 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 % before update 4, strip 1
140 % before update 4, strip 1
141 changeset: 4:264128213d29
141 changeset: 4:264128213d29
142 tag: tip
142 tag: tip
143 parent: 1:ef3a871183d7
143 parent: 1:ef3a871183d7
144 user: test
144 user: test
145 date: Thu Jan 01 00:00:00 1970 +0000
145 date: Thu Jan 01 00:00:00 1970 +0000
146 summary: c
146 summary: c
147
147
148 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
148 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
149 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
150 % after update 4, strip 1
150 % after update 4, strip 1
151 changeset: 0:9ab35a2d17cb
151 changeset: 0:9ab35a2d17cb
152 tag: tip
152 tag: tip
153 user: test
153 user: test
154 date: Thu Jan 01 00:00:00 1970 +0000
154 date: Thu Jan 01 00:00:00 1970 +0000
155 summary: a
155 summary: a
156
156
157 $ teststrip null 4
157 $ teststrip null 4
158 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
158 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
159 % before update null, strip 4
159 % before update null, strip 4
160 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
160 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
161 % after update null, strip 4
161 % after update null, strip 4
162
162
163 $ hg log
163 $ hg log
164 changeset: 4:264128213d29
164 changeset: 4:264128213d29
165 tag: tip
165 tag: tip
166 parent: 1:ef3a871183d7
166 parent: 1:ef3a871183d7
167 user: test
167 user: test
168 date: Thu Jan 01 00:00:00 1970 +0000
168 date: Thu Jan 01 00:00:00 1970 +0000
169 summary: c
169 summary: c
170
170
171 changeset: 3:443431ffac4f
171 changeset: 3:443431ffac4f
172 user: test
172 user: test
173 date: Thu Jan 01 00:00:00 1970 +0000
173 date: Thu Jan 01 00:00:00 1970 +0000
174 summary: e
174 summary: e
175
175
176 changeset: 2:65bd5f99a4a3
176 changeset: 2:65bd5f99a4a3
177 user: test
177 user: test
178 date: Thu Jan 01 00:00:00 1970 +0000
178 date: Thu Jan 01 00:00:00 1970 +0000
179 summary: d
179 summary: d
180
180
181 changeset: 1:ef3a871183d7
181 changeset: 1:ef3a871183d7
182 user: test
182 user: test
183 date: Thu Jan 01 00:00:00 1970 +0000
183 date: Thu Jan 01 00:00:00 1970 +0000
184 summary: b
184 summary: b
185
185
186 changeset: 0:9ab35a2d17cb
186 changeset: 0:9ab35a2d17cb
187 user: test
187 user: test
188 date: Thu Jan 01 00:00:00 1970 +0000
188 date: Thu Jan 01 00:00:00 1970 +0000
189 summary: a
189 summary: a
190
190
191 $ hg up -C 4
191 $ hg up -C 4
192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 $ hg parents
193 $ hg parents
194 changeset: 4:264128213d29
194 changeset: 4:264128213d29
195 tag: tip
195 tag: tip
196 parent: 1:ef3a871183d7
196 parent: 1:ef3a871183d7
197 user: test
197 user: test
198 date: Thu Jan 01 00:00:00 1970 +0000
198 date: Thu Jan 01 00:00:00 1970 +0000
199 summary: c
199 summary: c
200
200
201
201
202 $ hg --traceback strip 4
202 $ hg --traceback strip 4
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
204 saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg
204 saved backup bundle to $TESTTMP/test/.hg/strip-backup/264128213d29-0b39d6bf-backup.hg
205 $ hg parents
205 $ hg parents
206 changeset: 1:ef3a871183d7
206 changeset: 1:ef3a871183d7
207 user: test
207 user: test
208 date: Thu Jan 01 00:00:00 1970 +0000
208 date: Thu Jan 01 00:00:00 1970 +0000
209 summary: b
209 summary: b
210
210
211 $ hg debugbundle .hg/strip-backup/*
211 $ hg debugbundle .hg/strip-backup/*
212 Stream params: {Compression: BZ}
212 Stream params: {Compression: BZ}
213 changegroup -- {nbchanges: 1, version: 02}
213 changegroup -- {nbchanges: 1, version: 02}
214 264128213d290d868c54642d13aeaa3675551a78
214 264128213d290d868c54642d13aeaa3675551a78
215 cache:rev-branch-cache -- {}
215 cache:rev-branch-cache -- {}
216 phase-heads -- {}
216 phase-heads -- {}
217 264128213d290d868c54642d13aeaa3675551a78 draft
217 264128213d290d868c54642d13aeaa3675551a78 draft
218 $ hg unbundle .hg/strip-backup/*
218 $ hg unbundle .hg/strip-backup/*
219 adding changesets
219 adding changesets
220 adding manifests
220 adding manifests
221 adding file changes
221 adding file changes
222 added 1 changesets with 0 changes to 1 files (+1 heads)
222 added 1 changesets with 0 changes to 1 files (+1 heads)
223 new changesets 264128213d29
223 new changesets 264128213d29
224 (run 'hg heads' to see heads, 'hg merge' to merge)
224 (run 'hg heads' to see heads, 'hg merge' to merge)
225 $ rm .hg/strip-backup/*
225 $ rm .hg/strip-backup/*
226 $ hg log --graph
226 $ hg log --graph
227 o changeset: 4:264128213d29
227 o changeset: 4:264128213d29
228 | tag: tip
228 | tag: tip
229 | parent: 1:ef3a871183d7
229 | parent: 1:ef3a871183d7
230 | user: test
230 | user: test
231 | date: Thu Jan 01 00:00:00 1970 +0000
231 | date: Thu Jan 01 00:00:00 1970 +0000
232 | summary: c
232 | summary: c
233 |
233 |
234 | o changeset: 3:443431ffac4f
234 | o changeset: 3:443431ffac4f
235 | | user: test
235 | | user: test
236 | | date: Thu Jan 01 00:00:00 1970 +0000
236 | | date: Thu Jan 01 00:00:00 1970 +0000
237 | | summary: e
237 | | summary: e
238 | |
238 | |
239 | o changeset: 2:65bd5f99a4a3
239 | o changeset: 2:65bd5f99a4a3
240 |/ user: test
240 |/ user: test
241 | date: Thu Jan 01 00:00:00 1970 +0000
241 | date: Thu Jan 01 00:00:00 1970 +0000
242 | summary: d
242 | summary: d
243 |
243 |
244 @ changeset: 1:ef3a871183d7
244 @ changeset: 1:ef3a871183d7
245 | user: test
245 | user: test
246 | date: Thu Jan 01 00:00:00 1970 +0000
246 | date: Thu Jan 01 00:00:00 1970 +0000
247 | summary: b
247 | summary: b
248 |
248 |
249 o changeset: 0:9ab35a2d17cb
249 o changeset: 0:9ab35a2d17cb
250 user: test
250 user: test
251 date: Thu Jan 01 00:00:00 1970 +0000
251 date: Thu Jan 01 00:00:00 1970 +0000
252 summary: a
252 summary: a
253
253
254 $ hg up -C 2
254 $ hg up -C 2
255 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 $ hg merge 4
256 $ hg merge 4
257 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 (branch merge, don't forget to commit)
258 (branch merge, don't forget to commit)
259
259
260 before strip of merge parent
260 before strip of merge parent
261
261
262 $ hg parents
262 $ hg parents
263 changeset: 2:65bd5f99a4a3
263 changeset: 2:65bd5f99a4a3
264 user: test
264 user: test
265 date: Thu Jan 01 00:00:00 1970 +0000
265 date: Thu Jan 01 00:00:00 1970 +0000
266 summary: d
266 summary: d
267
267
268 changeset: 4:264128213d29
268 changeset: 4:264128213d29
269 tag: tip
269 tag: tip
270 parent: 1:ef3a871183d7
270 parent: 1:ef3a871183d7
271 user: test
271 user: test
272 date: Thu Jan 01 00:00:00 1970 +0000
272 date: Thu Jan 01 00:00:00 1970 +0000
273 summary: c
273 summary: c
274
274
275 $ hg strip 4
275 $ hg strip 4
276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
277 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
278
278
279 after strip of merge parent
279 after strip of merge parent
280
280
281 $ hg parents
281 $ hg parents
282 changeset: 1:ef3a871183d7
282 changeset: 1:ef3a871183d7
283 user: test
283 user: test
284 date: Thu Jan 01 00:00:00 1970 +0000
284 date: Thu Jan 01 00:00:00 1970 +0000
285 summary: b
285 summary: b
286
286
287 $ restore
287 $ restore
288
288
289 $ hg up
289 $ hg up
290 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
290 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
291 updated to "264128213d29: c"
291 updated to "264128213d29: c"
292 1 other heads for branch "default"
292 1 other heads for branch "default"
293 $ hg log -G
293 $ hg log -G
294 @ changeset: 4:264128213d29
294 @ changeset: 4:264128213d29
295 | tag: tip
295 | tag: tip
296 | parent: 1:ef3a871183d7
296 | parent: 1:ef3a871183d7
297 | user: test
297 | user: test
298 | date: Thu Jan 01 00:00:00 1970 +0000
298 | date: Thu Jan 01 00:00:00 1970 +0000
299 | summary: c
299 | summary: c
300 |
300 |
301 | o changeset: 3:443431ffac4f
301 | o changeset: 3:443431ffac4f
302 | | user: test
302 | | user: test
303 | | date: Thu Jan 01 00:00:00 1970 +0000
303 | | date: Thu Jan 01 00:00:00 1970 +0000
304 | | summary: e
304 | | summary: e
305 | |
305 | |
306 | o changeset: 2:65bd5f99a4a3
306 | o changeset: 2:65bd5f99a4a3
307 |/ user: test
307 |/ user: test
308 | date: Thu Jan 01 00:00:00 1970 +0000
308 | date: Thu Jan 01 00:00:00 1970 +0000
309 | summary: d
309 | summary: d
310 |
310 |
311 o changeset: 1:ef3a871183d7
311 o changeset: 1:ef3a871183d7
312 | user: test
312 | user: test
313 | date: Thu Jan 01 00:00:00 1970 +0000
313 | date: Thu Jan 01 00:00:00 1970 +0000
314 | summary: b
314 | summary: b
315 |
315 |
316 o changeset: 0:9ab35a2d17cb
316 o changeset: 0:9ab35a2d17cb
317 user: test
317 user: test
318 date: Thu Jan 01 00:00:00 1970 +0000
318 date: Thu Jan 01 00:00:00 1970 +0000
319 summary: a
319 summary: a
320
320
321
321
322 2 is parent of 3, only one strip should happen
322 2 is parent of 3, only one strip should happen
323
323
324 $ hg strip "roots(2)" 3
324 $ hg strip "roots(2)" 3
325 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
325 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
326 $ hg log -G
326 $ hg log -G
327 @ changeset: 2:264128213d29
327 @ changeset: 2:264128213d29
328 | tag: tip
328 | tag: tip
329 | user: test
329 | user: test
330 | date: Thu Jan 01 00:00:00 1970 +0000
330 | date: Thu Jan 01 00:00:00 1970 +0000
331 | summary: c
331 | summary: c
332 |
332 |
333 o changeset: 1:ef3a871183d7
333 o changeset: 1:ef3a871183d7
334 | user: test
334 | user: test
335 | date: Thu Jan 01 00:00:00 1970 +0000
335 | date: Thu Jan 01 00:00:00 1970 +0000
336 | summary: b
336 | summary: b
337 |
337 |
338 o changeset: 0:9ab35a2d17cb
338 o changeset: 0:9ab35a2d17cb
339 user: test
339 user: test
340 date: Thu Jan 01 00:00:00 1970 +0000
340 date: Thu Jan 01 00:00:00 1970 +0000
341 summary: a
341 summary: a
342
342
343 $ restore
343 $ restore
344 $ hg log -G
344 $ hg log -G
345 o changeset: 4:443431ffac4f
345 o changeset: 4:443431ffac4f
346 | tag: tip
346 | tag: tip
347 | user: test
347 | user: test
348 | date: Thu Jan 01 00:00:00 1970 +0000
348 | date: Thu Jan 01 00:00:00 1970 +0000
349 | summary: e
349 | summary: e
350 |
350 |
351 o changeset: 3:65bd5f99a4a3
351 o changeset: 3:65bd5f99a4a3
352 | parent: 1:ef3a871183d7
352 | parent: 1:ef3a871183d7
353 | user: test
353 | user: test
354 | date: Thu Jan 01 00:00:00 1970 +0000
354 | date: Thu Jan 01 00:00:00 1970 +0000
355 | summary: d
355 | summary: d
356 |
356 |
357 | @ changeset: 2:264128213d29
357 | @ changeset: 2:264128213d29
358 |/ user: test
358 |/ user: test
359 | date: Thu Jan 01 00:00:00 1970 +0000
359 | date: Thu Jan 01 00:00:00 1970 +0000
360 | summary: c
360 | summary: c
361 |
361 |
362 o changeset: 1:ef3a871183d7
362 o changeset: 1:ef3a871183d7
363 | user: test
363 | user: test
364 | date: Thu Jan 01 00:00:00 1970 +0000
364 | date: Thu Jan 01 00:00:00 1970 +0000
365 | summary: b
365 | summary: b
366 |
366 |
367 o changeset: 0:9ab35a2d17cb
367 o changeset: 0:9ab35a2d17cb
368 user: test
368 user: test
369 date: Thu Jan 01 00:00:00 1970 +0000
369 date: Thu Jan 01 00:00:00 1970 +0000
370 summary: a
370 summary: a
371
371
372 Failed hook while applying "saveheads" bundle.
372 Failed hook while applying "saveheads" bundle.
373
373
374 $ hg strip 2 --config hooks.pretxnchangegroup.bad=false
374 $ hg strip 2 --config hooks.pretxnchangegroup.bad=false
375 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
375 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
376 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
376 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
377 transaction abort!
377 transaction abort!
378 rollback completed
378 rollback completed
379 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
379 strip failed, backup bundle stored in '$TESTTMP/test/.hg/strip-backup/*-backup.hg' (glob)
380 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
380 strip failed, unrecovered changes stored in '$TESTTMP/test/.hg/strip-backup/*-temp.hg' (glob)
381 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
381 (fix the problem, then recover the changesets with "hg unbundle '$TESTTMP/test/.hg/strip-backup/*-temp.hg'") (glob)
382 abort: pretxnchangegroup.bad hook exited with status 1
382 abort: pretxnchangegroup.bad hook exited with status 1
383 [255]
383 [255]
384 $ restore
384 $ restore
385 $ hg log -G
385 $ hg log -G
386 o changeset: 4:443431ffac4f
386 o changeset: 4:443431ffac4f
387 | tag: tip
387 | tag: tip
388 | user: test
388 | user: test
389 | date: Thu Jan 01 00:00:00 1970 +0000
389 | date: Thu Jan 01 00:00:00 1970 +0000
390 | summary: e
390 | summary: e
391 |
391 |
392 o changeset: 3:65bd5f99a4a3
392 o changeset: 3:65bd5f99a4a3
393 | parent: 1:ef3a871183d7
393 | parent: 1:ef3a871183d7
394 | user: test
394 | user: test
395 | date: Thu Jan 01 00:00:00 1970 +0000
395 | date: Thu Jan 01 00:00:00 1970 +0000
396 | summary: d
396 | summary: d
397 |
397 |
398 | o changeset: 2:264128213d29
398 | o changeset: 2:264128213d29
399 |/ user: test
399 |/ user: test
400 | date: Thu Jan 01 00:00:00 1970 +0000
400 | date: Thu Jan 01 00:00:00 1970 +0000
401 | summary: c
401 | summary: c
402 |
402 |
403 @ changeset: 1:ef3a871183d7
403 @ changeset: 1:ef3a871183d7
404 | user: test
404 | user: test
405 | date: Thu Jan 01 00:00:00 1970 +0000
405 | date: Thu Jan 01 00:00:00 1970 +0000
406 | summary: b
406 | summary: b
407 |
407 |
408 o changeset: 0:9ab35a2d17cb
408 o changeset: 0:9ab35a2d17cb
409 user: test
409 user: test
410 date: Thu Jan 01 00:00:00 1970 +0000
410 date: Thu Jan 01 00:00:00 1970 +0000
411 summary: a
411 summary: a
412
412
413
413
414 2 different branches: 2 strips
414 2 different branches: 2 strips
415
415
416 $ hg strip 2 4
416 $ hg strip 2 4
417 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
417 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
418 $ hg log -G
418 $ hg log -G
419 o changeset: 2:65bd5f99a4a3
419 o changeset: 2:65bd5f99a4a3
420 | tag: tip
420 | tag: tip
421 | user: test
421 | user: test
422 | date: Thu Jan 01 00:00:00 1970 +0000
422 | date: Thu Jan 01 00:00:00 1970 +0000
423 | summary: d
423 | summary: d
424 |
424 |
425 @ changeset: 1:ef3a871183d7
425 @ changeset: 1:ef3a871183d7
426 | user: test
426 | user: test
427 | date: Thu Jan 01 00:00:00 1970 +0000
427 | date: Thu Jan 01 00:00:00 1970 +0000
428 | summary: b
428 | summary: b
429 |
429 |
430 o changeset: 0:9ab35a2d17cb
430 o changeset: 0:9ab35a2d17cb
431 user: test
431 user: test
432 date: Thu Jan 01 00:00:00 1970 +0000
432 date: Thu Jan 01 00:00:00 1970 +0000
433 summary: a
433 summary: a
434
434
435 $ restore
435 $ restore
436
436
437 2 different branches and a common ancestor: 1 strip
437 2 different branches and a common ancestor: 1 strip
438
438
439 $ hg strip 1 "2|4"
439 $ hg strip 1 "2|4"
440 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
440 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
441 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
441 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
442 $ restore
442 $ restore
443
443
444 verify fncache is kept up-to-date
444 verify fncache is kept up-to-date
445
445
446 $ touch a
446 $ touch a
447 $ hg ci -qAm a
447 $ hg ci -qAm a
448 #if repofncache
448 $ cat .hg/store/fncache | sort
449 $ cat .hg/store/fncache | sort
449 data/a.i
450 data/a.i
450 data/bar.i
451 data/bar.i
452 #endif
451
453
452 $ hg strip tip
454 $ hg strip tip
453 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
455 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
454 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
456 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
457 #if repofncache
455 $ cat .hg/store/fncache
458 $ cat .hg/store/fncache
456 data/bar.i
459 data/bar.i
460 #endif
457
461
458 stripping an empty revset
462 stripping an empty revset
459
463
460 $ hg strip "1 and not 1"
464 $ hg strip "1 and not 1"
461 abort: empty revision set
465 abort: empty revision set
462 [255]
466 [255]
463
467
464 remove branchy history for qimport tests
468 remove branchy history for qimport tests
465
469
466 $ hg strip 3
470 $ hg strip 3
467 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
471 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
468
472
469
473
470 strip of applied mq should cleanup status file
474 strip of applied mq should cleanup status file
471
475
472 $ echo "mq=" >> $HGRCPATH
476 $ echo "mq=" >> $HGRCPATH
473 $ hg up -C 3
477 $ hg up -C 3
474 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
478 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
475 $ echo fooagain >> bar
479 $ echo fooagain >> bar
476 $ hg ci -mf
480 $ hg ci -mf
477 $ hg qimport -r tip:2
481 $ hg qimport -r tip:2
478
482
479 applied patches before strip
483 applied patches before strip
480
484
481 $ hg qapplied
485 $ hg qapplied
482 d
486 d
483 e
487 e
484 f
488 f
485
489
486 stripping revision in queue
490 stripping revision in queue
487
491
488 $ hg strip 3
492 $ hg strip 3
489 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
493 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
490 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
494 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
491
495
492 applied patches after stripping rev in queue
496 applied patches after stripping rev in queue
493
497
494 $ hg qapplied
498 $ hg qapplied
495 d
499 d
496
500
497 stripping ancestor of queue
501 stripping ancestor of queue
498
502
499 $ hg strip 1
503 $ hg strip 1
500 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
504 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
501 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
505 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
502
506
503 applied patches after stripping ancestor of queue
507 applied patches after stripping ancestor of queue
504
508
505 $ hg qapplied
509 $ hg qapplied
506
510
507 Verify strip protects against stripping wc parent when there are uncommitted mods
511 Verify strip protects against stripping wc parent when there are uncommitted mods
508
512
509 $ echo b > b
513 $ echo b > b
510 $ echo bb > bar
514 $ echo bb > bar
511 $ hg add b
515 $ hg add b
512 $ hg ci -m 'b'
516 $ hg ci -m 'b'
513 $ hg log --graph
517 $ hg log --graph
514 @ changeset: 1:76dcf9fab855
518 @ changeset: 1:76dcf9fab855
515 | tag: tip
519 | tag: tip
516 | user: test
520 | user: test
517 | date: Thu Jan 01 00:00:00 1970 +0000
521 | date: Thu Jan 01 00:00:00 1970 +0000
518 | summary: b
522 | summary: b
519 |
523 |
520 o changeset: 0:9ab35a2d17cb
524 o changeset: 0:9ab35a2d17cb
521 user: test
525 user: test
522 date: Thu Jan 01 00:00:00 1970 +0000
526 date: Thu Jan 01 00:00:00 1970 +0000
523 summary: a
527 summary: a
524
528
525 $ hg up 0
529 $ hg up 0
526 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
530 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
527 $ echo c > bar
531 $ echo c > bar
528 $ hg up -t false
532 $ hg up -t false
529 merging bar
533 merging bar
530 merging bar failed!
534 merging bar failed!
531 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
535 1 files updated, 0 files merged, 0 files removed, 1 files unresolved
532 use 'hg resolve' to retry unresolved file merges
536 use 'hg resolve' to retry unresolved file merges
533 [1]
537 [1]
534 $ hg sum
538 $ hg sum
535 parent: 1:76dcf9fab855 tip
539 parent: 1:76dcf9fab855 tip
536 b
540 b
537 branch: default
541 branch: default
538 commit: 1 modified, 1 unknown, 1 unresolved
542 commit: 1 modified, 1 unknown, 1 unresolved
539 update: (current)
543 update: (current)
540 phases: 2 draft
544 phases: 2 draft
541 mq: 3 unapplied
545 mq: 3 unapplied
542
546
543 $ echo c > b
547 $ echo c > b
544 $ hg strip tip
548 $ hg strip tip
545 abort: local changes found
549 abort: local changes found
546 [255]
550 [255]
547 $ hg strip tip --keep
551 $ hg strip tip --keep
548 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
552 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
549 $ hg log --graph
553 $ hg log --graph
550 @ changeset: 0:9ab35a2d17cb
554 @ changeset: 0:9ab35a2d17cb
551 tag: tip
555 tag: tip
552 user: test
556 user: test
553 date: Thu Jan 01 00:00:00 1970 +0000
557 date: Thu Jan 01 00:00:00 1970 +0000
554 summary: a
558 summary: a
555
559
556 $ hg status
560 $ hg status
557 M bar
561 M bar
558 ? b
562 ? b
559 ? bar.orig
563 ? bar.orig
560
564
561 $ rm bar.orig
565 $ rm bar.orig
562 $ hg sum
566 $ hg sum
563 parent: 0:9ab35a2d17cb tip
567 parent: 0:9ab35a2d17cb tip
564 a
568 a
565 branch: default
569 branch: default
566 commit: 1 modified, 1 unknown
570 commit: 1 modified, 1 unknown
567 update: (current)
571 update: (current)
568 phases: 1 draft
572 phases: 1 draft
569 mq: 3 unapplied
573 mq: 3 unapplied
570
574
571 Strip adds, removes, modifies with --keep
575 Strip adds, removes, modifies with --keep
572
576
573 $ touch b
577 $ touch b
574 $ hg add b
578 $ hg add b
575 $ hg commit -mb
579 $ hg commit -mb
576 $ touch c
580 $ touch c
577
581
578 ... with a clean working dir
582 ... with a clean working dir
579
583
580 $ hg add c
584 $ hg add c
581 $ hg rm bar
585 $ hg rm bar
582 $ hg commit -mc
586 $ hg commit -mc
583 $ hg status
587 $ hg status
584 $ hg strip --keep tip
588 $ hg strip --keep tip
585 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
589 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
586 $ hg status
590 $ hg status
587 ! bar
591 ! bar
588 ? c
592 ? c
589
593
590 ... with a dirty working dir
594 ... with a dirty working dir
591
595
592 $ hg add c
596 $ hg add c
593 $ hg rm bar
597 $ hg rm bar
594 $ hg commit -mc
598 $ hg commit -mc
595 $ hg status
599 $ hg status
596 $ echo b > b
600 $ echo b > b
597 $ echo d > d
601 $ echo d > d
598 $ hg strip --keep tip
602 $ hg strip --keep tip
599 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
603 saved backup bundle to $TESTTMP/test/.hg/strip-backup/*-backup.hg (glob)
600 $ hg status
604 $ hg status
601 M b
605 M b
602 ! bar
606 ! bar
603 ? c
607 ? c
604 ? d
608 ? d
605
609
606 ... after updating the dirstate
610 ... after updating the dirstate
607 $ hg add c
611 $ hg add c
608 $ hg commit -mc
612 $ hg commit -mc
609 $ hg rm c
613 $ hg rm c
610 $ hg commit -mc
614 $ hg commit -mc
611 $ hg strip --keep '.^' -q
615 $ hg strip --keep '.^' -q
612 $ cd ..
616 $ cd ..
613
617
614 stripping many nodes on a complex graph (issue3299)
618 stripping many nodes on a complex graph (issue3299)
615
619
616 $ hg init issue3299
620 $ hg init issue3299
617 $ cd issue3299
621 $ cd issue3299
618 $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a'
622 $ hg debugbuilddag '@a.:a@b.:b.:x<a@a.:a<b@b.:b<a@a.:a'
619 $ hg strip 'not ancestors(x)'
623 $ hg strip 'not ancestors(x)'
620 saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob)
624 saved backup bundle to $TESTTMP/issue3299/.hg/strip-backup/*-backup.hg (glob)
621
625
622 test hg strip -B bookmark
626 test hg strip -B bookmark
623
627
624 $ cd ..
628 $ cd ..
625 $ hg init bookmarks
629 $ hg init bookmarks
626 $ cd bookmarks
630 $ cd bookmarks
627 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
631 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
628 $ hg bookmark -r 'a' 'todelete'
632 $ hg bookmark -r 'a' 'todelete'
629 $ hg bookmark -r 'b' 'B'
633 $ hg bookmark -r 'b' 'B'
630 $ hg bookmark -r 'b' 'nostrip'
634 $ hg bookmark -r 'b' 'nostrip'
631 $ hg bookmark -r 'c' 'delete'
635 $ hg bookmark -r 'c' 'delete'
632 $ hg bookmark -r 'd' 'multipledelete1'
636 $ hg bookmark -r 'd' 'multipledelete1'
633 $ hg bookmark -r 'e' 'multipledelete2'
637 $ hg bookmark -r 'e' 'multipledelete2'
634 $ hg bookmark -r 'f' 'singlenode1'
638 $ hg bookmark -r 'f' 'singlenode1'
635 $ hg bookmark -r 'f' 'singlenode2'
639 $ hg bookmark -r 'f' 'singlenode2'
636 $ hg up -C todelete
640 $ hg up -C todelete
637 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
641 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
638 (activating bookmark todelete)
642 (activating bookmark todelete)
639 $ hg strip -B nostrip
643 $ hg strip -B nostrip
640 bookmark 'nostrip' deleted
644 bookmark 'nostrip' deleted
641 abort: empty revision set
645 abort: empty revision set
642 [255]
646 [255]
643 $ hg strip -B todelete
647 $ hg strip -B todelete
644 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
648 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
645 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
649 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
646 bookmark 'todelete' deleted
650 bookmark 'todelete' deleted
647 $ hg id -ir dcbb326fdec2
651 $ hg id -ir dcbb326fdec2
648 abort: unknown revision 'dcbb326fdec2'!
652 abort: unknown revision 'dcbb326fdec2'!
649 [255]
653 [255]
650 $ hg id -ir d62d843c9a01
654 $ hg id -ir d62d843c9a01
651 d62d843c9a01
655 d62d843c9a01
652 $ hg bookmarks
656 $ hg bookmarks
653 B 9:ff43616e5d0f
657 B 9:ff43616e5d0f
654 delete 6:2702dd0c91e7
658 delete 6:2702dd0c91e7
655 multipledelete1 11:e46a4836065c
659 multipledelete1 11:e46a4836065c
656 multipledelete2 12:b4594d867745
660 multipledelete2 12:b4594d867745
657 singlenode1 13:43227190fef8
661 singlenode1 13:43227190fef8
658 singlenode2 13:43227190fef8
662 singlenode2 13:43227190fef8
659 $ hg strip -B multipledelete1 -B multipledelete2
663 $ hg strip -B multipledelete1 -B multipledelete2
660 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg
664 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg
661 bookmark 'multipledelete1' deleted
665 bookmark 'multipledelete1' deleted
662 bookmark 'multipledelete2' deleted
666 bookmark 'multipledelete2' deleted
663 $ hg id -ir e46a4836065c
667 $ hg id -ir e46a4836065c
664 abort: unknown revision 'e46a4836065c'!
668 abort: unknown revision 'e46a4836065c'!
665 [255]
669 [255]
666 $ hg id -ir b4594d867745
670 $ hg id -ir b4594d867745
667 abort: unknown revision 'b4594d867745'!
671 abort: unknown revision 'b4594d867745'!
668 [255]
672 [255]
669 $ hg strip -B singlenode1 -B singlenode2
673 $ hg strip -B singlenode1 -B singlenode2
670 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg
674 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg
671 bookmark 'singlenode1' deleted
675 bookmark 'singlenode1' deleted
672 bookmark 'singlenode2' deleted
676 bookmark 'singlenode2' deleted
673 $ hg id -ir 43227190fef8
677 $ hg id -ir 43227190fef8
674 abort: unknown revision '43227190fef8'!
678 abort: unknown revision '43227190fef8'!
675 [255]
679 [255]
676 $ hg strip -B unknownbookmark
680 $ hg strip -B unknownbookmark
677 abort: bookmark 'unknownbookmark' not found
681 abort: bookmark 'unknownbookmark' not found
678 [255]
682 [255]
679 $ hg strip -B unknownbookmark1 -B unknownbookmark2
683 $ hg strip -B unknownbookmark1 -B unknownbookmark2
680 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
684 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
681 [255]
685 [255]
682 $ hg strip -B delete -B unknownbookmark
686 $ hg strip -B delete -B unknownbookmark
683 abort: bookmark 'unknownbookmark' not found
687 abort: bookmark 'unknownbookmark' not found
684 [255]
688 [255]
685 $ hg strip -B delete
689 $ hg strip -B delete
686 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
690 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
687 bookmark 'delete' deleted
691 bookmark 'delete' deleted
688 $ hg id -ir 6:2702dd0c91e7
692 $ hg id -ir 6:2702dd0c91e7
689 abort: unknown revision '2702dd0c91e7'!
693 abort: unknown revision '2702dd0c91e7'!
690 [255]
694 [255]
691 $ hg update B
695 $ hg update B
692 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
696 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
693 (activating bookmark B)
697 (activating bookmark B)
694 $ echo a > a
698 $ echo a > a
695 $ hg add a
699 $ hg add a
696 $ hg strip -B B
700 $ hg strip -B B
697 abort: local changes found
701 abort: local changes found
698 [255]
702 [255]
699 $ hg bookmarks
703 $ hg bookmarks
700 * B 6:ff43616e5d0f
704 * B 6:ff43616e5d0f
701
705
702 Make sure no one adds back a -b option:
706 Make sure no one adds back a -b option:
703
707
704 $ hg strip -b tip
708 $ hg strip -b tip
705 hg strip: option -b not recognized
709 hg strip: option -b not recognized
706 hg strip [-k] [-f] [-B bookmark] [-r] REV...
710 hg strip [-k] [-f] [-B bookmark] [-r] REV...
707
711
708 strip changesets and all their descendants from the repository
712 strip changesets and all their descendants from the repository
709
713
710 (use 'hg help -e strip' to show help for the strip extension)
714 (use 'hg help -e strip' to show help for the strip extension)
711
715
712 options ([+] can be repeated):
716 options ([+] can be repeated):
713
717
714 -r --rev REV [+] strip specified revision (optional, can specify
718 -r --rev REV [+] strip specified revision (optional, can specify
715 revisions without this option)
719 revisions without this option)
716 -f --force force removal of changesets, discard uncommitted
720 -f --force force removal of changesets, discard uncommitted
717 changes (no backup)
721 changes (no backup)
718 --no-backup no backups
722 --no-backup no backups
719 -k --keep do not modify working directory during strip
723 -k --keep do not modify working directory during strip
720 -B --bookmark VALUE [+] remove revs only reachable from given bookmark
724 -B --bookmark VALUE [+] remove revs only reachable from given bookmark
721 --mq operate on patch repository
725 --mq operate on patch repository
722
726
723 (use 'hg strip -h' to show more help)
727 (use 'hg strip -h' to show more help)
724 [255]
728 [255]
725
729
726 $ cd ..
730 $ cd ..
727
731
728 Verify bundles don't get overwritten:
732 Verify bundles don't get overwritten:
729
733
730 $ hg init doublebundle
734 $ hg init doublebundle
731 $ cd doublebundle
735 $ cd doublebundle
732 $ touch a
736 $ touch a
733 $ hg commit -Aqm a
737 $ hg commit -Aqm a
734 $ touch b
738 $ touch b
735 $ hg commit -Aqm b
739 $ hg commit -Aqm b
736 $ hg strip -r 0
740 $ hg strip -r 0
737 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
741 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
738 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg
742 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-e68910bd-backup.hg
739 $ ls .hg/strip-backup
743 $ ls .hg/strip-backup
740 3903775176ed-e68910bd-backup.hg
744 3903775176ed-e68910bd-backup.hg
741 $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg
745 $ hg pull -q -r 3903775176ed .hg/strip-backup/3903775176ed-e68910bd-backup.hg
742 $ hg strip -r 0
746 $ hg strip -r 0
743 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg
747 saved backup bundle to $TESTTMP/doublebundle/.hg/strip-backup/3903775176ed-54390173-backup.hg
744 $ ls .hg/strip-backup
748 $ ls .hg/strip-backup
745 3903775176ed-54390173-backup.hg
749 3903775176ed-54390173-backup.hg
746 3903775176ed-e68910bd-backup.hg
750 3903775176ed-e68910bd-backup.hg
747 $ cd ..
751 $ cd ..
748
752
749 Test that we only bundle the stripped changesets (issue4736)
753 Test that we only bundle the stripped changesets (issue4736)
750 ------------------------------------------------------------
754 ------------------------------------------------------------
751
755
752 initialization (previous repo is empty anyway)
756 initialization (previous repo is empty anyway)
753
757
754 $ hg init issue4736
758 $ hg init issue4736
755 $ cd issue4736
759 $ cd issue4736
756 $ echo a > a
760 $ echo a > a
757 $ hg add a
761 $ hg add a
758 $ hg commit -m commitA
762 $ hg commit -m commitA
759 $ echo b > b
763 $ echo b > b
760 $ hg add b
764 $ hg add b
761 $ hg commit -m commitB
765 $ hg commit -m commitB
762 $ echo c > c
766 $ echo c > c
763 $ hg add c
767 $ hg add c
764 $ hg commit -m commitC
768 $ hg commit -m commitC
765 $ hg up 'desc(commitB)'
769 $ hg up 'desc(commitB)'
766 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
770 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
767 $ echo d > d
771 $ echo d > d
768 $ hg add d
772 $ hg add d
769 $ hg commit -m commitD
773 $ hg commit -m commitD
770 created new head
774 created new head
771 $ hg up 'desc(commitC)'
775 $ hg up 'desc(commitC)'
772 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
776 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
773 $ hg merge 'desc(commitD)'
777 $ hg merge 'desc(commitD)'
774 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
778 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
775 (branch merge, don't forget to commit)
779 (branch merge, don't forget to commit)
776 $ hg ci -m 'mergeCD'
780 $ hg ci -m 'mergeCD'
777 $ hg log -G
781 $ hg log -G
778 @ changeset: 4:d8db9d137221
782 @ changeset: 4:d8db9d137221
779 |\ tag: tip
783 |\ tag: tip
780 | | parent: 2:5c51d8d6557d
784 | | parent: 2:5c51d8d6557d
781 | | parent: 3:6625a5168474
785 | | parent: 3:6625a5168474
782 | | user: test
786 | | user: test
783 | | date: Thu Jan 01 00:00:00 1970 +0000
787 | | date: Thu Jan 01 00:00:00 1970 +0000
784 | | summary: mergeCD
788 | | summary: mergeCD
785 | |
789 | |
786 | o changeset: 3:6625a5168474
790 | o changeset: 3:6625a5168474
787 | | parent: 1:eca11cf91c71
791 | | parent: 1:eca11cf91c71
788 | | user: test
792 | | user: test
789 | | date: Thu Jan 01 00:00:00 1970 +0000
793 | | date: Thu Jan 01 00:00:00 1970 +0000
790 | | summary: commitD
794 | | summary: commitD
791 | |
795 | |
792 o | changeset: 2:5c51d8d6557d
796 o | changeset: 2:5c51d8d6557d
793 |/ user: test
797 |/ user: test
794 | date: Thu Jan 01 00:00:00 1970 +0000
798 | date: Thu Jan 01 00:00:00 1970 +0000
795 | summary: commitC
799 | summary: commitC
796 |
800 |
797 o changeset: 1:eca11cf91c71
801 o changeset: 1:eca11cf91c71
798 | user: test
802 | user: test
799 | date: Thu Jan 01 00:00:00 1970 +0000
803 | date: Thu Jan 01 00:00:00 1970 +0000
800 | summary: commitB
804 | summary: commitB
801 |
805 |
802 o changeset: 0:105141ef12d0
806 o changeset: 0:105141ef12d0
803 user: test
807 user: test
804 date: Thu Jan 01 00:00:00 1970 +0000
808 date: Thu Jan 01 00:00:00 1970 +0000
805 summary: commitA
809 summary: commitA
806
810
807
811
808 Check bundle behavior:
812 Check bundle behavior:
809
813
810 $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg
814 $ hg bundle -r 'desc(mergeCD)' --base 'desc(commitC)' ../issue4736.hg
811 2 changesets found
815 2 changesets found
812 $ hg log -r 'bundle()' -R ../issue4736.hg
816 $ hg log -r 'bundle()' -R ../issue4736.hg
813 changeset: 3:6625a5168474
817 changeset: 3:6625a5168474
814 parent: 1:eca11cf91c71
818 parent: 1:eca11cf91c71
815 user: test
819 user: test
816 date: Thu Jan 01 00:00:00 1970 +0000
820 date: Thu Jan 01 00:00:00 1970 +0000
817 summary: commitD
821 summary: commitD
818
822
819 changeset: 4:d8db9d137221
823 changeset: 4:d8db9d137221
820 tag: tip
824 tag: tip
821 parent: 2:5c51d8d6557d
825 parent: 2:5c51d8d6557d
822 parent: 3:6625a5168474
826 parent: 3:6625a5168474
823 user: test
827 user: test
824 date: Thu Jan 01 00:00:00 1970 +0000
828 date: Thu Jan 01 00:00:00 1970 +0000
825 summary: mergeCD
829 summary: mergeCD
826
830
827
831
828 check strip behavior
832 check strip behavior
829
833
830 $ hg --config extensions.strip= strip 'desc(commitD)' --debug
834 $ hg --config extensions.strip= strip 'desc(commitD)' --debug
831 resolving manifests
835 resolving manifests
832 branchmerge: False, force: True, partial: False
836 branchmerge: False, force: True, partial: False
833 ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71
837 ancestor: d8db9d137221+, local: d8db9d137221+, remote: eca11cf91c71
834 c: other deleted -> r
838 c: other deleted -> r
835 removing c
839 removing c
836 d: other deleted -> r
840 d: other deleted -> r
837 removing d
841 removing d
838 starting 4 threads for background file closing (?)
842 starting 4 threads for background file closing (?)
839 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
843 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
840 2 changesets found
844 2 changesets found
841 list of changesets:
845 list of changesets:
842 6625a516847449b6f0fa3737b9ba56e9f0f3032c
846 6625a516847449b6f0fa3737b9ba56e9f0f3032c
843 d8db9d1372214336d2b5570f20ee468d2c72fa8b
847 d8db9d1372214336d2b5570f20ee468d2c72fa8b
844 bundle2-output-bundle: "HG20", (1 params) 3 parts total
848 bundle2-output-bundle: "HG20", (1 params) 3 parts total
845 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
849 bundle2-output-part: "changegroup" (params: 1 mandatory 1 advisory) streamed payload
846 bundle2-output-part: "cache:rev-branch-cache" streamed payload
850 bundle2-output-part: "cache:rev-branch-cache" streamed payload
847 bundle2-output-part: "phase-heads" 24 bytes payload
851 bundle2-output-part: "phase-heads" 24 bytes payload
848 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg
852 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/6625a5168474-345bb43d-backup.hg
849 updating the branch cache
853 updating the branch cache
850 invalid branchheads cache (served): tip differs
854 invalid branchheads cache (served): tip differs
851 $ hg log -G
855 $ hg log -G
852 o changeset: 2:5c51d8d6557d
856 o changeset: 2:5c51d8d6557d
853 | tag: tip
857 | tag: tip
854 | user: test
858 | user: test
855 | date: Thu Jan 01 00:00:00 1970 +0000
859 | date: Thu Jan 01 00:00:00 1970 +0000
856 | summary: commitC
860 | summary: commitC
857 |
861 |
858 @ changeset: 1:eca11cf91c71
862 @ changeset: 1:eca11cf91c71
859 | user: test
863 | user: test
860 | date: Thu Jan 01 00:00:00 1970 +0000
864 | date: Thu Jan 01 00:00:00 1970 +0000
861 | summary: commitB
865 | summary: commitB
862 |
866 |
863 o changeset: 0:105141ef12d0
867 o changeset: 0:105141ef12d0
864 user: test
868 user: test
865 date: Thu Jan 01 00:00:00 1970 +0000
869 date: Thu Jan 01 00:00:00 1970 +0000
866 summary: commitA
870 summary: commitA
867
871
868
872
869 strip backup content
873 strip backup content
870
874
871 $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg
875 $ hg log -r 'bundle()' -R .hg/strip-backup/6625a5168474-*-backup.hg
872 changeset: 3:6625a5168474
876 changeset: 3:6625a5168474
873 parent: 1:eca11cf91c71
877 parent: 1:eca11cf91c71
874 user: test
878 user: test
875 date: Thu Jan 01 00:00:00 1970 +0000
879 date: Thu Jan 01 00:00:00 1970 +0000
876 summary: commitD
880 summary: commitD
877
881
878 changeset: 4:d8db9d137221
882 changeset: 4:d8db9d137221
879 tag: tip
883 tag: tip
880 parent: 2:5c51d8d6557d
884 parent: 2:5c51d8d6557d
881 parent: 3:6625a5168474
885 parent: 3:6625a5168474
882 user: test
886 user: test
883 date: Thu Jan 01 00:00:00 1970 +0000
887 date: Thu Jan 01 00:00:00 1970 +0000
884 summary: mergeCD
888 summary: mergeCD
885
889
886 Check that the phase cache is properly invalidated after a strip with bookmark.
890 Check that the phase cache is properly invalidated after a strip with bookmark.
887
891
888 $ cat > ../stripstalephasecache.py << EOF
892 $ cat > ../stripstalephasecache.py << EOF
889 > from mercurial import extensions, localrepo
893 > from mercurial import extensions, localrepo
890 > def transactioncallback(orig, repo, desc, *args, **kwargs):
894 > def transactioncallback(orig, repo, desc, *args, **kwargs):
891 > def test(transaction):
895 > def test(transaction):
892 > # observe cache inconsistency
896 > # observe cache inconsistency
893 > try:
897 > try:
894 > [repo.changelog.node(r) for r in repo.revs(b"not public()")]
898 > [repo.changelog.node(r) for r in repo.revs(b"not public()")]
895 > except IndexError:
899 > except IndexError:
896 > repo.ui.status(b"Index error!\n")
900 > repo.ui.status(b"Index error!\n")
897 > transaction = orig(repo, desc, *args, **kwargs)
901 > transaction = orig(repo, desc, *args, **kwargs)
898 > # warm up the phase cache
902 > # warm up the phase cache
899 > list(repo.revs(b"not public()"))
903 > list(repo.revs(b"not public()"))
900 > if desc != b'strip':
904 > if desc != b'strip':
901 > transaction.addpostclose(b"phase invalidation test", test)
905 > transaction.addpostclose(b"phase invalidation test", test)
902 > return transaction
906 > return transaction
903 > def extsetup(ui):
907 > def extsetup(ui):
904 > extensions.wrapfunction(localrepo.localrepository, b"transaction",
908 > extensions.wrapfunction(localrepo.localrepository, b"transaction",
905 > transactioncallback)
909 > transactioncallback)
906 > EOF
910 > EOF
907 $ hg up -C 2
911 $ hg up -C 2
908 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
912 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
909 $ echo k > k
913 $ echo k > k
910 $ hg add k
914 $ hg add k
911 $ hg commit -m commitK
915 $ hg commit -m commitK
912 $ echo l > l
916 $ echo l > l
913 $ hg add l
917 $ hg add l
914 $ hg commit -m commitL
918 $ hg commit -m commitL
915 $ hg book -r tip blah
919 $ hg book -r tip blah
916 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
920 $ hg strip ".^" --config extensions.crash=$TESTTMP/stripstalephasecache.py
917 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
921 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
918 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg
922 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/8f0b4384875c-4fa10deb-backup.hg
919 $ hg up -C 1
923 $ hg up -C 1
920 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
924 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
921
925
922 Error during post-close callback of the strip transaction
926 Error during post-close callback of the strip transaction
923 (They should be gracefully handled and reported)
927 (They should be gracefully handled and reported)
924
928
925 $ cat > ../crashstrip.py << EOF
929 $ cat > ../crashstrip.py << EOF
926 > from mercurial import error
930 > from mercurial import error
927 > def reposetup(ui, repo):
931 > def reposetup(ui, repo):
928 > class crashstriprepo(repo.__class__):
932 > class crashstriprepo(repo.__class__):
929 > def transaction(self, desc, *args, **kwargs):
933 > def transaction(self, desc, *args, **kwargs):
930 > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs)
934 > tr = super(crashstriprepo, self).transaction(desc, *args, **kwargs)
931 > if desc == b'strip':
935 > if desc == b'strip':
932 > def crash(tra): raise error.Abort(b'boom')
936 > def crash(tra): raise error.Abort(b'boom')
933 > tr.addpostclose(b'crash', crash)
937 > tr.addpostclose(b'crash', crash)
934 > return tr
938 > return tr
935 > repo.__class__ = crashstriprepo
939 > repo.__class__ = crashstriprepo
936 > EOF
940 > EOF
937 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
941 $ hg strip tip --config extensions.crash=$TESTTMP/crashstrip.py
938 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg
942 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg
939 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg'
943 strip failed, backup bundle stored in '$TESTTMP/issue4736/.hg/strip-backup/5c51d8d6557d-70daef06-backup.hg'
940 abort: boom
944 abort: boom
941 [255]
945 [255]
942
946
943 test stripping a working directory parent doesn't switch named branches
947 test stripping a working directory parent doesn't switch named branches
944
948
945 $ hg log -G
949 $ hg log -G
946 @ changeset: 1:eca11cf91c71
950 @ changeset: 1:eca11cf91c71
947 | tag: tip
951 | tag: tip
948 | user: test
952 | user: test
949 | date: Thu Jan 01 00:00:00 1970 +0000
953 | date: Thu Jan 01 00:00:00 1970 +0000
950 | summary: commitB
954 | summary: commitB
951 |
955 |
952 o changeset: 0:105141ef12d0
956 o changeset: 0:105141ef12d0
953 user: test
957 user: test
954 date: Thu Jan 01 00:00:00 1970 +0000
958 date: Thu Jan 01 00:00:00 1970 +0000
955 summary: commitA
959 summary: commitA
956
960
957
961
958 $ hg branch new-branch
962 $ hg branch new-branch
959 marked working directory as branch new-branch
963 marked working directory as branch new-branch
960 (branches are permanent and global, did you want a bookmark?)
964 (branches are permanent and global, did you want a bookmark?)
961 $ hg ci -m "start new branch"
965 $ hg ci -m "start new branch"
962 $ echo 'foo' > foo.txt
966 $ echo 'foo' > foo.txt
963 $ hg ci -Aqm foo
967 $ hg ci -Aqm foo
964 $ hg up default
968 $ hg up default
965 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
969 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
966 $ echo 'bar' > bar.txt
970 $ echo 'bar' > bar.txt
967 $ hg ci -Aqm bar
971 $ hg ci -Aqm bar
968 $ hg up new-branch
972 $ hg up new-branch
969 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
973 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
970 $ hg merge default
974 $ hg merge default
971 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
975 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
972 (branch merge, don't forget to commit)
976 (branch merge, don't forget to commit)
973 $ hg log -G
977 $ hg log -G
974 @ changeset: 4:35358f982181
978 @ changeset: 4:35358f982181
975 | tag: tip
979 | tag: tip
976 | parent: 1:eca11cf91c71
980 | parent: 1:eca11cf91c71
977 | user: test
981 | user: test
978 | date: Thu Jan 01 00:00:00 1970 +0000
982 | date: Thu Jan 01 00:00:00 1970 +0000
979 | summary: bar
983 | summary: bar
980 |
984 |
981 | @ changeset: 3:f62c6c09b707
985 | @ changeset: 3:f62c6c09b707
982 | | branch: new-branch
986 | | branch: new-branch
983 | | user: test
987 | | user: test
984 | | date: Thu Jan 01 00:00:00 1970 +0000
988 | | date: Thu Jan 01 00:00:00 1970 +0000
985 | | summary: foo
989 | | summary: foo
986 | |
990 | |
987 | o changeset: 2:b1d33a8cadd9
991 | o changeset: 2:b1d33a8cadd9
988 |/ branch: new-branch
992 |/ branch: new-branch
989 | user: test
993 | user: test
990 | date: Thu Jan 01 00:00:00 1970 +0000
994 | date: Thu Jan 01 00:00:00 1970 +0000
991 | summary: start new branch
995 | summary: start new branch
992 |
996 |
993 o changeset: 1:eca11cf91c71
997 o changeset: 1:eca11cf91c71
994 | user: test
998 | user: test
995 | date: Thu Jan 01 00:00:00 1970 +0000
999 | date: Thu Jan 01 00:00:00 1970 +0000
996 | summary: commitB
1000 | summary: commitB
997 |
1001 |
998 o changeset: 0:105141ef12d0
1002 o changeset: 0:105141ef12d0
999 user: test
1003 user: test
1000 date: Thu Jan 01 00:00:00 1970 +0000
1004 date: Thu Jan 01 00:00:00 1970 +0000
1001 summary: commitA
1005 summary: commitA
1002
1006
1003
1007
1004 $ hg strip --force -r 35358f982181
1008 $ hg strip --force -r 35358f982181
1005 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1009 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1006 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-50d992d4-backup.hg
1010 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-50d992d4-backup.hg
1007 $ hg log -G
1011 $ hg log -G
1008 @ changeset: 3:f62c6c09b707
1012 @ changeset: 3:f62c6c09b707
1009 | branch: new-branch
1013 | branch: new-branch
1010 | tag: tip
1014 | tag: tip
1011 | user: test
1015 | user: test
1012 | date: Thu Jan 01 00:00:00 1970 +0000
1016 | date: Thu Jan 01 00:00:00 1970 +0000
1013 | summary: foo
1017 | summary: foo
1014 |
1018 |
1015 o changeset: 2:b1d33a8cadd9
1019 o changeset: 2:b1d33a8cadd9
1016 | branch: new-branch
1020 | branch: new-branch
1017 | user: test
1021 | user: test
1018 | date: Thu Jan 01 00:00:00 1970 +0000
1022 | date: Thu Jan 01 00:00:00 1970 +0000
1019 | summary: start new branch
1023 | summary: start new branch
1020 |
1024 |
1021 o changeset: 1:eca11cf91c71
1025 o changeset: 1:eca11cf91c71
1022 | user: test
1026 | user: test
1023 | date: Thu Jan 01 00:00:00 1970 +0000
1027 | date: Thu Jan 01 00:00:00 1970 +0000
1024 | summary: commitB
1028 | summary: commitB
1025 |
1029 |
1026 o changeset: 0:105141ef12d0
1030 o changeset: 0:105141ef12d0
1027 user: test
1031 user: test
1028 date: Thu Jan 01 00:00:00 1970 +0000
1032 date: Thu Jan 01 00:00:00 1970 +0000
1029 summary: commitA
1033 summary: commitA
1030
1034
1031
1035
1032 $ hg up default
1036 $ hg up default
1033 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1037 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1034 $ echo 'bar' > bar.txt
1038 $ echo 'bar' > bar.txt
1035 $ hg ci -Aqm bar
1039 $ hg ci -Aqm bar
1036 $ hg up new-branch
1040 $ hg up new-branch
1037 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1041 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1038 $ hg merge default
1042 $ hg merge default
1039 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1043 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1040 (branch merge, don't forget to commit)
1044 (branch merge, don't forget to commit)
1041 $ hg ci -m merge
1045 $ hg ci -m merge
1042 $ hg log -G
1046 $ hg log -G
1043 @ changeset: 5:4cf5e92caec2
1047 @ changeset: 5:4cf5e92caec2
1044 |\ branch: new-branch
1048 |\ branch: new-branch
1045 | | tag: tip
1049 | | tag: tip
1046 | | parent: 3:f62c6c09b707
1050 | | parent: 3:f62c6c09b707
1047 | | parent: 4:35358f982181
1051 | | parent: 4:35358f982181
1048 | | user: test
1052 | | user: test
1049 | | date: Thu Jan 01 00:00:00 1970 +0000
1053 | | date: Thu Jan 01 00:00:00 1970 +0000
1050 | | summary: merge
1054 | | summary: merge
1051 | |
1055 | |
1052 | o changeset: 4:35358f982181
1056 | o changeset: 4:35358f982181
1053 | | parent: 1:eca11cf91c71
1057 | | parent: 1:eca11cf91c71
1054 | | user: test
1058 | | user: test
1055 | | date: Thu Jan 01 00:00:00 1970 +0000
1059 | | date: Thu Jan 01 00:00:00 1970 +0000
1056 | | summary: bar
1060 | | summary: bar
1057 | |
1061 | |
1058 o | changeset: 3:f62c6c09b707
1062 o | changeset: 3:f62c6c09b707
1059 | | branch: new-branch
1063 | | branch: new-branch
1060 | | user: test
1064 | | user: test
1061 | | date: Thu Jan 01 00:00:00 1970 +0000
1065 | | date: Thu Jan 01 00:00:00 1970 +0000
1062 | | summary: foo
1066 | | summary: foo
1063 | |
1067 | |
1064 o | changeset: 2:b1d33a8cadd9
1068 o | changeset: 2:b1d33a8cadd9
1065 |/ branch: new-branch
1069 |/ branch: new-branch
1066 | user: test
1070 | user: test
1067 | date: Thu Jan 01 00:00:00 1970 +0000
1071 | date: Thu Jan 01 00:00:00 1970 +0000
1068 | summary: start new branch
1072 | summary: start new branch
1069 |
1073 |
1070 o changeset: 1:eca11cf91c71
1074 o changeset: 1:eca11cf91c71
1071 | user: test
1075 | user: test
1072 | date: Thu Jan 01 00:00:00 1970 +0000
1076 | date: Thu Jan 01 00:00:00 1970 +0000
1073 | summary: commitB
1077 | summary: commitB
1074 |
1078 |
1075 o changeset: 0:105141ef12d0
1079 o changeset: 0:105141ef12d0
1076 user: test
1080 user: test
1077 date: Thu Jan 01 00:00:00 1970 +0000
1081 date: Thu Jan 01 00:00:00 1970 +0000
1078 summary: commitA
1082 summary: commitA
1079
1083
1080
1084
1081 $ hg strip -r 35358f982181
1085 $ hg strip -r 35358f982181
1082 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1086 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1083 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1087 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1084 $ hg log -G
1088 $ hg log -G
1085 @ changeset: 3:f62c6c09b707
1089 @ changeset: 3:f62c6c09b707
1086 | branch: new-branch
1090 | branch: new-branch
1087 | tag: tip
1091 | tag: tip
1088 | user: test
1092 | user: test
1089 | date: Thu Jan 01 00:00:00 1970 +0000
1093 | date: Thu Jan 01 00:00:00 1970 +0000
1090 | summary: foo
1094 | summary: foo
1091 |
1095 |
1092 o changeset: 2:b1d33a8cadd9
1096 o changeset: 2:b1d33a8cadd9
1093 | branch: new-branch
1097 | branch: new-branch
1094 | user: test
1098 | user: test
1095 | date: Thu Jan 01 00:00:00 1970 +0000
1099 | date: Thu Jan 01 00:00:00 1970 +0000
1096 | summary: start new branch
1100 | summary: start new branch
1097 |
1101 |
1098 o changeset: 1:eca11cf91c71
1102 o changeset: 1:eca11cf91c71
1099 | user: test
1103 | user: test
1100 | date: Thu Jan 01 00:00:00 1970 +0000
1104 | date: Thu Jan 01 00:00:00 1970 +0000
1101 | summary: commitB
1105 | summary: commitB
1102 |
1106 |
1103 o changeset: 0:105141ef12d0
1107 o changeset: 0:105141ef12d0
1104 user: test
1108 user: test
1105 date: Thu Jan 01 00:00:00 1970 +0000
1109 date: Thu Jan 01 00:00:00 1970 +0000
1106 summary: commitA
1110 summary: commitA
1107
1111
1108
1112
1109 $ hg unbundle -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1113 $ hg unbundle -u $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1110 adding changesets
1114 adding changesets
1111 adding manifests
1115 adding manifests
1112 adding file changes
1116 adding file changes
1113 added 2 changesets with 1 changes to 1 files
1117 added 2 changesets with 1 changes to 1 files
1114 new changesets 35358f982181:4cf5e92caec2
1118 new changesets 35358f982181:4cf5e92caec2
1115 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1119 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1116
1120
1117 $ hg strip -k -r 35358f982181
1121 $ hg strip -k -r 35358f982181
1118 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1122 saved backup bundle to $TESTTMP/issue4736/.hg/strip-backup/35358f982181-a6f020aa-backup.hg
1119 $ hg log -G
1123 $ hg log -G
1120 @ changeset: 3:f62c6c09b707
1124 @ changeset: 3:f62c6c09b707
1121 | branch: new-branch
1125 | branch: new-branch
1122 | tag: tip
1126 | tag: tip
1123 | user: test
1127 | user: test
1124 | date: Thu Jan 01 00:00:00 1970 +0000
1128 | date: Thu Jan 01 00:00:00 1970 +0000
1125 | summary: foo
1129 | summary: foo
1126 |
1130 |
1127 o changeset: 2:b1d33a8cadd9
1131 o changeset: 2:b1d33a8cadd9
1128 | branch: new-branch
1132 | branch: new-branch
1129 | user: test
1133 | user: test
1130 | date: Thu Jan 01 00:00:00 1970 +0000
1134 | date: Thu Jan 01 00:00:00 1970 +0000
1131 | summary: start new branch
1135 | summary: start new branch
1132 |
1136 |
1133 o changeset: 1:eca11cf91c71
1137 o changeset: 1:eca11cf91c71
1134 | user: test
1138 | user: test
1135 | date: Thu Jan 01 00:00:00 1970 +0000
1139 | date: Thu Jan 01 00:00:00 1970 +0000
1136 | summary: commitB
1140 | summary: commitB
1137 |
1141 |
1138 o changeset: 0:105141ef12d0
1142 o changeset: 0:105141ef12d0
1139 user: test
1143 user: test
1140 date: Thu Jan 01 00:00:00 1970 +0000
1144 date: Thu Jan 01 00:00:00 1970 +0000
1141 summary: commitA
1145 summary: commitA
1142
1146
1143 $ hg diff
1147 $ hg diff
1144 diff -r f62c6c09b707 bar.txt
1148 diff -r f62c6c09b707 bar.txt
1145 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1149 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1146 +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000
1150 +++ b/bar.txt Thu Jan 01 00:00:00 1970 +0000
1147 @@ -0,0 +1,1 @@
1151 @@ -0,0 +1,1 @@
1148 +bar
1152 +bar
1149
1153
1150 Use delayedstrip to strip inside a transaction
1154 Use delayedstrip to strip inside a transaction
1151
1155
1152 $ cd $TESTTMP
1156 $ cd $TESTTMP
1153 $ hg init delayedstrip
1157 $ hg init delayedstrip
1154 $ cd delayedstrip
1158 $ cd delayedstrip
1155 $ hg debugdrawdag <<'EOS'
1159 $ hg debugdrawdag <<'EOS'
1156 > D
1160 > D
1157 > |
1161 > |
1158 > C F H # Commit on top of "I",
1162 > C F H # Commit on top of "I",
1159 > | |/| # Strip B+D+I+E+G+H+Z
1163 > | |/| # Strip B+D+I+E+G+H+Z
1160 > I B E G
1164 > I B E G
1161 > \|/
1165 > \|/
1162 > A Z
1166 > A Z
1163 > EOS
1167 > EOS
1164 $ cp -R . ../scmutilcleanup
1168 $ cp -R . ../scmutilcleanup
1165
1169
1166 $ hg up -C I
1170 $ hg up -C I
1167 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1171 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1168 $ echo 3 >> I
1172 $ echo 3 >> I
1169 $ cat > $TESTTMP/delayedstrip.py <<EOF
1173 $ cat > $TESTTMP/delayedstrip.py <<EOF
1170 > from __future__ import absolute_import
1174 > from __future__ import absolute_import
1171 > from mercurial import commands, registrar, repair
1175 > from mercurial import commands, registrar, repair
1172 > cmdtable = {}
1176 > cmdtable = {}
1173 > command = registrar.command(cmdtable)
1177 > command = registrar.command(cmdtable)
1174 > @command(b'testdelayedstrip')
1178 > @command(b'testdelayedstrip')
1175 > def testdelayedstrip(ui, repo):
1179 > def testdelayedstrip(ui, repo):
1176 > def getnodes(expr):
1180 > def getnodes(expr):
1177 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1181 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1178 > with repo.wlock():
1182 > with repo.wlock():
1179 > with repo.lock():
1183 > with repo.lock():
1180 > with repo.transaction(b'delayedstrip'):
1184 > with repo.transaction(b'delayedstrip'):
1181 > repair.delayedstrip(ui, repo, getnodes(b'B+I+Z+D+E'), b'J')
1185 > repair.delayedstrip(ui, repo, getnodes(b'B+I+Z+D+E'), b'J')
1182 > repair.delayedstrip(ui, repo, getnodes(b'G+H+Z'), b'I')
1186 > repair.delayedstrip(ui, repo, getnodes(b'G+H+Z'), b'I')
1183 > commands.commit(ui, repo, message=b'J', date=b'0 0')
1187 > commands.commit(ui, repo, message=b'J', date=b'0 0')
1184 > EOF
1188 > EOF
1185 $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py
1189 $ hg testdelayedstrip --config extensions.t=$TESTTMP/delayedstrip.py
1186 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
1190 warning: orphaned descendants detected, not stripping 08ebfeb61bac, 112478962961, 7fb047a69f22
1187 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg
1191 saved backup bundle to $TESTTMP/delayedstrip/.hg/strip-backup/f585351a92f8-17475721-I.hg
1188
1192
1189 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
1193 $ hg log -G -T '{rev}:{node|short} {desc}' -r 'sort(all(), topo)'
1190 @ 6:2f2d51af6205 J
1194 @ 6:2f2d51af6205 J
1191 |
1195 |
1192 o 3:08ebfeb61bac I
1196 o 3:08ebfeb61bac I
1193 |
1197 |
1194 | o 5:64a8289d2492 F
1198 | o 5:64a8289d2492 F
1195 | |
1199 | |
1196 | o 2:7fb047a69f22 E
1200 | o 2:7fb047a69f22 E
1197 |/
1201 |/
1198 | o 4:26805aba1e60 C
1202 | o 4:26805aba1e60 C
1199 | |
1203 | |
1200 | o 1:112478962961 B
1204 | o 1:112478962961 B
1201 |/
1205 |/
1202 o 0:426bada5c675 A
1206 o 0:426bada5c675 A
1203
1207
1204 Test high-level scmutil.cleanupnodes API
1208 Test high-level scmutil.cleanupnodes API
1205
1209
1206 $ cd $TESTTMP/scmutilcleanup
1210 $ cd $TESTTMP/scmutilcleanup
1207 $ hg debugdrawdag <<'EOS'
1211 $ hg debugdrawdag <<'EOS'
1208 > D2 F2 G2 # D2, F2, G2 are replacements for D, F, G
1212 > D2 F2 G2 # D2, F2, G2 are replacements for D, F, G
1209 > | | |
1213 > | | |
1210 > C H G
1214 > C H G
1211 > EOS
1215 > EOS
1212 $ for i in B C D F G I Z; do
1216 $ for i in B C D F G I Z; do
1213 > hg bookmark -i -r $i b-$i
1217 > hg bookmark -i -r $i b-$i
1214 > done
1218 > done
1215 $ hg bookmark -i -r E 'b-F@divergent1'
1219 $ hg bookmark -i -r E 'b-F@divergent1'
1216 $ hg bookmark -i -r H 'b-F@divergent2'
1220 $ hg bookmark -i -r H 'b-F@divergent2'
1217 $ hg bookmark -i -r G 'b-F@divergent3'
1221 $ hg bookmark -i -r G 'b-F@divergent3'
1218 $ cp -R . ../scmutilcleanup.obsstore
1222 $ cp -R . ../scmutilcleanup.obsstore
1219
1223
1220 $ cat > $TESTTMP/scmutilcleanup.py <<EOF
1224 $ cat > $TESTTMP/scmutilcleanup.py <<EOF
1221 > from mercurial import registrar, scmutil
1225 > from mercurial import registrar, scmutil
1222 > cmdtable = {}
1226 > cmdtable = {}
1223 > command = registrar.command(cmdtable)
1227 > command = registrar.command(cmdtable)
1224 > @command(b'testnodescleanup')
1228 > @command(b'testnodescleanup')
1225 > def testnodescleanup(ui, repo):
1229 > def testnodescleanup(ui, repo):
1226 > def nodes(expr):
1230 > def nodes(expr):
1227 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1231 > return [repo.changelog.node(r) for r in repo.revs(expr)]
1228 > def node(expr):
1232 > def node(expr):
1229 > return nodes(expr)[0]
1233 > return nodes(expr)[0]
1230 > with repo.wlock():
1234 > with repo.wlock():
1231 > with repo.lock():
1235 > with repo.lock():
1232 > with repo.transaction(b'delayedstrip'):
1236 > with repo.transaction(b'delayedstrip'):
1233 > mapping = {node(b'F'): [node(b'F2')],
1237 > mapping = {node(b'F'): [node(b'F2')],
1234 > node(b'D'): [node(b'D2')],
1238 > node(b'D'): [node(b'D2')],
1235 > node(b'G'): [node(b'G2')]}
1239 > node(b'G'): [node(b'G2')]}
1236 > scmutil.cleanupnodes(repo, mapping, b'replace')
1240 > scmutil.cleanupnodes(repo, mapping, b'replace')
1237 > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2'),
1241 > scmutil.cleanupnodes(repo, nodes(b'((B::)+I+Z)-D2'),
1238 > b'replace')
1242 > b'replace')
1239 > EOF
1243 > EOF
1240 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1244 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1241 warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60
1245 warning: orphaned descendants detected, not stripping 112478962961, 1fc8102cda62, 26805aba1e60
1242 saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg
1246 saved backup bundle to $TESTTMP/scmutilcleanup/.hg/strip-backup/f585351a92f8-73fb7c03-replace.hg
1243
1247
1244 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1248 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1245 o 8:1473d4b996d1 G2 b-F@divergent3 b-G
1249 o 8:1473d4b996d1 G2 b-F@divergent3 b-G
1246 |
1250 |
1247 | o 7:d11b3456a873 F2 b-F
1251 | o 7:d11b3456a873 F2 b-F
1248 | |
1252 | |
1249 | o 5:5cb05ba470a7 H
1253 | o 5:5cb05ba470a7 H
1250 |/|
1254 |/|
1251 | o 3:7fb047a69f22 E b-F@divergent1
1255 | o 3:7fb047a69f22 E b-F@divergent1
1252 | |
1256 | |
1253 | | o 6:7c78f703e465 D2 b-D
1257 | | o 6:7c78f703e465 D2 b-D
1254 | | |
1258 | | |
1255 | | o 4:26805aba1e60 C
1259 | | o 4:26805aba1e60 C
1256 | | |
1260 | | |
1257 | | o 2:112478962961 B
1261 | | o 2:112478962961 B
1258 | |/
1262 | |/
1259 o | 1:1fc8102cda62 G
1263 o | 1:1fc8102cda62 G
1260 /
1264 /
1261 o 0:426bada5c675 A b-B b-C b-I
1265 o 0:426bada5c675 A b-B b-C b-I
1262
1266
1263 $ hg bookmark
1267 $ hg bookmark
1264 b-B 0:426bada5c675
1268 b-B 0:426bada5c675
1265 b-C 0:426bada5c675
1269 b-C 0:426bada5c675
1266 b-D 6:7c78f703e465
1270 b-D 6:7c78f703e465
1267 b-F 7:d11b3456a873
1271 b-F 7:d11b3456a873
1268 b-F@divergent1 3:7fb047a69f22
1272 b-F@divergent1 3:7fb047a69f22
1269 b-F@divergent3 8:1473d4b996d1
1273 b-F@divergent3 8:1473d4b996d1
1270 b-G 8:1473d4b996d1
1274 b-G 8:1473d4b996d1
1271 b-I 0:426bada5c675
1275 b-I 0:426bada5c675
1272 b-Z -1:000000000000
1276 b-Z -1:000000000000
1273
1277
1274 Test the above using obsstore "by the way". Not directly related to strip, but
1278 Test the above using obsstore "by the way". Not directly related to strip, but
1275 we have reusable code here
1279 we have reusable code here
1276
1280
1277 $ cd $TESTTMP/scmutilcleanup.obsstore
1281 $ cd $TESTTMP/scmutilcleanup.obsstore
1278 $ cat >> .hg/hgrc <<EOF
1282 $ cat >> .hg/hgrc <<EOF
1279 > [experimental]
1283 > [experimental]
1280 > evolution=true
1284 > evolution=true
1281 > evolution.track-operation=1
1285 > evolution.track-operation=1
1282 > EOF
1286 > EOF
1283
1287
1284 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1288 $ hg testnodescleanup --config extensions.t=$TESTTMP/scmutilcleanup.py
1285 4 new orphan changesets
1289 4 new orphan changesets
1286
1290
1287 $ rm .hg/localtags
1291 $ rm .hg/localtags
1288 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1292 $ hg log -G -T '{rev}:{node|short} {desc} {bookmarks}' -r 'sort(all(), topo)'
1289 * 12:1473d4b996d1 G2 b-F@divergent3 b-G
1293 * 12:1473d4b996d1 G2 b-F@divergent3 b-G
1290 |
1294 |
1291 | * 11:d11b3456a873 F2 b-F
1295 | * 11:d11b3456a873 F2 b-F
1292 | |
1296 | |
1293 | * 8:5cb05ba470a7 H
1297 | * 8:5cb05ba470a7 H
1294 |/|
1298 |/|
1295 | o 4:7fb047a69f22 E b-F@divergent1
1299 | o 4:7fb047a69f22 E b-F@divergent1
1296 | |
1300 | |
1297 | | * 10:7c78f703e465 D2 b-D
1301 | | * 10:7c78f703e465 D2 b-D
1298 | | |
1302 | | |
1299 | | x 6:26805aba1e60 C
1303 | | x 6:26805aba1e60 C
1300 | | |
1304 | | |
1301 | | x 3:112478962961 B
1305 | | x 3:112478962961 B
1302 | |/
1306 | |/
1303 x | 1:1fc8102cda62 G
1307 x | 1:1fc8102cda62 G
1304 /
1308 /
1305 o 0:426bada5c675 A b-B b-C b-I
1309 o 0:426bada5c675 A b-B b-C b-I
1306
1310
1307 $ hg debugobsolete
1311 $ hg debugobsolete
1308 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1312 1fc8102cda6204549f031015641606ccf5513ec3 1473d4b996d1d1b121de6b39fab6a04fbf9d873e 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1309 64a8289d249234b9886244d379f15e6b650b28e3 d11b3456a873daec7c7bc53e5622e8df6d741bd2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1313 64a8289d249234b9886244d379f15e6b650b28e3 d11b3456a873daec7c7bc53e5622e8df6d741bd2 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '13', 'operation': 'replace', 'user': 'test'}
1310 f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'replace', 'user': 'test'}
1314 f585351a92f85104bff7c284233c338b10eb1df7 7c78f703e465d73102cc8780667ce269c5208a40 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '9', 'operation': 'replace', 'user': 'test'}
1311 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1315 48b9aae0607f43ff110d84e6883c151942add5ab 0 {0000000000000000000000000000000000000000} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1312 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1316 112478962961147124edd43549aedd1a335e44bf 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1313 08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1317 08ebfeb61bac6e3f12079de774d285a0d6689eba 0 {426bada5c67598ca65036d57d9e4b64b0c1ce7a0} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1314 26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1318 26805aba1e600a82e93661149f2313866a221a7b 0 {112478962961147124edd43549aedd1a335e44bf} (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'replace', 'user': 'test'}
1315 $ cd ..
1319 $ cd ..
1316
1320
1317 Test that obsmarkers are restored even when not using generaldelta
1321 Test that obsmarkers are restored even when not using generaldelta
1318
1322
1319 $ hg --config format.usegeneraldelta=no init issue5678
1323 $ hg --config format.usegeneraldelta=no init issue5678
1320 $ cd issue5678
1324 $ cd issue5678
1321 $ cat >> .hg/hgrc <<EOF
1325 $ cat >> .hg/hgrc <<EOF
1322 > [experimental]
1326 > [experimental]
1323 > evolution=true
1327 > evolution=true
1324 > EOF
1328 > EOF
1325 $ echo a > a
1329 $ echo a > a
1326 $ hg ci -Aqm a
1330 $ hg ci -Aqm a
1327 $ hg ci --amend -m a2
1331 $ hg ci --amend -m a2
1328 $ hg debugobsolete
1332 $ hg debugobsolete
1329 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1333 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1330 $ hg strip .
1334 $ hg strip .
1331 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1335 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1332 saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg
1336 saved backup bundle to $TESTTMP/issue5678/.hg/strip-backup/489bac576828-bef27e14-backup.hg
1333 $ hg unbundle -q .hg/strip-backup/*
1337 $ hg unbundle -q .hg/strip-backup/*
1334 $ hg debugobsolete
1338 $ hg debugobsolete
1335 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1339 cb9a9f314b8b07ba71012fcdbc544b5a4d82ff5b 489bac576828490c0bb8d45eac9e5e172e4ec0a8 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '1', 'operation': 'amend', 'user': 'test'}
1336 $ cd ..
1340 $ cd ..
@@ -1,1211 +1,1205 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extdiff]
2 > [extdiff]
3 > # for portability:
3 > # for portability:
4 > pdiff = sh "$RUNTESTDIR/pdiff"
4 > pdiff = sh "$RUNTESTDIR/pdiff"
5 > [progress]
5 > [progress]
6 > disable=False
6 > disable=False
7 > assume-tty = 1
7 > assume-tty = 1
8 > delay = 0
8 > delay = 0
9 > # set changedelay really large so we don't see nested topics
9 > # set changedelay really large so we don't see nested topics
10 > changedelay = 30000
10 > changedelay = 30000
11 > format = topic bar number
11 > format = topic bar number
12 > refresh = 0
12 > refresh = 0
13 > width = 60
13 > width = 60
14 > EOF
14 > EOF
15
15
16 Preparing the subrepository 'sub2'
16 Preparing the subrepository 'sub2'
17
17
18 $ hg init sub2
18 $ hg init sub2
19 $ echo sub2 > sub2/sub2
19 $ echo sub2 > sub2/sub2
20 $ hg add -R sub2
20 $ hg add -R sub2
21 adding sub2/sub2
21 adding sub2/sub2
22 $ hg commit -R sub2 -m "sub2 import"
22 $ hg commit -R sub2 -m "sub2 import"
23
23
24 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
24 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
25
25
26 $ hg init sub1
26 $ hg init sub1
27 $ echo sub1 > sub1/sub1
27 $ echo sub1 > sub1/sub1
28 $ echo "sub2 = ../sub2" > sub1/.hgsub
28 $ echo "sub2 = ../sub2" > sub1/.hgsub
29 $ hg clone sub2 sub1/sub2
29 $ hg clone sub2 sub1/sub2
30 \r (no-eol) (esc)
30 \r (no-eol) (esc)
31 linking [ <=> ] 1\r (no-eol) (esc)
31 linking [ <=> ] 1\r (no-eol) (esc)
32 linking [ <=> ] 2\r (no-eol) (esc)
32 linking [ <=> ] 2\r (no-eol) (esc)
33 linking [ <=> ] 3\r (no-eol) (esc)
33 linking [ <=> ] 3\r (no-eol) (esc)
34 linking [ <=> ] 4\r (no-eol) (esc)
34 linking [ <=> ] 4\r (no-eol) (esc)
35 linking [ <=> ] 5\r (no-eol) (esc)
35 linking [ <=> ] 5\r (no-eol) (esc)
36 linking [ <=> ] 6\r (no-eol) (esc)
36 linking [ <=> ] 6\r (no-eol) (esc)
37 linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !)
38 \r (no-eol) (esc)
37 \r (no-eol) (esc)
39 \r (no-eol) (esc)
38 \r (no-eol) (esc)
40 updating [===========================================>] 1/1\r (no-eol) (esc)
39 updating [===========================================>] 1/1\r (no-eol) (esc)
41 \r (no-eol) (esc)
40 \r (no-eol) (esc)
42 updating to branch default
41 updating to branch default
43 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
42 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
44 $ hg add -R sub1
43 $ hg add -R sub1
45 adding sub1/.hgsub
44 adding sub1/.hgsub
46 adding sub1/sub1
45 adding sub1/sub1
47 $ hg commit -R sub1 -m "sub1 import"
46 $ hg commit -R sub1 -m "sub1 import"
48
47
49 Preparing the 'main' repo which depends on the subrepo 'sub1'
48 Preparing the 'main' repo which depends on the subrepo 'sub1'
50
49
51 $ hg init main
50 $ hg init main
52 $ echo main > main/main
51 $ echo main > main/main
53 $ echo "sub1 = ../sub1" > main/.hgsub
52 $ echo "sub1 = ../sub1" > main/.hgsub
54 $ hg clone sub1 main/sub1
53 $ hg clone sub1 main/sub1
55 \r (no-eol) (esc)
54 \r (no-eol) (esc)
56 linking [ <=> ] 1\r (no-eol) (esc)
55 linking [ <=> ] 1\r (no-eol) (esc)
57 linking [ <=> ] 2\r (no-eol) (esc)
56 linking [ <=> ] 2\r (no-eol) (esc)
58 linking [ <=> ] 3\r (no-eol) (esc)
57 linking [ <=> ] 3\r (no-eol) (esc)
59 linking [ <=> ] 4\r (no-eol) (esc)
58 linking [ <=> ] 4\r (no-eol) (esc)
60 linking [ <=> ] 5\r (no-eol) (esc)
59 linking [ <=> ] 5\r (no-eol) (esc)
61 linking [ <=> ] 6\r (no-eol) (esc)
60 linking [ <=> ] 6\r (no-eol) (esc)
62 linking [ <=> ] 7\r (no-eol) (esc)
61 linking [ <=> ] 7\r (no-eol) (esc)
63 linking [ <=> ] 8\r (no-eol) (esc)
62 linking [ <=> ] 8\r (no-eol) (esc)
64 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
63 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
65 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
64 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
66 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
67 \r (no-eol) (esc)
65 \r (no-eol) (esc)
68 \r (no-eol) (esc)
66 \r (no-eol) (esc)
69 updating [===========================================>] 3/3\r (no-eol) (esc)
67 updating [===========================================>] 3/3\r (no-eol) (esc)
70 \r (no-eol) (esc)
68 \r (no-eol) (esc)
71 \r (no-eol) (esc)
69 \r (no-eol) (esc)
72 linking [ <=> ] 1\r (no-eol) (esc)
70 linking [ <=> ] 1\r (no-eol) (esc)
73 linking [ <=> ] 2\r (no-eol) (esc)
71 linking [ <=> ] 2\r (no-eol) (esc)
74 linking [ <=> ] 3\r (no-eol) (esc)
72 linking [ <=> ] 3\r (no-eol) (esc)
75 linking [ <=> ] 4\r (no-eol) (esc)
73 linking [ <=> ] 4\r (no-eol) (esc)
76 linking [ <=> ] 5\r (no-eol) (esc)
74 linking [ <=> ] 5\r (no-eol) (esc)
77 linking [ <=> ] 6\r (no-eol) (esc)
75 linking [ <=> ] 6\r (no-eol) (esc)
78 linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !)
79 updating [===========================================>] 1/1\r (no-eol) (esc)
76 updating [===========================================>] 1/1\r (no-eol) (esc)
80 \r (no-eol) (esc)
77 \r (no-eol) (esc)
81 updating to branch default
78 updating to branch default
82 cloning subrepo sub2 from $TESTTMP/sub2
79 cloning subrepo sub2 from $TESTTMP/sub2
83 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
80 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 $ hg add -R main
81 $ hg add -R main
85 adding main/.hgsub
82 adding main/.hgsub
86 adding main/main
83 adding main/main
87 $ hg commit -R main -m "main import"
84 $ hg commit -R main -m "main import"
88
85
89 #if serve
86 #if serve
90
87
91 Unfortunately, subrepos not at their nominal location cannot be cloned. But
88 Unfortunately, subrepos not at their nominal location cannot be cloned. But
92 they are still served from their location within the local repository. The only
89 they are still served from their location within the local repository. The only
93 reason why 'main' can be cloned via the filesystem is because 'sub1' and 'sub2'
90 reason why 'main' can be cloned via the filesystem is because 'sub1' and 'sub2'
94 are also available as siblings of 'main'.
91 are also available as siblings of 'main'.
95
92
96 $ hg serve -R main --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log
93 $ hg serve -R main --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log
97 adding = $TESTTMP/main
94 adding = $TESTTMP/main
98 adding sub1 = $TESTTMP/main/sub1
95 adding sub1 = $TESTTMP/main/sub1
99 adding sub1/sub2 = $TESTTMP/main/sub1/sub2
96 adding sub1/sub2 = $TESTTMP/main/sub1/sub2
100 listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?)
97 listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?)
101 adding = $TESTTMP/main (?)
98 adding = $TESTTMP/main (?)
102 adding sub1 = $TESTTMP/main/sub1 (?)
99 adding sub1 = $TESTTMP/main/sub1 (?)
103 adding sub1/sub2 = $TESTTMP/main/sub1/sub2 (?)
100 adding sub1/sub2 = $TESTTMP/main/sub1/sub2 (?)
104 $ cat hg1.pid >> $DAEMON_PIDS
101 $ cat hg1.pid >> $DAEMON_PIDS
105
102
106 $ hg clone http://localhost:$HGPORT httpclone --config progress.disable=True
103 $ hg clone http://localhost:$HGPORT httpclone --config progress.disable=True
107 requesting all changes
104 requesting all changes
108 adding changesets
105 adding changesets
109 adding manifests
106 adding manifests
110 adding file changes
107 adding file changes
111 added 1 changesets with 3 changes to 3 files
108 added 1 changesets with 3 changes to 3 files
112 new changesets 7f491f53a367
109 new changesets 7f491f53a367
113 updating to branch default
110 updating to branch default
114 abort: HTTP Error 404: Not Found
111 abort: HTTP Error 404: Not Found
115 [255]
112 [255]
116
113
117 $ cat access.log
114 $ cat access.log
118 * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
115 * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
119 * "GET /?cmd=batch HTTP/1.1" 200 - * (glob)
116 * "GET /?cmd=batch HTTP/1.1" 200 - * (glob)
120 * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob)
117 * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob)
121 * "GET /../sub1?cmd=capabilities HTTP/1.1" 404 - (glob)
118 * "GET /../sub1?cmd=capabilities HTTP/1.1" 404 - (glob)
122 $ cat error.log
119 $ cat error.log
123
120
124 $ killdaemons.py
121 $ killdaemons.py
125 $ rm hg1.pid error.log access.log
122 $ rm hg1.pid error.log access.log
126 #endif
123 #endif
127
124
128 Cleaning both repositories, just as a clone -U
125 Cleaning both repositories, just as a clone -U
129
126
130 $ hg up -C -R sub2 null
127 $ hg up -C -R sub2 null
131 \r (no-eol) (esc)
128 \r (no-eol) (esc)
132 updating [===========================================>] 1/1\r (no-eol) (esc)
129 updating [===========================================>] 1/1\r (no-eol) (esc)
133 \r (no-eol) (esc)
130 \r (no-eol) (esc)
134 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
131 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
135 $ hg up -C -R sub1 null
132 $ hg up -C -R sub1 null
136 \r (no-eol) (esc)
133 \r (no-eol) (esc)
137 updating [===========================================>] 1/1\r (no-eol) (esc)
134 updating [===========================================>] 1/1\r (no-eol) (esc)
138 \r (no-eol) (esc)
135 \r (no-eol) (esc)
139 \r (no-eol) (esc)
136 \r (no-eol) (esc)
140 updating [===========================================>] 3/3\r (no-eol) (esc)
137 updating [===========================================>] 3/3\r (no-eol) (esc)
141 \r (no-eol) (esc)
138 \r (no-eol) (esc)
142 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
139 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
143 $ hg up -C -R main null
140 $ hg up -C -R main null
144 \r (no-eol) (esc)
141 \r (no-eol) (esc)
145 updating [===========================================>] 1/1\r (no-eol) (esc)
142 updating [===========================================>] 1/1\r (no-eol) (esc)
146 \r (no-eol) (esc)
143 \r (no-eol) (esc)
147 \r (no-eol) (esc)
144 \r (no-eol) (esc)
148 updating [===========================================>] 3/3\r (no-eol) (esc)
145 updating [===========================================>] 3/3\r (no-eol) (esc)
149 \r (no-eol) (esc)
146 \r (no-eol) (esc)
150 \r (no-eol) (esc)
147 \r (no-eol) (esc)
151 updating [===========================================>] 3/3\r (no-eol) (esc)
148 updating [===========================================>] 3/3\r (no-eol) (esc)
152 \r (no-eol) (esc)
149 \r (no-eol) (esc)
153 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
150 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
154 $ rm -rf main/sub1
151 $ rm -rf main/sub1
155 $ rm -rf sub1/sub2
152 $ rm -rf sub1/sub2
156
153
157 Clone main
154 Clone main
158
155
159 $ hg --config extensions.largefiles= clone main cloned
156 $ hg --config extensions.largefiles= clone main cloned
160 \r (no-eol) (esc)
157 \r (no-eol) (esc)
161 linking [ <=> ] 1\r (no-eol) (esc)
158 linking [ <=> ] 1\r (no-eol) (esc)
162 linking [ <=> ] 2\r (no-eol) (esc)
159 linking [ <=> ] 2\r (no-eol) (esc)
163 linking [ <=> ] 3\r (no-eol) (esc)
160 linking [ <=> ] 3\r (no-eol) (esc)
164 linking [ <=> ] 4\r (no-eol) (esc)
161 linking [ <=> ] 4\r (no-eol) (esc)
165 linking [ <=> ] 5\r (no-eol) (esc)
162 linking [ <=> ] 5\r (no-eol) (esc)
166 linking [ <=> ] 6\r (no-eol) (esc)
163 linking [ <=> ] 6\r (no-eol) (esc)
167 linking [ <=> ] 7\r (no-eol) (esc)
164 linking [ <=> ] 7\r (no-eol) (esc)
168 linking [ <=> ] 8\r (no-eol) (esc)
165 linking [ <=> ] 8\r (no-eol) (esc)
169 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
166 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
170 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
167 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
171 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
172 \r (no-eol) (esc)
168 \r (no-eol) (esc)
173 \r (no-eol) (esc)
169 \r (no-eol) (esc)
174 updating [===========================================>] 3/3\r (no-eol) (esc)
170 updating [===========================================>] 3/3\r (no-eol) (esc)
175 \r (no-eol) (esc)
171 \r (no-eol) (esc)
176 \r (no-eol) (esc)
172 \r (no-eol) (esc)
177 linking [ <=> ] 1\r (no-eol) (esc)
173 linking [ <=> ] 1\r (no-eol) (esc)
178 linking [ <=> ] 2\r (no-eol) (esc)
174 linking [ <=> ] 2\r (no-eol) (esc)
179 linking [ <=> ] 3\r (no-eol) (esc)
175 linking [ <=> ] 3\r (no-eol) (esc)
180 linking [ <=> ] 4\r (no-eol) (esc)
176 linking [ <=> ] 4\r (no-eol) (esc)
181 linking [ <=> ] 5\r (no-eol) (esc)
177 linking [ <=> ] 5\r (no-eol) (esc)
182 linking [ <=> ] 6\r (no-eol) (esc)
178 linking [ <=> ] 6\r (no-eol) (esc)
183 linking [ <=> ] 7\r (no-eol) (esc)
179 linking [ <=> ] 7\r (no-eol) (esc)
184 linking [ <=> ] 8\r (no-eol) (esc)
180 linking [ <=> ] 8\r (no-eol) (esc)
185 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
181 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
186 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
182 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
187 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
188 updating [===========================================>] 3/3\r (no-eol) (esc)
183 updating [===========================================>] 3/3\r (no-eol) (esc)
189 \r (no-eol) (esc)
184 \r (no-eol) (esc)
190 \r (no-eol) (esc)
185 \r (no-eol) (esc)
191 linking [ <=> ] 1\r (no-eol) (esc) (no-reposimplestore !)
186 linking [ <=> ] 1\r (no-eol) (esc) (no-reposimplestore !)
192 linking [ <=> ] 2\r (no-eol) (esc) (no-reposimplestore !)
187 linking [ <=> ] 2\r (no-eol) (esc) (no-reposimplestore !)
193 linking [ <=> ] 3\r (no-eol) (esc) (no-reposimplestore !)
188 linking [ <=> ] 3\r (no-eol) (esc) (no-reposimplestore !)
194 linking [ <=> ] 4\r (no-eol) (esc) (no-reposimplestore !)
189 linking [ <=> ] 4\r (no-eol) (esc) (no-reposimplestore !)
195 linking [ <=> ] 5\r (no-eol) (esc) (no-reposimplestore !)
190 linking [ <=> ] 5\r (no-eol) (esc) (no-reposimplestore !)
196 linking [ <=> ] 6\r (no-eol) (esc) (no-reposimplestore !)
191 linking [ <=> ] 6\r (no-eol) (esc) (no-reposimplestore !)
197 linking [ <=> ] 1\r (no-eol) (esc) (reposimplestore !)
192 linking [ <=> ] 1\r (no-eol) (esc) (reposimplestore !)
198 linking [ <=> ] 2\r (no-eol) (esc) (reposimplestore !)
193 linking [ <=> ] 2\r (no-eol) (esc) (reposimplestore !)
199 linking [ <=> ] 3\r (no-eol) (esc) (reposimplestore !)
194 linking [ <=> ] 3\r (no-eol) (esc) (reposimplestore !)
200 linking [ <=> ] 4\r (no-eol) (esc) (reposimplestore !)
195 linking [ <=> ] 4\r (no-eol) (esc) (reposimplestore !)
201 linking [ <=> ] 5\r (no-eol) (esc) (reposimplestore !)
196 linking [ <=> ] 5\r (no-eol) (esc) (reposimplestore !)
202 linking [ <=> ] 6\r (no-eol) (esc) (reposimplestore !)
197 linking [ <=> ] 6\r (no-eol) (esc) (reposimplestore !)
203 linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !)
204 updating [===========================================>] 1/1\r (no-eol) (esc)
198 updating [===========================================>] 1/1\r (no-eol) (esc)
205 \r (no-eol) (esc)
199 \r (no-eol) (esc)
206 updating to branch default
200 updating to branch default
207 cloning subrepo sub1 from $TESTTMP/sub1
201 cloning subrepo sub1 from $TESTTMP/sub1
208 cloning subrepo sub1/sub2 from $TESTTMP/sub2
202 cloning subrepo sub1/sub2 from $TESTTMP/sub2
209 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
203 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
210
204
211 Largefiles is NOT enabled in the clone if the source repo doesn't require it
205 Largefiles is NOT enabled in the clone if the source repo doesn't require it
212 $ cat cloned/.hg/hgrc
206 $ cat cloned/.hg/hgrc
213 # example repository config (see 'hg help config' for more info)
207 # example repository config (see 'hg help config' for more info)
214 [paths]
208 [paths]
215 default = $TESTTMP/main
209 default = $TESTTMP/main
216
210
217 # path aliases to other clones of this repo in URLs or filesystem paths
211 # path aliases to other clones of this repo in URLs or filesystem paths
218 # (see 'hg help config.paths' for more info)
212 # (see 'hg help config.paths' for more info)
219 #
213 #
220 # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
214 # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
221 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
215 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
222 # my-clone = /home/jdoe/jdoes-clone
216 # my-clone = /home/jdoe/jdoes-clone
223
217
224 [ui]
218 [ui]
225 # name and email (local to this repository, optional), e.g.
219 # name and email (local to this repository, optional), e.g.
226 # username = Jane Doe <jdoe@example.com>
220 # username = Jane Doe <jdoe@example.com>
227
221
228 Checking cloned repo ids
222 Checking cloned repo ids
229
223
230 $ printf "cloned " ; hg id -R cloned
224 $ printf "cloned " ; hg id -R cloned
231 cloned 7f491f53a367 tip
225 cloned 7f491f53a367 tip
232 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
226 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
233 cloned/sub1 fc3b4ce2696f tip
227 cloned/sub1 fc3b4ce2696f tip
234 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
228 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
235 cloned/sub1/sub2 c57a0840e3ba tip
229 cloned/sub1/sub2 c57a0840e3ba tip
236
230
237 debugsub output for main and sub1
231 debugsub output for main and sub1
238
232
239 $ hg debugsub -R cloned
233 $ hg debugsub -R cloned
240 path sub1
234 path sub1
241 source ../sub1
235 source ../sub1
242 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
236 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
243 $ hg debugsub -R cloned/sub1
237 $ hg debugsub -R cloned/sub1
244 path sub2
238 path sub2
245 source ../sub2
239 source ../sub2
246 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
240 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
247
241
248 Modifying deeply nested 'sub2'
242 Modifying deeply nested 'sub2'
249
243
250 $ echo modified > cloned/sub1/sub2/sub2
244 $ echo modified > cloned/sub1/sub2/sub2
251 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
245 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
252 committing subrepository sub1
246 committing subrepository sub1
253 committing subrepository sub1/sub2
247 committing subrepository sub1/sub2
254
248
255 Checking modified node ids
249 Checking modified node ids
256
250
257 $ printf "cloned " ; hg id -R cloned
251 $ printf "cloned " ; hg id -R cloned
258 cloned ffe6649062fe tip
252 cloned ffe6649062fe tip
259 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
253 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
260 cloned/sub1 2ecb03bf44a9 tip
254 cloned/sub1 2ecb03bf44a9 tip
261 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
255 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
262 cloned/sub1/sub2 53dd3430bcaf tip
256 cloned/sub1/sub2 53dd3430bcaf tip
263
257
264 debugsub output for main and sub1
258 debugsub output for main and sub1
265
259
266 $ hg debugsub -R cloned
260 $ hg debugsub -R cloned
267 path sub1
261 path sub1
268 source ../sub1
262 source ../sub1
269 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
263 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
270 $ hg debugsub -R cloned/sub1
264 $ hg debugsub -R cloned/sub1
271 path sub2
265 path sub2
272 source ../sub2
266 source ../sub2
273 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
267 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
274
268
275 Check that deep archiving works
269 Check that deep archiving works
276
270
277 $ cd cloned
271 $ cd cloned
278 $ echo 'test' > sub1/sub2/test.txt
272 $ echo 'test' > sub1/sub2/test.txt
279 $ hg --config extensions.largefiles=! add sub1/sub2/test.txt
273 $ hg --config extensions.largefiles=! add sub1/sub2/test.txt
280 $ mkdir sub1/sub2/folder
274 $ mkdir sub1/sub2/folder
281 $ echo 'subfolder' > sub1/sub2/folder/test.txt
275 $ echo 'subfolder' > sub1/sub2/folder/test.txt
282 $ hg ci -ASm "add test.txt"
276 $ hg ci -ASm "add test.txt"
283 adding sub1/sub2/folder/test.txt
277 adding sub1/sub2/folder/test.txt
284 committing subrepository sub1
278 committing subrepository sub1
285 committing subrepository sub1/sub2
279 committing subrepository sub1/sub2
286
280
287 $ rm -r main
281 $ rm -r main
288 $ hg archive -S -qr 'wdir()' ../wdir
282 $ hg archive -S -qr 'wdir()' ../wdir
289 $ cat ../wdir/.hg_archival.txt
283 $ cat ../wdir/.hg_archival.txt
290 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
284 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
291 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
285 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
292 branch: default
286 branch: default
293 latesttag: null
287 latesttag: null
294 latesttagdistance: 4
288 latesttagdistance: 4
295 changessincelatesttag: 4
289 changessincelatesttag: 4
296 $ hg update -Cq .
290 $ hg update -Cq .
297
291
298 A deleted subrepo file is flagged as dirty, like the top level repo
292 A deleted subrepo file is flagged as dirty, like the top level repo
299
293
300 $ rm -r ../wdir sub1/sub2/folder/test.txt
294 $ rm -r ../wdir sub1/sub2/folder/test.txt
301 $ hg archive -S -qr 'wdir()' ../wdir
295 $ hg archive -S -qr 'wdir()' ../wdir
302 $ cat ../wdir/.hg_archival.txt
296 $ cat ../wdir/.hg_archival.txt
303 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
297 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
304 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
298 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
305 branch: default
299 branch: default
306 latesttag: null
300 latesttag: null
307 latesttagdistance: 4
301 latesttagdistance: 4
308 changessincelatesttag: 4
302 changessincelatesttag: 4
309 $ hg update -Cq .
303 $ hg update -Cq .
310 $ rm -r ../wdir
304 $ rm -r ../wdir
311
305
312 $ hg archive -S -qr 'wdir()' ../wdir \
306 $ hg archive -S -qr 'wdir()' ../wdir \
313 > --config 'experimental.archivemetatemplate=archived {node|short}\n'
307 > --config 'experimental.archivemetatemplate=archived {node|short}\n'
314 $ cat ../wdir/.hg_archival.txt
308 $ cat ../wdir/.hg_archival.txt
315 archived ffffffffffff
309 archived ffffffffffff
316 $ rm -r ../wdir
310 $ rm -r ../wdir
317
311
318 .. but first take a detour through some deep removal testing
312 .. but first take a detour through some deep removal testing
319
313
320 $ hg remove -S -I 're:.*.txt' .
314 $ hg remove -S -I 're:.*.txt' .
321 \r (no-eol) (esc)
315 \r (no-eol) (esc)
322 searching [==========================================>] 1/1\r (no-eol) (esc)
316 searching [==========================================>] 1/1\r (no-eol) (esc)
323 searching [==========================================>] 1/1\r (no-eol) (esc)
317 searching [==========================================>] 1/1\r (no-eol) (esc)
324 \r (no-eol) (esc)
318 \r (no-eol) (esc)
325 \r (no-eol) (esc)
319 \r (no-eol) (esc)
326 deleting [=====================> ] 1/2\r (no-eol) (esc)
320 deleting [=====================> ] 1/2\r (no-eol) (esc)
327 \r (no-eol) (esc)
321 \r (no-eol) (esc)
328 \r (no-eol) (esc)
322 \r (no-eol) (esc)
329 deleting [===========================================>] 2/2\r (no-eol) (esc)
323 deleting [===========================================>] 2/2\r (no-eol) (esc)
330 \r (no-eol) (esc)
324 \r (no-eol) (esc)
331 removing sub1/sub2/folder/test.txt
325 removing sub1/sub2/folder/test.txt
332 removing sub1/sub2/test.txt
326 removing sub1/sub2/test.txt
333 $ hg status -S
327 $ hg status -S
334 R sub1/sub2/folder/test.txt
328 R sub1/sub2/folder/test.txt
335 R sub1/sub2/test.txt
329 R sub1/sub2/test.txt
336 $ hg update -Cq
330 $ hg update -Cq
337 $ hg remove -I 're:.*.txt' sub1
331 $ hg remove -I 're:.*.txt' sub1
338 \r (no-eol) (esc)
332 \r (no-eol) (esc)
339 searching [==========================================>] 1/1\r (no-eol) (esc)
333 searching [==========================================>] 1/1\r (no-eol) (esc)
340 \r (no-eol) (esc)
334 \r (no-eol) (esc)
341 \r (no-eol) (esc)
335 \r (no-eol) (esc)
342 deleting [===========================================>] 1/1\r (no-eol) (esc)
336 deleting [===========================================>] 1/1\r (no-eol) (esc)
343 \r (no-eol) (esc)
337 \r (no-eol) (esc)
344 $ hg status -S
338 $ hg status -S
345 $ hg remove sub1/sub2/folder/test.txt
339 $ hg remove sub1/sub2/folder/test.txt
346 \r (no-eol) (esc)
340 \r (no-eol) (esc)
347 searching [==========================================>] 1/1\r (no-eol) (esc)
341 searching [==========================================>] 1/1\r (no-eol) (esc)
348 searching [==========================================>] 1/1\r (no-eol) (esc)
342 searching [==========================================>] 1/1\r (no-eol) (esc)
349 \r (no-eol) (esc)
343 \r (no-eol) (esc)
350 \r (no-eol) (esc)
344 \r (no-eol) (esc)
351 deleting [===========================================>] 1/1\r (no-eol) (esc)
345 deleting [===========================================>] 1/1\r (no-eol) (esc)
352 \r (no-eol) (esc)
346 \r (no-eol) (esc)
353 \r (no-eol) (esc)
347 \r (no-eol) (esc)
354 deleting [===========================================>] 1/1\r (no-eol) (esc)
348 deleting [===========================================>] 1/1\r (no-eol) (esc)
355 \r (no-eol) (esc)
349 \r (no-eol) (esc)
356 \r (no-eol) (esc)
350 \r (no-eol) (esc)
357 deleting [===========================================>] 1/1\r (no-eol) (esc)
351 deleting [===========================================>] 1/1\r (no-eol) (esc)
358 \r (no-eol) (esc)
352 \r (no-eol) (esc)
359 $ hg remove sub1/.hgsubstate
353 $ hg remove sub1/.hgsubstate
360 \r (no-eol) (esc)
354 \r (no-eol) (esc)
361 searching [==========================================>] 1/1\r (no-eol) (esc)
355 searching [==========================================>] 1/1\r (no-eol) (esc)
362 \r (no-eol) (esc)
356 \r (no-eol) (esc)
363 \r (no-eol) (esc)
357 \r (no-eol) (esc)
364 deleting [===========================================>] 1/1\r (no-eol) (esc)
358 deleting [===========================================>] 1/1\r (no-eol) (esc)
365 \r (no-eol) (esc)
359 \r (no-eol) (esc)
366 \r (no-eol) (esc)
360 \r (no-eol) (esc)
367 deleting [===========================================>] 1/1\r (no-eol) (esc)
361 deleting [===========================================>] 1/1\r (no-eol) (esc)
368 \r (no-eol) (esc)
362 \r (no-eol) (esc)
369 $ mv sub1/.hgsub sub1/x.hgsub
363 $ mv sub1/.hgsub sub1/x.hgsub
370 $ hg status -S
364 $ hg status -S
371 warning: subrepo spec file 'sub1/.hgsub' not found
365 warning: subrepo spec file 'sub1/.hgsub' not found
372 R sub1/.hgsubstate
366 R sub1/.hgsubstate
373 R sub1/sub2/folder/test.txt
367 R sub1/sub2/folder/test.txt
374 ! sub1/.hgsub
368 ! sub1/.hgsub
375 ? sub1/x.hgsub
369 ? sub1/x.hgsub
376 $ mv sub1/x.hgsub sub1/.hgsub
370 $ mv sub1/x.hgsub sub1/.hgsub
377 $ hg update -Cq
371 $ hg update -Cq
378 $ touch sub1/foo
372 $ touch sub1/foo
379 $ hg forget sub1/sub2/folder/test.txt
373 $ hg forget sub1/sub2/folder/test.txt
380 $ rm sub1/sub2/test.txt
374 $ rm sub1/sub2/test.txt
381
375
382 Test relative path printing + subrepos
376 Test relative path printing + subrepos
383 $ mkdir -p foo/bar
377 $ mkdir -p foo/bar
384 $ cd foo
378 $ cd foo
385 $ touch bar/abc
379 $ touch bar/abc
386 $ hg addremove -S ..
380 $ hg addremove -S ..
387 \r (no-eol) (esc)
381 \r (no-eol) (esc)
388 searching for exact renames [ ] 0/1\r (no-eol) (esc)
382 searching for exact renames [ ] 0/1\r (no-eol) (esc)
389 \r (no-eol) (esc)
383 \r (no-eol) (esc)
390 adding ../sub1/sub2/folder/test.txt
384 adding ../sub1/sub2/folder/test.txt
391 removing ../sub1/sub2/test.txt
385 removing ../sub1/sub2/test.txt
392 adding ../sub1/foo
386 adding ../sub1/foo
393 adding bar/abc
387 adding bar/abc
394 $ cd ..
388 $ cd ..
395 $ hg status -S
389 $ hg status -S
396 A foo/bar/abc
390 A foo/bar/abc
397 A sub1/foo
391 A sub1/foo
398 R sub1/sub2/test.txt
392 R sub1/sub2/test.txt
399
393
400 Archive wdir() with subrepos
394 Archive wdir() with subrepos
401 $ hg rm main
395 $ hg rm main
402 \r (no-eol) (esc)
396 \r (no-eol) (esc)
403 deleting [===========================================>] 1/1\r (no-eol) (esc)
397 deleting [===========================================>] 1/1\r (no-eol) (esc)
404 \r (no-eol) (esc)
398 \r (no-eol) (esc)
405 $ hg archive -S -r 'wdir()' ../wdir
399 $ hg archive -S -r 'wdir()' ../wdir
406 \r (no-eol) (esc)
400 \r (no-eol) (esc)
407 archiving [ ] 0/3\r (no-eol) (esc)
401 archiving [ ] 0/3\r (no-eol) (esc)
408 archiving [=============> ] 1/3\r (no-eol) (esc)
402 archiving [=============> ] 1/3\r (no-eol) (esc)
409 archiving [===========================> ] 2/3\r (no-eol) (esc)
403 archiving [===========================> ] 2/3\r (no-eol) (esc)
410 archiving [==========================================>] 3/3\r (no-eol) (esc)
404 archiving [==========================================>] 3/3\r (no-eol) (esc)
411 \r (no-eol) (esc)
405 \r (no-eol) (esc)
412 \r (no-eol) (esc)
406 \r (no-eol) (esc)
413 archiving (sub1) [ ] 0/4\r (no-eol) (esc)
407 archiving (sub1) [ ] 0/4\r (no-eol) (esc)
414 archiving (sub1) [========> ] 1/4\r (no-eol) (esc)
408 archiving (sub1) [========> ] 1/4\r (no-eol) (esc)
415 archiving (sub1) [=================> ] 2/4\r (no-eol) (esc)
409 archiving (sub1) [=================> ] 2/4\r (no-eol) (esc)
416 archiving (sub1) [==========================> ] 3/4\r (no-eol) (esc)
410 archiving (sub1) [==========================> ] 3/4\r (no-eol) (esc)
417 archiving (sub1) [===================================>] 4/4\r (no-eol) (esc)
411 archiving (sub1) [===================================>] 4/4\r (no-eol) (esc)
418 \r (no-eol) (esc)
412 \r (no-eol) (esc)
419 \r (no-eol) (esc)
413 \r (no-eol) (esc)
420 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
414 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
421 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
415 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
422 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
416 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
423 \r (no-eol) (esc)
417 \r (no-eol) (esc)
424 $ diff -r . ../wdir | egrep -v '\.hg$|^Common subdirectories:'
418 $ diff -r . ../wdir | egrep -v '\.hg$|^Common subdirectories:'
425 Only in ../wdir: .hg_archival.txt
419 Only in ../wdir: .hg_archival.txt
426
420
427 $ find ../wdir -type f | sort
421 $ find ../wdir -type f | sort
428 ../wdir/.hg_archival.txt
422 ../wdir/.hg_archival.txt
429 ../wdir/.hgsub
423 ../wdir/.hgsub
430 ../wdir/.hgsubstate
424 ../wdir/.hgsubstate
431 ../wdir/foo/bar/abc
425 ../wdir/foo/bar/abc
432 ../wdir/sub1/.hgsub
426 ../wdir/sub1/.hgsub
433 ../wdir/sub1/.hgsubstate
427 ../wdir/sub1/.hgsubstate
434 ../wdir/sub1/foo
428 ../wdir/sub1/foo
435 ../wdir/sub1/sub1
429 ../wdir/sub1/sub1
436 ../wdir/sub1/sub2/folder/test.txt
430 ../wdir/sub1/sub2/folder/test.txt
437 ../wdir/sub1/sub2/sub2
431 ../wdir/sub1/sub2/sub2
438
432
439 $ cat ../wdir/.hg_archival.txt
433 $ cat ../wdir/.hg_archival.txt
440 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
434 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
441 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
435 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd+
442 branch: default
436 branch: default
443 latesttag: null
437 latesttag: null
444 latesttagdistance: 4
438 latesttagdistance: 4
445 changessincelatesttag: 4
439 changessincelatesttag: 4
446
440
447 Attempting to archive 'wdir()' with a missing file is handled gracefully
441 Attempting to archive 'wdir()' with a missing file is handled gracefully
448 $ rm sub1/sub1
442 $ rm sub1/sub1
449 $ rm -r ../wdir
443 $ rm -r ../wdir
450 $ hg archive -v -S -r 'wdir()' ../wdir
444 $ hg archive -v -S -r 'wdir()' ../wdir
451 \r (no-eol) (esc)
445 \r (no-eol) (esc)
452 archiving [ ] 0/3\r (no-eol) (esc)
446 archiving [ ] 0/3\r (no-eol) (esc)
453 archiving [=============> ] 1/3\r (no-eol) (esc)
447 archiving [=============> ] 1/3\r (no-eol) (esc)
454 archiving [===========================> ] 2/3\r (no-eol) (esc)
448 archiving [===========================> ] 2/3\r (no-eol) (esc)
455 archiving [==========================================>] 3/3\r (no-eol) (esc)
449 archiving [==========================================>] 3/3\r (no-eol) (esc)
456 \r (no-eol) (esc)
450 \r (no-eol) (esc)
457 \r (no-eol) (esc)
451 \r (no-eol) (esc)
458 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
452 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
459 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
453 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
460 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
454 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
461 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
455 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
462 \r (no-eol) (esc)
456 \r (no-eol) (esc)
463 \r (no-eol) (esc)
457 \r (no-eol) (esc)
464 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
458 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
465 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
459 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
466 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
460 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
467 \r (no-eol) (esc)
461 \r (no-eol) (esc)
468 $ find ../wdir -type f | sort
462 $ find ../wdir -type f | sort
469 ../wdir/.hg_archival.txt
463 ../wdir/.hg_archival.txt
470 ../wdir/.hgsub
464 ../wdir/.hgsub
471 ../wdir/.hgsubstate
465 ../wdir/.hgsubstate
472 ../wdir/foo/bar/abc
466 ../wdir/foo/bar/abc
473 ../wdir/sub1/.hgsub
467 ../wdir/sub1/.hgsub
474 ../wdir/sub1/.hgsubstate
468 ../wdir/sub1/.hgsubstate
475 ../wdir/sub1/foo
469 ../wdir/sub1/foo
476 ../wdir/sub1/sub2/folder/test.txt
470 ../wdir/sub1/sub2/folder/test.txt
477 ../wdir/sub1/sub2/sub2
471 ../wdir/sub1/sub2/sub2
478
472
479 Continue relative path printing + subrepos
473 Continue relative path printing + subrepos
480 $ hg update -Cq
474 $ hg update -Cq
481 $ rm -r ../wdir
475 $ rm -r ../wdir
482 $ hg archive -S -r 'wdir()' ../wdir
476 $ hg archive -S -r 'wdir()' ../wdir
483 \r (no-eol) (esc)
477 \r (no-eol) (esc)
484 archiving [ ] 0/3\r (no-eol) (esc)
478 archiving [ ] 0/3\r (no-eol) (esc)
485 archiving [=============> ] 1/3\r (no-eol) (esc)
479 archiving [=============> ] 1/3\r (no-eol) (esc)
486 archiving [===========================> ] 2/3\r (no-eol) (esc)
480 archiving [===========================> ] 2/3\r (no-eol) (esc)
487 archiving [==========================================>] 3/3\r (no-eol) (esc)
481 archiving [==========================================>] 3/3\r (no-eol) (esc)
488 \r (no-eol) (esc)
482 \r (no-eol) (esc)
489 \r (no-eol) (esc)
483 \r (no-eol) (esc)
490 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
484 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
491 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
485 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
492 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
486 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
493 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
487 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
494 \r (no-eol) (esc)
488 \r (no-eol) (esc)
495 \r (no-eol) (esc)
489 \r (no-eol) (esc)
496 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
490 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
497 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
491 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
498 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
492 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
499 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
493 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
500 \r (no-eol) (esc)
494 \r (no-eol) (esc)
501 $ cat ../wdir/.hg_archival.txt
495 $ cat ../wdir/.hg_archival.txt
502 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
496 repo: 7f491f53a367861f47ee64a80eb997d1f341b77a
503 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd
497 node: 9bb10eebee29dc0f1201dcf5977b811a540255fd
504 branch: default
498 branch: default
505 latesttag: null
499 latesttag: null
506 latesttagdistance: 4
500 latesttagdistance: 4
507 changessincelatesttag: 4
501 changessincelatesttag: 4
508
502
509 $ touch sub1/sub2/folder/bar
503 $ touch sub1/sub2/folder/bar
510 $ hg addremove sub1/sub2
504 $ hg addremove sub1/sub2
511 adding sub1/sub2/folder/bar
505 adding sub1/sub2/folder/bar
512 $ hg status -S
506 $ hg status -S
513 A sub1/sub2/folder/bar
507 A sub1/sub2/folder/bar
514 ? foo/bar/abc
508 ? foo/bar/abc
515 ? sub1/foo
509 ? sub1/foo
516 $ hg update -Cq
510 $ hg update -Cq
517 $ hg addremove sub1
511 $ hg addremove sub1
518 adding sub1/sub2/folder/bar
512 adding sub1/sub2/folder/bar
519 adding sub1/foo
513 adding sub1/foo
520 $ hg update -Cq
514 $ hg update -Cq
521 $ rm sub1/sub2/folder/test.txt
515 $ rm sub1/sub2/folder/test.txt
522 $ rm sub1/sub2/test.txt
516 $ rm sub1/sub2/test.txt
523 $ hg ci -ASm "remove test.txt"
517 $ hg ci -ASm "remove test.txt"
524 adding sub1/sub2/folder/bar
518 adding sub1/sub2/folder/bar
525 removing sub1/sub2/folder/test.txt
519 removing sub1/sub2/folder/test.txt
526 removing sub1/sub2/test.txt
520 removing sub1/sub2/test.txt
527 adding sub1/foo
521 adding sub1/foo
528 adding foo/bar/abc
522 adding foo/bar/abc
529 committing subrepository sub1
523 committing subrepository sub1
530 committing subrepository sub1/sub2
524 committing subrepository sub1/sub2
531
525
532 $ hg forget sub1/sub2/sub2
526 $ hg forget sub1/sub2/sub2
533 $ echo x > sub1/sub2/x.txt
527 $ echo x > sub1/sub2/x.txt
534 $ hg add sub1/sub2/x.txt
528 $ hg add sub1/sub2/x.txt
535
529
536 Files sees uncommitted adds and removes in subrepos
530 Files sees uncommitted adds and removes in subrepos
537 $ hg files -S
531 $ hg files -S
538 .hgsub
532 .hgsub
539 .hgsubstate
533 .hgsubstate
540 foo/bar/abc
534 foo/bar/abc
541 main
535 main
542 sub1/.hgsub
536 sub1/.hgsub
543 sub1/.hgsubstate
537 sub1/.hgsubstate
544 sub1/foo
538 sub1/foo
545 sub1/sub1
539 sub1/sub1
546 sub1/sub2/folder/bar
540 sub1/sub2/folder/bar
547 sub1/sub2/x.txt
541 sub1/sub2/x.txt
548
542
549 $ hg files -S "set:eol('dos') or eol('unix') or size('<= 0')"
543 $ hg files -S "set:eol('dos') or eol('unix') or size('<= 0')"
550 .hgsub
544 .hgsub
551 .hgsubstate
545 .hgsubstate
552 foo/bar/abc
546 foo/bar/abc
553 main
547 main
554 sub1/.hgsub
548 sub1/.hgsub
555 sub1/.hgsubstate
549 sub1/.hgsubstate
556 sub1/foo
550 sub1/foo
557 sub1/sub1
551 sub1/sub1
558 sub1/sub2/folder/bar
552 sub1/sub2/folder/bar
559 sub1/sub2/x.txt
553 sub1/sub2/x.txt
560
554
561 $ hg files -r '.^' -S "set:eol('dos') or eol('unix')"
555 $ hg files -r '.^' -S "set:eol('dos') or eol('unix')"
562 .hgsub
556 .hgsub
563 .hgsubstate
557 .hgsubstate
564 main
558 main
565 sub1/.hgsub
559 sub1/.hgsub
566 sub1/.hgsubstate
560 sub1/.hgsubstate
567 sub1/sub1
561 sub1/sub1
568 sub1/sub2/folder/test.txt
562 sub1/sub2/folder/test.txt
569 sub1/sub2/sub2
563 sub1/sub2/sub2
570 sub1/sub2/test.txt
564 sub1/sub2/test.txt
571
565
572 $ hg files sub1
566 $ hg files sub1
573 sub1/.hgsub
567 sub1/.hgsub
574 sub1/.hgsubstate
568 sub1/.hgsubstate
575 sub1/foo
569 sub1/foo
576 sub1/sub1
570 sub1/sub1
577 sub1/sub2/folder/bar
571 sub1/sub2/folder/bar
578 sub1/sub2/x.txt
572 sub1/sub2/x.txt
579
573
580 $ hg files sub1/sub2
574 $ hg files sub1/sub2
581 sub1/sub2/folder/bar
575 sub1/sub2/folder/bar
582 sub1/sub2/x.txt
576 sub1/sub2/x.txt
583
577
584 $ hg files
578 $ hg files
585 .hgsub
579 .hgsub
586 .hgsubstate
580 .hgsubstate
587 foo/bar/abc
581 foo/bar/abc
588 main
582 main
589
583
590 $ hg files -S -r '.^' sub1/sub2/folder
584 $ hg files -S -r '.^' sub1/sub2/folder
591 sub1/sub2/folder/test.txt
585 sub1/sub2/folder/test.txt
592
586
593 $ hg files -S -r '.^' sub1/sub2/missing
587 $ hg files -S -r '.^' sub1/sub2/missing
594 sub1/sub2/missing: no such file in rev 78026e779ea6
588 sub1/sub2/missing: no such file in rev 78026e779ea6
595 [1]
589 [1]
596
590
597 $ hg files -r '.^' sub1/
591 $ hg files -r '.^' sub1/
598 sub1/.hgsub
592 sub1/.hgsub
599 sub1/.hgsubstate
593 sub1/.hgsubstate
600 sub1/sub1
594 sub1/sub1
601 sub1/sub2/folder/test.txt
595 sub1/sub2/folder/test.txt
602 sub1/sub2/sub2
596 sub1/sub2/sub2
603 sub1/sub2/test.txt
597 sub1/sub2/test.txt
604
598
605 $ hg files -r '.^' sub1/sub2
599 $ hg files -r '.^' sub1/sub2
606 sub1/sub2/folder/test.txt
600 sub1/sub2/folder/test.txt
607 sub1/sub2/sub2
601 sub1/sub2/sub2
608 sub1/sub2/test.txt
602 sub1/sub2/test.txt
609
603
610 $ hg rollback -q
604 $ hg rollback -q
611 $ hg up -Cq
605 $ hg up -Cq
612
606
613 $ hg --config extensions.largefiles=! archive -S ../archive_all
607 $ hg --config extensions.largefiles=! archive -S ../archive_all
614 \r (no-eol) (esc)
608 \r (no-eol) (esc)
615 archiving [ ] 0/3\r (no-eol) (esc)
609 archiving [ ] 0/3\r (no-eol) (esc)
616 archiving [=============> ] 1/3\r (no-eol) (esc)
610 archiving [=============> ] 1/3\r (no-eol) (esc)
617 archiving [===========================> ] 2/3\r (no-eol) (esc)
611 archiving [===========================> ] 2/3\r (no-eol) (esc)
618 archiving [==========================================>] 3/3\r (no-eol) (esc)
612 archiving [==========================================>] 3/3\r (no-eol) (esc)
619 \r (no-eol) (esc)
613 \r (no-eol) (esc)
620 \r (no-eol) (esc)
614 \r (no-eol) (esc)
621 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
615 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
622 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
616 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
623 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
617 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
624 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
618 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
625 \r (no-eol) (esc)
619 \r (no-eol) (esc)
626 \r (no-eol) (esc)
620 \r (no-eol) (esc)
627 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
621 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
628 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
622 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
629 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
623 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
630 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
624 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
631 \r (no-eol) (esc)
625 \r (no-eol) (esc)
632 $ find ../archive_all | sort
626 $ find ../archive_all | sort
633 ../archive_all
627 ../archive_all
634 ../archive_all/.hg_archival.txt
628 ../archive_all/.hg_archival.txt
635 ../archive_all/.hgsub
629 ../archive_all/.hgsub
636 ../archive_all/.hgsubstate
630 ../archive_all/.hgsubstate
637 ../archive_all/main
631 ../archive_all/main
638 ../archive_all/sub1
632 ../archive_all/sub1
639 ../archive_all/sub1/.hgsub
633 ../archive_all/sub1/.hgsub
640 ../archive_all/sub1/.hgsubstate
634 ../archive_all/sub1/.hgsubstate
641 ../archive_all/sub1/sub1
635 ../archive_all/sub1/sub1
642 ../archive_all/sub1/sub2
636 ../archive_all/sub1/sub2
643 ../archive_all/sub1/sub2/folder
637 ../archive_all/sub1/sub2/folder
644 ../archive_all/sub1/sub2/folder/test.txt
638 ../archive_all/sub1/sub2/folder/test.txt
645 ../archive_all/sub1/sub2/sub2
639 ../archive_all/sub1/sub2/sub2
646 ../archive_all/sub1/sub2/test.txt
640 ../archive_all/sub1/sub2/test.txt
647
641
648 Check that archive -X works in deep subrepos
642 Check that archive -X works in deep subrepos
649
643
650 $ hg --config extensions.largefiles=! archive -S -X '**test*' ../archive_exclude
644 $ hg --config extensions.largefiles=! archive -S -X '**test*' ../archive_exclude
651 \r (no-eol) (esc)
645 \r (no-eol) (esc)
652 archiving [ ] 0/3\r (no-eol) (esc)
646 archiving [ ] 0/3\r (no-eol) (esc)
653 archiving [=============> ] 1/3\r (no-eol) (esc)
647 archiving [=============> ] 1/3\r (no-eol) (esc)
654 archiving [===========================> ] 2/3\r (no-eol) (esc)
648 archiving [===========================> ] 2/3\r (no-eol) (esc)
655 archiving [==========================================>] 3/3\r (no-eol) (esc)
649 archiving [==========================================>] 3/3\r (no-eol) (esc)
656 \r (no-eol) (esc)
650 \r (no-eol) (esc)
657 \r (no-eol) (esc)
651 \r (no-eol) (esc)
658 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
652 archiving (sub1) [ ] 0/3\r (no-eol) (esc)
659 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
653 archiving (sub1) [===========> ] 1/3\r (no-eol) (esc)
660 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
654 archiving (sub1) [=======================> ] 2/3\r (no-eol) (esc)
661 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
655 archiving (sub1) [===================================>] 3/3\r (no-eol) (esc)
662 \r (no-eol) (esc)
656 \r (no-eol) (esc)
663 \r (no-eol) (esc)
657 \r (no-eol) (esc)
664 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
658 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
665 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
659 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
666 \r (no-eol) (esc)
660 \r (no-eol) (esc)
667 $ find ../archive_exclude | sort
661 $ find ../archive_exclude | sort
668 ../archive_exclude
662 ../archive_exclude
669 ../archive_exclude/.hg_archival.txt
663 ../archive_exclude/.hg_archival.txt
670 ../archive_exclude/.hgsub
664 ../archive_exclude/.hgsub
671 ../archive_exclude/.hgsubstate
665 ../archive_exclude/.hgsubstate
672 ../archive_exclude/main
666 ../archive_exclude/main
673 ../archive_exclude/sub1
667 ../archive_exclude/sub1
674 ../archive_exclude/sub1/.hgsub
668 ../archive_exclude/sub1/.hgsub
675 ../archive_exclude/sub1/.hgsubstate
669 ../archive_exclude/sub1/.hgsubstate
676 ../archive_exclude/sub1/sub1
670 ../archive_exclude/sub1/sub1
677 ../archive_exclude/sub1/sub2
671 ../archive_exclude/sub1/sub2
678 ../archive_exclude/sub1/sub2/sub2
672 ../archive_exclude/sub1/sub2/sub2
679
673
680 $ hg --config extensions.largefiles=! archive -S -I '**test*' ../archive_include
674 $ hg --config extensions.largefiles=! archive -S -I '**test*' ../archive_include
681 \r (no-eol) (esc)
675 \r (no-eol) (esc)
682 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
676 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
683 \r (no-eol) (esc)
677 \r (no-eol) (esc)
684 \r (no-eol) (esc)
678 \r (no-eol) (esc)
685 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
679 archiving (sub1/sub2) [ ] 0/2\r (no-eol) (esc)
686 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
680 archiving (sub1/sub2) [==============> ] 1/2\r (no-eol) (esc)
687 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
681 archiving (sub1/sub2) [==============================>] 2/2\r (no-eol) (esc)
688 \r (no-eol) (esc)
682 \r (no-eol) (esc)
689 $ find ../archive_include | sort
683 $ find ../archive_include | sort
690 ../archive_include
684 ../archive_include
691 ../archive_include/sub1
685 ../archive_include/sub1
692 ../archive_include/sub1/sub2
686 ../archive_include/sub1/sub2
693 ../archive_include/sub1/sub2/folder
687 ../archive_include/sub1/sub2/folder
694 ../archive_include/sub1/sub2/folder/test.txt
688 ../archive_include/sub1/sub2/folder/test.txt
695 ../archive_include/sub1/sub2/test.txt
689 ../archive_include/sub1/sub2/test.txt
696
690
697 Check that deep archive works with largefiles (which overrides hgsubrepo impl)
691 Check that deep archive works with largefiles (which overrides hgsubrepo impl)
698 This also tests the repo.ui regression in 43fb170a23bd, and that lf subrepo
692 This also tests the repo.ui regression in 43fb170a23bd, and that lf subrepo
699 subrepos are archived properly.
693 subrepos are archived properly.
700 Note that add --large through a subrepo currently adds the file as a normal file
694 Note that add --large through a subrepo currently adds the file as a normal file
701
695
702 $ echo "large" > sub1/sub2/large.bin
696 $ echo "large" > sub1/sub2/large.bin
703 $ hg --config extensions.largefiles= add --large -R sub1/sub2 sub1/sub2/large.bin
697 $ hg --config extensions.largefiles= add --large -R sub1/sub2 sub1/sub2/large.bin
704 $ echo "large" > large.bin
698 $ echo "large" > large.bin
705 $ hg --config extensions.largefiles= add --large large.bin
699 $ hg --config extensions.largefiles= add --large large.bin
706 $ hg --config extensions.largefiles= ci -S -m "add large files"
700 $ hg --config extensions.largefiles= ci -S -m "add large files"
707 committing subrepository sub1
701 committing subrepository sub1
708 committing subrepository sub1/sub2
702 committing subrepository sub1/sub2
709
703
710 $ hg --config extensions.largefiles= archive -S ../archive_lf
704 $ hg --config extensions.largefiles= archive -S ../archive_lf
711 $ find ../archive_lf | sort
705 $ find ../archive_lf | sort
712 ../archive_lf
706 ../archive_lf
713 ../archive_lf/.hg_archival.txt
707 ../archive_lf/.hg_archival.txt
714 ../archive_lf/.hgsub
708 ../archive_lf/.hgsub
715 ../archive_lf/.hgsubstate
709 ../archive_lf/.hgsubstate
716 ../archive_lf/large.bin
710 ../archive_lf/large.bin
717 ../archive_lf/main
711 ../archive_lf/main
718 ../archive_lf/sub1
712 ../archive_lf/sub1
719 ../archive_lf/sub1/.hgsub
713 ../archive_lf/sub1/.hgsub
720 ../archive_lf/sub1/.hgsubstate
714 ../archive_lf/sub1/.hgsubstate
721 ../archive_lf/sub1/sub1
715 ../archive_lf/sub1/sub1
722 ../archive_lf/sub1/sub2
716 ../archive_lf/sub1/sub2
723 ../archive_lf/sub1/sub2/folder
717 ../archive_lf/sub1/sub2/folder
724 ../archive_lf/sub1/sub2/folder/test.txt
718 ../archive_lf/sub1/sub2/folder/test.txt
725 ../archive_lf/sub1/sub2/large.bin
719 ../archive_lf/sub1/sub2/large.bin
726 ../archive_lf/sub1/sub2/sub2
720 ../archive_lf/sub1/sub2/sub2
727 ../archive_lf/sub1/sub2/test.txt
721 ../archive_lf/sub1/sub2/test.txt
728 $ rm -rf ../archive_lf
722 $ rm -rf ../archive_lf
729
723
730 Exclude large files from main and sub-sub repo
724 Exclude large files from main and sub-sub repo
731
725
732 $ hg --config extensions.largefiles= archive -S -X '**.bin' ../archive_lf
726 $ hg --config extensions.largefiles= archive -S -X '**.bin' ../archive_lf
733 $ find ../archive_lf | sort
727 $ find ../archive_lf | sort
734 ../archive_lf
728 ../archive_lf
735 ../archive_lf/.hg_archival.txt
729 ../archive_lf/.hg_archival.txt
736 ../archive_lf/.hgsub
730 ../archive_lf/.hgsub
737 ../archive_lf/.hgsubstate
731 ../archive_lf/.hgsubstate
738 ../archive_lf/main
732 ../archive_lf/main
739 ../archive_lf/sub1
733 ../archive_lf/sub1
740 ../archive_lf/sub1/.hgsub
734 ../archive_lf/sub1/.hgsub
741 ../archive_lf/sub1/.hgsubstate
735 ../archive_lf/sub1/.hgsubstate
742 ../archive_lf/sub1/sub1
736 ../archive_lf/sub1/sub1
743 ../archive_lf/sub1/sub2
737 ../archive_lf/sub1/sub2
744 ../archive_lf/sub1/sub2/folder
738 ../archive_lf/sub1/sub2/folder
745 ../archive_lf/sub1/sub2/folder/test.txt
739 ../archive_lf/sub1/sub2/folder/test.txt
746 ../archive_lf/sub1/sub2/sub2
740 ../archive_lf/sub1/sub2/sub2
747 ../archive_lf/sub1/sub2/test.txt
741 ../archive_lf/sub1/sub2/test.txt
748 $ rm -rf ../archive_lf
742 $ rm -rf ../archive_lf
749
743
750 Exclude normal files from main and sub-sub repo
744 Exclude normal files from main and sub-sub repo
751
745
752 $ hg --config extensions.largefiles= archive -S -X '**.txt' -p '.' ../archive_lf.tgz
746 $ hg --config extensions.largefiles= archive -S -X '**.txt' -p '.' ../archive_lf.tgz
753 $ tar -tzf ../archive_lf.tgz | sort
747 $ tar -tzf ../archive_lf.tgz | sort
754 .hgsub
748 .hgsub
755 .hgsubstate
749 .hgsubstate
756 large.bin
750 large.bin
757 main
751 main
758 sub1/.hgsub
752 sub1/.hgsub
759 sub1/.hgsubstate
753 sub1/.hgsubstate
760 sub1/sub1
754 sub1/sub1
761 sub1/sub2/large.bin
755 sub1/sub2/large.bin
762 sub1/sub2/sub2
756 sub1/sub2/sub2
763
757
764 Include normal files from within a largefiles subrepo
758 Include normal files from within a largefiles subrepo
765
759
766 $ hg --config extensions.largefiles= archive -S -I '**.txt' ../archive_lf
760 $ hg --config extensions.largefiles= archive -S -I '**.txt' ../archive_lf
767 $ find ../archive_lf | sort
761 $ find ../archive_lf | sort
768 ../archive_lf
762 ../archive_lf
769 ../archive_lf/.hg_archival.txt
763 ../archive_lf/.hg_archival.txt
770 ../archive_lf/sub1
764 ../archive_lf/sub1
771 ../archive_lf/sub1/sub2
765 ../archive_lf/sub1/sub2
772 ../archive_lf/sub1/sub2/folder
766 ../archive_lf/sub1/sub2/folder
773 ../archive_lf/sub1/sub2/folder/test.txt
767 ../archive_lf/sub1/sub2/folder/test.txt
774 ../archive_lf/sub1/sub2/test.txt
768 ../archive_lf/sub1/sub2/test.txt
775 $ rm -rf ../archive_lf
769 $ rm -rf ../archive_lf
776
770
777 Include large files from within a largefiles subrepo
771 Include large files from within a largefiles subrepo
778
772
779 $ hg --config extensions.largefiles= archive -S -I '**.bin' ../archive_lf
773 $ hg --config extensions.largefiles= archive -S -I '**.bin' ../archive_lf
780 $ find ../archive_lf | sort
774 $ find ../archive_lf | sort
781 ../archive_lf
775 ../archive_lf
782 ../archive_lf/large.bin
776 ../archive_lf/large.bin
783 ../archive_lf/sub1
777 ../archive_lf/sub1
784 ../archive_lf/sub1/sub2
778 ../archive_lf/sub1/sub2
785 ../archive_lf/sub1/sub2/large.bin
779 ../archive_lf/sub1/sub2/large.bin
786 $ rm -rf ../archive_lf
780 $ rm -rf ../archive_lf
787
781
788 Find an exact largefile match in a largefiles subrepo
782 Find an exact largefile match in a largefiles subrepo
789
783
790 $ hg --config extensions.largefiles= archive -S -I 'sub1/sub2/large.bin' ../archive_lf
784 $ hg --config extensions.largefiles= archive -S -I 'sub1/sub2/large.bin' ../archive_lf
791 $ find ../archive_lf | sort
785 $ find ../archive_lf | sort
792 ../archive_lf
786 ../archive_lf
793 ../archive_lf/sub1
787 ../archive_lf/sub1
794 ../archive_lf/sub1/sub2
788 ../archive_lf/sub1/sub2
795 ../archive_lf/sub1/sub2/large.bin
789 ../archive_lf/sub1/sub2/large.bin
796 $ rm -rf ../archive_lf
790 $ rm -rf ../archive_lf
797
791
798 The local repo enables largefiles if a largefiles repo is cloned
792 The local repo enables largefiles if a largefiles repo is cloned
799 $ hg showconfig extensions
793 $ hg showconfig extensions
800 abort: repository requires features unknown to this Mercurial: largefiles!
794 abort: repository requires features unknown to this Mercurial: largefiles!
801 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
795 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
802 [255]
796 [255]
803 $ hg --config extensions.largefiles= clone -qU . ../lfclone
797 $ hg --config extensions.largefiles= clone -qU . ../lfclone
804 $ cat ../lfclone/.hg/hgrc
798 $ cat ../lfclone/.hg/hgrc
805 # example repository config (see 'hg help config' for more info)
799 # example repository config (see 'hg help config' for more info)
806 [paths]
800 [paths]
807 default = $TESTTMP/cloned
801 default = $TESTTMP/cloned
808
802
809 # path aliases to other clones of this repo in URLs or filesystem paths
803 # path aliases to other clones of this repo in URLs or filesystem paths
810 # (see 'hg help config.paths' for more info)
804 # (see 'hg help config.paths' for more info)
811 #
805 #
812 # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
806 # default:pushurl = ssh://jdoe@example.net/hg/jdoes-fork
813 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
807 # my-fork = ssh://jdoe@example.net/hg/jdoes-fork
814 # my-clone = /home/jdoe/jdoes-clone
808 # my-clone = /home/jdoe/jdoes-clone
815
809
816 [ui]
810 [ui]
817 # name and email (local to this repository, optional), e.g.
811 # name and email (local to this repository, optional), e.g.
818 # username = Jane Doe <jdoe@example.com>
812 # username = Jane Doe <jdoe@example.com>
819
813
820 [extensions]
814 [extensions]
821 largefiles=
815 largefiles=
822
816
823 Find an exact match to a standin (should archive nothing)
817 Find an exact match to a standin (should archive nothing)
824 $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
818 $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
825 $ find ../archive_lf 2> /dev/null | sort
819 $ find ../archive_lf 2> /dev/null | sort
826
820
827 $ cat >> $HGRCPATH <<EOF
821 $ cat >> $HGRCPATH <<EOF
828 > [extensions]
822 > [extensions]
829 > largefiles=
823 > largefiles=
830 > [largefiles]
824 > [largefiles]
831 > patterns=glob:**.dat
825 > patterns=glob:**.dat
832 > EOF
826 > EOF
833
827
834 Test forget through a deep subrepo with the largefiles extension, both a
828 Test forget through a deep subrepo with the largefiles extension, both a
835 largefile and a normal file. Then a largefile that hasn't been committed yet.
829 largefile and a normal file. Then a largefile that hasn't been committed yet.
836 $ touch sub1/sub2/untracked.txt
830 $ touch sub1/sub2/untracked.txt
837 $ touch sub1/sub2/large.dat
831 $ touch sub1/sub2/large.dat
838 $ hg forget sub1/sub2/large.bin sub1/sub2/test.txt sub1/sub2/untracked.txt
832 $ hg forget sub1/sub2/large.bin sub1/sub2/test.txt sub1/sub2/untracked.txt
839 not removing sub1/sub2/untracked.txt: file is already untracked
833 not removing sub1/sub2/untracked.txt: file is already untracked
840 [1]
834 [1]
841 $ hg add --large --dry-run -v sub1/sub2/untracked.txt
835 $ hg add --large --dry-run -v sub1/sub2/untracked.txt
842 adding sub1/sub2/untracked.txt as a largefile
836 adding sub1/sub2/untracked.txt as a largefile
843 $ hg add --large -v sub1/sub2/untracked.txt
837 $ hg add --large -v sub1/sub2/untracked.txt
844 adding sub1/sub2/untracked.txt as a largefile
838 adding sub1/sub2/untracked.txt as a largefile
845 $ hg add --normal -v sub1/sub2/large.dat
839 $ hg add --normal -v sub1/sub2/large.dat
846 adding sub1/sub2/large.dat
840 adding sub1/sub2/large.dat
847 $ hg forget -v sub1/sub2/untracked.txt
841 $ hg forget -v sub1/sub2/untracked.txt
848 removing sub1/sub2/untracked.txt
842 removing sub1/sub2/untracked.txt
849 $ hg status -S
843 $ hg status -S
850 A sub1/sub2/large.dat
844 A sub1/sub2/large.dat
851 R sub1/sub2/large.bin
845 R sub1/sub2/large.bin
852 R sub1/sub2/test.txt
846 R sub1/sub2/test.txt
853 ? foo/bar/abc
847 ? foo/bar/abc
854 ? sub1/sub2/untracked.txt
848 ? sub1/sub2/untracked.txt
855 ? sub1/sub2/x.txt
849 ? sub1/sub2/x.txt
856 $ hg add sub1/sub2
850 $ hg add sub1/sub2
857
851
858 $ hg archive -S -r 'wdir()' ../wdir2
852 $ hg archive -S -r 'wdir()' ../wdir2
859 $ diff -r . ../wdir2 | egrep -v '\.hg$|^Common subdirectories:'
853 $ diff -r . ../wdir2 | egrep -v '\.hg$|^Common subdirectories:'
860 Only in ../wdir2: .hg_archival.txt
854 Only in ../wdir2: .hg_archival.txt
861 Only in .: .hglf
855 Only in .: .hglf
862 Only in .: foo
856 Only in .: foo
863 Only in ./sub1/sub2: large.bin
857 Only in ./sub1/sub2: large.bin
864 Only in ./sub1/sub2: test.txt
858 Only in ./sub1/sub2: test.txt
865 Only in ./sub1/sub2: untracked.txt
859 Only in ./sub1/sub2: untracked.txt
866 Only in ./sub1/sub2: x.txt
860 Only in ./sub1/sub2: x.txt
867 $ find ../wdir2 -type f | sort
861 $ find ../wdir2 -type f | sort
868 ../wdir2/.hg_archival.txt
862 ../wdir2/.hg_archival.txt
869 ../wdir2/.hgsub
863 ../wdir2/.hgsub
870 ../wdir2/.hgsubstate
864 ../wdir2/.hgsubstate
871 ../wdir2/large.bin
865 ../wdir2/large.bin
872 ../wdir2/main
866 ../wdir2/main
873 ../wdir2/sub1/.hgsub
867 ../wdir2/sub1/.hgsub
874 ../wdir2/sub1/.hgsubstate
868 ../wdir2/sub1/.hgsubstate
875 ../wdir2/sub1/sub1
869 ../wdir2/sub1/sub1
876 ../wdir2/sub1/sub2/folder/test.txt
870 ../wdir2/sub1/sub2/folder/test.txt
877 ../wdir2/sub1/sub2/large.dat
871 ../wdir2/sub1/sub2/large.dat
878 ../wdir2/sub1/sub2/sub2
872 ../wdir2/sub1/sub2/sub2
879 $ hg status -S -mac -n | sort
873 $ hg status -S -mac -n | sort
880 .hgsub
874 .hgsub
881 .hgsubstate
875 .hgsubstate
882 large.bin
876 large.bin
883 main
877 main
884 sub1/.hgsub
878 sub1/.hgsub
885 sub1/.hgsubstate
879 sub1/.hgsubstate
886 sub1/sub1
880 sub1/sub1
887 sub1/sub2/folder/test.txt
881 sub1/sub2/folder/test.txt
888 sub1/sub2/large.dat
882 sub1/sub2/large.dat
889 sub1/sub2/sub2
883 sub1/sub2/sub2
890
884
891 $ hg ci -Sqm 'forget testing'
885 $ hg ci -Sqm 'forget testing'
892
886
893 Test 'wdir()' modified file archiving with largefiles
887 Test 'wdir()' modified file archiving with largefiles
894 $ echo 'mod' > main
888 $ echo 'mod' > main
895 $ echo 'mod' > large.bin
889 $ echo 'mod' > large.bin
896 $ echo 'mod' > sub1/sub2/large.dat
890 $ echo 'mod' > sub1/sub2/large.dat
897 $ hg archive -S -r 'wdir()' ../wdir3
891 $ hg archive -S -r 'wdir()' ../wdir3
898 $ diff -r . ../wdir3 | egrep -v '\.hg$|^Common subdirectories'
892 $ diff -r . ../wdir3 | egrep -v '\.hg$|^Common subdirectories'
899 Only in ../wdir3: .hg_archival.txt
893 Only in ../wdir3: .hg_archival.txt
900 Only in .: .hglf
894 Only in .: .hglf
901 Only in .: foo
895 Only in .: foo
902 Only in ./sub1/sub2: large.bin
896 Only in ./sub1/sub2: large.bin
903 Only in ./sub1/sub2: test.txt
897 Only in ./sub1/sub2: test.txt
904 Only in ./sub1/sub2: untracked.txt
898 Only in ./sub1/sub2: untracked.txt
905 Only in ./sub1/sub2: x.txt
899 Only in ./sub1/sub2: x.txt
906 $ find ../wdir3 -type f | sort
900 $ find ../wdir3 -type f | sort
907 ../wdir3/.hg_archival.txt
901 ../wdir3/.hg_archival.txt
908 ../wdir3/.hgsub
902 ../wdir3/.hgsub
909 ../wdir3/.hgsubstate
903 ../wdir3/.hgsubstate
910 ../wdir3/large.bin
904 ../wdir3/large.bin
911 ../wdir3/main
905 ../wdir3/main
912 ../wdir3/sub1/.hgsub
906 ../wdir3/sub1/.hgsub
913 ../wdir3/sub1/.hgsubstate
907 ../wdir3/sub1/.hgsubstate
914 ../wdir3/sub1/sub1
908 ../wdir3/sub1/sub1
915 ../wdir3/sub1/sub2/folder/test.txt
909 ../wdir3/sub1/sub2/folder/test.txt
916 ../wdir3/sub1/sub2/large.dat
910 ../wdir3/sub1/sub2/large.dat
917 ../wdir3/sub1/sub2/sub2
911 ../wdir3/sub1/sub2/sub2
918 $ hg up -Cq
912 $ hg up -Cq
919
913
920 Test issue4330: commit a directory where only normal files have changed
914 Test issue4330: commit a directory where only normal files have changed
921 $ touch foo/bar/large.dat
915 $ touch foo/bar/large.dat
922 $ hg add --large foo/bar/large.dat
916 $ hg add --large foo/bar/large.dat
923 $ hg ci -m 'add foo/bar/large.dat'
917 $ hg ci -m 'add foo/bar/large.dat'
924 $ touch a.txt
918 $ touch a.txt
925 $ touch a.dat
919 $ touch a.dat
926 $ hg add -v foo/bar/abc a.txt a.dat
920 $ hg add -v foo/bar/abc a.txt a.dat
927 adding a.dat as a largefile
921 adding a.dat as a largefile
928 adding a.txt
922 adding a.txt
929 adding foo/bar/abc
923 adding foo/bar/abc
930 $ hg ci -m 'dir commit with only normal file deltas' foo/bar
924 $ hg ci -m 'dir commit with only normal file deltas' foo/bar
931 $ hg status
925 $ hg status
932 A a.dat
926 A a.dat
933 A a.txt
927 A a.txt
934
928
935 Test a directory commit with a changed largefile and a changed normal file
929 Test a directory commit with a changed largefile and a changed normal file
936 $ echo changed > foo/bar/large.dat
930 $ echo changed > foo/bar/large.dat
937 $ echo changed > foo/bar/abc
931 $ echo changed > foo/bar/abc
938 $ hg ci -m 'dir commit with normal and lf file deltas' foo
932 $ hg ci -m 'dir commit with normal and lf file deltas' foo
939 $ hg status
933 $ hg status
940 A a.dat
934 A a.dat
941 A a.txt
935 A a.txt
942
936
943 $ hg ci -m "add a.*"
937 $ hg ci -m "add a.*"
944 $ hg mv a.dat b.dat
938 $ hg mv a.dat b.dat
945 $ hg mv foo/bar/abc foo/bar/def
939 $ hg mv foo/bar/abc foo/bar/def
946 $ hg status -C
940 $ hg status -C
947 A b.dat
941 A b.dat
948 a.dat
942 a.dat
949 A foo/bar/def
943 A foo/bar/def
950 foo/bar/abc
944 foo/bar/abc
951 R a.dat
945 R a.dat
952 R foo/bar/abc
946 R foo/bar/abc
953
947
954 $ hg ci -m "move large and normal"
948 $ hg ci -m "move large and normal"
955 $ hg status -C --rev '.^' --rev .
949 $ hg status -C --rev '.^' --rev .
956 A b.dat
950 A b.dat
957 a.dat
951 a.dat
958 A foo/bar/def
952 A foo/bar/def
959 foo/bar/abc
953 foo/bar/abc
960 R a.dat
954 R a.dat
961 R foo/bar/abc
955 R foo/bar/abc
962
956
963
957
964 $ echo foo > main
958 $ echo foo > main
965 $ hg ci -m "mod parent only"
959 $ hg ci -m "mod parent only"
966 $ hg init sub3
960 $ hg init sub3
967 $ echo "sub3 = sub3" >> .hgsub
961 $ echo "sub3 = sub3" >> .hgsub
968 $ echo xyz > sub3/a.txt
962 $ echo xyz > sub3/a.txt
969 $ hg add sub3/a.txt
963 $ hg add sub3/a.txt
970 $ hg ci -Sm "add sub3"
964 $ hg ci -Sm "add sub3"
971 committing subrepository sub3
965 committing subrepository sub3
972 $ cat .hgsub | grep -v sub3 > .hgsub1
966 $ cat .hgsub | grep -v sub3 > .hgsub1
973 $ mv .hgsub1 .hgsub
967 $ mv .hgsub1 .hgsub
974 $ hg ci -m "remove sub3"
968 $ hg ci -m "remove sub3"
975
969
976 $ hg log -r "subrepo()" --style compact
970 $ hg log -r "subrepo()" --style compact
977 0 7f491f53a367 1970-01-01 00:00 +0000 test
971 0 7f491f53a367 1970-01-01 00:00 +0000 test
978 main import
972 main import
979
973
980 1 ffe6649062fe 1970-01-01 00:00 +0000 test
974 1 ffe6649062fe 1970-01-01 00:00 +0000 test
981 deep nested modif should trigger a commit
975 deep nested modif should trigger a commit
982
976
983 2 9bb10eebee29 1970-01-01 00:00 +0000 test
977 2 9bb10eebee29 1970-01-01 00:00 +0000 test
984 add test.txt
978 add test.txt
985
979
986 3 7c64f035294f 1970-01-01 00:00 +0000 test
980 3 7c64f035294f 1970-01-01 00:00 +0000 test
987 add large files
981 add large files
988
982
989 4 f734a59e2e35 1970-01-01 00:00 +0000 test
983 4 f734a59e2e35 1970-01-01 00:00 +0000 test
990 forget testing
984 forget testing
991
985
992 11 9685a22af5db 1970-01-01 00:00 +0000 test
986 11 9685a22af5db 1970-01-01 00:00 +0000 test
993 add sub3
987 add sub3
994
988
995 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
989 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
996 remove sub3
990 remove sub3
997
991
998 $ hg log -r "subrepo('sub3')" --style compact
992 $ hg log -r "subrepo('sub3')" --style compact
999 11 9685a22af5db 1970-01-01 00:00 +0000 test
993 11 9685a22af5db 1970-01-01 00:00 +0000 test
1000 add sub3
994 add sub3
1001
995
1002 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
996 12[tip] 2e0485b475b9 1970-01-01 00:00 +0000 test
1003 remove sub3
997 remove sub3
1004
998
1005 $ hg log -r "subrepo('bogus')" --style compact
999 $ hg log -r "subrepo('bogus')" --style compact
1006
1000
1007
1001
1008 Test .hgsubstate in the R state
1002 Test .hgsubstate in the R state
1009
1003
1010 $ hg rm .hgsub .hgsubstate
1004 $ hg rm .hgsub .hgsubstate
1011 \r (no-eol) (esc)
1005 \r (no-eol) (esc)
1012 deleting [=====================> ] 1/2\r (no-eol) (esc)
1006 deleting [=====================> ] 1/2\r (no-eol) (esc)
1013 deleting [===========================================>] 2/2\r (no-eol) (esc)
1007 deleting [===========================================>] 2/2\r (no-eol) (esc)
1014 \r (no-eol) (esc)
1008 \r (no-eol) (esc)
1015 $ hg ci -m 'trash subrepo tracking'
1009 $ hg ci -m 'trash subrepo tracking'
1016
1010
1017 $ hg log -r "subrepo('re:sub\d+')" --style compact
1011 $ hg log -r "subrepo('re:sub\d+')" --style compact
1018 0 7f491f53a367 1970-01-01 00:00 +0000 test
1012 0 7f491f53a367 1970-01-01 00:00 +0000 test
1019 main import
1013 main import
1020
1014
1021 1 ffe6649062fe 1970-01-01 00:00 +0000 test
1015 1 ffe6649062fe 1970-01-01 00:00 +0000 test
1022 deep nested modif should trigger a commit
1016 deep nested modif should trigger a commit
1023
1017
1024 2 9bb10eebee29 1970-01-01 00:00 +0000 test
1018 2 9bb10eebee29 1970-01-01 00:00 +0000 test
1025 add test.txt
1019 add test.txt
1026
1020
1027 3 7c64f035294f 1970-01-01 00:00 +0000 test
1021 3 7c64f035294f 1970-01-01 00:00 +0000 test
1028 add large files
1022 add large files
1029
1023
1030 4 f734a59e2e35 1970-01-01 00:00 +0000 test
1024 4 f734a59e2e35 1970-01-01 00:00 +0000 test
1031 forget testing
1025 forget testing
1032
1026
1033 11 9685a22af5db 1970-01-01 00:00 +0000 test
1027 11 9685a22af5db 1970-01-01 00:00 +0000 test
1034 add sub3
1028 add sub3
1035
1029
1036 12 2e0485b475b9 1970-01-01 00:00 +0000 test
1030 12 2e0485b475b9 1970-01-01 00:00 +0000 test
1037 remove sub3
1031 remove sub3
1038
1032
1039 13[tip] a68b2c361653 1970-01-01 00:00 +0000 test
1033 13[tip] a68b2c361653 1970-01-01 00:00 +0000 test
1040 trash subrepo tracking
1034 trash subrepo tracking
1041
1035
1042
1036
1043 Restore the trashed subrepo tracking
1037 Restore the trashed subrepo tracking
1044
1038
1045 $ hg rollback -q
1039 $ hg rollback -q
1046 $ hg update -Cq .
1040 $ hg update -Cq .
1047
1041
1048 Interaction with extdiff, largefiles and subrepos
1042 Interaction with extdiff, largefiles and subrepos
1049
1043
1050 $ hg --config extensions.extdiff= pdiff -S
1044 $ hg --config extensions.extdiff= pdiff -S
1051
1045
1052 $ hg --config extensions.extdiff= pdiff -r '.^' -S
1046 $ hg --config extensions.extdiff= pdiff -r '.^' -S
1053 \r (no-eol) (esc)
1047 \r (no-eol) (esc)
1054 archiving [ ] 0/2\r (no-eol) (esc)
1048 archiving [ ] 0/2\r (no-eol) (esc)
1055 archiving [====================> ] 1/2\r (no-eol) (esc)
1049 archiving [====================> ] 1/2\r (no-eol) (esc)
1056 archiving [==========================================>] 2/2\r (no-eol) (esc)
1050 archiving [==========================================>] 2/2\r (no-eol) (esc)
1057 \r (no-eol) (esc)
1051 \r (no-eol) (esc)
1058 \r (no-eol) (esc)
1052 \r (no-eol) (esc)
1059 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1053 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1060 \r (no-eol) (esc)
1054 \r (no-eol) (esc)
1061 \r (no-eol) (esc)
1055 \r (no-eol) (esc)
1062 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1056 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1063 \r (no-eol) (esc)
1057 \r (no-eol) (esc)
1064 \r (no-eol) (esc)
1058 \r (no-eol) (esc)
1065 archiving (sub3) [ <=> ] 0\r (no-eol) (esc)
1059 archiving (sub3) [ <=> ] 0\r (no-eol) (esc)
1066 \r (no-eol) (esc)
1060 \r (no-eol) (esc)
1067 \r (no-eol) (esc)
1061 \r (no-eol) (esc)
1068 archiving [ ] 0/2\r (no-eol) (esc)
1062 archiving [ ] 0/2\r (no-eol) (esc)
1069 archiving [====================> ] 1/2\r (no-eol) (esc)
1063 archiving [====================> ] 1/2\r (no-eol) (esc)
1070 archiving [==========================================>] 2/2\r (no-eol) (esc)
1064 archiving [==========================================>] 2/2\r (no-eol) (esc)
1071 \r (no-eol) (esc)
1065 \r (no-eol) (esc)
1072 \r (no-eol) (esc)
1066 \r (no-eol) (esc)
1073 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1067 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1074 \r (no-eol) (esc)
1068 \r (no-eol) (esc)
1075 \r (no-eol) (esc)
1069 \r (no-eol) (esc)
1076 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1070 archiving (sub1/sub2) [ <=> ] 0\r (no-eol) (esc)
1077 \r (no-eol) (esc)
1071 \r (no-eol) (esc)
1078 diff -Nru cloned.*/.hgsub cloned/.hgsub (glob)
1072 diff -Nru cloned.*/.hgsub cloned/.hgsub (glob)
1079 --- cloned.*/.hgsub * (glob)
1073 --- cloned.*/.hgsub * (glob)
1080 +++ cloned/.hgsub * (glob)
1074 +++ cloned/.hgsub * (glob)
1081 @@ -1,2 +1* @@ (glob)
1075 @@ -1,2 +1* @@ (glob)
1082 sub1 = ../sub1
1076 sub1 = ../sub1
1083 -sub3 = sub3
1077 -sub3 = sub3
1084 diff -Nru cloned.*/.hgsubstate cloned/.hgsubstate (glob)
1078 diff -Nru cloned.*/.hgsubstate cloned/.hgsubstate (glob)
1085 --- cloned.*/.hgsubstate * (glob)
1079 --- cloned.*/.hgsubstate * (glob)
1086 +++ cloned/.hgsubstate * (glob)
1080 +++ cloned/.hgsubstate * (glob)
1087 @@ -1,2 +1* @@ (glob)
1081 @@ -1,2 +1* @@ (glob)
1088 7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1082 7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1089 -b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1083 -b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1090 [1]
1084 [1]
1091
1085
1092 $ hg --config extensions.extdiff= pdiff -r 0 -r '.^' -S
1086 $ hg --config extensions.extdiff= pdiff -r 0 -r '.^' -S
1093 \r (no-eol) (esc)
1087 \r (no-eol) (esc)
1094 archiving [ ] 0/3\r (no-eol) (esc)
1088 archiving [ ] 0/3\r (no-eol) (esc)
1095 archiving [=============> ] 1/3\r (no-eol) (esc)
1089 archiving [=============> ] 1/3\r (no-eol) (esc)
1096 archiving [===========================> ] 2/3\r (no-eol) (esc)
1090 archiving [===========================> ] 2/3\r (no-eol) (esc)
1097 archiving [==========================================>] 3/3\r (no-eol) (esc)
1091 archiving [==========================================>] 3/3\r (no-eol) (esc)
1098 \r (no-eol) (esc)
1092 \r (no-eol) (esc)
1099 \r (no-eol) (esc)
1093 \r (no-eol) (esc)
1100 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1094 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1101 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1095 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1102 \r (no-eol) (esc)
1096 \r (no-eol) (esc)
1103 \r (no-eol) (esc)
1097 \r (no-eol) (esc)
1104 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1098 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1105 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1099 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1106 \r (no-eol) (esc)
1100 \r (no-eol) (esc)
1107 \r (no-eol) (esc)
1101 \r (no-eol) (esc)
1108 archiving [ ] 0/8\r (no-eol) (esc)
1102 archiving [ ] 0/8\r (no-eol) (esc)
1109 archiving [====> ] 1/8\r (no-eol) (esc)
1103 archiving [====> ] 1/8\r (no-eol) (esc)
1110 archiving [=========> ] 2/8\r (no-eol) (esc)
1104 archiving [=========> ] 2/8\r (no-eol) (esc)
1111 archiving [===============> ] 3/8\r (no-eol) (esc)
1105 archiving [===============> ] 3/8\r (no-eol) (esc)
1112 archiving [====================> ] 4/8\r (no-eol) (esc)
1106 archiving [====================> ] 4/8\r (no-eol) (esc)
1113 archiving [=========================> ] 5/8\r (no-eol) (esc)
1107 archiving [=========================> ] 5/8\r (no-eol) (esc)
1114 archiving [===============================> ] 6/8\r (no-eol) (esc)
1108 archiving [===============================> ] 6/8\r (no-eol) (esc)
1115 archiving [====================================> ] 7/8\r (no-eol) (esc)
1109 archiving [====================================> ] 7/8\r (no-eol) (esc)
1116 archiving [==========================================>] 8/8\r (no-eol) (esc)
1110 archiving [==========================================>] 8/8\r (no-eol) (esc)
1117 \r (no-eol) (esc)
1111 \r (no-eol) (esc)
1118 \r (no-eol) (esc)
1112 \r (no-eol) (esc)
1119 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1113 archiving (sub1) [ ] 0/1\r (no-eol) (esc)
1120 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1114 archiving (sub1) [===================================>] 1/1\r (no-eol) (esc)
1121 \r (no-eol) (esc)
1115 \r (no-eol) (esc)
1122 \r (no-eol) (esc)
1116 \r (no-eol) (esc)
1123 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
1117 archiving (sub1/sub2) [ ] 0/3\r (no-eol) (esc)
1124 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
1118 archiving (sub1/sub2) [=========> ] 1/3\r (no-eol) (esc)
1125 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
1119 archiving (sub1/sub2) [===================> ] 2/3\r (no-eol) (esc)
1126 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
1120 archiving (sub1/sub2) [==============================>] 3/3\r (no-eol) (esc)
1127 \r (no-eol) (esc)
1121 \r (no-eol) (esc)
1128 \r (no-eol) (esc)
1122 \r (no-eol) (esc)
1129 archiving (sub3) [ ] 0/1\r (no-eol) (esc)
1123 archiving (sub3) [ ] 0/1\r (no-eol) (esc)
1130 archiving (sub3) [===================================>] 1/1\r (no-eol) (esc)
1124 archiving (sub3) [===================================>] 1/1\r (no-eol) (esc)
1131 \r (no-eol) (esc)
1125 \r (no-eol) (esc)
1132 diff -Nru cloned.*/.hglf/b.dat cloned.*/.hglf/b.dat (glob)
1126 diff -Nru cloned.*/.hglf/b.dat cloned.*/.hglf/b.dat (glob)
1133 --- cloned.*/.hglf/b.dat * (glob)
1127 --- cloned.*/.hglf/b.dat * (glob)
1134 +++ cloned.*/.hglf/b.dat * (glob)
1128 +++ cloned.*/.hglf/b.dat * (glob)
1135 @@ -*,0 +1* @@ (glob)
1129 @@ -*,0 +1* @@ (glob)
1136 +da39a3ee5e6b4b0d3255bfef95601890afd80709
1130 +da39a3ee5e6b4b0d3255bfef95601890afd80709
1137 diff -Nru cloned.*/.hglf/foo/bar/large.dat cloned.*/.hglf/foo/bar/large.dat (glob)
1131 diff -Nru cloned.*/.hglf/foo/bar/large.dat cloned.*/.hglf/foo/bar/large.dat (glob)
1138 --- cloned.*/.hglf/foo/bar/large.dat * (glob)
1132 --- cloned.*/.hglf/foo/bar/large.dat * (glob)
1139 +++ cloned.*/.hglf/foo/bar/large.dat * (glob)
1133 +++ cloned.*/.hglf/foo/bar/large.dat * (glob)
1140 @@ -*,0 +1* @@ (glob)
1134 @@ -*,0 +1* @@ (glob)
1141 +2f6933b5ee0f5fdd823d9717d8729f3c2523811b
1135 +2f6933b5ee0f5fdd823d9717d8729f3c2523811b
1142 diff -Nru cloned.*/.hglf/large.bin cloned.*/.hglf/large.bin (glob)
1136 diff -Nru cloned.*/.hglf/large.bin cloned.*/.hglf/large.bin (glob)
1143 --- cloned.*/.hglf/large.bin * (glob)
1137 --- cloned.*/.hglf/large.bin * (glob)
1144 +++ cloned.*/.hglf/large.bin * (glob)
1138 +++ cloned.*/.hglf/large.bin * (glob)
1145 @@ -*,0 +1* @@ (glob)
1139 @@ -*,0 +1* @@ (glob)
1146 +7f7097b041ccf68cc5561e9600da4655d21c6d18
1140 +7f7097b041ccf68cc5561e9600da4655d21c6d18
1147 diff -Nru cloned.*/.hgsub cloned.*/.hgsub (glob)
1141 diff -Nru cloned.*/.hgsub cloned.*/.hgsub (glob)
1148 --- cloned.*/.hgsub * (glob)
1142 --- cloned.*/.hgsub * (glob)
1149 +++ cloned.*/.hgsub * (glob)
1143 +++ cloned.*/.hgsub * (glob)
1150 @@ -1* +1,2 @@ (glob)
1144 @@ -1* +1,2 @@ (glob)
1151 sub1 = ../sub1
1145 sub1 = ../sub1
1152 +sub3 = sub3
1146 +sub3 = sub3
1153 diff -Nru cloned.*/.hgsubstate cloned.*/.hgsubstate (glob)
1147 diff -Nru cloned.*/.hgsubstate cloned.*/.hgsubstate (glob)
1154 --- cloned.*/.hgsubstate * (glob)
1148 --- cloned.*/.hgsubstate * (glob)
1155 +++ cloned.*/.hgsubstate * (glob)
1149 +++ cloned.*/.hgsubstate * (glob)
1156 @@ -1* +1,2 @@ (glob)
1150 @@ -1* +1,2 @@ (glob)
1157 -fc3b4ce2696f7741438c79207583768f2ce6b0dd sub1
1151 -fc3b4ce2696f7741438c79207583768f2ce6b0dd sub1
1158 +7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1152 +7a36fa02b66e61f27f3d4a822809f159479b8ab2 sub1
1159 +b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1153 +b1a26de6f2a045a9f079323693614ee322f1ff7e sub3
1160 diff -Nru cloned.*/foo/bar/def cloned.*/foo/bar/def (glob)
1154 diff -Nru cloned.*/foo/bar/def cloned.*/foo/bar/def (glob)
1161 --- cloned.*/foo/bar/def * (glob)
1155 --- cloned.*/foo/bar/def * (glob)
1162 +++ cloned.*/foo/bar/def * (glob)
1156 +++ cloned.*/foo/bar/def * (glob)
1163 @@ -*,0 +1* @@ (glob)
1157 @@ -*,0 +1* @@ (glob)
1164 +changed
1158 +changed
1165 diff -Nru cloned.*/main cloned.*/main (glob)
1159 diff -Nru cloned.*/main cloned.*/main (glob)
1166 --- cloned.*/main * (glob)
1160 --- cloned.*/main * (glob)
1167 +++ cloned.*/main * (glob)
1161 +++ cloned.*/main * (glob)
1168 @@ -1* +1* @@ (glob)
1162 @@ -1* +1* @@ (glob)
1169 -main
1163 -main
1170 +foo
1164 +foo
1171 diff -Nru cloned.*/sub1/.hgsubstate cloned.*/sub1/.hgsubstate (glob)
1165 diff -Nru cloned.*/sub1/.hgsubstate cloned.*/sub1/.hgsubstate (glob)
1172 --- cloned.*/sub1/.hgsubstate * (glob)
1166 --- cloned.*/sub1/.hgsubstate * (glob)
1173 +++ cloned.*/sub1/.hgsubstate * (glob)
1167 +++ cloned.*/sub1/.hgsubstate * (glob)
1174 @@ -1* +1* @@ (glob)
1168 @@ -1* +1* @@ (glob)
1175 -c57a0840e3badd667ef3c3ef65471609acb2ba3c sub2
1169 -c57a0840e3badd667ef3c3ef65471609acb2ba3c sub2
1176 +c77908c81ccea3794a896c79e98b0e004aee2e9e sub2
1170 +c77908c81ccea3794a896c79e98b0e004aee2e9e sub2
1177 diff -Nru cloned.*/sub1/sub2/folder/test.txt cloned.*/sub1/sub2/folder/test.txt (glob)
1171 diff -Nru cloned.*/sub1/sub2/folder/test.txt cloned.*/sub1/sub2/folder/test.txt (glob)
1178 --- cloned.*/sub1/sub2/folder/test.txt * (glob)
1172 --- cloned.*/sub1/sub2/folder/test.txt * (glob)
1179 +++ cloned.*/sub1/sub2/folder/test.txt * (glob)
1173 +++ cloned.*/sub1/sub2/folder/test.txt * (glob)
1180 @@ -*,0 +1* @@ (glob)
1174 @@ -*,0 +1* @@ (glob)
1181 +subfolder
1175 +subfolder
1182 diff -Nru cloned.*/sub1/sub2/sub2 cloned.*/sub1/sub2/sub2 (glob)
1176 diff -Nru cloned.*/sub1/sub2/sub2 cloned.*/sub1/sub2/sub2 (glob)
1183 --- cloned.*/sub1/sub2/sub2 * (glob)
1177 --- cloned.*/sub1/sub2/sub2 * (glob)
1184 +++ cloned.*/sub1/sub2/sub2 * (glob)
1178 +++ cloned.*/sub1/sub2/sub2 * (glob)
1185 @@ -1* +1* @@ (glob)
1179 @@ -1* +1* @@ (glob)
1186 -sub2
1180 -sub2
1187 +modified
1181 +modified
1188 diff -Nru cloned.*/sub3/a.txt cloned.*/sub3/a.txt (glob)
1182 diff -Nru cloned.*/sub3/a.txt cloned.*/sub3/a.txt (glob)
1189 --- cloned.*/sub3/a.txt * (glob)
1183 --- cloned.*/sub3/a.txt * (glob)
1190 +++ cloned.*/sub3/a.txt * (glob)
1184 +++ cloned.*/sub3/a.txt * (glob)
1191 @@ -*,0 +1* @@ (glob)
1185 @@ -*,0 +1* @@ (glob)
1192 +xyz
1186 +xyz
1193 [1]
1187 [1]
1194
1188
1195 $ echo mod > sub1/sub2/sub2
1189 $ echo mod > sub1/sub2/sub2
1196 $ hg --config extensions.extdiff= pdiff -S
1190 $ hg --config extensions.extdiff= pdiff -S
1197 \r (no-eol) (esc)
1191 \r (no-eol) (esc)
1198 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1192 archiving (sub1) [ <=> ] 0\r (no-eol) (esc)
1199 \r (no-eol) (esc)
1193 \r (no-eol) (esc)
1200 \r (no-eol) (esc)
1194 \r (no-eol) (esc)
1201 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1195 archiving (sub1/sub2) [ ] 0/1\r (no-eol) (esc)
1202 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1196 archiving (sub1/sub2) [==============================>] 1/1\r (no-eol) (esc)
1203 \r (no-eol) (esc)
1197 \r (no-eol) (esc)
1204 --- */cloned.*/sub1/sub2/sub2 * (glob)
1198 --- */cloned.*/sub1/sub2/sub2 * (glob)
1205 +++ */cloned/sub1/sub2/sub2 * (glob)
1199 +++ */cloned/sub1/sub2/sub2 * (glob)
1206 @@ -1* +1* @@ (glob)
1200 @@ -1* +1* @@ (glob)
1207 -modified
1201 -modified
1208 +mod
1202 +mod
1209 [1]
1203 [1]
1210
1204
1211 $ cd ..
1205 $ cd ..
@@ -1,711 +1,708 b''
1 Create test repository:
1 Create test repository:
2
2
3 $ hg init repo
3 $ hg init repo
4 $ cd repo
4 $ cd repo
5 $ echo x1 > x.txt
5 $ echo x1 > x.txt
6
6
7 $ hg init foo
7 $ hg init foo
8 $ cd foo
8 $ cd foo
9 $ echo y1 > y.txt
9 $ echo y1 > y.txt
10
10
11 $ hg init bar
11 $ hg init bar
12 $ cd bar
12 $ cd bar
13 $ echo z1 > z.txt
13 $ echo z1 > z.txt
14
14
15 $ cd ..
15 $ cd ..
16 $ echo 'bar = bar' > .hgsub
16 $ echo 'bar = bar' > .hgsub
17
17
18 $ cd ..
18 $ cd ..
19 $ echo 'foo = foo' > .hgsub
19 $ echo 'foo = foo' > .hgsub
20
20
21 Add files --- .hgsub files must go first to trigger subrepos:
21 Add files --- .hgsub files must go first to trigger subrepos:
22
22
23 $ hg add -S .hgsub
23 $ hg add -S .hgsub
24 $ hg add -S foo/.hgsub
24 $ hg add -S foo/.hgsub
25 $ hg add -S foo/bar
25 $ hg add -S foo/bar
26 adding foo/bar/z.txt
26 adding foo/bar/z.txt
27 $ hg add -S
27 $ hg add -S
28 adding x.txt
28 adding x.txt
29 adding foo/y.txt
29 adding foo/y.txt
30
30
31 Test recursive status without committing anything:
31 Test recursive status without committing anything:
32
32
33 $ hg status -S
33 $ hg status -S
34 A .hgsub
34 A .hgsub
35 A foo/.hgsub
35 A foo/.hgsub
36 A foo/bar/z.txt
36 A foo/bar/z.txt
37 A foo/y.txt
37 A foo/y.txt
38 A x.txt
38 A x.txt
39
39
40 Test recursive diff without committing anything:
40 Test recursive diff without committing anything:
41
41
42 $ hg diff --nodates -S foo
42 $ hg diff --nodates -S foo
43 diff -r 000000000000 foo/.hgsub
43 diff -r 000000000000 foo/.hgsub
44 --- /dev/null
44 --- /dev/null
45 +++ b/foo/.hgsub
45 +++ b/foo/.hgsub
46 @@ -0,0 +1,1 @@
46 @@ -0,0 +1,1 @@
47 +bar = bar
47 +bar = bar
48 diff -r 000000000000 foo/y.txt
48 diff -r 000000000000 foo/y.txt
49 --- /dev/null
49 --- /dev/null
50 +++ b/foo/y.txt
50 +++ b/foo/y.txt
51 @@ -0,0 +1,1 @@
51 @@ -0,0 +1,1 @@
52 +y1
52 +y1
53 diff -r 000000000000 foo/bar/z.txt
53 diff -r 000000000000 foo/bar/z.txt
54 --- /dev/null
54 --- /dev/null
55 +++ b/foo/bar/z.txt
55 +++ b/foo/bar/z.txt
56 @@ -0,0 +1,1 @@
56 @@ -0,0 +1,1 @@
57 +z1
57 +z1
58
58
59 Commits:
59 Commits:
60
60
61 $ hg commit -m fails
61 $ hg commit -m fails
62 abort: uncommitted changes in subrepository "foo"
62 abort: uncommitted changes in subrepository "foo"
63 (use --subrepos for recursive commit)
63 (use --subrepos for recursive commit)
64 [255]
64 [255]
65
65
66 The --subrepos flag overwrite the config setting:
66 The --subrepos flag overwrite the config setting:
67
67
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
68 $ hg commit -m 0-0-0 --config ui.commitsubrepos=No --subrepos
69 committing subrepository foo
69 committing subrepository foo
70 committing subrepository foo/bar
70 committing subrepository foo/bar
71
71
72 $ cd foo
72 $ cd foo
73 $ echo y2 >> y.txt
73 $ echo y2 >> y.txt
74 $ hg commit -m 0-1-0
74 $ hg commit -m 0-1-0
75
75
76 $ cd bar
76 $ cd bar
77 $ echo z2 >> z.txt
77 $ echo z2 >> z.txt
78 $ hg commit -m 0-1-1
78 $ hg commit -m 0-1-1
79
79
80 $ cd ..
80 $ cd ..
81 $ hg commit -m 0-2-1
81 $ hg commit -m 0-2-1
82
82
83 $ cd ..
83 $ cd ..
84 $ hg commit -m 1-2-1
84 $ hg commit -m 1-2-1
85
85
86 Change working directory:
86 Change working directory:
87
87
88 $ echo y3 >> foo/y.txt
88 $ echo y3 >> foo/y.txt
89 $ echo z3 >> foo/bar/z.txt
89 $ echo z3 >> foo/bar/z.txt
90 $ hg status -S
90 $ hg status -S
91 M foo/bar/z.txt
91 M foo/bar/z.txt
92 M foo/y.txt
92 M foo/y.txt
93 $ hg diff --nodates -S
93 $ hg diff --nodates -S
94 diff -r d254738c5f5e foo/y.txt
94 diff -r d254738c5f5e foo/y.txt
95 --- a/foo/y.txt
95 --- a/foo/y.txt
96 +++ b/foo/y.txt
96 +++ b/foo/y.txt
97 @@ -1,2 +1,3 @@
97 @@ -1,2 +1,3 @@
98 y1
98 y1
99 y2
99 y2
100 +y3
100 +y3
101 diff -r 9647f22de499 foo/bar/z.txt
101 diff -r 9647f22de499 foo/bar/z.txt
102 --- a/foo/bar/z.txt
102 --- a/foo/bar/z.txt
103 +++ b/foo/bar/z.txt
103 +++ b/foo/bar/z.txt
104 @@ -1,2 +1,3 @@
104 @@ -1,2 +1,3 @@
105 z1
105 z1
106 z2
106 z2
107 +z3
107 +z3
108
108
109 Status call crossing repository boundaries:
109 Status call crossing repository boundaries:
110
110
111 $ hg status -S foo/bar/z.txt
111 $ hg status -S foo/bar/z.txt
112 M foo/bar/z.txt
112 M foo/bar/z.txt
113 $ hg status -S -I 'foo/?.txt'
113 $ hg status -S -I 'foo/?.txt'
114 M foo/y.txt
114 M foo/y.txt
115 $ hg status -S -I '**/?.txt'
115 $ hg status -S -I '**/?.txt'
116 M foo/bar/z.txt
116 M foo/bar/z.txt
117 M foo/y.txt
117 M foo/y.txt
118 $ hg diff --nodates -S -I '**/?.txt'
118 $ hg diff --nodates -S -I '**/?.txt'
119 diff -r d254738c5f5e foo/y.txt
119 diff -r d254738c5f5e foo/y.txt
120 --- a/foo/y.txt
120 --- a/foo/y.txt
121 +++ b/foo/y.txt
121 +++ b/foo/y.txt
122 @@ -1,2 +1,3 @@
122 @@ -1,2 +1,3 @@
123 y1
123 y1
124 y2
124 y2
125 +y3
125 +y3
126 diff -r 9647f22de499 foo/bar/z.txt
126 diff -r 9647f22de499 foo/bar/z.txt
127 --- a/foo/bar/z.txt
127 --- a/foo/bar/z.txt
128 +++ b/foo/bar/z.txt
128 +++ b/foo/bar/z.txt
129 @@ -1,2 +1,3 @@
129 @@ -1,2 +1,3 @@
130 z1
130 z1
131 z2
131 z2
132 +z3
132 +z3
133
133
134 Status from within a subdirectory:
134 Status from within a subdirectory:
135
135
136 $ mkdir dir
136 $ mkdir dir
137 $ cd dir
137 $ cd dir
138 $ echo a1 > a.txt
138 $ echo a1 > a.txt
139 $ hg status -S
139 $ hg status -S
140 M foo/bar/z.txt
140 M foo/bar/z.txt
141 M foo/y.txt
141 M foo/y.txt
142 ? dir/a.txt
142 ? dir/a.txt
143 $ hg diff --nodates -S
143 $ hg diff --nodates -S
144 diff -r d254738c5f5e foo/y.txt
144 diff -r d254738c5f5e foo/y.txt
145 --- a/foo/y.txt
145 --- a/foo/y.txt
146 +++ b/foo/y.txt
146 +++ b/foo/y.txt
147 @@ -1,2 +1,3 @@
147 @@ -1,2 +1,3 @@
148 y1
148 y1
149 y2
149 y2
150 +y3
150 +y3
151 diff -r 9647f22de499 foo/bar/z.txt
151 diff -r 9647f22de499 foo/bar/z.txt
152 --- a/foo/bar/z.txt
152 --- a/foo/bar/z.txt
153 +++ b/foo/bar/z.txt
153 +++ b/foo/bar/z.txt
154 @@ -1,2 +1,3 @@
154 @@ -1,2 +1,3 @@
155 z1
155 z1
156 z2
156 z2
157 +z3
157 +z3
158
158
159 Status with relative path:
159 Status with relative path:
160
160
161 $ hg status -S ..
161 $ hg status -S ..
162 M ../foo/bar/z.txt
162 M ../foo/bar/z.txt
163 M ../foo/y.txt
163 M ../foo/y.txt
164 ? a.txt
164 ? a.txt
165
165
166 XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as
166 XXX: filtering lfilesrepo.status() in 3.3-rc causes these files to be listed as
167 added instead of modified.
167 added instead of modified.
168 $ hg status -S .. --config extensions.largefiles=
168 $ hg status -S .. --config extensions.largefiles=
169 M ../foo/bar/z.txt
169 M ../foo/bar/z.txt
170 M ../foo/y.txt
170 M ../foo/y.txt
171 ? a.txt
171 ? a.txt
172
172
173 $ hg diff --nodates -S ..
173 $ hg diff --nodates -S ..
174 diff -r d254738c5f5e foo/y.txt
174 diff -r d254738c5f5e foo/y.txt
175 --- a/foo/y.txt
175 --- a/foo/y.txt
176 +++ b/foo/y.txt
176 +++ b/foo/y.txt
177 @@ -1,2 +1,3 @@
177 @@ -1,2 +1,3 @@
178 y1
178 y1
179 y2
179 y2
180 +y3
180 +y3
181 diff -r 9647f22de499 foo/bar/z.txt
181 diff -r 9647f22de499 foo/bar/z.txt
182 --- a/foo/bar/z.txt
182 --- a/foo/bar/z.txt
183 +++ b/foo/bar/z.txt
183 +++ b/foo/bar/z.txt
184 @@ -1,2 +1,3 @@
184 @@ -1,2 +1,3 @@
185 z1
185 z1
186 z2
186 z2
187 +z3
187 +z3
188 $ cd ..
188 $ cd ..
189
189
190 Cleanup and final commit:
190 Cleanup and final commit:
191
191
192 $ rm -r dir
192 $ rm -r dir
193 $ hg commit --subrepos -m 2-3-2
193 $ hg commit --subrepos -m 2-3-2
194 committing subrepository foo
194 committing subrepository foo
195 committing subrepository foo/bar
195 committing subrepository foo/bar
196
196
197 Test explicit path commands within subrepos: add/forget
197 Test explicit path commands within subrepos: add/forget
198 $ echo z1 > foo/bar/z2.txt
198 $ echo z1 > foo/bar/z2.txt
199 $ hg status -S
199 $ hg status -S
200 ? foo/bar/z2.txt
200 ? foo/bar/z2.txt
201 $ hg add foo/bar/z2.txt
201 $ hg add foo/bar/z2.txt
202 $ hg status -S
202 $ hg status -S
203 A foo/bar/z2.txt
203 A foo/bar/z2.txt
204 $ hg forget foo/bar/z2.txt
204 $ hg forget foo/bar/z2.txt
205 $ hg status -S
205 $ hg status -S
206 ? foo/bar/z2.txt
206 ? foo/bar/z2.txt
207 $ hg forget foo/bar/z2.txt
207 $ hg forget foo/bar/z2.txt
208 not removing foo/bar/z2.txt: file is already untracked
208 not removing foo/bar/z2.txt: file is already untracked
209 [1]
209 [1]
210 $ hg status -S
210 $ hg status -S
211 ? foo/bar/z2.txt
211 ? foo/bar/z2.txt
212 $ rm foo/bar/z2.txt
212 $ rm foo/bar/z2.txt
213
213
214 Log with the relationships between repo and its subrepo:
214 Log with the relationships between repo and its subrepo:
215
215
216 $ hg log --template '{rev}:{node|short} {desc}\n'
216 $ hg log --template '{rev}:{node|short} {desc}\n'
217 2:1326fa26d0c0 2-3-2
217 2:1326fa26d0c0 2-3-2
218 1:4b3c9ff4f66b 1-2-1
218 1:4b3c9ff4f66b 1-2-1
219 0:23376cbba0d8 0-0-0
219 0:23376cbba0d8 0-0-0
220
220
221 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
221 $ hg -R foo log --template '{rev}:{node|short} {desc}\n'
222 3:65903cebad86 2-3-2
222 3:65903cebad86 2-3-2
223 2:d254738c5f5e 0-2-1
223 2:d254738c5f5e 0-2-1
224 1:8629ce7dcc39 0-1-0
224 1:8629ce7dcc39 0-1-0
225 0:af048e97ade2 0-0-0
225 0:af048e97ade2 0-0-0
226
226
227 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
227 $ hg -R foo/bar log --template '{rev}:{node|short} {desc}\n'
228 2:31ecbdafd357 2-3-2
228 2:31ecbdafd357 2-3-2
229 1:9647f22de499 0-1-1
229 1:9647f22de499 0-1-1
230 0:4904098473f9 0-0-0
230 0:4904098473f9 0-0-0
231
231
232 Status between revisions:
232 Status between revisions:
233
233
234 $ hg status -S
234 $ hg status -S
235 $ hg status -S --rev 0:1
235 $ hg status -S --rev 0:1
236 M .hgsubstate
236 M .hgsubstate
237 M foo/.hgsubstate
237 M foo/.hgsubstate
238 M foo/bar/z.txt
238 M foo/bar/z.txt
239 M foo/y.txt
239 M foo/y.txt
240 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
240 $ hg diff --nodates -S -I '**/?.txt' --rev 0:1
241 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
241 diff -r af048e97ade2 -r d254738c5f5e foo/y.txt
242 --- a/foo/y.txt
242 --- a/foo/y.txt
243 +++ b/foo/y.txt
243 +++ b/foo/y.txt
244 @@ -1,1 +1,2 @@
244 @@ -1,1 +1,2 @@
245 y1
245 y1
246 +y2
246 +y2
247 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
247 diff -r 4904098473f9 -r 9647f22de499 foo/bar/z.txt
248 --- a/foo/bar/z.txt
248 --- a/foo/bar/z.txt
249 +++ b/foo/bar/z.txt
249 +++ b/foo/bar/z.txt
250 @@ -1,1 +1,2 @@
250 @@ -1,1 +1,2 @@
251 z1
251 z1
252 +z2
252 +z2
253
253
254 #if serve
254 #if serve
255 $ cd ..
255 $ cd ..
256 $ hg serve -R repo --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log
256 $ hg serve -R repo --debug -S -p $HGPORT -d --pid-file=hg1.pid -E error.log -A access.log
257 adding = $TESTTMP/repo
257 adding = $TESTTMP/repo
258 adding foo = $TESTTMP/repo/foo
258 adding foo = $TESTTMP/repo/foo
259 adding foo/bar = $TESTTMP/repo/foo/bar
259 adding foo/bar = $TESTTMP/repo/foo/bar
260 listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?)
260 listening at http://*:$HGPORT/ (bound to *:$HGPORT) (glob) (?)
261 adding = $TESTTMP/repo (?)
261 adding = $TESTTMP/repo (?)
262 adding foo = $TESTTMP/repo/foo (?)
262 adding foo = $TESTTMP/repo/foo (?)
263 adding foo/bar = $TESTTMP/repo/foo/bar (?)
263 adding foo/bar = $TESTTMP/repo/foo/bar (?)
264 $ cat hg1.pid >> $DAEMON_PIDS
264 $ cat hg1.pid >> $DAEMON_PIDS
265
265
266 $ hg clone http://localhost:$HGPORT clone --config progress.disable=True
266 $ hg clone http://localhost:$HGPORT clone --config progress.disable=True
267 requesting all changes
267 requesting all changes
268 adding changesets
268 adding changesets
269 adding manifests
269 adding manifests
270 adding file changes
270 adding file changes
271 added 3 changesets with 5 changes to 3 files
271 added 3 changesets with 5 changes to 3 files
272 new changesets 23376cbba0d8:1326fa26d0c0
272 new changesets 23376cbba0d8:1326fa26d0c0
273 updating to branch default
273 updating to branch default
274 cloning subrepo foo from http://localhost:$HGPORT/foo
274 cloning subrepo foo from http://localhost:$HGPORT/foo
275 requesting all changes
275 requesting all changes
276 adding changesets
276 adding changesets
277 adding manifests
277 adding manifests
278 adding file changes
278 adding file changes
279 added 4 changesets with 7 changes to 3 files
279 added 4 changesets with 7 changes to 3 files
280 new changesets af048e97ade2:65903cebad86
280 new changesets af048e97ade2:65903cebad86
281 cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar
281 cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar
282 requesting all changes
282 requesting all changes
283 adding changesets
283 adding changesets
284 adding manifests
284 adding manifests
285 adding file changes
285 adding file changes
286 added 3 changesets with 3 changes to 1 files
286 added 3 changesets with 3 changes to 1 files
287 new changesets 4904098473f9:31ecbdafd357
287 new changesets 4904098473f9:31ecbdafd357
288 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
288 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
289
289
290 $ cat clone/foo/bar/z.txt
290 $ cat clone/foo/bar/z.txt
291 z1
291 z1
292 z2
292 z2
293 z3
293 z3
294
294
295 Clone pooling from a remote URL will share the top level repo and the subrepos,
295 Clone pooling from a remote URL will share the top level repo and the subrepos,
296 even if they are referenced by remote URL.
296 even if they are referenced by remote URL.
297
297
298 $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \
298 $ hg --config extensions.share= --config share.pool=$TESTTMP/pool \
299 > clone http://localhost:$HGPORT shared
299 > clone http://localhost:$HGPORT shared
300 (sharing from new pooled repository 23376cbba0d87c15906bb3652584927c140907bf)
300 (sharing from new pooled repository 23376cbba0d87c15906bb3652584927c140907bf)
301 requesting all changes
301 requesting all changes
302 adding changesets
302 adding changesets
303 adding manifests
303 adding manifests
304 adding file changes
304 adding file changes
305 added 3 changesets with 5 changes to 3 files
305 added 3 changesets with 5 changes to 3 files
306 new changesets 23376cbba0d8:1326fa26d0c0
306 new changesets 23376cbba0d8:1326fa26d0c0
307 searching for changes
307 searching for changes
308 no changes found
308 no changes found
309 updating working directory
309 updating working directory
310 cloning subrepo foo from http://localhost:$HGPORT/foo
310 cloning subrepo foo from http://localhost:$HGPORT/foo
311 (sharing from new pooled repository af048e97ade2e236f754f05d07013e586af0f8bf)
311 (sharing from new pooled repository af048e97ade2e236f754f05d07013e586af0f8bf)
312 requesting all changes
312 requesting all changes
313 adding changesets
313 adding changesets
314 adding manifests
314 adding manifests
315 adding file changes
315 adding file changes
316 added 4 changesets with 7 changes to 3 files
316 added 4 changesets with 7 changes to 3 files
317 new changesets af048e97ade2:65903cebad86
317 new changesets af048e97ade2:65903cebad86
318 searching for changes
318 searching for changes
319 no changes found
319 no changes found
320 cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar
320 cloning subrepo foo/bar from http://localhost:$HGPORT/foo/bar
321 (sharing from new pooled repository 4904098473f96c900fec436dad267edd4da59fad)
321 (sharing from new pooled repository 4904098473f96c900fec436dad267edd4da59fad)
322 requesting all changes
322 requesting all changes
323 adding changesets
323 adding changesets
324 adding manifests
324 adding manifests
325 adding file changes
325 adding file changes
326 added 3 changesets with 3 changes to 1 files
326 added 3 changesets with 3 changes to 1 files
327 new changesets 4904098473f9:31ecbdafd357
327 new changesets 4904098473f9:31ecbdafd357
328 searching for changes
328 searching for changes
329 no changes found
329 no changes found
330 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
330 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
331
331
332 $ cat access.log
332 $ cat access.log
333 * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
333 * "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
334 * "GET /?cmd=batch HTTP/1.1" 200 - * (glob)
334 * "GET /?cmd=batch HTTP/1.1" 200 - * (glob)
335 * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob)
335 * "GET /?cmd=getbundle HTTP/1.1" 200 - * (glob)
336 * "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
336 * "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
337 * "GET /foo?cmd=batch HTTP/1.1" 200 - * (glob)
337 * "GET /foo?cmd=batch HTTP/1.1" 200 - * (glob)
338 * "GET /foo?cmd=getbundle HTTP/1.1" 200 - * (glob)
338 * "GET /foo?cmd=getbundle HTTP/1.1" 200 - * (glob)
339 * "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
339 * "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
340 * "GET /foo/bar?cmd=batch HTTP/1.1" 200 - * (glob)
340 * "GET /foo/bar?cmd=batch HTTP/1.1" 200 - * (glob)
341 * "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - * (glob)
341 * "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - * (glob)
342 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
342 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
343 $LOCALIP - - [$LOGDATE$] "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
343 $LOCALIP - - [$LOGDATE$] "GET /?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
344 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
344 $LOCALIP - - [$LOGDATE$] "GET /?cmd=capabilities HTTP/1.1" 200 - (glob)
345 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
345 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
346 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
346 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
347 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D1326fa26d0c00d2146c63b56bb6a45149d7325ac x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
347 $LOCALIP - - [$LOGDATE$] "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D1326fa26d0c00d2146c63b56bb6a45149d7325ac x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
348 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=1326fa26d0c00d2146c63b56bb6a45149d7325ac&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
348 $LOCALIP - - [$LOGDATE$] "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=1326fa26d0c00d2146c63b56bb6a45149d7325ac&heads=1326fa26d0c00d2146c63b56bb6a45149d7325ac&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
349 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
349 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
350 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
350 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
351 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
351 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=capabilities HTTP/1.1" 200 - (glob)
352 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
352 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
353 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
353 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
354 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D65903cebad86f1a84bd4f1134f62fa7dcb7a1c98 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
354 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D65903cebad86f1a84bd4f1134f62fa7dcb7a1c98 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
355 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
355 $LOCALIP - - [$LOGDATE$] "GET /foo?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&heads=65903cebad86f1a84bd4f1134f62fa7dcb7a1c98&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
356 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
356 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
357 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
357 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=lookup HTTP/1.1" 200 - x-hgarg-1:key=0 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
358 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
358 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=capabilities HTTP/1.1" 200 - (glob)
359 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
359 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
360 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
360 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=1&common=0000000000000000000000000000000000000000&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
361 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D31ecbdafd357f54b281c9bd1d681bb90de219e22 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
361 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D31ecbdafd357f54b281c9bd1d681bb90de219e22 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
362 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=31ecbdafd357f54b281c9bd1d681bb90de219e22&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
362 $LOCALIP - - [$LOGDATE$] "GET /foo/bar?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:bookmarks=1&$USUAL_BUNDLE_CAPS$&cg=0&common=31ecbdafd357f54b281c9bd1d681bb90de219e22&heads=31ecbdafd357f54b281c9bd1d681bb90de219e22&listkeys=bookmarks&phases=1 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ (glob)
363
363
364 $ killdaemons.py
364 $ killdaemons.py
365 $ rm hg1.pid error.log access.log
365 $ rm hg1.pid error.log access.log
366 $ cd repo
366 $ cd repo
367 #endif
367 #endif
368
368
369 Enable progress extension for archive tests:
369 Enable progress extension for archive tests:
370
370
371 $ cp $HGRCPATH $HGRCPATH.no-progress
371 $ cp $HGRCPATH $HGRCPATH.no-progress
372 $ cat >> $HGRCPATH <<EOF
372 $ cat >> $HGRCPATH <<EOF
373 > [progress]
373 > [progress]
374 > disable=False
374 > disable=False
375 > assume-tty = 1
375 > assume-tty = 1
376 > delay = 0
376 > delay = 0
377 > # set changedelay really large so we don't see nested topics
377 > # set changedelay really large so we don't see nested topics
378 > changedelay = 30000
378 > changedelay = 30000
379 > format = topic bar number
379 > format = topic bar number
380 > refresh = 0
380 > refresh = 0
381 > width = 60
381 > width = 60
382 > EOF
382 > EOF
383
383
384 Test archiving to a directory tree (the doubled lines in the output
384 Test archiving to a directory tree (the doubled lines in the output
385 only show up in the test output, not in real usage):
385 only show up in the test output, not in real usage):
386
386
387 $ hg archive --subrepos ../archive
387 $ hg archive --subrepos ../archive
388 \r (no-eol) (esc)
388 \r (no-eol) (esc)
389 archiving [ ] 0/3\r (no-eol) (esc)
389 archiving [ ] 0/3\r (no-eol) (esc)
390 archiving [=============> ] 1/3\r (no-eol) (esc)
390 archiving [=============> ] 1/3\r (no-eol) (esc)
391 archiving [===========================> ] 2/3\r (no-eol) (esc)
391 archiving [===========================> ] 2/3\r (no-eol) (esc)
392 archiving [==========================================>] 3/3\r (no-eol) (esc)
392 archiving [==========================================>] 3/3\r (no-eol) (esc)
393 \r (no-eol) (esc)
393 \r (no-eol) (esc)
394 \r (no-eol) (esc)
394 \r (no-eol) (esc)
395 archiving (foo) [ ] 0/3\r (no-eol) (esc)
395 archiving (foo) [ ] 0/3\r (no-eol) (esc)
396 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
396 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
397 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
397 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
398 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
398 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
399 \r (no-eol) (esc)
399 \r (no-eol) (esc)
400 \r (no-eol) (esc)
400 \r (no-eol) (esc)
401 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
401 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
402 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
402 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
403 \r (no-eol) (esc)
403 \r (no-eol) (esc)
404 $ find ../archive | sort
404 $ find ../archive | sort
405 ../archive
405 ../archive
406 ../archive/.hg_archival.txt
406 ../archive/.hg_archival.txt
407 ../archive/.hgsub
407 ../archive/.hgsub
408 ../archive/.hgsubstate
408 ../archive/.hgsubstate
409 ../archive/foo
409 ../archive/foo
410 ../archive/foo/.hgsub
410 ../archive/foo/.hgsub
411 ../archive/foo/.hgsubstate
411 ../archive/foo/.hgsubstate
412 ../archive/foo/bar
412 ../archive/foo/bar
413 ../archive/foo/bar/z.txt
413 ../archive/foo/bar/z.txt
414 ../archive/foo/y.txt
414 ../archive/foo/y.txt
415 ../archive/x.txt
415 ../archive/x.txt
416
416
417 Test archiving to zip file (unzip output is unstable):
417 Test archiving to zip file (unzip output is unstable):
418
418
419 $ hg archive --subrepos --prefix '.' ../archive.zip
419 $ hg archive --subrepos --prefix '.' ../archive.zip
420 \r (no-eol) (esc)
420 \r (no-eol) (esc)
421 archiving [ ] 0/3\r (no-eol) (esc)
421 archiving [ ] 0/3\r (no-eol) (esc)
422 archiving [=============> ] 1/3\r (no-eol) (esc)
422 archiving [=============> ] 1/3\r (no-eol) (esc)
423 archiving [===========================> ] 2/3\r (no-eol) (esc)
423 archiving [===========================> ] 2/3\r (no-eol) (esc)
424 archiving [==========================================>] 3/3\r (no-eol) (esc)
424 archiving [==========================================>] 3/3\r (no-eol) (esc)
425 \r (no-eol) (esc)
425 \r (no-eol) (esc)
426 \r (no-eol) (esc)
426 \r (no-eol) (esc)
427 archiving (foo) [ ] 0/3\r (no-eol) (esc)
427 archiving (foo) [ ] 0/3\r (no-eol) (esc)
428 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
428 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
429 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
429 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
430 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
430 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
431 \r (no-eol) (esc)
431 \r (no-eol) (esc)
432 \r (no-eol) (esc)
432 \r (no-eol) (esc)
433 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
433 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
434 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
434 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
435 \r (no-eol) (esc)
435 \r (no-eol) (esc)
436
436
437 (unzip date formating is unstable, we do not care about it and glob it out)
437 (unzip date formating is unstable, we do not care about it and glob it out)
438
438
439 $ unzip -l ../archive.zip | grep -v -- ----- | egrep -v files$
439 $ unzip -l ../archive.zip | grep -v -- ----- | egrep -v files$
440 Archive: ../archive.zip
440 Archive: ../archive.zip
441 Length [ ]* Date [ ]* Time [ ]* Name (re)
441 Length [ ]* Date [ ]* Time [ ]* Name (re)
442 172 [0-9:\- ]* .hg_archival.txt (re)
442 172 [0-9:\- ]* .hg_archival.txt (re)
443 10 [0-9:\- ]* .hgsub (re)
443 10 [0-9:\- ]* .hgsub (re)
444 45 [0-9:\- ]* .hgsubstate (re)
444 45 [0-9:\- ]* .hgsubstate (re)
445 3 [0-9:\- ]* x.txt (re)
445 3 [0-9:\- ]* x.txt (re)
446 10 [0-9:\- ]* foo/.hgsub (re)
446 10 [0-9:\- ]* foo/.hgsub (re)
447 45 [0-9:\- ]* foo/.hgsubstate (re)
447 45 [0-9:\- ]* foo/.hgsubstate (re)
448 9 [0-9:\- ]* foo/y.txt (re)
448 9 [0-9:\- ]* foo/y.txt (re)
449 9 [0-9:\- ]* foo/bar/z.txt (re)
449 9 [0-9:\- ]* foo/bar/z.txt (re)
450
450
451 Test archiving a revision that references a subrepo that is not yet
451 Test archiving a revision that references a subrepo that is not yet
452 cloned:
452 cloned:
453
453
454 #if hardlink
454 #if hardlink
455 $ hg clone -U . ../empty
455 $ hg clone -U . ../empty
456 \r (no-eol) (esc)
456 \r (no-eol) (esc)
457 linking [ <=> ] 1\r (no-eol) (esc)
457 linking [ <=> ] 1\r (no-eol) (esc)
458 linking [ <=> ] 2\r (no-eol) (esc)
458 linking [ <=> ] 2\r (no-eol) (esc)
459 linking [ <=> ] 3\r (no-eol) (esc)
459 linking [ <=> ] 3\r (no-eol) (esc)
460 linking [ <=> ] 4\r (no-eol) (esc)
460 linking [ <=> ] 4\r (no-eol) (esc)
461 linking [ <=> ] 5\r (no-eol) (esc)
461 linking [ <=> ] 5\r (no-eol) (esc)
462 linking [ <=> ] 6\r (no-eol) (esc)
462 linking [ <=> ] 6\r (no-eol) (esc)
463 linking [ <=> ] 7\r (no-eol) (esc)
463 linking [ <=> ] 7\r (no-eol) (esc)
464 linking [ <=> ] 8\r (no-eol) (esc)
464 linking [ <=> ] 8\r (no-eol) (esc)
465 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
465 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
466 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
466 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
467 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
467 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
468 linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !)
468 linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !)
469 linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !)
470 \r (no-eol) (esc)
469 \r (no-eol) (esc)
471 #else
470 #else
472 $ hg clone -U . ../empty
471 $ hg clone -U . ../empty
473 \r (no-eol) (esc)
472 \r (no-eol) (esc)
474 linking [ <=> ] 1 (no-eol)
473 linking [ <=> ] 1 (no-eol)
475 #endif
474 #endif
476
475
477 $ cd ../empty
476 $ cd ../empty
478 #if hardlink
477 #if hardlink
479 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
478 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
480 \r (no-eol) (esc)
479 \r (no-eol) (esc)
481 archiving [ ] 0/3\r (no-eol) (esc)
480 archiving [ ] 0/3\r (no-eol) (esc)
482 archiving [=============> ] 1/3\r (no-eol) (esc)
481 archiving [=============> ] 1/3\r (no-eol) (esc)
483 archiving [===========================> ] 2/3\r (no-eol) (esc)
482 archiving [===========================> ] 2/3\r (no-eol) (esc)
484 archiving [==========================================>] 3/3\r (no-eol) (esc)
483 archiving [==========================================>] 3/3\r (no-eol) (esc)
485 \r (no-eol) (esc)
484 \r (no-eol) (esc)
486 \r (no-eol) (esc)
485 \r (no-eol) (esc)
487 linking [ <=> ] 1\r (no-eol) (esc)
486 linking [ <=> ] 1\r (no-eol) (esc)
488 linking [ <=> ] 2\r (no-eol) (esc)
487 linking [ <=> ] 2\r (no-eol) (esc)
489 linking [ <=> ] 3\r (no-eol) (esc)
488 linking [ <=> ] 3\r (no-eol) (esc)
490 linking [ <=> ] 4\r (no-eol) (esc)
489 linking [ <=> ] 4\r (no-eol) (esc)
491 linking [ <=> ] 5\r (no-eol) (esc)
490 linking [ <=> ] 5\r (no-eol) (esc)
492 linking [ <=> ] 6\r (no-eol) (esc)
491 linking [ <=> ] 6\r (no-eol) (esc)
493 linking [ <=> ] 7\r (no-eol) (esc)
492 linking [ <=> ] 7\r (no-eol) (esc)
494 linking [ <=> ] 8\r (no-eol) (esc)
493 linking [ <=> ] 8\r (no-eol) (esc)
495 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
494 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
496 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
495 linking [ <=> ] 10\r (no-eol) (esc) (reposimplestore !)
497 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
496 linking [ <=> ] 11\r (no-eol) (esc) (reposimplestore !)
498 linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !)
497 linking [ <=> ] 12\r (no-eol) (esc) (reposimplestore !)
499 linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !)
498 linking [ <=> ] 13\r (no-eol) (esc) (reposimplestore !)
500 linking [ <=> ] 14\r (no-eol) (esc) (reposimplestore !)
499 linking [ <=> ] 14\r (no-eol) (esc) (reposimplestore !)
501 linking [ <=> ] 15\r (no-eol) (esc) (reposimplestore !)
502 \r (no-eol) (esc)
500 \r (no-eol) (esc)
503 \r (no-eol) (esc)
501 \r (no-eol) (esc)
504 archiving (foo) [ ] 0/3\r (no-eol) (esc)
502 archiving (foo) [ ] 0/3\r (no-eol) (esc)
505 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
503 archiving (foo) [===========> ] 1/3\r (no-eol) (esc)
506 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
504 archiving (foo) [=======================> ] 2/3\r (no-eol) (esc)
507 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
505 archiving (foo) [====================================>] 3/3\r (no-eol) (esc)
508 \r (no-eol) (esc)
506 \r (no-eol) (esc)
509 \r (no-eol) (esc)
507 \r (no-eol) (esc)
510 linking [ <=> ] 1\r (no-eol) (esc)
508 linking [ <=> ] 1\r (no-eol) (esc)
511 linking [ <=> ] 2\r (no-eol) (esc)
509 linking [ <=> ] 2\r (no-eol) (esc)
512 linking [ <=> ] 3\r (no-eol) (esc)
510 linking [ <=> ] 3\r (no-eol) (esc)
513 linking [ <=> ] 4\r (no-eol) (esc)
511 linking [ <=> ] 4\r (no-eol) (esc)
514 linking [ <=> ] 5\r (no-eol) (esc)
512 linking [ <=> ] 5\r (no-eol) (esc)
515 linking [ <=> ] 6\r (no-eol) (esc)
513 linking [ <=> ] 6\r (no-eol) (esc)
516 linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !)
514 linking [ <=> ] 7\r (no-eol) (esc) (reposimplestore !)
517 linking [ <=> ] 8\r (no-eol) (esc) (reposimplestore !)
515 linking [ <=> ] 8\r (no-eol) (esc) (reposimplestore !)
518 linking [ <=> ] 9\r (no-eol) (esc) (reposimplestore !)
519 \r (no-eol) (esc)
516 \r (no-eol) (esc)
520 \r (no-eol) (esc)
517 \r (no-eol) (esc)
521 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
518 archiving (foo/bar) [ ] 0/1\r (no-eol) (esc)
522 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
519 archiving (foo/bar) [================================>] 1/1\r (no-eol) (esc)
523 \r (no-eol) (esc)
520 \r (no-eol) (esc)
524 cloning subrepo foo from $TESTTMP/repo/foo
521 cloning subrepo foo from $TESTTMP/repo/foo
525 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
522 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
526 #else
523 #else
527 Note there's a slight output glitch on non-hardlink systems: the last
524 Note there's a slight output glitch on non-hardlink systems: the last
528 "linking" progress topic never gets closed, leading to slight output corruption on that platform.
525 "linking" progress topic never gets closed, leading to slight output corruption on that platform.
529 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
526 $ hg archive --subrepos -r tip --prefix './' ../archive.tar.gz
530 \r (no-eol) (esc)
527 \r (no-eol) (esc)
531 archiving [ ] 0/3\r (no-eol) (esc)
528 archiving [ ] 0/3\r (no-eol) (esc)
532 archiving [=============> ] 1/3\r (no-eol) (esc)
529 archiving [=============> ] 1/3\r (no-eol) (esc)
533 archiving [===========================> ] 2/3\r (no-eol) (esc)
530 archiving [===========================> ] 2/3\r (no-eol) (esc)
534 archiving [==========================================>] 3/3\r (no-eol) (esc)
531 archiving [==========================================>] 3/3\r (no-eol) (esc)
535 \r (no-eol) (esc)
532 \r (no-eol) (esc)
536 \r (no-eol) (esc)
533 \r (no-eol) (esc)
537 linking [ <=> ] 1\r (no-eol) (esc)
534 linking [ <=> ] 1\r (no-eol) (esc)
538 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
535 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
539 #endif
536 #endif
540
537
541 Archive + subrepos uses '/' for all component separators
538 Archive + subrepos uses '/' for all component separators
542
539
543 $ tar -tzf ../archive.tar.gz | sort
540 $ tar -tzf ../archive.tar.gz | sort
544 .hg_archival.txt
541 .hg_archival.txt
545 .hgsub
542 .hgsub
546 .hgsubstate
543 .hgsubstate
547 foo/.hgsub
544 foo/.hgsub
548 foo/.hgsubstate
545 foo/.hgsubstate
549 foo/bar/z.txt
546 foo/bar/z.txt
550 foo/y.txt
547 foo/y.txt
551 x.txt
548 x.txt
552
549
553 The newly cloned subrepos contain no working copy:
550 The newly cloned subrepos contain no working copy:
554
551
555 $ hg -R foo summary
552 $ hg -R foo summary
556 parent: -1:000000000000 (no revision checked out)
553 parent: -1:000000000000 (no revision checked out)
557 branch: default
554 branch: default
558 commit: (clean)
555 commit: (clean)
559 update: 4 new changesets (update)
556 update: 4 new changesets (update)
560
557
561 Sharing a local repo without the locally referenced subrepo (i.e. it was never
558 Sharing a local repo without the locally referenced subrepo (i.e. it was never
562 updated from null), fails the same as a clone operation.
559 updated from null), fails the same as a clone operation.
563
560
564 $ hg --config progress.disable=True clone -U ../empty ../empty2
561 $ hg --config progress.disable=True clone -U ../empty ../empty2
565
562
566 $ hg --config extensions.share= --config progress.disable=True \
563 $ hg --config extensions.share= --config progress.disable=True \
567 > share ../empty2 ../empty_share
564 > share ../empty2 ../empty_share
568 updating working directory
565 updating working directory
569 abort: repository $TESTTMP/empty2/foo not found!
566 abort: repository $TESTTMP/empty2/foo not found!
570 [255]
567 [255]
571
568
572 $ hg --config progress.disable=True clone ../empty2 ../empty_clone
569 $ hg --config progress.disable=True clone ../empty2 ../empty_clone
573 updating to branch default
570 updating to branch default
574 abort: repository $TESTTMP/empty2/foo not found!
571 abort: repository $TESTTMP/empty2/foo not found!
575 [255]
572 [255]
576
573
577 Disable progress extension and cleanup:
574 Disable progress extension and cleanup:
578
575
579 $ mv $HGRCPATH.no-progress $HGRCPATH
576 $ mv $HGRCPATH.no-progress $HGRCPATH
580
577
581 Test archiving when there is a directory in the way for a subrepo
578 Test archiving when there is a directory in the way for a subrepo
582 created by archive:
579 created by archive:
583
580
584 $ hg clone -U . ../almost-empty
581 $ hg clone -U . ../almost-empty
585 $ cd ../almost-empty
582 $ cd ../almost-empty
586 $ mkdir foo
583 $ mkdir foo
587 $ echo f > foo/f
584 $ echo f > foo/f
588 $ hg archive --subrepos -r tip archive
585 $ hg archive --subrepos -r tip archive
589 cloning subrepo foo from $TESTTMP/empty/foo
586 cloning subrepo foo from $TESTTMP/empty/foo
590 abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepository "foo")
587 abort: destination '$TESTTMP/almost-empty/foo' is not empty (in subrepository "foo")
591 [255]
588 [255]
592
589
593 Clone and test outgoing:
590 Clone and test outgoing:
594
591
595 $ cd ..
592 $ cd ..
596 $ hg clone repo repo2
593 $ hg clone repo repo2
597 updating to branch default
594 updating to branch default
598 cloning subrepo foo from $TESTTMP/repo/foo
595 cloning subrepo foo from $TESTTMP/repo/foo
599 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
596 cloning subrepo foo/bar from $TESTTMP/repo/foo/bar
600 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
597 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
601 $ cd repo2
598 $ cd repo2
602 $ hg outgoing -S
599 $ hg outgoing -S
603 comparing with $TESTTMP/repo
600 comparing with $TESTTMP/repo
604 searching for changes
601 searching for changes
605 no changes found
602 no changes found
606 comparing with $TESTTMP/repo/foo
603 comparing with $TESTTMP/repo/foo
607 searching for changes
604 searching for changes
608 no changes found
605 no changes found
609 comparing with $TESTTMP/repo/foo/bar
606 comparing with $TESTTMP/repo/foo/bar
610 searching for changes
607 searching for changes
611 no changes found
608 no changes found
612 [1]
609 [1]
613
610
614 Make nested change:
611 Make nested change:
615
612
616 $ echo y4 >> foo/y.txt
613 $ echo y4 >> foo/y.txt
617 $ hg diff --nodates -S
614 $ hg diff --nodates -S
618 diff -r 65903cebad86 foo/y.txt
615 diff -r 65903cebad86 foo/y.txt
619 --- a/foo/y.txt
616 --- a/foo/y.txt
620 +++ b/foo/y.txt
617 +++ b/foo/y.txt
621 @@ -1,3 +1,4 @@
618 @@ -1,3 +1,4 @@
622 y1
619 y1
623 y2
620 y2
624 y3
621 y3
625 +y4
622 +y4
626 $ hg commit --subrepos -m 3-4-2
623 $ hg commit --subrepos -m 3-4-2
627 committing subrepository foo
624 committing subrepository foo
628 $ hg outgoing -S
625 $ hg outgoing -S
629 comparing with $TESTTMP/repo
626 comparing with $TESTTMP/repo
630 searching for changes
627 searching for changes
631 changeset: 3:2655b8ecc4ee
628 changeset: 3:2655b8ecc4ee
632 tag: tip
629 tag: tip
633 user: test
630 user: test
634 date: Thu Jan 01 00:00:00 1970 +0000
631 date: Thu Jan 01 00:00:00 1970 +0000
635 summary: 3-4-2
632 summary: 3-4-2
636
633
637 comparing with $TESTTMP/repo/foo
634 comparing with $TESTTMP/repo/foo
638 searching for changes
635 searching for changes
639 changeset: 4:e96193d6cb36
636 changeset: 4:e96193d6cb36
640 tag: tip
637 tag: tip
641 user: test
638 user: test
642 date: Thu Jan 01 00:00:00 1970 +0000
639 date: Thu Jan 01 00:00:00 1970 +0000
643 summary: 3-4-2
640 summary: 3-4-2
644
641
645 comparing with $TESTTMP/repo/foo/bar
642 comparing with $TESTTMP/repo/foo/bar
646 searching for changes
643 searching for changes
647 no changes found
644 no changes found
648
645
649
646
650 Switch to original repo and setup default path:
647 Switch to original repo and setup default path:
651
648
652 $ cd ../repo
649 $ cd ../repo
653 $ echo '[paths]' >> .hg/hgrc
650 $ echo '[paths]' >> .hg/hgrc
654 $ echo 'default = ../repo2' >> .hg/hgrc
651 $ echo 'default = ../repo2' >> .hg/hgrc
655
652
656 Test incoming:
653 Test incoming:
657
654
658 $ hg incoming -S
655 $ hg incoming -S
659 comparing with $TESTTMP/repo2
656 comparing with $TESTTMP/repo2
660 searching for changes
657 searching for changes
661 changeset: 3:2655b8ecc4ee
658 changeset: 3:2655b8ecc4ee
662 tag: tip
659 tag: tip
663 user: test
660 user: test
664 date: Thu Jan 01 00:00:00 1970 +0000
661 date: Thu Jan 01 00:00:00 1970 +0000
665 summary: 3-4-2
662 summary: 3-4-2
666
663
667 comparing with $TESTTMP/repo2/foo
664 comparing with $TESTTMP/repo2/foo
668 searching for changes
665 searching for changes
669 changeset: 4:e96193d6cb36
666 changeset: 4:e96193d6cb36
670 tag: tip
667 tag: tip
671 user: test
668 user: test
672 date: Thu Jan 01 00:00:00 1970 +0000
669 date: Thu Jan 01 00:00:00 1970 +0000
673 summary: 3-4-2
670 summary: 3-4-2
674
671
675 comparing with $TESTTMP/repo2/foo/bar
672 comparing with $TESTTMP/repo2/foo/bar
676 searching for changes
673 searching for changes
677 no changes found
674 no changes found
678
675
679 $ hg incoming -S --bundle incoming.hg
676 $ hg incoming -S --bundle incoming.hg
680 abort: cannot combine --bundle and --subrepos
677 abort: cannot combine --bundle and --subrepos
681 [255]
678 [255]
682
679
683 Test missing subrepo:
680 Test missing subrepo:
684
681
685 $ rm -r foo
682 $ rm -r foo
686 $ hg status -S
683 $ hg status -S
687 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
684 warning: error "unknown revision '65903cebad86f1a84bd4f1134f62fa7dcb7a1c98'" in subrepository "foo"
688
685
689 Issue2619: IndexError: list index out of range on hg add with subrepos
686 Issue2619: IndexError: list index out of range on hg add with subrepos
690 The subrepo must sorts after the explicit filename.
687 The subrepo must sorts after the explicit filename.
691
688
692 $ cd ..
689 $ cd ..
693 $ hg init test
690 $ hg init test
694 $ cd test
691 $ cd test
695 $ hg init x
692 $ hg init x
696 $ echo abc > abc.txt
693 $ echo abc > abc.txt
697 $ hg ci -Am "abc"
694 $ hg ci -Am "abc"
698 adding abc.txt
695 adding abc.txt
699 $ echo "x = x" >> .hgsub
696 $ echo "x = x" >> .hgsub
700 $ hg add .hgsub
697 $ hg add .hgsub
701 $ touch a x/a
698 $ touch a x/a
702 $ hg add a x/a
699 $ hg add a x/a
703
700
704 $ hg ci -Sm "added x"
701 $ hg ci -Sm "added x"
705 committing subrepository x
702 committing subrepository x
706 $ echo abc > x/a
703 $ echo abc > x/a
707 $ hg revert --rev '.^' "set:subrepo('glob:x*')"
704 $ hg revert --rev '.^' "set:subrepo('glob:x*')"
708 abort: subrepository 'x' does not exist in 25ac2c9b3180!
705 abort: subrepository 'x' does not exist in 25ac2c9b3180!
709 [255]
706 [255]
710
707
711 $ cd ..
708 $ cd ..
@@ -1,876 +1,878 b''
1 #require killdaemons
1 #require killdaemons
2
2
3 $ cat << EOF >> $HGRCPATH
3 $ cat << EOF >> $HGRCPATH
4 > [ui]
4 > [ui]
5 > ssh=$PYTHON "$TESTDIR/dummyssh"
5 > ssh=$PYTHON "$TESTDIR/dummyssh"
6 > EOF
6 > EOF
7
7
8 Set up repo
8 Set up repo
9
9
10 $ hg --config experimental.treemanifest=True init repo
10 $ hg --config experimental.treemanifest=True init repo
11 $ cd repo
11 $ cd repo
12
12
13 Requirements get set on init
13 Requirements get set on init
14
14
15 $ grep treemanifest .hg/requires
15 $ grep treemanifest .hg/requires
16 treemanifest
16 treemanifest
17
17
18 Without directories, looks like any other repo
18 Without directories, looks like any other repo
19
19
20 $ echo 0 > a
20 $ echo 0 > a
21 $ echo 0 > b
21 $ echo 0 > b
22 $ hg ci -Aqm initial
22 $ hg ci -Aqm initial
23 $ hg debugdata -m 0
23 $ hg debugdata -m 0
24 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
24 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
25 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
25 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
26
26
27 Submanifest is stored in separate revlog
27 Submanifest is stored in separate revlog
28
28
29 $ mkdir dir1
29 $ mkdir dir1
30 $ echo 1 > dir1/a
30 $ echo 1 > dir1/a
31 $ echo 1 > dir1/b
31 $ echo 1 > dir1/b
32 $ echo 1 > e
32 $ echo 1 > e
33 $ hg ci -Aqm 'add dir1'
33 $ hg ci -Aqm 'add dir1'
34 $ hg debugdata -m 1
34 $ hg debugdata -m 1
35 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
35 a\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
36 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
36 b\x00362fef284ce2ca02aecc8de6d5e8a1c3af0556fe (esc)
37 dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc)
37 dir1\x008b3ffd73f901e83304c83d33132c8e774ceac44et (esc)
38 e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
38 e\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
39 $ hg debugdata --dir dir1 0
39 $ hg debugdata --dir dir1 0
40 a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
40 a\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
41 b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
41 b\x00b8e02f6433738021a065f94175c7cd23db5f05be (esc)
42
42
43 Can add nested directories
43 Can add nested directories
44
44
45 $ mkdir dir1/dir1
45 $ mkdir dir1/dir1
46 $ echo 2 > dir1/dir1/a
46 $ echo 2 > dir1/dir1/a
47 $ echo 2 > dir1/dir1/b
47 $ echo 2 > dir1/dir1/b
48 $ mkdir dir1/dir2
48 $ mkdir dir1/dir2
49 $ echo 2 > dir1/dir2/a
49 $ echo 2 > dir1/dir2/a
50 $ echo 2 > dir1/dir2/b
50 $ echo 2 > dir1/dir2/b
51 $ hg ci -Aqm 'add dir1/dir1'
51 $ hg ci -Aqm 'add dir1/dir1'
52 $ hg files -r .
52 $ hg files -r .
53 a
53 a
54 b
54 b
55 dir1/a
55 dir1/a
56 dir1/b
56 dir1/b
57 dir1/dir1/a
57 dir1/dir1/a
58 dir1/dir1/b
58 dir1/dir1/b
59 dir1/dir2/a
59 dir1/dir2/a
60 dir1/dir2/b
60 dir1/dir2/b
61 e
61 e
62
62
63 The manifest command works
63 The manifest command works
64
64
65 $ hg manifest
65 $ hg manifest
66 a
66 a
67 b
67 b
68 dir1/a
68 dir1/a
69 dir1/b
69 dir1/b
70 dir1/dir1/a
70 dir1/dir1/a
71 dir1/dir1/b
71 dir1/dir1/b
72 dir1/dir2/a
72 dir1/dir2/a
73 dir1/dir2/b
73 dir1/dir2/b
74 e
74 e
75
75
76 Revision is not created for unchanged directory
76 Revision is not created for unchanged directory
77
77
78 $ mkdir dir2
78 $ mkdir dir2
79 $ echo 3 > dir2/a
79 $ echo 3 > dir2/a
80 $ hg add dir2
80 $ hg add dir2
81 adding dir2/a
81 adding dir2/a
82 $ hg debugindex --dir dir1 > before
82 $ hg debugindex --dir dir1 > before
83 $ hg ci -qm 'add dir2'
83 $ hg ci -qm 'add dir2'
84 $ hg debugindex --dir dir1 > after
84 $ hg debugindex --dir dir1 > after
85 $ diff before after
85 $ diff before after
86 $ rm before after
86 $ rm before after
87
87
88 Removing directory does not create an revlog entry
88 Removing directory does not create an revlog entry
89
89
90 $ hg rm dir1/dir1
90 $ hg rm dir1/dir1
91 removing dir1/dir1/a
91 removing dir1/dir1/a
92 removing dir1/dir1/b
92 removing dir1/dir1/b
93 $ hg debugindex --dir dir1/dir1 > before
93 $ hg debugindex --dir dir1/dir1 > before
94 $ hg ci -qm 'remove dir1/dir1'
94 $ hg ci -qm 'remove dir1/dir1'
95 $ hg debugindex --dir dir1/dir1 > after
95 $ hg debugindex --dir dir1/dir1 > after
96 $ diff before after
96 $ diff before after
97 $ rm before after
97 $ rm before after
98
98
99 Check that hg files (calls treemanifest.walk()) works
99 Check that hg files (calls treemanifest.walk()) works
100 without loading all directory revlogs
100 without loading all directory revlogs
101
101
102 $ hg co 'desc("add dir2")'
102 $ hg co 'desc("add dir2")'
103 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
103 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
104 $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup
104 $ mv .hg/store/meta/dir2 .hg/store/meta/dir2-backup
105 $ hg files -r . dir1
105 $ hg files -r . dir1
106 dir1/a
106 dir1/a
107 dir1/b
107 dir1/b
108 dir1/dir1/a
108 dir1/dir1/a
109 dir1/dir1/b
109 dir1/dir1/b
110 dir1/dir2/a
110 dir1/dir2/a
111 dir1/dir2/b
111 dir1/dir2/b
112
112
113 Check that status between revisions works (calls treemanifest.matches())
113 Check that status between revisions works (calls treemanifest.matches())
114 without loading all directory revlogs
114 without loading all directory revlogs
115
115
116 $ hg status --rev 'desc("add dir1")' --rev . dir1
116 $ hg status --rev 'desc("add dir1")' --rev . dir1
117 A dir1/dir1/a
117 A dir1/dir1/a
118 A dir1/dir1/b
118 A dir1/dir1/b
119 A dir1/dir2/a
119 A dir1/dir2/a
120 A dir1/dir2/b
120 A dir1/dir2/b
121 $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2
121 $ mv .hg/store/meta/dir2-backup .hg/store/meta/dir2
122
122
123 Merge creates 2-parent revision of directory revlog
123 Merge creates 2-parent revision of directory revlog
124
124
125 $ echo 5 > dir1/a
125 $ echo 5 > dir1/a
126 $ hg ci -Aqm 'modify dir1/a'
126 $ hg ci -Aqm 'modify dir1/a'
127 $ hg co '.^'
127 $ hg co '.^'
128 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
128 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
129 $ echo 6 > dir1/b
129 $ echo 6 > dir1/b
130 $ hg ci -Aqm 'modify dir1/b'
130 $ hg ci -Aqm 'modify dir1/b'
131 $ hg merge 'desc("modify dir1/a")'
131 $ hg merge 'desc("modify dir1/a")'
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
132 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
133 (branch merge, don't forget to commit)
133 (branch merge, don't forget to commit)
134 $ hg ci -m 'conflict-free merge involving dir1/'
134 $ hg ci -m 'conflict-free merge involving dir1/'
135 $ cat dir1/a
135 $ cat dir1/a
136 5
136 5
137 $ cat dir1/b
137 $ cat dir1/b
138 6
138 6
139 $ hg debugindex --dir dir1
139 $ hg debugindex --dir dir1
140 rev linkrev nodeid p1 p2
140 rev linkrev nodeid p1 p2
141 0 1 8b3ffd73f901 000000000000 000000000000
141 0 1 8b3ffd73f901 000000000000 000000000000
142 1 2 68e9d057c5a8 8b3ffd73f901 000000000000
142 1 2 68e9d057c5a8 8b3ffd73f901 000000000000
143 2 4 4698198d2624 68e9d057c5a8 000000000000
143 2 4 4698198d2624 68e9d057c5a8 000000000000
144 3 5 44844058ccce 68e9d057c5a8 000000000000
144 3 5 44844058ccce 68e9d057c5a8 000000000000
145 4 6 bf3d9b744927 68e9d057c5a8 000000000000
145 4 6 bf3d9b744927 68e9d057c5a8 000000000000
146 5 7 dde7c0af2a03 bf3d9b744927 44844058ccce
146 5 7 dde7c0af2a03 bf3d9b744927 44844058ccce
147
147
148 Merge keeping directory from parent 1 does not create revlog entry. (Note that
148 Merge keeping directory from parent 1 does not create revlog entry. (Note that
149 dir1's manifest does change, but only because dir1/a's filelog changes.)
149 dir1's manifest does change, but only because dir1/a's filelog changes.)
150
150
151 $ hg co 'desc("add dir2")'
151 $ hg co 'desc("add dir2")'
152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
153 $ echo 8 > dir2/a
153 $ echo 8 > dir2/a
154 $ hg ci -m 'modify dir2/a'
154 $ hg ci -m 'modify dir2/a'
155 created new head
155 created new head
156
156
157 $ hg debugindex --dir dir2 > before
157 $ hg debugindex --dir dir2 > before
158 $ hg merge 'desc("modify dir1/a")'
158 $ hg merge 'desc("modify dir1/a")'
159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
159 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
160 (branch merge, don't forget to commit)
160 (branch merge, don't forget to commit)
161 $ hg revert -r 'desc("modify dir2/a")' .
161 $ hg revert -r 'desc("modify dir2/a")' .
162 reverting dir1/a
162 reverting dir1/a
163 $ hg ci -m 'merge, keeping parent 1'
163 $ hg ci -m 'merge, keeping parent 1'
164 $ hg debugindex --dir dir2 > after
164 $ hg debugindex --dir dir2 > after
165 $ diff before after
165 $ diff before after
166 $ rm before after
166 $ rm before after
167
167
168 Merge keeping directory from parent 2 does not create revlog entry. (Note that
168 Merge keeping directory from parent 2 does not create revlog entry. (Note that
169 dir2's manifest does change, but only because dir2/a's filelog changes.)
169 dir2's manifest does change, but only because dir2/a's filelog changes.)
170
170
171 $ hg co 'desc("modify dir2/a")'
171 $ hg co 'desc("modify dir2/a")'
172 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
172 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 $ hg debugindex --dir dir1 > before
173 $ hg debugindex --dir dir1 > before
174 $ hg merge 'desc("modify dir1/a")'
174 $ hg merge 'desc("modify dir1/a")'
175 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
175 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
176 (branch merge, don't forget to commit)
176 (branch merge, don't forget to commit)
177 $ hg revert -r 'desc("modify dir1/a")' .
177 $ hg revert -r 'desc("modify dir1/a")' .
178 reverting dir2/a
178 reverting dir2/a
179 $ hg ci -m 'merge, keeping parent 2'
179 $ hg ci -m 'merge, keeping parent 2'
180 created new head
180 created new head
181 $ hg debugindex --dir dir1 > after
181 $ hg debugindex --dir dir1 > after
182 $ diff before after
182 $ diff before after
183 $ rm before after
183 $ rm before after
184
184
185 Create flat source repo for tests with mixed flat/tree manifests
185 Create flat source repo for tests with mixed flat/tree manifests
186
186
187 $ cd ..
187 $ cd ..
188 $ hg init repo-flat
188 $ hg init repo-flat
189 $ cd repo-flat
189 $ cd repo-flat
190
190
191 Create a few commits with flat manifest
191 Create a few commits with flat manifest
192
192
193 $ echo 0 > a
193 $ echo 0 > a
194 $ echo 0 > b
194 $ echo 0 > b
195 $ echo 0 > e
195 $ echo 0 > e
196 $ for d in dir1 dir1/dir1 dir1/dir2 dir2
196 $ for d in dir1 dir1/dir1 dir1/dir2 dir2
197 > do
197 > do
198 > mkdir $d
198 > mkdir $d
199 > echo 0 > $d/a
199 > echo 0 > $d/a
200 > echo 0 > $d/b
200 > echo 0 > $d/b
201 > done
201 > done
202 $ hg ci -Aqm initial
202 $ hg ci -Aqm initial
203
203
204 $ echo 1 > a
204 $ echo 1 > a
205 $ echo 1 > dir1/a
205 $ echo 1 > dir1/a
206 $ echo 1 > dir1/dir1/a
206 $ echo 1 > dir1/dir1/a
207 $ hg ci -Aqm 'modify on branch 1'
207 $ hg ci -Aqm 'modify on branch 1'
208
208
209 $ hg co 0
209 $ hg co 0
210 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
210 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
211 $ echo 2 > b
211 $ echo 2 > b
212 $ echo 2 > dir1/b
212 $ echo 2 > dir1/b
213 $ echo 2 > dir1/dir1/b
213 $ echo 2 > dir1/dir1/b
214 $ hg ci -Aqm 'modify on branch 2'
214 $ hg ci -Aqm 'modify on branch 2'
215
215
216 $ hg merge 1
216 $ hg merge 1
217 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
217 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
218 (branch merge, don't forget to commit)
218 (branch merge, don't forget to commit)
219 $ hg ci -m 'merge of flat manifests to new flat manifest'
219 $ hg ci -m 'merge of flat manifests to new flat manifest'
220
220
221 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
221 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
222 $ cat hg.pid >> $DAEMON_PIDS
222 $ cat hg.pid >> $DAEMON_PIDS
223
223
224 Create clone with tree manifests enabled
224 Create clone with tree manifests enabled
225
225
226 $ cd ..
226 $ cd ..
227 $ hg clone --config experimental.treemanifest=1 \
227 $ hg clone --config experimental.treemanifest=1 \
228 > http://localhost:$HGPORT repo-mixed -r 1
228 > http://localhost:$HGPORT repo-mixed -r 1
229 adding changesets
229 adding changesets
230 adding manifests
230 adding manifests
231 adding file changes
231 adding file changes
232 added 2 changesets with 14 changes to 11 files
232 added 2 changesets with 14 changes to 11 files
233 new changesets 5b02a3e8db7e:581ef6037d8b
233 new changesets 5b02a3e8db7e:581ef6037d8b
234 updating to branch default
234 updating to branch default
235 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
235 11 files updated, 0 files merged, 0 files removed, 0 files unresolved
236 $ cd repo-mixed
236 $ cd repo-mixed
237 $ test -d .hg/store/meta
237 $ test -d .hg/store/meta
238 [1]
238 [1]
239 $ grep treemanifest .hg/requires
239 $ grep treemanifest .hg/requires
240 treemanifest
240 treemanifest
241
241
242 Should be possible to push updates from flat to tree manifest repo
242 Should be possible to push updates from flat to tree manifest repo
243
243
244 $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed
244 $ hg -R ../repo-flat push ssh://user@dummy/repo-mixed
245 pushing to ssh://user@dummy/repo-mixed
245 pushing to ssh://user@dummy/repo-mixed
246 searching for changes
246 searching for changes
247 remote: adding changesets
247 remote: adding changesets
248 remote: adding manifests
248 remote: adding manifests
249 remote: adding file changes
249 remote: adding file changes
250 remote: added 2 changesets with 3 changes to 3 files
250 remote: added 2 changesets with 3 changes to 3 files
251
251
252 Commit should store revlog per directory
252 Commit should store revlog per directory
253
253
254 $ hg co 1
254 $ hg co 1
255 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
255 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 $ echo 3 > a
256 $ echo 3 > a
257 $ echo 3 > dir1/a
257 $ echo 3 > dir1/a
258 $ echo 3 > dir1/dir1/a
258 $ echo 3 > dir1/dir1/a
259 $ hg ci -m 'first tree'
259 $ hg ci -m 'first tree'
260 created new head
260 created new head
261 $ find .hg/store/meta | sort
261 $ find .hg/store/meta | sort
262 .hg/store/meta
262 .hg/store/meta
263 .hg/store/meta/dir1
263 .hg/store/meta/dir1
264 .hg/store/meta/dir1/00manifest.i
264 .hg/store/meta/dir1/00manifest.i
265 .hg/store/meta/dir1/dir1
265 .hg/store/meta/dir1/dir1
266 .hg/store/meta/dir1/dir1/00manifest.i
266 .hg/store/meta/dir1/dir1/00manifest.i
267 .hg/store/meta/dir1/dir2
267 .hg/store/meta/dir1/dir2
268 .hg/store/meta/dir1/dir2/00manifest.i
268 .hg/store/meta/dir1/dir2/00manifest.i
269 .hg/store/meta/dir2
269 .hg/store/meta/dir2
270 .hg/store/meta/dir2/00manifest.i
270 .hg/store/meta/dir2/00manifest.i
271
271
272 Merge of two trees
272 Merge of two trees
273
273
274 $ hg co 2
274 $ hg co 2
275 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 $ hg merge 1
276 $ hg merge 1
277 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
277 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
278 (branch merge, don't forget to commit)
278 (branch merge, don't forget to commit)
279 $ hg ci -m 'merge of flat manifests to new tree manifest'
279 $ hg ci -m 'merge of flat manifests to new tree manifest'
280 created new head
280 created new head
281 $ hg diff -r 3
281 $ hg diff -r 3
282
282
283 Parent of tree root manifest should be flat manifest, and two for merge
283 Parent of tree root manifest should be flat manifest, and two for merge
284
284
285 $ hg debugindex -m
285 $ hg debugindex -m
286 rev linkrev nodeid p1 p2
286 rev linkrev nodeid p1 p2
287 0 0 40536115ed9e 000000000000 000000000000
287 0 0 40536115ed9e 000000000000 000000000000
288 1 1 f3376063c255 40536115ed9e 000000000000
288 1 1 f3376063c255 40536115ed9e 000000000000
289 2 2 5d9b9da231a2 40536115ed9e 000000000000
289 2 2 5d9b9da231a2 40536115ed9e 000000000000
290 3 3 d17d663cbd8a 5d9b9da231a2 f3376063c255
290 3 3 d17d663cbd8a 5d9b9da231a2 f3376063c255
291 4 4 51e32a8c60ee f3376063c255 000000000000
291 4 4 51e32a8c60ee f3376063c255 000000000000
292 5 5 cc5baa78b230 5d9b9da231a2 f3376063c255
292 5 5 cc5baa78b230 5d9b9da231a2 f3376063c255
293
293
294
294
295 Status across flat/tree boundary should work
295 Status across flat/tree boundary should work
296
296
297 $ hg status --rev '.^' --rev .
297 $ hg status --rev '.^' --rev .
298 M a
298 M a
299 M dir1/a
299 M dir1/a
300 M dir1/dir1/a
300 M dir1/dir1/a
301
301
302
302
303 Turning off treemanifest config has no effect
303 Turning off treemanifest config has no effect
304
304
305 $ hg debugindex --dir dir1
305 $ hg debugindex --dir dir1
306 rev linkrev nodeid p1 p2
306 rev linkrev nodeid p1 p2
307 0 4 064927a0648a 000000000000 000000000000
307 0 4 064927a0648a 000000000000 000000000000
308 1 5 25ecb8cb8618 000000000000 000000000000
308 1 5 25ecb8cb8618 000000000000 000000000000
309 $ echo 2 > dir1/a
309 $ echo 2 > dir1/a
310 $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a'
310 $ hg --config experimental.treemanifest=False ci -qm 'modify dir1/a'
311 $ hg debugindex --dir dir1
311 $ hg debugindex --dir dir1
312 rev linkrev nodeid p1 p2
312 rev linkrev nodeid p1 p2
313 0 4 064927a0648a 000000000000 000000000000
313 0 4 064927a0648a 000000000000 000000000000
314 1 5 25ecb8cb8618 000000000000 000000000000
314 1 5 25ecb8cb8618 000000000000 000000000000
315 2 6 5b16163a30c6 25ecb8cb8618 000000000000
315 2 6 5b16163a30c6 25ecb8cb8618 000000000000
316
316
317 Stripping and recovering changes should work
317 Stripping and recovering changes should work
318
318
319 $ hg st --change tip
319 $ hg st --change tip
320 M dir1/a
320 M dir1/a
321 $ hg --config extensions.strip= strip tip
321 $ hg --config extensions.strip= strip tip
322 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
322 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
323 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg
323 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/51cfd7b1e13b-78a2f3ed-backup.hg
324 $ hg debugindex --dir dir1
324 $ hg debugindex --dir dir1
325 rev linkrev nodeid p1 p2
325 rev linkrev nodeid p1 p2
326 0 4 064927a0648a 000000000000 000000000000
326 0 4 064927a0648a 000000000000 000000000000
327 1 5 25ecb8cb8618 000000000000 000000000000
327 1 5 25ecb8cb8618 000000000000 000000000000
328
328
329 #if repobundlerepo
329 #if repobundlerepo
330 $ hg incoming .hg/strip-backup/*
330 $ hg incoming .hg/strip-backup/*
331 comparing with .hg/strip-backup/*-backup.hg (glob)
331 comparing with .hg/strip-backup/*-backup.hg (glob)
332 searching for changes
332 searching for changes
333 changeset: 6:51cfd7b1e13b
333 changeset: 6:51cfd7b1e13b
334 tag: tip
334 tag: tip
335 user: test
335 user: test
336 date: Thu Jan 01 00:00:00 1970 +0000
336 date: Thu Jan 01 00:00:00 1970 +0000
337 summary: modify dir1/a
337 summary: modify dir1/a
338
338
339 #endif
339 #endif
340
340
341 $ hg unbundle .hg/strip-backup/*
341 $ hg unbundle .hg/strip-backup/*
342 adding changesets
342 adding changesets
343 adding manifests
343 adding manifests
344 adding file changes
344 adding file changes
345 added 1 changesets with 1 changes to 1 files
345 added 1 changesets with 1 changes to 1 files
346 new changesets 51cfd7b1e13b
346 new changesets 51cfd7b1e13b
347 (run 'hg update' to get a working copy)
347 (run 'hg update' to get a working copy)
348 $ hg --config extensions.strip= strip tip
348 $ hg --config extensions.strip= strip tip
349 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/*-backup.hg (glob)
349 saved backup bundle to $TESTTMP/repo-mixed/.hg/strip-backup/*-backup.hg (glob)
350 $ hg unbundle -q .hg/strip-backup/*
350 $ hg unbundle -q .hg/strip-backup/*
351 $ hg debugindex --dir dir1
351 $ hg debugindex --dir dir1
352 rev linkrev nodeid p1 p2
352 rev linkrev nodeid p1 p2
353 0 4 064927a0648a 000000000000 000000000000
353 0 4 064927a0648a 000000000000 000000000000
354 1 5 25ecb8cb8618 000000000000 000000000000
354 1 5 25ecb8cb8618 000000000000 000000000000
355 2 6 5b16163a30c6 25ecb8cb8618 000000000000
355 2 6 5b16163a30c6 25ecb8cb8618 000000000000
356 $ hg st --change tip
356 $ hg st --change tip
357 M dir1/a
357 M dir1/a
358
358
359 Shelving and unshelving should work
359 Shelving and unshelving should work
360
360
361 $ echo foo >> dir1/a
361 $ echo foo >> dir1/a
362 $ hg --config extensions.shelve= shelve
362 $ hg --config extensions.shelve= shelve
363 shelved as default
363 shelved as default
364 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
364 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
365 $ hg --config extensions.shelve= unshelve
365 $ hg --config extensions.shelve= unshelve
366 unshelving change 'default'
366 unshelving change 'default'
367 $ hg diff --nodates
367 $ hg diff --nodates
368 diff -r 708a273da119 dir1/a
368 diff -r 708a273da119 dir1/a
369 --- a/dir1/a
369 --- a/dir1/a
370 +++ b/dir1/a
370 +++ b/dir1/a
371 @@ -1,1 +1,2 @@
371 @@ -1,1 +1,2 @@
372 1
372 1
373 +foo
373 +foo
374
374
375 Pushing from treemanifest repo to an empty repo makes that a treemanifest repo
375 Pushing from treemanifest repo to an empty repo makes that a treemanifest repo
376
376
377 $ cd ..
377 $ cd ..
378 $ hg init empty-repo
378 $ hg init empty-repo
379 $ cat << EOF >> empty-repo/.hg/hgrc
379 $ cat << EOF >> empty-repo/.hg/hgrc
380 > [experimental]
380 > [experimental]
381 > changegroup3=yes
381 > changegroup3=yes
382 > EOF
382 > EOF
383 $ grep treemanifest empty-repo/.hg/requires
383 $ grep treemanifest empty-repo/.hg/requires
384 [1]
384 [1]
385 $ hg push -R repo -r 0 empty-repo
385 $ hg push -R repo -r 0 empty-repo
386 pushing to empty-repo
386 pushing to empty-repo
387 searching for changes
387 searching for changes
388 adding changesets
388 adding changesets
389 adding manifests
389 adding manifests
390 adding file changes
390 adding file changes
391 added 1 changesets with 2 changes to 2 files
391 added 1 changesets with 2 changes to 2 files
392 $ grep treemanifest empty-repo/.hg/requires
392 $ grep treemanifest empty-repo/.hg/requires
393 treemanifest
393 treemanifest
394
394
395 Pushing to an empty repo works
395 Pushing to an empty repo works
396
396
397 $ hg --config experimental.treemanifest=1 init clone
397 $ hg --config experimental.treemanifest=1 init clone
398 $ grep treemanifest clone/.hg/requires
398 $ grep treemanifest clone/.hg/requires
399 treemanifest
399 treemanifest
400 $ hg push -R repo clone
400 $ hg push -R repo clone
401 pushing to clone
401 pushing to clone
402 searching for changes
402 searching for changes
403 adding changesets
403 adding changesets
404 adding manifests
404 adding manifests
405 adding file changes
405 adding file changes
406 added 11 changesets with 15 changes to 10 files (+3 heads)
406 added 11 changesets with 15 changes to 10 files (+3 heads)
407 $ grep treemanifest clone/.hg/requires
407 $ grep treemanifest clone/.hg/requires
408 treemanifest
408 treemanifest
409 $ hg -R clone verify
409 $ hg -R clone verify
410 checking changesets
410 checking changesets
411 checking manifests
411 checking manifests
412 checking directory manifests
412 checking directory manifests
413 crosschecking files in changesets and manifests
413 crosschecking files in changesets and manifests
414 checking files
414 checking files
415 10 files, 11 changesets, 15 total revisions
415 10 files, 11 changesets, 15 total revisions
416
416
417 Create deeper repo with tree manifests.
417 Create deeper repo with tree manifests.
418
418
419 $ hg --config experimental.treemanifest=True init deeprepo
419 $ hg --config experimental.treemanifest=True init deeprepo
420 $ cd deeprepo
420 $ cd deeprepo
421
421
422 $ mkdir .A
422 $ mkdir .A
423 $ mkdir b
423 $ mkdir b
424 $ mkdir b/bar
424 $ mkdir b/bar
425 $ mkdir b/bar/orange
425 $ mkdir b/bar/orange
426 $ mkdir b/bar/orange/fly
426 $ mkdir b/bar/orange/fly
427 $ mkdir b/foo
427 $ mkdir b/foo
428 $ mkdir b/foo/apple
428 $ mkdir b/foo/apple
429 $ mkdir b/foo/apple/bees
429 $ mkdir b/foo/apple/bees
430
430
431 $ touch .A/one.txt
431 $ touch .A/one.txt
432 $ touch .A/two.txt
432 $ touch .A/two.txt
433 $ touch b/bar/fruits.txt
433 $ touch b/bar/fruits.txt
434 $ touch b/bar/orange/fly/gnat.py
434 $ touch b/bar/orange/fly/gnat.py
435 $ touch b/bar/orange/fly/housefly.txt
435 $ touch b/bar/orange/fly/housefly.txt
436 $ touch b/foo/apple/bees/flower.py
436 $ touch b/foo/apple/bees/flower.py
437 $ touch c.txt
437 $ touch c.txt
438 $ touch d.py
438 $ touch d.py
439
439
440 $ hg ci -Aqm 'initial'
440 $ hg ci -Aqm 'initial'
441
441
442 $ echo >> .A/one.txt
442 $ echo >> .A/one.txt
443 $ echo >> .A/two.txt
443 $ echo >> .A/two.txt
444 $ echo >> b/bar/fruits.txt
444 $ echo >> b/bar/fruits.txt
445 $ echo >> b/bar/orange/fly/gnat.py
445 $ echo >> b/bar/orange/fly/gnat.py
446 $ echo >> b/bar/orange/fly/housefly.txt
446 $ echo >> b/bar/orange/fly/housefly.txt
447 $ echo >> b/foo/apple/bees/flower.py
447 $ echo >> b/foo/apple/bees/flower.py
448 $ echo >> c.txt
448 $ echo >> c.txt
449 $ echo >> d.py
449 $ echo >> d.py
450 $ hg ci -Aqm 'second'
450 $ hg ci -Aqm 'second'
451
451
452 We'll see that visitdir works by removing some treemanifest revlogs and running
452 We'll see that visitdir works by removing some treemanifest revlogs and running
453 the files command with various parameters.
453 the files command with various parameters.
454
454
455 Test files from the root.
455 Test files from the root.
456
456
457 $ hg files -r .
457 $ hg files -r .
458 .A/one.txt
458 .A/one.txt
459 .A/two.txt
459 .A/two.txt
460 b/bar/fruits.txt
460 b/bar/fruits.txt
461 b/bar/orange/fly/gnat.py
461 b/bar/orange/fly/gnat.py
462 b/bar/orange/fly/housefly.txt
462 b/bar/orange/fly/housefly.txt
463 b/foo/apple/bees/flower.py
463 b/foo/apple/bees/flower.py
464 c.txt
464 c.txt
465 d.py
465 d.py
466
466
467 Excludes with a glob should not exclude everything from the glob's root
467 Excludes with a glob should not exclude everything from the glob's root
468
468
469 $ hg files -r . -X 'b/fo?' b
469 $ hg files -r . -X 'b/fo?' b
470 b/bar/fruits.txt
470 b/bar/fruits.txt
471 b/bar/orange/fly/gnat.py
471 b/bar/orange/fly/gnat.py
472 b/bar/orange/fly/housefly.txt
472 b/bar/orange/fly/housefly.txt
473 $ cp -R .hg/store .hg/store-copy
473 $ cp -R .hg/store .hg/store-copy
474
474
475 Test files for a subdirectory.
475 Test files for a subdirectory.
476
476
477 $ rm -r .hg/store/meta/~2e_a
477 $ rm -r .hg/store/meta/~2e_a
478 $ hg files -r . b
478 $ hg files -r . b
479 b/bar/fruits.txt
479 b/bar/fruits.txt
480 b/bar/orange/fly/gnat.py
480 b/bar/orange/fly/gnat.py
481 b/bar/orange/fly/housefly.txt
481 b/bar/orange/fly/housefly.txt
482 b/foo/apple/bees/flower.py
482 b/foo/apple/bees/flower.py
483 $ hg diff -r '.^' -r . --stat b
483 $ hg diff -r '.^' -r . --stat b
484 b/bar/fruits.txt | 1 +
484 b/bar/fruits.txt | 1 +
485 b/bar/orange/fly/gnat.py | 1 +
485 b/bar/orange/fly/gnat.py | 1 +
486 b/bar/orange/fly/housefly.txt | 1 +
486 b/bar/orange/fly/housefly.txt | 1 +
487 b/foo/apple/bees/flower.py | 1 +
487 b/foo/apple/bees/flower.py | 1 +
488 4 files changed, 4 insertions(+), 0 deletions(-)
488 4 files changed, 4 insertions(+), 0 deletions(-)
489 $ cp -R .hg/store-copy/. .hg/store
489 $ cp -R .hg/store-copy/. .hg/store
490
490
491 Test files with just includes and excludes.
491 Test files with just includes and excludes.
492
492
493 $ rm -r .hg/store/meta/~2e_a
493 $ rm -r .hg/store/meta/~2e_a
494 $ rm -r .hg/store/meta/b/bar/orange/fly
494 $ rm -r .hg/store/meta/b/bar/orange/fly
495 $ rm -r .hg/store/meta/b/foo/apple/bees
495 $ rm -r .hg/store/meta/b/foo/apple/bees
496 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
496 $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
497 b/bar/fruits.txt
497 b/bar/fruits.txt
498 $ hg diff -r '.^' -r . --stat -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
498 $ hg diff -r '.^' -r . --stat -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees
499 b/bar/fruits.txt | 1 +
499 b/bar/fruits.txt | 1 +
500 1 files changed, 1 insertions(+), 0 deletions(-)
500 1 files changed, 1 insertions(+), 0 deletions(-)
501 $ cp -R .hg/store-copy/. .hg/store
501 $ cp -R .hg/store-copy/. .hg/store
502
502
503 Test files for a subdirectory, excluding a directory within it.
503 Test files for a subdirectory, excluding a directory within it.
504
504
505 $ rm -r .hg/store/meta/~2e_a
505 $ rm -r .hg/store/meta/~2e_a
506 $ rm -r .hg/store/meta/b/foo
506 $ rm -r .hg/store/meta/b/foo
507 $ hg files -r . -X path:b/foo b
507 $ hg files -r . -X path:b/foo b
508 b/bar/fruits.txt
508 b/bar/fruits.txt
509 b/bar/orange/fly/gnat.py
509 b/bar/orange/fly/gnat.py
510 b/bar/orange/fly/housefly.txt
510 b/bar/orange/fly/housefly.txt
511 $ hg diff -r '.^' -r . --stat -X path:b/foo b
511 $ hg diff -r '.^' -r . --stat -X path:b/foo b
512 b/bar/fruits.txt | 1 +
512 b/bar/fruits.txt | 1 +
513 b/bar/orange/fly/gnat.py | 1 +
513 b/bar/orange/fly/gnat.py | 1 +
514 b/bar/orange/fly/housefly.txt | 1 +
514 b/bar/orange/fly/housefly.txt | 1 +
515 3 files changed, 3 insertions(+), 0 deletions(-)
515 3 files changed, 3 insertions(+), 0 deletions(-)
516 $ cp -R .hg/store-copy/. .hg/store
516 $ cp -R .hg/store-copy/. .hg/store
517
517
518 Test files for a sub directory, including only a directory within it, and
518 Test files for a sub directory, including only a directory within it, and
519 including an unrelated directory.
519 including an unrelated directory.
520
520
521 $ rm -r .hg/store/meta/~2e_a
521 $ rm -r .hg/store/meta/~2e_a
522 $ rm -r .hg/store/meta/b/foo
522 $ rm -r .hg/store/meta/b/foo
523 $ hg files -r . -I path:b/bar/orange -I path:a b
523 $ hg files -r . -I path:b/bar/orange -I path:a b
524 b/bar/orange/fly/gnat.py
524 b/bar/orange/fly/gnat.py
525 b/bar/orange/fly/housefly.txt
525 b/bar/orange/fly/housefly.txt
526 $ hg diff -r '.^' -r . --stat -I path:b/bar/orange -I path:a b
526 $ hg diff -r '.^' -r . --stat -I path:b/bar/orange -I path:a b
527 b/bar/orange/fly/gnat.py | 1 +
527 b/bar/orange/fly/gnat.py | 1 +
528 b/bar/orange/fly/housefly.txt | 1 +
528 b/bar/orange/fly/housefly.txt | 1 +
529 2 files changed, 2 insertions(+), 0 deletions(-)
529 2 files changed, 2 insertions(+), 0 deletions(-)
530 $ cp -R .hg/store-copy/. .hg/store
530 $ cp -R .hg/store-copy/. .hg/store
531
531
532 Test files for a pattern, including a directory, and excluding a directory
532 Test files for a pattern, including a directory, and excluding a directory
533 within that.
533 within that.
534
534
535 $ rm -r .hg/store/meta/~2e_a
535 $ rm -r .hg/store/meta/~2e_a
536 $ rm -r .hg/store/meta/b/foo
536 $ rm -r .hg/store/meta/b/foo
537 $ rm -r .hg/store/meta/b/bar/orange
537 $ rm -r .hg/store/meta/b/bar/orange
538 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
538 $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange
539 b/bar/fruits.txt
539 b/bar/fruits.txt
540 $ hg diff -r '.^' -r . --stat glob:**.txt -I path:b/bar -X path:b/bar/orange
540 $ hg diff -r '.^' -r . --stat glob:**.txt -I path:b/bar -X path:b/bar/orange
541 b/bar/fruits.txt | 1 +
541 b/bar/fruits.txt | 1 +
542 1 files changed, 1 insertions(+), 0 deletions(-)
542 1 files changed, 1 insertions(+), 0 deletions(-)
543 $ cp -R .hg/store-copy/. .hg/store
543 $ cp -R .hg/store-copy/. .hg/store
544
544
545 Add some more changes to the deep repo
545 Add some more changes to the deep repo
546 $ echo narf >> b/bar/fruits.txt
546 $ echo narf >> b/bar/fruits.txt
547 $ hg ci -m narf
547 $ hg ci -m narf
548 $ echo troz >> b/bar/orange/fly/gnat.py
548 $ echo troz >> b/bar/orange/fly/gnat.py
549 $ hg ci -m troz
549 $ hg ci -m troz
550
550
551 Verify works
551 Verify works
552 $ hg verify
552 $ hg verify
553 checking changesets
553 checking changesets
554 checking manifests
554 checking manifests
555 checking directory manifests
555 checking directory manifests
556 crosschecking files in changesets and manifests
556 crosschecking files in changesets and manifests
557 checking files
557 checking files
558 8 files, 4 changesets, 18 total revisions
558 8 files, 4 changesets, 18 total revisions
559
559
560 #if repofncache
560 Dirlogs are included in fncache
561 Dirlogs are included in fncache
561 $ grep meta/.A/00manifest.i .hg/store/fncache
562 $ grep meta/.A/00manifest.i .hg/store/fncache
562 meta/.A/00manifest.i
563 meta/.A/00manifest.i
563
564
564 Rebuilt fncache includes dirlogs
565 Rebuilt fncache includes dirlogs
565 $ rm .hg/store/fncache
566 $ rm .hg/store/fncache
566 $ hg debugrebuildfncache
567 $ hg debugrebuildfncache
567 adding data/.A/one.txt.i
568 adding data/.A/one.txt.i
568 adding data/.A/two.txt.i
569 adding data/.A/two.txt.i
569 adding data/b/bar/fruits.txt.i
570 adding data/b/bar/fruits.txt.i
570 adding data/b/bar/orange/fly/gnat.py.i
571 adding data/b/bar/orange/fly/gnat.py.i
571 adding data/b/bar/orange/fly/housefly.txt.i
572 adding data/b/bar/orange/fly/housefly.txt.i
572 adding data/b/foo/apple/bees/flower.py.i
573 adding data/b/foo/apple/bees/flower.py.i
573 adding data/c.txt.i
574 adding data/c.txt.i
574 adding data/d.py.i
575 adding data/d.py.i
575 adding meta/.A/00manifest.i
576 adding meta/.A/00manifest.i
576 adding meta/b/00manifest.i
577 adding meta/b/00manifest.i
577 adding meta/b/bar/00manifest.i
578 adding meta/b/bar/00manifest.i
578 adding meta/b/bar/orange/00manifest.i
579 adding meta/b/bar/orange/00manifest.i
579 adding meta/b/bar/orange/fly/00manifest.i
580 adding meta/b/bar/orange/fly/00manifest.i
580 adding meta/b/foo/00manifest.i
581 adding meta/b/foo/00manifest.i
581 adding meta/b/foo/apple/00manifest.i
582 adding meta/b/foo/apple/00manifest.i
582 adding meta/b/foo/apple/bees/00manifest.i
583 adding meta/b/foo/apple/bees/00manifest.i
583 16 items added, 0 removed from fncache
584 16 items added, 0 removed from fncache
585 #endif
584
586
585 Finish first server
587 Finish first server
586 $ killdaemons.py
588 $ killdaemons.py
587
589
588 Back up the recently added revlogs
590 Back up the recently added revlogs
589 $ cp -R .hg/store .hg/store-newcopy
591 $ cp -R .hg/store .hg/store-newcopy
590
592
591 Verify reports missing dirlog
593 Verify reports missing dirlog
592 $ rm .hg/store/meta/b/00manifest.*
594 $ rm .hg/store/meta/b/00manifest.*
593 $ hg verify
595 $ hg verify
594 checking changesets
596 checking changesets
595 checking manifests
597 checking manifests
596 checking directory manifests
598 checking directory manifests
597 0: empty or missing b/
599 0: empty or missing b/
598 b/@0: parent-directory manifest refers to unknown revision 67688a370455
600 b/@0: parent-directory manifest refers to unknown revision 67688a370455
599 b/@1: parent-directory manifest refers to unknown revision f065da70369e
601 b/@1: parent-directory manifest refers to unknown revision f065da70369e
600 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
602 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
601 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
603 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
602 warning: orphan data file 'meta/b/bar/00manifest.i'
604 warning: orphan data file 'meta/b/bar/00manifest.i'
603 warning: orphan data file 'meta/b/bar/orange/00manifest.i'
605 warning: orphan data file 'meta/b/bar/orange/00manifest.i'
604 warning: orphan data file 'meta/b/bar/orange/fly/00manifest.i'
606 warning: orphan data file 'meta/b/bar/orange/fly/00manifest.i'
605 warning: orphan data file 'meta/b/foo/00manifest.i'
607 warning: orphan data file 'meta/b/foo/00manifest.i'
606 warning: orphan data file 'meta/b/foo/apple/00manifest.i'
608 warning: orphan data file 'meta/b/foo/apple/00manifest.i'
607 warning: orphan data file 'meta/b/foo/apple/bees/00manifest.i'
609 warning: orphan data file 'meta/b/foo/apple/bees/00manifest.i'
608 crosschecking files in changesets and manifests
610 crosschecking files in changesets and manifests
609 b/bar/fruits.txt@0: in changeset but not in manifest
611 b/bar/fruits.txt@0: in changeset but not in manifest
610 b/bar/orange/fly/gnat.py@0: in changeset but not in manifest
612 b/bar/orange/fly/gnat.py@0: in changeset but not in manifest
611 b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest
613 b/bar/orange/fly/housefly.txt@0: in changeset but not in manifest
612 b/foo/apple/bees/flower.py@0: in changeset but not in manifest
614 b/foo/apple/bees/flower.py@0: in changeset but not in manifest
613 checking files
615 checking files
614 8 files, 4 changesets, 18 total revisions
616 8 files, 4 changesets, 18 total revisions
615 6 warnings encountered!
617 6 warnings encountered!
616 9 integrity errors encountered!
618 9 integrity errors encountered!
617 (first damaged changeset appears to be 0)
619 (first damaged changeset appears to be 0)
618 [1]
620 [1]
619 $ cp -R .hg/store-newcopy/. .hg/store
621 $ cp -R .hg/store-newcopy/. .hg/store
620
622
621 Verify reports missing dirlog entry
623 Verify reports missing dirlog entry
622 $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
624 $ mv -f .hg/store-copy/meta/b/00manifest.* .hg/store/meta/b/
623 $ hg verify
625 $ hg verify
624 checking changesets
626 checking changesets
625 checking manifests
627 checking manifests
626 checking directory manifests
628 checking directory manifests
627 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
629 b/@2: parent-directory manifest refers to unknown revision ac0d30948e0b
628 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
630 b/@3: parent-directory manifest refers to unknown revision 367152e6af28
629 b/bar/@?: rev 2 points to unexpected changeset 2
631 b/bar/@?: rev 2 points to unexpected changeset 2
630 b/bar/@?: 44d7e1146e0d not in parent-directory manifest
632 b/bar/@?: 44d7e1146e0d not in parent-directory manifest
631 b/bar/@?: rev 3 points to unexpected changeset 3
633 b/bar/@?: rev 3 points to unexpected changeset 3
632 b/bar/@?: 70b10c6b17b7 not in parent-directory manifest
634 b/bar/@?: 70b10c6b17b7 not in parent-directory manifest
633 b/bar/orange/@?: rev 2 points to unexpected changeset 3
635 b/bar/orange/@?: rev 2 points to unexpected changeset 3
634 (expected None)
636 (expected None)
635 b/bar/orange/fly/@?: rev 2 points to unexpected changeset 3
637 b/bar/orange/fly/@?: rev 2 points to unexpected changeset 3
636 (expected None)
638 (expected None)
637 crosschecking files in changesets and manifests
639 crosschecking files in changesets and manifests
638 checking files
640 checking files
639 8 files, 4 changesets, 18 total revisions
641 8 files, 4 changesets, 18 total revisions
640 2 warnings encountered!
642 2 warnings encountered!
641 8 integrity errors encountered!
643 8 integrity errors encountered!
642 (first damaged changeset appears to be 2)
644 (first damaged changeset appears to be 2)
643 [1]
645 [1]
644 $ cp -R .hg/store-newcopy/. .hg/store
646 $ cp -R .hg/store-newcopy/. .hg/store
645
647
646 Test cloning a treemanifest repo over http.
648 Test cloning a treemanifest repo over http.
647 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
649 $ hg serve -p $HGPORT -d --pid-file=hg.pid --errorlog=errors.log
648 $ cat hg.pid >> $DAEMON_PIDS
650 $ cat hg.pid >> $DAEMON_PIDS
649 $ cd ..
651 $ cd ..
650 We can clone even with the knob turned off and we'll get a treemanifest repo.
652 We can clone even with the knob turned off and we'll get a treemanifest repo.
651 $ hg clone --config experimental.treemanifest=False \
653 $ hg clone --config experimental.treemanifest=False \
652 > --config experimental.changegroup3=True \
654 > --config experimental.changegroup3=True \
653 > http://localhost:$HGPORT deepclone
655 > http://localhost:$HGPORT deepclone
654 requesting all changes
656 requesting all changes
655 adding changesets
657 adding changesets
656 adding manifests
658 adding manifests
657 adding file changes
659 adding file changes
658 added 4 changesets with 18 changes to 8 files
660 added 4 changesets with 18 changes to 8 files
659 new changesets 775704be6f52:523e5c631710
661 new changesets 775704be6f52:523e5c631710
660 updating to branch default
662 updating to branch default
661 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
663 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
662 No server errors.
664 No server errors.
663 $ cat deeprepo/errors.log
665 $ cat deeprepo/errors.log
664 requires got updated to include treemanifest
666 requires got updated to include treemanifest
665 $ cat deepclone/.hg/requires | grep treemanifest
667 $ cat deepclone/.hg/requires | grep treemanifest
666 treemanifest
668 treemanifest
667 Tree manifest revlogs exist.
669 Tree manifest revlogs exist.
668 $ find deepclone/.hg/store/meta | sort
670 $ find deepclone/.hg/store/meta | sort
669 deepclone/.hg/store/meta
671 deepclone/.hg/store/meta
670 deepclone/.hg/store/meta/b
672 deepclone/.hg/store/meta/b
671 deepclone/.hg/store/meta/b/00manifest.i
673 deepclone/.hg/store/meta/b/00manifest.i
672 deepclone/.hg/store/meta/b/bar
674 deepclone/.hg/store/meta/b/bar
673 deepclone/.hg/store/meta/b/bar/00manifest.i
675 deepclone/.hg/store/meta/b/bar/00manifest.i
674 deepclone/.hg/store/meta/b/bar/orange
676 deepclone/.hg/store/meta/b/bar/orange
675 deepclone/.hg/store/meta/b/bar/orange/00manifest.i
677 deepclone/.hg/store/meta/b/bar/orange/00manifest.i
676 deepclone/.hg/store/meta/b/bar/orange/fly
678 deepclone/.hg/store/meta/b/bar/orange/fly
677 deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i
679 deepclone/.hg/store/meta/b/bar/orange/fly/00manifest.i
678 deepclone/.hg/store/meta/b/foo
680 deepclone/.hg/store/meta/b/foo
679 deepclone/.hg/store/meta/b/foo/00manifest.i
681 deepclone/.hg/store/meta/b/foo/00manifest.i
680 deepclone/.hg/store/meta/b/foo/apple
682 deepclone/.hg/store/meta/b/foo/apple
681 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
683 deepclone/.hg/store/meta/b/foo/apple/00manifest.i
682 deepclone/.hg/store/meta/b/foo/apple/bees
684 deepclone/.hg/store/meta/b/foo/apple/bees
683 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
685 deepclone/.hg/store/meta/b/foo/apple/bees/00manifest.i
684 deepclone/.hg/store/meta/~2e_a
686 deepclone/.hg/store/meta/~2e_a
685 deepclone/.hg/store/meta/~2e_a/00manifest.i
687 deepclone/.hg/store/meta/~2e_a/00manifest.i
686 Verify passes.
688 Verify passes.
687 $ cd deepclone
689 $ cd deepclone
688 $ hg verify
690 $ hg verify
689 checking changesets
691 checking changesets
690 checking manifests
692 checking manifests
691 checking directory manifests
693 checking directory manifests
692 crosschecking files in changesets and manifests
694 crosschecking files in changesets and manifests
693 checking files
695 checking files
694 8 files, 4 changesets, 18 total revisions
696 8 files, 4 changesets, 18 total revisions
695 $ cd ..
697 $ cd ..
696
698
697 Create clones using old repo formats to use in later tests
699 Create clones using old repo formats to use in later tests
698 $ hg clone --config format.usestore=False \
700 $ hg clone --config format.usestore=False \
699 > --config experimental.changegroup3=True \
701 > --config experimental.changegroup3=True \
700 > http://localhost:$HGPORT deeprepo-basicstore
702 > http://localhost:$HGPORT deeprepo-basicstore
701 requesting all changes
703 requesting all changes
702 adding changesets
704 adding changesets
703 adding manifests
705 adding manifests
704 adding file changes
706 adding file changes
705 added 4 changesets with 18 changes to 8 files
707 added 4 changesets with 18 changes to 8 files
706 new changesets 775704be6f52:523e5c631710
708 new changesets 775704be6f52:523e5c631710
707 updating to branch default
709 updating to branch default
708 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
710 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
709 $ cd deeprepo-basicstore
711 $ cd deeprepo-basicstore
710 $ grep store .hg/requires
712 $ grep store .hg/requires
711 [1]
713 [1]
712 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log
714 $ hg serve -p $HGPORT1 -d --pid-file=hg.pid --errorlog=errors.log
713 $ cat hg.pid >> $DAEMON_PIDS
715 $ cat hg.pid >> $DAEMON_PIDS
714 $ cd ..
716 $ cd ..
715 $ hg clone --config format.usefncache=False \
717 $ hg clone --config format.usefncache=False \
716 > --config experimental.changegroup3=True \
718 > --config experimental.changegroup3=True \
717 > http://localhost:$HGPORT deeprepo-encodedstore
719 > http://localhost:$HGPORT deeprepo-encodedstore
718 requesting all changes
720 requesting all changes
719 adding changesets
721 adding changesets
720 adding manifests
722 adding manifests
721 adding file changes
723 adding file changes
722 added 4 changesets with 18 changes to 8 files
724 added 4 changesets with 18 changes to 8 files
723 new changesets 775704be6f52:523e5c631710
725 new changesets 775704be6f52:523e5c631710
724 updating to branch default
726 updating to branch default
725 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
727 8 files updated, 0 files merged, 0 files removed, 0 files unresolved
726 $ cd deeprepo-encodedstore
728 $ cd deeprepo-encodedstore
727 $ grep fncache .hg/requires
729 $ grep fncache .hg/requires
728 [1]
730 [1]
729 $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log
731 $ hg serve -p $HGPORT2 -d --pid-file=hg.pid --errorlog=errors.log
730 $ cat hg.pid >> $DAEMON_PIDS
732 $ cat hg.pid >> $DAEMON_PIDS
731 $ cd ..
733 $ cd ..
732
734
733 Local clone with basicstore
735 Local clone with basicstore
734 $ hg clone -U deeprepo-basicstore local-clone-basicstore
736 $ hg clone -U deeprepo-basicstore local-clone-basicstore
735 $ hg -R local-clone-basicstore verify
737 $ hg -R local-clone-basicstore verify
736 checking changesets
738 checking changesets
737 checking manifests
739 checking manifests
738 checking directory manifests
740 checking directory manifests
739 crosschecking files in changesets and manifests
741 crosschecking files in changesets and manifests
740 checking files
742 checking files
741 8 files, 4 changesets, 18 total revisions
743 8 files, 4 changesets, 18 total revisions
742
744
743 Local clone with encodedstore
745 Local clone with encodedstore
744 $ hg clone -U deeprepo-encodedstore local-clone-encodedstore
746 $ hg clone -U deeprepo-encodedstore local-clone-encodedstore
745 $ hg -R local-clone-encodedstore verify
747 $ hg -R local-clone-encodedstore verify
746 checking changesets
748 checking changesets
747 checking manifests
749 checking manifests
748 checking directory manifests
750 checking directory manifests
749 crosschecking files in changesets and manifests
751 crosschecking files in changesets and manifests
750 checking files
752 checking files
751 8 files, 4 changesets, 18 total revisions
753 8 files, 4 changesets, 18 total revisions
752
754
753 Local clone with fncachestore
755 Local clone with fncachestore
754 $ hg clone -U deeprepo local-clone-fncachestore
756 $ hg clone -U deeprepo local-clone-fncachestore
755 $ hg -R local-clone-fncachestore verify
757 $ hg -R local-clone-fncachestore verify
756 checking changesets
758 checking changesets
757 checking manifests
759 checking manifests
758 checking directory manifests
760 checking directory manifests
759 crosschecking files in changesets and manifests
761 crosschecking files in changesets and manifests
760 checking files
762 checking files
761 8 files, 4 changesets, 18 total revisions
763 8 files, 4 changesets, 18 total revisions
762
764
763 Stream clone with basicstore
765 Stream clone with basicstore
764 $ hg clone --config experimental.changegroup3=True --stream -U \
766 $ hg clone --config experimental.changegroup3=True --stream -U \
765 > http://localhost:$HGPORT1 stream-clone-basicstore
767 > http://localhost:$HGPORT1 stream-clone-basicstore
766 streaming all changes
768 streaming all changes
767 18 files to transfer, * of data (glob)
769 18 files to transfer, * of data (glob)
768 transferred * in * seconds (*) (glob)
770 transferred * in * seconds (*) (glob)
769 searching for changes
771 searching for changes
770 no changes found
772 no changes found
771 $ hg -R stream-clone-basicstore verify
773 $ hg -R stream-clone-basicstore verify
772 checking changesets
774 checking changesets
773 checking manifests
775 checking manifests
774 checking directory manifests
776 checking directory manifests
775 crosschecking files in changesets and manifests
777 crosschecking files in changesets and manifests
776 checking files
778 checking files
777 8 files, 4 changesets, 18 total revisions
779 8 files, 4 changesets, 18 total revisions
778
780
779 Stream clone with encodedstore
781 Stream clone with encodedstore
780 $ hg clone --config experimental.changegroup3=True --stream -U \
782 $ hg clone --config experimental.changegroup3=True --stream -U \
781 > http://localhost:$HGPORT2 stream-clone-encodedstore
783 > http://localhost:$HGPORT2 stream-clone-encodedstore
782 streaming all changes
784 streaming all changes
783 18 files to transfer, * of data (glob)
785 18 files to transfer, * of data (glob)
784 transferred * in * seconds (*) (glob)
786 transferred * in * seconds (*) (glob)
785 searching for changes
787 searching for changes
786 no changes found
788 no changes found
787 $ hg -R stream-clone-encodedstore verify
789 $ hg -R stream-clone-encodedstore verify
788 checking changesets
790 checking changesets
789 checking manifests
791 checking manifests
790 checking directory manifests
792 checking directory manifests
791 crosschecking files in changesets and manifests
793 crosschecking files in changesets and manifests
792 checking files
794 checking files
793 8 files, 4 changesets, 18 total revisions
795 8 files, 4 changesets, 18 total revisions
794
796
795 Stream clone with fncachestore
797 Stream clone with fncachestore
796 $ hg clone --config experimental.changegroup3=True --stream -U \
798 $ hg clone --config experimental.changegroup3=True --stream -U \
797 > http://localhost:$HGPORT stream-clone-fncachestore
799 > http://localhost:$HGPORT stream-clone-fncachestore
798 streaming all changes
800 streaming all changes
799 18 files to transfer, * of data (glob)
801 18 files to transfer, * of data (glob)
800 transferred * in * seconds (*) (glob)
802 transferred * in * seconds (*) (glob)
801 searching for changes
803 searching for changes
802 no changes found
804 no changes found
803 $ hg -R stream-clone-fncachestore verify
805 $ hg -R stream-clone-fncachestore verify
804 checking changesets
806 checking changesets
805 checking manifests
807 checking manifests
806 checking directory manifests
808 checking directory manifests
807 crosschecking files in changesets and manifests
809 crosschecking files in changesets and manifests
808 checking files
810 checking files
809 8 files, 4 changesets, 18 total revisions
811 8 files, 4 changesets, 18 total revisions
810
812
811 Packed bundle
813 Packed bundle
812 $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg
814 $ hg -R deeprepo debugcreatestreamclonebundle repo-packed.hg
813 writing 5330 bytes for 18 files
815 writing 5330 bytes for 18 files
814 bundle requirements: generaldelta, revlogv1, treemanifest
816 bundle requirements: generaldelta, revlogv1, treemanifest
815 $ hg debugbundle --spec repo-packed.hg
817 $ hg debugbundle --spec repo-packed.hg
816 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Ctreemanifest
818 none-packed1;requirements%3Dgeneraldelta%2Crevlogv1%2Ctreemanifest
817
819
818 Bundle with changegroup2 is not supported
820 Bundle with changegroup2 is not supported
819
821
820 $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle
822 $ hg -R deeprepo bundle --all -t v2 deeprepo.bundle
821 abort: repository does not support bundle version 02
823 abort: repository does not support bundle version 02
822 [255]
824 [255]
823
825
824 Pull does not include changegroup for manifest the client already has from
826 Pull does not include changegroup for manifest the client already has from
825 other branch
827 other branch
826
828
827 $ mkdir grafted-dir-repo
829 $ mkdir grafted-dir-repo
828 $ cd grafted-dir-repo
830 $ cd grafted-dir-repo
829 $ hg --config experimental.treemanifest=1 init
831 $ hg --config experimental.treemanifest=1 init
830 $ mkdir dir
832 $ mkdir dir
831 $ echo a > dir/file
833 $ echo a > dir/file
832 $ echo a > file
834 $ echo a > file
833 $ hg ci -Am initial
835 $ hg ci -Am initial
834 adding dir/file
836 adding dir/file
835 adding file
837 adding file
836 $ echo b > dir/file
838 $ echo b > dir/file
837 $ hg ci -m updated
839 $ hg ci -m updated
838 $ hg co '.^'
840 $ hg co '.^'
839 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
841 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
840 $ hg revert -r tip dir/
842 $ hg revert -r tip dir/
841 reverting dir/file
843 reverting dir/file
842 $ echo b > file # to make sure root manifest is sent
844 $ echo b > file # to make sure root manifest is sent
843 $ hg ci -m grafted
845 $ hg ci -m grafted
844 created new head
846 created new head
845 $ cd ..
847 $ cd ..
846
848
847 $ hg --config experimental.treemanifest=1 clone --pull -r 1 \
849 $ hg --config experimental.treemanifest=1 clone --pull -r 1 \
848 > grafted-dir-repo grafted-dir-repo-clone
850 > grafted-dir-repo grafted-dir-repo-clone
849 adding changesets
851 adding changesets
850 adding manifests
852 adding manifests
851 adding file changes
853 adding file changes
852 added 2 changesets with 3 changes to 2 files
854 added 2 changesets with 3 changes to 2 files
853 new changesets d84f4c419457:09ab742f3b0f
855 new changesets d84f4c419457:09ab742f3b0f
854 updating to branch default
856 updating to branch default
855 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
857 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
856 $ cd grafted-dir-repo-clone
858 $ cd grafted-dir-repo-clone
857 $ hg pull -r 2
859 $ hg pull -r 2
858 pulling from $TESTTMP/grafted-dir-repo
860 pulling from $TESTTMP/grafted-dir-repo
859 searching for changes
861 searching for changes
860 adding changesets
862 adding changesets
861 adding manifests
863 adding manifests
862 adding file changes
864 adding file changes
863 added 1 changesets with 1 changes to 1 files (+1 heads)
865 added 1 changesets with 1 changes to 1 files (+1 heads)
864 new changesets 73699489fb7c
866 new changesets 73699489fb7c
865 (run 'hg heads' to see heads, 'hg merge' to merge)
867 (run 'hg heads' to see heads, 'hg merge' to merge)
866
868
867 Committing a empty commit does not duplicate root treemanifest
869 Committing a empty commit does not duplicate root treemanifest
868 $ echo z >> z
870 $ echo z >> z
869 $ hg commit -Aqm 'pre-empty commit'
871 $ hg commit -Aqm 'pre-empty commit'
870 $ hg rm z
872 $ hg rm z
871 $ hg commit --amend -m 'empty commit'
873 $ hg commit --amend -m 'empty commit'
872 saved backup bundle to $TESTTMP/grafted-dir-repo-clone/.hg/strip-backup/cb99d5717cea-9e3b6b02-amend.hg
874 saved backup bundle to $TESTTMP/grafted-dir-repo-clone/.hg/strip-backup/cb99d5717cea-9e3b6b02-amend.hg
873 $ hg log -r 'tip + tip^' -T '{manifest}\n'
875 $ hg log -r 'tip + tip^' -T '{manifest}\n'
874 1:678d3574b88c
876 1:678d3574b88c
875 1:678d3574b88c
877 1:678d3574b88c
876 $ hg --config extensions.strip= strip -r . -q
878 $ hg --config extensions.strip= strip -r . -q
General Comments 0
You need to be logged in to leave comments. Login now