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