##// END OF EJS Templates
largefiles: fix explicit commit of normal/largefile switch...
Mads Kiilerich -
r26817:b68797f2 stable
parent child Browse files
Show More
@@ -1,618 +1,621 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 '''largefiles utility code: must not import other modules in this package.'''
9 '''largefiles utility code: must not import other modules in this package.'''
10
10
11 import os
11 import os
12 import platform
12 import platform
13 import shutil
13 import shutil
14 import stat
14 import stat
15 import copy
15 import copy
16
16
17 from mercurial import dirstate, httpconnection, match as match_, util, scmutil
17 from mercurial import dirstate, httpconnection, match as match_, util, scmutil
18 from mercurial.i18n import _
18 from mercurial.i18n import _
19 from mercurial import node, error
19 from mercurial import node, error
20
20
21 shortname = '.hglf'
21 shortname = '.hglf'
22 shortnameslash = shortname + '/'
22 shortnameslash = shortname + '/'
23 longname = 'largefiles'
23 longname = 'largefiles'
24
24
25
25
26 # -- Private worker functions ------------------------------------------
26 # -- Private worker functions ------------------------------------------
27
27
28 def getminsize(ui, assumelfiles, opt, default=10):
28 def getminsize(ui, assumelfiles, opt, default=10):
29 lfsize = opt
29 lfsize = opt
30 if not lfsize and assumelfiles:
30 if not lfsize and assumelfiles:
31 lfsize = ui.config(longname, 'minsize', default=default)
31 lfsize = ui.config(longname, 'minsize', default=default)
32 if lfsize:
32 if lfsize:
33 try:
33 try:
34 lfsize = float(lfsize)
34 lfsize = float(lfsize)
35 except ValueError:
35 except ValueError:
36 raise error.Abort(_('largefiles: size must be number (not %s)\n')
36 raise error.Abort(_('largefiles: size must be number (not %s)\n')
37 % lfsize)
37 % lfsize)
38 if lfsize is None:
38 if lfsize is None:
39 raise error.Abort(_('minimum size for largefiles must be specified'))
39 raise error.Abort(_('minimum size for largefiles must be specified'))
40 return lfsize
40 return lfsize
41
41
42 def link(src, dest):
42 def link(src, dest):
43 util.makedirs(os.path.dirname(dest))
43 util.makedirs(os.path.dirname(dest))
44 try:
44 try:
45 util.oslink(src, dest)
45 util.oslink(src, dest)
46 except OSError:
46 except OSError:
47 # if hardlinks fail, fallback on atomic copy
47 # if hardlinks fail, fallback on atomic copy
48 dst = util.atomictempfile(dest)
48 dst = util.atomictempfile(dest)
49 for chunk in util.filechunkiter(open(src, 'rb')):
49 for chunk in util.filechunkiter(open(src, 'rb')):
50 dst.write(chunk)
50 dst.write(chunk)
51 dst.close()
51 dst.close()
52 os.chmod(dest, os.stat(src).st_mode)
52 os.chmod(dest, os.stat(src).st_mode)
53
53
54 def usercachepath(ui, hash):
54 def usercachepath(ui, hash):
55 path = ui.configpath(longname, 'usercache', None)
55 path = ui.configpath(longname, 'usercache', None)
56 if path:
56 if path:
57 path = os.path.join(path, hash)
57 path = os.path.join(path, hash)
58 else:
58 else:
59 if os.name == 'nt':
59 if os.name == 'nt':
60 appdata = os.getenv('LOCALAPPDATA', os.getenv('APPDATA'))
60 appdata = os.getenv('LOCALAPPDATA', os.getenv('APPDATA'))
61 if appdata:
61 if appdata:
62 path = os.path.join(appdata, longname, hash)
62 path = os.path.join(appdata, longname, hash)
63 elif platform.system() == 'Darwin':
63 elif platform.system() == 'Darwin':
64 home = os.getenv('HOME')
64 home = os.getenv('HOME')
65 if home:
65 if home:
66 path = os.path.join(home, 'Library', 'Caches',
66 path = os.path.join(home, 'Library', 'Caches',
67 longname, hash)
67 longname, hash)
68 elif os.name == 'posix':
68 elif os.name == 'posix':
69 path = os.getenv('XDG_CACHE_HOME')
69 path = os.getenv('XDG_CACHE_HOME')
70 if path:
70 if path:
71 path = os.path.join(path, longname, hash)
71 path = os.path.join(path, longname, hash)
72 else:
72 else:
73 home = os.getenv('HOME')
73 home = os.getenv('HOME')
74 if home:
74 if home:
75 path = os.path.join(home, '.cache', longname, hash)
75 path = os.path.join(home, '.cache', longname, hash)
76 else:
76 else:
77 raise error.Abort(_('unknown operating system: %s\n') % os.name)
77 raise error.Abort(_('unknown operating system: %s\n') % os.name)
78 return path
78 return path
79
79
80 def inusercache(ui, hash):
80 def inusercache(ui, hash):
81 path = usercachepath(ui, hash)
81 path = usercachepath(ui, hash)
82 return path and os.path.exists(path)
82 return path and os.path.exists(path)
83
83
84 def findfile(repo, hash):
84 def findfile(repo, hash):
85 path, exists = findstorepath(repo, hash)
85 path, exists = findstorepath(repo, hash)
86 if exists:
86 if exists:
87 repo.ui.note(_('found %s in store\n') % hash)
87 repo.ui.note(_('found %s in store\n') % hash)
88 return path
88 return path
89 elif inusercache(repo.ui, hash):
89 elif inusercache(repo.ui, hash):
90 repo.ui.note(_('found %s in system cache\n') % hash)
90 repo.ui.note(_('found %s in system cache\n') % hash)
91 path = storepath(repo, hash)
91 path = storepath(repo, hash)
92 link(usercachepath(repo.ui, hash), path)
92 link(usercachepath(repo.ui, hash), path)
93 return path
93 return path
94 return None
94 return None
95
95
96 class largefilesdirstate(dirstate.dirstate):
96 class largefilesdirstate(dirstate.dirstate):
97 def __getitem__(self, key):
97 def __getitem__(self, key):
98 return super(largefilesdirstate, self).__getitem__(unixpath(key))
98 return super(largefilesdirstate, self).__getitem__(unixpath(key))
99 def normal(self, f):
99 def normal(self, f):
100 return super(largefilesdirstate, self).normal(unixpath(f))
100 return super(largefilesdirstate, self).normal(unixpath(f))
101 def remove(self, f):
101 def remove(self, f):
102 return super(largefilesdirstate, self).remove(unixpath(f))
102 return super(largefilesdirstate, self).remove(unixpath(f))
103 def add(self, f):
103 def add(self, f):
104 return super(largefilesdirstate, self).add(unixpath(f))
104 return super(largefilesdirstate, self).add(unixpath(f))
105 def drop(self, f):
105 def drop(self, f):
106 return super(largefilesdirstate, self).drop(unixpath(f))
106 return super(largefilesdirstate, self).drop(unixpath(f))
107 def forget(self, f):
107 def forget(self, f):
108 return super(largefilesdirstate, self).forget(unixpath(f))
108 return super(largefilesdirstate, self).forget(unixpath(f))
109 def normallookup(self, f):
109 def normallookup(self, f):
110 return super(largefilesdirstate, self).normallookup(unixpath(f))
110 return super(largefilesdirstate, self).normallookup(unixpath(f))
111 def _ignore(self, f):
111 def _ignore(self, f):
112 return False
112 return False
113 def write(self, tr=False):
113 def write(self, tr=False):
114 # (1) disable PENDING mode always
114 # (1) disable PENDING mode always
115 # (lfdirstate isn't yet managed as a part of the transaction)
115 # (lfdirstate isn't yet managed as a part of the transaction)
116 # (2) avoid develwarn 'use dirstate.write with ....'
116 # (2) avoid develwarn 'use dirstate.write with ....'
117 super(largefilesdirstate, self).write(None)
117 super(largefilesdirstate, self).write(None)
118
118
119 def openlfdirstate(ui, repo, create=True):
119 def openlfdirstate(ui, repo, create=True):
120 '''
120 '''
121 Return a dirstate object that tracks largefiles: i.e. its root is
121 Return a dirstate object that tracks largefiles: i.e. its root is
122 the repo root, but it is saved in .hg/largefiles/dirstate.
122 the repo root, but it is saved in .hg/largefiles/dirstate.
123 '''
123 '''
124 lfstoredir = repo.join(longname)
124 lfstoredir = repo.join(longname)
125 opener = scmutil.opener(lfstoredir)
125 opener = scmutil.opener(lfstoredir)
126 lfdirstate = largefilesdirstate(opener, ui, repo.root,
126 lfdirstate = largefilesdirstate(opener, ui, repo.root,
127 repo.dirstate._validate)
127 repo.dirstate._validate)
128
128
129 # If the largefiles dirstate does not exist, populate and create
129 # If the largefiles dirstate does not exist, populate and create
130 # it. This ensures that we create it on the first meaningful
130 # it. This ensures that we create it on the first meaningful
131 # largefiles operation in a new clone.
131 # largefiles operation in a new clone.
132 if create and not os.path.exists(os.path.join(lfstoredir, 'dirstate')):
132 if create and not os.path.exists(os.path.join(lfstoredir, 'dirstate')):
133 matcher = getstandinmatcher(repo)
133 matcher = getstandinmatcher(repo)
134 standins = repo.dirstate.walk(matcher, [], False, False)
134 standins = repo.dirstate.walk(matcher, [], False, False)
135
135
136 if len(standins) > 0:
136 if len(standins) > 0:
137 util.makedirs(lfstoredir)
137 util.makedirs(lfstoredir)
138
138
139 for standin in standins:
139 for standin in standins:
140 lfile = splitstandin(standin)
140 lfile = splitstandin(standin)
141 lfdirstate.normallookup(lfile)
141 lfdirstate.normallookup(lfile)
142 return lfdirstate
142 return lfdirstate
143
143
144 def lfdirstatestatus(lfdirstate, repo):
144 def lfdirstatestatus(lfdirstate, repo):
145 wctx = repo['.']
145 wctx = repo['.']
146 match = match_.always(repo.root, repo.getcwd())
146 match = match_.always(repo.root, repo.getcwd())
147 unsure, s = lfdirstate.status(match, [], False, False, False)
147 unsure, s = lfdirstate.status(match, [], False, False, False)
148 modified, clean = s.modified, s.clean
148 modified, clean = s.modified, s.clean
149 for lfile in unsure:
149 for lfile in unsure:
150 try:
150 try:
151 fctx = wctx[standin(lfile)]
151 fctx = wctx[standin(lfile)]
152 except LookupError:
152 except LookupError:
153 fctx = None
153 fctx = None
154 if not fctx or fctx.data().strip() != hashfile(repo.wjoin(lfile)):
154 if not fctx or fctx.data().strip() != hashfile(repo.wjoin(lfile)):
155 modified.append(lfile)
155 modified.append(lfile)
156 else:
156 else:
157 clean.append(lfile)
157 clean.append(lfile)
158 lfdirstate.normal(lfile)
158 lfdirstate.normal(lfile)
159 return s
159 return s
160
160
161 def listlfiles(repo, rev=None, matcher=None):
161 def listlfiles(repo, rev=None, matcher=None):
162 '''return a list of largefiles in the working copy or the
162 '''return a list of largefiles in the working copy or the
163 specified changeset'''
163 specified changeset'''
164
164
165 if matcher is None:
165 if matcher is None:
166 matcher = getstandinmatcher(repo)
166 matcher = getstandinmatcher(repo)
167
167
168 # ignore unknown files in working directory
168 # ignore unknown files in working directory
169 return [splitstandin(f)
169 return [splitstandin(f)
170 for f in repo[rev].walk(matcher)
170 for f in repo[rev].walk(matcher)
171 if rev is not None or repo.dirstate[f] != '?']
171 if rev is not None or repo.dirstate[f] != '?']
172
172
173 def instore(repo, hash, forcelocal=False):
173 def instore(repo, hash, forcelocal=False):
174 return os.path.exists(storepath(repo, hash, forcelocal))
174 return os.path.exists(storepath(repo, hash, forcelocal))
175
175
176 def storepath(repo, hash, forcelocal=False):
176 def storepath(repo, hash, forcelocal=False):
177 if not forcelocal and repo.shared():
177 if not forcelocal and repo.shared():
178 return repo.vfs.reljoin(repo.sharedpath, longname, hash)
178 return repo.vfs.reljoin(repo.sharedpath, longname, hash)
179 return repo.join(longname, hash)
179 return repo.join(longname, hash)
180
180
181 def findstorepath(repo, hash):
181 def findstorepath(repo, hash):
182 '''Search through the local store path(s) to find the file for the given
182 '''Search through the local store path(s) to find the file for the given
183 hash. If the file is not found, its path in the primary store is returned.
183 hash. If the file is not found, its path in the primary store is returned.
184 The return value is a tuple of (path, exists(path)).
184 The return value is a tuple of (path, exists(path)).
185 '''
185 '''
186 # For shared repos, the primary store is in the share source. But for
186 # For shared repos, the primary store is in the share source. But for
187 # backward compatibility, force a lookup in the local store if it wasn't
187 # backward compatibility, force a lookup in the local store if it wasn't
188 # found in the share source.
188 # found in the share source.
189 path = storepath(repo, hash, False)
189 path = storepath(repo, hash, False)
190
190
191 if instore(repo, hash):
191 if instore(repo, hash):
192 return (path, True)
192 return (path, True)
193 elif repo.shared() and instore(repo, hash, True):
193 elif repo.shared() and instore(repo, hash, True):
194 return storepath(repo, hash, True)
194 return storepath(repo, hash, True)
195
195
196 return (path, False)
196 return (path, False)
197
197
198 def copyfromcache(repo, hash, filename):
198 def copyfromcache(repo, hash, filename):
199 '''Copy the specified largefile from the repo or system cache to
199 '''Copy the specified largefile from the repo or system cache to
200 filename in the repository. Return true on success or false if the
200 filename in the repository. Return true on success or false if the
201 file was not found in either cache (which should not happened:
201 file was not found in either cache (which should not happened:
202 this is meant to be called only after ensuring that the needed
202 this is meant to be called only after ensuring that the needed
203 largefile exists in the cache).'''
203 largefile exists in the cache).'''
204 path = findfile(repo, hash)
204 path = findfile(repo, hash)
205 if path is None:
205 if path is None:
206 return False
206 return False
207 util.makedirs(os.path.dirname(repo.wjoin(filename)))
207 util.makedirs(os.path.dirname(repo.wjoin(filename)))
208 # The write may fail before the file is fully written, but we
208 # The write may fail before the file is fully written, but we
209 # don't use atomic writes in the working copy.
209 # don't use atomic writes in the working copy.
210 shutil.copy(path, repo.wjoin(filename))
210 shutil.copy(path, repo.wjoin(filename))
211 return True
211 return True
212
212
213 def copytostore(repo, rev, file, uploaded=False):
213 def copytostore(repo, rev, file, uploaded=False):
214 hash = readstandin(repo, file, rev)
214 hash = readstandin(repo, file, rev)
215 if instore(repo, hash):
215 if instore(repo, hash):
216 return
216 return
217 copytostoreabsolute(repo, repo.wjoin(file), hash)
217 copytostoreabsolute(repo, repo.wjoin(file), hash)
218
218
219 def copyalltostore(repo, node):
219 def copyalltostore(repo, node):
220 '''Copy all largefiles in a given revision to the store'''
220 '''Copy all largefiles in a given revision to the store'''
221
221
222 ctx = repo[node]
222 ctx = repo[node]
223 for filename in ctx.files():
223 for filename in ctx.files():
224 if isstandin(filename) and filename in ctx.manifest():
224 if isstandin(filename) and filename in ctx.manifest():
225 realfile = splitstandin(filename)
225 realfile = splitstandin(filename)
226 copytostore(repo, ctx.node(), realfile)
226 copytostore(repo, ctx.node(), realfile)
227
227
228
228
229 def copytostoreabsolute(repo, file, hash):
229 def copytostoreabsolute(repo, file, hash):
230 if inusercache(repo.ui, hash):
230 if inusercache(repo.ui, hash):
231 link(usercachepath(repo.ui, hash), storepath(repo, hash))
231 link(usercachepath(repo.ui, hash), storepath(repo, hash))
232 else:
232 else:
233 util.makedirs(os.path.dirname(storepath(repo, hash)))
233 util.makedirs(os.path.dirname(storepath(repo, hash)))
234 dst = util.atomictempfile(storepath(repo, hash),
234 dst = util.atomictempfile(storepath(repo, hash),
235 createmode=repo.store.createmode)
235 createmode=repo.store.createmode)
236 for chunk in util.filechunkiter(open(file, 'rb')):
236 for chunk in util.filechunkiter(open(file, 'rb')):
237 dst.write(chunk)
237 dst.write(chunk)
238 dst.close()
238 dst.close()
239 linktousercache(repo, hash)
239 linktousercache(repo, hash)
240
240
241 def linktousercache(repo, hash):
241 def linktousercache(repo, hash):
242 path = usercachepath(repo.ui, hash)
242 path = usercachepath(repo.ui, hash)
243 if path:
243 if path:
244 link(storepath(repo, hash), path)
244 link(storepath(repo, hash), path)
245
245
246 def getstandinmatcher(repo, rmatcher=None):
246 def getstandinmatcher(repo, rmatcher=None):
247 '''Return a match object that applies rmatcher to the standin directory'''
247 '''Return a match object that applies rmatcher to the standin directory'''
248 standindir = repo.wjoin(shortname)
248 standindir = repo.wjoin(shortname)
249
249
250 # no warnings about missing files or directories
250 # no warnings about missing files or directories
251 badfn = lambda f, msg: None
251 badfn = lambda f, msg: None
252
252
253 if rmatcher and not rmatcher.always():
253 if rmatcher and not rmatcher.always():
254 pats = [os.path.join(standindir, pat) for pat in rmatcher.files()]
254 pats = [os.path.join(standindir, pat) for pat in rmatcher.files()]
255 if not pats:
255 if not pats:
256 pats = [standindir]
256 pats = [standindir]
257 match = scmutil.match(repo[None], pats, badfn=badfn)
257 match = scmutil.match(repo[None], pats, badfn=badfn)
258 # if pats is empty, it would incorrectly always match, so clear _always
258 # if pats is empty, it would incorrectly always match, so clear _always
259 match._always = False
259 match._always = False
260 else:
260 else:
261 # no patterns: relative to repo root
261 # no patterns: relative to repo root
262 match = scmutil.match(repo[None], [standindir], badfn=badfn)
262 match = scmutil.match(repo[None], [standindir], badfn=badfn)
263 return match
263 return match
264
264
265 def composestandinmatcher(repo, rmatcher):
265 def composestandinmatcher(repo, rmatcher):
266 '''Return a matcher that accepts standins corresponding to the
266 '''Return a matcher that accepts standins corresponding to the
267 files accepted by rmatcher. Pass the list of files in the matcher
267 files accepted by rmatcher. Pass the list of files in the matcher
268 as the paths specified by the user.'''
268 as the paths specified by the user.'''
269 smatcher = getstandinmatcher(repo, rmatcher)
269 smatcher = getstandinmatcher(repo, rmatcher)
270 isstandin = smatcher.matchfn
270 isstandin = smatcher.matchfn
271 def composedmatchfn(f):
271 def composedmatchfn(f):
272 return isstandin(f) and rmatcher.matchfn(splitstandin(f))
272 return isstandin(f) and rmatcher.matchfn(splitstandin(f))
273 smatcher.matchfn = composedmatchfn
273 smatcher.matchfn = composedmatchfn
274
274
275 return smatcher
275 return smatcher
276
276
277 def standin(filename):
277 def standin(filename):
278 '''Return the repo-relative path to the standin for the specified big
278 '''Return the repo-relative path to the standin for the specified big
279 file.'''
279 file.'''
280 # Notes:
280 # Notes:
281 # 1) Some callers want an absolute path, but for instance addlargefiles
281 # 1) Some callers want an absolute path, but for instance addlargefiles
282 # needs it repo-relative so it can be passed to repo[None].add(). So
282 # needs it repo-relative so it can be passed to repo[None].add(). So
283 # leave it up to the caller to use repo.wjoin() to get an absolute path.
283 # leave it up to the caller to use repo.wjoin() to get an absolute path.
284 # 2) Join with '/' because that's what dirstate always uses, even on
284 # 2) Join with '/' because that's what dirstate always uses, even on
285 # Windows. Change existing separator to '/' first in case we are
285 # Windows. Change existing separator to '/' first in case we are
286 # passed filenames from an external source (like the command line).
286 # passed filenames from an external source (like the command line).
287 return shortnameslash + util.pconvert(filename)
287 return shortnameslash + util.pconvert(filename)
288
288
289 def isstandin(filename):
289 def isstandin(filename):
290 '''Return true if filename is a big file standin. filename must be
290 '''Return true if filename is a big file standin. filename must be
291 in Mercurial's internal form (slash-separated).'''
291 in Mercurial's internal form (slash-separated).'''
292 return filename.startswith(shortnameslash)
292 return filename.startswith(shortnameslash)
293
293
294 def splitstandin(filename):
294 def splitstandin(filename):
295 # Split on / because that's what dirstate always uses, even on Windows.
295 # Split on / because that's what dirstate always uses, even on Windows.
296 # Change local separator to / first just in case we are passed filenames
296 # Change local separator to / first just in case we are passed filenames
297 # from an external source (like the command line).
297 # from an external source (like the command line).
298 bits = util.pconvert(filename).split('/', 1)
298 bits = util.pconvert(filename).split('/', 1)
299 if len(bits) == 2 and bits[0] == shortname:
299 if len(bits) == 2 and bits[0] == shortname:
300 return bits[1]
300 return bits[1]
301 else:
301 else:
302 return None
302 return None
303
303
304 def updatestandin(repo, standin):
304 def updatestandin(repo, standin):
305 file = repo.wjoin(splitstandin(standin))
305 file = repo.wjoin(splitstandin(standin))
306 if os.path.exists(file):
306 if os.path.exists(file):
307 hash = hashfile(file)
307 hash = hashfile(file)
308 executable = getexecutable(file)
308 executable = getexecutable(file)
309 writestandin(repo, standin, hash, executable)
309 writestandin(repo, standin, hash, executable)
310
310
311 def readstandin(repo, filename, node=None):
311 def readstandin(repo, filename, node=None):
312 '''read hex hash from standin for filename at given node, or working
312 '''read hex hash from standin for filename at given node, or working
313 directory if no node is given'''
313 directory if no node is given'''
314 return repo[node][standin(filename)].data().strip()
314 return repo[node][standin(filename)].data().strip()
315
315
316 def writestandin(repo, standin, hash, executable):
316 def writestandin(repo, standin, hash, executable):
317 '''write hash to <repo.root>/<standin>'''
317 '''write hash to <repo.root>/<standin>'''
318 repo.wwrite(standin, hash + '\n', executable and 'x' or '')
318 repo.wwrite(standin, hash + '\n', executable and 'x' or '')
319
319
320 def copyandhash(instream, outfile):
320 def copyandhash(instream, outfile):
321 '''Read bytes from instream (iterable) and write them to outfile,
321 '''Read bytes from instream (iterable) and write them to outfile,
322 computing the SHA-1 hash of the data along the way. Return the hash.'''
322 computing the SHA-1 hash of the data along the way. Return the hash.'''
323 hasher = util.sha1('')
323 hasher = util.sha1('')
324 for data in instream:
324 for data in instream:
325 hasher.update(data)
325 hasher.update(data)
326 outfile.write(data)
326 outfile.write(data)
327 return hasher.hexdigest()
327 return hasher.hexdigest()
328
328
329 def hashrepofile(repo, file):
329 def hashrepofile(repo, file):
330 return hashfile(repo.wjoin(file))
330 return hashfile(repo.wjoin(file))
331
331
332 def hashfile(file):
332 def hashfile(file):
333 if not os.path.exists(file):
333 if not os.path.exists(file):
334 return ''
334 return ''
335 hasher = util.sha1('')
335 hasher = util.sha1('')
336 fd = open(file, 'rb')
336 fd = open(file, 'rb')
337 for data in util.filechunkiter(fd, 128 * 1024):
337 for data in util.filechunkiter(fd, 128 * 1024):
338 hasher.update(data)
338 hasher.update(data)
339 fd.close()
339 fd.close()
340 return hasher.hexdigest()
340 return hasher.hexdigest()
341
341
342 def getexecutable(filename):
342 def getexecutable(filename):
343 mode = os.stat(filename).st_mode
343 mode = os.stat(filename).st_mode
344 return ((mode & stat.S_IXUSR) and
344 return ((mode & stat.S_IXUSR) and
345 (mode & stat.S_IXGRP) and
345 (mode & stat.S_IXGRP) and
346 (mode & stat.S_IXOTH))
346 (mode & stat.S_IXOTH))
347
347
348 def urljoin(first, second, *arg):
348 def urljoin(first, second, *arg):
349 def join(left, right):
349 def join(left, right):
350 if not left.endswith('/'):
350 if not left.endswith('/'):
351 left += '/'
351 left += '/'
352 if right.startswith('/'):
352 if right.startswith('/'):
353 right = right[1:]
353 right = right[1:]
354 return left + right
354 return left + right
355
355
356 url = join(first, second)
356 url = join(first, second)
357 for a in arg:
357 for a in arg:
358 url = join(url, a)
358 url = join(url, a)
359 return url
359 return url
360
360
361 def hexsha1(data):
361 def hexsha1(data):
362 """hexsha1 returns the hex-encoded sha1 sum of the data in the file-like
362 """hexsha1 returns the hex-encoded sha1 sum of the data in the file-like
363 object data"""
363 object data"""
364 h = util.sha1()
364 h = util.sha1()
365 for chunk in util.filechunkiter(data):
365 for chunk in util.filechunkiter(data):
366 h.update(chunk)
366 h.update(chunk)
367 return h.hexdigest()
367 return h.hexdigest()
368
368
369 def httpsendfile(ui, filename):
369 def httpsendfile(ui, filename):
370 return httpconnection.httpsendfile(ui, filename, 'rb')
370 return httpconnection.httpsendfile(ui, filename, 'rb')
371
371
372 def unixpath(path):
372 def unixpath(path):
373 '''Return a version of path normalized for use with the lfdirstate.'''
373 '''Return a version of path normalized for use with the lfdirstate.'''
374 return util.pconvert(os.path.normpath(path))
374 return util.pconvert(os.path.normpath(path))
375
375
376 def islfilesrepo(repo):
376 def islfilesrepo(repo):
377 if ('largefiles' in repo.requirements and
377 if ('largefiles' in repo.requirements and
378 any(shortnameslash in f[0] for f in repo.store.datafiles())):
378 any(shortnameslash in f[0] for f in repo.store.datafiles())):
379 return True
379 return True
380
380
381 return any(openlfdirstate(repo.ui, repo, False))
381 return any(openlfdirstate(repo.ui, repo, False))
382
382
383 class storeprotonotcapable(Exception):
383 class storeprotonotcapable(Exception):
384 def __init__(self, storetypes):
384 def __init__(self, storetypes):
385 self.storetypes = storetypes
385 self.storetypes = storetypes
386
386
387 def getstandinsstate(repo):
387 def getstandinsstate(repo):
388 standins = []
388 standins = []
389 matcher = getstandinmatcher(repo)
389 matcher = getstandinmatcher(repo)
390 for standin in repo.dirstate.walk(matcher, [], False, False):
390 for standin in repo.dirstate.walk(matcher, [], False, False):
391 lfile = splitstandin(standin)
391 lfile = splitstandin(standin)
392 try:
392 try:
393 hash = readstandin(repo, lfile)
393 hash = readstandin(repo, lfile)
394 except IOError:
394 except IOError:
395 hash = None
395 hash = None
396 standins.append((lfile, hash))
396 standins.append((lfile, hash))
397 return standins
397 return standins
398
398
399 def synclfdirstate(repo, lfdirstate, lfile, normallookup):
399 def synclfdirstate(repo, lfdirstate, lfile, normallookup):
400 lfstandin = standin(lfile)
400 lfstandin = standin(lfile)
401 if lfstandin in repo.dirstate:
401 if lfstandin in repo.dirstate:
402 stat = repo.dirstate._map[lfstandin]
402 stat = repo.dirstate._map[lfstandin]
403 state, mtime = stat[0], stat[3]
403 state, mtime = stat[0], stat[3]
404 else:
404 else:
405 state, mtime = '?', -1
405 state, mtime = '?', -1
406 if state == 'n':
406 if state == 'n':
407 if (normallookup or mtime < 0 or
407 if (normallookup or mtime < 0 or
408 not os.path.exists(repo.wjoin(lfile))):
408 not os.path.exists(repo.wjoin(lfile))):
409 # state 'n' doesn't ensure 'clean' in this case
409 # state 'n' doesn't ensure 'clean' in this case
410 lfdirstate.normallookup(lfile)
410 lfdirstate.normallookup(lfile)
411 else:
411 else:
412 lfdirstate.normal(lfile)
412 lfdirstate.normal(lfile)
413 elif state == 'm':
413 elif state == 'm':
414 lfdirstate.normallookup(lfile)
414 lfdirstate.normallookup(lfile)
415 elif state == 'r':
415 elif state == 'r':
416 lfdirstate.remove(lfile)
416 lfdirstate.remove(lfile)
417 elif state == 'a':
417 elif state == 'a':
418 lfdirstate.add(lfile)
418 lfdirstate.add(lfile)
419 elif state == '?':
419 elif state == '?':
420 lfdirstate.drop(lfile)
420 lfdirstate.drop(lfile)
421
421
422 def markcommitted(orig, ctx, node):
422 def markcommitted(orig, ctx, node):
423 repo = ctx.repo()
423 repo = ctx.repo()
424
424
425 orig(node)
425 orig(node)
426
426
427 # ATTENTION: "ctx.files()" may differ from "repo[node].files()"
427 # ATTENTION: "ctx.files()" may differ from "repo[node].files()"
428 # because files coming from the 2nd parent are omitted in the latter.
428 # because files coming from the 2nd parent are omitted in the latter.
429 #
429 #
430 # The former should be used to get targets of "synclfdirstate",
430 # The former should be used to get targets of "synclfdirstate",
431 # because such files:
431 # because such files:
432 # - are marked as "a" by "patch.patch()" (e.g. via transplant), and
432 # - are marked as "a" by "patch.patch()" (e.g. via transplant), and
433 # - have to be marked as "n" after commit, but
433 # - have to be marked as "n" after commit, but
434 # - aren't listed in "repo[node].files()"
434 # - aren't listed in "repo[node].files()"
435
435
436 lfdirstate = openlfdirstate(repo.ui, repo)
436 lfdirstate = openlfdirstate(repo.ui, repo)
437 for f in ctx.files():
437 for f in ctx.files():
438 if isstandin(f):
438 if isstandin(f):
439 lfile = splitstandin(f)
439 lfile = splitstandin(f)
440 synclfdirstate(repo, lfdirstate, lfile, False)
440 synclfdirstate(repo, lfdirstate, lfile, False)
441 lfdirstate.write()
441 lfdirstate.write()
442
442
443 # As part of committing, copy all of the largefiles into the cache.
443 # As part of committing, copy all of the largefiles into the cache.
444 copyalltostore(repo, node)
444 copyalltostore(repo, node)
445
445
446 def getlfilestoupdate(oldstandins, newstandins):
446 def getlfilestoupdate(oldstandins, newstandins):
447 changedstandins = set(oldstandins).symmetric_difference(set(newstandins))
447 changedstandins = set(oldstandins).symmetric_difference(set(newstandins))
448 filelist = []
448 filelist = []
449 for f in changedstandins:
449 for f in changedstandins:
450 if f[0] not in filelist:
450 if f[0] not in filelist:
451 filelist.append(f[0])
451 filelist.append(f[0])
452 return filelist
452 return filelist
453
453
454 def getlfilestoupload(repo, missing, addfunc):
454 def getlfilestoupload(repo, missing, addfunc):
455 for i, n in enumerate(missing):
455 for i, n in enumerate(missing):
456 repo.ui.progress(_('finding outgoing largefiles'), i,
456 repo.ui.progress(_('finding outgoing largefiles'), i,
457 unit=_('revision'), total=len(missing))
457 unit=_('revision'), total=len(missing))
458 parents = [p for p in repo.changelog.parents(n) if p != node.nullid]
458 parents = [p for p in repo.changelog.parents(n) if p != node.nullid]
459
459
460 oldlfstatus = repo.lfstatus
460 oldlfstatus = repo.lfstatus
461 repo.lfstatus = False
461 repo.lfstatus = False
462 try:
462 try:
463 ctx = repo[n]
463 ctx = repo[n]
464 finally:
464 finally:
465 repo.lfstatus = oldlfstatus
465 repo.lfstatus = oldlfstatus
466
466
467 files = set(ctx.files())
467 files = set(ctx.files())
468 if len(parents) == 2:
468 if len(parents) == 2:
469 mc = ctx.manifest()
469 mc = ctx.manifest()
470 mp1 = ctx.parents()[0].manifest()
470 mp1 = ctx.parents()[0].manifest()
471 mp2 = ctx.parents()[1].manifest()
471 mp2 = ctx.parents()[1].manifest()
472 for f in mp1:
472 for f in mp1:
473 if f not in mc:
473 if f not in mc:
474 files.add(f)
474 files.add(f)
475 for f in mp2:
475 for f in mp2:
476 if f not in mc:
476 if f not in mc:
477 files.add(f)
477 files.add(f)
478 for f in mc:
478 for f in mc:
479 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None):
479 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None):
480 files.add(f)
480 files.add(f)
481 for fn in files:
481 for fn in files:
482 if isstandin(fn) and fn in ctx:
482 if isstandin(fn) and fn in ctx:
483 addfunc(fn, ctx[fn].data().strip())
483 addfunc(fn, ctx[fn].data().strip())
484 repo.ui.progress(_('finding outgoing largefiles'), None)
484 repo.ui.progress(_('finding outgoing largefiles'), None)
485
485
486 def updatestandinsbymatch(repo, match):
486 def updatestandinsbymatch(repo, match):
487 '''Update standins in the working directory according to specified match
487 '''Update standins in the working directory according to specified match
488
488
489 This returns (possibly modified) ``match`` object to be used for
489 This returns (possibly modified) ``match`` object to be used for
490 subsequent commit process.
490 subsequent commit process.
491 '''
491 '''
492
492
493 ui = repo.ui
493 ui = repo.ui
494
494
495 # Case 1: user calls commit with no specific files or
495 # Case 1: user calls commit with no specific files or
496 # include/exclude patterns: refresh and commit all files that
496 # include/exclude patterns: refresh and commit all files that
497 # are "dirty".
497 # are "dirty".
498 if match is None or match.always():
498 if match is None or match.always():
499 # Spend a bit of time here to get a list of files we know
499 # Spend a bit of time here to get a list of files we know
500 # are modified so we can compare only against those.
500 # are modified so we can compare only against those.
501 # It can cost a lot of time (several seconds)
501 # It can cost a lot of time (several seconds)
502 # otherwise to update all standins if the largefiles are
502 # otherwise to update all standins if the largefiles are
503 # large.
503 # large.
504 lfdirstate = openlfdirstate(ui, repo)
504 lfdirstate = openlfdirstate(ui, repo)
505 dirtymatch = match_.always(repo.root, repo.getcwd())
505 dirtymatch = match_.always(repo.root, repo.getcwd())
506 unsure, s = lfdirstate.status(dirtymatch, [], False, False,
506 unsure, s = lfdirstate.status(dirtymatch, [], False, False,
507 False)
507 False)
508 modifiedfiles = unsure + s.modified + s.added + s.removed
508 modifiedfiles = unsure + s.modified + s.added + s.removed
509 lfiles = listlfiles(repo)
509 lfiles = listlfiles(repo)
510 # this only loops through largefiles that exist (not
510 # this only loops through largefiles that exist (not
511 # removed/renamed)
511 # removed/renamed)
512 for lfile in lfiles:
512 for lfile in lfiles:
513 if lfile in modifiedfiles:
513 if lfile in modifiedfiles:
514 if os.path.exists(
514 if os.path.exists(
515 repo.wjoin(standin(lfile))):
515 repo.wjoin(standin(lfile))):
516 # this handles the case where a rebase is being
516 # this handles the case where a rebase is being
517 # performed and the working copy is not updated
517 # performed and the working copy is not updated
518 # yet.
518 # yet.
519 if os.path.exists(repo.wjoin(lfile)):
519 if os.path.exists(repo.wjoin(lfile)):
520 updatestandin(repo,
520 updatestandin(repo,
521 standin(lfile))
521 standin(lfile))
522
522
523 return match
523 return match
524
524
525 lfiles = listlfiles(repo)
525 lfiles = listlfiles(repo)
526 match._files = repo._subdirlfs(match.files(), lfiles)
526 match._files = repo._subdirlfs(match.files(), lfiles)
527
527
528 # Case 2: user calls commit with specified patterns: refresh
528 # Case 2: user calls commit with specified patterns: refresh
529 # any matching big files.
529 # any matching big files.
530 smatcher = composestandinmatcher(repo, match)
530 smatcher = composestandinmatcher(repo, match)
531 standins = repo.dirstate.walk(smatcher, [], False, False)
531 standins = repo.dirstate.walk(smatcher, [], False, False)
532
532
533 # No matching big files: get out of the way and pass control to
533 # No matching big files: get out of the way and pass control to
534 # the usual commit() method.
534 # the usual commit() method.
535 if not standins:
535 if not standins:
536 return match
536 return match
537
537
538 # Refresh all matching big files. It's possible that the
538 # Refresh all matching big files. It's possible that the
539 # commit will end up failing, in which case the big files will
539 # commit will end up failing, in which case the big files will
540 # stay refreshed. No harm done: the user modified them and
540 # stay refreshed. No harm done: the user modified them and
541 # asked to commit them, so sooner or later we're going to
541 # asked to commit them, so sooner or later we're going to
542 # refresh the standins. Might as well leave them refreshed.
542 # refresh the standins. Might as well leave them refreshed.
543 lfdirstate = openlfdirstate(ui, repo)
543 lfdirstate = openlfdirstate(ui, repo)
544 for fstandin in standins:
544 for fstandin in standins:
545 lfile = splitstandin(fstandin)
545 lfile = splitstandin(fstandin)
546 if lfdirstate[lfile] != 'r':
546 if lfdirstate[lfile] != 'r':
547 updatestandin(repo, fstandin)
547 updatestandin(repo, fstandin)
548
548
549 # Cook up a new matcher that only matches regular files or
549 # Cook up a new matcher that only matches regular files or
550 # standins corresponding to the big files requested by the
550 # standins corresponding to the big files requested by the
551 # user. Have to modify _files to prevent commit() from
551 # user. Have to modify _files to prevent commit() from
552 # complaining "not tracked" for big files.
552 # complaining "not tracked" for big files.
553 match = copy.copy(match)
553 match = copy.copy(match)
554 origmatchfn = match.matchfn
554 origmatchfn = match.matchfn
555
555
556 # Check both the list of largefiles and the list of
556 # Check both the list of largefiles and the list of
557 # standins because if a largefile was removed, it
557 # standins because if a largefile was removed, it
558 # won't be in the list of largefiles at this point
558 # won't be in the list of largefiles at this point
559 match._files += sorted(standins)
559 match._files += sorted(standins)
560
560
561 actualfiles = []
561 actualfiles = []
562 for f in match._files:
562 for f in match._files:
563 fstandin = standin(f)
563 fstandin = standin(f)
564
564
565 # ignore known largefiles and standins
565 # For largefiles, only one of the normal and standin should be
566 if f in lfiles or fstandin in standins:
566 # committed (except if one of them is a remove).
567 # Thus, skip plain largefile names but keep the standin.
568 if (f in lfiles or fstandin in standins) and \
569 repo.dirstate[f] != 'r' and repo.dirstate[fstandin] != 'r':
567 continue
570 continue
568
571
569 actualfiles.append(f)
572 actualfiles.append(f)
570 match._files = actualfiles
573 match._files = actualfiles
571
574
572 def matchfn(f):
575 def matchfn(f):
573 if origmatchfn(f):
576 if origmatchfn(f):
574 return f not in lfiles
577 return f not in lfiles
575 else:
578 else:
576 return f in standins
579 return f in standins
577
580
578 match.matchfn = matchfn
581 match.matchfn = matchfn
579
582
580 return match
583 return match
581
584
582 class automatedcommithook(object):
585 class automatedcommithook(object):
583 '''Stateful hook to update standins at the 1st commit of resuming
586 '''Stateful hook to update standins at the 1st commit of resuming
584
587
585 For efficiency, updating standins in the working directory should
588 For efficiency, updating standins in the working directory should
586 be avoided while automated committing (like rebase, transplant and
589 be avoided while automated committing (like rebase, transplant and
587 so on), because they should be updated before committing.
590 so on), because they should be updated before committing.
588
591
589 But the 1st commit of resuming automated committing (e.g. ``rebase
592 But the 1st commit of resuming automated committing (e.g. ``rebase
590 --continue``) should update them, because largefiles may be
593 --continue``) should update them, because largefiles may be
591 modified manually.
594 modified manually.
592 '''
595 '''
593 def __init__(self, resuming):
596 def __init__(self, resuming):
594 self.resuming = resuming
597 self.resuming = resuming
595
598
596 def __call__(self, repo, match):
599 def __call__(self, repo, match):
597 if self.resuming:
600 if self.resuming:
598 self.resuming = False # avoids updating at subsequent commits
601 self.resuming = False # avoids updating at subsequent commits
599 return updatestandinsbymatch(repo, match)
602 return updatestandinsbymatch(repo, match)
600 else:
603 else:
601 return match
604 return match
602
605
603 def getstatuswriter(ui, repo, forcibly=None):
606 def getstatuswriter(ui, repo, forcibly=None):
604 '''Return the function to write largefiles specific status out
607 '''Return the function to write largefiles specific status out
605
608
606 If ``forcibly`` is ``None``, this returns the last element of
609 If ``forcibly`` is ``None``, this returns the last element of
607 ``repo._lfstatuswriters`` as "default" writer function.
610 ``repo._lfstatuswriters`` as "default" writer function.
608
611
609 Otherwise, this returns the function to always write out (or
612 Otherwise, this returns the function to always write out (or
610 ignore if ``not forcibly``) status.
613 ignore if ``not forcibly``) status.
611 '''
614 '''
612 if forcibly is None and util.safehasattr(repo, '_largefilesenabled'):
615 if forcibly is None and util.safehasattr(repo, '_largefilesenabled'):
613 return repo._lfstatuswriters[-1]
616 return repo._lfstatuswriters[-1]
614 else:
617 else:
615 if forcibly:
618 if forcibly:
616 return ui.status # forcibly WRITE OUT
619 return ui.status # forcibly WRITE OUT
617 else:
620 else:
618 return lambda *msg, **opts: None # forcibly IGNORE
621 return lambda *msg, **opts: None # forcibly IGNORE
@@ -1,1859 +1,1859 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 > [experimental]
22 > [experimental]
23 > # drop me once bundle2 is the default,
23 > # drop me once bundle2 is the default,
24 > # added to get test change early.
24 > # added to get test change early.
25 > bundle2-exp = True
25 > bundle2-exp = True
26 > EOF
26 > EOF
27
27
28 Create the repo with a couple of revisions of both large and normal
28 Create the repo with a couple of revisions of both large and normal
29 files.
29 files.
30 Test status and dirstate of largefiles and that summary output is correct.
30 Test status and dirstate of largefiles and that summary output is correct.
31
31
32 $ hg init a
32 $ hg init a
33 $ cd a
33 $ cd a
34 $ mkdir sub
34 $ mkdir sub
35 $ echo normal1 > normal1
35 $ echo normal1 > normal1
36 $ echo normal2 > sub/normal2
36 $ echo normal2 > sub/normal2
37 $ echo large1 > large1
37 $ echo large1 > large1
38 $ echo large2 > sub/large2
38 $ echo large2 > sub/large2
39 $ hg add normal1 sub/normal2
39 $ hg add normal1 sub/normal2
40 $ hg add --large large1 sub/large2
40 $ hg add --large large1 sub/large2
41 $ hg commit -m "add files"
41 $ hg commit -m "add files"
42 Invoking status precommit hook
42 Invoking status precommit hook
43 A large1
43 A large1
44 A normal1
44 A normal1
45 A sub/large2
45 A sub/large2
46 A sub/normal2
46 A sub/normal2
47 $ touch large1 sub/large2
47 $ touch large1 sub/large2
48 $ sleep 1
48 $ sleep 1
49 $ hg st
49 $ hg st
50 $ hg debugstate --nodates
50 $ hg debugstate --nodates
51 n 644 41 set .hglf/large1
51 n 644 41 set .hglf/large1
52 n 644 41 set .hglf/sub/large2
52 n 644 41 set .hglf/sub/large2
53 n 644 8 set normal1
53 n 644 8 set normal1
54 n 644 8 set sub/normal2
54 n 644 8 set sub/normal2
55 $ hg debugstate --large --nodates
55 $ hg debugstate --large --nodates
56 n 644 7 set large1
56 n 644 7 set large1
57 n 644 7 set sub/large2
57 n 644 7 set sub/large2
58 $ echo normal11 > normal1
58 $ echo normal11 > normal1
59 $ echo normal22 > sub/normal2
59 $ echo normal22 > sub/normal2
60 $ echo large11 > large1
60 $ echo large11 > large1
61 $ echo large22 > sub/large2
61 $ echo large22 > sub/large2
62 $ hg commit -m "edit files"
62 $ hg commit -m "edit files"
63 Invoking status precommit hook
63 Invoking status precommit hook
64 M large1
64 M large1
65 M normal1
65 M normal1
66 M sub/large2
66 M sub/large2
67 M sub/normal2
67 M sub/normal2
68 $ hg sum --large
68 $ hg sum --large
69 parent: 1:ce8896473775 tip
69 parent: 1:ce8896473775 tip
70 edit files
70 edit files
71 branch: default
71 branch: default
72 commit: (clean)
72 commit: (clean)
73 update: (current)
73 update: (current)
74 phases: 2 draft
74 phases: 2 draft
75 largefiles: (no remote repo)
75 largefiles: (no remote repo)
76
76
77 Commit preserved largefile contents.
77 Commit preserved largefile contents.
78
78
79 $ cat normal1
79 $ cat normal1
80 normal11
80 normal11
81 $ cat large1
81 $ cat large1
82 large11
82 large11
83 $ cat sub/normal2
83 $ cat sub/normal2
84 normal22
84 normal22
85 $ cat sub/large2
85 $ cat sub/large2
86 large22
86 large22
87
87
88 Test status, subdir and unknown files
88 Test status, subdir and unknown files
89
89
90 $ echo unknown > sub/unknown
90 $ echo unknown > sub/unknown
91 $ hg st --all
91 $ hg st --all
92 ? sub/unknown
92 ? sub/unknown
93 C large1
93 C large1
94 C normal1
94 C normal1
95 C sub/large2
95 C sub/large2
96 C sub/normal2
96 C sub/normal2
97 $ hg st --all sub
97 $ hg st --all sub
98 ? sub/unknown
98 ? sub/unknown
99 C sub/large2
99 C sub/large2
100 C sub/normal2
100 C sub/normal2
101 $ rm sub/unknown
101 $ rm sub/unknown
102
102
103 Test messages and exit codes for remove warning cases
103 Test messages and exit codes for remove warning cases
104
104
105 $ hg remove -A large1
105 $ hg remove -A large1
106 not removing large1: file still exists
106 not removing large1: file still exists
107 [1]
107 [1]
108 $ echo 'modified' > large1
108 $ echo 'modified' > large1
109 $ hg remove large1
109 $ hg remove large1
110 not removing large1: file is modified (use -f to force removal)
110 not removing large1: file is modified (use -f to force removal)
111 [1]
111 [1]
112 $ echo 'new' > normalnew
112 $ echo 'new' > normalnew
113 $ hg add normalnew
113 $ hg add normalnew
114 $ echo 'new' > largenew
114 $ echo 'new' > largenew
115 $ hg add --large normalnew
115 $ hg add --large normalnew
116 normalnew already tracked!
116 normalnew already tracked!
117 $ hg remove normalnew largenew
117 $ hg remove normalnew largenew
118 not removing largenew: file is untracked
118 not removing largenew: file is untracked
119 not removing normalnew: file has been marked for add (use forget to undo)
119 not removing normalnew: file has been marked for add (use forget to undo)
120 [1]
120 [1]
121 $ rm normalnew largenew
121 $ rm normalnew largenew
122 $ hg up -Cq
122 $ hg up -Cq
123
123
124 Remove both largefiles and normal files.
124 Remove both largefiles and normal files.
125
125
126 $ hg remove normal1 large1
126 $ hg remove normal1 large1
127 $ hg status large1
127 $ hg status large1
128 R large1
128 R large1
129 $ hg commit -m "remove files"
129 $ hg commit -m "remove files"
130 Invoking status precommit hook
130 Invoking status precommit hook
131 R large1
131 R large1
132 R normal1
132 R normal1
133 $ ls
133 $ ls
134 sub
134 sub
135 $ echo "testlargefile" > large1-test
135 $ echo "testlargefile" > large1-test
136 $ hg add --large large1-test
136 $ hg add --large large1-test
137 $ hg st
137 $ hg st
138 A large1-test
138 A large1-test
139 $ hg rm large1-test
139 $ hg rm large1-test
140 not removing large1-test: file has been marked for add (use forget to undo)
140 not removing large1-test: file has been marked for add (use forget to undo)
141 [1]
141 [1]
142 $ hg st
142 $ hg st
143 A large1-test
143 A large1-test
144 $ hg forget large1-test
144 $ hg forget large1-test
145 $ hg st
145 $ hg st
146 ? large1-test
146 ? large1-test
147 $ hg remove large1-test
147 $ hg remove large1-test
148 not removing large1-test: file is untracked
148 not removing large1-test: file is untracked
149 [1]
149 [1]
150 $ hg forget large1-test
150 $ hg forget large1-test
151 not removing large1-test: file is already untracked
151 not removing large1-test: file is already untracked
152 [1]
152 [1]
153 $ rm large1-test
153 $ rm large1-test
154
154
155 Copy both largefiles and normal files (testing that status output is correct).
155 Copy both largefiles and normal files (testing that status output is correct).
156
156
157 $ hg cp sub/normal2 normal1
157 $ hg cp sub/normal2 normal1
158 $ hg cp sub/large2 large1
158 $ hg cp sub/large2 large1
159 $ hg commit -m "copy files"
159 $ hg commit -m "copy files"
160 Invoking status precommit hook
160 Invoking status precommit hook
161 A large1
161 A large1
162 A normal1
162 A normal1
163 $ cat normal1
163 $ cat normal1
164 normal22
164 normal22
165 $ cat large1
165 $ cat large1
166 large22
166 large22
167
167
168 Test moving largefiles and verify that normal files are also unaffected.
168 Test moving largefiles and verify that normal files are also unaffected.
169
169
170 $ hg mv normal1 normal3
170 $ hg mv normal1 normal3
171 $ hg mv large1 large3
171 $ hg mv large1 large3
172 $ hg mv sub/normal2 sub/normal4
172 $ hg mv sub/normal2 sub/normal4
173 $ hg mv sub/large2 sub/large4
173 $ hg mv sub/large2 sub/large4
174 $ hg commit -m "move files"
174 $ hg commit -m "move files"
175 Invoking status precommit hook
175 Invoking status precommit hook
176 A large3
176 A large3
177 A normal3
177 A normal3
178 A sub/large4
178 A sub/large4
179 A sub/normal4
179 A sub/normal4
180 R large1
180 R large1
181 R normal1
181 R normal1
182 R sub/large2
182 R sub/large2
183 R sub/normal2
183 R sub/normal2
184 $ cat normal3
184 $ cat normal3
185 normal22
185 normal22
186 $ cat large3
186 $ cat large3
187 large22
187 large22
188 $ cat sub/normal4
188 $ cat sub/normal4
189 normal22
189 normal22
190 $ cat sub/large4
190 $ cat sub/large4
191 large22
191 large22
192
192
193
193
194 #if serve
194 #if serve
195 Test display of largefiles in hgweb
195 Test display of largefiles in hgweb
196
196
197 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
197 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
198 $ cat ../hg.pid >> $DAEMON_PIDS
198 $ cat ../hg.pid >> $DAEMON_PIDS
199 $ get-with-headers.py 127.0.0.1:$HGPORT 'file/tip/?style=raw'
199 $ get-with-headers.py 127.0.0.1:$HGPORT 'file/tip/?style=raw'
200 200 Script output follows
200 200 Script output follows
201
201
202
202
203 drwxr-xr-x sub
203 drwxr-xr-x sub
204 -rw-r--r-- 41 large3
204 -rw-r--r-- 41 large3
205 -rw-r--r-- 9 normal3
205 -rw-r--r-- 9 normal3
206
206
207
207
208 $ get-with-headers.py 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
208 $ get-with-headers.py 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
209 200 Script output follows
209 200 Script output follows
210
210
211
211
212 -rw-r--r-- 41 large4
212 -rw-r--r-- 41 large4
213 -rw-r--r-- 9 normal4
213 -rw-r--r-- 9 normal4
214
214
215
215
216 $ killdaemons.py
216 $ killdaemons.py
217 #endif
217 #endif
218
218
219 Test archiving the various revisions. These hit corner cases known with
219 Test archiving the various revisions. These hit corner cases known with
220 archiving.
220 archiving.
221
221
222 $ hg archive -r 0 ../archive0
222 $ hg archive -r 0 ../archive0
223 $ hg archive -r 1 ../archive1
223 $ hg archive -r 1 ../archive1
224 $ hg archive -r 2 ../archive2
224 $ hg archive -r 2 ../archive2
225 $ hg archive -r 3 ../archive3
225 $ hg archive -r 3 ../archive3
226 $ hg archive -r 4 ../archive4
226 $ hg archive -r 4 ../archive4
227 $ cd ../archive0
227 $ cd ../archive0
228 $ cat normal1
228 $ cat normal1
229 normal1
229 normal1
230 $ cat large1
230 $ cat large1
231 large1
231 large1
232 $ cat sub/normal2
232 $ cat sub/normal2
233 normal2
233 normal2
234 $ cat sub/large2
234 $ cat sub/large2
235 large2
235 large2
236 $ cd ../archive1
236 $ cd ../archive1
237 $ cat normal1
237 $ cat normal1
238 normal11
238 normal11
239 $ cat large1
239 $ cat large1
240 large11
240 large11
241 $ cat sub/normal2
241 $ cat sub/normal2
242 normal22
242 normal22
243 $ cat sub/large2
243 $ cat sub/large2
244 large22
244 large22
245 $ cd ../archive2
245 $ cd ../archive2
246 $ ls
246 $ ls
247 sub
247 sub
248 $ cat sub/normal2
248 $ cat sub/normal2
249 normal22
249 normal22
250 $ cat sub/large2
250 $ cat sub/large2
251 large22
251 large22
252 $ cd ../archive3
252 $ cd ../archive3
253 $ cat normal1
253 $ cat normal1
254 normal22
254 normal22
255 $ cat large1
255 $ cat large1
256 large22
256 large22
257 $ cat sub/normal2
257 $ cat sub/normal2
258 normal22
258 normal22
259 $ cat sub/large2
259 $ cat sub/large2
260 large22
260 large22
261 $ cd ../archive4
261 $ cd ../archive4
262 $ cat normal3
262 $ cat normal3
263 normal22
263 normal22
264 $ cat large3
264 $ cat large3
265 large22
265 large22
266 $ cat sub/normal4
266 $ cat sub/normal4
267 normal22
267 normal22
268 $ cat sub/large4
268 $ cat sub/large4
269 large22
269 large22
270
270
271 Commit corner case: specify files to commit.
271 Commit corner case: specify files to commit.
272
272
273 $ cd ../a
273 $ cd ../a
274 $ echo normal3 > normal3
274 $ echo normal3 > normal3
275 $ echo large3 > large3
275 $ echo large3 > large3
276 $ echo normal4 > sub/normal4
276 $ echo normal4 > sub/normal4
277 $ echo large4 > sub/large4
277 $ echo large4 > sub/large4
278 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
278 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
279 Invoking status precommit hook
279 Invoking status precommit hook
280 M large3
280 M large3
281 M normal3
281 M normal3
282 M sub/large4
282 M sub/large4
283 M sub/normal4
283 M sub/normal4
284 $ cat normal3
284 $ cat normal3
285 normal3
285 normal3
286 $ cat large3
286 $ cat large3
287 large3
287 large3
288 $ cat sub/normal4
288 $ cat sub/normal4
289 normal4
289 normal4
290 $ cat sub/large4
290 $ cat sub/large4
291 large4
291 large4
292
292
293 One more commit corner case: commit from a subdirectory.
293 One more commit corner case: commit from a subdirectory.
294
294
295 $ cd ../a
295 $ cd ../a
296 $ echo normal33 > normal3
296 $ echo normal33 > normal3
297 $ echo large33 > large3
297 $ echo large33 > large3
298 $ echo normal44 > sub/normal4
298 $ echo normal44 > sub/normal4
299 $ echo large44 > sub/large4
299 $ echo large44 > sub/large4
300 $ cd sub
300 $ cd sub
301 $ hg commit -m "edit files yet again"
301 $ hg commit -m "edit files yet again"
302 Invoking status precommit hook
302 Invoking status precommit hook
303 M large3
303 M large3
304 M normal3
304 M normal3
305 M sub/large4
305 M sub/large4
306 M sub/normal4
306 M sub/normal4
307 $ cat ../normal3
307 $ cat ../normal3
308 normal33
308 normal33
309 $ cat ../large3
309 $ cat ../large3
310 large33
310 large33
311 $ cat normal4
311 $ cat normal4
312 normal44
312 normal44
313 $ cat large4
313 $ cat large4
314 large44
314 large44
315
315
316 Committing standins is not allowed.
316 Committing standins is not allowed.
317
317
318 $ cd ..
318 $ cd ..
319 $ echo large3 > large3
319 $ echo large3 > large3
320 $ hg commit .hglf/large3 -m "try to commit standin"
320 $ hg commit .hglf/large3 -m "try to commit standin"
321 abort: file ".hglf/large3" is a largefile standin
321 abort: file ".hglf/large3" is a largefile standin
322 (commit the largefile itself instead)
322 (commit the largefile itself instead)
323 [255]
323 [255]
324
324
325 Corner cases for adding largefiles.
325 Corner cases for adding largefiles.
326
326
327 $ echo large5 > large5
327 $ echo large5 > large5
328 $ hg add --large large5
328 $ hg add --large large5
329 $ hg add --large large5
329 $ hg add --large large5
330 large5 already a largefile
330 large5 already a largefile
331 $ mkdir sub2
331 $ mkdir sub2
332 $ echo large6 > sub2/large6
332 $ echo large6 > sub2/large6
333 $ echo large7 > sub2/large7
333 $ echo large7 > sub2/large7
334 $ hg add --large sub2
334 $ hg add --large sub2
335 adding sub2/large6 as a largefile (glob)
335 adding sub2/large6 as a largefile (glob)
336 adding sub2/large7 as a largefile (glob)
336 adding sub2/large7 as a largefile (glob)
337 $ hg st
337 $ hg st
338 M large3
338 M large3
339 A large5
339 A large5
340 A sub2/large6
340 A sub2/large6
341 A sub2/large7
341 A sub2/large7
342
342
343 Committing directories containing only largefiles.
343 Committing directories containing only largefiles.
344
344
345 $ mkdir -p z/y/x/m
345 $ mkdir -p z/y/x/m
346 $ touch z/y/x/m/large1
346 $ touch z/y/x/m/large1
347 $ touch z/y/x/large2
347 $ touch z/y/x/large2
348 $ hg add --large z/y/x/m/large1 z/y/x/large2
348 $ hg add --large z/y/x/m/large1 z/y/x/large2
349 $ hg commit -m "Subdir with directory only containing largefiles" z
349 $ hg commit -m "Subdir with directory only containing largefiles" z
350 Invoking status precommit hook
350 Invoking status precommit hook
351 M large3
351 M large3
352 A large5
352 A large5
353 A sub2/large6
353 A sub2/large6
354 A sub2/large7
354 A sub2/large7
355 A z/y/x/large2
355 A z/y/x/large2
356 A z/y/x/m/large1
356 A z/y/x/m/large1
357
357
358 (and a bit of log testing)
358 (and a bit of log testing)
359
359
360 $ hg log -T '{rev}\n' z/y/x/m/large1
360 $ hg log -T '{rev}\n' z/y/x/m/large1
361 7
361 7
362 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
362 $ hg log -T '{rev}\n' z/y/x/m # with only a largefile
363 7
363 7
364
364
365 $ hg rollback --quiet
365 $ hg rollback --quiet
366 $ touch z/y/x/m/normal
366 $ touch z/y/x/m/normal
367 $ hg add z/y/x/m/normal
367 $ hg add z/y/x/m/normal
368 $ hg commit -m "Subdir with mixed contents" z
368 $ hg commit -m "Subdir with mixed contents" z
369 Invoking status precommit hook
369 Invoking status precommit hook
370 M large3
370 M large3
371 A large5
371 A large5
372 A sub2/large6
372 A sub2/large6
373 A sub2/large7
373 A sub2/large7
374 A z/y/x/large2
374 A z/y/x/large2
375 A z/y/x/m/large1
375 A z/y/x/m/large1
376 A z/y/x/m/normal
376 A z/y/x/m/normal
377 $ hg st
377 $ hg st
378 M large3
378 M large3
379 A large5
379 A large5
380 A sub2/large6
380 A sub2/large6
381 A sub2/large7
381 A sub2/large7
382 $ hg rollback --quiet
382 $ hg rollback --quiet
383 $ hg revert z/y/x/large2 z/y/x/m/large1
383 $ hg revert z/y/x/large2 z/y/x/m/large1
384 $ rm z/y/x/large2 z/y/x/m/large1
384 $ rm z/y/x/large2 z/y/x/m/large1
385 $ hg commit -m "Subdir with normal contents" z
385 $ hg commit -m "Subdir with normal contents" z
386 Invoking status precommit hook
386 Invoking status precommit hook
387 M large3
387 M large3
388 A large5
388 A large5
389 A sub2/large6
389 A sub2/large6
390 A sub2/large7
390 A sub2/large7
391 A z/y/x/m/normal
391 A z/y/x/m/normal
392 $ hg st
392 $ hg st
393 M large3
393 M large3
394 A large5
394 A large5
395 A sub2/large6
395 A sub2/large6
396 A sub2/large7
396 A sub2/large7
397 $ hg rollback --quiet
397 $ hg rollback --quiet
398 $ hg revert --quiet z
398 $ hg revert --quiet z
399 $ hg commit -m "Empty subdir" z
399 $ hg commit -m "Empty subdir" z
400 abort: z: no match under directory!
400 abort: z: no match under directory!
401 [255]
401 [255]
402 $ rm -rf z
402 $ rm -rf z
403 $ hg ci -m "standin" .hglf
403 $ hg ci -m "standin" .hglf
404 abort: file ".hglf" is a largefile standin
404 abort: file ".hglf" is a largefile standin
405 (commit the largefile itself instead)
405 (commit the largefile itself instead)
406 [255]
406 [255]
407
407
408 Test "hg status" with combination of 'file pattern' and 'directory
408 Test "hg status" with combination of 'file pattern' and 'directory
409 pattern' for largefiles:
409 pattern' for largefiles:
410
410
411 $ hg status sub2/large6 sub2
411 $ hg status sub2/large6 sub2
412 A sub2/large6
412 A sub2/large6
413 A sub2/large7
413 A sub2/large7
414
414
415 Config settings (pattern **.dat, minsize 2 MB) are respected.
415 Config settings (pattern **.dat, minsize 2 MB) are respected.
416
416
417 $ echo testdata > test.dat
417 $ echo testdata > test.dat
418 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
418 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
419 $ hg add
419 $ hg add
420 adding reallylarge as a largefile
420 adding reallylarge as a largefile
421 adding test.dat as a largefile
421 adding test.dat as a largefile
422
422
423 Test that minsize and --lfsize handle float values;
423 Test that minsize and --lfsize handle float values;
424 also tests that --lfsize overrides largefiles.minsize.
424 also tests that --lfsize overrides largefiles.minsize.
425 (0.250 MB = 256 kB = 262144 B)
425 (0.250 MB = 256 kB = 262144 B)
426
426
427 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
427 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
428 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
428 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
429 $ hg --config largefiles.minsize=.25 add
429 $ hg --config largefiles.minsize=.25 add
430 adding ratherlarge as a largefile
430 adding ratherlarge as a largefile
431 adding medium
431 adding medium
432 $ hg forget medium
432 $ hg forget medium
433 $ hg --config largefiles.minsize=.25 add --lfsize=.125
433 $ hg --config largefiles.minsize=.25 add --lfsize=.125
434 adding medium as a largefile
434 adding medium as a largefile
435 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
435 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
436 $ hg --config largefiles.minsize=.25 add --lfsize=.125
436 $ hg --config largefiles.minsize=.25 add --lfsize=.125
437 adding notlarge
437 adding notlarge
438 $ hg forget notlarge
438 $ hg forget notlarge
439
439
440 Test forget on largefiles.
440 Test forget on largefiles.
441
441
442 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
442 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
443 $ hg commit -m "add/edit more largefiles"
443 $ hg commit -m "add/edit more largefiles"
444 Invoking status precommit hook
444 Invoking status precommit hook
445 A sub2/large6
445 A sub2/large6
446 A sub2/large7
446 A sub2/large7
447 R large3
447 R large3
448 ? large5
448 ? large5
449 ? medium
449 ? medium
450 ? notlarge
450 ? notlarge
451 ? ratherlarge
451 ? ratherlarge
452 ? reallylarge
452 ? reallylarge
453 ? test.dat
453 ? test.dat
454 $ hg st
454 $ hg st
455 ? large3
455 ? large3
456 ? large5
456 ? large5
457 ? medium
457 ? medium
458 ? notlarge
458 ? notlarge
459 ? ratherlarge
459 ? ratherlarge
460 ? reallylarge
460 ? reallylarge
461 ? test.dat
461 ? test.dat
462
462
463 Purge with largefiles: verify that largefiles are still in the working
463 Purge with largefiles: verify that largefiles are still in the working
464 dir after a purge.
464 dir after a purge.
465
465
466 $ hg purge --all
466 $ hg purge --all
467 $ cat sub/large4
467 $ cat sub/large4
468 large44
468 large44
469 $ cat sub2/large6
469 $ cat sub2/large6
470 large6
470 large6
471 $ cat sub2/large7
471 $ cat sub2/large7
472 large7
472 large7
473
473
474 Test addremove: verify that files that should be added as largefiles are added as
474 Test addremove: verify that files that should be added as largefiles are added as
475 such and that already-existing largefiles are not added as normal files by
475 such and that already-existing largefiles are not added as normal files by
476 accident.
476 accident.
477
477
478 $ rm normal3
478 $ rm normal3
479 $ rm sub/large4
479 $ rm sub/large4
480 $ echo "testing addremove with patterns" > testaddremove.dat
480 $ echo "testing addremove with patterns" > testaddremove.dat
481 $ echo "normaladdremove" > normaladdremove
481 $ echo "normaladdremove" > normaladdremove
482 $ hg addremove
482 $ hg addremove
483 removing sub/large4
483 removing sub/large4
484 adding testaddremove.dat as a largefile
484 adding testaddremove.dat as a largefile
485 removing normal3
485 removing normal3
486 adding normaladdremove
486 adding normaladdremove
487
487
488 Test addremove with -R
488 Test addremove with -R
489
489
490 $ hg up -C
490 $ hg up -C
491 getting changed largefiles
491 getting changed largefiles
492 1 largefiles updated, 0 removed
492 1 largefiles updated, 0 removed
493 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
493 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
494 $ rm normal3
494 $ rm normal3
495 $ rm sub/large4
495 $ rm sub/large4
496 $ echo "testing addremove with patterns" > testaddremove.dat
496 $ echo "testing addremove with patterns" > testaddremove.dat
497 $ echo "normaladdremove" > normaladdremove
497 $ echo "normaladdremove" > normaladdremove
498 $ cd ..
498 $ cd ..
499 $ hg -R a -v addremove
499 $ hg -R a -v addremove
500 removing sub/large4
500 removing sub/large4
501 adding testaddremove.dat as a largefile
501 adding testaddremove.dat as a largefile
502 removing normal3
502 removing normal3
503 adding normaladdremove
503 adding normaladdremove
504 $ cd a
504 $ cd a
505
505
506 Test 3364
506 Test 3364
507 $ hg clone . ../addrm
507 $ hg clone . ../addrm
508 updating to branch default
508 updating to branch default
509 getting changed largefiles
509 getting changed largefiles
510 3 largefiles updated, 0 removed
510 3 largefiles updated, 0 removed
511 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
511 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 $ cd ../addrm
512 $ cd ../addrm
513 $ cat >> .hg/hgrc <<EOF
513 $ cat >> .hg/hgrc <<EOF
514 > [hooks]
514 > [hooks]
515 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
515 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
516 > EOF
516 > EOF
517 $ touch foo
517 $ touch foo
518 $ hg add --large foo
518 $ hg add --large foo
519 $ hg ci -m "add foo"
519 $ hg ci -m "add foo"
520 Invoking status precommit hook
520 Invoking status precommit hook
521 A foo
521 A foo
522 Invoking status postcommit hook
522 Invoking status postcommit hook
523 C foo
523 C foo
524 C normal3
524 C normal3
525 C sub/large4
525 C sub/large4
526 C sub/normal4
526 C sub/normal4
527 C sub2/large6
527 C sub2/large6
528 C sub2/large7
528 C sub2/large7
529 $ rm foo
529 $ rm foo
530 $ hg st
530 $ hg st
531 ! foo
531 ! foo
532 hmm.. no precommit invoked, but there is a postcommit??
532 hmm.. no precommit invoked, but there is a postcommit??
533 $ hg ci -m "will not checkin"
533 $ hg ci -m "will not checkin"
534 nothing changed
534 nothing changed
535 Invoking status postcommit hook
535 Invoking status postcommit hook
536 ! foo
536 ! foo
537 C normal3
537 C normal3
538 C sub/large4
538 C sub/large4
539 C sub/normal4
539 C sub/normal4
540 C sub2/large6
540 C sub2/large6
541 C sub2/large7
541 C sub2/large7
542 [1]
542 [1]
543 $ hg addremove
543 $ hg addremove
544 removing foo
544 removing foo
545 $ hg st
545 $ hg st
546 R foo
546 R foo
547 $ hg ci -m "used to say nothing changed"
547 $ hg ci -m "used to say nothing changed"
548 Invoking status precommit hook
548 Invoking status precommit hook
549 R foo
549 R foo
550 Invoking status postcommit hook
550 Invoking status postcommit hook
551 C normal3
551 C normal3
552 C sub/large4
552 C sub/large4
553 C sub/normal4
553 C sub/normal4
554 C sub2/large6
554 C sub2/large6
555 C sub2/large7
555 C sub2/large7
556 $ hg st
556 $ hg st
557
557
558 Test 3507 (both normal files and largefiles were a problem)
558 Test 3507 (both normal files and largefiles were a problem)
559
559
560 $ touch normal
560 $ touch normal
561 $ touch large
561 $ touch large
562 $ hg add normal
562 $ hg add normal
563 $ hg add --large large
563 $ hg add --large large
564 $ hg ci -m "added"
564 $ hg ci -m "added"
565 Invoking status precommit hook
565 Invoking status precommit hook
566 A large
566 A large
567 A normal
567 A normal
568 Invoking status postcommit hook
568 Invoking status postcommit hook
569 C large
569 C large
570 C normal
570 C normal
571 C normal3
571 C normal3
572 C sub/large4
572 C sub/large4
573 C sub/normal4
573 C sub/normal4
574 C sub2/large6
574 C sub2/large6
575 C sub2/large7
575 C sub2/large7
576 $ hg remove normal
576 $ hg remove normal
577 $ hg addremove --traceback
577 $ hg addremove --traceback
578 $ hg ci -m "addremoved normal"
578 $ hg ci -m "addremoved normal"
579 Invoking status precommit hook
579 Invoking status precommit hook
580 R normal
580 R normal
581 Invoking status postcommit hook
581 Invoking status postcommit hook
582 C large
582 C large
583 C normal3
583 C normal3
584 C sub/large4
584 C sub/large4
585 C sub/normal4
585 C sub/normal4
586 C sub2/large6
586 C sub2/large6
587 C sub2/large7
587 C sub2/large7
588 $ hg up -C '.^'
588 $ hg up -C '.^'
589 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
589 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
590 $ hg remove large
590 $ hg remove large
591 $ hg addremove --traceback
591 $ hg addremove --traceback
592 $ hg ci -m "removed large"
592 $ hg ci -m "removed large"
593 Invoking status precommit hook
593 Invoking status precommit hook
594 R large
594 R large
595 created new head
595 created new head
596 Invoking status postcommit hook
596 Invoking status postcommit hook
597 C normal
597 C normal
598 C normal3
598 C normal3
599 C sub/large4
599 C sub/large4
600 C sub/normal4
600 C sub/normal4
601 C sub2/large6
601 C sub2/large6
602 C sub2/large7
602 C sub2/large7
603
603
604 Test commit -A (issue3542)
604 Test commit -A (issue3542)
605 $ echo large8 > large8
605 $ echo large8 > large8
606 $ hg add --large large8
606 $ hg add --large large8
607 $ hg ci -Am 'this used to add large8 as normal and commit both'
607 $ hg ci -Am 'this used to add large8 as normal and commit both'
608 Invoking status precommit hook
608 Invoking status precommit hook
609 A large8
609 A large8
610 Invoking status postcommit hook
610 Invoking status postcommit hook
611 C large8
611 C large8
612 C normal
612 C normal
613 C normal3
613 C normal3
614 C sub/large4
614 C sub/large4
615 C sub/normal4
615 C sub/normal4
616 C sub2/large6
616 C sub2/large6
617 C sub2/large7
617 C sub2/large7
618 $ rm large8
618 $ rm large8
619 $ hg ci -Am 'this used to not notice the rm'
619 $ hg ci -Am 'this used to not notice the rm'
620 removing large8
620 removing large8
621 Invoking status precommit hook
621 Invoking status precommit hook
622 R large8
622 R large8
623 Invoking status postcommit hook
623 Invoking status postcommit hook
624 C normal
624 C normal
625 C normal3
625 C normal3
626 C sub/large4
626 C sub/large4
627 C sub/normal4
627 C sub/normal4
628 C sub2/large6
628 C sub2/large6
629 C sub2/large7
629 C sub2/large7
630
630
631 Test that a standin can't be added as a large file
631 Test that a standin can't be added as a large file
632
632
633 $ touch large
633 $ touch large
634 $ hg add --large large
634 $ hg add --large large
635 $ hg ci -m "add"
635 $ hg ci -m "add"
636 Invoking status precommit hook
636 Invoking status precommit hook
637 A large
637 A large
638 Invoking status postcommit hook
638 Invoking status postcommit hook
639 C large
639 C large
640 C normal
640 C normal
641 C normal3
641 C normal3
642 C sub/large4
642 C sub/large4
643 C sub/normal4
643 C sub/normal4
644 C sub2/large6
644 C sub2/large6
645 C sub2/large7
645 C sub2/large7
646 $ hg remove large
646 $ hg remove large
647 $ touch large
647 $ touch large
648 $ hg addremove --config largefiles.patterns=**large --traceback
648 $ hg addremove --config largefiles.patterns=**large --traceback
649 adding large as a largefile
649 adding large as a largefile
650
650
651 Test that outgoing --large works (with revsets too)
651 Test that outgoing --large works (with revsets too)
652 $ hg outgoing --rev '.^' --large
652 $ hg outgoing --rev '.^' --large
653 comparing with $TESTTMP/a (glob)
653 comparing with $TESTTMP/a (glob)
654 searching for changes
654 searching for changes
655 changeset: 8:c02fd3b77ec4
655 changeset: 8:c02fd3b77ec4
656 user: test
656 user: test
657 date: Thu Jan 01 00:00:00 1970 +0000
657 date: Thu Jan 01 00:00:00 1970 +0000
658 summary: add foo
658 summary: add foo
659
659
660 changeset: 9:289dd08c9bbb
660 changeset: 9:289dd08c9bbb
661 user: test
661 user: test
662 date: Thu Jan 01 00:00:00 1970 +0000
662 date: Thu Jan 01 00:00:00 1970 +0000
663 summary: used to say nothing changed
663 summary: used to say nothing changed
664
664
665 changeset: 10:34f23ac6ac12
665 changeset: 10:34f23ac6ac12
666 user: test
666 user: test
667 date: Thu Jan 01 00:00:00 1970 +0000
667 date: Thu Jan 01 00:00:00 1970 +0000
668 summary: added
668 summary: added
669
669
670 changeset: 12:710c1b2f523c
670 changeset: 12:710c1b2f523c
671 parent: 10:34f23ac6ac12
671 parent: 10:34f23ac6ac12
672 user: test
672 user: test
673 date: Thu Jan 01 00:00:00 1970 +0000
673 date: Thu Jan 01 00:00:00 1970 +0000
674 summary: removed large
674 summary: removed large
675
675
676 changeset: 13:0a3e75774479
676 changeset: 13:0a3e75774479
677 user: test
677 user: test
678 date: Thu Jan 01 00:00:00 1970 +0000
678 date: Thu Jan 01 00:00:00 1970 +0000
679 summary: this used to add large8 as normal and commit both
679 summary: this used to add large8 as normal and commit both
680
680
681 changeset: 14:84f3d378175c
681 changeset: 14:84f3d378175c
682 user: test
682 user: test
683 date: Thu Jan 01 00:00:00 1970 +0000
683 date: Thu Jan 01 00:00:00 1970 +0000
684 summary: this used to not notice the rm
684 summary: this used to not notice the rm
685
685
686 largefiles to upload (1 entities):
686 largefiles to upload (1 entities):
687 large8
687 large8
688
688
689 $ cd ../a
689 $ cd ../a
690
690
691 Clone a largefiles repo.
691 Clone a largefiles repo.
692
692
693 $ hg clone . ../b
693 $ hg clone . ../b
694 updating to branch default
694 updating to branch default
695 getting changed largefiles
695 getting changed largefiles
696 3 largefiles updated, 0 removed
696 3 largefiles updated, 0 removed
697 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
697 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
698 $ cd ../b
698 $ cd ../b
699 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
699 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
700 7:daea875e9014 add/edit more largefiles
700 7:daea875e9014 add/edit more largefiles
701 6:4355d653f84f edit files yet again
701 6:4355d653f84f edit files yet again
702 5:9d5af5072dbd edit files again
702 5:9d5af5072dbd edit files again
703 4:74c02385b94c move files
703 4:74c02385b94c move files
704 3:9e8fbc4bce62 copy files
704 3:9e8fbc4bce62 copy files
705 2:51a0ae4d5864 remove files
705 2:51a0ae4d5864 remove files
706 1:ce8896473775 edit files
706 1:ce8896473775 edit files
707 0:30d30fe6a5be add files
707 0:30d30fe6a5be add files
708 $ cat normal3
708 $ cat normal3
709 normal33
709 normal33
710
710
711 Test graph log
711 Test graph log
712
712
713 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
713 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
714 @ 7:daea875e9014 add/edit more largefiles
714 @ 7:daea875e9014 add/edit more largefiles
715 |
715 |
716 o 6:4355d653f84f edit files yet again
716 o 6:4355d653f84f edit files yet again
717 |
717 |
718 o 5:9d5af5072dbd edit files again
718 o 5:9d5af5072dbd edit files again
719 |
719 |
720 o 4:74c02385b94c move files
720 o 4:74c02385b94c move files
721 |
721 |
722 o 3:9e8fbc4bce62 copy files
722 o 3:9e8fbc4bce62 copy files
723 |
723 |
724 o 2:51a0ae4d5864 remove files
724 o 2:51a0ae4d5864 remove files
725 |
725 |
726 o 1:ce8896473775 edit files
726 o 1:ce8896473775 edit files
727 |
727 |
728 o 0:30d30fe6a5be add files
728 o 0:30d30fe6a5be add files
729
729
730
730
731 Test log with --patch
731 Test log with --patch
732
732
733 $ hg log --patch -r 6::7
733 $ hg log --patch -r 6::7
734 changeset: 6:4355d653f84f
734 changeset: 6:4355d653f84f
735 user: test
735 user: test
736 date: Thu Jan 01 00:00:00 1970 +0000
736 date: Thu Jan 01 00:00:00 1970 +0000
737 summary: edit files yet again
737 summary: edit files yet again
738
738
739 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
739 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
740 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
740 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
741 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
741 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
742 @@ -1,1 +1,1 @@
742 @@ -1,1 +1,1 @@
743 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
743 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
744 +7838695e10da2bb75ac1156565f40a2595fa2fa0
744 +7838695e10da2bb75ac1156565f40a2595fa2fa0
745 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
745 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
746 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
746 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
747 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
747 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
748 @@ -1,1 +1,1 @@
748 @@ -1,1 +1,1 @@
749 -aeb2210d19f02886dde00dac279729a48471e2f9
749 -aeb2210d19f02886dde00dac279729a48471e2f9
750 +971fb41e78fea4f8e0ba5244784239371cb00591
750 +971fb41e78fea4f8e0ba5244784239371cb00591
751 diff -r 9d5af5072dbd -r 4355d653f84f normal3
751 diff -r 9d5af5072dbd -r 4355d653f84f normal3
752 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
752 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
753 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
753 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
754 @@ -1,1 +1,1 @@
754 @@ -1,1 +1,1 @@
755 -normal3
755 -normal3
756 +normal33
756 +normal33
757 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
757 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
758 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
758 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
759 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
759 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
760 @@ -1,1 +1,1 @@
760 @@ -1,1 +1,1 @@
761 -normal4
761 -normal4
762 +normal44
762 +normal44
763
763
764 changeset: 7:daea875e9014
764 changeset: 7:daea875e9014
765 tag: tip
765 tag: tip
766 user: test
766 user: test
767 date: Thu Jan 01 00:00:00 1970 +0000
767 date: Thu Jan 01 00:00:00 1970 +0000
768 summary: add/edit more largefiles
768 summary: add/edit more largefiles
769
769
770 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
770 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
771 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
771 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
772 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
772 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
773 @@ -1,1 +0,0 @@
773 @@ -1,1 +0,0 @@
774 -7838695e10da2bb75ac1156565f40a2595fa2fa0
774 -7838695e10da2bb75ac1156565f40a2595fa2fa0
775 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
775 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
776 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
776 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
777 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
777 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
778 @@ -0,0 +1,1 @@
778 @@ -0,0 +1,1 @@
779 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
779 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
780 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
780 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
781 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
781 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
782 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
782 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
783 @@ -0,0 +1,1 @@
783 @@ -0,0 +1,1 @@
784 +bb3151689acb10f0c3125c560d5e63df914bc1af
784 +bb3151689acb10f0c3125c560d5e63df914bc1af
785
785
786
786
787 $ hg log --patch -r 6::7 sub/
787 $ hg log --patch -r 6::7 sub/
788 changeset: 6:4355d653f84f
788 changeset: 6:4355d653f84f
789 user: test
789 user: test
790 date: Thu Jan 01 00:00:00 1970 +0000
790 date: Thu Jan 01 00:00:00 1970 +0000
791 summary: edit files yet again
791 summary: edit files yet again
792
792
793 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
793 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
794 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
794 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
795 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
795 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
796 @@ -1,1 +1,1 @@
796 @@ -1,1 +1,1 @@
797 -aeb2210d19f02886dde00dac279729a48471e2f9
797 -aeb2210d19f02886dde00dac279729a48471e2f9
798 +971fb41e78fea4f8e0ba5244784239371cb00591
798 +971fb41e78fea4f8e0ba5244784239371cb00591
799 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
799 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
800 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
800 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
801 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
801 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
802 @@ -1,1 +1,1 @@
802 @@ -1,1 +1,1 @@
803 -normal4
803 -normal4
804 +normal44
804 +normal44
805
805
806
806
807 log with both --follow and --patch
807 log with both --follow and --patch
808
808
809 $ hg log --follow --patch --limit 2
809 $ hg log --follow --patch --limit 2
810 changeset: 7:daea875e9014
810 changeset: 7:daea875e9014
811 tag: tip
811 tag: tip
812 user: test
812 user: test
813 date: Thu Jan 01 00:00:00 1970 +0000
813 date: Thu Jan 01 00:00:00 1970 +0000
814 summary: add/edit more largefiles
814 summary: add/edit more largefiles
815
815
816 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
816 diff -r 4355d653f84f -r daea875e9014 .hglf/large3
817 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
817 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
818 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
818 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
819 @@ -1,1 +0,0 @@
819 @@ -1,1 +0,0 @@
820 -7838695e10da2bb75ac1156565f40a2595fa2fa0
820 -7838695e10da2bb75ac1156565f40a2595fa2fa0
821 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
821 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6
822 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
822 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
823 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
823 +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000
824 @@ -0,0 +1,1 @@
824 @@ -0,0 +1,1 @@
825 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
825 +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30
826 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
826 diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7
827 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
827 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
828 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
828 +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000
829 @@ -0,0 +1,1 @@
829 @@ -0,0 +1,1 @@
830 +bb3151689acb10f0c3125c560d5e63df914bc1af
830 +bb3151689acb10f0c3125c560d5e63df914bc1af
831
831
832 changeset: 6:4355d653f84f
832 changeset: 6:4355d653f84f
833 user: test
833 user: test
834 date: Thu Jan 01 00:00:00 1970 +0000
834 date: Thu Jan 01 00:00:00 1970 +0000
835 summary: edit files yet again
835 summary: edit files yet again
836
836
837 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
837 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3
838 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
838 --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
839 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
839 +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000
840 @@ -1,1 +1,1 @@
840 @@ -1,1 +1,1 @@
841 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
841 -baaf12afde9d8d67f25dab6dced0d2bf77dba47c
842 +7838695e10da2bb75ac1156565f40a2595fa2fa0
842 +7838695e10da2bb75ac1156565f40a2595fa2fa0
843 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
843 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
844 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
844 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
845 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
845 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
846 @@ -1,1 +1,1 @@
846 @@ -1,1 +1,1 @@
847 -aeb2210d19f02886dde00dac279729a48471e2f9
847 -aeb2210d19f02886dde00dac279729a48471e2f9
848 +971fb41e78fea4f8e0ba5244784239371cb00591
848 +971fb41e78fea4f8e0ba5244784239371cb00591
849 diff -r 9d5af5072dbd -r 4355d653f84f normal3
849 diff -r 9d5af5072dbd -r 4355d653f84f normal3
850 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
850 --- a/normal3 Thu Jan 01 00:00:00 1970 +0000
851 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
851 +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000
852 @@ -1,1 +1,1 @@
852 @@ -1,1 +1,1 @@
853 -normal3
853 -normal3
854 +normal33
854 +normal33
855 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
855 diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4
856 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
856 --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
857 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
857 +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000
858 @@ -1,1 +1,1 @@
858 @@ -1,1 +1,1 @@
859 -normal4
859 -normal4
860 +normal44
860 +normal44
861
861
862 $ hg log --follow --patch sub/large4
862 $ hg log --follow --patch sub/large4
863 changeset: 6:4355d653f84f
863 changeset: 6:4355d653f84f
864 user: test
864 user: test
865 date: Thu Jan 01 00:00:00 1970 +0000
865 date: Thu Jan 01 00:00:00 1970 +0000
866 summary: edit files yet again
866 summary: edit files yet again
867
867
868 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
868 diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4
869 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
869 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
870 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
870 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
871 @@ -1,1 +1,1 @@
871 @@ -1,1 +1,1 @@
872 -aeb2210d19f02886dde00dac279729a48471e2f9
872 -aeb2210d19f02886dde00dac279729a48471e2f9
873 +971fb41e78fea4f8e0ba5244784239371cb00591
873 +971fb41e78fea4f8e0ba5244784239371cb00591
874
874
875 changeset: 5:9d5af5072dbd
875 changeset: 5:9d5af5072dbd
876 user: test
876 user: test
877 date: Thu Jan 01 00:00:00 1970 +0000
877 date: Thu Jan 01 00:00:00 1970 +0000
878 summary: edit files again
878 summary: edit files again
879
879
880 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
880 diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4
881 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
881 --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
882 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
882 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
883 @@ -1,1 +1,1 @@
883 @@ -1,1 +1,1 @@
884 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
884 -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
885 +aeb2210d19f02886dde00dac279729a48471e2f9
885 +aeb2210d19f02886dde00dac279729a48471e2f9
886
886
887 changeset: 4:74c02385b94c
887 changeset: 4:74c02385b94c
888 user: test
888 user: test
889 date: Thu Jan 01 00:00:00 1970 +0000
889 date: Thu Jan 01 00:00:00 1970 +0000
890 summary: move files
890 summary: move files
891
891
892 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
892 diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4
893 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
893 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
894 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
894 +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000
895 @@ -0,0 +1,1 @@
895 @@ -0,0 +1,1 @@
896 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
896 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
897
897
898 changeset: 1:ce8896473775
898 changeset: 1:ce8896473775
899 user: test
899 user: test
900 date: Thu Jan 01 00:00:00 1970 +0000
900 date: Thu Jan 01 00:00:00 1970 +0000
901 summary: edit files
901 summary: edit files
902
902
903 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
903 diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2
904 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
904 --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
905 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
905 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
906 @@ -1,1 +1,1 @@
906 @@ -1,1 +1,1 @@
907 -1deebade43c8c498a3c8daddac0244dc55d1331d
907 -1deebade43c8c498a3c8daddac0244dc55d1331d
908 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
908 +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
909
909
910 changeset: 0:30d30fe6a5be
910 changeset: 0:30d30fe6a5be
911 user: test
911 user: test
912 date: Thu Jan 01 00:00:00 1970 +0000
912 date: Thu Jan 01 00:00:00 1970 +0000
913 summary: add files
913 summary: add files
914
914
915 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
915 diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2
916 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
916 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
917 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
917 +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000
918 @@ -0,0 +1,1 @@
918 @@ -0,0 +1,1 @@
919 +1deebade43c8c498a3c8daddac0244dc55d1331d
919 +1deebade43c8c498a3c8daddac0244dc55d1331d
920
920
921 $ cat sub/normal4
921 $ cat sub/normal4
922 normal44
922 normal44
923 $ cat sub/large4
923 $ cat sub/large4
924 large44
924 large44
925 $ cat sub2/large6
925 $ cat sub2/large6
926 large6
926 large6
927 $ cat sub2/large7
927 $ cat sub2/large7
928 large7
928 large7
929 $ hg log -qf sub2/large7
929 $ hg log -qf sub2/large7
930 7:daea875e9014
930 7:daea875e9014
931 $ hg log -Gqf sub2/large7
931 $ hg log -Gqf sub2/large7
932 @ 7:daea875e9014
932 @ 7:daea875e9014
933 |
933 |
934 $ cd ..
934 $ cd ..
935
935
936 Test log from outside repo
936 Test log from outside repo
937
937
938 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
938 $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n'
939 6:4355d653f84f edit files yet again
939 6:4355d653f84f edit files yet again
940 5:9d5af5072dbd edit files again
940 5:9d5af5072dbd edit files again
941 4:74c02385b94c move files
941 4:74c02385b94c move files
942 1:ce8896473775 edit files
942 1:ce8896473775 edit files
943 0:30d30fe6a5be add files
943 0:30d30fe6a5be add files
944
944
945 Test clone at revision
945 Test clone at revision
946
946
947 $ hg clone a -r 3 c
947 $ hg clone a -r 3 c
948 adding changesets
948 adding changesets
949 adding manifests
949 adding manifests
950 adding file changes
950 adding file changes
951 added 4 changesets with 10 changes to 4 files
951 added 4 changesets with 10 changes to 4 files
952 updating to branch default
952 updating to branch default
953 getting changed largefiles
953 getting changed largefiles
954 2 largefiles updated, 0 removed
954 2 largefiles updated, 0 removed
955 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
955 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
956 $ cd c
956 $ cd c
957 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
957 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
958 3:9e8fbc4bce62 copy files
958 3:9e8fbc4bce62 copy files
959 2:51a0ae4d5864 remove files
959 2:51a0ae4d5864 remove files
960 1:ce8896473775 edit files
960 1:ce8896473775 edit files
961 0:30d30fe6a5be add files
961 0:30d30fe6a5be add files
962 $ cat normal1
962 $ cat normal1
963 normal22
963 normal22
964 $ cat large1
964 $ cat large1
965 large22
965 large22
966 $ cat sub/normal2
966 $ cat sub/normal2
967 normal22
967 normal22
968 $ cat sub/large2
968 $ cat sub/large2
969 large22
969 large22
970
970
971 Old revisions of a clone have correct largefiles content (this also
971 Old revisions of a clone have correct largefiles content (this also
972 tests update).
972 tests update).
973
973
974 $ hg update -r 1
974 $ hg update -r 1
975 getting changed largefiles
975 getting changed largefiles
976 1 largefiles updated, 0 removed
976 1 largefiles updated, 0 removed
977 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
977 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
978 $ cat large1
978 $ cat large1
979 large11
979 large11
980 $ cat sub/large2
980 $ cat sub/large2
981 large22
981 large22
982 $ cd ..
982 $ cd ..
983
983
984 Test cloning with --all-largefiles flag
984 Test cloning with --all-largefiles flag
985
985
986 $ rm "${USERCACHE}"/*
986 $ rm "${USERCACHE}"/*
987 $ hg clone --all-largefiles a a-backup
987 $ hg clone --all-largefiles a a-backup
988 updating to branch default
988 updating to branch default
989 getting changed largefiles
989 getting changed largefiles
990 3 largefiles updated, 0 removed
990 3 largefiles updated, 0 removed
991 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
991 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
992 8 additional largefiles cached
992 8 additional largefiles cached
993
993
994 $ rm "${USERCACHE}"/*
994 $ rm "${USERCACHE}"/*
995 $ hg clone --all-largefiles -u 0 a a-clone0
995 $ hg clone --all-largefiles -u 0 a a-clone0
996 updating to branch default
996 updating to branch default
997 getting changed largefiles
997 getting changed largefiles
998 2 largefiles updated, 0 removed
998 2 largefiles updated, 0 removed
999 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
999 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1000 9 additional largefiles cached
1000 9 additional largefiles cached
1001 $ hg -R a-clone0 sum
1001 $ hg -R a-clone0 sum
1002 parent: 0:30d30fe6a5be
1002 parent: 0:30d30fe6a5be
1003 add files
1003 add files
1004 branch: default
1004 branch: default
1005 commit: (clean)
1005 commit: (clean)
1006 update: 7 new changesets (update)
1006 update: 7 new changesets (update)
1007 phases: 8 draft
1007 phases: 8 draft
1008
1008
1009 $ rm "${USERCACHE}"/*
1009 $ rm "${USERCACHE}"/*
1010 $ hg clone --all-largefiles -u 1 a a-clone1
1010 $ hg clone --all-largefiles -u 1 a a-clone1
1011 updating to branch default
1011 updating to branch default
1012 getting changed largefiles
1012 getting changed largefiles
1013 2 largefiles updated, 0 removed
1013 2 largefiles updated, 0 removed
1014 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1014 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1015 8 additional largefiles cached
1015 8 additional largefiles cached
1016 $ hg -R a-clone1 verify --large --lfa --lfc
1016 $ hg -R a-clone1 verify --large --lfa --lfc
1017 checking changesets
1017 checking changesets
1018 checking manifests
1018 checking manifests
1019 crosschecking files in changesets and manifests
1019 crosschecking files in changesets and manifests
1020 checking files
1020 checking files
1021 10 files, 8 changesets, 24 total revisions
1021 10 files, 8 changesets, 24 total revisions
1022 searching 8 changesets for largefiles
1022 searching 8 changesets for largefiles
1023 verified contents of 13 revisions of 6 largefiles
1023 verified contents of 13 revisions of 6 largefiles
1024 $ hg -R a-clone1 sum
1024 $ hg -R a-clone1 sum
1025 parent: 1:ce8896473775
1025 parent: 1:ce8896473775
1026 edit files
1026 edit files
1027 branch: default
1027 branch: default
1028 commit: (clean)
1028 commit: (clean)
1029 update: 6 new changesets (update)
1029 update: 6 new changesets (update)
1030 phases: 8 draft
1030 phases: 8 draft
1031
1031
1032 $ rm "${USERCACHE}"/*
1032 $ rm "${USERCACHE}"/*
1033 $ hg clone --all-largefiles -U a a-clone-u
1033 $ hg clone --all-largefiles -U a a-clone-u
1034 11 additional largefiles cached
1034 11 additional largefiles cached
1035 $ hg -R a-clone-u sum
1035 $ hg -R a-clone-u sum
1036 parent: -1:000000000000 (no revision checked out)
1036 parent: -1:000000000000 (no revision checked out)
1037 branch: default
1037 branch: default
1038 commit: (clean)
1038 commit: (clean)
1039 update: 8 new changesets (update)
1039 update: 8 new changesets (update)
1040 phases: 8 draft
1040 phases: 8 draft
1041
1041
1042 Show computed destination directory:
1042 Show computed destination directory:
1043
1043
1044 $ mkdir xyz
1044 $ mkdir xyz
1045 $ cd xyz
1045 $ cd xyz
1046 $ hg clone ../a
1046 $ hg clone ../a
1047 destination directory: a
1047 destination directory: a
1048 updating to branch default
1048 updating to branch default
1049 getting changed largefiles
1049 getting changed largefiles
1050 3 largefiles updated, 0 removed
1050 3 largefiles updated, 0 removed
1051 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1051 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1052 $ cd ..
1052 $ cd ..
1053
1053
1054 Clone URL without path:
1054 Clone URL without path:
1055
1055
1056 $ hg clone file://
1056 $ hg clone file://
1057 abort: repository / not found!
1057 abort: repository / not found!
1058 [255]
1058 [255]
1059
1059
1060 Ensure base clone command argument validation
1060 Ensure base clone command argument validation
1061
1061
1062 $ hg clone -U -u 0 a a-clone-failure
1062 $ hg clone -U -u 0 a a-clone-failure
1063 abort: cannot specify both --noupdate and --updaterev
1063 abort: cannot specify both --noupdate and --updaterev
1064 [255]
1064 [255]
1065
1065
1066 $ hg clone --all-largefiles a ssh://localhost/a
1066 $ hg clone --all-largefiles a ssh://localhost/a
1067 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1067 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
1068 [255]
1068 [255]
1069
1069
1070 Test pulling with --all-largefiles flag. Also test that the largefiles are
1070 Test pulling with --all-largefiles flag. Also test that the largefiles are
1071 downloaded from 'default' instead of 'default-push' when no source is specified
1071 downloaded from 'default' instead of 'default-push' when no source is specified
1072 (issue3584)
1072 (issue3584)
1073
1073
1074 $ rm -Rf a-backup
1074 $ rm -Rf a-backup
1075 $ hg clone -r 1 a a-backup
1075 $ hg clone -r 1 a a-backup
1076 adding changesets
1076 adding changesets
1077 adding manifests
1077 adding manifests
1078 adding file changes
1078 adding file changes
1079 added 2 changesets with 8 changes to 4 files
1079 added 2 changesets with 8 changes to 4 files
1080 updating to branch default
1080 updating to branch default
1081 getting changed largefiles
1081 getting changed largefiles
1082 2 largefiles updated, 0 removed
1082 2 largefiles updated, 0 removed
1083 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1083 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1084 $ rm "${USERCACHE}"/*
1084 $ rm "${USERCACHE}"/*
1085 $ cd a-backup
1085 $ cd a-backup
1086 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1086 $ hg pull --all-largefiles --config paths.default-push=bogus/path
1087 pulling from $TESTTMP/a (glob)
1087 pulling from $TESTTMP/a (glob)
1088 searching for changes
1088 searching for changes
1089 adding changesets
1089 adding changesets
1090 adding manifests
1090 adding manifests
1091 adding file changes
1091 adding file changes
1092 added 6 changesets with 16 changes to 8 files
1092 added 6 changesets with 16 changes to 8 files
1093 (run 'hg update' to get a working copy)
1093 (run 'hg update' to get a working copy)
1094 6 largefiles cached
1094 6 largefiles cached
1095
1095
1096 redo pull with --lfrev and check it pulls largefiles for the right revs
1096 redo pull with --lfrev and check it pulls largefiles for the right revs
1097
1097
1098 $ hg rollback
1098 $ hg rollback
1099 repository tip rolled back to revision 1 (undo pull)
1099 repository tip rolled back to revision 1 (undo pull)
1100 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1100 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
1101 pulling from $TESTTMP/a (glob)
1101 pulling from $TESTTMP/a (glob)
1102 searching for changes
1102 searching for changes
1103 all local heads known remotely
1103 all local heads known remotely
1104 6 changesets found
1104 6 changesets found
1105 uncompressed size of bundle content:
1105 uncompressed size of bundle content:
1106 1333 (changelog)
1106 1333 (changelog)
1107 1599 (manifests)
1107 1599 (manifests)
1108 254 .hglf/large1
1108 254 .hglf/large1
1109 564 .hglf/large3
1109 564 .hglf/large3
1110 572 .hglf/sub/large4
1110 572 .hglf/sub/large4
1111 182 .hglf/sub2/large6
1111 182 .hglf/sub2/large6
1112 182 .hglf/sub2/large7
1112 182 .hglf/sub2/large7
1113 212 normal1
1113 212 normal1
1114 457 normal3
1114 457 normal3
1115 465 sub/normal4
1115 465 sub/normal4
1116 adding changesets
1116 adding changesets
1117 adding manifests
1117 adding manifests
1118 adding file changes
1118 adding file changes
1119 added 6 changesets with 16 changes to 8 files
1119 added 6 changesets with 16 changes to 8 files
1120 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1120 calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles
1121 (run 'hg update' to get a working copy)
1121 (run 'hg update' to get a working copy)
1122 pulling largefiles for revision 7
1122 pulling largefiles for revision 7
1123 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1123 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
1124 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1124 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
1125 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1125 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
1126 pulling largefiles for revision 2
1126 pulling largefiles for revision 2
1127 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1127 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1128 0 largefiles cached
1128 0 largefiles cached
1129
1129
1130 lfpull
1130 lfpull
1131
1131
1132 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1132 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
1133 2 largefiles cached
1133 2 largefiles cached
1134 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1134 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
1135 pulling largefiles for revision 4
1135 pulling largefiles for revision 4
1136 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1136 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1137 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1137 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1138 pulling largefiles for revision 2
1138 pulling largefiles for revision 2
1139 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1139 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
1140 0 largefiles cached
1140 0 largefiles cached
1141
1141
1142 $ ls usercache-lfpull/* | sort
1142 $ ls usercache-lfpull/* | sort
1143 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1143 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
1144 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1144 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
1145
1145
1146 $ cd ..
1146 $ cd ..
1147
1147
1148 Rebasing between two repositories does not revert largefiles to old
1148 Rebasing between two repositories does not revert largefiles to old
1149 revisions (this was a very bad bug that took a lot of work to fix).
1149 revisions (this was a very bad bug that took a lot of work to fix).
1150
1150
1151 $ hg clone a d
1151 $ hg clone a d
1152 updating to branch default
1152 updating to branch default
1153 getting changed largefiles
1153 getting changed largefiles
1154 3 largefiles updated, 0 removed
1154 3 largefiles updated, 0 removed
1155 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1155 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1156 $ cd b
1156 $ cd b
1157 $ echo large4-modified > sub/large4
1157 $ echo large4-modified > sub/large4
1158 $ echo normal3-modified > normal3
1158 $ echo normal3-modified > normal3
1159 $ hg commit -m "modify normal file and largefile in repo b"
1159 $ hg commit -m "modify normal file and largefile in repo b"
1160 Invoking status precommit hook
1160 Invoking status precommit hook
1161 M normal3
1161 M normal3
1162 M sub/large4
1162 M sub/large4
1163 $ cd ../d
1163 $ cd ../d
1164 $ echo large6-modified > sub2/large6
1164 $ echo large6-modified > sub2/large6
1165 $ echo normal4-modified > sub/normal4
1165 $ echo normal4-modified > sub/normal4
1166 $ hg commit -m "modify normal file largefile in repo d"
1166 $ hg commit -m "modify normal file largefile in repo d"
1167 Invoking status precommit hook
1167 Invoking status precommit hook
1168 M sub/normal4
1168 M sub/normal4
1169 M sub2/large6
1169 M sub2/large6
1170 $ cd ..
1170 $ cd ..
1171 $ hg clone d e
1171 $ hg clone d e
1172 updating to branch default
1172 updating to branch default
1173 getting changed largefiles
1173 getting changed largefiles
1174 3 largefiles updated, 0 removed
1174 3 largefiles updated, 0 removed
1175 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1175 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1176 $ cd d
1176 $ cd d
1177
1177
1178 More rebase testing, but also test that the largefiles are downloaded from
1178 More rebase testing, but also test that the largefiles are downloaded from
1179 'default-push' when no source is specified (issue3584). (The largefile from the
1179 'default-push' when no source is specified (issue3584). (The largefile from the
1180 pulled revision is however not downloaded but found in the local cache.)
1180 pulled revision is however not downloaded but found in the local cache.)
1181 Largefiles are fetched for the new pulled revision, not for existing revisions,
1181 Largefiles are fetched for the new pulled revision, not for existing revisions,
1182 rebased or not.
1182 rebased or not.
1183
1183
1184 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1184 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1185 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1185 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
1186 pulling from $TESTTMP/b (glob)
1186 pulling from $TESTTMP/b (glob)
1187 searching for changes
1187 searching for changes
1188 adding changesets
1188 adding changesets
1189 adding manifests
1189 adding manifests
1190 adding file changes
1190 adding file changes
1191 added 1 changesets with 2 changes to 2 files (+1 heads)
1191 added 1 changesets with 2 changes to 2 files (+1 heads)
1192 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1192 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1193 Invoking status precommit hook
1193 Invoking status precommit hook
1194 M sub/normal4
1194 M sub/normal4
1195 M sub2/large6
1195 M sub2/large6
1196 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1196 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1197 0 largefiles cached
1197 0 largefiles cached
1198 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1198 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1199 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1199 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1200 9:598410d3eb9a modify normal file largefile in repo d
1200 9:598410d3eb9a modify normal file largefile in repo d
1201 8:a381d2c8c80e modify normal file and largefile in repo b
1201 8:a381d2c8c80e modify normal file and largefile in repo b
1202 7:daea875e9014 add/edit more largefiles
1202 7:daea875e9014 add/edit more largefiles
1203 6:4355d653f84f edit files yet again
1203 6:4355d653f84f edit files yet again
1204 5:9d5af5072dbd edit files again
1204 5:9d5af5072dbd edit files again
1205 4:74c02385b94c move files
1205 4:74c02385b94c move files
1206 3:9e8fbc4bce62 copy files
1206 3:9e8fbc4bce62 copy files
1207 2:51a0ae4d5864 remove files
1207 2:51a0ae4d5864 remove files
1208 1:ce8896473775 edit files
1208 1:ce8896473775 edit files
1209 0:30d30fe6a5be add files
1209 0:30d30fe6a5be add files
1210 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1210 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n'
1211 @ 9:598410d3eb9a modify normal file largefile in repo d
1211 @ 9:598410d3eb9a modify normal file largefile in repo d
1212 |
1212 |
1213 o 8:a381d2c8c80e modify normal file and largefile in repo b
1213 o 8:a381d2c8c80e modify normal file and largefile in repo b
1214 |
1214 |
1215 o 7:daea875e9014 add/edit more largefiles
1215 o 7:daea875e9014 add/edit more largefiles
1216 |
1216 |
1217 o 6:4355d653f84f edit files yet again
1217 o 6:4355d653f84f edit files yet again
1218 |
1218 |
1219 o 5:9d5af5072dbd edit files again
1219 o 5:9d5af5072dbd edit files again
1220 |
1220 |
1221 o 4:74c02385b94c move files
1221 o 4:74c02385b94c move files
1222 |
1222 |
1223 o 3:9e8fbc4bce62 copy files
1223 o 3:9e8fbc4bce62 copy files
1224 |
1224 |
1225 o 2:51a0ae4d5864 remove files
1225 o 2:51a0ae4d5864 remove files
1226 |
1226 |
1227 o 1:ce8896473775 edit files
1227 o 1:ce8896473775 edit files
1228 |
1228 |
1229 o 0:30d30fe6a5be add files
1229 o 0:30d30fe6a5be add files
1230
1230
1231 $ cat normal3
1231 $ cat normal3
1232 normal3-modified
1232 normal3-modified
1233 $ cat sub/normal4
1233 $ cat sub/normal4
1234 normal4-modified
1234 normal4-modified
1235 $ cat sub/large4
1235 $ cat sub/large4
1236 large4-modified
1236 large4-modified
1237 $ cat sub2/large6
1237 $ cat sub2/large6
1238 large6-modified
1238 large6-modified
1239 $ cat sub2/large7
1239 $ cat sub2/large7
1240 large7
1240 large7
1241 $ cd ../e
1241 $ cd ../e
1242 $ hg pull ../b
1242 $ hg pull ../b
1243 pulling from ../b
1243 pulling from ../b
1244 searching for changes
1244 searching for changes
1245 adding changesets
1245 adding changesets
1246 adding manifests
1246 adding manifests
1247 adding file changes
1247 adding file changes
1248 added 1 changesets with 2 changes to 2 files (+1 heads)
1248 added 1 changesets with 2 changes to 2 files (+1 heads)
1249 (run 'hg heads' to see heads, 'hg merge' to merge)
1249 (run 'hg heads' to see heads, 'hg merge' to merge)
1250 $ hg rebase
1250 $ hg rebase
1251 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1251 rebasing 8:f574fb32bb45 "modify normal file largefile in repo d"
1252 Invoking status precommit hook
1252 Invoking status precommit hook
1253 M sub/normal4
1253 M sub/normal4
1254 M sub2/large6
1254 M sub2/large6
1255 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1255 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-backup.hg (glob)
1256 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1256 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1257 9:598410d3eb9a modify normal file largefile in repo d
1257 9:598410d3eb9a modify normal file largefile in repo d
1258 8:a381d2c8c80e modify normal file and largefile in repo b
1258 8:a381d2c8c80e modify normal file and largefile in repo b
1259 7:daea875e9014 add/edit more largefiles
1259 7:daea875e9014 add/edit more largefiles
1260 6:4355d653f84f edit files yet again
1260 6:4355d653f84f edit files yet again
1261 5:9d5af5072dbd edit files again
1261 5:9d5af5072dbd edit files again
1262 4:74c02385b94c move files
1262 4:74c02385b94c move files
1263 3:9e8fbc4bce62 copy files
1263 3:9e8fbc4bce62 copy files
1264 2:51a0ae4d5864 remove files
1264 2:51a0ae4d5864 remove files
1265 1:ce8896473775 edit files
1265 1:ce8896473775 edit files
1266 0:30d30fe6a5be add files
1266 0:30d30fe6a5be add files
1267 $ cat normal3
1267 $ cat normal3
1268 normal3-modified
1268 normal3-modified
1269 $ cat sub/normal4
1269 $ cat sub/normal4
1270 normal4-modified
1270 normal4-modified
1271 $ cat sub/large4
1271 $ cat sub/large4
1272 large4-modified
1272 large4-modified
1273 $ cat sub2/large6
1273 $ cat sub2/large6
1274 large6-modified
1274 large6-modified
1275 $ cat sub2/large7
1275 $ cat sub2/large7
1276 large7
1276 large7
1277
1277
1278 Log on largefiles
1278 Log on largefiles
1279
1279
1280 - same output
1280 - same output
1281 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1281 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1282 8:a381d2c8c80e modify normal file and largefile in repo b
1282 8:a381d2c8c80e modify normal file and largefile in repo b
1283 6:4355d653f84f edit files yet again
1283 6:4355d653f84f edit files yet again
1284 5:9d5af5072dbd edit files again
1284 5:9d5af5072dbd edit files again
1285 4:74c02385b94c move files
1285 4:74c02385b94c move files
1286 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1286 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1287 o 8:a381d2c8c80e modify normal file and largefile in repo b
1287 o 8:a381d2c8c80e modify normal file and largefile in repo b
1288 |
1288 |
1289 o 6:4355d653f84f edit files yet again
1289 o 6:4355d653f84f edit files yet again
1290 |
1290 |
1291 o 5:9d5af5072dbd edit files again
1291 o 5:9d5af5072dbd edit files again
1292 |
1292 |
1293 o 4:74c02385b94c move files
1293 o 4:74c02385b94c move files
1294 |
1294 |
1295 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1295 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1296 8:a381d2c8c80e modify normal file and largefile in repo b
1296 8:a381d2c8c80e modify normal file and largefile in repo b
1297 6:4355d653f84f edit files yet again
1297 6:4355d653f84f edit files yet again
1298 5:9d5af5072dbd edit files again
1298 5:9d5af5072dbd edit files again
1299 4:74c02385b94c move files
1299 4:74c02385b94c move files
1300 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1300 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1301 o 8:a381d2c8c80e modify normal file and largefile in repo b
1301 o 8:a381d2c8c80e modify normal file and largefile in repo b
1302 |
1302 |
1303 o 6:4355d653f84f edit files yet again
1303 o 6:4355d653f84f edit files yet again
1304 |
1304 |
1305 o 5:9d5af5072dbd edit files again
1305 o 5:9d5af5072dbd edit files again
1306 |
1306 |
1307 o 4:74c02385b94c move files
1307 o 4:74c02385b94c move files
1308 |
1308 |
1309
1309
1310 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1310 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1311 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1311 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1312 8:a381d2c8c80e modify normal file and largefile in repo b
1312 8:a381d2c8c80e modify normal file and largefile in repo b
1313 6:4355d653f84f edit files yet again
1313 6:4355d653f84f edit files yet again
1314 5:9d5af5072dbd edit files again
1314 5:9d5af5072dbd edit files again
1315 4:74c02385b94c move files
1315 4:74c02385b94c move files
1316 1:ce8896473775 edit files
1316 1:ce8896473775 edit files
1317 0:30d30fe6a5be add files
1317 0:30d30fe6a5be add files
1318 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1318 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1319 o 8:a381d2c8c80e modify normal file and largefile in repo b
1319 o 8:a381d2c8c80e modify normal file and largefile in repo b
1320 |
1320 |
1321 o 6:4355d653f84f edit files yet again
1321 o 6:4355d653f84f edit files yet again
1322 |
1322 |
1323 o 5:9d5af5072dbd edit files again
1323 o 5:9d5af5072dbd edit files again
1324 |
1324 |
1325 o 4:74c02385b94c move files
1325 o 4:74c02385b94c move files
1326 |
1326 |
1327 o 1:ce8896473775 edit files
1327 o 1:ce8896473775 edit files
1328 |
1328 |
1329 o 0:30d30fe6a5be add files
1329 o 0:30d30fe6a5be add files
1330
1330
1331 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1331 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1332 9:598410d3eb9a modify normal file largefile in repo d
1332 9:598410d3eb9a modify normal file largefile in repo d
1333 8:a381d2c8c80e modify normal file and largefile in repo b
1333 8:a381d2c8c80e modify normal file and largefile in repo b
1334 6:4355d653f84f edit files yet again
1334 6:4355d653f84f edit files yet again
1335 5:9d5af5072dbd edit files again
1335 5:9d5af5072dbd edit files again
1336 4:74c02385b94c move files
1336 4:74c02385b94c move files
1337 1:ce8896473775 edit files
1337 1:ce8896473775 edit files
1338 0:30d30fe6a5be add files
1338 0:30d30fe6a5be add files
1339 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1339 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub
1340 @ 9:598410d3eb9a modify normal file largefile in repo d
1340 @ 9:598410d3eb9a modify normal file largefile in repo d
1341 |
1341 |
1342 o 8:a381d2c8c80e modify normal file and largefile in repo b
1342 o 8:a381d2c8c80e modify normal file and largefile in repo b
1343 |
1343 |
1344 o 6:4355d653f84f edit files yet again
1344 o 6:4355d653f84f edit files yet again
1345 |
1345 |
1346 o 5:9d5af5072dbd edit files again
1346 o 5:9d5af5072dbd edit files again
1347 |
1347 |
1348 o 4:74c02385b94c move files
1348 o 4:74c02385b94c move files
1349 |
1349 |
1350 o 1:ce8896473775 edit files
1350 o 1:ce8896473775 edit files
1351 |
1351 |
1352 o 0:30d30fe6a5be add files
1352 o 0:30d30fe6a5be add files
1353
1353
1354 - globbing gives same result
1354 - globbing gives same result
1355 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1355 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1356 9:598410d3eb9a modify normal file largefile in repo d
1356 9:598410d3eb9a modify normal file largefile in repo d
1357 8:a381d2c8c80e modify normal file and largefile in repo b
1357 8:a381d2c8c80e modify normal file and largefile in repo b
1358 6:4355d653f84f edit files yet again
1358 6:4355d653f84f edit files yet again
1359 5:9d5af5072dbd edit files again
1359 5:9d5af5072dbd edit files again
1360 4:74c02385b94c move files
1360 4:74c02385b94c move files
1361 1:ce8896473775 edit files
1361 1:ce8896473775 edit files
1362 0:30d30fe6a5be add files
1362 0:30d30fe6a5be add files
1363 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1363 $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1364 @ 9:598410d3eb9a modify normal file largefile in repo d
1364 @ 9:598410d3eb9a modify normal file largefile in repo d
1365 |
1365 |
1366 o 8:a381d2c8c80e modify normal file and largefile in repo b
1366 o 8:a381d2c8c80e modify normal file and largefile in repo b
1367 |
1367 |
1368 o 6:4355d653f84f edit files yet again
1368 o 6:4355d653f84f edit files yet again
1369 |
1369 |
1370 o 5:9d5af5072dbd edit files again
1370 o 5:9d5af5072dbd edit files again
1371 |
1371 |
1372 o 4:74c02385b94c move files
1372 o 4:74c02385b94c move files
1373 |
1373 |
1374 o 1:ce8896473775 edit files
1374 o 1:ce8896473775 edit files
1375 |
1375 |
1376 o 0:30d30fe6a5be add files
1376 o 0:30d30fe6a5be add files
1377
1377
1378 Rollback on largefiles.
1378 Rollback on largefiles.
1379
1379
1380 $ echo large4-modified-again > sub/large4
1380 $ echo large4-modified-again > sub/large4
1381 $ hg commit -m "Modify large4 again"
1381 $ hg commit -m "Modify large4 again"
1382 Invoking status precommit hook
1382 Invoking status precommit hook
1383 M sub/large4
1383 M sub/large4
1384 $ hg rollback
1384 $ hg rollback
1385 repository tip rolled back to revision 9 (undo commit)
1385 repository tip rolled back to revision 9 (undo commit)
1386 working directory now based on revision 9
1386 working directory now based on revision 9
1387 $ hg st
1387 $ hg st
1388 M sub/large4
1388 M sub/large4
1389 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1389 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1390 9:598410d3eb9a modify normal file largefile in repo d
1390 9:598410d3eb9a modify normal file largefile in repo d
1391 8:a381d2c8c80e modify normal file and largefile in repo b
1391 8:a381d2c8c80e modify normal file and largefile in repo b
1392 7:daea875e9014 add/edit more largefiles
1392 7:daea875e9014 add/edit more largefiles
1393 6:4355d653f84f edit files yet again
1393 6:4355d653f84f edit files yet again
1394 5:9d5af5072dbd edit files again
1394 5:9d5af5072dbd edit files again
1395 4:74c02385b94c move files
1395 4:74c02385b94c move files
1396 3:9e8fbc4bce62 copy files
1396 3:9e8fbc4bce62 copy files
1397 2:51a0ae4d5864 remove files
1397 2:51a0ae4d5864 remove files
1398 1:ce8896473775 edit files
1398 1:ce8896473775 edit files
1399 0:30d30fe6a5be add files
1399 0:30d30fe6a5be add files
1400 $ cat sub/large4
1400 $ cat sub/large4
1401 large4-modified-again
1401 large4-modified-again
1402
1402
1403 "update --check" refuses to update with uncommitted changes.
1403 "update --check" refuses to update with uncommitted changes.
1404 $ hg update --check 8
1404 $ hg update --check 8
1405 abort: uncommitted changes
1405 abort: uncommitted changes
1406 [255]
1406 [255]
1407
1407
1408 "update --clean" leaves correct largefiles in working copy, even when there is
1408 "update --clean" leaves correct largefiles in working copy, even when there is
1409 .orig files from revert in .hglf.
1409 .orig files from revert in .hglf.
1410
1410
1411 $ echo mistake > sub2/large7
1411 $ echo mistake > sub2/large7
1412 $ hg revert sub2/large7
1412 $ hg revert sub2/large7
1413 $ cat sub2/large7
1413 $ cat sub2/large7
1414 large7
1414 large7
1415 $ cat sub2/large7.orig
1415 $ cat sub2/large7.orig
1416 mistake
1416 mistake
1417 $ test ! -f .hglf/sub2/large7.orig
1417 $ test ! -f .hglf/sub2/large7.orig
1418
1418
1419 $ hg -q update --clean -r null
1419 $ hg -q update --clean -r null
1420 $ hg update --clean
1420 $ hg update --clean
1421 getting changed largefiles
1421 getting changed largefiles
1422 3 largefiles updated, 0 removed
1422 3 largefiles updated, 0 removed
1423 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1423 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1424 $ cat normal3
1424 $ cat normal3
1425 normal3-modified
1425 normal3-modified
1426 $ cat sub/normal4
1426 $ cat sub/normal4
1427 normal4-modified
1427 normal4-modified
1428 $ cat sub/large4
1428 $ cat sub/large4
1429 large4-modified
1429 large4-modified
1430 $ cat sub2/large6
1430 $ cat sub2/large6
1431 large6-modified
1431 large6-modified
1432 $ cat sub2/large7
1432 $ cat sub2/large7
1433 large7
1433 large7
1434 $ cat sub2/large7.orig
1434 $ cat sub2/large7.orig
1435 mistake
1435 mistake
1436 $ test ! -f .hglf/sub2/large7.orig
1436 $ test ! -f .hglf/sub2/large7.orig
1437
1437
1438 verify that largefile .orig file no longer is overwritten on every update -C:
1438 verify that largefile .orig file no longer is overwritten on every update -C:
1439 $ hg update --clean
1439 $ hg update --clean
1440 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1440 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1441 $ cat sub2/large7.orig
1441 $ cat sub2/large7.orig
1442 mistake
1442 mistake
1443 $ rm sub2/large7.orig
1443 $ rm sub2/large7.orig
1444
1444
1445 Now "update check" is happy.
1445 Now "update check" is happy.
1446 $ hg update --check 8
1446 $ hg update --check 8
1447 getting changed largefiles
1447 getting changed largefiles
1448 1 largefiles updated, 0 removed
1448 1 largefiles updated, 0 removed
1449 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1449 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1450 $ hg update --check
1450 $ hg update --check
1451 getting changed largefiles
1451 getting changed largefiles
1452 1 largefiles updated, 0 removed
1452 1 largefiles updated, 0 removed
1453 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1453 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1454
1454
1455 Test removing empty largefiles directories on update
1455 Test removing empty largefiles directories on update
1456 $ test -d sub2 && echo "sub2 exists"
1456 $ test -d sub2 && echo "sub2 exists"
1457 sub2 exists
1457 sub2 exists
1458 $ hg update -q null
1458 $ hg update -q null
1459 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1459 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1460 [1]
1460 [1]
1461 $ hg update -q
1461 $ hg update -q
1462
1462
1463 Test hg remove removes empty largefiles directories
1463 Test hg remove removes empty largefiles directories
1464 $ test -d sub2 && echo "sub2 exists"
1464 $ test -d sub2 && echo "sub2 exists"
1465 sub2 exists
1465 sub2 exists
1466 $ hg remove sub2/*
1466 $ hg remove sub2/*
1467 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1467 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1468 [1]
1468 [1]
1469 $ hg revert sub2/large6 sub2/large7
1469 $ hg revert sub2/large6 sub2/large7
1470
1470
1471 "revert" works on largefiles (and normal files too).
1471 "revert" works on largefiles (and normal files too).
1472 $ echo hack3 >> normal3
1472 $ echo hack3 >> normal3
1473 $ echo hack4 >> sub/normal4
1473 $ echo hack4 >> sub/normal4
1474 $ echo hack4 >> sub/large4
1474 $ echo hack4 >> sub/large4
1475 $ rm sub2/large6
1475 $ rm sub2/large6
1476 $ hg revert sub2/large6
1476 $ hg revert sub2/large6
1477 $ hg rm sub2/large6
1477 $ hg rm sub2/large6
1478 $ echo new >> sub2/large8
1478 $ echo new >> sub2/large8
1479 $ hg add --large sub2/large8
1479 $ hg add --large sub2/large8
1480 # XXX we don't really want to report that we're reverting the standin;
1480 # XXX we don't really want to report that we're reverting the standin;
1481 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1481 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1482 $ hg revert sub
1482 $ hg revert sub
1483 reverting .hglf/sub/large4 (glob)
1483 reverting .hglf/sub/large4 (glob)
1484 reverting sub/normal4 (glob)
1484 reverting sub/normal4 (glob)
1485 $ hg status
1485 $ hg status
1486 M normal3
1486 M normal3
1487 A sub2/large8
1487 A sub2/large8
1488 R sub2/large6
1488 R sub2/large6
1489 ? sub/large4.orig
1489 ? sub/large4.orig
1490 ? sub/normal4.orig
1490 ? sub/normal4.orig
1491 $ cat sub/normal4
1491 $ cat sub/normal4
1492 normal4-modified
1492 normal4-modified
1493 $ cat sub/large4
1493 $ cat sub/large4
1494 large4-modified
1494 large4-modified
1495 $ hg revert -a --no-backup
1495 $ hg revert -a --no-backup
1496 undeleting .hglf/sub2/large6 (glob)
1496 undeleting .hglf/sub2/large6 (glob)
1497 forgetting .hglf/sub2/large8 (glob)
1497 forgetting .hglf/sub2/large8 (glob)
1498 reverting normal3
1498 reverting normal3
1499 $ hg status
1499 $ hg status
1500 ? sub/large4.orig
1500 ? sub/large4.orig
1501 ? sub/normal4.orig
1501 ? sub/normal4.orig
1502 ? sub2/large8
1502 ? sub2/large8
1503 $ cat normal3
1503 $ cat normal3
1504 normal3-modified
1504 normal3-modified
1505 $ cat sub2/large6
1505 $ cat sub2/large6
1506 large6-modified
1506 large6-modified
1507 $ rm sub/*.orig sub2/large8
1507 $ rm sub/*.orig sub2/large8
1508
1508
1509 revert some files to an older revision
1509 revert some files to an older revision
1510 $ hg revert --no-backup -r 8 sub2
1510 $ hg revert --no-backup -r 8 sub2
1511 reverting .hglf/sub2/large6 (glob)
1511 reverting .hglf/sub2/large6 (glob)
1512 $ cat sub2/large6
1512 $ cat sub2/large6
1513 large6
1513 large6
1514 $ hg revert --no-backup -C -r '.^' sub2
1514 $ hg revert --no-backup -C -r '.^' sub2
1515 $ hg revert --no-backup sub2
1515 $ hg revert --no-backup sub2
1516 reverting .hglf/sub2/large6 (glob)
1516 reverting .hglf/sub2/large6 (glob)
1517 $ hg status
1517 $ hg status
1518
1518
1519 "verify --large" actually verifies largefiles
1519 "verify --large" actually verifies largefiles
1520
1520
1521 - Where Do We Come From? What Are We? Where Are We Going?
1521 - Where Do We Come From? What Are We? Where Are We Going?
1522 $ pwd
1522 $ pwd
1523 $TESTTMP/e
1523 $TESTTMP/e
1524 $ hg paths
1524 $ hg paths
1525 default = $TESTTMP/d (glob)
1525 default = $TESTTMP/d (glob)
1526
1526
1527 $ hg verify --large
1527 $ hg verify --large
1528 checking changesets
1528 checking changesets
1529 checking manifests
1529 checking manifests
1530 crosschecking files in changesets and manifests
1530 crosschecking files in changesets and manifests
1531 checking files
1531 checking files
1532 10 files, 10 changesets, 28 total revisions
1532 10 files, 10 changesets, 28 total revisions
1533 searching 1 changesets for largefiles
1533 searching 1 changesets for largefiles
1534 verified existence of 3 revisions of 3 largefiles
1534 verified existence of 3 revisions of 3 largefiles
1535
1535
1536 - introduce missing blob in local store repo and make sure that this is caught:
1536 - introduce missing blob in local store repo and make sure that this is caught:
1537 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1537 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1538 $ hg verify --large
1538 $ hg verify --large
1539 checking changesets
1539 checking changesets
1540 checking manifests
1540 checking manifests
1541 crosschecking files in changesets and manifests
1541 crosschecking files in changesets and manifests
1542 checking files
1542 checking files
1543 10 files, 10 changesets, 28 total revisions
1543 10 files, 10 changesets, 28 total revisions
1544 searching 1 changesets for largefiles
1544 searching 1 changesets for largefiles
1545 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1545 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1546 verified existence of 3 revisions of 3 largefiles
1546 verified existence of 3 revisions of 3 largefiles
1547 [1]
1547 [1]
1548
1548
1549 - introduce corruption and make sure that it is caught when checking content:
1549 - introduce corruption and make sure that it is caught when checking content:
1550 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1550 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1551 $ hg verify -q --large --lfc
1551 $ hg verify -q --large --lfc
1552 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1552 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1553 [1]
1553 [1]
1554
1554
1555 - cleanup
1555 - cleanup
1556 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1556 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1557
1557
1558 - verifying all revisions will fail because we didn't clone all largefiles to d:
1558 - verifying all revisions will fail because we didn't clone all largefiles to d:
1559 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1559 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1560 $ hg verify -q --lfa --lfc
1560 $ hg verify -q --lfa --lfc
1561 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1561 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1562 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1562 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1563 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1563 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1564 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1564 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1565 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1565 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1566 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1566 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1567 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1567 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1568 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1568 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1569 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1569 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1570 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1570 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1571 [1]
1571 [1]
1572
1572
1573 - cleanup
1573 - cleanup
1574 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1574 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1575 $ rm -f .hglf/sub/*.orig
1575 $ rm -f .hglf/sub/*.orig
1576
1576
1577 Update to revision with missing largefile - and make sure it really is missing
1577 Update to revision with missing largefile - and make sure it really is missing
1578
1578
1579 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1579 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1580 $ hg up -r 6
1580 $ hg up -r 6
1581 getting changed largefiles
1581 getting changed largefiles
1582 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1582 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1583 1 largefiles updated, 2 removed
1583 1 largefiles updated, 2 removed
1584 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1584 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1585 $ rm normal3
1585 $ rm normal3
1586 $ echo >> sub/normal4
1586 $ echo >> sub/normal4
1587 $ hg ci -m 'commit with missing files'
1587 $ hg ci -m 'commit with missing files'
1588 Invoking status precommit hook
1588 Invoking status precommit hook
1589 M sub/normal4
1589 M sub/normal4
1590 ! large3
1590 ! large3
1591 ! normal3
1591 ! normal3
1592 created new head
1592 created new head
1593 $ hg st
1593 $ hg st
1594 ! large3
1594 ! large3
1595 ! normal3
1595 ! normal3
1596 $ hg up -r.
1596 $ hg up -r.
1597 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1597 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1598 $ hg st
1598 $ hg st
1599 ! large3
1599 ! large3
1600 ! normal3
1600 ! normal3
1601 $ hg up -Cr.
1601 $ hg up -Cr.
1602 getting changed largefiles
1602 getting changed largefiles
1603 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1603 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1604 0 largefiles updated, 0 removed
1604 0 largefiles updated, 0 removed
1605 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1605 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1606 $ hg st
1606 $ hg st
1607 ! large3
1607 ! large3
1608 $ hg rollback
1608 $ hg rollback
1609 repository tip rolled back to revision 9 (undo commit)
1609 repository tip rolled back to revision 9 (undo commit)
1610 working directory now based on revision 6
1610 working directory now based on revision 6
1611
1611
1612 Merge with revision with missing largefile - and make sure it tries to fetch it.
1612 Merge with revision with missing largefile - and make sure it tries to fetch it.
1613
1613
1614 $ hg up -Cqr null
1614 $ hg up -Cqr null
1615 $ echo f > f
1615 $ echo f > f
1616 $ hg ci -Am branch
1616 $ hg ci -Am branch
1617 adding f
1617 adding f
1618 Invoking status precommit hook
1618 Invoking status precommit hook
1619 A f
1619 A f
1620 created new head
1620 created new head
1621 $ hg merge -r 6
1621 $ hg merge -r 6
1622 getting changed largefiles
1622 getting changed largefiles
1623 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1623 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob)
1624 1 largefiles updated, 0 removed
1624 1 largefiles updated, 0 removed
1625 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1625 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1626 (branch merge, don't forget to commit)
1626 (branch merge, don't forget to commit)
1627
1627
1628 $ hg rollback -q
1628 $ hg rollback -q
1629 $ hg up -Cq
1629 $ hg up -Cq
1630
1630
1631 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1631 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1632
1632
1633 $ hg pull --all-largefiles
1633 $ hg pull --all-largefiles
1634 pulling from $TESTTMP/d (glob)
1634 pulling from $TESTTMP/d (glob)
1635 searching for changes
1635 searching for changes
1636 no changes found
1636 no changes found
1637
1637
1638 Merging does not revert to old versions of largefiles and also check
1638 Merging does not revert to old versions of largefiles and also check
1639 that merging after having pulled from a non-default remote works
1639 that merging after having pulled from a non-default remote works
1640 correctly.
1640 correctly.
1641
1641
1642 $ cd ..
1642 $ cd ..
1643 $ hg clone -r 7 e temp
1643 $ hg clone -r 7 e temp
1644 adding changesets
1644 adding changesets
1645 adding manifests
1645 adding manifests
1646 adding file changes
1646 adding file changes
1647 added 8 changesets with 24 changes to 10 files
1647 added 8 changesets with 24 changes to 10 files
1648 updating to branch default
1648 updating to branch default
1649 getting changed largefiles
1649 getting changed largefiles
1650 3 largefiles updated, 0 removed
1650 3 largefiles updated, 0 removed
1651 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1651 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1652 $ hg clone temp f
1652 $ hg clone temp f
1653 updating to branch default
1653 updating to branch default
1654 getting changed largefiles
1654 getting changed largefiles
1655 3 largefiles updated, 0 removed
1655 3 largefiles updated, 0 removed
1656 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1656 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1657 # Delete the largefiles in the largefiles system cache so that we have an
1657 # Delete the largefiles in the largefiles system cache so that we have an
1658 # opportunity to test that caching after a pull works.
1658 # opportunity to test that caching after a pull works.
1659 $ rm "${USERCACHE}"/*
1659 $ rm "${USERCACHE}"/*
1660 $ cd f
1660 $ cd f
1661 $ echo "large4-merge-test" > sub/large4
1661 $ echo "large4-merge-test" > sub/large4
1662 $ hg commit -m "Modify large4 to test merge"
1662 $ hg commit -m "Modify large4 to test merge"
1663 Invoking status precommit hook
1663 Invoking status precommit hook
1664 M sub/large4
1664 M sub/large4
1665 # Test --cache-largefiles flag
1665 # Test --cache-largefiles flag
1666 $ hg pull --lfrev 'heads(pulled())' ../e
1666 $ hg pull --lfrev 'heads(pulled())' ../e
1667 pulling from ../e
1667 pulling from ../e
1668 searching for changes
1668 searching for changes
1669 adding changesets
1669 adding changesets
1670 adding manifests
1670 adding manifests
1671 adding file changes
1671 adding file changes
1672 added 2 changesets with 4 changes to 4 files (+1 heads)
1672 added 2 changesets with 4 changes to 4 files (+1 heads)
1673 (run 'hg heads' to see heads, 'hg merge' to merge)
1673 (run 'hg heads' to see heads, 'hg merge' to merge)
1674 2 largefiles cached
1674 2 largefiles cached
1675 $ hg merge
1675 $ hg merge
1676 largefile sub/large4 has a merge conflict
1676 largefile sub/large4 has a merge conflict
1677 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1677 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1678 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1678 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1679 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1679 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1680 getting changed largefiles
1680 getting changed largefiles
1681 1 largefiles updated, 0 removed
1681 1 largefiles updated, 0 removed
1682 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1682 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1683 (branch merge, don't forget to commit)
1683 (branch merge, don't forget to commit)
1684 $ hg commit -m "Merge repos e and f"
1684 $ hg commit -m "Merge repos e and f"
1685 Invoking status precommit hook
1685 Invoking status precommit hook
1686 M normal3
1686 M normal3
1687 M sub/normal4
1687 M sub/normal4
1688 M sub2/large6
1688 M sub2/large6
1689 $ cat normal3
1689 $ cat normal3
1690 normal3-modified
1690 normal3-modified
1691 $ cat sub/normal4
1691 $ cat sub/normal4
1692 normal4-modified
1692 normal4-modified
1693 $ cat sub/large4
1693 $ cat sub/large4
1694 large4-merge-test
1694 large4-merge-test
1695 $ cat sub2/large6
1695 $ cat sub2/large6
1696 large6-modified
1696 large6-modified
1697 $ cat sub2/large7
1697 $ cat sub2/large7
1698 large7
1698 large7
1699
1699
1700 Test status after merging with a branch that introduces a new largefile:
1700 Test status after merging with a branch that introduces a new largefile:
1701
1701
1702 $ echo large > large
1702 $ echo large > large
1703 $ hg add --large large
1703 $ hg add --large large
1704 $ hg commit -m 'add largefile'
1704 $ hg commit -m 'add largefile'
1705 Invoking status precommit hook
1705 Invoking status precommit hook
1706 A large
1706 A large
1707 $ hg update -q ".^"
1707 $ hg update -q ".^"
1708 $ echo change >> normal3
1708 $ echo change >> normal3
1709 $ hg commit -m 'some change'
1709 $ hg commit -m 'some change'
1710 Invoking status precommit hook
1710 Invoking status precommit hook
1711 M normal3
1711 M normal3
1712 created new head
1712 created new head
1713 $ hg merge
1713 $ hg merge
1714 getting changed largefiles
1714 getting changed largefiles
1715 1 largefiles updated, 0 removed
1715 1 largefiles updated, 0 removed
1716 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1716 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1717 (branch merge, don't forget to commit)
1717 (branch merge, don't forget to commit)
1718 $ hg status
1718 $ hg status
1719 M large
1719 M large
1720
1720
1721 - make sure update of merge with removed largefiles fails as expected
1721 - make sure update of merge with removed largefiles fails as expected
1722 $ hg rm sub2/large6
1722 $ hg rm sub2/large6
1723 $ hg up -r.
1723 $ hg up -r.
1724 abort: outstanding uncommitted merge
1724 abort: outstanding uncommitted merge
1725 [255]
1725 [255]
1726
1726
1727 - revert should be able to revert files introduced in a pending merge
1727 - revert should be able to revert files introduced in a pending merge
1728 $ hg revert --all -r .
1728 $ hg revert --all -r .
1729 removing .hglf/large (glob)
1729 removing .hglf/large (glob)
1730 undeleting .hglf/sub2/large6 (glob)
1730 undeleting .hglf/sub2/large6 (glob)
1731
1731
1732 Test that a normal file and a largefile with the same name and path cannot
1732 Test that a normal file and a largefile with the same name and path cannot
1733 coexist.
1733 coexist.
1734
1734
1735 $ rm sub2/large7
1735 $ rm sub2/large7
1736 $ echo "largeasnormal" > sub2/large7
1736 $ echo "largeasnormal" > sub2/large7
1737 $ hg add sub2/large7
1737 $ hg add sub2/large7
1738 sub2/large7 already a largefile (glob)
1738 sub2/large7 already a largefile (glob)
1739
1739
1740 Test that transplanting a largefile change works correctly.
1740 Test that transplanting a largefile change works correctly.
1741
1741
1742 $ cd ..
1742 $ cd ..
1743 $ hg clone -r 8 d g
1743 $ hg clone -r 8 d g
1744 adding changesets
1744 adding changesets
1745 adding manifests
1745 adding manifests
1746 adding file changes
1746 adding file changes
1747 added 9 changesets with 26 changes to 10 files
1747 added 9 changesets with 26 changes to 10 files
1748 updating to branch default
1748 updating to branch default
1749 getting changed largefiles
1749 getting changed largefiles
1750 3 largefiles updated, 0 removed
1750 3 largefiles updated, 0 removed
1751 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1751 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1752 $ cd g
1752 $ cd g
1753 $ hg transplant -s ../d 598410d3eb9a
1753 $ hg transplant -s ../d 598410d3eb9a
1754 searching for changes
1754 searching for changes
1755 searching for changes
1755 searching for changes
1756 adding changesets
1756 adding changesets
1757 adding manifests
1757 adding manifests
1758 adding file changes
1758 adding file changes
1759 added 1 changesets with 2 changes to 2 files
1759 added 1 changesets with 2 changes to 2 files
1760 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1760 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1761 9:598410d3eb9a modify normal file largefile in repo d
1761 9:598410d3eb9a modify normal file largefile in repo d
1762 8:a381d2c8c80e modify normal file and largefile in repo b
1762 8:a381d2c8c80e modify normal file and largefile in repo b
1763 7:daea875e9014 add/edit more largefiles
1763 7:daea875e9014 add/edit more largefiles
1764 6:4355d653f84f edit files yet again
1764 6:4355d653f84f edit files yet again
1765 5:9d5af5072dbd edit files again
1765 5:9d5af5072dbd edit files again
1766 4:74c02385b94c move files
1766 4:74c02385b94c move files
1767 3:9e8fbc4bce62 copy files
1767 3:9e8fbc4bce62 copy files
1768 2:51a0ae4d5864 remove files
1768 2:51a0ae4d5864 remove files
1769 1:ce8896473775 edit files
1769 1:ce8896473775 edit files
1770 0:30d30fe6a5be add files
1770 0:30d30fe6a5be add files
1771 $ cat normal3
1771 $ cat normal3
1772 normal3-modified
1772 normal3-modified
1773 $ cat sub/normal4
1773 $ cat sub/normal4
1774 normal4-modified
1774 normal4-modified
1775 $ cat sub/large4
1775 $ cat sub/large4
1776 large4-modified
1776 large4-modified
1777 $ cat sub2/large6
1777 $ cat sub2/large6
1778 large6-modified
1778 large6-modified
1779 $ cat sub2/large7
1779 $ cat sub2/large7
1780 large7
1780 large7
1781
1781
1782 Cat a largefile
1782 Cat a largefile
1783 $ hg cat normal3
1783 $ hg cat normal3
1784 normal3-modified
1784 normal3-modified
1785 $ hg cat sub/large4
1785 $ hg cat sub/large4
1786 large4-modified
1786 large4-modified
1787 $ rm "${USERCACHE}"/*
1787 $ rm "${USERCACHE}"/*
1788 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1788 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1789 $ cat cat.out
1789 $ cat cat.out
1790 large4-modified
1790 large4-modified
1791 $ rm cat.out
1791 $ rm cat.out
1792 $ hg cat -r a381d2c8c80e normal3
1792 $ hg cat -r a381d2c8c80e normal3
1793 normal3-modified
1793 normal3-modified
1794 $ hg cat -r '.^' normal3
1794 $ hg cat -r '.^' normal3
1795 normal3-modified
1795 normal3-modified
1796 $ hg cat -r '.^' sub/large4 doesntexist
1796 $ hg cat -r '.^' sub/large4 doesntexist
1797 large4-modified
1797 large4-modified
1798 doesntexist: no such file in rev a381d2c8c80e
1798 doesntexist: no such file in rev a381d2c8c80e
1799 $ hg --cwd sub cat -r '.^' large4
1799 $ hg --cwd sub cat -r '.^' large4
1800 large4-modified
1800 large4-modified
1801 $ hg --cwd sub cat -r '.^' ../normal3
1801 $ hg --cwd sub cat -r '.^' ../normal3
1802 normal3-modified
1802 normal3-modified
1803 Cat a standin
1803 Cat a standin
1804 $ hg cat .hglf/sub/large4
1804 $ hg cat .hglf/sub/large4
1805 e166e74c7303192238d60af5a9c4ce9bef0b7928
1805 e166e74c7303192238d60af5a9c4ce9bef0b7928
1806 $ hg cat .hglf/normal3
1806 $ hg cat .hglf/normal3
1807 .hglf/normal3: no such file in rev 598410d3eb9a (glob)
1807 .hglf/normal3: no such file in rev 598410d3eb9a (glob)
1808 [1]
1808 [1]
1809
1809
1810 Test that renaming a largefile results in correct output for status
1810 Test that renaming a largefile results in correct output for status
1811
1811
1812 $ hg rename sub/large4 large4-renamed
1812 $ hg rename sub/large4 large4-renamed
1813 $ hg commit -m "test rename output"
1813 $ hg commit -m "test rename output"
1814 Invoking status precommit hook
1814 Invoking status precommit hook
1815 A large4-renamed
1815 A large4-renamed
1816 R sub/large4
1816 R sub/large4
1817 $ cat large4-renamed
1817 $ cat large4-renamed
1818 large4-modified
1818 large4-modified
1819 $ cd sub2
1819 $ cd sub2
1820 $ hg rename large6 large6-renamed
1820 $ hg rename large6 large6-renamed
1821 $ hg st
1821 $ hg st
1822 A sub2/large6-renamed
1822 A sub2/large6-renamed
1823 R sub2/large6
1823 R sub2/large6
1824 $ cd ..
1824 $ cd ..
1825
1825
1826 Test --normal flag
1826 Test --normal flag
1827
1827
1828 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1828 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1829 $ hg add --normal --large new-largefile
1829 $ hg add --normal --large new-largefile
1830 abort: --normal cannot be used with --large
1830 abort: --normal cannot be used with --large
1831 [255]
1831 [255]
1832 $ hg add --normal new-largefile
1832 $ hg add --normal new-largefile
1833 new-largefile: up to 69 MB of RAM may be required to manage this file
1833 new-largefile: up to 69 MB of RAM may be required to manage this file
1834 (use 'hg revert new-largefile' to cancel the pending addition)
1834 (use 'hg revert new-largefile' to cancel the pending addition)
1835
1835
1836 Test explicit commit of switch between normal and largefile - make sure both
1836 Test explicit commit of switch between normal and largefile - make sure both
1837 the add and the remove is committed.
1837 the add and the remove is committed.
1838
1838
1839 $ hg up -qC
1839 $ hg up -qC
1840 $ hg forget normal3 large4-renamed
1840 $ hg forget normal3 large4-renamed
1841 $ hg add --large normal3
1841 $ hg add --large normal3
1842 $ hg add large4-renamed
1842 $ hg add large4-renamed
1843 $ hg commit -m 'swap' normal3 large4-renamed
1843 $ hg commit -m 'swap' normal3 large4-renamed
1844 Invoking status precommit hook
1844 Invoking status precommit hook
1845 A large4-renamed
1845 A large4-renamed
1846 A normal3
1846 A normal3
1847 ? new-largefile
1847 ? new-largefile
1848 ? sub2/large6-renamed
1848 ? sub2/large6-renamed
1849 $ hg mani
1849 $ hg mani
1850 .hglf/normal3
1850 .hglf/normal3
1851 .hglf/sub2/large6
1851 .hglf/sub2/large6
1852 .hglf/sub2/large7
1852 .hglf/sub2/large7
1853 normal3
1853 large4-renamed
1854 sub/normal4
1854 sub/normal4
1855
1855
1856 $ cd ..
1856 $ cd ..
1857
1857
1858
1858
1859
1859
General Comments 0
You need to be logged in to leave comments. Login now