##// END OF EJS Templates
largefiles: show also how many data entities are outgoing at "hg outgoing"...
FUJIWARA Katsunori -
r21883:87aa279f default
parent child Browse files
Show More
@@ -1,1195 +1,1214 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 '''Overridden Mercurial commands and functions for the largefiles extension'''
9 '''Overridden Mercurial commands and functions for the largefiles extension'''
10
10
11 import os
11 import os
12 import copy
12 import copy
13
13
14 from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \
14 from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \
15 archival, merge, pathutil, revset
15 archival, merge, pathutil, revset
16 from mercurial.i18n import _
16 from mercurial.i18n import _
17 from mercurial.node import hex
17 from mercurial.node import hex
18 from hgext import rebase
18 from hgext import rebase
19
19
20 import lfutil
20 import lfutil
21 import lfcommands
21 import lfcommands
22 import basestore
22 import basestore
23
23
24 # -- Utility functions: commonly/repeatedly needed functionality ---------------
24 # -- Utility functions: commonly/repeatedly needed functionality ---------------
25
25
26 def installnormalfilesmatchfn(manifest):
26 def installnormalfilesmatchfn(manifest):
27 '''installmatchfn with a matchfn that ignores all largefiles'''
27 '''installmatchfn with a matchfn that ignores all largefiles'''
28 def overridematch(ctx, pats=[], opts={}, globbed=False,
28 def overridematch(ctx, pats=[], opts={}, globbed=False,
29 default='relpath'):
29 default='relpath'):
30 match = oldmatch(ctx, pats, opts, globbed, default)
30 match = oldmatch(ctx, pats, opts, globbed, default)
31 m = copy.copy(match)
31 m = copy.copy(match)
32 notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
32 notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in
33 manifest)
33 manifest)
34 m._files = filter(notlfile, m._files)
34 m._files = filter(notlfile, m._files)
35 m._fmap = set(m._files)
35 m._fmap = set(m._files)
36 m._always = False
36 m._always = False
37 origmatchfn = m.matchfn
37 origmatchfn = m.matchfn
38 m.matchfn = lambda f: notlfile(f) and origmatchfn(f) or None
38 m.matchfn = lambda f: notlfile(f) and origmatchfn(f) or None
39 return m
39 return m
40 oldmatch = installmatchfn(overridematch)
40 oldmatch = installmatchfn(overridematch)
41
41
42 def installmatchfn(f):
42 def installmatchfn(f):
43 '''monkey patch the scmutil module with a custom match function.
43 '''monkey patch the scmutil module with a custom match function.
44 Warning: it is monkey patching the _module_ on runtime! Not thread safe!'''
44 Warning: it is monkey patching the _module_ on runtime! Not thread safe!'''
45 oldmatch = scmutil.match
45 oldmatch = scmutil.match
46 setattr(f, 'oldmatch', oldmatch)
46 setattr(f, 'oldmatch', oldmatch)
47 scmutil.match = f
47 scmutil.match = f
48 return oldmatch
48 return oldmatch
49
49
50 def restorematchfn():
50 def restorematchfn():
51 '''restores scmutil.match to what it was before installmatchfn
51 '''restores scmutil.match to what it was before installmatchfn
52 was called. no-op if scmutil.match is its original function.
52 was called. no-op if scmutil.match is its original function.
53
53
54 Note that n calls to installmatchfn will require n calls to
54 Note that n calls to installmatchfn will require n calls to
55 restore matchfn to reverse'''
55 restore matchfn to reverse'''
56 scmutil.match = getattr(scmutil.match, 'oldmatch')
56 scmutil.match = getattr(scmutil.match, 'oldmatch')
57
57
58 def installmatchandpatsfn(f):
58 def installmatchandpatsfn(f):
59 oldmatchandpats = scmutil.matchandpats
59 oldmatchandpats = scmutil.matchandpats
60 setattr(f, 'oldmatchandpats', oldmatchandpats)
60 setattr(f, 'oldmatchandpats', oldmatchandpats)
61 scmutil.matchandpats = f
61 scmutil.matchandpats = f
62 return oldmatchandpats
62 return oldmatchandpats
63
63
64 def restorematchandpatsfn():
64 def restorematchandpatsfn():
65 '''restores scmutil.matchandpats to what it was before
65 '''restores scmutil.matchandpats to what it was before
66 installnormalfilesmatchandpatsfn was called. no-op if scmutil.matchandpats
66 installnormalfilesmatchandpatsfn was called. no-op if scmutil.matchandpats
67 is its original function.
67 is its original function.
68
68
69 Note that n calls to installnormalfilesmatchandpatsfn will require n calls
69 Note that n calls to installnormalfilesmatchandpatsfn will require n calls
70 to restore matchfn to reverse'''
70 to restore matchfn to reverse'''
71 scmutil.matchandpats = getattr(scmutil.matchandpats, 'oldmatchandpats',
71 scmutil.matchandpats = getattr(scmutil.matchandpats, 'oldmatchandpats',
72 scmutil.matchandpats)
72 scmutil.matchandpats)
73
73
74 def addlargefiles(ui, repo, *pats, **opts):
74 def addlargefiles(ui, repo, *pats, **opts):
75 large = opts.pop('large', None)
75 large = opts.pop('large', None)
76 lfsize = lfutil.getminsize(
76 lfsize = lfutil.getminsize(
77 ui, lfutil.islfilesrepo(repo), opts.pop('lfsize', None))
77 ui, lfutil.islfilesrepo(repo), opts.pop('lfsize', None))
78
78
79 lfmatcher = None
79 lfmatcher = None
80 if lfutil.islfilesrepo(repo):
80 if lfutil.islfilesrepo(repo):
81 lfpats = ui.configlist(lfutil.longname, 'patterns', default=[])
81 lfpats = ui.configlist(lfutil.longname, 'patterns', default=[])
82 if lfpats:
82 if lfpats:
83 lfmatcher = match_.match(repo.root, '', list(lfpats))
83 lfmatcher = match_.match(repo.root, '', list(lfpats))
84
84
85 lfnames = []
85 lfnames = []
86 m = scmutil.match(repo[None], pats, opts)
86 m = scmutil.match(repo[None], pats, opts)
87 m.bad = lambda x, y: None
87 m.bad = lambda x, y: None
88 wctx = repo[None]
88 wctx = repo[None]
89 for f in repo.walk(m):
89 for f in repo.walk(m):
90 exact = m.exact(f)
90 exact = m.exact(f)
91 lfile = lfutil.standin(f) in wctx
91 lfile = lfutil.standin(f) in wctx
92 nfile = f in wctx
92 nfile = f in wctx
93 exists = lfile or nfile
93 exists = lfile or nfile
94
94
95 # Don't warn the user when they attempt to add a normal tracked file.
95 # Don't warn the user when they attempt to add a normal tracked file.
96 # The normal add code will do that for us.
96 # The normal add code will do that for us.
97 if exact and exists:
97 if exact and exists:
98 if lfile:
98 if lfile:
99 ui.warn(_('%s already a largefile\n') % f)
99 ui.warn(_('%s already a largefile\n') % f)
100 continue
100 continue
101
101
102 if (exact or not exists) and not lfutil.isstandin(f):
102 if (exact or not exists) and not lfutil.isstandin(f):
103 wfile = repo.wjoin(f)
103 wfile = repo.wjoin(f)
104
104
105 # In case the file was removed previously, but not committed
105 # In case the file was removed previously, but not committed
106 # (issue3507)
106 # (issue3507)
107 if not os.path.exists(wfile):
107 if not os.path.exists(wfile):
108 continue
108 continue
109
109
110 abovemin = (lfsize and
110 abovemin = (lfsize and
111 os.lstat(wfile).st_size >= lfsize * 1024 * 1024)
111 os.lstat(wfile).st_size >= lfsize * 1024 * 1024)
112 if large or abovemin or (lfmatcher and lfmatcher(f)):
112 if large or abovemin or (lfmatcher and lfmatcher(f)):
113 lfnames.append(f)
113 lfnames.append(f)
114 if ui.verbose or not exact:
114 if ui.verbose or not exact:
115 ui.status(_('adding %s as a largefile\n') % m.rel(f))
115 ui.status(_('adding %s as a largefile\n') % m.rel(f))
116
116
117 bad = []
117 bad = []
118 standins = []
118 standins = []
119
119
120 # Need to lock, otherwise there could be a race condition between
120 # Need to lock, otherwise there could be a race condition between
121 # when standins are created and added to the repo.
121 # when standins are created and added to the repo.
122 wlock = repo.wlock()
122 wlock = repo.wlock()
123 try:
123 try:
124 if not opts.get('dry_run'):
124 if not opts.get('dry_run'):
125 lfdirstate = lfutil.openlfdirstate(ui, repo)
125 lfdirstate = lfutil.openlfdirstate(ui, repo)
126 for f in lfnames:
126 for f in lfnames:
127 standinname = lfutil.standin(f)
127 standinname = lfutil.standin(f)
128 lfutil.writestandin(repo, standinname, hash='',
128 lfutil.writestandin(repo, standinname, hash='',
129 executable=lfutil.getexecutable(repo.wjoin(f)))
129 executable=lfutil.getexecutable(repo.wjoin(f)))
130 standins.append(standinname)
130 standins.append(standinname)
131 if lfdirstate[f] == 'r':
131 if lfdirstate[f] == 'r':
132 lfdirstate.normallookup(f)
132 lfdirstate.normallookup(f)
133 else:
133 else:
134 lfdirstate.add(f)
134 lfdirstate.add(f)
135 lfdirstate.write()
135 lfdirstate.write()
136 bad += [lfutil.splitstandin(f)
136 bad += [lfutil.splitstandin(f)
137 for f in repo[None].add(standins)
137 for f in repo[None].add(standins)
138 if f in m.files()]
138 if f in m.files()]
139 finally:
139 finally:
140 wlock.release()
140 wlock.release()
141 return bad
141 return bad
142
142
143 def removelargefiles(ui, repo, *pats, **opts):
143 def removelargefiles(ui, repo, *pats, **opts):
144 after = opts.get('after')
144 after = opts.get('after')
145 if not pats and not after:
145 if not pats and not after:
146 raise util.Abort(_('no files specified'))
146 raise util.Abort(_('no files specified'))
147 m = scmutil.match(repo[None], pats, opts)
147 m = scmutil.match(repo[None], pats, opts)
148 try:
148 try:
149 repo.lfstatus = True
149 repo.lfstatus = True
150 s = repo.status(match=m, clean=True)
150 s = repo.status(match=m, clean=True)
151 finally:
151 finally:
152 repo.lfstatus = False
152 repo.lfstatus = False
153 manifest = repo[None].manifest()
153 manifest = repo[None].manifest()
154 modified, added, deleted, clean = [[f for f in list
154 modified, added, deleted, clean = [[f for f in list
155 if lfutil.standin(f) in manifest]
155 if lfutil.standin(f) in manifest]
156 for list in [s[0], s[1], s[3], s[6]]]
156 for list in [s[0], s[1], s[3], s[6]]]
157
157
158 def warn(files, msg):
158 def warn(files, msg):
159 for f in files:
159 for f in files:
160 ui.warn(msg % m.rel(f))
160 ui.warn(msg % m.rel(f))
161 return int(len(files) > 0)
161 return int(len(files) > 0)
162
162
163 result = 0
163 result = 0
164
164
165 if after:
165 if after:
166 remove, forget = deleted, []
166 remove, forget = deleted, []
167 result = warn(modified + added + clean,
167 result = warn(modified + added + clean,
168 _('not removing %s: file still exists\n'))
168 _('not removing %s: file still exists\n'))
169 else:
169 else:
170 remove, forget = deleted + clean, []
170 remove, forget = deleted + clean, []
171 result = warn(modified, _('not removing %s: file is modified (use -f'
171 result = warn(modified, _('not removing %s: file is modified (use -f'
172 ' to force removal)\n'))
172 ' to force removal)\n'))
173 result = warn(added, _('not removing %s: file has been marked for add'
173 result = warn(added, _('not removing %s: file has been marked for add'
174 ' (use forget to undo)\n')) or result
174 ' (use forget to undo)\n')) or result
175
175
176 for f in sorted(remove + forget):
176 for f in sorted(remove + forget):
177 if ui.verbose or not m.exact(f):
177 if ui.verbose or not m.exact(f):
178 ui.status(_('removing %s\n') % m.rel(f))
178 ui.status(_('removing %s\n') % m.rel(f))
179
179
180 # Need to lock because standin files are deleted then removed from the
180 # Need to lock because standin files are deleted then removed from the
181 # repository and we could race in-between.
181 # repository and we could race in-between.
182 wlock = repo.wlock()
182 wlock = repo.wlock()
183 try:
183 try:
184 lfdirstate = lfutil.openlfdirstate(ui, repo)
184 lfdirstate = lfutil.openlfdirstate(ui, repo)
185 for f in remove:
185 for f in remove:
186 if not after:
186 if not after:
187 # If this is being called by addremove, notify the user that we
187 # If this is being called by addremove, notify the user that we
188 # are removing the file.
188 # are removing the file.
189 if getattr(repo, "_isaddremove", False):
189 if getattr(repo, "_isaddremove", False):
190 ui.status(_('removing %s\n') % f)
190 ui.status(_('removing %s\n') % f)
191 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
191 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
192 lfdirstate.remove(f)
192 lfdirstate.remove(f)
193 lfdirstate.write()
193 lfdirstate.write()
194 forget = [lfutil.standin(f) for f in forget]
194 forget = [lfutil.standin(f) for f in forget]
195 remove = [lfutil.standin(f) for f in remove]
195 remove = [lfutil.standin(f) for f in remove]
196 repo[None].forget(forget)
196 repo[None].forget(forget)
197 # If this is being called by addremove, let the original addremove
197 # If this is being called by addremove, let the original addremove
198 # function handle this.
198 # function handle this.
199 if not getattr(repo, "_isaddremove", False):
199 if not getattr(repo, "_isaddremove", False):
200 for f in remove:
200 for f in remove:
201 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
201 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
202 repo[None].forget(remove)
202 repo[None].forget(remove)
203 finally:
203 finally:
204 wlock.release()
204 wlock.release()
205
205
206 return result
206 return result
207
207
208 # For overriding mercurial.hgweb.webcommands so that largefiles will
208 # For overriding mercurial.hgweb.webcommands so that largefiles will
209 # appear at their right place in the manifests.
209 # appear at their right place in the manifests.
210 def decodepath(orig, path):
210 def decodepath(orig, path):
211 return lfutil.splitstandin(path) or path
211 return lfutil.splitstandin(path) or path
212
212
213 # -- Wrappers: modify existing commands --------------------------------
213 # -- Wrappers: modify existing commands --------------------------------
214
214
215 # Add works by going through the files that the user wanted to add and
215 # Add works by going through the files that the user wanted to add and
216 # checking if they should be added as largefiles. Then it makes a new
216 # checking if they should be added as largefiles. Then it makes a new
217 # matcher which matches only the normal files and runs the original
217 # matcher which matches only the normal files and runs the original
218 # version of add.
218 # version of add.
219 def overrideadd(orig, ui, repo, *pats, **opts):
219 def overrideadd(orig, ui, repo, *pats, **opts):
220 normal = opts.pop('normal')
220 normal = opts.pop('normal')
221 if normal:
221 if normal:
222 if opts.get('large'):
222 if opts.get('large'):
223 raise util.Abort(_('--normal cannot be used with --large'))
223 raise util.Abort(_('--normal cannot be used with --large'))
224 return orig(ui, repo, *pats, **opts)
224 return orig(ui, repo, *pats, **opts)
225 bad = addlargefiles(ui, repo, *pats, **opts)
225 bad = addlargefiles(ui, repo, *pats, **opts)
226 installnormalfilesmatchfn(repo[None].manifest())
226 installnormalfilesmatchfn(repo[None].manifest())
227 result = orig(ui, repo, *pats, **opts)
227 result = orig(ui, repo, *pats, **opts)
228 restorematchfn()
228 restorematchfn()
229
229
230 return (result == 1 or bad) and 1 or 0
230 return (result == 1 or bad) and 1 or 0
231
231
232 def overrideremove(orig, ui, repo, *pats, **opts):
232 def overrideremove(orig, ui, repo, *pats, **opts):
233 installnormalfilesmatchfn(repo[None].manifest())
233 installnormalfilesmatchfn(repo[None].manifest())
234 result = orig(ui, repo, *pats, **opts)
234 result = orig(ui, repo, *pats, **opts)
235 restorematchfn()
235 restorematchfn()
236 return removelargefiles(ui, repo, *pats, **opts) or result
236 return removelargefiles(ui, repo, *pats, **opts) or result
237
237
238 def overridestatusfn(orig, repo, rev2, **opts):
238 def overridestatusfn(orig, repo, rev2, **opts):
239 try:
239 try:
240 repo._repo.lfstatus = True
240 repo._repo.lfstatus = True
241 return orig(repo, rev2, **opts)
241 return orig(repo, rev2, **opts)
242 finally:
242 finally:
243 repo._repo.lfstatus = False
243 repo._repo.lfstatus = False
244
244
245 def overridestatus(orig, ui, repo, *pats, **opts):
245 def overridestatus(orig, ui, repo, *pats, **opts):
246 try:
246 try:
247 repo.lfstatus = True
247 repo.lfstatus = True
248 return orig(ui, repo, *pats, **opts)
248 return orig(ui, repo, *pats, **opts)
249 finally:
249 finally:
250 repo.lfstatus = False
250 repo.lfstatus = False
251
251
252 def overridedirty(orig, repo, ignoreupdate=False):
252 def overridedirty(orig, repo, ignoreupdate=False):
253 try:
253 try:
254 repo._repo.lfstatus = True
254 repo._repo.lfstatus = True
255 return orig(repo, ignoreupdate)
255 return orig(repo, ignoreupdate)
256 finally:
256 finally:
257 repo._repo.lfstatus = False
257 repo._repo.lfstatus = False
258
258
259 def overridelog(orig, ui, repo, *pats, **opts):
259 def overridelog(orig, ui, repo, *pats, **opts):
260 def overridematchandpats(ctx, pats=[], opts={}, globbed=False,
260 def overridematchandpats(ctx, pats=[], opts={}, globbed=False,
261 default='relpath'):
261 default='relpath'):
262 """Matcher that merges root directory with .hglf, suitable for log.
262 """Matcher that merges root directory with .hglf, suitable for log.
263 It is still possible to match .hglf directly.
263 It is still possible to match .hglf directly.
264 For any listed files run log on the standin too.
264 For any listed files run log on the standin too.
265 matchfn tries both the given filename and with .hglf stripped.
265 matchfn tries both the given filename and with .hglf stripped.
266 """
266 """
267 matchandpats = oldmatchandpats(ctx, pats, opts, globbed, default)
267 matchandpats = oldmatchandpats(ctx, pats, opts, globbed, default)
268 m, p = copy.copy(matchandpats)
268 m, p = copy.copy(matchandpats)
269
269
270 pats = set(p)
270 pats = set(p)
271 # TODO: handling of patterns in both cases below
271 # TODO: handling of patterns in both cases below
272 if m._cwd:
272 if m._cwd:
273 if os.path.isabs(m._cwd):
273 if os.path.isabs(m._cwd):
274 # TODO: handle largefile magic when invoked from other cwd
274 # TODO: handle largefile magic when invoked from other cwd
275 return matchandpats
275 return matchandpats
276 back = (m._cwd.count('/') + 1) * '../'
276 back = (m._cwd.count('/') + 1) * '../'
277 pats.update(back + lfutil.standin(m._cwd + '/' + f) for f in p)
277 pats.update(back + lfutil.standin(m._cwd + '/' + f) for f in p)
278 else:
278 else:
279 pats.update(lfutil.standin(f) for f in p)
279 pats.update(lfutil.standin(f) for f in p)
280
280
281 for i in range(0, len(m._files)):
281 for i in range(0, len(m._files)):
282 standin = lfutil.standin(m._files[i])
282 standin = lfutil.standin(m._files[i])
283 if standin in repo[ctx.node()]:
283 if standin in repo[ctx.node()]:
284 m._files[i] = standin
284 m._files[i] = standin
285 elif m._files[i] not in repo[ctx.node()]:
285 elif m._files[i] not in repo[ctx.node()]:
286 m._files.append(standin)
286 m._files.append(standin)
287 pats.add(standin)
287 pats.add(standin)
288
288
289 m._fmap = set(m._files)
289 m._fmap = set(m._files)
290 m._always = False
290 m._always = False
291 origmatchfn = m.matchfn
291 origmatchfn = m.matchfn
292 def lfmatchfn(f):
292 def lfmatchfn(f):
293 lf = lfutil.splitstandin(f)
293 lf = lfutil.splitstandin(f)
294 if lf is not None and origmatchfn(lf):
294 if lf is not None and origmatchfn(lf):
295 return True
295 return True
296 r = origmatchfn(f)
296 r = origmatchfn(f)
297 return r
297 return r
298 m.matchfn = lfmatchfn
298 m.matchfn = lfmatchfn
299
299
300 return m, pats
300 return m, pats
301
301
302 oldmatchandpats = installmatchandpatsfn(overridematchandpats)
302 oldmatchandpats = installmatchandpatsfn(overridematchandpats)
303 try:
303 try:
304 repo.lfstatus = True
304 repo.lfstatus = True
305 return orig(ui, repo, *pats, **opts)
305 return orig(ui, repo, *pats, **opts)
306 finally:
306 finally:
307 repo.lfstatus = False
307 repo.lfstatus = False
308 restorematchandpatsfn()
308 restorematchandpatsfn()
309
309
310 def overrideverify(orig, ui, repo, *pats, **opts):
310 def overrideverify(orig, ui, repo, *pats, **opts):
311 large = opts.pop('large', False)
311 large = opts.pop('large', False)
312 all = opts.pop('lfa', False)
312 all = opts.pop('lfa', False)
313 contents = opts.pop('lfc', False)
313 contents = opts.pop('lfc', False)
314
314
315 result = orig(ui, repo, *pats, **opts)
315 result = orig(ui, repo, *pats, **opts)
316 if large or all or contents:
316 if large or all or contents:
317 result = result or lfcommands.verifylfiles(ui, repo, all, contents)
317 result = result or lfcommands.verifylfiles(ui, repo, all, contents)
318 return result
318 return result
319
319
320 def overridedebugstate(orig, ui, repo, *pats, **opts):
320 def overridedebugstate(orig, ui, repo, *pats, **opts):
321 large = opts.pop('large', False)
321 large = opts.pop('large', False)
322 if large:
322 if large:
323 class fakerepo(object):
323 class fakerepo(object):
324 dirstate = lfutil.openlfdirstate(ui, repo)
324 dirstate = lfutil.openlfdirstate(ui, repo)
325 orig(ui, fakerepo, *pats, **opts)
325 orig(ui, fakerepo, *pats, **opts)
326 else:
326 else:
327 orig(ui, repo, *pats, **opts)
327 orig(ui, repo, *pats, **opts)
328
328
329 # Override needs to refresh standins so that update's normal merge
329 # Override needs to refresh standins so that update's normal merge
330 # will go through properly. Then the other update hook (overriding repo.update)
330 # will go through properly. Then the other update hook (overriding repo.update)
331 # will get the new files. Filemerge is also overridden so that the merge
331 # will get the new files. Filemerge is also overridden so that the merge
332 # will merge standins correctly.
332 # will merge standins correctly.
333 def overrideupdate(orig, ui, repo, *pats, **opts):
333 def overrideupdate(orig, ui, repo, *pats, **opts):
334 # Need to lock between the standins getting updated and their
334 # Need to lock between the standins getting updated and their
335 # largefiles getting updated
335 # largefiles getting updated
336 wlock = repo.wlock()
336 wlock = repo.wlock()
337 try:
337 try:
338 lfdirstate = lfutil.openlfdirstate(ui, repo)
338 lfdirstate = lfutil.openlfdirstate(ui, repo)
339 s = lfdirstate.status(match_.always(repo.root, repo.getcwd()),
339 s = lfdirstate.status(match_.always(repo.root, repo.getcwd()),
340 [], False, False, False)
340 [], False, False, False)
341 (unsure, modified, added, removed, missing, unknown, ignored, clean) = s
341 (unsure, modified, added, removed, missing, unknown, ignored, clean) = s
342
342
343 if opts['check']:
343 if opts['check']:
344 mod = len(modified) > 0
344 mod = len(modified) > 0
345 for lfile in unsure:
345 for lfile in unsure:
346 standin = lfutil.standin(lfile)
346 standin = lfutil.standin(lfile)
347 if repo['.'][standin].data().strip() != \
347 if repo['.'][standin].data().strip() != \
348 lfutil.hashfile(repo.wjoin(lfile)):
348 lfutil.hashfile(repo.wjoin(lfile)):
349 mod = True
349 mod = True
350 else:
350 else:
351 lfdirstate.normal(lfile)
351 lfdirstate.normal(lfile)
352 lfdirstate.write()
352 lfdirstate.write()
353 if mod:
353 if mod:
354 raise util.Abort(_('uncommitted changes'))
354 raise util.Abort(_('uncommitted changes'))
355 # XXX handle removed differently
355 # XXX handle removed differently
356 if not opts['clean']:
356 if not opts['clean']:
357 for lfile in unsure + modified + added:
357 for lfile in unsure + modified + added:
358 lfutil.updatestandin(repo, lfutil.standin(lfile))
358 lfutil.updatestandin(repo, lfutil.standin(lfile))
359 return orig(ui, repo, *pats, **opts)
359 return orig(ui, repo, *pats, **opts)
360 finally:
360 finally:
361 wlock.release()
361 wlock.release()
362
362
363 # Before starting the manifest merge, merge.updates will call
363 # Before starting the manifest merge, merge.updates will call
364 # _checkunknown to check if there are any files in the merged-in
364 # _checkunknown to check if there are any files in the merged-in
365 # changeset that collide with unknown files in the working copy.
365 # changeset that collide with unknown files in the working copy.
366 #
366 #
367 # The largefiles are seen as unknown, so this prevents us from merging
367 # The largefiles are seen as unknown, so this prevents us from merging
368 # in a file 'foo' if we already have a largefile with the same name.
368 # in a file 'foo' if we already have a largefile with the same name.
369 #
369 #
370 # The overridden function filters the unknown files by removing any
370 # The overridden function filters the unknown files by removing any
371 # largefiles. This makes the merge proceed and we can then handle this
371 # largefiles. This makes the merge proceed and we can then handle this
372 # case further in the overridden manifestmerge function below.
372 # case further in the overridden manifestmerge function below.
373 def overridecheckunknownfile(origfn, repo, wctx, mctx, f):
373 def overridecheckunknownfile(origfn, repo, wctx, mctx, f):
374 if lfutil.standin(repo.dirstate.normalize(f)) in wctx:
374 if lfutil.standin(repo.dirstate.normalize(f)) in wctx:
375 return False
375 return False
376 return origfn(repo, wctx, mctx, f)
376 return origfn(repo, wctx, mctx, f)
377
377
378 # The manifest merge handles conflicts on the manifest level. We want
378 # The manifest merge handles conflicts on the manifest level. We want
379 # to handle changes in largefile-ness of files at this level too.
379 # to handle changes in largefile-ness of files at this level too.
380 #
380 #
381 # The strategy is to run the original manifestmerge and then process
381 # The strategy is to run the original manifestmerge and then process
382 # the action list it outputs. There are two cases we need to deal with:
382 # the action list it outputs. There are two cases we need to deal with:
383 #
383 #
384 # 1. Normal file in p1, largefile in p2. Here the largefile is
384 # 1. Normal file in p1, largefile in p2. Here the largefile is
385 # detected via its standin file, which will enter the working copy
385 # detected via its standin file, which will enter the working copy
386 # with a "get" action. It is not "merge" since the standin is all
386 # with a "get" action. It is not "merge" since the standin is all
387 # Mercurial is concerned with at this level -- the link to the
387 # Mercurial is concerned with at this level -- the link to the
388 # existing normal file is not relevant here.
388 # existing normal file is not relevant here.
389 #
389 #
390 # 2. Largefile in p1, normal file in p2. Here we get a "merge" action
390 # 2. Largefile in p1, normal file in p2. Here we get a "merge" action
391 # since the largefile will be present in the working copy and
391 # since the largefile will be present in the working copy and
392 # different from the normal file in p2. Mercurial therefore
392 # different from the normal file in p2. Mercurial therefore
393 # triggers a merge action.
393 # triggers a merge action.
394 #
394 #
395 # In both cases, we prompt the user and emit new actions to either
395 # In both cases, we prompt the user and emit new actions to either
396 # remove the standin (if the normal file was kept) or to remove the
396 # remove the standin (if the normal file was kept) or to remove the
397 # normal file and get the standin (if the largefile was kept). The
397 # normal file and get the standin (if the largefile was kept). The
398 # default prompt answer is to use the largefile version since it was
398 # default prompt answer is to use the largefile version since it was
399 # presumably changed on purpose.
399 # presumably changed on purpose.
400 #
400 #
401 # Finally, the merge.applyupdates function will then take care of
401 # Finally, the merge.applyupdates function will then take care of
402 # writing the files into the working copy and lfcommands.updatelfiles
402 # writing the files into the working copy and lfcommands.updatelfiles
403 # will update the largefiles.
403 # will update the largefiles.
404 def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
404 def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force,
405 partial, acceptremote, followcopies):
405 partial, acceptremote, followcopies):
406 overwrite = force and not branchmerge
406 overwrite = force and not branchmerge
407 actions = origfn(repo, p1, p2, pas, branchmerge, force, partial,
407 actions = origfn(repo, p1, p2, pas, branchmerge, force, partial,
408 acceptremote, followcopies)
408 acceptremote, followcopies)
409
409
410 if overwrite:
410 if overwrite:
411 return actions
411 return actions
412
412
413 removes = set(a[0] for a in actions['r'])
413 removes = set(a[0] for a in actions['r'])
414
414
415 newglist = []
415 newglist = []
416 for action in actions['g']:
416 for action in actions['g']:
417 f, args, msg = action
417 f, args, msg = action
418 splitstandin = f and lfutil.splitstandin(f)
418 splitstandin = f and lfutil.splitstandin(f)
419 if (splitstandin is not None and
419 if (splitstandin is not None and
420 splitstandin in p1 and splitstandin not in removes):
420 splitstandin in p1 and splitstandin not in removes):
421 # Case 1: normal file in the working copy, largefile in
421 # Case 1: normal file in the working copy, largefile in
422 # the second parent
422 # the second parent
423 lfile = splitstandin
423 lfile = splitstandin
424 standin = f
424 standin = f
425 msg = _('remote turned local normal file %s into a largefile\n'
425 msg = _('remote turned local normal file %s into a largefile\n'
426 'use (l)argefile or keep (n)ormal file?'
426 'use (l)argefile or keep (n)ormal file?'
427 '$$ &Largefile $$ &Normal file') % lfile
427 '$$ &Largefile $$ &Normal file') % lfile
428 if repo.ui.promptchoice(msg, 0) == 0:
428 if repo.ui.promptchoice(msg, 0) == 0:
429 actions['r'].append((lfile, None, msg))
429 actions['r'].append((lfile, None, msg))
430 newglist.append((standin, (p2.flags(standin),), msg))
430 newglist.append((standin, (p2.flags(standin),), msg))
431 else:
431 else:
432 actions['r'].append((standin, None, msg))
432 actions['r'].append((standin, None, msg))
433 elif lfutil.standin(f) in p1 and lfutil.standin(f) not in removes:
433 elif lfutil.standin(f) in p1 and lfutil.standin(f) not in removes:
434 # Case 2: largefile in the working copy, normal file in
434 # Case 2: largefile in the working copy, normal file in
435 # the second parent
435 # the second parent
436 standin = lfutil.standin(f)
436 standin = lfutil.standin(f)
437 lfile = f
437 lfile = f
438 msg = _('remote turned local largefile %s into a normal file\n'
438 msg = _('remote turned local largefile %s into a normal file\n'
439 'keep (l)argefile or use (n)ormal file?'
439 'keep (l)argefile or use (n)ormal file?'
440 '$$ &Largefile $$ &Normal file') % lfile
440 '$$ &Largefile $$ &Normal file') % lfile
441 if repo.ui.promptchoice(msg, 0) == 0:
441 if repo.ui.promptchoice(msg, 0) == 0:
442 actions['r'].append((lfile, None, msg))
442 actions['r'].append((lfile, None, msg))
443 else:
443 else:
444 actions['r'].append((standin, None, msg))
444 actions['r'].append((standin, None, msg))
445 newglist.append((lfile, (p2.flags(lfile),), msg))
445 newglist.append((lfile, (p2.flags(lfile),), msg))
446 else:
446 else:
447 newglist.append(action)
447 newglist.append(action)
448
448
449 newglist.sort()
449 newglist.sort()
450 actions['g'] = newglist
450 actions['g'] = newglist
451
451
452 return actions
452 return actions
453
453
454 # Override filemerge to prompt the user about how they wish to merge
454 # Override filemerge to prompt the user about how they wish to merge
455 # largefiles. This will handle identical edits without prompting the user.
455 # largefiles. This will handle identical edits without prompting the user.
456 def overridefilemerge(origfn, repo, mynode, orig, fcd, fco, fca, labels=None):
456 def overridefilemerge(origfn, repo, mynode, orig, fcd, fco, fca, labels=None):
457 if not lfutil.isstandin(orig):
457 if not lfutil.isstandin(orig):
458 return origfn(repo, mynode, orig, fcd, fco, fca, labels=labels)
458 return origfn(repo, mynode, orig, fcd, fco, fca, labels=labels)
459
459
460 ahash = fca.data().strip().lower()
460 ahash = fca.data().strip().lower()
461 dhash = fcd.data().strip().lower()
461 dhash = fcd.data().strip().lower()
462 ohash = fco.data().strip().lower()
462 ohash = fco.data().strip().lower()
463 if (ohash != ahash and
463 if (ohash != ahash and
464 ohash != dhash and
464 ohash != dhash and
465 (dhash == ahash or
465 (dhash == ahash or
466 repo.ui.promptchoice(
466 repo.ui.promptchoice(
467 _('largefile %s has a merge conflict\nancestor was %s\n'
467 _('largefile %s has a merge conflict\nancestor was %s\n'
468 'keep (l)ocal %s or\ntake (o)ther %s?'
468 'keep (l)ocal %s or\ntake (o)ther %s?'
469 '$$ &Local $$ &Other') %
469 '$$ &Local $$ &Other') %
470 (lfutil.splitstandin(orig), ahash, dhash, ohash),
470 (lfutil.splitstandin(orig), ahash, dhash, ohash),
471 0) == 1)):
471 0) == 1)):
472 repo.wwrite(fcd.path(), fco.data(), fco.flags())
472 repo.wwrite(fcd.path(), fco.data(), fco.flags())
473 return 0
473 return 0
474
474
475 # Copy first changes the matchers to match standins instead of
475 # Copy first changes the matchers to match standins instead of
476 # largefiles. Then it overrides util.copyfile in that function it
476 # largefiles. Then it overrides util.copyfile in that function it
477 # checks if the destination largefile already exists. It also keeps a
477 # checks if the destination largefile already exists. It also keeps a
478 # list of copied files so that the largefiles can be copied and the
478 # list of copied files so that the largefiles can be copied and the
479 # dirstate updated.
479 # dirstate updated.
480 def overridecopy(orig, ui, repo, pats, opts, rename=False):
480 def overridecopy(orig, ui, repo, pats, opts, rename=False):
481 # doesn't remove largefile on rename
481 # doesn't remove largefile on rename
482 if len(pats) < 2:
482 if len(pats) < 2:
483 # this isn't legal, let the original function deal with it
483 # this isn't legal, let the original function deal with it
484 return orig(ui, repo, pats, opts, rename)
484 return orig(ui, repo, pats, opts, rename)
485
485
486 def makestandin(relpath):
486 def makestandin(relpath):
487 path = pathutil.canonpath(repo.root, repo.getcwd(), relpath)
487 path = pathutil.canonpath(repo.root, repo.getcwd(), relpath)
488 return os.path.join(repo.wjoin(lfutil.standin(path)))
488 return os.path.join(repo.wjoin(lfutil.standin(path)))
489
489
490 fullpats = scmutil.expandpats(pats)
490 fullpats = scmutil.expandpats(pats)
491 dest = fullpats[-1]
491 dest = fullpats[-1]
492
492
493 if os.path.isdir(dest):
493 if os.path.isdir(dest):
494 if not os.path.isdir(makestandin(dest)):
494 if not os.path.isdir(makestandin(dest)):
495 os.makedirs(makestandin(dest))
495 os.makedirs(makestandin(dest))
496 # This could copy both lfiles and normal files in one command,
496 # This could copy both lfiles and normal files in one command,
497 # but we don't want to do that. First replace their matcher to
497 # but we don't want to do that. First replace their matcher to
498 # only match normal files and run it, then replace it to just
498 # only match normal files and run it, then replace it to just
499 # match largefiles and run it again.
499 # match largefiles and run it again.
500 nonormalfiles = False
500 nonormalfiles = False
501 nolfiles = False
501 nolfiles = False
502 installnormalfilesmatchfn(repo[None].manifest())
502 installnormalfilesmatchfn(repo[None].manifest())
503 try:
503 try:
504 try:
504 try:
505 result = orig(ui, repo, pats, opts, rename)
505 result = orig(ui, repo, pats, opts, rename)
506 except util.Abort, e:
506 except util.Abort, e:
507 if str(e) != _('no files to copy'):
507 if str(e) != _('no files to copy'):
508 raise e
508 raise e
509 else:
509 else:
510 nonormalfiles = True
510 nonormalfiles = True
511 result = 0
511 result = 0
512 finally:
512 finally:
513 restorematchfn()
513 restorematchfn()
514
514
515 # The first rename can cause our current working directory to be removed.
515 # The first rename can cause our current working directory to be removed.
516 # In that case there is nothing left to copy/rename so just quit.
516 # In that case there is nothing left to copy/rename so just quit.
517 try:
517 try:
518 repo.getcwd()
518 repo.getcwd()
519 except OSError:
519 except OSError:
520 return result
520 return result
521
521
522 try:
522 try:
523 try:
523 try:
524 # When we call orig below it creates the standins but we don't add
524 # When we call orig below it creates the standins but we don't add
525 # them to the dir state until later so lock during that time.
525 # them to the dir state until later so lock during that time.
526 wlock = repo.wlock()
526 wlock = repo.wlock()
527
527
528 manifest = repo[None].manifest()
528 manifest = repo[None].manifest()
529 def overridematch(ctx, pats=[], opts={}, globbed=False,
529 def overridematch(ctx, pats=[], opts={}, globbed=False,
530 default='relpath'):
530 default='relpath'):
531 newpats = []
531 newpats = []
532 # The patterns were previously mangled to add the standin
532 # The patterns were previously mangled to add the standin
533 # directory; we need to remove that now
533 # directory; we need to remove that now
534 for pat in pats:
534 for pat in pats:
535 if match_.patkind(pat) is None and lfutil.shortname in pat:
535 if match_.patkind(pat) is None and lfutil.shortname in pat:
536 newpats.append(pat.replace(lfutil.shortname, ''))
536 newpats.append(pat.replace(lfutil.shortname, ''))
537 else:
537 else:
538 newpats.append(pat)
538 newpats.append(pat)
539 match = oldmatch(ctx, newpats, opts, globbed, default)
539 match = oldmatch(ctx, newpats, opts, globbed, default)
540 m = copy.copy(match)
540 m = copy.copy(match)
541 lfile = lambda f: lfutil.standin(f) in manifest
541 lfile = lambda f: lfutil.standin(f) in manifest
542 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
542 m._files = [lfutil.standin(f) for f in m._files if lfile(f)]
543 m._fmap = set(m._files)
543 m._fmap = set(m._files)
544 m._always = False
544 m._always = False
545 origmatchfn = m.matchfn
545 origmatchfn = m.matchfn
546 m.matchfn = lambda f: (lfutil.isstandin(f) and
546 m.matchfn = lambda f: (lfutil.isstandin(f) and
547 (f in manifest) and
547 (f in manifest) and
548 origmatchfn(lfutil.splitstandin(f)) or
548 origmatchfn(lfutil.splitstandin(f)) or
549 None)
549 None)
550 return m
550 return m
551 oldmatch = installmatchfn(overridematch)
551 oldmatch = installmatchfn(overridematch)
552 listpats = []
552 listpats = []
553 for pat in pats:
553 for pat in pats:
554 if match_.patkind(pat) is not None:
554 if match_.patkind(pat) is not None:
555 listpats.append(pat)
555 listpats.append(pat)
556 else:
556 else:
557 listpats.append(makestandin(pat))
557 listpats.append(makestandin(pat))
558
558
559 try:
559 try:
560 origcopyfile = util.copyfile
560 origcopyfile = util.copyfile
561 copiedfiles = []
561 copiedfiles = []
562 def overridecopyfile(src, dest):
562 def overridecopyfile(src, dest):
563 if (lfutil.shortname in src and
563 if (lfutil.shortname in src and
564 dest.startswith(repo.wjoin(lfutil.shortname))):
564 dest.startswith(repo.wjoin(lfutil.shortname))):
565 destlfile = dest.replace(lfutil.shortname, '')
565 destlfile = dest.replace(lfutil.shortname, '')
566 if not opts['force'] and os.path.exists(destlfile):
566 if not opts['force'] and os.path.exists(destlfile):
567 raise IOError('',
567 raise IOError('',
568 _('destination largefile already exists'))
568 _('destination largefile already exists'))
569 copiedfiles.append((src, dest))
569 copiedfiles.append((src, dest))
570 origcopyfile(src, dest)
570 origcopyfile(src, dest)
571
571
572 util.copyfile = overridecopyfile
572 util.copyfile = overridecopyfile
573 result += orig(ui, repo, listpats, opts, rename)
573 result += orig(ui, repo, listpats, opts, rename)
574 finally:
574 finally:
575 util.copyfile = origcopyfile
575 util.copyfile = origcopyfile
576
576
577 lfdirstate = lfutil.openlfdirstate(ui, repo)
577 lfdirstate = lfutil.openlfdirstate(ui, repo)
578 for (src, dest) in copiedfiles:
578 for (src, dest) in copiedfiles:
579 if (lfutil.shortname in src and
579 if (lfutil.shortname in src and
580 dest.startswith(repo.wjoin(lfutil.shortname))):
580 dest.startswith(repo.wjoin(lfutil.shortname))):
581 srclfile = src.replace(repo.wjoin(lfutil.standin('')), '')
581 srclfile = src.replace(repo.wjoin(lfutil.standin('')), '')
582 destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '')
582 destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '')
583 destlfiledir = os.path.dirname(repo.wjoin(destlfile)) or '.'
583 destlfiledir = os.path.dirname(repo.wjoin(destlfile)) or '.'
584 if not os.path.isdir(destlfiledir):
584 if not os.path.isdir(destlfiledir):
585 os.makedirs(destlfiledir)
585 os.makedirs(destlfiledir)
586 if rename:
586 if rename:
587 os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile))
587 os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile))
588
588
589 # The file is gone, but this deletes any empty parent
589 # The file is gone, but this deletes any empty parent
590 # directories as a side-effect.
590 # directories as a side-effect.
591 util.unlinkpath(repo.wjoin(srclfile), True)
591 util.unlinkpath(repo.wjoin(srclfile), True)
592 lfdirstate.remove(srclfile)
592 lfdirstate.remove(srclfile)
593 else:
593 else:
594 util.copyfile(repo.wjoin(srclfile),
594 util.copyfile(repo.wjoin(srclfile),
595 repo.wjoin(destlfile))
595 repo.wjoin(destlfile))
596
596
597 lfdirstate.add(destlfile)
597 lfdirstate.add(destlfile)
598 lfdirstate.write()
598 lfdirstate.write()
599 except util.Abort, e:
599 except util.Abort, e:
600 if str(e) != _('no files to copy'):
600 if str(e) != _('no files to copy'):
601 raise e
601 raise e
602 else:
602 else:
603 nolfiles = True
603 nolfiles = True
604 finally:
604 finally:
605 restorematchfn()
605 restorematchfn()
606 wlock.release()
606 wlock.release()
607
607
608 if nolfiles and nonormalfiles:
608 if nolfiles and nonormalfiles:
609 raise util.Abort(_('no files to copy'))
609 raise util.Abort(_('no files to copy'))
610
610
611 return result
611 return result
612
612
613 # When the user calls revert, we have to be careful to not revert any
613 # When the user calls revert, we have to be careful to not revert any
614 # changes to other largefiles accidentally. This means we have to keep
614 # changes to other largefiles accidentally. This means we have to keep
615 # track of the largefiles that are being reverted so we only pull down
615 # track of the largefiles that are being reverted so we only pull down
616 # the necessary largefiles.
616 # the necessary largefiles.
617 #
617 #
618 # Standins are only updated (to match the hash of largefiles) before
618 # Standins are only updated (to match the hash of largefiles) before
619 # commits. Update the standins then run the original revert, changing
619 # commits. Update the standins then run the original revert, changing
620 # the matcher to hit standins instead of largefiles. Based on the
620 # the matcher to hit standins instead of largefiles. Based on the
621 # resulting standins update the largefiles.
621 # resulting standins update the largefiles.
622 def overriderevert(orig, ui, repo, *pats, **opts):
622 def overriderevert(orig, ui, repo, *pats, **opts):
623 # Because we put the standins in a bad state (by updating them)
623 # Because we put the standins in a bad state (by updating them)
624 # and then return them to a correct state we need to lock to
624 # and then return them to a correct state we need to lock to
625 # prevent others from changing them in their incorrect state.
625 # prevent others from changing them in their incorrect state.
626 wlock = repo.wlock()
626 wlock = repo.wlock()
627 try:
627 try:
628 lfdirstate = lfutil.openlfdirstate(ui, repo)
628 lfdirstate = lfutil.openlfdirstate(ui, repo)
629 (modified, added, removed, missing, unknown, ignored, clean) = \
629 (modified, added, removed, missing, unknown, ignored, clean) = \
630 lfutil.lfdirstatestatus(lfdirstate, repo, repo['.'].rev())
630 lfutil.lfdirstatestatus(lfdirstate, repo, repo['.'].rev())
631 lfdirstate.write()
631 lfdirstate.write()
632 for lfile in modified:
632 for lfile in modified:
633 lfutil.updatestandin(repo, lfutil.standin(lfile))
633 lfutil.updatestandin(repo, lfutil.standin(lfile))
634 for lfile in missing:
634 for lfile in missing:
635 if (os.path.exists(repo.wjoin(lfutil.standin(lfile)))):
635 if (os.path.exists(repo.wjoin(lfutil.standin(lfile)))):
636 os.unlink(repo.wjoin(lfutil.standin(lfile)))
636 os.unlink(repo.wjoin(lfutil.standin(lfile)))
637
637
638 oldstandins = lfutil.getstandinsstate(repo)
638 oldstandins = lfutil.getstandinsstate(repo)
639
639
640 def overridematch(ctx, pats=[], opts={}, globbed=False,
640 def overridematch(ctx, pats=[], opts={}, globbed=False,
641 default='relpath'):
641 default='relpath'):
642 match = oldmatch(ctx, pats, opts, globbed, default)
642 match = oldmatch(ctx, pats, opts, globbed, default)
643 m = copy.copy(match)
643 m = copy.copy(match)
644 def tostandin(f):
644 def tostandin(f):
645 if lfutil.standin(f) in ctx:
645 if lfutil.standin(f) in ctx:
646 return lfutil.standin(f)
646 return lfutil.standin(f)
647 elif lfutil.standin(f) in repo[None]:
647 elif lfutil.standin(f) in repo[None]:
648 return None
648 return None
649 return f
649 return f
650 m._files = [tostandin(f) for f in m._files]
650 m._files = [tostandin(f) for f in m._files]
651 m._files = [f for f in m._files if f is not None]
651 m._files = [f for f in m._files if f is not None]
652 m._fmap = set(m._files)
652 m._fmap = set(m._files)
653 m._always = False
653 m._always = False
654 origmatchfn = m.matchfn
654 origmatchfn = m.matchfn
655 def matchfn(f):
655 def matchfn(f):
656 if lfutil.isstandin(f):
656 if lfutil.isstandin(f):
657 return (origmatchfn(lfutil.splitstandin(f)) and
657 return (origmatchfn(lfutil.splitstandin(f)) and
658 (f in repo[None] or f in ctx))
658 (f in repo[None] or f in ctx))
659 return origmatchfn(f)
659 return origmatchfn(f)
660 m.matchfn = matchfn
660 m.matchfn = matchfn
661 return m
661 return m
662 oldmatch = installmatchfn(overridematch)
662 oldmatch = installmatchfn(overridematch)
663 try:
663 try:
664 orig(ui, repo, *pats, **opts)
664 orig(ui, repo, *pats, **opts)
665 finally:
665 finally:
666 restorematchfn()
666 restorematchfn()
667
667
668 newstandins = lfutil.getstandinsstate(repo)
668 newstandins = lfutil.getstandinsstate(repo)
669 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
669 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
670 lfcommands.updatelfiles(ui, repo, filelist, printmessage=False)
670 lfcommands.updatelfiles(ui, repo, filelist, printmessage=False)
671
671
672 finally:
672 finally:
673 wlock.release()
673 wlock.release()
674
674
675 def hgupdaterepo(orig, repo, node, overwrite):
675 def hgupdaterepo(orig, repo, node, overwrite):
676 if not overwrite:
676 if not overwrite:
677 # Only call updatelfiles on the standins that have changed to save time
677 # Only call updatelfiles on the standins that have changed to save time
678 oldstandins = lfutil.getstandinsstate(repo)
678 oldstandins = lfutil.getstandinsstate(repo)
679
679
680 result = orig(repo, node, overwrite)
680 result = orig(repo, node, overwrite)
681
681
682 filelist = None
682 filelist = None
683 if not overwrite:
683 if not overwrite:
684 newstandins = lfutil.getstandinsstate(repo)
684 newstandins = lfutil.getstandinsstate(repo)
685 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
685 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
686 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist)
686 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist)
687 return result
687 return result
688
688
689 def hgmerge(orig, repo, node, force=None, remind=True):
689 def hgmerge(orig, repo, node, force=None, remind=True):
690 result = orig(repo, node, force, remind)
690 result = orig(repo, node, force, remind)
691 lfcommands.updatelfiles(repo.ui, repo)
691 lfcommands.updatelfiles(repo.ui, repo)
692 return result
692 return result
693
693
694 # When we rebase a repository with remotely changed largefiles, we need to
694 # When we rebase a repository with remotely changed largefiles, we need to
695 # take some extra care so that the largefiles are correctly updated in the
695 # take some extra care so that the largefiles are correctly updated in the
696 # working copy
696 # working copy
697 def overridepull(orig, ui, repo, source=None, **opts):
697 def overridepull(orig, ui, repo, source=None, **opts):
698 revsprepull = len(repo)
698 revsprepull = len(repo)
699 if not source:
699 if not source:
700 source = 'default'
700 source = 'default'
701 repo.lfpullsource = source
701 repo.lfpullsource = source
702 if opts.get('rebase', False):
702 if opts.get('rebase', False):
703 repo._isrebasing = True
703 repo._isrebasing = True
704 try:
704 try:
705 if opts.get('update'):
705 if opts.get('update'):
706 del opts['update']
706 del opts['update']
707 ui.debug('--update and --rebase are not compatible, ignoring '
707 ui.debug('--update and --rebase are not compatible, ignoring '
708 'the update flag\n')
708 'the update flag\n')
709 del opts['rebase']
709 del opts['rebase']
710 origpostincoming = commands.postincoming
710 origpostincoming = commands.postincoming
711 def _dummy(*args, **kwargs):
711 def _dummy(*args, **kwargs):
712 pass
712 pass
713 commands.postincoming = _dummy
713 commands.postincoming = _dummy
714 try:
714 try:
715 result = commands.pull(ui, repo, source, **opts)
715 result = commands.pull(ui, repo, source, **opts)
716 finally:
716 finally:
717 commands.postincoming = origpostincoming
717 commands.postincoming = origpostincoming
718 revspostpull = len(repo)
718 revspostpull = len(repo)
719 if revspostpull > revsprepull:
719 if revspostpull > revsprepull:
720 result = result or rebase.rebase(ui, repo)
720 result = result or rebase.rebase(ui, repo)
721 finally:
721 finally:
722 repo._isrebasing = False
722 repo._isrebasing = False
723 else:
723 else:
724 result = orig(ui, repo, source, **opts)
724 result = orig(ui, repo, source, **opts)
725 revspostpull = len(repo)
725 revspostpull = len(repo)
726 lfrevs = opts.get('lfrev', [])
726 lfrevs = opts.get('lfrev', [])
727 if opts.get('all_largefiles'):
727 if opts.get('all_largefiles'):
728 lfrevs.append('pulled()')
728 lfrevs.append('pulled()')
729 if lfrevs and revspostpull > revsprepull:
729 if lfrevs and revspostpull > revsprepull:
730 numcached = 0
730 numcached = 0
731 repo.firstpulled = revsprepull # for pulled() revset expression
731 repo.firstpulled = revsprepull # for pulled() revset expression
732 try:
732 try:
733 for rev in scmutil.revrange(repo, lfrevs):
733 for rev in scmutil.revrange(repo, lfrevs):
734 ui.note(_('pulling largefiles for revision %s\n') % rev)
734 ui.note(_('pulling largefiles for revision %s\n') % rev)
735 (cached, missing) = lfcommands.cachelfiles(ui, repo, rev)
735 (cached, missing) = lfcommands.cachelfiles(ui, repo, rev)
736 numcached += len(cached)
736 numcached += len(cached)
737 finally:
737 finally:
738 del repo.firstpulled
738 del repo.firstpulled
739 ui.status(_("%d largefiles cached\n") % numcached)
739 ui.status(_("%d largefiles cached\n") % numcached)
740 return result
740 return result
741
741
742 def pulledrevsetsymbol(repo, subset, x):
742 def pulledrevsetsymbol(repo, subset, x):
743 """``pulled()``
743 """``pulled()``
744 Changesets that just has been pulled.
744 Changesets that just has been pulled.
745
745
746 Only available with largefiles from pull --lfrev expressions.
746 Only available with largefiles from pull --lfrev expressions.
747
747
748 .. container:: verbose
748 .. container:: verbose
749
749
750 Some examples:
750 Some examples:
751
751
752 - pull largefiles for all new changesets::
752 - pull largefiles for all new changesets::
753
753
754 hg pull -lfrev "pulled()"
754 hg pull -lfrev "pulled()"
755
755
756 - pull largefiles for all new branch heads::
756 - pull largefiles for all new branch heads::
757
757
758 hg pull -lfrev "head(pulled()) and not closed()"
758 hg pull -lfrev "head(pulled()) and not closed()"
759
759
760 """
760 """
761
761
762 try:
762 try:
763 firstpulled = repo.firstpulled
763 firstpulled = repo.firstpulled
764 except AttributeError:
764 except AttributeError:
765 raise util.Abort(_("pulled() only available in --lfrev"))
765 raise util.Abort(_("pulled() only available in --lfrev"))
766 return revset.baseset([r for r in subset if r >= firstpulled])
766 return revset.baseset([r for r in subset if r >= firstpulled])
767
767
768 def overrideclone(orig, ui, source, dest=None, **opts):
768 def overrideclone(orig, ui, source, dest=None, **opts):
769 d = dest
769 d = dest
770 if d is None:
770 if d is None:
771 d = hg.defaultdest(source)
771 d = hg.defaultdest(source)
772 if opts.get('all_largefiles') and not hg.islocal(d):
772 if opts.get('all_largefiles') and not hg.islocal(d):
773 raise util.Abort(_(
773 raise util.Abort(_(
774 '--all-largefiles is incompatible with non-local destination %s') %
774 '--all-largefiles is incompatible with non-local destination %s') %
775 d)
775 d)
776
776
777 return orig(ui, source, dest, **opts)
777 return orig(ui, source, dest, **opts)
778
778
779 def hgclone(orig, ui, opts, *args, **kwargs):
779 def hgclone(orig, ui, opts, *args, **kwargs):
780 result = orig(ui, opts, *args, **kwargs)
780 result = orig(ui, opts, *args, **kwargs)
781
781
782 if result is not None:
782 if result is not None:
783 sourcerepo, destrepo = result
783 sourcerepo, destrepo = result
784 repo = destrepo.local()
784 repo = destrepo.local()
785
785
786 # Caching is implicitly limited to 'rev' option, since the dest repo was
786 # Caching is implicitly limited to 'rev' option, since the dest repo was
787 # truncated at that point. The user may expect a download count with
787 # truncated at that point. The user may expect a download count with
788 # this option, so attempt whether or not this is a largefile repo.
788 # this option, so attempt whether or not this is a largefile repo.
789 if opts.get('all_largefiles'):
789 if opts.get('all_largefiles'):
790 success, missing = lfcommands.downloadlfiles(ui, repo, None)
790 success, missing = lfcommands.downloadlfiles(ui, repo, None)
791
791
792 if missing != 0:
792 if missing != 0:
793 return None
793 return None
794
794
795 return result
795 return result
796
796
797 def overriderebase(orig, ui, repo, **opts):
797 def overriderebase(orig, ui, repo, **opts):
798 repo._isrebasing = True
798 repo._isrebasing = True
799 try:
799 try:
800 return orig(ui, repo, **opts)
800 return orig(ui, repo, **opts)
801 finally:
801 finally:
802 repo._isrebasing = False
802 repo._isrebasing = False
803
803
804 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
804 def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None,
805 prefix=None, mtime=None, subrepos=None):
805 prefix=None, mtime=None, subrepos=None):
806 # No need to lock because we are only reading history and
806 # No need to lock because we are only reading history and
807 # largefile caches, neither of which are modified.
807 # largefile caches, neither of which are modified.
808 lfcommands.cachelfiles(repo.ui, repo, node)
808 lfcommands.cachelfiles(repo.ui, repo, node)
809
809
810 if kind not in archival.archivers:
810 if kind not in archival.archivers:
811 raise util.Abort(_("unknown archive type '%s'") % kind)
811 raise util.Abort(_("unknown archive type '%s'") % kind)
812
812
813 ctx = repo[node]
813 ctx = repo[node]
814
814
815 if kind == 'files':
815 if kind == 'files':
816 if prefix:
816 if prefix:
817 raise util.Abort(
817 raise util.Abort(
818 _('cannot give prefix when archiving to files'))
818 _('cannot give prefix when archiving to files'))
819 else:
819 else:
820 prefix = archival.tidyprefix(dest, kind, prefix)
820 prefix = archival.tidyprefix(dest, kind, prefix)
821
821
822 def write(name, mode, islink, getdata):
822 def write(name, mode, islink, getdata):
823 if matchfn and not matchfn(name):
823 if matchfn and not matchfn(name):
824 return
824 return
825 data = getdata()
825 data = getdata()
826 if decode:
826 if decode:
827 data = repo.wwritedata(name, data)
827 data = repo.wwritedata(name, data)
828 archiver.addfile(prefix + name, mode, islink, data)
828 archiver.addfile(prefix + name, mode, islink, data)
829
829
830 archiver = archival.archivers[kind](dest, mtime or ctx.date()[0])
830 archiver = archival.archivers[kind](dest, mtime or ctx.date()[0])
831
831
832 if repo.ui.configbool("ui", "archivemeta", True):
832 if repo.ui.configbool("ui", "archivemeta", True):
833 def metadata():
833 def metadata():
834 base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
834 base = 'repo: %s\nnode: %s\nbranch: %s\n' % (
835 hex(repo.changelog.node(0)), hex(node), ctx.branch())
835 hex(repo.changelog.node(0)), hex(node), ctx.branch())
836
836
837 tags = ''.join('tag: %s\n' % t for t in ctx.tags()
837 tags = ''.join('tag: %s\n' % t for t in ctx.tags()
838 if repo.tagtype(t) == 'global')
838 if repo.tagtype(t) == 'global')
839 if not tags:
839 if not tags:
840 repo.ui.pushbuffer()
840 repo.ui.pushbuffer()
841 opts = {'template': '{latesttag}\n{latesttagdistance}',
841 opts = {'template': '{latesttag}\n{latesttagdistance}',
842 'style': '', 'patch': None, 'git': None}
842 'style': '', 'patch': None, 'git': None}
843 cmdutil.show_changeset(repo.ui, repo, opts).show(ctx)
843 cmdutil.show_changeset(repo.ui, repo, opts).show(ctx)
844 ltags, dist = repo.ui.popbuffer().split('\n')
844 ltags, dist = repo.ui.popbuffer().split('\n')
845 tags = ''.join('latesttag: %s\n' % t for t in ltags.split(':'))
845 tags = ''.join('latesttag: %s\n' % t for t in ltags.split(':'))
846 tags += 'latesttagdistance: %s\n' % dist
846 tags += 'latesttagdistance: %s\n' % dist
847
847
848 return base + tags
848 return base + tags
849
849
850 write('.hg_archival.txt', 0644, False, metadata)
850 write('.hg_archival.txt', 0644, False, metadata)
851
851
852 for f in ctx:
852 for f in ctx:
853 ff = ctx.flags(f)
853 ff = ctx.flags(f)
854 getdata = ctx[f].data
854 getdata = ctx[f].data
855 if lfutil.isstandin(f):
855 if lfutil.isstandin(f):
856 path = lfutil.findfile(repo, getdata().strip())
856 path = lfutil.findfile(repo, getdata().strip())
857 if path is None:
857 if path is None:
858 raise util.Abort(
858 raise util.Abort(
859 _('largefile %s not found in repo store or system cache')
859 _('largefile %s not found in repo store or system cache')
860 % lfutil.splitstandin(f))
860 % lfutil.splitstandin(f))
861 f = lfutil.splitstandin(f)
861 f = lfutil.splitstandin(f)
862
862
863 def getdatafn():
863 def getdatafn():
864 fd = None
864 fd = None
865 try:
865 try:
866 fd = open(path, 'rb')
866 fd = open(path, 'rb')
867 return fd.read()
867 return fd.read()
868 finally:
868 finally:
869 if fd:
869 if fd:
870 fd.close()
870 fd.close()
871
871
872 getdata = getdatafn
872 getdata = getdatafn
873 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
873 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
874
874
875 if subrepos:
875 if subrepos:
876 for subpath in sorted(ctx.substate):
876 for subpath in sorted(ctx.substate):
877 sub = ctx.sub(subpath)
877 sub = ctx.sub(subpath)
878 submatch = match_.narrowmatcher(subpath, matchfn)
878 submatch = match_.narrowmatcher(subpath, matchfn)
879 sub.archive(repo.ui, archiver, prefix, submatch)
879 sub.archive(repo.ui, archiver, prefix, submatch)
880
880
881 archiver.done()
881 archiver.done()
882
882
883 def hgsubrepoarchive(orig, repo, ui, archiver, prefix, match=None):
883 def hgsubrepoarchive(orig, repo, ui, archiver, prefix, match=None):
884 repo._get(repo._state + ('hg',))
884 repo._get(repo._state + ('hg',))
885 rev = repo._state[1]
885 rev = repo._state[1]
886 ctx = repo._repo[rev]
886 ctx = repo._repo[rev]
887
887
888 lfcommands.cachelfiles(ui, repo._repo, ctx.node())
888 lfcommands.cachelfiles(ui, repo._repo, ctx.node())
889
889
890 def write(name, mode, islink, getdata):
890 def write(name, mode, islink, getdata):
891 # At this point, the standin has been replaced with the largefile name,
891 # At this point, the standin has been replaced with the largefile name,
892 # so the normal matcher works here without the lfutil variants.
892 # so the normal matcher works here without the lfutil variants.
893 if match and not match(f):
893 if match and not match(f):
894 return
894 return
895 data = getdata()
895 data = getdata()
896
896
897 archiver.addfile(prefix + repo._path + '/' + name, mode, islink, data)
897 archiver.addfile(prefix + repo._path + '/' + name, mode, islink, data)
898
898
899 for f in ctx:
899 for f in ctx:
900 ff = ctx.flags(f)
900 ff = ctx.flags(f)
901 getdata = ctx[f].data
901 getdata = ctx[f].data
902 if lfutil.isstandin(f):
902 if lfutil.isstandin(f):
903 path = lfutil.findfile(repo._repo, getdata().strip())
903 path = lfutil.findfile(repo._repo, getdata().strip())
904 if path is None:
904 if path is None:
905 raise util.Abort(
905 raise util.Abort(
906 _('largefile %s not found in repo store or system cache')
906 _('largefile %s not found in repo store or system cache')
907 % lfutil.splitstandin(f))
907 % lfutil.splitstandin(f))
908 f = lfutil.splitstandin(f)
908 f = lfutil.splitstandin(f)
909
909
910 def getdatafn():
910 def getdatafn():
911 fd = None
911 fd = None
912 try:
912 try:
913 fd = open(os.path.join(prefix, path), 'rb')
913 fd = open(os.path.join(prefix, path), 'rb')
914 return fd.read()
914 return fd.read()
915 finally:
915 finally:
916 if fd:
916 if fd:
917 fd.close()
917 fd.close()
918
918
919 getdata = getdatafn
919 getdata = getdatafn
920
920
921 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
921 write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata)
922
922
923 for subpath in sorted(ctx.substate):
923 for subpath in sorted(ctx.substate):
924 sub = ctx.sub(subpath)
924 sub = ctx.sub(subpath)
925 submatch = match_.narrowmatcher(subpath, match)
925 submatch = match_.narrowmatcher(subpath, match)
926 sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/',
926 sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/',
927 submatch)
927 submatch)
928
928
929 # If a largefile is modified, the change is not reflected in its
929 # If a largefile is modified, the change is not reflected in its
930 # standin until a commit. cmdutil.bailifchanged() raises an exception
930 # standin until a commit. cmdutil.bailifchanged() raises an exception
931 # if the repo has uncommitted changes. Wrap it to also check if
931 # if the repo has uncommitted changes. Wrap it to also check if
932 # largefiles were changed. This is used by bisect and backout.
932 # largefiles were changed. This is used by bisect and backout.
933 def overridebailifchanged(orig, repo):
933 def overridebailifchanged(orig, repo):
934 orig(repo)
934 orig(repo)
935 repo.lfstatus = True
935 repo.lfstatus = True
936 modified, added, removed, deleted = repo.status()[:4]
936 modified, added, removed, deleted = repo.status()[:4]
937 repo.lfstatus = False
937 repo.lfstatus = False
938 if modified or added or removed or deleted:
938 if modified or added or removed or deleted:
939 raise util.Abort(_('uncommitted changes'))
939 raise util.Abort(_('uncommitted changes'))
940
940
941 # Fetch doesn't use cmdutil.bailifchanged so override it to add the check
941 # Fetch doesn't use cmdutil.bailifchanged so override it to add the check
942 def overridefetch(orig, ui, repo, *pats, **opts):
942 def overridefetch(orig, ui, repo, *pats, **opts):
943 repo.lfstatus = True
943 repo.lfstatus = True
944 modified, added, removed, deleted = repo.status()[:4]
944 modified, added, removed, deleted = repo.status()[:4]
945 repo.lfstatus = False
945 repo.lfstatus = False
946 if modified or added or removed or deleted:
946 if modified or added or removed or deleted:
947 raise util.Abort(_('uncommitted changes'))
947 raise util.Abort(_('uncommitted changes'))
948 return orig(ui, repo, *pats, **opts)
948 return orig(ui, repo, *pats, **opts)
949
949
950 def overrideforget(orig, ui, repo, *pats, **opts):
950 def overrideforget(orig, ui, repo, *pats, **opts):
951 installnormalfilesmatchfn(repo[None].manifest())
951 installnormalfilesmatchfn(repo[None].manifest())
952 result = orig(ui, repo, *pats, **opts)
952 result = orig(ui, repo, *pats, **opts)
953 restorematchfn()
953 restorematchfn()
954 m = scmutil.match(repo[None], pats, opts)
954 m = scmutil.match(repo[None], pats, opts)
955
955
956 try:
956 try:
957 repo.lfstatus = True
957 repo.lfstatus = True
958 s = repo.status(match=m, clean=True)
958 s = repo.status(match=m, clean=True)
959 finally:
959 finally:
960 repo.lfstatus = False
960 repo.lfstatus = False
961 forget = sorted(s[0] + s[1] + s[3] + s[6])
961 forget = sorted(s[0] + s[1] + s[3] + s[6])
962 forget = [f for f in forget if lfutil.standin(f) in repo[None].manifest()]
962 forget = [f for f in forget if lfutil.standin(f) in repo[None].manifest()]
963
963
964 for f in forget:
964 for f in forget:
965 if lfutil.standin(f) not in repo.dirstate and not \
965 if lfutil.standin(f) not in repo.dirstate and not \
966 os.path.isdir(m.rel(lfutil.standin(f))):
966 os.path.isdir(m.rel(lfutil.standin(f))):
967 ui.warn(_('not removing %s: file is already untracked\n')
967 ui.warn(_('not removing %s: file is already untracked\n')
968 % m.rel(f))
968 % m.rel(f))
969 result = 1
969 result = 1
970
970
971 for f in forget:
971 for f in forget:
972 if ui.verbose or not m.exact(f):
972 if ui.verbose or not m.exact(f):
973 ui.status(_('removing %s\n') % m.rel(f))
973 ui.status(_('removing %s\n') % m.rel(f))
974
974
975 # Need to lock because standin files are deleted then removed from the
975 # Need to lock because standin files are deleted then removed from the
976 # repository and we could race in-between.
976 # repository and we could race in-between.
977 wlock = repo.wlock()
977 wlock = repo.wlock()
978 try:
978 try:
979 lfdirstate = lfutil.openlfdirstate(ui, repo)
979 lfdirstate = lfutil.openlfdirstate(ui, repo)
980 for f in forget:
980 for f in forget:
981 if lfdirstate[f] == 'a':
981 if lfdirstate[f] == 'a':
982 lfdirstate.drop(f)
982 lfdirstate.drop(f)
983 else:
983 else:
984 lfdirstate.remove(f)
984 lfdirstate.remove(f)
985 lfdirstate.write()
985 lfdirstate.write()
986 standins = [lfutil.standin(f) for f in forget]
986 standins = [lfutil.standin(f) for f in forget]
987 for f in standins:
987 for f in standins:
988 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
988 util.unlinkpath(repo.wjoin(f), ignoremissing=True)
989 repo[None].forget(standins)
989 repo[None].forget(standins)
990 finally:
990 finally:
991 wlock.release()
991 wlock.release()
992
992
993 return result
993 return result
994
994
995 def _getoutgoings(repo, missing, addfunc):
995 def _getoutgoings(repo, missing, addfunc):
996 """get pairs of filename and largefile hash in outgoing revisions
996 """get pairs of filename and largefile hash in outgoing revisions
997 in 'missing'.
997 in 'missing'.
998
998
999 'addfunc' is invoked with each unique pairs of filename and
999 'addfunc' is invoked with each unique pairs of filename and
1000 largefile hash value.
1000 largefile hash value.
1001 """
1001 """
1002 knowns = set()
1002 knowns = set()
1003 def dedup(fn, lfhash):
1003 def dedup(fn, lfhash):
1004 k = (fn, lfhash)
1004 k = (fn, lfhash)
1005 if k not in knowns:
1005 if k not in knowns:
1006 knowns.add(k)
1006 knowns.add(k)
1007 addfunc(fn, lfhash)
1007 addfunc(fn, lfhash)
1008 lfutil.getlfilestoupload(repo, missing, dedup)
1008 lfutil.getlfilestoupload(repo, missing, dedup)
1009
1009
1010 def outgoinghook(ui, repo, other, opts, missing):
1010 def outgoinghook(ui, repo, other, opts, missing):
1011 if opts.pop('large', None):
1011 if opts.pop('large', None):
1012 toupload = set()
1012 lfhashes = set()
1013 lfutil.getlfilestoupload(repo, missing,
1013 if ui.debugflag:
1014 lambda fn, lfhash: toupload.add(fn))
1014 toupload = {}
1015 def addfunc(fn, lfhash):
1016 if fn not in toupload:
1017 toupload[fn] = []
1018 toupload[fn].append(lfhash)
1019 lfhashes.add(lfhash)
1020 def showhashes(fn):
1021 for lfhash in sorted(toupload[fn]):
1022 ui.debug(' %s\n' % (lfhash))
1023 else:
1024 toupload = set()
1025 def addfunc(fn, lfhash):
1026 toupload.add(fn)
1027 lfhashes.add(lfhash)
1028 def showhashes(fn):
1029 pass
1030 _getoutgoings(repo, missing, addfunc)
1031
1015 if not toupload:
1032 if not toupload:
1016 ui.status(_('largefiles: no files to upload\n'))
1033 ui.status(_('largefiles: no files to upload\n'))
1017 else:
1034 else:
1018 ui.status(_('largefiles to upload:\n'))
1035 ui.status(_('largefiles to upload (%d entities):\n')
1036 % (len(lfhashes)))
1019 for file in sorted(toupload):
1037 for file in sorted(toupload):
1020 ui.status(lfutil.splitstandin(file) + '\n')
1038 ui.status(lfutil.splitstandin(file) + '\n')
1039 showhashes(file)
1021 ui.status('\n')
1040 ui.status('\n')
1022
1041
1023 def summaryremotehook(ui, repo, opts, changes):
1042 def summaryremotehook(ui, repo, opts, changes):
1024 largeopt = opts.get('large', False)
1043 largeopt = opts.get('large', False)
1025 if changes is None:
1044 if changes is None:
1026 if largeopt:
1045 if largeopt:
1027 return (False, True) # only outgoing check is needed
1046 return (False, True) # only outgoing check is needed
1028 else:
1047 else:
1029 return (False, False)
1048 return (False, False)
1030 elif largeopt:
1049 elif largeopt:
1031 url, branch, peer, outgoing = changes[1]
1050 url, branch, peer, outgoing = changes[1]
1032 if peer is None:
1051 if peer is None:
1033 # i18n: column positioning for "hg summary"
1052 # i18n: column positioning for "hg summary"
1034 ui.status(_('largefiles: (no remote repo)\n'))
1053 ui.status(_('largefiles: (no remote repo)\n'))
1035 return
1054 return
1036
1055
1037 toupload = set()
1056 toupload = set()
1038 lfhashes = set()
1057 lfhashes = set()
1039 def addfunc(fn, lfhash):
1058 def addfunc(fn, lfhash):
1040 toupload.add(fn)
1059 toupload.add(fn)
1041 lfhashes.add(lfhash)
1060 lfhashes.add(lfhash)
1042 _getoutgoings(repo, outgoing.missing, addfunc)
1061 _getoutgoings(repo, outgoing.missing, addfunc)
1043
1062
1044 if not toupload:
1063 if not toupload:
1045 # i18n: column positioning for "hg summary"
1064 # i18n: column positioning for "hg summary"
1046 ui.status(_('largefiles: (no files to upload)\n'))
1065 ui.status(_('largefiles: (no files to upload)\n'))
1047 else:
1066 else:
1048 # i18n: column positioning for "hg summary"
1067 # i18n: column positioning for "hg summary"
1049 ui.status(_('largefiles: %d entities for %d files to upload\n')
1068 ui.status(_('largefiles: %d entities for %d files to upload\n')
1050 % (len(lfhashes), len(toupload)))
1069 % (len(lfhashes), len(toupload)))
1051
1070
1052 def overridesummary(orig, ui, repo, *pats, **opts):
1071 def overridesummary(orig, ui, repo, *pats, **opts):
1053 try:
1072 try:
1054 repo.lfstatus = True
1073 repo.lfstatus = True
1055 orig(ui, repo, *pats, **opts)
1074 orig(ui, repo, *pats, **opts)
1056 finally:
1075 finally:
1057 repo.lfstatus = False
1076 repo.lfstatus = False
1058
1077
1059 def scmutiladdremove(orig, repo, pats=[], opts={}, dry_run=None,
1078 def scmutiladdremove(orig, repo, pats=[], opts={}, dry_run=None,
1060 similarity=None):
1079 similarity=None):
1061 if not lfutil.islfilesrepo(repo):
1080 if not lfutil.islfilesrepo(repo):
1062 return orig(repo, pats, opts, dry_run, similarity)
1081 return orig(repo, pats, opts, dry_run, similarity)
1063 # Get the list of missing largefiles so we can remove them
1082 # Get the list of missing largefiles so we can remove them
1064 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1083 lfdirstate = lfutil.openlfdirstate(repo.ui, repo)
1065 s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False,
1084 s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False,
1066 False, False)
1085 False, False)
1067 (unsure, modified, added, removed, missing, unknown, ignored, clean) = s
1086 (unsure, modified, added, removed, missing, unknown, ignored, clean) = s
1068
1087
1069 # Call into the normal remove code, but the removing of the standin, we want
1088 # Call into the normal remove code, but the removing of the standin, we want
1070 # to have handled by original addremove. Monkey patching here makes sure
1089 # to have handled by original addremove. Monkey patching here makes sure
1071 # we don't remove the standin in the largefiles code, preventing a very
1090 # we don't remove the standin in the largefiles code, preventing a very
1072 # confused state later.
1091 # confused state later.
1073 if missing:
1092 if missing:
1074 m = [repo.wjoin(f) for f in missing]
1093 m = [repo.wjoin(f) for f in missing]
1075 repo._isaddremove = True
1094 repo._isaddremove = True
1076 removelargefiles(repo.ui, repo, *m, **opts)
1095 removelargefiles(repo.ui, repo, *m, **opts)
1077 repo._isaddremove = False
1096 repo._isaddremove = False
1078 # Call into the normal add code, and any files that *should* be added as
1097 # Call into the normal add code, and any files that *should* be added as
1079 # largefiles will be
1098 # largefiles will be
1080 addlargefiles(repo.ui, repo, *pats, **opts)
1099 addlargefiles(repo.ui, repo, *pats, **opts)
1081 # Now that we've handled largefiles, hand off to the original addremove
1100 # Now that we've handled largefiles, hand off to the original addremove
1082 # function to take care of the rest. Make sure it doesn't do anything with
1101 # function to take care of the rest. Make sure it doesn't do anything with
1083 # largefiles by installing a matcher that will ignore them.
1102 # largefiles by installing a matcher that will ignore them.
1084 installnormalfilesmatchfn(repo[None].manifest())
1103 installnormalfilesmatchfn(repo[None].manifest())
1085 result = orig(repo, pats, opts, dry_run, similarity)
1104 result = orig(repo, pats, opts, dry_run, similarity)
1086 restorematchfn()
1105 restorematchfn()
1087 return result
1106 return result
1088
1107
1089 # Calling purge with --all will cause the largefiles to be deleted.
1108 # Calling purge with --all will cause the largefiles to be deleted.
1090 # Override repo.status to prevent this from happening.
1109 # Override repo.status to prevent this from happening.
1091 def overridepurge(orig, ui, repo, *dirs, **opts):
1110 def overridepurge(orig, ui, repo, *dirs, **opts):
1092 # XXX large file status is buggy when used on repo proxy.
1111 # XXX large file status is buggy when used on repo proxy.
1093 # XXX this needs to be investigate.
1112 # XXX this needs to be investigate.
1094 repo = repo.unfiltered()
1113 repo = repo.unfiltered()
1095 oldstatus = repo.status
1114 oldstatus = repo.status
1096 def overridestatus(node1='.', node2=None, match=None, ignored=False,
1115 def overridestatus(node1='.', node2=None, match=None, ignored=False,
1097 clean=False, unknown=False, listsubrepos=False):
1116 clean=False, unknown=False, listsubrepos=False):
1098 r = oldstatus(node1, node2, match, ignored, clean, unknown,
1117 r = oldstatus(node1, node2, match, ignored, clean, unknown,
1099 listsubrepos)
1118 listsubrepos)
1100 lfdirstate = lfutil.openlfdirstate(ui, repo)
1119 lfdirstate = lfutil.openlfdirstate(ui, repo)
1101 modified, added, removed, deleted, unknown, ignored, clean = r
1120 modified, added, removed, deleted, unknown, ignored, clean = r
1102 unknown = [f for f in unknown if lfdirstate[f] == '?']
1121 unknown = [f for f in unknown if lfdirstate[f] == '?']
1103 ignored = [f for f in ignored if lfdirstate[f] == '?']
1122 ignored = [f for f in ignored if lfdirstate[f] == '?']
1104 return modified, added, removed, deleted, unknown, ignored, clean
1123 return modified, added, removed, deleted, unknown, ignored, clean
1105 repo.status = overridestatus
1124 repo.status = overridestatus
1106 orig(ui, repo, *dirs, **opts)
1125 orig(ui, repo, *dirs, **opts)
1107 repo.status = oldstatus
1126 repo.status = oldstatus
1108
1127
1109 def overriderollback(orig, ui, repo, **opts):
1128 def overriderollback(orig, ui, repo, **opts):
1110 result = orig(ui, repo, **opts)
1129 result = orig(ui, repo, **opts)
1111 merge.update(repo, node=None, branchmerge=False, force=True,
1130 merge.update(repo, node=None, branchmerge=False, force=True,
1112 partial=lfutil.isstandin)
1131 partial=lfutil.isstandin)
1113 wlock = repo.wlock()
1132 wlock = repo.wlock()
1114 try:
1133 try:
1115 lfdirstate = lfutil.openlfdirstate(ui, repo)
1134 lfdirstate = lfutil.openlfdirstate(ui, repo)
1116 lfiles = lfutil.listlfiles(repo)
1135 lfiles = lfutil.listlfiles(repo)
1117 oldlfiles = lfutil.listlfiles(repo, repo[None].parents()[0].rev())
1136 oldlfiles = lfutil.listlfiles(repo, repo[None].parents()[0].rev())
1118 for file in lfiles:
1137 for file in lfiles:
1119 if file in oldlfiles:
1138 if file in oldlfiles:
1120 lfdirstate.normallookup(file)
1139 lfdirstate.normallookup(file)
1121 else:
1140 else:
1122 lfdirstate.add(file)
1141 lfdirstate.add(file)
1123 lfdirstate.write()
1142 lfdirstate.write()
1124 finally:
1143 finally:
1125 wlock.release()
1144 wlock.release()
1126 return result
1145 return result
1127
1146
1128 def overridetransplant(orig, ui, repo, *revs, **opts):
1147 def overridetransplant(orig, ui, repo, *revs, **opts):
1129 try:
1148 try:
1130 oldstandins = lfutil.getstandinsstate(repo)
1149 oldstandins = lfutil.getstandinsstate(repo)
1131 repo._istransplanting = True
1150 repo._istransplanting = True
1132 result = orig(ui, repo, *revs, **opts)
1151 result = orig(ui, repo, *revs, **opts)
1133 newstandins = lfutil.getstandinsstate(repo)
1152 newstandins = lfutil.getstandinsstate(repo)
1134 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
1153 filelist = lfutil.getlfilestoupdate(oldstandins, newstandins)
1135 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1154 lfcommands.updatelfiles(repo.ui, repo, filelist=filelist,
1136 printmessage=True)
1155 printmessage=True)
1137 finally:
1156 finally:
1138 repo._istransplanting = False
1157 repo._istransplanting = False
1139 return result
1158 return result
1140
1159
1141 def overridecat(orig, ui, repo, file1, *pats, **opts):
1160 def overridecat(orig, ui, repo, file1, *pats, **opts):
1142 ctx = scmutil.revsingle(repo, opts.get('rev'))
1161 ctx = scmutil.revsingle(repo, opts.get('rev'))
1143 err = 1
1162 err = 1
1144 notbad = set()
1163 notbad = set()
1145 m = scmutil.match(ctx, (file1,) + pats, opts)
1164 m = scmutil.match(ctx, (file1,) + pats, opts)
1146 origmatchfn = m.matchfn
1165 origmatchfn = m.matchfn
1147 def lfmatchfn(f):
1166 def lfmatchfn(f):
1148 if origmatchfn(f):
1167 if origmatchfn(f):
1149 return True
1168 return True
1150 lf = lfutil.splitstandin(f)
1169 lf = lfutil.splitstandin(f)
1151 if lf is None:
1170 if lf is None:
1152 return False
1171 return False
1153 notbad.add(lf)
1172 notbad.add(lf)
1154 return origmatchfn(lf)
1173 return origmatchfn(lf)
1155 m.matchfn = lfmatchfn
1174 m.matchfn = lfmatchfn
1156 origbadfn = m.bad
1175 origbadfn = m.bad
1157 def lfbadfn(f, msg):
1176 def lfbadfn(f, msg):
1158 if not f in notbad:
1177 if not f in notbad:
1159 origbadfn(f, msg)
1178 origbadfn(f, msg)
1160 m.bad = lfbadfn
1179 m.bad = lfbadfn
1161 for f in ctx.walk(m):
1180 for f in ctx.walk(m):
1162 fp = cmdutil.makefileobj(repo, opts.get('output'), ctx.node(),
1181 fp = cmdutil.makefileobj(repo, opts.get('output'), ctx.node(),
1163 pathname=f)
1182 pathname=f)
1164 lf = lfutil.splitstandin(f)
1183 lf = lfutil.splitstandin(f)
1165 if lf is None or origmatchfn(f):
1184 if lf is None or origmatchfn(f):
1166 # duplicating unreachable code from commands.cat
1185 # duplicating unreachable code from commands.cat
1167 data = ctx[f].data()
1186 data = ctx[f].data()
1168 if opts.get('decode'):
1187 if opts.get('decode'):
1169 data = repo.wwritedata(f, data)
1188 data = repo.wwritedata(f, data)
1170 fp.write(data)
1189 fp.write(data)
1171 else:
1190 else:
1172 hash = lfutil.readstandin(repo, lf, ctx.rev())
1191 hash = lfutil.readstandin(repo, lf, ctx.rev())
1173 if not lfutil.inusercache(repo.ui, hash):
1192 if not lfutil.inusercache(repo.ui, hash):
1174 store = basestore._openstore(repo)
1193 store = basestore._openstore(repo)
1175 success, missing = store.get([(lf, hash)])
1194 success, missing = store.get([(lf, hash)])
1176 if len(success) != 1:
1195 if len(success) != 1:
1177 raise util.Abort(
1196 raise util.Abort(
1178 _('largefile %s is not in cache and could not be '
1197 _('largefile %s is not in cache and could not be '
1179 'downloaded') % lf)
1198 'downloaded') % lf)
1180 path = lfutil.usercachepath(repo.ui, hash)
1199 path = lfutil.usercachepath(repo.ui, hash)
1181 fpin = open(path, "rb")
1200 fpin = open(path, "rb")
1182 for chunk in util.filechunkiter(fpin, 128 * 1024):
1201 for chunk in util.filechunkiter(fpin, 128 * 1024):
1183 fp.write(chunk)
1202 fp.write(chunk)
1184 fpin.close()
1203 fpin.close()
1185 fp.close()
1204 fp.close()
1186 err = 0
1205 err = 0
1187 return err
1206 return err
1188
1207
1189 def mercurialsinkbefore(orig, sink):
1208 def mercurialsinkbefore(orig, sink):
1190 sink.repo._isconverting = True
1209 sink.repo._isconverting = True
1191 orig(sink)
1210 orig(sink)
1192
1211
1193 def mercurialsinkafter(orig, sink):
1212 def mercurialsinkafter(orig, sink):
1194 sink.repo._isconverting = False
1213 sink.repo._isconverting = False
1195 orig(sink)
1214 orig(sink)
@@ -1,754 +1,795 b''
1 This file contains testcases that tend to be related to special cases or less
1 This file contains testcases that tend to be related to special cases or less
2 common commands affecting largefile.
2 common commands affecting largefile.
3
3
4 Each sections should be independent of each others.
4 Each sections should be independent of each others.
5
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
9 > [extensions]
10 > largefiles=
10 > largefiles=
11 > purge=
11 > purge=
12 > rebase=
12 > rebase=
13 > transplant=
13 > transplant=
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [largefiles]
16 > [largefiles]
17 > minsize=2
17 > minsize=2
18 > patterns=glob:**.dat
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
19 > usercache=${USERCACHE}
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24
24
25
25
26 Test copies and moves from a directory other than root (issue3516)
26 Test copies and moves from a directory other than root (issue3516)
27 =========================================================================
27 =========================================================================
28
28
29 $ hg init lf_cpmv
29 $ hg init lf_cpmv
30 $ cd lf_cpmv
30 $ cd lf_cpmv
31 $ mkdir dira
31 $ mkdir dira
32 $ mkdir dira/dirb
32 $ mkdir dira/dirb
33 $ touch dira/dirb/largefile
33 $ touch dira/dirb/largefile
34 $ hg add --large dira/dirb/largefile
34 $ hg add --large dira/dirb/largefile
35 $ hg commit -m "added"
35 $ hg commit -m "added"
36 Invoking status precommit hook
36 Invoking status precommit hook
37 A dira/dirb/largefile
37 A dira/dirb/largefile
38 $ cd dira
38 $ cd dira
39 $ hg cp dirb/largefile foo/largefile
39 $ hg cp dirb/largefile foo/largefile
40 $ hg ci -m "deep copy"
40 $ hg ci -m "deep copy"
41 Invoking status precommit hook
41 Invoking status precommit hook
42 A dira/foo/largefile
42 A dira/foo/largefile
43 $ find . | sort
43 $ find . | sort
44 .
44 .
45 ./dirb
45 ./dirb
46 ./dirb/largefile
46 ./dirb/largefile
47 ./foo
47 ./foo
48 ./foo/largefile
48 ./foo/largefile
49 $ hg mv foo/largefile baz/largefile
49 $ hg mv foo/largefile baz/largefile
50 $ hg ci -m "moved"
50 $ hg ci -m "moved"
51 Invoking status precommit hook
51 Invoking status precommit hook
52 A dira/baz/largefile
52 A dira/baz/largefile
53 R dira/foo/largefile
53 R dira/foo/largefile
54 $ find . | sort
54 $ find . | sort
55 .
55 .
56 ./baz
56 ./baz
57 ./baz/largefile
57 ./baz/largefile
58 ./dirb
58 ./dirb
59 ./dirb/largefile
59 ./dirb/largefile
60 $ cd ..
60 $ cd ..
61 $ hg mv dira dirc
61 $ hg mv dira dirc
62 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
62 moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile (glob)
63 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
63 moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile (glob)
64 $ find * | sort
64 $ find * | sort
65 dirc
65 dirc
66 dirc/baz
66 dirc/baz
67 dirc/baz/largefile
67 dirc/baz/largefile
68 dirc/dirb
68 dirc/dirb
69 dirc/dirb/largefile
69 dirc/dirb/largefile
70 $ hg up -qC
70 $ hg up -qC
71 $ cd ..
71 $ cd ..
72
72
73 Clone a local repository owned by another user
73 Clone a local repository owned by another user
74 ===================================================
74 ===================================================
75
75
76 #if unix-permissions
76 #if unix-permissions
77
77
78 We have to simulate that here by setting $HOME and removing write permissions
78 We have to simulate that here by setting $HOME and removing write permissions
79 $ ORIGHOME="$HOME"
79 $ ORIGHOME="$HOME"
80 $ mkdir alice
80 $ mkdir alice
81 $ HOME="`pwd`/alice"
81 $ HOME="`pwd`/alice"
82 $ cd alice
82 $ cd alice
83 $ hg init pubrepo
83 $ hg init pubrepo
84 $ cd pubrepo
84 $ cd pubrepo
85 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
85 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
86 $ hg add --large a-large-file
86 $ hg add --large a-large-file
87 $ hg commit -m "Add a large file"
87 $ hg commit -m "Add a large file"
88 Invoking status precommit hook
88 Invoking status precommit hook
89 A a-large-file
89 A a-large-file
90 $ cd ..
90 $ cd ..
91 $ chmod -R a-w pubrepo
91 $ chmod -R a-w pubrepo
92 $ cd ..
92 $ cd ..
93 $ mkdir bob
93 $ mkdir bob
94 $ HOME="`pwd`/bob"
94 $ HOME="`pwd`/bob"
95 $ cd bob
95 $ cd bob
96 $ hg clone --pull ../alice/pubrepo pubrepo
96 $ hg clone --pull ../alice/pubrepo pubrepo
97 requesting all changes
97 requesting all changes
98 adding changesets
98 adding changesets
99 adding manifests
99 adding manifests
100 adding file changes
100 adding file changes
101 added 1 changesets with 1 changes to 1 files
101 added 1 changesets with 1 changes to 1 files
102 updating to branch default
102 updating to branch default
103 getting changed largefiles
103 getting changed largefiles
104 1 largefiles updated, 0 removed
104 1 largefiles updated, 0 removed
105 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
105 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
106 $ cd ..
106 $ cd ..
107 $ chmod -R u+w alice/pubrepo
107 $ chmod -R u+w alice/pubrepo
108 $ HOME="$ORIGHOME"
108 $ HOME="$ORIGHOME"
109
109
110 #endif
110 #endif
111
111
112
112
113 Symlink to a large largefile should behave the same as a symlink to a normal file
113 Symlink to a large largefile should behave the same as a symlink to a normal file
114 =====================================================================================
114 =====================================================================================
115
115
116 #if symlink
116 #if symlink
117
117
118 $ hg init largesymlink
118 $ hg init largesymlink
119 $ cd largesymlink
119 $ cd largesymlink
120 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
120 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
121 $ hg add --large largefile
121 $ hg add --large largefile
122 $ hg commit -m "commit a large file"
122 $ hg commit -m "commit a large file"
123 Invoking status precommit hook
123 Invoking status precommit hook
124 A largefile
124 A largefile
125 $ ln -s largefile largelink
125 $ ln -s largefile largelink
126 $ hg add largelink
126 $ hg add largelink
127 $ hg commit -m "commit a large symlink"
127 $ hg commit -m "commit a large symlink"
128 Invoking status precommit hook
128 Invoking status precommit hook
129 A largelink
129 A largelink
130 $ rm -f largelink
130 $ rm -f largelink
131 $ hg up >/dev/null
131 $ hg up >/dev/null
132 $ test -f largelink
132 $ test -f largelink
133 [1]
133 [1]
134 $ test -L largelink
134 $ test -L largelink
135 [1]
135 [1]
136 $ rm -f largelink # make next part of the test independent of the previous
136 $ rm -f largelink # make next part of the test independent of the previous
137 $ hg up -C >/dev/null
137 $ hg up -C >/dev/null
138 $ test -f largelink
138 $ test -f largelink
139 $ test -L largelink
139 $ test -L largelink
140 $ cd ..
140 $ cd ..
141
141
142 #endif
142 #endif
143
143
144
144
145 test for pattern matching on 'hg status':
145 test for pattern matching on 'hg status':
146 ==============================================
146 ==============================================
147
147
148
148
149 to boost performance, largefiles checks whether specified patterns are
149 to boost performance, largefiles checks whether specified patterns are
150 related to largefiles in working directory (NOT to STANDIN) or not.
150 related to largefiles in working directory (NOT to STANDIN) or not.
151
151
152 $ hg init statusmatch
152 $ hg init statusmatch
153 $ cd statusmatch
153 $ cd statusmatch
154
154
155 $ mkdir -p a/b/c/d
155 $ mkdir -p a/b/c/d
156 $ echo normal > a/b/c/d/e.normal.txt
156 $ echo normal > a/b/c/d/e.normal.txt
157 $ hg add a/b/c/d/e.normal.txt
157 $ hg add a/b/c/d/e.normal.txt
158 $ echo large > a/b/c/d/e.large.txt
158 $ echo large > a/b/c/d/e.large.txt
159 $ hg add --large a/b/c/d/e.large.txt
159 $ hg add --large a/b/c/d/e.large.txt
160 $ mkdir -p a/b/c/x
160 $ mkdir -p a/b/c/x
161 $ echo normal > a/b/c/x/y.normal.txt
161 $ echo normal > a/b/c/x/y.normal.txt
162 $ hg add a/b/c/x/y.normal.txt
162 $ hg add a/b/c/x/y.normal.txt
163 $ hg commit -m 'add files'
163 $ hg commit -m 'add files'
164 Invoking status precommit hook
164 Invoking status precommit hook
165 A a/b/c/d/e.large.txt
165 A a/b/c/d/e.large.txt
166 A a/b/c/d/e.normal.txt
166 A a/b/c/d/e.normal.txt
167 A a/b/c/x/y.normal.txt
167 A a/b/c/x/y.normal.txt
168
168
169 (1) no pattern: no performance boost
169 (1) no pattern: no performance boost
170 $ hg status -A
170 $ hg status -A
171 C a/b/c/d/e.large.txt
171 C a/b/c/d/e.large.txt
172 C a/b/c/d/e.normal.txt
172 C a/b/c/d/e.normal.txt
173 C a/b/c/x/y.normal.txt
173 C a/b/c/x/y.normal.txt
174
174
175 (2) pattern not related to largefiles: performance boost
175 (2) pattern not related to largefiles: performance boost
176 $ hg status -A a/b/c/x
176 $ hg status -A a/b/c/x
177 C a/b/c/x/y.normal.txt
177 C a/b/c/x/y.normal.txt
178
178
179 (3) pattern related to largefiles: no performance boost
179 (3) pattern related to largefiles: no performance boost
180 $ hg status -A a/b/c/d
180 $ hg status -A a/b/c/d
181 C a/b/c/d/e.large.txt
181 C a/b/c/d/e.large.txt
182 C a/b/c/d/e.normal.txt
182 C a/b/c/d/e.normal.txt
183
183
184 (4) pattern related to STANDIN (not to largefiles): performance boost
184 (4) pattern related to STANDIN (not to largefiles): performance boost
185 $ hg status -A .hglf/a
185 $ hg status -A .hglf/a
186 C .hglf/a/b/c/d/e.large.txt
186 C .hglf/a/b/c/d/e.large.txt
187
187
188 (5) mixed case: no performance boost
188 (5) mixed case: no performance boost
189 $ hg status -A a/b/c/x a/b/c/d
189 $ hg status -A a/b/c/x a/b/c/d
190 C a/b/c/d/e.large.txt
190 C a/b/c/d/e.large.txt
191 C a/b/c/d/e.normal.txt
191 C a/b/c/d/e.normal.txt
192 C a/b/c/x/y.normal.txt
192 C a/b/c/x/y.normal.txt
193
193
194 verify that largefiles doesn't break filesets
194 verify that largefiles doesn't break filesets
195
195
196 $ hg log --rev . --exclude "set:binary()"
196 $ hg log --rev . --exclude "set:binary()"
197 changeset: 0:41bd42f10efa
197 changeset: 0:41bd42f10efa
198 tag: tip
198 tag: tip
199 user: test
199 user: test
200 date: Thu Jan 01 00:00:00 1970 +0000
200 date: Thu Jan 01 00:00:00 1970 +0000
201 summary: add files
201 summary: add files
202
202
203 verify that large files in subrepos handled properly
203 verify that large files in subrepos handled properly
204 $ hg init subrepo
204 $ hg init subrepo
205 $ echo "subrepo = subrepo" > .hgsub
205 $ echo "subrepo = subrepo" > .hgsub
206 $ hg add .hgsub
206 $ hg add .hgsub
207 $ hg ci -m "add subrepo"
207 $ hg ci -m "add subrepo"
208 Invoking status precommit hook
208 Invoking status precommit hook
209 A .hgsub
209 A .hgsub
210 ? .hgsubstate
210 ? .hgsubstate
211 $ echo "rev 1" > subrepo/large.txt
211 $ echo "rev 1" > subrepo/large.txt
212 $ hg -R subrepo add --large subrepo/large.txt
212 $ hg -R subrepo add --large subrepo/large.txt
213 $ hg sum
213 $ hg sum
214 parent: 1:8ee150ea2e9c tip
214 parent: 1:8ee150ea2e9c tip
215 add subrepo
215 add subrepo
216 branch: default
216 branch: default
217 commit: 1 subrepos
217 commit: 1 subrepos
218 update: (current)
218 update: (current)
219 $ hg st
219 $ hg st
220 $ hg st -S
220 $ hg st -S
221 A subrepo/large.txt
221 A subrepo/large.txt
222 $ hg ci -S -m "commit top repo"
222 $ hg ci -S -m "commit top repo"
223 committing subrepository subrepo
223 committing subrepository subrepo
224 Invoking status precommit hook
224 Invoking status precommit hook
225 A large.txt
225 A large.txt
226 Invoking status precommit hook
226 Invoking status precommit hook
227 M .hgsubstate
227 M .hgsubstate
228 # No differences
228 # No differences
229 $ hg st -S
229 $ hg st -S
230 $ hg sum
230 $ hg sum
231 parent: 2:ce4cd0c527a6 tip
231 parent: 2:ce4cd0c527a6 tip
232 commit top repo
232 commit top repo
233 branch: default
233 branch: default
234 commit: (clean)
234 commit: (clean)
235 update: (current)
235 update: (current)
236 $ echo "rev 2" > subrepo/large.txt
236 $ echo "rev 2" > subrepo/large.txt
237 $ hg st -S
237 $ hg st -S
238 M subrepo/large.txt
238 M subrepo/large.txt
239 $ hg sum
239 $ hg sum
240 parent: 2:ce4cd0c527a6 tip
240 parent: 2:ce4cd0c527a6 tip
241 commit top repo
241 commit top repo
242 branch: default
242 branch: default
243 commit: 1 subrepos
243 commit: 1 subrepos
244 update: (current)
244 update: (current)
245 $ hg ci -m "this commit should fail without -S"
245 $ hg ci -m "this commit should fail without -S"
246 abort: uncommitted changes in subrepo subrepo
246 abort: uncommitted changes in subrepo subrepo
247 (use --subrepos for recursive commit)
247 (use --subrepos for recursive commit)
248 [255]
248 [255]
249
249
250 Add a normal file to the subrepo, then test archiving
250 Add a normal file to the subrepo, then test archiving
251
251
252 $ echo 'normal file' > subrepo/normal.txt
252 $ echo 'normal file' > subrepo/normal.txt
253 $ hg -R subrepo add subrepo/normal.txt
253 $ hg -R subrepo add subrepo/normal.txt
254
254
255 Lock in subrepo, otherwise the change isn't archived
255 Lock in subrepo, otherwise the change isn't archived
256
256
257 $ hg ci -S -m "add normal file to top level"
257 $ hg ci -S -m "add normal file to top level"
258 committing subrepository subrepo
258 committing subrepository subrepo
259 Invoking status precommit hook
259 Invoking status precommit hook
260 M large.txt
260 M large.txt
261 A normal.txt
261 A normal.txt
262 Invoking status precommit hook
262 Invoking status precommit hook
263 M .hgsubstate
263 M .hgsubstate
264 $ hg archive -S ../lf_subrepo_archive
264 $ hg archive -S ../lf_subrepo_archive
265 $ find ../lf_subrepo_archive | sort
265 $ find ../lf_subrepo_archive | sort
266 ../lf_subrepo_archive
266 ../lf_subrepo_archive
267 ../lf_subrepo_archive/.hg_archival.txt
267 ../lf_subrepo_archive/.hg_archival.txt
268 ../lf_subrepo_archive/.hgsub
268 ../lf_subrepo_archive/.hgsub
269 ../lf_subrepo_archive/.hgsubstate
269 ../lf_subrepo_archive/.hgsubstate
270 ../lf_subrepo_archive/a
270 ../lf_subrepo_archive/a
271 ../lf_subrepo_archive/a/b
271 ../lf_subrepo_archive/a/b
272 ../lf_subrepo_archive/a/b/c
272 ../lf_subrepo_archive/a/b/c
273 ../lf_subrepo_archive/a/b/c/d
273 ../lf_subrepo_archive/a/b/c/d
274 ../lf_subrepo_archive/a/b/c/d/e.large.txt
274 ../lf_subrepo_archive/a/b/c/d/e.large.txt
275 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
275 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
276 ../lf_subrepo_archive/a/b/c/x
276 ../lf_subrepo_archive/a/b/c/x
277 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
277 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
278 ../lf_subrepo_archive/subrepo
278 ../lf_subrepo_archive/subrepo
279 ../lf_subrepo_archive/subrepo/large.txt
279 ../lf_subrepo_archive/subrepo/large.txt
280 ../lf_subrepo_archive/subrepo/normal.txt
280 ../lf_subrepo_archive/subrepo/normal.txt
281
281
282 Test update with subrepos.
282 Test update with subrepos.
283
283
284 $ hg update 0
284 $ hg update 0
285 getting changed largefiles
285 getting changed largefiles
286 0 largefiles updated, 1 removed
286 0 largefiles updated, 1 removed
287 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
287 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
288 $ hg status -S
288 $ hg status -S
289 $ hg update tip
289 $ hg update tip
290 getting changed largefiles
290 getting changed largefiles
291 1 largefiles updated, 0 removed
291 1 largefiles updated, 0 removed
292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
292 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
293 $ hg status -S
293 $ hg status -S
294 # modify a large file
294 # modify a large file
295 $ echo "modified" > subrepo/large.txt
295 $ echo "modified" > subrepo/large.txt
296 $ hg st -S
296 $ hg st -S
297 M subrepo/large.txt
297 M subrepo/large.txt
298 # update -C should revert the change.
298 # update -C should revert the change.
299 $ hg update -C
299 $ hg update -C
300 getting changed largefiles
300 getting changed largefiles
301 1 largefiles updated, 0 removed
301 1 largefiles updated, 0 removed
302 getting changed largefiles
302 getting changed largefiles
303 0 largefiles updated, 0 removed
303 0 largefiles updated, 0 removed
304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
304 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
305 $ hg status -S
305 $ hg status -S
306
306
307 Test archiving a revision that references a subrepo that is not yet
307 Test archiving a revision that references a subrepo that is not yet
308 cloned (see test-subrepo-recursion.t):
308 cloned (see test-subrepo-recursion.t):
309
309
310 $ hg clone -U . ../empty
310 $ hg clone -U . ../empty
311 $ cd ../empty
311 $ cd ../empty
312 $ hg archive --subrepos -r tip ../archive.tar.gz
312 $ hg archive --subrepos -r tip ../archive.tar.gz
313 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
313 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
314 $ cd ..
314 $ cd ..
315
315
316
316
317
317
318
318
319
319
320
320
321 Test addremove, forget and others
321 Test addremove, forget and others
322 ==============================================
322 ==============================================
323
323
324 Test that addremove picks up largefiles prior to the initial commit (issue3541)
324 Test that addremove picks up largefiles prior to the initial commit (issue3541)
325
325
326 $ hg init addrm2
326 $ hg init addrm2
327 $ cd addrm2
327 $ cd addrm2
328 $ touch large.dat
328 $ touch large.dat
329 $ touch large2.dat
329 $ touch large2.dat
330 $ touch normal
330 $ touch normal
331 $ hg add --large large.dat
331 $ hg add --large large.dat
332 $ hg addremove -v
332 $ hg addremove -v
333 adding large2.dat as a largefile
333 adding large2.dat as a largefile
334 adding normal
334 adding normal
335
335
336 Test that forgetting all largefiles reverts to islfilesrepo() == False
336 Test that forgetting all largefiles reverts to islfilesrepo() == False
337 (addremove will add *.dat as normal files now)
337 (addremove will add *.dat as normal files now)
338 $ hg forget large.dat
338 $ hg forget large.dat
339 $ hg forget large2.dat
339 $ hg forget large2.dat
340 $ hg addremove -v
340 $ hg addremove -v
341 adding large.dat
341 adding large.dat
342 adding large2.dat
342 adding large2.dat
343
343
344 Test commit's addremove option prior to the first commit
344 Test commit's addremove option prior to the first commit
345 $ hg forget large.dat
345 $ hg forget large.dat
346 $ hg forget large2.dat
346 $ hg forget large2.dat
347 $ hg add --large large.dat
347 $ hg add --large large.dat
348 $ hg ci -Am "commit"
348 $ hg ci -Am "commit"
349 adding large2.dat as a largefile
349 adding large2.dat as a largefile
350 Invoking status precommit hook
350 Invoking status precommit hook
351 A large.dat
351 A large.dat
352 A large2.dat
352 A large2.dat
353 A normal
353 A normal
354 $ find .hglf | sort
354 $ find .hglf | sort
355 .hglf
355 .hglf
356 .hglf/large.dat
356 .hglf/large.dat
357 .hglf/large2.dat
357 .hglf/large2.dat
358
358
359 Test actions on largefiles using relative paths from subdir
359 Test actions on largefiles using relative paths from subdir
360
360
361 $ mkdir sub
361 $ mkdir sub
362 $ cd sub
362 $ cd sub
363 $ echo anotherlarge > anotherlarge
363 $ echo anotherlarge > anotherlarge
364 $ hg add --large anotherlarge
364 $ hg add --large anotherlarge
365 $ hg st
365 $ hg st
366 A sub/anotherlarge
366 A sub/anotherlarge
367 $ hg st anotherlarge
367 $ hg st anotherlarge
368 A anotherlarge
368 A anotherlarge
369 $ hg commit -m anotherlarge anotherlarge
369 $ hg commit -m anotherlarge anotherlarge
370 Invoking status precommit hook
370 Invoking status precommit hook
371 A sub/anotherlarge
371 A sub/anotherlarge
372 $ hg log anotherlarge
372 $ hg log anotherlarge
373 changeset: 1:9627a577c5e9
373 changeset: 1:9627a577c5e9
374 tag: tip
374 tag: tip
375 user: test
375 user: test
376 date: Thu Jan 01 00:00:00 1970 +0000
376 date: Thu Jan 01 00:00:00 1970 +0000
377 summary: anotherlarge
377 summary: anotherlarge
378
378
379 $ hg log -G anotherlarge
379 $ hg log -G anotherlarge
380 @ changeset: 1:9627a577c5e9
380 @ changeset: 1:9627a577c5e9
381 | tag: tip
381 | tag: tip
382 | user: test
382 | user: test
383 | date: Thu Jan 01 00:00:00 1970 +0000
383 | date: Thu Jan 01 00:00:00 1970 +0000
384 | summary: anotherlarge
384 | summary: anotherlarge
385 |
385 |
386 $ echo more >> anotherlarge
386 $ echo more >> anotherlarge
387 $ hg st .
387 $ hg st .
388 M anotherlarge
388 M anotherlarge
389 $ hg cat anotherlarge
389 $ hg cat anotherlarge
390 anotherlarge
390 anotherlarge
391 $ hg revert anotherlarge
391 $ hg revert anotherlarge
392 $ hg st
392 $ hg st
393 ? sub/anotherlarge.orig
393 ? sub/anotherlarge.orig
394 $ cd ..
394 $ cd ..
395
395
396 $ cd ..
396 $ cd ..
397
397
398 Check error message while exchange
398 Check error message while exchange
399 =========================================================
399 =========================================================
400
400
401 issue3651: summary/outgoing with largefiles shows "no remote repo"
401 issue3651: summary/outgoing with largefiles shows "no remote repo"
402 unexpectedly
402 unexpectedly
403
403
404 $ mkdir issue3651
404 $ mkdir issue3651
405 $ cd issue3651
405 $ cd issue3651
406
406
407 $ hg init src
407 $ hg init src
408 $ echo a > src/a
408 $ echo a > src/a
409 $ hg -R src add --large src/a
409 $ hg -R src add --large src/a
410 $ hg -R src commit -m '#0'
410 $ hg -R src commit -m '#0'
411 Invoking status precommit hook
411 Invoking status precommit hook
412 A a
412 A a
413
413
414 check messages when no remote repository is specified:
414 check messages when no remote repository is specified:
415 "no remote repo" route for "hg outgoing --large" is not tested here,
415 "no remote repo" route for "hg outgoing --large" is not tested here,
416 because it can't be reproduced easily.
416 because it can't be reproduced easily.
417
417
418 $ hg init clone1
418 $ hg init clone1
419 $ hg -R clone1 -q pull src
419 $ hg -R clone1 -q pull src
420 $ hg -R clone1 -q update
420 $ hg -R clone1 -q update
421 $ hg -R clone1 paths | grep default
421 $ hg -R clone1 paths | grep default
422 [1]
422 [1]
423
423
424 $ hg -R clone1 summary --large
424 $ hg -R clone1 summary --large
425 parent: 0:fc0bd45326d3 tip
425 parent: 0:fc0bd45326d3 tip
426 #0
426 #0
427 branch: default
427 branch: default
428 commit: (clean)
428 commit: (clean)
429 update: (current)
429 update: (current)
430 largefiles: (no remote repo)
430 largefiles: (no remote repo)
431
431
432 check messages when there is no files to upload:
432 check messages when there is no files to upload:
433
433
434 $ hg -q clone src clone2
434 $ hg -q clone src clone2
435 $ hg -R clone2 paths | grep default
435 $ hg -R clone2 paths | grep default
436 default = $TESTTMP/issue3651/src (glob)
436 default = $TESTTMP/issue3651/src (glob)
437
437
438 $ hg -R clone2 summary --large
438 $ hg -R clone2 summary --large
439 parent: 0:fc0bd45326d3 tip
439 parent: 0:fc0bd45326d3 tip
440 #0
440 #0
441 branch: default
441 branch: default
442 commit: (clean)
442 commit: (clean)
443 update: (current)
443 update: (current)
444 largefiles: (no files to upload)
444 largefiles: (no files to upload)
445 $ hg -R clone2 outgoing --large
445 $ hg -R clone2 outgoing --large
446 comparing with $TESTTMP/issue3651/src (glob)
446 comparing with $TESTTMP/issue3651/src (glob)
447 searching for changes
447 searching for changes
448 no changes found
448 no changes found
449 largefiles: no files to upload
449 largefiles: no files to upload
450 [1]
450 [1]
451
451
452 $ hg -R clone2 outgoing --large --graph --template "{rev}"
452 $ hg -R clone2 outgoing --large --graph --template "{rev}"
453 comparing with $TESTTMP/issue3651/src (glob)
453 comparing with $TESTTMP/issue3651/src (glob)
454 searching for changes
454 searching for changes
455 no changes found
455 no changes found
456 largefiles: no files to upload
456 largefiles: no files to upload
457
457
458 check messages when there are files to upload:
458 check messages when there are files to upload:
459
459
460 $ echo b > clone2/b
460 $ echo b > clone2/b
461 $ hg -R clone2 add --large clone2/b
461 $ hg -R clone2 add --large clone2/b
462 $ hg -R clone2 commit -m '#1'
462 $ hg -R clone2 commit -m '#1'
463 Invoking status precommit hook
463 Invoking status precommit hook
464 A b
464 A b
465 $ hg -R clone2 summary --large
465 $ hg -R clone2 summary --large
466 parent: 1:1acbe71ce432 tip
466 parent: 1:1acbe71ce432 tip
467 #1
467 #1
468 branch: default
468 branch: default
469 commit: (clean)
469 commit: (clean)
470 update: (current)
470 update: (current)
471 largefiles: 1 entities for 1 files to upload
471 largefiles: 1 entities for 1 files to upload
472 $ hg -R clone2 outgoing --large
472 $ hg -R clone2 outgoing --large
473 comparing with $TESTTMP/issue3651/src (glob)
473 comparing with $TESTTMP/issue3651/src (glob)
474 searching for changes
474 searching for changes
475 changeset: 1:1acbe71ce432
475 changeset: 1:1acbe71ce432
476 tag: tip
476 tag: tip
477 user: test
477 user: test
478 date: Thu Jan 01 00:00:00 1970 +0000
478 date: Thu Jan 01 00:00:00 1970 +0000
479 summary: #1
479 summary: #1
480
480
481 largefiles to upload:
481 largefiles to upload (1 entities):
482 b
482 b
483
483
484 $ hg -R clone2 outgoing --large --graph --template "{rev}"
484 $ hg -R clone2 outgoing --large --graph --template "{rev}"
485 comparing with $TESTTMP/issue3651/src
485 comparing with $TESTTMP/issue3651/src
486 searching for changes
486 searching for changes
487 @ 1
487 @ 1
488
488
489 largefiles to upload:
489 largefiles to upload (1 entities):
490 b
490 b
491
491
492
492
493 $ cp clone2/b clone2/b1
493 $ cp clone2/b clone2/b1
494 $ cp clone2/b clone2/b2
494 $ cp clone2/b clone2/b2
495 $ hg -R clone2 add --large clone2/b1 clone2/b2
495 $ hg -R clone2 add --large clone2/b1 clone2/b2
496 $ hg -R clone2 commit -m '#2: add largefiles referring same entity'
496 $ hg -R clone2 commit -m '#2: add largefiles referring same entity'
497 Invoking status precommit hook
497 Invoking status precommit hook
498 A b1
498 A b1
499 A b2
499 A b2
500 $ hg -R clone2 summary --large
500 $ hg -R clone2 summary --large
501 parent: 2:6095d0695d70 tip
501 parent: 2:6095d0695d70 tip
502 #2: add largefiles referring same entity
502 #2: add largefiles referring same entity
503 branch: default
503 branch: default
504 commit: (clean)
504 commit: (clean)
505 update: (current)
505 update: (current)
506 largefiles: 1 entities for 3 files to upload
506 largefiles: 1 entities for 3 files to upload
507 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
507 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
508 comparing with $TESTTMP/issue3651/src (glob)
508 comparing with $TESTTMP/issue3651/src (glob)
509 searching for changes
509 searching for changes
510 1:1acbe71ce432
510 1:1acbe71ce432
511 2:6095d0695d70
511 2:6095d0695d70
512 largefiles to upload:
512 largefiles to upload (1 entities):
513 b
513 b
514 b1
514 b1
515 b2
515 b2
516
516
517 $ hg -R clone2 cat -r 1 clone2/.hglf/b
518 89e6c98d92887913cadf06b2adb97f26cde4849b
519 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
520 comparing with $TESTTMP/issue3651/src (glob)
521 query 1; heads
522 searching for changes
523 all remote heads known locally
524 1:1acbe71ce432
525 2:6095d0695d70
526 largefiles to upload (1 entities):
527 b
528 89e6c98d92887913cadf06b2adb97f26cde4849b
529 b1
530 89e6c98d92887913cadf06b2adb97f26cde4849b
531 b2
532 89e6c98d92887913cadf06b2adb97f26cde4849b
533
517
534
518 $ echo bbb > clone2/b
535 $ echo bbb > clone2/b
519 $ hg -R clone2 commit -m '#3: add new largefile entity as existing file'
536 $ hg -R clone2 commit -m '#3: add new largefile entity as existing file'
520 Invoking status precommit hook
537 Invoking status precommit hook
521 M b
538 M b
522 $ echo bbbb > clone2/b
539 $ echo bbbb > clone2/b
523 $ hg -R clone2 commit -m '#4: add new largefile entity as existing file'
540 $ hg -R clone2 commit -m '#4: add new largefile entity as existing file'
524 Invoking status precommit hook
541 Invoking status precommit hook
525 M b
542 M b
526 $ cp clone2/b1 clone2/b
543 $ cp clone2/b1 clone2/b
527 $ hg -R clone2 commit -m '#5: refer existing largefile entity again'
544 $ hg -R clone2 commit -m '#5: refer existing largefile entity again'
528 Invoking status precommit hook
545 Invoking status precommit hook
529 M b
546 M b
530 $ hg -R clone2 summary --large
547 $ hg -R clone2 summary --large
531 parent: 5:036794ea641c tip
548 parent: 5:036794ea641c tip
532 #5: refer existing largefile entity again
549 #5: refer existing largefile entity again
533 branch: default
550 branch: default
534 commit: (clean)
551 commit: (clean)
535 update: (current)
552 update: (current)
536 largefiles: 3 entities for 3 files to upload
553 largefiles: 3 entities for 3 files to upload
537 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
554 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n"
538 comparing with $TESTTMP/issue3651/src (glob)
555 comparing with $TESTTMP/issue3651/src (glob)
539 searching for changes
556 searching for changes
540 1:1acbe71ce432
557 1:1acbe71ce432
541 2:6095d0695d70
558 2:6095d0695d70
542 3:7983dce246cc
559 3:7983dce246cc
543 4:233f12ada4ae
560 4:233f12ada4ae
544 5:036794ea641c
561 5:036794ea641c
545 largefiles to upload:
562 largefiles to upload (3 entities):
546 b
563 b
547 b1
564 b1
548 b2
565 b2
549
566
567 $ hg -R clone2 cat -r 3 clone2/.hglf/b
568 c801c9cfe94400963fcb683246217d5db77f9a9a
569 $ hg -R clone2 cat -r 4 clone2/.hglf/b
570 13f9ed0898e315bf59dc2973fec52037b6f441a2
571 $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug
572 comparing with $TESTTMP/issue3651/src (glob)
573 query 1; heads
574 searching for changes
575 all remote heads known locally
576 1:1acbe71ce432
577 2:6095d0695d70
578 3:7983dce246cc
579 4:233f12ada4ae
580 5:036794ea641c
581 largefiles to upload (3 entities):
582 b
583 13f9ed0898e315bf59dc2973fec52037b6f441a2
584 89e6c98d92887913cadf06b2adb97f26cde4849b
585 c801c9cfe94400963fcb683246217d5db77f9a9a
586 b1
587 89e6c98d92887913cadf06b2adb97f26cde4849b
588 b2
589 89e6c98d92887913cadf06b2adb97f26cde4849b
590
550
591
551 $ cd ..
592 $ cd ..
552
593
553 merge action 'd' for 'local renamed directory to d2/g' which has no filename
594 merge action 'd' for 'local renamed directory to d2/g' which has no filename
554 ==================================================================================
595 ==================================================================================
555
596
556 $ hg init merge-action
597 $ hg init merge-action
557 $ cd merge-action
598 $ cd merge-action
558 $ touch l
599 $ touch l
559 $ hg add --large l
600 $ hg add --large l
560 $ mkdir d1
601 $ mkdir d1
561 $ touch d1/f
602 $ touch d1/f
562 $ hg ci -Aqm0
603 $ hg ci -Aqm0
563 Invoking status precommit hook
604 Invoking status precommit hook
564 A d1/f
605 A d1/f
565 A l
606 A l
566 $ echo > d1/f
607 $ echo > d1/f
567 $ touch d1/g
608 $ touch d1/g
568 $ hg ci -Aqm1
609 $ hg ci -Aqm1
569 Invoking status precommit hook
610 Invoking status precommit hook
570 M d1/f
611 M d1/f
571 A d1/g
612 A d1/g
572 $ hg up -qr0
613 $ hg up -qr0
573 $ hg mv d1 d2
614 $ hg mv d1 d2
574 moving d1/f to d2/f (glob)
615 moving d1/f to d2/f (glob)
575 $ hg ci -qm2
616 $ hg ci -qm2
576 Invoking status precommit hook
617 Invoking status precommit hook
577 A d2/f
618 A d2/f
578 R d1/f
619 R d1/f
579 $ hg merge
620 $ hg merge
580 merging d2/f and d1/f to d2/f
621 merging d2/f and d1/f to d2/f
581 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
622 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
582 (branch merge, don't forget to commit)
623 (branch merge, don't forget to commit)
583 getting changed largefiles
624 getting changed largefiles
584 0 largefiles updated, 0 removed
625 0 largefiles updated, 0 removed
585 $ cd ..
626 $ cd ..
586
627
587
628
588 Merge conflicts:
629 Merge conflicts:
589 =====================
630 =====================
590
631
591 $ hg init merge
632 $ hg init merge
592 $ cd merge
633 $ cd merge
593 $ echo 0 > f-different
634 $ echo 0 > f-different
594 $ echo 0 > f-same
635 $ echo 0 > f-same
595 $ echo 0 > f-unchanged-1
636 $ echo 0 > f-unchanged-1
596 $ echo 0 > f-unchanged-2
637 $ echo 0 > f-unchanged-2
597 $ hg add --large *
638 $ hg add --large *
598 $ hg ci -m0
639 $ hg ci -m0
599 Invoking status precommit hook
640 Invoking status precommit hook
600 A f-different
641 A f-different
601 A f-same
642 A f-same
602 A f-unchanged-1
643 A f-unchanged-1
603 A f-unchanged-2
644 A f-unchanged-2
604 $ echo tmp1 > f-unchanged-1
645 $ echo tmp1 > f-unchanged-1
605 $ echo tmp1 > f-unchanged-2
646 $ echo tmp1 > f-unchanged-2
606 $ echo tmp1 > f-same
647 $ echo tmp1 > f-same
607 $ hg ci -m1
648 $ hg ci -m1
608 Invoking status precommit hook
649 Invoking status precommit hook
609 M f-same
650 M f-same
610 M f-unchanged-1
651 M f-unchanged-1
611 M f-unchanged-2
652 M f-unchanged-2
612 $ echo 2 > f-different
653 $ echo 2 > f-different
613 $ echo 0 > f-unchanged-1
654 $ echo 0 > f-unchanged-1
614 $ echo 1 > f-unchanged-2
655 $ echo 1 > f-unchanged-2
615 $ echo 1 > f-same
656 $ echo 1 > f-same
616 $ hg ci -m2
657 $ hg ci -m2
617 Invoking status precommit hook
658 Invoking status precommit hook
618 M f-different
659 M f-different
619 M f-same
660 M f-same
620 M f-unchanged-1
661 M f-unchanged-1
621 M f-unchanged-2
662 M f-unchanged-2
622 $ hg up -qr0
663 $ hg up -qr0
623 $ echo tmp2 > f-unchanged-1
664 $ echo tmp2 > f-unchanged-1
624 $ echo tmp2 > f-unchanged-2
665 $ echo tmp2 > f-unchanged-2
625 $ echo tmp2 > f-same
666 $ echo tmp2 > f-same
626 $ hg ci -m3
667 $ hg ci -m3
627 Invoking status precommit hook
668 Invoking status precommit hook
628 M f-same
669 M f-same
629 M f-unchanged-1
670 M f-unchanged-1
630 M f-unchanged-2
671 M f-unchanged-2
631 created new head
672 created new head
632 $ echo 1 > f-different
673 $ echo 1 > f-different
633 $ echo 1 > f-unchanged-1
674 $ echo 1 > f-unchanged-1
634 $ echo 0 > f-unchanged-2
675 $ echo 0 > f-unchanged-2
635 $ echo 1 > f-same
676 $ echo 1 > f-same
636 $ hg ci -m4
677 $ hg ci -m4
637 Invoking status precommit hook
678 Invoking status precommit hook
638 M f-different
679 M f-different
639 M f-same
680 M f-same
640 M f-unchanged-1
681 M f-unchanged-1
641 M f-unchanged-2
682 M f-unchanged-2
642 $ hg merge
683 $ hg merge
643 largefile f-different has a merge conflict
684 largefile f-different has a merge conflict
644 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
685 ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7
645 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
686 keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or
646 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
687 take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l
647 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
688 0 files updated, 4 files merged, 0 files removed, 0 files unresolved
648 (branch merge, don't forget to commit)
689 (branch merge, don't forget to commit)
649 getting changed largefiles
690 getting changed largefiles
650 1 largefiles updated, 0 removed
691 1 largefiles updated, 0 removed
651 $ cat f-different
692 $ cat f-different
652 1
693 1
653 $ cat f-same
694 $ cat f-same
654 1
695 1
655 $ cat f-unchanged-1
696 $ cat f-unchanged-1
656 1
697 1
657 $ cat f-unchanged-2
698 $ cat f-unchanged-2
658 1
699 1
659 $ cd ..
700 $ cd ..
660
701
661 Test largefile insulation (do not enabled a side effect
702 Test largefile insulation (do not enabled a side effect
662 ========================================================
703 ========================================================
663
704
664 Check whether "largefiles" feature is supported only in repositories
705 Check whether "largefiles" feature is supported only in repositories
665 enabling largefiles extension.
706 enabling largefiles extension.
666
707
667 $ mkdir individualenabling
708 $ mkdir individualenabling
668 $ cd individualenabling
709 $ cd individualenabling
669
710
670 $ hg init enabledlocally
711 $ hg init enabledlocally
671 $ echo large > enabledlocally/large
712 $ echo large > enabledlocally/large
672 $ hg -R enabledlocally add --large enabledlocally/large
713 $ hg -R enabledlocally add --large enabledlocally/large
673 $ hg -R enabledlocally commit -m '#0'
714 $ hg -R enabledlocally commit -m '#0'
674 Invoking status precommit hook
715 Invoking status precommit hook
675 A large
716 A large
676
717
677 $ hg init notenabledlocally
718 $ hg init notenabledlocally
678 $ echo large > notenabledlocally/large
719 $ echo large > notenabledlocally/large
679 $ hg -R notenabledlocally add --large notenabledlocally/large
720 $ hg -R notenabledlocally add --large notenabledlocally/large
680 $ hg -R notenabledlocally commit -m '#0'
721 $ hg -R notenabledlocally commit -m '#0'
681 Invoking status precommit hook
722 Invoking status precommit hook
682 A large
723 A large
683
724
684 $ cat >> $HGRCPATH <<EOF
725 $ cat >> $HGRCPATH <<EOF
685 > [extensions]
726 > [extensions]
686 > # disable globally
727 > # disable globally
687 > largefiles=!
728 > largefiles=!
688 > EOF
729 > EOF
689 $ cat >> enabledlocally/.hg/hgrc <<EOF
730 $ cat >> enabledlocally/.hg/hgrc <<EOF
690 > [extensions]
731 > [extensions]
691 > # enable locally
732 > # enable locally
692 > largefiles=
733 > largefiles=
693 > EOF
734 > EOF
694 $ hg -R enabledlocally root
735 $ hg -R enabledlocally root
695 $TESTTMP/individualenabling/enabledlocally (glob)
736 $TESTTMP/individualenabling/enabledlocally (glob)
696 $ hg -R notenabledlocally root
737 $ hg -R notenabledlocally root
697 abort: repository requires features unknown to this Mercurial: largefiles!
738 abort: repository requires features unknown to this Mercurial: largefiles!
698 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
739 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
699 [255]
740 [255]
700
741
701 $ hg init push-dst
742 $ hg init push-dst
702 $ hg -R enabledlocally push push-dst
743 $ hg -R enabledlocally push push-dst
703 pushing to push-dst
744 pushing to push-dst
704 abort: required features are not supported in the destination: largefiles
745 abort: required features are not supported in the destination: largefiles
705 [255]
746 [255]
706
747
707 $ hg init pull-src
748 $ hg init pull-src
708 $ hg -R pull-src pull enabledlocally
749 $ hg -R pull-src pull enabledlocally
709 pulling from enabledlocally
750 pulling from enabledlocally
710 abort: required features are not supported in the destination: largefiles
751 abort: required features are not supported in the destination: largefiles
711 [255]
752 [255]
712
753
713 $ hg clone enabledlocally clone-dst
754 $ hg clone enabledlocally clone-dst
714 abort: repository requires features unknown to this Mercurial: largefiles!
755 abort: repository requires features unknown to this Mercurial: largefiles!
715 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
756 (see http://mercurial.selenic.com/wiki/MissingRequirement for more information)
716 [255]
757 [255]
717 $ test -d clone-dst
758 $ test -d clone-dst
718 [1]
759 [1]
719 $ hg clone --pull enabledlocally clone-pull-dst
760 $ hg clone --pull enabledlocally clone-pull-dst
720 abort: required features are not supported in the destination: largefiles
761 abort: required features are not supported in the destination: largefiles
721 [255]
762 [255]
722 $ test -d clone-pull-dst
763 $ test -d clone-pull-dst
723 [1]
764 [1]
724
765
725 #if serve
766 #if serve
726
767
727 Test largefiles specific peer setup, when largefiles is enabled
768 Test largefiles specific peer setup, when largefiles is enabled
728 locally (issue4109)
769 locally (issue4109)
729
770
730 $ hg showconfig extensions | grep largefiles
771 $ hg showconfig extensions | grep largefiles
731 extensions.largefiles=!
772 extensions.largefiles=!
732 $ mkdir -p $TESTTMP/individualenabling/usercache
773 $ mkdir -p $TESTTMP/individualenabling/usercache
733
774
734 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
775 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
735 $ cat hg.pid >> $DAEMON_PIDS
776 $ cat hg.pid >> $DAEMON_PIDS
736
777
737 $ hg init pull-dst
778 $ hg init pull-dst
738 $ cat > pull-dst/.hg/hgrc <<EOF
779 $ cat > pull-dst/.hg/hgrc <<EOF
739 > [extensions]
780 > [extensions]
740 > # enable locally
781 > # enable locally
741 > largefiles=
782 > largefiles=
742 > [largefiles]
783 > [largefiles]
743 > # ignore system cache to force largefiles specific wire proto access
784 > # ignore system cache to force largefiles specific wire proto access
744 > usercache=$TESTTMP/individualenabling/usercache
785 > usercache=$TESTTMP/individualenabling/usercache
745 > EOF
786 > EOF
746 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
787 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
747
788
748 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
789 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
749 #endif
790 #endif
750
791
751 $ cd ..
792 $ cd ..
752
793
753
794
754
795
@@ -1,1636 +1,1636 b''
1 This file used to contains all largefile tests.
1 This file used to contains all largefile tests.
2 Do not add any new tests in this file as it his already far too long to run.
2 Do not add any new tests in this file as it his already far too long to run.
3
3
4 It contains all the testing of the basic concepts of large file in a single block.
4 It contains all the testing of the basic concepts of large file in a single block.
5
5
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
6 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
7 $ mkdir "${USERCACHE}"
7 $ mkdir "${USERCACHE}"
8 $ cat >> $HGRCPATH <<EOF
8 $ cat >> $HGRCPATH <<EOF
9 > [extensions]
9 > [extensions]
10 > largefiles=
10 > largefiles=
11 > purge=
11 > purge=
12 > rebase=
12 > rebase=
13 > transplant=
13 > transplant=
14 > [phases]
14 > [phases]
15 > publish=False
15 > publish=False
16 > [largefiles]
16 > [largefiles]
17 > minsize=2
17 > minsize=2
18 > patterns=glob:**.dat
18 > patterns=glob:**.dat
19 > usercache=${USERCACHE}
19 > usercache=${USERCACHE}
20 > [hooks]
20 > [hooks]
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
21 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
22 > EOF
22 > EOF
23
23
24 Create the repo with a couple of revisions of both large and normal
24 Create the repo with a couple of revisions of both large and normal
25 files.
25 files.
26 Test status and dirstate of largefiles and that summary output is correct.
26 Test status and dirstate of largefiles and that summary output is correct.
27
27
28 $ hg init a
28 $ hg init a
29 $ cd a
29 $ cd a
30 $ mkdir sub
30 $ mkdir sub
31 $ echo normal1 > normal1
31 $ echo normal1 > normal1
32 $ echo normal2 > sub/normal2
32 $ echo normal2 > sub/normal2
33 $ echo large1 > large1
33 $ echo large1 > large1
34 $ echo large2 > sub/large2
34 $ echo large2 > sub/large2
35 $ hg add normal1 sub/normal2
35 $ hg add normal1 sub/normal2
36 $ hg add --large large1 sub/large2
36 $ hg add --large large1 sub/large2
37 $ hg commit -m "add files"
37 $ hg commit -m "add files"
38 Invoking status precommit hook
38 Invoking status precommit hook
39 A large1
39 A large1
40 A normal1
40 A normal1
41 A sub/large2
41 A sub/large2
42 A sub/normal2
42 A sub/normal2
43 $ touch large1 sub/large2
43 $ touch large1 sub/large2
44 $ sleep 1
44 $ sleep 1
45 $ hg st
45 $ hg st
46 $ hg debugstate --nodates
46 $ hg debugstate --nodates
47 n 644 41 .hglf/large1
47 n 644 41 .hglf/large1
48 n 644 41 .hglf/sub/large2
48 n 644 41 .hglf/sub/large2
49 n 644 8 normal1
49 n 644 8 normal1
50 n 644 8 sub/normal2
50 n 644 8 sub/normal2
51 $ hg debugstate --large --nodates
51 $ hg debugstate --large --nodates
52 n 644 7 large1
52 n 644 7 large1
53 n 644 7 sub/large2
53 n 644 7 sub/large2
54 $ echo normal11 > normal1
54 $ echo normal11 > normal1
55 $ echo normal22 > sub/normal2
55 $ echo normal22 > sub/normal2
56 $ echo large11 > large1
56 $ echo large11 > large1
57 $ echo large22 > sub/large2
57 $ echo large22 > sub/large2
58 $ hg commit -m "edit files"
58 $ hg commit -m "edit files"
59 Invoking status precommit hook
59 Invoking status precommit hook
60 M large1
60 M large1
61 M normal1
61 M normal1
62 M sub/large2
62 M sub/large2
63 M sub/normal2
63 M sub/normal2
64 $ hg sum --large
64 $ hg sum --large
65 parent: 1:ce8896473775 tip
65 parent: 1:ce8896473775 tip
66 edit files
66 edit files
67 branch: default
67 branch: default
68 commit: (clean)
68 commit: (clean)
69 update: (current)
69 update: (current)
70 largefiles: (no remote repo)
70 largefiles: (no remote repo)
71
71
72 Commit preserved largefile contents.
72 Commit preserved largefile contents.
73
73
74 $ cat normal1
74 $ cat normal1
75 normal11
75 normal11
76 $ cat large1
76 $ cat large1
77 large11
77 large11
78 $ cat sub/normal2
78 $ cat sub/normal2
79 normal22
79 normal22
80 $ cat sub/large2
80 $ cat sub/large2
81 large22
81 large22
82
82
83 Test status, subdir and unknown files
83 Test status, subdir and unknown files
84
84
85 $ echo unknown > sub/unknown
85 $ echo unknown > sub/unknown
86 $ hg st --all
86 $ hg st --all
87 ? sub/unknown
87 ? sub/unknown
88 C large1
88 C large1
89 C normal1
89 C normal1
90 C sub/large2
90 C sub/large2
91 C sub/normal2
91 C sub/normal2
92 $ hg st --all sub
92 $ hg st --all sub
93 ? sub/unknown
93 ? sub/unknown
94 C sub/large2
94 C sub/large2
95 C sub/normal2
95 C sub/normal2
96 $ rm sub/unknown
96 $ rm sub/unknown
97
97
98 Test messages and exit codes for remove warning cases
98 Test messages and exit codes for remove warning cases
99
99
100 $ hg remove -A large1
100 $ hg remove -A large1
101 not removing large1: file still exists
101 not removing large1: file still exists
102 [1]
102 [1]
103 $ echo 'modified' > large1
103 $ echo 'modified' > large1
104 $ hg remove large1
104 $ hg remove large1
105 not removing large1: file is modified (use -f to force removal)
105 not removing large1: file is modified (use -f to force removal)
106 [1]
106 [1]
107 $ echo 'new' > normalnew
107 $ echo 'new' > normalnew
108 $ hg add normalnew
108 $ hg add normalnew
109 $ echo 'new' > largenew
109 $ echo 'new' > largenew
110 $ hg add --large normalnew
110 $ hg add --large normalnew
111 normalnew already tracked!
111 normalnew already tracked!
112 $ hg remove normalnew largenew
112 $ hg remove normalnew largenew
113 not removing largenew: file is untracked
113 not removing largenew: file is untracked
114 not removing normalnew: file has been marked for add (use forget to undo)
114 not removing normalnew: file has been marked for add (use forget to undo)
115 [1]
115 [1]
116 $ rm normalnew largenew
116 $ rm normalnew largenew
117 $ hg up -Cq
117 $ hg up -Cq
118
118
119 Remove both largefiles and normal files.
119 Remove both largefiles and normal files.
120
120
121 $ hg remove normal1 large1
121 $ hg remove normal1 large1
122 $ hg status large1
122 $ hg status large1
123 R large1
123 R large1
124 $ hg commit -m "remove files"
124 $ hg commit -m "remove files"
125 Invoking status precommit hook
125 Invoking status precommit hook
126 R large1
126 R large1
127 R normal1
127 R normal1
128 $ ls
128 $ ls
129 sub
129 sub
130 $ echo "testlargefile" > large1-test
130 $ echo "testlargefile" > large1-test
131 $ hg add --large large1-test
131 $ hg add --large large1-test
132 $ hg st
132 $ hg st
133 A large1-test
133 A large1-test
134 $ hg rm large1-test
134 $ hg rm large1-test
135 not removing large1-test: file has been marked for add (use forget to undo)
135 not removing large1-test: file has been marked for add (use forget to undo)
136 [1]
136 [1]
137 $ hg st
137 $ hg st
138 A large1-test
138 A large1-test
139 $ hg forget large1-test
139 $ hg forget large1-test
140 $ hg st
140 $ hg st
141 ? large1-test
141 ? large1-test
142 $ hg remove large1-test
142 $ hg remove large1-test
143 not removing large1-test: file is untracked
143 not removing large1-test: file is untracked
144 [1]
144 [1]
145 $ hg forget large1-test
145 $ hg forget large1-test
146 not removing large1-test: file is already untracked
146 not removing large1-test: file is already untracked
147 [1]
147 [1]
148 $ rm large1-test
148 $ rm large1-test
149
149
150 Copy both largefiles and normal files (testing that status output is correct).
150 Copy both largefiles and normal files (testing that status output is correct).
151
151
152 $ hg cp sub/normal2 normal1
152 $ hg cp sub/normal2 normal1
153 $ hg cp sub/large2 large1
153 $ hg cp sub/large2 large1
154 $ hg commit -m "copy files"
154 $ hg commit -m "copy files"
155 Invoking status precommit hook
155 Invoking status precommit hook
156 A large1
156 A large1
157 A normal1
157 A normal1
158 $ cat normal1
158 $ cat normal1
159 normal22
159 normal22
160 $ cat large1
160 $ cat large1
161 large22
161 large22
162
162
163 Test moving largefiles and verify that normal files are also unaffected.
163 Test moving largefiles and verify that normal files are also unaffected.
164
164
165 $ hg mv normal1 normal3
165 $ hg mv normal1 normal3
166 $ hg mv large1 large3
166 $ hg mv large1 large3
167 $ hg mv sub/normal2 sub/normal4
167 $ hg mv sub/normal2 sub/normal4
168 $ hg mv sub/large2 sub/large4
168 $ hg mv sub/large2 sub/large4
169 $ hg commit -m "move files"
169 $ hg commit -m "move files"
170 Invoking status precommit hook
170 Invoking status precommit hook
171 A large3
171 A large3
172 A normal3
172 A normal3
173 A sub/large4
173 A sub/large4
174 A sub/normal4
174 A sub/normal4
175 R large1
175 R large1
176 R normal1
176 R normal1
177 R sub/large2
177 R sub/large2
178 R sub/normal2
178 R sub/normal2
179 $ cat normal3
179 $ cat normal3
180 normal22
180 normal22
181 $ cat large3
181 $ cat large3
182 large22
182 large22
183 $ cat sub/normal4
183 $ cat sub/normal4
184 normal22
184 normal22
185 $ cat sub/large4
185 $ cat sub/large4
186 large22
186 large22
187
187
188
188
189 #if serve
189 #if serve
190 Test display of largefiles in hgweb
190 Test display of largefiles in hgweb
191
191
192 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
192 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
193 $ cat ../hg.pid >> $DAEMON_PIDS
193 $ cat ../hg.pid >> $DAEMON_PIDS
194 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
194 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
195 200 Script output follows
195 200 Script output follows
196
196
197
197
198 drwxr-xr-x sub
198 drwxr-xr-x sub
199 -rw-r--r-- 41 large3
199 -rw-r--r-- 41 large3
200 -rw-r--r-- 9 normal3
200 -rw-r--r-- 9 normal3
201
201
202
202
203 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
203 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
204 200 Script output follows
204 200 Script output follows
205
205
206
206
207 -rw-r--r-- 41 large4
207 -rw-r--r-- 41 large4
208 -rw-r--r-- 9 normal4
208 -rw-r--r-- 9 normal4
209
209
210
210
211 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
211 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
212 #endif
212 #endif
213
213
214 Test archiving the various revisions. These hit corner cases known with
214 Test archiving the various revisions. These hit corner cases known with
215 archiving.
215 archiving.
216
216
217 $ hg archive -r 0 ../archive0
217 $ hg archive -r 0 ../archive0
218 $ hg archive -r 1 ../archive1
218 $ hg archive -r 1 ../archive1
219 $ hg archive -r 2 ../archive2
219 $ hg archive -r 2 ../archive2
220 $ hg archive -r 3 ../archive3
220 $ hg archive -r 3 ../archive3
221 $ hg archive -r 4 ../archive4
221 $ hg archive -r 4 ../archive4
222 $ cd ../archive0
222 $ cd ../archive0
223 $ cat normal1
223 $ cat normal1
224 normal1
224 normal1
225 $ cat large1
225 $ cat large1
226 large1
226 large1
227 $ cat sub/normal2
227 $ cat sub/normal2
228 normal2
228 normal2
229 $ cat sub/large2
229 $ cat sub/large2
230 large2
230 large2
231 $ cd ../archive1
231 $ cd ../archive1
232 $ cat normal1
232 $ cat normal1
233 normal11
233 normal11
234 $ cat large1
234 $ cat large1
235 large11
235 large11
236 $ cat sub/normal2
236 $ cat sub/normal2
237 normal22
237 normal22
238 $ cat sub/large2
238 $ cat sub/large2
239 large22
239 large22
240 $ cd ../archive2
240 $ cd ../archive2
241 $ ls
241 $ ls
242 sub
242 sub
243 $ cat sub/normal2
243 $ cat sub/normal2
244 normal22
244 normal22
245 $ cat sub/large2
245 $ cat sub/large2
246 large22
246 large22
247 $ cd ../archive3
247 $ cd ../archive3
248 $ cat normal1
248 $ cat normal1
249 normal22
249 normal22
250 $ cat large1
250 $ cat large1
251 large22
251 large22
252 $ cat sub/normal2
252 $ cat sub/normal2
253 normal22
253 normal22
254 $ cat sub/large2
254 $ cat sub/large2
255 large22
255 large22
256 $ cd ../archive4
256 $ cd ../archive4
257 $ cat normal3
257 $ cat normal3
258 normal22
258 normal22
259 $ cat large3
259 $ cat large3
260 large22
260 large22
261 $ cat sub/normal4
261 $ cat sub/normal4
262 normal22
262 normal22
263 $ cat sub/large4
263 $ cat sub/large4
264 large22
264 large22
265
265
266 Commit corner case: specify files to commit.
266 Commit corner case: specify files to commit.
267
267
268 $ cd ../a
268 $ cd ../a
269 $ echo normal3 > normal3
269 $ echo normal3 > normal3
270 $ echo large3 > large3
270 $ echo large3 > large3
271 $ echo normal4 > sub/normal4
271 $ echo normal4 > sub/normal4
272 $ echo large4 > sub/large4
272 $ echo large4 > sub/large4
273 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
273 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
274 Invoking status precommit hook
274 Invoking status precommit hook
275 M large3
275 M large3
276 M normal3
276 M normal3
277 M sub/large4
277 M sub/large4
278 M sub/normal4
278 M sub/normal4
279 $ cat normal3
279 $ cat normal3
280 normal3
280 normal3
281 $ cat large3
281 $ cat large3
282 large3
282 large3
283 $ cat sub/normal4
283 $ cat sub/normal4
284 normal4
284 normal4
285 $ cat sub/large4
285 $ cat sub/large4
286 large4
286 large4
287
287
288 One more commit corner case: commit from a subdirectory.
288 One more commit corner case: commit from a subdirectory.
289
289
290 $ cd ../a
290 $ cd ../a
291 $ echo normal33 > normal3
291 $ echo normal33 > normal3
292 $ echo large33 > large3
292 $ echo large33 > large3
293 $ echo normal44 > sub/normal4
293 $ echo normal44 > sub/normal4
294 $ echo large44 > sub/large4
294 $ echo large44 > sub/large4
295 $ cd sub
295 $ cd sub
296 $ hg commit -m "edit files yet again"
296 $ hg commit -m "edit files yet again"
297 Invoking status precommit hook
297 Invoking status precommit hook
298 M large3
298 M large3
299 M normal3
299 M normal3
300 M sub/large4
300 M sub/large4
301 M sub/normal4
301 M sub/normal4
302 $ cat ../normal3
302 $ cat ../normal3
303 normal33
303 normal33
304 $ cat ../large3
304 $ cat ../large3
305 large33
305 large33
306 $ cat normal4
306 $ cat normal4
307 normal44
307 normal44
308 $ cat large4
308 $ cat large4
309 large44
309 large44
310
310
311 Committing standins is not allowed.
311 Committing standins is not allowed.
312
312
313 $ cd ..
313 $ cd ..
314 $ echo large3 > large3
314 $ echo large3 > large3
315 $ hg commit .hglf/large3 -m "try to commit standin"
315 $ hg commit .hglf/large3 -m "try to commit standin"
316 abort: file ".hglf/large3" is a largefile standin
316 abort: file ".hglf/large3" is a largefile standin
317 (commit the largefile itself instead)
317 (commit the largefile itself instead)
318 [255]
318 [255]
319
319
320 Corner cases for adding largefiles.
320 Corner cases for adding largefiles.
321
321
322 $ echo large5 > large5
322 $ echo large5 > large5
323 $ hg add --large large5
323 $ hg add --large large5
324 $ hg add --large large5
324 $ hg add --large large5
325 large5 already a largefile
325 large5 already a largefile
326 $ mkdir sub2
326 $ mkdir sub2
327 $ echo large6 > sub2/large6
327 $ echo large6 > sub2/large6
328 $ echo large7 > sub2/large7
328 $ echo large7 > sub2/large7
329 $ hg add --large sub2
329 $ hg add --large sub2
330 adding sub2/large6 as a largefile (glob)
330 adding sub2/large6 as a largefile (glob)
331 adding sub2/large7 as a largefile (glob)
331 adding sub2/large7 as a largefile (glob)
332 $ hg st
332 $ hg st
333 M large3
333 M large3
334 A large5
334 A large5
335 A sub2/large6
335 A sub2/large6
336 A sub2/large7
336 A sub2/large7
337
337
338 Committing directories containing only largefiles.
338 Committing directories containing only largefiles.
339
339
340 $ mkdir -p z/y/x/m
340 $ mkdir -p z/y/x/m
341 $ touch z/y/x/m/large1
341 $ touch z/y/x/m/large1
342 $ touch z/y/x/large2
342 $ touch z/y/x/large2
343 $ hg add --large z/y/x/m/large1 z/y/x/large2
343 $ hg add --large z/y/x/m/large1 z/y/x/large2
344 $ hg commit -m "Subdir with directory only containing largefiles" z
344 $ hg commit -m "Subdir with directory only containing largefiles" z
345 Invoking status precommit hook
345 Invoking status precommit hook
346 M large3
346 M large3
347 A large5
347 A large5
348 A sub2/large6
348 A sub2/large6
349 A sub2/large7
349 A sub2/large7
350 A z/y/x/large2
350 A z/y/x/large2
351 A z/y/x/m/large1
351 A z/y/x/m/large1
352
352
353 (and a bit of log testing)
353 (and a bit of log testing)
354
354
355 $ hg log -T '{rev}\n' z/y/x/m/large1
355 $ hg log -T '{rev}\n' z/y/x/m/large1
356 7
356 7
357 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
357 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
358 7
358 7
359
359
360 $ hg rollback --quiet
360 $ hg rollback --quiet
361 $ touch z/y/x/m/normal
361 $ touch z/y/x/m/normal
362 $ hg add z/y/x/m/normal
362 $ hg add z/y/x/m/normal
363 $ hg commit -m "Subdir with mixed contents" z
363 $ hg commit -m "Subdir with mixed contents" z
364 Invoking status precommit hook
364 Invoking status precommit hook
365 M large3
365 M large3
366 A large5
366 A large5
367 A sub2/large6
367 A sub2/large6
368 A sub2/large7
368 A sub2/large7
369 A z/y/x/large2
369 A z/y/x/large2
370 A z/y/x/m/large1
370 A z/y/x/m/large1
371 A z/y/x/m/normal
371 A z/y/x/m/normal
372 $ hg st
372 $ hg st
373 M large3
373 M large3
374 A large5
374 A large5
375 A sub2/large6
375 A sub2/large6
376 A sub2/large7
376 A sub2/large7
377 $ hg rollback --quiet
377 $ hg rollback --quiet
378 $ hg revert z/y/x/large2 z/y/x/m/large1
378 $ hg revert z/y/x/large2 z/y/x/m/large1
379 $ rm z/y/x/large2 z/y/x/m/large1
379 $ rm z/y/x/large2 z/y/x/m/large1
380 $ hg commit -m "Subdir with normal contents" z
380 $ hg commit -m "Subdir with normal contents" z
381 Invoking status precommit hook
381 Invoking status precommit hook
382 M large3
382 M large3
383 A large5
383 A large5
384 A sub2/large6
384 A sub2/large6
385 A sub2/large7
385 A sub2/large7
386 A z/y/x/m/normal
386 A z/y/x/m/normal
387 $ hg st
387 $ hg st
388 M large3
388 M large3
389 A large5
389 A large5
390 A sub2/large6
390 A sub2/large6
391 A sub2/large7
391 A sub2/large7
392 $ hg rollback --quiet
392 $ hg rollback --quiet
393 $ hg revert --quiet z
393 $ hg revert --quiet z
394 $ hg commit -m "Empty subdir" z
394 $ hg commit -m "Empty subdir" z
395 abort: z: no match under directory!
395 abort: z: no match under directory!
396 [255]
396 [255]
397 $ rm -rf z
397 $ rm -rf z
398 $ hg ci -m "standin" .hglf
398 $ hg ci -m "standin" .hglf
399 abort: file ".hglf" is a largefile standin
399 abort: file ".hglf" is a largefile standin
400 (commit the largefile itself instead)
400 (commit the largefile itself instead)
401 [255]
401 [255]
402
402
403 Test "hg status" with combination of 'file pattern' and 'directory
403 Test "hg status" with combination of 'file pattern' and 'directory
404 pattern' for largefiles:
404 pattern' for largefiles:
405
405
406 $ hg status sub2/large6 sub2
406 $ hg status sub2/large6 sub2
407 A sub2/large6
407 A sub2/large6
408 A sub2/large7
408 A sub2/large7
409
409
410 Config settings (pattern **.dat, minsize 2 MB) are respected.
410 Config settings (pattern **.dat, minsize 2 MB) are respected.
411
411
412 $ echo testdata > test.dat
412 $ echo testdata > test.dat
413 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
413 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
414 $ hg add
414 $ hg add
415 adding reallylarge as a largefile
415 adding reallylarge as a largefile
416 adding test.dat as a largefile
416 adding test.dat as a largefile
417
417
418 Test that minsize and --lfsize handle float values;
418 Test that minsize and --lfsize handle float values;
419 also tests that --lfsize overrides largefiles.minsize.
419 also tests that --lfsize overrides largefiles.minsize.
420 (0.250 MB = 256 kB = 262144 B)
420 (0.250 MB = 256 kB = 262144 B)
421
421
422 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
422 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
423 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
423 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
424 $ hg --config largefiles.minsize=.25 add
424 $ hg --config largefiles.minsize=.25 add
425 adding ratherlarge as a largefile
425 adding ratherlarge as a largefile
426 adding medium
426 adding medium
427 $ hg forget medium
427 $ hg forget medium
428 $ hg --config largefiles.minsize=.25 add --lfsize=.125
428 $ hg --config largefiles.minsize=.25 add --lfsize=.125
429 adding medium as a largefile
429 adding medium as a largefile
430 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
430 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
431 $ hg --config largefiles.minsize=.25 add --lfsize=.125
431 $ hg --config largefiles.minsize=.25 add --lfsize=.125
432 adding notlarge
432 adding notlarge
433 $ hg forget notlarge
433 $ hg forget notlarge
434
434
435 Test forget on largefiles.
435 Test forget on largefiles.
436
436
437 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
437 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
438 $ hg commit -m "add/edit more largefiles"
438 $ hg commit -m "add/edit more largefiles"
439 Invoking status precommit hook
439 Invoking status precommit hook
440 A sub2/large6
440 A sub2/large6
441 A sub2/large7
441 A sub2/large7
442 R large3
442 R large3
443 ? large5
443 ? large5
444 ? medium
444 ? medium
445 ? notlarge
445 ? notlarge
446 ? ratherlarge
446 ? ratherlarge
447 ? reallylarge
447 ? reallylarge
448 ? test.dat
448 ? test.dat
449 $ hg st
449 $ hg st
450 ? large3
450 ? large3
451 ? large5
451 ? large5
452 ? medium
452 ? medium
453 ? notlarge
453 ? notlarge
454 ? ratherlarge
454 ? ratherlarge
455 ? reallylarge
455 ? reallylarge
456 ? test.dat
456 ? test.dat
457
457
458 Purge with largefiles: verify that largefiles are still in the working
458 Purge with largefiles: verify that largefiles are still in the working
459 dir after a purge.
459 dir after a purge.
460
460
461 $ hg purge --all
461 $ hg purge --all
462 $ cat sub/large4
462 $ cat sub/large4
463 large44
463 large44
464 $ cat sub2/large6
464 $ cat sub2/large6
465 large6
465 large6
466 $ cat sub2/large7
466 $ cat sub2/large7
467 large7
467 large7
468
468
469 Test addremove: verify that files that should be added as largefiles are added as
469 Test addremove: verify that files that should be added as largefiles are added as
470 such and that already-existing largefiles are not added as normal files by
470 such and that already-existing largefiles are not added as normal files by
471 accident.
471 accident.
472
472
473 $ rm normal3
473 $ rm normal3
474 $ rm sub/large4
474 $ rm sub/large4
475 $ echo "testing addremove with patterns" > testaddremove.dat
475 $ echo "testing addremove with patterns" > testaddremove.dat
476 $ echo "normaladdremove" > normaladdremove
476 $ echo "normaladdremove" > normaladdremove
477 $ hg addremove
477 $ hg addremove
478 removing sub/large4
478 removing sub/large4
479 adding testaddremove.dat as a largefile
479 adding testaddremove.dat as a largefile
480 removing normal3
480 removing normal3
481 adding normaladdremove
481 adding normaladdremove
482
482
483 Test addremove with -R
483 Test addremove with -R
484
484
485 $ hg up -C
485 $ hg up -C
486 getting changed largefiles
486 getting changed largefiles
487 1 largefiles updated, 0 removed
487 1 largefiles updated, 0 removed
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
488 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
489 $ rm normal3
489 $ rm normal3
490 $ rm sub/large4
490 $ rm sub/large4
491 $ echo "testing addremove with patterns" > testaddremove.dat
491 $ echo "testing addremove with patterns" > testaddremove.dat
492 $ echo "normaladdremove" > normaladdremove
492 $ echo "normaladdremove" > normaladdremove
493 $ cd ..
493 $ cd ..
494 $ hg -R a addremove
494 $ hg -R a addremove
495 removing sub/large4
495 removing sub/large4
496 adding a/testaddremove.dat as a largefile (glob)
496 adding a/testaddremove.dat as a largefile (glob)
497 removing normal3
497 removing normal3
498 adding normaladdremove
498 adding normaladdremove
499 $ cd a
499 $ cd a
500
500
501 Test 3364
501 Test 3364
502 $ hg clone . ../addrm
502 $ hg clone . ../addrm
503 updating to branch default
503 updating to branch default
504 getting changed largefiles
504 getting changed largefiles
505 3 largefiles updated, 0 removed
505 3 largefiles updated, 0 removed
506 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
506 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
507 $ cd ../addrm
507 $ cd ../addrm
508 $ cat >> .hg/hgrc <<EOF
508 $ cat >> .hg/hgrc <<EOF
509 > [hooks]
509 > [hooks]
510 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
510 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
511 > EOF
511 > EOF
512 $ touch foo
512 $ touch foo
513 $ hg add --large foo
513 $ hg add --large foo
514 $ hg ci -m "add foo"
514 $ hg ci -m "add foo"
515 Invoking status precommit hook
515 Invoking status precommit hook
516 A foo
516 A foo
517 Invoking status postcommit hook
517 Invoking status postcommit hook
518 C foo
518 C foo
519 C normal3
519 C normal3
520 C sub/large4
520 C sub/large4
521 C sub/normal4
521 C sub/normal4
522 C sub2/large6
522 C sub2/large6
523 C sub2/large7
523 C sub2/large7
524 $ rm foo
524 $ rm foo
525 $ hg st
525 $ hg st
526 ! foo
526 ! foo
527 hmm.. no precommit invoked, but there is a postcommit??
527 hmm.. no precommit invoked, but there is a postcommit??
528 $ hg ci -m "will not checkin"
528 $ hg ci -m "will not checkin"
529 nothing changed
529 nothing changed
530 Invoking status postcommit hook
530 Invoking status postcommit hook
531 ! foo
531 ! foo
532 C normal3
532 C normal3
533 C sub/large4
533 C sub/large4
534 C sub/normal4
534 C sub/normal4
535 C sub2/large6
535 C sub2/large6
536 C sub2/large7
536 C sub2/large7
537 [1]
537 [1]
538 $ hg addremove
538 $ hg addremove
539 removing foo
539 removing foo
540 $ hg st
540 $ hg st
541 R foo
541 R foo
542 $ hg ci -m "used to say nothing changed"
542 $ hg ci -m "used to say nothing changed"
543 Invoking status precommit hook
543 Invoking status precommit hook
544 R foo
544 R foo
545 Invoking status postcommit hook
545 Invoking status postcommit hook
546 C normal3
546 C normal3
547 C sub/large4
547 C sub/large4
548 C sub/normal4
548 C sub/normal4
549 C sub2/large6
549 C sub2/large6
550 C sub2/large7
550 C sub2/large7
551 $ hg st
551 $ hg st
552
552
553 Test 3507 (both normal files and largefiles were a problem)
553 Test 3507 (both normal files and largefiles were a problem)
554
554
555 $ touch normal
555 $ touch normal
556 $ touch large
556 $ touch large
557 $ hg add normal
557 $ hg add normal
558 $ hg add --large large
558 $ hg add --large large
559 $ hg ci -m "added"
559 $ hg ci -m "added"
560 Invoking status precommit hook
560 Invoking status precommit hook
561 A large
561 A large
562 A normal
562 A normal
563 Invoking status postcommit hook
563 Invoking status postcommit hook
564 C large
564 C large
565 C normal
565 C normal
566 C normal3
566 C normal3
567 C sub/large4
567 C sub/large4
568 C sub/normal4
568 C sub/normal4
569 C sub2/large6
569 C sub2/large6
570 C sub2/large7
570 C sub2/large7
571 $ hg remove normal
571 $ hg remove normal
572 $ hg addremove --traceback
572 $ hg addremove --traceback
573 $ hg ci -m "addremoved normal"
573 $ hg ci -m "addremoved normal"
574 Invoking status precommit hook
574 Invoking status precommit hook
575 R normal
575 R normal
576 Invoking status postcommit hook
576 Invoking status postcommit hook
577 C large
577 C large
578 C normal3
578 C normal3
579 C sub/large4
579 C sub/large4
580 C sub/normal4
580 C sub/normal4
581 C sub2/large6
581 C sub2/large6
582 C sub2/large7
582 C sub2/large7
583 $ hg up -C '.^'
583 $ hg up -C '.^'
584 getting changed largefiles
584 getting changed largefiles
585 0 largefiles updated, 0 removed
585 0 largefiles updated, 0 removed
586 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
586 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
587 $ hg remove large
587 $ hg remove large
588 $ hg addremove --traceback
588 $ hg addremove --traceback
589 $ hg ci -m "removed large"
589 $ hg ci -m "removed large"
590 Invoking status precommit hook
590 Invoking status precommit hook
591 R large
591 R large
592 created new head
592 created new head
593 Invoking status postcommit hook
593 Invoking status postcommit hook
594 C normal
594 C normal
595 C normal3
595 C normal3
596 C sub/large4
596 C sub/large4
597 C sub/normal4
597 C sub/normal4
598 C sub2/large6
598 C sub2/large6
599 C sub2/large7
599 C sub2/large7
600
600
601 Test commit -A (issue 3542)
601 Test commit -A (issue 3542)
602 $ echo large8 > large8
602 $ echo large8 > large8
603 $ hg add --large large8
603 $ hg add --large large8
604 $ hg ci -Am 'this used to add large8 as normal and commit both'
604 $ hg ci -Am 'this used to add large8 as normal and commit both'
605 Invoking status precommit hook
605 Invoking status precommit hook
606 A large8
606 A large8
607 Invoking status postcommit hook
607 Invoking status postcommit hook
608 C large8
608 C large8
609 C normal
609 C normal
610 C normal3
610 C normal3
611 C sub/large4
611 C sub/large4
612 C sub/normal4
612 C sub/normal4
613 C sub2/large6
613 C sub2/large6
614 C sub2/large7
614 C sub2/large7
615 $ rm large8
615 $ rm large8
616 $ hg ci -Am 'this used to not notice the rm'
616 $ hg ci -Am 'this used to not notice the rm'
617 removing large8
617 removing large8
618 Invoking status precommit hook
618 Invoking status precommit hook
619 R large8
619 R large8
620 Invoking status postcommit hook
620 Invoking status postcommit hook
621 C normal
621 C normal
622 C normal3
622 C normal3
623 C sub/large4
623 C sub/large4
624 C sub/normal4
624 C sub/normal4
625 C sub2/large6
625 C sub2/large6
626 C sub2/large7
626 C sub2/large7
627
627
628 Test that a standin can't be added as a large file
628 Test that a standin can't be added as a large file
629
629
630 $ touch large
630 $ touch large
631 $ hg add --large large
631 $ hg add --large large
632 $ hg ci -m "add"
632 $ hg ci -m "add"
633 Invoking status precommit hook
633 Invoking status precommit hook
634 A large
634 A large
635 Invoking status postcommit hook
635 Invoking status postcommit hook
636 C large
636 C large
637 C normal
637 C normal
638 C normal3
638 C normal3
639 C sub/large4
639 C sub/large4
640 C sub/normal4
640 C sub/normal4
641 C sub2/large6
641 C sub2/large6
642 C sub2/large7
642 C sub2/large7
643 $ hg remove large
643 $ hg remove large
644 $ touch large
644 $ touch large
645 $ hg addremove --config largefiles.patterns=**large --traceback
645 $ hg addremove --config largefiles.patterns=**large --traceback
646 adding large as a largefile
646 adding large as a largefile
647
647
648 Test that outgoing --large works (with revsets too)
648 Test that outgoing --large works (with revsets too)
649 $ hg outgoing --rev '.^' --large
649 $ hg outgoing --rev '.^' --large
650 comparing with $TESTTMP/a (glob)
650 comparing with $TESTTMP/a (glob)
651 searching for changes
651 searching for changes
652 changeset: 8:c02fd3b77ec4
652 changeset: 8:c02fd3b77ec4
653 user: test
653 user: test
654 date: Thu Jan 01 00:00:00 1970 +0000
654 date: Thu Jan 01 00:00:00 1970 +0000
655 summary: add foo
655 summary: add foo
656
656
657 changeset: 9:289dd08c9bbb
657 changeset: 9:289dd08c9bbb
658 user: test
658 user: test
659 date: Thu Jan 01 00:00:00 1970 +0000
659 date: Thu Jan 01 00:00:00 1970 +0000
660 summary: used to say nothing changed
660 summary: used to say nothing changed
661
661
662 changeset: 10:34f23ac6ac12
662 changeset: 10:34f23ac6ac12
663 user: test
663 user: test
664 date: Thu Jan 01 00:00:00 1970 +0000
664 date: Thu Jan 01 00:00:00 1970 +0000
665 summary: added
665 summary: added
666
666
667 changeset: 12:710c1b2f523c
667 changeset: 12:710c1b2f523c
668 parent: 10:34f23ac6ac12
668 parent: 10:34f23ac6ac12
669 user: test
669 user: test
670 date: Thu Jan 01 00:00:00 1970 +0000
670 date: Thu Jan 01 00:00:00 1970 +0000
671 summary: removed large
671 summary: removed large
672
672
673 changeset: 13:0a3e75774479
673 changeset: 13:0a3e75774479
674 user: test
674 user: test
675 date: Thu Jan 01 00:00:00 1970 +0000
675 date: Thu Jan 01 00:00:00 1970 +0000
676 summary: this used to add large8 as normal and commit both
676 summary: this used to add large8 as normal and commit both
677
677
678 changeset: 14:84f3d378175c
678 changeset: 14:84f3d378175c
679 user: test
679 user: test
680 date: Thu Jan 01 00:00:00 1970 +0000
680 date: Thu Jan 01 00:00:00 1970 +0000
681 summary: this used to not notice the rm
681 summary: this used to not notice the rm
682
682
683 largefiles to upload:
683 largefiles to upload (2 entities):
684 foo
684 foo
685 large
685 large
686 large8
686 large8
687
687
688 $ cd ../a
688 $ cd ../a
689
689
690 Clone a largefiles repo.
690 Clone a largefiles repo.
691
691
692 $ hg clone . ../b
692 $ hg clone . ../b
693 updating to branch default
693 updating to branch default
694 getting changed largefiles
694 getting changed largefiles
695 3 largefiles updated, 0 removed
695 3 largefiles updated, 0 removed
696 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
696 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
697 $ cd ../b
697 $ cd ../b
698 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
698 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
699 7:daea875e9014 add/edit more largefiles
699 7:daea875e9014 add/edit more largefiles
700 6:4355d653f84f edit files yet again
700 6:4355d653f84f edit files yet again
701 5:9d5af5072dbd edit files again
701 5:9d5af5072dbd edit files again
702 4:74c02385b94c move files
702 4:74c02385b94c move files
703 3:9e8fbc4bce62 copy files
703 3:9e8fbc4bce62 copy files
704 2:51a0ae4d5864 remove files
704 2:51a0ae4d5864 remove files
705 1:ce8896473775 edit files
705 1:ce8896473775 edit files
706 0:30d30fe6a5be add files
706 0:30d30fe6a5be add files
707 $ cat normal3
707 $ cat normal3
708 normal33
708 normal33
709
709
710 Test graph log
710 Test graph log
711
711
712 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
712 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
713 @ 7:daea875e9014 add/edit more largefiles
713 @ 7:daea875e9014 add/edit more largefiles
714 |
714 |
715 o 6:4355d653f84f edit files yet again
715 o 6:4355d653f84f edit files yet again
716 |
716 |
717 o 5:9d5af5072dbd edit files again
717 o 5:9d5af5072dbd edit files again
718 |
718 |
719 o 4:74c02385b94c move files
719 o 4:74c02385b94c move files
720 |
720 |
721 o 3:9e8fbc4bce62 copy files
721 o 3:9e8fbc4bce62 copy files
722 |
722 |
723 o 2:51a0ae4d5864 remove files
723 o 2:51a0ae4d5864 remove files
724 |
724 |
725 o 1:ce8896473775 edit files
725 o 1:ce8896473775 edit files
726 |
726 |
727 o 0:30d30fe6a5be add files
727 o 0:30d30fe6a5be add files
728
728
729 $ cat sub/normal4
729 $ cat sub/normal4
730 normal44
730 normal44
731 $ cat sub/large4
731 $ cat sub/large4
732 large44
732 large44
733 $ cat sub2/large6
733 $ cat sub2/large6
734 large6
734 large6
735 $ cat sub2/large7
735 $ cat sub2/large7
736 large7
736 large7
737 $ hg log -qf sub2/large7
737 $ hg log -qf sub2/large7
738 7:daea875e9014
738 7:daea875e9014
739 $ hg log -Gqf sub2/large7
739 $ hg log -Gqf sub2/large7
740 @ 7:daea875e9014
740 @ 7:daea875e9014
741 |
741 |
742 $ cd ..
742 $ cd ..
743
743
744 Test log from outside repo
744 Test log from outside repo
745
745
746 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
746 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
747 6:4355d653f84f edit files yet again
747 6:4355d653f84f edit files yet again
748 5:9d5af5072dbd edit files again
748 5:9d5af5072dbd edit files again
749 4:74c02385b94c move files
749 4:74c02385b94c move files
750 1:ce8896473775 edit files
750 1:ce8896473775 edit files
751 0:30d30fe6a5be add files
751 0:30d30fe6a5be add files
752
752
753 Test clone at revision
753 Test clone at revision
754
754
755 $ hg clone a -r 3 c
755 $ hg clone a -r 3 c
756 adding changesets
756 adding changesets
757 adding manifests
757 adding manifests
758 adding file changes
758 adding file changes
759 added 4 changesets with 10 changes to 4 files
759 added 4 changesets with 10 changes to 4 files
760 updating to branch default
760 updating to branch default
761 getting changed largefiles
761 getting changed largefiles
762 2 largefiles updated, 0 removed
762 2 largefiles updated, 0 removed
763 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
763 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
764 $ cd c
764 $ cd c
765 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
765 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
766 3:9e8fbc4bce62 copy files
766 3:9e8fbc4bce62 copy files
767 2:51a0ae4d5864 remove files
767 2:51a0ae4d5864 remove files
768 1:ce8896473775 edit files
768 1:ce8896473775 edit files
769 0:30d30fe6a5be add files
769 0:30d30fe6a5be add files
770 $ cat normal1
770 $ cat normal1
771 normal22
771 normal22
772 $ cat large1
772 $ cat large1
773 large22
773 large22
774 $ cat sub/normal2
774 $ cat sub/normal2
775 normal22
775 normal22
776 $ cat sub/large2
776 $ cat sub/large2
777 large22
777 large22
778
778
779 Old revisions of a clone have correct largefiles content (this also
779 Old revisions of a clone have correct largefiles content (this also
780 tests update).
780 tests update).
781
781
782 $ hg update -r 1
782 $ hg update -r 1
783 getting changed largefiles
783 getting changed largefiles
784 1 largefiles updated, 0 removed
784 1 largefiles updated, 0 removed
785 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
785 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
786 $ cat large1
786 $ cat large1
787 large11
787 large11
788 $ cat sub/large2
788 $ cat sub/large2
789 large22
789 large22
790 $ cd ..
790 $ cd ..
791
791
792 Test cloning with --all-largefiles flag
792 Test cloning with --all-largefiles flag
793
793
794 $ rm "${USERCACHE}"/*
794 $ rm "${USERCACHE}"/*
795 $ hg clone --all-largefiles a a-backup
795 $ hg clone --all-largefiles a a-backup
796 updating to branch default
796 updating to branch default
797 getting changed largefiles
797 getting changed largefiles
798 3 largefiles updated, 0 removed
798 3 largefiles updated, 0 removed
799 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
799 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
800 8 additional largefiles cached
800 8 additional largefiles cached
801
801
802 $ rm "${USERCACHE}"/*
802 $ rm "${USERCACHE}"/*
803 $ hg clone --all-largefiles -u 0 a a-clone0
803 $ hg clone --all-largefiles -u 0 a a-clone0
804 updating to branch default
804 updating to branch default
805 getting changed largefiles
805 getting changed largefiles
806 2 largefiles updated, 0 removed
806 2 largefiles updated, 0 removed
807 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
807 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
808 9 additional largefiles cached
808 9 additional largefiles cached
809 $ hg -R a-clone0 sum
809 $ hg -R a-clone0 sum
810 parent: 0:30d30fe6a5be
810 parent: 0:30d30fe6a5be
811 add files
811 add files
812 branch: default
812 branch: default
813 commit: (clean)
813 commit: (clean)
814 update: 7 new changesets (update)
814 update: 7 new changesets (update)
815
815
816 $ rm "${USERCACHE}"/*
816 $ rm "${USERCACHE}"/*
817 $ hg clone --all-largefiles -u 1 a a-clone1
817 $ hg clone --all-largefiles -u 1 a a-clone1
818 updating to branch default
818 updating to branch default
819 getting changed largefiles
819 getting changed largefiles
820 2 largefiles updated, 0 removed
820 2 largefiles updated, 0 removed
821 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
821 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
822 8 additional largefiles cached
822 8 additional largefiles cached
823 $ hg -R a-clone1 verify --large --lfa --lfc
823 $ hg -R a-clone1 verify --large --lfa --lfc
824 checking changesets
824 checking changesets
825 checking manifests
825 checking manifests
826 crosschecking files in changesets and manifests
826 crosschecking files in changesets and manifests
827 checking files
827 checking files
828 10 files, 8 changesets, 24 total revisions
828 10 files, 8 changesets, 24 total revisions
829 searching 8 changesets for largefiles
829 searching 8 changesets for largefiles
830 verified contents of 13 revisions of 6 largefiles
830 verified contents of 13 revisions of 6 largefiles
831 $ hg -R a-clone1 sum
831 $ hg -R a-clone1 sum
832 parent: 1:ce8896473775
832 parent: 1:ce8896473775
833 edit files
833 edit files
834 branch: default
834 branch: default
835 commit: (clean)
835 commit: (clean)
836 update: 6 new changesets (update)
836 update: 6 new changesets (update)
837
837
838 $ rm "${USERCACHE}"/*
838 $ rm "${USERCACHE}"/*
839 $ hg clone --all-largefiles -U a a-clone-u
839 $ hg clone --all-largefiles -U a a-clone-u
840 11 additional largefiles cached
840 11 additional largefiles cached
841 $ hg -R a-clone-u sum
841 $ hg -R a-clone-u sum
842 parent: -1:000000000000 (no revision checked out)
842 parent: -1:000000000000 (no revision checked out)
843 branch: default
843 branch: default
844 commit: (clean)
844 commit: (clean)
845 update: 8 new changesets (update)
845 update: 8 new changesets (update)
846
846
847 Show computed destination directory:
847 Show computed destination directory:
848
848
849 $ mkdir xyz
849 $ mkdir xyz
850 $ cd xyz
850 $ cd xyz
851 $ hg clone ../a
851 $ hg clone ../a
852 destination directory: a
852 destination directory: a
853 updating to branch default
853 updating to branch default
854 getting changed largefiles
854 getting changed largefiles
855 3 largefiles updated, 0 removed
855 3 largefiles updated, 0 removed
856 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
856 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
857 $ cd ..
857 $ cd ..
858
858
859 Clone URL without path:
859 Clone URL without path:
860
860
861 $ hg clone file://
861 $ hg clone file://
862 abort: repository / not found!
862 abort: repository / not found!
863 [255]
863 [255]
864
864
865 Ensure base clone command argument validation
865 Ensure base clone command argument validation
866
866
867 $ hg clone -U -u 0 a a-clone-failure
867 $ hg clone -U -u 0 a a-clone-failure
868 abort: cannot specify both --noupdate and --updaterev
868 abort: cannot specify both --noupdate and --updaterev
869 [255]
869 [255]
870
870
871 $ hg clone --all-largefiles a ssh://localhost/a
871 $ hg clone --all-largefiles a ssh://localhost/a
872 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
872 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
873 [255]
873 [255]
874
874
875 Test pulling with --all-largefiles flag. Also test that the largefiles are
875 Test pulling with --all-largefiles flag. Also test that the largefiles are
876 downloaded from 'default' instead of 'default-push' when no source is specified
876 downloaded from 'default' instead of 'default-push' when no source is specified
877 (issue3584)
877 (issue3584)
878
878
879 $ rm -Rf a-backup
879 $ rm -Rf a-backup
880 $ hg clone -r 1 a a-backup
880 $ hg clone -r 1 a a-backup
881 adding changesets
881 adding changesets
882 adding manifests
882 adding manifests
883 adding file changes
883 adding file changes
884 added 2 changesets with 8 changes to 4 files
884 added 2 changesets with 8 changes to 4 files
885 updating to branch default
885 updating to branch default
886 getting changed largefiles
886 getting changed largefiles
887 2 largefiles updated, 0 removed
887 2 largefiles updated, 0 removed
888 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
888 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
889 $ rm "${USERCACHE}"/*
889 $ rm "${USERCACHE}"/*
890 $ cd a-backup
890 $ cd a-backup
891 $ hg pull --all-largefiles --config paths.default-push=bogus/path
891 $ hg pull --all-largefiles --config paths.default-push=bogus/path
892 pulling from $TESTTMP/a (glob)
892 pulling from $TESTTMP/a (glob)
893 searching for changes
893 searching for changes
894 adding changesets
894 adding changesets
895 adding manifests
895 adding manifests
896 adding file changes
896 adding file changes
897 added 6 changesets with 16 changes to 8 files
897 added 6 changesets with 16 changes to 8 files
898 (run 'hg update' to get a working copy)
898 (run 'hg update' to get a working copy)
899 6 largefiles cached
899 6 largefiles cached
900
900
901 redo pull with --lfrev and check it pulls largefiles for the right revs
901 redo pull with --lfrev and check it pulls largefiles for the right revs
902
902
903 $ hg rollback
903 $ hg rollback
904 repository tip rolled back to revision 1 (undo pull)
904 repository tip rolled back to revision 1 (undo pull)
905 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
905 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
906 pulling from $TESTTMP/a (glob)
906 pulling from $TESTTMP/a (glob)
907 searching for changes
907 searching for changes
908 all local heads known remotely
908 all local heads known remotely
909 6 changesets found
909 6 changesets found
910 adding changesets
910 adding changesets
911 adding manifests
911 adding manifests
912 adding file changes
912 adding file changes
913 added 6 changesets with 16 changes to 8 files
913 added 6 changesets with 16 changes to 8 files
914 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
914 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
915 (run 'hg update' to get a working copy)
915 (run 'hg update' to get a working copy)
916 pulling largefiles for revision 7
916 pulling largefiles for revision 7
917 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
917 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
918 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
918 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
919 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
919 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
920 pulling largefiles for revision 2
920 pulling largefiles for revision 2
921 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
921 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
922 0 largefiles cached
922 0 largefiles cached
923
923
924 lfpull
924 lfpull
925
925
926 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
926 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
927 2 largefiles cached
927 2 largefiles cached
928 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
928 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
929 pulling largefiles for revision 4
929 pulling largefiles for revision 4
930 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
930 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
931 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
931 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
932 pulling largefiles for revision 2
932 pulling largefiles for revision 2
933 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
933 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
934 0 largefiles cached
934 0 largefiles cached
935
935
936 $ ls usercache-lfpull/* | sort
936 $ ls usercache-lfpull/* | sort
937 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
937 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
938 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
938 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
939
939
940 $ cd ..
940 $ cd ..
941
941
942 Rebasing between two repositories does not revert largefiles to old
942 Rebasing between two repositories does not revert largefiles to old
943 revisions (this was a very bad bug that took a lot of work to fix).
943 revisions (this was a very bad bug that took a lot of work to fix).
944
944
945 $ hg clone a d
945 $ hg clone a d
946 updating to branch default
946 updating to branch default
947 getting changed largefiles
947 getting changed largefiles
948 3 largefiles updated, 0 removed
948 3 largefiles updated, 0 removed
949 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
949 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
950 $ cd b
950 $ cd b
951 $ echo large4-modified > sub/large4
951 $ echo large4-modified > sub/large4
952 $ echo normal3-modified > normal3
952 $ echo normal3-modified > normal3
953 $ hg commit -m "modify normal file and largefile in repo b"
953 $ hg commit -m "modify normal file and largefile in repo b"
954 Invoking status precommit hook
954 Invoking status precommit hook
955 M normal3
955 M normal3
956 M sub/large4
956 M sub/large4
957 $ cd ../d
957 $ cd ../d
958 $ echo large6-modified > sub2/large6
958 $ echo large6-modified > sub2/large6
959 $ echo normal4-modified > sub/normal4
959 $ echo normal4-modified > sub/normal4
960 $ hg commit -m "modify normal file largefile in repo d"
960 $ hg commit -m "modify normal file largefile in repo d"
961 Invoking status precommit hook
961 Invoking status precommit hook
962 M sub/normal4
962 M sub/normal4
963 M sub2/large6
963 M sub2/large6
964 $ cd ..
964 $ cd ..
965 $ hg clone d e
965 $ hg clone d e
966 updating to branch default
966 updating to branch default
967 getting changed largefiles
967 getting changed largefiles
968 3 largefiles updated, 0 removed
968 3 largefiles updated, 0 removed
969 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
969 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
970 $ cd d
970 $ cd d
971
971
972 More rebase testing, but also test that the largefiles are downloaded from
972 More rebase testing, but also test that the largefiles are downloaded from
973 'default-push' when no source is specified (issue3584). (The largefile from the
973 'default-push' when no source is specified (issue3584). (The largefile from the
974 pulled revision is however not downloaded but found in the local cache.)
974 pulled revision is however not downloaded but found in the local cache.)
975 Largefiles are fetched for the new pulled revision, not for existing revisions,
975 Largefiles are fetched for the new pulled revision, not for existing revisions,
976 rebased or not.
976 rebased or not.
977
977
978 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
978 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
979 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
979 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
980 pulling from $TESTTMP/b (glob)
980 pulling from $TESTTMP/b (glob)
981 searching for changes
981 searching for changes
982 adding changesets
982 adding changesets
983 adding manifests
983 adding manifests
984 adding file changes
984 adding file changes
985 added 1 changesets with 2 changes to 2 files (+1 heads)
985 added 1 changesets with 2 changes to 2 files (+1 heads)
986 Invoking status precommit hook
986 Invoking status precommit hook
987 M sub/normal4
987 M sub/normal4
988 M sub2/large6
988 M sub2/large6
989 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
989 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
990 0 largefiles cached
990 0 largefiles cached
991 nothing to rebase - working directory parent is also destination
991 nothing to rebase - working directory parent is also destination
992 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
992 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
993 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
993 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
994 9:598410d3eb9a modify normal file largefile in repo d
994 9:598410d3eb9a modify normal file largefile in repo d
995 8:a381d2c8c80e modify normal file and largefile in repo b
995 8:a381d2c8c80e modify normal file and largefile in repo b
996 7:daea875e9014 add/edit more largefiles
996 7:daea875e9014 add/edit more largefiles
997 6:4355d653f84f edit files yet again
997 6:4355d653f84f edit files yet again
998 5:9d5af5072dbd edit files again
998 5:9d5af5072dbd edit files again
999 4:74c02385b94c move files
999 4:74c02385b94c move files
1000 3:9e8fbc4bce62 copy files
1000 3:9e8fbc4bce62 copy files
1001 2:51a0ae4d5864 remove files
1001 2:51a0ae4d5864 remove files
1002 1:ce8896473775 edit files
1002 1:ce8896473775 edit files
1003 0:30d30fe6a5be add files
1003 0:30d30fe6a5be add files
1004 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1004 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1005 @ 9:598410d3eb9a modify normal file largefile in repo d
1005 @ 9:598410d3eb9a modify normal file largefile in repo d
1006 |
1006 |
1007 o 8:a381d2c8c80e modify normal file and largefile in repo b
1007 o 8:a381d2c8c80e modify normal file and largefile in repo b
1008 |
1008 |
1009 o 7:daea875e9014 add/edit more largefiles
1009 o 7:daea875e9014 add/edit more largefiles
1010 |
1010 |
1011 o 6:4355d653f84f edit files yet again
1011 o 6:4355d653f84f edit files yet again
1012 |
1012 |
1013 o 5:9d5af5072dbd edit files again
1013 o 5:9d5af5072dbd edit files again
1014 |
1014 |
1015 o 4:74c02385b94c move files
1015 o 4:74c02385b94c move files
1016 |
1016 |
1017 o 3:9e8fbc4bce62 copy files
1017 o 3:9e8fbc4bce62 copy files
1018 |
1018 |
1019 o 2:51a0ae4d5864 remove files
1019 o 2:51a0ae4d5864 remove files
1020 |
1020 |
1021 o 1:ce8896473775 edit files
1021 o 1:ce8896473775 edit files
1022 |
1022 |
1023 o 0:30d30fe6a5be add files
1023 o 0:30d30fe6a5be add files
1024
1024
1025 $ cat normal3
1025 $ cat normal3
1026 normal3-modified
1026 normal3-modified
1027 $ cat sub/normal4
1027 $ cat sub/normal4
1028 normal4-modified
1028 normal4-modified
1029 $ cat sub/large4
1029 $ cat sub/large4
1030 large4-modified
1030 large4-modified
1031 $ cat sub2/large6
1031 $ cat sub2/large6
1032 large6-modified
1032 large6-modified
1033 $ cat sub2/large7
1033 $ cat sub2/large7
1034 large7
1034 large7
1035 $ cd ../e
1035 $ cd ../e
1036 $ hg pull ../b
1036 $ hg pull ../b
1037 pulling from ../b
1037 pulling from ../b
1038 searching for changes
1038 searching for changes
1039 adding changesets
1039 adding changesets
1040 adding manifests
1040 adding manifests
1041 adding file changes
1041 adding file changes
1042 added 1 changesets with 2 changes to 2 files (+1 heads)
1042 added 1 changesets with 2 changes to 2 files (+1 heads)
1043 (run 'hg heads' to see heads, 'hg merge' to merge)
1043 (run 'hg heads' to see heads, 'hg merge' to merge)
1044 $ hg rebase
1044 $ hg rebase
1045 Invoking status precommit hook
1045 Invoking status precommit hook
1046 M sub/normal4
1046 M sub/normal4
1047 M sub2/large6
1047 M sub2/large6
1048 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1048 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1049 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1049 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1050 9:598410d3eb9a modify normal file largefile in repo d
1050 9:598410d3eb9a modify normal file largefile in repo d
1051 8:a381d2c8c80e modify normal file and largefile in repo b
1051 8:a381d2c8c80e modify normal file and largefile in repo b
1052 7:daea875e9014 add/edit more largefiles
1052 7:daea875e9014 add/edit more largefiles
1053 6:4355d653f84f edit files yet again
1053 6:4355d653f84f edit files yet again
1054 5:9d5af5072dbd edit files again
1054 5:9d5af5072dbd edit files again
1055 4:74c02385b94c move files
1055 4:74c02385b94c move files
1056 3:9e8fbc4bce62 copy files
1056 3:9e8fbc4bce62 copy files
1057 2:51a0ae4d5864 remove files
1057 2:51a0ae4d5864 remove files
1058 1:ce8896473775 edit files
1058 1:ce8896473775 edit files
1059 0:30d30fe6a5be add files
1059 0:30d30fe6a5be add files
1060 $ cat normal3
1060 $ cat normal3
1061 normal3-modified
1061 normal3-modified
1062 $ cat sub/normal4
1062 $ cat sub/normal4
1063 normal4-modified
1063 normal4-modified
1064 $ cat sub/large4
1064 $ cat sub/large4
1065 large4-modified
1065 large4-modified
1066 $ cat sub2/large6
1066 $ cat sub2/large6
1067 large6-modified
1067 large6-modified
1068 $ cat sub2/large7
1068 $ cat sub2/large7
1069 large7
1069 large7
1070
1070
1071 Log on largefiles
1071 Log on largefiles
1072
1072
1073 - same output
1073 - same output
1074 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1074 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1075 8:a381d2c8c80e modify normal file and largefile in repo b
1075 8:a381d2c8c80e modify normal file and largefile in repo b
1076 6:4355d653f84f edit files yet again
1076 6:4355d653f84f edit files yet again
1077 5:9d5af5072dbd edit files again
1077 5:9d5af5072dbd edit files again
1078 4:74c02385b94c move files
1078 4:74c02385b94c move files
1079 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1079 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1080 o 8:a381d2c8c80e modify normal file and largefile in repo b
1080 o 8:a381d2c8c80e modify normal file and largefile in repo b
1081 |
1081 |
1082 o 6:4355d653f84f edit files yet again
1082 o 6:4355d653f84f edit files yet again
1083 |
1083 |
1084 o 5:9d5af5072dbd edit files again
1084 o 5:9d5af5072dbd edit files again
1085 |
1085 |
1086 o 4:74c02385b94c move files
1086 o 4:74c02385b94c move files
1087 |
1087 |
1088 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1088 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1089 8:a381d2c8c80e modify normal file and largefile in repo b
1089 8:a381d2c8c80e modify normal file and largefile in repo b
1090 6:4355d653f84f edit files yet again
1090 6:4355d653f84f edit files yet again
1091 5:9d5af5072dbd edit files again
1091 5:9d5af5072dbd edit files again
1092 4:74c02385b94c move files
1092 4:74c02385b94c move files
1093 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1093 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1094 o 8:a381d2c8c80e modify normal file and largefile in repo b
1094 o 8:a381d2c8c80e modify normal file and largefile in repo b
1095 |
1095 |
1096 o 6:4355d653f84f edit files yet again
1096 o 6:4355d653f84f edit files yet again
1097 |
1097 |
1098 o 5:9d5af5072dbd edit files again
1098 o 5:9d5af5072dbd edit files again
1099 |
1099 |
1100 o 4:74c02385b94c move files
1100 o 4:74c02385b94c move files
1101 |
1101 |
1102
1102
1103 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1103 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1104 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1104 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1105 8:a381d2c8c80e modify normal file and largefile in repo b
1105 8:a381d2c8c80e modify normal file and largefile in repo b
1106 6:4355d653f84f edit files yet again
1106 6:4355d653f84f edit files yet again
1107 5:9d5af5072dbd edit files again
1107 5:9d5af5072dbd edit files again
1108 4:74c02385b94c move files
1108 4:74c02385b94c move files
1109 1:ce8896473775 edit files
1109 1:ce8896473775 edit files
1110 0:30d30fe6a5be add files
1110 0:30d30fe6a5be add files
1111 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1111 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1112 o 8:a381d2c8c80e modify normal file and largefile in repo b
1112 o 8:a381d2c8c80e modify normal file and largefile in repo b
1113 |
1113 |
1114 o 6:4355d653f84f edit files yet again
1114 o 6:4355d653f84f edit files yet again
1115 |
1115 |
1116 o 5:9d5af5072dbd edit files again
1116 o 5:9d5af5072dbd edit files again
1117 |
1117 |
1118 o 4:74c02385b94c move files
1118 o 4:74c02385b94c move files
1119 |
1119 |
1120 o 1:ce8896473775 edit files
1120 o 1:ce8896473775 edit files
1121 |
1121 |
1122 o 0:30d30fe6a5be add files
1122 o 0:30d30fe6a5be add files
1123
1123
1124 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1124 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1125 9:598410d3eb9a modify normal file largefile in repo d
1125 9:598410d3eb9a modify normal file largefile in repo d
1126 8:a381d2c8c80e modify normal file and largefile in repo b
1126 8:a381d2c8c80e modify normal file and largefile in repo b
1127 6:4355d653f84f edit files yet again
1127 6:4355d653f84f edit files yet again
1128 5:9d5af5072dbd edit files again
1128 5:9d5af5072dbd edit files again
1129 4:74c02385b94c move files
1129 4:74c02385b94c move files
1130 1:ce8896473775 edit files
1130 1:ce8896473775 edit files
1131 0:30d30fe6a5be add files
1131 0:30d30fe6a5be add files
1132 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1132 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1133 @ 9:598410d3eb9a modify normal file largefile in repo d
1133 @ 9:598410d3eb9a modify normal file largefile in repo d
1134 |
1134 |
1135 o 8:a381d2c8c80e modify normal file and largefile in repo b
1135 o 8:a381d2c8c80e modify normal file and largefile in repo b
1136 |
1136 |
1137 o 6:4355d653f84f edit files yet again
1137 o 6:4355d653f84f edit files yet again
1138 |
1138 |
1139 o 5:9d5af5072dbd edit files again
1139 o 5:9d5af5072dbd edit files again
1140 |
1140 |
1141 o 4:74c02385b94c move files
1141 o 4:74c02385b94c move files
1142 |
1142 |
1143 o 1:ce8896473775 edit files
1143 o 1:ce8896473775 edit files
1144 |
1144 |
1145 o 0:30d30fe6a5be add files
1145 o 0:30d30fe6a5be add files
1146
1146
1147 - globbing gives same result
1147 - globbing gives same result
1148 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1148 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1149 9:598410d3eb9a modify normal file largefile in repo d
1149 9:598410d3eb9a modify normal file largefile in repo d
1150 8:a381d2c8c80e modify normal file and largefile in repo b
1150 8:a381d2c8c80e modify normal file and largefile in repo b
1151 6:4355d653f84f edit files yet again
1151 6:4355d653f84f edit files yet again
1152 5:9d5af5072dbd edit files again
1152 5:9d5af5072dbd edit files again
1153 4:74c02385b94c move files
1153 4:74c02385b94c move files
1154 1:ce8896473775 edit files
1154 1:ce8896473775 edit files
1155 0:30d30fe6a5be add files
1155 0:30d30fe6a5be add files
1156 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1156 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1157 @ 9:598410d3eb9a modify normal file largefile in repo d
1157 @ 9:598410d3eb9a modify normal file largefile in repo d
1158 |
1158 |
1159 o 8:a381d2c8c80e modify normal file and largefile in repo b
1159 o 8:a381d2c8c80e modify normal file and largefile in repo b
1160 |
1160 |
1161 o 6:4355d653f84f edit files yet again
1161 o 6:4355d653f84f edit files yet again
1162 |
1162 |
1163 o 5:9d5af5072dbd edit files again
1163 o 5:9d5af5072dbd edit files again
1164 |
1164 |
1165 o 4:74c02385b94c move files
1165 o 4:74c02385b94c move files
1166 |
1166 |
1167 o 1:ce8896473775 edit files
1167 o 1:ce8896473775 edit files
1168 |
1168 |
1169 o 0:30d30fe6a5be add files
1169 o 0:30d30fe6a5be add files
1170
1170
1171 Rollback on largefiles.
1171 Rollback on largefiles.
1172
1172
1173 $ echo large4-modified-again > sub/large4
1173 $ echo large4-modified-again > sub/large4
1174 $ hg commit -m "Modify large4 again"
1174 $ hg commit -m "Modify large4 again"
1175 Invoking status precommit hook
1175 Invoking status precommit hook
1176 M sub/large4
1176 M sub/large4
1177 $ hg rollback
1177 $ hg rollback
1178 repository tip rolled back to revision 9 (undo commit)
1178 repository tip rolled back to revision 9 (undo commit)
1179 working directory now based on revision 9
1179 working directory now based on revision 9
1180 $ hg st
1180 $ hg st
1181 M sub/large4
1181 M sub/large4
1182 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1182 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1183 9:598410d3eb9a modify normal file largefile in repo d
1183 9:598410d3eb9a modify normal file largefile in repo d
1184 8:a381d2c8c80e modify normal file and largefile in repo b
1184 8:a381d2c8c80e modify normal file and largefile in repo b
1185 7:daea875e9014 add/edit more largefiles
1185 7:daea875e9014 add/edit more largefiles
1186 6:4355d653f84f edit files yet again
1186 6:4355d653f84f edit files yet again
1187 5:9d5af5072dbd edit files again
1187 5:9d5af5072dbd edit files again
1188 4:74c02385b94c move files
1188 4:74c02385b94c move files
1189 3:9e8fbc4bce62 copy files
1189 3:9e8fbc4bce62 copy files
1190 2:51a0ae4d5864 remove files
1190 2:51a0ae4d5864 remove files
1191 1:ce8896473775 edit files
1191 1:ce8896473775 edit files
1192 0:30d30fe6a5be add files
1192 0:30d30fe6a5be add files
1193 $ cat sub/large4
1193 $ cat sub/large4
1194 large4-modified-again
1194 large4-modified-again
1195
1195
1196 "update --check" refuses to update with uncommitted changes.
1196 "update --check" refuses to update with uncommitted changes.
1197 $ hg update --check 8
1197 $ hg update --check 8
1198 abort: uncommitted changes
1198 abort: uncommitted changes
1199 [255]
1199 [255]
1200
1200
1201 "update --clean" leaves correct largefiles in working copy, even when there is
1201 "update --clean" leaves correct largefiles in working copy, even when there is
1202 .orig files from revert in .hglf.
1202 .orig files from revert in .hglf.
1203
1203
1204 $ echo mistake > sub2/large7
1204 $ echo mistake > sub2/large7
1205 $ hg revert sub2/large7
1205 $ hg revert sub2/large7
1206 $ cat sub2/large7
1206 $ cat sub2/large7
1207 large7
1207 large7
1208 $ cat sub2/large7.orig
1208 $ cat sub2/large7.orig
1209 mistake
1209 mistake
1210 $ test ! -f .hglf/sub2/large7.orig
1210 $ test ! -f .hglf/sub2/large7.orig
1211
1211
1212 $ hg -q update --clean -r null
1212 $ hg -q update --clean -r null
1213 $ hg update --clean
1213 $ hg update --clean
1214 getting changed largefiles
1214 getting changed largefiles
1215 3 largefiles updated, 0 removed
1215 3 largefiles updated, 0 removed
1216 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1216 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1217 $ cat normal3
1217 $ cat normal3
1218 normal3-modified
1218 normal3-modified
1219 $ cat sub/normal4
1219 $ cat sub/normal4
1220 normal4-modified
1220 normal4-modified
1221 $ cat sub/large4
1221 $ cat sub/large4
1222 large4-modified
1222 large4-modified
1223 $ cat sub2/large6
1223 $ cat sub2/large6
1224 large6-modified
1224 large6-modified
1225 $ cat sub2/large7
1225 $ cat sub2/large7
1226 large7
1226 large7
1227 $ cat sub2/large7.orig
1227 $ cat sub2/large7.orig
1228 mistake
1228 mistake
1229 $ test ! -f .hglf/sub2/large7.orig
1229 $ test ! -f .hglf/sub2/large7.orig
1230
1230
1231 verify that largefile .orig file no longer is overwritten on every update -C:
1231 verify that largefile .orig file no longer is overwritten on every update -C:
1232 $ hg update --clean
1232 $ hg update --clean
1233 getting changed largefiles
1233 getting changed largefiles
1234 0 largefiles updated, 0 removed
1234 0 largefiles updated, 0 removed
1235 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1235 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1236 $ cat sub2/large7.orig
1236 $ cat sub2/large7.orig
1237 mistake
1237 mistake
1238 $ rm sub2/large7.orig
1238 $ rm sub2/large7.orig
1239
1239
1240 Now "update check" is happy.
1240 Now "update check" is happy.
1241 $ hg update --check 8
1241 $ hg update --check 8
1242 getting changed largefiles
1242 getting changed largefiles
1243 1 largefiles updated, 0 removed
1243 1 largefiles updated, 0 removed
1244 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1244 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1245 $ hg update --check
1245 $ hg update --check
1246 getting changed largefiles
1246 getting changed largefiles
1247 1 largefiles updated, 0 removed
1247 1 largefiles updated, 0 removed
1248 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1248 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1249
1249
1250 Test removing empty largefiles directories on update
1250 Test removing empty largefiles directories on update
1251 $ test -d sub2 && echo "sub2 exists"
1251 $ test -d sub2 && echo "sub2 exists"
1252 sub2 exists
1252 sub2 exists
1253 $ hg update -q null
1253 $ hg update -q null
1254 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1254 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1255 [1]
1255 [1]
1256 $ hg update -q
1256 $ hg update -q
1257
1257
1258 Test hg remove removes empty largefiles directories
1258 Test hg remove removes empty largefiles directories
1259 $ test -d sub2 && echo "sub2 exists"
1259 $ test -d sub2 && echo "sub2 exists"
1260 sub2 exists
1260 sub2 exists
1261 $ hg remove sub2/*
1261 $ hg remove sub2/*
1262 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1262 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1263 [1]
1263 [1]
1264 $ hg revert sub2/large6 sub2/large7
1264 $ hg revert sub2/large6 sub2/large7
1265
1265
1266 "revert" works on largefiles (and normal files too).
1266 "revert" works on largefiles (and normal files too).
1267 $ echo hack3 >> normal3
1267 $ echo hack3 >> normal3
1268 $ echo hack4 >> sub/normal4
1268 $ echo hack4 >> sub/normal4
1269 $ echo hack4 >> sub/large4
1269 $ echo hack4 >> sub/large4
1270 $ rm sub2/large6
1270 $ rm sub2/large6
1271 $ hg revert sub2/large6
1271 $ hg revert sub2/large6
1272 $ hg rm sub2/large6
1272 $ hg rm sub2/large6
1273 $ echo new >> sub2/large8
1273 $ echo new >> sub2/large8
1274 $ hg add --large sub2/large8
1274 $ hg add --large sub2/large8
1275 # XXX we don't really want to report that we're reverting the standin;
1275 # XXX we don't really want to report that we're reverting the standin;
1276 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1276 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1277 $ hg revert sub
1277 $ hg revert sub
1278 reverting .hglf/sub/large4 (glob)
1278 reverting .hglf/sub/large4 (glob)
1279 reverting sub/normal4 (glob)
1279 reverting sub/normal4 (glob)
1280 $ hg status
1280 $ hg status
1281 M normal3
1281 M normal3
1282 A sub2/large8
1282 A sub2/large8
1283 R sub2/large6
1283 R sub2/large6
1284 ? sub/large4.orig
1284 ? sub/large4.orig
1285 ? sub/normal4.orig
1285 ? sub/normal4.orig
1286 $ cat sub/normal4
1286 $ cat sub/normal4
1287 normal4-modified
1287 normal4-modified
1288 $ cat sub/large4
1288 $ cat sub/large4
1289 large4-modified
1289 large4-modified
1290 $ hg revert -a --no-backup
1290 $ hg revert -a --no-backup
1291 undeleting .hglf/sub2/large6 (glob)
1291 undeleting .hglf/sub2/large6 (glob)
1292 forgetting .hglf/sub2/large8 (glob)
1292 forgetting .hglf/sub2/large8 (glob)
1293 reverting normal3
1293 reverting normal3
1294 $ hg status
1294 $ hg status
1295 ? sub/large4.orig
1295 ? sub/large4.orig
1296 ? sub/normal4.orig
1296 ? sub/normal4.orig
1297 ? sub2/large8
1297 ? sub2/large8
1298 $ cat normal3
1298 $ cat normal3
1299 normal3-modified
1299 normal3-modified
1300 $ cat sub2/large6
1300 $ cat sub2/large6
1301 large6-modified
1301 large6-modified
1302 $ rm sub/*.orig sub2/large8
1302 $ rm sub/*.orig sub2/large8
1303
1303
1304 revert some files to an older revision
1304 revert some files to an older revision
1305 $ hg revert --no-backup -r 8 sub2
1305 $ hg revert --no-backup -r 8 sub2
1306 reverting .hglf/sub2/large6 (glob)
1306 reverting .hglf/sub2/large6 (glob)
1307 $ cat sub2/large6
1307 $ cat sub2/large6
1308 large6
1308 large6
1309 $ hg revert --no-backup -C -r '.^' sub2
1309 $ hg revert --no-backup -C -r '.^' sub2
1310 reverting .hglf/sub2/large6 (glob)
1310 reverting .hglf/sub2/large6 (glob)
1311 $ hg revert --no-backup sub2
1311 $ hg revert --no-backup sub2
1312 reverting .hglf/sub2/large6 (glob)
1312 reverting .hglf/sub2/large6 (glob)
1313 $ hg status
1313 $ hg status
1314
1314
1315 "verify --large" actually verifies largefiles
1315 "verify --large" actually verifies largefiles
1316
1316
1317 - Where Do We Come From? What Are We? Where Are We Going?
1317 - Where Do We Come From? What Are We? Where Are We Going?
1318 $ pwd
1318 $ pwd
1319 $TESTTMP/e
1319 $TESTTMP/e
1320 $ hg paths
1320 $ hg paths
1321 default = $TESTTMP/d (glob)
1321 default = $TESTTMP/d (glob)
1322
1322
1323 $ hg verify --large
1323 $ hg verify --large
1324 checking changesets
1324 checking changesets
1325 checking manifests
1325 checking manifests
1326 crosschecking files in changesets and manifests
1326 crosschecking files in changesets and manifests
1327 checking files
1327 checking files
1328 10 files, 10 changesets, 28 total revisions
1328 10 files, 10 changesets, 28 total revisions
1329 searching 1 changesets for largefiles
1329 searching 1 changesets for largefiles
1330 verified existence of 3 revisions of 3 largefiles
1330 verified existence of 3 revisions of 3 largefiles
1331
1331
1332 - introduce missing blob in local store repo and make sure that this is caught:
1332 - introduce missing blob in local store repo and make sure that this is caught:
1333 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1333 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1334 $ hg verify --large
1334 $ hg verify --large
1335 checking changesets
1335 checking changesets
1336 checking manifests
1336 checking manifests
1337 crosschecking files in changesets and manifests
1337 crosschecking files in changesets and manifests
1338 checking files
1338 checking files
1339 10 files, 10 changesets, 28 total revisions
1339 10 files, 10 changesets, 28 total revisions
1340 searching 1 changesets for largefiles
1340 searching 1 changesets for largefiles
1341 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1341 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1342 verified existence of 3 revisions of 3 largefiles
1342 verified existence of 3 revisions of 3 largefiles
1343 [1]
1343 [1]
1344
1344
1345 - introduce corruption and make sure that it is caught when checking content:
1345 - introduce corruption and make sure that it is caught when checking content:
1346 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1346 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1347 $ hg verify -q --large --lfc
1347 $ hg verify -q --large --lfc
1348 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1348 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1349 [1]
1349 [1]
1350
1350
1351 - cleanup
1351 - cleanup
1352 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1352 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1353
1353
1354 - verifying all revisions will fail because we didn't clone all largefiles to d:
1354 - verifying all revisions will fail because we didn't clone all largefiles to d:
1355 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1355 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1356 $ hg verify -q --lfa --lfc
1356 $ hg verify -q --lfa --lfc
1357 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1357 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1358 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1358 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1359 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1359 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1360 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1360 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1361 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1361 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1362 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1362 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1363 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1363 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1364 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1364 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1365 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1365 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1366 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1366 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1367 [1]
1367 [1]
1368
1368
1369 - cleanup
1369 - cleanup
1370 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1370 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1371 $ rm -f .hglf/sub/*.orig
1371 $ rm -f .hglf/sub/*.orig
1372
1372
1373 Update to revision with missing largefile - and make sure it really is missing
1373 Update to revision with missing largefile - and make sure it really is missing
1374
1374
1375 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1375 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1376 $ hg up -r 6
1376 $ hg up -r 6
1377 getting changed largefiles
1377 getting changed largefiles
1378 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1378 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1379 1 largefiles updated, 2 removed
1379 1 largefiles updated, 2 removed
1380 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1380 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1381 $ rm normal3
1381 $ rm normal3
1382 $ echo >> sub/normal4
1382 $ echo >> sub/normal4
1383 $ hg ci -m 'commit with missing files'
1383 $ hg ci -m 'commit with missing files'
1384 Invoking status precommit hook
1384 Invoking status precommit hook
1385 M sub/normal4
1385 M sub/normal4
1386 ! large3
1386 ! large3
1387 ! normal3
1387 ! normal3
1388 created new head
1388 created new head
1389 $ hg st
1389 $ hg st
1390 ! large3
1390 ! large3
1391 ! normal3
1391 ! normal3
1392 $ hg up -r.
1392 $ hg up -r.
1393 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1393 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1394 $ hg st
1394 $ hg st
1395 ! large3
1395 ! large3
1396 ! normal3
1396 ! normal3
1397 $ hg up -Cr.
1397 $ hg up -Cr.
1398 getting changed largefiles
1398 getting changed largefiles
1399 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1399 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1400 0 largefiles updated, 0 removed
1400 0 largefiles updated, 0 removed
1401 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1401 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1402 $ hg st
1402 $ hg st
1403 ! large3
1403 ! large3
1404 $ hg rollback
1404 $ hg rollback
1405 repository tip rolled back to revision 9 (undo commit)
1405 repository tip rolled back to revision 9 (undo commit)
1406 working directory now based on revision 6
1406 working directory now based on revision 6
1407
1407
1408 Merge with revision with missing largefile - and make sure it tries to fetch it.
1408 Merge with revision with missing largefile - and make sure it tries to fetch it.
1409
1409
1410 $ hg up -Cqr null
1410 $ hg up -Cqr null
1411 $ echo f > f
1411 $ echo f > f
1412 $ hg ci -Am branch
1412 $ hg ci -Am branch
1413 adding f
1413 adding f
1414 Invoking status precommit hook
1414 Invoking status precommit hook
1415 A f
1415 A f
1416 created new head
1416 created new head
1417 $ hg merge -r 6
1417 $ hg merge -r 6
1418 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1418 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1419 (branch merge, don't forget to commit)
1419 (branch merge, don't forget to commit)
1420 getting changed largefiles
1420 getting changed largefiles
1421 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1421 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1422 1 largefiles updated, 0 removed
1422 1 largefiles updated, 0 removed
1423
1423
1424 $ hg rollback -q
1424 $ hg rollback -q
1425 $ hg up -Cq
1425 $ hg up -Cq
1426
1426
1427 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1427 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1428
1428
1429 $ hg pull --all-largefiles
1429 $ hg pull --all-largefiles
1430 pulling from $TESTTMP/d (glob)
1430 pulling from $TESTTMP/d (glob)
1431 searching for changes
1431 searching for changes
1432 no changes found
1432 no changes found
1433
1433
1434 Merging does not revert to old versions of largefiles and also check
1434 Merging does not revert to old versions of largefiles and also check
1435 that merging after having pulled from a non-default remote works
1435 that merging after having pulled from a non-default remote works
1436 correctly.
1436 correctly.
1437
1437
1438 $ cd ..
1438 $ cd ..
1439 $ hg clone -r 7 e temp
1439 $ hg clone -r 7 e temp
1440 adding changesets
1440 adding changesets
1441 adding manifests
1441 adding manifests
1442 adding file changes
1442 adding file changes
1443 added 8 changesets with 24 changes to 10 files
1443 added 8 changesets with 24 changes to 10 files
1444 updating to branch default
1444 updating to branch default
1445 getting changed largefiles
1445 getting changed largefiles
1446 3 largefiles updated, 0 removed
1446 3 largefiles updated, 0 removed
1447 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1447 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1448 $ hg clone temp f
1448 $ hg clone temp f
1449 updating to branch default
1449 updating to branch default
1450 getting changed largefiles
1450 getting changed largefiles
1451 3 largefiles updated, 0 removed
1451 3 largefiles updated, 0 removed
1452 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1452 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1453 # Delete the largefiles in the largefiles system cache so that we have an
1453 # Delete the largefiles in the largefiles system cache so that we have an
1454 # opportunity to test that caching after a pull works.
1454 # opportunity to test that caching after a pull works.
1455 $ rm "${USERCACHE}"/*
1455 $ rm "${USERCACHE}"/*
1456 $ cd f
1456 $ cd f
1457 $ echo "large4-merge-test" > sub/large4
1457 $ echo "large4-merge-test" > sub/large4
1458 $ hg commit -m "Modify large4 to test merge"
1458 $ hg commit -m "Modify large4 to test merge"
1459 Invoking status precommit hook
1459 Invoking status precommit hook
1460 M sub/large4
1460 M sub/large4
1461 # Test --cache-largefiles flag
1461 # Test --cache-largefiles flag
1462 $ hg pull --lfrev 'heads(pulled())' ../e
1462 $ hg pull --lfrev 'heads(pulled())' ../e
1463 pulling from ../e
1463 pulling from ../e
1464 searching for changes
1464 searching for changes
1465 adding changesets
1465 adding changesets
1466 adding manifests
1466 adding manifests
1467 adding file changes
1467 adding file changes
1468 added 2 changesets with 4 changes to 4 files (+1 heads)
1468 added 2 changesets with 4 changes to 4 files (+1 heads)
1469 (run 'hg heads' to see heads, 'hg merge' to merge)
1469 (run 'hg heads' to see heads, 'hg merge' to merge)
1470 2 largefiles cached
1470 2 largefiles cached
1471 $ hg merge
1471 $ hg merge
1472 largefile sub/large4 has a merge conflict
1472 largefile sub/large4 has a merge conflict
1473 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1473 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1474 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1474 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1475 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1475 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1476 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1476 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1477 (branch merge, don't forget to commit)
1477 (branch merge, don't forget to commit)
1478 getting changed largefiles
1478 getting changed largefiles
1479 1 largefiles updated, 0 removed
1479 1 largefiles updated, 0 removed
1480 $ hg commit -m "Merge repos e and f"
1480 $ hg commit -m "Merge repos e and f"
1481 Invoking status precommit hook
1481 Invoking status precommit hook
1482 M normal3
1482 M normal3
1483 M sub/normal4
1483 M sub/normal4
1484 M sub2/large6
1484 M sub2/large6
1485 $ cat normal3
1485 $ cat normal3
1486 normal3-modified
1486 normal3-modified
1487 $ cat sub/normal4
1487 $ cat sub/normal4
1488 normal4-modified
1488 normal4-modified
1489 $ cat sub/large4
1489 $ cat sub/large4
1490 large4-merge-test
1490 large4-merge-test
1491 $ cat sub2/large6
1491 $ cat sub2/large6
1492 large6-modified
1492 large6-modified
1493 $ cat sub2/large7
1493 $ cat sub2/large7
1494 large7
1494 large7
1495
1495
1496 Test status after merging with a branch that introduces a new largefile:
1496 Test status after merging with a branch that introduces a new largefile:
1497
1497
1498 $ echo large > large
1498 $ echo large > large
1499 $ hg add --large large
1499 $ hg add --large large
1500 $ hg commit -m 'add largefile'
1500 $ hg commit -m 'add largefile'
1501 Invoking status precommit hook
1501 Invoking status precommit hook
1502 A large
1502 A large
1503 $ hg update -q ".^"
1503 $ hg update -q ".^"
1504 $ echo change >> normal3
1504 $ echo change >> normal3
1505 $ hg commit -m 'some change'
1505 $ hg commit -m 'some change'
1506 Invoking status precommit hook
1506 Invoking status precommit hook
1507 M normal3
1507 M normal3
1508 created new head
1508 created new head
1509 $ hg merge
1509 $ hg merge
1510 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1510 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1511 (branch merge, don't forget to commit)
1511 (branch merge, don't forget to commit)
1512 getting changed largefiles
1512 getting changed largefiles
1513 1 largefiles updated, 0 removed
1513 1 largefiles updated, 0 removed
1514 $ hg status
1514 $ hg status
1515 M large
1515 M large
1516
1516
1517 - make sure update of merge with removed largefiles fails as expected
1517 - make sure update of merge with removed largefiles fails as expected
1518 $ hg rm sub2/large6
1518 $ hg rm sub2/large6
1519 $ hg up -r.
1519 $ hg up -r.
1520 abort: outstanding uncommitted merges
1520 abort: outstanding uncommitted merges
1521 [255]
1521 [255]
1522
1522
1523 - revert should be able to revert files introduced in a pending merge
1523 - revert should be able to revert files introduced in a pending merge
1524 $ hg revert --all -r .
1524 $ hg revert --all -r .
1525 removing .hglf/large (glob)
1525 removing .hglf/large (glob)
1526 undeleting .hglf/sub2/large6 (glob)
1526 undeleting .hglf/sub2/large6 (glob)
1527
1527
1528 Test that a normal file and a largefile with the same name and path cannot
1528 Test that a normal file and a largefile with the same name and path cannot
1529 coexist.
1529 coexist.
1530
1530
1531 $ rm sub2/large7
1531 $ rm sub2/large7
1532 $ echo "largeasnormal" > sub2/large7
1532 $ echo "largeasnormal" > sub2/large7
1533 $ hg add sub2/large7
1533 $ hg add sub2/large7
1534 sub2/large7 already a largefile
1534 sub2/large7 already a largefile
1535
1535
1536 Test that transplanting a largefile change works correctly.
1536 Test that transplanting a largefile change works correctly.
1537
1537
1538 $ cd ..
1538 $ cd ..
1539 $ hg clone -r 8 d g
1539 $ hg clone -r 8 d g
1540 adding changesets
1540 adding changesets
1541 adding manifests
1541 adding manifests
1542 adding file changes
1542 adding file changes
1543 added 9 changesets with 26 changes to 10 files
1543 added 9 changesets with 26 changes to 10 files
1544 updating to branch default
1544 updating to branch default
1545 getting changed largefiles
1545 getting changed largefiles
1546 3 largefiles updated, 0 removed
1546 3 largefiles updated, 0 removed
1547 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1547 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1548 $ cd g
1548 $ cd g
1549 $ hg transplant -s ../d 598410d3eb9a
1549 $ hg transplant -s ../d 598410d3eb9a
1550 searching for changes
1550 searching for changes
1551 searching for changes
1551 searching for changes
1552 adding changesets
1552 adding changesets
1553 adding manifests
1553 adding manifests
1554 adding file changes
1554 adding file changes
1555 added 1 changesets with 2 changes to 2 files
1555 added 1 changesets with 2 changes to 2 files
1556 getting changed largefiles
1556 getting changed largefiles
1557 1 largefiles updated, 0 removed
1557 1 largefiles updated, 0 removed
1558 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1558 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1559 9:598410d3eb9a modify normal file largefile in repo d
1559 9:598410d3eb9a modify normal file largefile in repo d
1560 8:a381d2c8c80e modify normal file and largefile in repo b
1560 8:a381d2c8c80e modify normal file and largefile in repo b
1561 7:daea875e9014 add/edit more largefiles
1561 7:daea875e9014 add/edit more largefiles
1562 6:4355d653f84f edit files yet again
1562 6:4355d653f84f edit files yet again
1563 5:9d5af5072dbd edit files again
1563 5:9d5af5072dbd edit files again
1564 4:74c02385b94c move files
1564 4:74c02385b94c move files
1565 3:9e8fbc4bce62 copy files
1565 3:9e8fbc4bce62 copy files
1566 2:51a0ae4d5864 remove files
1566 2:51a0ae4d5864 remove files
1567 1:ce8896473775 edit files
1567 1:ce8896473775 edit files
1568 0:30d30fe6a5be add files
1568 0:30d30fe6a5be add files
1569 $ cat normal3
1569 $ cat normal3
1570 normal3-modified
1570 normal3-modified
1571 $ cat sub/normal4
1571 $ cat sub/normal4
1572 normal4-modified
1572 normal4-modified
1573 $ cat sub/large4
1573 $ cat sub/large4
1574 large4-modified
1574 large4-modified
1575 $ cat sub2/large6
1575 $ cat sub2/large6
1576 large6-modified
1576 large6-modified
1577 $ cat sub2/large7
1577 $ cat sub2/large7
1578 large7
1578 large7
1579
1579
1580 Cat a largefile
1580 Cat a largefile
1581 $ hg cat normal3
1581 $ hg cat normal3
1582 normal3-modified
1582 normal3-modified
1583 $ hg cat sub/large4
1583 $ hg cat sub/large4
1584 large4-modified
1584 large4-modified
1585 $ rm "${USERCACHE}"/*
1585 $ rm "${USERCACHE}"/*
1586 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1586 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1587 $ cat cat.out
1587 $ cat cat.out
1588 large4-modified
1588 large4-modified
1589 $ rm cat.out
1589 $ rm cat.out
1590 $ hg cat -r a381d2c8c80e normal3
1590 $ hg cat -r a381d2c8c80e normal3
1591 normal3-modified
1591 normal3-modified
1592 $ hg cat -r '.^' normal3
1592 $ hg cat -r '.^' normal3
1593 normal3-modified
1593 normal3-modified
1594 $ hg cat -r '.^' sub/large4 doesntexist
1594 $ hg cat -r '.^' sub/large4 doesntexist
1595 large4-modified
1595 large4-modified
1596 doesntexist: no such file in rev a381d2c8c80e
1596 doesntexist: no such file in rev a381d2c8c80e
1597 $ hg --cwd sub cat -r '.^' large4
1597 $ hg --cwd sub cat -r '.^' large4
1598 large4-modified
1598 large4-modified
1599 $ hg --cwd sub cat -r '.^' ../normal3
1599 $ hg --cwd sub cat -r '.^' ../normal3
1600 normal3-modified
1600 normal3-modified
1601 Cat a standin
1601 Cat a standin
1602 $ hg cat .hglf/sub/large4
1602 $ hg cat .hglf/sub/large4
1603 e166e74c7303192238d60af5a9c4ce9bef0b7928
1603 e166e74c7303192238d60af5a9c4ce9bef0b7928
1604 $ hg cat .hglf/normal3
1604 $ hg cat .hglf/normal3
1605 .hglf/normal3: no such file in rev 598410d3eb9a
1605 .hglf/normal3: no such file in rev 598410d3eb9a
1606 [1]
1606 [1]
1607
1607
1608 Test that renaming a largefile results in correct output for status
1608 Test that renaming a largefile results in correct output for status
1609
1609
1610 $ hg rename sub/large4 large4-renamed
1610 $ hg rename sub/large4 large4-renamed
1611 $ hg commit -m "test rename output"
1611 $ hg commit -m "test rename output"
1612 Invoking status precommit hook
1612 Invoking status precommit hook
1613 A large4-renamed
1613 A large4-renamed
1614 R sub/large4
1614 R sub/large4
1615 $ cat large4-renamed
1615 $ cat large4-renamed
1616 large4-modified
1616 large4-modified
1617 $ cd sub2
1617 $ cd sub2
1618 $ hg rename large6 large6-renamed
1618 $ hg rename large6 large6-renamed
1619 $ hg st
1619 $ hg st
1620 A sub2/large6-renamed
1620 A sub2/large6-renamed
1621 R sub2/large6
1621 R sub2/large6
1622 $ cd ..
1622 $ cd ..
1623
1623
1624 Test --normal flag
1624 Test --normal flag
1625
1625
1626 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1626 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1627 $ hg add --normal --large new-largefile
1627 $ hg add --normal --large new-largefile
1628 abort: --normal cannot be used with --large
1628 abort: --normal cannot be used with --large
1629 [255]
1629 [255]
1630 $ hg add --normal new-largefile
1630 $ hg add --normal new-largefile
1631 new-largefile: up to 69 MB of RAM may be required to manage this file
1631 new-largefile: up to 69 MB of RAM may be required to manage this file
1632 (use 'hg revert new-largefile' to cancel the pending addition)
1632 (use 'hg revert new-largefile' to cancel the pending addition)
1633 $ cd ..
1633 $ cd ..
1634
1634
1635
1635
1636
1636
General Comments 0
You need to be logged in to leave comments. Login now