##// END OF EJS Templates
tests: convert some hghave unix-permissions to #if
Mads Kiilerich -
r16986:79902f7e default
parent child Browse files
Show More
@@ -1,395 +1,398 b''
1 $ "$TESTDIR/hghave" unix-permissions || exit 80
2
3 $ cat >> $HGRCPATH <<EOF
1 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
2 > [extensions]
5 > convert=
3 > convert=
6 > [convert]
4 > [convert]
7 > hg.saverev=False
5 > hg.saverev=False
8 > EOF
6 > EOF
9 $ hg help convert
7 $ hg help convert
10 hg convert [OPTION]... SOURCE [DEST [REVMAP]]
8 hg convert [OPTION]... SOURCE [DEST [REVMAP]]
11
9
12 convert a foreign SCM repository to a Mercurial one.
10 convert a foreign SCM repository to a Mercurial one.
13
11
14 Accepted source formats [identifiers]:
12 Accepted source formats [identifiers]:
15
13
16 - Mercurial [hg]
14 - Mercurial [hg]
17 - CVS [cvs]
15 - CVS [cvs]
18 - Darcs [darcs]
16 - Darcs [darcs]
19 - git [git]
17 - git [git]
20 - Subversion [svn]
18 - Subversion [svn]
21 - Monotone [mtn]
19 - Monotone [mtn]
22 - GNU Arch [gnuarch]
20 - GNU Arch [gnuarch]
23 - Bazaar [bzr]
21 - Bazaar [bzr]
24 - Perforce [p4]
22 - Perforce [p4]
25
23
26 Accepted destination formats [identifiers]:
24 Accepted destination formats [identifiers]:
27
25
28 - Mercurial [hg]
26 - Mercurial [hg]
29 - Subversion [svn] (history on branches is not preserved)
27 - Subversion [svn] (history on branches is not preserved)
30
28
31 If no revision is given, all revisions will be converted. Otherwise,
29 If no revision is given, all revisions will be converted. Otherwise,
32 convert will only import up to the named revision (given in a format
30 convert will only import up to the named revision (given in a format
33 understood by the source).
31 understood by the source).
34
32
35 If no destination directory name is specified, it defaults to the basename
33 If no destination directory name is specified, it defaults to the basename
36 of the source with "-hg" appended. If the destination repository doesn't
34 of the source with "-hg" appended. If the destination repository doesn't
37 exist, it will be created.
35 exist, it will be created.
38
36
39 By default, all sources except Mercurial will use --branchsort. Mercurial
37 By default, all sources except Mercurial will use --branchsort. Mercurial
40 uses --sourcesort to preserve original revision numbers order. Sort modes
38 uses --sourcesort to preserve original revision numbers order. Sort modes
41 have the following effects:
39 have the following effects:
42
40
43 --branchsort convert from parent to child revision when possible, which
41 --branchsort convert from parent to child revision when possible, which
44 means branches are usually converted one after the other.
42 means branches are usually converted one after the other.
45 It generates more compact repositories.
43 It generates more compact repositories.
46 --datesort sort revisions by date. Converted repositories have good-
44 --datesort sort revisions by date. Converted repositories have good-
47 looking changelogs but are often an order of magnitude
45 looking changelogs but are often an order of magnitude
48 larger than the same ones generated by --branchsort.
46 larger than the same ones generated by --branchsort.
49 --sourcesort try to preserve source revisions order, only supported by
47 --sourcesort try to preserve source revisions order, only supported by
50 Mercurial sources.
48 Mercurial sources.
51
49
52 If "REVMAP" isn't given, it will be put in a default location
50 If "REVMAP" isn't given, it will be put in a default location
53 ("<dest>/.hg/shamap" by default). The "REVMAP" is a simple text file that
51 ("<dest>/.hg/shamap" by default). The "REVMAP" is a simple text file that
54 maps each source commit ID to the destination ID for that revision, like
52 maps each source commit ID to the destination ID for that revision, like
55 so:
53 so:
56
54
57 <source ID> <destination ID>
55 <source ID> <destination ID>
58
56
59 If the file doesn't exist, it's automatically created. It's updated on
57 If the file doesn't exist, it's automatically created. It's updated on
60 each commit copied, so "hg convert" can be interrupted and can be run
58 each commit copied, so "hg convert" can be interrupted and can be run
61 repeatedly to copy new commits.
59 repeatedly to copy new commits.
62
60
63 The authormap is a simple text file that maps each source commit author to
61 The authormap is a simple text file that maps each source commit author to
64 a destination commit author. It is handy for source SCMs that use unix
62 a destination commit author. It is handy for source SCMs that use unix
65 logins to identify authors (eg: CVS). One line per author mapping and the
63 logins to identify authors (eg: CVS). One line per author mapping and the
66 line format is:
64 line format is:
67
65
68 source author = destination author
66 source author = destination author
69
67
70 Empty lines and lines starting with a "#" are ignored.
68 Empty lines and lines starting with a "#" are ignored.
71
69
72 The filemap is a file that allows filtering and remapping of files and
70 The filemap is a file that allows filtering and remapping of files and
73 directories. Each line can contain one of the following directives:
71 directories. Each line can contain one of the following directives:
74
72
75 include path/to/file-or-dir
73 include path/to/file-or-dir
76
74
77 exclude path/to/file-or-dir
75 exclude path/to/file-or-dir
78
76
79 rename path/to/source path/to/destination
77 rename path/to/source path/to/destination
80
78
81 Comment lines start with "#". A specified path matches if it equals the
79 Comment lines start with "#". A specified path matches if it equals the
82 full relative name of a file or one of its parent directories. The
80 full relative name of a file or one of its parent directories. The
83 "include" or "exclude" directive with the longest matching path applies,
81 "include" or "exclude" directive with the longest matching path applies,
84 so line order does not matter.
82 so line order does not matter.
85
83
86 The "include" directive causes a file, or all files under a directory, to
84 The "include" directive causes a file, or all files under a directory, to
87 be included in the destination repository, and the exclusion of all other
85 be included in the destination repository, and the exclusion of all other
88 files and directories not explicitly included. The "exclude" directive
86 files and directories not explicitly included. The "exclude" directive
89 causes files or directories to be omitted. The "rename" directive renames
87 causes files or directories to be omitted. The "rename" directive renames
90 a file or directory if it is converted. To rename from a subdirectory into
88 a file or directory if it is converted. To rename from a subdirectory into
91 the root of the repository, use "." as the path to rename to.
89 the root of the repository, use "." as the path to rename to.
92
90
93 The splicemap is a file that allows insertion of synthetic history,
91 The splicemap is a file that allows insertion of synthetic history,
94 letting you specify the parents of a revision. This is useful if you want
92 letting you specify the parents of a revision. This is useful if you want
95 to e.g. give a Subversion merge two parents, or graft two disconnected
93 to e.g. give a Subversion merge two parents, or graft two disconnected
96 series of history together. Each entry contains a key, followed by a
94 series of history together. Each entry contains a key, followed by a
97 space, followed by one or two comma-separated values:
95 space, followed by one or two comma-separated values:
98
96
99 key parent1, parent2
97 key parent1, parent2
100
98
101 The key is the revision ID in the source revision control system whose
99 The key is the revision ID in the source revision control system whose
102 parents should be modified (same format as a key in .hg/shamap). The
100 parents should be modified (same format as a key in .hg/shamap). The
103 values are the revision IDs (in either the source or destination revision
101 values are the revision IDs (in either the source or destination revision
104 control system) that should be used as the new parents for that node. For
102 control system) that should be used as the new parents for that node. For
105 example, if you have merged "release-1.0" into "trunk", then you should
103 example, if you have merged "release-1.0" into "trunk", then you should
106 specify the revision on "trunk" as the first parent and the one on the
104 specify the revision on "trunk" as the first parent and the one on the
107 "release-1.0" branch as the second.
105 "release-1.0" branch as the second.
108
106
109 The branchmap is a file that allows you to rename a branch when it is
107 The branchmap is a file that allows you to rename a branch when it is
110 being brought in from whatever external repository. When used in
108 being brought in from whatever external repository. When used in
111 conjunction with a splicemap, it allows for a powerful combination to help
109 conjunction with a splicemap, it allows for a powerful combination to help
112 fix even the most badly mismanaged repositories and turn them into nicely
110 fix even the most badly mismanaged repositories and turn them into nicely
113 structured Mercurial repositories. The branchmap contains lines of the
111 structured Mercurial repositories. The branchmap contains lines of the
114 form:
112 form:
115
113
116 original_branch_name new_branch_name
114 original_branch_name new_branch_name
117
115
118 where "original_branch_name" is the name of the branch in the source
116 where "original_branch_name" is the name of the branch in the source
119 repository, and "new_branch_name" is the name of the branch is the
117 repository, and "new_branch_name" is the name of the branch is the
120 destination repository. No whitespace is allowed in the branch names. This
118 destination repository. No whitespace is allowed in the branch names. This
121 can be used to (for instance) move code in one repository from "default"
119 can be used to (for instance) move code in one repository from "default"
122 to a named branch.
120 to a named branch.
123
121
124 Mercurial Source
122 Mercurial Source
125 ''''''''''''''''
123 ''''''''''''''''
126
124
127 The Mercurial source recognizes the following configuration options, which
125 The Mercurial source recognizes the following configuration options, which
128 you can set on the command line with "--config":
126 you can set on the command line with "--config":
129
127
130 convert.hg.ignoreerrors
128 convert.hg.ignoreerrors
131 ignore integrity errors when reading. Use it to fix
129 ignore integrity errors when reading. Use it to fix
132 Mercurial repositories with missing revlogs, by converting
130 Mercurial repositories with missing revlogs, by converting
133 from and to Mercurial. Default is False.
131 from and to Mercurial. Default is False.
134 convert.hg.saverev
132 convert.hg.saverev
135 store original revision ID in changeset (forces target IDs
133 store original revision ID in changeset (forces target IDs
136 to change). It takes a boolean argument and defaults to
134 to change). It takes a boolean argument and defaults to
137 False.
135 False.
138 convert.hg.startrev
136 convert.hg.startrev
139 convert start revision and its descendants. It takes a hg
137 convert start revision and its descendants. It takes a hg
140 revision identifier and defaults to 0.
138 revision identifier and defaults to 0.
141
139
142 CVS Source
140 CVS Source
143 ''''''''''
141 ''''''''''
144
142
145 CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
143 CVS source will use a sandbox (i.e. a checked-out copy) from CVS to
146 indicate the starting point of what will be converted. Direct access to
144 indicate the starting point of what will be converted. Direct access to
147 the repository files is not needed, unless of course the repository is
145 the repository files is not needed, unless of course the repository is
148 ":local:". The conversion uses the top level directory in the sandbox to
146 ":local:". The conversion uses the top level directory in the sandbox to
149 find the CVS repository, and then uses CVS rlog commands to find files to
147 find the CVS repository, and then uses CVS rlog commands to find files to
150 convert. This means that unless a filemap is given, all files under the
148 convert. This means that unless a filemap is given, all files under the
151 starting directory will be converted, and that any directory
149 starting directory will be converted, and that any directory
152 reorganization in the CVS sandbox is ignored.
150 reorganization in the CVS sandbox is ignored.
153
151
154 The following options can be used with "--config":
152 The following options can be used with "--config":
155
153
156 convert.cvsps.cache
154 convert.cvsps.cache
157 Set to False to disable remote log caching, for testing and
155 Set to False to disable remote log caching, for testing and
158 debugging purposes. Default is True.
156 debugging purposes. Default is True.
159 convert.cvsps.fuzz
157 convert.cvsps.fuzz
160 Specify the maximum time (in seconds) that is allowed
158 Specify the maximum time (in seconds) that is allowed
161 between commits with identical user and log message in a
159 between commits with identical user and log message in a
162 single changeset. When very large files were checked in as
160 single changeset. When very large files were checked in as
163 part of a changeset then the default may not be long enough.
161 part of a changeset then the default may not be long enough.
164 The default is 60.
162 The default is 60.
165 convert.cvsps.mergeto
163 convert.cvsps.mergeto
166 Specify a regular expression to which commit log messages
164 Specify a regular expression to which commit log messages
167 are matched. If a match occurs, then the conversion process
165 are matched. If a match occurs, then the conversion process
168 will insert a dummy revision merging the branch on which
166 will insert a dummy revision merging the branch on which
169 this log message occurs to the branch indicated in the
167 this log message occurs to the branch indicated in the
170 regex. Default is "{{mergetobranch ([-\w]+)}}"
168 regex. Default is "{{mergetobranch ([-\w]+)}}"
171 convert.cvsps.mergefrom
169 convert.cvsps.mergefrom
172 Specify a regular expression to which commit log messages
170 Specify a regular expression to which commit log messages
173 are matched. If a match occurs, then the conversion process
171 are matched. If a match occurs, then the conversion process
174 will add the most recent revision on the branch indicated in
172 will add the most recent revision on the branch indicated in
175 the regex as the second parent of the changeset. Default is
173 the regex as the second parent of the changeset. Default is
176 "{{mergefrombranch ([-\w]+)}}"
174 "{{mergefrombranch ([-\w]+)}}"
177 hook.cvslog Specify a Python function to be called at the end of
175 hook.cvslog Specify a Python function to be called at the end of
178 gathering the CVS log. The function is passed a list with
176 gathering the CVS log. The function is passed a list with
179 the log entries, and can modify the entries in-place, or add
177 the log entries, and can modify the entries in-place, or add
180 or delete them.
178 or delete them.
181 hook.cvschangesets
179 hook.cvschangesets
182 Specify a Python function to be called after the changesets
180 Specify a Python function to be called after the changesets
183 are calculated from the the CVS log. The function is passed
181 are calculated from the the CVS log. The function is passed
184 a list with the changeset entries, and can modify the
182 a list with the changeset entries, and can modify the
185 changesets in-place, or add or delete them.
183 changesets in-place, or add or delete them.
186
184
187 An additional "debugcvsps" Mercurial command allows the builtin changeset
185 An additional "debugcvsps" Mercurial command allows the builtin changeset
188 merging code to be run without doing a conversion. Its parameters and
186 merging code to be run without doing a conversion. Its parameters and
189 output are similar to that of cvsps 2.1. Please see the command help for
187 output are similar to that of cvsps 2.1. Please see the command help for
190 more details.
188 more details.
191
189
192 Subversion Source
190 Subversion Source
193 '''''''''''''''''
191 '''''''''''''''''
194
192
195 Subversion source detects classical trunk/branches/tags layouts. By
193 Subversion source detects classical trunk/branches/tags layouts. By
196 default, the supplied "svn://repo/path/" source URL is converted as a
194 default, the supplied "svn://repo/path/" source URL is converted as a
197 single branch. If "svn://repo/path/trunk" exists it replaces the default
195 single branch. If "svn://repo/path/trunk" exists it replaces the default
198 branch. If "svn://repo/path/branches" exists, its subdirectories are
196 branch. If "svn://repo/path/branches" exists, its subdirectories are
199 listed as possible branches. If "svn://repo/path/tags" exists, it is
197 listed as possible branches. If "svn://repo/path/tags" exists, it is
200 looked for tags referencing converted branches. Default "trunk",
198 looked for tags referencing converted branches. Default "trunk",
201 "branches" and "tags" values can be overridden with following options. Set
199 "branches" and "tags" values can be overridden with following options. Set
202 them to paths relative to the source URL, or leave them blank to disable
200 them to paths relative to the source URL, or leave them blank to disable
203 auto detection.
201 auto detection.
204
202
205 The following options can be set with "--config":
203 The following options can be set with "--config":
206
204
207 convert.svn.branches
205 convert.svn.branches
208 specify the directory containing branches. The default is
206 specify the directory containing branches. The default is
209 "branches".
207 "branches".
210 convert.svn.tags
208 convert.svn.tags
211 specify the directory containing tags. The default is
209 specify the directory containing tags. The default is
212 "tags".
210 "tags".
213 convert.svn.trunk
211 convert.svn.trunk
214 specify the name of the trunk branch. The default is
212 specify the name of the trunk branch. The default is
215 "trunk".
213 "trunk".
216
214
217 Source history can be retrieved starting at a specific revision, instead
215 Source history can be retrieved starting at a specific revision, instead
218 of being integrally converted. Only single branch conversions are
216 of being integrally converted. Only single branch conversions are
219 supported.
217 supported.
220
218
221 convert.svn.startrev
219 convert.svn.startrev
222 specify start Subversion revision number. The default is 0.
220 specify start Subversion revision number. The default is 0.
223
221
224 Perforce Source
222 Perforce Source
225 '''''''''''''''
223 '''''''''''''''
226
224
227 The Perforce (P4) importer can be given a p4 depot path or a client
225 The Perforce (P4) importer can be given a p4 depot path or a client
228 specification as source. It will convert all files in the source to a flat
226 specification as source. It will convert all files in the source to a flat
229 Mercurial repository, ignoring labels, branches and integrations. Note
227 Mercurial repository, ignoring labels, branches and integrations. Note
230 that when a depot path is given you then usually should specify a target
228 that when a depot path is given you then usually should specify a target
231 directory, because otherwise the target may be named "...-hg".
229 directory, because otherwise the target may be named "...-hg".
232
230
233 It is possible to limit the amount of source history to be converted by
231 It is possible to limit the amount of source history to be converted by
234 specifying an initial Perforce revision:
232 specifying an initial Perforce revision:
235
233
236 convert.p4.startrev
234 convert.p4.startrev
237 specify initial Perforce revision (a Perforce changelist
235 specify initial Perforce revision (a Perforce changelist
238 number).
236 number).
239
237
240 Mercurial Destination
238 Mercurial Destination
241 '''''''''''''''''''''
239 '''''''''''''''''''''
242
240
243 The following options are supported:
241 The following options are supported:
244
242
245 convert.hg.clonebranches
243 convert.hg.clonebranches
246 dispatch source branches in separate clones. The default is
244 dispatch source branches in separate clones. The default is
247 False.
245 False.
248 convert.hg.tagsbranch
246 convert.hg.tagsbranch
249 branch name for tag revisions, defaults to "default".
247 branch name for tag revisions, defaults to "default".
250 convert.hg.usebranchnames
248 convert.hg.usebranchnames
251 preserve branch names. The default is True.
249 preserve branch names. The default is True.
252
250
253 options:
251 options:
254
252
255 -s --source-type TYPE source repository type
253 -s --source-type TYPE source repository type
256 -d --dest-type TYPE destination repository type
254 -d --dest-type TYPE destination repository type
257 -r --rev REV import up to target revision REV
255 -r --rev REV import up to target revision REV
258 -A --authormap FILE remap usernames using this file
256 -A --authormap FILE remap usernames using this file
259 --filemap FILE remap file names using contents of file
257 --filemap FILE remap file names using contents of file
260 --splicemap FILE splice synthesized history into place
258 --splicemap FILE splice synthesized history into place
261 --branchmap FILE change branch names while converting
259 --branchmap FILE change branch names while converting
262 --branchsort try to sort changesets by branches
260 --branchsort try to sort changesets by branches
263 --datesort try to sort changesets by date
261 --datesort try to sort changesets by date
264 --sourcesort preserve source changesets order
262 --sourcesort preserve source changesets order
265
263
266 use "hg -v help convert" to show more info
264 use "hg -v help convert" to show more info
267 $ hg init a
265 $ hg init a
268 $ cd a
266 $ cd a
269 $ echo a > a
267 $ echo a > a
270 $ hg ci -d'0 0' -Ama
268 $ hg ci -d'0 0' -Ama
271 adding a
269 adding a
272 $ hg cp a b
270 $ hg cp a b
273 $ hg ci -d'1 0' -mb
271 $ hg ci -d'1 0' -mb
274 $ hg rm a
272 $ hg rm a
275 $ hg ci -d'2 0' -mc
273 $ hg ci -d'2 0' -mc
276 $ hg mv b a
274 $ hg mv b a
277 $ hg ci -d'3 0' -md
275 $ hg ci -d'3 0' -md
278 $ echo a >> a
276 $ echo a >> a
279 $ hg ci -d'4 0' -me
277 $ hg ci -d'4 0' -me
280 $ cd ..
278 $ cd ..
281 $ hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded'
279 $ hg convert a 2>&1 | grep -v 'subversion python bindings could not be loaded'
282 assuming destination a-hg
280 assuming destination a-hg
283 initializing destination a-hg repository
281 initializing destination a-hg repository
284 scanning source...
282 scanning source...
285 sorting...
283 sorting...
286 converting...
284 converting...
287 4 a
285 4 a
288 3 b
286 3 b
289 2 c
287 2 c
290 1 d
288 1 d
291 0 e
289 0 e
292 $ hg --cwd a-hg pull ../a
290 $ hg --cwd a-hg pull ../a
293 pulling from ../a
291 pulling from ../a
294 searching for changes
292 searching for changes
295 no changes found
293 no changes found
296 $ touch bogusfile
297
294
298 should fail
295 conversion to existing file should fail
299
296
297 $ touch bogusfile
300 $ hg convert a bogusfile
298 $ hg convert a bogusfile
301 initializing destination bogusfile repository
299 initializing destination bogusfile repository
302 abort: cannot create new bundle repository
300 abort: cannot create new bundle repository
303 [255]
301 [255]
302
303 #if unix-permissions
304
305 conversion to dir without permissions should fail
306
304 $ mkdir bogusdir
307 $ mkdir bogusdir
305 $ chmod 000 bogusdir
308 $ chmod 000 bogusdir
306
309
307 should fail
308
309 $ hg convert a bogusdir
310 $ hg convert a bogusdir
310 abort: Permission denied: bogusdir
311 abort: Permission denied: bogusdir
311 [255]
312 [255]
312
313
313 should succeed
314 user permissions should succeed
314
315
315 $ chmod 700 bogusdir
316 $ chmod 700 bogusdir
316 $ hg convert a bogusdir
317 $ hg convert a bogusdir
317 initializing destination bogusdir repository
318 initializing destination bogusdir repository
318 scanning source...
319 scanning source...
319 sorting...
320 sorting...
320 converting...
321 converting...
321 4 a
322 4 a
322 3 b
323 3 b
323 2 c
324 2 c
324 1 d
325 1 d
325 0 e
326 0 e
326
327
328 #endif
329
327 test pre and post conversion actions
330 test pre and post conversion actions
328
331
329 $ echo 'include b' > filemap
332 $ echo 'include b' > filemap
330 $ hg convert --debug --filemap filemap a partialb | \
333 $ hg convert --debug --filemap filemap a partialb | \
331 > grep 'run hg'
334 > grep 'run hg'
332 run hg source pre-conversion action
335 run hg source pre-conversion action
333 run hg sink pre-conversion action
336 run hg sink pre-conversion action
334 run hg sink post-conversion action
337 run hg sink post-conversion action
335 run hg source post-conversion action
338 run hg source post-conversion action
336
339
337 converting empty dir should fail "nicely
340 converting empty dir should fail "nicely
338
341
339 $ mkdir emptydir
342 $ mkdir emptydir
340
343
341 override $PATH to ensure p4 not visible; use $PYTHON in case we're
344 override $PATH to ensure p4 not visible; use $PYTHON in case we're
342 running from a devel copy, not a temp installation
345 running from a devel copy, not a temp installation
343
346
344 $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg convert emptydir
347 $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg convert emptydir
345 assuming destination emptydir-hg
348 assuming destination emptydir-hg
346 initializing destination emptydir-hg repository
349 initializing destination emptydir-hg repository
347 emptydir does not look like a CVS checkout
350 emptydir does not look like a CVS checkout
348 emptydir does not look like a Git repository
351 emptydir does not look like a Git repository
349 emptydir does not look like a Subversion repository
352 emptydir does not look like a Subversion repository
350 emptydir is not a local Mercurial repository
353 emptydir is not a local Mercurial repository
351 emptydir does not look like a darcs repository
354 emptydir does not look like a darcs repository
352 emptydir does not look like a monotone repository
355 emptydir does not look like a monotone repository
353 emptydir does not look like a GNU Arch repository
356 emptydir does not look like a GNU Arch repository
354 emptydir does not look like a Bazaar repository
357 emptydir does not look like a Bazaar repository
355 cannot find required "p4" tool
358 cannot find required "p4" tool
356 abort: emptydir: missing or unsupported repository
359 abort: emptydir: missing or unsupported repository
357 [255]
360 [255]
358
361
359 convert with imaginary source type
362 convert with imaginary source type
360
363
361 $ hg convert --source-type foo a a-foo
364 $ hg convert --source-type foo a a-foo
362 initializing destination a-foo repository
365 initializing destination a-foo repository
363 abort: foo: invalid source repository type
366 abort: foo: invalid source repository type
364 [255]
367 [255]
365
368
366 convert with imaginary sink type
369 convert with imaginary sink type
367
370
368 $ hg convert --dest-type foo a a-foo
371 $ hg convert --dest-type foo a a-foo
369 abort: foo: invalid destination repository type
372 abort: foo: invalid destination repository type
370 [255]
373 [255]
371
374
372 testing: convert must not produce duplicate entries in fncache
375 testing: convert must not produce duplicate entries in fncache
373
376
374 $ hg convert a b
377 $ hg convert a b
375 initializing destination b repository
378 initializing destination b repository
376 scanning source...
379 scanning source...
377 sorting...
380 sorting...
378 converting...
381 converting...
379 4 a
382 4 a
380 3 b
383 3 b
381 2 c
384 2 c
382 1 d
385 1 d
383 0 e
386 0 e
384
387
385 contents of fncache file:
388 contents of fncache file:
386
389
387 $ cat b/.hg/store/fncache | sort
390 $ cat b/.hg/store/fncache | sort
388 data/a.i
391 data/a.i
389 data/b.i
392 data/b.i
390
393
391 test bogus URL
394 test bogus URL
392
395
393 $ hg convert -q bzr+ssh://foobar@selenic.com/baz baz
396 $ hg convert -q bzr+ssh://foobar@selenic.com/baz baz
394 abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository
397 abort: bzr+ssh://foobar@selenic.com/baz: missing or unsupported repository
395 [255]
398 [255]
@@ -1,525 +1,528 b''
1 $ "$TESTDIR/hghave" unix-permissions || exit 80
2
3 Test EOL extension
1 Test EOL extension
4
2
5 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
6 > [diff]
4 > [diff]
7 > git = True
5 > git = True
8 > EOF
6 > EOF
9
7
10 Set up helpers
8 Set up helpers
11
9
12 $ cat > switch-eol.py <<EOF
10 $ cat > switch-eol.py <<EOF
13 > import sys
11 > import sys
14 > try:
12 > try:
15 > import os, msvcrt
13 > import os, msvcrt
16 > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
14 > msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
17 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
15 > msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
18 > except ImportError:
16 > except ImportError:
19 > pass
17 > pass
20 > (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n')
18 > (old, new) = sys.argv[1] == 'LF' and ('\n', '\r\n') or ('\r\n', '\n')
21 > print "%% switching encoding from %r to %r" % (old, new)
19 > print "%% switching encoding from %r to %r" % (old, new)
22 > for path in sys.argv[2:]:
20 > for path in sys.argv[2:]:
23 > data = file(path, 'rb').read()
21 > data = file(path, 'rb').read()
24 > data = data.replace(old, new)
22 > data = data.replace(old, new)
25 > file(path, 'wb').write(data)
23 > file(path, 'wb').write(data)
26 > EOF
24 > EOF
27
25
28 $ seteol () {
26 $ seteol () {
29 > if [ $1 = "LF" ]; then
27 > if [ $1 = "LF" ]; then
30 > EOL='\n'
28 > EOL='\n'
31 > else
29 > else
32 > EOL='\r\n'
30 > EOL='\r\n'
33 > fi
31 > fi
34 > }
32 > }
35
33
36 $ makerepo () {
34 $ makerepo () {
37 > seteol $1
35 > seteol $1
38 > echo "% setup $1 repository"
36 > echo "% setup $1 repository"
39 > hg init repo
37 > hg init repo
40 > cd repo
38 > cd repo
41 > cat > .hgeol <<EOF
39 > cat > .hgeol <<EOF
42 > [repository]
40 > [repository]
43 > native = $1
41 > native = $1
44 > [patterns]
42 > [patterns]
45 > mixed.txt = BIN
43 > mixed.txt = BIN
46 > **.txt = native
44 > **.txt = native
47 > EOF
45 > EOF
48 > printf "first${EOL}second${EOL}third${EOL}" > a.txt
46 > printf "first${EOL}second${EOL}third${EOL}" > a.txt
49 > hg commit --addremove -m 'checkin'
47 > hg commit --addremove -m 'checkin'
50 > echo
48 > echo
51 > cd ..
49 > cd ..
52 > }
50 > }
53
51
54 $ dotest () {
52 $ dotest () {
55 > seteol $1
53 > seteol $1
56 > echo "% hg clone repo repo-$1"
54 > echo "% hg clone repo repo-$1"
57 > hg clone --noupdate repo repo-$1
55 > hg clone --noupdate repo repo-$1
58 > cd repo-$1
56 > cd repo-$1
59 > cat > .hg/hgrc <<EOF
57 > cat > .hg/hgrc <<EOF
60 > [extensions]
58 > [extensions]
61 > eol =
59 > eol =
62 > [eol]
60 > [eol]
63 > native = $1
61 > native = $1
64 > EOF
62 > EOF
65 > hg update
63 > hg update
66 > echo '% a.txt'
64 > echo '% a.txt'
67 > cat a.txt
65 > cat a.txt
68 > echo '% hg cat a.txt'
66 > echo '% hg cat a.txt'
69 > hg cat a.txt
67 > hg cat a.txt
70 > printf "fourth${EOL}" >> a.txt
68 > printf "fourth${EOL}" >> a.txt
71 > echo '% a.txt'
69 > echo '% a.txt'
72 > cat a.txt
70 > cat a.txt
73 > hg diff
71 > hg diff
74 > python ../switch-eol.py $1 a.txt
72 > python ../switch-eol.py $1 a.txt
75 > echo '% hg diff only reports a single changed line:'
73 > echo '% hg diff only reports a single changed line:'
76 > hg diff
74 > hg diff
77 > echo "% reverting back to $1 format"
75 > echo "% reverting back to $1 format"
78 > hg revert a.txt
76 > hg revert a.txt
79 > cat a.txt
77 > cat a.txt
80 > printf "first\r\nsecond\n" > mixed.txt
78 > printf "first\r\nsecond\n" > mixed.txt
81 > hg add mixed.txt
79 > hg add mixed.txt
82 > echo "% hg commit of inconsistent .txt file marked as binary (should work)"
80 > echo "% hg commit of inconsistent .txt file marked as binary (should work)"
83 > hg commit -m 'binary file'
81 > hg commit -m 'binary file'
84 > echo "% hg commit of inconsistent .txt file marked as native (should fail)"
82 > echo "% hg commit of inconsistent .txt file marked as native (should fail)"
85 > printf "first\nsecond\r\nthird\nfourth\r\n" > a.txt
83 > printf "first\nsecond\r\nthird\nfourth\r\n" > a.txt
86 > hg commit -m 'inconsistent file'
84 > hg commit -m 'inconsistent file'
87 > echo "% hg commit --config eol.only-consistent=False (should work)"
85 > echo "% hg commit --config eol.only-consistent=False (should work)"
88 > hg commit --config eol.only-consistent=False -m 'inconsistent file'
86 > hg commit --config eol.only-consistent=False -m 'inconsistent file'
89 > echo "% hg commit of binary .txt file marked as native (binary files always okay)"
87 > echo "% hg commit of binary .txt file marked as native (binary files always okay)"
90 > printf "first${EOL}\0${EOL}third${EOL}" > a.txt
88 > printf "first${EOL}\0${EOL}third${EOL}" > a.txt
91 > hg commit -m 'binary file'
89 > hg commit -m 'binary file'
92 > cd ..
90 > cd ..
93 > rm -r repo-$1
91 > rm -r repo-$1
94 > }
92 > }
95
93
96 $ makemixedrepo () {
94 $ makemixedrepo () {
97 > echo
95 > echo
98 > echo "# setup $1 repository"
96 > echo "# setup $1 repository"
99 > hg init mixed
97 > hg init mixed
100 > cd mixed
98 > cd mixed
101 > printf "foo\r\nbar\r\nbaz\r\n" > win.txt
99 > printf "foo\r\nbar\r\nbaz\r\n" > win.txt
102 > printf "foo\nbar\nbaz\n" > unix.txt
100 > printf "foo\nbar\nbaz\n" > unix.txt
103 > #printf "foo\r\nbar\nbaz\r\n" > mixed.txt
101 > #printf "foo\r\nbar\nbaz\r\n" > mixed.txt
104 > hg commit --addremove -m 'created mixed files'
102 > hg commit --addremove -m 'created mixed files'
105 > echo "# setting repository-native EOLs to $1"
103 > echo "# setting repository-native EOLs to $1"
106 > cat > .hgeol <<EOF
104 > cat > .hgeol <<EOF
107 > [repository]
105 > [repository]
108 > native = $1
106 > native = $1
109 > [patterns]
107 > [patterns]
110 > **.txt = native
108 > **.txt = native
111 > EOF
109 > EOF
112 > hg commit --addremove -m 'added .hgeol'
110 > hg commit --addremove -m 'added .hgeol'
113 > cd ..
111 > cd ..
114 > }
112 > }
115
113
116 $ testmixed () {
114 $ testmixed () {
117 > echo
115 > echo
118 > echo "% hg clone mixed mixed-$1"
116 > echo "% hg clone mixed mixed-$1"
119 > hg clone mixed mixed-$1
117 > hg clone mixed mixed-$1
120 > cd mixed-$1
118 > cd mixed-$1
121 > echo '% hg status (eol extension not yet activated)'
119 > echo '% hg status (eol extension not yet activated)'
122 > hg status
120 > hg status
123 > cat > .hg/hgrc <<EOF
121 > cat > .hg/hgrc <<EOF
124 > [extensions]
122 > [extensions]
125 > eol =
123 > eol =
126 > [eol]
124 > [eol]
127 > native = $1
125 > native = $1
128 > EOF
126 > EOF
129 > echo '% hg status (eol activated)'
127 > echo '% hg status (eol activated)'
130 > hg status
128 > hg status
131 > echo '% hg commit'
129 > echo '% hg commit'
132 > hg commit -m 'synchronized EOLs'
130 > hg commit -m 'synchronized EOLs'
133 > echo '% hg status'
131 > echo '% hg status'
134 > hg status
132 > hg status
135 > cd ..
133 > cd ..
136 > rm -r mixed-$1
134 > rm -r mixed-$1
137 > }
135 > }
138
136
139 Basic tests
137 Basic tests
140
138
141 $ makerepo LF
139 $ makerepo LF
142 % setup LF repository
140 % setup LF repository
143 adding .hgeol
141 adding .hgeol
144 adding a.txt
142 adding a.txt
145
143
146 $ dotest LF
144 $ dotest LF
147 % hg clone repo repo-LF
145 % hg clone repo repo-LF
148 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
146 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
149 % a.txt
147 % a.txt
150 first
148 first
151 second
149 second
152 third
150 third
153 % hg cat a.txt
151 % hg cat a.txt
154 first
152 first
155 second
153 second
156 third
154 third
157 % a.txt
155 % a.txt
158 first
156 first
159 second
157 second
160 third
158 third
161 fourth
159 fourth
162 diff --git a/a.txt b/a.txt
160 diff --git a/a.txt b/a.txt
163 --- a/a.txt
161 --- a/a.txt
164 +++ b/a.txt
162 +++ b/a.txt
165 @@ -1,3 +1,4 @@
163 @@ -1,3 +1,4 @@
166 first
164 first
167 second
165 second
168 third
166 third
169 +fourth
167 +fourth
170 % switching encoding from '\n' to '\r\n'
168 % switching encoding from '\n' to '\r\n'
171 % hg diff only reports a single changed line:
169 % hg diff only reports a single changed line:
172 diff --git a/a.txt b/a.txt
170 diff --git a/a.txt b/a.txt
173 --- a/a.txt
171 --- a/a.txt
174 +++ b/a.txt
172 +++ b/a.txt
175 @@ -1,3 +1,4 @@
173 @@ -1,3 +1,4 @@
176 first
174 first
177 second
175 second
178 third
176 third
179 +fourth
177 +fourth
180 % reverting back to LF format
178 % reverting back to LF format
181 first
179 first
182 second
180 second
183 third
181 third
184 % hg commit of inconsistent .txt file marked as binary (should work)
182 % hg commit of inconsistent .txt file marked as binary (should work)
185 % hg commit of inconsistent .txt file marked as native (should fail)
183 % hg commit of inconsistent .txt file marked as native (should fail)
186 abort: inconsistent newline style in a.txt
184 abort: inconsistent newline style in a.txt
187
185
188 % hg commit --config eol.only-consistent=False (should work)
186 % hg commit --config eol.only-consistent=False (should work)
189 % hg commit of binary .txt file marked as native (binary files always okay)
187 % hg commit of binary .txt file marked as native (binary files always okay)
190 $ dotest CRLF
188 $ dotest CRLF
191 % hg clone repo repo-CRLF
189 % hg clone repo repo-CRLF
192 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 % a.txt
191 % a.txt
194 first\r (esc)
192 first\r (esc)
195 second\r (esc)
193 second\r (esc)
196 third\r (esc)
194 third\r (esc)
197 % hg cat a.txt
195 % hg cat a.txt
198 first
196 first
199 second
197 second
200 third
198 third
201 % a.txt
199 % a.txt
202 first\r (esc)
200 first\r (esc)
203 second\r (esc)
201 second\r (esc)
204 third\r (esc)
202 third\r (esc)
205 fourth\r (esc)
203 fourth\r (esc)
206 diff --git a/a.txt b/a.txt
204 diff --git a/a.txt b/a.txt
207 --- a/a.txt
205 --- a/a.txt
208 +++ b/a.txt
206 +++ b/a.txt
209 @@ -1,3 +1,4 @@
207 @@ -1,3 +1,4 @@
210 first
208 first
211 second
209 second
212 third
210 third
213 +fourth
211 +fourth
214 % switching encoding from '\r\n' to '\n'
212 % switching encoding from '\r\n' to '\n'
215 % hg diff only reports a single changed line:
213 % hg diff only reports a single changed line:
216 diff --git a/a.txt b/a.txt
214 diff --git a/a.txt b/a.txt
217 --- a/a.txt
215 --- a/a.txt
218 +++ b/a.txt
216 +++ b/a.txt
219 @@ -1,3 +1,4 @@
217 @@ -1,3 +1,4 @@
220 first
218 first
221 second
219 second
222 third
220 third
223 +fourth
221 +fourth
224 % reverting back to CRLF format
222 % reverting back to CRLF format
225 first\r (esc)
223 first\r (esc)
226 second\r (esc)
224 second\r (esc)
227 third\r (esc)
225 third\r (esc)
228 % hg commit of inconsistent .txt file marked as binary (should work)
226 % hg commit of inconsistent .txt file marked as binary (should work)
229 % hg commit of inconsistent .txt file marked as native (should fail)
227 % hg commit of inconsistent .txt file marked as native (should fail)
230 abort: inconsistent newline style in a.txt
228 abort: inconsistent newline style in a.txt
231
229
232 % hg commit --config eol.only-consistent=False (should work)
230 % hg commit --config eol.only-consistent=False (should work)
233 % hg commit of binary .txt file marked as native (binary files always okay)
231 % hg commit of binary .txt file marked as native (binary files always okay)
234 $ rm -r repo
232 $ rm -r repo
235 $ makerepo CRLF
233 $ makerepo CRLF
236 % setup CRLF repository
234 % setup CRLF repository
237 adding .hgeol
235 adding .hgeol
238 adding a.txt
236 adding a.txt
239
237
240 $ dotest LF
238 $ dotest LF
241 % hg clone repo repo-LF
239 % hg clone repo repo-LF
242 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
240 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
243 % a.txt
241 % a.txt
244 first
242 first
245 second
243 second
246 third
244 third
247 % hg cat a.txt
245 % hg cat a.txt
248 first\r (esc)
246 first\r (esc)
249 second\r (esc)
247 second\r (esc)
250 third\r (esc)
248 third\r (esc)
251 % a.txt
249 % a.txt
252 first
250 first
253 second
251 second
254 third
252 third
255 fourth
253 fourth
256 diff --git a/a.txt b/a.txt
254 diff --git a/a.txt b/a.txt
257 --- a/a.txt
255 --- a/a.txt
258 +++ b/a.txt
256 +++ b/a.txt
259 @@ -1,3 +1,4 @@
257 @@ -1,3 +1,4 @@
260 first\r (esc)
258 first\r (esc)
261 second\r (esc)
259 second\r (esc)
262 third\r (esc)
260 third\r (esc)
263 +fourth\r (esc)
261 +fourth\r (esc)
264 % switching encoding from '\n' to '\r\n'
262 % switching encoding from '\n' to '\r\n'
265 % hg diff only reports a single changed line:
263 % hg diff only reports a single changed line:
266 diff --git a/a.txt b/a.txt
264 diff --git a/a.txt b/a.txt
267 --- a/a.txt
265 --- a/a.txt
268 +++ b/a.txt
266 +++ b/a.txt
269 @@ -1,3 +1,4 @@
267 @@ -1,3 +1,4 @@
270 first\r (esc)
268 first\r (esc)
271 second\r (esc)
269 second\r (esc)
272 third\r (esc)
270 third\r (esc)
273 +fourth\r (esc)
271 +fourth\r (esc)
274 % reverting back to LF format
272 % reverting back to LF format
275 first
273 first
276 second
274 second
277 third
275 third
278 % hg commit of inconsistent .txt file marked as binary (should work)
276 % hg commit of inconsistent .txt file marked as binary (should work)
279 % hg commit of inconsistent .txt file marked as native (should fail)
277 % hg commit of inconsistent .txt file marked as native (should fail)
280 abort: inconsistent newline style in a.txt
278 abort: inconsistent newline style in a.txt
281
279
282 % hg commit --config eol.only-consistent=False (should work)
280 % hg commit --config eol.only-consistent=False (should work)
283 % hg commit of binary .txt file marked as native (binary files always okay)
281 % hg commit of binary .txt file marked as native (binary files always okay)
284 $ dotest CRLF
282 $ dotest CRLF
285 % hg clone repo repo-CRLF
283 % hg clone repo repo-CRLF
286 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
284 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
287 % a.txt
285 % a.txt
288 first\r (esc)
286 first\r (esc)
289 second\r (esc)
287 second\r (esc)
290 third\r (esc)
288 third\r (esc)
291 % hg cat a.txt
289 % hg cat a.txt
292 first\r (esc)
290 first\r (esc)
293 second\r (esc)
291 second\r (esc)
294 third\r (esc)
292 third\r (esc)
295 % a.txt
293 % a.txt
296 first\r (esc)
294 first\r (esc)
297 second\r (esc)
295 second\r (esc)
298 third\r (esc)
296 third\r (esc)
299 fourth\r (esc)
297 fourth\r (esc)
300 diff --git a/a.txt b/a.txt
298 diff --git a/a.txt b/a.txt
301 --- a/a.txt
299 --- a/a.txt
302 +++ b/a.txt
300 +++ b/a.txt
303 @@ -1,3 +1,4 @@
301 @@ -1,3 +1,4 @@
304 first\r (esc)
302 first\r (esc)
305 second\r (esc)
303 second\r (esc)
306 third\r (esc)
304 third\r (esc)
307 +fourth\r (esc)
305 +fourth\r (esc)
308 % switching encoding from '\r\n' to '\n'
306 % switching encoding from '\r\n' to '\n'
309 % hg diff only reports a single changed line:
307 % hg diff only reports a single changed line:
310 diff --git a/a.txt b/a.txt
308 diff --git a/a.txt b/a.txt
311 --- a/a.txt
309 --- a/a.txt
312 +++ b/a.txt
310 +++ b/a.txt
313 @@ -1,3 +1,4 @@
311 @@ -1,3 +1,4 @@
314 first\r (esc)
312 first\r (esc)
315 second\r (esc)
313 second\r (esc)
316 third\r (esc)
314 third\r (esc)
317 +fourth\r (esc)
315 +fourth\r (esc)
318 % reverting back to CRLF format
316 % reverting back to CRLF format
319 first\r (esc)
317 first\r (esc)
320 second\r (esc)
318 second\r (esc)
321 third\r (esc)
319 third\r (esc)
322 % hg commit of inconsistent .txt file marked as binary (should work)
320 % hg commit of inconsistent .txt file marked as binary (should work)
323 % hg commit of inconsistent .txt file marked as native (should fail)
321 % hg commit of inconsistent .txt file marked as native (should fail)
324 abort: inconsistent newline style in a.txt
322 abort: inconsistent newline style in a.txt
325
323
326 % hg commit --config eol.only-consistent=False (should work)
324 % hg commit --config eol.only-consistent=False (should work)
327 % hg commit of binary .txt file marked as native (binary files always okay)
325 % hg commit of binary .txt file marked as native (binary files always okay)
328 $ rm -r repo
326 $ rm -r repo
329
327
330 Mixed tests
328 Mixed tests
331
329
332 $ makemixedrepo LF
330 $ makemixedrepo LF
333
331
334 # setup LF repository
332 # setup LF repository
335 adding unix.txt
333 adding unix.txt
336 adding win.txt
334 adding win.txt
337 # setting repository-native EOLs to LF
335 # setting repository-native EOLs to LF
338 adding .hgeol
336 adding .hgeol
339 $ testmixed LF
337 $ testmixed LF
340
338
341 % hg clone mixed mixed-LF
339 % hg clone mixed mixed-LF
342 updating to branch default
340 updating to branch default
343 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
341 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
344 % hg status (eol extension not yet activated)
342 % hg status (eol extension not yet activated)
345 % hg status (eol activated)
343 % hg status (eol activated)
346 M win.txt
344 M win.txt
347 % hg commit
345 % hg commit
348 % hg status
346 % hg status
349 $ testmixed CRLF
347 $ testmixed CRLF
350
348
351 % hg clone mixed mixed-CRLF
349 % hg clone mixed mixed-CRLF
352 updating to branch default
350 updating to branch default
353 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
351 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
354 % hg status (eol extension not yet activated)
352 % hg status (eol extension not yet activated)
355 % hg status (eol activated)
353 % hg status (eol activated)
356 M win.txt
354 M win.txt
357 % hg commit
355 % hg commit
358 % hg status
356 % hg status
359 $ rm -r mixed
357 $ rm -r mixed
360 $ makemixedrepo CRLF
358 $ makemixedrepo CRLF
361
359
362 # setup CRLF repository
360 # setup CRLF repository
363 adding unix.txt
361 adding unix.txt
364 adding win.txt
362 adding win.txt
365 # setting repository-native EOLs to CRLF
363 # setting repository-native EOLs to CRLF
366 adding .hgeol
364 adding .hgeol
367 $ testmixed LF
365 $ testmixed LF
368
366
369 % hg clone mixed mixed-LF
367 % hg clone mixed mixed-LF
370 updating to branch default
368 updating to branch default
371 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
369 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
372 % hg status (eol extension not yet activated)
370 % hg status (eol extension not yet activated)
373 % hg status (eol activated)
371 % hg status (eol activated)
374 M unix.txt
372 M unix.txt
375 % hg commit
373 % hg commit
376 % hg status
374 % hg status
377 $ testmixed CRLF
375 $ testmixed CRLF
378
376
379 % hg clone mixed mixed-CRLF
377 % hg clone mixed mixed-CRLF
380 updating to branch default
378 updating to branch default
381 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
379 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
382 % hg status (eol extension not yet activated)
380 % hg status (eol extension not yet activated)
383 % hg status (eol activated)
381 % hg status (eol activated)
384 M unix.txt
382 M unix.txt
385 % hg commit
383 % hg commit
386 % hg status
384 % hg status
387 $ rm -r mixed
385 $ rm -r mixed
388
386
387 $ echo '[extensions]' >> $HGRCPATH
388 $ echo 'eol =' >> $HGRCPATH
389
390 #if unix-permissions
391
389 Test issue2569 -- eol extension takes write lock on reading:
392 Test issue2569 -- eol extension takes write lock on reading:
390
393
391 $ echo '[extensions]' >> $HGRCPATH
392 $ echo 'eol =' >> $HGRCPATH
393 $ hg init repo
394 $ hg init repo
394 $ cd repo
395 $ cd repo
395 $ touch .hgeol
396 $ touch .hgeol
396 $ hg status
397 $ hg status
397 ? .hgeol
398 ? .hgeol
398 $ chmod -R -w .hg
399 $ chmod -R -w .hg
399 $ sleep 1
400 $ sleep 1
400 $ touch .hgeol
401 $ touch .hgeol
401 $ hg status --traceback
402 $ hg status --traceback
402 ? .hgeol
403 ? .hgeol
403 $ chmod -R u+w .hg
404 $ chmod -R u+w .hg
404 $ cd ..
405 $ cd ..
405
406
407 #endif
408
406 Test cleverencode: and cleverdecode: aliases for win32text extension
409 Test cleverencode: and cleverdecode: aliases for win32text extension
407
410
408 $ echo '[encode]' >> $HGRCPATH
411 $ echo '[encode]' >> $HGRCPATH
409 $ echo '**.txt = cleverencode:' >> $HGRCPATH
412 $ echo '**.txt = cleverencode:' >> $HGRCPATH
410 $ echo '[decode]' >> $HGRCPATH
413 $ echo '[decode]' >> $HGRCPATH
411 $ echo '**.txt = cleverdecode:' >> $HGRCPATH
414 $ echo '**.txt = cleverdecode:' >> $HGRCPATH
412
415
413 $ hg init win32compat
416 $ hg init win32compat
414 $ cd win32compat
417 $ cd win32compat
415 $ printf "foo\r\nbar\r\nbaz\r\n" > win.txt
418 $ printf "foo\r\nbar\r\nbaz\r\n" > win.txt
416 $ printf "foo\nbar\nbaz\n" > unix.txt
419 $ printf "foo\nbar\nbaz\n" > unix.txt
417 $ hg add
420 $ hg add
418 adding unix.txt
421 adding unix.txt
419 adding win.txt
422 adding win.txt
420 $ hg commit -m checkin
423 $ hg commit -m checkin
421
424
422 Check that both files have LF line-endings in the repository:
425 Check that both files have LF line-endings in the repository:
423
426
424 $ hg cat win.txt
427 $ hg cat win.txt
425 foo
428 foo
426 bar
429 bar
427 baz
430 baz
428 $ hg cat unix.txt
431 $ hg cat unix.txt
429 foo
432 foo
430 bar
433 bar
431 baz
434 baz
432
435
433 Test handling of a broken .hgeol file:
436 Test handling of a broken .hgeol file:
434
437
435 $ touch .hgeol
438 $ touch .hgeol
436 $ hg add .hgeol
439 $ hg add .hgeol
437 $ hg commit -m 'clean version'
440 $ hg commit -m 'clean version'
438 $ echo "bad" > .hgeol
441 $ echo "bad" > .hgeol
439 $ hg status
442 $ hg status
440 warning: ignoring .hgeol file due to parse error at .hgeol:1: bad
443 warning: ignoring .hgeol file due to parse error at .hgeol:1: bad
441 M .hgeol
444 M .hgeol
442 $ hg revert .hgeol
445 $ hg revert .hgeol
443 warning: ignoring .hgeol file due to parse error at .hgeol:1: bad
446 warning: ignoring .hgeol file due to parse error at .hgeol:1: bad
444 $ hg status
447 $ hg status
445 ? .hgeol.orig
448 ? .hgeol.orig
446
449
447 Test eol.only-consistent can be specified in .hgeol
450 Test eol.only-consistent can be specified in .hgeol
448
451
449 $ cd $TESTTMP
452 $ cd $TESTTMP
450 $ hg init only-consistent
453 $ hg init only-consistent
451 $ cd only-consistent
454 $ cd only-consistent
452 $ printf "first\nsecond\r\n" > a.txt
455 $ printf "first\nsecond\r\n" > a.txt
453 $ hg add a.txt
456 $ hg add a.txt
454 $ cat > .hgeol << EOF
457 $ cat > .hgeol << EOF
455 > [eol]
458 > [eol]
456 > only-consistent = True
459 > only-consistent = True
457 > EOF
460 > EOF
458 $ hg commit -m 'inconsistent'
461 $ hg commit -m 'inconsistent'
459 abort: inconsistent newline style in a.txt
462 abort: inconsistent newline style in a.txt
460
463
461 [255]
464 [255]
462 $ cat > .hgeol << EOF
465 $ cat > .hgeol << EOF
463 > [eol]
466 > [eol]
464 > only-consistent = False
467 > only-consistent = False
465 > EOF
468 > EOF
466 $ hg commit -m 'consistent'
469 $ hg commit -m 'consistent'
467
470
468
471
469 Test trailing newline
472 Test trailing newline
470
473
471 $ cat >> $HGRCPATH <<EOF
474 $ cat >> $HGRCPATH <<EOF
472 > [extensions]
475 > [extensions]
473 > eol=
476 > eol=
474 > EOF
477 > EOF
475
478
476 setup repository
479 setup repository
477
480
478 $ cd $TESTTMP
481 $ cd $TESTTMP
479 $ hg init trailing
482 $ hg init trailing
480 $ cd trailing
483 $ cd trailing
481 $ cat > .hgeol <<EOF
484 $ cat > .hgeol <<EOF
482 > [patterns]
485 > [patterns]
483 > **.txt = native
486 > **.txt = native
484 > [eol]
487 > [eol]
485 > fix-trailing-newline = False
488 > fix-trailing-newline = False
486 > EOF
489 > EOF
487
490
488 add text without trailing newline
491 add text without trailing newline
489
492
490 $ printf "first\nsecond" > a.txt
493 $ printf "first\nsecond" > a.txt
491 $ hg commit --addremove -m 'checking in'
494 $ hg commit --addremove -m 'checking in'
492 adding .hgeol
495 adding .hgeol
493 adding a.txt
496 adding a.txt
494 $ rm a.txt
497 $ rm a.txt
495 $ hg update -C -q
498 $ hg update -C -q
496 $ cat a.txt
499 $ cat a.txt
497 first
500 first
498 second (no-eol)
501 second (no-eol)
499
502
500 $ cat > .hgeol <<EOF
503 $ cat > .hgeol <<EOF
501 > [patterns]
504 > [patterns]
502 > **.txt = native
505 > **.txt = native
503 > [eol]
506 > [eol]
504 > fix-trailing-newline = True
507 > fix-trailing-newline = True
505 > EOF
508 > EOF
506 $ printf "third\nfourth" > a.txt
509 $ printf "third\nfourth" > a.txt
507 $ hg commit -m 'checking in with newline fix'
510 $ hg commit -m 'checking in with newline fix'
508 $ rm a.txt
511 $ rm a.txt
509 $ hg update -C -q
512 $ hg update -C -q
510 $ cat a.txt
513 $ cat a.txt
511 third
514 third
512 fourth
515 fourth
513
516
514 append a line without trailing newline
517 append a line without trailing newline
515
518
516 $ printf "fifth" >> a.txt
519 $ printf "fifth" >> a.txt
517 $ hg commit -m 'adding another line line'
520 $ hg commit -m 'adding another line line'
518 $ rm a.txt
521 $ rm a.txt
519 $ hg update -C -q
522 $ hg update -C -q
520 $ cat a.txt
523 $ cat a.txt
521 third
524 third
522 fourth
525 fourth
523 fifth
526 fifth
524
527
525 $ cd ..
528 $ cd ..
@@ -1,123 +1,125 b''
1 $ "$TESTDIR/hghave" unix-permissions || exit 80
2
3 Create user cache directory
1 Create user cache directory
4
2
5 $ USERCACHE=`pwd`/cache; export USERCACHE
3 $ USERCACHE=`pwd`/cache; export USERCACHE
6 $ cat <<EOF >> ${HGRCPATH}
4 $ cat <<EOF >> ${HGRCPATH}
7 > [extensions]
5 > [extensions]
8 > hgext.largefiles=
6 > hgext.largefiles=
9 > [largefiles]
7 > [largefiles]
10 > usercache=${USERCACHE}
8 > usercache=${USERCACHE}
11 > EOF
9 > EOF
12 $ mkdir -p ${USERCACHE}
10 $ mkdir -p ${USERCACHE}
13
11
14 Create source repo, and commit adding largefile.
12 Create source repo, and commit adding largefile.
15
13
16 $ hg init src
14 $ hg init src
17 $ cd src
15 $ cd src
18 $ echo large > large
16 $ echo large > large
19 $ hg add --large large
17 $ hg add --large large
20 $ hg commit -m 'add largefile'
18 $ hg commit -m 'add largefile'
21 $ cd ..
19 $ cd ..
22
20
23 Discard all cached largefiles in USERCACHE
21 Discard all cached largefiles in USERCACHE
24
22
25 $ rm -rf ${USERCACHE}
23 $ rm -rf ${USERCACHE}
26
24
27 Create mirror repo, and pull from source without largefile:
25 Create mirror repo, and pull from source without largefile:
28 "pull" is used instead of "clone" for suppression of (1) updating to
26 "pull" is used instead of "clone" for suppression of (1) updating to
29 tip (= cahcing largefile from source repo), and (2) recording source
27 tip (= cahcing largefile from source repo), and (2) recording source
30 repo as "default" path in .hg/hgrc.
28 repo as "default" path in .hg/hgrc.
31
29
32 $ hg init mirror
30 $ hg init mirror
33 $ cd mirror
31 $ cd mirror
34 $ hg pull ../src
32 $ hg pull ../src
35 pulling from ../src
33 pulling from ../src
36 requesting all changes
34 requesting all changes
37 adding changesets
35 adding changesets
38 adding manifests
36 adding manifests
39 adding file changes
37 adding file changes
40 added 1 changesets with 1 changes to 1 files
38 added 1 changesets with 1 changes to 1 files
41 (run 'hg update' to get a working copy)
39 (run 'hg update' to get a working copy)
42 caching new largefiles
40 caching new largefiles
43 0 largefiles cached
41 0 largefiles cached
44
42
45 Update working directory to "tip", which requires largefile("large"),
43 Update working directory to "tip", which requires largefile("large"),
46 but there is no cache file for it. So, hg must treat it as
44 but there is no cache file for it. So, hg must treat it as
47 "missing"(!) file.
45 "missing"(!) file.
48
46
49 $ hg update
47 $ hg update
50 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
48 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
51 getting changed largefiles
49 getting changed largefiles
52 large: can't get file locally
50 large: can't get file locally
53 (no default or default-push path set in hgrc)
51 (no default or default-push path set in hgrc)
54 0 largefiles updated, 0 removed
52 0 largefiles updated, 0 removed
55 $ hg status
53 $ hg status
56 ! large
54 ! large
57
55
58 Update working directory to null: this cleanup .hg/largefiles/dirstate
56 Update working directory to null: this cleanup .hg/largefiles/dirstate
59
57
60 $ hg update null
58 $ hg update null
61 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
59 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
62 getting changed largefiles
60 getting changed largefiles
63 0 largefiles updated, 0 removed
61 0 largefiles updated, 0 removed
64
62
65 Update working directory to tip, again.
63 Update working directory to tip, again.
66
64
67 $ hg update
65 $ hg update
68 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
66 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 getting changed largefiles
67 getting changed largefiles
70 large: can't get file locally
68 large: can't get file locally
71 (no default or default-push path set in hgrc)
69 (no default or default-push path set in hgrc)
72 0 largefiles updated, 0 removed
70 0 largefiles updated, 0 removed
73 $ hg status
71 $ hg status
74 ! large
72 ! large
73 $ cd ..
74
75 #if unix-permissions
75
76
76 Portable way to print file permissions:
77 Portable way to print file permissions:
77
78
78 $ cd ..
79 $ cat > ls-l.py <<EOF
79 $ cat > ls-l.py <<EOF
80 > #!/usr/bin/env python
80 > #!/usr/bin/env python
81 > import sys, os
81 > import sys, os
82 > path = sys.argv[1]
82 > path = sys.argv[1]
83 > print '%03o' % (os.lstat(path).st_mode & 0777)
83 > print '%03o' % (os.lstat(path).st_mode & 0777)
84 > EOF
84 > EOF
85 $ chmod +x ls-l.py
85 $ chmod +x ls-l.py
86
86
87 Test that files in .hg/largefiles inherit mode from .hg/store, not
87 Test that files in .hg/largefiles inherit mode from .hg/store, not
88 from file in working copy:
88 from file in working copy:
89
89
90 $ cd src
90 $ cd src
91 $ chmod 750 .hg/store
91 $ chmod 750 .hg/store
92 $ chmod 660 large
92 $ chmod 660 large
93 $ echo change >> large
93 $ echo change >> large
94 $ hg commit -m change
94 $ hg commit -m change
95 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
95 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
96 640
96 640
97
97
98 Test permission of with files in .hg/largefiles created by update:
98 Test permission of with files in .hg/largefiles created by update:
99
99
100 $ cd ../mirror
100 $ cd ../mirror
101 $ rm -r "$USERCACHE" .hg/largefiles # avoid links
101 $ rm -r "$USERCACHE" .hg/largefiles # avoid links
102 $ chmod 750 .hg/store
102 $ chmod 750 .hg/store
103 $ hg pull ../src --update -q
103 $ hg pull ../src --update -q
104 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
104 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
105 640
105 640
106
106
107 Test permission of files created by push:
107 Test permission of files created by push:
108
108
109 $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
109 $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
110 > --config "web.allow_push=*" --config web.push_ssl=no
110 > --config "web.allow_push=*" --config web.push_ssl=no
111 $ cat hg.pid >> $DAEMON_PIDS
111 $ cat hg.pid >> $DAEMON_PIDS
112
112
113 $ echo change >> large
113 $ echo change >> large
114 $ hg commit -m change
114 $ hg commit -m change
115
115
116 $ rm -r "$USERCACHE"
116 $ rm -r "$USERCACHE"
117
117
118 $ hg push -q http://localhost:$HGPORT/
118 $ hg push -q http://localhost:$HGPORT/
119
119
120 $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
120 $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
121 640
121 640
122
122
123 $ cd ..
123 $ cd ..
124
125 #endif
@@ -1,1217 +1,1221 b''
1 $ "$TESTDIR/hghave" unix-permissions serve || exit 80
1 $ "$TESTDIR/hghave" serve || exit 80
2 $ USERCACHE=`pwd`/cache; export USERCACHE
2 $ USERCACHE=`pwd`/cache; export USERCACHE
3 $ mkdir -p ${USERCACHE}
3 $ mkdir -p ${USERCACHE}
4 $ cat >> $HGRCPATH <<EOF
4 $ cat >> $HGRCPATH <<EOF
5 > [extensions]
5 > [extensions]
6 > largefiles=
6 > largefiles=
7 > purge=
7 > purge=
8 > rebase=
8 > rebase=
9 > transplant=
9 > transplant=
10 > [phases]
10 > [phases]
11 > publish=False
11 > publish=False
12 > [largefiles]
12 > [largefiles]
13 > minsize=2
13 > minsize=2
14 > patterns=glob:**.dat
14 > patterns=glob:**.dat
15 > usercache=${USERCACHE}
15 > usercache=${USERCACHE}
16 > [hooks]
16 > [hooks]
17 > precommit=echo "Invoking status precommit hook"; hg status
17 > precommit=echo "Invoking status precommit hook"; hg status
18 > EOF
18 > EOF
19
19
20 Create the repo with a couple of revisions of both large and normal
20 Create the repo with a couple of revisions of both large and normal
21 files, testing that status correctly shows largefiles and that summary output
21 files, testing that status correctly shows largefiles and that summary output
22 is correct.
22 is correct.
23
23
24 $ hg init a
24 $ hg init a
25 $ cd a
25 $ cd a
26 $ mkdir sub
26 $ mkdir sub
27 $ echo normal1 > normal1
27 $ echo normal1 > normal1
28 $ echo normal2 > sub/normal2
28 $ echo normal2 > sub/normal2
29 $ echo large1 > large1
29 $ echo large1 > large1
30 $ echo large2 > sub/large2
30 $ echo large2 > sub/large2
31 $ hg add normal1 sub/normal2
31 $ hg add normal1 sub/normal2
32 $ hg add --large large1 sub/large2
32 $ hg add --large large1 sub/large2
33 $ hg commit -m "add files"
33 $ hg commit -m "add files"
34 Invoking status precommit hook
34 Invoking status precommit hook
35 A large1
35 A large1
36 A normal1
36 A normal1
37 A sub/large2
37 A sub/large2
38 A sub/normal2
38 A sub/normal2
39 $ echo normal11 > normal1
39 $ echo normal11 > normal1
40 $ echo normal22 > sub/normal2
40 $ echo normal22 > sub/normal2
41 $ echo large11 > large1
41 $ echo large11 > large1
42 $ echo large22 > sub/large2
42 $ echo large22 > sub/large2
43 $ hg commit -m "edit files"
43 $ hg commit -m "edit files"
44 Invoking status precommit hook
44 Invoking status precommit hook
45 M large1
45 M large1
46 M normal1
46 M normal1
47 M sub/large2
47 M sub/large2
48 M sub/normal2
48 M sub/normal2
49 $ hg sum --large
49 $ hg sum --large
50 parent: 1:ce8896473775 tip
50 parent: 1:ce8896473775 tip
51 edit files
51 edit files
52 branch: default
52 branch: default
53 commit: (clean)
53 commit: (clean)
54 update: (current)
54 update: (current)
55 largefiles: No remote repo
55 largefiles: No remote repo
56
56
57 Commit preserved largefile contents.
57 Commit preserved largefile contents.
58
58
59 $ cat normal1
59 $ cat normal1
60 normal11
60 normal11
61 $ cat large1
61 $ cat large1
62 large11
62 large11
63 $ cat sub/normal2
63 $ cat sub/normal2
64 normal22
64 normal22
65 $ cat sub/large2
65 $ cat sub/large2
66 large22
66 large22
67
67
68 Test status, subdir and unknown files
68 Test status, subdir and unknown files
69
69
70 $ echo unknown > sub/unknown
70 $ echo unknown > sub/unknown
71 $ hg st --all
71 $ hg st --all
72 ? sub/unknown
72 ? sub/unknown
73 C large1
73 C large1
74 C normal1
74 C normal1
75 C sub/large2
75 C sub/large2
76 C sub/normal2
76 C sub/normal2
77 $ hg st --all sub
77 $ hg st --all sub
78 ? sub/unknown
78 ? sub/unknown
79 C sub/large2
79 C sub/large2
80 C sub/normal2
80 C sub/normal2
81 $ rm sub/unknown
81 $ rm sub/unknown
82
82
83 Remove both largefiles and normal files.
83 Remove both largefiles and normal files.
84
84
85 $ hg remove normal1 large1
85 $ hg remove normal1 large1
86 $ hg status large1
86 $ hg status large1
87 R large1
87 R large1
88 $ hg commit -m "remove files"
88 $ hg commit -m "remove files"
89 Invoking status precommit hook
89 Invoking status precommit hook
90 R large1
90 R large1
91 R normal1
91 R normal1
92 $ ls
92 $ ls
93 sub
93 sub
94 $ echo "testlargefile" > large1-test
94 $ echo "testlargefile" > large1-test
95 $ hg add --large large1-test
95 $ hg add --large large1-test
96 $ hg st
96 $ hg st
97 A large1-test
97 A large1-test
98 $ hg rm large1-test
98 $ hg rm large1-test
99 not removing large1-test: file has been marked for add (use forget to undo)
99 not removing large1-test: file has been marked for add (use forget to undo)
100 $ hg st
100 $ hg st
101 A large1-test
101 A large1-test
102 $ hg forget large1-test
102 $ hg forget large1-test
103 $ hg st
103 $ hg st
104 ? large1-test
104 ? large1-test
105 $ rm large1-test
105 $ rm large1-test
106
106
107 Copy both largefiles and normal files (testing that status output is correct).
107 Copy both largefiles and normal files (testing that status output is correct).
108
108
109 $ hg cp sub/normal2 normal1
109 $ hg cp sub/normal2 normal1
110 $ hg cp sub/large2 large1
110 $ hg cp sub/large2 large1
111 $ hg commit -m "copy files"
111 $ hg commit -m "copy files"
112 Invoking status precommit hook
112 Invoking status precommit hook
113 A large1
113 A large1
114 A normal1
114 A normal1
115 $ cat normal1
115 $ cat normal1
116 normal22
116 normal22
117 $ cat large1
117 $ cat large1
118 large22
118 large22
119
119
120 Test moving largefiles and verify that normal files are also unaffected.
120 Test moving largefiles and verify that normal files are also unaffected.
121
121
122 $ hg mv normal1 normal3
122 $ hg mv normal1 normal3
123 $ hg mv large1 large3
123 $ hg mv large1 large3
124 $ hg mv sub/normal2 sub/normal4
124 $ hg mv sub/normal2 sub/normal4
125 $ hg mv sub/large2 sub/large4
125 $ hg mv sub/large2 sub/large4
126 $ hg commit -m "move files"
126 $ hg commit -m "move files"
127 Invoking status precommit hook
127 Invoking status precommit hook
128 A large3
128 A large3
129 A normal3
129 A normal3
130 A sub/large4
130 A sub/large4
131 A sub/normal4
131 A sub/normal4
132 R large1
132 R large1
133 R normal1
133 R normal1
134 R sub/large2
134 R sub/large2
135 R sub/normal2
135 R sub/normal2
136 $ cat normal3
136 $ cat normal3
137 normal22
137 normal22
138 $ cat large3
138 $ cat large3
139 large22
139 large22
140 $ cat sub/normal4
140 $ cat sub/normal4
141 normal22
141 normal22
142 $ cat sub/large4
142 $ cat sub/large4
143 large22
143 large22
144
144
145 Test display of largefiles in hgweb
145 Test display of largefiles in hgweb
146
146
147 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
147 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
148 $ cat ../hg.pid >> $DAEMON_PIDS
148 $ cat ../hg.pid >> $DAEMON_PIDS
149 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/?style=raw'
149 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/?style=raw'
150 200 Script output follows
150 200 Script output follows
151
151
152
152
153 drwxr-xr-x sub
153 drwxr-xr-x sub
154 -rw-r--r-- 41 large3
154 -rw-r--r-- 41 large3
155 -rw-r--r-- 9 normal3
155 -rw-r--r-- 9 normal3
156
156
157
157
158 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/sub/?style=raw'
158 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/sub/?style=raw'
159 200 Script output follows
159 200 Script output follows
160
160
161
161
162 -rw-r--r-- 41 large4
162 -rw-r--r-- 41 large4
163 -rw-r--r-- 9 normal4
163 -rw-r--r-- 9 normal4
164
164
165
165
166 $ "$TESTDIR/killdaemons.py"
166 $ "$TESTDIR/killdaemons.py"
167
167
168 Test archiving the various revisions. These hit corner cases known with
168 Test archiving the various revisions. These hit corner cases known with
169 archiving.
169 archiving.
170
170
171 $ hg archive -r 0 ../archive0
171 $ hg archive -r 0 ../archive0
172 $ hg archive -r 1 ../archive1
172 $ hg archive -r 1 ../archive1
173 $ hg archive -r 2 ../archive2
173 $ hg archive -r 2 ../archive2
174 $ hg archive -r 3 ../archive3
174 $ hg archive -r 3 ../archive3
175 $ hg archive -r 4 ../archive4
175 $ hg archive -r 4 ../archive4
176 $ cd ../archive0
176 $ cd ../archive0
177 $ cat normal1
177 $ cat normal1
178 normal1
178 normal1
179 $ cat large1
179 $ cat large1
180 large1
180 large1
181 $ cat sub/normal2
181 $ cat sub/normal2
182 normal2
182 normal2
183 $ cat sub/large2
183 $ cat sub/large2
184 large2
184 large2
185 $ cd ../archive1
185 $ cd ../archive1
186 $ cat normal1
186 $ cat normal1
187 normal11
187 normal11
188 $ cat large1
188 $ cat large1
189 large11
189 large11
190 $ cat sub/normal2
190 $ cat sub/normal2
191 normal22
191 normal22
192 $ cat sub/large2
192 $ cat sub/large2
193 large22
193 large22
194 $ cd ../archive2
194 $ cd ../archive2
195 $ ls
195 $ ls
196 sub
196 sub
197 $ cat sub/normal2
197 $ cat sub/normal2
198 normal22
198 normal22
199 $ cat sub/large2
199 $ cat sub/large2
200 large22
200 large22
201 $ cd ../archive3
201 $ cd ../archive3
202 $ cat normal1
202 $ cat normal1
203 normal22
203 normal22
204 $ cat large1
204 $ cat large1
205 large22
205 large22
206 $ cat sub/normal2
206 $ cat sub/normal2
207 normal22
207 normal22
208 $ cat sub/large2
208 $ cat sub/large2
209 large22
209 large22
210 $ cd ../archive4
210 $ cd ../archive4
211 $ cat normal3
211 $ cat normal3
212 normal22
212 normal22
213 $ cat large3
213 $ cat large3
214 large22
214 large22
215 $ cat sub/normal4
215 $ cat sub/normal4
216 normal22
216 normal22
217 $ cat sub/large4
217 $ cat sub/large4
218 large22
218 large22
219
219
220 Commit corner case: specify files to commit.
220 Commit corner case: specify files to commit.
221
221
222 $ cd ../a
222 $ cd ../a
223 $ echo normal3 > normal3
223 $ echo normal3 > normal3
224 $ echo large3 > large3
224 $ echo large3 > large3
225 $ echo normal4 > sub/normal4
225 $ echo normal4 > sub/normal4
226 $ echo large4 > sub/large4
226 $ echo large4 > sub/large4
227 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
227 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
228 Invoking status precommit hook
228 Invoking status precommit hook
229 M large3
229 M large3
230 M normal3
230 M normal3
231 M sub/large4
231 M sub/large4
232 M sub/normal4
232 M sub/normal4
233 $ cat normal3
233 $ cat normal3
234 normal3
234 normal3
235 $ cat large3
235 $ cat large3
236 large3
236 large3
237 $ cat sub/normal4
237 $ cat sub/normal4
238 normal4
238 normal4
239 $ cat sub/large4
239 $ cat sub/large4
240 large4
240 large4
241
241
242 One more commit corner case: commit from a subdirectory.
242 One more commit corner case: commit from a subdirectory.
243
243
244 $ cd ../a
244 $ cd ../a
245 $ echo normal33 > normal3
245 $ echo normal33 > normal3
246 $ echo large33 > large3
246 $ echo large33 > large3
247 $ echo normal44 > sub/normal4
247 $ echo normal44 > sub/normal4
248 $ echo large44 > sub/large4
248 $ echo large44 > sub/large4
249 $ cd sub
249 $ cd sub
250 $ hg commit -m "edit files yet again"
250 $ hg commit -m "edit files yet again"
251 Invoking status precommit hook
251 Invoking status precommit hook
252 M large3
252 M large3
253 M normal3
253 M normal3
254 M sub/large4
254 M sub/large4
255 M sub/normal4
255 M sub/normal4
256 $ cat ../normal3
256 $ cat ../normal3
257 normal33
257 normal33
258 $ cat ../large3
258 $ cat ../large3
259 large33
259 large33
260 $ cat normal4
260 $ cat normal4
261 normal44
261 normal44
262 $ cat large4
262 $ cat large4
263 large44
263 large44
264
264
265 Committing standins is not allowed.
265 Committing standins is not allowed.
266
266
267 $ cd ..
267 $ cd ..
268 $ echo large3 > large3
268 $ echo large3 > large3
269 $ hg commit .hglf/large3 -m "try to commit standin"
269 $ hg commit .hglf/large3 -m "try to commit standin"
270 abort: file ".hglf/large3" is a largefile standin
270 abort: file ".hglf/large3" is a largefile standin
271 (commit the largefile itself instead)
271 (commit the largefile itself instead)
272 [255]
272 [255]
273
273
274 Corner cases for adding largefiles.
274 Corner cases for adding largefiles.
275
275
276 $ echo large5 > large5
276 $ echo large5 > large5
277 $ hg add --large large5
277 $ hg add --large large5
278 $ hg add --large large5
278 $ hg add --large large5
279 large5 already a largefile
279 large5 already a largefile
280 $ mkdir sub2
280 $ mkdir sub2
281 $ echo large6 > sub2/large6
281 $ echo large6 > sub2/large6
282 $ echo large7 > sub2/large7
282 $ echo large7 > sub2/large7
283 $ hg add --large sub2
283 $ hg add --large sub2
284 adding sub2/large6 as a largefile (glob)
284 adding sub2/large6 as a largefile (glob)
285 adding sub2/large7 as a largefile (glob)
285 adding sub2/large7 as a largefile (glob)
286 $ hg st
286 $ hg st
287 M large3
287 M large3
288 A large5
288 A large5
289 A sub2/large6
289 A sub2/large6
290 A sub2/large7
290 A sub2/large7
291
291
292 Test "hg status" with combination of 'file pattern' and 'directory
292 Test "hg status" with combination of 'file pattern' and 'directory
293 pattern' for largefiles:
293 pattern' for largefiles:
294
294
295 $ hg status sub2/large6 sub2
295 $ hg status sub2/large6 sub2
296 A sub2/large6
296 A sub2/large6
297 A sub2/large7
297 A sub2/large7
298
298
299 Config settings (pattern **.dat, minsize 2 MB) are respected.
299 Config settings (pattern **.dat, minsize 2 MB) are respected.
300
300
301 $ echo testdata > test.dat
301 $ echo testdata > test.dat
302 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
302 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
303 $ hg add
303 $ hg add
304 adding reallylarge as a largefile
304 adding reallylarge as a largefile
305 adding test.dat as a largefile
305 adding test.dat as a largefile
306
306
307 Test that minsize and --lfsize handle float values;
307 Test that minsize and --lfsize handle float values;
308 also tests that --lfsize overrides largefiles.minsize.
308 also tests that --lfsize overrides largefiles.minsize.
309 (0.250 MB = 256 kB = 262144 B)
309 (0.250 MB = 256 kB = 262144 B)
310
310
311 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
311 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
312 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
312 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
313 $ hg --config largefiles.minsize=.25 add
313 $ hg --config largefiles.minsize=.25 add
314 adding ratherlarge as a largefile
314 adding ratherlarge as a largefile
315 adding medium
315 adding medium
316 $ hg forget medium
316 $ hg forget medium
317 $ hg --config largefiles.minsize=.25 add --lfsize=.125
317 $ hg --config largefiles.minsize=.25 add --lfsize=.125
318 adding medium as a largefile
318 adding medium as a largefile
319 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
319 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
320 $ hg --config largefiles.minsize=.25 add --lfsize=.125
320 $ hg --config largefiles.minsize=.25 add --lfsize=.125
321 adding notlarge
321 adding notlarge
322 $ hg forget notlarge
322 $ hg forget notlarge
323
323
324 Test forget on largefiles.
324 Test forget on largefiles.
325
325
326 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
326 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
327 $ hg commit -m "add/edit more largefiles"
327 $ hg commit -m "add/edit more largefiles"
328 Invoking status precommit hook
328 Invoking status precommit hook
329 A sub2/large6
329 A sub2/large6
330 A sub2/large7
330 A sub2/large7
331 R large3
331 R large3
332 ? large5
332 ? large5
333 ? medium
333 ? medium
334 ? notlarge
334 ? notlarge
335 ? ratherlarge
335 ? ratherlarge
336 ? reallylarge
336 ? reallylarge
337 ? test.dat
337 ? test.dat
338 $ hg st
338 $ hg st
339 ? large3
339 ? large3
340 ? large5
340 ? large5
341 ? medium
341 ? medium
342 ? notlarge
342 ? notlarge
343 ? ratherlarge
343 ? ratherlarge
344 ? reallylarge
344 ? reallylarge
345 ? test.dat
345 ? test.dat
346
346
347 Purge with largefiles: verify that largefiles are still in the working
347 Purge with largefiles: verify that largefiles are still in the working
348 dir after a purge.
348 dir after a purge.
349
349
350 $ hg purge --all
350 $ hg purge --all
351 $ cat sub/large4
351 $ cat sub/large4
352 large44
352 large44
353 $ cat sub2/large6
353 $ cat sub2/large6
354 large6
354 large6
355 $ cat sub2/large7
355 $ cat sub2/large7
356 large7
356 large7
357
357
358 Test addremove: verify that files that should be added as largfiles are added as
358 Test addremove: verify that files that should be added as largfiles are added as
359 such and that already-existing largfiles are not added as normal files by
359 such and that already-existing largfiles are not added as normal files by
360 accident.
360 accident.
361
361
362 $ rm normal3
362 $ rm normal3
363 $ rm sub/large4
363 $ rm sub/large4
364 $ echo "testing addremove with patterns" > testaddremove.dat
364 $ echo "testing addremove with patterns" > testaddremove.dat
365 $ echo "normaladdremove" > normaladdremove
365 $ echo "normaladdremove" > normaladdremove
366 $ hg addremove
366 $ hg addremove
367 removing sub/large4
367 removing sub/large4
368 adding testaddremove.dat as a largefile
368 adding testaddremove.dat as a largefile
369 removing normal3
369 removing normal3
370 adding normaladdremove
370 adding normaladdremove
371
371
372 Clone a largefiles repo.
372 Clone a largefiles repo.
373
373
374 $ hg clone . ../b
374 $ hg clone . ../b
375 updating to branch default
375 updating to branch default
376 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
376 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
377 getting changed largefiles
377 getting changed largefiles
378 3 largefiles updated, 0 removed
378 3 largefiles updated, 0 removed
379 $ cd ../b
379 $ cd ../b
380 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
380 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
381 7:daea875e9014 add/edit more largefiles
381 7:daea875e9014 add/edit more largefiles
382 6:4355d653f84f edit files yet again
382 6:4355d653f84f edit files yet again
383 5:9d5af5072dbd edit files again
383 5:9d5af5072dbd edit files again
384 4:74c02385b94c move files
384 4:74c02385b94c move files
385 3:9e8fbc4bce62 copy files
385 3:9e8fbc4bce62 copy files
386 2:51a0ae4d5864 remove files
386 2:51a0ae4d5864 remove files
387 1:ce8896473775 edit files
387 1:ce8896473775 edit files
388 0:30d30fe6a5be add files
388 0:30d30fe6a5be add files
389 $ cat normal3
389 $ cat normal3
390 normal33
390 normal33
391 $ cat sub/normal4
391 $ cat sub/normal4
392 normal44
392 normal44
393 $ cat sub/large4
393 $ cat sub/large4
394 large44
394 large44
395 $ cat sub2/large6
395 $ cat sub2/large6
396 large6
396 large6
397 $ cat sub2/large7
397 $ cat sub2/large7
398 large7
398 large7
399 $ cd ..
399 $ cd ..
400 $ hg clone a -r 3 c
400 $ hg clone a -r 3 c
401 adding changesets
401 adding changesets
402 adding manifests
402 adding manifests
403 adding file changes
403 adding file changes
404 added 4 changesets with 10 changes to 4 files
404 added 4 changesets with 10 changes to 4 files
405 updating to branch default
405 updating to branch default
406 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
406 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
407 getting changed largefiles
407 getting changed largefiles
408 2 largefiles updated, 0 removed
408 2 largefiles updated, 0 removed
409 $ cd c
409 $ cd c
410 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
410 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
411 3:9e8fbc4bce62 copy files
411 3:9e8fbc4bce62 copy files
412 2:51a0ae4d5864 remove files
412 2:51a0ae4d5864 remove files
413 1:ce8896473775 edit files
413 1:ce8896473775 edit files
414 0:30d30fe6a5be add files
414 0:30d30fe6a5be add files
415 $ cat normal1
415 $ cat normal1
416 normal22
416 normal22
417 $ cat large1
417 $ cat large1
418 large22
418 large22
419 $ cat sub/normal2
419 $ cat sub/normal2
420 normal22
420 normal22
421 $ cat sub/large2
421 $ cat sub/large2
422 large22
422 large22
423
423
424 Old revisions of a clone have correct largefiles content (this also
424 Old revisions of a clone have correct largefiles content (this also
425 tests update).
425 tests update).
426
426
427 $ hg update -r 1
427 $ hg update -r 1
428 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
428 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
429 getting changed largefiles
429 getting changed largefiles
430 1 largefiles updated, 0 removed
430 1 largefiles updated, 0 removed
431 $ cat large1
431 $ cat large1
432 large11
432 large11
433 $ cat sub/large2
433 $ cat sub/large2
434 large22
434 large22
435 $ cd ..
435 $ cd ..
436
436
437 Test cloning with --all-largefiles flag
437 Test cloning with --all-largefiles flag
438
438
439 $ rm -Rf ${USERCACHE}/*
439 $ rm -Rf ${USERCACHE}/*
440 $ hg clone --all-largefiles a a-backup
440 $ hg clone --all-largefiles a a-backup
441 updating to branch default
441 updating to branch default
442 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
443 getting changed largefiles
443 getting changed largefiles
444 3 largefiles updated, 0 removed
444 3 largefiles updated, 0 removed
445 8 additional largefiles cached
445 8 additional largefiles cached
446
446
447 $ hg clone --all-largefiles a ssh://localhost/a
447 $ hg clone --all-largefiles a ssh://localhost/a
448 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
448 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
449 [255]
449 [255]
450
450
451 Test pulling with --all-largefiles flag
451 Test pulling with --all-largefiles flag
452
452
453 $ rm -Rf a-backup
453 $ rm -Rf a-backup
454 $ hg clone -r 1 a a-backup
454 $ hg clone -r 1 a a-backup
455 adding changesets
455 adding changesets
456 adding manifests
456 adding manifests
457 adding file changes
457 adding file changes
458 added 2 changesets with 8 changes to 4 files
458 added 2 changesets with 8 changes to 4 files
459 updating to branch default
459 updating to branch default
460 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
460 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
461 getting changed largefiles
461 getting changed largefiles
462 2 largefiles updated, 0 removed
462 2 largefiles updated, 0 removed
463 $ rm -Rf ${USERCACHE}/*
463 $ rm -Rf ${USERCACHE}/*
464 $ cd a-backup
464 $ cd a-backup
465 $ hg pull --all-largefiles
465 $ hg pull --all-largefiles
466 pulling from $TESTTMP/a
466 pulling from $TESTTMP/a
467 searching for changes
467 searching for changes
468 adding changesets
468 adding changesets
469 adding manifests
469 adding manifests
470 adding file changes
470 adding file changes
471 added 6 changesets with 16 changes to 8 files
471 added 6 changesets with 16 changes to 8 files
472 (run 'hg update' to get a working copy)
472 (run 'hg update' to get a working copy)
473 caching new largefiles
473 caching new largefiles
474 3 largefiles cached
474 3 largefiles cached
475 3 additional largefiles cached
475 3 additional largefiles cached
476 $ cd ..
476 $ cd ..
477
477
478 Rebasing between two repositories does not revert largefiles to old
478 Rebasing between two repositories does not revert largefiles to old
479 revisions (this was a very bad bug that took a lot of work to fix).
479 revisions (this was a very bad bug that took a lot of work to fix).
480
480
481 $ hg clone a d
481 $ hg clone a d
482 updating to branch default
482 updating to branch default
483 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
483 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
484 getting changed largefiles
484 getting changed largefiles
485 3 largefiles updated, 0 removed
485 3 largefiles updated, 0 removed
486 $ cd b
486 $ cd b
487 $ echo large4-modified > sub/large4
487 $ echo large4-modified > sub/large4
488 $ echo normal3-modified > normal3
488 $ echo normal3-modified > normal3
489 $ hg commit -m "modify normal file and largefile in repo b"
489 $ hg commit -m "modify normal file and largefile in repo b"
490 Invoking status precommit hook
490 Invoking status precommit hook
491 M normal3
491 M normal3
492 M sub/large4
492 M sub/large4
493 $ cd ../d
493 $ cd ../d
494 $ echo large6-modified > sub2/large6
494 $ echo large6-modified > sub2/large6
495 $ echo normal4-modified > sub/normal4
495 $ echo normal4-modified > sub/normal4
496 $ hg commit -m "modify normal file largefile in repo d"
496 $ hg commit -m "modify normal file largefile in repo d"
497 Invoking status precommit hook
497 Invoking status precommit hook
498 M sub/normal4
498 M sub/normal4
499 M sub2/large6
499 M sub2/large6
500 $ cd ..
500 $ cd ..
501 $ hg clone d e
501 $ hg clone d e
502 updating to branch default
502 updating to branch default
503 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
503 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
504 getting changed largefiles
504 getting changed largefiles
505 3 largefiles updated, 0 removed
505 3 largefiles updated, 0 removed
506 $ cd d
506 $ cd d
507 $ hg pull --rebase ../b
507 $ hg pull --rebase ../b
508 pulling from ../b
508 pulling from ../b
509 searching for changes
509 searching for changes
510 adding changesets
510 adding changesets
511 adding manifests
511 adding manifests
512 adding file changes
512 adding file changes
513 added 1 changesets with 2 changes to 2 files (+1 heads)
513 added 1 changesets with 2 changes to 2 files (+1 heads)
514 Invoking status precommit hook
514 Invoking status precommit hook
515 M sub/normal4
515 M sub/normal4
516 M sub2/large6
516 M sub2/large6
517 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
517 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
518 nothing to rebase
518 nothing to rebase
519 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
519 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
520 9:598410d3eb9a modify normal file largefile in repo d
520 9:598410d3eb9a modify normal file largefile in repo d
521 8:a381d2c8c80e modify normal file and largefile in repo b
521 8:a381d2c8c80e modify normal file and largefile in repo b
522 7:daea875e9014 add/edit more largefiles
522 7:daea875e9014 add/edit more largefiles
523 6:4355d653f84f edit files yet again
523 6:4355d653f84f edit files yet again
524 5:9d5af5072dbd edit files again
524 5:9d5af5072dbd edit files again
525 4:74c02385b94c move files
525 4:74c02385b94c move files
526 3:9e8fbc4bce62 copy files
526 3:9e8fbc4bce62 copy files
527 2:51a0ae4d5864 remove files
527 2:51a0ae4d5864 remove files
528 1:ce8896473775 edit files
528 1:ce8896473775 edit files
529 0:30d30fe6a5be add files
529 0:30d30fe6a5be add files
530 $ cat normal3
530 $ cat normal3
531 normal3-modified
531 normal3-modified
532 $ cat sub/normal4
532 $ cat sub/normal4
533 normal4-modified
533 normal4-modified
534 $ cat sub/large4
534 $ cat sub/large4
535 large4-modified
535 large4-modified
536 $ cat sub2/large6
536 $ cat sub2/large6
537 large6-modified
537 large6-modified
538 $ cat sub2/large7
538 $ cat sub2/large7
539 large7
539 large7
540 $ cd ../e
540 $ cd ../e
541 $ hg pull ../b
541 $ hg pull ../b
542 pulling from ../b
542 pulling from ../b
543 searching for changes
543 searching for changes
544 adding changesets
544 adding changesets
545 adding manifests
545 adding manifests
546 adding file changes
546 adding file changes
547 added 1 changesets with 2 changes to 2 files (+1 heads)
547 added 1 changesets with 2 changes to 2 files (+1 heads)
548 (run 'hg heads' to see heads, 'hg merge' to merge)
548 (run 'hg heads' to see heads, 'hg merge' to merge)
549 caching new largefiles
549 caching new largefiles
550 0 largefiles cached
550 0 largefiles cached
551 $ hg rebase
551 $ hg rebase
552 Invoking status precommit hook
552 Invoking status precommit hook
553 M sub/normal4
553 M sub/normal4
554 M sub2/large6
554 M sub2/large6
555 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
555 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
556 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
556 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
557 9:598410d3eb9a modify normal file largefile in repo d
557 9:598410d3eb9a modify normal file largefile in repo d
558 8:a381d2c8c80e modify normal file and largefile in repo b
558 8:a381d2c8c80e modify normal file and largefile in repo b
559 7:daea875e9014 add/edit more largefiles
559 7:daea875e9014 add/edit more largefiles
560 6:4355d653f84f edit files yet again
560 6:4355d653f84f edit files yet again
561 5:9d5af5072dbd edit files again
561 5:9d5af5072dbd edit files again
562 4:74c02385b94c move files
562 4:74c02385b94c move files
563 3:9e8fbc4bce62 copy files
563 3:9e8fbc4bce62 copy files
564 2:51a0ae4d5864 remove files
564 2:51a0ae4d5864 remove files
565 1:ce8896473775 edit files
565 1:ce8896473775 edit files
566 0:30d30fe6a5be add files
566 0:30d30fe6a5be add files
567 $ cat normal3
567 $ cat normal3
568 normal3-modified
568 normal3-modified
569 $ cat sub/normal4
569 $ cat sub/normal4
570 normal4-modified
570 normal4-modified
571 $ cat sub/large4
571 $ cat sub/large4
572 large4-modified
572 large4-modified
573 $ cat sub2/large6
573 $ cat sub2/large6
574 large6-modified
574 large6-modified
575 $ cat sub2/large7
575 $ cat sub2/large7
576 large7
576 large7
577
577
578 Rollback on largefiles.
578 Rollback on largefiles.
579
579
580 $ echo large4-modified-again > sub/large4
580 $ echo large4-modified-again > sub/large4
581 $ hg commit -m "Modify large4 again"
581 $ hg commit -m "Modify large4 again"
582 Invoking status precommit hook
582 Invoking status precommit hook
583 M sub/large4
583 M sub/large4
584 $ hg rollback
584 $ hg rollback
585 repository tip rolled back to revision 9 (undo commit)
585 repository tip rolled back to revision 9 (undo commit)
586 working directory now based on revision 9
586 working directory now based on revision 9
587 $ hg st
587 $ hg st
588 M sub/large4
588 M sub/large4
589 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
589 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
590 9:598410d3eb9a modify normal file largefile in repo d
590 9:598410d3eb9a modify normal file largefile in repo d
591 8:a381d2c8c80e modify normal file and largefile in repo b
591 8:a381d2c8c80e modify normal file and largefile in repo b
592 7:daea875e9014 add/edit more largefiles
592 7:daea875e9014 add/edit more largefiles
593 6:4355d653f84f edit files yet again
593 6:4355d653f84f edit files yet again
594 5:9d5af5072dbd edit files again
594 5:9d5af5072dbd edit files again
595 4:74c02385b94c move files
595 4:74c02385b94c move files
596 3:9e8fbc4bce62 copy files
596 3:9e8fbc4bce62 copy files
597 2:51a0ae4d5864 remove files
597 2:51a0ae4d5864 remove files
598 1:ce8896473775 edit files
598 1:ce8896473775 edit files
599 0:30d30fe6a5be add files
599 0:30d30fe6a5be add files
600 $ cat sub/large4
600 $ cat sub/large4
601 large4-modified-again
601 large4-modified-again
602
602
603 "update --check" refuses to update with uncommitted changes.
603 "update --check" refuses to update with uncommitted changes.
604 $ hg update --check 8
604 $ hg update --check 8
605 abort: uncommitted local changes
605 abort: uncommitted local changes
606 [255]
606 [255]
607
607
608 "update --clean" leaves correct largefiles in working copy.
608 "update --clean" leaves correct largefiles in working copy.
609
609
610 $ hg update --clean
610 $ hg update --clean
611 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
611 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
612 getting changed largefiles
612 getting changed largefiles
613 1 largefiles updated, 0 removed
613 1 largefiles updated, 0 removed
614 $ cat normal3
614 $ cat normal3
615 normal3-modified
615 normal3-modified
616 $ cat sub/normal4
616 $ cat sub/normal4
617 normal4-modified
617 normal4-modified
618 $ cat sub/large4
618 $ cat sub/large4
619 large4-modified
619 large4-modified
620 $ cat sub2/large6
620 $ cat sub2/large6
621 large6-modified
621 large6-modified
622 $ cat sub2/large7
622 $ cat sub2/large7
623 large7
623 large7
624
624
625 Now "update check" is happy.
625 Now "update check" is happy.
626 $ hg update --check 8
626 $ hg update --check 8
627 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
627 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
628 getting changed largefiles
628 getting changed largefiles
629 1 largefiles updated, 0 removed
629 1 largefiles updated, 0 removed
630 $ hg update --check
630 $ hg update --check
631 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
631 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
632 getting changed largefiles
632 getting changed largefiles
633 1 largefiles updated, 0 removed
633 1 largefiles updated, 0 removed
634
634
635 Test removing empty largefiles directories on update
635 Test removing empty largefiles directories on update
636 $ test -d sub2 && echo "sub2 exists"
636 $ test -d sub2 && echo "sub2 exists"
637 sub2 exists
637 sub2 exists
638 $ hg update -q null
638 $ hg update -q null
639 $ test -d sub2 && echo "error: sub2 should not exist anymore"
639 $ test -d sub2 && echo "error: sub2 should not exist anymore"
640 [1]
640 [1]
641 $ hg update -q
641 $ hg update -q
642
642
643 Test hg remove removes empty largefiles directories
643 Test hg remove removes empty largefiles directories
644 $ test -d sub2 && echo "sub2 exists"
644 $ test -d sub2 && echo "sub2 exists"
645 sub2 exists
645 sub2 exists
646 $ hg remove sub2/*
646 $ hg remove sub2/*
647 $ test -d sub2 && echo "error: sub2 should not exist anymore"
647 $ test -d sub2 && echo "error: sub2 should not exist anymore"
648 [1]
648 [1]
649 $ hg revert sub2/large6 sub2/large7
649 $ hg revert sub2/large6 sub2/large7
650
650
651 "revert" works on largefiles (and normal files too).
651 "revert" works on largefiles (and normal files too).
652 $ echo hack3 >> normal3
652 $ echo hack3 >> normal3
653 $ echo hack4 >> sub/normal4
653 $ echo hack4 >> sub/normal4
654 $ echo hack4 >> sub/large4
654 $ echo hack4 >> sub/large4
655 $ rm sub2/large6
655 $ rm sub2/large6
656 $ hg revert sub2/large6
656 $ hg revert sub2/large6
657 $ hg rm sub2/large6
657 $ hg rm sub2/large6
658 $ echo new >> sub2/large8
658 $ echo new >> sub2/large8
659 $ hg add --large sub2/large8
659 $ hg add --large sub2/large8
660 # XXX we don't really want to report that we're reverting the standin;
660 # XXX we don't really want to report that we're reverting the standin;
661 # that's just an implementation detail. But I don't see an obvious fix. ;-(
661 # that's just an implementation detail. But I don't see an obvious fix. ;-(
662 $ hg revert sub
662 $ hg revert sub
663 reverting .hglf/sub/large4 (glob)
663 reverting .hglf/sub/large4 (glob)
664 reverting sub/normal4 (glob)
664 reverting sub/normal4 (glob)
665 $ hg status
665 $ hg status
666 M normal3
666 M normal3
667 A sub2/large8
667 A sub2/large8
668 R sub2/large6
668 R sub2/large6
669 ? sub/large4.orig
669 ? sub/large4.orig
670 ? sub/normal4.orig
670 ? sub/normal4.orig
671 $ cat sub/normal4
671 $ cat sub/normal4
672 normal4-modified
672 normal4-modified
673 $ cat sub/large4
673 $ cat sub/large4
674 large4-modified
674 large4-modified
675 $ hg revert -a --no-backup
675 $ hg revert -a --no-backup
676 undeleting .hglf/sub2/large6 (glob)
676 undeleting .hglf/sub2/large6 (glob)
677 forgetting .hglf/sub2/large8 (glob)
677 forgetting .hglf/sub2/large8 (glob)
678 reverting normal3
678 reverting normal3
679 $ hg status
679 $ hg status
680 ? sub/large4.orig
680 ? sub/large4.orig
681 ? sub/normal4.orig
681 ? sub/normal4.orig
682 ? sub2/large8
682 ? sub2/large8
683 $ cat normal3
683 $ cat normal3
684 normal3-modified
684 normal3-modified
685 $ cat sub2/large6
685 $ cat sub2/large6
686 large6-modified
686 large6-modified
687 $ rm sub/*.orig sub2/large8
687 $ rm sub/*.orig sub2/large8
688
688
689 revert some files to an older revision
689 revert some files to an older revision
690 $ hg revert --no-backup -r 8 sub2
690 $ hg revert --no-backup -r 8 sub2
691 reverting .hglf/sub2/large6 (glob)
691 reverting .hglf/sub2/large6 (glob)
692 $ cat sub2/large6
692 $ cat sub2/large6
693 large6
693 large6
694 $ hg revert --no-backup sub2
694 $ hg revert --no-backup sub2
695 reverting .hglf/sub2/large6 (glob)
695 reverting .hglf/sub2/large6 (glob)
696 $ hg status
696 $ hg status
697
697
698 "verify --large" actually verifies largefiles
698 "verify --large" actually verifies largefiles
699
699
700 $ hg verify --large
700 $ hg verify --large
701 checking changesets
701 checking changesets
702 checking manifests
702 checking manifests
703 crosschecking files in changesets and manifests
703 crosschecking files in changesets and manifests
704 checking files
704 checking files
705 10 files, 10 changesets, 28 total revisions
705 10 files, 10 changesets, 28 total revisions
706 searching 1 changesets for largefiles
706 searching 1 changesets for largefiles
707 verified existence of 3 revisions of 3 largefiles
707 verified existence of 3 revisions of 3 largefiles
708
708
709 Merging does not revert to old versions of largefiles and also check
709 Merging does not revert to old versions of largefiles and also check
710 that merging after having pulled from a non-default remote works
710 that merging after having pulled from a non-default remote works
711 correctly.
711 correctly.
712
712
713 $ cd ..
713 $ cd ..
714 $ hg clone -r 7 e temp
714 $ hg clone -r 7 e temp
715 adding changesets
715 adding changesets
716 adding manifests
716 adding manifests
717 adding file changes
717 adding file changes
718 added 8 changesets with 24 changes to 10 files
718 added 8 changesets with 24 changes to 10 files
719 updating to branch default
719 updating to branch default
720 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
720 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
721 getting changed largefiles
721 getting changed largefiles
722 3 largefiles updated, 0 removed
722 3 largefiles updated, 0 removed
723 $ hg clone temp f
723 $ hg clone temp f
724 updating to branch default
724 updating to branch default
725 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
725 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
726 getting changed largefiles
726 getting changed largefiles
727 3 largefiles updated, 0 removed
727 3 largefiles updated, 0 removed
728 # Delete the largefiles in the largefiles system cache so that we have an
728 # Delete the largefiles in the largefiles system cache so that we have an
729 # opportunity to test that caching after a pull works.
729 # opportunity to test that caching after a pull works.
730 $ rm ${USERCACHE}/*
730 $ rm ${USERCACHE}/*
731 $ cd f
731 $ cd f
732 $ echo "large4-merge-test" > sub/large4
732 $ echo "large4-merge-test" > sub/large4
733 $ hg commit -m "Modify large4 to test merge"
733 $ hg commit -m "Modify large4 to test merge"
734 Invoking status precommit hook
734 Invoking status precommit hook
735 M sub/large4
735 M sub/large4
736 $ hg pull ../e
736 $ hg pull ../e
737 pulling from ../e
737 pulling from ../e
738 searching for changes
738 searching for changes
739 adding changesets
739 adding changesets
740 adding manifests
740 adding manifests
741 adding file changes
741 adding file changes
742 added 2 changesets with 4 changes to 4 files (+1 heads)
742 added 2 changesets with 4 changes to 4 files (+1 heads)
743 (run 'hg heads' to see heads, 'hg merge' to merge)
743 (run 'hg heads' to see heads, 'hg merge' to merge)
744 caching new largefiles
744 caching new largefiles
745 2 largefiles cached
745 2 largefiles cached
746 $ hg merge
746 $ hg merge
747 merging sub/large4
747 merging sub/large4
748 largefile sub/large4 has a merge conflict
748 largefile sub/large4 has a merge conflict
749 keep (l)ocal or take (o)ther? l
749 keep (l)ocal or take (o)ther? l
750 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
750 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
751 (branch merge, don't forget to commit)
751 (branch merge, don't forget to commit)
752 getting changed largefiles
752 getting changed largefiles
753 1 largefiles updated, 0 removed
753 1 largefiles updated, 0 removed
754 $ hg commit -m "Merge repos e and f"
754 $ hg commit -m "Merge repos e and f"
755 Invoking status precommit hook
755 Invoking status precommit hook
756 M normal3
756 M normal3
757 M sub/normal4
757 M sub/normal4
758 M sub2/large6
758 M sub2/large6
759 $ cat normal3
759 $ cat normal3
760 normal3-modified
760 normal3-modified
761 $ cat sub/normal4
761 $ cat sub/normal4
762 normal4-modified
762 normal4-modified
763 $ cat sub/large4
763 $ cat sub/large4
764 large4-merge-test
764 large4-merge-test
765 $ cat sub2/large6
765 $ cat sub2/large6
766 large6-modified
766 large6-modified
767 $ cat sub2/large7
767 $ cat sub2/large7
768 large7
768 large7
769
769
770 Test status after merging with a branch that introduces a new largefile:
770 Test status after merging with a branch that introduces a new largefile:
771
771
772 $ echo large > large
772 $ echo large > large
773 $ hg add --large large
773 $ hg add --large large
774 $ hg commit -m 'add largefile'
774 $ hg commit -m 'add largefile'
775 Invoking status precommit hook
775 Invoking status precommit hook
776 A large
776 A large
777 $ hg update -q ".^"
777 $ hg update -q ".^"
778 $ echo change >> normal3
778 $ echo change >> normal3
779 $ hg commit -m 'some change'
779 $ hg commit -m 'some change'
780 Invoking status precommit hook
780 Invoking status precommit hook
781 M normal3
781 M normal3
782 created new head
782 created new head
783 $ hg merge
783 $ hg merge
784 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
784 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
785 (branch merge, don't forget to commit)
785 (branch merge, don't forget to commit)
786 getting changed largefiles
786 getting changed largefiles
787 1 largefiles updated, 0 removed
787 1 largefiles updated, 0 removed
788 $ hg status
788 $ hg status
789 M large
789 M large
790
790
791 Test that a normal file and a largefile with the same name and path cannot
791 Test that a normal file and a largefile with the same name and path cannot
792 coexist.
792 coexist.
793
793
794 $ rm sub2/large7
794 $ rm sub2/large7
795 $ echo "largeasnormal" > sub2/large7
795 $ echo "largeasnormal" > sub2/large7
796 $ hg add sub2/large7
796 $ hg add sub2/large7
797 sub2/large7 already a largefile
797 sub2/large7 already a largefile
798
798
799 Test that transplanting a largefile change works correctly.
799 Test that transplanting a largefile change works correctly.
800
800
801 $ cd ..
801 $ cd ..
802 $ hg clone -r 8 d g
802 $ hg clone -r 8 d g
803 adding changesets
803 adding changesets
804 adding manifests
804 adding manifests
805 adding file changes
805 adding file changes
806 added 9 changesets with 26 changes to 10 files
806 added 9 changesets with 26 changes to 10 files
807 updating to branch default
807 updating to branch default
808 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
808 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
809 getting changed largefiles
809 getting changed largefiles
810 3 largefiles updated, 0 removed
810 3 largefiles updated, 0 removed
811 $ cd g
811 $ cd g
812 $ hg transplant -s ../d 598410d3eb9a
812 $ hg transplant -s ../d 598410d3eb9a
813 searching for changes
813 searching for changes
814 searching for changes
814 searching for changes
815 adding changesets
815 adding changesets
816 adding manifests
816 adding manifests
817 adding file changes
817 adding file changes
818 added 1 changesets with 2 changes to 2 files
818 added 1 changesets with 2 changes to 2 files
819 getting changed largefiles
819 getting changed largefiles
820 1 largefiles updated, 0 removed
820 1 largefiles updated, 0 removed
821 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
821 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
822 9:598410d3eb9a modify normal file largefile in repo d
822 9:598410d3eb9a modify normal file largefile in repo d
823 8:a381d2c8c80e modify normal file and largefile in repo b
823 8:a381d2c8c80e modify normal file and largefile in repo b
824 7:daea875e9014 add/edit more largefiles
824 7:daea875e9014 add/edit more largefiles
825 6:4355d653f84f edit files yet again
825 6:4355d653f84f edit files yet again
826 5:9d5af5072dbd edit files again
826 5:9d5af5072dbd edit files again
827 4:74c02385b94c move files
827 4:74c02385b94c move files
828 3:9e8fbc4bce62 copy files
828 3:9e8fbc4bce62 copy files
829 2:51a0ae4d5864 remove files
829 2:51a0ae4d5864 remove files
830 1:ce8896473775 edit files
830 1:ce8896473775 edit files
831 0:30d30fe6a5be add files
831 0:30d30fe6a5be add files
832 $ cat normal3
832 $ cat normal3
833 normal3-modified
833 normal3-modified
834 $ cat sub/normal4
834 $ cat sub/normal4
835 normal4-modified
835 normal4-modified
836 $ cat sub/large4
836 $ cat sub/large4
837 large4-modified
837 large4-modified
838 $ cat sub2/large6
838 $ cat sub2/large6
839 large6-modified
839 large6-modified
840 $ cat sub2/large7
840 $ cat sub2/large7
841 large7
841 large7
842
842
843 Cat a largefile
843 Cat a largefile
844 $ hg cat normal3
844 $ hg cat normal3
845 normal3-modified
845 normal3-modified
846 $ hg cat sub/large4
846 $ hg cat sub/large4
847 large4-modified
847 large4-modified
848 $ rm ${USERCACHE}/*
848 $ rm ${USERCACHE}/*
849 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
849 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
850 $ cat cat.out
850 $ cat cat.out
851 large4-modified
851 large4-modified
852 $ rm cat.out
852 $ rm cat.out
853 $ hg cat -r a381d2c8c80e normal3
853 $ hg cat -r a381d2c8c80e normal3
854 normal3-modified
854 normal3-modified
855
855
856 Test that renaming a largefile results in correct output for status
856 Test that renaming a largefile results in correct output for status
857
857
858 $ hg rename sub/large4 large4-renamed
858 $ hg rename sub/large4 large4-renamed
859 $ hg commit -m "test rename output"
859 $ hg commit -m "test rename output"
860 Invoking status precommit hook
860 Invoking status precommit hook
861 A large4-renamed
861 A large4-renamed
862 R sub/large4
862 R sub/large4
863 $ cat large4-renamed
863 $ cat large4-renamed
864 large4-modified
864 large4-modified
865 $ cd sub2
865 $ cd sub2
866 $ hg rename large6 large6-renamed
866 $ hg rename large6 large6-renamed
867 $ hg st
867 $ hg st
868 A sub2/large6-renamed
868 A sub2/large6-renamed
869 R sub2/large6
869 R sub2/large6
870 $ cd ..
870 $ cd ..
871
871
872 Test --normal flag
872 Test --normal flag
873
873
874 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
874 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
875 $ hg add --normal --large new-largefile
875 $ hg add --normal --large new-largefile
876 abort: --normal cannot be used with --large
876 abort: --normal cannot be used with --large
877 [255]
877 [255]
878 $ hg add --normal new-largefile
878 $ hg add --normal new-largefile
879 new-largefile: up to 69 MB of RAM may be required to manage this file
879 new-largefile: up to 69 MB of RAM may be required to manage this file
880 (use 'hg revert new-largefile' to cancel the pending addition)
880 (use 'hg revert new-largefile' to cancel the pending addition)
881 $ cd ..
881 $ cd ..
882
882
883 vanilla clients not locked out from largefiles servers on vanilla repos
883 vanilla clients not locked out from largefiles servers on vanilla repos
884 $ mkdir r1
884 $ mkdir r1
885 $ cd r1
885 $ cd r1
886 $ hg init
886 $ hg init
887 $ echo c1 > f1
887 $ echo c1 > f1
888 $ hg add f1
888 $ hg add f1
889 $ hg commit -m "m1"
889 $ hg commit -m "m1"
890 Invoking status precommit hook
890 Invoking status precommit hook
891 A f1
891 A f1
892 $ cd ..
892 $ cd ..
893 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
893 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
894 $ cat hg.pid >> $DAEMON_PIDS
894 $ cat hg.pid >> $DAEMON_PIDS
895 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
895 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
896 requesting all changes
896 requesting all changes
897 adding changesets
897 adding changesets
898 adding manifests
898 adding manifests
899 adding file changes
899 adding file changes
900 added 1 changesets with 1 changes to 1 files
900 added 1 changesets with 1 changes to 1 files
901 updating to branch default
901 updating to branch default
902 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
902 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
903
903
904 largefiles clients still work with vanilla servers
904 largefiles clients still work with vanilla servers
905 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
905 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
906 $ cat hg.pid >> $DAEMON_PIDS
906 $ cat hg.pid >> $DAEMON_PIDS
907 $ hg clone http://localhost:$HGPORT1 r3
907 $ hg clone http://localhost:$HGPORT1 r3
908 requesting all changes
908 requesting all changes
909 adding changesets
909 adding changesets
910 adding manifests
910 adding manifests
911 adding file changes
911 adding file changes
912 added 1 changesets with 1 changes to 1 files
912 added 1 changesets with 1 changes to 1 files
913 updating to branch default
913 updating to branch default
914 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
914 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
915
915
916 vanilla clients locked out from largefiles http repos
916 vanilla clients locked out from largefiles http repos
917 $ mkdir r4
917 $ mkdir r4
918 $ cd r4
918 $ cd r4
919 $ hg init
919 $ hg init
920 $ echo c1 > f1
920 $ echo c1 > f1
921 $ hg add --large f1
921 $ hg add --large f1
922 $ hg commit -m "m1"
922 $ hg commit -m "m1"
923 Invoking status precommit hook
923 Invoking status precommit hook
924 A f1
924 A f1
925 $ cd ..
925 $ cd ..
926 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
926 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
927 $ cat hg.pid >> $DAEMON_PIDS
927 $ cat hg.pid >> $DAEMON_PIDS
928 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
928 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
929 abort: remote error:
929 abort: remote error:
930
930
931 This repository uses the largefiles extension.
931 This repository uses the largefiles extension.
932
932
933 Please enable it in your Mercurial config file.
933 Please enable it in your Mercurial config file.
934 [255]
934 [255]
935
935
936 used all HGPORTs, kill all daemons
936 used all HGPORTs, kill all daemons
937 $ "$TESTDIR/killdaemons.py"
937 $ "$TESTDIR/killdaemons.py"
938
938
939 vanilla clients locked out from largefiles ssh repos
939 vanilla clients locked out from largefiles ssh repos
940 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
940 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
941 abort: remote error:
941 abort: remote error:
942
942
943 This repository uses the largefiles extension.
943 This repository uses the largefiles extension.
944
944
945 Please enable it in your Mercurial config file.
945 Please enable it in your Mercurial config file.
946 [255]
946 [255]
947
947
948 largefiles clients refuse to push largefiles repos to vanilla servers
948 largefiles clients refuse to push largefiles repos to vanilla servers
949 $ mkdir r6
949 $ mkdir r6
950 $ cd r6
950 $ cd r6
951 $ hg init
951 $ hg init
952 $ echo c1 > f1
952 $ echo c1 > f1
953 $ hg add f1
953 $ hg add f1
954 $ hg commit -m "m1"
954 $ hg commit -m "m1"
955 Invoking status precommit hook
955 Invoking status precommit hook
956 A f1
956 A f1
957 $ cat >> .hg/hgrc <<!
957 $ cat >> .hg/hgrc <<!
958 > [web]
958 > [web]
959 > push_ssl = false
959 > push_ssl = false
960 > allow_push = *
960 > allow_push = *
961 > !
961 > !
962 $ cd ..
962 $ cd ..
963 $ hg clone r6 r7
963 $ hg clone r6 r7
964 updating to branch default
964 updating to branch default
965 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
965 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
966 $ cd r7
966 $ cd r7
967 $ echo c2 > f2
967 $ echo c2 > f2
968 $ hg add --large f2
968 $ hg add --large f2
969 $ hg commit -m "m2"
969 $ hg commit -m "m2"
970 Invoking status precommit hook
970 Invoking status precommit hook
971 A f2
971 A f2
972 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
972 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
973 $ cat ../hg.pid >> $DAEMON_PIDS
973 $ cat ../hg.pid >> $DAEMON_PIDS
974 $ hg push http://localhost:$HGPORT
974 $ hg push http://localhost:$HGPORT
975 pushing to http://localhost:$HGPORT/
975 pushing to http://localhost:$HGPORT/
976 searching for changes
976 searching for changes
977 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
977 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
978 [255]
978 [255]
979 $ cd ..
979 $ cd ..
980
980
981 putlfile errors are shown (issue3123)
981 putlfile errors are shown (issue3123)
982 Corrupt the cached largefile in r7
982 Corrupt the cached largefile in r7
983 $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8
983 $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8
984 $ hg init empty
984 $ hg init empty
985 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
985 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
986 > --config 'web.allow_push=*' --config web.push_ssl=False
986 > --config 'web.allow_push=*' --config web.push_ssl=False
987 $ cat hg.pid >> $DAEMON_PIDS
987 $ cat hg.pid >> $DAEMON_PIDS
988 $ hg push -R r7 http://localhost:$HGPORT1
988 $ hg push -R r7 http://localhost:$HGPORT1
989 pushing to http://localhost:$HGPORT1/
989 pushing to http://localhost:$HGPORT1/
990 searching for changes
990 searching for changes
991 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
991 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
992 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/
992 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/
993 [255]
993 [255]
994 $ rm -rf empty
994 $ rm -rf empty
995
995
996 Push a largefiles repository to a served empty repository
996 Push a largefiles repository to a served empty repository
997 $ hg init r8
997 $ hg init r8
998 $ echo c3 > r8/f1
998 $ echo c3 > r8/f1
999 $ hg add --large r8/f1 -R r8
999 $ hg add --large r8/f1 -R r8
1000 $ hg commit -m "m1" -R r8
1000 $ hg commit -m "m1" -R r8
1001 Invoking status precommit hook
1001 Invoking status precommit hook
1002 A f1
1002 A f1
1003 $ hg init empty
1003 $ hg init empty
1004 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1004 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1005 > --config 'web.allow_push=*' --config web.push_ssl=False
1005 > --config 'web.allow_push=*' --config web.push_ssl=False
1006 $ cat hg.pid >> $DAEMON_PIDS
1006 $ cat hg.pid >> $DAEMON_PIDS
1007 $ rm ${USERCACHE}/*
1007 $ rm ${USERCACHE}/*
1008 $ hg push -R r8 http://localhost:$HGPORT2
1008 $ hg push -R r8 http://localhost:$HGPORT2
1009 pushing to http://localhost:$HGPORT2/
1009 pushing to http://localhost:$HGPORT2/
1010 searching for changes
1010 searching for changes
1011 searching for changes
1011 searching for changes
1012 remote: adding changesets
1012 remote: adding changesets
1013 remote: adding manifests
1013 remote: adding manifests
1014 remote: adding file changes
1014 remote: adding file changes
1015 remote: added 1 changesets with 1 changes to 1 files
1015 remote: added 1 changesets with 1 changes to 1 files
1016 $ rm -rf empty
1016 $ rm -rf empty
1017
1017
1018 used all HGPORTs, kill all daemons
1018 used all HGPORTs, kill all daemons
1019 $ "$TESTDIR/killdaemons.py"
1019 $ "$TESTDIR/killdaemons.py"
1020
1020
1021 #if unix-permissions
1022
1021 Clone a local repository owned by another user
1023 Clone a local repository owned by another user
1022 We have to simulate that here by setting $HOME and removing write permissions
1024 We have to simulate that here by setting $HOME and removing write permissions
1023 $ ORIGHOME="$HOME"
1025 $ ORIGHOME="$HOME"
1024 $ mkdir alice
1026 $ mkdir alice
1025 $ HOME="`pwd`/alice"
1027 $ HOME="`pwd`/alice"
1026 $ cd alice
1028 $ cd alice
1027 $ hg init pubrepo
1029 $ hg init pubrepo
1028 $ cd pubrepo
1030 $ cd pubrepo
1029 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1031 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1030 $ hg add --large a-large-file
1032 $ hg add --large a-large-file
1031 $ hg commit -m "Add a large file"
1033 $ hg commit -m "Add a large file"
1032 Invoking status precommit hook
1034 Invoking status precommit hook
1033 A a-large-file
1035 A a-large-file
1034 $ cd ..
1036 $ cd ..
1035 $ chmod -R a-w pubrepo
1037 $ chmod -R a-w pubrepo
1036 $ cd ..
1038 $ cd ..
1037 $ mkdir bob
1039 $ mkdir bob
1038 $ HOME="`pwd`/bob"
1040 $ HOME="`pwd`/bob"
1039 $ cd bob
1041 $ cd bob
1040 $ hg clone --pull ../alice/pubrepo pubrepo
1042 $ hg clone --pull ../alice/pubrepo pubrepo
1041 requesting all changes
1043 requesting all changes
1042 adding changesets
1044 adding changesets
1043 adding manifests
1045 adding manifests
1044 adding file changes
1046 adding file changes
1045 added 1 changesets with 1 changes to 1 files
1047 added 1 changesets with 1 changes to 1 files
1046 updating to branch default
1048 updating to branch default
1047 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1049 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1048 getting changed largefiles
1050 getting changed largefiles
1049 1 largefiles updated, 0 removed
1051 1 largefiles updated, 0 removed
1050 $ cd ..
1052 $ cd ..
1051 $ chmod -R u+w alice/pubrepo
1053 $ chmod -R u+w alice/pubrepo
1052 $ HOME="$ORIGHOME"
1054 $ HOME="$ORIGHOME"
1053
1055
1056 #endif
1057
1054 #if symlink
1058 #if symlink
1055
1059
1056 Symlink to a large largefile should behave the same as a symlink to a normal file
1060 Symlink to a large largefile should behave the same as a symlink to a normal file
1057 $ hg init largesymlink
1061 $ hg init largesymlink
1058 $ cd largesymlink
1062 $ cd largesymlink
1059 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1063 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1060 $ hg add --large largefile
1064 $ hg add --large largefile
1061 $ hg commit -m "commit a large file"
1065 $ hg commit -m "commit a large file"
1062 Invoking status precommit hook
1066 Invoking status precommit hook
1063 A largefile
1067 A largefile
1064 $ ln -s largefile largelink
1068 $ ln -s largefile largelink
1065 $ hg add largelink
1069 $ hg add largelink
1066 $ hg commit -m "commit a large symlink"
1070 $ hg commit -m "commit a large symlink"
1067 Invoking status precommit hook
1071 Invoking status precommit hook
1068 A largelink
1072 A largelink
1069 $ rm -f largelink
1073 $ rm -f largelink
1070 $ hg up >/dev/null
1074 $ hg up >/dev/null
1071 $ test -f largelink
1075 $ test -f largelink
1072 [1]
1076 [1]
1073 $ test -L largelink
1077 $ test -L largelink
1074 [1]
1078 [1]
1075 $ rm -f largelink # make next part of the test independent of the previous
1079 $ rm -f largelink # make next part of the test independent of the previous
1076 $ hg up -C >/dev/null
1080 $ hg up -C >/dev/null
1077 $ test -f largelink
1081 $ test -f largelink
1078 $ test -L largelink
1082 $ test -L largelink
1079 $ cd ..
1083 $ cd ..
1080
1084
1081 #endif
1085 #endif
1082
1086
1083 test for pattern matching on 'hg status':
1087 test for pattern matching on 'hg status':
1084 to boost performance, largefiles checks whether specified patterns are
1088 to boost performance, largefiles checks whether specified patterns are
1085 related to largefiles in working directory (NOT to STANDIN) or not.
1089 related to largefiles in working directory (NOT to STANDIN) or not.
1086
1090
1087 $ hg init statusmatch
1091 $ hg init statusmatch
1088 $ cd statusmatch
1092 $ cd statusmatch
1089
1093
1090 $ mkdir -p a/b/c/d
1094 $ mkdir -p a/b/c/d
1091 $ echo normal > a/b/c/d/e.normal.txt
1095 $ echo normal > a/b/c/d/e.normal.txt
1092 $ hg add a/b/c/d/e.normal.txt
1096 $ hg add a/b/c/d/e.normal.txt
1093 $ echo large > a/b/c/d/e.large.txt
1097 $ echo large > a/b/c/d/e.large.txt
1094 $ hg add --large a/b/c/d/e.large.txt
1098 $ hg add --large a/b/c/d/e.large.txt
1095 $ mkdir -p a/b/c/x
1099 $ mkdir -p a/b/c/x
1096 $ echo normal > a/b/c/x/y.normal.txt
1100 $ echo normal > a/b/c/x/y.normal.txt
1097 $ hg add a/b/c/x/y.normal.txt
1101 $ hg add a/b/c/x/y.normal.txt
1098 $ hg commit -m 'add files'
1102 $ hg commit -m 'add files'
1099 Invoking status precommit hook
1103 Invoking status precommit hook
1100 A a/b/c/d/e.large.txt
1104 A a/b/c/d/e.large.txt
1101 A a/b/c/d/e.normal.txt
1105 A a/b/c/d/e.normal.txt
1102 A a/b/c/x/y.normal.txt
1106 A a/b/c/x/y.normal.txt
1103
1107
1104 (1) no pattern: no performance boost
1108 (1) no pattern: no performance boost
1105 $ hg status -A
1109 $ hg status -A
1106 C a/b/c/d/e.large.txt
1110 C a/b/c/d/e.large.txt
1107 C a/b/c/d/e.normal.txt
1111 C a/b/c/d/e.normal.txt
1108 C a/b/c/x/y.normal.txt
1112 C a/b/c/x/y.normal.txt
1109
1113
1110 (2) pattern not related to largefiles: performance boost
1114 (2) pattern not related to largefiles: performance boost
1111 $ hg status -A a/b/c/x
1115 $ hg status -A a/b/c/x
1112 C a/b/c/x/y.normal.txt
1116 C a/b/c/x/y.normal.txt
1113
1117
1114 (3) pattern related to largefiles: no performance boost
1118 (3) pattern related to largefiles: no performance boost
1115 $ hg status -A a/b/c/d
1119 $ hg status -A a/b/c/d
1116 C a/b/c/d/e.large.txt
1120 C a/b/c/d/e.large.txt
1117 C a/b/c/d/e.normal.txt
1121 C a/b/c/d/e.normal.txt
1118
1122
1119 (4) pattern related to STANDIN (not to largefiles): performance boost
1123 (4) pattern related to STANDIN (not to largefiles): performance boost
1120 $ hg status -A .hglf/a
1124 $ hg status -A .hglf/a
1121 C .hglf/a/b/c/d/e.large.txt
1125 C .hglf/a/b/c/d/e.large.txt
1122
1126
1123 (5) mixed case: no performance boost
1127 (5) mixed case: no performance boost
1124 $ hg status -A a/b/c/x a/b/c/d
1128 $ hg status -A a/b/c/x a/b/c/d
1125 C a/b/c/d/e.large.txt
1129 C a/b/c/d/e.large.txt
1126 C a/b/c/d/e.normal.txt
1130 C a/b/c/d/e.normal.txt
1127 C a/b/c/x/y.normal.txt
1131 C a/b/c/x/y.normal.txt
1128
1132
1129 verify that largefiles doesn't break filesets
1133 verify that largefiles doesn't break filesets
1130
1134
1131 $ hg log --rev . --exclude "set:binary()"
1135 $ hg log --rev . --exclude "set:binary()"
1132 changeset: 0:41bd42f10efa
1136 changeset: 0:41bd42f10efa
1133 tag: tip
1137 tag: tip
1134 user: test
1138 user: test
1135 date: Thu Jan 01 00:00:00 1970 +0000
1139 date: Thu Jan 01 00:00:00 1970 +0000
1136 summary: add files
1140 summary: add files
1137
1141
1138 verify that large files in subrepos handled properly
1142 verify that large files in subrepos handled properly
1139 $ hg init subrepo
1143 $ hg init subrepo
1140 $ echo "subrepo = subrepo" > .hgsub
1144 $ echo "subrepo = subrepo" > .hgsub
1141 $ hg add .hgsub
1145 $ hg add .hgsub
1142 $ hg ci -m "add subrepo"
1146 $ hg ci -m "add subrepo"
1143 Invoking status precommit hook
1147 Invoking status precommit hook
1144 A .hgsub
1148 A .hgsub
1145 ? .hgsubstate
1149 ? .hgsubstate
1146 $ echo "rev 1" > subrepo/large.txt
1150 $ echo "rev 1" > subrepo/large.txt
1147 $ hg -R subrepo add --large subrepo/large.txt
1151 $ hg -R subrepo add --large subrepo/large.txt
1148 $ hg sum
1152 $ hg sum
1149 parent: 1:8ee150ea2e9c tip
1153 parent: 1:8ee150ea2e9c tip
1150 add subrepo
1154 add subrepo
1151 branch: default
1155 branch: default
1152 commit: 1 subrepos
1156 commit: 1 subrepos
1153 update: (current)
1157 update: (current)
1154 $ hg st
1158 $ hg st
1155 $ hg st -S
1159 $ hg st -S
1156 A subrepo/large.txt
1160 A subrepo/large.txt
1157 $ hg ci -S -m "commit top repo"
1161 $ hg ci -S -m "commit top repo"
1158 committing subrepository subrepo
1162 committing subrepository subrepo
1159 Invoking status precommit hook
1163 Invoking status precommit hook
1160 A large.txt
1164 A large.txt
1161 Invoking status precommit hook
1165 Invoking status precommit hook
1162 M .hgsubstate
1166 M .hgsubstate
1163 # No differences
1167 # No differences
1164 $ hg st -S
1168 $ hg st -S
1165 $ hg sum
1169 $ hg sum
1166 parent: 2:ce4cd0c527a6 tip
1170 parent: 2:ce4cd0c527a6 tip
1167 commit top repo
1171 commit top repo
1168 branch: default
1172 branch: default
1169 commit: (clean)
1173 commit: (clean)
1170 update: (current)
1174 update: (current)
1171 $ echo "rev 2" > subrepo/large.txt
1175 $ echo "rev 2" > subrepo/large.txt
1172 $ hg st -S
1176 $ hg st -S
1173 M subrepo/large.txt
1177 M subrepo/large.txt
1174 $ hg sum
1178 $ hg sum
1175 parent: 2:ce4cd0c527a6 tip
1179 parent: 2:ce4cd0c527a6 tip
1176 commit top repo
1180 commit top repo
1177 branch: default
1181 branch: default
1178 commit: 1 subrepos
1182 commit: 1 subrepos
1179 update: (current)
1183 update: (current)
1180 $ hg ci -m "this commit should fail without -S"
1184 $ hg ci -m "this commit should fail without -S"
1181 abort: uncommitted changes in subrepo subrepo
1185 abort: uncommitted changes in subrepo subrepo
1182 (use --subrepos for recursive commit)
1186 (use --subrepos for recursive commit)
1183 [255]
1187 [255]
1184
1188
1185 Add a normal file to the subrepo, then test archiving
1189 Add a normal file to the subrepo, then test archiving
1186
1190
1187 $ echo 'normal file' > subrepo/normal.txt
1191 $ echo 'normal file' > subrepo/normal.txt
1188 $ hg -R subrepo add subrepo/normal.txt
1192 $ hg -R subrepo add subrepo/normal.txt
1189
1193
1190 Lock in subrepo, otherwise the change isn't archived
1194 Lock in subrepo, otherwise the change isn't archived
1191
1195
1192 $ hg ci -S -m "add normal file to top level"
1196 $ hg ci -S -m "add normal file to top level"
1193 committing subrepository subrepo
1197 committing subrepository subrepo
1194 Invoking status precommit hook
1198 Invoking status precommit hook
1195 M large.txt
1199 M large.txt
1196 A normal.txt
1200 A normal.txt
1197 Invoking status precommit hook
1201 Invoking status precommit hook
1198 M .hgsubstate
1202 M .hgsubstate
1199 $ hg archive -S lf_subrepo_archive
1203 $ hg archive -S lf_subrepo_archive
1200 $ find lf_subrepo_archive | sort
1204 $ find lf_subrepo_archive | sort
1201 lf_subrepo_archive
1205 lf_subrepo_archive
1202 lf_subrepo_archive/.hg_archival.txt
1206 lf_subrepo_archive/.hg_archival.txt
1203 lf_subrepo_archive/.hgsub
1207 lf_subrepo_archive/.hgsub
1204 lf_subrepo_archive/.hgsubstate
1208 lf_subrepo_archive/.hgsubstate
1205 lf_subrepo_archive/a
1209 lf_subrepo_archive/a
1206 lf_subrepo_archive/a/b
1210 lf_subrepo_archive/a/b
1207 lf_subrepo_archive/a/b/c
1211 lf_subrepo_archive/a/b/c
1208 lf_subrepo_archive/a/b/c/d
1212 lf_subrepo_archive/a/b/c/d
1209 lf_subrepo_archive/a/b/c/d/e.large.txt
1213 lf_subrepo_archive/a/b/c/d/e.large.txt
1210 lf_subrepo_archive/a/b/c/d/e.normal.txt
1214 lf_subrepo_archive/a/b/c/d/e.normal.txt
1211 lf_subrepo_archive/a/b/c/x
1215 lf_subrepo_archive/a/b/c/x
1212 lf_subrepo_archive/a/b/c/x/y.normal.txt
1216 lf_subrepo_archive/a/b/c/x/y.normal.txt
1213 lf_subrepo_archive/subrepo
1217 lf_subrepo_archive/subrepo
1214 lf_subrepo_archive/subrepo/large.txt
1218 lf_subrepo_archive/subrepo/large.txt
1215 lf_subrepo_archive/subrepo/normal.txt
1219 lf_subrepo_archive/subrepo/normal.txt
1216
1220
1217 $ cd ..
1221 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now