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