##// END OF EJS Templates
check-code: fix check for trailing whitespace on empty lines...
Mads Kiilerich -
r17346:2944a6d3 default
parent child Browse files
Show More
@@ -1,450 +1,450 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 #
2 #
3 # check-code - a style and portability checker for Mercurial
3 # check-code - a style and portability checker for Mercurial
4 #
4 #
5 # Copyright 2010 Matt Mackall <mpm@selenic.com>
5 # Copyright 2010 Matt Mackall <mpm@selenic.com>
6 #
6 #
7 # This software may be used and distributed according to the terms of the
7 # This software may be used and distributed according to the terms of the
8 # GNU General Public License version 2 or any later version.
8 # GNU General Public License version 2 or any later version.
9
9
10 import re, glob, os, sys
10 import re, glob, os, sys
11 import keyword
11 import keyword
12 import optparse
12 import optparse
13
13
14 def repquote(m):
14 def repquote(m):
15 t = re.sub(r"\w", "x", m.group('text'))
15 t = re.sub(r"\w", "x", m.group('text'))
16 t = re.sub(r"[^\s\nx]", "o", t)
16 t = re.sub(r"[^\s\nx]", "o", t)
17 return m.group('quote') + t + m.group('quote')
17 return m.group('quote') + t + m.group('quote')
18
18
19 def reppython(m):
19 def reppython(m):
20 comment = m.group('comment')
20 comment = m.group('comment')
21 if comment:
21 if comment:
22 return "#" * len(comment)
22 return "#" * len(comment)
23 return repquote(m)
23 return repquote(m)
24
24
25 def repcomment(m):
25 def repcomment(m):
26 return m.group(1) + "#" * len(m.group(2))
26 return m.group(1) + "#" * len(m.group(2))
27
27
28 def repccomment(m):
28 def repccomment(m):
29 t = re.sub(r"((?<=\n) )|\S", "x", m.group(2))
29 t = re.sub(r"((?<=\n) )|\S", "x", m.group(2))
30 return m.group(1) + t + "*/"
30 return m.group(1) + t + "*/"
31
31
32 def repcallspaces(m):
32 def repcallspaces(m):
33 t = re.sub(r"\n\s+", "\n", m.group(2))
33 t = re.sub(r"\n\s+", "\n", m.group(2))
34 return m.group(1) + t
34 return m.group(1) + t
35
35
36 def repinclude(m):
36 def repinclude(m):
37 return m.group(1) + "<foo>"
37 return m.group(1) + "<foo>"
38
38
39 def rephere(m):
39 def rephere(m):
40 t = re.sub(r"\S", "x", m.group(2))
40 t = re.sub(r"\S", "x", m.group(2))
41 return m.group(1) + t
41 return m.group(1) + t
42
42
43
43
44 testpats = [
44 testpats = [
45 [
45 [
46 (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"),
46 (r'pushd|popd', "don't use 'pushd' or 'popd', use 'cd'"),
47 (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"),
47 (r'\W\$?\(\([^\)\n]*\)\)', "don't use (()) or $(()), use 'expr'"),
48 (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"),
48 (r'grep.*-q', "don't use 'grep -q', redirect to /dev/null"),
49 (r'sed.*-i', "don't use 'sed -i', use a temporary file"),
49 (r'sed.*-i', "don't use 'sed -i', use a temporary file"),
50 (r'\becho\b.*\\n', "don't use 'echo \\n', use printf"),
50 (r'\becho\b.*\\n', "don't use 'echo \\n', use printf"),
51 (r'echo -n', "don't use 'echo -n', use printf"),
51 (r'echo -n', "don't use 'echo -n', use printf"),
52 (r'(^| )wc[^|]*$\n(?!.*\(re\))', "filter wc output"),
52 (r'(^| )wc[^|]*$\n(?!.*\(re\))', "filter wc output"),
53 (r'head -c', "don't use 'head -c', use 'dd'"),
53 (r'head -c', "don't use 'head -c', use 'dd'"),
54 (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"),
54 (r'sha1sum', "don't use sha1sum, use $TESTDIR/md5sum.py"),
55 (r'ls.*-\w*R', "don't use 'ls -R', use 'find'"),
55 (r'ls.*-\w*R', "don't use 'ls -R', use 'find'"),
56 (r'printf.*\\([1-9]|0\d)', "don't use 'printf \NNN', use Python"),
56 (r'printf.*\\([1-9]|0\d)', "don't use 'printf \NNN', use Python"),
57 (r'printf.*\\x', "don't use printf \\x, use Python"),
57 (r'printf.*\\x', "don't use printf \\x, use Python"),
58 (r'\$\(.*\)', "don't use $(expr), use `expr`"),
58 (r'\$\(.*\)', "don't use $(expr), use `expr`"),
59 (r'rm -rf \*', "don't use naked rm -rf, target a directory"),
59 (r'rm -rf \*', "don't use naked rm -rf, target a directory"),
60 (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w',
60 (r'(^|\|\s*)grep (-\w\s+)*[^|]*[(|]\w',
61 "use egrep for extended grep syntax"),
61 "use egrep for extended grep syntax"),
62 (r'/bin/', "don't use explicit paths for tools"),
62 (r'/bin/', "don't use explicit paths for tools"),
63 (r'[^\n]\Z', "no trailing newline"),
63 (r'[^\n]\Z', "no trailing newline"),
64 (r'export.*=', "don't export and assign at once"),
64 (r'export.*=', "don't export and assign at once"),
65 (r'^source\b', "don't use 'source', use '.'"),
65 (r'^source\b', "don't use 'source', use '.'"),
66 (r'touch -d', "don't use 'touch -d', use 'touch -t' instead"),
66 (r'touch -d', "don't use 'touch -d', use 'touch -t' instead"),
67 (r'ls +[^|\n-]+ +-', "options to 'ls' must come before filenames"),
67 (r'ls +[^|\n-]+ +-', "options to 'ls' must come before filenames"),
68 (r'[^>\n]>\s*\$HGRCPATH', "don't overwrite $HGRCPATH, append to it"),
68 (r'[^>\n]>\s*\$HGRCPATH', "don't overwrite $HGRCPATH, append to it"),
69 (r'^stop\(\)', "don't use 'stop' as a shell function name"),
69 (r'^stop\(\)', "don't use 'stop' as a shell function name"),
70 (r'(\[|\btest\b).*-e ', "don't use 'test -e', use 'test -f'"),
70 (r'(\[|\btest\b).*-e ', "don't use 'test -e', use 'test -f'"),
71 (r'^alias\b.*=', "don't use alias, use a function"),
71 (r'^alias\b.*=', "don't use alias, use a function"),
72 (r'if\s*!', "don't use '!' to negate exit status"),
72 (r'if\s*!', "don't use '!' to negate exit status"),
73 (r'/dev/u?random', "don't use entropy, use /dev/zero"),
73 (r'/dev/u?random', "don't use entropy, use /dev/zero"),
74 (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"),
74 (r'do\s*true;\s*done', "don't use true as loop body, use sleep 0"),
75 (r'^( *)\t', "don't use tabs to indent"),
75 (r'^( *)\t', "don't use tabs to indent"),
76 ],
76 ],
77 # warnings
77 # warnings
78 [
78 [
79 (r'^function', "don't use 'function', use old style"),
79 (r'^function', "don't use 'function', use old style"),
80 (r'^diff.*-\w*N', "don't use 'diff -N'"),
80 (r'^diff.*-\w*N', "don't use 'diff -N'"),
81 (r'\$PWD', "don't use $PWD, use `pwd`"),
81 (r'\$PWD', "don't use $PWD, use `pwd`"),
82 (r'^([^"\'\n]|("[^"\n]*")|(\'[^\'\n]*\'))*\^', "^ must be quoted"),
82 (r'^([^"\'\n]|("[^"\n]*")|(\'[^\'\n]*\'))*\^', "^ must be quoted"),
83 ]
83 ]
84 ]
84 ]
85
85
86 testfilters = [
86 testfilters = [
87 (r"( *)(#([^\n]*\S)?)", repcomment),
87 (r"( *)(#([^\n]*\S)?)", repcomment),
88 (r"<<(\S+)((.|\n)*?\n\1)", rephere),
88 (r"<<(\S+)((.|\n)*?\n\1)", rephere),
89 ]
89 ]
90
90
91 uprefix = r"^ \$ "
91 uprefix = r"^ \$ "
92 utestpats = [
92 utestpats = [
93 [
93 [
94 (r'^(\S| \$ ).*(\S[ \t]+|^[ \t]+)\n', "trailing whitespace on non-output"),
94 (r'^(\S.*|| \$ .*)[ \t]\n', "trailing whitespace on non-output"),
95 (uprefix + r'.*\|\s*sed[^|>\n]*\n',
95 (uprefix + r'.*\|\s*sed[^|>\n]*\n',
96 "use regex test output patterns instead of sed"),
96 "use regex test output patterns instead of sed"),
97 (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"),
97 (uprefix + r'(true|exit 0)', "explicit zero exit unnecessary"),
98 (uprefix + r'.*(?<!\[)\$\?', "explicit exit code checks unnecessary"),
98 (uprefix + r'.*(?<!\[)\$\?', "explicit exit code checks unnecessary"),
99 (uprefix + r'.*\|\| echo.*(fail|error)',
99 (uprefix + r'.*\|\| echo.*(fail|error)',
100 "explicit exit code checks unnecessary"),
100 "explicit exit code checks unnecessary"),
101 (uprefix + r'set -e', "don't use set -e"),
101 (uprefix + r'set -e', "don't use set -e"),
102 (uprefix + r'\s', "don't indent commands, use > for continued lines"),
102 (uprefix + r'\s', "don't indent commands, use > for continued lines"),
103 (r'^ saved backup bundle to \$TESTTMP.*\.hg$',
103 (r'^ saved backup bundle to \$TESTTMP.*\.hg$',
104 "use (glob) to match Windows paths too"),
104 "use (glob) to match Windows paths too"),
105 ],
105 ],
106 # warnings
106 # warnings
107 []
107 []
108 ]
108 ]
109
109
110 for i in [0, 1]:
110 for i in [0, 1]:
111 for p, m in testpats[i]:
111 for p, m in testpats[i]:
112 if p.startswith(r'^'):
112 if p.startswith(r'^'):
113 p = r"^ [$>] (%s)" % p[1:]
113 p = r"^ [$>] (%s)" % p[1:]
114 else:
114 else:
115 p = r"^ [$>] .*(%s)" % p
115 p = r"^ [$>] .*(%s)" % p
116 utestpats[i].append((p, m))
116 utestpats[i].append((p, m))
117
117
118 utestfilters = [
118 utestfilters = [
119 (r"( *)(#([^\n]*\S)?)", repcomment),
119 (r"( *)(#([^\n]*\S)?)", repcomment),
120 ]
120 ]
121
121
122 pypats = [
122 pypats = [
123 [
123 [
124 (r'^\s*def\s*\w+\s*\(.*,\s*\(',
124 (r'^\s*def\s*\w+\s*\(.*,\s*\(',
125 "tuple parameter unpacking not available in Python 3+"),
125 "tuple parameter unpacking not available in Python 3+"),
126 (r'lambda\s*\(.*,.*\)',
126 (r'lambda\s*\(.*,.*\)',
127 "tuple parameter unpacking not available in Python 3+"),
127 "tuple parameter unpacking not available in Python 3+"),
128 (r'(?<!def)\s+(cmp)\(', "cmp is not available in Python 3+"),
128 (r'(?<!def)\s+(cmp)\(', "cmp is not available in Python 3+"),
129 (r'\breduce\s*\(.*', "reduce is not available in Python 3+"),
129 (r'\breduce\s*\(.*', "reduce is not available in Python 3+"),
130 (r'\.has_key\b', "dict.has_key is not available in Python 3+"),
130 (r'\.has_key\b', "dict.has_key is not available in Python 3+"),
131 (r'^\s*\t', "don't use tabs"),
131 (r'^\s*\t', "don't use tabs"),
132 (r'\S;\s*\n', "semicolon"),
132 (r'\S;\s*\n', "semicolon"),
133 (r'[^_]_\("[^"]+"\s*%', "don't use % inside _()"),
133 (r'[^_]_\("[^"]+"\s*%', "don't use % inside _()"),
134 (r"[^_]_\('[^']+'\s*%", "don't use % inside _()"),
134 (r"[^_]_\('[^']+'\s*%", "don't use % inside _()"),
135 (r'\w,\w', "missing whitespace after ,"),
135 (r'\w,\w', "missing whitespace after ,"),
136 (r'\w[+/*\-<>]\w', "missing whitespace in expression"),
136 (r'\w[+/*\-<>]\w', "missing whitespace in expression"),
137 (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"),
137 (r'^\s+\w+=\w+[^,)\n]$', "missing whitespace in assignment"),
138 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n'
138 (r'(\s+)try:\n((?:\n|\1\s.*\n)+?)\1except.*?:\n'
139 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Py2.4'),
139 r'((?:\n|\1\s.*\n)+?)\1finally:', 'no try/except/finally in Py2.4'),
140 (r'.{81}', "line too long"),
140 (r'.{81}', "line too long"),
141 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
141 (r' x+[xo][\'"]\n\s+[\'"]x', 'string join across lines with no space'),
142 (r'[^\n]\Z', "no trailing newline"),
142 (r'[^\n]\Z', "no trailing newline"),
143 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
143 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
144 # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=',
144 # (r'^\s+[^_ \n][^_. \n]+_[^_\n]+\s*=',
145 # "don't use underbars in identifiers"),
145 # "don't use underbars in identifiers"),
146 (r'^\s+(self\.)?[A-za-z][a-z0-9]+[A-Z]\w* = ',
146 (r'^\s+(self\.)?[A-za-z][a-z0-9]+[A-Z]\w* = ',
147 "don't use camelcase in identifiers"),
147 "don't use camelcase in identifiers"),
148 (r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+',
148 (r'^\s*(if|while|def|class|except|try)\s[^[\n]*:\s*[^\\n]#\s]+',
149 "linebreak after :"),
149 "linebreak after :"),
150 (r'class\s[^( \n]+:', "old-style class, use class foo(object)"),
150 (r'class\s[^( \n]+:', "old-style class, use class foo(object)"),
151 (r'class\s[^( \n]+\(\):',
151 (r'class\s[^( \n]+\(\):',
152 "class foo() not available in Python 2.4, use class foo(object)"),
152 "class foo() not available in Python 2.4, use class foo(object)"),
153 (r'\b(%s)\(' % '|'.join(keyword.kwlist),
153 (r'\b(%s)\(' % '|'.join(keyword.kwlist),
154 "Python keyword is not a function"),
154 "Python keyword is not a function"),
155 (r',]', "unneeded trailing ',' in list"),
155 (r',]', "unneeded trailing ',' in list"),
156 # (r'class\s[A-Z][^\(]*\((?!Exception)',
156 # (r'class\s[A-Z][^\(]*\((?!Exception)',
157 # "don't capitalize non-exception classes"),
157 # "don't capitalize non-exception classes"),
158 # (r'in range\(', "use xrange"),
158 # (r'in range\(', "use xrange"),
159 # (r'^\s*print\s+', "avoid using print in core and extensions"),
159 # (r'^\s*print\s+', "avoid using print in core and extensions"),
160 (r'[\x80-\xff]', "non-ASCII character literal"),
160 (r'[\x80-\xff]', "non-ASCII character literal"),
161 (r'("\')\.format\(', "str.format() not available in Python 2.4"),
161 (r'("\')\.format\(', "str.format() not available in Python 2.4"),
162 (r'^\s*with\s+', "with not available in Python 2.4"),
162 (r'^\s*with\s+', "with not available in Python 2.4"),
163 (r'\.isdisjoint\(', "set.isdisjoint not available in Python 2.4"),
163 (r'\.isdisjoint\(', "set.isdisjoint not available in Python 2.4"),
164 (r'^\s*except.* as .*:', "except as not available in Python 2.4"),
164 (r'^\s*except.* as .*:', "except as not available in Python 2.4"),
165 (r'^\s*os\.path\.relpath', "relpath not available in Python 2.4"),
165 (r'^\s*os\.path\.relpath', "relpath not available in Python 2.4"),
166 (r'(?<!def)\s+(any|all|format)\(',
166 (r'(?<!def)\s+(any|all|format)\(',
167 "any/all/format not available in Python 2.4"),
167 "any/all/format not available in Python 2.4"),
168 (r'(?<!def)\s+(callable)\(',
168 (r'(?<!def)\s+(callable)\(',
169 "callable not available in Python 3, use getattr(f, '__call__', None)"),
169 "callable not available in Python 3, use getattr(f, '__call__', None)"),
170 (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
170 (r'if\s.*\selse', "if ... else form not available in Python 2.4"),
171 (r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist),
171 (r'^\s*(%s)\s\s' % '|'.join(keyword.kwlist),
172 "gratuitous whitespace after Python keyword"),
172 "gratuitous whitespace after Python keyword"),
173 (r'([\(\[][ \t]\S)|(\S[ \t][\)\]])', "gratuitous whitespace in () or []"),
173 (r'([\(\[][ \t]\S)|(\S[ \t][\)\]])', "gratuitous whitespace in () or []"),
174 # (r'\s\s=', "gratuitous whitespace before ="),
174 # (r'\s\s=', "gratuitous whitespace before ="),
175 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\S',
175 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\S',
176 "missing whitespace around operator"),
176 "missing whitespace around operator"),
177 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\s',
177 (r'[^>< ](\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\s',
178 "missing whitespace around operator"),
178 "missing whitespace around operator"),
179 (r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\S',
179 (r'\s(\+=|-=|!=|<>|<=|>=|<<=|>>=|%=)\S',
180 "missing whitespace around operator"),
180 "missing whitespace around operator"),
181 (r'[^^+=*/!<>&| %-](\s=|=\s)[^= ]',
181 (r'[^^+=*/!<>&| %-](\s=|=\s)[^= ]',
182 "wrong whitespace around ="),
182 "wrong whitespace around ="),
183 (r'raise Exception', "don't raise generic exceptions"),
183 (r'raise Exception', "don't raise generic exceptions"),
184 (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"),
184 (r' is\s+(not\s+)?["\'0-9-]', "object comparison with literal"),
185 (r' [=!]=\s+(True|False|None)',
185 (r' [=!]=\s+(True|False|None)',
186 "comparison with singleton, use 'is' or 'is not' instead"),
186 "comparison with singleton, use 'is' or 'is not' instead"),
187 (r'^\s*(while|if) [01]:',
187 (r'^\s*(while|if) [01]:',
188 "use True/False for constant Boolean expression"),
188 "use True/False for constant Boolean expression"),
189 (r'(?:(?<!def)\s+|\()hasattr',
189 (r'(?:(?<!def)\s+|\()hasattr',
190 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
190 'hasattr(foo, bar) is broken, use util.safehasattr(foo, bar) instead'),
191 (r'opener\([^)]*\).read\(',
191 (r'opener\([^)]*\).read\(',
192 "use opener.read() instead"),
192 "use opener.read() instead"),
193 (r'BaseException', 'not in Py2.4, use Exception'),
193 (r'BaseException', 'not in Py2.4, use Exception'),
194 (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'),
194 (r'os\.path\.relpath', 'os.path.relpath is not in Py2.5'),
195 (r'opener\([^)]*\).write\(',
195 (r'opener\([^)]*\).write\(',
196 "use opener.write() instead"),
196 "use opener.write() instead"),
197 (r'[\s\(](open|file)\([^)]*\)\.read\(',
197 (r'[\s\(](open|file)\([^)]*\)\.read\(',
198 "use util.readfile() instead"),
198 "use util.readfile() instead"),
199 (r'[\s\(](open|file)\([^)]*\)\.write\(',
199 (r'[\s\(](open|file)\([^)]*\)\.write\(',
200 "use util.readfile() instead"),
200 "use util.readfile() instead"),
201 (r'^[\s\(]*(open(er)?|file)\([^)]*\)',
201 (r'^[\s\(]*(open(er)?|file)\([^)]*\)',
202 "always assign an opened file to a variable, and close it afterwards"),
202 "always assign an opened file to a variable, and close it afterwards"),
203 (r'[\s\(](open|file)\([^)]*\)\.',
203 (r'[\s\(](open|file)\([^)]*\)\.',
204 "always assign an opened file to a variable, and close it afterwards"),
204 "always assign an opened file to a variable, and close it afterwards"),
205 (r'(?i)descendent', "the proper spelling is descendAnt"),
205 (r'(?i)descendent', "the proper spelling is descendAnt"),
206 (r'\.debug\(\_', "don't mark debug messages for translation"),
206 (r'\.debug\(\_', "don't mark debug messages for translation"),
207 (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"),
207 (r'\.strip\(\)\.split\(\)', "no need to strip before splitting"),
208 (r'^\s*except\s*:', "warning: naked except clause", r'#.*re-raises'),
208 (r'^\s*except\s*:', "warning: naked except clause", r'#.*re-raises'),
209 (r':\n( )*( ){1,3}[^ ]', "must indent 4 spaces"),
209 (r':\n( )*( ){1,3}[^ ]', "must indent 4 spaces"),
210 ],
210 ],
211 # warnings
211 # warnings
212 [
212 [
213 (r'ui\.(status|progress|write|note|warn)\([\'\"]x',
213 (r'ui\.(status|progress|write|note|warn)\([\'\"]x',
214 "warning: unwrapped ui message"),
214 "warning: unwrapped ui message"),
215 ]
215 ]
216 ]
216 ]
217
217
218 pyfilters = [
218 pyfilters = [
219 (r"""(?msx)(?P<comment>\#.*?$)|
219 (r"""(?msx)(?P<comment>\#.*?$)|
220 ((?P<quote>('''|\"\"\"|(?<!')'(?!')|(?<!")"(?!")))
220 ((?P<quote>('''|\"\"\"|(?<!')'(?!')|(?<!")"(?!")))
221 (?P<text>(([^\\]|\\.)*?))
221 (?P<text>(([^\\]|\\.)*?))
222 (?P=quote))""", reppython),
222 (?P=quote))""", reppython),
223 ]
223 ]
224
224
225 cpats = [
225 cpats = [
226 [
226 [
227 (r'//', "don't use //-style comments"),
227 (r'//', "don't use //-style comments"),
228 (r'^ ', "don't use spaces to indent"),
228 (r'^ ', "don't use spaces to indent"),
229 (r'\S\t', "don't use tabs except for indent"),
229 (r'\S\t', "don't use tabs except for indent"),
230 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
230 (r'(\S[ \t]+|^[ \t]+)\n', "trailing whitespace"),
231 (r'.{81}', "line too long"),
231 (r'.{81}', "line too long"),
232 (r'(while|if|do|for)\(', "use space after while/if/do/for"),
232 (r'(while|if|do|for)\(', "use space after while/if/do/for"),
233 (r'return\(', "return is not a function"),
233 (r'return\(', "return is not a function"),
234 (r' ;', "no space before ;"),
234 (r' ;', "no space before ;"),
235 (r'\w+\* \w+', "use int *foo, not int* foo"),
235 (r'\w+\* \w+', "use int *foo, not int* foo"),
236 (r'\([^\)]+\) \w+', "use (int)foo, not (int) foo"),
236 (r'\([^\)]+\) \w+', "use (int)foo, not (int) foo"),
237 (r'\w+ (\+\+|--)', "use foo++, not foo ++"),
237 (r'\w+ (\+\+|--)', "use foo++, not foo ++"),
238 (r'\w,\w', "missing whitespace after ,"),
238 (r'\w,\w', "missing whitespace after ,"),
239 (r'^[^#]\w[+/*]\w', "missing whitespace in expression"),
239 (r'^[^#]\w[+/*]\w', "missing whitespace in expression"),
240 (r'^#\s+\w', "use #foo, not # foo"),
240 (r'^#\s+\w', "use #foo, not # foo"),
241 (r'[^\n]\Z', "no trailing newline"),
241 (r'[^\n]\Z', "no trailing newline"),
242 (r'^\s*#import\b', "use only #include in standard C code"),
242 (r'^\s*#import\b', "use only #include in standard C code"),
243 ],
243 ],
244 # warnings
244 # warnings
245 []
245 []
246 ]
246 ]
247
247
248 cfilters = [
248 cfilters = [
249 (r'(/\*)(((\*(?!/))|[^*])*)\*/', repccomment),
249 (r'(/\*)(((\*(?!/))|[^*])*)\*/', repccomment),
250 (r'''(?P<quote>(?<!")")(?P<text>([^"]|\\")+)"(?!")''', repquote),
250 (r'''(?P<quote>(?<!")")(?P<text>([^"]|\\")+)"(?!")''', repquote),
251 (r'''(#\s*include\s+<)([^>]+)>''', repinclude),
251 (r'''(#\s*include\s+<)([^>]+)>''', repinclude),
252 (r'(\()([^)]+\))', repcallspaces),
252 (r'(\()([^)]+\))', repcallspaces),
253 ]
253 ]
254
254
255 inutilpats = [
255 inutilpats = [
256 [
256 [
257 (r'\bui\.', "don't use ui in util"),
257 (r'\bui\.', "don't use ui in util"),
258 ],
258 ],
259 # warnings
259 # warnings
260 []
260 []
261 ]
261 ]
262
262
263 inrevlogpats = [
263 inrevlogpats = [
264 [
264 [
265 (r'\brepo\.', "don't use repo in revlog"),
265 (r'\brepo\.', "don't use repo in revlog"),
266 ],
266 ],
267 # warnings
267 # warnings
268 []
268 []
269 ]
269 ]
270
270
271 checks = [
271 checks = [
272 ('python', r'.*\.(py|cgi)$', pyfilters, pypats),
272 ('python', r'.*\.(py|cgi)$', pyfilters, pypats),
273 ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats),
273 ('test script', r'(.*/)?test-[^.~]*$', testfilters, testpats),
274 ('c', r'.*\.c$', cfilters, cpats),
274 ('c', r'.*\.c$', cfilters, cpats),
275 ('unified test', r'.*\.t$', utestfilters, utestpats),
275 ('unified test', r'.*\.t$', utestfilters, utestpats),
276 ('layering violation repo in revlog', r'mercurial/revlog\.py', pyfilters,
276 ('layering violation repo in revlog', r'mercurial/revlog\.py', pyfilters,
277 inrevlogpats),
277 inrevlogpats),
278 ('layering violation ui in util', r'mercurial/util\.py', pyfilters,
278 ('layering violation ui in util', r'mercurial/util\.py', pyfilters,
279 inutilpats),
279 inutilpats),
280 ]
280 ]
281
281
282 class norepeatlogger(object):
282 class norepeatlogger(object):
283 def __init__(self):
283 def __init__(self):
284 self._lastseen = None
284 self._lastseen = None
285
285
286 def log(self, fname, lineno, line, msg, blame):
286 def log(self, fname, lineno, line, msg, blame):
287 """print error related a to given line of a given file.
287 """print error related a to given line of a given file.
288
288
289 The faulty line will also be printed but only once in the case
289 The faulty line will also be printed but only once in the case
290 of multiple errors.
290 of multiple errors.
291
291
292 :fname: filename
292 :fname: filename
293 :lineno: line number
293 :lineno: line number
294 :line: actual content of the line
294 :line: actual content of the line
295 :msg: error message
295 :msg: error message
296 """
296 """
297 msgid = fname, lineno, line
297 msgid = fname, lineno, line
298 if msgid != self._lastseen:
298 if msgid != self._lastseen:
299 if blame:
299 if blame:
300 print "%s:%d (%s):" % (fname, lineno, blame)
300 print "%s:%d (%s):" % (fname, lineno, blame)
301 else:
301 else:
302 print "%s:%d:" % (fname, lineno)
302 print "%s:%d:" % (fname, lineno)
303 print " > %s" % line
303 print " > %s" % line
304 self._lastseen = msgid
304 self._lastseen = msgid
305 print " " + msg
305 print " " + msg
306
306
307 _defaultlogger = norepeatlogger()
307 _defaultlogger = norepeatlogger()
308
308
309 def getblame(f):
309 def getblame(f):
310 lines = []
310 lines = []
311 for l in os.popen('hg annotate -un %s' % f):
311 for l in os.popen('hg annotate -un %s' % f):
312 start, line = l.split(':', 1)
312 start, line = l.split(':', 1)
313 user, rev = start.split()
313 user, rev = start.split()
314 lines.append((line[1:-1], user, rev))
314 lines.append((line[1:-1], user, rev))
315 return lines
315 return lines
316
316
317 def checkfile(f, logfunc=_defaultlogger.log, maxerr=None, warnings=False,
317 def checkfile(f, logfunc=_defaultlogger.log, maxerr=None, warnings=False,
318 blame=False, debug=False, lineno=True):
318 blame=False, debug=False, lineno=True):
319 """checks style and portability of a given file
319 """checks style and portability of a given file
320
320
321 :f: filepath
321 :f: filepath
322 :logfunc: function used to report error
322 :logfunc: function used to report error
323 logfunc(filename, linenumber, linecontent, errormessage)
323 logfunc(filename, linenumber, linecontent, errormessage)
324 :maxerr: number of error to display before arborting.
324 :maxerr: number of error to display before arborting.
325 Set to false (default) to report all errors
325 Set to false (default) to report all errors
326
326
327 return True if no error is found, False otherwise.
327 return True if no error is found, False otherwise.
328 """
328 """
329 blamecache = None
329 blamecache = None
330 result = True
330 result = True
331 for name, match, filters, pats in checks:
331 for name, match, filters, pats in checks:
332 if debug:
332 if debug:
333 print name, f
333 print name, f
334 fc = 0
334 fc = 0
335 if not re.match(match, f):
335 if not re.match(match, f):
336 if debug:
336 if debug:
337 print "Skipping %s for %s it doesn't match %s" % (
337 print "Skipping %s for %s it doesn't match %s" % (
338 name, match, f)
338 name, match, f)
339 continue
339 continue
340 fp = open(f)
340 fp = open(f)
341 pre = post = fp.read()
341 pre = post = fp.read()
342 fp.close()
342 fp.close()
343 if "no-" + "check-code" in pre:
343 if "no-" + "check-code" in pre:
344 if debug:
344 if debug:
345 print "Skipping %s for %s it has no- and check-code" % (
345 print "Skipping %s for %s it has no- and check-code" % (
346 name, f)
346 name, f)
347 break
347 break
348 for p, r in filters:
348 for p, r in filters:
349 post = re.sub(p, r, post)
349 post = re.sub(p, r, post)
350 if warnings:
350 if warnings:
351 pats = pats[0] + pats[1]
351 pats = pats[0] + pats[1]
352 else:
352 else:
353 pats = pats[0]
353 pats = pats[0]
354 # print post # uncomment to show filtered version
354 # print post # uncomment to show filtered version
355
355
356 if debug:
356 if debug:
357 print "Checking %s for %s" % (name, f)
357 print "Checking %s for %s" % (name, f)
358
358
359 prelines = None
359 prelines = None
360 errors = []
360 errors = []
361 for pat in pats:
361 for pat in pats:
362 if len(pat) == 3:
362 if len(pat) == 3:
363 p, msg, ignore = pat
363 p, msg, ignore = pat
364 else:
364 else:
365 p, msg = pat
365 p, msg = pat
366 ignore = None
366 ignore = None
367
367
368 # fix-up regexes for multiline searches
368 # fix-up regexes for multiline searches
369 po = p
369 po = p
370 # \s doesn't match \n
370 # \s doesn't match \n
371 p = re.sub(r'(?<!\\)\\s', r'[ \\t]', p)
371 p = re.sub(r'(?<!\\)\\s', r'[ \\t]', p)
372 # [^...] doesn't match newline
372 # [^...] doesn't match newline
373 p = re.sub(r'(?<!\\)\[\^', r'[^\\n', p)
373 p = re.sub(r'(?<!\\)\[\^', r'[^\\n', p)
374
374
375 #print po, '=>', p
375 #print po, '=>', p
376
376
377 pos = 0
377 pos = 0
378 n = 0
378 n = 0
379 for m in re.finditer(p, post, re.MULTILINE):
379 for m in re.finditer(p, post, re.MULTILINE):
380 if prelines is None:
380 if prelines is None:
381 prelines = pre.splitlines()
381 prelines = pre.splitlines()
382 postlines = post.splitlines(True)
382 postlines = post.splitlines(True)
383
383
384 start = m.start()
384 start = m.start()
385 while n < len(postlines):
385 while n < len(postlines):
386 step = len(postlines[n])
386 step = len(postlines[n])
387 if pos + step > start:
387 if pos + step > start:
388 break
388 break
389 pos += step
389 pos += step
390 n += 1
390 n += 1
391 l = prelines[n]
391 l = prelines[n]
392
392
393 if "check-code" + "-ignore" in l:
393 if "check-code" + "-ignore" in l:
394 if debug:
394 if debug:
395 print "Skipping %s for %s:%s (check-code -ignore)" % (
395 print "Skipping %s for %s:%s (check-code -ignore)" % (
396 name, f, n)
396 name, f, n)
397 continue
397 continue
398 elif ignore and re.search(ignore, l, re.MULTILINE):
398 elif ignore and re.search(ignore, l, re.MULTILINE):
399 continue
399 continue
400 bd = ""
400 bd = ""
401 if blame:
401 if blame:
402 bd = 'working directory'
402 bd = 'working directory'
403 if not blamecache:
403 if not blamecache:
404 blamecache = getblame(f)
404 blamecache = getblame(f)
405 if n < len(blamecache):
405 if n < len(blamecache):
406 bl, bu, br = blamecache[n]
406 bl, bu, br = blamecache[n]
407 if bl == l:
407 if bl == l:
408 bd = '%s@%s' % (bu, br)
408 bd = '%s@%s' % (bu, br)
409 errors.append((f, lineno and n + 1, l, msg, bd))
409 errors.append((f, lineno and n + 1, l, msg, bd))
410 result = False
410 result = False
411
411
412 errors.sort()
412 errors.sort()
413 for e in errors:
413 for e in errors:
414 logfunc(*e)
414 logfunc(*e)
415 fc += 1
415 fc += 1
416 if maxerr and fc >= maxerr:
416 if maxerr and fc >= maxerr:
417 print " (too many errors, giving up)"
417 print " (too many errors, giving up)"
418 break
418 break
419
419
420 return result
420 return result
421
421
422 if __name__ == "__main__":
422 if __name__ == "__main__":
423 parser = optparse.OptionParser("%prog [options] [files]")
423 parser = optparse.OptionParser("%prog [options] [files]")
424 parser.add_option("-w", "--warnings", action="store_true",
424 parser.add_option("-w", "--warnings", action="store_true",
425 help="include warning-level checks")
425 help="include warning-level checks")
426 parser.add_option("-p", "--per-file", type="int",
426 parser.add_option("-p", "--per-file", type="int",
427 help="max warnings per file")
427 help="max warnings per file")
428 parser.add_option("-b", "--blame", action="store_true",
428 parser.add_option("-b", "--blame", action="store_true",
429 help="use annotate to generate blame info")
429 help="use annotate to generate blame info")
430 parser.add_option("", "--debug", action="store_true",
430 parser.add_option("", "--debug", action="store_true",
431 help="show debug information")
431 help="show debug information")
432 parser.add_option("", "--nolineno", action="store_false",
432 parser.add_option("", "--nolineno", action="store_false",
433 dest='lineno', help="don't show line numbers")
433 dest='lineno', help="don't show line numbers")
434
434
435 parser.set_defaults(per_file=15, warnings=False, blame=False, debug=False,
435 parser.set_defaults(per_file=15, warnings=False, blame=False, debug=False,
436 lineno=True)
436 lineno=True)
437 (options, args) = parser.parse_args()
437 (options, args) = parser.parse_args()
438
438
439 if len(args) == 0:
439 if len(args) == 0:
440 check = glob.glob("*")
440 check = glob.glob("*")
441 else:
441 else:
442 check = args
442 check = args
443
443
444 ret = 0
444 ret = 0
445 for f in check:
445 for f in check:
446 if not checkfile(f, maxerr=options.per_file, warnings=options.warnings,
446 if not checkfile(f, maxerr=options.per_file, warnings=options.warnings,
447 blame=options.blame, debug=options.debug,
447 blame=options.blame, debug=options.debug,
448 lineno=options.lineno):
448 lineno=options.lineno):
449 ret = 1
449 ret = 1
450 sys.exit(ret)
450 sys.exit(ret)
@@ -1,57 +1,57 b''
1 Create a repository:
1 Create a repository:
2
2
3 $ hg init t
3 $ hg init t
4 $ cd t
4 $ cd t
5
5
6 Make a changeset:
6 Make a changeset:
7
7
8 $ echo a > a
8 $ echo a > a
9 $ hg add a
9 $ hg add a
10 $ hg commit -m test
10 $ hg commit -m test
11
11
12 This command is ancient:
12 This command is ancient:
13
13
14 $ hg history
14 $ hg history
15 changeset: 0:acb14030fe0a
15 changeset: 0:acb14030fe0a
16 tag: tip
16 tag: tip
17 user: test
17 user: test
18 date: Thu Jan 01 00:00:00 1970 +0000
18 date: Thu Jan 01 00:00:00 1970 +0000
19 summary: test
19 summary: test
20
20
21
21
22 Verify that updating to revision 0 via commands.update() works properly
22 Verify that updating to revision 0 via commands.update() works properly
23
23
24 $ cat <<EOF > update_to_rev0.py
24 $ cat <<EOF > update_to_rev0.py
25 > from mercurial import ui, hg, commands
25 > from mercurial import ui, hg, commands
26 > myui = ui.ui()
26 > myui = ui.ui()
27 > repo = hg.repository(myui, path='.')
27 > repo = hg.repository(myui, path='.')
28 > commands.update(myui, repo, rev=0)
28 > commands.update(myui, repo, rev=0)
29 > EOF
29 > EOF
30 $ hg up null
30 $ hg up null
31 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
31 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
32 $ python ./update_to_rev0.py
32 $ python ./update_to_rev0.py
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 $ hg identify -n
34 $ hg identify -n
35 0
35 0
36
36
37
37
38 Poke around at hashes:
38 Poke around at hashes:
39
39
40 $ hg manifest --debug
40 $ hg manifest --debug
41 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
41 b789fdd96dc2f3bd229c1dd8eedf0fc60e2b68e3 644 a
42
42
43 $ hg cat a
43 $ hg cat a
44 a
44 a
45
45
46 Verify should succeed:
46 Verify should succeed:
47
47
48 $ hg verify
48 $ hg verify
49 checking changesets
49 checking changesets
50 checking manifests
50 checking manifests
51 crosschecking files in changesets and manifests
51 crosschecking files in changesets and manifests
52 checking files
52 checking files
53 1 files, 1 changesets, 1 total revisions
53 1 files, 1 changesets, 1 total revisions
54
54
55 At the end...
55 At the end...
56
56
57 $ cd ..
57 $ cd ..
@@ -1,298 +1,298 b''
1 $ "$TESTDIR/hghave" serve || exit 80
1 $ "$TESTDIR/hghave" serve || exit 80
2
2
3 initialize
3 initialize
4
4
5 $ hg init a
5 $ hg init a
6 $ cd a
6 $ cd a
7 $ echo 'test' > test
7 $ echo 'test' > test
8 $ hg commit -Am'test'
8 $ hg commit -Am'test'
9 adding test
9 adding test
10
10
11 set bookmarks
11 set bookmarks
12
12
13 $ hg bookmark X
13 $ hg bookmark X
14 $ hg bookmark Y
14 $ hg bookmark Y
15 $ hg bookmark Z
15 $ hg bookmark Z
16
16
17 import bookmark by name
17 import bookmark by name
18
18
19 $ hg init ../b
19 $ hg init ../b
20 $ cd ../b
20 $ cd ../b
21 $ hg book Y
21 $ hg book Y
22 $ hg book
22 $ hg book
23 * Y -1:000000000000
23 * Y -1:000000000000
24 $ hg pull ../a
24 $ hg pull ../a
25 pulling from ../a
25 pulling from ../a
26 requesting all changes
26 requesting all changes
27 adding changesets
27 adding changesets
28 adding manifests
28 adding manifests
29 adding file changes
29 adding file changes
30 added 1 changesets with 1 changes to 1 files
30 added 1 changesets with 1 changes to 1 files
31 updating bookmark Y
31 updating bookmark Y
32 adding remote bookmark X
32 adding remote bookmark X
33 adding remote bookmark Z
33 adding remote bookmark Z
34 (run 'hg update' to get a working copy)
34 (run 'hg update' to get a working copy)
35 $ hg bookmarks
35 $ hg bookmarks
36 X 0:4e3505fd9583
36 X 0:4e3505fd9583
37 Y 0:4e3505fd9583
37 Y 0:4e3505fd9583
38 Z 0:4e3505fd9583
38 Z 0:4e3505fd9583
39 $ hg debugpushkey ../a namespaces
39 $ hg debugpushkey ../a namespaces
40 bookmarks
40 bookmarks
41 phases
41 phases
42 namespaces
42 namespaces
43 $ hg debugpushkey ../a bookmarks
43 $ hg debugpushkey ../a bookmarks
44 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
44 Y 4e3505fd95835d721066b76e75dbb8cc554d7f77
45 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
45 X 4e3505fd95835d721066b76e75dbb8cc554d7f77
46 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
46 Z 4e3505fd95835d721066b76e75dbb8cc554d7f77
47 $ hg pull -B X ../a
47 $ hg pull -B X ../a
48 pulling from ../a
48 pulling from ../a
49 no changes found
49 no changes found
50 importing bookmark X
50 importing bookmark X
51 $ hg bookmark
51 $ hg bookmark
52 X 0:4e3505fd9583
52 X 0:4e3505fd9583
53 Y 0:4e3505fd9583
53 Y 0:4e3505fd9583
54 Z 0:4e3505fd9583
54 Z 0:4e3505fd9583
55
55
56 export bookmark by name
56 export bookmark by name
57
57
58 $ hg bookmark W
58 $ hg bookmark W
59 $ hg bookmark foo
59 $ hg bookmark foo
60 $ hg bookmark foobar
60 $ hg bookmark foobar
61 $ hg push -B W ../a
61 $ hg push -B W ../a
62 pushing to ../a
62 pushing to ../a
63 searching for changes
63 searching for changes
64 no changes found
64 no changes found
65 exporting bookmark W
65 exporting bookmark W
66 [1]
66 [1]
67 $ hg -R ../a bookmarks
67 $ hg -R ../a bookmarks
68 W -1:000000000000
68 W -1:000000000000
69 X 0:4e3505fd9583
69 X 0:4e3505fd9583
70 Y 0:4e3505fd9583
70 Y 0:4e3505fd9583
71 * Z 0:4e3505fd9583
71 * Z 0:4e3505fd9583
72
72
73 delete a remote bookmark
73 delete a remote bookmark
74
74
75 $ hg book -d W
75 $ hg book -d W
76 $ hg push -B W ../a
76 $ hg push -B W ../a
77 pushing to ../a
77 pushing to ../a
78 searching for changes
78 searching for changes
79 no changes found
79 no changes found
80 deleting remote bookmark W
80 deleting remote bookmark W
81 [1]
81 [1]
82
82
83 push/pull name that doesn't exist
83 push/pull name that doesn't exist
84
84
85 $ hg push -B badname ../a
85 $ hg push -B badname ../a
86 pushing to ../a
86 pushing to ../a
87 searching for changes
87 searching for changes
88 no changes found
88 no changes found
89 bookmark badname does not exist on the local or remote repository!
89 bookmark badname does not exist on the local or remote repository!
90 [2]
90 [2]
91 $ hg pull -B anotherbadname ../a
91 $ hg pull -B anotherbadname ../a
92 pulling from ../a
92 pulling from ../a
93 abort: remote bookmark anotherbadname not found!
93 abort: remote bookmark anotherbadname not found!
94 [255]
94 [255]
95
95
96 divergent bookmarks
96 divergent bookmarks
97
97
98 $ cd ../a
98 $ cd ../a
99 $ echo c1 > f1
99 $ echo c1 > f1
100 $ hg ci -Am1
100 $ hg ci -Am1
101 adding f1
101 adding f1
102 $ hg book -f X
102 $ hg book -f X
103 $ hg book
103 $ hg book
104 * X 1:0d2164f0ce0d
104 * X 1:0d2164f0ce0d
105 Y 0:4e3505fd9583
105 Y 0:4e3505fd9583
106 Z 1:0d2164f0ce0d
106 Z 1:0d2164f0ce0d
107
107
108 $ cd ../b
108 $ cd ../b
109 $ hg up
109 $ hg up
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
110 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
111 updating bookmark foobar
111 updating bookmark foobar
112 $ echo c2 > f2
112 $ echo c2 > f2
113 $ hg ci -Am2
113 $ hg ci -Am2
114 adding f2
114 adding f2
115 $ hg book -f X
115 $ hg book -f X
116 $ hg book
116 $ hg book
117 * X 1:9b140be10808
117 * X 1:9b140be10808
118 Y 0:4e3505fd9583
118 Y 0:4e3505fd9583
119 Z 0:4e3505fd9583
119 Z 0:4e3505fd9583
120 foo -1:000000000000
120 foo -1:000000000000
121 foobar 1:9b140be10808
121 foobar 1:9b140be10808
122
122
123 $ hg pull --config paths.foo=../a foo
123 $ hg pull --config paths.foo=../a foo
124 pulling from $TESTTMP/a (glob)
124 pulling from $TESTTMP/a (glob)
125 searching for changes
125 searching for changes
126 adding changesets
126 adding changesets
127 adding manifests
127 adding manifests
128 adding file changes
128 adding file changes
129 added 1 changesets with 1 changes to 1 files (+1 heads)
129 added 1 changesets with 1 changes to 1 files (+1 heads)
130 divergent bookmark X stored as X@foo
130 divergent bookmark X stored as X@foo
131 updating bookmark Z
131 updating bookmark Z
132 (run 'hg heads' to see heads, 'hg merge' to merge)
132 (run 'hg heads' to see heads, 'hg merge' to merge)
133 $ hg book
133 $ hg book
134 * X 1:9b140be10808
134 * X 1:9b140be10808
135 X@foo 2:0d2164f0ce0d
135 X@foo 2:0d2164f0ce0d
136 Y 0:4e3505fd9583
136 Y 0:4e3505fd9583
137 Z 2:0d2164f0ce0d
137 Z 2:0d2164f0ce0d
138 foo -1:000000000000
138 foo -1:000000000000
139 foobar 1:9b140be10808
139 foobar 1:9b140be10808
140 $ hg push -f ../a
140 $ hg push -f ../a
141 pushing to ../a
141 pushing to ../a
142 searching for changes
142 searching for changes
143 adding changesets
143 adding changesets
144 adding manifests
144 adding manifests
145 adding file changes
145 adding file changes
146 added 1 changesets with 1 changes to 1 files (+1 heads)
146 added 1 changesets with 1 changes to 1 files (+1 heads)
147 $ hg -R ../a book
147 $ hg -R ../a book
148 * X 1:0d2164f0ce0d
148 * X 1:0d2164f0ce0d
149 Y 0:4e3505fd9583
149 Y 0:4e3505fd9583
150 Z 1:0d2164f0ce0d
150 Z 1:0d2164f0ce0d
151
151
152 update a remote bookmark from a non-head to a head
152 update a remote bookmark from a non-head to a head
153
153
154 $ hg up -q Y
154 $ hg up -q Y
155 $ echo c3 > f2
155 $ echo c3 > f2
156 $ hg ci -Am3
156 $ hg ci -Am3
157 adding f2
157 adding f2
158 created new head
158 created new head
159 $ hg push ../a
159 $ hg push ../a
160 pushing to ../a
160 pushing to ../a
161 searching for changes
161 searching for changes
162 adding changesets
162 adding changesets
163 adding manifests
163 adding manifests
164 adding file changes
164 adding file changes
165 added 1 changesets with 1 changes to 1 files (+1 heads)
165 added 1 changesets with 1 changes to 1 files (+1 heads)
166 updating bookmark Y
166 updating bookmark Y
167 $ hg -R ../a book
167 $ hg -R ../a book
168 * X 1:0d2164f0ce0d
168 * X 1:0d2164f0ce0d
169 Y 3:f6fc62dde3c0
169 Y 3:f6fc62dde3c0
170 Z 1:0d2164f0ce0d
170 Z 1:0d2164f0ce0d
171
171
172 diverging a remote bookmark fails
172 diverging a remote bookmark fails
173
173
174 $ hg up -q 4e3505fd9583
174 $ hg up -q 4e3505fd9583
175 $ echo c4 > f2
175 $ echo c4 > f2
176 $ hg ci -Am4
176 $ hg ci -Am4
177 adding f2
177 adding f2
178 created new head
178 created new head
179 $ hg book -f Y
179 $ hg book -f Y
180
180
181 $ cat <<EOF > ../a/.hg/hgrc
181 $ cat <<EOF > ../a/.hg/hgrc
182 > [web]
182 > [web]
183 > push_ssl = false
183 > push_ssl = false
184 > allow_push = *
184 > allow_push = *
185 > EOF
185 > EOF
186
186
187 $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
187 $ hg -R ../a serve -p $HGPORT2 -d --pid-file=../hg2.pid
188 $ cat ../hg2.pid >> $DAEMON_PIDS
188 $ cat ../hg2.pid >> $DAEMON_PIDS
189
189
190 $ hg push http://localhost:$HGPORT2/
190 $ hg push http://localhost:$HGPORT2/
191 pushing to http://localhost:$HGPORT2/
191 pushing to http://localhost:$HGPORT2/
192 searching for changes
192 searching for changes
193 abort: push creates new remote head 4efff6d98829!
193 abort: push creates new remote head 4efff6d98829!
194 (did you forget to merge? use push -f to force)
194 (did you forget to merge? use push -f to force)
195 [255]
195 [255]
196 $ hg -R ../a book
196 $ hg -R ../a book
197 * X 1:0d2164f0ce0d
197 * X 1:0d2164f0ce0d
198 Y 3:f6fc62dde3c0
198 Y 3:f6fc62dde3c0
199 Z 1:0d2164f0ce0d
199 Z 1:0d2164f0ce0d
200
200
201 hgweb
201 hgweb
202
202
203 $ cat <<EOF > .hg/hgrc
203 $ cat <<EOF > .hg/hgrc
204 > [web]
204 > [web]
205 > push_ssl = false
205 > push_ssl = false
206 > allow_push = *
206 > allow_push = *
207 > EOF
207 > EOF
208
208
209 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
209 $ hg serve -p $HGPORT -d --pid-file=../hg.pid -E errors.log
210 $ cat ../hg.pid >> $DAEMON_PIDS
210 $ cat ../hg.pid >> $DAEMON_PIDS
211 $ cd ../a
211 $ cd ../a
212
212
213 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
213 $ hg debugpushkey http://localhost:$HGPORT/ namespaces
214 bookmarks
214 bookmarks
215 phases
215 phases
216 namespaces
216 namespaces
217 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
217 $ hg debugpushkey http://localhost:$HGPORT/ bookmarks
218 Y 4efff6d98829d9c824c621afd6e3f01865f5439f
218 Y 4efff6d98829d9c824c621afd6e3f01865f5439f
219 foobar 9b140be1080824d768c5a4691a564088eede71f9
219 foobar 9b140be1080824d768c5a4691a564088eede71f9
220 Z 0d2164f0ce0d8f1d6f94351eba04b794909be66c
220 Z 0d2164f0ce0d8f1d6f94351eba04b794909be66c
221 foo 0000000000000000000000000000000000000000
221 foo 0000000000000000000000000000000000000000
222 X 9b140be1080824d768c5a4691a564088eede71f9
222 X 9b140be1080824d768c5a4691a564088eede71f9
223 $ hg out -B http://localhost:$HGPORT/
223 $ hg out -B http://localhost:$HGPORT/
224 comparing with http://localhost:$HGPORT/
224 comparing with http://localhost:$HGPORT/
225 searching for changed bookmarks
225 searching for changed bookmarks
226 no changed bookmarks found
226 no changed bookmarks found
227 [1]
227 [1]
228 $ hg push -B Z http://localhost:$HGPORT/
228 $ hg push -B Z http://localhost:$HGPORT/
229 pushing to http://localhost:$HGPORT/
229 pushing to http://localhost:$HGPORT/
230 searching for changes
230 searching for changes
231 no changes found
231 no changes found
232 exporting bookmark Z
232 exporting bookmark Z
233 [1]
233 [1]
234 $ hg book -d Z
234 $ hg book -d Z
235 $ hg in -B http://localhost:$HGPORT/
235 $ hg in -B http://localhost:$HGPORT/
236 comparing with http://localhost:$HGPORT/
236 comparing with http://localhost:$HGPORT/
237 searching for changed bookmarks
237 searching for changed bookmarks
238 Z 0d2164f0ce0d
238 Z 0d2164f0ce0d
239 foo 000000000000
239 foo 000000000000
240 foobar 9b140be10808
240 foobar 9b140be10808
241 $ hg pull -B Z http://localhost:$HGPORT/
241 $ hg pull -B Z http://localhost:$HGPORT/
242 pulling from http://localhost:$HGPORT/
242 pulling from http://localhost:$HGPORT/
243 no changes found
243 no changes found
244 adding remote bookmark foobar
244 adding remote bookmark foobar
245 adding remote bookmark Z
245 adding remote bookmark Z
246 adding remote bookmark foo
246 adding remote bookmark foo
247 divergent bookmark X stored as X@1
247 divergent bookmark X stored as X@1
248 importing bookmark Z
248 importing bookmark Z
249 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
249 $ hg clone http://localhost:$HGPORT/ cloned-bookmarks
250 requesting all changes
250 requesting all changes
251 adding changesets
251 adding changesets
252 adding manifests
252 adding manifests
253 adding file changes
253 adding file changes
254 added 5 changesets with 5 changes to 3 files (+3 heads)
254 added 5 changesets with 5 changes to 3 files (+3 heads)
255 updating to branch default
255 updating to branch default
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
256 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
257 $ hg -R cloned-bookmarks bookmarks
257 $ hg -R cloned-bookmarks bookmarks
258 X 1:9b140be10808
258 X 1:9b140be10808
259 Y 4:4efff6d98829
259 Y 4:4efff6d98829
260 Z 2:0d2164f0ce0d
260 Z 2:0d2164f0ce0d
261 foo -1:000000000000
261 foo -1:000000000000
262 foobar 1:9b140be10808
262 foobar 1:9b140be10808
263
263
264 $ cd ..
264 $ cd ..
265
265
266 Pushing a bookmark should only push the changes required by that
266 Pushing a bookmark should only push the changes required by that
267 bookmark, not all outgoing changes:
267 bookmark, not all outgoing changes:
268 $ hg clone http://localhost:$HGPORT/ addmarks
268 $ hg clone http://localhost:$HGPORT/ addmarks
269 requesting all changes
269 requesting all changes
270 adding changesets
270 adding changesets
271 adding manifests
271 adding manifests
272 adding file changes
272 adding file changes
273 added 5 changesets with 5 changes to 3 files (+3 heads)
273 added 5 changesets with 5 changes to 3 files (+3 heads)
274 updating to branch default
274 updating to branch default
275 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
275 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
276 $ cd addmarks
276 $ cd addmarks
277 $ echo foo > foo
277 $ echo foo > foo
278 $ hg add foo
278 $ hg add foo
279 $ hg commit -m 'add foo'
279 $ hg commit -m 'add foo'
280 $ echo bar > bar
280 $ echo bar > bar
281 $ hg add bar
281 $ hg add bar
282 $ hg commit -m 'add bar'
282 $ hg commit -m 'add bar'
283 $ hg co "tip^"
283 $ hg co "tip^"
284 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
284 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
285 $ hg book add-foo
285 $ hg book add-foo
286 $ hg book -r tip add-bar
286 $ hg book -r tip add-bar
287 Note: this push *must* push only a single changeset, as that's the point
287 Note: this push *must* push only a single changeset, as that's the point
288 of this test.
288 of this test.
289 $ hg push -B add-foo
289 $ hg push -B add-foo
290 pushing to http://localhost:$HGPORT/
290 pushing to http://localhost:$HGPORT/
291 searching for changes
291 searching for changes
292 remote: adding changesets
292 remote: adding changesets
293 remote: adding manifests
293 remote: adding manifests
294 remote: adding file changes
294 remote: adding file changes
295 remote: added 1 changesets with 1 changes to 1 files
295 remote: added 1 changesets with 1 changes to 1 files
296 exporting bookmark add-foo
296 exporting bookmark add-foo
297
297
298 $ cd ..
298 $ cd ..
@@ -1,72 +1,72 b''
1 $ hg init repo
1 $ hg init repo
2 $ cd repo
2 $ cd repo
3 $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
3 $ i=0; while [ "$i" -lt 213 ]; do echo a >> a; i=`expr $i + 1`; done
4 $ hg add a
4 $ hg add a
5 $ cp a b
5 $ cp a b
6 $ hg add b
6 $ hg add b
7
7
8 Wide diffstat:
8 Wide diffstat:
9
9
10 $ hg diff --stat
10 $ hg diff --stat
11 a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11 a | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 b | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
12 b | 213 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
13 2 files changed, 426 insertions(+), 0 deletions(-)
13 2 files changed, 426 insertions(+), 0 deletions(-)
14
14
15 diffstat width:
15 diffstat width:
16
16
17 $ COLUMNS=24 hg diff --config ui.interactive=true --stat
17 $ COLUMNS=24 hg diff --config ui.interactive=true --stat
18 a | 213 ++++++++++++++
18 a | 213 ++++++++++++++
19 b | 213 ++++++++++++++
19 b | 213 ++++++++++++++
20 2 files changed, 426 insertions(+), 0 deletions(-)
20 2 files changed, 426 insertions(+), 0 deletions(-)
21
21
22 $ hg ci -m adda
22 $ hg ci -m adda
23
23
24 $ cat >> a <<EOF
24 $ cat >> a <<EOF
25 > a
25 > a
26 > a
26 > a
27 > a
27 > a
28 > EOF
28 > EOF
29
29
30 Narrow diffstat:
30 Narrow diffstat:
31
31
32 $ hg diff --stat
32 $ hg diff --stat
33 a | 3 +++
33 a | 3 +++
34 1 files changed, 3 insertions(+), 0 deletions(-)
34 1 files changed, 3 insertions(+), 0 deletions(-)
35
35
36 $ hg ci -m appenda
36 $ hg ci -m appenda
37
37
38 >>> open("c", "wb").write("\0")
38 >>> open("c", "wb").write("\0")
39 $ touch d
39 $ touch d
40 $ hg add c d
40 $ hg add c d
41
41
42 Binary diffstat:
42 Binary diffstat:
43
43
44 $ hg diff --stat
44 $ hg diff --stat
45 c | Bin
45 c | Bin
46 1 files changed, 0 insertions(+), 0 deletions(-)
46 1 files changed, 0 insertions(+), 0 deletions(-)
47
47
48 Binary git diffstat:
48 Binary git diffstat:
49
49
50 $ hg diff --stat --git
50 $ hg diff --stat --git
51 c | Bin
51 c | Bin
52 d | 0
52 d | 0
53 2 files changed, 0 insertions(+), 0 deletions(-)
53 2 files changed, 0 insertions(+), 0 deletions(-)
54
54
55 $ hg ci -m createb
55 $ hg ci -m createb
56
56
57 >>> open("file with spaces", "wb").write("\0")
57 >>> open("file with spaces", "wb").write("\0")
58 $ hg add "file with spaces"
58 $ hg add "file with spaces"
59
59
60 Filename with spaces diffstat:
60 Filename with spaces diffstat:
61
61
62 $ hg diff --stat
62 $ hg diff --stat
63 file with spaces | Bin
63 file with spaces | Bin
64 1 files changed, 0 insertions(+), 0 deletions(-)
64 1 files changed, 0 insertions(+), 0 deletions(-)
65
65
66 Filename with spaces git diffstat:
66 Filename with spaces git diffstat:
67
67
68 $ hg diff --stat --git
68 $ hg diff --stat --git
69 file with spaces | Bin
69 file with spaces | Bin
70 1 files changed, 0 insertions(+), 0 deletions(-)
70 1 files changed, 0 insertions(+), 0 deletions(-)
71
71
72 $ cd ..
72 $ cd ..
@@ -1,252 +1,252 b''
1 Test character encoding
1 Test character encoding
2
2
3 $ hg init t
3 $ hg init t
4 $ cd t
4 $ cd t
5
5
6 we need a repo with some legacy latin-1 changesets
6 we need a repo with some legacy latin-1 changesets
7
7
8 $ hg unbundle "$TESTDIR/bundles/legacy-encoding.hg"
8 $ hg unbundle "$TESTDIR/bundles/legacy-encoding.hg"
9 adding changesets
9 adding changesets
10 adding manifests
10 adding manifests
11 adding file changes
11 adding file changes
12 added 2 changesets with 2 changes to 1 files
12 added 2 changesets with 2 changes to 1 files
13 (run 'hg update' to get a working copy)
13 (run 'hg update' to get a working copy)
14 $ hg co
14 $ hg co
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
15 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 $ python << EOF
16 $ python << EOF
17 > f = file('latin-1', 'w'); f.write("latin-1 e' encoded: \xe9"); f.close()
17 > f = file('latin-1', 'w'); f.write("latin-1 e' encoded: \xe9"); f.close()
18 > f = file('utf-8', 'w'); f.write("utf-8 e' encoded: \xc3\xa9"); f.close()
18 > f = file('utf-8', 'w'); f.write("utf-8 e' encoded: \xc3\xa9"); f.close()
19 > f = file('latin-1-tag', 'w'); f.write("\xe9"); f.close()
19 > f = file('latin-1-tag', 'w'); f.write("\xe9"); f.close()
20 > EOF
20 > EOF
21
21
22 should fail with encoding error
22 should fail with encoding error
23
23
24 $ echo "plain old ascii" > a
24 $ echo "plain old ascii" > a
25 $ hg st
25 $ hg st
26 M a
26 M a
27 ? latin-1
27 ? latin-1
28 ? latin-1-tag
28 ? latin-1-tag
29 ? utf-8
29 ? utf-8
30 $ HGENCODING=ascii hg ci -l latin-1
30 $ HGENCODING=ascii hg ci -l latin-1
31 transaction abort!
31 transaction abort!
32 rollback completed
32 rollback completed
33 abort: decoding near ' encoded: \xe9': 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)! (esc)
33 abort: decoding near ' encoded: \xe9': 'ascii' codec can't decode byte 0xe9 in position 20: ordinal not in range(128)! (esc)
34 [255]
34 [255]
35
35
36 these should work
36 these should work
37
37
38 $ echo "latin-1" > a
38 $ echo "latin-1" > a
39 $ HGENCODING=latin-1 hg ci -l latin-1
39 $ HGENCODING=latin-1 hg ci -l latin-1
40 $ echo "utf-8" > a
40 $ echo "utf-8" > a
41 $ HGENCODING=utf-8 hg ci -l utf-8
41 $ HGENCODING=utf-8 hg ci -l utf-8
42 $ HGENCODING=latin-1 hg tag `cat latin-1-tag`
42 $ HGENCODING=latin-1 hg tag `cat latin-1-tag`
43 $ HGENCODING=latin-1 hg branch `cat latin-1-tag`
43 $ HGENCODING=latin-1 hg branch `cat latin-1-tag`
44 marked working directory as branch \xe9 (esc)
44 marked working directory as branch \xe9 (esc)
45 (branches are permanent and global, did you want a bookmark?)
45 (branches are permanent and global, did you want a bookmark?)
46 $ HGENCODING=latin-1 hg ci -m 'latin1 branch'
46 $ HGENCODING=latin-1 hg ci -m 'latin1 branch'
47 $ rm .hg/branch
47 $ rm .hg/branch
48
48
49 hg log (ascii)
49 hg log (ascii)
50
50
51 $ hg --encoding ascii log
51 $ hg --encoding ascii log
52 changeset: 5:a52c0692f24a
52 changeset: 5:a52c0692f24a
53 branch: ?
53 branch: ?
54 tag: tip
54 tag: tip
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: latin1 branch
57 summary: latin1 branch
58
58
59 changeset: 4:94db611b4196
59 changeset: 4:94db611b4196
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: Added tag ? for changeset ca661e7520de
62 summary: Added tag ? for changeset ca661e7520de
63
63
64 changeset: 3:ca661e7520de
64 changeset: 3:ca661e7520de
65 tag: ?
65 tag: ?
66 user: test
66 user: test
67 date: Thu Jan 01 00:00:00 1970 +0000
67 date: Thu Jan 01 00:00:00 1970 +0000
68 summary: utf-8 e' encoded: ?
68 summary: utf-8 e' encoded: ?
69
69
70 changeset: 2:650c6f3d55dd
70 changeset: 2:650c6f3d55dd
71 user: test
71 user: test
72 date: Thu Jan 01 00:00:00 1970 +0000
72 date: Thu Jan 01 00:00:00 1970 +0000
73 summary: latin-1 e' encoded: ?
73 summary: latin-1 e' encoded: ?
74
74
75 changeset: 1:0e5b7e3f9c4a
75 changeset: 1:0e5b7e3f9c4a
76 user: test
76 user: test
77 date: Mon Jan 12 13:46:40 1970 +0000
77 date: Mon Jan 12 13:46:40 1970 +0000
78 summary: koi8-r: ????? = u'\u0440\u0442\u0443\u0442\u044c'
78 summary: koi8-r: ????? = u'\u0440\u0442\u0443\u0442\u044c'
79
79
80 changeset: 0:1e78a93102a3
80 changeset: 0:1e78a93102a3
81 user: test
81 user: test
82 date: Mon Jan 12 13:46:40 1970 +0000
82 date: Mon Jan 12 13:46:40 1970 +0000
83 summary: latin-1 e': ? = u'\xe9'
83 summary: latin-1 e': ? = u'\xe9'
84
84
85
85
86 hg log (latin-1)
86 hg log (latin-1)
87
87
88 $ hg --encoding latin-1 log
88 $ hg --encoding latin-1 log
89 changeset: 5:a52c0692f24a
89 changeset: 5:a52c0692f24a
90 branch: \xe9 (esc)
90 branch: \xe9 (esc)
91 tag: tip
91 tag: tip
92 user: test
92 user: test
93 date: Thu Jan 01 00:00:00 1970 +0000
93 date: Thu Jan 01 00:00:00 1970 +0000
94 summary: latin1 branch
94 summary: latin1 branch
95
95
96 changeset: 4:94db611b4196
96 changeset: 4:94db611b4196
97 user: test
97 user: test
98 date: Thu Jan 01 00:00:00 1970 +0000
98 date: Thu Jan 01 00:00:00 1970 +0000
99 summary: Added tag \xe9 for changeset ca661e7520de (esc)
99 summary: Added tag \xe9 for changeset ca661e7520de (esc)
100
100
101 changeset: 3:ca661e7520de
101 changeset: 3:ca661e7520de
102 tag: \xe9 (esc)
102 tag: \xe9 (esc)
103 user: test
103 user: test
104 date: Thu Jan 01 00:00:00 1970 +0000
104 date: Thu Jan 01 00:00:00 1970 +0000
105 summary: utf-8 e' encoded: \xe9 (esc)
105 summary: utf-8 e' encoded: \xe9 (esc)
106
106
107 changeset: 2:650c6f3d55dd
107 changeset: 2:650c6f3d55dd
108 user: test
108 user: test
109 date: Thu Jan 01 00:00:00 1970 +0000
109 date: Thu Jan 01 00:00:00 1970 +0000
110 summary: latin-1 e' encoded: \xe9 (esc)
110 summary: latin-1 e' encoded: \xe9 (esc)
111
111
112 changeset: 1:0e5b7e3f9c4a
112 changeset: 1:0e5b7e3f9c4a
113 user: test
113 user: test
114 date: Mon Jan 12 13:46:40 1970 +0000
114 date: Mon Jan 12 13:46:40 1970 +0000
115 summary: koi8-r: \xd2\xd4\xd5\xd4\xd8 = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
115 summary: koi8-r: \xd2\xd4\xd5\xd4\xd8 = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
116
116
117 changeset: 0:1e78a93102a3
117 changeset: 0:1e78a93102a3
118 user: test
118 user: test
119 date: Mon Jan 12 13:46:40 1970 +0000
119 date: Mon Jan 12 13:46:40 1970 +0000
120 summary: latin-1 e': \xe9 = u'\\xe9' (esc)
120 summary: latin-1 e': \xe9 = u'\\xe9' (esc)
121
121
122
122
123 hg log (utf-8)
123 hg log (utf-8)
124
124
125 $ hg --encoding utf-8 log
125 $ hg --encoding utf-8 log
126 changeset: 5:a52c0692f24a
126 changeset: 5:a52c0692f24a
127 branch: \xc3\xa9 (esc)
127 branch: \xc3\xa9 (esc)
128 tag: tip
128 tag: tip
129 user: test
129 user: test
130 date: Thu Jan 01 00:00:00 1970 +0000
130 date: Thu Jan 01 00:00:00 1970 +0000
131 summary: latin1 branch
131 summary: latin1 branch
132
132
133 changeset: 4:94db611b4196
133 changeset: 4:94db611b4196
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: Added tag \xc3\xa9 for changeset ca661e7520de (esc)
136 summary: Added tag \xc3\xa9 for changeset ca661e7520de (esc)
137
137
138 changeset: 3:ca661e7520de
138 changeset: 3:ca661e7520de
139 tag: \xc3\xa9 (esc)
139 tag: \xc3\xa9 (esc)
140 user: test
140 user: test
141 date: Thu Jan 01 00:00:00 1970 +0000
141 date: Thu Jan 01 00:00:00 1970 +0000
142 summary: utf-8 e' encoded: \xc3\xa9 (esc)
142 summary: utf-8 e' encoded: \xc3\xa9 (esc)
143
143
144 changeset: 2:650c6f3d55dd
144 changeset: 2:650c6f3d55dd
145 user: test
145 user: test
146 date: Thu Jan 01 00:00:00 1970 +0000
146 date: Thu Jan 01 00:00:00 1970 +0000
147 summary: latin-1 e' encoded: \xc3\xa9 (esc)
147 summary: latin-1 e' encoded: \xc3\xa9 (esc)
148
148
149 changeset: 1:0e5b7e3f9c4a
149 changeset: 1:0e5b7e3f9c4a
150 user: test
150 user: test
151 date: Mon Jan 12 13:46:40 1970 +0000
151 date: Mon Jan 12 13:46:40 1970 +0000
152 summary: koi8-r: \xc3\x92\xc3\x94\xc3\x95\xc3\x94\xc3\x98 = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
152 summary: koi8-r: \xc3\x92\xc3\x94\xc3\x95\xc3\x94\xc3\x98 = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
153
153
154 changeset: 0:1e78a93102a3
154 changeset: 0:1e78a93102a3
155 user: test
155 user: test
156 date: Mon Jan 12 13:46:40 1970 +0000
156 date: Mon Jan 12 13:46:40 1970 +0000
157 summary: latin-1 e': \xc3\xa9 = u'\\xe9' (esc)
157 summary: latin-1 e': \xc3\xa9 = u'\\xe9' (esc)
158
158
159
159
160 hg tags (ascii)
160 hg tags (ascii)
161
161
162 $ HGENCODING=ascii hg tags
162 $ HGENCODING=ascii hg tags
163 tip 5:a52c0692f24a
163 tip 5:a52c0692f24a
164 ? 3:ca661e7520de
164 ? 3:ca661e7520de
165
165
166 hg tags (latin-1)
166 hg tags (latin-1)
167
167
168 $ HGENCODING=latin-1 hg tags
168 $ HGENCODING=latin-1 hg tags
169 tip 5:a52c0692f24a
169 tip 5:a52c0692f24a
170 \xe9 3:ca661e7520de (esc)
170 \xe9 3:ca661e7520de (esc)
171
171
172 hg tags (utf-8)
172 hg tags (utf-8)
173
173
174 $ HGENCODING=utf-8 hg tags
174 $ HGENCODING=utf-8 hg tags
175 tip 5:a52c0692f24a
175 tip 5:a52c0692f24a
176 \xc3\xa9 3:ca661e7520de (esc)
176 \xc3\xa9 3:ca661e7520de (esc)
177
177
178 hg branches (ascii)
178 hg branches (ascii)
179
179
180 $ HGENCODING=ascii hg branches
180 $ HGENCODING=ascii hg branches
181 ? 5:a52c0692f24a
181 ? 5:a52c0692f24a
182 default 4:94db611b4196 (inactive)
182 default 4:94db611b4196 (inactive)
183
183
184 hg branches (latin-1)
184 hg branches (latin-1)
185
185
186 $ HGENCODING=latin-1 hg branches
186 $ HGENCODING=latin-1 hg branches
187 \xe9 5:a52c0692f24a (esc)
187 \xe9 5:a52c0692f24a (esc)
188 default 4:94db611b4196 (inactive)
188 default 4:94db611b4196 (inactive)
189
189
190 hg branches (utf-8)
190 hg branches (utf-8)
191
191
192 $ HGENCODING=utf-8 hg branches
192 $ HGENCODING=utf-8 hg branches
193 \xc3\xa9 5:a52c0692f24a (esc)
193 \xc3\xa9 5:a52c0692f24a (esc)
194 default 4:94db611b4196 (inactive)
194 default 4:94db611b4196 (inactive)
195 $ echo '[ui]' >> .hg/hgrc
195 $ echo '[ui]' >> .hg/hgrc
196 $ echo 'fallbackencoding = koi8-r' >> .hg/hgrc
196 $ echo 'fallbackencoding = koi8-r' >> .hg/hgrc
197
197
198 hg log (utf-8)
198 hg log (utf-8)
199
199
200 $ HGENCODING=utf-8 hg log
200 $ HGENCODING=utf-8 hg log
201 changeset: 5:a52c0692f24a
201 changeset: 5:a52c0692f24a
202 branch: \xc3\xa9 (esc)
202 branch: \xc3\xa9 (esc)
203 tag: tip
203 tag: tip
204 user: test
204 user: test
205 date: Thu Jan 01 00:00:00 1970 +0000
205 date: Thu Jan 01 00:00:00 1970 +0000
206 summary: latin1 branch
206 summary: latin1 branch
207
207
208 changeset: 4:94db611b4196
208 changeset: 4:94db611b4196
209 user: test
209 user: test
210 date: Thu Jan 01 00:00:00 1970 +0000
210 date: Thu Jan 01 00:00:00 1970 +0000
211 summary: Added tag \xc3\xa9 for changeset ca661e7520de (esc)
211 summary: Added tag \xc3\xa9 for changeset ca661e7520de (esc)
212
212
213 changeset: 3:ca661e7520de
213 changeset: 3:ca661e7520de
214 tag: \xc3\xa9 (esc)
214 tag: \xc3\xa9 (esc)
215 user: test
215 user: test
216 date: Thu Jan 01 00:00:00 1970 +0000
216 date: Thu Jan 01 00:00:00 1970 +0000
217 summary: utf-8 e' encoded: \xc3\xa9 (esc)
217 summary: utf-8 e' encoded: \xc3\xa9 (esc)
218
218
219 changeset: 2:650c6f3d55dd
219 changeset: 2:650c6f3d55dd
220 user: test
220 user: test
221 date: Thu Jan 01 00:00:00 1970 +0000
221 date: Thu Jan 01 00:00:00 1970 +0000
222 summary: latin-1 e' encoded: \xc3\xa9 (esc)
222 summary: latin-1 e' encoded: \xc3\xa9 (esc)
223
223
224 changeset: 1:0e5b7e3f9c4a
224 changeset: 1:0e5b7e3f9c4a
225 user: test
225 user: test
226 date: Mon Jan 12 13:46:40 1970 +0000
226 date: Mon Jan 12 13:46:40 1970 +0000
227 summary: koi8-r: \xd1\x80\xd1\x82\xd1\x83\xd1\x82\xd1\x8c = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
227 summary: koi8-r: \xd1\x80\xd1\x82\xd1\x83\xd1\x82\xd1\x8c = u'\\u0440\\u0442\\u0443\\u0442\\u044c' (esc)
228
228
229 changeset: 0:1e78a93102a3
229 changeset: 0:1e78a93102a3
230 user: test
230 user: test
231 date: Mon Jan 12 13:46:40 1970 +0000
231 date: Mon Jan 12 13:46:40 1970 +0000
232 summary: latin-1 e': \xd0\x98 = u'\\xe9' (esc)
232 summary: latin-1 e': \xd0\x98 = u'\\xe9' (esc)
233
233
234
234
235 hg log (dolphin)
235 hg log (dolphin)
236
236
237 $ HGENCODING=dolphin hg log
237 $ HGENCODING=dolphin hg log
238 abort: unknown encoding: dolphin
238 abort: unknown encoding: dolphin
239 (please check your locale settings)
239 (please check your locale settings)
240 [255]
240 [255]
241 $ HGENCODING=ascii hg branch `cat latin-1-tag`
241 $ HGENCODING=ascii hg branch `cat latin-1-tag`
242 abort: decoding near '\xe9': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)! (esc)
242 abort: decoding near '\xe9': 'ascii' codec can't decode byte 0xe9 in position 0: ordinal not in range(128)! (esc)
243 [255]
243 [255]
244 $ cp latin-1-tag .hg/branch
244 $ cp latin-1-tag .hg/branch
245 $ HGENCODING=latin-1 hg ci -m 'auto-promote legacy name'
245 $ HGENCODING=latin-1 hg ci -m 'auto-promote legacy name'
246
246
247 Test roundtrip encoding of lookup tables when not using UTF-8 (issue2763)
247 Test roundtrip encoding of lookup tables when not using UTF-8 (issue2763)
248
248
249 $ HGENCODING=latin-1 hg up `cat latin-1-tag`
249 $ HGENCODING=latin-1 hg up `cat latin-1-tag`
250 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
250 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
251
251
252 $ cd ..
252 $ cd ..
@@ -1,1447 +1,1447 b''
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
2 $ mkdir "${USERCACHE}"
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > largefiles=
5 > largefiles=
6 > purge=
6 > purge=
7 > rebase=
7 > rebase=
8 > transplant=
8 > transplant=
9 > [phases]
9 > [phases]
10 > publish=False
10 > publish=False
11 > [largefiles]
11 > [largefiles]
12 > minsize=2
12 > minsize=2
13 > patterns=glob:**.dat
13 > patterns=glob:**.dat
14 > usercache=${USERCACHE}
14 > usercache=${USERCACHE}
15 > [hooks]
15 > [hooks]
16 > precommit=sh -c "echo \"Invoking status precommit hook\"; hg status"
16 > precommit=sh -c "echo \"Invoking status precommit hook\"; hg status"
17 > EOF
17 > EOF
18
18
19 Create the repo with a couple of revisions of both large and normal
19 Create the repo with a couple of revisions of both large and normal
20 files, testing that status correctly shows largefiles and that summary output
20 files, testing that status correctly shows largefiles and that summary output
21 is correct.
21 is correct.
22
22
23 $ hg init a
23 $ hg init a
24 $ cd a
24 $ cd a
25 $ mkdir sub
25 $ mkdir sub
26 $ echo normal1 > normal1
26 $ echo normal1 > normal1
27 $ echo normal2 > sub/normal2
27 $ echo normal2 > sub/normal2
28 $ echo large1 > large1
28 $ echo large1 > large1
29 $ echo large2 > sub/large2
29 $ echo large2 > sub/large2
30 $ hg add normal1 sub/normal2
30 $ hg add normal1 sub/normal2
31 $ hg add --large large1 sub/large2
31 $ hg add --large large1 sub/large2
32 $ hg commit -m "add files"
32 $ hg commit -m "add files"
33 Invoking status precommit hook
33 Invoking status precommit hook
34 A large1
34 A large1
35 A normal1
35 A normal1
36 A sub/large2
36 A sub/large2
37 A sub/normal2
37 A sub/normal2
38 $ echo normal11 > normal1
38 $ echo normal11 > normal1
39 $ echo normal22 > sub/normal2
39 $ echo normal22 > sub/normal2
40 $ echo large11 > large1
40 $ echo large11 > large1
41 $ echo large22 > sub/large2
41 $ echo large22 > sub/large2
42 $ hg commit -m "edit files"
42 $ hg commit -m "edit files"
43 Invoking status precommit hook
43 Invoking status precommit hook
44 M large1
44 M large1
45 M normal1
45 M normal1
46 M sub/large2
46 M sub/large2
47 M sub/normal2
47 M sub/normal2
48 $ hg sum --large
48 $ hg sum --large
49 parent: 1:ce8896473775 tip
49 parent: 1:ce8896473775 tip
50 edit files
50 edit files
51 branch: default
51 branch: default
52 commit: (clean)
52 commit: (clean)
53 update: (current)
53 update: (current)
54 largefiles: No remote repo
54 largefiles: No remote repo
55
55
56 Commit preserved largefile contents.
56 Commit preserved largefile contents.
57
57
58 $ cat normal1
58 $ cat normal1
59 normal11
59 normal11
60 $ cat large1
60 $ cat large1
61 large11
61 large11
62 $ cat sub/normal2
62 $ cat sub/normal2
63 normal22
63 normal22
64 $ cat sub/large2
64 $ cat sub/large2
65 large22
65 large22
66
66
67 Test status, subdir and unknown files
67 Test status, subdir and unknown files
68
68
69 $ echo unknown > sub/unknown
69 $ echo unknown > sub/unknown
70 $ hg st --all
70 $ hg st --all
71 ? sub/unknown
71 ? sub/unknown
72 C large1
72 C large1
73 C normal1
73 C normal1
74 C sub/large2
74 C sub/large2
75 C sub/normal2
75 C sub/normal2
76 $ hg st --all sub
76 $ hg st --all sub
77 ? sub/unknown
77 ? sub/unknown
78 C sub/large2
78 C sub/large2
79 C sub/normal2
79 C sub/normal2
80 $ rm sub/unknown
80 $ rm sub/unknown
81
81
82 Remove both largefiles and normal files.
82 Remove both largefiles and normal files.
83
83
84 $ hg remove normal1 large1
84 $ hg remove normal1 large1
85 $ hg status large1
85 $ hg status large1
86 R large1
86 R large1
87 $ hg commit -m "remove files"
87 $ hg commit -m "remove files"
88 Invoking status precommit hook
88 Invoking status precommit hook
89 R large1
89 R large1
90 R normal1
90 R normal1
91 $ ls
91 $ ls
92 sub
92 sub
93 $ echo "testlargefile" > large1-test
93 $ echo "testlargefile" > large1-test
94 $ hg add --large large1-test
94 $ hg add --large large1-test
95 $ hg st
95 $ hg st
96 A large1-test
96 A large1-test
97 $ hg rm large1-test
97 $ hg rm large1-test
98 not removing large1-test: file has been marked for add (use forget to undo)
98 not removing large1-test: file has been marked for add (use forget to undo)
99 $ hg st
99 $ hg st
100 A large1-test
100 A large1-test
101 $ hg forget large1-test
101 $ hg forget large1-test
102 $ hg st
102 $ hg st
103 ? large1-test
103 ? large1-test
104 $ rm large1-test
104 $ rm large1-test
105
105
106 Copy both largefiles and normal files (testing that status output is correct).
106 Copy both largefiles and normal files (testing that status output is correct).
107
107
108 $ hg cp sub/normal2 normal1
108 $ hg cp sub/normal2 normal1
109 $ hg cp sub/large2 large1
109 $ hg cp sub/large2 large1
110 $ hg commit -m "copy files"
110 $ hg commit -m "copy files"
111 Invoking status precommit hook
111 Invoking status precommit hook
112 A large1
112 A large1
113 A normal1
113 A normal1
114 $ cat normal1
114 $ cat normal1
115 normal22
115 normal22
116 $ cat large1
116 $ cat large1
117 large22
117 large22
118
118
119 Test moving largefiles and verify that normal files are also unaffected.
119 Test moving largefiles and verify that normal files are also unaffected.
120
120
121 $ hg mv normal1 normal3
121 $ hg mv normal1 normal3
122 $ hg mv large1 large3
122 $ hg mv large1 large3
123 $ hg mv sub/normal2 sub/normal4
123 $ hg mv sub/normal2 sub/normal4
124 $ hg mv sub/large2 sub/large4
124 $ hg mv sub/large2 sub/large4
125 $ hg commit -m "move files"
125 $ hg commit -m "move files"
126 Invoking status precommit hook
126 Invoking status precommit hook
127 A large3
127 A large3
128 A normal3
128 A normal3
129 A sub/large4
129 A sub/large4
130 A sub/normal4
130 A sub/normal4
131 R large1
131 R large1
132 R normal1
132 R normal1
133 R sub/large2
133 R sub/large2
134 R sub/normal2
134 R sub/normal2
135 $ cat normal3
135 $ cat normal3
136 normal22
136 normal22
137 $ cat large3
137 $ cat large3
138 large22
138 large22
139 $ cat sub/normal4
139 $ cat sub/normal4
140 normal22
140 normal22
141 $ cat sub/large4
141 $ cat sub/large4
142 large22
142 large22
143
143
144 Test copies and moves from a directory other than root (issue3516)
144 Test copies and moves from a directory other than root (issue3516)
145
145
146 $ cd ..
146 $ cd ..
147 $ hg init lf_cpmv
147 $ hg init lf_cpmv
148 $ cd lf_cpmv
148 $ cd lf_cpmv
149 $ mkdir dira
149 $ mkdir dira
150 $ mkdir dira/dirb
150 $ mkdir dira/dirb
151 $ touch dira/dirb/largefile
151 $ touch dira/dirb/largefile
152 $ hg add --large dira/dirb/largefile
152 $ hg add --large dira/dirb/largefile
153 $ hg commit -m "added"
153 $ hg commit -m "added"
154 Invoking status precommit hook
154 Invoking status precommit hook
155 A dira/dirb/largefile
155 A dira/dirb/largefile
156 $ cd dira
156 $ cd dira
157 $ hg cp dirb/largefile foo/largefile
157 $ hg cp dirb/largefile foo/largefile
158 $ hg ci -m "deep copy"
158 $ hg ci -m "deep copy"
159 Invoking status precommit hook
159 Invoking status precommit hook
160 A dira/foo/largefile
160 A dira/foo/largefile
161 $ find . | sort
161 $ find . | sort
162 .
162 .
163 ./dirb
163 ./dirb
164 ./dirb/largefile
164 ./dirb/largefile
165 ./foo
165 ./foo
166 ./foo/largefile
166 ./foo/largefile
167 $ hg mv foo/largefile baz/largefile
167 $ hg mv foo/largefile baz/largefile
168 $ hg ci -m "moved"
168 $ hg ci -m "moved"
169 Invoking status precommit hook
169 Invoking status precommit hook
170 A dira/baz/largefile
170 A dira/baz/largefile
171 R dira/foo/largefile
171 R dira/foo/largefile
172 $ find . | sort
172 $ find . | sort
173 .
173 .
174 ./baz
174 ./baz
175 ./baz/largefile
175 ./baz/largefile
176 ./dirb
176 ./dirb
177 ./dirb/largefile
177 ./dirb/largefile
178 ./foo
178 ./foo
179 $ cd ../../a
179 $ cd ../../a
180
180
181 #if hgweb
181 #if hgweb
182 Test display of largefiles in hgweb
182 Test display of largefiles in hgweb
183
183
184 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
184 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
185 $ cat ../hg.pid >> $DAEMON_PIDS
185 $ cat ../hg.pid >> $DAEMON_PIDS
186 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
186 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
187 200 Script output follows
187 200 Script output follows
188
188
189
189
190 drwxr-xr-x sub
190 drwxr-xr-x sub
191 -rw-r--r-- 41 large3
191 -rw-r--r-- 41 large3
192 -rw-r--r-- 9 normal3
192 -rw-r--r-- 9 normal3
193
193
194
194
195 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
195 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
196 200 Script output follows
196 200 Script output follows
197
197
198
198
199 -rw-r--r-- 41 large4
199 -rw-r--r-- 41 large4
200 -rw-r--r-- 9 normal4
200 -rw-r--r-- 9 normal4
201
201
202
202
203 $ "$TESTDIR/killdaemons.py"
203 $ "$TESTDIR/killdaemons.py"
204 #endif
204 #endif
205
205
206 Test archiving the various revisions. These hit corner cases known with
206 Test archiving the various revisions. These hit corner cases known with
207 archiving.
207 archiving.
208
208
209 $ hg archive -r 0 ../archive0
209 $ hg archive -r 0 ../archive0
210 $ hg archive -r 1 ../archive1
210 $ hg archive -r 1 ../archive1
211 $ hg archive -r 2 ../archive2
211 $ hg archive -r 2 ../archive2
212 $ hg archive -r 3 ../archive3
212 $ hg archive -r 3 ../archive3
213 $ hg archive -r 4 ../archive4
213 $ hg archive -r 4 ../archive4
214 $ cd ../archive0
214 $ cd ../archive0
215 $ cat normal1
215 $ cat normal1
216 normal1
216 normal1
217 $ cat large1
217 $ cat large1
218 large1
218 large1
219 $ cat sub/normal2
219 $ cat sub/normal2
220 normal2
220 normal2
221 $ cat sub/large2
221 $ cat sub/large2
222 large2
222 large2
223 $ cd ../archive1
223 $ cd ../archive1
224 $ cat normal1
224 $ cat normal1
225 normal11
225 normal11
226 $ cat large1
226 $ cat large1
227 large11
227 large11
228 $ cat sub/normal2
228 $ cat sub/normal2
229 normal22
229 normal22
230 $ cat sub/large2
230 $ cat sub/large2
231 large22
231 large22
232 $ cd ../archive2
232 $ cd ../archive2
233 $ ls
233 $ ls
234 sub
234 sub
235 $ cat sub/normal2
235 $ cat sub/normal2
236 normal22
236 normal22
237 $ cat sub/large2
237 $ cat sub/large2
238 large22
238 large22
239 $ cd ../archive3
239 $ cd ../archive3
240 $ cat normal1
240 $ cat normal1
241 normal22
241 normal22
242 $ cat large1
242 $ cat large1
243 large22
243 large22
244 $ cat sub/normal2
244 $ cat sub/normal2
245 normal22
245 normal22
246 $ cat sub/large2
246 $ cat sub/large2
247 large22
247 large22
248 $ cd ../archive4
248 $ cd ../archive4
249 $ cat normal3
249 $ cat normal3
250 normal22
250 normal22
251 $ cat large3
251 $ cat large3
252 large22
252 large22
253 $ cat sub/normal4
253 $ cat sub/normal4
254 normal22
254 normal22
255 $ cat sub/large4
255 $ cat sub/large4
256 large22
256 large22
257
257
258 Commit corner case: specify files to commit.
258 Commit corner case: specify files to commit.
259
259
260 $ cd ../a
260 $ cd ../a
261 $ echo normal3 > normal3
261 $ echo normal3 > normal3
262 $ echo large3 > large3
262 $ echo large3 > large3
263 $ echo normal4 > sub/normal4
263 $ echo normal4 > sub/normal4
264 $ echo large4 > sub/large4
264 $ echo large4 > sub/large4
265 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
265 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
266 Invoking status precommit hook
266 Invoking status precommit hook
267 M large3
267 M large3
268 M normal3
268 M normal3
269 M sub/large4
269 M sub/large4
270 M sub/normal4
270 M sub/normal4
271 $ cat normal3
271 $ cat normal3
272 normal3
272 normal3
273 $ cat large3
273 $ cat large3
274 large3
274 large3
275 $ cat sub/normal4
275 $ cat sub/normal4
276 normal4
276 normal4
277 $ cat sub/large4
277 $ cat sub/large4
278 large4
278 large4
279
279
280 One more commit corner case: commit from a subdirectory.
280 One more commit corner case: commit from a subdirectory.
281
281
282 $ cd ../a
282 $ cd ../a
283 $ echo normal33 > normal3
283 $ echo normal33 > normal3
284 $ echo large33 > large3
284 $ echo large33 > large3
285 $ echo normal44 > sub/normal4
285 $ echo normal44 > sub/normal4
286 $ echo large44 > sub/large4
286 $ echo large44 > sub/large4
287 $ cd sub
287 $ cd sub
288 $ hg commit -m "edit files yet again"
288 $ hg commit -m "edit files yet again"
289 Invoking status precommit hook
289 Invoking status precommit hook
290 M large3
290 M large3
291 M normal3
291 M normal3
292 M sub/large4
292 M sub/large4
293 M sub/normal4
293 M sub/normal4
294 $ cat ../normal3
294 $ cat ../normal3
295 normal33
295 normal33
296 $ cat ../large3
296 $ cat ../large3
297 large33
297 large33
298 $ cat normal4
298 $ cat normal4
299 normal44
299 normal44
300 $ cat large4
300 $ cat large4
301 large44
301 large44
302
302
303 Committing standins is not allowed.
303 Committing standins is not allowed.
304
304
305 $ cd ..
305 $ cd ..
306 $ echo large3 > large3
306 $ echo large3 > large3
307 $ hg commit .hglf/large3 -m "try to commit standin"
307 $ hg commit .hglf/large3 -m "try to commit standin"
308 abort: file ".hglf/large3" is a largefile standin
308 abort: file ".hglf/large3" is a largefile standin
309 (commit the largefile itself instead)
309 (commit the largefile itself instead)
310 [255]
310 [255]
311
311
312 Corner cases for adding largefiles.
312 Corner cases for adding largefiles.
313
313
314 $ echo large5 > large5
314 $ echo large5 > large5
315 $ hg add --large large5
315 $ hg add --large large5
316 $ hg add --large large5
316 $ hg add --large large5
317 large5 already a largefile
317 large5 already a largefile
318 $ mkdir sub2
318 $ mkdir sub2
319 $ echo large6 > sub2/large6
319 $ echo large6 > sub2/large6
320 $ echo large7 > sub2/large7
320 $ echo large7 > sub2/large7
321 $ hg add --large sub2
321 $ hg add --large sub2
322 adding sub2/large6 as a largefile (glob)
322 adding sub2/large6 as a largefile (glob)
323 adding sub2/large7 as a largefile (glob)
323 adding sub2/large7 as a largefile (glob)
324 $ hg st
324 $ hg st
325 M large3
325 M large3
326 A large5
326 A large5
327 A sub2/large6
327 A sub2/large6
328 A sub2/large7
328 A sub2/large7
329
329
330 Test "hg status" with combination of 'file pattern' and 'directory
330 Test "hg status" with combination of 'file pattern' and 'directory
331 pattern' for largefiles:
331 pattern' for largefiles:
332
332
333 $ hg status sub2/large6 sub2
333 $ hg status sub2/large6 sub2
334 A sub2/large6
334 A sub2/large6
335 A sub2/large7
335 A sub2/large7
336
336
337 Config settings (pattern **.dat, minsize 2 MB) are respected.
337 Config settings (pattern **.dat, minsize 2 MB) are respected.
338
338
339 $ echo testdata > test.dat
339 $ echo testdata > test.dat
340 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
340 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
341 $ hg add
341 $ hg add
342 adding reallylarge as a largefile
342 adding reallylarge as a largefile
343 adding test.dat as a largefile
343 adding test.dat as a largefile
344
344
345 Test that minsize and --lfsize handle float values;
345 Test that minsize and --lfsize handle float values;
346 also tests that --lfsize overrides largefiles.minsize.
346 also tests that --lfsize overrides largefiles.minsize.
347 (0.250 MB = 256 kB = 262144 B)
347 (0.250 MB = 256 kB = 262144 B)
348
348
349 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
349 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
350 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
350 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
351 $ hg --config largefiles.minsize=.25 add
351 $ hg --config largefiles.minsize=.25 add
352 adding ratherlarge as a largefile
352 adding ratherlarge as a largefile
353 adding medium
353 adding medium
354 $ hg forget medium
354 $ hg forget medium
355 $ hg --config largefiles.minsize=.25 add --lfsize=.125
355 $ hg --config largefiles.minsize=.25 add --lfsize=.125
356 adding medium as a largefile
356 adding medium as a largefile
357 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
357 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
358 $ hg --config largefiles.minsize=.25 add --lfsize=.125
358 $ hg --config largefiles.minsize=.25 add --lfsize=.125
359 adding notlarge
359 adding notlarge
360 $ hg forget notlarge
360 $ hg forget notlarge
361
361
362 Test forget on largefiles.
362 Test forget on largefiles.
363
363
364 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
364 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
365 $ hg commit -m "add/edit more largefiles"
365 $ hg commit -m "add/edit more largefiles"
366 Invoking status precommit hook
366 Invoking status precommit hook
367 A sub2/large6
367 A sub2/large6
368 A sub2/large7
368 A sub2/large7
369 R large3
369 R large3
370 ? large5
370 ? large5
371 ? medium
371 ? medium
372 ? notlarge
372 ? notlarge
373 ? ratherlarge
373 ? ratherlarge
374 ? reallylarge
374 ? reallylarge
375 ? test.dat
375 ? test.dat
376 $ hg st
376 $ hg st
377 ? large3
377 ? large3
378 ? large5
378 ? large5
379 ? medium
379 ? medium
380 ? notlarge
380 ? notlarge
381 ? ratherlarge
381 ? ratherlarge
382 ? reallylarge
382 ? reallylarge
383 ? test.dat
383 ? test.dat
384
384
385 Purge with largefiles: verify that largefiles are still in the working
385 Purge with largefiles: verify that largefiles are still in the working
386 dir after a purge.
386 dir after a purge.
387
387
388 $ hg purge --all
388 $ hg purge --all
389 $ cat sub/large4
389 $ cat sub/large4
390 large44
390 large44
391 $ cat sub2/large6
391 $ cat sub2/large6
392 large6
392 large6
393 $ cat sub2/large7
393 $ cat sub2/large7
394 large7
394 large7
395
395
396 Test addremove: verify that files that should be added as largfiles are added as
396 Test addremove: verify that files that should be added as largfiles are added as
397 such and that already-existing largfiles are not added as normal files by
397 such and that already-existing largfiles are not added as normal files by
398 accident.
398 accident.
399
399
400 $ rm normal3
400 $ rm normal3
401 $ rm sub/large4
401 $ rm sub/large4
402 $ echo "testing addremove with patterns" > testaddremove.dat
402 $ echo "testing addremove with patterns" > testaddremove.dat
403 $ echo "normaladdremove" > normaladdremove
403 $ echo "normaladdremove" > normaladdremove
404 $ hg addremove
404 $ hg addremove
405 removing sub/large4
405 removing sub/large4
406 adding testaddremove.dat as a largefile
406 adding testaddremove.dat as a largefile
407 removing normal3
407 removing normal3
408 adding normaladdremove
408 adding normaladdremove
409
409
410 Test addremove with -R
410 Test addremove with -R
411
411
412 $ hg up -C
412 $ hg up -C
413 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
413 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
414 getting changed largefiles
414 getting changed largefiles
415 1 largefiles updated, 0 removed
415 1 largefiles updated, 0 removed
416 $ rm normal3
416 $ rm normal3
417 $ rm sub/large4
417 $ rm sub/large4
418 $ echo "testing addremove with patterns" > testaddremove.dat
418 $ echo "testing addremove with patterns" > testaddremove.dat
419 $ echo "normaladdremove" > normaladdremove
419 $ echo "normaladdremove" > normaladdremove
420 $ cd ..
420 $ cd ..
421 $ hg -R a addremove
421 $ hg -R a addremove
422 removing sub/large4
422 removing sub/large4
423 adding a/testaddremove.dat as a largefile (glob)
423 adding a/testaddremove.dat as a largefile (glob)
424 removing normal3
424 removing normal3
425 adding normaladdremove
425 adding normaladdremove
426 $ cd a
426 $ cd a
427
427
428 Test 3364
428 Test 3364
429 $ hg clone . ../addrm
429 $ hg clone . ../addrm
430 updating to branch default
430 updating to branch default
431 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
431 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
432 getting changed largefiles
432 getting changed largefiles
433 3 largefiles updated, 0 removed
433 3 largefiles updated, 0 removed
434 $ cd ../addrm
434 $ cd ../addrm
435 $ cat >> .hg/hgrc <<EOF
435 $ cat >> .hg/hgrc <<EOF
436 > [hooks]
436 > [hooks]
437 > post-commit.stat=sh -c "echo \"Invoking status postcommit hook\"; hg status -A"
437 > post-commit.stat=sh -c "echo \"Invoking status postcommit hook\"; hg status -A"
438 > EOF
438 > EOF
439 $ touch foo
439 $ touch foo
440 $ hg add --large foo
440 $ hg add --large foo
441 $ hg ci -m "add foo"
441 $ hg ci -m "add foo"
442 Invoking status precommit hook
442 Invoking status precommit hook
443 A foo
443 A foo
444 Invoking status postcommit hook
444 Invoking status postcommit hook
445 C foo
445 C foo
446 C normal3
446 C normal3
447 C sub/large4
447 C sub/large4
448 C sub/normal4
448 C sub/normal4
449 C sub2/large6
449 C sub2/large6
450 C sub2/large7
450 C sub2/large7
451 $ rm foo
451 $ rm foo
452 $ hg st
452 $ hg st
453 ! foo
453 ! foo
454 hmm.. no precommit invoked, but there is a postcommit??
454 hmm.. no precommit invoked, but there is a postcommit??
455 $ hg ci -m "will not checkin"
455 $ hg ci -m "will not checkin"
456 nothing changed
456 nothing changed
457 Invoking status postcommit hook
457 Invoking status postcommit hook
458 ! foo
458 ! foo
459 C normal3
459 C normal3
460 C sub/large4
460 C sub/large4
461 C sub/normal4
461 C sub/normal4
462 C sub2/large6
462 C sub2/large6
463 C sub2/large7
463 C sub2/large7
464 [1]
464 [1]
465 $ hg addremove
465 $ hg addremove
466 removing foo
466 removing foo
467 $ hg st
467 $ hg st
468 R foo
468 R foo
469 $ hg ci -m "used to say nothing changed"
469 $ hg ci -m "used to say nothing changed"
470 Invoking status precommit hook
470 Invoking status precommit hook
471 R foo
471 R foo
472 Invoking status postcommit hook
472 Invoking status postcommit hook
473 C normal3
473 C normal3
474 C sub/large4
474 C sub/large4
475 C sub/normal4
475 C sub/normal4
476 C sub2/large6
476 C sub2/large6
477 C sub2/large7
477 C sub2/large7
478 $ hg st
478 $ hg st
479
479
480 Test 3507 (both normal files and largefiles were a problem)
480 Test 3507 (both normal files and largefiles were a problem)
481
481
482 $ touch normal
482 $ touch normal
483 $ touch large
483 $ touch large
484 $ hg add normal
484 $ hg add normal
485 $ hg add --large large
485 $ hg add --large large
486 $ hg ci -m "added"
486 $ hg ci -m "added"
487 Invoking status precommit hook
487 Invoking status precommit hook
488 A large
488 A large
489 A normal
489 A normal
490 Invoking status postcommit hook
490 Invoking status postcommit hook
491 C large
491 C large
492 C normal
492 C normal
493 C normal3
493 C normal3
494 C sub/large4
494 C sub/large4
495 C sub/normal4
495 C sub/normal4
496 C sub2/large6
496 C sub2/large6
497 C sub2/large7
497 C sub2/large7
498 $ hg remove normal
498 $ hg remove normal
499 $ hg addremove --traceback
499 $ hg addremove --traceback
500 $ hg ci -m "addremoved normal"
500 $ hg ci -m "addremoved normal"
501 Invoking status precommit hook
501 Invoking status precommit hook
502 R normal
502 R normal
503 Invoking status postcommit hook
503 Invoking status postcommit hook
504 C large
504 C large
505 C normal3
505 C normal3
506 C sub/large4
506 C sub/large4
507 C sub/normal4
507 C sub/normal4
508 C sub2/large6
508 C sub2/large6
509 C sub2/large7
509 C sub2/large7
510 $ hg up -C '.^'
510 $ hg up -C '.^'
511 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
511 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 getting changed largefiles
512 getting changed largefiles
513 0 largefiles updated, 0 removed
513 0 largefiles updated, 0 removed
514 $ hg remove large
514 $ hg remove large
515 $ hg addremove --traceback
515 $ hg addremove --traceback
516 $ hg ci -m "removed large"
516 $ hg ci -m "removed large"
517 Invoking status precommit hook
517 Invoking status precommit hook
518 R large
518 R large
519 created new head
519 created new head
520 Invoking status postcommit hook
520 Invoking status postcommit hook
521 C normal
521 C normal
522 C normal3
522 C normal3
523 C sub/large4
523 C sub/large4
524 C sub/normal4
524 C sub/normal4
525 C sub2/large6
525 C sub2/large6
526 C sub2/large7
526 C sub2/large7
527
527
528 Test that a standin can't be added as a large file
528 Test that a standin can't be added as a large file
529
529
530 $ touch large
530 $ touch large
531 $ hg add --large large
531 $ hg add --large large
532 $ hg ci -m "add"
532 $ hg ci -m "add"
533 Invoking status precommit hook
533 Invoking status precommit hook
534 A large
534 A large
535 Invoking status postcommit hook
535 Invoking status postcommit hook
536 C large
536 C large
537 C normal
537 C normal
538 C normal3
538 C normal3
539 C sub/large4
539 C sub/large4
540 C sub/normal4
540 C sub/normal4
541 C sub2/large6
541 C sub2/large6
542 C sub2/large7
542 C sub2/large7
543 $ hg remove large
543 $ hg remove large
544 $ touch large
544 $ touch large
545 $ hg addremove --config largefiles.patterns=**large --traceback
545 $ hg addremove --config largefiles.patterns=**large --traceback
546 adding large as a largefile
546 adding large as a largefile
547
547
548 Test that outgoing --large works (with revsets too)
548 Test that outgoing --large works (with revsets too)
549 $ hg outgoing --rev '.^' --large
549 $ hg outgoing --rev '.^' --large
550 comparing with $TESTTMP/a (glob)
550 comparing with $TESTTMP/a (glob)
551 searching for changes
551 searching for changes
552 changeset: 8:c02fd3b77ec4
552 changeset: 8:c02fd3b77ec4
553 user: test
553 user: test
554 date: Thu Jan 01 00:00:00 1970 +0000
554 date: Thu Jan 01 00:00:00 1970 +0000
555 summary: add foo
555 summary: add foo
556
556
557 changeset: 9:289dd08c9bbb
557 changeset: 9:289dd08c9bbb
558 user: test
558 user: test
559 date: Thu Jan 01 00:00:00 1970 +0000
559 date: Thu Jan 01 00:00:00 1970 +0000
560 summary: used to say nothing changed
560 summary: used to say nothing changed
561
561
562 changeset: 10:34f23ac6ac12
562 changeset: 10:34f23ac6ac12
563 user: test
563 user: test
564 date: Thu Jan 01 00:00:00 1970 +0000
564 date: Thu Jan 01 00:00:00 1970 +0000
565 summary: added
565 summary: added
566
566
567 changeset: 12:710c1b2f523c
567 changeset: 12:710c1b2f523c
568 parent: 10:34f23ac6ac12
568 parent: 10:34f23ac6ac12
569 user: test
569 user: test
570 date: Thu Jan 01 00:00:00 1970 +0000
570 date: Thu Jan 01 00:00:00 1970 +0000
571 summary: removed large
571 summary: removed large
572
572
573 searching for changes
573 searching for changes
574 largefiles to upload:
574 largefiles to upload:
575 large
575 large
576 foo
576 foo
577
577
578 $ cd ../a
578 $ cd ../a
579
579
580 Clone a largefiles repo.
580 Clone a largefiles repo.
581
581
582 $ hg clone . ../b
582 $ hg clone . ../b
583 updating to branch default
583 updating to branch default
584 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
584 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
585 getting changed largefiles
585 getting changed largefiles
586 3 largefiles updated, 0 removed
586 3 largefiles updated, 0 removed
587 $ cd ../b
587 $ cd ../b
588 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
588 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
589 7:daea875e9014 add/edit more largefiles
589 7:daea875e9014 add/edit more largefiles
590 6:4355d653f84f edit files yet again
590 6:4355d653f84f edit files yet again
591 5:9d5af5072dbd edit files again
591 5:9d5af5072dbd edit files again
592 4:74c02385b94c move files
592 4:74c02385b94c move files
593 3:9e8fbc4bce62 copy files
593 3:9e8fbc4bce62 copy files
594 2:51a0ae4d5864 remove files
594 2:51a0ae4d5864 remove files
595 1:ce8896473775 edit files
595 1:ce8896473775 edit files
596 0:30d30fe6a5be add files
596 0:30d30fe6a5be add files
597 $ cat normal3
597 $ cat normal3
598 normal33
598 normal33
599 $ cat sub/normal4
599 $ cat sub/normal4
600 normal44
600 normal44
601 $ cat sub/large4
601 $ cat sub/large4
602 large44
602 large44
603 $ cat sub2/large6
603 $ cat sub2/large6
604 large6
604 large6
605 $ cat sub2/large7
605 $ cat sub2/large7
606 large7
606 large7
607 $ cd ..
607 $ cd ..
608 $ hg clone a -r 3 c
608 $ hg clone a -r 3 c
609 adding changesets
609 adding changesets
610 adding manifests
610 adding manifests
611 adding file changes
611 adding file changes
612 added 4 changesets with 10 changes to 4 files
612 added 4 changesets with 10 changes to 4 files
613 updating to branch default
613 updating to branch default
614 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
614 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
615 getting changed largefiles
615 getting changed largefiles
616 2 largefiles updated, 0 removed
616 2 largefiles updated, 0 removed
617 $ cd c
617 $ cd c
618 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
618 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
619 3:9e8fbc4bce62 copy files
619 3:9e8fbc4bce62 copy files
620 2:51a0ae4d5864 remove files
620 2:51a0ae4d5864 remove files
621 1:ce8896473775 edit files
621 1:ce8896473775 edit files
622 0:30d30fe6a5be add files
622 0:30d30fe6a5be add files
623 $ cat normal1
623 $ cat normal1
624 normal22
624 normal22
625 $ cat large1
625 $ cat large1
626 large22
626 large22
627 $ cat sub/normal2
627 $ cat sub/normal2
628 normal22
628 normal22
629 $ cat sub/large2
629 $ cat sub/large2
630 large22
630 large22
631
631
632 Old revisions of a clone have correct largefiles content (this also
632 Old revisions of a clone have correct largefiles content (this also
633 tests update).
633 tests update).
634
634
635 $ hg update -r 1
635 $ hg update -r 1
636 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
636 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
637 getting changed largefiles
637 getting changed largefiles
638 1 largefiles updated, 0 removed
638 1 largefiles updated, 0 removed
639 $ cat large1
639 $ cat large1
640 large11
640 large11
641 $ cat sub/large2
641 $ cat sub/large2
642 large22
642 large22
643 $ cd ..
643 $ cd ..
644
644
645 Test cloning with --all-largefiles flag
645 Test cloning with --all-largefiles flag
646
646
647 $ rm "${USERCACHE}"/*
647 $ rm "${USERCACHE}"/*
648 $ hg clone --all-largefiles a a-backup
648 $ hg clone --all-largefiles a a-backup
649 updating to branch default
649 updating to branch default
650 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
650 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
651 getting changed largefiles
651 getting changed largefiles
652 3 largefiles updated, 0 removed
652 3 largefiles updated, 0 removed
653 8 additional largefiles cached
653 8 additional largefiles cached
654
654
655 $ hg clone --all-largefiles a ssh://localhost/a
655 $ hg clone --all-largefiles a ssh://localhost/a
656 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
656 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
657 [255]
657 [255]
658
658
659 Test pulling with --all-largefiles flag
659 Test pulling with --all-largefiles flag
660
660
661 $ rm -Rf a-backup
661 $ rm -Rf a-backup
662 $ hg clone -r 1 a a-backup
662 $ hg clone -r 1 a a-backup
663 adding changesets
663 adding changesets
664 adding manifests
664 adding manifests
665 adding file changes
665 adding file changes
666 added 2 changesets with 8 changes to 4 files
666 added 2 changesets with 8 changes to 4 files
667 updating to branch default
667 updating to branch default
668 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
668 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
669 getting changed largefiles
669 getting changed largefiles
670 2 largefiles updated, 0 removed
670 2 largefiles updated, 0 removed
671 $ rm "${USERCACHE}"/*
671 $ rm "${USERCACHE}"/*
672 $ cd a-backup
672 $ cd a-backup
673 $ hg pull --all-largefiles
673 $ hg pull --all-largefiles
674 pulling from $TESTTMP/a (glob)
674 pulling from $TESTTMP/a (glob)
675 searching for changes
675 searching for changes
676 adding changesets
676 adding changesets
677 adding manifests
677 adding manifests
678 adding file changes
678 adding file changes
679 added 6 changesets with 16 changes to 8 files
679 added 6 changesets with 16 changes to 8 files
680 (run 'hg update' to get a working copy)
680 (run 'hg update' to get a working copy)
681 caching new largefiles
681 caching new largefiles
682 3 largefiles cached
682 3 largefiles cached
683 3 additional largefiles cached
683 3 additional largefiles cached
684 $ cd ..
684 $ cd ..
685
685
686 Rebasing between two repositories does not revert largefiles to old
686 Rebasing between two repositories does not revert largefiles to old
687 revisions (this was a very bad bug that took a lot of work to fix).
687 revisions (this was a very bad bug that took a lot of work to fix).
688
688
689 $ hg clone a d
689 $ hg clone a d
690 updating to branch default
690 updating to branch default
691 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
691 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
692 getting changed largefiles
692 getting changed largefiles
693 3 largefiles updated, 0 removed
693 3 largefiles updated, 0 removed
694 $ cd b
694 $ cd b
695 $ echo large4-modified > sub/large4
695 $ echo large4-modified > sub/large4
696 $ echo normal3-modified > normal3
696 $ echo normal3-modified > normal3
697 $ hg commit -m "modify normal file and largefile in repo b"
697 $ hg commit -m "modify normal file and largefile in repo b"
698 Invoking status precommit hook
698 Invoking status precommit hook
699 M normal3
699 M normal3
700 M sub/large4
700 M sub/large4
701 $ cd ../d
701 $ cd ../d
702 $ echo large6-modified > sub2/large6
702 $ echo large6-modified > sub2/large6
703 $ echo normal4-modified > sub/normal4
703 $ echo normal4-modified > sub/normal4
704 $ hg commit -m "modify normal file largefile in repo d"
704 $ hg commit -m "modify normal file largefile in repo d"
705 Invoking status precommit hook
705 Invoking status precommit hook
706 M sub/normal4
706 M sub/normal4
707 M sub2/large6
707 M sub2/large6
708 $ cd ..
708 $ cd ..
709 $ hg clone d e
709 $ hg clone d e
710 updating to branch default
710 updating to branch default
711 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
711 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
712 getting changed largefiles
712 getting changed largefiles
713 3 largefiles updated, 0 removed
713 3 largefiles updated, 0 removed
714 $ cd d
714 $ cd d
715 $ hg pull --rebase ../b
715 $ hg pull --rebase ../b
716 pulling from ../b
716 pulling from ../b
717 searching for changes
717 searching for changes
718 adding changesets
718 adding changesets
719 adding manifests
719 adding manifests
720 adding file changes
720 adding file changes
721 added 1 changesets with 2 changes to 2 files (+1 heads)
721 added 1 changesets with 2 changes to 2 files (+1 heads)
722 Invoking status precommit hook
722 Invoking status precommit hook
723 M sub/normal4
723 M sub/normal4
724 M sub2/large6
724 M sub2/large6
725 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
725 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
726 nothing to rebase
726 nothing to rebase
727 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
727 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
728 9:598410d3eb9a modify normal file largefile in repo d
728 9:598410d3eb9a modify normal file largefile in repo d
729 8:a381d2c8c80e modify normal file and largefile in repo b
729 8:a381d2c8c80e modify normal file and largefile in repo b
730 7:daea875e9014 add/edit more largefiles
730 7:daea875e9014 add/edit more largefiles
731 6:4355d653f84f edit files yet again
731 6:4355d653f84f edit files yet again
732 5:9d5af5072dbd edit files again
732 5:9d5af5072dbd edit files again
733 4:74c02385b94c move files
733 4:74c02385b94c move files
734 3:9e8fbc4bce62 copy files
734 3:9e8fbc4bce62 copy files
735 2:51a0ae4d5864 remove files
735 2:51a0ae4d5864 remove files
736 1:ce8896473775 edit files
736 1:ce8896473775 edit files
737 0:30d30fe6a5be add files
737 0:30d30fe6a5be add files
738 $ cat normal3
738 $ cat normal3
739 normal3-modified
739 normal3-modified
740 $ cat sub/normal4
740 $ cat sub/normal4
741 normal4-modified
741 normal4-modified
742 $ cat sub/large4
742 $ cat sub/large4
743 large4-modified
743 large4-modified
744 $ cat sub2/large6
744 $ cat sub2/large6
745 large6-modified
745 large6-modified
746 $ cat sub2/large7
746 $ cat sub2/large7
747 large7
747 large7
748 $ cd ../e
748 $ cd ../e
749 $ hg pull ../b
749 $ hg pull ../b
750 pulling from ../b
750 pulling from ../b
751 searching for changes
751 searching for changes
752 adding changesets
752 adding changesets
753 adding manifests
753 adding manifests
754 adding file changes
754 adding file changes
755 added 1 changesets with 2 changes to 2 files (+1 heads)
755 added 1 changesets with 2 changes to 2 files (+1 heads)
756 (run 'hg heads' to see heads, 'hg merge' to merge)
756 (run 'hg heads' to see heads, 'hg merge' to merge)
757 caching new largefiles
757 caching new largefiles
758 0 largefiles cached
758 0 largefiles cached
759 $ hg rebase
759 $ hg rebase
760 Invoking status precommit hook
760 Invoking status precommit hook
761 M sub/normal4
761 M sub/normal4
762 M sub2/large6
762 M sub2/large6
763 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
763 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
764 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
764 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
765 9:598410d3eb9a modify normal file largefile in repo d
765 9:598410d3eb9a modify normal file largefile in repo d
766 8:a381d2c8c80e modify normal file and largefile in repo b
766 8:a381d2c8c80e modify normal file and largefile in repo b
767 7:daea875e9014 add/edit more largefiles
767 7:daea875e9014 add/edit more largefiles
768 6:4355d653f84f edit files yet again
768 6:4355d653f84f edit files yet again
769 5:9d5af5072dbd edit files again
769 5:9d5af5072dbd edit files again
770 4:74c02385b94c move files
770 4:74c02385b94c move files
771 3:9e8fbc4bce62 copy files
771 3:9e8fbc4bce62 copy files
772 2:51a0ae4d5864 remove files
772 2:51a0ae4d5864 remove files
773 1:ce8896473775 edit files
773 1:ce8896473775 edit files
774 0:30d30fe6a5be add files
774 0:30d30fe6a5be add files
775 $ cat normal3
775 $ cat normal3
776 normal3-modified
776 normal3-modified
777 $ cat sub/normal4
777 $ cat sub/normal4
778 normal4-modified
778 normal4-modified
779 $ cat sub/large4
779 $ cat sub/large4
780 large4-modified
780 large4-modified
781 $ cat sub2/large6
781 $ cat sub2/large6
782 large6-modified
782 large6-modified
783 $ cat sub2/large7
783 $ cat sub2/large7
784 large7
784 large7
785
785
786 Rollback on largefiles.
786 Rollback on largefiles.
787
787
788 $ echo large4-modified-again > sub/large4
788 $ echo large4-modified-again > sub/large4
789 $ hg commit -m "Modify large4 again"
789 $ hg commit -m "Modify large4 again"
790 Invoking status precommit hook
790 Invoking status precommit hook
791 M sub/large4
791 M sub/large4
792 $ hg rollback
792 $ hg rollback
793 repository tip rolled back to revision 9 (undo commit)
793 repository tip rolled back to revision 9 (undo commit)
794 working directory now based on revision 9
794 working directory now based on revision 9
795 $ hg st
795 $ hg st
796 M sub/large4
796 M sub/large4
797 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
797 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
798 9:598410d3eb9a modify normal file largefile in repo d
798 9:598410d3eb9a modify normal file largefile in repo d
799 8:a381d2c8c80e modify normal file and largefile in repo b
799 8:a381d2c8c80e modify normal file and largefile in repo b
800 7:daea875e9014 add/edit more largefiles
800 7:daea875e9014 add/edit more largefiles
801 6:4355d653f84f edit files yet again
801 6:4355d653f84f edit files yet again
802 5:9d5af5072dbd edit files again
802 5:9d5af5072dbd edit files again
803 4:74c02385b94c move files
803 4:74c02385b94c move files
804 3:9e8fbc4bce62 copy files
804 3:9e8fbc4bce62 copy files
805 2:51a0ae4d5864 remove files
805 2:51a0ae4d5864 remove files
806 1:ce8896473775 edit files
806 1:ce8896473775 edit files
807 0:30d30fe6a5be add files
807 0:30d30fe6a5be add files
808 $ cat sub/large4
808 $ cat sub/large4
809 large4-modified-again
809 large4-modified-again
810
810
811 "update --check" refuses to update with uncommitted changes.
811 "update --check" refuses to update with uncommitted changes.
812 $ hg update --check 8
812 $ hg update --check 8
813 abort: uncommitted local changes
813 abort: uncommitted local changes
814 [255]
814 [255]
815
815
816 "update --clean" leaves correct largefiles in working copy.
816 "update --clean" leaves correct largefiles in working copy.
817
817
818 $ hg update --clean
818 $ hg update --clean
819 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
819 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
820 getting changed largefiles
820 getting changed largefiles
821 1 largefiles updated, 0 removed
821 1 largefiles updated, 0 removed
822 $ cat normal3
822 $ cat normal3
823 normal3-modified
823 normal3-modified
824 $ cat sub/normal4
824 $ cat sub/normal4
825 normal4-modified
825 normal4-modified
826 $ cat sub/large4
826 $ cat sub/large4
827 large4-modified
827 large4-modified
828 $ cat sub2/large6
828 $ cat sub2/large6
829 large6-modified
829 large6-modified
830 $ cat sub2/large7
830 $ cat sub2/large7
831 large7
831 large7
832
832
833 Now "update check" is happy.
833 Now "update check" is happy.
834 $ hg update --check 8
834 $ hg update --check 8
835 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
835 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
836 getting changed largefiles
836 getting changed largefiles
837 1 largefiles updated, 0 removed
837 1 largefiles updated, 0 removed
838 $ hg update --check
838 $ hg update --check
839 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
839 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
840 getting changed largefiles
840 getting changed largefiles
841 1 largefiles updated, 0 removed
841 1 largefiles updated, 0 removed
842
842
843 Test removing empty largefiles directories on update
843 Test removing empty largefiles directories on update
844 $ test -d sub2 && echo "sub2 exists"
844 $ test -d sub2 && echo "sub2 exists"
845 sub2 exists
845 sub2 exists
846 $ hg update -q null
846 $ hg update -q null
847 $ test -d sub2 && echo "error: sub2 should not exist anymore"
847 $ test -d sub2 && echo "error: sub2 should not exist anymore"
848 [1]
848 [1]
849 $ hg update -q
849 $ hg update -q
850
850
851 Test hg remove removes empty largefiles directories
851 Test hg remove removes empty largefiles directories
852 $ test -d sub2 && echo "sub2 exists"
852 $ test -d sub2 && echo "sub2 exists"
853 sub2 exists
853 sub2 exists
854 $ hg remove sub2/*
854 $ hg remove sub2/*
855 $ test -d sub2 && echo "error: sub2 should not exist anymore"
855 $ test -d sub2 && echo "error: sub2 should not exist anymore"
856 [1]
856 [1]
857 $ hg revert sub2/large6 sub2/large7
857 $ hg revert sub2/large6 sub2/large7
858
858
859 "revert" works on largefiles (and normal files too).
859 "revert" works on largefiles (and normal files too).
860 $ echo hack3 >> normal3
860 $ echo hack3 >> normal3
861 $ echo hack4 >> sub/normal4
861 $ echo hack4 >> sub/normal4
862 $ echo hack4 >> sub/large4
862 $ echo hack4 >> sub/large4
863 $ rm sub2/large6
863 $ rm sub2/large6
864 $ hg revert sub2/large6
864 $ hg revert sub2/large6
865 $ hg rm sub2/large6
865 $ hg rm sub2/large6
866 $ echo new >> sub2/large8
866 $ echo new >> sub2/large8
867 $ hg add --large sub2/large8
867 $ hg add --large sub2/large8
868 # XXX we don't really want to report that we're reverting the standin;
868 # XXX we don't really want to report that we're reverting the standin;
869 # that's just an implementation detail. But I don't see an obvious fix. ;-(
869 # that's just an implementation detail. But I don't see an obvious fix. ;-(
870 $ hg revert sub
870 $ hg revert sub
871 reverting .hglf/sub/large4 (glob)
871 reverting .hglf/sub/large4 (glob)
872 reverting sub/normal4 (glob)
872 reverting sub/normal4 (glob)
873 $ hg status
873 $ hg status
874 M normal3
874 M normal3
875 A sub2/large8
875 A sub2/large8
876 R sub2/large6
876 R sub2/large6
877 ? sub/large4.orig
877 ? sub/large4.orig
878 ? sub/normal4.orig
878 ? sub/normal4.orig
879 $ cat sub/normal4
879 $ cat sub/normal4
880 normal4-modified
880 normal4-modified
881 $ cat sub/large4
881 $ cat sub/large4
882 large4-modified
882 large4-modified
883 $ hg revert -a --no-backup
883 $ hg revert -a --no-backup
884 undeleting .hglf/sub2/large6 (glob)
884 undeleting .hglf/sub2/large6 (glob)
885 forgetting .hglf/sub2/large8 (glob)
885 forgetting .hglf/sub2/large8 (glob)
886 reverting normal3
886 reverting normal3
887 $ hg status
887 $ hg status
888 ? sub/large4.orig
888 ? sub/large4.orig
889 ? sub/normal4.orig
889 ? sub/normal4.orig
890 ? sub2/large8
890 ? sub2/large8
891 $ cat normal3
891 $ cat normal3
892 normal3-modified
892 normal3-modified
893 $ cat sub2/large6
893 $ cat sub2/large6
894 large6-modified
894 large6-modified
895 $ rm sub/*.orig sub2/large8
895 $ rm sub/*.orig sub2/large8
896
896
897 revert some files to an older revision
897 revert some files to an older revision
898 $ hg revert --no-backup -r 8 sub2
898 $ hg revert --no-backup -r 8 sub2
899 reverting .hglf/sub2/large6 (glob)
899 reverting .hglf/sub2/large6 (glob)
900 $ cat sub2/large6
900 $ cat sub2/large6
901 large6
901 large6
902 $ hg revert --no-backup -C -r '.^' sub2
902 $ hg revert --no-backup -C -r '.^' sub2
903 reverting .hglf/sub2/large6 (glob)
903 reverting .hglf/sub2/large6 (glob)
904 $ hg revert --no-backup sub2
904 $ hg revert --no-backup sub2
905 reverting .hglf/sub2/large6 (glob)
905 reverting .hglf/sub2/large6 (glob)
906 $ hg status
906 $ hg status
907
907
908 "verify --large" actually verifies largefiles
908 "verify --large" actually verifies largefiles
909
909
910 $ hg verify --large
910 $ hg verify --large
911 checking changesets
911 checking changesets
912 checking manifests
912 checking manifests
913 crosschecking files in changesets and manifests
913 crosschecking files in changesets and manifests
914 checking files
914 checking files
915 10 files, 10 changesets, 28 total revisions
915 10 files, 10 changesets, 28 total revisions
916 searching 1 changesets for largefiles
916 searching 1 changesets for largefiles
917 verified existence of 3 revisions of 3 largefiles
917 verified existence of 3 revisions of 3 largefiles
918
918
919 Merging does not revert to old versions of largefiles and also check
919 Merging does not revert to old versions of largefiles and also check
920 that merging after having pulled from a non-default remote works
920 that merging after having pulled from a non-default remote works
921 correctly.
921 correctly.
922
922
923 $ cd ..
923 $ cd ..
924 $ hg clone -r 7 e temp
924 $ hg clone -r 7 e temp
925 adding changesets
925 adding changesets
926 adding manifests
926 adding manifests
927 adding file changes
927 adding file changes
928 added 8 changesets with 24 changes to 10 files
928 added 8 changesets with 24 changes to 10 files
929 updating to branch default
929 updating to branch default
930 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
930 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
931 getting changed largefiles
931 getting changed largefiles
932 3 largefiles updated, 0 removed
932 3 largefiles updated, 0 removed
933 $ hg clone temp f
933 $ hg clone temp f
934 updating to branch default
934 updating to branch default
935 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
935 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
936 getting changed largefiles
936 getting changed largefiles
937 3 largefiles updated, 0 removed
937 3 largefiles updated, 0 removed
938 # Delete the largefiles in the largefiles system cache so that we have an
938 # Delete the largefiles in the largefiles system cache so that we have an
939 # opportunity to test that caching after a pull works.
939 # opportunity to test that caching after a pull works.
940 $ rm "${USERCACHE}"/*
940 $ rm "${USERCACHE}"/*
941 $ cd f
941 $ cd f
942 $ echo "large4-merge-test" > sub/large4
942 $ echo "large4-merge-test" > sub/large4
943 $ hg commit -m "Modify large4 to test merge"
943 $ hg commit -m "Modify large4 to test merge"
944 Invoking status precommit hook
944 Invoking status precommit hook
945 M sub/large4
945 M sub/large4
946 $ hg pull ../e
946 $ hg pull ../e
947 pulling from ../e
947 pulling from ../e
948 searching for changes
948 searching for changes
949 adding changesets
949 adding changesets
950 adding manifests
950 adding manifests
951 adding file changes
951 adding file changes
952 added 2 changesets with 4 changes to 4 files (+1 heads)
952 added 2 changesets with 4 changes to 4 files (+1 heads)
953 (run 'hg heads' to see heads, 'hg merge' to merge)
953 (run 'hg heads' to see heads, 'hg merge' to merge)
954 caching new largefiles
954 caching new largefiles
955 2 largefiles cached
955 2 largefiles cached
956 $ hg merge
956 $ hg merge
957 merging sub/large4
957 merging sub/large4
958 largefile sub/large4 has a merge conflict
958 largefile sub/large4 has a merge conflict
959 keep (l)ocal or take (o)ther? l
959 keep (l)ocal or take (o)ther? l
960 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
960 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
961 (branch merge, don't forget to commit)
961 (branch merge, don't forget to commit)
962 getting changed largefiles
962 getting changed largefiles
963 1 largefiles updated, 0 removed
963 1 largefiles updated, 0 removed
964 $ hg commit -m "Merge repos e and f"
964 $ hg commit -m "Merge repos e and f"
965 Invoking status precommit hook
965 Invoking status precommit hook
966 M normal3
966 M normal3
967 M sub/normal4
967 M sub/normal4
968 M sub2/large6
968 M sub2/large6
969 $ cat normal3
969 $ cat normal3
970 normal3-modified
970 normal3-modified
971 $ cat sub/normal4
971 $ cat sub/normal4
972 normal4-modified
972 normal4-modified
973 $ cat sub/large4
973 $ cat sub/large4
974 large4-merge-test
974 large4-merge-test
975 $ cat sub2/large6
975 $ cat sub2/large6
976 large6-modified
976 large6-modified
977 $ cat sub2/large7
977 $ cat sub2/large7
978 large7
978 large7
979
979
980 Test status after merging with a branch that introduces a new largefile:
980 Test status after merging with a branch that introduces a new largefile:
981
981
982 $ echo large > large
982 $ echo large > large
983 $ hg add --large large
983 $ hg add --large large
984 $ hg commit -m 'add largefile'
984 $ hg commit -m 'add largefile'
985 Invoking status precommit hook
985 Invoking status precommit hook
986 A large
986 A large
987 $ hg update -q ".^"
987 $ hg update -q ".^"
988 $ echo change >> normal3
988 $ echo change >> normal3
989 $ hg commit -m 'some change'
989 $ hg commit -m 'some change'
990 Invoking status precommit hook
990 Invoking status precommit hook
991 M normal3
991 M normal3
992 created new head
992 created new head
993 $ hg merge
993 $ hg merge
994 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
994 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
995 (branch merge, don't forget to commit)
995 (branch merge, don't forget to commit)
996 getting changed largefiles
996 getting changed largefiles
997 1 largefiles updated, 0 removed
997 1 largefiles updated, 0 removed
998 $ hg status
998 $ hg status
999 M large
999 M large
1000
1000
1001 Test that a normal file and a largefile with the same name and path cannot
1001 Test that a normal file and a largefile with the same name and path cannot
1002 coexist.
1002 coexist.
1003
1003
1004 $ rm sub2/large7
1004 $ rm sub2/large7
1005 $ echo "largeasnormal" > sub2/large7
1005 $ echo "largeasnormal" > sub2/large7
1006 $ hg add sub2/large7
1006 $ hg add sub2/large7
1007 sub2/large7 already a largefile
1007 sub2/large7 already a largefile
1008
1008
1009 Test that transplanting a largefile change works correctly.
1009 Test that transplanting a largefile change works correctly.
1010
1010
1011 $ cd ..
1011 $ cd ..
1012 $ hg clone -r 8 d g
1012 $ hg clone -r 8 d g
1013 adding changesets
1013 adding changesets
1014 adding manifests
1014 adding manifests
1015 adding file changes
1015 adding file changes
1016 added 9 changesets with 26 changes to 10 files
1016 added 9 changesets with 26 changes to 10 files
1017 updating to branch default
1017 updating to branch default
1018 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1018 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1019 getting changed largefiles
1019 getting changed largefiles
1020 3 largefiles updated, 0 removed
1020 3 largefiles updated, 0 removed
1021 $ cd g
1021 $ cd g
1022 $ hg transplant -s ../d 598410d3eb9a
1022 $ hg transplant -s ../d 598410d3eb9a
1023 searching for changes
1023 searching for changes
1024 searching for changes
1024 searching for changes
1025 adding changesets
1025 adding changesets
1026 adding manifests
1026 adding manifests
1027 adding file changes
1027 adding file changes
1028 added 1 changesets with 2 changes to 2 files
1028 added 1 changesets with 2 changes to 2 files
1029 getting changed largefiles
1029 getting changed largefiles
1030 1 largefiles updated, 0 removed
1030 1 largefiles updated, 0 removed
1031 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1031 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1032 9:598410d3eb9a modify normal file largefile in repo d
1032 9:598410d3eb9a modify normal file largefile in repo d
1033 8:a381d2c8c80e modify normal file and largefile in repo b
1033 8:a381d2c8c80e modify normal file and largefile in repo b
1034 7:daea875e9014 add/edit more largefiles
1034 7:daea875e9014 add/edit more largefiles
1035 6:4355d653f84f edit files yet again
1035 6:4355d653f84f edit files yet again
1036 5:9d5af5072dbd edit files again
1036 5:9d5af5072dbd edit files again
1037 4:74c02385b94c move files
1037 4:74c02385b94c move files
1038 3:9e8fbc4bce62 copy files
1038 3:9e8fbc4bce62 copy files
1039 2:51a0ae4d5864 remove files
1039 2:51a0ae4d5864 remove files
1040 1:ce8896473775 edit files
1040 1:ce8896473775 edit files
1041 0:30d30fe6a5be add files
1041 0:30d30fe6a5be add files
1042 $ cat normal3
1042 $ cat normal3
1043 normal3-modified
1043 normal3-modified
1044 $ cat sub/normal4
1044 $ cat sub/normal4
1045 normal4-modified
1045 normal4-modified
1046 $ cat sub/large4
1046 $ cat sub/large4
1047 large4-modified
1047 large4-modified
1048 $ cat sub2/large6
1048 $ cat sub2/large6
1049 large6-modified
1049 large6-modified
1050 $ cat sub2/large7
1050 $ cat sub2/large7
1051 large7
1051 large7
1052
1052
1053 Cat a largefile
1053 Cat a largefile
1054 $ hg cat normal3
1054 $ hg cat normal3
1055 normal3-modified
1055 normal3-modified
1056 $ hg cat sub/large4
1056 $ hg cat sub/large4
1057 large4-modified
1057 large4-modified
1058 $ rm "${USERCACHE}"/*
1058 $ rm "${USERCACHE}"/*
1059 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1059 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1060 $ cat cat.out
1060 $ cat cat.out
1061 large4-modified
1061 large4-modified
1062 $ rm cat.out
1062 $ rm cat.out
1063 $ hg cat -r a381d2c8c80e normal3
1063 $ hg cat -r a381d2c8c80e normal3
1064 normal3-modified
1064 normal3-modified
1065 $ hg cat -r '.^' normal3
1065 $ hg cat -r '.^' normal3
1066 normal3-modified
1066 normal3-modified
1067 $ hg cat -r '.^' sub/large4
1067 $ hg cat -r '.^' sub/large4
1068 large4-modified
1068 large4-modified
1069
1069
1070 Test that renaming a largefile results in correct output for status
1070 Test that renaming a largefile results in correct output for status
1071
1071
1072 $ hg rename sub/large4 large4-renamed
1072 $ hg rename sub/large4 large4-renamed
1073 $ hg commit -m "test rename output"
1073 $ hg commit -m "test rename output"
1074 Invoking status precommit hook
1074 Invoking status precommit hook
1075 A large4-renamed
1075 A large4-renamed
1076 R sub/large4
1076 R sub/large4
1077 $ cat large4-renamed
1077 $ cat large4-renamed
1078 large4-modified
1078 large4-modified
1079 $ cd sub2
1079 $ cd sub2
1080 $ hg rename large6 large6-renamed
1080 $ hg rename large6 large6-renamed
1081 $ hg st
1081 $ hg st
1082 A sub2/large6-renamed
1082 A sub2/large6-renamed
1083 R sub2/large6
1083 R sub2/large6
1084 $ cd ..
1084 $ cd ..
1085
1085
1086 Test --normal flag
1086 Test --normal flag
1087
1087
1088 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1088 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1089 $ hg add --normal --large new-largefile
1089 $ hg add --normal --large new-largefile
1090 abort: --normal cannot be used with --large
1090 abort: --normal cannot be used with --large
1091 [255]
1091 [255]
1092 $ hg add --normal new-largefile
1092 $ hg add --normal new-largefile
1093 new-largefile: up to 69 MB of RAM may be required to manage this file
1093 new-largefile: up to 69 MB of RAM may be required to manage this file
1094 (use 'hg revert new-largefile' to cancel the pending addition)
1094 (use 'hg revert new-largefile' to cancel the pending addition)
1095 $ cd ..
1095 $ cd ..
1096
1096
1097 #if serve
1097 #if serve
1098 vanilla clients not locked out from largefiles servers on vanilla repos
1098 vanilla clients not locked out from largefiles servers on vanilla repos
1099 $ mkdir r1
1099 $ mkdir r1
1100 $ cd r1
1100 $ cd r1
1101 $ hg init
1101 $ hg init
1102 $ echo c1 > f1
1102 $ echo c1 > f1
1103 $ hg add f1
1103 $ hg add f1
1104 $ hg commit -m "m1"
1104 $ hg commit -m "m1"
1105 Invoking status precommit hook
1105 Invoking status precommit hook
1106 A f1
1106 A f1
1107 $ cd ..
1107 $ cd ..
1108 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1108 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1109 $ cat hg.pid >> $DAEMON_PIDS
1109 $ cat hg.pid >> $DAEMON_PIDS
1110 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1110 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1111 requesting all changes
1111 requesting all changes
1112 adding changesets
1112 adding changesets
1113 adding manifests
1113 adding manifests
1114 adding file changes
1114 adding file changes
1115 added 1 changesets with 1 changes to 1 files
1115 added 1 changesets with 1 changes to 1 files
1116 updating to branch default
1116 updating to branch default
1117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1117 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1118
1118
1119 largefiles clients still work with vanilla servers
1119 largefiles clients still work with vanilla servers
1120 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1120 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1121 $ cat hg.pid >> $DAEMON_PIDS
1121 $ cat hg.pid >> $DAEMON_PIDS
1122 $ hg clone http://localhost:$HGPORT1 r3
1122 $ hg clone http://localhost:$HGPORT1 r3
1123 requesting all changes
1123 requesting all changes
1124 adding changesets
1124 adding changesets
1125 adding manifests
1125 adding manifests
1126 adding file changes
1126 adding file changes
1127 added 1 changesets with 1 changes to 1 files
1127 added 1 changesets with 1 changes to 1 files
1128 updating to branch default
1128 updating to branch default
1129 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1129 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1130 #endif
1130 #endif
1131
1131
1132
1132
1133 vanilla clients locked out from largefiles http repos
1133 vanilla clients locked out from largefiles http repos
1134 $ mkdir r4
1134 $ mkdir r4
1135 $ cd r4
1135 $ cd r4
1136 $ hg init
1136 $ hg init
1137 $ echo c1 > f1
1137 $ echo c1 > f1
1138 $ hg add --large f1
1138 $ hg add --large f1
1139 $ hg commit -m "m1"
1139 $ hg commit -m "m1"
1140 Invoking status precommit hook
1140 Invoking status precommit hook
1141 A f1
1141 A f1
1142 $ cd ..
1142 $ cd ..
1143
1143
1144 #if serve
1144 #if serve
1145 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1145 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1146 $ cat hg.pid >> $DAEMON_PIDS
1146 $ cat hg.pid >> $DAEMON_PIDS
1147 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1147 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1148 abort: remote error:
1148 abort: remote error:
1149
1149
1150 This repository uses the largefiles extension.
1150 This repository uses the largefiles extension.
1151
1151
1152 Please enable it in your Mercurial config file.
1152 Please enable it in your Mercurial config file.
1153 [255]
1153 [255]
1154
1154
1155 used all HGPORTs, kill all daemons
1155 used all HGPORTs, kill all daemons
1156 $ "$TESTDIR/killdaemons.py"
1156 $ "$TESTDIR/killdaemons.py"
1157 #endif
1157 #endif
1158
1158
1159 vanilla clients locked out from largefiles ssh repos
1159 vanilla clients locked out from largefiles ssh repos
1160 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1160 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1161 abort: remote error:
1161 abort: remote error:
1162
1162
1163 This repository uses the largefiles extension.
1163 This repository uses the largefiles extension.
1164
1164
1165 Please enable it in your Mercurial config file.
1165 Please enable it in your Mercurial config file.
1166 [255]
1166 [255]
1167
1167
1168 #if serve
1168 #if serve
1169
1169
1170 largefiles clients refuse to push largefiles repos to vanilla servers
1170 largefiles clients refuse to push largefiles repos to vanilla servers
1171 $ mkdir r6
1171 $ mkdir r6
1172 $ cd r6
1172 $ cd r6
1173 $ hg init
1173 $ hg init
1174 $ echo c1 > f1
1174 $ echo c1 > f1
1175 $ hg add f1
1175 $ hg add f1
1176 $ hg commit -m "m1"
1176 $ hg commit -m "m1"
1177 Invoking status precommit hook
1177 Invoking status precommit hook
1178 A f1
1178 A f1
1179 $ cat >> .hg/hgrc <<!
1179 $ cat >> .hg/hgrc <<!
1180 > [web]
1180 > [web]
1181 > push_ssl = false
1181 > push_ssl = false
1182 > allow_push = *
1182 > allow_push = *
1183 > !
1183 > !
1184 $ cd ..
1184 $ cd ..
1185 $ hg clone r6 r7
1185 $ hg clone r6 r7
1186 updating to branch default
1186 updating to branch default
1187 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1187 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1188 $ cd r7
1188 $ cd r7
1189 $ echo c2 > f2
1189 $ echo c2 > f2
1190 $ hg add --large f2
1190 $ hg add --large f2
1191 $ hg commit -m "m2"
1191 $ hg commit -m "m2"
1192 Invoking status precommit hook
1192 Invoking status precommit hook
1193 A f2
1193 A f2
1194 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1194 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1195 $ cat ../hg.pid >> $DAEMON_PIDS
1195 $ cat ../hg.pid >> $DAEMON_PIDS
1196 $ hg push http://localhost:$HGPORT
1196 $ hg push http://localhost:$HGPORT
1197 pushing to http://localhost:$HGPORT/
1197 pushing to http://localhost:$HGPORT/
1198 searching for changes
1198 searching for changes
1199 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1199 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1200 [255]
1200 [255]
1201 $ cd ..
1201 $ cd ..
1202
1202
1203 putlfile errors are shown (issue3123)
1203 putlfile errors are shown (issue3123)
1204 Corrupt the cached largefile in r7 and in the usercache (required for testing on vfat)
1204 Corrupt the cached largefile in r7 and in the usercache (required for testing on vfat)
1205 $ echo corruption > "$TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8"
1205 $ echo corruption > "$TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8"
1206 $ echo corruption > "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1206 $ echo corruption > "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1207 $ hg init empty
1207 $ hg init empty
1208 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1208 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1209 > --config 'web.allow_push=*' --config web.push_ssl=False
1209 > --config 'web.allow_push=*' --config web.push_ssl=False
1210 $ cat hg.pid >> $DAEMON_PIDS
1210 $ cat hg.pid >> $DAEMON_PIDS
1211 $ hg push -R r7 http://localhost:$HGPORT1
1211 $ hg push -R r7 http://localhost:$HGPORT1
1212 pushing to http://localhost:$HGPORT1/
1212 pushing to http://localhost:$HGPORT1/
1213 searching for changes
1213 searching for changes
1214 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1214 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1215 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1215 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1216 [255]
1216 [255]
1217 $ rm -rf empty
1217 $ rm -rf empty
1218
1218
1219 Push a largefiles repository to a served empty repository
1219 Push a largefiles repository to a served empty repository
1220 $ hg init r8
1220 $ hg init r8
1221 $ echo c3 > r8/f1
1221 $ echo c3 > r8/f1
1222 $ hg add --large r8/f1 -R r8
1222 $ hg add --large r8/f1 -R r8
1223 $ hg commit -m "m1" -R r8
1223 $ hg commit -m "m1" -R r8
1224 Invoking status precommit hook
1224 Invoking status precommit hook
1225 A f1
1225 A f1
1226 $ hg init empty
1226 $ hg init empty
1227 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1227 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1228 > --config 'web.allow_push=*' --config web.push_ssl=False
1228 > --config 'web.allow_push=*' --config web.push_ssl=False
1229 $ cat hg.pid >> $DAEMON_PIDS
1229 $ cat hg.pid >> $DAEMON_PIDS
1230 $ rm "${USERCACHE}"/*
1230 $ rm "${USERCACHE}"/*
1231 $ hg push -R r8 http://localhost:$HGPORT2
1231 $ hg push -R r8 http://localhost:$HGPORT2
1232 pushing to http://localhost:$HGPORT2/
1232 pushing to http://localhost:$HGPORT2/
1233 searching for changes
1233 searching for changes
1234 searching for changes
1234 searching for changes
1235 remote: adding changesets
1235 remote: adding changesets
1236 remote: adding manifests
1236 remote: adding manifests
1237 remote: adding file changes
1237 remote: adding file changes
1238 remote: added 1 changesets with 1 changes to 1 files
1238 remote: added 1 changesets with 1 changes to 1 files
1239 $ rm -rf empty
1239 $ rm -rf empty
1240
1240
1241 used all HGPORTs, kill all daemons
1241 used all HGPORTs, kill all daemons
1242 $ "$TESTDIR/killdaemons.py"
1242 $ "$TESTDIR/killdaemons.py"
1243
1243
1244 #endif
1244 #endif
1245
1245
1246
1246
1247 #if unix-permissions
1247 #if unix-permissions
1248
1248
1249 Clone a local repository owned by another user
1249 Clone a local repository owned by another user
1250 We have to simulate that here by setting $HOME and removing write permissions
1250 We have to simulate that here by setting $HOME and removing write permissions
1251 $ ORIGHOME="$HOME"
1251 $ ORIGHOME="$HOME"
1252 $ mkdir alice
1252 $ mkdir alice
1253 $ HOME="`pwd`/alice"
1253 $ HOME="`pwd`/alice"
1254 $ cd alice
1254 $ cd alice
1255 $ hg init pubrepo
1255 $ hg init pubrepo
1256 $ cd pubrepo
1256 $ cd pubrepo
1257 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1257 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1258 $ hg add --large a-large-file
1258 $ hg add --large a-large-file
1259 $ hg commit -m "Add a large file"
1259 $ hg commit -m "Add a large file"
1260 Invoking status precommit hook
1260 Invoking status precommit hook
1261 A a-large-file
1261 A a-large-file
1262 $ cd ..
1262 $ cd ..
1263 $ chmod -R a-w pubrepo
1263 $ chmod -R a-w pubrepo
1264 $ cd ..
1264 $ cd ..
1265 $ mkdir bob
1265 $ mkdir bob
1266 $ HOME="`pwd`/bob"
1266 $ HOME="`pwd`/bob"
1267 $ cd bob
1267 $ cd bob
1268 $ hg clone --pull ../alice/pubrepo pubrepo
1268 $ hg clone --pull ../alice/pubrepo pubrepo
1269 requesting all changes
1269 requesting all changes
1270 adding changesets
1270 adding changesets
1271 adding manifests
1271 adding manifests
1272 adding file changes
1272 adding file changes
1273 added 1 changesets with 1 changes to 1 files
1273 added 1 changesets with 1 changes to 1 files
1274 updating to branch default
1274 updating to branch default
1275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1275 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1276 getting changed largefiles
1276 getting changed largefiles
1277 1 largefiles updated, 0 removed
1277 1 largefiles updated, 0 removed
1278 $ cd ..
1278 $ cd ..
1279 $ chmod -R u+w alice/pubrepo
1279 $ chmod -R u+w alice/pubrepo
1280 $ HOME="$ORIGHOME"
1280 $ HOME="$ORIGHOME"
1281
1281
1282 #endif
1282 #endif
1283
1283
1284 #if symlink
1284 #if symlink
1285
1285
1286 Symlink to a large largefile should behave the same as a symlink to a normal file
1286 Symlink to a large largefile should behave the same as a symlink to a normal file
1287 $ hg init largesymlink
1287 $ hg init largesymlink
1288 $ cd largesymlink
1288 $ cd largesymlink
1289 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1289 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1290 $ hg add --large largefile
1290 $ hg add --large largefile
1291 $ hg commit -m "commit a large file"
1291 $ hg commit -m "commit a large file"
1292 Invoking status precommit hook
1292 Invoking status precommit hook
1293 A largefile
1293 A largefile
1294 $ ln -s largefile largelink
1294 $ ln -s largefile largelink
1295 $ hg add largelink
1295 $ hg add largelink
1296 $ hg commit -m "commit a large symlink"
1296 $ hg commit -m "commit a large symlink"
1297 Invoking status precommit hook
1297 Invoking status precommit hook
1298 A largelink
1298 A largelink
1299 $ rm -f largelink
1299 $ rm -f largelink
1300 $ hg up >/dev/null
1300 $ hg up >/dev/null
1301 $ test -f largelink
1301 $ test -f largelink
1302 [1]
1302 [1]
1303 $ test -L largelink
1303 $ test -L largelink
1304 [1]
1304 [1]
1305 $ rm -f largelink # make next part of the test independent of the previous
1305 $ rm -f largelink # make next part of the test independent of the previous
1306 $ hg up -C >/dev/null
1306 $ hg up -C >/dev/null
1307 $ test -f largelink
1307 $ test -f largelink
1308 $ test -L largelink
1308 $ test -L largelink
1309 $ cd ..
1309 $ cd ..
1310
1310
1311 #endif
1311 #endif
1312
1312
1313 test for pattern matching on 'hg status':
1313 test for pattern matching on 'hg status':
1314 to boost performance, largefiles checks whether specified patterns are
1314 to boost performance, largefiles checks whether specified patterns are
1315 related to largefiles in working directory (NOT to STANDIN) or not.
1315 related to largefiles in working directory (NOT to STANDIN) or not.
1316
1316
1317 $ hg init statusmatch
1317 $ hg init statusmatch
1318 $ cd statusmatch
1318 $ cd statusmatch
1319
1319
1320 $ mkdir -p a/b/c/d
1320 $ mkdir -p a/b/c/d
1321 $ echo normal > a/b/c/d/e.normal.txt
1321 $ echo normal > a/b/c/d/e.normal.txt
1322 $ hg add a/b/c/d/e.normal.txt
1322 $ hg add a/b/c/d/e.normal.txt
1323 $ echo large > a/b/c/d/e.large.txt
1323 $ echo large > a/b/c/d/e.large.txt
1324 $ hg add --large a/b/c/d/e.large.txt
1324 $ hg add --large a/b/c/d/e.large.txt
1325 $ mkdir -p a/b/c/x
1325 $ mkdir -p a/b/c/x
1326 $ echo normal > a/b/c/x/y.normal.txt
1326 $ echo normal > a/b/c/x/y.normal.txt
1327 $ hg add a/b/c/x/y.normal.txt
1327 $ hg add a/b/c/x/y.normal.txt
1328 $ hg commit -m 'add files'
1328 $ hg commit -m 'add files'
1329 Invoking status precommit hook
1329 Invoking status precommit hook
1330 A a/b/c/d/e.large.txt
1330 A a/b/c/d/e.large.txt
1331 A a/b/c/d/e.normal.txt
1331 A a/b/c/d/e.normal.txt
1332 A a/b/c/x/y.normal.txt
1332 A a/b/c/x/y.normal.txt
1333
1333
1334 (1) no pattern: no performance boost
1334 (1) no pattern: no performance boost
1335 $ hg status -A
1335 $ hg status -A
1336 C a/b/c/d/e.large.txt
1336 C a/b/c/d/e.large.txt
1337 C a/b/c/d/e.normal.txt
1337 C a/b/c/d/e.normal.txt
1338 C a/b/c/x/y.normal.txt
1338 C a/b/c/x/y.normal.txt
1339
1339
1340 (2) pattern not related to largefiles: performance boost
1340 (2) pattern not related to largefiles: performance boost
1341 $ hg status -A a/b/c/x
1341 $ hg status -A a/b/c/x
1342 C a/b/c/x/y.normal.txt
1342 C a/b/c/x/y.normal.txt
1343
1343
1344 (3) pattern related to largefiles: no performance boost
1344 (3) pattern related to largefiles: no performance boost
1345 $ hg status -A a/b/c/d
1345 $ hg status -A a/b/c/d
1346 C a/b/c/d/e.large.txt
1346 C a/b/c/d/e.large.txt
1347 C a/b/c/d/e.normal.txt
1347 C a/b/c/d/e.normal.txt
1348
1348
1349 (4) pattern related to STANDIN (not to largefiles): performance boost
1349 (4) pattern related to STANDIN (not to largefiles): performance boost
1350 $ hg status -A .hglf/a
1350 $ hg status -A .hglf/a
1351 C .hglf/a/b/c/d/e.large.txt
1351 C .hglf/a/b/c/d/e.large.txt
1352
1352
1353 (5) mixed case: no performance boost
1353 (5) mixed case: no performance boost
1354 $ hg status -A a/b/c/x a/b/c/d
1354 $ hg status -A a/b/c/x a/b/c/d
1355 C a/b/c/d/e.large.txt
1355 C a/b/c/d/e.large.txt
1356 C a/b/c/d/e.normal.txt
1356 C a/b/c/d/e.normal.txt
1357 C a/b/c/x/y.normal.txt
1357 C a/b/c/x/y.normal.txt
1358
1358
1359 verify that largefiles doesn't break filesets
1359 verify that largefiles doesn't break filesets
1360
1360
1361 $ hg log --rev . --exclude "set:binary()"
1361 $ hg log --rev . --exclude "set:binary()"
1362 changeset: 0:41bd42f10efa
1362 changeset: 0:41bd42f10efa
1363 tag: tip
1363 tag: tip
1364 user: test
1364 user: test
1365 date: Thu Jan 01 00:00:00 1970 +0000
1365 date: Thu Jan 01 00:00:00 1970 +0000
1366 summary: add files
1366 summary: add files
1367
1367
1368 verify that large files in subrepos handled properly
1368 verify that large files in subrepos handled properly
1369 $ hg init subrepo
1369 $ hg init subrepo
1370 $ echo "subrepo = subrepo" > .hgsub
1370 $ echo "subrepo = subrepo" > .hgsub
1371 $ hg add .hgsub
1371 $ hg add .hgsub
1372 $ hg ci -m "add subrepo"
1372 $ hg ci -m "add subrepo"
1373 Invoking status precommit hook
1373 Invoking status precommit hook
1374 A .hgsub
1374 A .hgsub
1375 ? .hgsubstate
1375 ? .hgsubstate
1376 $ echo "rev 1" > subrepo/large.txt
1376 $ echo "rev 1" > subrepo/large.txt
1377 $ hg -R subrepo add --large subrepo/large.txt
1377 $ hg -R subrepo add --large subrepo/large.txt
1378 $ hg sum
1378 $ hg sum
1379 parent: 1:8ee150ea2e9c tip
1379 parent: 1:8ee150ea2e9c tip
1380 add subrepo
1380 add subrepo
1381 branch: default
1381 branch: default
1382 commit: 1 subrepos
1382 commit: 1 subrepos
1383 update: (current)
1383 update: (current)
1384 $ hg st
1384 $ hg st
1385 $ hg st -S
1385 $ hg st -S
1386 A subrepo/large.txt
1386 A subrepo/large.txt
1387 $ hg ci -S -m "commit top repo"
1387 $ hg ci -S -m "commit top repo"
1388 committing subrepository subrepo
1388 committing subrepository subrepo
1389 Invoking status precommit hook
1389 Invoking status precommit hook
1390 A large.txt
1390 A large.txt
1391 Invoking status precommit hook
1391 Invoking status precommit hook
1392 M .hgsubstate
1392 M .hgsubstate
1393 # No differences
1393 # No differences
1394 $ hg st -S
1394 $ hg st -S
1395 $ hg sum
1395 $ hg sum
1396 parent: 2:ce4cd0c527a6 tip
1396 parent: 2:ce4cd0c527a6 tip
1397 commit top repo
1397 commit top repo
1398 branch: default
1398 branch: default
1399 commit: (clean)
1399 commit: (clean)
1400 update: (current)
1400 update: (current)
1401 $ echo "rev 2" > subrepo/large.txt
1401 $ echo "rev 2" > subrepo/large.txt
1402 $ hg st -S
1402 $ hg st -S
1403 M subrepo/large.txt
1403 M subrepo/large.txt
1404 $ hg sum
1404 $ hg sum
1405 parent: 2:ce4cd0c527a6 tip
1405 parent: 2:ce4cd0c527a6 tip
1406 commit top repo
1406 commit top repo
1407 branch: default
1407 branch: default
1408 commit: 1 subrepos
1408 commit: 1 subrepos
1409 update: (current)
1409 update: (current)
1410 $ hg ci -m "this commit should fail without -S"
1410 $ hg ci -m "this commit should fail without -S"
1411 abort: uncommitted changes in subrepo subrepo
1411 abort: uncommitted changes in subrepo subrepo
1412 (use --subrepos for recursive commit)
1412 (use --subrepos for recursive commit)
1413 [255]
1413 [255]
1414
1414
1415 Add a normal file to the subrepo, then test archiving
1415 Add a normal file to the subrepo, then test archiving
1416
1416
1417 $ echo 'normal file' > subrepo/normal.txt
1417 $ echo 'normal file' > subrepo/normal.txt
1418 $ hg -R subrepo add subrepo/normal.txt
1418 $ hg -R subrepo add subrepo/normal.txt
1419
1419
1420 Lock in subrepo, otherwise the change isn't archived
1420 Lock in subrepo, otherwise the change isn't archived
1421
1421
1422 $ hg ci -S -m "add normal file to top level"
1422 $ hg ci -S -m "add normal file to top level"
1423 committing subrepository subrepo
1423 committing subrepository subrepo
1424 Invoking status precommit hook
1424 Invoking status precommit hook
1425 M large.txt
1425 M large.txt
1426 A normal.txt
1426 A normal.txt
1427 Invoking status precommit hook
1427 Invoking status precommit hook
1428 M .hgsubstate
1428 M .hgsubstate
1429 $ hg archive -S lf_subrepo_archive
1429 $ hg archive -S lf_subrepo_archive
1430 $ find lf_subrepo_archive | sort
1430 $ find lf_subrepo_archive | sort
1431 lf_subrepo_archive
1431 lf_subrepo_archive
1432 lf_subrepo_archive/.hg_archival.txt
1432 lf_subrepo_archive/.hg_archival.txt
1433 lf_subrepo_archive/.hgsub
1433 lf_subrepo_archive/.hgsub
1434 lf_subrepo_archive/.hgsubstate
1434 lf_subrepo_archive/.hgsubstate
1435 lf_subrepo_archive/a
1435 lf_subrepo_archive/a
1436 lf_subrepo_archive/a/b
1436 lf_subrepo_archive/a/b
1437 lf_subrepo_archive/a/b/c
1437 lf_subrepo_archive/a/b/c
1438 lf_subrepo_archive/a/b/c/d
1438 lf_subrepo_archive/a/b/c/d
1439 lf_subrepo_archive/a/b/c/d/e.large.txt
1439 lf_subrepo_archive/a/b/c/d/e.large.txt
1440 lf_subrepo_archive/a/b/c/d/e.normal.txt
1440 lf_subrepo_archive/a/b/c/d/e.normal.txt
1441 lf_subrepo_archive/a/b/c/x
1441 lf_subrepo_archive/a/b/c/x
1442 lf_subrepo_archive/a/b/c/x/y.normal.txt
1442 lf_subrepo_archive/a/b/c/x/y.normal.txt
1443 lf_subrepo_archive/subrepo
1443 lf_subrepo_archive/subrepo
1444 lf_subrepo_archive/subrepo/large.txt
1444 lf_subrepo_archive/subrepo/large.txt
1445 lf_subrepo_archive/subrepo/normal.txt
1445 lf_subrepo_archive/subrepo/normal.txt
1446
1446
1447 $ cd ..
1447 $ cd ..
@@ -1,113 +1,113 b''
1 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
2 > [extensions]
2 > [extensions]
3 > graphlog=
3 > graphlog=
4 > rebase=
4 > rebase=
5 >
5 >
6 > [phases]
6 > [phases]
7 > publish=False
7 > publish=False
8 >
8 >
9 > [alias]
9 > [alias]
10 > tglog = log -G --template "{rev}: '{desc}' bookmarks: {bookmarks}\n"
10 > tglog = log -G --template "{rev}: '{desc}' bookmarks: {bookmarks}\n"
11 > EOF
11 > EOF
12
12
13 Create a repo with several bookmarks
13 Create a repo with several bookmarks
14 $ hg init a
14 $ hg init a
15 $ cd a
15 $ cd a
16
16
17 $ echo a > a
17 $ echo a > a
18 $ hg ci -Am A
18 $ hg ci -Am A
19 adding a
19 adding a
20
20
21 $ echo b > b
21 $ echo b > b
22 $ hg ci -Am B
22 $ hg ci -Am B
23 adding b
23 adding b
24 $ hg book 'X'
24 $ hg book 'X'
25 $ hg book 'Y'
25 $ hg book 'Y'
26
26
27 $ echo c > c
27 $ echo c > c
28 $ hg ci -Am C
28 $ hg ci -Am C
29 adding c
29 adding c
30 $ hg book 'Z'
30 $ hg book 'Z'
31
31
32 $ hg up -q 0
32 $ hg up -q 0
33
33
34 $ echo d > d
34 $ echo d > d
35 $ hg ci -Am D
35 $ hg ci -Am D
36 adding d
36 adding d
37 created new head
37 created new head
38
38
39 $ hg book W
39 $ hg book W
40
40
41 $ hg tglog
41 $ hg tglog
42 @ 3: 'D' bookmarks: W
42 @ 3: 'D' bookmarks: W
43 |
43 |
44 | o 2: 'C' bookmarks: Y Z
44 | o 2: 'C' bookmarks: Y Z
45 | |
45 | |
46 | o 1: 'B' bookmarks: X
46 | o 1: 'B' bookmarks: X
47 |/
47 |/
48 o 0: 'A' bookmarks:
48 o 0: 'A' bookmarks:
49
49
50
50
51 Move only rebased bookmarks
51 Move only rebased bookmarks
52
52
53 $ cd ..
53 $ cd ..
54 $ hg clone -q a a1
54 $ hg clone -q a a1
55
55
56 $ cd a1
56 $ cd a1
57 $ hg up -q Z
57 $ hg up -q Z
58
58
59 $ hg rebase -s Y -d 3
59 $ hg rebase -s Y -d 3
60 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
60 saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
61
61
62 $ hg tglog
62 $ hg tglog
63 @ 3: 'C' bookmarks: Y Z
63 @ 3: 'C' bookmarks: Y Z
64 |
64 |
65 o 2: 'D' bookmarks: W
65 o 2: 'D' bookmarks: W
66 |
66 |
67 | o 1: 'B' bookmarks: X
67 | o 1: 'B' bookmarks: X
68 |/
68 |/
69 o 0: 'A' bookmarks:
69 o 0: 'A' bookmarks:
70
70
71 Keep bookmarks to the correct rebased changeset
71 Keep bookmarks to the correct rebased changeset
72
72
73 $ cd ..
73 $ cd ..
74 $ hg clone -q a a2
74 $ hg clone -q a a2
75
75
76 $ cd a2
76 $ cd a2
77 $ hg up -q Z
77 $ hg up -q Z
78
78
79 $ hg rebase -s 1 -d 3
79 $ hg rebase -s 1 -d 3
80 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
80 saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
81
81
82 $ hg tglog
82 $ hg tglog
83 @ 3: 'C' bookmarks: Y Z
83 @ 3: 'C' bookmarks: Y Z
84 |
84 |
85 o 2: 'B' bookmarks: X
85 o 2: 'B' bookmarks: X
86 |
86 |
87 o 1: 'D' bookmarks: W
87 o 1: 'D' bookmarks: W
88 |
88 |
89 o 0: 'A' bookmarks:
89 o 0: 'A' bookmarks:
90
90
91
91
92 Keep active bookmark on the correct changeset
92 Keep active bookmark on the correct changeset
93
93
94 $ cd ..
94 $ cd ..
95 $ hg clone -q a a3
95 $ hg clone -q a a3
96
96
97 $ cd a3
97 $ cd a3
98 $ hg up -q X
98 $ hg up -q X
99
99
100 $ hg rebase -d W
100 $ hg rebase -d W
101 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
101 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
102
102
103 $ hg tglog
103 $ hg tglog
104 @ 3: 'C' bookmarks: Y Z
104 @ 3: 'C' bookmarks: Y Z
105 |
105 |
106 o 2: 'B' bookmarks: X
106 o 2: 'B' bookmarks: X
107 |
107 |
108 o 1: 'D' bookmarks: W
108 o 1: 'D' bookmarks: W
109 |
109 |
110 o 0: 'A' bookmarks:
110 o 0: 'A' bookmarks:
111
111
112
112
113 $ cd ..
113 $ cd ..
@@ -1,264 +1,264 b''
1 Preparing the subrepository 'sub2'
1 Preparing the subrepository 'sub2'
2
2
3 $ hg init sub2
3 $ hg init sub2
4 $ echo sub2 > sub2/sub2
4 $ echo sub2 > sub2/sub2
5 $ hg add -R sub2
5 $ hg add -R sub2
6 adding sub2/sub2 (glob)
6 adding sub2/sub2 (glob)
7 $ hg commit -R sub2 -m "sub2 import"
7 $ hg commit -R sub2 -m "sub2 import"
8
8
9 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
9 Preparing the 'sub1' repo which depends on the subrepo 'sub2'
10
10
11 $ hg init sub1
11 $ hg init sub1
12 $ echo sub1 > sub1/sub1
12 $ echo sub1 > sub1/sub1
13 $ echo "sub2 = ../sub2" > sub1/.hgsub
13 $ echo "sub2 = ../sub2" > sub1/.hgsub
14 $ hg clone sub2 sub1/sub2
14 $ hg clone sub2 sub1/sub2
15 updating to branch default
15 updating to branch default
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
16 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
17 $ hg add -R sub1
17 $ hg add -R sub1
18 adding sub1/.hgsub (glob)
18 adding sub1/.hgsub (glob)
19 adding sub1/sub1 (glob)
19 adding sub1/sub1 (glob)
20 $ hg commit -R sub1 -m "sub1 import"
20 $ hg commit -R sub1 -m "sub1 import"
21
21
22 Preparing the 'main' repo which depends on the subrepo 'sub1'
22 Preparing the 'main' repo which depends on the subrepo 'sub1'
23
23
24 $ hg init main
24 $ hg init main
25 $ echo main > main/main
25 $ echo main > main/main
26 $ echo "sub1 = ../sub1" > main/.hgsub
26 $ echo "sub1 = ../sub1" > main/.hgsub
27 $ hg clone sub1 main/sub1
27 $ hg clone sub1 main/sub1
28 updating to branch default
28 updating to branch default
29 cloning subrepo sub2 from $TESTTMP/sub2
29 cloning subrepo sub2 from $TESTTMP/sub2
30 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
30 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
31 $ hg add -R main
31 $ hg add -R main
32 adding main/.hgsub (glob)
32 adding main/.hgsub (glob)
33 adding main/main (glob)
33 adding main/main (glob)
34 $ hg commit -R main -m "main import"
34 $ hg commit -R main -m "main import"
35
35
36 Cleaning both repositories, just as a clone -U
36 Cleaning both repositories, just as a clone -U
37
37
38 $ hg up -C -R sub2 null
38 $ hg up -C -R sub2 null
39 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
39 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
40 $ hg up -C -R sub1 null
40 $ hg up -C -R sub1 null
41 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
41 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
42 $ hg up -C -R main null
42 $ hg up -C -R main null
43 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
43 0 files updated, 0 files merged, 3 files removed, 0 files unresolved
44 $ rm -rf main/sub1
44 $ rm -rf main/sub1
45 $ rm -rf sub1/sub2
45 $ rm -rf sub1/sub2
46
46
47 Clone main
47 Clone main
48
48
49 $ hg clone main cloned
49 $ hg clone main cloned
50 updating to branch default
50 updating to branch default
51 cloning subrepo sub1 from $TESTTMP/sub1
51 cloning subrepo sub1 from $TESTTMP/sub1
52 cloning subrepo sub1/sub2 from $TESTTMP/sub2 (glob)
52 cloning subrepo sub1/sub2 from $TESTTMP/sub2 (glob)
53 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
54
54
55 Checking cloned repo ids
55 Checking cloned repo ids
56
56
57 $ printf "cloned " ; hg id -R cloned
57 $ printf "cloned " ; hg id -R cloned
58 cloned 7f491f53a367 tip
58 cloned 7f491f53a367 tip
59 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
59 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
60 cloned/sub1 fc3b4ce2696f tip
60 cloned/sub1 fc3b4ce2696f tip
61 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
61 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
62 cloned/sub1/sub2 c57a0840e3ba tip
62 cloned/sub1/sub2 c57a0840e3ba tip
63
63
64 debugsub output for main and sub1
64 debugsub output for main and sub1
65
65
66 $ hg debugsub -R cloned
66 $ hg debugsub -R cloned
67 path sub1
67 path sub1
68 source ../sub1
68 source ../sub1
69 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
69 revision fc3b4ce2696f7741438c79207583768f2ce6b0dd
70 $ hg debugsub -R cloned/sub1
70 $ hg debugsub -R cloned/sub1
71 path sub2
71 path sub2
72 source ../sub2
72 source ../sub2
73 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
73 revision c57a0840e3badd667ef3c3ef65471609acb2ba3c
74
74
75 Modifying deeply nested 'sub2'
75 Modifying deeply nested 'sub2'
76
76
77 $ echo modified > cloned/sub1/sub2/sub2
77 $ echo modified > cloned/sub1/sub2/sub2
78 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
78 $ hg commit --subrepos -m "deep nested modif should trigger a commit" -R cloned
79 committing subrepository sub1
79 committing subrepository sub1
80 committing subrepository sub1/sub2 (glob)
80 committing subrepository sub1/sub2 (glob)
81
81
82 Checking modified node ids
82 Checking modified node ids
83
83
84 $ printf "cloned " ; hg id -R cloned
84 $ printf "cloned " ; hg id -R cloned
85 cloned ffe6649062fe tip
85 cloned ffe6649062fe tip
86 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
86 $ printf "cloned/sub1 " ; hg id -R cloned/sub1
87 cloned/sub1 2ecb03bf44a9 tip
87 cloned/sub1 2ecb03bf44a9 tip
88 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
88 $ printf "cloned/sub1/sub2 " ; hg id -R cloned/sub1/sub2
89 cloned/sub1/sub2 53dd3430bcaf tip
89 cloned/sub1/sub2 53dd3430bcaf tip
90
90
91 debugsub output for main and sub1
91 debugsub output for main and sub1
92
92
93 $ hg debugsub -R cloned
93 $ hg debugsub -R cloned
94 path sub1
94 path sub1
95 source ../sub1
95 source ../sub1
96 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
96 revision 2ecb03bf44a94e749e8669481dd9069526ce7cb9
97 $ hg debugsub -R cloned/sub1
97 $ hg debugsub -R cloned/sub1
98 path sub2
98 path sub2
99 source ../sub2
99 source ../sub2
100 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
100 revision 53dd3430bcaf5ab4a7c48262bcad6d441f510487
101
101
102 Check that deep archiving works
102 Check that deep archiving works
103
103
104 $ cd cloned
104 $ cd cloned
105 $ echo 'test' > sub1/sub2/test.txt
105 $ echo 'test' > sub1/sub2/test.txt
106 $ hg --config extensions.largefiles=! add sub1/sub2/test.txt
106 $ hg --config extensions.largefiles=! add sub1/sub2/test.txt
107 $ mkdir sub1/sub2/folder
107 $ mkdir sub1/sub2/folder
108 $ echo 'subfolder' > sub1/sub2/folder/test.txt
108 $ echo 'subfolder' > sub1/sub2/folder/test.txt
109 $ hg --config extensions.largefiles=! add sub1/sub2/folder/test.txt
109 $ hg --config extensions.largefiles=! add sub1/sub2/folder/test.txt
110 $ hg ci -Sm "add test.txt"
110 $ hg ci -Sm "add test.txt"
111 committing subrepository sub1
111 committing subrepository sub1
112 committing subrepository sub1/sub2 (glob)
112 committing subrepository sub1/sub2 (glob)
113 $ hg --config extensions.largefiles=! archive -S ../archive_all
113 $ hg --config extensions.largefiles=! archive -S ../archive_all
114 $ find ../archive_all | sort
114 $ find ../archive_all | sort
115 ../archive_all
115 ../archive_all
116 ../archive_all/.hg_archival.txt
116 ../archive_all/.hg_archival.txt
117 ../archive_all/.hgsub
117 ../archive_all/.hgsub
118 ../archive_all/.hgsubstate
118 ../archive_all/.hgsubstate
119 ../archive_all/main
119 ../archive_all/main
120 ../archive_all/sub1
120 ../archive_all/sub1
121 ../archive_all/sub1/.hgsub
121 ../archive_all/sub1/.hgsub
122 ../archive_all/sub1/.hgsubstate
122 ../archive_all/sub1/.hgsubstate
123 ../archive_all/sub1/sub1
123 ../archive_all/sub1/sub1
124 ../archive_all/sub1/sub2
124 ../archive_all/sub1/sub2
125 ../archive_all/sub1/sub2/folder
125 ../archive_all/sub1/sub2/folder
126 ../archive_all/sub1/sub2/folder/test.txt
126 ../archive_all/sub1/sub2/folder/test.txt
127 ../archive_all/sub1/sub2/sub2
127 ../archive_all/sub1/sub2/sub2
128 ../archive_all/sub1/sub2/test.txt
128 ../archive_all/sub1/sub2/test.txt
129
129
130 Check that archive -X works in deep subrepos
130 Check that archive -X works in deep subrepos
131
131
132 $ hg --config extensions.largefiles=! archive -S -X '**test*' ../archive_exclude
132 $ hg --config extensions.largefiles=! archive -S -X '**test*' ../archive_exclude
133 $ find ../archive_exclude | sort
133 $ find ../archive_exclude | sort
134 ../archive_exclude
134 ../archive_exclude
135 ../archive_exclude/.hg_archival.txt
135 ../archive_exclude/.hg_archival.txt
136 ../archive_exclude/.hgsub
136 ../archive_exclude/.hgsub
137 ../archive_exclude/.hgsubstate
137 ../archive_exclude/.hgsubstate
138 ../archive_exclude/main
138 ../archive_exclude/main
139 ../archive_exclude/sub1
139 ../archive_exclude/sub1
140 ../archive_exclude/sub1/.hgsub
140 ../archive_exclude/sub1/.hgsub
141 ../archive_exclude/sub1/.hgsubstate
141 ../archive_exclude/sub1/.hgsubstate
142 ../archive_exclude/sub1/sub1
142 ../archive_exclude/sub1/sub1
143 ../archive_exclude/sub1/sub2
143 ../archive_exclude/sub1/sub2
144 ../archive_exclude/sub1/sub2/sub2
144 ../archive_exclude/sub1/sub2/sub2
145
145
146 $ hg --config extensions.largefiles=! archive -S -I '**test*' ../archive_include
146 $ hg --config extensions.largefiles=! archive -S -I '**test*' ../archive_include
147 $ find ../archive_include | sort
147 $ find ../archive_include | sort
148 ../archive_include
148 ../archive_include
149 ../archive_include/sub1
149 ../archive_include/sub1
150 ../archive_include/sub1/sub2
150 ../archive_include/sub1/sub2
151 ../archive_include/sub1/sub2/folder
151 ../archive_include/sub1/sub2/folder
152 ../archive_include/sub1/sub2/folder/test.txt
152 ../archive_include/sub1/sub2/folder/test.txt
153 ../archive_include/sub1/sub2/test.txt
153 ../archive_include/sub1/sub2/test.txt
154
154
155 Check that deep archive works with largefiles (which overrides hgsubrepo impl)
155 Check that deep archive works with largefiles (which overrides hgsubrepo impl)
156 This also tests the repo.ui regression in 43fb170a23bd, and that lf subrepo
156 This also tests the repo.ui regression in 43fb170a23bd, and that lf subrepo
157 subrepos are archived properly.
157 subrepos are archived properly.
158 Note that add --large through a subrepo currently adds the file as a normal file
158 Note that add --large through a subrepo currently adds the file as a normal file
159
159
160 $ echo "large" > sub1/sub2/large.bin
160 $ echo "large" > sub1/sub2/large.bin
161 $ hg --config extensions.largefiles= add --large -R sub1/sub2 sub1/sub2/large.bin
161 $ hg --config extensions.largefiles= add --large -R sub1/sub2 sub1/sub2/large.bin
162 $ echo "large" > large.bin
162 $ echo "large" > large.bin
163 $ hg --config extensions.largefiles= add --large large.bin
163 $ hg --config extensions.largefiles= add --large large.bin
164 $ hg --config extensions.largefiles= ci -S -m "add large files"
164 $ hg --config extensions.largefiles= ci -S -m "add large files"
165 committing subrepository sub1
165 committing subrepository sub1
166 committing subrepository sub1/sub2 (glob)
166 committing subrepository sub1/sub2 (glob)
167
167
168 $ hg --config extensions.largefiles= archive -S ../archive_lf
168 $ hg --config extensions.largefiles= archive -S ../archive_lf
169 $ find ../archive_lf | sort
169 $ find ../archive_lf | sort
170 ../archive_lf
170 ../archive_lf
171 ../archive_lf/.hg_archival.txt
171 ../archive_lf/.hg_archival.txt
172 ../archive_lf/.hgsub
172 ../archive_lf/.hgsub
173 ../archive_lf/.hgsubstate
173 ../archive_lf/.hgsubstate
174 ../archive_lf/large.bin
174 ../archive_lf/large.bin
175 ../archive_lf/main
175 ../archive_lf/main
176 ../archive_lf/sub1
176 ../archive_lf/sub1
177 ../archive_lf/sub1/.hgsub
177 ../archive_lf/sub1/.hgsub
178 ../archive_lf/sub1/.hgsubstate
178 ../archive_lf/sub1/.hgsubstate
179 ../archive_lf/sub1/sub1
179 ../archive_lf/sub1/sub1
180 ../archive_lf/sub1/sub2
180 ../archive_lf/sub1/sub2
181 ../archive_lf/sub1/sub2/folder
181 ../archive_lf/sub1/sub2/folder
182 ../archive_lf/sub1/sub2/folder/test.txt
182 ../archive_lf/sub1/sub2/folder/test.txt
183 ../archive_lf/sub1/sub2/large.bin
183 ../archive_lf/sub1/sub2/large.bin
184 ../archive_lf/sub1/sub2/sub2
184 ../archive_lf/sub1/sub2/sub2
185 ../archive_lf/sub1/sub2/test.txt
185 ../archive_lf/sub1/sub2/test.txt
186 $ rm -rf ../archive_lf
186 $ rm -rf ../archive_lf
187
187
188 Exclude large files from main and sub-sub repo
188 Exclude large files from main and sub-sub repo
189
189
190 $ hg --config extensions.largefiles= archive -S -X '**.bin' ../archive_lf
190 $ hg --config extensions.largefiles= archive -S -X '**.bin' ../archive_lf
191 $ find ../archive_lf | sort
191 $ find ../archive_lf | sort
192 ../archive_lf
192 ../archive_lf
193 ../archive_lf/.hg_archival.txt
193 ../archive_lf/.hg_archival.txt
194 ../archive_lf/.hgsub
194 ../archive_lf/.hgsub
195 ../archive_lf/.hgsubstate
195 ../archive_lf/.hgsubstate
196 ../archive_lf/main
196 ../archive_lf/main
197 ../archive_lf/sub1
197 ../archive_lf/sub1
198 ../archive_lf/sub1/.hgsub
198 ../archive_lf/sub1/.hgsub
199 ../archive_lf/sub1/.hgsubstate
199 ../archive_lf/sub1/.hgsubstate
200 ../archive_lf/sub1/sub1
200 ../archive_lf/sub1/sub1
201 ../archive_lf/sub1/sub2
201 ../archive_lf/sub1/sub2
202 ../archive_lf/sub1/sub2/folder
202 ../archive_lf/sub1/sub2/folder
203 ../archive_lf/sub1/sub2/folder/test.txt
203 ../archive_lf/sub1/sub2/folder/test.txt
204 ../archive_lf/sub1/sub2/sub2
204 ../archive_lf/sub1/sub2/sub2
205 ../archive_lf/sub1/sub2/test.txt
205 ../archive_lf/sub1/sub2/test.txt
206 $ rm -rf ../archive_lf
206 $ rm -rf ../archive_lf
207
207
208 Exclude normal files from main and sub-sub repo
208 Exclude normal files from main and sub-sub repo
209
209
210 $ hg --config extensions.largefiles= archive -S -X '**.txt' ../archive_lf
210 $ hg --config extensions.largefiles= archive -S -X '**.txt' ../archive_lf
211 $ find ../archive_lf | sort
211 $ find ../archive_lf | sort
212 ../archive_lf
212 ../archive_lf
213 ../archive_lf/.hgsub
213 ../archive_lf/.hgsub
214 ../archive_lf/.hgsubstate
214 ../archive_lf/.hgsubstate
215 ../archive_lf/large.bin
215 ../archive_lf/large.bin
216 ../archive_lf/main
216 ../archive_lf/main
217 ../archive_lf/sub1
217 ../archive_lf/sub1
218 ../archive_lf/sub1/.hgsub
218 ../archive_lf/sub1/.hgsub
219 ../archive_lf/sub1/.hgsubstate
219 ../archive_lf/sub1/.hgsubstate
220 ../archive_lf/sub1/sub1
220 ../archive_lf/sub1/sub1
221 ../archive_lf/sub1/sub2
221 ../archive_lf/sub1/sub2
222 ../archive_lf/sub1/sub2/large.bin
222 ../archive_lf/sub1/sub2/large.bin
223 ../archive_lf/sub1/sub2/sub2
223 ../archive_lf/sub1/sub2/sub2
224 $ rm -rf ../archive_lf
224 $ rm -rf ../archive_lf
225
225
226 Include normal files from within a largefiles subrepo
226 Include normal files from within a largefiles subrepo
227
227
228 $ hg --config extensions.largefiles= archive -S -I '**.txt' ../archive_lf
228 $ hg --config extensions.largefiles= archive -S -I '**.txt' ../archive_lf
229 $ find ../archive_lf | sort
229 $ find ../archive_lf | sort
230 ../archive_lf
230 ../archive_lf
231 ../archive_lf/.hg_archival.txt
231 ../archive_lf/.hg_archival.txt
232 ../archive_lf/sub1
232 ../archive_lf/sub1
233 ../archive_lf/sub1/sub2
233 ../archive_lf/sub1/sub2
234 ../archive_lf/sub1/sub2/folder
234 ../archive_lf/sub1/sub2/folder
235 ../archive_lf/sub1/sub2/folder/test.txt
235 ../archive_lf/sub1/sub2/folder/test.txt
236 ../archive_lf/sub1/sub2/test.txt
236 ../archive_lf/sub1/sub2/test.txt
237 $ rm -rf ../archive_lf
237 $ rm -rf ../archive_lf
238
238
239 Include large files from within a largefiles subrepo
239 Include large files from within a largefiles subrepo
240
240
241 $ hg --config extensions.largefiles= archive -S -I '**.bin' ../archive_lf
241 $ hg --config extensions.largefiles= archive -S -I '**.bin' ../archive_lf
242 $ find ../archive_lf | sort
242 $ find ../archive_lf | sort
243 ../archive_lf
243 ../archive_lf
244 ../archive_lf/large.bin
244 ../archive_lf/large.bin
245 ../archive_lf/sub1
245 ../archive_lf/sub1
246 ../archive_lf/sub1/sub2
246 ../archive_lf/sub1/sub2
247 ../archive_lf/sub1/sub2/large.bin
247 ../archive_lf/sub1/sub2/large.bin
248 $ rm -rf ../archive_lf
248 $ rm -rf ../archive_lf
249
249
250 Find an exact largefile match in a largefiles subrepo
250 Find an exact largefile match in a largefiles subrepo
251
251
252 $ hg --config extensions.largefiles= archive -S -I 'sub1/sub2/large.bin' ../archive_lf
252 $ hg --config extensions.largefiles= archive -S -I 'sub1/sub2/large.bin' ../archive_lf
253 $ find ../archive_lf | sort
253 $ find ../archive_lf | sort
254 ../archive_lf
254 ../archive_lf
255 ../archive_lf/sub1
255 ../archive_lf/sub1
256 ../archive_lf/sub1/sub2
256 ../archive_lf/sub1/sub2
257 ../archive_lf/sub1/sub2/large.bin
257 ../archive_lf/sub1/sub2/large.bin
258 $ rm -rf ../archive_lf
258 $ rm -rf ../archive_lf
259
259
260 Find an exact match to a standin (should archive nothing)
260 Find an exact match to a standin (should archive nothing)
261 $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
261 $ hg --config extensions.largefiles= archive -S -I 'sub/sub2/.hglf/large.bin' ../archive_lf
262 $ find ../archive_lf 2> /dev/null | sort
262 $ find ../archive_lf 2> /dev/null | sort
263
263
264 $ cd ..
264 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now