##// END OF EJS Templates
largefiles: update should only create a .orig backup of a largefile once...
Mads Kiilerich -
r21083:20b0c49c default
parent child Browse files
Show More
@@ -1,582 +1,583
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, errno
11 import os, errno
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 m = util.sha1('')
218 m = util.sha1('')
219 m.update(ctx[f].data())
219 m.update(ctx[f].data())
220 hash = m.hexdigest()
220 hash = m.hexdigest()
221 if f not in lfiletohash or lfiletohash[f] != hash:
221 if f not in lfiletohash or lfiletohash[f] != hash:
222 rdst.wwrite(f, ctx[f].data(), ctx[f].flags())
222 rdst.wwrite(f, ctx[f].data(), ctx[f].flags())
223 executable = 'x' in ctx[f].flags()
223 executable = 'x' in ctx[f].flags()
224 lfutil.writestandin(rdst, lfutil.standin(f), hash,
224 lfutil.writestandin(rdst, lfutil.standin(f), hash,
225 executable)
225 executable)
226 lfiletohash[f] = hash
226 lfiletohash[f] = hash
227 else:
227 else:
228 # normal file
228 # normal file
229 dstfiles.append(f)
229 dstfiles.append(f)
230
230
231 def getfilectx(repo, memctx, f):
231 def getfilectx(repo, memctx, f):
232 if lfutil.isstandin(f):
232 if lfutil.isstandin(f):
233 # if the file isn't in the manifest then it was removed
233 # if the file isn't in the manifest then it was removed
234 # or renamed, raise IOError to indicate this
234 # or renamed, raise IOError to indicate this
235 srcfname = lfutil.splitstandin(f)
235 srcfname = lfutil.splitstandin(f)
236 try:
236 try:
237 fctx = ctx.filectx(srcfname)
237 fctx = ctx.filectx(srcfname)
238 except error.LookupError:
238 except error.LookupError:
239 raise IOError
239 raise IOError
240 renamed = fctx.renamed()
240 renamed = fctx.renamed()
241 if renamed:
241 if renamed:
242 # standin is always a largefile because largefile-ness
242 # standin is always a largefile because largefile-ness
243 # doesn't change after rename or copy
243 # doesn't change after rename or copy
244 renamed = lfutil.standin(renamed[0])
244 renamed = lfutil.standin(renamed[0])
245
245
246 return context.memfilectx(f, lfiletohash[srcfname] + '\n', 'l' in
246 return context.memfilectx(f, lfiletohash[srcfname] + '\n', 'l' in
247 fctx.flags(), 'x' in fctx.flags(), renamed)
247 fctx.flags(), 'x' in fctx.flags(), renamed)
248 else:
248 else:
249 return _getnormalcontext(repo.ui, ctx, f, revmap)
249 return _getnormalcontext(repo.ui, ctx, f, revmap)
250
250
251 # Commit
251 # Commit
252 _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
252 _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
253
253
254 def _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap):
254 def _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap):
255 mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
255 mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
256 getfilectx, ctx.user(), ctx.date(), ctx.extra())
256 getfilectx, ctx.user(), ctx.date(), ctx.extra())
257 ret = rdst.commitctx(mctx)
257 ret = rdst.commitctx(mctx)
258 rdst.setparents(ret)
258 rdst.setparents(ret)
259 revmap[ctx.node()] = rdst.changelog.tip()
259 revmap[ctx.node()] = rdst.changelog.tip()
260
260
261 # Generate list of changed files
261 # Generate list of changed files
262 def _getchangedfiles(ctx, parents):
262 def _getchangedfiles(ctx, parents):
263 files = set(ctx.files())
263 files = set(ctx.files())
264 if node.nullid not in parents:
264 if node.nullid not in parents:
265 mc = ctx.manifest()
265 mc = ctx.manifest()
266 mp1 = ctx.parents()[0].manifest()
266 mp1 = ctx.parents()[0].manifest()
267 mp2 = ctx.parents()[1].manifest()
267 mp2 = ctx.parents()[1].manifest()
268 files |= (set(mp1) | set(mp2)) - set(mc)
268 files |= (set(mp1) | set(mp2)) - set(mc)
269 for f in mc:
269 for f in mc:
270 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None):
270 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None):
271 files.add(f)
271 files.add(f)
272 return files
272 return files
273
273
274 # Convert src parents to dst parents
274 # Convert src parents to dst parents
275 def _convertparents(ctx, revmap):
275 def _convertparents(ctx, revmap):
276 parents = []
276 parents = []
277 for p in ctx.parents():
277 for p in ctx.parents():
278 parents.append(revmap[p.node()])
278 parents.append(revmap[p.node()])
279 while len(parents) < 2:
279 while len(parents) < 2:
280 parents.append(node.nullid)
280 parents.append(node.nullid)
281 return parents
281 return parents
282
282
283 # Get memfilectx for a normal file
283 # Get memfilectx for a normal file
284 def _getnormalcontext(ui, ctx, f, revmap):
284 def _getnormalcontext(ui, ctx, f, revmap):
285 try:
285 try:
286 fctx = ctx.filectx(f)
286 fctx = ctx.filectx(f)
287 except error.LookupError:
287 except error.LookupError:
288 raise IOError
288 raise IOError
289 renamed = fctx.renamed()
289 renamed = fctx.renamed()
290 if renamed:
290 if renamed:
291 renamed = renamed[0]
291 renamed = renamed[0]
292
292
293 data = fctx.data()
293 data = fctx.data()
294 if f == '.hgtags':
294 if f == '.hgtags':
295 data = _converttags (ui, revmap, data)
295 data = _converttags (ui, revmap, data)
296 return context.memfilectx(f, data, 'l' in fctx.flags(),
296 return context.memfilectx(f, data, 'l' in fctx.flags(),
297 'x' in fctx.flags(), renamed)
297 'x' in fctx.flags(), renamed)
298
298
299 # Remap tag data using a revision map
299 # Remap tag data using a revision map
300 def _converttags(ui, revmap, data):
300 def _converttags(ui, revmap, data):
301 newdata = []
301 newdata = []
302 for line in data.splitlines():
302 for line in data.splitlines():
303 try:
303 try:
304 id, name = line.split(' ', 1)
304 id, name = line.split(' ', 1)
305 except ValueError:
305 except ValueError:
306 ui.warn(_('skipping incorrectly formatted tag %s\n')
306 ui.warn(_('skipping incorrectly formatted tag %s\n')
307 % line)
307 % line)
308 continue
308 continue
309 try:
309 try:
310 newid = node.bin(id)
310 newid = node.bin(id)
311 except TypeError:
311 except TypeError:
312 ui.warn(_('skipping incorrectly formatted id %s\n')
312 ui.warn(_('skipping incorrectly formatted id %s\n')
313 % id)
313 % id)
314 continue
314 continue
315 try:
315 try:
316 newdata.append('%s %s\n' % (node.hex(revmap[newid]),
316 newdata.append('%s %s\n' % (node.hex(revmap[newid]),
317 name))
317 name))
318 except KeyError:
318 except KeyError:
319 ui.warn(_('no mapping for id %s\n') % id)
319 ui.warn(_('no mapping for id %s\n') % id)
320 continue
320 continue
321 return ''.join(newdata)
321 return ''.join(newdata)
322
322
323 def _islfile(file, ctx, matcher, size):
323 def _islfile(file, ctx, matcher, size):
324 '''Return true if file should be considered a largefile, i.e.
324 '''Return true if file should be considered a largefile, i.e.
325 matcher matches it or it is larger than size.'''
325 matcher matches it or it is larger than size.'''
326 # never store special .hg* files as largefiles
326 # never store special .hg* files as largefiles
327 if file == '.hgtags' or file == '.hgignore' or file == '.hgsigs':
327 if file == '.hgtags' or file == '.hgignore' or file == '.hgsigs':
328 return False
328 return False
329 if matcher and matcher(file):
329 if matcher and matcher(file):
330 return True
330 return True
331 try:
331 try:
332 return ctx.filectx(file).size() >= size * 1024 * 1024
332 return ctx.filectx(file).size() >= size * 1024 * 1024
333 except error.LookupError:
333 except error.LookupError:
334 return False
334 return False
335
335
336 def uploadlfiles(ui, rsrc, rdst, files):
336 def uploadlfiles(ui, rsrc, rdst, files):
337 '''upload largefiles to the central store'''
337 '''upload largefiles to the central store'''
338
338
339 if not files:
339 if not files:
340 return
340 return
341
341
342 store = basestore._openstore(rsrc, rdst, put=True)
342 store = basestore._openstore(rsrc, rdst, put=True)
343
343
344 at = 0
344 at = 0
345 ui.debug("sending statlfile command for %d largefiles\n" % len(files))
345 ui.debug("sending statlfile command for %d largefiles\n" % len(files))
346 retval = store.exists(files)
346 retval = store.exists(files)
347 files = filter(lambda h: not retval[h], files)
347 files = filter(lambda h: not retval[h], files)
348 ui.debug("%d largefiles need to be uploaded\n" % len(files))
348 ui.debug("%d largefiles need to be uploaded\n" % len(files))
349
349
350 for hash in files:
350 for hash in files:
351 ui.progress(_('uploading largefiles'), at, unit='largefile',
351 ui.progress(_('uploading largefiles'), at, unit='largefile',
352 total=len(files))
352 total=len(files))
353 source = lfutil.findfile(rsrc, hash)
353 source = lfutil.findfile(rsrc, hash)
354 if not source:
354 if not source:
355 raise util.Abort(_('largefile %s missing from store'
355 raise util.Abort(_('largefile %s missing from store'
356 ' (needs to be uploaded)') % hash)
356 ' (needs to be uploaded)') % hash)
357 # XXX check for errors here
357 # XXX check for errors here
358 store.put(source, hash)
358 store.put(source, hash)
359 at += 1
359 at += 1
360 ui.progress(_('uploading largefiles'), None)
360 ui.progress(_('uploading largefiles'), None)
361
361
362 def verifylfiles(ui, repo, all=False, contents=False):
362 def verifylfiles(ui, repo, all=False, contents=False):
363 '''Verify that every largefile revision in the current changeset
363 '''Verify that every largefile revision in the current changeset
364 exists in the central store. With --contents, also verify that
364 exists in the central store. With --contents, also verify that
365 the contents of each local largefile file revision are correct (SHA-1 hash
365 the contents of each local largefile file revision are correct (SHA-1 hash
366 matches the revision ID). With --all, check every changeset in
366 matches the revision ID). With --all, check every changeset in
367 this repository.'''
367 this repository.'''
368 if all:
368 if all:
369 # Pass a list to the function rather than an iterator because we know a
369 # Pass a list to the function rather than an iterator because we know a
370 # list will work.
370 # list will work.
371 revs = range(len(repo))
371 revs = range(len(repo))
372 else:
372 else:
373 revs = ['.']
373 revs = ['.']
374
374
375 store = basestore._openstore(repo)
375 store = basestore._openstore(repo)
376 return store.verify(revs, contents=contents)
376 return store.verify(revs, contents=contents)
377
377
378 def debugdirstate(ui, repo):
378 def debugdirstate(ui, repo):
379 '''Show basic information for the largefiles dirstate'''
379 '''Show basic information for the largefiles dirstate'''
380 lfdirstate = lfutil.openlfdirstate(ui, repo)
380 lfdirstate = lfutil.openlfdirstate(ui, repo)
381 for file_, ent in sorted(lfdirstate._map.iteritems()):
381 for file_, ent in sorted(lfdirstate._map.iteritems()):
382 mode = '%3o' % (ent[1] & 0777 & ~util.umask)
382 mode = '%3o' % (ent[1] & 0777 & ~util.umask)
383 ui.write("%c %s %10d %s\n" % (ent[0], mode, ent[2], file_))
383 ui.write("%c %s %10d %s\n" % (ent[0], mode, ent[2], file_))
384
384
385 def cachelfiles(ui, repo, node, filelist=None):
385 def cachelfiles(ui, repo, node, filelist=None):
386 '''cachelfiles ensures that all largefiles needed by the specified revision
386 '''cachelfiles ensures that all largefiles needed by the specified revision
387 are present in the repository's largefile cache.
387 are present in the repository's largefile cache.
388
388
389 returns a tuple (cached, missing). cached is the list of files downloaded
389 returns a tuple (cached, missing). cached is the list of files downloaded
390 by this operation; missing is the list of files that were needed but could
390 by this operation; missing is the list of files that were needed but could
391 not be found.'''
391 not be found.'''
392 lfiles = lfutil.listlfiles(repo, node)
392 lfiles = lfutil.listlfiles(repo, node)
393 if filelist:
393 if filelist:
394 lfiles = set(lfiles) & set(filelist)
394 lfiles = set(lfiles) & set(filelist)
395 toget = []
395 toget = []
396
396
397 for lfile in lfiles:
397 for lfile in lfiles:
398 try:
398 try:
399 expectedhash = repo[node][lfutil.standin(lfile)].data().strip()
399 expectedhash = repo[node][lfutil.standin(lfile)].data().strip()
400 except IOError, err:
400 except IOError, err:
401 if err.errno == errno.ENOENT:
401 if err.errno == errno.ENOENT:
402 continue # node must be None and standin wasn't found in wctx
402 continue # node must be None and standin wasn't found in wctx
403 raise
403 raise
404 if not lfutil.findfile(repo, expectedhash):
404 if not lfutil.findfile(repo, expectedhash):
405 toget.append((lfile, expectedhash))
405 toget.append((lfile, expectedhash))
406
406
407 if toget:
407 if toget:
408 store = basestore._openstore(repo)
408 store = basestore._openstore(repo)
409 ret = store.get(toget)
409 ret = store.get(toget)
410 return ret
410 return ret
411
411
412 return ([], [])
412 return ([], [])
413
413
414 def downloadlfiles(ui, repo, rev=None):
414 def downloadlfiles(ui, repo, rev=None):
415 matchfn = scmutil.match(repo[None],
415 matchfn = scmutil.match(repo[None],
416 [repo.wjoin(lfutil.shortname)], {})
416 [repo.wjoin(lfutil.shortname)], {})
417 def prepare(ctx, fns):
417 def prepare(ctx, fns):
418 pass
418 pass
419 totalsuccess = 0
419 totalsuccess = 0
420 totalmissing = 0
420 totalmissing = 0
421 if rev != []: # walkchangerevs on empty list would return all revs
421 if rev != []: # walkchangerevs on empty list would return all revs
422 for ctx in cmdutil.walkchangerevs(repo, matchfn, {'rev' : rev},
422 for ctx in cmdutil.walkchangerevs(repo, matchfn, {'rev' : rev},
423 prepare):
423 prepare):
424 success, missing = cachelfiles(ui, repo, ctx.node())
424 success, missing = cachelfiles(ui, repo, ctx.node())
425 totalsuccess += len(success)
425 totalsuccess += len(success)
426 totalmissing += len(missing)
426 totalmissing += len(missing)
427 ui.status(_("%d additional largefiles cached\n") % totalsuccess)
427 ui.status(_("%d additional largefiles cached\n") % totalsuccess)
428 if totalmissing > 0:
428 if totalmissing > 0:
429 ui.status(_("%d largefiles failed to download\n") % totalmissing)
429 ui.status(_("%d largefiles failed to download\n") % totalmissing)
430 return totalsuccess, totalmissing
430 return totalsuccess, totalmissing
431
431
432 def updatelfiles(ui, repo, filelist=None, printmessage=True):
432 def updatelfiles(ui, repo, filelist=None, printmessage=True):
433 wlock = repo.wlock()
433 wlock = repo.wlock()
434 try:
434 try:
435 lfdirstate = lfutil.openlfdirstate(ui, repo)
435 lfdirstate = lfutil.openlfdirstate(ui, repo)
436 lfiles = set(lfutil.listlfiles(repo)) | set(lfdirstate)
436 lfiles = set(lfutil.listlfiles(repo)) | set(lfdirstate)
437
437
438 if filelist is not None:
438 if filelist is not None:
439 lfiles = [f for f in lfiles if f in filelist]
439 lfiles = [f for f in lfiles if f in filelist]
440
440
441 update = {}
441 update = {}
442 updated, removed = 0, 0
442 updated, removed = 0, 0
443 for lfile in lfiles:
443 for lfile in lfiles:
444 abslfile = repo.wjoin(lfile)
444 abslfile = repo.wjoin(lfile)
445 absstandin = repo.wjoin(lfutil.standin(lfile))
445 absstandin = repo.wjoin(lfutil.standin(lfile))
446 if os.path.exists(absstandin):
446 if os.path.exists(absstandin):
447 if (os.path.exists(absstandin + '.orig') and
447 if (os.path.exists(absstandin + '.orig') and
448 os.path.exists(abslfile)):
448 os.path.exists(abslfile)):
449 shutil.copyfile(abslfile, abslfile + '.orig')
449 shutil.copyfile(abslfile, abslfile + '.orig')
450 util.unlinkpath(absstandin + '.orig')
450 expecthash = lfutil.readstandin(repo, lfile)
451 expecthash = lfutil.readstandin(repo, lfile)
451 if (expecthash != '' and
452 if (expecthash != '' and
452 (not os.path.exists(abslfile) or
453 (not os.path.exists(abslfile) or
453 expecthash != lfutil.hashfile(abslfile))):
454 expecthash != lfutil.hashfile(abslfile))):
454 if lfile not in repo[None]: # not switched to normal file
455 if lfile not in repo[None]: # not switched to normal file
455 util.unlinkpath(abslfile, ignoremissing=True)
456 util.unlinkpath(abslfile, ignoremissing=True)
456 # use normallookup() to allocate entry in largefiles
457 # use normallookup() to allocate entry in largefiles
457 # dirstate, because lack of it misleads
458 # dirstate, because lack of it misleads
458 # lfilesrepo.status() into recognition that such cache
459 # lfilesrepo.status() into recognition that such cache
459 # missing files are REMOVED.
460 # missing files are REMOVED.
460 lfdirstate.normallookup(lfile)
461 lfdirstate.normallookup(lfile)
461 update[lfile] = expecthash
462 update[lfile] = expecthash
462 else:
463 else:
463 # Remove lfiles for which the standin is deleted, unless the
464 # Remove lfiles for which the standin is deleted, unless the
464 # lfile is added to the repository again. This happens when a
465 # lfile is added to the repository again. This happens when a
465 # largefile is converted back to a normal file: the standin
466 # largefile is converted back to a normal file: the standin
466 # disappears, but a new (normal) file appears as the lfile.
467 # disappears, but a new (normal) file appears as the lfile.
467 if (os.path.exists(abslfile) and
468 if (os.path.exists(abslfile) and
468 repo.dirstate.normalize(lfile) not in repo[None]):
469 repo.dirstate.normalize(lfile) not in repo[None]):
469 util.unlinkpath(abslfile)
470 util.unlinkpath(abslfile)
470 removed += 1
471 removed += 1
471
472
472 # largefile processing might be slow and be interrupted - be prepared
473 # largefile processing might be slow and be interrupted - be prepared
473 lfdirstate.write()
474 lfdirstate.write()
474
475
475 if lfiles:
476 if lfiles:
476 if printmessage:
477 if printmessage:
477 ui.status(_('getting changed largefiles\n'))
478 ui.status(_('getting changed largefiles\n'))
478 cachelfiles(ui, repo, None, lfiles)
479 cachelfiles(ui, repo, None, lfiles)
479
480
480 for lfile in lfiles:
481 for lfile in lfiles:
481 update1 = 0
482 update1 = 0
482
483
483 expecthash = update.get(lfile)
484 expecthash = update.get(lfile)
484 if expecthash:
485 if expecthash:
485 if not lfutil.copyfromcache(repo, expecthash, lfile):
486 if not lfutil.copyfromcache(repo, expecthash, lfile):
486 # failed ... but already removed and set to normallookup
487 # failed ... but already removed and set to normallookup
487 continue
488 continue
488 # Synchronize largefile dirstate to the last modified
489 # Synchronize largefile dirstate to the last modified
489 # time of the file
490 # time of the file
490 lfdirstate.normal(lfile)
491 lfdirstate.normal(lfile)
491 update1 = 1
492 update1 = 1
492
493
493 # copy the state of largefile standin from the repository's
494 # copy the state of largefile standin from the repository's
494 # dirstate to its state in the lfdirstate.
495 # dirstate to its state in the lfdirstate.
495 abslfile = repo.wjoin(lfile)
496 abslfile = repo.wjoin(lfile)
496 absstandin = repo.wjoin(lfutil.standin(lfile))
497 absstandin = repo.wjoin(lfutil.standin(lfile))
497 if os.path.exists(absstandin):
498 if os.path.exists(absstandin):
498 mode = os.stat(absstandin).st_mode
499 mode = os.stat(absstandin).st_mode
499 if mode != os.stat(abslfile).st_mode:
500 if mode != os.stat(abslfile).st_mode:
500 os.chmod(abslfile, mode)
501 os.chmod(abslfile, mode)
501 update1 = 1
502 update1 = 1
502
503
503 updated += update1
504 updated += update1
504
505
505 state = repo.dirstate[lfutil.standin(lfile)]
506 state = repo.dirstate[lfutil.standin(lfile)]
506 if state == 'n':
507 if state == 'n':
507 # When rebasing, we need to synchronize the standin and the
508 # When rebasing, we need to synchronize the standin and the
508 # largefile, because otherwise the largefile will get reverted.
509 # largefile, because otherwise the largefile will get reverted.
509 # But for commit's sake, we have to mark the file as unclean.
510 # But for commit's sake, we have to mark the file as unclean.
510 if getattr(repo, "_isrebasing", False):
511 if getattr(repo, "_isrebasing", False):
511 lfdirstate.normallookup(lfile)
512 lfdirstate.normallookup(lfile)
512 else:
513 else:
513 lfdirstate.normal(lfile)
514 lfdirstate.normal(lfile)
514 elif state == 'r':
515 elif state == 'r':
515 lfdirstate.remove(lfile)
516 lfdirstate.remove(lfile)
516 elif state == 'a':
517 elif state == 'a':
517 lfdirstate.add(lfile)
518 lfdirstate.add(lfile)
518 elif state == '?':
519 elif state == '?':
519 lfdirstate.drop(lfile)
520 lfdirstate.drop(lfile)
520
521
521 lfdirstate.write()
522 lfdirstate.write()
522 if printmessage and lfiles:
523 if printmessage and lfiles:
523 ui.status(_('%d largefiles updated, %d removed\n') % (updated,
524 ui.status(_('%d largefiles updated, %d removed\n') % (updated,
524 removed))
525 removed))
525 finally:
526 finally:
526 wlock.release()
527 wlock.release()
527
528
528 def lfpull(ui, repo, source="default", **opts):
529 def lfpull(ui, repo, source="default", **opts):
529 """pull largefiles for the specified revisions from the specified source
530 """pull largefiles for the specified revisions from the specified source
530
531
531 Pull largefiles that are referenced from local changesets but missing
532 Pull largefiles that are referenced from local changesets but missing
532 locally, pulling from a remote repository to the local cache.
533 locally, pulling from a remote repository to the local cache.
533
534
534 If SOURCE is omitted, the 'default' path will be used.
535 If SOURCE is omitted, the 'default' path will be used.
535 See :hg:`help urls` for more information.
536 See :hg:`help urls` for more information.
536
537
537 .. container:: verbose
538 .. container:: verbose
538
539
539 Some examples:
540 Some examples:
540
541
541 - pull largefiles for all branch heads::
542 - pull largefiles for all branch heads::
542
543
543 hg lfpull -r "head() and not closed()"
544 hg lfpull -r "head() and not closed()"
544
545
545 - pull largefiles on the default branch::
546 - pull largefiles on the default branch::
546
547
547 hg lfpull -r "branch(default)"
548 hg lfpull -r "branch(default)"
548 """
549 """
549 repo.lfpullsource = source
550 repo.lfpullsource = source
550
551
551 revs = opts.get('rev', [])
552 revs = opts.get('rev', [])
552 if not revs:
553 if not revs:
553 raise util.Abort(_('no revisions specified'))
554 raise util.Abort(_('no revisions specified'))
554 revs = scmutil.revrange(repo, revs)
555 revs = scmutil.revrange(repo, revs)
555
556
556 numcached = 0
557 numcached = 0
557 for rev in revs:
558 for rev in revs:
558 ui.note(_('pulling largefiles for revision %s\n') % rev)
559 ui.note(_('pulling largefiles for revision %s\n') % rev)
559 (cached, missing) = cachelfiles(ui, repo, rev)
560 (cached, missing) = cachelfiles(ui, repo, rev)
560 numcached += len(cached)
561 numcached += len(cached)
561 ui.status(_("%d largefiles cached\n") % numcached)
562 ui.status(_("%d largefiles cached\n") % numcached)
562
563
563 # -- hg commands declarations ------------------------------------------------
564 # -- hg commands declarations ------------------------------------------------
564
565
565 cmdtable = {
566 cmdtable = {
566 'lfconvert': (lfconvert,
567 'lfconvert': (lfconvert,
567 [('s', 'size', '',
568 [('s', 'size', '',
568 _('minimum size (MB) for files to be converted '
569 _('minimum size (MB) for files to be converted '
569 'as largefiles'),
570 'as largefiles'),
570 'SIZE'),
571 'SIZE'),
571 ('', 'to-normal', False,
572 ('', 'to-normal', False,
572 _('convert from a largefiles repo to a normal repo')),
573 _('convert from a largefiles repo to a normal repo')),
573 ],
574 ],
574 _('hg lfconvert SOURCE DEST [FILE ...]')),
575 _('hg lfconvert SOURCE DEST [FILE ...]')),
575 'lfpull': (lfpull,
576 'lfpull': (lfpull,
576 [('r', 'rev', [], _('pull largefiles for these revisions'))
577 [('r', 'rev', [], _('pull largefiles for these revisions'))
577 ] + commands.remoteopts,
578 ] + commands.remoteopts,
578 _('-r REV... [-e CMD] [--remotecmd CMD] [SOURCE]')
579 _('-r REV... [-e CMD] [--remotecmd CMD] [SOURCE]')
579 ),
580 ),
580 }
581 }
581
582
582 commands.inferrepo += " lfconvert"
583 commands.inferrepo += " lfconvert"
@@ -1,2395 +1,2399
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 largefiles are added as
492 Test addremove: verify that files that should be added as largefiles are added as
493 such and that already-existing largefiles are not added as normal files by
493 such and that already-existing largefiles 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 largefiles to upload:
706 largefiles to upload:
707 foo
707 foo
708 large
708 large
709 large8
709 large8
710
710
711 $ cd ../a
711 $ cd ../a
712
712
713 Clone a largefiles repo.
713 Clone a largefiles repo.
714
714
715 $ hg clone . ../b
715 $ hg clone . ../b
716 updating to branch default
716 updating to branch default
717 getting changed largefiles
717 getting changed largefiles
718 3 largefiles updated, 0 removed
718 3 largefiles updated, 0 removed
719 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
719 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
720 $ cd ../b
720 $ cd ../b
721 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
721 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
722 7:daea875e9014 add/edit more largefiles
722 7:daea875e9014 add/edit more largefiles
723 6:4355d653f84f edit files yet again
723 6:4355d653f84f edit files yet again
724 5:9d5af5072dbd edit files again
724 5:9d5af5072dbd edit files again
725 4:74c02385b94c move files
725 4:74c02385b94c move files
726 3:9e8fbc4bce62 copy files
726 3:9e8fbc4bce62 copy files
727 2:51a0ae4d5864 remove files
727 2:51a0ae4d5864 remove files
728 1:ce8896473775 edit files
728 1:ce8896473775 edit files
729 0:30d30fe6a5be add files
729 0:30d30fe6a5be add files
730 $ cat normal3
730 $ cat normal3
731 normal33
731 normal33
732 $ cat sub/normal4
732 $ cat sub/normal4
733 normal44
733 normal44
734 $ cat sub/large4
734 $ cat sub/large4
735 large44
735 large44
736 $ cat sub2/large6
736 $ cat sub2/large6
737 large6
737 large6
738 $ cat sub2/large7
738 $ cat sub2/large7
739 large7
739 large7
740 $ hg log -qf sub2/large7
740 $ hg log -qf sub2/large7
741 7:daea875e9014
741 7:daea875e9014
742 $ cd ..
742 $ cd ..
743 $ hg clone a -r 3 c
743 $ hg clone a -r 3 c
744 adding changesets
744 adding changesets
745 adding manifests
745 adding manifests
746 adding file changes
746 adding file changes
747 added 4 changesets with 10 changes to 4 files
747 added 4 changesets with 10 changes to 4 files
748 updating to branch default
748 updating to branch default
749 getting changed largefiles
749 getting changed largefiles
750 2 largefiles updated, 0 removed
750 2 largefiles updated, 0 removed
751 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
751 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
752 $ cd c
752 $ cd c
753 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
753 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
754 3:9e8fbc4bce62 copy files
754 3:9e8fbc4bce62 copy files
755 2:51a0ae4d5864 remove files
755 2:51a0ae4d5864 remove files
756 1:ce8896473775 edit files
756 1:ce8896473775 edit files
757 0:30d30fe6a5be add files
757 0:30d30fe6a5be add files
758 $ cat normal1
758 $ cat normal1
759 normal22
759 normal22
760 $ cat large1
760 $ cat large1
761 large22
761 large22
762 $ cat sub/normal2
762 $ cat sub/normal2
763 normal22
763 normal22
764 $ cat sub/large2
764 $ cat sub/large2
765 large22
765 large22
766
766
767 Old revisions of a clone have correct largefiles content (this also
767 Old revisions of a clone have correct largefiles content (this also
768 tests update).
768 tests update).
769
769
770 $ hg update -r 1
770 $ hg update -r 1
771 getting changed largefiles
771 getting changed largefiles
772 1 largefiles updated, 0 removed
772 1 largefiles updated, 0 removed
773 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
773 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
774 $ cat large1
774 $ cat large1
775 large11
775 large11
776 $ cat sub/large2
776 $ cat sub/large2
777 large22
777 large22
778 $ cd ..
778 $ cd ..
779
779
780 Test cloning with --all-largefiles flag
780 Test cloning with --all-largefiles flag
781
781
782 $ rm "${USERCACHE}"/*
782 $ rm "${USERCACHE}"/*
783 $ hg clone --all-largefiles a a-backup
783 $ hg clone --all-largefiles a a-backup
784 updating to branch default
784 updating to branch default
785 getting changed largefiles
785 getting changed largefiles
786 3 largefiles updated, 0 removed
786 3 largefiles updated, 0 removed
787 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
787 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
788 8 additional largefiles cached
788 8 additional largefiles cached
789
789
790 $ rm "${USERCACHE}"/*
790 $ rm "${USERCACHE}"/*
791 $ hg clone --all-largefiles -u 0 a a-clone0
791 $ hg clone --all-largefiles -u 0 a a-clone0
792 updating to branch default
792 updating to branch default
793 getting changed largefiles
793 getting changed largefiles
794 2 largefiles updated, 0 removed
794 2 largefiles updated, 0 removed
795 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
795 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 9 additional largefiles cached
796 9 additional largefiles cached
797 $ hg -R a-clone0 sum
797 $ hg -R a-clone0 sum
798 parent: 0:30d30fe6a5be
798 parent: 0:30d30fe6a5be
799 add files
799 add files
800 branch: default
800 branch: default
801 commit: (clean)
801 commit: (clean)
802 update: 7 new changesets (update)
802 update: 7 new changesets (update)
803
803
804 $ rm "${USERCACHE}"/*
804 $ rm "${USERCACHE}"/*
805 $ hg clone --all-largefiles -u 1 a a-clone1
805 $ hg clone --all-largefiles -u 1 a a-clone1
806 updating to branch default
806 updating to branch default
807 getting changed largefiles
807 getting changed largefiles
808 2 largefiles updated, 0 removed
808 2 largefiles updated, 0 removed
809 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
809 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
810 8 additional largefiles cached
810 8 additional largefiles cached
811 $ hg -R a-clone1 verify --large --lfa --lfc
811 $ hg -R a-clone1 verify --large --lfa --lfc
812 checking changesets
812 checking changesets
813 checking manifests
813 checking manifests
814 crosschecking files in changesets and manifests
814 crosschecking files in changesets and manifests
815 checking files
815 checking files
816 10 files, 8 changesets, 24 total revisions
816 10 files, 8 changesets, 24 total revisions
817 searching 8 changesets for largefiles
817 searching 8 changesets for largefiles
818 verified contents of 13 revisions of 6 largefiles
818 verified contents of 13 revisions of 6 largefiles
819 $ hg -R a-clone1 sum
819 $ hg -R a-clone1 sum
820 parent: 1:ce8896473775
820 parent: 1:ce8896473775
821 edit files
821 edit files
822 branch: default
822 branch: default
823 commit: (clean)
823 commit: (clean)
824 update: 6 new changesets (update)
824 update: 6 new changesets (update)
825
825
826 $ rm "${USERCACHE}"/*
826 $ rm "${USERCACHE}"/*
827 $ hg clone --all-largefiles -U a a-clone-u
827 $ hg clone --all-largefiles -U a a-clone-u
828 11 additional largefiles cached
828 11 additional largefiles cached
829 $ hg -R a-clone-u sum
829 $ hg -R a-clone-u sum
830 parent: -1:000000000000 (no revision checked out)
830 parent: -1:000000000000 (no revision checked out)
831 branch: default
831 branch: default
832 commit: (clean)
832 commit: (clean)
833 update: 8 new changesets (update)
833 update: 8 new changesets (update)
834
834
835 Show computed destination directory:
835 Show computed destination directory:
836
836
837 $ mkdir xyz
837 $ mkdir xyz
838 $ cd xyz
838 $ cd xyz
839 $ hg clone ../a
839 $ hg clone ../a
840 destination directory: a
840 destination directory: a
841 updating to branch default
841 updating to branch default
842 getting changed largefiles
842 getting changed largefiles
843 3 largefiles updated, 0 removed
843 3 largefiles updated, 0 removed
844 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
844 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
845 $ cd ..
845 $ cd ..
846
846
847 Clone URL without path:
847 Clone URL without path:
848
848
849 $ hg clone file://
849 $ hg clone file://
850 abort: repository / not found!
850 abort: repository / not found!
851 [255]
851 [255]
852
852
853 Ensure base clone command argument validation
853 Ensure base clone command argument validation
854
854
855 $ hg clone -U -u 0 a a-clone-failure
855 $ hg clone -U -u 0 a a-clone-failure
856 abort: cannot specify both --noupdate and --updaterev
856 abort: cannot specify both --noupdate and --updaterev
857 [255]
857 [255]
858
858
859 $ hg clone --all-largefiles a ssh://localhost/a
859 $ hg clone --all-largefiles a ssh://localhost/a
860 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
860 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
861 [255]
861 [255]
862
862
863 Test pulling with --all-largefiles flag. Also test that the largefiles are
863 Test pulling with --all-largefiles flag. Also test that the largefiles are
864 downloaded from 'default' instead of 'default-push' when no source is specified
864 downloaded from 'default' instead of 'default-push' when no source is specified
865 (issue3584)
865 (issue3584)
866
866
867 $ rm -Rf a-backup
867 $ rm -Rf a-backup
868 $ hg clone -r 1 a a-backup
868 $ hg clone -r 1 a a-backup
869 adding changesets
869 adding changesets
870 adding manifests
870 adding manifests
871 adding file changes
871 adding file changes
872 added 2 changesets with 8 changes to 4 files
872 added 2 changesets with 8 changes to 4 files
873 updating to branch default
873 updating to branch default
874 getting changed largefiles
874 getting changed largefiles
875 2 largefiles updated, 0 removed
875 2 largefiles updated, 0 removed
876 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
876 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
877 $ rm "${USERCACHE}"/*
877 $ rm "${USERCACHE}"/*
878 $ cd a-backup
878 $ cd a-backup
879 $ hg pull --all-largefiles --config paths.default-push=bogus/path
879 $ hg pull --all-largefiles --config paths.default-push=bogus/path
880 pulling from $TESTTMP/a (glob)
880 pulling from $TESTTMP/a (glob)
881 searching for changes
881 searching for changes
882 adding changesets
882 adding changesets
883 adding manifests
883 adding manifests
884 adding file changes
884 adding file changes
885 added 6 changesets with 16 changes to 8 files
885 added 6 changesets with 16 changes to 8 files
886 (run 'hg update' to get a working copy)
886 (run 'hg update' to get a working copy)
887 6 largefiles cached
887 6 largefiles cached
888
888
889 redo pull with --lfrev and check it pulls largefiles for the right revs
889 redo pull with --lfrev and check it pulls largefiles for the right revs
890
890
891 $ hg rollback
891 $ hg rollback
892 repository tip rolled back to revision 1 (undo pull)
892 repository tip rolled back to revision 1 (undo pull)
893 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
893 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
894 pulling from $TESTTMP/a (glob)
894 pulling from $TESTTMP/a (glob)
895 searching for changes
895 searching for changes
896 all local heads known remotely
896 all local heads known remotely
897 6 changesets found
897 6 changesets found
898 adding changesets
898 adding changesets
899 adding manifests
899 adding manifests
900 adding file changes
900 adding file changes
901 added 6 changesets with 16 changes to 8 files
901 added 6 changesets with 16 changes to 8 files
902 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
902 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
903 (run 'hg update' to get a working copy)
903 (run 'hg update' to get a working copy)
904 pulling largefiles for revision 7
904 pulling largefiles for revision 7
905 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
905 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
906 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
906 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
907 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
907 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
908 pulling largefiles for revision 2
908 pulling largefiles for revision 2
909 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
909 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
910 0 largefiles cached
910 0 largefiles cached
911
911
912 lfpull
912 lfpull
913
913
914 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
914 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
915 2 largefiles cached
915 2 largefiles cached
916 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
916 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
917 pulling largefiles for revision 4
917 pulling largefiles for revision 4
918 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
918 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
919 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
919 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
920 pulling largefiles for revision 2
920 pulling largefiles for revision 2
921 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
921 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
922 0 largefiles cached
922 0 largefiles cached
923
923
924 $ ls usercache-lfpull/* | sort
924 $ ls usercache-lfpull/* | sort
925 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
925 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
926 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
926 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
927
927
928 $ cd ..
928 $ cd ..
929
929
930 Rebasing between two repositories does not revert largefiles to old
930 Rebasing between two repositories does not revert largefiles to old
931 revisions (this was a very bad bug that took a lot of work to fix).
931 revisions (this was a very bad bug that took a lot of work to fix).
932
932
933 $ hg clone a d
933 $ hg clone a d
934 updating to branch default
934 updating to branch default
935 getting changed largefiles
935 getting changed largefiles
936 3 largefiles updated, 0 removed
936 3 largefiles updated, 0 removed
937 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
937 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
938 $ cd b
938 $ cd b
939 $ echo large4-modified > sub/large4
939 $ echo large4-modified > sub/large4
940 $ echo normal3-modified > normal3
940 $ echo normal3-modified > normal3
941 $ hg commit -m "modify normal file and largefile in repo b"
941 $ hg commit -m "modify normal file and largefile in repo b"
942 Invoking status precommit hook
942 Invoking status precommit hook
943 M normal3
943 M normal3
944 M sub/large4
944 M sub/large4
945 $ cd ../d
945 $ cd ../d
946 $ echo large6-modified > sub2/large6
946 $ echo large6-modified > sub2/large6
947 $ echo normal4-modified > sub/normal4
947 $ echo normal4-modified > sub/normal4
948 $ hg commit -m "modify normal file largefile in repo d"
948 $ hg commit -m "modify normal file largefile in repo d"
949 Invoking status precommit hook
949 Invoking status precommit hook
950 M sub/normal4
950 M sub/normal4
951 M sub2/large6
951 M sub2/large6
952 $ cd ..
952 $ cd ..
953 $ hg clone d e
953 $ hg clone d e
954 updating to branch default
954 updating to branch default
955 getting changed largefiles
955 getting changed largefiles
956 3 largefiles updated, 0 removed
956 3 largefiles updated, 0 removed
957 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
957 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
958 $ cd d
958 $ cd d
959
959
960 More rebase testing, but also test that the largefiles are downloaded from
960 More rebase testing, but also test that the largefiles are downloaded from
961 'default-push' when no source is specified (issue3584). (The largefile from the
961 'default-push' when no source is specified (issue3584). (The largefile from the
962 pulled revision is however not downloaded but found in the local cache.)
962 pulled revision is however not downloaded but found in the local cache.)
963 Largefiles are fetched for the new pulled revision, not for existing revisions,
963 Largefiles are fetched for the new pulled revision, not for existing revisions,
964 rebased or not.
964 rebased or not.
965
965
966 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
966 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
967 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
967 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
968 pulling from $TESTTMP/b (glob)
968 pulling from $TESTTMP/b (glob)
969 searching for changes
969 searching for changes
970 adding changesets
970 adding changesets
971 adding manifests
971 adding manifests
972 adding file changes
972 adding file changes
973 added 1 changesets with 2 changes to 2 files (+1 heads)
973 added 1 changesets with 2 changes to 2 files (+1 heads)
974 Invoking status precommit hook
974 Invoking status precommit hook
975 M sub/normal4
975 M sub/normal4
976 M sub2/large6
976 M sub2/large6
977 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
977 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
978 0 largefiles cached
978 0 largefiles cached
979 nothing to rebase - working directory parent is also destination
979 nothing to rebase - working directory parent is also destination
980 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
980 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
981 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
981 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
982 9:598410d3eb9a modify normal file largefile in repo d
982 9:598410d3eb9a modify normal file largefile in repo d
983 8:a381d2c8c80e modify normal file and largefile in repo b
983 8:a381d2c8c80e modify normal file and largefile in repo b
984 7:daea875e9014 add/edit more largefiles
984 7:daea875e9014 add/edit more largefiles
985 6:4355d653f84f edit files yet again
985 6:4355d653f84f edit files yet again
986 5:9d5af5072dbd edit files again
986 5:9d5af5072dbd edit files again
987 4:74c02385b94c move files
987 4:74c02385b94c move files
988 3:9e8fbc4bce62 copy files
988 3:9e8fbc4bce62 copy files
989 2:51a0ae4d5864 remove files
989 2:51a0ae4d5864 remove files
990 1:ce8896473775 edit files
990 1:ce8896473775 edit files
991 0:30d30fe6a5be add files
991 0:30d30fe6a5be add files
992 $ cat normal3
992 $ cat normal3
993 normal3-modified
993 normal3-modified
994 $ cat sub/normal4
994 $ cat sub/normal4
995 normal4-modified
995 normal4-modified
996 $ cat sub/large4
996 $ cat sub/large4
997 large4-modified
997 large4-modified
998 $ cat sub2/large6
998 $ cat sub2/large6
999 large6-modified
999 large6-modified
1000 $ cat sub2/large7
1000 $ cat sub2/large7
1001 large7
1001 large7
1002 $ cd ../e
1002 $ cd ../e
1003 $ hg pull ../b
1003 $ hg pull ../b
1004 pulling from ../b
1004 pulling from ../b
1005 searching for changes
1005 searching for changes
1006 adding changesets
1006 adding changesets
1007 adding manifests
1007 adding manifests
1008 adding file changes
1008 adding file changes
1009 added 1 changesets with 2 changes to 2 files (+1 heads)
1009 added 1 changesets with 2 changes to 2 files (+1 heads)
1010 (run 'hg heads' to see heads, 'hg merge' to merge)
1010 (run 'hg heads' to see heads, 'hg merge' to merge)
1011 $ hg rebase
1011 $ hg rebase
1012 Invoking status precommit hook
1012 Invoking status precommit hook
1013 M sub/normal4
1013 M sub/normal4
1014 M sub2/large6
1014 M sub2/large6
1015 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1015 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1016 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1016 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1017 9:598410d3eb9a modify normal file largefile in repo d
1017 9:598410d3eb9a modify normal file largefile in repo d
1018 8:a381d2c8c80e modify normal file and largefile in repo b
1018 8:a381d2c8c80e modify normal file and largefile in repo b
1019 7:daea875e9014 add/edit more largefiles
1019 7:daea875e9014 add/edit more largefiles
1020 6:4355d653f84f edit files yet again
1020 6:4355d653f84f edit files yet again
1021 5:9d5af5072dbd edit files again
1021 5:9d5af5072dbd edit files again
1022 4:74c02385b94c move files
1022 4:74c02385b94c move files
1023 3:9e8fbc4bce62 copy files
1023 3:9e8fbc4bce62 copy files
1024 2:51a0ae4d5864 remove files
1024 2:51a0ae4d5864 remove files
1025 1:ce8896473775 edit files
1025 1:ce8896473775 edit files
1026 0:30d30fe6a5be add files
1026 0:30d30fe6a5be add files
1027 $ cat normal3
1027 $ cat normal3
1028 normal3-modified
1028 normal3-modified
1029 $ cat sub/normal4
1029 $ cat sub/normal4
1030 normal4-modified
1030 normal4-modified
1031 $ cat sub/large4
1031 $ cat sub/large4
1032 large4-modified
1032 large4-modified
1033 $ cat sub2/large6
1033 $ cat sub2/large6
1034 large6-modified
1034 large6-modified
1035 $ cat sub2/large7
1035 $ cat sub2/large7
1036 large7
1036 large7
1037
1037
1038 Log on largefiles
1038 Log on largefiles
1039
1039
1040 - same output
1040 - same output
1041 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1041 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1042 8:a381d2c8c80e modify normal file and largefile in repo b
1042 8:a381d2c8c80e modify normal file and largefile in repo b
1043 6:4355d653f84f edit files yet again
1043 6:4355d653f84f edit files yet again
1044 5:9d5af5072dbd edit files again
1044 5:9d5af5072dbd edit files again
1045 4:74c02385b94c move files
1045 4:74c02385b94c move files
1046 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1046 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1047 8:a381d2c8c80e modify normal file and largefile in repo b
1047 8:a381d2c8c80e modify normal file and largefile in repo b
1048 6:4355d653f84f edit files yet again
1048 6:4355d653f84f edit files yet again
1049 5:9d5af5072dbd edit files again
1049 5:9d5af5072dbd edit files again
1050 4:74c02385b94c move files
1050 4:74c02385b94c move files
1051
1051
1052 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1052 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1053 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1053 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1054 8:a381d2c8c80e modify normal file and largefile in repo b
1054 8:a381d2c8c80e modify normal file and largefile in repo b
1055 6:4355d653f84f edit files yet again
1055 6:4355d653f84f edit files yet again
1056 5:9d5af5072dbd edit files again
1056 5:9d5af5072dbd edit files again
1057 4:74c02385b94c move files
1057 4:74c02385b94c move files
1058 1:ce8896473775 edit files
1058 1:ce8896473775 edit files
1059 0:30d30fe6a5be add files
1059 0:30d30fe6a5be add files
1060 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1060 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1061 9:598410d3eb9a modify normal file largefile in repo d
1061 9:598410d3eb9a modify normal file largefile in repo d
1062 8:a381d2c8c80e modify normal file and largefile in repo b
1062 8:a381d2c8c80e modify normal file and largefile in repo b
1063 6:4355d653f84f edit files yet again
1063 6:4355d653f84f edit files yet again
1064 5:9d5af5072dbd edit files again
1064 5:9d5af5072dbd edit files again
1065 4:74c02385b94c move files
1065 4:74c02385b94c move files
1066 1:ce8896473775 edit files
1066 1:ce8896473775 edit files
1067 0:30d30fe6a5be add files
1067 0:30d30fe6a5be add files
1068
1068
1069 - globbing gives same result
1069 - globbing gives same result
1070 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1070 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1071 9:598410d3eb9a modify normal file largefile in repo d
1071 9:598410d3eb9a modify normal file largefile in repo d
1072 8:a381d2c8c80e modify normal file and largefile in repo b
1072 8:a381d2c8c80e modify normal file and largefile in repo b
1073 6:4355d653f84f edit files yet again
1073 6:4355d653f84f edit files yet again
1074 5:9d5af5072dbd edit files again
1074 5:9d5af5072dbd edit files again
1075 4:74c02385b94c move files
1075 4:74c02385b94c move files
1076 1:ce8896473775 edit files
1076 1:ce8896473775 edit files
1077 0:30d30fe6a5be add files
1077 0:30d30fe6a5be add files
1078
1078
1079 Rollback on largefiles.
1079 Rollback on largefiles.
1080
1080
1081 $ echo large4-modified-again > sub/large4
1081 $ echo large4-modified-again > sub/large4
1082 $ hg commit -m "Modify large4 again"
1082 $ hg commit -m "Modify large4 again"
1083 Invoking status precommit hook
1083 Invoking status precommit hook
1084 M sub/large4
1084 M sub/large4
1085 $ hg rollback
1085 $ hg rollback
1086 repository tip rolled back to revision 9 (undo commit)
1086 repository tip rolled back to revision 9 (undo commit)
1087 working directory now based on revision 9
1087 working directory now based on revision 9
1088 $ hg st
1088 $ hg st
1089 M sub/large4
1089 M sub/large4
1090 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1090 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1091 9:598410d3eb9a modify normal file largefile in repo d
1091 9:598410d3eb9a modify normal file largefile in repo d
1092 8:a381d2c8c80e modify normal file and largefile in repo b
1092 8:a381d2c8c80e modify normal file and largefile in repo b
1093 7:daea875e9014 add/edit more largefiles
1093 7:daea875e9014 add/edit more largefiles
1094 6:4355d653f84f edit files yet again
1094 6:4355d653f84f edit files yet again
1095 5:9d5af5072dbd edit files again
1095 5:9d5af5072dbd edit files again
1096 4:74c02385b94c move files
1096 4:74c02385b94c move files
1097 3:9e8fbc4bce62 copy files
1097 3:9e8fbc4bce62 copy files
1098 2:51a0ae4d5864 remove files
1098 2:51a0ae4d5864 remove files
1099 1:ce8896473775 edit files
1099 1:ce8896473775 edit files
1100 0:30d30fe6a5be add files
1100 0:30d30fe6a5be add files
1101 $ cat sub/large4
1101 $ cat sub/large4
1102 large4-modified-again
1102 large4-modified-again
1103
1103
1104 "update --check" refuses to update with uncommitted changes.
1104 "update --check" refuses to update with uncommitted changes.
1105 $ hg update --check 8
1105 $ hg update --check 8
1106 abort: uncommitted changes
1106 abort: uncommitted changes
1107 [255]
1107 [255]
1108
1108
1109 "update --clean" leaves correct largefiles in working copy, even when there is
1109 "update --clean" leaves correct largefiles in working copy, even when there is
1110 .orig files from revert in .hglf.
1110 .orig files from revert in .hglf.
1111
1111
1112 $ echo mistake > sub2/large7
1112 $ echo mistake > sub2/large7
1113 $ hg revert sub2/large7
1113 $ hg revert sub2/large7
1114 $ cat sub2/large7
1115 large7
1116 $ cat sub2/large7.orig
1117 mistake
1118 $ test ! -f .hglf/sub2/large7.orig
1119
1114 $ hg -q update --clean -r null
1120 $ hg -q update --clean -r null
1115 $ hg update --clean
1121 $ hg update --clean
1116 getting changed largefiles
1122 getting changed largefiles
1117 3 largefiles updated, 0 removed
1123 3 largefiles updated, 0 removed
1118 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1124 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1119 $ cat normal3
1125 $ cat normal3
1120 normal3-modified
1126 normal3-modified
1121 $ cat sub/normal4
1127 $ cat sub/normal4
1122 normal4-modified
1128 normal4-modified
1123 $ cat sub/large4
1129 $ cat sub/large4
1124 large4-modified
1130 large4-modified
1125 $ cat sub2/large6
1131 $ cat sub2/large6
1126 large6-modified
1132 large6-modified
1127 $ cat sub2/large7
1133 $ cat sub2/large7
1128 large7
1134 large7
1129 $ cat sub2/large7.orig
1135 $ cat sub2/large7.orig
1130 mistake
1136 mistake
1131 $ cat .hglf/sub2/large7.orig
1137 $ test ! -f .hglf/sub2/large7.orig
1132 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1133
1138
1134 demonstrate misfeature: .orig file is overwritten on every update -C,
1139 verify that largefile .orig file no longer is overwritten on every update -C:
1135 also when clean:
1136 $ hg update --clean
1140 $ hg update --clean
1137 getting changed largefiles
1141 getting changed largefiles
1138 0 largefiles updated, 0 removed
1142 0 largefiles updated, 0 removed
1139 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1143 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1140 $ cat sub2/large7.orig
1144 $ cat sub2/large7.orig
1141 large7
1145 mistake
1142 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1146 $ rm sub2/large7.orig
1143
1147
1144 Now "update check" is happy.
1148 Now "update check" is happy.
1145 $ hg update --check 8
1149 $ hg update --check 8
1146 getting changed largefiles
1150 getting changed largefiles
1147 1 largefiles updated, 0 removed
1151 1 largefiles updated, 0 removed
1148 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1149 $ hg update --check
1153 $ hg update --check
1150 getting changed largefiles
1154 getting changed largefiles
1151 1 largefiles updated, 0 removed
1155 1 largefiles updated, 0 removed
1152 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1156 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1153
1157
1154 Test removing empty largefiles directories on update
1158 Test removing empty largefiles directories on update
1155 $ test -d sub2 && echo "sub2 exists"
1159 $ test -d sub2 && echo "sub2 exists"
1156 sub2 exists
1160 sub2 exists
1157 $ hg update -q null
1161 $ hg update -q null
1158 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1162 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1159 [1]
1163 [1]
1160 $ hg update -q
1164 $ hg update -q
1161
1165
1162 Test hg remove removes empty largefiles directories
1166 Test hg remove removes empty largefiles directories
1163 $ test -d sub2 && echo "sub2 exists"
1167 $ test -d sub2 && echo "sub2 exists"
1164 sub2 exists
1168 sub2 exists
1165 $ hg remove sub2/*
1169 $ hg remove sub2/*
1166 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1170 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1167 [1]
1171 [1]
1168 $ hg revert sub2/large6 sub2/large7
1172 $ hg revert sub2/large6 sub2/large7
1169
1173
1170 "revert" works on largefiles (and normal files too).
1174 "revert" works on largefiles (and normal files too).
1171 $ echo hack3 >> normal3
1175 $ echo hack3 >> normal3
1172 $ echo hack4 >> sub/normal4
1176 $ echo hack4 >> sub/normal4
1173 $ echo hack4 >> sub/large4
1177 $ echo hack4 >> sub/large4
1174 $ rm sub2/large6
1178 $ rm sub2/large6
1175 $ hg revert sub2/large6
1179 $ hg revert sub2/large6
1176 $ hg rm sub2/large6
1180 $ hg rm sub2/large6
1177 $ echo new >> sub2/large8
1181 $ echo new >> sub2/large8
1178 $ hg add --large sub2/large8
1182 $ hg add --large sub2/large8
1179 # XXX we don't really want to report that we're reverting the standin;
1183 # XXX we don't really want to report that we're reverting the standin;
1180 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1184 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1181 $ hg revert sub
1185 $ hg revert sub
1182 reverting .hglf/sub/large4 (glob)
1186 reverting .hglf/sub/large4 (glob)
1183 reverting sub/normal4 (glob)
1187 reverting sub/normal4 (glob)
1184 $ hg status
1188 $ hg status
1185 M normal3
1189 M normal3
1186 A sub2/large8
1190 A sub2/large8
1187 R sub2/large6
1191 R sub2/large6
1188 ? sub/large4.orig
1192 ? sub/large4.orig
1189 ? sub/normal4.orig
1193 ? sub/normal4.orig
1190 $ cat sub/normal4
1194 $ cat sub/normal4
1191 normal4-modified
1195 normal4-modified
1192 $ cat sub/large4
1196 $ cat sub/large4
1193 large4-modified
1197 large4-modified
1194 $ hg revert -a --no-backup
1198 $ hg revert -a --no-backup
1195 undeleting .hglf/sub2/large6 (glob)
1199 undeleting .hglf/sub2/large6 (glob)
1196 forgetting .hglf/sub2/large8 (glob)
1200 forgetting .hglf/sub2/large8 (glob)
1197 reverting normal3
1201 reverting normal3
1198 $ hg status
1202 $ hg status
1199 ? sub/large4.orig
1203 ? sub/large4.orig
1200 ? sub/normal4.orig
1204 ? sub/normal4.orig
1201 ? sub2/large8
1205 ? sub2/large8
1202 $ cat normal3
1206 $ cat normal3
1203 normal3-modified
1207 normal3-modified
1204 $ cat sub2/large6
1208 $ cat sub2/large6
1205 large6-modified
1209 large6-modified
1206 $ rm sub/*.orig sub2/large8
1210 $ rm sub/*.orig sub2/large8
1207
1211
1208 revert some files to an older revision
1212 revert some files to an older revision
1209 $ hg revert --no-backup -r 8 sub2
1213 $ hg revert --no-backup -r 8 sub2
1210 reverting .hglf/sub2/large6 (glob)
1214 reverting .hglf/sub2/large6 (glob)
1211 $ cat sub2/large6
1215 $ cat sub2/large6
1212 large6
1216 large6
1213 $ hg revert --no-backup -C -r '.^' sub2
1217 $ hg revert --no-backup -C -r '.^' sub2
1214 reverting .hglf/sub2/large6 (glob)
1218 reverting .hglf/sub2/large6 (glob)
1215 $ hg revert --no-backup sub2
1219 $ hg revert --no-backup sub2
1216 reverting .hglf/sub2/large6 (glob)
1220 reverting .hglf/sub2/large6 (glob)
1217 $ hg status
1221 $ hg status
1218
1222
1219 "verify --large" actually verifies largefiles
1223 "verify --large" actually verifies largefiles
1220
1224
1221 - Where Do We Come From? What Are We? Where Are We Going?
1225 - Where Do We Come From? What Are We? Where Are We Going?
1222 $ pwd
1226 $ pwd
1223 $TESTTMP/e
1227 $TESTTMP/e
1224 $ hg paths
1228 $ hg paths
1225 default = $TESTTMP/d (glob)
1229 default = $TESTTMP/d (glob)
1226
1230
1227 $ hg verify --large
1231 $ hg verify --large
1228 checking changesets
1232 checking changesets
1229 checking manifests
1233 checking manifests
1230 crosschecking files in changesets and manifests
1234 crosschecking files in changesets and manifests
1231 checking files
1235 checking files
1232 10 files, 10 changesets, 28 total revisions
1236 10 files, 10 changesets, 28 total revisions
1233 searching 1 changesets for largefiles
1237 searching 1 changesets for largefiles
1234 verified existence of 3 revisions of 3 largefiles
1238 verified existence of 3 revisions of 3 largefiles
1235
1239
1236 - introduce missing blob in local store repo and make sure that this is caught:
1240 - introduce missing blob in local store repo and make sure that this is caught:
1237 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1241 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1238 $ hg verify --large
1242 $ hg verify --large
1239 checking changesets
1243 checking changesets
1240 checking manifests
1244 checking manifests
1241 crosschecking files in changesets and manifests
1245 crosschecking files in changesets and manifests
1242 checking files
1246 checking files
1243 10 files, 10 changesets, 28 total revisions
1247 10 files, 10 changesets, 28 total revisions
1244 searching 1 changesets for largefiles
1248 searching 1 changesets for largefiles
1245 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1249 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1246 verified existence of 3 revisions of 3 largefiles
1250 verified existence of 3 revisions of 3 largefiles
1247 [1]
1251 [1]
1248
1252
1249 - introduce corruption and make sure that it is caught when checking content:
1253 - introduce corruption and make sure that it is caught when checking content:
1250 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1254 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1251 $ hg verify -q --large --lfc
1255 $ hg verify -q --large --lfc
1252 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1256 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1253 [1]
1257 [1]
1254
1258
1255 - cleanup
1259 - cleanup
1256 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1260 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1257
1261
1258 - verifying all revisions will fail because we didn't clone all largefiles to d:
1262 - verifying all revisions will fail because we didn't clone all largefiles to d:
1259 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1263 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1260 $ hg verify -q --lfa --lfc
1264 $ hg verify -q --lfa --lfc
1261 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1265 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1262 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1266 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1263 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1267 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1264 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1268 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1265 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1269 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1266 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1270 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1267 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1271 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1268 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1272 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1269 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1273 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1270 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1274 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1271 [1]
1275 [1]
1272
1276
1273 - cleanup
1277 - cleanup
1274 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1278 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1275 $ rm -f .hglf/sub/*.orig
1279 $ rm -f .hglf/sub/*.orig
1276
1280
1277 Update to revision with missing largefile - and make sure it really is missing
1281 Update to revision with missing largefile - and make sure it really is missing
1278
1282
1279 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1283 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1280 $ hg up -r 6
1284 $ hg up -r 6
1281 getting changed largefiles
1285 getting changed largefiles
1282 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1286 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1283 1 largefiles updated, 2 removed
1287 1 largefiles updated, 2 removed
1284 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1288 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1285 $ rm normal3
1289 $ rm normal3
1286 $ echo >> sub/normal4
1290 $ echo >> sub/normal4
1287 $ hg ci -m 'commit with missing files'
1291 $ hg ci -m 'commit with missing files'
1288 Invoking status precommit hook
1292 Invoking status precommit hook
1289 M sub/normal4
1293 M sub/normal4
1290 ! large3
1294 ! large3
1291 ! normal3
1295 ! normal3
1292 created new head
1296 created new head
1293 $ hg st
1297 $ hg st
1294 ! large3
1298 ! large3
1295 ! normal3
1299 ! normal3
1296 $ hg up -r.
1300 $ hg up -r.
1297 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1301 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1298 $ hg st
1302 $ hg st
1299 ! large3
1303 ! large3
1300 ! normal3
1304 ! normal3
1301 $ hg up -Cr.
1305 $ hg up -Cr.
1302 getting changed largefiles
1306 getting changed largefiles
1303 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1307 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1304 0 largefiles updated, 0 removed
1308 0 largefiles updated, 0 removed
1305 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1309 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1306 $ hg st
1310 $ hg st
1307 ! large3
1311 ! large3
1308 $ hg rollback
1312 $ hg rollback
1309 repository tip rolled back to revision 9 (undo commit)
1313 repository tip rolled back to revision 9 (undo commit)
1310 working directory now based on revision 6
1314 working directory now based on revision 6
1311
1315
1312 Merge with revision with missing largefile - and make sure it tries to fetch it.
1316 Merge with revision with missing largefile - and make sure it tries to fetch it.
1313
1317
1314 $ hg up -Cqr null
1318 $ hg up -Cqr null
1315 $ echo f > f
1319 $ echo f > f
1316 $ hg ci -Am branch
1320 $ hg ci -Am branch
1317 adding f
1321 adding f
1318 Invoking status precommit hook
1322 Invoking status precommit hook
1319 A f
1323 A f
1320 created new head
1324 created new head
1321 $ hg merge -r 6
1325 $ hg merge -r 6
1322 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1326 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1323 (branch merge, don't forget to commit)
1327 (branch merge, don't forget to commit)
1324 getting changed largefiles
1328 getting changed largefiles
1325 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1329 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1326 1 largefiles updated, 0 removed
1330 1 largefiles updated, 0 removed
1327
1331
1328 $ hg rollback -q
1332 $ hg rollback -q
1329 $ hg up -Cq
1333 $ hg up -Cq
1330
1334
1331 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1335 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1332
1336
1333 $ hg pull --all-largefiles
1337 $ hg pull --all-largefiles
1334 pulling from $TESTTMP/d (glob)
1338 pulling from $TESTTMP/d (glob)
1335 searching for changes
1339 searching for changes
1336 no changes found
1340 no changes found
1337
1341
1338 Merging does not revert to old versions of largefiles and also check
1342 Merging does not revert to old versions of largefiles and also check
1339 that merging after having pulled from a non-default remote works
1343 that merging after having pulled from a non-default remote works
1340 correctly.
1344 correctly.
1341
1345
1342 $ cd ..
1346 $ cd ..
1343 $ hg clone -r 7 e temp
1347 $ hg clone -r 7 e temp
1344 adding changesets
1348 adding changesets
1345 adding manifests
1349 adding manifests
1346 adding file changes
1350 adding file changes
1347 added 8 changesets with 24 changes to 10 files
1351 added 8 changesets with 24 changes to 10 files
1348 updating to branch default
1352 updating to branch default
1349 getting changed largefiles
1353 getting changed largefiles
1350 3 largefiles updated, 0 removed
1354 3 largefiles updated, 0 removed
1351 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1355 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1352 $ hg clone temp f
1356 $ hg clone temp f
1353 updating to branch default
1357 updating to branch default
1354 getting changed largefiles
1358 getting changed largefiles
1355 3 largefiles updated, 0 removed
1359 3 largefiles updated, 0 removed
1356 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1360 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1357 # Delete the largefiles in the largefiles system cache so that we have an
1361 # Delete the largefiles in the largefiles system cache so that we have an
1358 # opportunity to test that caching after a pull works.
1362 # opportunity to test that caching after a pull works.
1359 $ rm "${USERCACHE}"/*
1363 $ rm "${USERCACHE}"/*
1360 $ cd f
1364 $ cd f
1361 $ echo "large4-merge-test" > sub/large4
1365 $ echo "large4-merge-test" > sub/large4
1362 $ hg commit -m "Modify large4 to test merge"
1366 $ hg commit -m "Modify large4 to test merge"
1363 Invoking status precommit hook
1367 Invoking status precommit hook
1364 M sub/large4
1368 M sub/large4
1365 # Test --cache-largefiles flag
1369 # Test --cache-largefiles flag
1366 $ hg pull --lfrev 'heads(pulled())' ../e
1370 $ hg pull --lfrev 'heads(pulled())' ../e
1367 pulling from ../e
1371 pulling from ../e
1368 searching for changes
1372 searching for changes
1369 adding changesets
1373 adding changesets
1370 adding manifests
1374 adding manifests
1371 adding file changes
1375 adding file changes
1372 added 2 changesets with 4 changes to 4 files (+1 heads)
1376 added 2 changesets with 4 changes to 4 files (+1 heads)
1373 (run 'hg heads' to see heads, 'hg merge' to merge)
1377 (run 'hg heads' to see heads, 'hg merge' to merge)
1374 2 largefiles cached
1378 2 largefiles cached
1375 $ hg merge
1379 $ hg merge
1376 largefile sub/large4 has a merge conflict
1380 largefile sub/large4 has a merge conflict
1377 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1381 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1378 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1382 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1379 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1383 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1380 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1384 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1381 (branch merge, don't forget to commit)
1385 (branch merge, don't forget to commit)
1382 getting changed largefiles
1386 getting changed largefiles
1383 1 largefiles updated, 0 removed
1387 1 largefiles updated, 0 removed
1384 $ hg commit -m "Merge repos e and f"
1388 $ hg commit -m "Merge repos e and f"
1385 Invoking status precommit hook
1389 Invoking status precommit hook
1386 M normal3
1390 M normal3
1387 M sub/normal4
1391 M sub/normal4
1388 M sub2/large6
1392 M sub2/large6
1389 $ cat normal3
1393 $ cat normal3
1390 normal3-modified
1394 normal3-modified
1391 $ cat sub/normal4
1395 $ cat sub/normal4
1392 normal4-modified
1396 normal4-modified
1393 $ cat sub/large4
1397 $ cat sub/large4
1394 large4-merge-test
1398 large4-merge-test
1395 $ cat sub2/large6
1399 $ cat sub2/large6
1396 large6-modified
1400 large6-modified
1397 $ cat sub2/large7
1401 $ cat sub2/large7
1398 large7
1402 large7
1399
1403
1400 Test status after merging with a branch that introduces a new largefile:
1404 Test status after merging with a branch that introduces a new largefile:
1401
1405
1402 $ echo large > large
1406 $ echo large > large
1403 $ hg add --large large
1407 $ hg add --large large
1404 $ hg commit -m 'add largefile'
1408 $ hg commit -m 'add largefile'
1405 Invoking status precommit hook
1409 Invoking status precommit hook
1406 A large
1410 A large
1407 $ hg update -q ".^"
1411 $ hg update -q ".^"
1408 $ echo change >> normal3
1412 $ echo change >> normal3
1409 $ hg commit -m 'some change'
1413 $ hg commit -m 'some change'
1410 Invoking status precommit hook
1414 Invoking status precommit hook
1411 M normal3
1415 M normal3
1412 created new head
1416 created new head
1413 $ hg merge
1417 $ hg merge
1414 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1418 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1415 (branch merge, don't forget to commit)
1419 (branch merge, don't forget to commit)
1416 getting changed largefiles
1420 getting changed largefiles
1417 1 largefiles updated, 0 removed
1421 1 largefiles updated, 0 removed
1418 $ hg status
1422 $ hg status
1419 M large
1423 M large
1420
1424
1421 - make sure update of merge with removed largefiles fails as expected
1425 - make sure update of merge with removed largefiles fails as expected
1422 $ hg rm sub2/large6
1426 $ hg rm sub2/large6
1423 $ hg up -r.
1427 $ hg up -r.
1424 abort: outstanding uncommitted merges
1428 abort: outstanding uncommitted merges
1425 [255]
1429 [255]
1426
1430
1427 - revert should be able to revert files introduced in a pending merge
1431 - revert should be able to revert files introduced in a pending merge
1428 $ hg revert --all -r .
1432 $ hg revert --all -r .
1429 removing .hglf/large (glob)
1433 removing .hglf/large (glob)
1430 undeleting .hglf/sub2/large6 (glob)
1434 undeleting .hglf/sub2/large6 (glob)
1431
1435
1432 Test that a normal file and a largefile with the same name and path cannot
1436 Test that a normal file and a largefile with the same name and path cannot
1433 coexist.
1437 coexist.
1434
1438
1435 $ rm sub2/large7
1439 $ rm sub2/large7
1436 $ echo "largeasnormal" > sub2/large7
1440 $ echo "largeasnormal" > sub2/large7
1437 $ hg add sub2/large7
1441 $ hg add sub2/large7
1438 sub2/large7 already a largefile
1442 sub2/large7 already a largefile
1439
1443
1440 Test that transplanting a largefile change works correctly.
1444 Test that transplanting a largefile change works correctly.
1441
1445
1442 $ cd ..
1446 $ cd ..
1443 $ hg clone -r 8 d g
1447 $ hg clone -r 8 d g
1444 adding changesets
1448 adding changesets
1445 adding manifests
1449 adding manifests
1446 adding file changes
1450 adding file changes
1447 added 9 changesets with 26 changes to 10 files
1451 added 9 changesets with 26 changes to 10 files
1448 updating to branch default
1452 updating to branch default
1449 getting changed largefiles
1453 getting changed largefiles
1450 3 largefiles updated, 0 removed
1454 3 largefiles updated, 0 removed
1451 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1455 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1452 $ cd g
1456 $ cd g
1453 $ hg transplant -s ../d 598410d3eb9a
1457 $ hg transplant -s ../d 598410d3eb9a
1454 searching for changes
1458 searching for changes
1455 searching for changes
1459 searching for changes
1456 adding changesets
1460 adding changesets
1457 adding manifests
1461 adding manifests
1458 adding file changes
1462 adding file changes
1459 added 1 changesets with 2 changes to 2 files
1463 added 1 changesets with 2 changes to 2 files
1460 getting changed largefiles
1464 getting changed largefiles
1461 1 largefiles updated, 0 removed
1465 1 largefiles updated, 0 removed
1462 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1466 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1463 9:598410d3eb9a modify normal file largefile in repo d
1467 9:598410d3eb9a modify normal file largefile in repo d
1464 8:a381d2c8c80e modify normal file and largefile in repo b
1468 8:a381d2c8c80e modify normal file and largefile in repo b
1465 7:daea875e9014 add/edit more largefiles
1469 7:daea875e9014 add/edit more largefiles
1466 6:4355d653f84f edit files yet again
1470 6:4355d653f84f edit files yet again
1467 5:9d5af5072dbd edit files again
1471 5:9d5af5072dbd edit files again
1468 4:74c02385b94c move files
1472 4:74c02385b94c move files
1469 3:9e8fbc4bce62 copy files
1473 3:9e8fbc4bce62 copy files
1470 2:51a0ae4d5864 remove files
1474 2:51a0ae4d5864 remove files
1471 1:ce8896473775 edit files
1475 1:ce8896473775 edit files
1472 0:30d30fe6a5be add files
1476 0:30d30fe6a5be add files
1473 $ cat normal3
1477 $ cat normal3
1474 normal3-modified
1478 normal3-modified
1475 $ cat sub/normal4
1479 $ cat sub/normal4
1476 normal4-modified
1480 normal4-modified
1477 $ cat sub/large4
1481 $ cat sub/large4
1478 large4-modified
1482 large4-modified
1479 $ cat sub2/large6
1483 $ cat sub2/large6
1480 large6-modified
1484 large6-modified
1481 $ cat sub2/large7
1485 $ cat sub2/large7
1482 large7
1486 large7
1483
1487
1484 Cat a largefile
1488 Cat a largefile
1485 $ hg cat normal3
1489 $ hg cat normal3
1486 normal3-modified
1490 normal3-modified
1487 $ hg cat sub/large4
1491 $ hg cat sub/large4
1488 large4-modified
1492 large4-modified
1489 $ rm "${USERCACHE}"/*
1493 $ rm "${USERCACHE}"/*
1490 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1494 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1491 $ cat cat.out
1495 $ cat cat.out
1492 large4-modified
1496 large4-modified
1493 $ rm cat.out
1497 $ rm cat.out
1494 $ hg cat -r a381d2c8c80e normal3
1498 $ hg cat -r a381d2c8c80e normal3
1495 normal3-modified
1499 normal3-modified
1496 $ hg cat -r '.^' normal3
1500 $ hg cat -r '.^' normal3
1497 normal3-modified
1501 normal3-modified
1498 $ hg cat -r '.^' sub/large4 doesntexist
1502 $ hg cat -r '.^' sub/large4 doesntexist
1499 large4-modified
1503 large4-modified
1500 doesntexist: no such file in rev a381d2c8c80e
1504 doesntexist: no such file in rev a381d2c8c80e
1501 $ hg --cwd sub cat -r '.^' large4
1505 $ hg --cwd sub cat -r '.^' large4
1502 large4-modified
1506 large4-modified
1503 $ hg --cwd sub cat -r '.^' ../normal3
1507 $ hg --cwd sub cat -r '.^' ../normal3
1504 normal3-modified
1508 normal3-modified
1505
1509
1506 Test that renaming a largefile results in correct output for status
1510 Test that renaming a largefile results in correct output for status
1507
1511
1508 $ hg rename sub/large4 large4-renamed
1512 $ hg rename sub/large4 large4-renamed
1509 $ hg commit -m "test rename output"
1513 $ hg commit -m "test rename output"
1510 Invoking status precommit hook
1514 Invoking status precommit hook
1511 A large4-renamed
1515 A large4-renamed
1512 R sub/large4
1516 R sub/large4
1513 $ cat large4-renamed
1517 $ cat large4-renamed
1514 large4-modified
1518 large4-modified
1515 $ cd sub2
1519 $ cd sub2
1516 $ hg rename large6 large6-renamed
1520 $ hg rename large6 large6-renamed
1517 $ hg st
1521 $ hg st
1518 A sub2/large6-renamed
1522 A sub2/large6-renamed
1519 R sub2/large6
1523 R sub2/large6
1520 $ cd ..
1524 $ cd ..
1521
1525
1522 Test --normal flag
1526 Test --normal flag
1523
1527
1524 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1528 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1525 $ hg add --normal --large new-largefile
1529 $ hg add --normal --large new-largefile
1526 abort: --normal cannot be used with --large
1530 abort: --normal cannot be used with --large
1527 [255]
1531 [255]
1528 $ hg add --normal new-largefile
1532 $ hg add --normal new-largefile
1529 new-largefile: up to 69 MB of RAM may be required to manage this file
1533 new-largefile: up to 69 MB of RAM may be required to manage this file
1530 (use 'hg revert new-largefile' to cancel the pending addition)
1534 (use 'hg revert new-largefile' to cancel the pending addition)
1531 $ cd ..
1535 $ cd ..
1532
1536
1533 #if serve
1537 #if serve
1534 vanilla clients not locked out from largefiles servers on vanilla repos
1538 vanilla clients not locked out from largefiles servers on vanilla repos
1535 $ mkdir r1
1539 $ mkdir r1
1536 $ cd r1
1540 $ cd r1
1537 $ hg init
1541 $ hg init
1538 $ echo c1 > f1
1542 $ echo c1 > f1
1539 $ hg add f1
1543 $ hg add f1
1540 $ hg commit -m "m1"
1544 $ hg commit -m "m1"
1541 Invoking status precommit hook
1545 Invoking status precommit hook
1542 A f1
1546 A f1
1543 $ cd ..
1547 $ cd ..
1544 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1548 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1545 $ cat hg.pid >> $DAEMON_PIDS
1549 $ cat hg.pid >> $DAEMON_PIDS
1546 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1550 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1547 requesting all changes
1551 requesting all changes
1548 adding changesets
1552 adding changesets
1549 adding manifests
1553 adding manifests
1550 adding file changes
1554 adding file changes
1551 added 1 changesets with 1 changes to 1 files
1555 added 1 changesets with 1 changes to 1 files
1552 updating to branch default
1556 updating to branch default
1553 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1557 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1554
1558
1555 largefiles clients still work with vanilla servers
1559 largefiles clients still work with vanilla servers
1556 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1560 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1557 $ cat hg.pid >> $DAEMON_PIDS
1561 $ cat hg.pid >> $DAEMON_PIDS
1558 $ hg clone http://localhost:$HGPORT1 r3
1562 $ hg clone http://localhost:$HGPORT1 r3
1559 requesting all changes
1563 requesting all changes
1560 adding changesets
1564 adding changesets
1561 adding manifests
1565 adding manifests
1562 adding file changes
1566 adding file changes
1563 added 1 changesets with 1 changes to 1 files
1567 added 1 changesets with 1 changes to 1 files
1564 updating to branch default
1568 updating to branch default
1565 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1569 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1566 #endif
1570 #endif
1567
1571
1568
1572
1569 vanilla clients locked out from largefiles http repos
1573 vanilla clients locked out from largefiles http repos
1570 $ mkdir r4
1574 $ mkdir r4
1571 $ cd r4
1575 $ cd r4
1572 $ hg init
1576 $ hg init
1573 $ echo c1 > f1
1577 $ echo c1 > f1
1574 $ hg add --large f1
1578 $ hg add --large f1
1575 $ hg commit -m "m1"
1579 $ hg commit -m "m1"
1576 Invoking status precommit hook
1580 Invoking status precommit hook
1577 A f1
1581 A f1
1578 $ cd ..
1582 $ cd ..
1579
1583
1580 largefiles can be pushed locally (issue3583)
1584 largefiles can be pushed locally (issue3583)
1581 $ hg init dest
1585 $ hg init dest
1582 $ cd r4
1586 $ cd r4
1583 $ hg outgoing ../dest
1587 $ hg outgoing ../dest
1584 comparing with ../dest
1588 comparing with ../dest
1585 searching for changes
1589 searching for changes
1586 changeset: 0:639881c12b4c
1590 changeset: 0:639881c12b4c
1587 tag: tip
1591 tag: tip
1588 user: test
1592 user: test
1589 date: Thu Jan 01 00:00:00 1970 +0000
1593 date: Thu Jan 01 00:00:00 1970 +0000
1590 summary: m1
1594 summary: m1
1591
1595
1592 $ hg push ../dest
1596 $ hg push ../dest
1593 pushing to ../dest
1597 pushing to ../dest
1594 searching for changes
1598 searching for changes
1595 adding changesets
1599 adding changesets
1596 adding manifests
1600 adding manifests
1597 adding file changes
1601 adding file changes
1598 added 1 changesets with 1 changes to 1 files
1602 added 1 changesets with 1 changes to 1 files
1599
1603
1600 exit code with nothing outgoing (issue3611)
1604 exit code with nothing outgoing (issue3611)
1601 $ hg outgoing ../dest
1605 $ hg outgoing ../dest
1602 comparing with ../dest
1606 comparing with ../dest
1603 searching for changes
1607 searching for changes
1604 no changes found
1608 no changes found
1605 [1]
1609 [1]
1606 $ cd ..
1610 $ cd ..
1607
1611
1608 #if serve
1612 #if serve
1609 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1613 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1610 $ cat hg.pid >> $DAEMON_PIDS
1614 $ cat hg.pid >> $DAEMON_PIDS
1611 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1615 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1612 abort: remote error:
1616 abort: remote error:
1613
1617
1614 This repository uses the largefiles extension.
1618 This repository uses the largefiles extension.
1615
1619
1616 Please enable it in your Mercurial config file.
1620 Please enable it in your Mercurial config file.
1617 [255]
1621 [255]
1618
1622
1619 used all HGPORTs, kill all daemons
1623 used all HGPORTs, kill all daemons
1620 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1624 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1621 #endif
1625 #endif
1622
1626
1623 vanilla clients locked out from largefiles ssh repos
1627 vanilla clients locked out from largefiles ssh repos
1624 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1628 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1625 abort: remote error:
1629 abort: remote error:
1626
1630
1627 This repository uses the largefiles extension.
1631 This repository uses the largefiles extension.
1628
1632
1629 Please enable it in your Mercurial config file.
1633 Please enable it in your Mercurial config file.
1630 [255]
1634 [255]
1631
1635
1632 #if serve
1636 #if serve
1633
1637
1634 largefiles clients refuse to push largefiles repos to vanilla servers
1638 largefiles clients refuse to push largefiles repos to vanilla servers
1635 $ mkdir r6
1639 $ mkdir r6
1636 $ cd r6
1640 $ cd r6
1637 $ hg init
1641 $ hg init
1638 $ echo c1 > f1
1642 $ echo c1 > f1
1639 $ hg add f1
1643 $ hg add f1
1640 $ hg commit -m "m1"
1644 $ hg commit -m "m1"
1641 Invoking status precommit hook
1645 Invoking status precommit hook
1642 A f1
1646 A f1
1643 $ cat >> .hg/hgrc <<!
1647 $ cat >> .hg/hgrc <<!
1644 > [web]
1648 > [web]
1645 > push_ssl = false
1649 > push_ssl = false
1646 > allow_push = *
1650 > allow_push = *
1647 > !
1651 > !
1648 $ cd ..
1652 $ cd ..
1649 $ hg clone r6 r7
1653 $ hg clone r6 r7
1650 updating to branch default
1654 updating to branch default
1651 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1655 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1652 $ cd r7
1656 $ cd r7
1653 $ echo c2 > f2
1657 $ echo c2 > f2
1654 $ hg add --large f2
1658 $ hg add --large f2
1655 $ hg commit -m "m2"
1659 $ hg commit -m "m2"
1656 Invoking status precommit hook
1660 Invoking status precommit hook
1657 A f2
1661 A f2
1658 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1662 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1659 $ cat ../hg.pid >> $DAEMON_PIDS
1663 $ cat ../hg.pid >> $DAEMON_PIDS
1660 $ hg push http://localhost:$HGPORT
1664 $ hg push http://localhost:$HGPORT
1661 pushing to http://localhost:$HGPORT/
1665 pushing to http://localhost:$HGPORT/
1662 searching for changes
1666 searching for changes
1663 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1667 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1664 [255]
1668 [255]
1665 $ cd ..
1669 $ cd ..
1666
1670
1667 putlfile errors are shown (issue3123)
1671 putlfile errors are shown (issue3123)
1668 Corrupt the cached largefile in r7 and move it out of the servers usercache
1672 Corrupt the cached largefile in r7 and move it out of the servers usercache
1669 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1673 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1670 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1674 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1671 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1675 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1672 $ hg init empty
1676 $ hg init empty
1673 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1677 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1674 > --config 'web.allow_push=*' --config web.push_ssl=False
1678 > --config 'web.allow_push=*' --config web.push_ssl=False
1675 $ cat hg.pid >> $DAEMON_PIDS
1679 $ cat hg.pid >> $DAEMON_PIDS
1676 $ hg push -R r7 http://localhost:$HGPORT1
1680 $ hg push -R r7 http://localhost:$HGPORT1
1677 pushing to http://localhost:$HGPORT1/
1681 pushing to http://localhost:$HGPORT1/
1678 searching for changes
1682 searching for changes
1679 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1683 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1680 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1684 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1681 [255]
1685 [255]
1682 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1686 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1683 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1687 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1684 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1688 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1685 $ hg push -R r7 http://localhost:$HGPORT1
1689 $ hg push -R r7 http://localhost:$HGPORT1
1686 pushing to http://localhost:$HGPORT1/
1690 pushing to http://localhost:$HGPORT1/
1687 searching for changes
1691 searching for changes
1688 remote: adding changesets
1692 remote: adding changesets
1689 remote: adding manifests
1693 remote: adding manifests
1690 remote: adding file changes
1694 remote: adding file changes
1691 remote: added 2 changesets with 2 changes to 2 files
1695 remote: added 2 changesets with 2 changes to 2 files
1692 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1696 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1693 server side corruption
1697 server side corruption
1694 $ rm -rf empty
1698 $ rm -rf empty
1695
1699
1696 Push a largefiles repository to a served empty repository
1700 Push a largefiles repository to a served empty repository
1697 $ hg init r8
1701 $ hg init r8
1698 $ echo c3 > r8/f1
1702 $ echo c3 > r8/f1
1699 $ hg add --large r8/f1 -R r8
1703 $ hg add --large r8/f1 -R r8
1700 $ hg commit -m "m1" -R r8
1704 $ hg commit -m "m1" -R r8
1701 Invoking status precommit hook
1705 Invoking status precommit hook
1702 A f1
1706 A f1
1703 $ hg init empty
1707 $ hg init empty
1704 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1708 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1705 > --config 'web.allow_push=*' --config web.push_ssl=False
1709 > --config 'web.allow_push=*' --config web.push_ssl=False
1706 $ cat hg.pid >> $DAEMON_PIDS
1710 $ cat hg.pid >> $DAEMON_PIDS
1707 $ rm "${USERCACHE}"/*
1711 $ rm "${USERCACHE}"/*
1708 $ hg push -R r8 http://localhost:$HGPORT2/#default
1712 $ hg push -R r8 http://localhost:$HGPORT2/#default
1709 pushing to http://localhost:$HGPORT2/
1713 pushing to http://localhost:$HGPORT2/
1710 searching for changes
1714 searching for changes
1711 remote: adding changesets
1715 remote: adding changesets
1712 remote: adding manifests
1716 remote: adding manifests
1713 remote: adding file changes
1717 remote: adding file changes
1714 remote: added 1 changesets with 1 changes to 1 files
1718 remote: added 1 changesets with 1 changes to 1 files
1715 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1719 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1716 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1720 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1717
1721
1718 Clone over http, no largefiles pulled on clone.
1722 Clone over http, no largefiles pulled on clone.
1719
1723
1720 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1724 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1721 adding changesets
1725 adding changesets
1722 adding manifests
1726 adding manifests
1723 adding file changes
1727 adding file changes
1724 added 1 changesets with 1 changes to 1 files
1728 added 1 changesets with 1 changes to 1 files
1725
1729
1726 test 'verify' with remotestore:
1730 test 'verify' with remotestore:
1727
1731
1728 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1732 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1729 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1733 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1730 $ hg -R http-clone verify --large --lfa
1734 $ hg -R http-clone verify --large --lfa
1731 checking changesets
1735 checking changesets
1732 checking manifests
1736 checking manifests
1733 crosschecking files in changesets and manifests
1737 crosschecking files in changesets and manifests
1734 checking files
1738 checking files
1735 1 files, 1 changesets, 1 total revisions
1739 1 files, 1 changesets, 1 total revisions
1736 searching 1 changesets for largefiles
1740 searching 1 changesets for largefiles
1737 changeset 0:cf03e5bb9936: f1 missing
1741 changeset 0:cf03e5bb9936: f1 missing
1738 verified existence of 1 revisions of 1 largefiles
1742 verified existence of 1 revisions of 1 largefiles
1739 [1]
1743 [1]
1740 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1744 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1741 $ hg -R http-clone -q verify --large --lfa
1745 $ hg -R http-clone -q verify --large --lfa
1742
1746
1743 largefiles pulled on update - a largefile missing on the server:
1747 largefiles pulled on update - a largefile missing on the server:
1744 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1748 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1745 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1749 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1746 getting changed largefiles
1750 getting changed largefiles
1747 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
1751 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
1748 0 largefiles updated, 0 removed
1752 0 largefiles updated, 0 removed
1749 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1753 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1750 $ hg -R http-clone st
1754 $ hg -R http-clone st
1751 ! f1
1755 ! f1
1752 $ hg -R http-clone up -Cqr null
1756 $ hg -R http-clone up -Cqr null
1753
1757
1754 largefiles pulled on update - a largefile corrupted on the server:
1758 largefiles pulled on update - a largefile corrupted on the server:
1755 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1759 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1756 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1760 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1757 getting changed largefiles
1761 getting changed largefiles
1758 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1762 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1759 0 largefiles updated, 0 removed
1763 0 largefiles updated, 0 removed
1760 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1764 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1761 $ hg -R http-clone st
1765 $ hg -R http-clone st
1762 ! f1
1766 ! f1
1763 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1767 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1764 $ [ ! -f http-clone/f1 ]
1768 $ [ ! -f http-clone/f1 ]
1765 $ [ ! -f http-clone-usercache ]
1769 $ [ ! -f http-clone-usercache ]
1766 $ hg -R http-clone verify --large --lfc
1770 $ hg -R http-clone verify --large --lfc
1767 checking changesets
1771 checking changesets
1768 checking manifests
1772 checking manifests
1769 crosschecking files in changesets and manifests
1773 crosschecking files in changesets and manifests
1770 checking files
1774 checking files
1771 1 files, 1 changesets, 1 total revisions
1775 1 files, 1 changesets, 1 total revisions
1772 searching 1 changesets for largefiles
1776 searching 1 changesets for largefiles
1773 verified contents of 1 revisions of 1 largefiles
1777 verified contents of 1 revisions of 1 largefiles
1774 $ hg -R http-clone up -Cqr null
1778 $ hg -R http-clone up -Cqr null
1775
1779
1776 largefiles pulled on update - no server side problems:
1780 largefiles pulled on update - no server side problems:
1777 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1781 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1778 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1782 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1779 resolving manifests
1783 resolving manifests
1780 branchmerge: False, force: False, partial: False
1784 branchmerge: False, force: False, partial: False
1781 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1785 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1782 .hglf/f1: remote created -> g
1786 .hglf/f1: remote created -> g
1783 getting .hglf/f1
1787 getting .hglf/f1
1784 updating: .hglf/f1 1/1 files (100.00%)
1788 updating: .hglf/f1 1/1 files (100.00%)
1785 getting changed largefiles
1789 getting changed largefiles
1786 using http://localhost:$HGPORT2/
1790 using http://localhost:$HGPORT2/
1787 sending capabilities command
1791 sending capabilities command
1788 sending batch command
1792 sending batch command
1789 getting largefiles: 0/1 lfile (0.00%)
1793 getting largefiles: 0/1 lfile (0.00%)
1790 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1794 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1791 sending getlfile command
1795 sending getlfile command
1792 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1796 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1793 1 largefiles updated, 0 removed
1797 1 largefiles updated, 0 removed
1794 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1798 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1795
1799
1796 $ ls http-clone-usercache/*
1800 $ ls http-clone-usercache/*
1797 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1801 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1798
1802
1799 $ rm -rf empty http-clone*
1803 $ rm -rf empty http-clone*
1800
1804
1801 used all HGPORTs, kill all daemons
1805 used all HGPORTs, kill all daemons
1802 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1806 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1803
1807
1804 #endif
1808 #endif
1805
1809
1806
1810
1807 #if unix-permissions
1811 #if unix-permissions
1808
1812
1809 Clone a local repository owned by another user
1813 Clone a local repository owned by another user
1810 We have to simulate that here by setting $HOME and removing write permissions
1814 We have to simulate that here by setting $HOME and removing write permissions
1811 $ ORIGHOME="$HOME"
1815 $ ORIGHOME="$HOME"
1812 $ mkdir alice
1816 $ mkdir alice
1813 $ HOME="`pwd`/alice"
1817 $ HOME="`pwd`/alice"
1814 $ cd alice
1818 $ cd alice
1815 $ hg init pubrepo
1819 $ hg init pubrepo
1816 $ cd pubrepo
1820 $ cd pubrepo
1817 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1821 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1818 $ hg add --large a-large-file
1822 $ hg add --large a-large-file
1819 $ hg commit -m "Add a large file"
1823 $ hg commit -m "Add a large file"
1820 Invoking status precommit hook
1824 Invoking status precommit hook
1821 A a-large-file
1825 A a-large-file
1822 $ cd ..
1826 $ cd ..
1823 $ chmod -R a-w pubrepo
1827 $ chmod -R a-w pubrepo
1824 $ cd ..
1828 $ cd ..
1825 $ mkdir bob
1829 $ mkdir bob
1826 $ HOME="`pwd`/bob"
1830 $ HOME="`pwd`/bob"
1827 $ cd bob
1831 $ cd bob
1828 $ hg clone --pull ../alice/pubrepo pubrepo
1832 $ hg clone --pull ../alice/pubrepo pubrepo
1829 requesting all changes
1833 requesting all changes
1830 adding changesets
1834 adding changesets
1831 adding manifests
1835 adding manifests
1832 adding file changes
1836 adding file changes
1833 added 1 changesets with 1 changes to 1 files
1837 added 1 changesets with 1 changes to 1 files
1834 updating to branch default
1838 updating to branch default
1835 getting changed largefiles
1839 getting changed largefiles
1836 1 largefiles updated, 0 removed
1840 1 largefiles updated, 0 removed
1837 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1841 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1838 $ cd ..
1842 $ cd ..
1839 $ chmod -R u+w alice/pubrepo
1843 $ chmod -R u+w alice/pubrepo
1840 $ HOME="$ORIGHOME"
1844 $ HOME="$ORIGHOME"
1841
1845
1842 #endif
1846 #endif
1843
1847
1844 #if symlink
1848 #if symlink
1845
1849
1846 Symlink to a large largefile should behave the same as a symlink to a normal file
1850 Symlink to a large largefile should behave the same as a symlink to a normal file
1847 $ hg init largesymlink
1851 $ hg init largesymlink
1848 $ cd largesymlink
1852 $ cd largesymlink
1849 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1853 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1850 $ hg add --large largefile
1854 $ hg add --large largefile
1851 $ hg commit -m "commit a large file"
1855 $ hg commit -m "commit a large file"
1852 Invoking status precommit hook
1856 Invoking status precommit hook
1853 A largefile
1857 A largefile
1854 $ ln -s largefile largelink
1858 $ ln -s largefile largelink
1855 $ hg add largelink
1859 $ hg add largelink
1856 $ hg commit -m "commit a large symlink"
1860 $ hg commit -m "commit a large symlink"
1857 Invoking status precommit hook
1861 Invoking status precommit hook
1858 A largelink
1862 A largelink
1859 $ rm -f largelink
1863 $ rm -f largelink
1860 $ hg up >/dev/null
1864 $ hg up >/dev/null
1861 $ test -f largelink
1865 $ test -f largelink
1862 [1]
1866 [1]
1863 $ test -L largelink
1867 $ test -L largelink
1864 [1]
1868 [1]
1865 $ rm -f largelink # make next part of the test independent of the previous
1869 $ rm -f largelink # make next part of the test independent of the previous
1866 $ hg up -C >/dev/null
1870 $ hg up -C >/dev/null
1867 $ test -f largelink
1871 $ test -f largelink
1868 $ test -L largelink
1872 $ test -L largelink
1869 $ cd ..
1873 $ cd ..
1870
1874
1871 #endif
1875 #endif
1872
1876
1873 test for pattern matching on 'hg status':
1877 test for pattern matching on 'hg status':
1874 to boost performance, largefiles checks whether specified patterns are
1878 to boost performance, largefiles checks whether specified patterns are
1875 related to largefiles in working directory (NOT to STANDIN) or not.
1879 related to largefiles in working directory (NOT to STANDIN) or not.
1876
1880
1877 $ hg init statusmatch
1881 $ hg init statusmatch
1878 $ cd statusmatch
1882 $ cd statusmatch
1879
1883
1880 $ mkdir -p a/b/c/d
1884 $ mkdir -p a/b/c/d
1881 $ echo normal > a/b/c/d/e.normal.txt
1885 $ echo normal > a/b/c/d/e.normal.txt
1882 $ hg add a/b/c/d/e.normal.txt
1886 $ hg add a/b/c/d/e.normal.txt
1883 $ echo large > a/b/c/d/e.large.txt
1887 $ echo large > a/b/c/d/e.large.txt
1884 $ hg add --large a/b/c/d/e.large.txt
1888 $ hg add --large a/b/c/d/e.large.txt
1885 $ mkdir -p a/b/c/x
1889 $ mkdir -p a/b/c/x
1886 $ echo normal > a/b/c/x/y.normal.txt
1890 $ echo normal > a/b/c/x/y.normal.txt
1887 $ hg add a/b/c/x/y.normal.txt
1891 $ hg add a/b/c/x/y.normal.txt
1888 $ hg commit -m 'add files'
1892 $ hg commit -m 'add files'
1889 Invoking status precommit hook
1893 Invoking status precommit hook
1890 A a/b/c/d/e.large.txt
1894 A a/b/c/d/e.large.txt
1891 A a/b/c/d/e.normal.txt
1895 A a/b/c/d/e.normal.txt
1892 A a/b/c/x/y.normal.txt
1896 A a/b/c/x/y.normal.txt
1893
1897
1894 (1) no pattern: no performance boost
1898 (1) no pattern: no performance boost
1895 $ hg status -A
1899 $ hg status -A
1896 C a/b/c/d/e.large.txt
1900 C a/b/c/d/e.large.txt
1897 C a/b/c/d/e.normal.txt
1901 C a/b/c/d/e.normal.txt
1898 C a/b/c/x/y.normal.txt
1902 C a/b/c/x/y.normal.txt
1899
1903
1900 (2) pattern not related to largefiles: performance boost
1904 (2) pattern not related to largefiles: performance boost
1901 $ hg status -A a/b/c/x
1905 $ hg status -A a/b/c/x
1902 C a/b/c/x/y.normal.txt
1906 C a/b/c/x/y.normal.txt
1903
1907
1904 (3) pattern related to largefiles: no performance boost
1908 (3) pattern related to largefiles: no performance boost
1905 $ hg status -A a/b/c/d
1909 $ hg status -A a/b/c/d
1906 C a/b/c/d/e.large.txt
1910 C a/b/c/d/e.large.txt
1907 C a/b/c/d/e.normal.txt
1911 C a/b/c/d/e.normal.txt
1908
1912
1909 (4) pattern related to STANDIN (not to largefiles): performance boost
1913 (4) pattern related to STANDIN (not to largefiles): performance boost
1910 $ hg status -A .hglf/a
1914 $ hg status -A .hglf/a
1911 C .hglf/a/b/c/d/e.large.txt
1915 C .hglf/a/b/c/d/e.large.txt
1912
1916
1913 (5) mixed case: no performance boost
1917 (5) mixed case: no performance boost
1914 $ hg status -A a/b/c/x a/b/c/d
1918 $ hg status -A a/b/c/x a/b/c/d
1915 C a/b/c/d/e.large.txt
1919 C a/b/c/d/e.large.txt
1916 C a/b/c/d/e.normal.txt
1920 C a/b/c/d/e.normal.txt
1917 C a/b/c/x/y.normal.txt
1921 C a/b/c/x/y.normal.txt
1918
1922
1919 verify that largefiles doesn't break filesets
1923 verify that largefiles doesn't break filesets
1920
1924
1921 $ hg log --rev . --exclude "set:binary()"
1925 $ hg log --rev . --exclude "set:binary()"
1922 changeset: 0:41bd42f10efa
1926 changeset: 0:41bd42f10efa
1923 tag: tip
1927 tag: tip
1924 user: test
1928 user: test
1925 date: Thu Jan 01 00:00:00 1970 +0000
1929 date: Thu Jan 01 00:00:00 1970 +0000
1926 summary: add files
1930 summary: add files
1927
1931
1928 verify that large files in subrepos handled properly
1932 verify that large files in subrepos handled properly
1929 $ hg init subrepo
1933 $ hg init subrepo
1930 $ echo "subrepo = subrepo" > .hgsub
1934 $ echo "subrepo = subrepo" > .hgsub
1931 $ hg add .hgsub
1935 $ hg add .hgsub
1932 $ hg ci -m "add subrepo"
1936 $ hg ci -m "add subrepo"
1933 Invoking status precommit hook
1937 Invoking status precommit hook
1934 A .hgsub
1938 A .hgsub
1935 ? .hgsubstate
1939 ? .hgsubstate
1936 $ echo "rev 1" > subrepo/large.txt
1940 $ echo "rev 1" > subrepo/large.txt
1937 $ hg -R subrepo add --large subrepo/large.txt
1941 $ hg -R subrepo add --large subrepo/large.txt
1938 $ hg sum
1942 $ hg sum
1939 parent: 1:8ee150ea2e9c tip
1943 parent: 1:8ee150ea2e9c tip
1940 add subrepo
1944 add subrepo
1941 branch: default
1945 branch: default
1942 commit: 1 subrepos
1946 commit: 1 subrepos
1943 update: (current)
1947 update: (current)
1944 $ hg st
1948 $ hg st
1945 $ hg st -S
1949 $ hg st -S
1946 A subrepo/large.txt
1950 A subrepo/large.txt
1947 $ hg ci -S -m "commit top repo"
1951 $ hg ci -S -m "commit top repo"
1948 committing subrepository subrepo
1952 committing subrepository subrepo
1949 Invoking status precommit hook
1953 Invoking status precommit hook
1950 A large.txt
1954 A large.txt
1951 Invoking status precommit hook
1955 Invoking status precommit hook
1952 M .hgsubstate
1956 M .hgsubstate
1953 # No differences
1957 # No differences
1954 $ hg st -S
1958 $ hg st -S
1955 $ hg sum
1959 $ hg sum
1956 parent: 2:ce4cd0c527a6 tip
1960 parent: 2:ce4cd0c527a6 tip
1957 commit top repo
1961 commit top repo
1958 branch: default
1962 branch: default
1959 commit: (clean)
1963 commit: (clean)
1960 update: (current)
1964 update: (current)
1961 $ echo "rev 2" > subrepo/large.txt
1965 $ echo "rev 2" > subrepo/large.txt
1962 $ hg st -S
1966 $ hg st -S
1963 M subrepo/large.txt
1967 M subrepo/large.txt
1964 $ hg sum
1968 $ hg sum
1965 parent: 2:ce4cd0c527a6 tip
1969 parent: 2:ce4cd0c527a6 tip
1966 commit top repo
1970 commit top repo
1967 branch: default
1971 branch: default
1968 commit: 1 subrepos
1972 commit: 1 subrepos
1969 update: (current)
1973 update: (current)
1970 $ hg ci -m "this commit should fail without -S"
1974 $ hg ci -m "this commit should fail without -S"
1971 abort: uncommitted changes in subrepo subrepo
1975 abort: uncommitted changes in subrepo subrepo
1972 (use --subrepos for recursive commit)
1976 (use --subrepos for recursive commit)
1973 [255]
1977 [255]
1974
1978
1975 Add a normal file to the subrepo, then test archiving
1979 Add a normal file to the subrepo, then test archiving
1976
1980
1977 $ echo 'normal file' > subrepo/normal.txt
1981 $ echo 'normal file' > subrepo/normal.txt
1978 $ hg -R subrepo add subrepo/normal.txt
1982 $ hg -R subrepo add subrepo/normal.txt
1979
1983
1980 Lock in subrepo, otherwise the change isn't archived
1984 Lock in subrepo, otherwise the change isn't archived
1981
1985
1982 $ hg ci -S -m "add normal file to top level"
1986 $ hg ci -S -m "add normal file to top level"
1983 committing subrepository subrepo
1987 committing subrepository subrepo
1984 Invoking status precommit hook
1988 Invoking status precommit hook
1985 M large.txt
1989 M large.txt
1986 A normal.txt
1990 A normal.txt
1987 Invoking status precommit hook
1991 Invoking status precommit hook
1988 M .hgsubstate
1992 M .hgsubstate
1989 $ hg archive -S ../lf_subrepo_archive
1993 $ hg archive -S ../lf_subrepo_archive
1990 $ find ../lf_subrepo_archive | sort
1994 $ find ../lf_subrepo_archive | sort
1991 ../lf_subrepo_archive
1995 ../lf_subrepo_archive
1992 ../lf_subrepo_archive/.hg_archival.txt
1996 ../lf_subrepo_archive/.hg_archival.txt
1993 ../lf_subrepo_archive/.hgsub
1997 ../lf_subrepo_archive/.hgsub
1994 ../lf_subrepo_archive/.hgsubstate
1998 ../lf_subrepo_archive/.hgsubstate
1995 ../lf_subrepo_archive/a
1999 ../lf_subrepo_archive/a
1996 ../lf_subrepo_archive/a/b
2000 ../lf_subrepo_archive/a/b
1997 ../lf_subrepo_archive/a/b/c
2001 ../lf_subrepo_archive/a/b/c
1998 ../lf_subrepo_archive/a/b/c/d
2002 ../lf_subrepo_archive/a/b/c/d
1999 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2003 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2000 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2004 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2001 ../lf_subrepo_archive/a/b/c/x
2005 ../lf_subrepo_archive/a/b/c/x
2002 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2006 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2003 ../lf_subrepo_archive/subrepo
2007 ../lf_subrepo_archive/subrepo
2004 ../lf_subrepo_archive/subrepo/large.txt
2008 ../lf_subrepo_archive/subrepo/large.txt
2005 ../lf_subrepo_archive/subrepo/normal.txt
2009 ../lf_subrepo_archive/subrepo/normal.txt
2006
2010
2007 Test update with subrepos.
2011 Test update with subrepos.
2008
2012
2009 $ hg update 0
2013 $ hg update 0
2010 getting changed largefiles
2014 getting changed largefiles
2011 0 largefiles updated, 1 removed
2015 0 largefiles updated, 1 removed
2012 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2016 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2013 $ hg status -S
2017 $ hg status -S
2014 $ hg update tip
2018 $ hg update tip
2015 getting changed largefiles
2019 getting changed largefiles
2016 1 largefiles updated, 0 removed
2020 1 largefiles updated, 0 removed
2017 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2021 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2018 $ hg status -S
2022 $ hg status -S
2019 # modify a large file
2023 # modify a large file
2020 $ echo "modified" > subrepo/large.txt
2024 $ echo "modified" > subrepo/large.txt
2021 $ hg st -S
2025 $ hg st -S
2022 M subrepo/large.txt
2026 M subrepo/large.txt
2023 # update -C should revert the change.
2027 # update -C should revert the change.
2024 $ hg update -C
2028 $ hg update -C
2025 getting changed largefiles
2029 getting changed largefiles
2026 1 largefiles updated, 0 removed
2030 1 largefiles updated, 0 removed
2027 getting changed largefiles
2031 getting changed largefiles
2028 0 largefiles updated, 0 removed
2032 0 largefiles updated, 0 removed
2029 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2033 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2030 $ hg status -S
2034 $ hg status -S
2031
2035
2032 Test archiving a revision that references a subrepo that is not yet
2036 Test archiving a revision that references a subrepo that is not yet
2033 cloned (see test-subrepo-recursion.t):
2037 cloned (see test-subrepo-recursion.t):
2034
2038
2035 $ hg clone -U . ../empty
2039 $ hg clone -U . ../empty
2036 $ cd ../empty
2040 $ cd ../empty
2037 $ hg archive --subrepos -r tip ../archive.tar.gz
2041 $ hg archive --subrepos -r tip ../archive.tar.gz
2038 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2042 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2039 $ cd ..
2043 $ cd ..
2040
2044
2041 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2045 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2042
2046
2043 $ hg init addrm2
2047 $ hg init addrm2
2044 $ cd addrm2
2048 $ cd addrm2
2045 $ touch large.dat
2049 $ touch large.dat
2046 $ touch large2.dat
2050 $ touch large2.dat
2047 $ touch normal
2051 $ touch normal
2048 $ hg add --large large.dat
2052 $ hg add --large large.dat
2049 $ hg addremove -v
2053 $ hg addremove -v
2050 adding large2.dat as a largefile
2054 adding large2.dat as a largefile
2051 adding normal
2055 adding normal
2052
2056
2053 Test that forgetting all largefiles reverts to islfilesrepo() == False
2057 Test that forgetting all largefiles reverts to islfilesrepo() == False
2054 (addremove will add *.dat as normal files now)
2058 (addremove will add *.dat as normal files now)
2055 $ hg forget large.dat
2059 $ hg forget large.dat
2056 $ hg forget large2.dat
2060 $ hg forget large2.dat
2057 $ hg addremove -v
2061 $ hg addremove -v
2058 adding large.dat
2062 adding large.dat
2059 adding large2.dat
2063 adding large2.dat
2060
2064
2061 Test commit's addremove option prior to the first commit
2065 Test commit's addremove option prior to the first commit
2062 $ hg forget large.dat
2066 $ hg forget large.dat
2063 $ hg forget large2.dat
2067 $ hg forget large2.dat
2064 $ hg add --large large.dat
2068 $ hg add --large large.dat
2065 $ hg ci -Am "commit"
2069 $ hg ci -Am "commit"
2066 adding large2.dat as a largefile
2070 adding large2.dat as a largefile
2067 Invoking status precommit hook
2071 Invoking status precommit hook
2068 A large.dat
2072 A large.dat
2069 A large2.dat
2073 A large2.dat
2070 A normal
2074 A normal
2071 $ find .hglf | sort
2075 $ find .hglf | sort
2072 .hglf
2076 .hglf
2073 .hglf/large.dat
2077 .hglf/large.dat
2074 .hglf/large2.dat
2078 .hglf/large2.dat
2075
2079
2076 Test actions on largefiles using relative paths from subdir
2080 Test actions on largefiles using relative paths from subdir
2077
2081
2078 $ mkdir sub
2082 $ mkdir sub
2079 $ cd sub
2083 $ cd sub
2080 $ echo anotherlarge > anotherlarge
2084 $ echo anotherlarge > anotherlarge
2081 $ hg add --large anotherlarge
2085 $ hg add --large anotherlarge
2082 $ hg st
2086 $ hg st
2083 A sub/anotherlarge
2087 A sub/anotherlarge
2084 $ hg st anotherlarge
2088 $ hg st anotherlarge
2085 A anotherlarge
2089 A anotherlarge
2086 $ hg commit -m anotherlarge anotherlarge
2090 $ hg commit -m anotherlarge anotherlarge
2087 Invoking status precommit hook
2091 Invoking status precommit hook
2088 A sub/anotherlarge
2092 A sub/anotherlarge
2089 $ hg log anotherlarge
2093 $ hg log anotherlarge
2090 changeset: 1:9627a577c5e9
2094 changeset: 1:9627a577c5e9
2091 tag: tip
2095 tag: tip
2092 user: test
2096 user: test
2093 date: Thu Jan 01 00:00:00 1970 +0000
2097 date: Thu Jan 01 00:00:00 1970 +0000
2094 summary: anotherlarge
2098 summary: anotherlarge
2095
2099
2096 $ echo more >> anotherlarge
2100 $ echo more >> anotherlarge
2097 $ hg st .
2101 $ hg st .
2098 M anotherlarge
2102 M anotherlarge
2099 $ hg cat anotherlarge
2103 $ hg cat anotherlarge
2100 anotherlarge
2104 anotherlarge
2101 $ hg revert anotherlarge
2105 $ hg revert anotherlarge
2102 $ hg st
2106 $ hg st
2103 ? sub/anotherlarge.orig
2107 ? sub/anotherlarge.orig
2104 $ cd ..
2108 $ cd ..
2105
2109
2106 $ cd ..
2110 $ cd ..
2107
2111
2108 issue3651: summary/outgoing with largefiles shows "no remote repo"
2112 issue3651: summary/outgoing with largefiles shows "no remote repo"
2109 unexpectedly
2113 unexpectedly
2110
2114
2111 $ mkdir issue3651
2115 $ mkdir issue3651
2112 $ cd issue3651
2116 $ cd issue3651
2113
2117
2114 $ hg init src
2118 $ hg init src
2115 $ echo a > src/a
2119 $ echo a > src/a
2116 $ hg -R src add --large src/a
2120 $ hg -R src add --large src/a
2117 $ hg -R src commit -m '#0'
2121 $ hg -R src commit -m '#0'
2118 Invoking status precommit hook
2122 Invoking status precommit hook
2119 A a
2123 A a
2120
2124
2121 check messages when no remote repository is specified:
2125 check messages when no remote repository is specified:
2122 "no remote repo" route for "hg outgoing --large" is not tested here,
2126 "no remote repo" route for "hg outgoing --large" is not tested here,
2123 because it can't be reproduced easily.
2127 because it can't be reproduced easily.
2124
2128
2125 $ hg init clone1
2129 $ hg init clone1
2126 $ hg -R clone1 -q pull src
2130 $ hg -R clone1 -q pull src
2127 $ hg -R clone1 -q update
2131 $ hg -R clone1 -q update
2128 $ hg -R clone1 paths | grep default
2132 $ hg -R clone1 paths | grep default
2129 [1]
2133 [1]
2130
2134
2131 $ hg -R clone1 summary --large
2135 $ hg -R clone1 summary --large
2132 parent: 0:fc0bd45326d3 tip
2136 parent: 0:fc0bd45326d3 tip
2133 #0
2137 #0
2134 branch: default
2138 branch: default
2135 commit: (clean)
2139 commit: (clean)
2136 update: (current)
2140 update: (current)
2137 largefiles: (no remote repo)
2141 largefiles: (no remote repo)
2138
2142
2139 check messages when there is no files to upload:
2143 check messages when there is no files to upload:
2140
2144
2141 $ hg -q clone src clone2
2145 $ hg -q clone src clone2
2142 $ hg -R clone2 paths | grep default
2146 $ hg -R clone2 paths | grep default
2143 default = $TESTTMP/issue3651/src (glob)
2147 default = $TESTTMP/issue3651/src (glob)
2144
2148
2145 $ hg -R clone2 summary --large
2149 $ hg -R clone2 summary --large
2146 parent: 0:fc0bd45326d3 tip
2150 parent: 0:fc0bd45326d3 tip
2147 #0
2151 #0
2148 branch: default
2152 branch: default
2149 commit: (clean)
2153 commit: (clean)
2150 update: (current)
2154 update: (current)
2151 largefiles: (no files to upload)
2155 largefiles: (no files to upload)
2152 $ hg -R clone2 outgoing --large
2156 $ hg -R clone2 outgoing --large
2153 comparing with $TESTTMP/issue3651/src (glob)
2157 comparing with $TESTTMP/issue3651/src (glob)
2154 searching for changes
2158 searching for changes
2155 no changes found
2159 no changes found
2156 largefiles: no files to upload
2160 largefiles: no files to upload
2157 [1]
2161 [1]
2158
2162
2159 $ hg -R clone2 outgoing --large --graph --template "{rev}"
2163 $ hg -R clone2 outgoing --large --graph --template "{rev}"
2160 comparing with $TESTTMP/issue3651/src (glob)
2164 comparing with $TESTTMP/issue3651/src (glob)
2161 searching for changes
2165 searching for changes
2162 no changes found
2166 no changes found
2163 largefiles: no files to upload
2167 largefiles: no files to upload
2164
2168
2165 check messages when there are files to upload:
2169 check messages when there are files to upload:
2166
2170
2167 $ echo b > clone2/b
2171 $ echo b > clone2/b
2168 $ hg -R clone2 add --large clone2/b
2172 $ hg -R clone2 add --large clone2/b
2169 $ hg -R clone2 commit -m '#1'
2173 $ hg -R clone2 commit -m '#1'
2170 Invoking status precommit hook
2174 Invoking status precommit hook
2171 A b
2175 A b
2172 $ hg -R clone2 summary --large
2176 $ hg -R clone2 summary --large
2173 parent: 1:1acbe71ce432 tip
2177 parent: 1:1acbe71ce432 tip
2174 #1
2178 #1
2175 branch: default
2179 branch: default
2176 commit: (clean)
2180 commit: (clean)
2177 update: (current)
2181 update: (current)
2178 largefiles: 1 to upload
2182 largefiles: 1 to upload
2179 $ hg -R clone2 outgoing --large
2183 $ hg -R clone2 outgoing --large
2180 comparing with $TESTTMP/issue3651/src (glob)
2184 comparing with $TESTTMP/issue3651/src (glob)
2181 searching for changes
2185 searching for changes
2182 changeset: 1:1acbe71ce432
2186 changeset: 1:1acbe71ce432
2183 tag: tip
2187 tag: tip
2184 user: test
2188 user: test
2185 date: Thu Jan 01 00:00:00 1970 +0000
2189 date: Thu Jan 01 00:00:00 1970 +0000
2186 summary: #1
2190 summary: #1
2187
2191
2188 largefiles to upload:
2192 largefiles to upload:
2189 b
2193 b
2190
2194
2191 $ hg -R clone2 outgoing --large --graph --template "{rev}"
2195 $ hg -R clone2 outgoing --large --graph --template "{rev}"
2192 comparing with $TESTTMP/issue3651/src
2196 comparing with $TESTTMP/issue3651/src
2193 searching for changes
2197 searching for changes
2194 @ 1
2198 @ 1
2195
2199
2196 largefiles to upload:
2200 largefiles to upload:
2197 b
2201 b
2198
2202
2199
2203
2200 $ cd ..
2204 $ cd ..
2201
2205
2202 merge action 'd' for 'local renamed directory to d2/g' which has no filename
2206 merge action 'd' for 'local renamed directory to d2/g' which has no filename
2203
2207
2204 $ hg init merge-action
2208 $ hg init merge-action
2205 $ cd merge-action
2209 $ cd merge-action
2206 $ touch l
2210 $ touch l
2207 $ hg add --large l
2211 $ hg add --large l
2208 $ mkdir d1
2212 $ mkdir d1
2209 $ touch d1/f
2213 $ touch d1/f
2210 $ hg ci -Aqm0
2214 $ hg ci -Aqm0
2211 Invoking status precommit hook
2215 Invoking status precommit hook
2212 A d1/f
2216 A d1/f
2213 A l
2217 A l
2214 $ echo > d1/f
2218 $ echo > d1/f
2215 $ touch d1/g
2219 $ touch d1/g
2216 $ hg ci -Aqm1
2220 $ hg ci -Aqm1
2217 Invoking status precommit hook
2221 Invoking status precommit hook
2218 M d1/f
2222 M d1/f
2219 A d1/g
2223 A d1/g
2220 $ hg up -qr0
2224 $ hg up -qr0
2221 $ hg mv d1 d2
2225 $ hg mv d1 d2
2222 moving d1/f to d2/f (glob)
2226 moving d1/f to d2/f (glob)
2223 $ hg ci -qm2
2227 $ hg ci -qm2
2224 Invoking status precommit hook
2228 Invoking status precommit hook
2225 A d2/f
2229 A d2/f
2226 R d1/f
2230 R d1/f
2227 $ hg merge
2231 $ hg merge
2228 merging d2/f and d1/f to d2/f
2232 merging d2/f and d1/f to d2/f
2229 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
2233 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
2230 (branch merge, don't forget to commit)
2234 (branch merge, don't forget to commit)
2231 getting changed largefiles
2235 getting changed largefiles
2232 0 largefiles updated, 0 removed
2236 0 largefiles updated, 0 removed
2233 $ cd ..
2237 $ cd ..
2234
2238
2235
2239
2236 Merge conflicts:
2240 Merge conflicts:
2237
2241
2238 $ hg init merge
2242 $ hg init merge
2239 $ cd merge
2243 $ cd merge
2240 $ echo 0 > f-different
2244 $ echo 0 > f-different
2241 $ echo 0 > f-same
2245 $ echo 0 > f-same
2242 $ echo 0 > f-unchanged-1
2246 $ echo 0 > f-unchanged-1
2243 $ echo 0 > f-unchanged-2
2247 $ echo 0 > f-unchanged-2
2244 $ hg add --large *
2248 $ hg add --large *
2245 $ hg ci -m0
2249 $ hg ci -m0
2246 Invoking status precommit hook
2250 Invoking status precommit hook
2247 A f-different
2251 A f-different
2248 A f-same
2252 A f-same
2249 A f-unchanged-1
2253 A f-unchanged-1
2250 A f-unchanged-2
2254 A f-unchanged-2
2251 $ echo tmp1 > f-unchanged-1
2255 $ echo tmp1 > f-unchanged-1
2252 $ echo tmp1 > f-unchanged-2
2256 $ echo tmp1 > f-unchanged-2
2253 $ echo tmp1 > f-same
2257 $ echo tmp1 > f-same
2254 $ hg ci -m1
2258 $ hg ci -m1
2255 Invoking status precommit hook
2259 Invoking status precommit hook
2256 M f-same
2260 M f-same
2257 M f-unchanged-1
2261 M f-unchanged-1
2258 M f-unchanged-2
2262 M f-unchanged-2
2259 $ echo 2 > f-different
2263 $ echo 2 > f-different
2260 $ echo 0 > f-unchanged-1
2264 $ echo 0 > f-unchanged-1
2261 $ echo 1 > f-unchanged-2
2265 $ echo 1 > f-unchanged-2
2262 $ echo 1 > f-same
2266 $ echo 1 > f-same
2263 $ hg ci -m2
2267 $ hg ci -m2
2264 Invoking status precommit hook
2268 Invoking status precommit hook
2265 M f-different
2269 M f-different
2266 M f-same
2270 M f-same
2267 M f-unchanged-1
2271 M f-unchanged-1
2268 M f-unchanged-2
2272 M f-unchanged-2
2269 $ hg up -qr0
2273 $ hg up -qr0
2270 $ echo tmp2 > f-unchanged-1
2274 $ echo tmp2 > f-unchanged-1
2271 $ echo tmp2 > f-unchanged-2
2275 $ echo tmp2 > f-unchanged-2
2272 $ echo tmp2 > f-same
2276 $ echo tmp2 > f-same
2273 $ hg ci -m3
2277 $ hg ci -m3
2274 Invoking status precommit hook
2278 Invoking status precommit hook
2275 M f-same
2279 M f-same
2276 M f-unchanged-1
2280 M f-unchanged-1
2277 M f-unchanged-2
2281 M f-unchanged-2
2278 created new head
2282 created new head
2279 $ echo 1 > f-different
2283 $ echo 1 > f-different
2280 $ echo 1 > f-unchanged-1
2284 $ echo 1 > f-unchanged-1
2281 $ echo 0 > f-unchanged-2
2285 $ echo 0 > f-unchanged-2
2282 $ echo 1 > f-same
2286 $ echo 1 > f-same
2283 $ hg ci -m4
2287 $ hg ci -m4
2284 Invoking status precommit hook
2288 Invoking status precommit hook
2285 M f-different
2289 M f-different
2286 M f-same
2290 M f-same
2287 M f-unchanged-1
2291 M f-unchanged-1
2288 M f-unchanged-2
2292 M f-unchanged-2
2289 $ hg merge
2293 $ hg merge
2290 largefile f-different has a merge conflict
2294 largefile f-different has a merge conflict
2291 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
2295 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
2292 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
2296 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
2293 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
2297 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
2294 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
2298 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
2295 (branch merge, don't forget to commit)
2299 (branch merge, don't forget to commit)
2296 getting changed largefiles
2300 getting changed largefiles
2297 1 largefiles updated, 0 removed
2301 1 largefiles updated, 0 removed
2298 $ cat f-different
2302 $ cat f-different
2299 1
2303 1
2300 $ cat f-same
2304 $ cat f-same
2301 1
2305 1
2302 $ cat f-unchanged-1
2306 $ cat f-unchanged-1
2303 1
2307 1
2304 $ cat f-unchanged-2
2308 $ cat f-unchanged-2
2305 1
2309 1
2306 $ cd ..
2310 $ cd ..
2307
2311
2308 Check whether "largefiles" feature is supported only in repositories
2312 Check whether "largefiles" feature is supported only in repositories
2309 enabling largefiles extension.
2313 enabling largefiles extension.
2310
2314
2311 $ mkdir individualenabling
2315 $ mkdir individualenabling
2312 $ cd individualenabling
2316 $ cd individualenabling
2313
2317
2314 $ hg init enabledlocally
2318 $ hg init enabledlocally
2315 $ echo large > enabledlocally/large
2319 $ echo large > enabledlocally/large
2316 $ hg -R enabledlocally add --large enabledlocally/large
2320 $ hg -R enabledlocally add --large enabledlocally/large
2317 $ hg -R enabledlocally commit -m '#0'
2321 $ hg -R enabledlocally commit -m '#0'
2318 Invoking status precommit hook
2322 Invoking status precommit hook
2319 A large
2323 A large
2320
2324
2321 $ hg init notenabledlocally
2325 $ hg init notenabledlocally
2322 $ echo large > notenabledlocally/large
2326 $ echo large > notenabledlocally/large
2323 $ hg -R notenabledlocally add --large notenabledlocally/large
2327 $ hg -R notenabledlocally add --large notenabledlocally/large
2324 $ hg -R notenabledlocally commit -m '#0'
2328 $ hg -R notenabledlocally commit -m '#0'
2325 Invoking status precommit hook
2329 Invoking status precommit hook
2326 A large
2330 A large
2327
2331
2328 $ cat >> $HGRCPATH <<EOF
2332 $ cat >> $HGRCPATH <<EOF
2329 > [extensions]
2333 > [extensions]
2330 > # disable globally
2334 > # disable globally
2331 > largefiles=!
2335 > largefiles=!
2332 > EOF
2336 > EOF
2333 $ cat >> enabledlocally/.hg/hgrc <<EOF
2337 $ cat >> enabledlocally/.hg/hgrc <<EOF
2334 > [extensions]
2338 > [extensions]
2335 > # enable locally
2339 > # enable locally
2336 > largefiles=
2340 > largefiles=
2337 > EOF
2341 > EOF
2338 $ hg -R enabledlocally root
2342 $ hg -R enabledlocally root
2339 $TESTTMP/individualenabling/enabledlocally (glob)
2343 $TESTTMP/individualenabling/enabledlocally (glob)
2340 $ hg -R notenabledlocally root
2344 $ hg -R notenabledlocally root
2341 abort: repository requires features unknown to this Mercurial: largefiles!
2345 abort: repository requires features unknown to this Mercurial: largefiles!
2342 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
2346 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
2343 [255]
2347 [255]
2344
2348
2345 $ hg init push-dst
2349 $ hg init push-dst
2346 $ hg -R enabledlocally push push-dst
2350 $ hg -R enabledlocally push push-dst
2347 pushing to push-dst
2351 pushing to push-dst
2348 abort: required features are not supported in the destination: largefiles
2352 abort: required features are not supported in the destination: largefiles
2349 [255]
2353 [255]
2350
2354
2351 $ hg init pull-src
2355 $ hg init pull-src
2352 $ hg -R pull-src pull enabledlocally
2356 $ hg -R pull-src pull enabledlocally
2353 pulling from enabledlocally
2357 pulling from enabledlocally
2354 abort: required features are not supported in the destination: largefiles
2358 abort: required features are not supported in the destination: largefiles
2355 [255]
2359 [255]
2356
2360
2357 $ hg clone enabledlocally clone-dst
2361 $ hg clone enabledlocally clone-dst
2358 abort: repository requires features unknown to this Mercurial: largefiles!
2362 abort: repository requires features unknown to this Mercurial: largefiles!
2359 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
2363 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
2360 [255]
2364 [255]
2361 $ test -d clone-dst
2365 $ test -d clone-dst
2362 [1]
2366 [1]
2363 $ hg clone --pull enabledlocally clone-pull-dst
2367 $ hg clone --pull enabledlocally clone-pull-dst
2364 abort: required features are not supported in the destination: largefiles
2368 abort: required features are not supported in the destination: largefiles
2365 [255]
2369 [255]
2366 $ test -d clone-pull-dst
2370 $ test -d clone-pull-dst
2367 [1]
2371 [1]
2368
2372
2369 #if serve
2373 #if serve
2370
2374
2371 Test largefiles specific peer setup, when largefiles is enabled
2375 Test largefiles specific peer setup, when largefiles is enabled
2372 locally (issue4109)
2376 locally (issue4109)
2373
2377
2374 $ hg showconfig extensions | grep largefiles
2378 $ hg showconfig extensions | grep largefiles
2375 extensions.largefiles=!
2379 extensions.largefiles=!
2376 $ mkdir -p $TESTTMP/individualenabling/usercache
2380 $ mkdir -p $TESTTMP/individualenabling/usercache
2377
2381
2378 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
2382 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
2379 $ cat hg.pid >> $DAEMON_PIDS
2383 $ cat hg.pid >> $DAEMON_PIDS
2380
2384
2381 $ hg init pull-dst
2385 $ hg init pull-dst
2382 $ cat > pull-dst/.hg/hgrc <<EOF
2386 $ cat > pull-dst/.hg/hgrc <<EOF
2383 > [extensions]
2387 > [extensions]
2384 > # enable locally
2388 > # enable locally
2385 > largefiles=
2389 > largefiles=
2386 > [largefiles]
2390 > [largefiles]
2387 > # ignore system cache to force largefiles specific wire proto access
2391 > # ignore system cache to force largefiles specific wire proto access
2388 > usercache=$TESTTMP/individualenabling/usercache
2392 > usercache=$TESTTMP/individualenabling/usercache
2389 > EOF
2393 > EOF
2390 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
2394 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
2391
2395
2392 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
2396 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
2393 #endif
2397 #endif
2394
2398
2395 $ cd ..
2399 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now