##// END OF EJS Templates
largefiles: fix download of largefiles from an empty list of changesets...
Mads Kiilerich -
r18722:f0aa8bbf stable
parent child Browse files
Show More
@@ -1,570 +1,571
1 # Copyright 2009-2010 Gregory P. Ward
1 # Copyright 2009-2010 Gregory P. Ward
2 # Copyright 2009-2010 Intelerad Medical Systems Incorporated
2 # Copyright 2009-2010 Intelerad Medical Systems Incorporated
3 # Copyright 2010-2011 Fog Creek Software
3 # Copyright 2010-2011 Fog Creek Software
4 # Copyright 2010-2011 Unity Technologies
4 # Copyright 2010-2011 Unity Technologies
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 '''High-level command function for lfconvert, plus the cmdtable.'''
9 '''High-level command function for lfconvert, plus the cmdtable.'''
10
10
11 import os
11 import os
12 import shutil
12 import shutil
13
13
14 from mercurial import util, match as match_, hg, node, context, error, \
14 from mercurial import util, match as match_, hg, node, context, error, \
15 cmdutil, scmutil, commands
15 cmdutil, scmutil, commands
16 from mercurial.i18n import _
16 from mercurial.i18n import _
17 from mercurial.lock import release
17 from mercurial.lock import release
18
18
19 import lfutil
19 import lfutil
20 import basestore
20 import basestore
21
21
22 # -- Commands ----------------------------------------------------------
22 # -- Commands ----------------------------------------------------------
23
23
24 def lfconvert(ui, src, dest, *pats, **opts):
24 def lfconvert(ui, src, dest, *pats, **opts):
25 '''convert a normal repository to a largefiles repository
25 '''convert a normal repository to a largefiles repository
26
26
27 Convert repository SOURCE to a new repository DEST, identical to
27 Convert repository SOURCE to a new repository DEST, identical to
28 SOURCE except that certain files will be converted as largefiles:
28 SOURCE except that certain files will be converted as largefiles:
29 specifically, any file that matches any PATTERN *or* whose size is
29 specifically, any file that matches any PATTERN *or* whose size is
30 above the minimum size threshold is converted as a largefile. The
30 above the minimum size threshold is converted as a largefile. The
31 size used to determine whether or not to track a file as a
31 size used to determine whether or not to track a file as a
32 largefile is the size of the first version of the file. The
32 largefile is the size of the first version of the file. The
33 minimum size can be specified either with --size or in
33 minimum size can be specified either with --size or in
34 configuration as ``largefiles.size``.
34 configuration as ``largefiles.size``.
35
35
36 After running this command you will need to make sure that
36 After running this command you will need to make sure that
37 largefiles is enabled anywhere you intend to push the new
37 largefiles is enabled anywhere you intend to push the new
38 repository.
38 repository.
39
39
40 Use --to-normal to convert largefiles back to normal files; after
40 Use --to-normal to convert largefiles back to normal files; after
41 this, the DEST repository can be used without largefiles at all.'''
41 this, the DEST repository can be used without largefiles at all.'''
42
42
43 if opts['to_normal']:
43 if opts['to_normal']:
44 tolfile = False
44 tolfile = False
45 else:
45 else:
46 tolfile = True
46 tolfile = True
47 size = lfutil.getminsize(ui, True, opts.get('size'), default=None)
47 size = lfutil.getminsize(ui, True, opts.get('size'), default=None)
48
48
49 if not hg.islocal(src):
49 if not hg.islocal(src):
50 raise util.Abort(_('%s is not a local Mercurial repo') % src)
50 raise util.Abort(_('%s is not a local Mercurial repo') % src)
51 if not hg.islocal(dest):
51 if not hg.islocal(dest):
52 raise util.Abort(_('%s is not a local Mercurial repo') % dest)
52 raise util.Abort(_('%s is not a local Mercurial repo') % dest)
53
53
54 rsrc = hg.repository(ui, src)
54 rsrc = hg.repository(ui, src)
55 ui.status(_('initializing destination %s\n') % dest)
55 ui.status(_('initializing destination %s\n') % dest)
56 rdst = hg.repository(ui, dest, create=True)
56 rdst = hg.repository(ui, dest, create=True)
57
57
58 success = False
58 success = False
59 dstwlock = dstlock = None
59 dstwlock = dstlock = None
60 try:
60 try:
61 # Lock destination to prevent modification while it is converted to.
61 # Lock destination to prevent modification while it is converted to.
62 # Don't need to lock src because we are just reading from its history
62 # Don't need to lock src because we are just reading from its history
63 # which can't change.
63 # which can't change.
64 dstwlock = rdst.wlock()
64 dstwlock = rdst.wlock()
65 dstlock = rdst.lock()
65 dstlock = rdst.lock()
66
66
67 # Get a list of all changesets in the source. The easy way to do this
67 # Get a list of all changesets in the source. The easy way to do this
68 # is to simply walk the changelog, using changelog.nodesbetween().
68 # is to simply walk the changelog, using changelog.nodesbetween().
69 # Take a look at mercurial/revlog.py:639 for more details.
69 # Take a look at mercurial/revlog.py:639 for more details.
70 # Use a generator instead of a list to decrease memory usage
70 # Use a generator instead of a list to decrease memory usage
71 ctxs = (rsrc[ctx] for ctx in rsrc.changelog.nodesbetween(None,
71 ctxs = (rsrc[ctx] for ctx in rsrc.changelog.nodesbetween(None,
72 rsrc.heads())[0])
72 rsrc.heads())[0])
73 revmap = {node.nullid: node.nullid}
73 revmap = {node.nullid: node.nullid}
74 if tolfile:
74 if tolfile:
75 lfiles = set()
75 lfiles = set()
76 normalfiles = set()
76 normalfiles = set()
77 if not pats:
77 if not pats:
78 pats = ui.configlist(lfutil.longname, 'patterns', default=[])
78 pats = ui.configlist(lfutil.longname, 'patterns', default=[])
79 if pats:
79 if pats:
80 matcher = match_.match(rsrc.root, '', list(pats))
80 matcher = match_.match(rsrc.root, '', list(pats))
81 else:
81 else:
82 matcher = None
82 matcher = None
83
83
84 lfiletohash = {}
84 lfiletohash = {}
85 for ctx in ctxs:
85 for ctx in ctxs:
86 ui.progress(_('converting revisions'), ctx.rev(),
86 ui.progress(_('converting revisions'), ctx.rev(),
87 unit=_('revision'), total=rsrc['tip'].rev())
87 unit=_('revision'), total=rsrc['tip'].rev())
88 _lfconvert_addchangeset(rsrc, rdst, ctx, revmap,
88 _lfconvert_addchangeset(rsrc, rdst, ctx, revmap,
89 lfiles, normalfiles, matcher, size, lfiletohash)
89 lfiles, normalfiles, matcher, size, lfiletohash)
90 ui.progress(_('converting revisions'), None)
90 ui.progress(_('converting revisions'), None)
91
91
92 if os.path.exists(rdst.wjoin(lfutil.shortname)):
92 if os.path.exists(rdst.wjoin(lfutil.shortname)):
93 shutil.rmtree(rdst.wjoin(lfutil.shortname))
93 shutil.rmtree(rdst.wjoin(lfutil.shortname))
94
94
95 for f in lfiletohash.keys():
95 for f in lfiletohash.keys():
96 if os.path.isfile(rdst.wjoin(f)):
96 if os.path.isfile(rdst.wjoin(f)):
97 os.unlink(rdst.wjoin(f))
97 os.unlink(rdst.wjoin(f))
98 try:
98 try:
99 os.removedirs(os.path.dirname(rdst.wjoin(f)))
99 os.removedirs(os.path.dirname(rdst.wjoin(f)))
100 except OSError:
100 except OSError:
101 pass
101 pass
102
102
103 # If there were any files converted to largefiles, add largefiles
103 # If there were any files converted to largefiles, add largefiles
104 # to the destination repository's requirements.
104 # to the destination repository's requirements.
105 if lfiles:
105 if lfiles:
106 rdst.requirements.add('largefiles')
106 rdst.requirements.add('largefiles')
107 rdst._writerequirements()
107 rdst._writerequirements()
108 else:
108 else:
109 for ctx in ctxs:
109 for ctx in ctxs:
110 ui.progress(_('converting revisions'), ctx.rev(),
110 ui.progress(_('converting revisions'), ctx.rev(),
111 unit=_('revision'), total=rsrc['tip'].rev())
111 unit=_('revision'), total=rsrc['tip'].rev())
112 _addchangeset(ui, rsrc, rdst, ctx, revmap)
112 _addchangeset(ui, rsrc, rdst, ctx, revmap)
113
113
114 ui.progress(_('converting revisions'), None)
114 ui.progress(_('converting revisions'), None)
115 success = True
115 success = True
116 finally:
116 finally:
117 rdst.dirstate.clear()
117 rdst.dirstate.clear()
118 release(dstlock, dstwlock)
118 release(dstlock, dstwlock)
119 if not success:
119 if not success:
120 # we failed, remove the new directory
120 # we failed, remove the new directory
121 shutil.rmtree(rdst.root)
121 shutil.rmtree(rdst.root)
122
122
123 def _addchangeset(ui, rsrc, rdst, ctx, revmap):
123 def _addchangeset(ui, rsrc, rdst, ctx, revmap):
124 # Convert src parents to dst parents
124 # Convert src parents to dst parents
125 parents = _convertparents(ctx, revmap)
125 parents = _convertparents(ctx, revmap)
126
126
127 # Generate list of changed files
127 # Generate list of changed files
128 files = _getchangedfiles(ctx, parents)
128 files = _getchangedfiles(ctx, parents)
129
129
130 def getfilectx(repo, memctx, f):
130 def getfilectx(repo, memctx, f):
131 if lfutil.standin(f) in files:
131 if lfutil.standin(f) in files:
132 # if the file isn't in the manifest then it was removed
132 # if the file isn't in the manifest then it was removed
133 # or renamed, raise IOError to indicate this
133 # or renamed, raise IOError to indicate this
134 try:
134 try:
135 fctx = ctx.filectx(lfutil.standin(f))
135 fctx = ctx.filectx(lfutil.standin(f))
136 except error.LookupError:
136 except error.LookupError:
137 raise IOError
137 raise IOError
138 renamed = fctx.renamed()
138 renamed = fctx.renamed()
139 if renamed:
139 if renamed:
140 renamed = lfutil.splitstandin(renamed[0])
140 renamed = lfutil.splitstandin(renamed[0])
141
141
142 hash = fctx.data().strip()
142 hash = fctx.data().strip()
143 path = lfutil.findfile(rsrc, hash)
143 path = lfutil.findfile(rsrc, hash)
144
144
145 # If one file is missing, likely all files from this rev are
145 # If one file is missing, likely all files from this rev are
146 if path is None:
146 if path is None:
147 cachelfiles(ui, rsrc, ctx.node())
147 cachelfiles(ui, rsrc, ctx.node())
148 path = lfutil.findfile(rsrc, hash)
148 path = lfutil.findfile(rsrc, hash)
149
149
150 if path is None:
150 if path is None:
151 raise util.Abort(
151 raise util.Abort(
152 _("missing largefile \'%s\' from revision %s")
152 _("missing largefile \'%s\' from revision %s")
153 % (f, node.hex(ctx.node())))
153 % (f, node.hex(ctx.node())))
154
154
155 data = ''
155 data = ''
156 fd = None
156 fd = None
157 try:
157 try:
158 fd = open(path, 'rb')
158 fd = open(path, 'rb')
159 data = fd.read()
159 data = fd.read()
160 finally:
160 finally:
161 if fd:
161 if fd:
162 fd.close()
162 fd.close()
163 return context.memfilectx(f, data, 'l' in fctx.flags(),
163 return context.memfilectx(f, data, 'l' in fctx.flags(),
164 'x' in fctx.flags(), renamed)
164 'x' in fctx.flags(), renamed)
165 else:
165 else:
166 return _getnormalcontext(repo.ui, ctx, f, revmap)
166 return _getnormalcontext(repo.ui, ctx, f, revmap)
167
167
168 dstfiles = []
168 dstfiles = []
169 for file in files:
169 for file in files:
170 if lfutil.isstandin(file):
170 if lfutil.isstandin(file):
171 dstfiles.append(lfutil.splitstandin(file))
171 dstfiles.append(lfutil.splitstandin(file))
172 else:
172 else:
173 dstfiles.append(file)
173 dstfiles.append(file)
174 # Commit
174 # Commit
175 _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
175 _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
176
176
177 def _lfconvert_addchangeset(rsrc, rdst, ctx, revmap, lfiles, normalfiles,
177 def _lfconvert_addchangeset(rsrc, rdst, ctx, revmap, lfiles, normalfiles,
178 matcher, size, lfiletohash):
178 matcher, size, lfiletohash):
179 # Convert src parents to dst parents
179 # Convert src parents to dst parents
180 parents = _convertparents(ctx, revmap)
180 parents = _convertparents(ctx, revmap)
181
181
182 # Generate list of changed files
182 # Generate list of changed files
183 files = _getchangedfiles(ctx, parents)
183 files = _getchangedfiles(ctx, parents)
184
184
185 dstfiles = []
185 dstfiles = []
186 for f in files:
186 for f in files:
187 if f not in lfiles and f not in normalfiles:
187 if f not in lfiles and f not in normalfiles:
188 islfile = _islfile(f, ctx, matcher, size)
188 islfile = _islfile(f, ctx, matcher, size)
189 # If this file was renamed or copied then copy
189 # If this file was renamed or copied then copy
190 # the largefile-ness of its predecessor
190 # the largefile-ness of its predecessor
191 if f in ctx.manifest():
191 if f in ctx.manifest():
192 fctx = ctx.filectx(f)
192 fctx = ctx.filectx(f)
193 renamed = fctx.renamed()
193 renamed = fctx.renamed()
194 renamedlfile = renamed and renamed[0] in lfiles
194 renamedlfile = renamed and renamed[0] in lfiles
195 islfile |= renamedlfile
195 islfile |= renamedlfile
196 if 'l' in fctx.flags():
196 if 'l' in fctx.flags():
197 if renamedlfile:
197 if renamedlfile:
198 raise util.Abort(
198 raise util.Abort(
199 _('renamed/copied largefile %s becomes symlink')
199 _('renamed/copied largefile %s becomes symlink')
200 % f)
200 % f)
201 islfile = False
201 islfile = False
202 if islfile:
202 if islfile:
203 lfiles.add(f)
203 lfiles.add(f)
204 else:
204 else:
205 normalfiles.add(f)
205 normalfiles.add(f)
206
206
207 if f in lfiles:
207 if f in lfiles:
208 dstfiles.append(lfutil.standin(f))
208 dstfiles.append(lfutil.standin(f))
209 # largefile in manifest if it has not been removed/renamed
209 # largefile in manifest if it has not been removed/renamed
210 if f in ctx.manifest():
210 if f in ctx.manifest():
211 fctx = ctx.filectx(f)
211 fctx = ctx.filectx(f)
212 if 'l' in fctx.flags():
212 if 'l' in fctx.flags():
213 renamed = fctx.renamed()
213 renamed = fctx.renamed()
214 if renamed and renamed[0] in lfiles:
214 if renamed and renamed[0] in lfiles:
215 raise util.Abort(_('largefile %s becomes symlink') % f)
215 raise util.Abort(_('largefile %s becomes symlink') % f)
216
216
217 # largefile was modified, update standins
217 # largefile was modified, update standins
218 fullpath = rdst.wjoin(f)
218 fullpath = rdst.wjoin(f)
219 util.makedirs(os.path.dirname(fullpath))
219 util.makedirs(os.path.dirname(fullpath))
220 m = util.sha1('')
220 m = util.sha1('')
221 m.update(ctx[f].data())
221 m.update(ctx[f].data())
222 hash = m.hexdigest()
222 hash = m.hexdigest()
223 if f not in lfiletohash or lfiletohash[f] != hash:
223 if f not in lfiletohash or lfiletohash[f] != hash:
224 try:
224 try:
225 fd = open(fullpath, 'wb')
225 fd = open(fullpath, 'wb')
226 fd.write(ctx[f].data())
226 fd.write(ctx[f].data())
227 finally:
227 finally:
228 if fd:
228 if fd:
229 fd.close()
229 fd.close()
230 executable = 'x' in ctx[f].flags()
230 executable = 'x' in ctx[f].flags()
231 os.chmod(fullpath, lfutil.getmode(executable))
231 os.chmod(fullpath, lfutil.getmode(executable))
232 lfutil.writestandin(rdst, lfutil.standin(f), hash,
232 lfutil.writestandin(rdst, lfutil.standin(f), hash,
233 executable)
233 executable)
234 lfiletohash[f] = hash
234 lfiletohash[f] = hash
235 else:
235 else:
236 # normal file
236 # normal file
237 dstfiles.append(f)
237 dstfiles.append(f)
238
238
239 def getfilectx(repo, memctx, f):
239 def getfilectx(repo, memctx, f):
240 if lfutil.isstandin(f):
240 if lfutil.isstandin(f):
241 # if the file isn't in the manifest then it was removed
241 # if the file isn't in the manifest then it was removed
242 # or renamed, raise IOError to indicate this
242 # or renamed, raise IOError to indicate this
243 srcfname = lfutil.splitstandin(f)
243 srcfname = lfutil.splitstandin(f)
244 try:
244 try:
245 fctx = ctx.filectx(srcfname)
245 fctx = ctx.filectx(srcfname)
246 except error.LookupError:
246 except error.LookupError:
247 raise IOError
247 raise IOError
248 renamed = fctx.renamed()
248 renamed = fctx.renamed()
249 if renamed:
249 if renamed:
250 # standin is always a largefile because largefile-ness
250 # standin is always a largefile because largefile-ness
251 # doesn't change after rename or copy
251 # doesn't change after rename or copy
252 renamed = lfutil.standin(renamed[0])
252 renamed = lfutil.standin(renamed[0])
253
253
254 return context.memfilectx(f, lfiletohash[srcfname] + '\n', 'l' in
254 return context.memfilectx(f, lfiletohash[srcfname] + '\n', 'l' in
255 fctx.flags(), 'x' in fctx.flags(), renamed)
255 fctx.flags(), 'x' in fctx.flags(), renamed)
256 else:
256 else:
257 return _getnormalcontext(repo.ui, ctx, f, revmap)
257 return _getnormalcontext(repo.ui, ctx, f, revmap)
258
258
259 # Commit
259 # Commit
260 _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
260 _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
261
261
262 def _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap):
262 def _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap):
263 mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
263 mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
264 getfilectx, ctx.user(), ctx.date(), ctx.extra())
264 getfilectx, ctx.user(), ctx.date(), ctx.extra())
265 ret = rdst.commitctx(mctx)
265 ret = rdst.commitctx(mctx)
266 rdst.setparents(ret)
266 rdst.setparents(ret)
267 revmap[ctx.node()] = rdst.changelog.tip()
267 revmap[ctx.node()] = rdst.changelog.tip()
268
268
269 # Generate list of changed files
269 # Generate list of changed files
270 def _getchangedfiles(ctx, parents):
270 def _getchangedfiles(ctx, parents):
271 files = set(ctx.files())
271 files = set(ctx.files())
272 if node.nullid not in parents:
272 if node.nullid not in parents:
273 mc = ctx.manifest()
273 mc = ctx.manifest()
274 mp1 = ctx.parents()[0].manifest()
274 mp1 = ctx.parents()[0].manifest()
275 mp2 = ctx.parents()[1].manifest()
275 mp2 = ctx.parents()[1].manifest()
276 files |= (set(mp1) | set(mp2)) - set(mc)
276 files |= (set(mp1) | set(mp2)) - set(mc)
277 for f in mc:
277 for f in mc:
278 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None):
278 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None):
279 files.add(f)
279 files.add(f)
280 return files
280 return files
281
281
282 # Convert src parents to dst parents
282 # Convert src parents to dst parents
283 def _convertparents(ctx, revmap):
283 def _convertparents(ctx, revmap):
284 parents = []
284 parents = []
285 for p in ctx.parents():
285 for p in ctx.parents():
286 parents.append(revmap[p.node()])
286 parents.append(revmap[p.node()])
287 while len(parents) < 2:
287 while len(parents) < 2:
288 parents.append(node.nullid)
288 parents.append(node.nullid)
289 return parents
289 return parents
290
290
291 # Get memfilectx for a normal file
291 # Get memfilectx for a normal file
292 def _getnormalcontext(ui, ctx, f, revmap):
292 def _getnormalcontext(ui, ctx, f, revmap):
293 try:
293 try:
294 fctx = ctx.filectx(f)
294 fctx = ctx.filectx(f)
295 except error.LookupError:
295 except error.LookupError:
296 raise IOError
296 raise IOError
297 renamed = fctx.renamed()
297 renamed = fctx.renamed()
298 if renamed:
298 if renamed:
299 renamed = renamed[0]
299 renamed = renamed[0]
300
300
301 data = fctx.data()
301 data = fctx.data()
302 if f == '.hgtags':
302 if f == '.hgtags':
303 data = _converttags (ui, revmap, data)
303 data = _converttags (ui, revmap, data)
304 return context.memfilectx(f, data, 'l' in fctx.flags(),
304 return context.memfilectx(f, data, 'l' in fctx.flags(),
305 'x' in fctx.flags(), renamed)
305 'x' in fctx.flags(), renamed)
306
306
307 # Remap tag data using a revision map
307 # Remap tag data using a revision map
308 def _converttags(ui, revmap, data):
308 def _converttags(ui, revmap, data):
309 newdata = []
309 newdata = []
310 for line in data.splitlines():
310 for line in data.splitlines():
311 try:
311 try:
312 id, name = line.split(' ', 1)
312 id, name = line.split(' ', 1)
313 except ValueError:
313 except ValueError:
314 ui.warn(_('skipping incorrectly formatted tag %s\n'
314 ui.warn(_('skipping incorrectly formatted tag %s\n'
315 % line))
315 % line))
316 continue
316 continue
317 try:
317 try:
318 newid = node.bin(id)
318 newid = node.bin(id)
319 except TypeError:
319 except TypeError:
320 ui.warn(_('skipping incorrectly formatted id %s\n'
320 ui.warn(_('skipping incorrectly formatted id %s\n'
321 % id))
321 % id))
322 continue
322 continue
323 try:
323 try:
324 newdata.append('%s %s\n' % (node.hex(revmap[newid]),
324 newdata.append('%s %s\n' % (node.hex(revmap[newid]),
325 name))
325 name))
326 except KeyError:
326 except KeyError:
327 ui.warn(_('no mapping for id %s\n') % id)
327 ui.warn(_('no mapping for id %s\n') % id)
328 continue
328 continue
329 return ''.join(newdata)
329 return ''.join(newdata)
330
330
331 def _islfile(file, ctx, matcher, size):
331 def _islfile(file, ctx, matcher, size):
332 '''Return true if file should be considered a largefile, i.e.
332 '''Return true if file should be considered a largefile, i.e.
333 matcher matches it or it is larger than size.'''
333 matcher matches it or it is larger than size.'''
334 # never store special .hg* files as largefiles
334 # never store special .hg* files as largefiles
335 if file == '.hgtags' or file == '.hgignore' or file == '.hgsigs':
335 if file == '.hgtags' or file == '.hgignore' or file == '.hgsigs':
336 return False
336 return False
337 if matcher and matcher(file):
337 if matcher and matcher(file):
338 return True
338 return True
339 try:
339 try:
340 return ctx.filectx(file).size() >= size * 1024 * 1024
340 return ctx.filectx(file).size() >= size * 1024 * 1024
341 except error.LookupError:
341 except error.LookupError:
342 return False
342 return False
343
343
344 def uploadlfiles(ui, rsrc, rdst, files):
344 def uploadlfiles(ui, rsrc, rdst, files):
345 '''upload largefiles to the central store'''
345 '''upload largefiles to the central store'''
346
346
347 if not files:
347 if not files:
348 return
348 return
349
349
350 store = basestore._openstore(rsrc, rdst, put=True)
350 store = basestore._openstore(rsrc, rdst, put=True)
351
351
352 at = 0
352 at = 0
353 ui.debug("sending statlfile command for %d largefiles\n" % len(files))
353 ui.debug("sending statlfile command for %d largefiles\n" % len(files))
354 retval = store.exists(files)
354 retval = store.exists(files)
355 files = filter(lambda h: not retval[h], files)
355 files = filter(lambda h: not retval[h], files)
356 ui.debug("%d largefiles need to be uploaded\n" % len(files))
356 ui.debug("%d largefiles need to be uploaded\n" % len(files))
357
357
358 for hash in files:
358 for hash in files:
359 ui.progress(_('uploading largefiles'), at, unit='largefile',
359 ui.progress(_('uploading largefiles'), at, unit='largefile',
360 total=len(files))
360 total=len(files))
361 source = lfutil.findfile(rsrc, hash)
361 source = lfutil.findfile(rsrc, hash)
362 if not source:
362 if not source:
363 raise util.Abort(_('largefile %s missing from store'
363 raise util.Abort(_('largefile %s missing from store'
364 ' (needs to be uploaded)') % hash)
364 ' (needs to be uploaded)') % hash)
365 # XXX check for errors here
365 # XXX check for errors here
366 store.put(source, hash)
366 store.put(source, hash)
367 at += 1
367 at += 1
368 ui.progress(_('uploading largefiles'), None)
368 ui.progress(_('uploading largefiles'), None)
369
369
370 def verifylfiles(ui, repo, all=False, contents=False):
370 def verifylfiles(ui, repo, all=False, contents=False):
371 '''Verify that every big file revision in the current changeset
371 '''Verify that every big file revision in the current changeset
372 exists in the central store. With --contents, also verify that
372 exists in the central store. With --contents, also verify that
373 the contents of each big file revision are correct (SHA-1 hash
373 the contents of each big file revision are correct (SHA-1 hash
374 matches the revision ID). With --all, check every changeset in
374 matches the revision ID). With --all, check every changeset in
375 this repository.'''
375 this repository.'''
376 if all:
376 if all:
377 # Pass a list to the function rather than an iterator because we know a
377 # Pass a list to the function rather than an iterator because we know a
378 # list will work.
378 # list will work.
379 revs = range(len(repo))
379 revs = range(len(repo))
380 else:
380 else:
381 revs = ['.']
381 revs = ['.']
382
382
383 store = basestore._openstore(repo)
383 store = basestore._openstore(repo)
384 return store.verify(revs, contents=contents)
384 return store.verify(revs, contents=contents)
385
385
386 def debugdirstate(ui, repo):
386 def debugdirstate(ui, repo):
387 '''Show basic information for the largefiles dirstate'''
387 '''Show basic information for the largefiles dirstate'''
388 lfdirstate = lfutil.openlfdirstate(ui, repo)
388 lfdirstate = lfutil.openlfdirstate(ui, repo)
389 for file_, ent in sorted(lfdirstate._map.iteritems()):
389 for file_, ent in sorted(lfdirstate._map.iteritems()):
390 mode = '%3o' % (ent[1] & 0777 & ~util.umask)
390 mode = '%3o' % (ent[1] & 0777 & ~util.umask)
391 ui.write("%c %s %10d %s\n" % (ent[0], mode, ent[2], file_))
391 ui.write("%c %s %10d %s\n" % (ent[0], mode, ent[2], file_))
392
392
393 def cachelfiles(ui, repo, node, filelist=None):
393 def cachelfiles(ui, repo, node, filelist=None):
394 '''cachelfiles ensures that all largefiles needed by the specified revision
394 '''cachelfiles ensures that all largefiles needed by the specified revision
395 are present in the repository's largefile cache.
395 are present in the repository's largefile cache.
396
396
397 returns a tuple (cached, missing). cached is the list of files downloaded
397 returns a tuple (cached, missing). cached is the list of files downloaded
398 by this operation; missing is the list of files that were needed but could
398 by this operation; missing is the list of files that were needed but could
399 not be found.'''
399 not be found.'''
400 lfiles = lfutil.listlfiles(repo, node)
400 lfiles = lfutil.listlfiles(repo, node)
401 if filelist:
401 if filelist:
402 lfiles = set(lfiles) & set(filelist)
402 lfiles = set(lfiles) & set(filelist)
403 toget = []
403 toget = []
404
404
405 for lfile in lfiles:
405 for lfile in lfiles:
406 # If we are mid-merge, then we have to trust the standin that is in the
406 # If we are mid-merge, then we have to trust the standin that is in the
407 # working copy to have the correct hashvalue. This is because the
407 # working copy to have the correct hashvalue. This is because the
408 # original hg.merge() already updated the standin as part of the normal
408 # original hg.merge() already updated the standin as part of the normal
409 # merge process -- we just have to update the largefile to match.
409 # merge process -- we just have to update the largefile to match.
410 if (getattr(repo, "_ismerging", False) and
410 if (getattr(repo, "_ismerging", False) and
411 os.path.exists(repo.wjoin(lfutil.standin(lfile)))):
411 os.path.exists(repo.wjoin(lfutil.standin(lfile)))):
412 expectedhash = lfutil.readstandin(repo, lfile)
412 expectedhash = lfutil.readstandin(repo, lfile)
413 else:
413 else:
414 expectedhash = repo[node][lfutil.standin(lfile)].data().strip()
414 expectedhash = repo[node][lfutil.standin(lfile)].data().strip()
415
415
416 # if it exists and its hash matches, it might have been locally
416 # if it exists and its hash matches, it might have been locally
417 # modified before updating and the user chose 'local'. in this case,
417 # modified before updating and the user chose 'local'. in this case,
418 # it will not be in any store, so don't look for it.
418 # it will not be in any store, so don't look for it.
419 if ((not os.path.exists(repo.wjoin(lfile)) or
419 if ((not os.path.exists(repo.wjoin(lfile)) or
420 expectedhash != lfutil.hashfile(repo.wjoin(lfile))) and
420 expectedhash != lfutil.hashfile(repo.wjoin(lfile))) and
421 not lfutil.findfile(repo, expectedhash)):
421 not lfutil.findfile(repo, expectedhash)):
422 toget.append((lfile, expectedhash))
422 toget.append((lfile, expectedhash))
423
423
424 if toget:
424 if toget:
425 store = basestore._openstore(repo)
425 store = basestore._openstore(repo)
426 ret = store.get(toget)
426 ret = store.get(toget)
427 return ret
427 return ret
428
428
429 return ([], [])
429 return ([], [])
430
430
431 def downloadlfiles(ui, repo, rev=None):
431 def downloadlfiles(ui, repo, rev=None):
432 matchfn = scmutil.match(repo[None],
432 matchfn = scmutil.match(repo[None],
433 [repo.wjoin(lfutil.shortname)], {})
433 [repo.wjoin(lfutil.shortname)], {})
434 def prepare(ctx, fns):
434 def prepare(ctx, fns):
435 pass
435 pass
436 totalsuccess = 0
436 totalsuccess = 0
437 totalmissing = 0
437 totalmissing = 0
438 for ctx in cmdutil.walkchangerevs(repo, matchfn, {'rev' : rev},
438 if rev != []: # walkchangerevs on empty list would return all revs
439 prepare):
439 for ctx in cmdutil.walkchangerevs(repo, matchfn, {'rev' : rev},
440 success, missing = cachelfiles(ui, repo, ctx.node())
440 prepare):
441 totalsuccess += len(success)
441 success, missing = cachelfiles(ui, repo, ctx.node())
442 totalmissing += len(missing)
442 totalsuccess += len(success)
443 totalmissing += len(missing)
443 ui.status(_("%d additional largefiles cached\n") % totalsuccess)
444 ui.status(_("%d additional largefiles cached\n") % totalsuccess)
444 if totalmissing > 0:
445 if totalmissing > 0:
445 ui.status(_("%d largefiles failed to download\n") % totalmissing)
446 ui.status(_("%d largefiles failed to download\n") % totalmissing)
446 return totalsuccess, totalmissing
447 return totalsuccess, totalmissing
447
448
448 def updatelfiles(ui, repo, filelist=None, printmessage=True):
449 def updatelfiles(ui, repo, filelist=None, printmessage=True):
449 wlock = repo.wlock()
450 wlock = repo.wlock()
450 try:
451 try:
451 lfdirstate = lfutil.openlfdirstate(ui, repo)
452 lfdirstate = lfutil.openlfdirstate(ui, repo)
452 lfiles = set(lfutil.listlfiles(repo)) | set(lfdirstate)
453 lfiles = set(lfutil.listlfiles(repo)) | set(lfdirstate)
453
454
454 if filelist is not None:
455 if filelist is not None:
455 lfiles = [f for f in lfiles if f in filelist]
456 lfiles = [f for f in lfiles if f in filelist]
456
457
457 printed = False
458 printed = False
458 if printmessage and lfiles:
459 if printmessage and lfiles:
459 ui.status(_('getting changed largefiles\n'))
460 ui.status(_('getting changed largefiles\n'))
460 printed = True
461 printed = True
461 cachelfiles(ui, repo, '.', lfiles)
462 cachelfiles(ui, repo, '.', lfiles)
462
463
463 updated, removed = 0, 0
464 updated, removed = 0, 0
464 for f in lfiles:
465 for f in lfiles:
465 i = _updatelfile(repo, lfdirstate, f)
466 i = _updatelfile(repo, lfdirstate, f)
466 if i:
467 if i:
467 if i > 0:
468 if i > 0:
468 updated += i
469 updated += i
469 else:
470 else:
470 removed -= i
471 removed -= i
471 if printmessage and (removed or updated) and not printed:
472 if printmessage and (removed or updated) and not printed:
472 ui.status(_('getting changed largefiles\n'))
473 ui.status(_('getting changed largefiles\n'))
473 printed = True
474 printed = True
474
475
475 lfdirstate.write()
476 lfdirstate.write()
476 if printed and printmessage:
477 if printed and printmessage:
477 ui.status(_('%d largefiles updated, %d removed\n') % (updated,
478 ui.status(_('%d largefiles updated, %d removed\n') % (updated,
478 removed))
479 removed))
479 finally:
480 finally:
480 wlock.release()
481 wlock.release()
481
482
482 def _updatelfile(repo, lfdirstate, lfile):
483 def _updatelfile(repo, lfdirstate, lfile):
483 '''updates a single largefile and copies the state of its standin from
484 '''updates a single largefile and copies the state of its standin from
484 the repository's dirstate to its state in the lfdirstate.
485 the repository's dirstate to its state in the lfdirstate.
485
486
486 returns 1 if the file was modified, -1 if the file was removed, 0 if the
487 returns 1 if the file was modified, -1 if the file was removed, 0 if the
487 file was unchanged, and None if the needed largefile was missing from the
488 file was unchanged, and None if the needed largefile was missing from the
488 cache.'''
489 cache.'''
489 ret = 0
490 ret = 0
490 abslfile = repo.wjoin(lfile)
491 abslfile = repo.wjoin(lfile)
491 absstandin = repo.wjoin(lfutil.standin(lfile))
492 absstandin = repo.wjoin(lfutil.standin(lfile))
492 if os.path.exists(absstandin):
493 if os.path.exists(absstandin):
493 if os.path.exists(absstandin + '.orig') and os.path.exists(abslfile):
494 if os.path.exists(absstandin + '.orig') and os.path.exists(abslfile):
494 shutil.copyfile(abslfile, abslfile + '.orig')
495 shutil.copyfile(abslfile, abslfile + '.orig')
495 expecthash = lfutil.readstandin(repo, lfile)
496 expecthash = lfutil.readstandin(repo, lfile)
496 if (expecthash != '' and
497 if (expecthash != '' and
497 (not os.path.exists(abslfile) or
498 (not os.path.exists(abslfile) or
498 expecthash != lfutil.hashfile(abslfile))):
499 expecthash != lfutil.hashfile(abslfile))):
499 if not lfutil.copyfromcache(repo, expecthash, lfile):
500 if not lfutil.copyfromcache(repo, expecthash, lfile):
500 # use normallookup() to allocate entry in largefiles dirstate,
501 # use normallookup() to allocate entry in largefiles dirstate,
501 # because lack of it misleads lfilesrepo.status() into
502 # because lack of it misleads lfilesrepo.status() into
502 # recognition that such cache missing files are REMOVED.
503 # recognition that such cache missing files are REMOVED.
503 lfdirstate.normallookup(lfile)
504 lfdirstate.normallookup(lfile)
504 return None # don't try to set the mode
505 return None # don't try to set the mode
505 else:
506 else:
506 # Synchronize largefile dirstate to the last modified time of
507 # Synchronize largefile dirstate to the last modified time of
507 # the file
508 # the file
508 lfdirstate.normal(lfile)
509 lfdirstate.normal(lfile)
509 ret = 1
510 ret = 1
510 mode = os.stat(absstandin).st_mode
511 mode = os.stat(absstandin).st_mode
511 if mode != os.stat(abslfile).st_mode:
512 if mode != os.stat(abslfile).st_mode:
512 os.chmod(abslfile, mode)
513 os.chmod(abslfile, mode)
513 ret = 1
514 ret = 1
514 else:
515 else:
515 # Remove lfiles for which the standin is deleted, unless the
516 # Remove lfiles for which the standin is deleted, unless the
516 # lfile is added to the repository again. This happens when a
517 # lfile is added to the repository again. This happens when a
517 # largefile is converted back to a normal file: the standin
518 # largefile is converted back to a normal file: the standin
518 # disappears, but a new (normal) file appears as the lfile.
519 # disappears, but a new (normal) file appears as the lfile.
519 if os.path.exists(abslfile) and lfile not in repo[None]:
520 if os.path.exists(abslfile) and lfile not in repo[None]:
520 util.unlinkpath(abslfile)
521 util.unlinkpath(abslfile)
521 ret = -1
522 ret = -1
522 state = repo.dirstate[lfutil.standin(lfile)]
523 state = repo.dirstate[lfutil.standin(lfile)]
523 if state == 'n':
524 if state == 'n':
524 # When rebasing, we need to synchronize the standin and the largefile,
525 # When rebasing, we need to synchronize the standin and the largefile,
525 # because otherwise the largefile will get reverted. But for commit's
526 # because otherwise the largefile will get reverted. But for commit's
526 # sake, we have to mark the file as unclean.
527 # sake, we have to mark the file as unclean.
527 if getattr(repo, "_isrebasing", False):
528 if getattr(repo, "_isrebasing", False):
528 lfdirstate.normallookup(lfile)
529 lfdirstate.normallookup(lfile)
529 else:
530 else:
530 lfdirstate.normal(lfile)
531 lfdirstate.normal(lfile)
531 elif state == 'r':
532 elif state == 'r':
532 lfdirstate.remove(lfile)
533 lfdirstate.remove(lfile)
533 elif state == 'a':
534 elif state == 'a':
534 lfdirstate.add(lfile)
535 lfdirstate.add(lfile)
535 elif state == '?':
536 elif state == '?':
536 lfdirstate.drop(lfile)
537 lfdirstate.drop(lfile)
537 return ret
538 return ret
538
539
539 def catlfile(repo, lfile, rev, filename):
540 def catlfile(repo, lfile, rev, filename):
540 hash = lfutil.readstandin(repo, lfile, rev)
541 hash = lfutil.readstandin(repo, lfile, rev)
541 if not lfutil.inusercache(repo.ui, hash):
542 if not lfutil.inusercache(repo.ui, hash):
542 store = basestore._openstore(repo)
543 store = basestore._openstore(repo)
543 success, missing = store.get([(lfile, hash)])
544 success, missing = store.get([(lfile, hash)])
544 if len(success) != 1:
545 if len(success) != 1:
545 raise util.Abort(
546 raise util.Abort(
546 _('largefile %s is not in cache and could not be downloaded')
547 _('largefile %s is not in cache and could not be downloaded')
547 % lfile)
548 % lfile)
548 path = lfutil.usercachepath(repo.ui, hash)
549 path = lfutil.usercachepath(repo.ui, hash)
549 fpout = cmdutil.makefileobj(repo, filename)
550 fpout = cmdutil.makefileobj(repo, filename)
550 fpin = open(path, "rb")
551 fpin = open(path, "rb")
551 fpout.write(fpin.read())
552 fpout.write(fpin.read())
552 fpout.close()
553 fpout.close()
553 fpin.close()
554 fpin.close()
554 return 0
555 return 0
555
556
556 # -- hg commands declarations ------------------------------------------------
557 # -- hg commands declarations ------------------------------------------------
557
558
558 cmdtable = {
559 cmdtable = {
559 'lfconvert': (lfconvert,
560 'lfconvert': (lfconvert,
560 [('s', 'size', '',
561 [('s', 'size', '',
561 _('minimum size (MB) for files to be converted '
562 _('minimum size (MB) for files to be converted '
562 'as largefiles'),
563 'as largefiles'),
563 'SIZE'),
564 'SIZE'),
564 ('', 'to-normal', False,
565 ('', 'to-normal', False,
565 _('convert from a largefiles repo to a normal repo')),
566 _('convert from a largefiles repo to a normal repo')),
566 ],
567 ],
567 _('hg lfconvert SOURCE DEST [FILE ...]')),
568 _('hg lfconvert SOURCE DEST [FILE ...]')),
568 }
569 }
569
570
570 commands.inferrepo += " lfconvert"
571 commands.inferrepo += " lfconvert"
@@ -1,2115 +1,2125
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
2 $ mkdir "${USERCACHE}"
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > largefiles=
5 > largefiles=
6 > purge=
6 > purge=
7 > rebase=
7 > rebase=
8 > transplant=
8 > transplant=
9 > [phases]
9 > [phases]
10 > publish=False
10 > publish=False
11 > [largefiles]
11 > [largefiles]
12 > minsize=2
12 > minsize=2
13 > patterns=glob:**.dat
13 > patterns=glob:**.dat
14 > usercache=${USERCACHE}
14 > usercache=${USERCACHE}
15 > [hooks]
15 > [hooks]
16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
17 > EOF
17 > EOF
18
18
19 Create the repo with a couple of revisions of both large and normal
19 Create the repo with a couple of revisions of both large and normal
20 files.
20 files.
21 Test status and dirstate of largefiles and that summary output is correct.
21 Test status and dirstate of largefiles and that summary output is correct.
22
22
23 $ hg init a
23 $ hg init a
24 $ cd a
24 $ cd a
25 $ mkdir sub
25 $ mkdir sub
26 $ echo normal1 > normal1
26 $ echo normal1 > normal1
27 $ echo normal2 > sub/normal2
27 $ echo normal2 > sub/normal2
28 $ echo large1 > large1
28 $ echo large1 > large1
29 $ echo large2 > sub/large2
29 $ echo large2 > sub/large2
30 $ hg add normal1 sub/normal2
30 $ hg add normal1 sub/normal2
31 $ hg add --large large1 sub/large2
31 $ hg add --large large1 sub/large2
32 $ hg commit -m "add files"
32 $ hg commit -m "add files"
33 Invoking status precommit hook
33 Invoking status precommit hook
34 A large1
34 A large1
35 A normal1
35 A normal1
36 A sub/large2
36 A sub/large2
37 A sub/normal2
37 A sub/normal2
38 $ touch large1 sub/large2
38 $ touch large1 sub/large2
39 $ sleep 1
39 $ sleep 1
40 $ hg st
40 $ hg st
41 $ hg debugstate --nodates
41 $ hg debugstate --nodates
42 n 644 41 .hglf/large1
42 n 644 41 .hglf/large1
43 n 644 41 .hglf/sub/large2
43 n 644 41 .hglf/sub/large2
44 n 644 8 normal1
44 n 644 8 normal1
45 n 644 8 sub/normal2
45 n 644 8 sub/normal2
46 $ hg debugstate --large
46 $ hg debugstate --large
47 n 644 7 large1
47 n 644 7 large1
48 n 644 7 sub/large2
48 n 644 7 sub/large2
49 $ echo normal11 > normal1
49 $ echo normal11 > normal1
50 $ echo normal22 > sub/normal2
50 $ echo normal22 > sub/normal2
51 $ echo large11 > large1
51 $ echo large11 > large1
52 $ echo large22 > sub/large2
52 $ echo large22 > sub/large2
53 $ hg commit -m "edit files"
53 $ hg commit -m "edit files"
54 Invoking status precommit hook
54 Invoking status precommit hook
55 M large1
55 M large1
56 M normal1
56 M normal1
57 M sub/large2
57 M sub/large2
58 M sub/normal2
58 M sub/normal2
59 $ hg sum --large
59 $ hg sum --large
60 parent: 1:ce8896473775 tip
60 parent: 1:ce8896473775 tip
61 edit files
61 edit files
62 branch: default
62 branch: default
63 commit: (clean)
63 commit: (clean)
64 update: (current)
64 update: (current)
65 largefiles: (no remote repo)
65 largefiles: (no remote repo)
66
66
67 Commit preserved largefile contents.
67 Commit preserved largefile contents.
68
68
69 $ cat normal1
69 $ cat normal1
70 normal11
70 normal11
71 $ cat large1
71 $ cat large1
72 large11
72 large11
73 $ cat sub/normal2
73 $ cat sub/normal2
74 normal22
74 normal22
75 $ cat sub/large2
75 $ cat sub/large2
76 large22
76 large22
77
77
78 Test status, subdir and unknown files
78 Test status, subdir and unknown files
79
79
80 $ echo unknown > sub/unknown
80 $ echo unknown > sub/unknown
81 $ hg st --all
81 $ hg st --all
82 ? sub/unknown
82 ? sub/unknown
83 C large1
83 C large1
84 C normal1
84 C normal1
85 C sub/large2
85 C sub/large2
86 C sub/normal2
86 C sub/normal2
87 $ hg st --all sub
87 $ hg st --all sub
88 ? sub/unknown
88 ? sub/unknown
89 C sub/large2
89 C sub/large2
90 C sub/normal2
90 C sub/normal2
91 $ rm sub/unknown
91 $ rm sub/unknown
92
92
93 Test messages and exit codes for remove warning cases
93 Test messages and exit codes for remove warning cases
94
94
95 $ hg remove -A large1
95 $ hg remove -A large1
96 not removing large1: file still exists
96 not removing large1: file still exists
97 [1]
97 [1]
98 $ echo 'modified' > large1
98 $ echo 'modified' > large1
99 $ hg remove large1
99 $ hg remove large1
100 not removing large1: file is modified (use -f to force removal)
100 not removing large1: file is modified (use -f to force removal)
101 [1]
101 [1]
102 $ echo 'new' > normalnew
102 $ echo 'new' > normalnew
103 $ hg add normalnew
103 $ hg add normalnew
104 $ echo 'new' > largenew
104 $ echo 'new' > largenew
105 $ hg add --large normalnew
105 $ hg add --large normalnew
106 normalnew already tracked!
106 normalnew already tracked!
107 $ hg remove normalnew largenew
107 $ hg remove normalnew largenew
108 not removing largenew: file is untracked
108 not removing largenew: file is untracked
109 not removing normalnew: file has been marked for add (use forget to undo)
109 not removing normalnew: file has been marked for add (use forget to undo)
110 [1]
110 [1]
111 $ rm normalnew largenew
111 $ rm normalnew largenew
112 $ hg up -Cq
112 $ hg up -Cq
113
113
114 Remove both largefiles and normal files.
114 Remove both largefiles and normal files.
115
115
116 $ hg remove normal1 large1
116 $ hg remove normal1 large1
117 $ hg status large1
117 $ hg status large1
118 R large1
118 R large1
119 $ hg commit -m "remove files"
119 $ hg commit -m "remove files"
120 Invoking status precommit hook
120 Invoking status precommit hook
121 R large1
121 R large1
122 R normal1
122 R normal1
123 $ ls
123 $ ls
124 sub
124 sub
125 $ echo "testlargefile" > large1-test
125 $ echo "testlargefile" > large1-test
126 $ hg add --large large1-test
126 $ hg add --large large1-test
127 $ hg st
127 $ hg st
128 A large1-test
128 A large1-test
129 $ hg rm large1-test
129 $ hg rm large1-test
130 not removing large1-test: file has been marked for add (use forget to undo)
130 not removing large1-test: file has been marked for add (use forget to undo)
131 [1]
131 [1]
132 $ hg st
132 $ hg st
133 A large1-test
133 A large1-test
134 $ hg forget large1-test
134 $ hg forget large1-test
135 $ hg st
135 $ hg st
136 ? large1-test
136 ? large1-test
137 $ hg remove large1-test
137 $ hg remove large1-test
138 not removing large1-test: file is untracked
138 not removing large1-test: file is untracked
139 [1]
139 [1]
140 $ hg forget large1-test
140 $ hg forget large1-test
141 not removing large1-test: file is already untracked
141 not removing large1-test: file is already untracked
142 [1]
142 [1]
143 $ rm large1-test
143 $ rm large1-test
144
144
145 Copy both largefiles and normal files (testing that status output is correct).
145 Copy both largefiles and normal files (testing that status output is correct).
146
146
147 $ hg cp sub/normal2 normal1
147 $ hg cp sub/normal2 normal1
148 $ hg cp sub/large2 large1
148 $ hg cp sub/large2 large1
149 $ hg commit -m "copy files"
149 $ hg commit -m "copy files"
150 Invoking status precommit hook
150 Invoking status precommit hook
151 A large1
151 A large1
152 A normal1
152 A normal1
153 $ cat normal1
153 $ cat normal1
154 normal22
154 normal22
155 $ cat large1
155 $ cat large1
156 large22
156 large22
157
157
158 Test moving largefiles and verify that normal files are also unaffected.
158 Test moving largefiles and verify that normal files are also unaffected.
159
159
160 $ hg mv normal1 normal3
160 $ hg mv normal1 normal3
161 $ hg mv large1 large3
161 $ hg mv large1 large3
162 $ hg mv sub/normal2 sub/normal4
162 $ hg mv sub/normal2 sub/normal4
163 $ hg mv sub/large2 sub/large4
163 $ hg mv sub/large2 sub/large4
164 $ hg commit -m "move files"
164 $ hg commit -m "move files"
165 Invoking status precommit hook
165 Invoking status precommit hook
166 A large3
166 A large3
167 A normal3
167 A normal3
168 A sub/large4
168 A sub/large4
169 A sub/normal4
169 A sub/normal4
170 R large1
170 R large1
171 R normal1
171 R normal1
172 R sub/large2
172 R sub/large2
173 R sub/normal2
173 R sub/normal2
174 $ cat normal3
174 $ cat normal3
175 normal22
175 normal22
176 $ cat large3
176 $ cat large3
177 large22
177 large22
178 $ cat sub/normal4
178 $ cat sub/normal4
179 normal22
179 normal22
180 $ cat sub/large4
180 $ cat sub/large4
181 large22
181 large22
182
182
183 Test copies and moves from a directory other than root (issue3516)
183 Test copies and moves from a directory other than root (issue3516)
184
184
185 $ cd ..
185 $ cd ..
186 $ hg init lf_cpmv
186 $ hg init lf_cpmv
187 $ cd lf_cpmv
187 $ cd lf_cpmv
188 $ mkdir dira
188 $ mkdir dira
189 $ mkdir dira/dirb
189 $ mkdir dira/dirb
190 $ touch dira/dirb/largefile
190 $ touch dira/dirb/largefile
191 $ hg add --large dira/dirb/largefile
191 $ hg add --large dira/dirb/largefile
192 $ hg commit -m "added"
192 $ hg commit -m "added"
193 Invoking status precommit hook
193 Invoking status precommit hook
194 A dira/dirb/largefile
194 A dira/dirb/largefile
195 $ cd dira
195 $ cd dira
196 $ hg cp dirb/largefile foo/largefile
196 $ hg cp dirb/largefile foo/largefile
197 $ hg ci -m "deep copy"
197 $ hg ci -m "deep copy"
198 Invoking status precommit hook
198 Invoking status precommit hook
199 A dira/foo/largefile
199 A dira/foo/largefile
200 $ find . | sort
200 $ find . | sort
201 .
201 .
202 ./dirb
202 ./dirb
203 ./dirb/largefile
203 ./dirb/largefile
204 ./foo
204 ./foo
205 ./foo/largefile
205 ./foo/largefile
206 $ hg mv foo/largefile baz/largefile
206 $ hg mv foo/largefile baz/largefile
207 $ hg ci -m "moved"
207 $ hg ci -m "moved"
208 Invoking status precommit hook
208 Invoking status precommit hook
209 A dira/baz/largefile
209 A dira/baz/largefile
210 R dira/foo/largefile
210 R dira/foo/largefile
211 $ find . | sort
211 $ find . | sort
212 .
212 .
213 ./baz
213 ./baz
214 ./baz/largefile
214 ./baz/largefile
215 ./dirb
215 ./dirb
216 ./dirb/largefile
216 ./dirb/largefile
217 ./foo
217 ./foo
218 $ cd ../../a
218 $ cd ../../a
219
219
220 #if serve
220 #if serve
221 Test display of largefiles in hgweb
221 Test display of largefiles in hgweb
222
222
223 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
223 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
224 $ cat ../hg.pid >> $DAEMON_PIDS
224 $ cat ../hg.pid >> $DAEMON_PIDS
225 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
225 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
226 200 Script output follows
226 200 Script output follows
227
227
228
228
229 drwxr-xr-x sub
229 drwxr-xr-x sub
230 -rw-r--r-- 41 large3
230 -rw-r--r-- 41 large3
231 -rw-r--r-- 9 normal3
231 -rw-r--r-- 9 normal3
232
232
233
233
234 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
234 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
235 200 Script output follows
235 200 Script output follows
236
236
237
237
238 -rw-r--r-- 41 large4
238 -rw-r--r-- 41 large4
239 -rw-r--r-- 9 normal4
239 -rw-r--r-- 9 normal4
240
240
241
241
242 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
242 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
243 #endif
243 #endif
244
244
245 Test archiving the various revisions. These hit corner cases known with
245 Test archiving the various revisions. These hit corner cases known with
246 archiving.
246 archiving.
247
247
248 $ hg archive -r 0 ../archive0
248 $ hg archive -r 0 ../archive0
249 $ hg archive -r 1 ../archive1
249 $ hg archive -r 1 ../archive1
250 $ hg archive -r 2 ../archive2
250 $ hg archive -r 2 ../archive2
251 $ hg archive -r 3 ../archive3
251 $ hg archive -r 3 ../archive3
252 $ hg archive -r 4 ../archive4
252 $ hg archive -r 4 ../archive4
253 $ cd ../archive0
253 $ cd ../archive0
254 $ cat normal1
254 $ cat normal1
255 normal1
255 normal1
256 $ cat large1
256 $ cat large1
257 large1
257 large1
258 $ cat sub/normal2
258 $ cat sub/normal2
259 normal2
259 normal2
260 $ cat sub/large2
260 $ cat sub/large2
261 large2
261 large2
262 $ cd ../archive1
262 $ cd ../archive1
263 $ cat normal1
263 $ cat normal1
264 normal11
264 normal11
265 $ cat large1
265 $ cat large1
266 large11
266 large11
267 $ cat sub/normal2
267 $ cat sub/normal2
268 normal22
268 normal22
269 $ cat sub/large2
269 $ cat sub/large2
270 large22
270 large22
271 $ cd ../archive2
271 $ cd ../archive2
272 $ ls
272 $ ls
273 sub
273 sub
274 $ cat sub/normal2
274 $ cat sub/normal2
275 normal22
275 normal22
276 $ cat sub/large2
276 $ cat sub/large2
277 large22
277 large22
278 $ cd ../archive3
278 $ cd ../archive3
279 $ cat normal1
279 $ cat normal1
280 normal22
280 normal22
281 $ cat large1
281 $ cat large1
282 large22
282 large22
283 $ cat sub/normal2
283 $ cat sub/normal2
284 normal22
284 normal22
285 $ cat sub/large2
285 $ cat sub/large2
286 large22
286 large22
287 $ cd ../archive4
287 $ cd ../archive4
288 $ cat normal3
288 $ cat normal3
289 normal22
289 normal22
290 $ cat large3
290 $ cat large3
291 large22
291 large22
292 $ cat sub/normal4
292 $ cat sub/normal4
293 normal22
293 normal22
294 $ cat sub/large4
294 $ cat sub/large4
295 large22
295 large22
296
296
297 Commit corner case: specify files to commit.
297 Commit corner case: specify files to commit.
298
298
299 $ cd ../a
299 $ cd ../a
300 $ echo normal3 > normal3
300 $ echo normal3 > normal3
301 $ echo large3 > large3
301 $ echo large3 > large3
302 $ echo normal4 > sub/normal4
302 $ echo normal4 > sub/normal4
303 $ echo large4 > sub/large4
303 $ echo large4 > sub/large4
304 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
304 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
305 Invoking status precommit hook
305 Invoking status precommit hook
306 M large3
306 M large3
307 M normal3
307 M normal3
308 M sub/large4
308 M sub/large4
309 M sub/normal4
309 M sub/normal4
310 $ cat normal3
310 $ cat normal3
311 normal3
311 normal3
312 $ cat large3
312 $ cat large3
313 large3
313 large3
314 $ cat sub/normal4
314 $ cat sub/normal4
315 normal4
315 normal4
316 $ cat sub/large4
316 $ cat sub/large4
317 large4
317 large4
318
318
319 One more commit corner case: commit from a subdirectory.
319 One more commit corner case: commit from a subdirectory.
320
320
321 $ cd ../a
321 $ cd ../a
322 $ echo normal33 > normal3
322 $ echo normal33 > normal3
323 $ echo large33 > large3
323 $ echo large33 > large3
324 $ echo normal44 > sub/normal4
324 $ echo normal44 > sub/normal4
325 $ echo large44 > sub/large4
325 $ echo large44 > sub/large4
326 $ cd sub
326 $ cd sub
327 $ hg commit -m "edit files yet again"
327 $ hg commit -m "edit files yet again"
328 Invoking status precommit hook
328 Invoking status precommit hook
329 M large3
329 M large3
330 M normal3
330 M normal3
331 M sub/large4
331 M sub/large4
332 M sub/normal4
332 M sub/normal4
333 $ cat ../normal3
333 $ cat ../normal3
334 normal33
334 normal33
335 $ cat ../large3
335 $ cat ../large3
336 large33
336 large33
337 $ cat normal4
337 $ cat normal4
338 normal44
338 normal44
339 $ cat large4
339 $ cat large4
340 large44
340 large44
341
341
342 Committing standins is not allowed.
342 Committing standins is not allowed.
343
343
344 $ cd ..
344 $ cd ..
345 $ echo large3 > large3
345 $ echo large3 > large3
346 $ hg commit .hglf/large3 -m "try to commit standin"
346 $ hg commit .hglf/large3 -m "try to commit standin"
347 abort: file ".hglf/large3" is a largefile standin
347 abort: file ".hglf/large3" is a largefile standin
348 (commit the largefile itself instead)
348 (commit the largefile itself instead)
349 [255]
349 [255]
350
350
351 Corner cases for adding largefiles.
351 Corner cases for adding largefiles.
352
352
353 $ echo large5 > large5
353 $ echo large5 > large5
354 $ hg add --large large5
354 $ hg add --large large5
355 $ hg add --large large5
355 $ hg add --large large5
356 large5 already a largefile
356 large5 already a largefile
357 $ mkdir sub2
357 $ mkdir sub2
358 $ echo large6 > sub2/large6
358 $ echo large6 > sub2/large6
359 $ echo large7 > sub2/large7
359 $ echo large7 > sub2/large7
360 $ hg add --large sub2
360 $ hg add --large sub2
361 adding sub2/large6 as a largefile (glob)
361 adding sub2/large6 as a largefile (glob)
362 adding sub2/large7 as a largefile (glob)
362 adding sub2/large7 as a largefile (glob)
363 $ hg st
363 $ hg st
364 M large3
364 M large3
365 A large5
365 A large5
366 A sub2/large6
366 A sub2/large6
367 A sub2/large7
367 A sub2/large7
368
368
369 Committing directories containing only largefiles.
369 Committing directories containing only largefiles.
370
370
371 $ mkdir -p z/y/x/m
371 $ mkdir -p z/y/x/m
372 $ touch z/y/x/m/large1
372 $ touch z/y/x/m/large1
373 $ touch z/y/x/large2
373 $ touch z/y/x/large2
374 $ hg add --large z/y/x/m/large1 z/y/x/large2
374 $ hg add --large z/y/x/m/large1 z/y/x/large2
375 $ hg commit -m "Subdir with directory only containing largefiles" z
375 $ hg commit -m "Subdir with directory only containing largefiles" z
376 Invoking status precommit hook
376 Invoking status precommit hook
377 M large3
377 M large3
378 A large5
378 A large5
379 A sub2/large6
379 A sub2/large6
380 A sub2/large7
380 A sub2/large7
381 A z/y/x/large2
381 A z/y/x/large2
382 A z/y/x/m/large1
382 A z/y/x/m/large1
383 $ hg rollback --quiet
383 $ hg rollback --quiet
384 $ touch z/y/x/m/normal
384 $ touch z/y/x/m/normal
385 $ hg add z/y/x/m/normal
385 $ hg add z/y/x/m/normal
386 $ hg commit -m "Subdir with mixed contents" z
386 $ hg commit -m "Subdir with mixed contents" z
387 Invoking status precommit hook
387 Invoking status precommit hook
388 M large3
388 M large3
389 A large5
389 A large5
390 A sub2/large6
390 A sub2/large6
391 A sub2/large7
391 A sub2/large7
392 A z/y/x/large2
392 A z/y/x/large2
393 A z/y/x/m/large1
393 A z/y/x/m/large1
394 A z/y/x/m/normal
394 A z/y/x/m/normal
395 $ hg st
395 $ hg st
396 M large3
396 M large3
397 A large5
397 A large5
398 A sub2/large6
398 A sub2/large6
399 A sub2/large7
399 A sub2/large7
400 $ hg rollback --quiet
400 $ hg rollback --quiet
401 $ hg revert z/y/x/large2 z/y/x/m/large1
401 $ hg revert z/y/x/large2 z/y/x/m/large1
402 $ rm z/y/x/large2 z/y/x/m/large1
402 $ rm z/y/x/large2 z/y/x/m/large1
403 $ hg commit -m "Subdir with normal contents" z
403 $ hg commit -m "Subdir with normal contents" z
404 Invoking status precommit hook
404 Invoking status precommit hook
405 M large3
405 M large3
406 A large5
406 A large5
407 A sub2/large6
407 A sub2/large6
408 A sub2/large7
408 A sub2/large7
409 A z/y/x/m/normal
409 A z/y/x/m/normal
410 $ hg st
410 $ hg st
411 M large3
411 M large3
412 A large5
412 A large5
413 A sub2/large6
413 A sub2/large6
414 A sub2/large7
414 A sub2/large7
415 $ hg rollback --quiet
415 $ hg rollback --quiet
416 $ hg revert --quiet z
416 $ hg revert --quiet z
417 $ hg commit -m "Empty subdir" z
417 $ hg commit -m "Empty subdir" z
418 abort: z: no match under directory!
418 abort: z: no match under directory!
419 [255]
419 [255]
420 $ rm -rf z
420 $ rm -rf z
421 $ hg ci -m "standin" .hglf
421 $ hg ci -m "standin" .hglf
422 abort: file ".hglf" is a largefile standin
422 abort: file ".hglf" is a largefile standin
423 (commit the largefile itself instead)
423 (commit the largefile itself instead)
424 [255]
424 [255]
425
425
426 Test "hg status" with combination of 'file pattern' and 'directory
426 Test "hg status" with combination of 'file pattern' and 'directory
427 pattern' for largefiles:
427 pattern' for largefiles:
428
428
429 $ hg status sub2/large6 sub2
429 $ hg status sub2/large6 sub2
430 A sub2/large6
430 A sub2/large6
431 A sub2/large7
431 A sub2/large7
432
432
433 Config settings (pattern **.dat, minsize 2 MB) are respected.
433 Config settings (pattern **.dat, minsize 2 MB) are respected.
434
434
435 $ echo testdata > test.dat
435 $ echo testdata > test.dat
436 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
436 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
437 $ hg add
437 $ hg add
438 adding reallylarge as a largefile
438 adding reallylarge as a largefile
439 adding test.dat as a largefile
439 adding test.dat as a largefile
440
440
441 Test that minsize and --lfsize handle float values;
441 Test that minsize and --lfsize handle float values;
442 also tests that --lfsize overrides largefiles.minsize.
442 also tests that --lfsize overrides largefiles.minsize.
443 (0.250 MB = 256 kB = 262144 B)
443 (0.250 MB = 256 kB = 262144 B)
444
444
445 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
445 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
446 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
446 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
447 $ hg --config largefiles.minsize=.25 add
447 $ hg --config largefiles.minsize=.25 add
448 adding ratherlarge as a largefile
448 adding ratherlarge as a largefile
449 adding medium
449 adding medium
450 $ hg forget medium
450 $ hg forget medium
451 $ hg --config largefiles.minsize=.25 add --lfsize=.125
451 $ hg --config largefiles.minsize=.25 add --lfsize=.125
452 adding medium as a largefile
452 adding medium as a largefile
453 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
453 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
454 $ hg --config largefiles.minsize=.25 add --lfsize=.125
454 $ hg --config largefiles.minsize=.25 add --lfsize=.125
455 adding notlarge
455 adding notlarge
456 $ hg forget notlarge
456 $ hg forget notlarge
457
457
458 Test forget on largefiles.
458 Test forget on largefiles.
459
459
460 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
460 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
461 $ hg commit -m "add/edit more largefiles"
461 $ hg commit -m "add/edit more largefiles"
462 Invoking status precommit hook
462 Invoking status precommit hook
463 A sub2/large6
463 A sub2/large6
464 A sub2/large7
464 A sub2/large7
465 R large3
465 R large3
466 ? large5
466 ? large5
467 ? medium
467 ? medium
468 ? notlarge
468 ? notlarge
469 ? ratherlarge
469 ? ratherlarge
470 ? reallylarge
470 ? reallylarge
471 ? test.dat
471 ? test.dat
472 $ hg st
472 $ hg st
473 ? large3
473 ? large3
474 ? large5
474 ? large5
475 ? medium
475 ? medium
476 ? notlarge
476 ? notlarge
477 ? ratherlarge
477 ? ratherlarge
478 ? reallylarge
478 ? reallylarge
479 ? test.dat
479 ? test.dat
480
480
481 Purge with largefiles: verify that largefiles are still in the working
481 Purge with largefiles: verify that largefiles are still in the working
482 dir after a purge.
482 dir after a purge.
483
483
484 $ hg purge --all
484 $ hg purge --all
485 $ cat sub/large4
485 $ cat sub/large4
486 large44
486 large44
487 $ cat sub2/large6
487 $ cat sub2/large6
488 large6
488 large6
489 $ cat sub2/large7
489 $ cat sub2/large7
490 large7
490 large7
491
491
492 Test addremove: verify that files that should be added as largfiles are added as
492 Test addremove: verify that files that should be added as largfiles are added as
493 such and that already-existing largfiles are not added as normal files by
493 such and that already-existing largfiles are not added as normal files by
494 accident.
494 accident.
495
495
496 $ rm normal3
496 $ rm normal3
497 $ rm sub/large4
497 $ rm sub/large4
498 $ echo "testing addremove with patterns" > testaddremove.dat
498 $ echo "testing addremove with patterns" > testaddremove.dat
499 $ echo "normaladdremove" > normaladdremove
499 $ echo "normaladdremove" > normaladdremove
500 $ hg addremove
500 $ hg addremove
501 removing sub/large4
501 removing sub/large4
502 adding testaddremove.dat as a largefile
502 adding testaddremove.dat as a largefile
503 removing normal3
503 removing normal3
504 adding normaladdremove
504 adding normaladdremove
505
505
506 Test addremove with -R
506 Test addremove with -R
507
507
508 $ hg up -C
508 $ hg up -C
509 getting changed largefiles
509 getting changed largefiles
510 1 largefiles updated, 0 removed
510 1 largefiles updated, 0 removed
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 $ rm normal3
512 $ rm normal3
513 $ rm sub/large4
513 $ rm sub/large4
514 $ echo "testing addremove with patterns" > testaddremove.dat
514 $ echo "testing addremove with patterns" > testaddremove.dat
515 $ echo "normaladdremove" > normaladdremove
515 $ echo "normaladdremove" > normaladdremove
516 $ cd ..
516 $ cd ..
517 $ hg -R a addremove
517 $ hg -R a addremove
518 removing sub/large4
518 removing sub/large4
519 adding a/testaddremove.dat as a largefile (glob)
519 adding a/testaddremove.dat as a largefile (glob)
520 removing normal3
520 removing normal3
521 adding normaladdremove
521 adding normaladdremove
522 $ cd a
522 $ cd a
523
523
524 Test 3364
524 Test 3364
525 $ hg clone . ../addrm
525 $ hg clone . ../addrm
526 updating to branch default
526 updating to branch default
527 getting changed largefiles
527 getting changed largefiles
528 3 largefiles updated, 0 removed
528 3 largefiles updated, 0 removed
529 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
529 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
530 $ cd ../addrm
530 $ cd ../addrm
531 $ cat >> .hg/hgrc <<EOF
531 $ cat >> .hg/hgrc <<EOF
532 > [hooks]
532 > [hooks]
533 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
533 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
534 > EOF
534 > EOF
535 $ touch foo
535 $ touch foo
536 $ hg add --large foo
536 $ hg add --large foo
537 $ hg ci -m "add foo"
537 $ hg ci -m "add foo"
538 Invoking status precommit hook
538 Invoking status precommit hook
539 A foo
539 A foo
540 Invoking status postcommit hook
540 Invoking status postcommit hook
541 C foo
541 C foo
542 C normal3
542 C normal3
543 C sub/large4
543 C sub/large4
544 C sub/normal4
544 C sub/normal4
545 C sub2/large6
545 C sub2/large6
546 C sub2/large7
546 C sub2/large7
547 $ rm foo
547 $ rm foo
548 $ hg st
548 $ hg st
549 ! foo
549 ! foo
550 hmm.. no precommit invoked, but there is a postcommit??
550 hmm.. no precommit invoked, but there is a postcommit??
551 $ hg ci -m "will not checkin"
551 $ hg ci -m "will not checkin"
552 nothing changed
552 nothing changed
553 Invoking status postcommit hook
553 Invoking status postcommit hook
554 ! foo
554 ! foo
555 C normal3
555 C normal3
556 C sub/large4
556 C sub/large4
557 C sub/normal4
557 C sub/normal4
558 C sub2/large6
558 C sub2/large6
559 C sub2/large7
559 C sub2/large7
560 [1]
560 [1]
561 $ hg addremove
561 $ hg addremove
562 removing foo
562 removing foo
563 $ hg st
563 $ hg st
564 R foo
564 R foo
565 $ hg ci -m "used to say nothing changed"
565 $ hg ci -m "used to say nothing changed"
566 Invoking status precommit hook
566 Invoking status precommit hook
567 R foo
567 R foo
568 Invoking status postcommit hook
568 Invoking status postcommit hook
569 C normal3
569 C normal3
570 C sub/large4
570 C sub/large4
571 C sub/normal4
571 C sub/normal4
572 C sub2/large6
572 C sub2/large6
573 C sub2/large7
573 C sub2/large7
574 $ hg st
574 $ hg st
575
575
576 Test 3507 (both normal files and largefiles were a problem)
576 Test 3507 (both normal files and largefiles were a problem)
577
577
578 $ touch normal
578 $ touch normal
579 $ touch large
579 $ touch large
580 $ hg add normal
580 $ hg add normal
581 $ hg add --large large
581 $ hg add --large large
582 $ hg ci -m "added"
582 $ hg ci -m "added"
583 Invoking status precommit hook
583 Invoking status precommit hook
584 A large
584 A large
585 A normal
585 A normal
586 Invoking status postcommit hook
586 Invoking status postcommit hook
587 C large
587 C large
588 C normal
588 C normal
589 C normal3
589 C normal3
590 C sub/large4
590 C sub/large4
591 C sub/normal4
591 C sub/normal4
592 C sub2/large6
592 C sub2/large6
593 C sub2/large7
593 C sub2/large7
594 $ hg remove normal
594 $ hg remove normal
595 $ hg addremove --traceback
595 $ hg addremove --traceback
596 $ hg ci -m "addremoved normal"
596 $ hg ci -m "addremoved normal"
597 Invoking status precommit hook
597 Invoking status precommit hook
598 R normal
598 R normal
599 Invoking status postcommit hook
599 Invoking status postcommit hook
600 C large
600 C large
601 C normal3
601 C normal3
602 C sub/large4
602 C sub/large4
603 C sub/normal4
603 C sub/normal4
604 C sub2/large6
604 C sub2/large6
605 C sub2/large7
605 C sub2/large7
606 $ hg up -C '.^'
606 $ hg up -C '.^'
607 getting changed largefiles
607 getting changed largefiles
608 0 largefiles updated, 0 removed
608 0 largefiles updated, 0 removed
609 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
609 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
610 $ hg remove large
610 $ hg remove large
611 $ hg addremove --traceback
611 $ hg addremove --traceback
612 $ hg ci -m "removed large"
612 $ hg ci -m "removed large"
613 Invoking status precommit hook
613 Invoking status precommit hook
614 R large
614 R large
615 created new head
615 created new head
616 Invoking status postcommit hook
616 Invoking status postcommit hook
617 C normal
617 C normal
618 C normal3
618 C normal3
619 C sub/large4
619 C sub/large4
620 C sub/normal4
620 C sub/normal4
621 C sub2/large6
621 C sub2/large6
622 C sub2/large7
622 C sub2/large7
623
623
624 Test commit -A (issue 3542)
624 Test commit -A (issue 3542)
625 $ echo large8 > large8
625 $ echo large8 > large8
626 $ hg add --large large8
626 $ hg add --large large8
627 $ hg ci -Am 'this used to add large8 as normal and commit both'
627 $ hg ci -Am 'this used to add large8 as normal and commit both'
628 Invoking status precommit hook
628 Invoking status precommit hook
629 A large8
629 A large8
630 Invoking status postcommit hook
630 Invoking status postcommit hook
631 C large8
631 C large8
632 C normal
632 C normal
633 C normal3
633 C normal3
634 C sub/large4
634 C sub/large4
635 C sub/normal4
635 C sub/normal4
636 C sub2/large6
636 C sub2/large6
637 C sub2/large7
637 C sub2/large7
638 $ rm large8
638 $ rm large8
639 $ hg ci -Am 'this used to not notice the rm'
639 $ hg ci -Am 'this used to not notice the rm'
640 removing large8
640 removing large8
641 Invoking status precommit hook
641 Invoking status precommit hook
642 R large8
642 R large8
643 Invoking status postcommit hook
643 Invoking status postcommit hook
644 C normal
644 C normal
645 C normal3
645 C normal3
646 C sub/large4
646 C sub/large4
647 C sub/normal4
647 C sub/normal4
648 C sub2/large6
648 C sub2/large6
649 C sub2/large7
649 C sub2/large7
650
650
651 Test that a standin can't be added as a large file
651 Test that a standin can't be added as a large file
652
652
653 $ touch large
653 $ touch large
654 $ hg add --large large
654 $ hg add --large large
655 $ hg ci -m "add"
655 $ hg ci -m "add"
656 Invoking status precommit hook
656 Invoking status precommit hook
657 A large
657 A large
658 Invoking status postcommit hook
658 Invoking status postcommit hook
659 C large
659 C large
660 C normal
660 C normal
661 C normal3
661 C normal3
662 C sub/large4
662 C sub/large4
663 C sub/normal4
663 C sub/normal4
664 C sub2/large6
664 C sub2/large6
665 C sub2/large7
665 C sub2/large7
666 $ hg remove large
666 $ hg remove large
667 $ touch large
667 $ touch large
668 $ hg addremove --config largefiles.patterns=**large --traceback
668 $ hg addremove --config largefiles.patterns=**large --traceback
669 adding large as a largefile
669 adding large as a largefile
670
670
671 Test that outgoing --large works (with revsets too)
671 Test that outgoing --large works (with revsets too)
672 $ hg outgoing --rev '.^' --large
672 $ hg outgoing --rev '.^' --large
673 comparing with $TESTTMP/a (glob)
673 comparing with $TESTTMP/a (glob)
674 searching for changes
674 searching for changes
675 changeset: 8:c02fd3b77ec4
675 changeset: 8:c02fd3b77ec4
676 user: test
676 user: test
677 date: Thu Jan 01 00:00:00 1970 +0000
677 date: Thu Jan 01 00:00:00 1970 +0000
678 summary: add foo
678 summary: add foo
679
679
680 changeset: 9:289dd08c9bbb
680 changeset: 9:289dd08c9bbb
681 user: test
681 user: test
682 date: Thu Jan 01 00:00:00 1970 +0000
682 date: Thu Jan 01 00:00:00 1970 +0000
683 summary: used to say nothing changed
683 summary: used to say nothing changed
684
684
685 changeset: 10:34f23ac6ac12
685 changeset: 10:34f23ac6ac12
686 user: test
686 user: test
687 date: Thu Jan 01 00:00:00 1970 +0000
687 date: Thu Jan 01 00:00:00 1970 +0000
688 summary: added
688 summary: added
689
689
690 changeset: 12:710c1b2f523c
690 changeset: 12:710c1b2f523c
691 parent: 10:34f23ac6ac12
691 parent: 10:34f23ac6ac12
692 user: test
692 user: test
693 date: Thu Jan 01 00:00:00 1970 +0000
693 date: Thu Jan 01 00:00:00 1970 +0000
694 summary: removed large
694 summary: removed large
695
695
696 changeset: 13:0a3e75774479
696 changeset: 13:0a3e75774479
697 user: test
697 user: test
698 date: Thu Jan 01 00:00:00 1970 +0000
698 date: Thu Jan 01 00:00:00 1970 +0000
699 summary: this used to add large8 as normal and commit both
699 summary: this used to add large8 as normal and commit both
700
700
701 changeset: 14:84f3d378175c
701 changeset: 14:84f3d378175c
702 user: test
702 user: test
703 date: Thu Jan 01 00:00:00 1970 +0000
703 date: Thu Jan 01 00:00:00 1970 +0000
704 summary: this used to not notice the rm
704 summary: this used to not notice the rm
705
705
706 searching for changes
706 searching for changes
707 largefiles to upload:
707 largefiles to upload:
708 foo
708 foo
709 large
709 large
710 large8
710 large8
711
711
712 $ cd ../a
712 $ cd ../a
713
713
714 Clone a largefiles repo.
714 Clone a largefiles repo.
715
715
716 $ hg clone . ../b
716 $ hg clone . ../b
717 updating to branch default
717 updating to branch default
718 getting changed largefiles
718 getting changed largefiles
719 3 largefiles updated, 0 removed
719 3 largefiles updated, 0 removed
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 $ cd ../b
721 $ cd ../b
722 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
722 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
723 7:daea875e9014 add/edit more largefiles
723 7:daea875e9014 add/edit more largefiles
724 6:4355d653f84f edit files yet again
724 6:4355d653f84f edit files yet again
725 5:9d5af5072dbd edit files again
725 5:9d5af5072dbd edit files again
726 4:74c02385b94c move files
726 4:74c02385b94c move files
727 3:9e8fbc4bce62 copy files
727 3:9e8fbc4bce62 copy files
728 2:51a0ae4d5864 remove files
728 2:51a0ae4d5864 remove files
729 1:ce8896473775 edit files
729 1:ce8896473775 edit files
730 0:30d30fe6a5be add files
730 0:30d30fe6a5be add files
731 $ cat normal3
731 $ cat normal3
732 normal33
732 normal33
733 $ cat sub/normal4
733 $ cat sub/normal4
734 normal44
734 normal44
735 $ cat sub/large4
735 $ cat sub/large4
736 large44
736 large44
737 $ cat sub2/large6
737 $ cat sub2/large6
738 large6
738 large6
739 $ cat sub2/large7
739 $ cat sub2/large7
740 large7
740 large7
741 $ cd ..
741 $ cd ..
742 $ hg clone a -r 3 c
742 $ hg clone a -r 3 c
743 adding changesets
743 adding changesets
744 adding manifests
744 adding manifests
745 adding file changes
745 adding file changes
746 added 4 changesets with 10 changes to 4 files
746 added 4 changesets with 10 changes to 4 files
747 updating to branch default
747 updating to branch default
748 getting changed largefiles
748 getting changed largefiles
749 2 largefiles updated, 0 removed
749 2 largefiles updated, 0 removed
750 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
750 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
751 $ cd c
751 $ cd c
752 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
752 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
753 3:9e8fbc4bce62 copy files
753 3:9e8fbc4bce62 copy files
754 2:51a0ae4d5864 remove files
754 2:51a0ae4d5864 remove files
755 1:ce8896473775 edit files
755 1:ce8896473775 edit files
756 0:30d30fe6a5be add files
756 0:30d30fe6a5be add files
757 $ cat normal1
757 $ cat normal1
758 normal22
758 normal22
759 $ cat large1
759 $ cat large1
760 large22
760 large22
761 $ cat sub/normal2
761 $ cat sub/normal2
762 normal22
762 normal22
763 $ cat sub/large2
763 $ cat sub/large2
764 large22
764 large22
765
765
766 Old revisions of a clone have correct largefiles content (this also
766 Old revisions of a clone have correct largefiles content (this also
767 tests update).
767 tests update).
768
768
769 $ hg update -r 1
769 $ hg update -r 1
770 getting changed largefiles
770 getting changed largefiles
771 1 largefiles updated, 0 removed
771 1 largefiles updated, 0 removed
772 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
772 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 $ cat large1
773 $ cat large1
774 large11
774 large11
775 $ cat sub/large2
775 $ cat sub/large2
776 large22
776 large22
777 $ cd ..
777 $ cd ..
778
778
779 Test cloning with --all-largefiles flag
779 Test cloning with --all-largefiles flag
780
780
781 $ rm "${USERCACHE}"/*
781 $ rm "${USERCACHE}"/*
782 $ hg clone --all-largefiles a a-backup
782 $ hg clone --all-largefiles a a-backup
783 updating to branch default
783 updating to branch default
784 getting changed largefiles
784 getting changed largefiles
785 3 largefiles updated, 0 removed
785 3 largefiles updated, 0 removed
786 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
786 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
787 8 additional largefiles cached
787 8 additional largefiles cached
788
788
789 $ rm "${USERCACHE}"/*
789 $ rm "${USERCACHE}"/*
790 $ hg clone --all-largefiles -u 0 a a-clone0
790 $ hg clone --all-largefiles -u 0 a a-clone0
791 updating to branch default
791 updating to branch default
792 getting changed largefiles
792 getting changed largefiles
793 2 largefiles updated, 0 removed
793 2 largefiles updated, 0 removed
794 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
794 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
795 9 additional largefiles cached
795 9 additional largefiles cached
796 $ hg -R a-clone0 sum
796 $ hg -R a-clone0 sum
797 parent: 0:30d30fe6a5be
797 parent: 0:30d30fe6a5be
798 add files
798 add files
799 branch: default
799 branch: default
800 commit: (clean)
800 commit: (clean)
801 update: 7 new changesets (update)
801 update: 7 new changesets (update)
802
802
803 $ rm "${USERCACHE}"/*
803 $ rm "${USERCACHE}"/*
804 $ hg clone --all-largefiles -u 1 a a-clone1
804 $ hg clone --all-largefiles -u 1 a a-clone1
805 updating to branch default
805 updating to branch default
806 getting changed largefiles
806 getting changed largefiles
807 2 largefiles updated, 0 removed
807 2 largefiles updated, 0 removed
808 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
808 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
809 8 additional largefiles cached
809 8 additional largefiles cached
810 $ hg -R a-clone1 verify --large --lfa --lfc
810 $ hg -R a-clone1 verify --large --lfa --lfc
811 checking changesets
811 checking changesets
812 checking manifests
812 checking manifests
813 crosschecking files in changesets and manifests
813 crosschecking files in changesets and manifests
814 checking files
814 checking files
815 10 files, 8 changesets, 24 total revisions
815 10 files, 8 changesets, 24 total revisions
816 searching 8 changesets for largefiles
816 searching 8 changesets for largefiles
817 verified contents of 13 revisions of 6 largefiles
817 verified contents of 13 revisions of 6 largefiles
818 $ hg -R a-clone1 sum
818 $ hg -R a-clone1 sum
819 parent: 1:ce8896473775
819 parent: 1:ce8896473775
820 edit files
820 edit files
821 branch: default
821 branch: default
822 commit: (clean)
822 commit: (clean)
823 update: 6 new changesets (update)
823 update: 6 new changesets (update)
824
824
825 $ rm "${USERCACHE}"/*
825 $ rm "${USERCACHE}"/*
826 $ hg clone --all-largefiles -U a a-clone-u
826 $ hg clone --all-largefiles -U a a-clone-u
827 11 additional largefiles cached
827 11 additional largefiles cached
828 $ hg -R a-clone-u sum
828 $ hg -R a-clone-u sum
829 parent: -1:000000000000 (no revision checked out)
829 parent: -1:000000000000 (no revision checked out)
830 branch: default
830 branch: default
831 commit: (clean)
831 commit: (clean)
832 update: 8 new changesets (update)
832 update: 8 new changesets (update)
833
833
834 Show computed destination directory:
834 Show computed destination directory:
835
835
836 $ mkdir xyz
836 $ mkdir xyz
837 $ cd xyz
837 $ cd xyz
838 $ hg clone ../a
838 $ hg clone ../a
839 destination directory: a
839 destination directory: a
840 updating to branch default
840 updating to branch default
841 getting changed largefiles
841 getting changed largefiles
842 3 largefiles updated, 0 removed
842 3 largefiles updated, 0 removed
843 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
843 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
844 $ cd ..
844 $ cd ..
845
845
846 Clone URL without path:
846 Clone URL without path:
847
847
848 $ hg clone file://
848 $ hg clone file://
849 abort: repository / not found!
849 abort: repository / not found!
850 [255]
850 [255]
851
851
852 Ensure base clone command argument validation
852 Ensure base clone command argument validation
853
853
854 $ hg clone -U -u 0 a a-clone-failure
854 $ hg clone -U -u 0 a a-clone-failure
855 abort: cannot specify both --noupdate and --updaterev
855 abort: cannot specify both --noupdate and --updaterev
856 [255]
856 [255]
857
857
858 $ hg clone --all-largefiles a ssh://localhost/a
858 $ hg clone --all-largefiles a ssh://localhost/a
859 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
859 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
860 [255]
860 [255]
861
861
862 Test pulling with --all-largefiles flag. Also test that the largefiles are
862 Test pulling with --all-largefiles flag. Also test that the largefiles are
863 downloaded from 'default' instead of 'default-push' when no source is specified
863 downloaded from 'default' instead of 'default-push' when no source is specified
864 (issue3584)
864 (issue3584)
865
865
866 $ rm -Rf a-backup
866 $ rm -Rf a-backup
867 $ hg clone -r 1 a a-backup
867 $ hg clone -r 1 a a-backup
868 adding changesets
868 adding changesets
869 adding manifests
869 adding manifests
870 adding file changes
870 adding file changes
871 added 2 changesets with 8 changes to 4 files
871 added 2 changesets with 8 changes to 4 files
872 updating to branch default
872 updating to branch default
873 getting changed largefiles
873 getting changed largefiles
874 2 largefiles updated, 0 removed
874 2 largefiles updated, 0 removed
875 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
875 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
876 $ rm "${USERCACHE}"/*
876 $ rm "${USERCACHE}"/*
877 $ cd a-backup
877 $ cd a-backup
878 $ hg pull --all-largefiles --config paths.default-push=bogus/path
878 $ hg pull --all-largefiles --config paths.default-push=bogus/path
879 pulling from $TESTTMP/a (glob)
879 pulling from $TESTTMP/a (glob)
880 searching for changes
880 searching for changes
881 adding changesets
881 adding changesets
882 adding manifests
882 adding manifests
883 adding file changes
883 adding file changes
884 added 6 changesets with 16 changes to 8 files
884 added 6 changesets with 16 changes to 8 files
885 (run 'hg update' to get a working copy)
885 (run 'hg update' to get a working copy)
886 caching new largefiles
886 caching new largefiles
887 3 largefiles cached
887 3 largefiles cached
888 3 additional largefiles cached
888 3 additional largefiles cached
889 $ cd ..
889 $ cd ..
890
890
891 Rebasing between two repositories does not revert largefiles to old
891 Rebasing between two repositories does not revert largefiles to old
892 revisions (this was a very bad bug that took a lot of work to fix).
892 revisions (this was a very bad bug that took a lot of work to fix).
893
893
894 $ hg clone a d
894 $ hg clone a d
895 updating to branch default
895 updating to branch default
896 getting changed largefiles
896 getting changed largefiles
897 3 largefiles updated, 0 removed
897 3 largefiles updated, 0 removed
898 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
898 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
899 $ cd b
899 $ cd b
900 $ echo large4-modified > sub/large4
900 $ echo large4-modified > sub/large4
901 $ echo normal3-modified > normal3
901 $ echo normal3-modified > normal3
902 $ hg commit -m "modify normal file and largefile in repo b"
902 $ hg commit -m "modify normal file and largefile in repo b"
903 Invoking status precommit hook
903 Invoking status precommit hook
904 M normal3
904 M normal3
905 M sub/large4
905 M sub/large4
906 $ cd ../d
906 $ cd ../d
907 $ echo large6-modified > sub2/large6
907 $ echo large6-modified > sub2/large6
908 $ echo normal4-modified > sub/normal4
908 $ echo normal4-modified > sub/normal4
909 $ hg commit -m "modify normal file largefile in repo d"
909 $ hg commit -m "modify normal file largefile in repo d"
910 Invoking status precommit hook
910 Invoking status precommit hook
911 M sub/normal4
911 M sub/normal4
912 M sub2/large6
912 M sub2/large6
913 $ cd ..
913 $ cd ..
914 $ hg clone d e
914 $ hg clone d e
915 updating to branch default
915 updating to branch default
916 getting changed largefiles
916 getting changed largefiles
917 3 largefiles updated, 0 removed
917 3 largefiles updated, 0 removed
918 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
918 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
919 $ cd d
919 $ cd d
920
920
921 More rebase testing, but also test that the largefiles are downloaded from
921 More rebase testing, but also test that the largefiles are downloaded from
922 'default-push' when no source is specified (issue3584). (The largefile from the
922 'default-push' when no source is specified (issue3584). (The largefile from the
923 pulled revision is however not downloaded but found in the local cache.)
923 pulled revision is however not downloaded but found in the local cache.)
924 Largefiles are fetched for the new pulled revision, not for existing revisions,
924 Largefiles are fetched for the new pulled revision, not for existing revisions,
925 rebased or not.
925 rebased or not.
926
926
927 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
927 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
928 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
928 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
929 pulling from $TESTTMP/b (glob)
929 pulling from $TESTTMP/b (glob)
930 searching for changes
930 searching for changes
931 adding changesets
931 adding changesets
932 adding manifests
932 adding manifests
933 adding file changes
933 adding file changes
934 added 1 changesets with 2 changes to 2 files (+1 heads)
934 added 1 changesets with 2 changes to 2 files (+1 heads)
935 Invoking status precommit hook
935 Invoking status precommit hook
936 M sub/normal4
936 M sub/normal4
937 M sub2/large6
937 M sub2/large6
938 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
938 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
939 0 additional largefiles cached
939 0 additional largefiles cached
940 nothing to rebase
940 nothing to rebase
941 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
941 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
942 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
942 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
943 9:598410d3eb9a modify normal file largefile in repo d
943 9:598410d3eb9a modify normal file largefile in repo d
944 8:a381d2c8c80e modify normal file and largefile in repo b
944 8:a381d2c8c80e modify normal file and largefile in repo b
945 7:daea875e9014 add/edit more largefiles
945 7:daea875e9014 add/edit more largefiles
946 6:4355d653f84f edit files yet again
946 6:4355d653f84f edit files yet again
947 5:9d5af5072dbd edit files again
947 5:9d5af5072dbd edit files again
948 4:74c02385b94c move files
948 4:74c02385b94c move files
949 3:9e8fbc4bce62 copy files
949 3:9e8fbc4bce62 copy files
950 2:51a0ae4d5864 remove files
950 2:51a0ae4d5864 remove files
951 1:ce8896473775 edit files
951 1:ce8896473775 edit files
952 0:30d30fe6a5be add files
952 0:30d30fe6a5be add files
953 $ cat normal3
953 $ cat normal3
954 normal3-modified
954 normal3-modified
955 $ cat sub/normal4
955 $ cat sub/normal4
956 normal4-modified
956 normal4-modified
957 $ cat sub/large4
957 $ cat sub/large4
958 large4-modified
958 large4-modified
959 $ cat sub2/large6
959 $ cat sub2/large6
960 large6-modified
960 large6-modified
961 $ cat sub2/large7
961 $ cat sub2/large7
962 large7
962 large7
963 $ cd ../e
963 $ cd ../e
964 $ hg pull ../b
964 $ hg pull ../b
965 pulling from ../b
965 pulling from ../b
966 searching for changes
966 searching for changes
967 adding changesets
967 adding changesets
968 adding manifests
968 adding manifests
969 adding file changes
969 adding file changes
970 added 1 changesets with 2 changes to 2 files (+1 heads)
970 added 1 changesets with 2 changes to 2 files (+1 heads)
971 (run 'hg heads' to see heads, 'hg merge' to merge)
971 (run 'hg heads' to see heads, 'hg merge' to merge)
972 caching new largefiles
972 caching new largefiles
973 0 largefiles cached
973 0 largefiles cached
974 $ hg rebase
974 $ hg rebase
975 Invoking status precommit hook
975 Invoking status precommit hook
976 M sub/normal4
976 M sub/normal4
977 M sub2/large6
977 M sub2/large6
978 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
978 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
979 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
979 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
980 9:598410d3eb9a modify normal file largefile in repo d
980 9:598410d3eb9a modify normal file largefile in repo d
981 8:a381d2c8c80e modify normal file and largefile in repo b
981 8:a381d2c8c80e modify normal file and largefile in repo b
982 7:daea875e9014 add/edit more largefiles
982 7:daea875e9014 add/edit more largefiles
983 6:4355d653f84f edit files yet again
983 6:4355d653f84f edit files yet again
984 5:9d5af5072dbd edit files again
984 5:9d5af5072dbd edit files again
985 4:74c02385b94c move files
985 4:74c02385b94c move files
986 3:9e8fbc4bce62 copy files
986 3:9e8fbc4bce62 copy files
987 2:51a0ae4d5864 remove files
987 2:51a0ae4d5864 remove files
988 1:ce8896473775 edit files
988 1:ce8896473775 edit files
989 0:30d30fe6a5be add files
989 0:30d30fe6a5be add files
990 $ cat normal3
990 $ cat normal3
991 normal3-modified
991 normal3-modified
992 $ cat sub/normal4
992 $ cat sub/normal4
993 normal4-modified
993 normal4-modified
994 $ cat sub/large4
994 $ cat sub/large4
995 large4-modified
995 large4-modified
996 $ cat sub2/large6
996 $ cat sub2/large6
997 large6-modified
997 large6-modified
998 $ cat sub2/large7
998 $ cat sub2/large7
999 large7
999 large7
1000
1000
1001 Log on largefiles
1001 Log on largefiles
1002
1002
1003 - same output
1003 - same output
1004 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1004 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1005 8:a381d2c8c80e modify normal file and largefile in repo b
1005 8:a381d2c8c80e modify normal file and largefile in repo b
1006 6:4355d653f84f edit files yet again
1006 6:4355d653f84f edit files yet again
1007 5:9d5af5072dbd edit files again
1007 5:9d5af5072dbd edit files again
1008 4:74c02385b94c move files
1008 4:74c02385b94c move files
1009 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1009 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1010 8:a381d2c8c80e modify normal file and largefile in repo b
1010 8:a381d2c8c80e modify normal file and largefile in repo b
1011 6:4355d653f84f edit files yet again
1011 6:4355d653f84f edit files yet again
1012 5:9d5af5072dbd edit files again
1012 5:9d5af5072dbd edit files again
1013 4:74c02385b94c move files
1013 4:74c02385b94c move files
1014
1014
1015 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1015 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1016 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1016 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1017 8:a381d2c8c80e modify normal file and largefile in repo b
1017 8:a381d2c8c80e modify normal file and largefile in repo b
1018 6:4355d653f84f edit files yet again
1018 6:4355d653f84f edit files yet again
1019 5:9d5af5072dbd edit files again
1019 5:9d5af5072dbd edit files again
1020 4:74c02385b94c move files
1020 4:74c02385b94c move files
1021 1:ce8896473775 edit files
1021 1:ce8896473775 edit files
1022 0:30d30fe6a5be add files
1022 0:30d30fe6a5be add files
1023 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1023 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1024 9:598410d3eb9a modify normal file largefile in repo d
1024 9:598410d3eb9a modify normal file largefile in repo d
1025 8:a381d2c8c80e modify normal file and largefile in repo b
1025 8:a381d2c8c80e modify normal file and largefile in repo b
1026 6:4355d653f84f edit files yet again
1026 6:4355d653f84f edit files yet again
1027 5:9d5af5072dbd edit files again
1027 5:9d5af5072dbd edit files again
1028 4:74c02385b94c move files
1028 4:74c02385b94c move files
1029 1:ce8896473775 edit files
1029 1:ce8896473775 edit files
1030 0:30d30fe6a5be add files
1030 0:30d30fe6a5be add files
1031
1031
1032 - globbing gives same result
1032 - globbing gives same result
1033 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1033 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1034 9:598410d3eb9a modify normal file largefile in repo d
1034 9:598410d3eb9a modify normal file largefile in repo d
1035 8:a381d2c8c80e modify normal file and largefile in repo b
1035 8:a381d2c8c80e modify normal file and largefile in repo b
1036 6:4355d653f84f edit files yet again
1036 6:4355d653f84f edit files yet again
1037 5:9d5af5072dbd edit files again
1037 5:9d5af5072dbd edit files again
1038 4:74c02385b94c move files
1038 4:74c02385b94c move files
1039 1:ce8896473775 edit files
1039 1:ce8896473775 edit files
1040 0:30d30fe6a5be add files
1040 0:30d30fe6a5be add files
1041
1041
1042 Rollback on largefiles.
1042 Rollback on largefiles.
1043
1043
1044 $ echo large4-modified-again > sub/large4
1044 $ echo large4-modified-again > sub/large4
1045 $ hg commit -m "Modify large4 again"
1045 $ hg commit -m "Modify large4 again"
1046 Invoking status precommit hook
1046 Invoking status precommit hook
1047 M sub/large4
1047 M sub/large4
1048 $ hg rollback
1048 $ hg rollback
1049 repository tip rolled back to revision 9 (undo commit)
1049 repository tip rolled back to revision 9 (undo commit)
1050 working directory now based on revision 9
1050 working directory now based on revision 9
1051 $ hg st
1051 $ hg st
1052 M sub/large4
1052 M sub/large4
1053 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1053 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1054 9:598410d3eb9a modify normal file largefile in repo d
1054 9:598410d3eb9a modify normal file largefile in repo d
1055 8:a381d2c8c80e modify normal file and largefile in repo b
1055 8:a381d2c8c80e modify normal file and largefile in repo b
1056 7:daea875e9014 add/edit more largefiles
1056 7:daea875e9014 add/edit more largefiles
1057 6:4355d653f84f edit files yet again
1057 6:4355d653f84f edit files yet again
1058 5:9d5af5072dbd edit files again
1058 5:9d5af5072dbd edit files again
1059 4:74c02385b94c move files
1059 4:74c02385b94c move files
1060 3:9e8fbc4bce62 copy files
1060 3:9e8fbc4bce62 copy files
1061 2:51a0ae4d5864 remove files
1061 2:51a0ae4d5864 remove files
1062 1:ce8896473775 edit files
1062 1:ce8896473775 edit files
1063 0:30d30fe6a5be add files
1063 0:30d30fe6a5be add files
1064 $ cat sub/large4
1064 $ cat sub/large4
1065 large4-modified-again
1065 large4-modified-again
1066
1066
1067 "update --check" refuses to update with uncommitted changes.
1067 "update --check" refuses to update with uncommitted changes.
1068 $ hg update --check 8
1068 $ hg update --check 8
1069 abort: uncommitted local changes
1069 abort: uncommitted local changes
1070 [255]
1070 [255]
1071
1071
1072 "update --clean" leaves correct largefiles in working copy, even when there is
1072 "update --clean" leaves correct largefiles in working copy, even when there is
1073 .orig files from revert in .hglf.
1073 .orig files from revert in .hglf.
1074
1074
1075 $ echo mistake > sub2/large7
1075 $ echo mistake > sub2/large7
1076 $ hg revert sub2/large7
1076 $ hg revert sub2/large7
1077 $ hg -q update --clean -r null
1077 $ hg -q update --clean -r null
1078 $ hg update --clean
1078 $ hg update --clean
1079 getting changed largefiles
1079 getting changed largefiles
1080 3 largefiles updated, 0 removed
1080 3 largefiles updated, 0 removed
1081 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1081 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1082 $ cat normal3
1082 $ cat normal3
1083 normal3-modified
1083 normal3-modified
1084 $ cat sub/normal4
1084 $ cat sub/normal4
1085 normal4-modified
1085 normal4-modified
1086 $ cat sub/large4
1086 $ cat sub/large4
1087 large4-modified
1087 large4-modified
1088 $ cat sub2/large6
1088 $ cat sub2/large6
1089 large6-modified
1089 large6-modified
1090 $ cat sub2/large7
1090 $ cat sub2/large7
1091 large7
1091 large7
1092 $ cat sub2/large7.orig
1092 $ cat sub2/large7.orig
1093 mistake
1093 mistake
1094 $ cat .hglf/sub2/large7.orig
1094 $ cat .hglf/sub2/large7.orig
1095 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1095 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1096
1096
1097 demonstrate misfeature: .orig file is overwritten on every update -C,
1097 demonstrate misfeature: .orig file is overwritten on every update -C,
1098 also when clean:
1098 also when clean:
1099 $ hg update --clean
1099 $ hg update --clean
1100 getting changed largefiles
1100 getting changed largefiles
1101 0 largefiles updated, 0 removed
1101 0 largefiles updated, 0 removed
1102 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1102 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1103 $ cat sub2/large7.orig
1103 $ cat sub2/large7.orig
1104 large7
1104 large7
1105 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1105 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1106
1106
1107 Now "update check" is happy.
1107 Now "update check" is happy.
1108 $ hg update --check 8
1108 $ hg update --check 8
1109 getting changed largefiles
1109 getting changed largefiles
1110 1 largefiles updated, 0 removed
1110 1 largefiles updated, 0 removed
1111 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1111 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1112 $ hg update --check
1112 $ hg update --check
1113 getting changed largefiles
1113 getting changed largefiles
1114 1 largefiles updated, 0 removed
1114 1 largefiles updated, 0 removed
1115 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1115 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1116
1116
1117 Test removing empty largefiles directories on update
1117 Test removing empty largefiles directories on update
1118 $ test -d sub2 && echo "sub2 exists"
1118 $ test -d sub2 && echo "sub2 exists"
1119 sub2 exists
1119 sub2 exists
1120 $ hg update -q null
1120 $ hg update -q null
1121 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1121 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1122 [1]
1122 [1]
1123 $ hg update -q
1123 $ hg update -q
1124
1124
1125 Test hg remove removes empty largefiles directories
1125 Test hg remove removes empty largefiles directories
1126 $ test -d sub2 && echo "sub2 exists"
1126 $ test -d sub2 && echo "sub2 exists"
1127 sub2 exists
1127 sub2 exists
1128 $ hg remove sub2/*
1128 $ hg remove sub2/*
1129 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1129 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1130 [1]
1130 [1]
1131 $ hg revert sub2/large6 sub2/large7
1131 $ hg revert sub2/large6 sub2/large7
1132
1132
1133 "revert" works on largefiles (and normal files too).
1133 "revert" works on largefiles (and normal files too).
1134 $ echo hack3 >> normal3
1134 $ echo hack3 >> normal3
1135 $ echo hack4 >> sub/normal4
1135 $ echo hack4 >> sub/normal4
1136 $ echo hack4 >> sub/large4
1136 $ echo hack4 >> sub/large4
1137 $ rm sub2/large6
1137 $ rm sub2/large6
1138 $ hg revert sub2/large6
1138 $ hg revert sub2/large6
1139 $ hg rm sub2/large6
1139 $ hg rm sub2/large6
1140 $ echo new >> sub2/large8
1140 $ echo new >> sub2/large8
1141 $ hg add --large sub2/large8
1141 $ hg add --large sub2/large8
1142 # XXX we don't really want to report that we're reverting the standin;
1142 # XXX we don't really want to report that we're reverting the standin;
1143 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1143 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1144 $ hg revert sub
1144 $ hg revert sub
1145 reverting .hglf/sub/large4 (glob)
1145 reverting .hglf/sub/large4 (glob)
1146 reverting sub/normal4 (glob)
1146 reverting sub/normal4 (glob)
1147 $ hg status
1147 $ hg status
1148 M normal3
1148 M normal3
1149 A sub2/large8
1149 A sub2/large8
1150 R sub2/large6
1150 R sub2/large6
1151 ? sub/large4.orig
1151 ? sub/large4.orig
1152 ? sub/normal4.orig
1152 ? sub/normal4.orig
1153 $ cat sub/normal4
1153 $ cat sub/normal4
1154 normal4-modified
1154 normal4-modified
1155 $ cat sub/large4
1155 $ cat sub/large4
1156 large4-modified
1156 large4-modified
1157 $ hg revert -a --no-backup
1157 $ hg revert -a --no-backup
1158 undeleting .hglf/sub2/large6 (glob)
1158 undeleting .hglf/sub2/large6 (glob)
1159 forgetting .hglf/sub2/large8 (glob)
1159 forgetting .hglf/sub2/large8 (glob)
1160 reverting normal3
1160 reverting normal3
1161 $ hg status
1161 $ hg status
1162 ? sub/large4.orig
1162 ? sub/large4.orig
1163 ? sub/normal4.orig
1163 ? sub/normal4.orig
1164 ? sub2/large8
1164 ? sub2/large8
1165 $ cat normal3
1165 $ cat normal3
1166 normal3-modified
1166 normal3-modified
1167 $ cat sub2/large6
1167 $ cat sub2/large6
1168 large6-modified
1168 large6-modified
1169 $ rm sub/*.orig sub2/large8
1169 $ rm sub/*.orig sub2/large8
1170
1170
1171 revert some files to an older revision
1171 revert some files to an older revision
1172 $ hg revert --no-backup -r 8 sub2
1172 $ hg revert --no-backup -r 8 sub2
1173 reverting .hglf/sub2/large6 (glob)
1173 reverting .hglf/sub2/large6 (glob)
1174 $ cat sub2/large6
1174 $ cat sub2/large6
1175 large6
1175 large6
1176 $ hg revert --no-backup -C -r '.^' sub2
1176 $ hg revert --no-backup -C -r '.^' sub2
1177 reverting .hglf/sub2/large6 (glob)
1177 reverting .hglf/sub2/large6 (glob)
1178 $ hg revert --no-backup sub2
1178 $ hg revert --no-backup sub2
1179 reverting .hglf/sub2/large6 (glob)
1179 reverting .hglf/sub2/large6 (glob)
1180 $ hg status
1180 $ hg status
1181
1181
1182 "verify --large" actually verifies largefiles
1182 "verify --large" actually verifies largefiles
1183
1183
1184 - Where Do We Come From? What Are We? Where Are We Going?
1184 - Where Do We Come From? What Are We? Where Are We Going?
1185 $ pwd
1185 $ pwd
1186 $TESTTMP/e
1186 $TESTTMP/e
1187 $ hg paths
1187 $ hg paths
1188 default = $TESTTMP/d (glob)
1188 default = $TESTTMP/d (glob)
1189
1189
1190 $ hg verify --large
1190 $ hg verify --large
1191 checking changesets
1191 checking changesets
1192 checking manifests
1192 checking manifests
1193 crosschecking files in changesets and manifests
1193 crosschecking files in changesets and manifests
1194 checking files
1194 checking files
1195 10 files, 10 changesets, 28 total revisions
1195 10 files, 10 changesets, 28 total revisions
1196 searching 1 changesets for largefiles
1196 searching 1 changesets for largefiles
1197 verified existence of 3 revisions of 3 largefiles
1197 verified existence of 3 revisions of 3 largefiles
1198
1198
1199 - introduce missing blob in local store repo and make sure that this is caught:
1199 - introduce missing blob in local store repo and make sure that this is caught:
1200 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1200 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1201 $ hg verify --large
1201 $ hg verify --large
1202 checking changesets
1202 checking changesets
1203 checking manifests
1203 checking manifests
1204 crosschecking files in changesets and manifests
1204 crosschecking files in changesets and manifests
1205 checking files
1205 checking files
1206 10 files, 10 changesets, 28 total revisions
1206 10 files, 10 changesets, 28 total revisions
1207 searching 1 changesets for largefiles
1207 searching 1 changesets for largefiles
1208 changeset 9:598410d3eb9a: sub/large4 missing
1208 changeset 9:598410d3eb9a: sub/large4 missing
1209 (looked for hash e166e74c7303192238d60af5a9c4ce9bef0b7928)
1209 (looked for hash e166e74c7303192238d60af5a9c4ce9bef0b7928)
1210 verified existence of 3 revisions of 3 largefiles
1210 verified existence of 3 revisions of 3 largefiles
1211 [1]
1211 [1]
1212
1212
1213 - introduce corruption and make sure that it is caught when checking content:
1213 - introduce corruption and make sure that it is caught when checking content:
1214 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1214 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1215 $ hg verify -q --large --lfc
1215 $ hg verify -q --large --lfc
1216 searching 1 changesets for largefiles
1216 searching 1 changesets for largefiles
1217 changeset 9:598410d3eb9a: sub/large4: contents differ
1217 changeset 9:598410d3eb9a: sub/large4: contents differ
1218 ($TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928: (glob)
1218 ($TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928: (glob)
1219 expected hash e166e74c7303192238d60af5a9c4ce9bef0b7928,
1219 expected hash e166e74c7303192238d60af5a9c4ce9bef0b7928,
1220 but got 1f19b76d5b3cad1472c87efb42b582c97e040060)
1220 but got 1f19b76d5b3cad1472c87efb42b582c97e040060)
1221 verified contents of 3 revisions of 3 largefiles
1221 verified contents of 3 revisions of 3 largefiles
1222 [1]
1222 [1]
1223
1223
1224 - cleanup
1224 - cleanup
1225 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1225 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1226
1226
1227 - verifying all revisions will fail because we didn't clone all largefiles to d:
1227 - verifying all revisions will fail because we didn't clone all largefiles to d:
1228 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1228 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1229 $ hg verify -q --large --lfa --lfc
1229 $ hg verify -q --large --lfa --lfc
1230 searching 10 changesets for largefiles
1230 searching 10 changesets for largefiles
1231 changeset 0:30d30fe6a5be: large1 missing
1231 changeset 0:30d30fe6a5be: large1 missing
1232 (looked for hash 4669e532d5b2c093a78eca010077e708a071bb64)
1232 (looked for hash 4669e532d5b2c093a78eca010077e708a071bb64)
1233 changeset 0:30d30fe6a5be: sub/large2 missing
1233 changeset 0:30d30fe6a5be: sub/large2 missing
1234 (looked for hash 1deebade43c8c498a3c8daddac0244dc55d1331d)
1234 (looked for hash 1deebade43c8c498a3c8daddac0244dc55d1331d)
1235 changeset 1:ce8896473775: large1 missing
1235 changeset 1:ce8896473775: large1 missing
1236 (looked for hash 5f78770c0e77ba4287ad6ef3071c9bf9c379742f)
1236 (looked for hash 5f78770c0e77ba4287ad6ef3071c9bf9c379742f)
1237 changeset 1:ce8896473775: sub/large2: contents differ
1237 changeset 1:ce8896473775: sub/large2: contents differ
1238 ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
1238 ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
1239 expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
1239 expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
1240 but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
1240 but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
1241 changeset 3:9e8fbc4bce62: large1: contents differ
1241 changeset 3:9e8fbc4bce62: large1: contents differ
1242 ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
1242 ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
1243 expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
1243 expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
1244 but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
1244 but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
1245 changeset 4:74c02385b94c: large3: contents differ
1245 changeset 4:74c02385b94c: large3: contents differ
1246 ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
1246 ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
1247 expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
1247 expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
1248 but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
1248 but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
1249 changeset 4:74c02385b94c: sub/large4: contents differ
1249 changeset 4:74c02385b94c: sub/large4: contents differ
1250 ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
1250 ($TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4: (glob)
1251 expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
1251 expected hash eb7338044dc27f9bc59b8dd5a246b065ead7a9c4,
1252 but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
1252 but got cfef678f24d3e339944138ecdd8fd85ca21d820f)
1253 changeset 5:9d5af5072dbd: large3 missing
1253 changeset 5:9d5af5072dbd: large3 missing
1254 (looked for hash baaf12afde9d8d67f25dab6dced0d2bf77dba47c)
1254 (looked for hash baaf12afde9d8d67f25dab6dced0d2bf77dba47c)
1255 changeset 5:9d5af5072dbd: sub/large4 missing
1255 changeset 5:9d5af5072dbd: sub/large4 missing
1256 (looked for hash aeb2210d19f02886dde00dac279729a48471e2f9)
1256 (looked for hash aeb2210d19f02886dde00dac279729a48471e2f9)
1257 changeset 6:4355d653f84f: large3 missing
1257 changeset 6:4355d653f84f: large3 missing
1258 (looked for hash 7838695e10da2bb75ac1156565f40a2595fa2fa0)
1258 (looked for hash 7838695e10da2bb75ac1156565f40a2595fa2fa0)
1259 verified contents of 15 revisions of 6 largefiles
1259 verified contents of 15 revisions of 6 largefiles
1260 [1]
1260 [1]
1261
1261
1262 - cleanup
1262 - cleanup
1263 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1263 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1264
1264
1265 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1266
1267 $ hg pull --all-largefiles
1268 pulling from $TESTTMP/d (glob)
1269 searching for changes
1270 no changes found
1271 caching new largefiles
1272 0 largefiles cached
1273 0 additional largefiles cached
1274
1265 Merging does not revert to old versions of largefiles and also check
1275 Merging does not revert to old versions of largefiles and also check
1266 that merging after having pulled from a non-default remote works
1276 that merging after having pulled from a non-default remote works
1267 correctly.
1277 correctly.
1268
1278
1269 $ cd ..
1279 $ cd ..
1270 $ hg clone -r 7 e temp
1280 $ hg clone -r 7 e temp
1271 adding changesets
1281 adding changesets
1272 adding manifests
1282 adding manifests
1273 adding file changes
1283 adding file changes
1274 added 8 changesets with 24 changes to 10 files
1284 added 8 changesets with 24 changes to 10 files
1275 updating to branch default
1285 updating to branch default
1276 getting changed largefiles
1286 getting changed largefiles
1277 3 largefiles updated, 0 removed
1287 3 largefiles updated, 0 removed
1278 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1288 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1279 $ hg clone temp f
1289 $ hg clone temp f
1280 updating to branch default
1290 updating to branch default
1281 getting changed largefiles
1291 getting changed largefiles
1282 3 largefiles updated, 0 removed
1292 3 largefiles updated, 0 removed
1283 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1293 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1284 # Delete the largefiles in the largefiles system cache so that we have an
1294 # Delete the largefiles in the largefiles system cache so that we have an
1285 # opportunity to test that caching after a pull works.
1295 # opportunity to test that caching after a pull works.
1286 $ rm "${USERCACHE}"/*
1296 $ rm "${USERCACHE}"/*
1287 $ cd f
1297 $ cd f
1288 $ echo "large4-merge-test" > sub/large4
1298 $ echo "large4-merge-test" > sub/large4
1289 $ hg commit -m "Modify large4 to test merge"
1299 $ hg commit -m "Modify large4 to test merge"
1290 Invoking status precommit hook
1300 Invoking status precommit hook
1291 M sub/large4
1301 M sub/large4
1292 $ hg pull ../e
1302 $ hg pull ../e
1293 pulling from ../e
1303 pulling from ../e
1294 searching for changes
1304 searching for changes
1295 adding changesets
1305 adding changesets
1296 adding manifests
1306 adding manifests
1297 adding file changes
1307 adding file changes
1298 added 2 changesets with 4 changes to 4 files (+1 heads)
1308 added 2 changesets with 4 changes to 4 files (+1 heads)
1299 (run 'hg heads' to see heads, 'hg merge' to merge)
1309 (run 'hg heads' to see heads, 'hg merge' to merge)
1300 caching new largefiles
1310 caching new largefiles
1301 2 largefiles cached
1311 2 largefiles cached
1302 $ hg merge
1312 $ hg merge
1303 merging sub/large4
1313 merging sub/large4
1304 largefile sub/large4 has a merge conflict
1314 largefile sub/large4 has a merge conflict
1305 keep (l)ocal or take (o)ther? l
1315 keep (l)ocal or take (o)ther? l
1306 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1316 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1307 (branch merge, don't forget to commit)
1317 (branch merge, don't forget to commit)
1308 getting changed largefiles
1318 getting changed largefiles
1309 1 largefiles updated, 0 removed
1319 1 largefiles updated, 0 removed
1310 $ hg commit -m "Merge repos e and f"
1320 $ hg commit -m "Merge repos e and f"
1311 Invoking status precommit hook
1321 Invoking status precommit hook
1312 M normal3
1322 M normal3
1313 M sub/normal4
1323 M sub/normal4
1314 M sub2/large6
1324 M sub2/large6
1315 $ cat normal3
1325 $ cat normal3
1316 normal3-modified
1326 normal3-modified
1317 $ cat sub/normal4
1327 $ cat sub/normal4
1318 normal4-modified
1328 normal4-modified
1319 $ cat sub/large4
1329 $ cat sub/large4
1320 large4-merge-test
1330 large4-merge-test
1321 $ cat sub2/large6
1331 $ cat sub2/large6
1322 large6-modified
1332 large6-modified
1323 $ cat sub2/large7
1333 $ cat sub2/large7
1324 large7
1334 large7
1325
1335
1326 Test status after merging with a branch that introduces a new largefile:
1336 Test status after merging with a branch that introduces a new largefile:
1327
1337
1328 $ echo large > large
1338 $ echo large > large
1329 $ hg add --large large
1339 $ hg add --large large
1330 $ hg commit -m 'add largefile'
1340 $ hg commit -m 'add largefile'
1331 Invoking status precommit hook
1341 Invoking status precommit hook
1332 A large
1342 A large
1333 $ hg update -q ".^"
1343 $ hg update -q ".^"
1334 $ echo change >> normal3
1344 $ echo change >> normal3
1335 $ hg commit -m 'some change'
1345 $ hg commit -m 'some change'
1336 Invoking status precommit hook
1346 Invoking status precommit hook
1337 M normal3
1347 M normal3
1338 created new head
1348 created new head
1339 $ hg merge
1349 $ hg merge
1340 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1350 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1341 (branch merge, don't forget to commit)
1351 (branch merge, don't forget to commit)
1342 getting changed largefiles
1352 getting changed largefiles
1343 1 largefiles updated, 0 removed
1353 1 largefiles updated, 0 removed
1344 $ hg status
1354 $ hg status
1345 M large
1355 M large
1346
1356
1347 - make sure update of merge with removed largefiles fails as expected
1357 - make sure update of merge with removed largefiles fails as expected
1348 $ hg rm sub2/large6
1358 $ hg rm sub2/large6
1349 $ hg up -r.
1359 $ hg up -r.
1350 abort: outstanding uncommitted merges
1360 abort: outstanding uncommitted merges
1351 [255]
1361 [255]
1352
1362
1353 - revert should be able to revert files introduced in a pending merge
1363 - revert should be able to revert files introduced in a pending merge
1354 $ hg revert --all -r .
1364 $ hg revert --all -r .
1355 removing .hglf/large (glob)
1365 removing .hglf/large (glob)
1356 undeleting .hglf/sub2/large6 (glob)
1366 undeleting .hglf/sub2/large6 (glob)
1357
1367
1358 Test that a normal file and a largefile with the same name and path cannot
1368 Test that a normal file and a largefile with the same name and path cannot
1359 coexist.
1369 coexist.
1360
1370
1361 $ rm sub2/large7
1371 $ rm sub2/large7
1362 $ echo "largeasnormal" > sub2/large7
1372 $ echo "largeasnormal" > sub2/large7
1363 $ hg add sub2/large7
1373 $ hg add sub2/large7
1364 sub2/large7 already a largefile
1374 sub2/large7 already a largefile
1365
1375
1366 Test that transplanting a largefile change works correctly.
1376 Test that transplanting a largefile change works correctly.
1367
1377
1368 $ cd ..
1378 $ cd ..
1369 $ hg clone -r 8 d g
1379 $ hg clone -r 8 d g
1370 adding changesets
1380 adding changesets
1371 adding manifests
1381 adding manifests
1372 adding file changes
1382 adding file changes
1373 added 9 changesets with 26 changes to 10 files
1383 added 9 changesets with 26 changes to 10 files
1374 updating to branch default
1384 updating to branch default
1375 getting changed largefiles
1385 getting changed largefiles
1376 3 largefiles updated, 0 removed
1386 3 largefiles updated, 0 removed
1377 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1387 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1378 $ cd g
1388 $ cd g
1379 $ hg transplant -s ../d 598410d3eb9a
1389 $ hg transplant -s ../d 598410d3eb9a
1380 searching for changes
1390 searching for changes
1381 searching for changes
1391 searching for changes
1382 adding changesets
1392 adding changesets
1383 adding manifests
1393 adding manifests
1384 adding file changes
1394 adding file changes
1385 added 1 changesets with 2 changes to 2 files
1395 added 1 changesets with 2 changes to 2 files
1386 getting changed largefiles
1396 getting changed largefiles
1387 1 largefiles updated, 0 removed
1397 1 largefiles updated, 0 removed
1388 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1398 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1389 9:598410d3eb9a modify normal file largefile in repo d
1399 9:598410d3eb9a modify normal file largefile in repo d
1390 8:a381d2c8c80e modify normal file and largefile in repo b
1400 8:a381d2c8c80e modify normal file and largefile in repo b
1391 7:daea875e9014 add/edit more largefiles
1401 7:daea875e9014 add/edit more largefiles
1392 6:4355d653f84f edit files yet again
1402 6:4355d653f84f edit files yet again
1393 5:9d5af5072dbd edit files again
1403 5:9d5af5072dbd edit files again
1394 4:74c02385b94c move files
1404 4:74c02385b94c move files
1395 3:9e8fbc4bce62 copy files
1405 3:9e8fbc4bce62 copy files
1396 2:51a0ae4d5864 remove files
1406 2:51a0ae4d5864 remove files
1397 1:ce8896473775 edit files
1407 1:ce8896473775 edit files
1398 0:30d30fe6a5be add files
1408 0:30d30fe6a5be add files
1399 $ cat normal3
1409 $ cat normal3
1400 normal3-modified
1410 normal3-modified
1401 $ cat sub/normal4
1411 $ cat sub/normal4
1402 normal4-modified
1412 normal4-modified
1403 $ cat sub/large4
1413 $ cat sub/large4
1404 large4-modified
1414 large4-modified
1405 $ cat sub2/large6
1415 $ cat sub2/large6
1406 large6-modified
1416 large6-modified
1407 $ cat sub2/large7
1417 $ cat sub2/large7
1408 large7
1418 large7
1409
1419
1410 Cat a largefile
1420 Cat a largefile
1411 $ hg cat normal3
1421 $ hg cat normal3
1412 normal3-modified
1422 normal3-modified
1413 $ hg cat sub/large4
1423 $ hg cat sub/large4
1414 large4-modified
1424 large4-modified
1415 $ rm "${USERCACHE}"/*
1425 $ rm "${USERCACHE}"/*
1416 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1426 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1417 $ cat cat.out
1427 $ cat cat.out
1418 large4-modified
1428 large4-modified
1419 $ rm cat.out
1429 $ rm cat.out
1420 $ hg cat -r a381d2c8c80e normal3
1430 $ hg cat -r a381d2c8c80e normal3
1421 normal3-modified
1431 normal3-modified
1422 $ hg cat -r '.^' normal3
1432 $ hg cat -r '.^' normal3
1423 normal3-modified
1433 normal3-modified
1424 $ hg cat -r '.^' sub/large4 doesntexist
1434 $ hg cat -r '.^' sub/large4 doesntexist
1425 large4-modified
1435 large4-modified
1426 doesntexist: no such file in rev a381d2c8c80e
1436 doesntexist: no such file in rev a381d2c8c80e
1427 [1]
1437 [1]
1428
1438
1429 Test that renaming a largefile results in correct output for status
1439 Test that renaming a largefile results in correct output for status
1430
1440
1431 $ hg rename sub/large4 large4-renamed
1441 $ hg rename sub/large4 large4-renamed
1432 $ hg commit -m "test rename output"
1442 $ hg commit -m "test rename output"
1433 Invoking status precommit hook
1443 Invoking status precommit hook
1434 A large4-renamed
1444 A large4-renamed
1435 R sub/large4
1445 R sub/large4
1436 $ cat large4-renamed
1446 $ cat large4-renamed
1437 large4-modified
1447 large4-modified
1438 $ cd sub2
1448 $ cd sub2
1439 $ hg rename large6 large6-renamed
1449 $ hg rename large6 large6-renamed
1440 $ hg st
1450 $ hg st
1441 A sub2/large6-renamed
1451 A sub2/large6-renamed
1442 R sub2/large6
1452 R sub2/large6
1443 $ cd ..
1453 $ cd ..
1444
1454
1445 Test --normal flag
1455 Test --normal flag
1446
1456
1447 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1457 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1448 $ hg add --normal --large new-largefile
1458 $ hg add --normal --large new-largefile
1449 abort: --normal cannot be used with --large
1459 abort: --normal cannot be used with --large
1450 [255]
1460 [255]
1451 $ hg add --normal new-largefile
1461 $ hg add --normal new-largefile
1452 new-largefile: up to 69 MB of RAM may be required to manage this file
1462 new-largefile: up to 69 MB of RAM may be required to manage this file
1453 (use 'hg revert new-largefile' to cancel the pending addition)
1463 (use 'hg revert new-largefile' to cancel the pending addition)
1454 $ cd ..
1464 $ cd ..
1455
1465
1456 #if serve
1466 #if serve
1457 vanilla clients not locked out from largefiles servers on vanilla repos
1467 vanilla clients not locked out from largefiles servers on vanilla repos
1458 $ mkdir r1
1468 $ mkdir r1
1459 $ cd r1
1469 $ cd r1
1460 $ hg init
1470 $ hg init
1461 $ echo c1 > f1
1471 $ echo c1 > f1
1462 $ hg add f1
1472 $ hg add f1
1463 $ hg commit -m "m1"
1473 $ hg commit -m "m1"
1464 Invoking status precommit hook
1474 Invoking status precommit hook
1465 A f1
1475 A f1
1466 $ cd ..
1476 $ cd ..
1467 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1477 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1468 $ cat hg.pid >> $DAEMON_PIDS
1478 $ cat hg.pid >> $DAEMON_PIDS
1469 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1479 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1470 requesting all changes
1480 requesting all changes
1471 adding changesets
1481 adding changesets
1472 adding manifests
1482 adding manifests
1473 adding file changes
1483 adding file changes
1474 added 1 changesets with 1 changes to 1 files
1484 added 1 changesets with 1 changes to 1 files
1475 updating to branch default
1485 updating to branch default
1476 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1486 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1477
1487
1478 largefiles clients still work with vanilla servers
1488 largefiles clients still work with vanilla servers
1479 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1489 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1480 $ cat hg.pid >> $DAEMON_PIDS
1490 $ cat hg.pid >> $DAEMON_PIDS
1481 $ hg clone http://localhost:$HGPORT1 r3
1491 $ hg clone http://localhost:$HGPORT1 r3
1482 requesting all changes
1492 requesting all changes
1483 adding changesets
1493 adding changesets
1484 adding manifests
1494 adding manifests
1485 adding file changes
1495 adding file changes
1486 added 1 changesets with 1 changes to 1 files
1496 added 1 changesets with 1 changes to 1 files
1487 updating to branch default
1497 updating to branch default
1488 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1498 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1489 #endif
1499 #endif
1490
1500
1491
1501
1492 vanilla clients locked out from largefiles http repos
1502 vanilla clients locked out from largefiles http repos
1493 $ mkdir r4
1503 $ mkdir r4
1494 $ cd r4
1504 $ cd r4
1495 $ hg init
1505 $ hg init
1496 $ echo c1 > f1
1506 $ echo c1 > f1
1497 $ hg add --large f1
1507 $ hg add --large f1
1498 $ hg commit -m "m1"
1508 $ hg commit -m "m1"
1499 Invoking status precommit hook
1509 Invoking status precommit hook
1500 A f1
1510 A f1
1501 $ cd ..
1511 $ cd ..
1502
1512
1503 largefiles can be pushed locally (issue3583)
1513 largefiles can be pushed locally (issue3583)
1504 $ hg init dest
1514 $ hg init dest
1505 $ cd r4
1515 $ cd r4
1506 $ hg outgoing ../dest
1516 $ hg outgoing ../dest
1507 comparing with ../dest
1517 comparing with ../dest
1508 searching for changes
1518 searching for changes
1509 changeset: 0:639881c12b4c
1519 changeset: 0:639881c12b4c
1510 tag: tip
1520 tag: tip
1511 user: test
1521 user: test
1512 date: Thu Jan 01 00:00:00 1970 +0000
1522 date: Thu Jan 01 00:00:00 1970 +0000
1513 summary: m1
1523 summary: m1
1514
1524
1515 $ hg push ../dest
1525 $ hg push ../dest
1516 pushing to ../dest
1526 pushing to ../dest
1517 searching for changes
1527 searching for changes
1518 searching for changes
1528 searching for changes
1519 adding changesets
1529 adding changesets
1520 adding manifests
1530 adding manifests
1521 adding file changes
1531 adding file changes
1522 added 1 changesets with 1 changes to 1 files
1532 added 1 changesets with 1 changes to 1 files
1523
1533
1524 exit code with nothing outgoing (issue3611)
1534 exit code with nothing outgoing (issue3611)
1525 $ hg outgoing ../dest
1535 $ hg outgoing ../dest
1526 comparing with ../dest
1536 comparing with ../dest
1527 searching for changes
1537 searching for changes
1528 no changes found
1538 no changes found
1529 [1]
1539 [1]
1530 $ cd ..
1540 $ cd ..
1531
1541
1532 #if serve
1542 #if serve
1533 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1543 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1534 $ cat hg.pid >> $DAEMON_PIDS
1544 $ cat hg.pid >> $DAEMON_PIDS
1535 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1545 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1536 abort: remote error:
1546 abort: remote error:
1537
1547
1538 This repository uses the largefiles extension.
1548 This repository uses the largefiles extension.
1539
1549
1540 Please enable it in your Mercurial config file.
1550 Please enable it in your Mercurial config file.
1541 [255]
1551 [255]
1542
1552
1543 used all HGPORTs, kill all daemons
1553 used all HGPORTs, kill all daemons
1544 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1554 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1545 #endif
1555 #endif
1546
1556
1547 vanilla clients locked out from largefiles ssh repos
1557 vanilla clients locked out from largefiles ssh repos
1548 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1558 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1549 abort: remote error:
1559 abort: remote error:
1550
1560
1551 This repository uses the largefiles extension.
1561 This repository uses the largefiles extension.
1552
1562
1553 Please enable it in your Mercurial config file.
1563 Please enable it in your Mercurial config file.
1554 [255]
1564 [255]
1555
1565
1556 #if serve
1566 #if serve
1557
1567
1558 largefiles clients refuse to push largefiles repos to vanilla servers
1568 largefiles clients refuse to push largefiles repos to vanilla servers
1559 $ mkdir r6
1569 $ mkdir r6
1560 $ cd r6
1570 $ cd r6
1561 $ hg init
1571 $ hg init
1562 $ echo c1 > f1
1572 $ echo c1 > f1
1563 $ hg add f1
1573 $ hg add f1
1564 $ hg commit -m "m1"
1574 $ hg commit -m "m1"
1565 Invoking status precommit hook
1575 Invoking status precommit hook
1566 A f1
1576 A f1
1567 $ cat >> .hg/hgrc <<!
1577 $ cat >> .hg/hgrc <<!
1568 > [web]
1578 > [web]
1569 > push_ssl = false
1579 > push_ssl = false
1570 > allow_push = *
1580 > allow_push = *
1571 > !
1581 > !
1572 $ cd ..
1582 $ cd ..
1573 $ hg clone r6 r7
1583 $ hg clone r6 r7
1574 updating to branch default
1584 updating to branch default
1575 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1585 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1576 $ cd r7
1586 $ cd r7
1577 $ echo c2 > f2
1587 $ echo c2 > f2
1578 $ hg add --large f2
1588 $ hg add --large f2
1579 $ hg commit -m "m2"
1589 $ hg commit -m "m2"
1580 Invoking status precommit hook
1590 Invoking status precommit hook
1581 A f2
1591 A f2
1582 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1592 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1583 $ cat ../hg.pid >> $DAEMON_PIDS
1593 $ cat ../hg.pid >> $DAEMON_PIDS
1584 $ hg push http://localhost:$HGPORT
1594 $ hg push http://localhost:$HGPORT
1585 pushing to http://localhost:$HGPORT/
1595 pushing to http://localhost:$HGPORT/
1586 searching for changes
1596 searching for changes
1587 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1597 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1588 [255]
1598 [255]
1589 $ cd ..
1599 $ cd ..
1590
1600
1591 putlfile errors are shown (issue3123)
1601 putlfile errors are shown (issue3123)
1592 Corrupt the cached largefile in r7 and move it out of the servers usercache
1602 Corrupt the cached largefile in r7 and move it out of the servers usercache
1593 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1603 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1594 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1604 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1595 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1605 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1596 $ hg init empty
1606 $ hg init empty
1597 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1607 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1598 > --config 'web.allow_push=*' --config web.push_ssl=False
1608 > --config 'web.allow_push=*' --config web.push_ssl=False
1599 $ cat hg.pid >> $DAEMON_PIDS
1609 $ cat hg.pid >> $DAEMON_PIDS
1600 $ hg push -R r7 http://localhost:$HGPORT1
1610 $ hg push -R r7 http://localhost:$HGPORT1
1601 pushing to http://localhost:$HGPORT1/
1611 pushing to http://localhost:$HGPORT1/
1602 searching for changes
1612 searching for changes
1603 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1613 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1604 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1614 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1605 [255]
1615 [255]
1606 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1616 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1607 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1617 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1608 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1618 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1609 $ hg push -R r7 http://localhost:$HGPORT1
1619 $ hg push -R r7 http://localhost:$HGPORT1
1610 pushing to http://localhost:$HGPORT1/
1620 pushing to http://localhost:$HGPORT1/
1611 searching for changes
1621 searching for changes
1612 searching for changes
1622 searching for changes
1613 remote: adding changesets
1623 remote: adding changesets
1614 remote: adding manifests
1624 remote: adding manifests
1615 remote: adding file changes
1625 remote: adding file changes
1616 remote: added 2 changesets with 2 changes to 2 files
1626 remote: added 2 changesets with 2 changes to 2 files
1617 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1627 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1618 server side corruption
1628 server side corruption
1619 $ rm -rf empty
1629 $ rm -rf empty
1620
1630
1621 Push a largefiles repository to a served empty repository
1631 Push a largefiles repository to a served empty repository
1622 $ hg init r8
1632 $ hg init r8
1623 $ echo c3 > r8/f1
1633 $ echo c3 > r8/f1
1624 $ hg add --large r8/f1 -R r8
1634 $ hg add --large r8/f1 -R r8
1625 $ hg commit -m "m1" -R r8
1635 $ hg commit -m "m1" -R r8
1626 Invoking status precommit hook
1636 Invoking status precommit hook
1627 A f1
1637 A f1
1628 $ hg init empty
1638 $ hg init empty
1629 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1639 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1630 > --config 'web.allow_push=*' --config web.push_ssl=False
1640 > --config 'web.allow_push=*' --config web.push_ssl=False
1631 $ cat hg.pid >> $DAEMON_PIDS
1641 $ cat hg.pid >> $DAEMON_PIDS
1632 $ rm "${USERCACHE}"/*
1642 $ rm "${USERCACHE}"/*
1633 $ hg push -R r8 http://localhost:$HGPORT2/#default
1643 $ hg push -R r8 http://localhost:$HGPORT2/#default
1634 pushing to http://localhost:$HGPORT2/
1644 pushing to http://localhost:$HGPORT2/
1635 searching for changes
1645 searching for changes
1636 searching for changes
1646 searching for changes
1637 remote: adding changesets
1647 remote: adding changesets
1638 remote: adding manifests
1648 remote: adding manifests
1639 remote: adding file changes
1649 remote: adding file changes
1640 remote: added 1 changesets with 1 changes to 1 files
1650 remote: added 1 changesets with 1 changes to 1 files
1641 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1651 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1642 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1652 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1643
1653
1644 Clone over http, no largefiles pulled on clone.
1654 Clone over http, no largefiles pulled on clone.
1645
1655
1646 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1656 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1647 adding changesets
1657 adding changesets
1648 adding manifests
1658 adding manifests
1649 adding file changes
1659 adding file changes
1650 added 1 changesets with 1 changes to 1 files
1660 added 1 changesets with 1 changes to 1 files
1651
1661
1652 test 'verify' with remotestore:
1662 test 'verify' with remotestore:
1653
1663
1654 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1664 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1655 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1665 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1656 $ hg -R http-clone verify --large --lfa
1666 $ hg -R http-clone verify --large --lfa
1657 checking changesets
1667 checking changesets
1658 checking manifests
1668 checking manifests
1659 crosschecking files in changesets and manifests
1669 crosschecking files in changesets and manifests
1660 checking files
1670 checking files
1661 1 files, 1 changesets, 1 total revisions
1671 1 files, 1 changesets, 1 total revisions
1662 searching 1 changesets for largefiles
1672 searching 1 changesets for largefiles
1663 changeset 0:cf03e5bb9936: f1 missing
1673 changeset 0:cf03e5bb9936: f1 missing
1664 verified existence of 1 revisions of 1 largefiles
1674 verified existence of 1 revisions of 1 largefiles
1665 [1]
1675 [1]
1666 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1676 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1667 $ hg -R http-clone -q verify --large --lfa
1677 $ hg -R http-clone -q verify --large --lfa
1668 searching 1 changesets for largefiles
1678 searching 1 changesets for largefiles
1669 verified existence of 1 revisions of 1 largefiles
1679 verified existence of 1 revisions of 1 largefiles
1670
1680
1671 largefiles pulled on update - a largefile missing on the server:
1681 largefiles pulled on update - a largefile missing on the server:
1672 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1682 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1673 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1683 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1674 getting changed largefiles
1684 getting changed largefiles
1675 abort: remotestore: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 is missing
1685 abort: remotestore: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 is missing
1676 [255]
1686 [255]
1677 $ hg -R http-clone up -Cqr null
1687 $ hg -R http-clone up -Cqr null
1678
1688
1679 largefiles pulled on update - a largefile corrupted on the server:
1689 largefiles pulled on update - a largefile corrupted on the server:
1680 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1690 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1681 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1691 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1682 getting changed largefiles
1692 getting changed largefiles
1683 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1693 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1684 0 largefiles updated, 0 removed
1694 0 largefiles updated, 0 removed
1685 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1695 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1686 $ hg -R http-clone st
1696 $ hg -R http-clone st
1687 ! f1
1697 ! f1
1688 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1698 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1689 $ [ ! -f http-clone/f1 ]
1699 $ [ ! -f http-clone/f1 ]
1690 $ [ ! -f http-clone-usercache ]
1700 $ [ ! -f http-clone-usercache ]
1691 $ hg -R http-clone verify --large --lfc
1701 $ hg -R http-clone verify --large --lfc
1692 checking changesets
1702 checking changesets
1693 checking manifests
1703 checking manifests
1694 crosschecking files in changesets and manifests
1704 crosschecking files in changesets and manifests
1695 checking files
1705 checking files
1696 1 files, 1 changesets, 1 total revisions
1706 1 files, 1 changesets, 1 total revisions
1697 searching 1 changesets for largefiles
1707 searching 1 changesets for largefiles
1698 verified contents of 1 revisions of 1 largefiles
1708 verified contents of 1 revisions of 1 largefiles
1699 $ hg -R http-clone up -Cqr null
1709 $ hg -R http-clone up -Cqr null
1700
1710
1701 largefiles pulled on update - no server side problems:
1711 largefiles pulled on update - no server side problems:
1702 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1712 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1703 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1713 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1704 resolving manifests
1714 resolving manifests
1705 overwrite: False, partial: False
1715 overwrite: False, partial: False
1706 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1716 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1707 .hglf/f1: remote created -> g
1717 .hglf/f1: remote created -> g
1708 updating: .hglf/f1 1/1 files (100.00%)
1718 updating: .hglf/f1 1/1 files (100.00%)
1709 getting .hglf/f1
1719 getting .hglf/f1
1710 getting changed largefiles
1720 getting changed largefiles
1711 using http://localhost:$HGPORT2/
1721 using http://localhost:$HGPORT2/
1712 sending capabilities command
1722 sending capabilities command
1713 getting largefiles: 0/1 lfile (0.00%)
1723 getting largefiles: 0/1 lfile (0.00%)
1714 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1724 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1715 sending batch command
1725 sending batch command
1716 sending getlfile command
1726 sending getlfile command
1717 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1727 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1718 1 largefiles updated, 0 removed
1728 1 largefiles updated, 0 removed
1719 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1729 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1720
1730
1721 $ ls http-clone-usercache/*
1731 $ ls http-clone-usercache/*
1722 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1732 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1723
1733
1724 $ rm -rf empty http-clone*
1734 $ rm -rf empty http-clone*
1725
1735
1726 used all HGPORTs, kill all daemons
1736 used all HGPORTs, kill all daemons
1727 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1737 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1728
1738
1729 #endif
1739 #endif
1730
1740
1731
1741
1732 #if unix-permissions
1742 #if unix-permissions
1733
1743
1734 Clone a local repository owned by another user
1744 Clone a local repository owned by another user
1735 We have to simulate that here by setting $HOME and removing write permissions
1745 We have to simulate that here by setting $HOME and removing write permissions
1736 $ ORIGHOME="$HOME"
1746 $ ORIGHOME="$HOME"
1737 $ mkdir alice
1747 $ mkdir alice
1738 $ HOME="`pwd`/alice"
1748 $ HOME="`pwd`/alice"
1739 $ cd alice
1749 $ cd alice
1740 $ hg init pubrepo
1750 $ hg init pubrepo
1741 $ cd pubrepo
1751 $ cd pubrepo
1742 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1752 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1743 $ hg add --large a-large-file
1753 $ hg add --large a-large-file
1744 $ hg commit -m "Add a large file"
1754 $ hg commit -m "Add a large file"
1745 Invoking status precommit hook
1755 Invoking status precommit hook
1746 A a-large-file
1756 A a-large-file
1747 $ cd ..
1757 $ cd ..
1748 $ chmod -R a-w pubrepo
1758 $ chmod -R a-w pubrepo
1749 $ cd ..
1759 $ cd ..
1750 $ mkdir bob
1760 $ mkdir bob
1751 $ HOME="`pwd`/bob"
1761 $ HOME="`pwd`/bob"
1752 $ cd bob
1762 $ cd bob
1753 $ hg clone --pull ../alice/pubrepo pubrepo
1763 $ hg clone --pull ../alice/pubrepo pubrepo
1754 requesting all changes
1764 requesting all changes
1755 adding changesets
1765 adding changesets
1756 adding manifests
1766 adding manifests
1757 adding file changes
1767 adding file changes
1758 added 1 changesets with 1 changes to 1 files
1768 added 1 changesets with 1 changes to 1 files
1759 updating to branch default
1769 updating to branch default
1760 getting changed largefiles
1770 getting changed largefiles
1761 1 largefiles updated, 0 removed
1771 1 largefiles updated, 0 removed
1762 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1772 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1763 $ cd ..
1773 $ cd ..
1764 $ chmod -R u+w alice/pubrepo
1774 $ chmod -R u+w alice/pubrepo
1765 $ HOME="$ORIGHOME"
1775 $ HOME="$ORIGHOME"
1766
1776
1767 #endif
1777 #endif
1768
1778
1769 #if symlink
1779 #if symlink
1770
1780
1771 Symlink to a large largefile should behave the same as a symlink to a normal file
1781 Symlink to a large largefile should behave the same as a symlink to a normal file
1772 $ hg init largesymlink
1782 $ hg init largesymlink
1773 $ cd largesymlink
1783 $ cd largesymlink
1774 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1784 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1775 $ hg add --large largefile
1785 $ hg add --large largefile
1776 $ hg commit -m "commit a large file"
1786 $ hg commit -m "commit a large file"
1777 Invoking status precommit hook
1787 Invoking status precommit hook
1778 A largefile
1788 A largefile
1779 $ ln -s largefile largelink
1789 $ ln -s largefile largelink
1780 $ hg add largelink
1790 $ hg add largelink
1781 $ hg commit -m "commit a large symlink"
1791 $ hg commit -m "commit a large symlink"
1782 Invoking status precommit hook
1792 Invoking status precommit hook
1783 A largelink
1793 A largelink
1784 $ rm -f largelink
1794 $ rm -f largelink
1785 $ hg up >/dev/null
1795 $ hg up >/dev/null
1786 $ test -f largelink
1796 $ test -f largelink
1787 [1]
1797 [1]
1788 $ test -L largelink
1798 $ test -L largelink
1789 [1]
1799 [1]
1790 $ rm -f largelink # make next part of the test independent of the previous
1800 $ rm -f largelink # make next part of the test independent of the previous
1791 $ hg up -C >/dev/null
1801 $ hg up -C >/dev/null
1792 $ test -f largelink
1802 $ test -f largelink
1793 $ test -L largelink
1803 $ test -L largelink
1794 $ cd ..
1804 $ cd ..
1795
1805
1796 #endif
1806 #endif
1797
1807
1798 test for pattern matching on 'hg status':
1808 test for pattern matching on 'hg status':
1799 to boost performance, largefiles checks whether specified patterns are
1809 to boost performance, largefiles checks whether specified patterns are
1800 related to largefiles in working directory (NOT to STANDIN) or not.
1810 related to largefiles in working directory (NOT to STANDIN) or not.
1801
1811
1802 $ hg init statusmatch
1812 $ hg init statusmatch
1803 $ cd statusmatch
1813 $ cd statusmatch
1804
1814
1805 $ mkdir -p a/b/c/d
1815 $ mkdir -p a/b/c/d
1806 $ echo normal > a/b/c/d/e.normal.txt
1816 $ echo normal > a/b/c/d/e.normal.txt
1807 $ hg add a/b/c/d/e.normal.txt
1817 $ hg add a/b/c/d/e.normal.txt
1808 $ echo large > a/b/c/d/e.large.txt
1818 $ echo large > a/b/c/d/e.large.txt
1809 $ hg add --large a/b/c/d/e.large.txt
1819 $ hg add --large a/b/c/d/e.large.txt
1810 $ mkdir -p a/b/c/x
1820 $ mkdir -p a/b/c/x
1811 $ echo normal > a/b/c/x/y.normal.txt
1821 $ echo normal > a/b/c/x/y.normal.txt
1812 $ hg add a/b/c/x/y.normal.txt
1822 $ hg add a/b/c/x/y.normal.txt
1813 $ hg commit -m 'add files'
1823 $ hg commit -m 'add files'
1814 Invoking status precommit hook
1824 Invoking status precommit hook
1815 A a/b/c/d/e.large.txt
1825 A a/b/c/d/e.large.txt
1816 A a/b/c/d/e.normal.txt
1826 A a/b/c/d/e.normal.txt
1817 A a/b/c/x/y.normal.txt
1827 A a/b/c/x/y.normal.txt
1818
1828
1819 (1) no pattern: no performance boost
1829 (1) no pattern: no performance boost
1820 $ hg status -A
1830 $ hg status -A
1821 C a/b/c/d/e.large.txt
1831 C a/b/c/d/e.large.txt
1822 C a/b/c/d/e.normal.txt
1832 C a/b/c/d/e.normal.txt
1823 C a/b/c/x/y.normal.txt
1833 C a/b/c/x/y.normal.txt
1824
1834
1825 (2) pattern not related to largefiles: performance boost
1835 (2) pattern not related to largefiles: performance boost
1826 $ hg status -A a/b/c/x
1836 $ hg status -A a/b/c/x
1827 C a/b/c/x/y.normal.txt
1837 C a/b/c/x/y.normal.txt
1828
1838
1829 (3) pattern related to largefiles: no performance boost
1839 (3) pattern related to largefiles: no performance boost
1830 $ hg status -A a/b/c/d
1840 $ hg status -A a/b/c/d
1831 C a/b/c/d/e.large.txt
1841 C a/b/c/d/e.large.txt
1832 C a/b/c/d/e.normal.txt
1842 C a/b/c/d/e.normal.txt
1833
1843
1834 (4) pattern related to STANDIN (not to largefiles): performance boost
1844 (4) pattern related to STANDIN (not to largefiles): performance boost
1835 $ hg status -A .hglf/a
1845 $ hg status -A .hglf/a
1836 C .hglf/a/b/c/d/e.large.txt
1846 C .hglf/a/b/c/d/e.large.txt
1837
1847
1838 (5) mixed case: no performance boost
1848 (5) mixed case: no performance boost
1839 $ hg status -A a/b/c/x a/b/c/d
1849 $ hg status -A a/b/c/x a/b/c/d
1840 C a/b/c/d/e.large.txt
1850 C a/b/c/d/e.large.txt
1841 C a/b/c/d/e.normal.txt
1851 C a/b/c/d/e.normal.txt
1842 C a/b/c/x/y.normal.txt
1852 C a/b/c/x/y.normal.txt
1843
1853
1844 verify that largefiles doesn't break filesets
1854 verify that largefiles doesn't break filesets
1845
1855
1846 $ hg log --rev . --exclude "set:binary()"
1856 $ hg log --rev . --exclude "set:binary()"
1847 changeset: 0:41bd42f10efa
1857 changeset: 0:41bd42f10efa
1848 tag: tip
1858 tag: tip
1849 user: test
1859 user: test
1850 date: Thu Jan 01 00:00:00 1970 +0000
1860 date: Thu Jan 01 00:00:00 1970 +0000
1851 summary: add files
1861 summary: add files
1852
1862
1853 verify that large files in subrepos handled properly
1863 verify that large files in subrepos handled properly
1854 $ hg init subrepo
1864 $ hg init subrepo
1855 $ echo "subrepo = subrepo" > .hgsub
1865 $ echo "subrepo = subrepo" > .hgsub
1856 $ hg add .hgsub
1866 $ hg add .hgsub
1857 $ hg ci -m "add subrepo"
1867 $ hg ci -m "add subrepo"
1858 Invoking status precommit hook
1868 Invoking status precommit hook
1859 A .hgsub
1869 A .hgsub
1860 ? .hgsubstate
1870 ? .hgsubstate
1861 $ echo "rev 1" > subrepo/large.txt
1871 $ echo "rev 1" > subrepo/large.txt
1862 $ hg -R subrepo add --large subrepo/large.txt
1872 $ hg -R subrepo add --large subrepo/large.txt
1863 $ hg sum
1873 $ hg sum
1864 parent: 1:8ee150ea2e9c tip
1874 parent: 1:8ee150ea2e9c tip
1865 add subrepo
1875 add subrepo
1866 branch: default
1876 branch: default
1867 commit: 1 subrepos
1877 commit: 1 subrepos
1868 update: (current)
1878 update: (current)
1869 $ hg st
1879 $ hg st
1870 $ hg st -S
1880 $ hg st -S
1871 A subrepo/large.txt
1881 A subrepo/large.txt
1872 $ hg ci -S -m "commit top repo"
1882 $ hg ci -S -m "commit top repo"
1873 committing subrepository subrepo
1883 committing subrepository subrepo
1874 Invoking status precommit hook
1884 Invoking status precommit hook
1875 A large.txt
1885 A large.txt
1876 Invoking status precommit hook
1886 Invoking status precommit hook
1877 M .hgsubstate
1887 M .hgsubstate
1878 # No differences
1888 # No differences
1879 $ hg st -S
1889 $ hg st -S
1880 $ hg sum
1890 $ hg sum
1881 parent: 2:ce4cd0c527a6 tip
1891 parent: 2:ce4cd0c527a6 tip
1882 commit top repo
1892 commit top repo
1883 branch: default
1893 branch: default
1884 commit: (clean)
1894 commit: (clean)
1885 update: (current)
1895 update: (current)
1886 $ echo "rev 2" > subrepo/large.txt
1896 $ echo "rev 2" > subrepo/large.txt
1887 $ hg st -S
1897 $ hg st -S
1888 M subrepo/large.txt
1898 M subrepo/large.txt
1889 $ hg sum
1899 $ hg sum
1890 parent: 2:ce4cd0c527a6 tip
1900 parent: 2:ce4cd0c527a6 tip
1891 commit top repo
1901 commit top repo
1892 branch: default
1902 branch: default
1893 commit: 1 subrepos
1903 commit: 1 subrepos
1894 update: (current)
1904 update: (current)
1895 $ hg ci -m "this commit should fail without -S"
1905 $ hg ci -m "this commit should fail without -S"
1896 abort: uncommitted changes in subrepo subrepo
1906 abort: uncommitted changes in subrepo subrepo
1897 (use --subrepos for recursive commit)
1907 (use --subrepos for recursive commit)
1898 [255]
1908 [255]
1899
1909
1900 Add a normal file to the subrepo, then test archiving
1910 Add a normal file to the subrepo, then test archiving
1901
1911
1902 $ echo 'normal file' > subrepo/normal.txt
1912 $ echo 'normal file' > subrepo/normal.txt
1903 $ hg -R subrepo add subrepo/normal.txt
1913 $ hg -R subrepo add subrepo/normal.txt
1904
1914
1905 Lock in subrepo, otherwise the change isn't archived
1915 Lock in subrepo, otherwise the change isn't archived
1906
1916
1907 $ hg ci -S -m "add normal file to top level"
1917 $ hg ci -S -m "add normal file to top level"
1908 committing subrepository subrepo
1918 committing subrepository subrepo
1909 Invoking status precommit hook
1919 Invoking status precommit hook
1910 M large.txt
1920 M large.txt
1911 A normal.txt
1921 A normal.txt
1912 Invoking status precommit hook
1922 Invoking status precommit hook
1913 M .hgsubstate
1923 M .hgsubstate
1914 $ hg archive -S ../lf_subrepo_archive
1924 $ hg archive -S ../lf_subrepo_archive
1915 $ find ../lf_subrepo_archive | sort
1925 $ find ../lf_subrepo_archive | sort
1916 ../lf_subrepo_archive
1926 ../lf_subrepo_archive
1917 ../lf_subrepo_archive/.hg_archival.txt
1927 ../lf_subrepo_archive/.hg_archival.txt
1918 ../lf_subrepo_archive/.hgsub
1928 ../lf_subrepo_archive/.hgsub
1919 ../lf_subrepo_archive/.hgsubstate
1929 ../lf_subrepo_archive/.hgsubstate
1920 ../lf_subrepo_archive/a
1930 ../lf_subrepo_archive/a
1921 ../lf_subrepo_archive/a/b
1931 ../lf_subrepo_archive/a/b
1922 ../lf_subrepo_archive/a/b/c
1932 ../lf_subrepo_archive/a/b/c
1923 ../lf_subrepo_archive/a/b/c/d
1933 ../lf_subrepo_archive/a/b/c/d
1924 ../lf_subrepo_archive/a/b/c/d/e.large.txt
1934 ../lf_subrepo_archive/a/b/c/d/e.large.txt
1925 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
1935 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
1926 ../lf_subrepo_archive/a/b/c/x
1936 ../lf_subrepo_archive/a/b/c/x
1927 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
1937 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
1928 ../lf_subrepo_archive/subrepo
1938 ../lf_subrepo_archive/subrepo
1929 ../lf_subrepo_archive/subrepo/large.txt
1939 ../lf_subrepo_archive/subrepo/large.txt
1930 ../lf_subrepo_archive/subrepo/normal.txt
1940 ../lf_subrepo_archive/subrepo/normal.txt
1931
1941
1932 Test update with subrepos.
1942 Test update with subrepos.
1933
1943
1934 $ hg update 0
1944 $ hg update 0
1935 getting changed largefiles
1945 getting changed largefiles
1936 0 largefiles updated, 1 removed
1946 0 largefiles updated, 1 removed
1937 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1947 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1938 $ hg status -S
1948 $ hg status -S
1939 $ hg update tip
1949 $ hg update tip
1940 getting changed largefiles
1950 getting changed largefiles
1941 1 largefiles updated, 0 removed
1951 1 largefiles updated, 0 removed
1942 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1952 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1943 $ hg status -S
1953 $ hg status -S
1944 # modify a large file
1954 # modify a large file
1945 $ echo "modified" > subrepo/large.txt
1955 $ echo "modified" > subrepo/large.txt
1946 $ hg st -S
1956 $ hg st -S
1947 M subrepo/large.txt
1957 M subrepo/large.txt
1948 # update -C should revert the change.
1958 # update -C should revert the change.
1949 $ hg update -C
1959 $ hg update -C
1950 getting changed largefiles
1960 getting changed largefiles
1951 1 largefiles updated, 0 removed
1961 1 largefiles updated, 0 removed
1952 getting changed largefiles
1962 getting changed largefiles
1953 0 largefiles updated, 0 removed
1963 0 largefiles updated, 0 removed
1954 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1964 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1955 $ hg status -S
1965 $ hg status -S
1956
1966
1957 Test archiving a revision that references a subrepo that is not yet
1967 Test archiving a revision that references a subrepo that is not yet
1958 cloned (see test-subrepo-recursion.t):
1968 cloned (see test-subrepo-recursion.t):
1959
1969
1960 $ hg clone -U . ../empty
1970 $ hg clone -U . ../empty
1961 $ cd ../empty
1971 $ cd ../empty
1962 $ hg archive --subrepos -r tip ../archive.tar.gz
1972 $ hg archive --subrepos -r tip ../archive.tar.gz
1963 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
1973 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
1964 $ cd ..
1974 $ cd ..
1965
1975
1966 Test that addremove picks up largefiles prior to the initial commit (issue3541)
1976 Test that addremove picks up largefiles prior to the initial commit (issue3541)
1967
1977
1968 $ hg init addrm2
1978 $ hg init addrm2
1969 $ cd addrm2
1979 $ cd addrm2
1970 $ touch large.dat
1980 $ touch large.dat
1971 $ touch large2.dat
1981 $ touch large2.dat
1972 $ touch normal
1982 $ touch normal
1973 $ hg add --large large.dat
1983 $ hg add --large large.dat
1974 $ hg addremove -v
1984 $ hg addremove -v
1975 adding large2.dat as a largefile
1985 adding large2.dat as a largefile
1976 adding normal
1986 adding normal
1977
1987
1978 Test that forgetting all largefiles reverts to islfilesrepo() == False
1988 Test that forgetting all largefiles reverts to islfilesrepo() == False
1979 (addremove will add *.dat as normal files now)
1989 (addremove will add *.dat as normal files now)
1980 $ hg forget large.dat
1990 $ hg forget large.dat
1981 $ hg forget large2.dat
1991 $ hg forget large2.dat
1982 $ hg addremove -v
1992 $ hg addremove -v
1983 adding large.dat
1993 adding large.dat
1984 adding large2.dat
1994 adding large2.dat
1985
1995
1986 Test commit's addremove option prior to the first commit
1996 Test commit's addremove option prior to the first commit
1987 $ hg forget large.dat
1997 $ hg forget large.dat
1988 $ hg forget large2.dat
1998 $ hg forget large2.dat
1989 $ hg add --large large.dat
1999 $ hg add --large large.dat
1990 $ hg ci -Am "commit"
2000 $ hg ci -Am "commit"
1991 adding large2.dat as a largefile
2001 adding large2.dat as a largefile
1992 Invoking status precommit hook
2002 Invoking status precommit hook
1993 A large.dat
2003 A large.dat
1994 A large2.dat
2004 A large2.dat
1995 A normal
2005 A normal
1996 $ find .hglf | sort
2006 $ find .hglf | sort
1997 .hglf
2007 .hglf
1998 .hglf/large.dat
2008 .hglf/large.dat
1999 .hglf/large2.dat
2009 .hglf/large2.dat
2000
2010
2001 Test actions on largefiles using relative paths from subdir
2011 Test actions on largefiles using relative paths from subdir
2002
2012
2003 $ mkdir sub
2013 $ mkdir sub
2004 $ cd sub
2014 $ cd sub
2005 $ echo anotherlarge > anotherlarge
2015 $ echo anotherlarge > anotherlarge
2006 $ hg add --large anotherlarge
2016 $ hg add --large anotherlarge
2007 $ hg st
2017 $ hg st
2008 A sub/anotherlarge
2018 A sub/anotherlarge
2009 $ hg st anotherlarge
2019 $ hg st anotherlarge
2010 A anotherlarge
2020 A anotherlarge
2011 $ hg commit -m anotherlarge anotherlarge
2021 $ hg commit -m anotherlarge anotherlarge
2012 Invoking status precommit hook
2022 Invoking status precommit hook
2013 A sub/anotherlarge
2023 A sub/anotherlarge
2014 $ hg log anotherlarge
2024 $ hg log anotherlarge
2015 changeset: 1:9627a577c5e9
2025 changeset: 1:9627a577c5e9
2016 tag: tip
2026 tag: tip
2017 user: test
2027 user: test
2018 date: Thu Jan 01 00:00:00 1970 +0000
2028 date: Thu Jan 01 00:00:00 1970 +0000
2019 summary: anotherlarge
2029 summary: anotherlarge
2020
2030
2021 $ echo more >> anotherlarge
2031 $ echo more >> anotherlarge
2022 $ hg st .
2032 $ hg st .
2023 M anotherlarge
2033 M anotherlarge
2024 $ hg cat anotherlarge
2034 $ hg cat anotherlarge
2025 anotherlarge
2035 anotherlarge
2026 $ hg revert anotherlarge
2036 $ hg revert anotherlarge
2027 $ hg st
2037 $ hg st
2028 ? sub/anotherlarge.orig
2038 ? sub/anotherlarge.orig
2029 $ cd ..
2039 $ cd ..
2030
2040
2031 $ cd ..
2041 $ cd ..
2032
2042
2033 issue3651: summary/outgoing with largefiles shows "no remote repo"
2043 issue3651: summary/outgoing with largefiles shows "no remote repo"
2034 unexpectedly
2044 unexpectedly
2035
2045
2036 $ mkdir issue3651
2046 $ mkdir issue3651
2037 $ cd issue3651
2047 $ cd issue3651
2038
2048
2039 $ hg init src
2049 $ hg init src
2040 $ echo a > src/a
2050 $ echo a > src/a
2041 $ hg -R src add --large src/a
2051 $ hg -R src add --large src/a
2042 $ hg -R src commit -m '#0'
2052 $ hg -R src commit -m '#0'
2043 Invoking status precommit hook
2053 Invoking status precommit hook
2044 A a
2054 A a
2045
2055
2046 check messages when no remote repository is specified:
2056 check messages when no remote repository is specified:
2047 "no remote repo" route for "hg outgoing --large" is not tested here,
2057 "no remote repo" route for "hg outgoing --large" is not tested here,
2048 because it can't be reproduced easily.
2058 because it can't be reproduced easily.
2049
2059
2050 $ hg init clone1
2060 $ hg init clone1
2051 $ hg -R clone1 -q pull src
2061 $ hg -R clone1 -q pull src
2052 $ hg -R clone1 -q update
2062 $ hg -R clone1 -q update
2053 $ hg -R clone1 paths | grep default
2063 $ hg -R clone1 paths | grep default
2054 [1]
2064 [1]
2055
2065
2056 $ hg -R clone1 summary --large
2066 $ hg -R clone1 summary --large
2057 parent: 0:fc0bd45326d3 tip
2067 parent: 0:fc0bd45326d3 tip
2058 #0
2068 #0
2059 branch: default
2069 branch: default
2060 commit: (clean)
2070 commit: (clean)
2061 update: (current)
2071 update: (current)
2062 largefiles: (no remote repo)
2072 largefiles: (no remote repo)
2063
2073
2064 check messages when there is no files to upload:
2074 check messages when there is no files to upload:
2065
2075
2066 $ hg -q clone src clone2
2076 $ hg -q clone src clone2
2067 $ hg -R clone2 paths | grep default
2077 $ hg -R clone2 paths | grep default
2068 default = $TESTTMP/issue3651/src (glob)
2078 default = $TESTTMP/issue3651/src (glob)
2069
2079
2070 $ hg -R clone2 summary --large
2080 $ hg -R clone2 summary --large
2071 parent: 0:fc0bd45326d3 tip
2081 parent: 0:fc0bd45326d3 tip
2072 #0
2082 #0
2073 branch: default
2083 branch: default
2074 commit: (clean)
2084 commit: (clean)
2075 update: (current)
2085 update: (current)
2076 searching for changes
2086 searching for changes
2077 largefiles: (no files to upload)
2087 largefiles: (no files to upload)
2078 $ hg -R clone2 outgoing --large
2088 $ hg -R clone2 outgoing --large
2079 comparing with $TESTTMP/issue3651/src (glob)
2089 comparing with $TESTTMP/issue3651/src (glob)
2080 searching for changes
2090 searching for changes
2081 no changes found
2091 no changes found
2082 searching for changes
2092 searching for changes
2083 largefiles: no files to upload
2093 largefiles: no files to upload
2084 [1]
2094 [1]
2085
2095
2086 check messages when there are files to upload:
2096 check messages when there are files to upload:
2087
2097
2088 $ echo b > clone2/b
2098 $ echo b > clone2/b
2089 $ hg -R clone2 add --large clone2/b
2099 $ hg -R clone2 add --large clone2/b
2090 $ hg -R clone2 commit -m '#1'
2100 $ hg -R clone2 commit -m '#1'
2091 Invoking status precommit hook
2101 Invoking status precommit hook
2092 A b
2102 A b
2093 $ hg -R clone2 summary --large
2103 $ hg -R clone2 summary --large
2094 parent: 1:1acbe71ce432 tip
2104 parent: 1:1acbe71ce432 tip
2095 #1
2105 #1
2096 branch: default
2106 branch: default
2097 commit: (clean)
2107 commit: (clean)
2098 update: (current)
2108 update: (current)
2099 searching for changes
2109 searching for changes
2100 largefiles: 1 to upload
2110 largefiles: 1 to upload
2101 $ hg -R clone2 outgoing --large
2111 $ hg -R clone2 outgoing --large
2102 comparing with $TESTTMP/issue3651/src (glob)
2112 comparing with $TESTTMP/issue3651/src (glob)
2103 searching for changes
2113 searching for changes
2104 changeset: 1:1acbe71ce432
2114 changeset: 1:1acbe71ce432
2105 tag: tip
2115 tag: tip
2106 user: test
2116 user: test
2107 date: Thu Jan 01 00:00:00 1970 +0000
2117 date: Thu Jan 01 00:00:00 1970 +0000
2108 summary: #1
2118 summary: #1
2109
2119
2110 searching for changes
2120 searching for changes
2111 largefiles to upload:
2121 largefiles to upload:
2112 b
2122 b
2113
2123
2114
2124
2115 $ cd ..
2125 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now