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