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