##// END OF EJS Templates
largefiles: pay attention to dropped standin files when updating largefiles...
Matt Harbison -
r35175:b175e54c stable
parent child Browse files
Show More
@@ -1,578 +1,592
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 from __future__ import absolute_import
10 from __future__ import absolute_import
11
11
12 import errno
12 import errno
13 import hashlib
13 import hashlib
14 import os
14 import os
15 import shutil
15 import shutil
16
16
17 from mercurial.i18n import _
17 from mercurial.i18n import _
18
18
19 from mercurial import (
19 from mercurial import (
20 cmdutil,
20 cmdutil,
21 context,
21 context,
22 error,
22 error,
23 hg,
23 hg,
24 lock,
24 lock,
25 match as matchmod,
25 match as matchmod,
26 node,
26 node,
27 registrar,
27 registrar,
28 scmutil,
28 scmutil,
29 util,
29 util,
30 )
30 )
31
31
32 from ..convert import (
32 from ..convert import (
33 convcmd,
33 convcmd,
34 filemap,
34 filemap,
35 )
35 )
36
36
37 from . import (
37 from . import (
38 lfutil,
38 lfutil,
39 storefactory
39 storefactory
40 )
40 )
41
41
42 release = lock.release
42 release = lock.release
43
43
44 # -- Commands ----------------------------------------------------------
44 # -- Commands ----------------------------------------------------------
45
45
46 cmdtable = {}
46 cmdtable = {}
47 command = registrar.command(cmdtable)
47 command = registrar.command(cmdtable)
48
48
49 @command('lfconvert',
49 @command('lfconvert',
50 [('s', 'size', '',
50 [('s', 'size', '',
51 _('minimum size (MB) for files to be converted as largefiles'), 'SIZE'),
51 _('minimum size (MB) for files to be converted as largefiles'), 'SIZE'),
52 ('', 'to-normal', False,
52 ('', 'to-normal', False,
53 _('convert from a largefiles repo to a normal repo')),
53 _('convert from a largefiles repo to a normal repo')),
54 ],
54 ],
55 _('hg lfconvert SOURCE DEST [FILE ...]'),
55 _('hg lfconvert SOURCE DEST [FILE ...]'),
56 norepo=True,
56 norepo=True,
57 inferrepo=True)
57 inferrepo=True)
58 def lfconvert(ui, src, dest, *pats, **opts):
58 def lfconvert(ui, src, dest, *pats, **opts):
59 '''convert a normal repository to a largefiles repository
59 '''convert a normal repository to a largefiles repository
60
60
61 Convert repository SOURCE to a new repository DEST, identical to
61 Convert repository SOURCE to a new repository DEST, identical to
62 SOURCE except that certain files will be converted as largefiles:
62 SOURCE except that certain files will be converted as largefiles:
63 specifically, any file that matches any PATTERN *or* whose size is
63 specifically, any file that matches any PATTERN *or* whose size is
64 above the minimum size threshold is converted as a largefile. The
64 above the minimum size threshold is converted as a largefile. The
65 size used to determine whether or not to track a file as a
65 size used to determine whether or not to track a file as a
66 largefile is the size of the first version of the file. The
66 largefile is the size of the first version of the file. The
67 minimum size can be specified either with --size or in
67 minimum size can be specified either with --size or in
68 configuration as ``largefiles.size``.
68 configuration as ``largefiles.size``.
69
69
70 After running this command you will need to make sure that
70 After running this command you will need to make sure that
71 largefiles is enabled anywhere you intend to push the new
71 largefiles is enabled anywhere you intend to push the new
72 repository.
72 repository.
73
73
74 Use --to-normal to convert largefiles back to normal files; after
74 Use --to-normal to convert largefiles back to normal files; after
75 this, the DEST repository can be used without largefiles at all.'''
75 this, the DEST repository can be used without largefiles at all.'''
76
76
77 if opts['to_normal']:
77 if opts['to_normal']:
78 tolfile = False
78 tolfile = False
79 else:
79 else:
80 tolfile = True
80 tolfile = True
81 size = lfutil.getminsize(ui, True, opts.get('size'), default=None)
81 size = lfutil.getminsize(ui, True, opts.get('size'), default=None)
82
82
83 if not hg.islocal(src):
83 if not hg.islocal(src):
84 raise error.Abort(_('%s is not a local Mercurial repo') % src)
84 raise error.Abort(_('%s is not a local Mercurial repo') % src)
85 if not hg.islocal(dest):
85 if not hg.islocal(dest):
86 raise error.Abort(_('%s is not a local Mercurial repo') % dest)
86 raise error.Abort(_('%s is not a local Mercurial repo') % dest)
87
87
88 rsrc = hg.repository(ui, src)
88 rsrc = hg.repository(ui, src)
89 ui.status(_('initializing destination %s\n') % dest)
89 ui.status(_('initializing destination %s\n') % dest)
90 rdst = hg.repository(ui, dest, create=True)
90 rdst = hg.repository(ui, dest, create=True)
91
91
92 success = False
92 success = False
93 dstwlock = dstlock = None
93 dstwlock = dstlock = None
94 try:
94 try:
95 # Get a list of all changesets in the source. The easy way to do this
95 # Get a list of all changesets in the source. The easy way to do this
96 # is to simply walk the changelog, using changelog.nodesbetween().
96 # is to simply walk the changelog, using changelog.nodesbetween().
97 # Take a look at mercurial/revlog.py:639 for more details.
97 # Take a look at mercurial/revlog.py:639 for more details.
98 # Use a generator instead of a list to decrease memory usage
98 # Use a generator instead of a list to decrease memory usage
99 ctxs = (rsrc[ctx] for ctx in rsrc.changelog.nodesbetween(None,
99 ctxs = (rsrc[ctx] for ctx in rsrc.changelog.nodesbetween(None,
100 rsrc.heads())[0])
100 rsrc.heads())[0])
101 revmap = {node.nullid: node.nullid}
101 revmap = {node.nullid: node.nullid}
102 if tolfile:
102 if tolfile:
103 # Lock destination to prevent modification while it is converted to.
103 # Lock destination to prevent modification while it is converted to.
104 # Don't need to lock src because we are just reading from its
104 # Don't need to lock src because we are just reading from its
105 # history which can't change.
105 # history which can't change.
106 dstwlock = rdst.wlock()
106 dstwlock = rdst.wlock()
107 dstlock = rdst.lock()
107 dstlock = rdst.lock()
108
108
109 lfiles = set()
109 lfiles = set()
110 normalfiles = set()
110 normalfiles = set()
111 if not pats:
111 if not pats:
112 pats = ui.configlist(lfutil.longname, 'patterns')
112 pats = ui.configlist(lfutil.longname, 'patterns')
113 if pats:
113 if pats:
114 matcher = matchmod.match(rsrc.root, '', list(pats))
114 matcher = matchmod.match(rsrc.root, '', list(pats))
115 else:
115 else:
116 matcher = None
116 matcher = None
117
117
118 lfiletohash = {}
118 lfiletohash = {}
119 for ctx in ctxs:
119 for ctx in ctxs:
120 ui.progress(_('converting revisions'), ctx.rev(),
120 ui.progress(_('converting revisions'), ctx.rev(),
121 unit=_('revisions'), total=rsrc['tip'].rev())
121 unit=_('revisions'), total=rsrc['tip'].rev())
122 _lfconvert_addchangeset(rsrc, rdst, ctx, revmap,
122 _lfconvert_addchangeset(rsrc, rdst, ctx, revmap,
123 lfiles, normalfiles, matcher, size, lfiletohash)
123 lfiles, normalfiles, matcher, size, lfiletohash)
124 ui.progress(_('converting revisions'), None)
124 ui.progress(_('converting revisions'), None)
125
125
126 if rdst.wvfs.exists(lfutil.shortname):
126 if rdst.wvfs.exists(lfutil.shortname):
127 rdst.wvfs.rmtree(lfutil.shortname)
127 rdst.wvfs.rmtree(lfutil.shortname)
128
128
129 for f in lfiletohash.keys():
129 for f in lfiletohash.keys():
130 if rdst.wvfs.isfile(f):
130 if rdst.wvfs.isfile(f):
131 rdst.wvfs.unlink(f)
131 rdst.wvfs.unlink(f)
132 try:
132 try:
133 rdst.wvfs.removedirs(rdst.wvfs.dirname(f))
133 rdst.wvfs.removedirs(rdst.wvfs.dirname(f))
134 except OSError:
134 except OSError:
135 pass
135 pass
136
136
137 # If there were any files converted to largefiles, add largefiles
137 # If there were any files converted to largefiles, add largefiles
138 # to the destination repository's requirements.
138 # to the destination repository's requirements.
139 if lfiles:
139 if lfiles:
140 rdst.requirements.add('largefiles')
140 rdst.requirements.add('largefiles')
141 rdst._writerequirements()
141 rdst._writerequirements()
142 else:
142 else:
143 class lfsource(filemap.filemap_source):
143 class lfsource(filemap.filemap_source):
144 def __init__(self, ui, source):
144 def __init__(self, ui, source):
145 super(lfsource, self).__init__(ui, source, None)
145 super(lfsource, self).__init__(ui, source, None)
146 self.filemapper.rename[lfutil.shortname] = '.'
146 self.filemapper.rename[lfutil.shortname] = '.'
147
147
148 def getfile(self, name, rev):
148 def getfile(self, name, rev):
149 realname, realrev = rev
149 realname, realrev = rev
150 f = super(lfsource, self).getfile(name, rev)
150 f = super(lfsource, self).getfile(name, rev)
151
151
152 if (not realname.startswith(lfutil.shortnameslash)
152 if (not realname.startswith(lfutil.shortnameslash)
153 or f[0] is None):
153 or f[0] is None):
154 return f
154 return f
155
155
156 # Substitute in the largefile data for the hash
156 # Substitute in the largefile data for the hash
157 hash = f[0].strip()
157 hash = f[0].strip()
158 path = lfutil.findfile(rsrc, hash)
158 path = lfutil.findfile(rsrc, hash)
159
159
160 if path is None:
160 if path is None:
161 raise error.Abort(_("missing largefile for '%s' in %s")
161 raise error.Abort(_("missing largefile for '%s' in %s")
162 % (realname, realrev))
162 % (realname, realrev))
163 return util.readfile(path), f[1]
163 return util.readfile(path), f[1]
164
164
165 class converter(convcmd.converter):
165 class converter(convcmd.converter):
166 def __init__(self, ui, source, dest, revmapfile, opts):
166 def __init__(self, ui, source, dest, revmapfile, opts):
167 src = lfsource(ui, source)
167 src = lfsource(ui, source)
168
168
169 super(converter, self).__init__(ui, src, dest, revmapfile,
169 super(converter, self).__init__(ui, src, dest, revmapfile,
170 opts)
170 opts)
171
171
172 found, missing = downloadlfiles(ui, rsrc)
172 found, missing = downloadlfiles(ui, rsrc)
173 if missing != 0:
173 if missing != 0:
174 raise error.Abort(_("all largefiles must be present locally"))
174 raise error.Abort(_("all largefiles must be present locally"))
175
175
176 orig = convcmd.converter
176 orig = convcmd.converter
177 convcmd.converter = converter
177 convcmd.converter = converter
178
178
179 try:
179 try:
180 convcmd.convert(ui, src, dest)
180 convcmd.convert(ui, src, dest)
181 finally:
181 finally:
182 convcmd.converter = orig
182 convcmd.converter = orig
183 success = True
183 success = True
184 finally:
184 finally:
185 if tolfile:
185 if tolfile:
186 rdst.dirstate.clear()
186 rdst.dirstate.clear()
187 release(dstlock, dstwlock)
187 release(dstlock, dstwlock)
188 if not success:
188 if not success:
189 # we failed, remove the new directory
189 # we failed, remove the new directory
190 shutil.rmtree(rdst.root)
190 shutil.rmtree(rdst.root)
191
191
192 def _lfconvert_addchangeset(rsrc, rdst, ctx, revmap, lfiles, normalfiles,
192 def _lfconvert_addchangeset(rsrc, rdst, ctx, revmap, lfiles, normalfiles,
193 matcher, size, lfiletohash):
193 matcher, size, lfiletohash):
194 # Convert src parents to dst parents
194 # Convert src parents to dst parents
195 parents = _convertparents(ctx, revmap)
195 parents = _convertparents(ctx, revmap)
196
196
197 # Generate list of changed files
197 # Generate list of changed files
198 files = _getchangedfiles(ctx, parents)
198 files = _getchangedfiles(ctx, parents)
199
199
200 dstfiles = []
200 dstfiles = []
201 for f in files:
201 for f in files:
202 if f not in lfiles and f not in normalfiles:
202 if f not in lfiles and f not in normalfiles:
203 islfile = _islfile(f, ctx, matcher, size)
203 islfile = _islfile(f, ctx, matcher, size)
204 # If this file was renamed or copied then copy
204 # If this file was renamed or copied then copy
205 # the largefile-ness of its predecessor
205 # the largefile-ness of its predecessor
206 if f in ctx.manifest():
206 if f in ctx.manifest():
207 fctx = ctx.filectx(f)
207 fctx = ctx.filectx(f)
208 renamed = fctx.renamed()
208 renamed = fctx.renamed()
209 renamedlfile = renamed and renamed[0] in lfiles
209 renamedlfile = renamed and renamed[0] in lfiles
210 islfile |= renamedlfile
210 islfile |= renamedlfile
211 if 'l' in fctx.flags():
211 if 'l' in fctx.flags():
212 if renamedlfile:
212 if renamedlfile:
213 raise error.Abort(
213 raise error.Abort(
214 _('renamed/copied largefile %s becomes symlink')
214 _('renamed/copied largefile %s becomes symlink')
215 % f)
215 % f)
216 islfile = False
216 islfile = False
217 if islfile:
217 if islfile:
218 lfiles.add(f)
218 lfiles.add(f)
219 else:
219 else:
220 normalfiles.add(f)
220 normalfiles.add(f)
221
221
222 if f in lfiles:
222 if f in lfiles:
223 fstandin = lfutil.standin(f)
223 fstandin = lfutil.standin(f)
224 dstfiles.append(fstandin)
224 dstfiles.append(fstandin)
225 # largefile in manifest if it has not been removed/renamed
225 # largefile in manifest if it has not been removed/renamed
226 if f in ctx.manifest():
226 if f in ctx.manifest():
227 fctx = ctx.filectx(f)
227 fctx = ctx.filectx(f)
228 if 'l' in fctx.flags():
228 if 'l' in fctx.flags():
229 renamed = fctx.renamed()
229 renamed = fctx.renamed()
230 if renamed and renamed[0] in lfiles:
230 if renamed and renamed[0] in lfiles:
231 raise error.Abort(_('largefile %s becomes symlink') % f)
231 raise error.Abort(_('largefile %s becomes symlink') % f)
232
232
233 # largefile was modified, update standins
233 # largefile was modified, update standins
234 m = hashlib.sha1('')
234 m = hashlib.sha1('')
235 m.update(ctx[f].data())
235 m.update(ctx[f].data())
236 hash = m.hexdigest()
236 hash = m.hexdigest()
237 if f not in lfiletohash or lfiletohash[f] != hash:
237 if f not in lfiletohash or lfiletohash[f] != hash:
238 rdst.wwrite(f, ctx[f].data(), ctx[f].flags())
238 rdst.wwrite(f, ctx[f].data(), ctx[f].flags())
239 executable = 'x' in ctx[f].flags()
239 executable = 'x' in ctx[f].flags()
240 lfutil.writestandin(rdst, fstandin, hash,
240 lfutil.writestandin(rdst, fstandin, hash,
241 executable)
241 executable)
242 lfiletohash[f] = hash
242 lfiletohash[f] = hash
243 else:
243 else:
244 # normal file
244 # normal file
245 dstfiles.append(f)
245 dstfiles.append(f)
246
246
247 def getfilectx(repo, memctx, f):
247 def getfilectx(repo, memctx, f):
248 srcfname = lfutil.splitstandin(f)
248 srcfname = lfutil.splitstandin(f)
249 if srcfname is not None:
249 if srcfname is not None:
250 # if the file isn't in the manifest then it was removed
250 # if the file isn't in the manifest then it was removed
251 # or renamed, return None to indicate this
251 # or renamed, return None to indicate this
252 try:
252 try:
253 fctx = ctx.filectx(srcfname)
253 fctx = ctx.filectx(srcfname)
254 except error.LookupError:
254 except error.LookupError:
255 return None
255 return None
256 renamed = fctx.renamed()
256 renamed = fctx.renamed()
257 if renamed:
257 if renamed:
258 # standin is always a largefile because largefile-ness
258 # standin is always a largefile because largefile-ness
259 # doesn't change after rename or copy
259 # doesn't change after rename or copy
260 renamed = lfutil.standin(renamed[0])
260 renamed = lfutil.standin(renamed[0])
261
261
262 return context.memfilectx(repo, f, lfiletohash[srcfname] + '\n',
262 return context.memfilectx(repo, f, lfiletohash[srcfname] + '\n',
263 'l' in fctx.flags(), 'x' in fctx.flags(),
263 'l' in fctx.flags(), 'x' in fctx.flags(),
264 renamed)
264 renamed)
265 else:
265 else:
266 return _getnormalcontext(repo, ctx, f, revmap)
266 return _getnormalcontext(repo, ctx, f, revmap)
267
267
268 # Commit
268 # Commit
269 _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
269 _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap)
270
270
271 def _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap):
271 def _commitcontext(rdst, parents, ctx, dstfiles, getfilectx, revmap):
272 mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
272 mctx = context.memctx(rdst, parents, ctx.description(), dstfiles,
273 getfilectx, ctx.user(), ctx.date(), ctx.extra())
273 getfilectx, ctx.user(), ctx.date(), ctx.extra())
274 ret = rdst.commitctx(mctx)
274 ret = rdst.commitctx(mctx)
275 lfutil.copyalltostore(rdst, ret)
275 lfutil.copyalltostore(rdst, ret)
276 rdst.setparents(ret)
276 rdst.setparents(ret)
277 revmap[ctx.node()] = rdst.changelog.tip()
277 revmap[ctx.node()] = rdst.changelog.tip()
278
278
279 # Generate list of changed files
279 # Generate list of changed files
280 def _getchangedfiles(ctx, parents):
280 def _getchangedfiles(ctx, parents):
281 files = set(ctx.files())
281 files = set(ctx.files())
282 if node.nullid not in parents:
282 if node.nullid not in parents:
283 mc = ctx.manifest()
283 mc = ctx.manifest()
284 mp1 = ctx.parents()[0].manifest()
284 mp1 = ctx.parents()[0].manifest()
285 mp2 = ctx.parents()[1].manifest()
285 mp2 = ctx.parents()[1].manifest()
286 files |= (set(mp1) | set(mp2)) - set(mc)
286 files |= (set(mp1) | set(mp2)) - set(mc)
287 for f in mc:
287 for f in mc:
288 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None):
288 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None):
289 files.add(f)
289 files.add(f)
290 return files
290 return files
291
291
292 # Convert src parents to dst parents
292 # Convert src parents to dst parents
293 def _convertparents(ctx, revmap):
293 def _convertparents(ctx, revmap):
294 parents = []
294 parents = []
295 for p in ctx.parents():
295 for p in ctx.parents():
296 parents.append(revmap[p.node()])
296 parents.append(revmap[p.node()])
297 while len(parents) < 2:
297 while len(parents) < 2:
298 parents.append(node.nullid)
298 parents.append(node.nullid)
299 return parents
299 return parents
300
300
301 # Get memfilectx for a normal file
301 # Get memfilectx for a normal file
302 def _getnormalcontext(repo, ctx, f, revmap):
302 def _getnormalcontext(repo, ctx, f, revmap):
303 try:
303 try:
304 fctx = ctx.filectx(f)
304 fctx = ctx.filectx(f)
305 except error.LookupError:
305 except error.LookupError:
306 return None
306 return None
307 renamed = fctx.renamed()
307 renamed = fctx.renamed()
308 if renamed:
308 if renamed:
309 renamed = renamed[0]
309 renamed = renamed[0]
310
310
311 data = fctx.data()
311 data = fctx.data()
312 if f == '.hgtags':
312 if f == '.hgtags':
313 data = _converttags (repo.ui, revmap, data)
313 data = _converttags (repo.ui, revmap, data)
314 return context.memfilectx(repo, f, data, 'l' in fctx.flags(),
314 return context.memfilectx(repo, f, data, 'l' in fctx.flags(),
315 'x' in fctx.flags(), renamed)
315 'x' in fctx.flags(), renamed)
316
316
317 # Remap tag data using a revision map
317 # Remap tag data using a revision map
318 def _converttags(ui, revmap, data):
318 def _converttags(ui, revmap, data):
319 newdata = []
319 newdata = []
320 for line in data.splitlines():
320 for line in data.splitlines():
321 try:
321 try:
322 id, name = line.split(' ', 1)
322 id, name = line.split(' ', 1)
323 except ValueError:
323 except ValueError:
324 ui.warn(_('skipping incorrectly formatted tag %s\n')
324 ui.warn(_('skipping incorrectly formatted tag %s\n')
325 % line)
325 % line)
326 continue
326 continue
327 try:
327 try:
328 newid = node.bin(id)
328 newid = node.bin(id)
329 except TypeError:
329 except TypeError:
330 ui.warn(_('skipping incorrectly formatted id %s\n')
330 ui.warn(_('skipping incorrectly formatted id %s\n')
331 % id)
331 % id)
332 continue
332 continue
333 try:
333 try:
334 newdata.append('%s %s\n' % (node.hex(revmap[newid]),
334 newdata.append('%s %s\n' % (node.hex(revmap[newid]),
335 name))
335 name))
336 except KeyError:
336 except KeyError:
337 ui.warn(_('no mapping for id %s\n') % id)
337 ui.warn(_('no mapping for id %s\n') % id)
338 continue
338 continue
339 return ''.join(newdata)
339 return ''.join(newdata)
340
340
341 def _islfile(file, ctx, matcher, size):
341 def _islfile(file, ctx, matcher, size):
342 '''Return true if file should be considered a largefile, i.e.
342 '''Return true if file should be considered a largefile, i.e.
343 matcher matches it or it is larger than size.'''
343 matcher matches it or it is larger than size.'''
344 # never store special .hg* files as largefiles
344 # never store special .hg* files as largefiles
345 if file == '.hgtags' or file == '.hgignore' or file == '.hgsigs':
345 if file == '.hgtags' or file == '.hgignore' or file == '.hgsigs':
346 return False
346 return False
347 if matcher and matcher(file):
347 if matcher and matcher(file):
348 return True
348 return True
349 try:
349 try:
350 return ctx.filectx(file).size() >= size * 1024 * 1024
350 return ctx.filectx(file).size() >= size * 1024 * 1024
351 except error.LookupError:
351 except error.LookupError:
352 return False
352 return False
353
353
354 def uploadlfiles(ui, rsrc, rdst, files):
354 def uploadlfiles(ui, rsrc, rdst, files):
355 '''upload largefiles to the central store'''
355 '''upload largefiles to the central store'''
356
356
357 if not files:
357 if not files:
358 return
358 return
359
359
360 store = storefactory.openstore(rsrc, rdst, put=True)
360 store = storefactory.openstore(rsrc, rdst, put=True)
361
361
362 at = 0
362 at = 0
363 ui.debug("sending statlfile command for %d largefiles\n" % len(files))
363 ui.debug("sending statlfile command for %d largefiles\n" % len(files))
364 retval = store.exists(files)
364 retval = store.exists(files)
365 files = filter(lambda h: not retval[h], files)
365 files = filter(lambda h: not retval[h], files)
366 ui.debug("%d largefiles need to be uploaded\n" % len(files))
366 ui.debug("%d largefiles need to be uploaded\n" % len(files))
367
367
368 for hash in files:
368 for hash in files:
369 ui.progress(_('uploading largefiles'), at, unit=_('files'),
369 ui.progress(_('uploading largefiles'), at, unit=_('files'),
370 total=len(files))
370 total=len(files))
371 source = lfutil.findfile(rsrc, hash)
371 source = lfutil.findfile(rsrc, hash)
372 if not source:
372 if not source:
373 raise error.Abort(_('largefile %s missing from store'
373 raise error.Abort(_('largefile %s missing from store'
374 ' (needs to be uploaded)') % hash)
374 ' (needs to be uploaded)') % hash)
375 # XXX check for errors here
375 # XXX check for errors here
376 store.put(source, hash)
376 store.put(source, hash)
377 at += 1
377 at += 1
378 ui.progress(_('uploading largefiles'), None)
378 ui.progress(_('uploading largefiles'), None)
379
379
380 def verifylfiles(ui, repo, all=False, contents=False):
380 def verifylfiles(ui, repo, all=False, contents=False):
381 '''Verify that every largefile revision in the current changeset
381 '''Verify that every largefile revision in the current changeset
382 exists in the central store. With --contents, also verify that
382 exists in the central store. With --contents, also verify that
383 the contents of each local largefile file revision are correct (SHA-1 hash
383 the contents of each local largefile file revision are correct (SHA-1 hash
384 matches the revision ID). With --all, check every changeset in
384 matches the revision ID). With --all, check every changeset in
385 this repository.'''
385 this repository.'''
386 if all:
386 if all:
387 revs = repo.revs('all()')
387 revs = repo.revs('all()')
388 else:
388 else:
389 revs = ['.']
389 revs = ['.']
390
390
391 store = storefactory.openstore(repo)
391 store = storefactory.openstore(repo)
392 return store.verify(revs, contents=contents)
392 return store.verify(revs, contents=contents)
393
393
394 def cachelfiles(ui, repo, node, filelist=None):
394 def cachelfiles(ui, repo, node, filelist=None):
395 '''cachelfiles ensures that all largefiles needed by the specified revision
395 '''cachelfiles ensures that all largefiles needed by the specified revision
396 are present in the repository's largefile cache.
396 are present in the repository's largefile cache.
397
397
398 returns a tuple (cached, missing). cached is the list of files downloaded
398 returns a tuple (cached, missing). cached is the list of files downloaded
399 by this operation; missing is the list of files that were needed but could
399 by this operation; missing is the list of files that were needed but could
400 not be found.'''
400 not be found.'''
401 lfiles = lfutil.listlfiles(repo, node)
401 lfiles = lfutil.listlfiles(repo, node)
402 if filelist:
402 if filelist:
403 lfiles = set(lfiles) & set(filelist)
403 lfiles = set(lfiles) & set(filelist)
404 toget = []
404 toget = []
405
405
406 ctx = repo[node]
406 ctx = repo[node]
407 for lfile in lfiles:
407 for lfile in lfiles:
408 try:
408 try:
409 expectedhash = lfutil.readasstandin(ctx[lfutil.standin(lfile)])
409 expectedhash = lfutil.readasstandin(ctx[lfutil.standin(lfile)])
410 except IOError as err:
410 except IOError as err:
411 if err.errno == errno.ENOENT:
411 if err.errno == errno.ENOENT:
412 continue # node must be None and standin wasn't found in wctx
412 continue # node must be None and standin wasn't found in wctx
413 raise
413 raise
414 if not lfutil.findfile(repo, expectedhash):
414 if not lfutil.findfile(repo, expectedhash):
415 toget.append((lfile, expectedhash))
415 toget.append((lfile, expectedhash))
416
416
417 if toget:
417 if toget:
418 store = storefactory.openstore(repo)
418 store = storefactory.openstore(repo)
419 ret = store.get(toget)
419 ret = store.get(toget)
420 return ret
420 return ret
421
421
422 return ([], [])
422 return ([], [])
423
423
424 def downloadlfiles(ui, repo, rev=None):
424 def downloadlfiles(ui, repo, rev=None):
425 match = scmutil.match(repo[None], [repo.wjoin(lfutil.shortname)], {})
425 match = scmutil.match(repo[None], [repo.wjoin(lfutil.shortname)], {})
426 def prepare(ctx, fns):
426 def prepare(ctx, fns):
427 pass
427 pass
428 totalsuccess = 0
428 totalsuccess = 0
429 totalmissing = 0
429 totalmissing = 0
430 if rev != []: # walkchangerevs on empty list would return all revs
430 if rev != []: # walkchangerevs on empty list would return all revs
431 for ctx in cmdutil.walkchangerevs(repo, match, {'rev' : rev},
431 for ctx in cmdutil.walkchangerevs(repo, match, {'rev' : rev},
432 prepare):
432 prepare):
433 success, missing = cachelfiles(ui, repo, ctx.node())
433 success, missing = cachelfiles(ui, repo, ctx.node())
434 totalsuccess += len(success)
434 totalsuccess += len(success)
435 totalmissing += len(missing)
435 totalmissing += len(missing)
436 ui.status(_("%d additional largefiles cached\n") % totalsuccess)
436 ui.status(_("%d additional largefiles cached\n") % totalsuccess)
437 if totalmissing > 0:
437 if totalmissing > 0:
438 ui.status(_("%d largefiles failed to download\n") % totalmissing)
438 ui.status(_("%d largefiles failed to download\n") % totalmissing)
439 return totalsuccess, totalmissing
439 return totalsuccess, totalmissing
440
440
441 def updatelfiles(ui, repo, filelist=None, printmessage=None,
441 def updatelfiles(ui, repo, filelist=None, printmessage=None,
442 normallookup=False):
442 normallookup=False):
443 '''Update largefiles according to standins in the working directory
443 '''Update largefiles according to standins in the working directory
444
444
445 If ``printmessage`` is other than ``None``, it means "print (or
445 If ``printmessage`` is other than ``None``, it means "print (or
446 ignore, for false) message forcibly".
446 ignore, for false) message forcibly".
447 '''
447 '''
448 statuswriter = lfutil.getstatuswriter(ui, repo, printmessage)
448 statuswriter = lfutil.getstatuswriter(ui, repo, printmessage)
449 with repo.wlock():
449 with repo.wlock():
450 lfdirstate = lfutil.openlfdirstate(ui, repo)
450 lfdirstate = lfutil.openlfdirstate(ui, repo)
451 lfiles = set(lfutil.listlfiles(repo)) | set(lfdirstate)
451 lfiles = set(lfutil.listlfiles(repo)) | set(lfdirstate)
452
452
453 if filelist is not None:
453 if filelist is not None:
454 filelist = set(filelist)
454 filelist = set(filelist)
455 lfiles = [f for f in lfiles if f in filelist]
455 lfiles = [f for f in lfiles if f in filelist]
456
456
457 update = {}
457 update = {}
458 dropped = set()
458 updated, removed = 0, 0
459 updated, removed = 0, 0
459 wvfs = repo.wvfs
460 wvfs = repo.wvfs
460 wctx = repo[None]
461 wctx = repo[None]
461 for lfile in lfiles:
462 for lfile in lfiles:
462 rellfile = lfile
463 rellfile = lfile
463 rellfileorig = os.path.relpath(
464 rellfileorig = os.path.relpath(
464 scmutil.origpath(ui, repo, wvfs.join(rellfile)),
465 scmutil.origpath(ui, repo, wvfs.join(rellfile)),
465 start=repo.root)
466 start=repo.root)
466 relstandin = lfutil.standin(lfile)
467 relstandin = lfutil.standin(lfile)
467 relstandinorig = os.path.relpath(
468 relstandinorig = os.path.relpath(
468 scmutil.origpath(ui, repo, wvfs.join(relstandin)),
469 scmutil.origpath(ui, repo, wvfs.join(relstandin)),
469 start=repo.root)
470 start=repo.root)
470 if wvfs.exists(relstandin):
471 if wvfs.exists(relstandin):
471 if (wvfs.exists(relstandinorig) and
472 if (wvfs.exists(relstandinorig) and
472 wvfs.exists(rellfile)):
473 wvfs.exists(rellfile)):
473 shutil.copyfile(wvfs.join(rellfile),
474 shutil.copyfile(wvfs.join(rellfile),
474 wvfs.join(rellfileorig))
475 wvfs.join(rellfileorig))
475 wvfs.unlinkpath(relstandinorig)
476 wvfs.unlinkpath(relstandinorig)
476 expecthash = lfutil.readasstandin(wctx[relstandin])
477 expecthash = lfutil.readasstandin(wctx[relstandin])
477 if expecthash != '':
478 if expecthash != '':
478 if lfile not in wctx: # not switched to normal file
479 if lfile not in wctx: # not switched to normal file
479 wvfs.unlinkpath(rellfile, ignoremissing=True)
480 if repo.dirstate[relstandin] != '?':
481 wvfs.unlinkpath(rellfile, ignoremissing=True)
482 else:
483 dropped.add(rellfile)
484
480 # use normallookup() to allocate an entry in largefiles
485 # use normallookup() to allocate an entry in largefiles
481 # dirstate to prevent lfilesrepo.status() from reporting
486 # dirstate to prevent lfilesrepo.status() from reporting
482 # missing files as removed.
487 # missing files as removed.
483 lfdirstate.normallookup(lfile)
488 lfdirstate.normallookup(lfile)
484 update[lfile] = expecthash
489 update[lfile] = expecthash
485 else:
490 else:
486 # Remove lfiles for which the standin is deleted, unless the
491 # Remove lfiles for which the standin is deleted, unless the
487 # lfile is added to the repository again. This happens when a
492 # lfile is added to the repository again. This happens when a
488 # largefile is converted back to a normal file: the standin
493 # largefile is converted back to a normal file: the standin
489 # disappears, but a new (normal) file appears as the lfile.
494 # disappears, but a new (normal) file appears as the lfile.
490 if (wvfs.exists(rellfile) and
495 if (wvfs.exists(rellfile) and
491 repo.dirstate.normalize(lfile) not in wctx):
496 repo.dirstate.normalize(lfile) not in wctx):
492 wvfs.unlinkpath(rellfile)
497 wvfs.unlinkpath(rellfile)
493 removed += 1
498 removed += 1
494
499
495 # largefile processing might be slow and be interrupted - be prepared
500 # largefile processing might be slow and be interrupted - be prepared
496 lfdirstate.write()
501 lfdirstate.write()
497
502
498 if lfiles:
503 if lfiles:
504 lfiles = [f for f in lfiles if f not in dropped]
505
506 for f in dropped:
507 repo.wvfs.unlinkpath(lfutil.standin(f))
508
509 # This needs to happen for dropped files, otherwise they stay in
510 # the M state.
511 lfutil.synclfdirstate(repo, lfdirstate, f, normallookup)
512
499 statuswriter(_('getting changed largefiles\n'))
513 statuswriter(_('getting changed largefiles\n'))
500 cachelfiles(ui, repo, None, lfiles)
514 cachelfiles(ui, repo, None, lfiles)
501
515
502 for lfile in lfiles:
516 for lfile in lfiles:
503 update1 = 0
517 update1 = 0
504
518
505 expecthash = update.get(lfile)
519 expecthash = update.get(lfile)
506 if expecthash:
520 if expecthash:
507 if not lfutil.copyfromcache(repo, expecthash, lfile):
521 if not lfutil.copyfromcache(repo, expecthash, lfile):
508 # failed ... but already removed and set to normallookup
522 # failed ... but already removed and set to normallookup
509 continue
523 continue
510 # Synchronize largefile dirstate to the last modified
524 # Synchronize largefile dirstate to the last modified
511 # time of the file
525 # time of the file
512 lfdirstate.normal(lfile)
526 lfdirstate.normal(lfile)
513 update1 = 1
527 update1 = 1
514
528
515 # copy the exec mode of largefile standin from the repository's
529 # copy the exec mode of largefile standin from the repository's
516 # dirstate to its state in the lfdirstate.
530 # dirstate to its state in the lfdirstate.
517 rellfile = lfile
531 rellfile = lfile
518 relstandin = lfutil.standin(lfile)
532 relstandin = lfutil.standin(lfile)
519 if wvfs.exists(relstandin):
533 if wvfs.exists(relstandin):
520 # exec is decided by the users permissions using mask 0o100
534 # exec is decided by the users permissions using mask 0o100
521 standinexec = wvfs.stat(relstandin).st_mode & 0o100
535 standinexec = wvfs.stat(relstandin).st_mode & 0o100
522 st = wvfs.stat(rellfile)
536 st = wvfs.stat(rellfile)
523 mode = st.st_mode
537 mode = st.st_mode
524 if standinexec != mode & 0o100:
538 if standinexec != mode & 0o100:
525 # first remove all X bits, then shift all R bits to X
539 # first remove all X bits, then shift all R bits to X
526 mode &= ~0o111
540 mode &= ~0o111
527 if standinexec:
541 if standinexec:
528 mode |= (mode >> 2) & 0o111 & ~util.umask
542 mode |= (mode >> 2) & 0o111 & ~util.umask
529 wvfs.chmod(rellfile, mode)
543 wvfs.chmod(rellfile, mode)
530 update1 = 1
544 update1 = 1
531
545
532 updated += update1
546 updated += update1
533
547
534 lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup)
548 lfutil.synclfdirstate(repo, lfdirstate, lfile, normallookup)
535
549
536 lfdirstate.write()
550 lfdirstate.write()
537 if lfiles:
551 if lfiles:
538 statuswriter(_('%d largefiles updated, %d removed\n') % (updated,
552 statuswriter(_('%d largefiles updated, %d removed\n') % (updated,
539 removed))
553 removed))
540
554
541 @command('lfpull',
555 @command('lfpull',
542 [('r', 'rev', [], _('pull largefiles for these revisions'))
556 [('r', 'rev', [], _('pull largefiles for these revisions'))
543 ] + cmdutil.remoteopts,
557 ] + cmdutil.remoteopts,
544 _('-r REV... [-e CMD] [--remotecmd CMD] [SOURCE]'))
558 _('-r REV... [-e CMD] [--remotecmd CMD] [SOURCE]'))
545 def lfpull(ui, repo, source="default", **opts):
559 def lfpull(ui, repo, source="default", **opts):
546 """pull largefiles for the specified revisions from the specified source
560 """pull largefiles for the specified revisions from the specified source
547
561
548 Pull largefiles that are referenced from local changesets but missing
562 Pull largefiles that are referenced from local changesets but missing
549 locally, pulling from a remote repository to the local cache.
563 locally, pulling from a remote repository to the local cache.
550
564
551 If SOURCE is omitted, the 'default' path will be used.
565 If SOURCE is omitted, the 'default' path will be used.
552 See :hg:`help urls` for more information.
566 See :hg:`help urls` for more information.
553
567
554 .. container:: verbose
568 .. container:: verbose
555
569
556 Some examples:
570 Some examples:
557
571
558 - pull largefiles for all branch heads::
572 - pull largefiles for all branch heads::
559
573
560 hg lfpull -r "head() and not closed()"
574 hg lfpull -r "head() and not closed()"
561
575
562 - pull largefiles on the default branch::
576 - pull largefiles on the default branch::
563
577
564 hg lfpull -r "branch(default)"
578 hg lfpull -r "branch(default)"
565 """
579 """
566 repo.lfpullsource = source
580 repo.lfpullsource = source
567
581
568 revs = opts.get('rev', [])
582 revs = opts.get('rev', [])
569 if not revs:
583 if not revs:
570 raise error.Abort(_('no revisions specified'))
584 raise error.Abort(_('no revisions specified'))
571 revs = scmutil.revrange(repo, revs)
585 revs = scmutil.revrange(repo, revs)
572
586
573 numcached = 0
587 numcached = 0
574 for rev in revs:
588 for rev in revs:
575 ui.note(_('pulling largefiles for revision %s\n') % rev)
589 ui.note(_('pulling largefiles for revision %s\n') % rev)
576 (cached, missing) = cachelfiles(ui, repo, rev)
590 (cached, missing) = cachelfiles(ui, repo, rev)
577 numcached += len(cached)
591 numcached += len(cached)
578 ui.status(_("%d largefiles cached\n") % numcached)
592 ui.status(_("%d largefiles cached\n") % numcached)
@@ -1,1283 +1,1275
1 This file contains testcases that tend to be related to special cases or less
1 This file contains testcases that tend to be related to special cases or less
2 common commands affecting largefile.
2 common commands affecting largefile.
3
3
4 Each sections should be independent of each others.
4 Each sections should be independent of each others.
5
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
9 > [extensions]
10 > largefiles=
10 > largefiles=
11 > purge=
11 > purge=
12 > rebase=
12 > rebase=
13 > transplant=
13 > transplant=
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [largefiles]
16 > [largefiles]
17 > minsize=2
17 > minsize=2
18 > patterns=glob:**.dat
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
19 > usercache=${USERCACHE}
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24
24
25
25
26 Test copies and moves from a directory other than root (issue3516)
26 Test copies and moves from a directory other than root (issue3516)
27 =========================================================================
27 =========================================================================
28
28
29 $ hg init lf_cpmv
29 $ hg init lf_cpmv
30 $ cd lf_cpmv
30 $ cd lf_cpmv
31 $ mkdir dira
31 $ mkdir dira
32 $ mkdir dira/dirb
32 $ mkdir dira/dirb
33 $ touch dira/dirb/largefile
33 $ touch dira/dirb/largefile
34 $ hg add --large dira/dirb/largefile
34 $ hg add --large dira/dirb/largefile
35 $ hg commit -m "added"
35 $ hg commit -m "added"
36 Invoking status precommit hook
36 Invoking status precommit hook
37 A dira/dirb/largefile
37 A dira/dirb/largefile
38 $ cd dira
38 $ cd dira
39 $ hg cp dirb/largefile foo/largefile
39 $ hg cp dirb/largefile foo/largefile
40
40
41 TODO: Ideally, this should mention the largefile, not the standin
41 TODO: Ideally, this should mention the largefile, not the standin
42 $ hg log -T '{rev}\n' --stat 'set:clean()'
42 $ hg log -T '{rev}\n' --stat 'set:clean()'
43 0
43 0
44 .hglf/dira/dirb/largefile | 1 +
44 .hglf/dira/dirb/largefile | 1 +
45 1 files changed, 1 insertions(+), 0 deletions(-)
45 1 files changed, 1 insertions(+), 0 deletions(-)
46
46
47 $ hg ci -m "deep copy"
47 $ hg ci -m "deep copy"
48 Invoking status precommit hook
48 Invoking status precommit hook
49 A dira/foo/largefile
49 A dira/foo/largefile
50 $ find . | sort
50 $ find . | sort
51 .
51 .
52 ./dirb
52 ./dirb
53 ./dirb/largefile
53 ./dirb/largefile
54 ./foo
54 ./foo
55 ./foo/largefile
55 ./foo/largefile
56 $ hg mv foo/largefile baz/largefile
56 $ hg mv foo/largefile baz/largefile
57 $ hg ci -m "moved"
57 $ hg ci -m "moved"
58 Invoking status precommit hook
58 Invoking status precommit hook
59 A dira/baz/largefile
59 A dira/baz/largefile
60 R dira/foo/largefile
60 R dira/foo/largefile
61 $ find . | sort
61 $ find . | sort
62 .
62 .
63 ./baz
63 ./baz
64 ./baz/largefile
64 ./baz/largefile
65 ./dirb
65 ./dirb
66 ./dirb/largefile
66 ./dirb/largefile
67 $ cd ..
67 $ cd ..
68 $ hg mv dira dirc
68 $ hg mv dira dirc
69 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
69 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
70 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
70 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
71 $ find * | sort
71 $ find * | sort
72 dirc
72 dirc
73 dirc/baz
73 dirc/baz
74 dirc/baz/largefile
74 dirc/baz/largefile
75 dirc/dirb
75 dirc/dirb
76 dirc/dirb/largefile
76 dirc/dirb/largefile
77
77
78 $ hg clone -q . ../fetch
78 $ hg clone -q . ../fetch
79 $ hg --config extensions.fetch= fetch ../fetch
79 $ hg --config extensions.fetch= fetch ../fetch
80 abort: uncommitted changes
80 abort: uncommitted changes
81 [255]
81 [255]
82 $ hg up -qC
82 $ hg up -qC
83 $ cd ..
83 $ cd ..
84
84
85 Clone a local repository owned by another user
85 Clone a local repository owned by another user
86 ===================================================
86 ===================================================
87
87
88 #if unix-permissions
88 #if unix-permissions
89
89
90 We have to simulate that here by setting $HOME and removing write permissions
90 We have to simulate that here by setting $HOME and removing write permissions
91 $ ORIGHOME="$HOME"
91 $ ORIGHOME="$HOME"
92 $ mkdir alice
92 $ mkdir alice
93 $ HOME="`pwd`/alice"
93 $ HOME="`pwd`/alice"
94 $ cd alice
94 $ cd alice
95 $ hg init pubrepo
95 $ hg init pubrepo
96 $ cd pubrepo
96 $ cd pubrepo
97 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
97 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
98 $ hg add --large a-large-file
98 $ hg add --large a-large-file
99 $ hg commit -m "Add a large file"
99 $ hg commit -m "Add a large file"
100 Invoking status precommit hook
100 Invoking status precommit hook
101 A a-large-file
101 A a-large-file
102 $ cd ..
102 $ cd ..
103 $ chmod -R a-w pubrepo
103 $ chmod -R a-w pubrepo
104 $ cd ..
104 $ cd ..
105 $ mkdir bob
105 $ mkdir bob
106 $ HOME="`pwd`/bob"
106 $ HOME="`pwd`/bob"
107 $ cd bob
107 $ cd bob
108 $ hg clone --pull ../alice/pubrepo pubrepo
108 $ hg clone --pull ../alice/pubrepo pubrepo
109 requesting all changes
109 requesting all changes
110 adding changesets
110 adding changesets
111 adding manifests
111 adding manifests
112 adding file changes
112 adding file changes
113 added 1 changesets with 1 changes to 1 files
113 added 1 changesets with 1 changes to 1 files
114 new changesets 09a186cfa6da
114 new changesets 09a186cfa6da
115 updating to branch default
115 updating to branch default
116 getting changed largefiles
116 getting changed largefiles
117 1 largefiles updated, 0 removed
117 1 largefiles updated, 0 removed
118 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
119 $ cd ..
119 $ cd ..
120 $ chmod -R u+w alice/pubrepo
120 $ chmod -R u+w alice/pubrepo
121 $ HOME="$ORIGHOME"
121 $ HOME="$ORIGHOME"
122
122
123 #endif
123 #endif
124
124
125
125
126 Symlink to a large largefile should behave the same as a symlink to a normal file
126 Symlink to a large largefile should behave the same as a symlink to a normal file
127 =====================================================================================
127 =====================================================================================
128
128
129 #if symlink
129 #if symlink
130
130
131 $ hg init largesymlink
131 $ hg init largesymlink
132 $ cd largesymlink
132 $ cd largesymlink
133 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
133 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
134 $ hg add --large largefile
134 $ hg add --large largefile
135 $ hg commit -m "commit a large file"
135 $ hg commit -m "commit a large file"
136 Invoking status precommit hook
136 Invoking status precommit hook
137 A largefile
137 A largefile
138 $ ln -s largefile largelink
138 $ ln -s largefile largelink
139 $ hg add largelink
139 $ hg add largelink
140 $ hg commit -m "commit a large symlink"
140 $ hg commit -m "commit a large symlink"
141 Invoking status precommit hook
141 Invoking status precommit hook
142 A largelink
142 A largelink
143 $ rm -f largelink
143 $ rm -f largelink
144 $ hg up >/dev/null
144 $ hg up >/dev/null
145 $ test -f largelink
145 $ test -f largelink
146 [1]
146 [1]
147 $ test -L largelink
147 $ test -L largelink
148 [1]
148 [1]
149 $ rm -f largelink # make next part of the test independent of the previous
149 $ rm -f largelink # make next part of the test independent of the previous
150 $ hg up -C >/dev/null
150 $ hg up -C >/dev/null
151 $ test -f largelink
151 $ test -f largelink
152 $ test -L largelink
152 $ test -L largelink
153 $ cd ..
153 $ cd ..
154
154
155 #endif
155 #endif
156
156
157
157
158 test for pattern matching on 'hg status':
158 test for pattern matching on 'hg status':
159 ==============================================
159 ==============================================
160
160
161
161
162 to boost performance, largefiles checks whether specified patterns are
162 to boost performance, largefiles checks whether specified patterns are
163 related to largefiles in working directory (NOT to STANDIN) or not.
163 related to largefiles in working directory (NOT to STANDIN) or not.
164
164
165 $ hg init statusmatch
165 $ hg init statusmatch
166 $ cd statusmatch
166 $ cd statusmatch
167
167
168 $ mkdir -p a/b/c/d
168 $ mkdir -p a/b/c/d
169 $ echo normal > a/b/c/d/e.normal.txt
169 $ echo normal > a/b/c/d/e.normal.txt
170 $ hg add a/b/c/d/e.normal.txt
170 $ hg add a/b/c/d/e.normal.txt
171 $ echo large > a/b/c/d/e.large.txt
171 $ echo large > a/b/c/d/e.large.txt
172 $ hg add --large a/b/c/d/e.large.txt
172 $ hg add --large a/b/c/d/e.large.txt
173 $ mkdir -p a/b/c/x
173 $ mkdir -p a/b/c/x
174 $ echo normal > a/b/c/x/y.normal.txt
174 $ echo normal > a/b/c/x/y.normal.txt
175 $ hg add a/b/c/x/y.normal.txt
175 $ hg add a/b/c/x/y.normal.txt
176 $ hg commit -m 'add files'
176 $ hg commit -m 'add files'
177 Invoking status precommit hook
177 Invoking status precommit hook
178 A a/b/c/d/e.large.txt
178 A a/b/c/d/e.large.txt
179 A a/b/c/d/e.normal.txt
179 A a/b/c/d/e.normal.txt
180 A a/b/c/x/y.normal.txt
180 A a/b/c/x/y.normal.txt
181
181
182 (1) no pattern: no performance boost
182 (1) no pattern: no performance boost
183 $ hg status -A
183 $ hg status -A
184 C a/b/c/d/e.large.txt
184 C a/b/c/d/e.large.txt
185 C a/b/c/d/e.normal.txt
185 C a/b/c/d/e.normal.txt
186 C a/b/c/x/y.normal.txt
186 C a/b/c/x/y.normal.txt
187
187
188 (2) pattern not related to largefiles: performance boost
188 (2) pattern not related to largefiles: performance boost
189 $ hg status -A a/b/c/x
189 $ hg status -A a/b/c/x
190 C a/b/c/x/y.normal.txt
190 C a/b/c/x/y.normal.txt
191
191
192 (3) pattern related to largefiles: no performance boost
192 (3) pattern related to largefiles: no performance boost
193 $ hg status -A a/b/c/d
193 $ hg status -A a/b/c/d
194 C a/b/c/d/e.large.txt
194 C a/b/c/d/e.large.txt
195 C a/b/c/d/e.normal.txt
195 C a/b/c/d/e.normal.txt
196
196
197 (4) pattern related to STANDIN (not to largefiles): performance boost
197 (4) pattern related to STANDIN (not to largefiles): performance boost
198 $ hg status -A .hglf/a
198 $ hg status -A .hglf/a
199 C .hglf/a/b/c/d/e.large.txt
199 C .hglf/a/b/c/d/e.large.txt
200
200
201 (5) mixed case: no performance boost
201 (5) mixed case: no performance boost
202 $ hg status -A a/b/c/x a/b/c/d
202 $ hg status -A a/b/c/x a/b/c/d
203 C a/b/c/d/e.large.txt
203 C a/b/c/d/e.large.txt
204 C a/b/c/d/e.normal.txt
204 C a/b/c/d/e.normal.txt
205 C a/b/c/x/y.normal.txt
205 C a/b/c/x/y.normal.txt
206
206
207 verify that largefiles doesn't break filesets
207 verify that largefiles doesn't break filesets
208
208
209 $ hg log --rev . --exclude "set:binary()"
209 $ hg log --rev . --exclude "set:binary()"
210 changeset: 0:41bd42f10efa
210 changeset: 0:41bd42f10efa
211 tag: tip
211 tag: tip
212 user: test
212 user: test
213 date: Thu Jan 01 00:00:00 1970 +0000
213 date: Thu Jan 01 00:00:00 1970 +0000
214 summary: add files
214 summary: add files
215
215
216 sharing a largefile repo automatically enables largefiles on the share
216 sharing a largefile repo automatically enables largefiles on the share
217
217
218 $ hg share --config extensions.share= . ../shared_lfrepo
218 $ hg share --config extensions.share= . ../shared_lfrepo
219 updating working directory
219 updating working directory
220 getting changed largefiles
220 getting changed largefiles
221 1 largefiles updated, 0 removed
221 1 largefiles updated, 0 removed
222 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
222 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
223 $ cat ../shared_lfrepo/.hg/hgrc
223 $ cat ../shared_lfrepo/.hg/hgrc
224
224
225 [extensions]
225 [extensions]
226 largefiles=
226 largefiles=
227
227
228 verify that large files in subrepos handled properly
228 verify that large files in subrepos handled properly
229 $ hg init subrepo
229 $ hg init subrepo
230 $ echo "subrepo = subrepo" > .hgsub
230 $ echo "subrepo = subrepo" > .hgsub
231 $ hg add .hgsub
231 $ hg add .hgsub
232 $ hg ci -m "add subrepo"
232 $ hg ci -m "add subrepo"
233 Invoking status precommit hook
233 Invoking status precommit hook
234 A .hgsub
234 A .hgsub
235 ? .hgsubstate
235 ? .hgsubstate
236 $ echo "rev 1" > subrepo/large.txt
236 $ echo "rev 1" > subrepo/large.txt
237 $ hg add --large subrepo/large.txt
237 $ hg add --large subrepo/large.txt
238 $ hg sum
238 $ hg sum
239 parent: 1:8ee150ea2e9c tip
239 parent: 1:8ee150ea2e9c tip
240 add subrepo
240 add subrepo
241 branch: default
241 branch: default
242 commit: 1 subrepos
242 commit: 1 subrepos
243 update: (current)
243 update: (current)
244 phases: 2 draft
244 phases: 2 draft
245 $ hg st
245 $ hg st
246 $ hg st -S
246 $ hg st -S
247 A subrepo/large.txt
247 A subrepo/large.txt
248 $ hg ci -S -m "commit top repo"
248 $ hg ci -S -m "commit top repo"
249 committing subrepository subrepo
249 committing subrepository subrepo
250 Invoking status precommit hook
250 Invoking status precommit hook
251 A large.txt
251 A large.txt
252 Invoking status precommit hook
252 Invoking status precommit hook
253 M .hgsubstate
253 M .hgsubstate
254 # No differences
254 # No differences
255 $ hg st -S
255 $ hg st -S
256 $ hg sum
256 $ hg sum
257 parent: 2:ce4cd0c527a6 tip
257 parent: 2:ce4cd0c527a6 tip
258 commit top repo
258 commit top repo
259 branch: default
259 branch: default
260 commit: (clean)
260 commit: (clean)
261 update: (current)
261 update: (current)
262 phases: 3 draft
262 phases: 3 draft
263 $ echo "rev 2" > subrepo/large.txt
263 $ echo "rev 2" > subrepo/large.txt
264 $ hg st -S
264 $ hg st -S
265 M subrepo/large.txt
265 M subrepo/large.txt
266 $ hg sum
266 $ hg sum
267 parent: 2:ce4cd0c527a6 tip
267 parent: 2:ce4cd0c527a6 tip
268 commit top repo
268 commit top repo
269 branch: default
269 branch: default
270 commit: 1 subrepos
270 commit: 1 subrepos
271 update: (current)
271 update: (current)
272 phases: 3 draft
272 phases: 3 draft
273 $ hg ci -m "this commit should fail without -S"
273 $ hg ci -m "this commit should fail without -S"
274 abort: uncommitted changes in subrepository "subrepo"
274 abort: uncommitted changes in subrepository "subrepo"
275 (use --subrepos for recursive commit)
275 (use --subrepos for recursive commit)
276 [255]
276 [255]
277
277
278 Add a normal file to the subrepo, then test archiving
278 Add a normal file to the subrepo, then test archiving
279
279
280 $ echo 'normal file' > subrepo/normal.txt
280 $ echo 'normal file' > subrepo/normal.txt
281 $ touch large.dat
281 $ touch large.dat
282 $ mv subrepo/large.txt subrepo/renamed-large.txt
282 $ mv subrepo/large.txt subrepo/renamed-large.txt
283 $ hg addremove -S --dry-run
283 $ hg addremove -S --dry-run
284 adding large.dat as a largefile
284 adding large.dat as a largefile
285 removing subrepo/large.txt
285 removing subrepo/large.txt
286 adding subrepo/normal.txt
286 adding subrepo/normal.txt
287 adding subrepo/renamed-large.txt
287 adding subrepo/renamed-large.txt
288 $ hg status -S
288 $ hg status -S
289 ! subrepo/large.txt
289 ! subrepo/large.txt
290 ? large.dat
290 ? large.dat
291 ? subrepo/normal.txt
291 ? subrepo/normal.txt
292 ? subrepo/renamed-large.txt
292 ? subrepo/renamed-large.txt
293
293
294 $ hg addremove --dry-run subrepo
294 $ hg addremove --dry-run subrepo
295 removing subrepo/large.txt (glob)
295 removing subrepo/large.txt (glob)
296 adding subrepo/normal.txt (glob)
296 adding subrepo/normal.txt (glob)
297 adding subrepo/renamed-large.txt (glob)
297 adding subrepo/renamed-large.txt (glob)
298 $ hg status -S
298 $ hg status -S
299 ! subrepo/large.txt
299 ! subrepo/large.txt
300 ? large.dat
300 ? large.dat
301 ? subrepo/normal.txt
301 ? subrepo/normal.txt
302 ? subrepo/renamed-large.txt
302 ? subrepo/renamed-large.txt
303 $ cd ..
303 $ cd ..
304
304
305 $ hg -R statusmatch addremove --dry-run statusmatch/subrepo
305 $ hg -R statusmatch addremove --dry-run statusmatch/subrepo
306 removing statusmatch/subrepo/large.txt (glob)
306 removing statusmatch/subrepo/large.txt (glob)
307 adding statusmatch/subrepo/normal.txt (glob)
307 adding statusmatch/subrepo/normal.txt (glob)
308 adding statusmatch/subrepo/renamed-large.txt (glob)
308 adding statusmatch/subrepo/renamed-large.txt (glob)
309 $ hg -R statusmatch status -S
309 $ hg -R statusmatch status -S
310 ! subrepo/large.txt
310 ! subrepo/large.txt
311 ? large.dat
311 ? large.dat
312 ? subrepo/normal.txt
312 ? subrepo/normal.txt
313 ? subrepo/renamed-large.txt
313 ? subrepo/renamed-large.txt
314
314
315 $ hg -R statusmatch addremove --dry-run -S
315 $ hg -R statusmatch addremove --dry-run -S
316 adding large.dat as a largefile
316 adding large.dat as a largefile
317 removing subrepo/large.txt
317 removing subrepo/large.txt
318 adding subrepo/normal.txt
318 adding subrepo/normal.txt
319 adding subrepo/renamed-large.txt
319 adding subrepo/renamed-large.txt
320 $ cd statusmatch
320 $ cd statusmatch
321
321
322 $ mv subrepo/renamed-large.txt subrepo/large.txt
322 $ mv subrepo/renamed-large.txt subrepo/large.txt
323 $ hg addremove subrepo
323 $ hg addremove subrepo
324 adding subrepo/normal.txt (glob)
324 adding subrepo/normal.txt (glob)
325 $ hg forget subrepo/normal.txt
325 $ hg forget subrepo/normal.txt
326
326
327 $ hg addremove -S
327 $ hg addremove -S
328 adding large.dat as a largefile
328 adding large.dat as a largefile
329 adding subrepo/normal.txt
329 adding subrepo/normal.txt
330 $ rm large.dat
330 $ rm large.dat
331
331
332 $ hg addremove subrepo
332 $ hg addremove subrepo
333 $ hg addremove -S
333 $ hg addremove -S
334 removing large.dat
334 removing large.dat
335
335
336 Lock in subrepo, otherwise the change isn't archived
336 Lock in subrepo, otherwise the change isn't archived
337
337
338 $ hg ci -S -m "add normal file to top level"
338 $ hg ci -S -m "add normal file to top level"
339 committing subrepository subrepo
339 committing subrepository subrepo
340 Invoking status precommit hook
340 Invoking status precommit hook
341 M large.txt
341 M large.txt
342 A normal.txt
342 A normal.txt
343 Invoking status precommit hook
343 Invoking status precommit hook
344 M .hgsubstate
344 M .hgsubstate
345 $ hg archive -S ../lf_subrepo_archive
345 $ hg archive -S ../lf_subrepo_archive
346 $ find ../lf_subrepo_archive | sort
346 $ find ../lf_subrepo_archive | sort
347 ../lf_subrepo_archive
347 ../lf_subrepo_archive
348 ../lf_subrepo_archive/.hg_archival.txt
348 ../lf_subrepo_archive/.hg_archival.txt
349 ../lf_subrepo_archive/.hgsub
349 ../lf_subrepo_archive/.hgsub
350 ../lf_subrepo_archive/.hgsubstate
350 ../lf_subrepo_archive/.hgsubstate
351 ../lf_subrepo_archive/a
351 ../lf_subrepo_archive/a
352 ../lf_subrepo_archive/a/b
352 ../lf_subrepo_archive/a/b
353 ../lf_subrepo_archive/a/b/c
353 ../lf_subrepo_archive/a/b/c
354 ../lf_subrepo_archive/a/b/c/d
354 ../lf_subrepo_archive/a/b/c/d
355 ../lf_subrepo_archive/a/b/c/d/e.large.txt
355 ../lf_subrepo_archive/a/b/c/d/e.large.txt
356 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
356 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
357 ../lf_subrepo_archive/a/b/c/x
357 ../lf_subrepo_archive/a/b/c/x
358 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
358 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
359 ../lf_subrepo_archive/subrepo
359 ../lf_subrepo_archive/subrepo
360 ../lf_subrepo_archive/subrepo/large.txt
360 ../lf_subrepo_archive/subrepo/large.txt
361 ../lf_subrepo_archive/subrepo/normal.txt
361 ../lf_subrepo_archive/subrepo/normal.txt
362 $ cat ../lf_subrepo_archive/.hg_archival.txt
362 $ cat ../lf_subrepo_archive/.hg_archival.txt
363 repo: 41bd42f10efa43698cc02052ea0977771cba506d
363 repo: 41bd42f10efa43698cc02052ea0977771cba506d
364 node: d56a95e6522858bc08a724c4fe2bdee066d1c30b
364 node: d56a95e6522858bc08a724c4fe2bdee066d1c30b
365 branch: default
365 branch: default
366 latesttag: null
366 latesttag: null
367 latesttagdistance: 4
367 latesttagdistance: 4
368 changessincelatesttag: 4
368 changessincelatesttag: 4
369
369
370 Test update with subrepos.
370 Test update with subrepos.
371
371
372 $ hg update 0
372 $ hg update 0
373 getting changed largefiles
373 getting changed largefiles
374 0 largefiles updated, 1 removed
374 0 largefiles updated, 1 removed
375 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
375 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
376 $ hg status -S
376 $ hg status -S
377 $ hg update tip
377 $ hg update tip
378 getting changed largefiles
378 getting changed largefiles
379 1 largefiles updated, 0 removed
379 1 largefiles updated, 0 removed
380 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
380 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
381 $ hg status -S
381 $ hg status -S
382 # modify a large file
382 # modify a large file
383 $ echo "modified" > subrepo/large.txt
383 $ echo "modified" > subrepo/large.txt
384 $ hg st -S
384 $ hg st -S
385 M subrepo/large.txt
385 M subrepo/large.txt
386 # update -C should revert the change.
386 # update -C should revert the change.
387 $ hg update -C
387 $ hg update -C
388 getting changed largefiles
388 getting changed largefiles
389 1 largefiles updated, 0 removed
389 1 largefiles updated, 0 removed
390 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
390 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
391 $ hg status -S
391 $ hg status -S
392
392
393 Forget doesn't change the content of the file
393 Forget doesn't change the content of the file
394 $ echo 'pre-forget content' > subrepo/large.txt
394 $ echo 'pre-forget content' > subrepo/large.txt
395 $ hg forget -v subrepo/large.txt
395 $ hg forget -v subrepo/large.txt
396 removing subrepo/large.txt (glob)
396 removing subrepo/large.txt (glob)
397 $ cat subrepo/large.txt
397 $ cat subrepo/large.txt
398 pre-forget content
398 pre-forget content
399
399
400 Test reverting a forgotten file
400 Test reverting a forgotten file
401 $ hg revert -R subrepo subrepo/large.txt
401 $ hg revert -R subrepo subrepo/large.txt
402 $ hg status -SA subrepo/large.txt
402 $ hg status -SA subrepo/large.txt
403 C subrepo/large.txt
403 C subrepo/large.txt
404
404
405 $ hg rm -v subrepo/large.txt
405 $ hg rm -v subrepo/large.txt
406 removing subrepo/large.txt (glob)
406 removing subrepo/large.txt (glob)
407 $ hg revert -R subrepo subrepo/large.txt
407 $ hg revert -R subrepo subrepo/large.txt
408 $ rm subrepo/large.txt
408 $ rm subrepo/large.txt
409 $ hg addremove -S
409 $ hg addremove -S
410 removing subrepo/large.txt
410 removing subrepo/large.txt
411 $ hg st -S
411 $ hg st -S
412 R subrepo/large.txt
412 R subrepo/large.txt
413
413
414 Test archiving a revision that references a subrepo that is not yet
414 Test archiving a revision that references a subrepo that is not yet
415 cloned (see test-subrepo-recursion.t):
415 cloned (see test-subrepo-recursion.t):
416
416
417 $ hg clone -U . ../empty
417 $ hg clone -U . ../empty
418 $ cd ../empty
418 $ cd ../empty
419 $ hg archive --subrepos -r tip ../archive.tar.gz
419 $ hg archive --subrepos -r tip ../archive.tar.gz
420 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
420 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
421 $ cd ..
421 $ cd ..
422
422
423
423
424
424
425
425
426
426
427
427
428 Test addremove, forget and others
428 Test addremove, forget and others
429 ==============================================
429 ==============================================
430
430
431 Test that addremove picks up largefiles prior to the initial commit (issue3541)
431 Test that addremove picks up largefiles prior to the initial commit (issue3541)
432
432
433 $ hg init addrm2
433 $ hg init addrm2
434 $ cd addrm2
434 $ cd addrm2
435 $ touch large.dat
435 $ touch large.dat
436 $ touch large2.dat
436 $ touch large2.dat
437 $ touch normal
437 $ touch normal
438 $ hg add --large large.dat
438 $ hg add --large large.dat
439 $ hg addremove -v
439 $ hg addremove -v
440 adding large2.dat as a largefile
440 adding large2.dat as a largefile
441 adding normal
441 adding normal
442
442
443 Test that forgetting all largefiles reverts to islfilesrepo() == False
443 Test that forgetting all largefiles reverts to islfilesrepo() == False
444 (addremove will add *.dat as normal files now)
444 (addremove will add *.dat as normal files now)
445 $ hg forget large.dat
445 $ hg forget large.dat
446 $ hg forget large2.dat
446 $ hg forget large2.dat
447 $ hg addremove -v
447 $ hg addremove -v
448 adding large.dat
448 adding large.dat
449 adding large2.dat
449 adding large2.dat
450
450
451 Test commit's addremove option prior to the first commit
451 Test commit's addremove option prior to the first commit
452 $ hg forget large.dat
452 $ hg forget large.dat
453 $ hg forget large2.dat
453 $ hg forget large2.dat
454 $ hg add --large large.dat
454 $ hg add --large large.dat
455 $ hg ci -Am "commit"
455 $ hg ci -Am "commit"
456 adding large2.dat as a largefile
456 adding large2.dat as a largefile
457 Invoking status precommit hook
457 Invoking status precommit hook
458 A large.dat
458 A large.dat
459 A large2.dat
459 A large2.dat
460 A normal
460 A normal
461 $ find .hglf | sort
461 $ find .hglf | sort
462 .hglf
462 .hglf
463 .hglf/large.dat
463 .hglf/large.dat
464 .hglf/large2.dat
464 .hglf/large2.dat
465
465
466 Test actions on largefiles using relative paths from subdir
466 Test actions on largefiles using relative paths from subdir
467
467
468 $ mkdir sub
468 $ mkdir sub
469 $ cd sub
469 $ cd sub
470 $ echo anotherlarge > anotherlarge
470 $ echo anotherlarge > anotherlarge
471 $ hg add --large anotherlarge
471 $ hg add --large anotherlarge
472 $ hg st
472 $ hg st
473 A sub/anotherlarge
473 A sub/anotherlarge
474 $ hg st anotherlarge
474 $ hg st anotherlarge
475 A anotherlarge
475 A anotherlarge
476 $ hg commit -m anotherlarge anotherlarge
476 $ hg commit -m anotherlarge anotherlarge
477 Invoking status precommit hook
477 Invoking status precommit hook
478 A sub/anotherlarge
478 A sub/anotherlarge
479 $ hg log anotherlarge
479 $ hg log anotherlarge
480 changeset: 1:9627a577c5e9
480 changeset: 1:9627a577c5e9
481 tag: tip
481 tag: tip
482 user: test
482 user: test
483 date: Thu Jan 01 00:00:00 1970 +0000
483 date: Thu Jan 01 00:00:00 1970 +0000
484 summary: anotherlarge
484 summary: anotherlarge
485
485
486 $ hg --debug log -T '{rev}: {desc}\n' ../sub/anotherlarge
486 $ hg --debug log -T '{rev}: {desc}\n' ../sub/anotherlarge
487 updated patterns: ../.hglf/sub/../sub/anotherlarge, ../sub/anotherlarge
487 updated patterns: ../.hglf/sub/../sub/anotherlarge, ../sub/anotherlarge
488 1: anotherlarge
488 1: anotherlarge
489
489
490 $ hg log -G anotherlarge
490 $ hg log -G anotherlarge
491 @ changeset: 1:9627a577c5e9
491 @ changeset: 1:9627a577c5e9
492 | tag: tip
492 | tag: tip
493 ~ user: test
493 ~ user: test
494 date: Thu Jan 01 00:00:00 1970 +0000
494 date: Thu Jan 01 00:00:00 1970 +0000
495 summary: anotherlarge
495 summary: anotherlarge
496
496
497
497
498 $ hg log glob:another*
498 $ hg log glob:another*
499 changeset: 1:9627a577c5e9
499 changeset: 1:9627a577c5e9
500 tag: tip
500 tag: tip
501 user: test
501 user: test
502 date: Thu Jan 01 00:00:00 1970 +0000
502 date: Thu Jan 01 00:00:00 1970 +0000
503 summary: anotherlarge
503 summary: anotherlarge
504
504
505 $ hg --debug log -T '{rev}: {desc}\n' -G glob:another*
505 $ hg --debug log -T '{rev}: {desc}\n' -G glob:another*
506 updated patterns: glob:../.hglf/sub/another*, glob:another*
506 updated patterns: glob:../.hglf/sub/another*, glob:another*
507 @ 1: anotherlarge
507 @ 1: anotherlarge
508 |
508 |
509 ~
509 ~
510
510
511 #if no-msys
511 #if no-msys
512 $ hg --debug log -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys
512 $ hg --debug log -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys
513 updated patterns: glob:../.hglf/sub/another*
513 updated patterns: glob:../.hglf/sub/another*
514 1: anotherlarge
514 1: anotherlarge
515
515
516 $ hg --debug log -G -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys
516 $ hg --debug log -G -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys
517 updated patterns: glob:../.hglf/sub/another*
517 updated patterns: glob:../.hglf/sub/another*
518 @ 1: anotherlarge
518 @ 1: anotherlarge
519 |
519 |
520 ~
520 ~
521 #endif
521 #endif
522
522
523 $ echo more >> anotherlarge
523 $ echo more >> anotherlarge
524 $ hg st .
524 $ hg st .
525 M anotherlarge
525 M anotherlarge
526 $ hg cat anotherlarge
526 $ hg cat anotherlarge
527 anotherlarge
527 anotherlarge
528 $ hg revert anotherlarge
528 $ hg revert anotherlarge
529 $ hg st
529 $ hg st
530 ? sub/anotherlarge.orig
530 ? sub/anotherlarge.orig
531
531
532 Test orig files go where we want them
532 Test orig files go where we want them
533 $ echo moremore >> anotherlarge
533 $ echo moremore >> anotherlarge
534 $ hg revert anotherlarge -v --config 'ui.origbackuppath=.hg/origbackups'
534 $ hg revert anotherlarge -v --config 'ui.origbackuppath=.hg/origbackups'
535 creating directory: $TESTTMP/addrm2/.hg/origbackups/.hglf/sub (glob)
535 creating directory: $TESTTMP/addrm2/.hg/origbackups/.hglf/sub (glob)
536 saving current version of ../.hglf/sub/anotherlarge as $TESTTMP/addrm2/.hg/origbackups/.hglf/sub/anotherlarge (glob)
536 saving current version of ../.hglf/sub/anotherlarge as $TESTTMP/addrm2/.hg/origbackups/.hglf/sub/anotherlarge (glob)
537 reverting ../.hglf/sub/anotherlarge (glob)
537 reverting ../.hglf/sub/anotherlarge (glob)
538 creating directory: $TESTTMP/addrm2/.hg/origbackups/sub (glob)
538 creating directory: $TESTTMP/addrm2/.hg/origbackups/sub (glob)
539 found 90c622cf65cebe75c5842f9136c459333faf392e in store
539 found 90c622cf65cebe75c5842f9136c459333faf392e in store
540 found 90c622cf65cebe75c5842f9136c459333faf392e in store
540 found 90c622cf65cebe75c5842f9136c459333faf392e in store
541 $ ls ../.hg/origbackups/sub
541 $ ls ../.hg/origbackups/sub
542 anotherlarge
542 anotherlarge
543 $ cd ..
543 $ cd ..
544
544
545 Test glob logging from the root dir
545 Test glob logging from the root dir
546 $ hg log glob:**another*
546 $ hg log glob:**another*
547 changeset: 1:9627a577c5e9
547 changeset: 1:9627a577c5e9
548 tag: tip
548 tag: tip
549 user: test
549 user: test
550 date: Thu Jan 01 00:00:00 1970 +0000
550 date: Thu Jan 01 00:00:00 1970 +0000
551 summary: anotherlarge
551 summary: anotherlarge
552
552
553 $ hg log -G glob:**another*
553 $ hg log -G glob:**another*
554 @ changeset: 1:9627a577c5e9
554 @ changeset: 1:9627a577c5e9
555 | tag: tip
555 | tag: tip
556 ~ user: test
556 ~ user: test
557 date: Thu Jan 01 00:00:00 1970 +0000
557 date: Thu Jan 01 00:00:00 1970 +0000
558 summary: anotherlarge
558 summary: anotherlarge
559
559
560
560
561 $ cd ..
561 $ cd ..
562
562
563 Log from outer space
563 Log from outer space
564 $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/sub/anotherlarge'
564 $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/sub/anotherlarge'
565 updated patterns: addrm2/.hglf/sub/anotherlarge, addrm2/sub/anotherlarge
565 updated patterns: addrm2/.hglf/sub/anotherlarge, addrm2/sub/anotherlarge
566 1: anotherlarge
566 1: anotherlarge
567 $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/.hglf/sub/anotherlarge'
567 $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/.hglf/sub/anotherlarge'
568 updated patterns: addrm2/.hglf/sub/anotherlarge
568 updated patterns: addrm2/.hglf/sub/anotherlarge
569 1: anotherlarge
569 1: anotherlarge
570
570
571
571
572 Check error message while exchange
572 Check error message while exchange
573 =========================================================
573 =========================================================
574
574
575 issue3651: summary/outgoing with largefiles shows "no remote repo"
575 issue3651: summary/outgoing with largefiles shows "no remote repo"
576 unexpectedly
576 unexpectedly
577
577
578 $ mkdir issue3651
578 $ mkdir issue3651
579 $ cd issue3651
579 $ cd issue3651
580
580
581 $ hg init src
581 $ hg init src
582 $ echo a > src/a
582 $ echo a > src/a
583 $ hg -R src add --large src/a
583 $ hg -R src add --large src/a
584 $ hg -R src commit -m '#0'
584 $ hg -R src commit -m '#0'
585 Invoking status precommit hook
585 Invoking status precommit hook
586 A a
586 A a
587
587
588 check messages when no remote repository is specified:
588 check messages when no remote repository is specified:
589 "no remote repo" route for "hg outgoing --large" is not tested here,
589 "no remote repo" route for "hg outgoing --large" is not tested here,
590 because it can't be reproduced easily.
590 because it can't be reproduced easily.
591
591
592 $ hg init clone1
592 $ hg init clone1
593 $ hg -R clone1 -q pull src
593 $ hg -R clone1 -q pull src
594 $ hg -R clone1 -q update
594 $ hg -R clone1 -q update
595 $ hg -R clone1 paths | grep default
595 $ hg -R clone1 paths | grep default
596 [1]
596 [1]
597
597
598 $ hg -R clone1 summary --large
598 $ hg -R clone1 summary --large
599 parent: 0:fc0bd45326d3 tip
599 parent: 0:fc0bd45326d3 tip
600 #0
600 #0
601 branch: default
601 branch: default
602 commit: (clean)
602 commit: (clean)
603 update: (current)
603 update: (current)
604 phases: 1 draft
604 phases: 1 draft
605 largefiles: (no remote repo)
605 largefiles: (no remote repo)
606
606
607 check messages when there is no files to upload:
607 check messages when there is no files to upload:
608
608
609 $ hg -q clone src clone2
609 $ hg -q clone src clone2
610 $ hg -R clone2 paths | grep default
610 $ hg -R clone2 paths | grep default
611 default = $TESTTMP/issue3651/src (glob)
611 default = $TESTTMP/issue3651/src (glob)
612
612
613 $ hg -R clone2 summary --large
613 $ hg -R clone2 summary --large
614 parent: 0:fc0bd45326d3 tip
614 parent: 0:fc0bd45326d3 tip
615 #0
615 #0
616 branch: default
616 branch: default
617 commit: (clean)
617 commit: (clean)
618 update: (current)
618 update: (current)
619 phases: 1 draft
619 phases: 1 draft
620 largefiles: (no files to upload)
620 largefiles: (no files to upload)
621 $ hg -R clone2 outgoing --large
621 $ hg -R clone2 outgoing --large
622 comparing with $TESTTMP/issue3651/src (glob)
622 comparing with $TESTTMP/issue3651/src (glob)
623 searching for changes
623 searching for changes
624 no changes found
624 no changes found
625 largefiles: no files to upload
625 largefiles: no files to upload
626 [1]
626 [1]
627
627
628 $ hg -R clone2 outgoing --large --graph --template "{rev}"
628 $ hg -R clone2 outgoing --large --graph --template "{rev}"
629 comparing with $TESTTMP/issue3651/src (glob)
629 comparing with $TESTTMP/issue3651/src (glob)
630 searching for changes
630 searching for changes
631 no changes found
631 no changes found
632 largefiles: no files to upload
632 largefiles: no files to upload
633
633
634 check messages when there are files to upload:
634 check messages when there are files to upload:
635
635
636 $ echo b > clone2/b
636 $ echo b > clone2/b
637 $ hg -R clone2 add --large clone2/b
637 $ hg -R clone2 add --large clone2/b
638 $ hg -R clone2 commit -m '#1'
638 $ hg -R clone2 commit -m '#1'
639 Invoking status precommit hook
639 Invoking status precommit hook
640 A b
640 A b
641 $ hg -R clone2 summary --large
641 $ hg -R clone2 summary --large
642 parent: 1:1acbe71ce432 tip
642 parent: 1:1acbe71ce432 tip
643 #1
643 #1
644 branch: default
644 branch: default
645 commit: (clean)
645 commit: (clean)
646 update: (current)
646 update: (current)
647 phases: 2 draft
647 phases: 2 draft
648 largefiles: 1 entities for 1 files to upload
648 largefiles: 1 entities for 1 files to upload
649 $ hg -R clone2 outgoing --large
649 $ hg -R clone2 outgoing --large
650 comparing with $TESTTMP/issue3651/src (glob)
650 comparing with $TESTTMP/issue3651/src (glob)
651 searching for changes
651 searching for changes
652 changeset: 1:1acbe71ce432
652 changeset: 1:1acbe71ce432
653 tag: tip
653 tag: tip
654 user: test
654 user: test
655 date: Thu Jan 01 00:00:00 1970 +0000
655 date: Thu Jan 01 00:00:00 1970 +0000
656 summary: #1
656 summary: #1
657
657
658 largefiles to upload (1 entities):
658 largefiles to upload (1 entities):
659 b
659 b
660
660
661 $ hg -R clone2 outgoing --large --graph --template "{rev}"
661 $ hg -R clone2 outgoing --large --graph --template "{rev}"
662 comparing with $TESTTMP/issue3651/src (glob)
662 comparing with $TESTTMP/issue3651/src (glob)
663 searching for changes
663 searching for changes
664 @ 1
664 @ 1
665
665
666 largefiles to upload (1 entities):
666 largefiles to upload (1 entities):
667 b
667 b
668
668
669
669
670 $ cp clone2/b clone2/b1
670 $ cp clone2/b clone2/b1
671 $ cp clone2/b clone2/b2
671 $ cp clone2/b clone2/b2
672 $ hg -R clone2 add --large clone2/b1 clone2/b2
672 $ hg -R clone2 add --large clone2/b1 clone2/b2
673 $ hg -R clone2 commit -m '#2: add largefiles referring same entity'
673 $ hg -R clone2 commit -m '#2: add largefiles referring same entity'
674 Invoking status precommit hook
674 Invoking status precommit hook
675 A b1
675 A b1
676 A b2
676 A b2
677 $ hg -R clone2 summary --large
677 $ hg -R clone2 summary --large
678 parent: 2:6095d0695d70 tip
678 parent: 2:6095d0695d70 tip
679 #2: add largefiles referring same entity
679 #2: add largefiles referring same entity
680 branch: default
680 branch: default
681 commit: (clean)
681 commit: (clean)
682 update: (current)
682 update: (current)
683 phases: 3 draft
683 phases: 3 draft
684 largefiles: 1 entities for 3 files to upload
684 largefiles: 1 entities for 3 files to upload
685 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
685 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
686 comparing with $TESTTMP/issue3651/src (glob)
686 comparing with $TESTTMP/issue3651/src (glob)
687 searching for changes
687 searching for changes
688 1:1acbe71ce432
688 1:1acbe71ce432
689 2:6095d0695d70
689 2:6095d0695d70
690 largefiles to upload (1 entities):
690 largefiles to upload (1 entities):
691 b
691 b
692 b1
692 b1
693 b2
693 b2
694
694
695 $ hg -R clone2 cat -r 1 clone2/.hglf/b
695 $ hg -R clone2 cat -r 1 clone2/.hglf/b
696 89e6c98d92887913cadf06b2adb97f26cde4849b
696 89e6c98d92887913cadf06b2adb97f26cde4849b
697 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true
697 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true
698 comparing with $TESTTMP/issue3651/src (glob)
698 comparing with $TESTTMP/issue3651/src (glob)
699 query 1; heads
699 query 1; heads
700 searching for changes
700 searching for changes
701 all remote heads known locally
701 all remote heads known locally
702 1:1acbe71ce432
702 1:1acbe71ce432
703 2:6095d0695d70
703 2:6095d0695d70
704 finding outgoing largefiles: 0/2 revisions (0.00%)
704 finding outgoing largefiles: 0/2 revisions (0.00%)
705 finding outgoing largefiles: 1/2 revisions (50.00%)
705 finding outgoing largefiles: 1/2 revisions (50.00%)
706 largefiles to upload (1 entities):
706 largefiles to upload (1 entities):
707 b
707 b
708 89e6c98d92887913cadf06b2adb97f26cde4849b
708 89e6c98d92887913cadf06b2adb97f26cde4849b
709 b1
709 b1
710 89e6c98d92887913cadf06b2adb97f26cde4849b
710 89e6c98d92887913cadf06b2adb97f26cde4849b
711 b2
711 b2
712 89e6c98d92887913cadf06b2adb97f26cde4849b
712 89e6c98d92887913cadf06b2adb97f26cde4849b
713
713
714
714
715 $ echo bbb > clone2/b
715 $ echo bbb > clone2/b
716 $ hg -R clone2 commit -m '#3: add new largefile entity as existing file'
716 $ hg -R clone2 commit -m '#3: add new largefile entity as existing file'
717 Invoking status precommit hook
717 Invoking status precommit hook
718 M b
718 M b
719 $ echo bbbb > clone2/b
719 $ echo bbbb > clone2/b
720 $ hg -R clone2 commit -m '#4: add new largefile entity as existing file'
720 $ hg -R clone2 commit -m '#4: add new largefile entity as existing file'
721 Invoking status precommit hook
721 Invoking status precommit hook
722 M b
722 M b
723 $ cp clone2/b1 clone2/b
723 $ cp clone2/b1 clone2/b
724 $ hg -R clone2 commit -m '#5: refer existing largefile entity again'
724 $ hg -R clone2 commit -m '#5: refer existing largefile entity again'
725 Invoking status precommit hook
725 Invoking status precommit hook
726 M b
726 M b
727 $ hg -R clone2 summary --large
727 $ hg -R clone2 summary --large
728 parent: 5:036794ea641c tip
728 parent: 5:036794ea641c tip
729 #5: refer existing largefile entity again
729 #5: refer existing largefile entity again
730 branch: default
730 branch: default
731 commit: (clean)
731 commit: (clean)
732 update: (current)
732 update: (current)
733 phases: 6 draft
733 phases: 6 draft
734 largefiles: 3 entities for 3 files to upload
734 largefiles: 3 entities for 3 files to upload
735 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
735 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
736 comparing with $TESTTMP/issue3651/src (glob)
736 comparing with $TESTTMP/issue3651/src (glob)
737 searching for changes
737 searching for changes
738 1:1acbe71ce432
738 1:1acbe71ce432
739 2:6095d0695d70
739 2:6095d0695d70
740 3:7983dce246cc
740 3:7983dce246cc
741 4:233f12ada4ae
741 4:233f12ada4ae
742 5:036794ea641c
742 5:036794ea641c
743 largefiles to upload (3 entities):
743 largefiles to upload (3 entities):
744 b
744 b
745 b1
745 b1
746 b2
746 b2
747
747
748 $ hg -R clone2 cat -r 3 clone2/.hglf/b
748 $ hg -R clone2 cat -r 3 clone2/.hglf/b
749 c801c9cfe94400963fcb683246217d5db77f9a9a
749 c801c9cfe94400963fcb683246217d5db77f9a9a
750 $ hg -R clone2 cat -r 4 clone2/.hglf/b
750 $ hg -R clone2 cat -r 4 clone2/.hglf/b
751 13f9ed0898e315bf59dc2973fec52037b6f441a2
751 13f9ed0898e315bf59dc2973fec52037b6f441a2
752 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true
752 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true
753 comparing with $TESTTMP/issue3651/src (glob)
753 comparing with $TESTTMP/issue3651/src (glob)
754 query 1; heads
754 query 1; heads
755 searching for changes
755 searching for changes
756 all remote heads known locally
756 all remote heads known locally
757 1:1acbe71ce432
757 1:1acbe71ce432
758 2:6095d0695d70
758 2:6095d0695d70
759 3:7983dce246cc
759 3:7983dce246cc
760 4:233f12ada4ae
760 4:233f12ada4ae
761 5:036794ea641c
761 5:036794ea641c
762 finding outgoing largefiles: 0/5 revisions (0.00%)
762 finding outgoing largefiles: 0/5 revisions (0.00%)
763 finding outgoing largefiles: 1/5 revisions (20.00%)
763 finding outgoing largefiles: 1/5 revisions (20.00%)
764 finding outgoing largefiles: 2/5 revisions (40.00%)
764 finding outgoing largefiles: 2/5 revisions (40.00%)
765 finding outgoing largefiles: 3/5 revisions (60.00%)
765 finding outgoing largefiles: 3/5 revisions (60.00%)
766 finding outgoing largefiles: 4/5 revisions (80.00%)
766 finding outgoing largefiles: 4/5 revisions (80.00%)
767 largefiles to upload (3 entities):
767 largefiles to upload (3 entities):
768 b
768 b
769 13f9ed0898e315bf59dc2973fec52037b6f441a2
769 13f9ed0898e315bf59dc2973fec52037b6f441a2
770 89e6c98d92887913cadf06b2adb97f26cde4849b
770 89e6c98d92887913cadf06b2adb97f26cde4849b
771 c801c9cfe94400963fcb683246217d5db77f9a9a
771 c801c9cfe94400963fcb683246217d5db77f9a9a
772 b1
772 b1
773 89e6c98d92887913cadf06b2adb97f26cde4849b
773 89e6c98d92887913cadf06b2adb97f26cde4849b
774 b2
774 b2
775 89e6c98d92887913cadf06b2adb97f26cde4849b
775 89e6c98d92887913cadf06b2adb97f26cde4849b
776
776
777
777
778 Pushing revision #1 causes uploading entity 89e6c98d9288, which is
778 Pushing revision #1 causes uploading entity 89e6c98d9288, which is
779 shared also by largefiles b1, b2 in revision #2 and b in revision #5.
779 shared also by largefiles b1, b2 in revision #2 and b in revision #5.
780
780
781 Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg
781 Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg
782 summary" and "hg outgoing", even though files in outgoing revision #2
782 summary" and "hg outgoing", even though files in outgoing revision #2
783 and #5 refer it.
783 and #5 refer it.
784
784
785 $ hg -R clone2 push -r 1 -q
785 $ hg -R clone2 push -r 1 -q
786 $ hg -R clone2 summary --large
786 $ hg -R clone2 summary --large
787 parent: 5:036794ea641c tip
787 parent: 5:036794ea641c tip
788 #5: refer existing largefile entity again
788 #5: refer existing largefile entity again
789 branch: default
789 branch: default
790 commit: (clean)
790 commit: (clean)
791 update: (current)
791 update: (current)
792 phases: 6 draft
792 phases: 6 draft
793 largefiles: 2 entities for 1 files to upload
793 largefiles: 2 entities for 1 files to upload
794 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
794 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
795 comparing with $TESTTMP/issue3651/src (glob)
795 comparing with $TESTTMP/issue3651/src (glob)
796 searching for changes
796 searching for changes
797 2:6095d0695d70
797 2:6095d0695d70
798 3:7983dce246cc
798 3:7983dce246cc
799 4:233f12ada4ae
799 4:233f12ada4ae
800 5:036794ea641c
800 5:036794ea641c
801 largefiles to upload (2 entities):
801 largefiles to upload (2 entities):
802 b
802 b
803
803
804 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true
804 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true
805 comparing with $TESTTMP/issue3651/src (glob)
805 comparing with $TESTTMP/issue3651/src (glob)
806 query 1; heads
806 query 1; heads
807 searching for changes
807 searching for changes
808 all remote heads known locally
808 all remote heads known locally
809 2:6095d0695d70
809 2:6095d0695d70
810 3:7983dce246cc
810 3:7983dce246cc
811 4:233f12ada4ae
811 4:233f12ada4ae
812 5:036794ea641c
812 5:036794ea641c
813 finding outgoing largefiles: 0/4 revisions (0.00%)
813 finding outgoing largefiles: 0/4 revisions (0.00%)
814 finding outgoing largefiles: 1/4 revisions (25.00%)
814 finding outgoing largefiles: 1/4 revisions (25.00%)
815 finding outgoing largefiles: 2/4 revisions (50.00%)
815 finding outgoing largefiles: 2/4 revisions (50.00%)
816 finding outgoing largefiles: 3/4 revisions (75.00%)
816 finding outgoing largefiles: 3/4 revisions (75.00%)
817 largefiles to upload (2 entities):
817 largefiles to upload (2 entities):
818 b
818 b
819 13f9ed0898e315bf59dc2973fec52037b6f441a2
819 13f9ed0898e315bf59dc2973fec52037b6f441a2
820 c801c9cfe94400963fcb683246217d5db77f9a9a
820 c801c9cfe94400963fcb683246217d5db77f9a9a
821
821
822
822
823 $ cd ..
823 $ cd ..
824
824
825 merge action 'd' for 'local renamed directory to d2/g' which has no filename
825 merge action 'd' for 'local renamed directory to d2/g' which has no filename
826 ==================================================================================
826 ==================================================================================
827
827
828 $ hg init merge-action
828 $ hg init merge-action
829 $ cd merge-action
829 $ cd merge-action
830 $ touch l
830 $ touch l
831 $ hg add --large l
831 $ hg add --large l
832 $ mkdir d1
832 $ mkdir d1
833 $ touch d1/f
833 $ touch d1/f
834 $ hg ci -Aqm0
834 $ hg ci -Aqm0
835 Invoking status precommit hook
835 Invoking status precommit hook
836 A d1/f
836 A d1/f
837 A l
837 A l
838 $ echo > d1/f
838 $ echo > d1/f
839 $ touch d1/g
839 $ touch d1/g
840 $ hg ci -Aqm1
840 $ hg ci -Aqm1
841 Invoking status precommit hook
841 Invoking status precommit hook
842 M d1/f
842 M d1/f
843 A d1/g
843 A d1/g
844 $ hg up -qr0
844 $ hg up -qr0
845 $ hg mv d1 d2
845 $ hg mv d1 d2
846 moving d1/f to d2/f (glob)
846 moving d1/f to d2/f (glob)
847 $ hg ci -qm2
847 $ hg ci -qm2
848 Invoking status precommit hook
848 Invoking status precommit hook
849 A d2/f
849 A d2/f
850 R d1/f
850 R d1/f
851 $ hg merge
851 $ hg merge
852 merging d2/f and d1/f to d2/f
852 merging d2/f and d1/f to d2/f
853 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
853 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
854 (branch merge, don't forget to commit)
854 (branch merge, don't forget to commit)
855 $ cd ..
855 $ cd ..
856
856
857
857
858 Merge conflicts:
858 Merge conflicts:
859 =====================
859 =====================
860
860
861 $ hg init merge
861 $ hg init merge
862 $ cd merge
862 $ cd merge
863 $ echo 0 > f-different
863 $ echo 0 > f-different
864 $ echo 0 > f-same
864 $ echo 0 > f-same
865 $ echo 0 > f-unchanged-1
865 $ echo 0 > f-unchanged-1
866 $ echo 0 > f-unchanged-2
866 $ echo 0 > f-unchanged-2
867 $ hg add --large *
867 $ hg add --large *
868 $ hg ci -m0
868 $ hg ci -m0
869 Invoking status precommit hook
869 Invoking status precommit hook
870 A f-different
870 A f-different
871 A f-same
871 A f-same
872 A f-unchanged-1
872 A f-unchanged-1
873 A f-unchanged-2
873 A f-unchanged-2
874 $ echo tmp1 > f-unchanged-1
874 $ echo tmp1 > f-unchanged-1
875 $ echo tmp1 > f-unchanged-2
875 $ echo tmp1 > f-unchanged-2
876 $ echo tmp1 > f-same
876 $ echo tmp1 > f-same
877 $ hg ci -m1
877 $ hg ci -m1
878 Invoking status precommit hook
878 Invoking status precommit hook
879 M f-same
879 M f-same
880 M f-unchanged-1
880 M f-unchanged-1
881 M f-unchanged-2
881 M f-unchanged-2
882 $ echo 2 > f-different
882 $ echo 2 > f-different
883 $ echo 0 > f-unchanged-1
883 $ echo 0 > f-unchanged-1
884 $ echo 1 > f-unchanged-2
884 $ echo 1 > f-unchanged-2
885 $ echo 1 > f-same
885 $ echo 1 > f-same
886 $ hg ci -m2
886 $ hg ci -m2
887 Invoking status precommit hook
887 Invoking status precommit hook
888 M f-different
888 M f-different
889 M f-same
889 M f-same
890 M f-unchanged-1
890 M f-unchanged-1
891 M f-unchanged-2
891 M f-unchanged-2
892 $ hg up -qr0
892 $ hg up -qr0
893 $ echo tmp2 > f-unchanged-1
893 $ echo tmp2 > f-unchanged-1
894 $ echo tmp2 > f-unchanged-2
894 $ echo tmp2 > f-unchanged-2
895 $ echo tmp2 > f-same
895 $ echo tmp2 > f-same
896 $ hg ci -m3
896 $ hg ci -m3
897 Invoking status precommit hook
897 Invoking status precommit hook
898 M f-same
898 M f-same
899 M f-unchanged-1
899 M f-unchanged-1
900 M f-unchanged-2
900 M f-unchanged-2
901 created new head
901 created new head
902 $ echo 1 > f-different
902 $ echo 1 > f-different
903 $ echo 1 > f-unchanged-1
903 $ echo 1 > f-unchanged-1
904 $ echo 0 > f-unchanged-2
904 $ echo 0 > f-unchanged-2
905 $ echo 1 > f-same
905 $ echo 1 > f-same
906 $ hg ci -m4
906 $ hg ci -m4
907 Invoking status precommit hook
907 Invoking status precommit hook
908 M f-different
908 M f-different
909 M f-same
909 M f-same
910 M f-unchanged-1
910 M f-unchanged-1
911 M f-unchanged-2
911 M f-unchanged-2
912 $ hg merge
912 $ hg merge
913 largefile f-different has a merge conflict
913 largefile f-different has a merge conflict
914 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
914 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
915 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
915 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
916 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
916 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
917 getting changed largefiles
917 getting changed largefiles
918 1 largefiles updated, 0 removed
918 1 largefiles updated, 0 removed
919 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
919 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
920 (branch merge, don't forget to commit)
920 (branch merge, don't forget to commit)
921 $ cat f-different
921 $ cat f-different
922 1
922 1
923 $ cat f-same
923 $ cat f-same
924 1
924 1
925 $ cat f-unchanged-1
925 $ cat f-unchanged-1
926 1
926 1
927 $ cat f-unchanged-2
927 $ cat f-unchanged-2
928 1
928 1
929 $ cd ..
929 $ cd ..
930
930
931 Test largefile insulation (do not enabled a side effect
931 Test largefile insulation (do not enabled a side effect
932 ========================================================
932 ========================================================
933
933
934 Check whether "largefiles" feature is supported only in repositories
934 Check whether "largefiles" feature is supported only in repositories
935 enabling largefiles extension.
935 enabling largefiles extension.
936
936
937 $ mkdir individualenabling
937 $ mkdir individualenabling
938 $ cd individualenabling
938 $ cd individualenabling
939
939
940 $ hg init enabledlocally
940 $ hg init enabledlocally
941 $ echo large > enabledlocally/large
941 $ echo large > enabledlocally/large
942 $ hg -R enabledlocally add --large enabledlocally/large
942 $ hg -R enabledlocally add --large enabledlocally/large
943 $ hg -R enabledlocally commit -m '#0'
943 $ hg -R enabledlocally commit -m '#0'
944 Invoking status precommit hook
944 Invoking status precommit hook
945 A large
945 A large
946
946
947 $ hg init notenabledlocally
947 $ hg init notenabledlocally
948 $ echo large > notenabledlocally/large
948 $ echo large > notenabledlocally/large
949 $ hg -R notenabledlocally add --large notenabledlocally/large
949 $ hg -R notenabledlocally add --large notenabledlocally/large
950 $ hg -R notenabledlocally commit -m '#0'
950 $ hg -R notenabledlocally commit -m '#0'
951 Invoking status precommit hook
951 Invoking status precommit hook
952 A large
952 A large
953
953
954 $ cat >> $HGRCPATH <<EOF
954 $ cat >> $HGRCPATH <<EOF
955 > [extensions]
955 > [extensions]
956 > # disable globally
956 > # disable globally
957 > largefiles=!
957 > largefiles=!
958 > EOF
958 > EOF
959 $ cat >> enabledlocally/.hg/hgrc <<EOF
959 $ cat >> enabledlocally/.hg/hgrc <<EOF
960 > [extensions]
960 > [extensions]
961 > # enable locally
961 > # enable locally
962 > largefiles=
962 > largefiles=
963 > EOF
963 > EOF
964 $ hg -R enabledlocally root
964 $ hg -R enabledlocally root
965 $TESTTMP/individualenabling/enabledlocally (glob)
965 $TESTTMP/individualenabling/enabledlocally (glob)
966 $ hg -R notenabledlocally root
966 $ hg -R notenabledlocally root
967 abort: repository requires features unknown to this Mercurial: largefiles!
967 abort: repository requires features unknown to this Mercurial: largefiles!
968 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
968 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
969 [255]
969 [255]
970
970
971 $ hg init push-dst
971 $ hg init push-dst
972 $ hg -R enabledlocally push push-dst
972 $ hg -R enabledlocally push push-dst
973 pushing to push-dst
973 pushing to push-dst
974 abort: required features are not supported in the destination: largefiles
974 abort: required features are not supported in the destination: largefiles
975 [255]
975 [255]
976
976
977 $ hg init pull-src
977 $ hg init pull-src
978 $ hg -R pull-src pull enabledlocally
978 $ hg -R pull-src pull enabledlocally
979 pulling from enabledlocally
979 pulling from enabledlocally
980 abort: required features are not supported in the destination: largefiles
980 abort: required features are not supported in the destination: largefiles
981 [255]
981 [255]
982
982
983 $ hg clone enabledlocally clone-dst
983 $ hg clone enabledlocally clone-dst
984 abort: repository requires features unknown to this Mercurial: largefiles!
984 abort: repository requires features unknown to this Mercurial: largefiles!
985 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
985 (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
986 [255]
986 [255]
987 $ test -d clone-dst
987 $ test -d clone-dst
988 [1]
988 [1]
989 $ hg clone --pull enabledlocally clone-pull-dst
989 $ hg clone --pull enabledlocally clone-pull-dst
990 abort: required features are not supported in the destination: largefiles
990 abort: required features are not supported in the destination: largefiles
991 [255]
991 [255]
992 $ test -d clone-pull-dst
992 $ test -d clone-pull-dst
993 [1]
993 [1]
994
994
995 #if serve
995 #if serve
996
996
997 Test largefiles specific peer setup, when largefiles is enabled
997 Test largefiles specific peer setup, when largefiles is enabled
998 locally (issue4109)
998 locally (issue4109)
999
999
1000 $ hg showconfig extensions | grep largefiles
1000 $ hg showconfig extensions | grep largefiles
1001 extensions.largefiles=!
1001 extensions.largefiles=!
1002 $ mkdir -p $TESTTMP/individualenabling/usercache
1002 $ mkdir -p $TESTTMP/individualenabling/usercache
1003
1003
1004 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
1004 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
1005 $ cat hg.pid >> $DAEMON_PIDS
1005 $ cat hg.pid >> $DAEMON_PIDS
1006
1006
1007 $ hg init pull-dst
1007 $ hg init pull-dst
1008 $ cat > pull-dst/.hg/hgrc <<EOF
1008 $ cat > pull-dst/.hg/hgrc <<EOF
1009 > [extensions]
1009 > [extensions]
1010 > # enable locally
1010 > # enable locally
1011 > largefiles=
1011 > largefiles=
1012 > [largefiles]
1012 > [largefiles]
1013 > # ignore system cache to force largefiles specific wire proto access
1013 > # ignore system cache to force largefiles specific wire proto access
1014 > usercache=$TESTTMP/individualenabling/usercache
1014 > usercache=$TESTTMP/individualenabling/usercache
1015 > EOF
1015 > EOF
1016 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
1016 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
1017
1017
1018 $ killdaemons.py
1018 $ killdaemons.py
1019 #endif
1019 #endif
1020
1020
1021 Test overridden functions work correctly even for repos disabling
1021 Test overridden functions work correctly even for repos disabling
1022 largefiles (issue4547)
1022 largefiles (issue4547)
1023
1023
1024 $ hg showconfig extensions | grep largefiles
1024 $ hg showconfig extensions | grep largefiles
1025 extensions.largefiles=!
1025 extensions.largefiles=!
1026
1026
1027 (test updating implied by clone)
1027 (test updating implied by clone)
1028
1028
1029 $ hg init enabled-but-no-largefiles
1029 $ hg init enabled-but-no-largefiles
1030 $ echo normal1 > enabled-but-no-largefiles/normal1
1030 $ echo normal1 > enabled-but-no-largefiles/normal1
1031 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal1
1031 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal1
1032 $ hg -R enabled-but-no-largefiles commit -m '#0@enabled-but-no-largefiles'
1032 $ hg -R enabled-but-no-largefiles commit -m '#0@enabled-but-no-largefiles'
1033 Invoking status precommit hook
1033 Invoking status precommit hook
1034 A normal1
1034 A normal1
1035 $ cat >> enabled-but-no-largefiles/.hg/hgrc <<EOF
1035 $ cat >> enabled-but-no-largefiles/.hg/hgrc <<EOF
1036 > [extensions]
1036 > [extensions]
1037 > # enable locally
1037 > # enable locally
1038 > largefiles=
1038 > largefiles=
1039 > EOF
1039 > EOF
1040 $ hg clone -q enabled-but-no-largefiles no-largefiles
1040 $ hg clone -q enabled-but-no-largefiles no-largefiles
1041
1041
1042 $ echo normal2 > enabled-but-no-largefiles/normal2
1042 $ echo normal2 > enabled-but-no-largefiles/normal2
1043 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2
1043 $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2
1044 $ hg -R enabled-but-no-largefiles commit -m '#1@enabled-but-no-largefiles'
1044 $ hg -R enabled-but-no-largefiles commit -m '#1@enabled-but-no-largefiles'
1045 Invoking status precommit hook
1045 Invoking status precommit hook
1046 A normal2
1046 A normal2
1047
1047
1048 $ echo normal3 > no-largefiles/normal3
1048 $ echo normal3 > no-largefiles/normal3
1049 $ hg -R no-largefiles add no-largefiles/normal3
1049 $ hg -R no-largefiles add no-largefiles/normal3
1050 $ hg -R no-largefiles commit -m '#1@no-largefiles'
1050 $ hg -R no-largefiles commit -m '#1@no-largefiles'
1051 Invoking status precommit hook
1051 Invoking status precommit hook
1052 A normal3
1052 A normal3
1053
1053
1054 $ hg -R no-largefiles -q pull --rebase
1054 $ hg -R no-largefiles -q pull --rebase
1055 Invoking status precommit hook
1055 Invoking status precommit hook
1056 A normal3
1056 A normal3
1057
1057
1058 (test reverting)
1058 (test reverting)
1059
1059
1060 $ hg init subrepo-root
1060 $ hg init subrepo-root
1061 $ cat >> subrepo-root/.hg/hgrc <<EOF
1061 $ cat >> subrepo-root/.hg/hgrc <<EOF
1062 > [extensions]
1062 > [extensions]
1063 > # enable locally
1063 > # enable locally
1064 > largefiles=
1064 > largefiles=
1065 > EOF
1065 > EOF
1066 $ echo large > subrepo-root/large
1066 $ echo large > subrepo-root/large
1067 $ mkdir -p subrepo-root/dir/subdir
1067 $ mkdir -p subrepo-root/dir/subdir
1068 $ echo large2 > subrepo-root/dir/subdir/large.bin
1068 $ echo large2 > subrepo-root/dir/subdir/large.bin
1069 $ hg -R subrepo-root add --large subrepo-root/large subrepo-root/dir/subdir/large.bin
1069 $ hg -R subrepo-root add --large subrepo-root/large subrepo-root/dir/subdir/large.bin
1070 $ hg clone -q no-largefiles subrepo-root/no-largefiles
1070 $ hg clone -q no-largefiles subrepo-root/no-largefiles
1071 $ cat > subrepo-root/.hgsub <<EOF
1071 $ cat > subrepo-root/.hgsub <<EOF
1072 > no-largefiles = no-largefiles
1072 > no-largefiles = no-largefiles
1073 > EOF
1073 > EOF
1074 $ hg -R subrepo-root add subrepo-root/.hgsub
1074 $ hg -R subrepo-root add subrepo-root/.hgsub
1075 $ hg -R subrepo-root commit -m '#0'
1075 $ hg -R subrepo-root commit -m '#0'
1076 Invoking status precommit hook
1076 Invoking status precommit hook
1077 A .hgsub
1077 A .hgsub
1078 A dir/subdir/large.bin
1078 A dir/subdir/large.bin
1079 A large
1079 A large
1080 ? .hgsubstate
1080 ? .hgsubstate
1081 $ echo dirty >> subrepo-root/large
1081 $ echo dirty >> subrepo-root/large
1082 $ echo dirty >> subrepo-root/no-largefiles/normal1
1082 $ echo dirty >> subrepo-root/no-largefiles/normal1
1083 $ hg -R subrepo-root status -S
1083 $ hg -R subrepo-root status -S
1084 M large
1084 M large
1085 M no-largefiles/normal1
1085 M no-largefiles/normal1
1086 $ hg -R subrepo-root extdiff -p echo -S --config extensions.extdiff=
1086 $ hg -R subrepo-root extdiff -p echo -S --config extensions.extdiff=
1087 "*\\no-largefiles\\normal1" "*\\no-largefiles\\normal1" (glob) (windows !)
1087 "*\\no-largefiles\\normal1" "*\\no-largefiles\\normal1" (glob) (windows !)
1088 */no-largefiles/normal1 */no-largefiles/normal1 (glob) (no-windows !)
1088 */no-largefiles/normal1 */no-largefiles/normal1 (glob) (no-windows !)
1089 [1]
1089 [1]
1090 $ hg -R subrepo-root revert --all
1090 $ hg -R subrepo-root revert --all
1091 reverting subrepo-root/.hglf/large (glob)
1091 reverting subrepo-root/.hglf/large (glob)
1092 reverting subrepo no-largefiles
1092 reverting subrepo no-largefiles
1093 reverting subrepo-root/no-largefiles/normal1 (glob)
1093 reverting subrepo-root/no-largefiles/normal1 (glob)
1094
1094
1095 Move (and then undo) a directory move with only largefiles.
1095 Move (and then undo) a directory move with only largefiles.
1096
1096
1097 $ listtree() {
1097 $ listtree() {
1098 > find $@ \( -type d -printf "%p/\n" -o -type f -printf "%p\n" \) \
1098 > find $@ \( -type d -printf "%p/\n" -o -type f -printf "%p\n" \) \
1099 > -a -name .hg -prune | sort
1099 > -a -name .hg -prune | sort
1100 > }
1100 > }
1101
1101
1102 $ cd subrepo-root
1102 $ cd subrepo-root
1103 $ listtree .hglf dir* large*
1103 $ listtree .hglf dir* large*
1104 .hglf/
1104 .hglf/
1105 .hglf/dir/
1105 .hglf/dir/
1106 .hglf/dir/subdir/
1106 .hglf/dir/subdir/
1107 .hglf/dir/subdir/large.bin
1107 .hglf/dir/subdir/large.bin
1108 .hglf/large
1108 .hglf/large
1109 dir/
1109 dir/
1110 dir/subdir/
1110 dir/subdir/
1111 dir/subdir/large.bin
1111 dir/subdir/large.bin
1112 large
1112 large
1113 large.orig
1113 large.orig
1114
1114
1115 $ hg mv dir/subdir dir/subdir2
1115 $ hg mv dir/subdir dir/subdir2
1116 moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin (glob)
1116 moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin (glob)
1117
1117
1118 $ listtree .hglf dir* large*
1118 $ listtree .hglf dir* large*
1119 .hglf/
1119 .hglf/
1120 .hglf/dir/
1120 .hglf/dir/
1121 .hglf/dir/subdir2/
1121 .hglf/dir/subdir2/
1122 .hglf/dir/subdir2/large.bin
1122 .hglf/dir/subdir2/large.bin
1123 .hglf/large
1123 .hglf/large
1124 dir/
1124 dir/
1125 dir/subdir2/
1125 dir/subdir2/
1126 dir/subdir2/large.bin
1126 dir/subdir2/large.bin
1127 large
1127 large
1128 large.orig
1128 large.orig
1129 $ hg status -C
1129 $ hg status -C
1130 A dir/subdir2/large.bin
1130 A dir/subdir2/large.bin
1131 dir/subdir/large.bin
1131 dir/subdir/large.bin
1132 R dir/subdir/large.bin
1132 R dir/subdir/large.bin
1133 ? large.orig
1133 ? large.orig
1134
1134
1135 $ echo 'modified' > dir/subdir2/large.bin
1135 $ echo 'modified' > dir/subdir2/large.bin
1136 $ hg status -C
1136 $ hg status -C
1137 A dir/subdir2/large.bin
1137 A dir/subdir2/large.bin
1138 dir/subdir/large.bin
1138 dir/subdir/large.bin
1139 R dir/subdir/large.bin
1139 R dir/subdir/large.bin
1140 ? large.orig
1140 ? large.orig
1141
1141
1142 $ hg revert --all
1142 $ hg revert --all
1143 undeleting .hglf/dir/subdir/large.bin (glob)
1143 undeleting .hglf/dir/subdir/large.bin (glob)
1144 forgetting .hglf/dir/subdir2/large.bin (glob)
1144 forgetting .hglf/dir/subdir2/large.bin (glob)
1145 reverting subrepo no-largefiles
1145 reverting subrepo no-largefiles
1146
1146
1147 $ hg status -C
1147 $ hg status -C
1148 ? dir/subdir2/large.bin
1148 ? dir/subdir2/large.bin
1149 ? large.orig
1149 ? large.orig
1150
1150
1151 BUG: The content of the forgotten file shouldn't be clobbered
1151 The content of the forgotten file shouldn't be clobbered
1152
1152
1153 $ cat dir/subdir2/large.bin
1153 $ cat dir/subdir2/large.bin
1154 large2
1154 modified
1155
1155
1156 BUG: the standin for subdir2 should be deleted, not just dropped
1156 The standin for subdir2 should be deleted, not just dropped
1157
1157
1158 $ listtree .hglf dir* large*
1158 $ listtree .hglf dir* large*
1159 .hglf/
1159 .hglf/
1160 .hglf/dir/
1160 .hglf/dir/
1161 .hglf/dir/subdir/
1161 .hglf/dir/subdir/
1162 .hglf/dir/subdir/large.bin
1162 .hglf/dir/subdir/large.bin
1163 .hglf/dir/subdir2/
1164 .hglf/dir/subdir2/large.bin
1165 .hglf/large
1163 .hglf/large
1166 dir/
1164 dir/
1167 dir/subdir/
1165 dir/subdir/
1168 dir/subdir/large.bin
1166 dir/subdir/large.bin
1169 dir/subdir2/
1167 dir/subdir2/
1170 dir/subdir2/large.bin
1168 dir/subdir2/large.bin
1171 large
1169 large
1172 large.orig
1170 large.orig
1173
1171
1174 $ rm -r dir/subdir2
1172 $ rm -r dir/subdir2
1175
1173
1176 BUG: subdir should not be in the destination. This is caused by the directory
1174 'subdir' should not be in the destination. It would be if the subdir2 directory
1177 existing under .hglf/.
1175 existed under .hglf/.
1178 $ hg mv dir/subdir dir/subdir2
1176 $ hg mv dir/subdir dir/subdir2
1179 moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/subdir/large.bin (glob)
1177 moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin (glob)
1180
1178
1181 $ hg status -C
1179 $ hg status -C
1182 A dir/subdir2/subdir/large.bin
1180 A dir/subdir2/large.bin
1183 dir/subdir/large.bin
1181 dir/subdir/large.bin
1184 R dir/subdir/large.bin
1182 R dir/subdir/large.bin
1185 ? large.orig
1183 ? large.orig
1186
1184
1187 $ listtree .hglf dir* large*
1185 $ listtree .hglf dir* large*
1188 .hglf/
1186 .hglf/
1189 .hglf/dir/
1187 .hglf/dir/
1190 .hglf/dir/subdir2/
1188 .hglf/dir/subdir2/
1191 .hglf/dir/subdir2/large.bin
1189 .hglf/dir/subdir2/large.bin
1192 .hglf/dir/subdir2/subdir/
1193 .hglf/dir/subdir2/subdir/large.bin
1194 .hglf/large
1190 .hglf/large
1195 dir/
1191 dir/
1196 dir/subdir2/
1192 dir/subdir2/
1197 dir/subdir2/subdir/
1193 dir/subdir2/large.bin
1198 dir/subdir2/subdir/large.bin
1199 large
1194 large
1200 large.orig
1195 large.orig
1201
1196
1202 Start from scratch, and rename something other than the final path component.
1197 Start from scratch, and rename something other than the final path component.
1203
1198
1204 $ hg up -qC .
1199 $ hg up -qC .
1205 $ hg --config extensions.purge= purge
1200 $ hg --config extensions.purge= purge
1206
1201
1207 $ hg mv dir/subdir dir2/subdir
1202 $ hg mv dir/subdir dir2/subdir
1208 moving .hglf/dir/subdir/large.bin to .hglf/dir2/subdir/large.bin (glob)
1203 moving .hglf/dir/subdir/large.bin to .hglf/dir2/subdir/large.bin (glob)
1209
1204
1210 $ hg status -C
1205 $ hg status -C
1211 A dir2/subdir/large.bin
1206 A dir2/subdir/large.bin
1212 dir/subdir/large.bin
1207 dir/subdir/large.bin
1213 R dir/subdir/large.bin
1208 R dir/subdir/large.bin
1214
1209
1215 $ listtree .hglf dir* large*
1210 $ listtree .hglf dir* large*
1216 .hglf/
1211 .hglf/
1217 .hglf/dir2/
1212 .hglf/dir2/
1218 .hglf/dir2/subdir/
1213 .hglf/dir2/subdir/
1219 .hglf/dir2/subdir/large.bin
1214 .hglf/dir2/subdir/large.bin
1220 .hglf/large
1215 .hglf/large
1221 dir2/
1216 dir2/
1222 dir2/subdir/
1217 dir2/subdir/
1223 dir2/subdir/large.bin
1218 dir2/subdir/large.bin
1224 large
1219 large
1225
1220
1226 $ hg revert --all
1221 $ hg revert --all
1227 undeleting .hglf/dir/subdir/large.bin (glob)
1222 undeleting .hglf/dir/subdir/large.bin (glob)
1228 forgetting .hglf/dir2/subdir/large.bin (glob)
1223 forgetting .hglf/dir2/subdir/large.bin (glob)
1229 reverting subrepo no-largefiles
1224 reverting subrepo no-largefiles
1230
1225
1231 $ hg status -C
1226 $ hg status -C
1232 ? dir2/subdir/large.bin
1227 ? dir2/subdir/large.bin
1233
1228
1234 $ listtree .hglf dir* large*
1229 $ listtree .hglf dir* large*
1235 .hglf/
1230 .hglf/
1236 .hglf/dir/
1231 .hglf/dir/
1237 .hglf/dir/subdir/
1232 .hglf/dir/subdir/
1238 .hglf/dir/subdir/large.bin
1233 .hglf/dir/subdir/large.bin
1239 .hglf/dir2/
1240 .hglf/dir2/subdir/
1241 .hglf/dir2/subdir/large.bin
1242 .hglf/large
1234 .hglf/large
1243 dir/
1235 dir/
1244 dir/subdir/
1236 dir/subdir/
1245 dir/subdir/large.bin
1237 dir/subdir/large.bin
1246 dir2/
1238 dir2/
1247 dir2/subdir/
1239 dir2/subdir/
1248 dir2/subdir/large.bin
1240 dir2/subdir/large.bin
1249 large
1241 large
1250
1242
1251 $ cd ../..
1243 $ cd ../..
1252
1244
1253 Test "pull --rebase" when rebase is enabled before largefiles (issue3861)
1245 Test "pull --rebase" when rebase is enabled before largefiles (issue3861)
1254 =========================================================================
1246 =========================================================================
1255
1247
1256 $ hg showconfig extensions | grep largefiles
1248 $ hg showconfig extensions | grep largefiles
1257 extensions.largefiles=!
1249 extensions.largefiles=!
1258
1250
1259 $ mkdir issue3861
1251 $ mkdir issue3861
1260 $ cd issue3861
1252 $ cd issue3861
1261 $ hg init src
1253 $ hg init src
1262 $ hg clone -q src dst
1254 $ hg clone -q src dst
1263 $ echo a > src/a
1255 $ echo a > src/a
1264 $ hg -R src commit -Aqm "#0"
1256 $ hg -R src commit -Aqm "#0"
1265 Invoking status precommit hook
1257 Invoking status precommit hook
1266 A a
1258 A a
1267
1259
1268 $ cat >> dst/.hg/hgrc <<EOF
1260 $ cat >> dst/.hg/hgrc <<EOF
1269 > [extensions]
1261 > [extensions]
1270 > largefiles=
1262 > largefiles=
1271 > EOF
1263 > EOF
1272 $ hg -R dst pull --rebase
1264 $ hg -R dst pull --rebase
1273 pulling from $TESTTMP/issue3861/src (glob)
1265 pulling from $TESTTMP/issue3861/src (glob)
1274 requesting all changes
1266 requesting all changes
1275 adding changesets
1267 adding changesets
1276 adding manifests
1268 adding manifests
1277 adding file changes
1269 adding file changes
1278 added 1 changesets with 1 changes to 1 files
1270 added 1 changesets with 1 changes to 1 files
1279 new changesets bf5e395ced2c
1271 new changesets bf5e395ced2c
1280 nothing to rebase - updating instead
1272 nothing to rebase - updating instead
1281 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1273 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1282
1274
1283 $ cd ..
1275 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now