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