##// END OF EJS Templates
largefiles: stat all largefiles in one batch before downloading...
Mads Kiilerich -
r19008:9d33d6e0 default
parent child Browse files
Show More
@@ -1,200 +1,207 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 '''base class for store implementations and store-related utility code'''
9 '''base class for store implementations and store-related utility code'''
10
10
11 import re
11 import re
12
12
13 from mercurial import util, node, hg
13 from mercurial import util, node, hg
14 from mercurial.i18n import _
14 from mercurial.i18n import _
15
15
16 import lfutil
16 import lfutil
17
17
18 class StoreError(Exception):
18 class StoreError(Exception):
19 '''Raised when there is a problem getting files from or putting
19 '''Raised when there is a problem getting files from or putting
20 files to a central store.'''
20 files to a central store.'''
21 def __init__(self, filename, hash, url, detail):
21 def __init__(self, filename, hash, url, detail):
22 self.filename = filename
22 self.filename = filename
23 self.hash = hash
23 self.hash = hash
24 self.url = url
24 self.url = url
25 self.detail = detail
25 self.detail = detail
26
26
27 def longmessage(self):
27 def longmessage(self):
28 return (_("error getting id %s from url %s for file %s: %s\n") %
28 return (_("error getting id %s from url %s for file %s: %s\n") %
29 (self.hash, self.url, self.filename, self.detail))
29 (self.hash, self.url, self.filename, self.detail))
30
30
31 def __str__(self):
31 def __str__(self):
32 return "%s: %s" % (self.url, self.detail)
32 return "%s: %s" % (self.url, self.detail)
33
33
34 class basestore(object):
34 class basestore(object):
35 def __init__(self, ui, repo, url):
35 def __init__(self, ui, repo, url):
36 self.ui = ui
36 self.ui = ui
37 self.repo = repo
37 self.repo = repo
38 self.url = url
38 self.url = url
39
39
40 def put(self, source, hash):
40 def put(self, source, hash):
41 '''Put source file into the store so it can be retrieved by hash.'''
41 '''Put source file into the store so it can be retrieved by hash.'''
42 raise NotImplementedError('abstract method')
42 raise NotImplementedError('abstract method')
43
43
44 def exists(self, hashes):
44 def exists(self, hashes):
45 '''Check to see if the store contains the given hashes. Given an
45 '''Check to see if the store contains the given hashes. Given an
46 iterable of hashes it returns a mapping from hash to bool.'''
46 iterable of hashes it returns a mapping from hash to bool.'''
47 raise NotImplementedError('abstract method')
47 raise NotImplementedError('abstract method')
48
48
49 def get(self, files):
49 def get(self, files):
50 '''Get the specified largefiles from the store and write to local
50 '''Get the specified largefiles from the store and write to local
51 files under repo.root. files is a list of (filename, hash)
51 files under repo.root. files is a list of (filename, hash)
52 tuples. Return (success, missing), lists of files successfully
52 tuples. Return (success, missing), lists of files successfully
53 downloaded and those not found in the store. success is a list
53 downloaded and those not found in the store. success is a list
54 of (filename, hash) tuples; missing is a list of filenames that
54 of (filename, hash) tuples; missing is a list of filenames that
55 we could not get. (The detailed error message will already have
55 we could not get. (The detailed error message will already have
56 been presented to the user, so missing is just supplied as a
56 been presented to the user, so missing is just supplied as a
57 summary.)'''
57 summary.)'''
58 success = []
58 success = []
59 missing = []
59 missing = []
60 ui = self.ui
60 ui = self.ui
61
61
62 util.makedirs(lfutil.storepath(self.repo, ''))
62 util.makedirs(lfutil.storepath(self.repo, ''))
63
63
64 at = 0
64 at = 0
65 available = self.exists(set(hash for (_filename, hash) in files))
65 for filename, hash in files:
66 for filename, hash in files:
66 ui.progress(_('getting largefiles'), at, unit='lfile',
67 ui.progress(_('getting largefiles'), at, unit='lfile',
67 total=len(files))
68 total=len(files))
68 at += 1
69 at += 1
69 ui.note(_('getting %s:%s\n') % (filename, hash))
70 ui.note(_('getting %s:%s\n') % (filename, hash))
70
71
72 if not available.get(hash):
73 ui.warn(_('%s: largefile %s not available from %s\n')
74 % (filename, hash, self.url))
75 missing.append(filename)
76 continue
77
71 storefilename = lfutil.storepath(self.repo, hash)
78 storefilename = lfutil.storepath(self.repo, hash)
72 tmpfile = util.atomictempfile(storefilename + '.tmp',
79 tmpfile = util.atomictempfile(storefilename + '.tmp',
73 createmode=self.repo.store.createmode)
80 createmode=self.repo.store.createmode)
74
81
75 try:
82 try:
76 hhash = self._getfile(tmpfile, filename, hash)
83 hhash = self._getfile(tmpfile, filename, hash)
77 except StoreError, err:
84 except StoreError, err:
78 ui.warn(err.longmessage())
85 ui.warn(err.longmessage())
79 hhash = ""
86 hhash = ""
80 tmpfile.close()
87 tmpfile.close()
81
88
82 if hhash != hash:
89 if hhash != hash:
83 if hhash != "":
90 if hhash != "":
84 ui.warn(_('%s: data corruption (expected %s, got %s)\n')
91 ui.warn(_('%s: data corruption (expected %s, got %s)\n')
85 % (filename, hash, hhash))
92 % (filename, hash, hhash))
86 util.unlink(storefilename + '.tmp')
93 util.unlink(storefilename + '.tmp')
87 missing.append(filename)
94 missing.append(filename)
88 continue
95 continue
89
96
90 util.rename(storefilename + '.tmp', storefilename)
97 util.rename(storefilename + '.tmp', storefilename)
91 lfutil.linktousercache(self.repo, hash)
98 lfutil.linktousercache(self.repo, hash)
92 success.append((filename, hhash))
99 success.append((filename, hhash))
93
100
94 ui.progress(_('getting largefiles'), None)
101 ui.progress(_('getting largefiles'), None)
95 return (success, missing)
102 return (success, missing)
96
103
97 def verify(self, revs, contents=False):
104 def verify(self, revs, contents=False):
98 '''Verify the existence (and, optionally, contents) of every big
105 '''Verify the existence (and, optionally, contents) of every big
99 file revision referenced by every changeset in revs.
106 file revision referenced by every changeset in revs.
100 Return 0 if all is well, non-zero on any errors.'''
107 Return 0 if all is well, non-zero on any errors.'''
101 failed = False
108 failed = False
102
109
103 self.ui.status(_('searching %d changesets for largefiles\n') %
110 self.ui.status(_('searching %d changesets for largefiles\n') %
104 len(revs))
111 len(revs))
105 verified = set() # set of (filename, filenode) tuples
112 verified = set() # set of (filename, filenode) tuples
106
113
107 for rev in revs:
114 for rev in revs:
108 cctx = self.repo[rev]
115 cctx = self.repo[rev]
109 cset = "%d:%s" % (cctx.rev(), node.short(cctx.node()))
116 cset = "%d:%s" % (cctx.rev(), node.short(cctx.node()))
110
117
111 for standin in cctx:
118 for standin in cctx:
112 if self._verifyfile(cctx, cset, contents, standin, verified):
119 if self._verifyfile(cctx, cset, contents, standin, verified):
113 failed = True
120 failed = True
114
121
115 numrevs = len(verified)
122 numrevs = len(verified)
116 numlfiles = len(set([fname for (fname, fnode) in verified]))
123 numlfiles = len(set([fname for (fname, fnode) in verified]))
117 if contents:
124 if contents:
118 self.ui.status(
125 self.ui.status(
119 _('verified contents of %d revisions of %d largefiles\n')
126 _('verified contents of %d revisions of %d largefiles\n')
120 % (numrevs, numlfiles))
127 % (numrevs, numlfiles))
121 else:
128 else:
122 self.ui.status(
129 self.ui.status(
123 _('verified existence of %d revisions of %d largefiles\n')
130 _('verified existence of %d revisions of %d largefiles\n')
124 % (numrevs, numlfiles))
131 % (numrevs, numlfiles))
125 return int(failed)
132 return int(failed)
126
133
127 def _getfile(self, tmpfile, filename, hash):
134 def _getfile(self, tmpfile, filename, hash):
128 '''Fetch one revision of one file from the store and write it
135 '''Fetch one revision of one file from the store and write it
129 to tmpfile. Compute the hash of the file on-the-fly as it
136 to tmpfile. Compute the hash of the file on-the-fly as it
130 downloads and return the hash. Close tmpfile. Raise
137 downloads and return the hash. Close tmpfile. Raise
131 StoreError if unable to download the file (e.g. it does not
138 StoreError if unable to download the file (e.g. it does not
132 exist in the store).'''
139 exist in the store).'''
133 raise NotImplementedError('abstract method')
140 raise NotImplementedError('abstract method')
134
141
135 def _verifyfile(self, cctx, cset, contents, standin, verified):
142 def _verifyfile(self, cctx, cset, contents, standin, verified):
136 '''Perform the actual verification of a file in the store.
143 '''Perform the actual verification of a file in the store.
137 'cset' is only used in warnings.
144 'cset' is only used in warnings.
138 'contents' controls verification of content hash.
145 'contents' controls verification of content hash.
139 'standin' is the standin path of the largefile to verify.
146 'standin' is the standin path of the largefile to verify.
140 'verified' is maintained as a set of already verified files.
147 'verified' is maintained as a set of already verified files.
141 Returns _true_ if it is a standin and any problems are found!
148 Returns _true_ if it is a standin and any problems are found!
142 '''
149 '''
143 raise NotImplementedError('abstract method')
150 raise NotImplementedError('abstract method')
144
151
145 import localstore, wirestore
152 import localstore, wirestore
146
153
147 _storeprovider = {
154 _storeprovider = {
148 'file': [localstore.localstore],
155 'file': [localstore.localstore],
149 'http': [wirestore.wirestore],
156 'http': [wirestore.wirestore],
150 'https': [wirestore.wirestore],
157 'https': [wirestore.wirestore],
151 'ssh': [wirestore.wirestore],
158 'ssh': [wirestore.wirestore],
152 }
159 }
153
160
154 _scheme_re = re.compile(r'^([a-zA-Z0-9+-.]+)://')
161 _scheme_re = re.compile(r'^([a-zA-Z0-9+-.]+)://')
155
162
156 # During clone this function is passed the src's ui object
163 # During clone this function is passed the src's ui object
157 # but it needs the dest's ui object so it can read out of
164 # but it needs the dest's ui object so it can read out of
158 # the config file. Use repo.ui instead.
165 # the config file. Use repo.ui instead.
159 def _openstore(repo, remote=None, put=False):
166 def _openstore(repo, remote=None, put=False):
160 ui = repo.ui
167 ui = repo.ui
161
168
162 if not remote:
169 if not remote:
163 lfpullsource = getattr(repo, 'lfpullsource', None)
170 lfpullsource = getattr(repo, 'lfpullsource', None)
164 if lfpullsource:
171 if lfpullsource:
165 path = ui.expandpath(lfpullsource)
172 path = ui.expandpath(lfpullsource)
166 else:
173 else:
167 path = ui.expandpath('default-push', 'default')
174 path = ui.expandpath('default-push', 'default')
168
175
169 # ui.expandpath() leaves 'default-push' and 'default' alone if
176 # ui.expandpath() leaves 'default-push' and 'default' alone if
170 # they cannot be expanded: fallback to the empty string,
177 # they cannot be expanded: fallback to the empty string,
171 # meaning the current directory.
178 # meaning the current directory.
172 if path == 'default-push' or path == 'default':
179 if path == 'default-push' or path == 'default':
173 path = ''
180 path = ''
174 remote = repo
181 remote = repo
175 else:
182 else:
176 path, _branches = hg.parseurl(path)
183 path, _branches = hg.parseurl(path)
177 remote = hg.peer(repo, {}, path)
184 remote = hg.peer(repo, {}, path)
178
185
179 # The path could be a scheme so use Mercurial's normal functionality
186 # The path could be a scheme so use Mercurial's normal functionality
180 # to resolve the scheme to a repository and use its path
187 # to resolve the scheme to a repository and use its path
181 path = util.safehasattr(remote, 'url') and remote.url() or remote.path
188 path = util.safehasattr(remote, 'url') and remote.url() or remote.path
182
189
183 match = _scheme_re.match(path)
190 match = _scheme_re.match(path)
184 if not match: # regular filesystem path
191 if not match: # regular filesystem path
185 scheme = 'file'
192 scheme = 'file'
186 else:
193 else:
187 scheme = match.group(1)
194 scheme = match.group(1)
188
195
189 try:
196 try:
190 storeproviders = _storeprovider[scheme]
197 storeproviders = _storeprovider[scheme]
191 except KeyError:
198 except KeyError:
192 raise util.Abort(_('unsupported URL scheme %r') % scheme)
199 raise util.Abort(_('unsupported URL scheme %r') % scheme)
193
200
194 for classobj in storeproviders:
201 for classobj in storeproviders:
195 try:
202 try:
196 return classobj(ui, repo, remote)
203 return classobj(ui, repo, remote)
197 except lfutil.storeprotonotcapable:
204 except lfutil.storeprotonotcapable:
198 pass
205 pass
199
206
200 raise util.Abort(_('%s does not appear to be a largefile store') % path)
207 raise util.Abort(_('%s does not appear to be a largefile store') % path)
@@ -1,108 +1,98 b''
1 # Copyright 2010-2011 Fog Creek Software
1 # Copyright 2010-2011 Fog Creek Software
2 # Copyright 2010-2011 Unity Technologies
2 # Copyright 2010-2011 Unity Technologies
3 #
3 #
4 # This software may be used and distributed according to the terms of the
4 # This software may be used and distributed according to the terms of the
5 # GNU General Public License version 2 or any later version.
5 # GNU General Public License version 2 or any later version.
6
6
7 '''remote largefile store; the base class for wirestore'''
7 '''remote largefile store; the base class for wirestore'''
8
8
9 import urllib2
9 import urllib2
10
10
11 from mercurial import util
11 from mercurial import util
12 from mercurial.i18n import _
12 from mercurial.i18n import _
13 from mercurial.wireproto import remotebatch
13 from mercurial.wireproto import remotebatch
14
14
15 import lfutil
15 import lfutil
16 import basestore
16 import basestore
17
17
18 class remotestore(basestore.basestore):
18 class remotestore(basestore.basestore):
19 '''a largefile store accessed over a network'''
19 '''a largefile store accessed over a network'''
20 def __init__(self, ui, repo, url):
20 def __init__(self, ui, repo, url):
21 super(remotestore, self).__init__(ui, repo, url)
21 super(remotestore, self).__init__(ui, repo, url)
22
22
23 def put(self, source, hash):
23 def put(self, source, hash):
24 if self.sendfile(source, hash):
24 if self.sendfile(source, hash):
25 raise util.Abort(
25 raise util.Abort(
26 _('remotestore: could not put %s to remote store %s')
26 _('remotestore: could not put %s to remote store %s')
27 % (source, self.url))
27 % (source, self.url))
28 self.ui.debug(
28 self.ui.debug(
29 _('remotestore: put %s to remote store %s') % (source, self.url))
29 _('remotestore: put %s to remote store %s') % (source, self.url))
30
30
31 def exists(self, hashes):
31 def exists(self, hashes):
32 return dict((h, s == 0) for (h, s) in self._stat(hashes).iteritems())
32 return dict((h, s == 0) for (h, s) in self._stat(hashes).iteritems())
33
33
34 def sendfile(self, filename, hash):
34 def sendfile(self, filename, hash):
35 self.ui.debug('remotestore: sendfile(%s, %s)\n' % (filename, hash))
35 self.ui.debug('remotestore: sendfile(%s, %s)\n' % (filename, hash))
36 fd = None
36 fd = None
37 try:
37 try:
38 try:
38 try:
39 fd = lfutil.httpsendfile(self.ui, filename)
39 fd = lfutil.httpsendfile(self.ui, filename)
40 except IOError, e:
40 except IOError, e:
41 raise util.Abort(
41 raise util.Abort(
42 _('remotestore: could not open file %s: %s')
42 _('remotestore: could not open file %s: %s')
43 % (filename, str(e)))
43 % (filename, str(e)))
44 return self._put(hash, fd)
44 return self._put(hash, fd)
45 finally:
45 finally:
46 if fd:
46 if fd:
47 fd.close()
47 fd.close()
48
48
49 def _getfile(self, tmpfile, filename, hash):
49 def _getfile(self, tmpfile, filename, hash):
50 # quit if the largefile isn't there
51 stat = self._stat([hash])[hash]
52 if stat == 1:
53 raise util.Abort(_('remotestore: largefile %s is invalid') % hash)
54 elif stat == 2:
55 raise util.Abort(_('remotestore: largefile %s is missing') % hash)
56 elif stat != 0:
57 raise RuntimeError('error getting file: unexpected response from '
58 'statlfile (%r)' % stat)
59
60 try:
50 try:
61 chunks = self._get(hash)
51 chunks = self._get(hash)
62 except urllib2.HTTPError, e:
52 except urllib2.HTTPError, e:
63 # 401s get converted to util.Aborts; everything else is fine being
53 # 401s get converted to util.Aborts; everything else is fine being
64 # turned into a StoreError
54 # turned into a StoreError
65 raise basestore.StoreError(filename, hash, self.url, str(e))
55 raise basestore.StoreError(filename, hash, self.url, str(e))
66 except urllib2.URLError, e:
56 except urllib2.URLError, e:
67 # This usually indicates a connection problem, so don't
57 # This usually indicates a connection problem, so don't
68 # keep trying with the other files... they will probably
58 # keep trying with the other files... they will probably
69 # all fail too.
59 # all fail too.
70 raise util.Abort('%s: %s' % (self.url, e.reason))
60 raise util.Abort('%s: %s' % (self.url, e.reason))
71 except IOError, e:
61 except IOError, e:
72 raise basestore.StoreError(filename, hash, self.url, str(e))
62 raise basestore.StoreError(filename, hash, self.url, str(e))
73
63
74 return lfutil.copyandhash(chunks, tmpfile)
64 return lfutil.copyandhash(chunks, tmpfile)
75
65
76 def _verifyfile(self, cctx, cset, contents, standin, verified):
66 def _verifyfile(self, cctx, cset, contents, standin, verified):
77 filename = lfutil.splitstandin(standin)
67 filename = lfutil.splitstandin(standin)
78 if not filename:
68 if not filename:
79 return False
69 return False
80 fctx = cctx[standin]
70 fctx = cctx[standin]
81 key = (filename, fctx.filenode())
71 key = (filename, fctx.filenode())
82 if key in verified:
72 if key in verified:
83 return False
73 return False
84
74
85 verified.add(key)
75 verified.add(key)
86
76
87 expecthash = fctx.data()[0:40]
77 expecthash = fctx.data()[0:40]
88 stat = self._stat([expecthash])[expecthash]
78 stat = self._stat([expecthash])[expecthash]
89 if not stat:
79 if not stat:
90 return False
80 return False
91 elif stat == 1:
81 elif stat == 1:
92 self.ui.warn(
82 self.ui.warn(
93 _('changeset %s: %s: contents differ\n')
83 _('changeset %s: %s: contents differ\n')
94 % (cset, filename))
84 % (cset, filename))
95 return True # failed
85 return True # failed
96 elif stat == 2:
86 elif stat == 2:
97 self.ui.warn(
87 self.ui.warn(
98 _('changeset %s: %s missing\n')
88 _('changeset %s: %s missing\n')
99 % (cset, filename))
89 % (cset, filename))
100 return True # failed
90 return True # failed
101 else:
91 else:
102 raise RuntimeError('verify failed: unexpected response from '
92 raise RuntimeError('verify failed: unexpected response from '
103 'statlfile (%r)' % stat)
93 'statlfile (%r)' % stat)
104
94
105 def batch(self):
95 def batch(self):
106 '''Support for remote batching.'''
96 '''Support for remote batching.'''
107 return remotebatch(self)
97 return remotebatch(self)
108
98
@@ -1,39 +1,40 b''
1 # Copyright 2010-2011 Fog Creek Software
1 # Copyright 2010-2011 Fog Creek Software
2 #
2 #
3 # This software may be used and distributed according to the terms of the
3 # This software may be used and distributed according to the terms of the
4 # GNU General Public License version 2 or any later version.
4 # GNU General Public License version 2 or any later version.
5
5
6 '''largefile store working over Mercurial's wire protocol'''
6 '''largefile store working over Mercurial's wire protocol'''
7
7
8 import lfutil
8 import lfutil
9 import remotestore
9 import remotestore
10
10
11 class wirestore(remotestore.remotestore):
11 class wirestore(remotestore.remotestore):
12 def __init__(self, ui, repo, remote):
12 def __init__(self, ui, repo, remote):
13 cap = remote.capable('largefiles')
13 cap = remote.capable('largefiles')
14 if not cap:
14 if not cap:
15 raise lfutil.storeprotonotcapable([])
15 raise lfutil.storeprotonotcapable([])
16 storetypes = cap.split(',')
16 storetypes = cap.split(',')
17 if 'serve' not in storetypes:
17 if 'serve' not in storetypes:
18 raise lfutil.storeprotonotcapable(storetypes)
18 raise lfutil.storeprotonotcapable(storetypes)
19 self.remote = remote
19 self.remote = remote
20 super(wirestore, self).__init__(ui, repo, remote.url())
20 super(wirestore, self).__init__(ui, repo, remote.url())
21
21
22 def _put(self, hash, fd):
22 def _put(self, hash, fd):
23 return self.remote.putlfile(hash, fd)
23 return self.remote.putlfile(hash, fd)
24
24
25 def _get(self, hash):
25 def _get(self, hash):
26 return self.remote.getlfile(hash)
26 return self.remote.getlfile(hash)
27
27
28 def _stat(self, hashes):
28 def _stat(self, hashes):
29 '''For each hash, return 2 if the largefile is missing, 1 if it has a
29 '''For each hash, return 0 if it is available, other values if not.
30 mismatched checksum, or 0 if it is in good condition'''
30 It is usually 2 if the largefile is missing, but might be 1 the server
31 has a corrupted copy.'''
31 batch = self.remote.batch()
32 batch = self.remote.batch()
32 futures = {}
33 futures = {}
33 for hash in hashes:
34 for hash in hashes:
34 futures[hash] = batch.statlfile(hash)
35 futures[hash] = batch.statlfile(hash)
35 batch.submit()
36 batch.submit()
36 retval = {}
37 retval = {}
37 for hash in hashes:
38 for hash in hashes:
38 retval[hash] = futures[hash].value
39 retval[hash] = futures[hash].value
39 return retval
40 return retval
@@ -1,136 +1,136 b''
1 Create user cache directory
1 Create user cache directory
2
2
3 $ USERCACHE=`pwd`/cache; export USERCACHE
3 $ USERCACHE=`pwd`/cache; export USERCACHE
4 $ cat <<EOF >> ${HGRCPATH}
4 $ cat <<EOF >> ${HGRCPATH}
5 > [extensions]
5 > [extensions]
6 > hgext.largefiles=
6 > hgext.largefiles=
7 > [largefiles]
7 > [largefiles]
8 > usercache=${USERCACHE}
8 > usercache=${USERCACHE}
9 > EOF
9 > EOF
10 $ mkdir -p ${USERCACHE}
10 $ mkdir -p ${USERCACHE}
11
11
12 Create source repo, and commit adding largefile.
12 Create source repo, and commit adding largefile.
13
13
14 $ hg init src
14 $ hg init src
15 $ cd src
15 $ cd src
16 $ echo large > large
16 $ echo large > large
17 $ hg add --large large
17 $ hg add --large large
18 $ hg commit -m 'add largefile'
18 $ hg commit -m 'add largefile'
19 $ hg rm large
19 $ hg rm large
20 $ hg commit -m 'branchhead without largefile'
20 $ hg commit -m 'branchhead without largefile'
21 $ hg up -qr 0
21 $ hg up -qr 0
22 $ cd ..
22 $ cd ..
23
23
24 Discard all cached largefiles in USERCACHE
24 Discard all cached largefiles in USERCACHE
25
25
26 $ rm -rf ${USERCACHE}
26 $ rm -rf ${USERCACHE}
27
27
28 Create mirror repo, and pull from source without largefile:
28 Create mirror repo, and pull from source without largefile:
29 "pull" is used instead of "clone" for suppression of (1) updating to
29 "pull" is used instead of "clone" for suppression of (1) updating to
30 tip (= cahcing largefile from source repo), and (2) recording source
30 tip (= cahcing largefile from source repo), and (2) recording source
31 repo as "default" path in .hg/hgrc.
31 repo as "default" path in .hg/hgrc.
32
32
33 $ hg init mirror
33 $ hg init mirror
34 $ cd mirror
34 $ cd mirror
35 $ hg pull ../src
35 $ hg pull ../src
36 pulling from ../src
36 pulling from ../src
37 requesting all changes
37 requesting all changes
38 adding changesets
38 adding changesets
39 adding manifests
39 adding manifests
40 adding file changes
40 adding file changes
41 added 2 changesets with 1 changes to 1 files
41 added 2 changesets with 1 changes to 1 files
42 (run 'hg update' to get a working copy)
42 (run 'hg update' to get a working copy)
43
43
44 Update working directory to "tip", which requires largefile("large"),
44 Update working directory to "tip", which requires largefile("large"),
45 but there is no cache file for it. So, hg must treat it as
45 but there is no cache file for it. So, hg must treat it as
46 "missing"(!) file.
46 "missing"(!) file.
47
47
48 $ hg update -r0
48 $ hg update -r0
49 getting changed largefiles
49 getting changed largefiles
50 error getting id 7f7097b041ccf68cc5561e9600da4655d21c6d18 from url file:$TESTTMP/mirror for file large: can't get file locally (glob)
50 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:$TESTTMP/mirror
51 0 largefiles updated, 0 removed
51 0 largefiles updated, 0 removed
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
52 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
53 $ hg status
53 $ hg status
54 ! large
54 ! large
55
55
56 Update working directory to null: this cleanup .hg/largefiles/dirstate
56 Update working directory to null: this cleanup .hg/largefiles/dirstate
57
57
58 $ hg update null
58 $ hg update null
59 getting changed largefiles
59 getting changed largefiles
60 0 largefiles updated, 0 removed
60 0 largefiles updated, 0 removed
61 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
61 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
62
62
63 Update working directory to tip, again.
63 Update working directory to tip, again.
64
64
65 $ hg update -r0
65 $ hg update -r0
66 getting changed largefiles
66 getting changed largefiles
67 error getting id 7f7097b041ccf68cc5561e9600da4655d21c6d18 from url file:$TESTTMP/mirror for file large: can't get file locally (glob)
67 large: largefile 7f7097b041ccf68cc5561e9600da4655d21c6d18 not available from file:$TESTTMP/mirror
68 0 largefiles updated, 0 removed
68 0 largefiles updated, 0 removed
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
69 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
70 $ hg status
70 $ hg status
71 ! large
71 ! large
72 $ cd ..
72 $ cd ..
73
73
74 Verify that largefiles from pulled branchheads are fetched, also to an empty repo
74 Verify that largefiles from pulled branchheads are fetched, also to an empty repo
75
75
76 $ hg init mirror2
76 $ hg init mirror2
77 $ hg -R mirror2 pull src -r0
77 $ hg -R mirror2 pull src -r0
78 pulling from src
78 pulling from src
79 adding changesets
79 adding changesets
80 adding manifests
80 adding manifests
81 adding file changes
81 adding file changes
82 added 1 changesets with 1 changes to 1 files
82 added 1 changesets with 1 changes to 1 files
83 (run 'hg update' to get a working copy)
83 (run 'hg update' to get a working copy)
84
84
85 #if unix-permissions
85 #if unix-permissions
86
86
87 Portable way to print file permissions:
87 Portable way to print file permissions:
88
88
89 $ cat > ls-l.py <<EOF
89 $ cat > ls-l.py <<EOF
90 > #!/usr/bin/env python
90 > #!/usr/bin/env python
91 > import sys, os
91 > import sys, os
92 > path = sys.argv[1]
92 > path = sys.argv[1]
93 > print '%03o' % (os.lstat(path).st_mode & 0777)
93 > print '%03o' % (os.lstat(path).st_mode & 0777)
94 > EOF
94 > EOF
95 $ chmod +x ls-l.py
95 $ chmod +x ls-l.py
96
96
97 Test that files in .hg/largefiles inherit mode from .hg/store, not
97 Test that files in .hg/largefiles inherit mode from .hg/store, not
98 from file in working copy:
98 from file in working copy:
99
99
100 $ cd src
100 $ cd src
101 $ chmod 750 .hg/store
101 $ chmod 750 .hg/store
102 $ chmod 660 large
102 $ chmod 660 large
103 $ echo change >> large
103 $ echo change >> large
104 $ hg commit -m change
104 $ hg commit -m change
105 created new head
105 created new head
106 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
106 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
107 640
107 640
108
108
109 Test permission of with files in .hg/largefiles created by update:
109 Test permission of with files in .hg/largefiles created by update:
110
110
111 $ cd ../mirror
111 $ cd ../mirror
112 $ rm -r "$USERCACHE" .hg/largefiles # avoid links
112 $ rm -r "$USERCACHE" .hg/largefiles # avoid links
113 $ chmod 750 .hg/store
113 $ chmod 750 .hg/store
114 $ hg pull ../src --update -q
114 $ hg pull ../src --update -q
115 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
115 $ ../ls-l.py .hg/largefiles/e151b474069de4ca6898f67ce2f2a7263adf8fea
116 640
116 640
117
117
118 Test permission of files created by push:
118 Test permission of files created by push:
119
119
120 $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
120 $ hg serve -R ../src -d -p $HGPORT --pid-file hg.pid \
121 > --config "web.allow_push=*" --config web.push_ssl=no
121 > --config "web.allow_push=*" --config web.push_ssl=no
122 $ cat hg.pid >> $DAEMON_PIDS
122 $ cat hg.pid >> $DAEMON_PIDS
123
123
124 $ echo change >> large
124 $ echo change >> large
125 $ hg commit -m change
125 $ hg commit -m change
126
126
127 $ rm -r "$USERCACHE"
127 $ rm -r "$USERCACHE"
128
128
129 $ hg push -q http://localhost:$HGPORT/
129 $ hg push -q http://localhost:$HGPORT/
130
130
131 $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
131 $ ../ls-l.py ../src/.hg/largefiles/b734e14a0971e370408ab9bce8d56d8485e368a9
132 640
132 640
133
133
134 $ cd ..
134 $ cd ..
135
135
136 #endif
136 #endif
@@ -1,2216 +1,2219 b''
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
2 $ mkdir "${USERCACHE}"
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > largefiles=
5 > largefiles=
6 > purge=
6 > purge=
7 > rebase=
7 > rebase=
8 > transplant=
8 > transplant=
9 > [phases]
9 > [phases]
10 > publish=False
10 > publish=False
11 > [largefiles]
11 > [largefiles]
12 > minsize=2
12 > minsize=2
13 > patterns=glob:**.dat
13 > patterns=glob:**.dat
14 > usercache=${USERCACHE}
14 > usercache=${USERCACHE}
15 > [hooks]
15 > [hooks]
16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
17 > EOF
17 > EOF
18
18
19 Create the repo with a couple of revisions of both large and normal
19 Create the repo with a couple of revisions of both large and normal
20 files.
20 files.
21 Test status and dirstate of largefiles and that summary output is correct.
21 Test status and dirstate of largefiles and that summary output is correct.
22
22
23 $ hg init a
23 $ hg init a
24 $ cd a
24 $ cd a
25 $ mkdir sub
25 $ mkdir sub
26 $ echo normal1 > normal1
26 $ echo normal1 > normal1
27 $ echo normal2 > sub/normal2
27 $ echo normal2 > sub/normal2
28 $ echo large1 > large1
28 $ echo large1 > large1
29 $ echo large2 > sub/large2
29 $ echo large2 > sub/large2
30 $ hg add normal1 sub/normal2
30 $ hg add normal1 sub/normal2
31 $ hg add --large large1 sub/large2
31 $ hg add --large large1 sub/large2
32 $ hg commit -m "add files"
32 $ hg commit -m "add files"
33 Invoking status precommit hook
33 Invoking status precommit hook
34 A large1
34 A large1
35 A normal1
35 A normal1
36 A sub/large2
36 A sub/large2
37 A sub/normal2
37 A sub/normal2
38 $ touch large1 sub/large2
38 $ touch large1 sub/large2
39 $ sleep 1
39 $ sleep 1
40 $ hg st
40 $ hg st
41 $ hg debugstate --nodates
41 $ hg debugstate --nodates
42 n 644 41 .hglf/large1
42 n 644 41 .hglf/large1
43 n 644 41 .hglf/sub/large2
43 n 644 41 .hglf/sub/large2
44 n 644 8 normal1
44 n 644 8 normal1
45 n 644 8 sub/normal2
45 n 644 8 sub/normal2
46 $ hg debugstate --large
46 $ hg debugstate --large
47 n 644 7 large1
47 n 644 7 large1
48 n 644 7 sub/large2
48 n 644 7 sub/large2
49 $ echo normal11 > normal1
49 $ echo normal11 > normal1
50 $ echo normal22 > sub/normal2
50 $ echo normal22 > sub/normal2
51 $ echo large11 > large1
51 $ echo large11 > large1
52 $ echo large22 > sub/large2
52 $ echo large22 > sub/large2
53 $ hg commit -m "edit files"
53 $ hg commit -m "edit files"
54 Invoking status precommit hook
54 Invoking status precommit hook
55 M large1
55 M large1
56 M normal1
56 M normal1
57 M sub/large2
57 M sub/large2
58 M sub/normal2
58 M sub/normal2
59 $ hg sum --large
59 $ hg sum --large
60 parent: 1:ce8896473775 tip
60 parent: 1:ce8896473775 tip
61 edit files
61 edit files
62 branch: default
62 branch: default
63 commit: (clean)
63 commit: (clean)
64 update: (current)
64 update: (current)
65 largefiles: (no remote repo)
65 largefiles: (no remote repo)
66
66
67 Commit preserved largefile contents.
67 Commit preserved largefile contents.
68
68
69 $ cat normal1
69 $ cat normal1
70 normal11
70 normal11
71 $ cat large1
71 $ cat large1
72 large11
72 large11
73 $ cat sub/normal2
73 $ cat sub/normal2
74 normal22
74 normal22
75 $ cat sub/large2
75 $ cat sub/large2
76 large22
76 large22
77
77
78 Test status, subdir and unknown files
78 Test status, subdir and unknown files
79
79
80 $ echo unknown > sub/unknown
80 $ echo unknown > sub/unknown
81 $ hg st --all
81 $ hg st --all
82 ? sub/unknown
82 ? sub/unknown
83 C large1
83 C large1
84 C normal1
84 C normal1
85 C sub/large2
85 C sub/large2
86 C sub/normal2
86 C sub/normal2
87 $ hg st --all sub
87 $ hg st --all sub
88 ? sub/unknown
88 ? sub/unknown
89 C sub/large2
89 C sub/large2
90 C sub/normal2
90 C sub/normal2
91 $ rm sub/unknown
91 $ rm sub/unknown
92
92
93 Test messages and exit codes for remove warning cases
93 Test messages and exit codes for remove warning cases
94
94
95 $ hg remove -A large1
95 $ hg remove -A large1
96 not removing large1: file still exists
96 not removing large1: file still exists
97 [1]
97 [1]
98 $ echo 'modified' > large1
98 $ echo 'modified' > large1
99 $ hg remove large1
99 $ hg remove large1
100 not removing large1: file is modified (use -f to force removal)
100 not removing large1: file is modified (use -f to force removal)
101 [1]
101 [1]
102 $ echo 'new' > normalnew
102 $ echo 'new' > normalnew
103 $ hg add normalnew
103 $ hg add normalnew
104 $ echo 'new' > largenew
104 $ echo 'new' > largenew
105 $ hg add --large normalnew
105 $ hg add --large normalnew
106 normalnew already tracked!
106 normalnew already tracked!
107 $ hg remove normalnew largenew
107 $ hg remove normalnew largenew
108 not removing largenew: file is untracked
108 not removing largenew: file is untracked
109 not removing normalnew: file has been marked for add (use forget to undo)
109 not removing normalnew: file has been marked for add (use forget to undo)
110 [1]
110 [1]
111 $ rm normalnew largenew
111 $ rm normalnew largenew
112 $ hg up -Cq
112 $ hg up -Cq
113
113
114 Remove both largefiles and normal files.
114 Remove both largefiles and normal files.
115
115
116 $ hg remove normal1 large1
116 $ hg remove normal1 large1
117 $ hg status large1
117 $ hg status large1
118 R large1
118 R large1
119 $ hg commit -m "remove files"
119 $ hg commit -m "remove files"
120 Invoking status precommit hook
120 Invoking status precommit hook
121 R large1
121 R large1
122 R normal1
122 R normal1
123 $ ls
123 $ ls
124 sub
124 sub
125 $ echo "testlargefile" > large1-test
125 $ echo "testlargefile" > large1-test
126 $ hg add --large large1-test
126 $ hg add --large large1-test
127 $ hg st
127 $ hg st
128 A large1-test
128 A large1-test
129 $ hg rm large1-test
129 $ hg rm large1-test
130 not removing large1-test: file has been marked for add (use forget to undo)
130 not removing large1-test: file has been marked for add (use forget to undo)
131 [1]
131 [1]
132 $ hg st
132 $ hg st
133 A large1-test
133 A large1-test
134 $ hg forget large1-test
134 $ hg forget large1-test
135 $ hg st
135 $ hg st
136 ? large1-test
136 ? large1-test
137 $ hg remove large1-test
137 $ hg remove large1-test
138 not removing large1-test: file is untracked
138 not removing large1-test: file is untracked
139 [1]
139 [1]
140 $ hg forget large1-test
140 $ hg forget large1-test
141 not removing large1-test: file is already untracked
141 not removing large1-test: file is already untracked
142 [1]
142 [1]
143 $ rm large1-test
143 $ rm large1-test
144
144
145 Copy both largefiles and normal files (testing that status output is correct).
145 Copy both largefiles and normal files (testing that status output is correct).
146
146
147 $ hg cp sub/normal2 normal1
147 $ hg cp sub/normal2 normal1
148 $ hg cp sub/large2 large1
148 $ hg cp sub/large2 large1
149 $ hg commit -m "copy files"
149 $ hg commit -m "copy files"
150 Invoking status precommit hook
150 Invoking status precommit hook
151 A large1
151 A large1
152 A normal1
152 A normal1
153 $ cat normal1
153 $ cat normal1
154 normal22
154 normal22
155 $ cat large1
155 $ cat large1
156 large22
156 large22
157
157
158 Test moving largefiles and verify that normal files are also unaffected.
158 Test moving largefiles and verify that normal files are also unaffected.
159
159
160 $ hg mv normal1 normal3
160 $ hg mv normal1 normal3
161 $ hg mv large1 large3
161 $ hg mv large1 large3
162 $ hg mv sub/normal2 sub/normal4
162 $ hg mv sub/normal2 sub/normal4
163 $ hg mv sub/large2 sub/large4
163 $ hg mv sub/large2 sub/large4
164 $ hg commit -m "move files"
164 $ hg commit -m "move files"
165 Invoking status precommit hook
165 Invoking status precommit hook
166 A large3
166 A large3
167 A normal3
167 A normal3
168 A sub/large4
168 A sub/large4
169 A sub/normal4
169 A sub/normal4
170 R large1
170 R large1
171 R normal1
171 R normal1
172 R sub/large2
172 R sub/large2
173 R sub/normal2
173 R sub/normal2
174 $ cat normal3
174 $ cat normal3
175 normal22
175 normal22
176 $ cat large3
176 $ cat large3
177 large22
177 large22
178 $ cat sub/normal4
178 $ cat sub/normal4
179 normal22
179 normal22
180 $ cat sub/large4
180 $ cat sub/large4
181 large22
181 large22
182
182
183 Test repo method wrapping detection
183 Test repo method wrapping detection
184
184
185 $ cat > $TESTTMP/wrapping1.py <<EOF
185 $ cat > $TESTTMP/wrapping1.py <<EOF
186 > from hgext import largefiles
186 > from hgext import largefiles
187 > def reposetup(ui, repo):
187 > def reposetup(ui, repo):
188 > class derived(repo.__class__):
188 > class derived(repo.__class__):
189 > def push(self, *args, **kwargs):
189 > def push(self, *args, **kwargs):
190 > return super(derived, self).push(*args, **kwargs)
190 > return super(derived, self).push(*args, **kwargs)
191 > repo.__class__ = derived
191 > repo.__class__ = derived
192 > largefiles.reposetup(ui, repo)
192 > largefiles.reposetup(ui, repo)
193 > uisetup = largefiles.uisetup
193 > uisetup = largefiles.uisetup
194 > EOF
194 > EOF
195 $ hg --config extensions.largefiles=$TESTTMP/wrapping1.py status
195 $ hg --config extensions.largefiles=$TESTTMP/wrapping1.py status
196 largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly
196 largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly
197
197
198 $ cat > $TESTTMP/wrapping2.py <<EOF
198 $ cat > $TESTTMP/wrapping2.py <<EOF
199 > from hgext import largefiles
199 > from hgext import largefiles
200 > def reposetup(ui, repo):
200 > def reposetup(ui, repo):
201 > orgpush = repo.push
201 > orgpush = repo.push
202 > def push(*args, **kwargs):
202 > def push(*args, **kwargs):
203 > return orgpush(*args, **kwargs)
203 > return orgpush(*args, **kwargs)
204 > repo.push = push
204 > repo.push = push
205 > largefiles.reposetup(ui, repo)
205 > largefiles.reposetup(ui, repo)
206 > uisetup = largefiles.uisetup
206 > uisetup = largefiles.uisetup
207 > EOF
207 > EOF
208 $ hg --config extensions.largefiles=$TESTTMP/wrapping2.py status
208 $ hg --config extensions.largefiles=$TESTTMP/wrapping2.py status
209 largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly
209 largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly
210
210
211 Test copies and moves from a directory other than root (issue3516)
211 Test copies and moves from a directory other than root (issue3516)
212
212
213 $ cd ..
213 $ cd ..
214 $ hg init lf_cpmv
214 $ hg init lf_cpmv
215 $ cd lf_cpmv
215 $ cd lf_cpmv
216 $ mkdir dira
216 $ mkdir dira
217 $ mkdir dira/dirb
217 $ mkdir dira/dirb
218 $ touch dira/dirb/largefile
218 $ touch dira/dirb/largefile
219 $ hg add --large dira/dirb/largefile
219 $ hg add --large dira/dirb/largefile
220 $ hg commit -m "added"
220 $ hg commit -m "added"
221 Invoking status precommit hook
221 Invoking status precommit hook
222 A dira/dirb/largefile
222 A dira/dirb/largefile
223 $ cd dira
223 $ cd dira
224 $ hg cp dirb/largefile foo/largefile
224 $ hg cp dirb/largefile foo/largefile
225 $ hg ci -m "deep copy"
225 $ hg ci -m "deep copy"
226 Invoking status precommit hook
226 Invoking status precommit hook
227 A dira/foo/largefile
227 A dira/foo/largefile
228 $ find . | sort
228 $ find . | sort
229 .
229 .
230 ./dirb
230 ./dirb
231 ./dirb/largefile
231 ./dirb/largefile
232 ./foo
232 ./foo
233 ./foo/largefile
233 ./foo/largefile
234 $ hg mv foo/largefile baz/largefile
234 $ hg mv foo/largefile baz/largefile
235 $ hg ci -m "moved"
235 $ hg ci -m "moved"
236 Invoking status precommit hook
236 Invoking status precommit hook
237 A dira/baz/largefile
237 A dira/baz/largefile
238 R dira/foo/largefile
238 R dira/foo/largefile
239 $ find . | sort
239 $ find . | sort
240 .
240 .
241 ./baz
241 ./baz
242 ./baz/largefile
242 ./baz/largefile
243 ./dirb
243 ./dirb
244 ./dirb/largefile
244 ./dirb/largefile
245 ./foo
245 ./foo
246 $ cd ../../a
246 $ cd ../../a
247
247
248 #if serve
248 #if serve
249 Test display of largefiles in hgweb
249 Test display of largefiles in hgweb
250
250
251 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
251 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
252 $ cat ../hg.pid >> $DAEMON_PIDS
252 $ cat ../hg.pid >> $DAEMON_PIDS
253 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
253 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
254 200 Script output follows
254 200 Script output follows
255
255
256
256
257 drwxr-xr-x sub
257 drwxr-xr-x sub
258 -rw-r--r-- 41 large3
258 -rw-r--r-- 41 large3
259 -rw-r--r-- 9 normal3
259 -rw-r--r-- 9 normal3
260
260
261
261
262 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
262 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
263 200 Script output follows
263 200 Script output follows
264
264
265
265
266 -rw-r--r-- 41 large4
266 -rw-r--r-- 41 large4
267 -rw-r--r-- 9 normal4
267 -rw-r--r-- 9 normal4
268
268
269
269
270 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
270 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
271 #endif
271 #endif
272
272
273 Test archiving the various revisions. These hit corner cases known with
273 Test archiving the various revisions. These hit corner cases known with
274 archiving.
274 archiving.
275
275
276 $ hg archive -r 0 ../archive0
276 $ hg archive -r 0 ../archive0
277 $ hg archive -r 1 ../archive1
277 $ hg archive -r 1 ../archive1
278 $ hg archive -r 2 ../archive2
278 $ hg archive -r 2 ../archive2
279 $ hg archive -r 3 ../archive3
279 $ hg archive -r 3 ../archive3
280 $ hg archive -r 4 ../archive4
280 $ hg archive -r 4 ../archive4
281 $ cd ../archive0
281 $ cd ../archive0
282 $ cat normal1
282 $ cat normal1
283 normal1
283 normal1
284 $ cat large1
284 $ cat large1
285 large1
285 large1
286 $ cat sub/normal2
286 $ cat sub/normal2
287 normal2
287 normal2
288 $ cat sub/large2
288 $ cat sub/large2
289 large2
289 large2
290 $ cd ../archive1
290 $ cd ../archive1
291 $ cat normal1
291 $ cat normal1
292 normal11
292 normal11
293 $ cat large1
293 $ cat large1
294 large11
294 large11
295 $ cat sub/normal2
295 $ cat sub/normal2
296 normal22
296 normal22
297 $ cat sub/large2
297 $ cat sub/large2
298 large22
298 large22
299 $ cd ../archive2
299 $ cd ../archive2
300 $ ls
300 $ ls
301 sub
301 sub
302 $ cat sub/normal2
302 $ cat sub/normal2
303 normal22
303 normal22
304 $ cat sub/large2
304 $ cat sub/large2
305 large22
305 large22
306 $ cd ../archive3
306 $ cd ../archive3
307 $ cat normal1
307 $ cat normal1
308 normal22
308 normal22
309 $ cat large1
309 $ cat large1
310 large22
310 large22
311 $ cat sub/normal2
311 $ cat sub/normal2
312 normal22
312 normal22
313 $ cat sub/large2
313 $ cat sub/large2
314 large22
314 large22
315 $ cd ../archive4
315 $ cd ../archive4
316 $ cat normal3
316 $ cat normal3
317 normal22
317 normal22
318 $ cat large3
318 $ cat large3
319 large22
319 large22
320 $ cat sub/normal4
320 $ cat sub/normal4
321 normal22
321 normal22
322 $ cat sub/large4
322 $ cat sub/large4
323 large22
323 large22
324
324
325 Commit corner case: specify files to commit.
325 Commit corner case: specify files to commit.
326
326
327 $ cd ../a
327 $ cd ../a
328 $ echo normal3 > normal3
328 $ echo normal3 > normal3
329 $ echo large3 > large3
329 $ echo large3 > large3
330 $ echo normal4 > sub/normal4
330 $ echo normal4 > sub/normal4
331 $ echo large4 > sub/large4
331 $ echo large4 > sub/large4
332 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
332 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
333 Invoking status precommit hook
333 Invoking status precommit hook
334 M large3
334 M large3
335 M normal3
335 M normal3
336 M sub/large4
336 M sub/large4
337 M sub/normal4
337 M sub/normal4
338 $ cat normal3
338 $ cat normal3
339 normal3
339 normal3
340 $ cat large3
340 $ cat large3
341 large3
341 large3
342 $ cat sub/normal4
342 $ cat sub/normal4
343 normal4
343 normal4
344 $ cat sub/large4
344 $ cat sub/large4
345 large4
345 large4
346
346
347 One more commit corner case: commit from a subdirectory.
347 One more commit corner case: commit from a subdirectory.
348
348
349 $ cd ../a
349 $ cd ../a
350 $ echo normal33 > normal3
350 $ echo normal33 > normal3
351 $ echo large33 > large3
351 $ echo large33 > large3
352 $ echo normal44 > sub/normal4
352 $ echo normal44 > sub/normal4
353 $ echo large44 > sub/large4
353 $ echo large44 > sub/large4
354 $ cd sub
354 $ cd sub
355 $ hg commit -m "edit files yet again"
355 $ hg commit -m "edit files yet again"
356 Invoking status precommit hook
356 Invoking status precommit hook
357 M large3
357 M large3
358 M normal3
358 M normal3
359 M sub/large4
359 M sub/large4
360 M sub/normal4
360 M sub/normal4
361 $ cat ../normal3
361 $ cat ../normal3
362 normal33
362 normal33
363 $ cat ../large3
363 $ cat ../large3
364 large33
364 large33
365 $ cat normal4
365 $ cat normal4
366 normal44
366 normal44
367 $ cat large4
367 $ cat large4
368 large44
368 large44
369
369
370 Committing standins is not allowed.
370 Committing standins is not allowed.
371
371
372 $ cd ..
372 $ cd ..
373 $ echo large3 > large3
373 $ echo large3 > large3
374 $ hg commit .hglf/large3 -m "try to commit standin"
374 $ hg commit .hglf/large3 -m "try to commit standin"
375 abort: file ".hglf/large3" is a largefile standin
375 abort: file ".hglf/large3" is a largefile standin
376 (commit the largefile itself instead)
376 (commit the largefile itself instead)
377 [255]
377 [255]
378
378
379 Corner cases for adding largefiles.
379 Corner cases for adding largefiles.
380
380
381 $ echo large5 > large5
381 $ echo large5 > large5
382 $ hg add --large large5
382 $ hg add --large large5
383 $ hg add --large large5
383 $ hg add --large large5
384 large5 already a largefile
384 large5 already a largefile
385 $ mkdir sub2
385 $ mkdir sub2
386 $ echo large6 > sub2/large6
386 $ echo large6 > sub2/large6
387 $ echo large7 > sub2/large7
387 $ echo large7 > sub2/large7
388 $ hg add --large sub2
388 $ hg add --large sub2
389 adding sub2/large6 as a largefile (glob)
389 adding sub2/large6 as a largefile (glob)
390 adding sub2/large7 as a largefile (glob)
390 adding sub2/large7 as a largefile (glob)
391 $ hg st
391 $ hg st
392 M large3
392 M large3
393 A large5
393 A large5
394 A sub2/large6
394 A sub2/large6
395 A sub2/large7
395 A sub2/large7
396
396
397 Committing directories containing only largefiles.
397 Committing directories containing only largefiles.
398
398
399 $ mkdir -p z/y/x/m
399 $ mkdir -p z/y/x/m
400 $ touch z/y/x/m/large1
400 $ touch z/y/x/m/large1
401 $ touch z/y/x/large2
401 $ touch z/y/x/large2
402 $ hg add --large z/y/x/m/large1 z/y/x/large2
402 $ hg add --large z/y/x/m/large1 z/y/x/large2
403 $ hg commit -m "Subdir with directory only containing largefiles" z
403 $ hg commit -m "Subdir with directory only containing largefiles" z
404 Invoking status precommit hook
404 Invoking status precommit hook
405 M large3
405 M large3
406 A large5
406 A large5
407 A sub2/large6
407 A sub2/large6
408 A sub2/large7
408 A sub2/large7
409 A z/y/x/large2
409 A z/y/x/large2
410 A z/y/x/m/large1
410 A z/y/x/m/large1
411 $ hg rollback --quiet
411 $ hg rollback --quiet
412 $ touch z/y/x/m/normal
412 $ touch z/y/x/m/normal
413 $ hg add z/y/x/m/normal
413 $ hg add z/y/x/m/normal
414 $ hg commit -m "Subdir with mixed contents" z
414 $ hg commit -m "Subdir with mixed contents" z
415 Invoking status precommit hook
415 Invoking status precommit hook
416 M large3
416 M large3
417 A large5
417 A large5
418 A sub2/large6
418 A sub2/large6
419 A sub2/large7
419 A sub2/large7
420 A z/y/x/large2
420 A z/y/x/large2
421 A z/y/x/m/large1
421 A z/y/x/m/large1
422 A z/y/x/m/normal
422 A z/y/x/m/normal
423 $ hg st
423 $ hg st
424 M large3
424 M large3
425 A large5
425 A large5
426 A sub2/large6
426 A sub2/large6
427 A sub2/large7
427 A sub2/large7
428 $ hg rollback --quiet
428 $ hg rollback --quiet
429 $ hg revert z/y/x/large2 z/y/x/m/large1
429 $ hg revert z/y/x/large2 z/y/x/m/large1
430 $ rm z/y/x/large2 z/y/x/m/large1
430 $ rm z/y/x/large2 z/y/x/m/large1
431 $ hg commit -m "Subdir with normal contents" z
431 $ hg commit -m "Subdir with normal contents" z
432 Invoking status precommit hook
432 Invoking status precommit hook
433 M large3
433 M large3
434 A large5
434 A large5
435 A sub2/large6
435 A sub2/large6
436 A sub2/large7
436 A sub2/large7
437 A z/y/x/m/normal
437 A z/y/x/m/normal
438 $ hg st
438 $ hg st
439 M large3
439 M large3
440 A large5
440 A large5
441 A sub2/large6
441 A sub2/large6
442 A sub2/large7
442 A sub2/large7
443 $ hg rollback --quiet
443 $ hg rollback --quiet
444 $ hg revert --quiet z
444 $ hg revert --quiet z
445 $ hg commit -m "Empty subdir" z
445 $ hg commit -m "Empty subdir" z
446 abort: z: no match under directory!
446 abort: z: no match under directory!
447 [255]
447 [255]
448 $ rm -rf z
448 $ rm -rf z
449 $ hg ci -m "standin" .hglf
449 $ hg ci -m "standin" .hglf
450 abort: file ".hglf" is a largefile standin
450 abort: file ".hglf" is a largefile standin
451 (commit the largefile itself instead)
451 (commit the largefile itself instead)
452 [255]
452 [255]
453
453
454 Test "hg status" with combination of 'file pattern' and 'directory
454 Test "hg status" with combination of 'file pattern' and 'directory
455 pattern' for largefiles:
455 pattern' for largefiles:
456
456
457 $ hg status sub2/large6 sub2
457 $ hg status sub2/large6 sub2
458 A sub2/large6
458 A sub2/large6
459 A sub2/large7
459 A sub2/large7
460
460
461 Config settings (pattern **.dat, minsize 2 MB) are respected.
461 Config settings (pattern **.dat, minsize 2 MB) are respected.
462
462
463 $ echo testdata > test.dat
463 $ echo testdata > test.dat
464 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
464 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
465 $ hg add
465 $ hg add
466 adding reallylarge as a largefile
466 adding reallylarge as a largefile
467 adding test.dat as a largefile
467 adding test.dat as a largefile
468
468
469 Test that minsize and --lfsize handle float values;
469 Test that minsize and --lfsize handle float values;
470 also tests that --lfsize overrides largefiles.minsize.
470 also tests that --lfsize overrides largefiles.minsize.
471 (0.250 MB = 256 kB = 262144 B)
471 (0.250 MB = 256 kB = 262144 B)
472
472
473 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
473 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
474 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
474 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
475 $ hg --config largefiles.minsize=.25 add
475 $ hg --config largefiles.minsize=.25 add
476 adding ratherlarge as a largefile
476 adding ratherlarge as a largefile
477 adding medium
477 adding medium
478 $ hg forget medium
478 $ hg forget medium
479 $ hg --config largefiles.minsize=.25 add --lfsize=.125
479 $ hg --config largefiles.minsize=.25 add --lfsize=.125
480 adding medium as a largefile
480 adding medium as a largefile
481 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
481 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
482 $ hg --config largefiles.minsize=.25 add --lfsize=.125
482 $ hg --config largefiles.minsize=.25 add --lfsize=.125
483 adding notlarge
483 adding notlarge
484 $ hg forget notlarge
484 $ hg forget notlarge
485
485
486 Test forget on largefiles.
486 Test forget on largefiles.
487
487
488 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
488 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
489 $ hg commit -m "add/edit more largefiles"
489 $ hg commit -m "add/edit more largefiles"
490 Invoking status precommit hook
490 Invoking status precommit hook
491 A sub2/large6
491 A sub2/large6
492 A sub2/large7
492 A sub2/large7
493 R large3
493 R large3
494 ? large5
494 ? large5
495 ? medium
495 ? medium
496 ? notlarge
496 ? notlarge
497 ? ratherlarge
497 ? ratherlarge
498 ? reallylarge
498 ? reallylarge
499 ? test.dat
499 ? test.dat
500 $ hg st
500 $ hg st
501 ? large3
501 ? large3
502 ? large5
502 ? large5
503 ? medium
503 ? medium
504 ? notlarge
504 ? notlarge
505 ? ratherlarge
505 ? ratherlarge
506 ? reallylarge
506 ? reallylarge
507 ? test.dat
507 ? test.dat
508
508
509 Purge with largefiles: verify that largefiles are still in the working
509 Purge with largefiles: verify that largefiles are still in the working
510 dir after a purge.
510 dir after a purge.
511
511
512 $ hg purge --all
512 $ hg purge --all
513 $ cat sub/large4
513 $ cat sub/large4
514 large44
514 large44
515 $ cat sub2/large6
515 $ cat sub2/large6
516 large6
516 large6
517 $ cat sub2/large7
517 $ cat sub2/large7
518 large7
518 large7
519
519
520 Test addremove: verify that files that should be added as largfiles are added as
520 Test addremove: verify that files that should be added as largfiles are added as
521 such and that already-existing largfiles are not added as normal files by
521 such and that already-existing largfiles are not added as normal files by
522 accident.
522 accident.
523
523
524 $ rm normal3
524 $ rm normal3
525 $ rm sub/large4
525 $ rm sub/large4
526 $ echo "testing addremove with patterns" > testaddremove.dat
526 $ echo "testing addremove with patterns" > testaddremove.dat
527 $ echo "normaladdremove" > normaladdremove
527 $ echo "normaladdremove" > normaladdremove
528 $ hg addremove
528 $ hg addremove
529 removing sub/large4
529 removing sub/large4
530 adding testaddremove.dat as a largefile
530 adding testaddremove.dat as a largefile
531 removing normal3
531 removing normal3
532 adding normaladdremove
532 adding normaladdremove
533
533
534 Test addremove with -R
534 Test addremove with -R
535
535
536 $ hg up -C
536 $ hg up -C
537 getting changed largefiles
537 getting changed largefiles
538 1 largefiles updated, 0 removed
538 1 largefiles updated, 0 removed
539 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
539 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
540 $ rm normal3
540 $ rm normal3
541 $ rm sub/large4
541 $ rm sub/large4
542 $ echo "testing addremove with patterns" > testaddremove.dat
542 $ echo "testing addremove with patterns" > testaddremove.dat
543 $ echo "normaladdremove" > normaladdremove
543 $ echo "normaladdremove" > normaladdremove
544 $ cd ..
544 $ cd ..
545 $ hg -R a addremove
545 $ hg -R a addremove
546 removing sub/large4
546 removing sub/large4
547 adding a/testaddremove.dat as a largefile (glob)
547 adding a/testaddremove.dat as a largefile (glob)
548 removing normal3
548 removing normal3
549 adding normaladdremove
549 adding normaladdremove
550 $ cd a
550 $ cd a
551
551
552 Test 3364
552 Test 3364
553 $ hg clone . ../addrm
553 $ hg clone . ../addrm
554 updating to branch default
554 updating to branch default
555 getting changed largefiles
555 getting changed largefiles
556 3 largefiles updated, 0 removed
556 3 largefiles updated, 0 removed
557 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
557 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
558 $ cd ../addrm
558 $ cd ../addrm
559 $ cat >> .hg/hgrc <<EOF
559 $ cat >> .hg/hgrc <<EOF
560 > [hooks]
560 > [hooks]
561 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
561 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
562 > EOF
562 > EOF
563 $ touch foo
563 $ touch foo
564 $ hg add --large foo
564 $ hg add --large foo
565 $ hg ci -m "add foo"
565 $ hg ci -m "add foo"
566 Invoking status precommit hook
566 Invoking status precommit hook
567 A foo
567 A foo
568 Invoking status postcommit hook
568 Invoking status postcommit hook
569 C foo
569 C foo
570 C normal3
570 C normal3
571 C sub/large4
571 C sub/large4
572 C sub/normal4
572 C sub/normal4
573 C sub2/large6
573 C sub2/large6
574 C sub2/large7
574 C sub2/large7
575 $ rm foo
575 $ rm foo
576 $ hg st
576 $ hg st
577 ! foo
577 ! foo
578 hmm.. no precommit invoked, but there is a postcommit??
578 hmm.. no precommit invoked, but there is a postcommit??
579 $ hg ci -m "will not checkin"
579 $ hg ci -m "will not checkin"
580 nothing changed
580 nothing changed
581 Invoking status postcommit hook
581 Invoking status postcommit hook
582 ! foo
582 ! foo
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 [1]
588 [1]
589 $ hg addremove
589 $ hg addremove
590 removing foo
590 removing foo
591 $ hg st
591 $ hg st
592 R foo
592 R foo
593 $ hg ci -m "used to say nothing changed"
593 $ hg ci -m "used to say nothing changed"
594 Invoking status precommit hook
594 Invoking status precommit hook
595 R foo
595 R foo
596 Invoking status postcommit hook
596 Invoking status postcommit hook
597 C normal3
597 C normal3
598 C sub/large4
598 C sub/large4
599 C sub/normal4
599 C sub/normal4
600 C sub2/large6
600 C sub2/large6
601 C sub2/large7
601 C sub2/large7
602 $ hg st
602 $ hg st
603
603
604 Test 3507 (both normal files and largefiles were a problem)
604 Test 3507 (both normal files and largefiles were a problem)
605
605
606 $ touch normal
606 $ touch normal
607 $ touch large
607 $ touch large
608 $ hg add normal
608 $ hg add normal
609 $ hg add --large large
609 $ hg add --large large
610 $ hg ci -m "added"
610 $ hg ci -m "added"
611 Invoking status precommit hook
611 Invoking status precommit hook
612 A large
612 A large
613 A normal
613 A normal
614 Invoking status postcommit hook
614 Invoking status postcommit hook
615 C large
615 C large
616 C normal
616 C normal
617 C normal3
617 C normal3
618 C sub/large4
618 C sub/large4
619 C sub/normal4
619 C sub/normal4
620 C sub2/large6
620 C sub2/large6
621 C sub2/large7
621 C sub2/large7
622 $ hg remove normal
622 $ hg remove normal
623 $ hg addremove --traceback
623 $ hg addremove --traceback
624 $ hg ci -m "addremoved normal"
624 $ hg ci -m "addremoved normal"
625 Invoking status precommit hook
625 Invoking status precommit hook
626 R normal
626 R normal
627 Invoking status postcommit hook
627 Invoking status postcommit hook
628 C large
628 C large
629 C normal3
629 C normal3
630 C sub/large4
630 C sub/large4
631 C sub/normal4
631 C sub/normal4
632 C sub2/large6
632 C sub2/large6
633 C sub2/large7
633 C sub2/large7
634 $ hg up -C '.^'
634 $ hg up -C '.^'
635 getting changed largefiles
635 getting changed largefiles
636 0 largefiles updated, 0 removed
636 0 largefiles updated, 0 removed
637 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
637 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
638 $ hg remove large
638 $ hg remove large
639 $ hg addremove --traceback
639 $ hg addremove --traceback
640 $ hg ci -m "removed large"
640 $ hg ci -m "removed large"
641 Invoking status precommit hook
641 Invoking status precommit hook
642 R large
642 R large
643 created new head
643 created new head
644 Invoking status postcommit hook
644 Invoking status postcommit hook
645 C normal
645 C normal
646 C normal3
646 C normal3
647 C sub/large4
647 C sub/large4
648 C sub/normal4
648 C sub/normal4
649 C sub2/large6
649 C sub2/large6
650 C sub2/large7
650 C sub2/large7
651
651
652 Test commit -A (issue 3542)
652 Test commit -A (issue 3542)
653 $ echo large8 > large8
653 $ echo large8 > large8
654 $ hg add --large large8
654 $ hg add --large large8
655 $ hg ci -Am 'this used to add large8 as normal and commit both'
655 $ hg ci -Am 'this used to add large8 as normal and commit both'
656 Invoking status precommit hook
656 Invoking status precommit hook
657 A large8
657 A large8
658 Invoking status postcommit hook
658 Invoking status postcommit hook
659 C large8
659 C large8
660 C normal
660 C normal
661 C normal3
661 C normal3
662 C sub/large4
662 C sub/large4
663 C sub/normal4
663 C sub/normal4
664 C sub2/large6
664 C sub2/large6
665 C sub2/large7
665 C sub2/large7
666 $ rm large8
666 $ rm large8
667 $ hg ci -Am 'this used to not notice the rm'
667 $ hg ci -Am 'this used to not notice the rm'
668 removing large8
668 removing large8
669 Invoking status precommit hook
669 Invoking status precommit hook
670 R large8
670 R large8
671 Invoking status postcommit hook
671 Invoking status postcommit hook
672 C normal
672 C normal
673 C normal3
673 C normal3
674 C sub/large4
674 C sub/large4
675 C sub/normal4
675 C sub/normal4
676 C sub2/large6
676 C sub2/large6
677 C sub2/large7
677 C sub2/large7
678
678
679 Test that a standin can't be added as a large file
679 Test that a standin can't be added as a large file
680
680
681 $ touch large
681 $ touch large
682 $ hg add --large large
682 $ hg add --large large
683 $ hg ci -m "add"
683 $ hg ci -m "add"
684 Invoking status precommit hook
684 Invoking status precommit hook
685 A large
685 A large
686 Invoking status postcommit hook
686 Invoking status postcommit hook
687 C large
687 C large
688 C normal
688 C normal
689 C normal3
689 C normal3
690 C sub/large4
690 C sub/large4
691 C sub/normal4
691 C sub/normal4
692 C sub2/large6
692 C sub2/large6
693 C sub2/large7
693 C sub2/large7
694 $ hg remove large
694 $ hg remove large
695 $ touch large
695 $ touch large
696 $ hg addremove --config largefiles.patterns=**large --traceback
696 $ hg addremove --config largefiles.patterns=**large --traceback
697 adding large as a largefile
697 adding large as a largefile
698
698
699 Test that outgoing --large works (with revsets too)
699 Test that outgoing --large works (with revsets too)
700 $ hg outgoing --rev '.^' --large
700 $ hg outgoing --rev '.^' --large
701 comparing with $TESTTMP/a (glob)
701 comparing with $TESTTMP/a (glob)
702 searching for changes
702 searching for changes
703 changeset: 8:c02fd3b77ec4
703 changeset: 8:c02fd3b77ec4
704 user: test
704 user: test
705 date: Thu Jan 01 00:00:00 1970 +0000
705 date: Thu Jan 01 00:00:00 1970 +0000
706 summary: add foo
706 summary: add foo
707
707
708 changeset: 9:289dd08c9bbb
708 changeset: 9:289dd08c9bbb
709 user: test
709 user: test
710 date: Thu Jan 01 00:00:00 1970 +0000
710 date: Thu Jan 01 00:00:00 1970 +0000
711 summary: used to say nothing changed
711 summary: used to say nothing changed
712
712
713 changeset: 10:34f23ac6ac12
713 changeset: 10:34f23ac6ac12
714 user: test
714 user: test
715 date: Thu Jan 01 00:00:00 1970 +0000
715 date: Thu Jan 01 00:00:00 1970 +0000
716 summary: added
716 summary: added
717
717
718 changeset: 12:710c1b2f523c
718 changeset: 12:710c1b2f523c
719 parent: 10:34f23ac6ac12
719 parent: 10:34f23ac6ac12
720 user: test
720 user: test
721 date: Thu Jan 01 00:00:00 1970 +0000
721 date: Thu Jan 01 00:00:00 1970 +0000
722 summary: removed large
722 summary: removed large
723
723
724 changeset: 13:0a3e75774479
724 changeset: 13:0a3e75774479
725 user: test
725 user: test
726 date: Thu Jan 01 00:00:00 1970 +0000
726 date: Thu Jan 01 00:00:00 1970 +0000
727 summary: this used to add large8 as normal and commit both
727 summary: this used to add large8 as normal and commit both
728
728
729 changeset: 14:84f3d378175c
729 changeset: 14:84f3d378175c
730 user: test
730 user: test
731 date: Thu Jan 01 00:00:00 1970 +0000
731 date: Thu Jan 01 00:00:00 1970 +0000
732 summary: this used to not notice the rm
732 summary: this used to not notice the rm
733
733
734 searching for changes
734 searching for changes
735 largefiles to upload:
735 largefiles to upload:
736 foo
736 foo
737 large
737 large
738 large8
738 large8
739
739
740 $ cd ../a
740 $ cd ../a
741
741
742 Clone a largefiles repo.
742 Clone a largefiles repo.
743
743
744 $ hg clone . ../b
744 $ hg clone . ../b
745 updating to branch default
745 updating to branch default
746 getting changed largefiles
746 getting changed largefiles
747 3 largefiles updated, 0 removed
747 3 largefiles updated, 0 removed
748 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
748 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
749 $ cd ../b
749 $ cd ../b
750 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
750 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
751 7:daea875e9014 add/edit more largefiles
751 7:daea875e9014 add/edit more largefiles
752 6:4355d653f84f edit files yet again
752 6:4355d653f84f edit files yet again
753 5:9d5af5072dbd edit files again
753 5:9d5af5072dbd edit files again
754 4:74c02385b94c move files
754 4:74c02385b94c move files
755 3:9e8fbc4bce62 copy files
755 3:9e8fbc4bce62 copy files
756 2:51a0ae4d5864 remove files
756 2:51a0ae4d5864 remove files
757 1:ce8896473775 edit files
757 1:ce8896473775 edit files
758 0:30d30fe6a5be add files
758 0:30d30fe6a5be add files
759 $ cat normal3
759 $ cat normal3
760 normal33
760 normal33
761 $ cat sub/normal4
761 $ cat sub/normal4
762 normal44
762 normal44
763 $ cat sub/large4
763 $ cat sub/large4
764 large44
764 large44
765 $ cat sub2/large6
765 $ cat sub2/large6
766 large6
766 large6
767 $ cat sub2/large7
767 $ cat sub2/large7
768 large7
768 large7
769 $ cd ..
769 $ cd ..
770 $ hg clone a -r 3 c
770 $ hg clone a -r 3 c
771 adding changesets
771 adding changesets
772 adding manifests
772 adding manifests
773 adding file changes
773 adding file changes
774 added 4 changesets with 10 changes to 4 files
774 added 4 changesets with 10 changes to 4 files
775 updating to branch default
775 updating to branch default
776 getting changed largefiles
776 getting changed largefiles
777 2 largefiles updated, 0 removed
777 2 largefiles updated, 0 removed
778 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
778 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
779 $ cd c
779 $ cd c
780 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
780 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
781 3:9e8fbc4bce62 copy files
781 3:9e8fbc4bce62 copy files
782 2:51a0ae4d5864 remove files
782 2:51a0ae4d5864 remove files
783 1:ce8896473775 edit files
783 1:ce8896473775 edit files
784 0:30d30fe6a5be add files
784 0:30d30fe6a5be add files
785 $ cat normal1
785 $ cat normal1
786 normal22
786 normal22
787 $ cat large1
787 $ cat large1
788 large22
788 large22
789 $ cat sub/normal2
789 $ cat sub/normal2
790 normal22
790 normal22
791 $ cat sub/large2
791 $ cat sub/large2
792 large22
792 large22
793
793
794 Old revisions of a clone have correct largefiles content (this also
794 Old revisions of a clone have correct largefiles content (this also
795 tests update).
795 tests update).
796
796
797 $ hg update -r 1
797 $ hg update -r 1
798 getting changed largefiles
798 getting changed largefiles
799 1 largefiles updated, 0 removed
799 1 largefiles updated, 0 removed
800 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
800 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
801 $ cat large1
801 $ cat large1
802 large11
802 large11
803 $ cat sub/large2
803 $ cat sub/large2
804 large22
804 large22
805 $ cd ..
805 $ cd ..
806
806
807 Test cloning with --all-largefiles flag
807 Test cloning with --all-largefiles flag
808
808
809 $ rm "${USERCACHE}"/*
809 $ rm "${USERCACHE}"/*
810 $ hg clone --all-largefiles a a-backup
810 $ hg clone --all-largefiles a a-backup
811 updating to branch default
811 updating to branch default
812 getting changed largefiles
812 getting changed largefiles
813 3 largefiles updated, 0 removed
813 3 largefiles updated, 0 removed
814 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
814 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
815 8 additional largefiles cached
815 8 additional largefiles cached
816
816
817 $ rm "${USERCACHE}"/*
817 $ rm "${USERCACHE}"/*
818 $ hg clone --all-largefiles -u 0 a a-clone0
818 $ hg clone --all-largefiles -u 0 a a-clone0
819 updating to branch default
819 updating to branch default
820 getting changed largefiles
820 getting changed largefiles
821 2 largefiles updated, 0 removed
821 2 largefiles updated, 0 removed
822 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
822 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
823 9 additional largefiles cached
823 9 additional largefiles cached
824 $ hg -R a-clone0 sum
824 $ hg -R a-clone0 sum
825 parent: 0:30d30fe6a5be
825 parent: 0:30d30fe6a5be
826 add files
826 add files
827 branch: default
827 branch: default
828 commit: (clean)
828 commit: (clean)
829 update: 7 new changesets (update)
829 update: 7 new changesets (update)
830
830
831 $ rm "${USERCACHE}"/*
831 $ rm "${USERCACHE}"/*
832 $ hg clone --all-largefiles -u 1 a a-clone1
832 $ hg clone --all-largefiles -u 1 a a-clone1
833 updating to branch default
833 updating to branch default
834 getting changed largefiles
834 getting changed largefiles
835 2 largefiles updated, 0 removed
835 2 largefiles updated, 0 removed
836 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
836 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
837 8 additional largefiles cached
837 8 additional largefiles cached
838 $ hg -R a-clone1 verify --large --lfa --lfc
838 $ hg -R a-clone1 verify --large --lfa --lfc
839 checking changesets
839 checking changesets
840 checking manifests
840 checking manifests
841 crosschecking files in changesets and manifests
841 crosschecking files in changesets and manifests
842 checking files
842 checking files
843 10 files, 8 changesets, 24 total revisions
843 10 files, 8 changesets, 24 total revisions
844 searching 8 changesets for largefiles
844 searching 8 changesets for largefiles
845 verified contents of 13 revisions of 6 largefiles
845 verified contents of 13 revisions of 6 largefiles
846 $ hg -R a-clone1 sum
846 $ hg -R a-clone1 sum
847 parent: 1:ce8896473775
847 parent: 1:ce8896473775
848 edit files
848 edit files
849 branch: default
849 branch: default
850 commit: (clean)
850 commit: (clean)
851 update: 6 new changesets (update)
851 update: 6 new changesets (update)
852
852
853 $ rm "${USERCACHE}"/*
853 $ rm "${USERCACHE}"/*
854 $ hg clone --all-largefiles -U a a-clone-u
854 $ hg clone --all-largefiles -U a a-clone-u
855 11 additional largefiles cached
855 11 additional largefiles cached
856 $ hg -R a-clone-u sum
856 $ hg -R a-clone-u sum
857 parent: -1:000000000000 (no revision checked out)
857 parent: -1:000000000000 (no revision checked out)
858 branch: default
858 branch: default
859 commit: (clean)
859 commit: (clean)
860 update: 8 new changesets (update)
860 update: 8 new changesets (update)
861
861
862 Show computed destination directory:
862 Show computed destination directory:
863
863
864 $ mkdir xyz
864 $ mkdir xyz
865 $ cd xyz
865 $ cd xyz
866 $ hg clone ../a
866 $ hg clone ../a
867 destination directory: a
867 destination directory: a
868 updating to branch default
868 updating to branch default
869 getting changed largefiles
869 getting changed largefiles
870 3 largefiles updated, 0 removed
870 3 largefiles updated, 0 removed
871 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
871 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
872 $ cd ..
872 $ cd ..
873
873
874 Clone URL without path:
874 Clone URL without path:
875
875
876 $ hg clone file://
876 $ hg clone file://
877 abort: repository / not found!
877 abort: repository / not found!
878 [255]
878 [255]
879
879
880 Ensure base clone command argument validation
880 Ensure base clone command argument validation
881
881
882 $ hg clone -U -u 0 a a-clone-failure
882 $ hg clone -U -u 0 a a-clone-failure
883 abort: cannot specify both --noupdate and --updaterev
883 abort: cannot specify both --noupdate and --updaterev
884 [255]
884 [255]
885
885
886 $ hg clone --all-largefiles a ssh://localhost/a
886 $ hg clone --all-largefiles a ssh://localhost/a
887 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
887 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
888 [255]
888 [255]
889
889
890 Test pulling with --all-largefiles flag. Also test that the largefiles are
890 Test pulling with --all-largefiles flag. Also test that the largefiles are
891 downloaded from 'default' instead of 'default-push' when no source is specified
891 downloaded from 'default' instead of 'default-push' when no source is specified
892 (issue3584)
892 (issue3584)
893
893
894 $ rm -Rf a-backup
894 $ rm -Rf a-backup
895 $ hg clone -r 1 a a-backup
895 $ hg clone -r 1 a a-backup
896 adding changesets
896 adding changesets
897 adding manifests
897 adding manifests
898 adding file changes
898 adding file changes
899 added 2 changesets with 8 changes to 4 files
899 added 2 changesets with 8 changes to 4 files
900 updating to branch default
900 updating to branch default
901 getting changed largefiles
901 getting changed largefiles
902 2 largefiles updated, 0 removed
902 2 largefiles updated, 0 removed
903 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
903 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
904 $ rm "${USERCACHE}"/*
904 $ rm "${USERCACHE}"/*
905 $ cd a-backup
905 $ cd a-backup
906 $ hg pull --all-largefiles --config paths.default-push=bogus/path
906 $ hg pull --all-largefiles --config paths.default-push=bogus/path
907 pulling from $TESTTMP/a (glob)
907 pulling from $TESTTMP/a (glob)
908 searching for changes
908 searching for changes
909 adding changesets
909 adding changesets
910 adding manifests
910 adding manifests
911 adding file changes
911 adding file changes
912 added 6 changesets with 16 changes to 8 files
912 added 6 changesets with 16 changes to 8 files
913 (run 'hg update' to get a working copy)
913 (run 'hg update' to get a working copy)
914 6 largefiles cached
914 6 largefiles cached
915
915
916 redo pull with --lfrev and check it pulls largefiles for the right revs
916 redo pull with --lfrev and check it pulls largefiles for the right revs
917
917
918 $ hg rollback
918 $ hg rollback
919 repository tip rolled back to revision 1 (undo pull)
919 repository tip rolled back to revision 1 (undo pull)
920 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
920 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
921 pulling from $TESTTMP/a (glob)
921 pulling from $TESTTMP/a (glob)
922 searching for changes
922 searching for changes
923 all local heads known remotely
923 all local heads known remotely
924 6 changesets found
924 6 changesets found
925 adding changesets
925 adding changesets
926 adding manifests
926 adding manifests
927 adding file changes
927 adding file changes
928 added 6 changesets with 16 changes to 8 files
928 added 6 changesets with 16 changes to 8 files
929 calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob)
929 calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob)
930 (run 'hg update' to get a working copy)
930 (run 'hg update' to get a working copy)
931 pulling largefiles for revision 7
931 pulling largefiles for revision 7
932 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
932 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
933 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
933 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
934 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
934 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
935 pulling largefiles for revision 2
935 pulling largefiles for revision 2
936 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
936 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
937 0 largefiles cached
937 0 largefiles cached
938
938
939 lfpull
939 lfpull
940
940
941 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
941 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
942 2 largefiles cached
942 2 largefiles cached
943 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
943 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
944 pulling largefiles for revision 4
944 pulling largefiles for revision 4
945 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
945 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
946 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
946 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
947 pulling largefiles for revision 2
947 pulling largefiles for revision 2
948 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
948 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
949 0 largefiles cached
949 0 largefiles cached
950
950
951 $ ls usercache-lfpull/* | sort
951 $ ls usercache-lfpull/* | sort
952 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
952 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
953 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
953 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
954
954
955 $ cd ..
955 $ cd ..
956
956
957 Rebasing between two repositories does not revert largefiles to old
957 Rebasing between two repositories does not revert largefiles to old
958 revisions (this was a very bad bug that took a lot of work to fix).
958 revisions (this was a very bad bug that took a lot of work to fix).
959
959
960 $ hg clone a d
960 $ hg clone a d
961 updating to branch default
961 updating to branch default
962 getting changed largefiles
962 getting changed largefiles
963 3 largefiles updated, 0 removed
963 3 largefiles updated, 0 removed
964 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
964 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
965 $ cd b
965 $ cd b
966 $ echo large4-modified > sub/large4
966 $ echo large4-modified > sub/large4
967 $ echo normal3-modified > normal3
967 $ echo normal3-modified > normal3
968 $ hg commit -m "modify normal file and largefile in repo b"
968 $ hg commit -m "modify normal file and largefile in repo b"
969 Invoking status precommit hook
969 Invoking status precommit hook
970 M normal3
970 M normal3
971 M sub/large4
971 M sub/large4
972 $ cd ../d
972 $ cd ../d
973 $ echo large6-modified > sub2/large6
973 $ echo large6-modified > sub2/large6
974 $ echo normal4-modified > sub/normal4
974 $ echo normal4-modified > sub/normal4
975 $ hg commit -m "modify normal file largefile in repo d"
975 $ hg commit -m "modify normal file largefile in repo d"
976 Invoking status precommit hook
976 Invoking status precommit hook
977 M sub/normal4
977 M sub/normal4
978 M sub2/large6
978 M sub2/large6
979 $ cd ..
979 $ cd ..
980 $ hg clone d e
980 $ hg clone d e
981 updating to branch default
981 updating to branch default
982 getting changed largefiles
982 getting changed largefiles
983 3 largefiles updated, 0 removed
983 3 largefiles updated, 0 removed
984 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
984 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
985 $ cd d
985 $ cd d
986
986
987 More rebase testing, but also test that the largefiles are downloaded from
987 More rebase testing, but also test that the largefiles are downloaded from
988 'default-push' when no source is specified (issue3584). (The largefile from the
988 'default-push' when no source is specified (issue3584). (The largefile from the
989 pulled revision is however not downloaded but found in the local cache.)
989 pulled revision is however not downloaded but found in the local cache.)
990 Largefiles are fetched for the new pulled revision, not for existing revisions,
990 Largefiles are fetched for the new pulled revision, not for existing revisions,
991 rebased or not.
991 rebased or not.
992
992
993 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
993 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
994 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
994 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
995 pulling from $TESTTMP/b (glob)
995 pulling from $TESTTMP/b (glob)
996 searching for changes
996 searching for changes
997 adding changesets
997 adding changesets
998 adding manifests
998 adding manifests
999 adding file changes
999 adding file changes
1000 added 1 changesets with 2 changes to 2 files (+1 heads)
1000 added 1 changesets with 2 changes to 2 files (+1 heads)
1001 Invoking status precommit hook
1001 Invoking status precommit hook
1002 M sub/normal4
1002 M sub/normal4
1003 M sub2/large6
1003 M sub2/large6
1004 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1004 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1005 0 largefiles cached
1005 0 largefiles cached
1006 nothing to rebase
1006 nothing to rebase
1007 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1007 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
1008 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1008 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1009 9:598410d3eb9a modify normal file largefile in repo d
1009 9:598410d3eb9a modify normal file largefile in repo d
1010 8:a381d2c8c80e modify normal file and largefile in repo b
1010 8:a381d2c8c80e modify normal file and largefile in repo b
1011 7:daea875e9014 add/edit more largefiles
1011 7:daea875e9014 add/edit more largefiles
1012 6:4355d653f84f edit files yet again
1012 6:4355d653f84f edit files yet again
1013 5:9d5af5072dbd edit files again
1013 5:9d5af5072dbd edit files again
1014 4:74c02385b94c move files
1014 4:74c02385b94c move files
1015 3:9e8fbc4bce62 copy files
1015 3:9e8fbc4bce62 copy files
1016 2:51a0ae4d5864 remove files
1016 2:51a0ae4d5864 remove files
1017 1:ce8896473775 edit files
1017 1:ce8896473775 edit files
1018 0:30d30fe6a5be add files
1018 0:30d30fe6a5be add files
1019 $ cat normal3
1019 $ cat normal3
1020 normal3-modified
1020 normal3-modified
1021 $ cat sub/normal4
1021 $ cat sub/normal4
1022 normal4-modified
1022 normal4-modified
1023 $ cat sub/large4
1023 $ cat sub/large4
1024 large4-modified
1024 large4-modified
1025 $ cat sub2/large6
1025 $ cat sub2/large6
1026 large6-modified
1026 large6-modified
1027 $ cat sub2/large7
1027 $ cat sub2/large7
1028 large7
1028 large7
1029 $ cd ../e
1029 $ cd ../e
1030 $ hg pull ../b
1030 $ hg pull ../b
1031 pulling from ../b
1031 pulling from ../b
1032 searching for changes
1032 searching for changes
1033 adding changesets
1033 adding changesets
1034 adding manifests
1034 adding manifests
1035 adding file changes
1035 adding file changes
1036 added 1 changesets with 2 changes to 2 files (+1 heads)
1036 added 1 changesets with 2 changes to 2 files (+1 heads)
1037 (run 'hg heads' to see heads, 'hg merge' to merge)
1037 (run 'hg heads' to see heads, 'hg merge' to merge)
1038 $ hg rebase
1038 $ hg rebase
1039 Invoking status precommit hook
1039 Invoking status precommit hook
1040 M sub/normal4
1040 M sub/normal4
1041 M sub2/large6
1041 M sub2/large6
1042 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1042 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1043 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1043 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1044 9:598410d3eb9a modify normal file largefile in repo d
1044 9:598410d3eb9a modify normal file largefile in repo d
1045 8:a381d2c8c80e modify normal file and largefile in repo b
1045 8:a381d2c8c80e modify normal file and largefile in repo b
1046 7:daea875e9014 add/edit more largefiles
1046 7:daea875e9014 add/edit more largefiles
1047 6:4355d653f84f edit files yet again
1047 6:4355d653f84f edit files yet again
1048 5:9d5af5072dbd edit files again
1048 5:9d5af5072dbd edit files again
1049 4:74c02385b94c move files
1049 4:74c02385b94c move files
1050 3:9e8fbc4bce62 copy files
1050 3:9e8fbc4bce62 copy files
1051 2:51a0ae4d5864 remove files
1051 2:51a0ae4d5864 remove files
1052 1:ce8896473775 edit files
1052 1:ce8896473775 edit files
1053 0:30d30fe6a5be add files
1053 0:30d30fe6a5be add files
1054 $ cat normal3
1054 $ cat normal3
1055 normal3-modified
1055 normal3-modified
1056 $ cat sub/normal4
1056 $ cat sub/normal4
1057 normal4-modified
1057 normal4-modified
1058 $ cat sub/large4
1058 $ cat sub/large4
1059 large4-modified
1059 large4-modified
1060 $ cat sub2/large6
1060 $ cat sub2/large6
1061 large6-modified
1061 large6-modified
1062 $ cat sub2/large7
1062 $ cat sub2/large7
1063 large7
1063 large7
1064
1064
1065 Log on largefiles
1065 Log on largefiles
1066
1066
1067 - same output
1067 - same output
1068 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1068 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1069 8:a381d2c8c80e modify normal file and largefile in repo b
1069 8:a381d2c8c80e modify normal file and largefile in repo b
1070 6:4355d653f84f edit files yet again
1070 6:4355d653f84f edit files yet again
1071 5:9d5af5072dbd edit files again
1071 5:9d5af5072dbd edit files again
1072 4:74c02385b94c move files
1072 4:74c02385b94c move files
1073 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1073 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1074 8:a381d2c8c80e modify normal file and largefile in repo b
1074 8:a381d2c8c80e modify normal file and largefile in repo b
1075 6:4355d653f84f edit files yet again
1075 6:4355d653f84f edit files yet again
1076 5:9d5af5072dbd edit files again
1076 5:9d5af5072dbd edit files again
1077 4:74c02385b94c move files
1077 4:74c02385b94c move files
1078
1078
1079 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1079 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1080 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1080 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1081 8:a381d2c8c80e modify normal file and largefile in repo b
1081 8:a381d2c8c80e modify normal file and largefile in repo b
1082 6:4355d653f84f edit files yet again
1082 6:4355d653f84f edit files yet again
1083 5:9d5af5072dbd edit files again
1083 5:9d5af5072dbd edit files again
1084 4:74c02385b94c move files
1084 4:74c02385b94c move files
1085 1:ce8896473775 edit files
1085 1:ce8896473775 edit files
1086 0:30d30fe6a5be add files
1086 0:30d30fe6a5be add files
1087 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1087 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1088 9:598410d3eb9a modify normal file largefile in repo d
1088 9:598410d3eb9a modify normal file largefile in repo d
1089 8:a381d2c8c80e modify normal file and largefile in repo b
1089 8:a381d2c8c80e modify normal file and largefile in repo b
1090 6:4355d653f84f edit files yet again
1090 6:4355d653f84f edit files yet again
1091 5:9d5af5072dbd edit files again
1091 5:9d5af5072dbd edit files again
1092 4:74c02385b94c move files
1092 4:74c02385b94c move files
1093 1:ce8896473775 edit files
1093 1:ce8896473775 edit files
1094 0:30d30fe6a5be add files
1094 0:30d30fe6a5be add files
1095
1095
1096 - globbing gives same result
1096 - globbing gives same result
1097 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1097 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1098 9:598410d3eb9a modify normal file largefile in repo d
1098 9:598410d3eb9a modify normal file largefile in repo d
1099 8:a381d2c8c80e modify normal file and largefile in repo b
1099 8:a381d2c8c80e modify normal file and largefile in repo b
1100 6:4355d653f84f edit files yet again
1100 6:4355d653f84f edit files yet again
1101 5:9d5af5072dbd edit files again
1101 5:9d5af5072dbd edit files again
1102 4:74c02385b94c move files
1102 4:74c02385b94c move files
1103 1:ce8896473775 edit files
1103 1:ce8896473775 edit files
1104 0:30d30fe6a5be add files
1104 0:30d30fe6a5be add files
1105
1105
1106 Rollback on largefiles.
1106 Rollback on largefiles.
1107
1107
1108 $ echo large4-modified-again > sub/large4
1108 $ echo large4-modified-again > sub/large4
1109 $ hg commit -m "Modify large4 again"
1109 $ hg commit -m "Modify large4 again"
1110 Invoking status precommit hook
1110 Invoking status precommit hook
1111 M sub/large4
1111 M sub/large4
1112 $ hg rollback
1112 $ hg rollback
1113 repository tip rolled back to revision 9 (undo commit)
1113 repository tip rolled back to revision 9 (undo commit)
1114 working directory now based on revision 9
1114 working directory now based on revision 9
1115 $ hg st
1115 $ hg st
1116 M sub/large4
1116 M sub/large4
1117 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1117 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1118 9:598410d3eb9a modify normal file largefile in repo d
1118 9:598410d3eb9a modify normal file largefile in repo d
1119 8:a381d2c8c80e modify normal file and largefile in repo b
1119 8:a381d2c8c80e modify normal file and largefile in repo b
1120 7:daea875e9014 add/edit more largefiles
1120 7:daea875e9014 add/edit more largefiles
1121 6:4355d653f84f edit files yet again
1121 6:4355d653f84f edit files yet again
1122 5:9d5af5072dbd edit files again
1122 5:9d5af5072dbd edit files again
1123 4:74c02385b94c move files
1123 4:74c02385b94c move files
1124 3:9e8fbc4bce62 copy files
1124 3:9e8fbc4bce62 copy files
1125 2:51a0ae4d5864 remove files
1125 2:51a0ae4d5864 remove files
1126 1:ce8896473775 edit files
1126 1:ce8896473775 edit files
1127 0:30d30fe6a5be add files
1127 0:30d30fe6a5be add files
1128 $ cat sub/large4
1128 $ cat sub/large4
1129 large4-modified-again
1129 large4-modified-again
1130
1130
1131 "update --check" refuses to update with uncommitted changes.
1131 "update --check" refuses to update with uncommitted changes.
1132 $ hg update --check 8
1132 $ hg update --check 8
1133 abort: uncommitted local changes
1133 abort: uncommitted local changes
1134 [255]
1134 [255]
1135
1135
1136 "update --clean" leaves correct largefiles in working copy, even when there is
1136 "update --clean" leaves correct largefiles in working copy, even when there is
1137 .orig files from revert in .hglf.
1137 .orig files from revert in .hglf.
1138
1138
1139 $ echo mistake > sub2/large7
1139 $ echo mistake > sub2/large7
1140 $ hg revert sub2/large7
1140 $ hg revert sub2/large7
1141 $ hg -q update --clean -r null
1141 $ hg -q update --clean -r null
1142 $ hg update --clean
1142 $ hg update --clean
1143 getting changed largefiles
1143 getting changed largefiles
1144 3 largefiles updated, 0 removed
1144 3 largefiles updated, 0 removed
1145 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1145 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1146 $ cat normal3
1146 $ cat normal3
1147 normal3-modified
1147 normal3-modified
1148 $ cat sub/normal4
1148 $ cat sub/normal4
1149 normal4-modified
1149 normal4-modified
1150 $ cat sub/large4
1150 $ cat sub/large4
1151 large4-modified
1151 large4-modified
1152 $ cat sub2/large6
1152 $ cat sub2/large6
1153 large6-modified
1153 large6-modified
1154 $ cat sub2/large7
1154 $ cat sub2/large7
1155 large7
1155 large7
1156 $ cat sub2/large7.orig
1156 $ cat sub2/large7.orig
1157 mistake
1157 mistake
1158 $ cat .hglf/sub2/large7.orig
1158 $ cat .hglf/sub2/large7.orig
1159 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1159 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1160
1160
1161 demonstrate misfeature: .orig file is overwritten on every update -C,
1161 demonstrate misfeature: .orig file is overwritten on every update -C,
1162 also when clean:
1162 also when clean:
1163 $ hg update --clean
1163 $ hg update --clean
1164 getting changed largefiles
1164 getting changed largefiles
1165 0 largefiles updated, 0 removed
1165 0 largefiles updated, 0 removed
1166 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1166 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1167 $ cat sub2/large7.orig
1167 $ cat sub2/large7.orig
1168 large7
1168 large7
1169 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1169 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1170
1170
1171 Now "update check" is happy.
1171 Now "update check" is happy.
1172 $ hg update --check 8
1172 $ hg update --check 8
1173 getting changed largefiles
1173 getting changed largefiles
1174 1 largefiles updated, 0 removed
1174 1 largefiles updated, 0 removed
1175 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1175 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1176 $ hg update --check
1176 $ hg update --check
1177 getting changed largefiles
1177 getting changed largefiles
1178 1 largefiles updated, 0 removed
1178 1 largefiles updated, 0 removed
1179 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1179 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1180
1180
1181 Test removing empty largefiles directories on update
1181 Test removing empty largefiles directories on update
1182 $ test -d sub2 && echo "sub2 exists"
1182 $ test -d sub2 && echo "sub2 exists"
1183 sub2 exists
1183 sub2 exists
1184 $ hg update -q null
1184 $ hg update -q null
1185 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1185 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1186 [1]
1186 [1]
1187 $ hg update -q
1187 $ hg update -q
1188
1188
1189 Test hg remove removes empty largefiles directories
1189 Test hg remove removes empty largefiles directories
1190 $ test -d sub2 && echo "sub2 exists"
1190 $ test -d sub2 && echo "sub2 exists"
1191 sub2 exists
1191 sub2 exists
1192 $ hg remove sub2/*
1192 $ hg remove sub2/*
1193 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1193 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1194 [1]
1194 [1]
1195 $ hg revert sub2/large6 sub2/large7
1195 $ hg revert sub2/large6 sub2/large7
1196
1196
1197 "revert" works on largefiles (and normal files too).
1197 "revert" works on largefiles (and normal files too).
1198 $ echo hack3 >> normal3
1198 $ echo hack3 >> normal3
1199 $ echo hack4 >> sub/normal4
1199 $ echo hack4 >> sub/normal4
1200 $ echo hack4 >> sub/large4
1200 $ echo hack4 >> sub/large4
1201 $ rm sub2/large6
1201 $ rm sub2/large6
1202 $ hg revert sub2/large6
1202 $ hg revert sub2/large6
1203 $ hg rm sub2/large6
1203 $ hg rm sub2/large6
1204 $ echo new >> sub2/large8
1204 $ echo new >> sub2/large8
1205 $ hg add --large sub2/large8
1205 $ hg add --large sub2/large8
1206 # XXX we don't really want to report that we're reverting the standin;
1206 # XXX we don't really want to report that we're reverting the standin;
1207 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1207 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1208 $ hg revert sub
1208 $ hg revert sub
1209 reverting .hglf/sub/large4 (glob)
1209 reverting .hglf/sub/large4 (glob)
1210 reverting sub/normal4 (glob)
1210 reverting sub/normal4 (glob)
1211 $ hg status
1211 $ hg status
1212 M normal3
1212 M normal3
1213 A sub2/large8
1213 A sub2/large8
1214 R sub2/large6
1214 R sub2/large6
1215 ? sub/large4.orig
1215 ? sub/large4.orig
1216 ? sub/normal4.orig
1216 ? sub/normal4.orig
1217 $ cat sub/normal4
1217 $ cat sub/normal4
1218 normal4-modified
1218 normal4-modified
1219 $ cat sub/large4
1219 $ cat sub/large4
1220 large4-modified
1220 large4-modified
1221 $ hg revert -a --no-backup
1221 $ hg revert -a --no-backup
1222 undeleting .hglf/sub2/large6 (glob)
1222 undeleting .hglf/sub2/large6 (glob)
1223 forgetting .hglf/sub2/large8 (glob)
1223 forgetting .hglf/sub2/large8 (glob)
1224 reverting normal3
1224 reverting normal3
1225 $ hg status
1225 $ hg status
1226 ? sub/large4.orig
1226 ? sub/large4.orig
1227 ? sub/normal4.orig
1227 ? sub/normal4.orig
1228 ? sub2/large8
1228 ? sub2/large8
1229 $ cat normal3
1229 $ cat normal3
1230 normal3-modified
1230 normal3-modified
1231 $ cat sub2/large6
1231 $ cat sub2/large6
1232 large6-modified
1232 large6-modified
1233 $ rm sub/*.orig sub2/large8
1233 $ rm sub/*.orig sub2/large8
1234
1234
1235 revert some files to an older revision
1235 revert some files to an older revision
1236 $ hg revert --no-backup -r 8 sub2
1236 $ hg revert --no-backup -r 8 sub2
1237 reverting .hglf/sub2/large6 (glob)
1237 reverting .hglf/sub2/large6 (glob)
1238 $ cat sub2/large6
1238 $ cat sub2/large6
1239 large6
1239 large6
1240 $ hg revert --no-backup -C -r '.^' sub2
1240 $ hg revert --no-backup -C -r '.^' sub2
1241 reverting .hglf/sub2/large6 (glob)
1241 reverting .hglf/sub2/large6 (glob)
1242 $ hg revert --no-backup sub2
1242 $ hg revert --no-backup sub2
1243 reverting .hglf/sub2/large6 (glob)
1243 reverting .hglf/sub2/large6 (glob)
1244 $ hg status
1244 $ hg status
1245
1245
1246 "verify --large" actually verifies largefiles
1246 "verify --large" actually verifies largefiles
1247
1247
1248 - Where Do We Come From? What Are We? Where Are We Going?
1248 - Where Do We Come From? What Are We? Where Are We Going?
1249 $ pwd
1249 $ pwd
1250 $TESTTMP/e
1250 $TESTTMP/e
1251 $ hg paths
1251 $ hg paths
1252 default = $TESTTMP/d (glob)
1252 default = $TESTTMP/d (glob)
1253
1253
1254 $ hg verify --large
1254 $ hg verify --large
1255 checking changesets
1255 checking changesets
1256 checking manifests
1256 checking manifests
1257 crosschecking files in changesets and manifests
1257 crosschecking files in changesets and manifests
1258 checking files
1258 checking files
1259 10 files, 10 changesets, 28 total revisions
1259 10 files, 10 changesets, 28 total revisions
1260 searching 1 changesets for largefiles
1260 searching 1 changesets for largefiles
1261 verified existence of 3 revisions of 3 largefiles
1261 verified existence of 3 revisions of 3 largefiles
1262
1262
1263 - introduce missing blob in local store repo and make sure that this is caught:
1263 - introduce missing blob in local store repo and make sure that this is caught:
1264 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1264 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1265 $ hg verify --large
1265 $ hg verify --large
1266 checking changesets
1266 checking changesets
1267 checking manifests
1267 checking manifests
1268 crosschecking files in changesets and manifests
1268 crosschecking files in changesets and manifests
1269 checking files
1269 checking files
1270 10 files, 10 changesets, 28 total revisions
1270 10 files, 10 changesets, 28 total revisions
1271 searching 1 changesets for largefiles
1271 searching 1 changesets for largefiles
1272 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1272 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1273 verified existence of 3 revisions of 3 largefiles
1273 verified existence of 3 revisions of 3 largefiles
1274 [1]
1274 [1]
1275
1275
1276 - introduce corruption and make sure that it is caught when checking content:
1276 - introduce corruption and make sure that it is caught when checking content:
1277 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1277 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1278 $ hg verify -q --large --lfc
1278 $ hg verify -q --large --lfc
1279 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1279 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1280 [1]
1280 [1]
1281
1281
1282 - cleanup
1282 - cleanup
1283 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1283 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1284
1284
1285 - verifying all revisions will fail because we didn't clone all largefiles to d:
1285 - verifying all revisions will fail because we didn't clone all largefiles to d:
1286 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1286 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1287 $ hg verify -q --lfa --lfc
1287 $ hg verify -q --lfa --lfc
1288 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1288 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1289 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1289 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1290 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1290 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1291 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1291 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1292 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1292 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1293 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1293 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1294 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1294 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1295 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1295 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1296 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1296 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1297 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1297 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1298 [1]
1298 [1]
1299
1299
1300 - cleanup
1300 - cleanup
1301 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1301 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1302 $ rm -f .hglf/sub/*.orig
1302 $ rm -f .hglf/sub/*.orig
1303
1303
1304 Update to revision with missing largefile - and make sure it really is missing
1304 Update to revision with missing largefile - and make sure it really is missing
1305
1305
1306 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1306 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1307 $ hg up -r 6
1307 $ hg up -r 6
1308 getting changed largefiles
1308 getting changed largefiles
1309 error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob)
1309 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d
1310 1 largefiles updated, 2 removed
1310 1 largefiles updated, 2 removed
1311 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1311 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1312 $ rm normal3
1312 $ rm normal3
1313 $ echo >> sub/normal4
1313 $ echo >> sub/normal4
1314 $ hg ci -m 'commit with missing files'
1314 $ hg ci -m 'commit with missing files'
1315 Invoking status precommit hook
1315 Invoking status precommit hook
1316 M sub/normal4
1316 M sub/normal4
1317 ! large3
1317 ! large3
1318 ! normal3
1318 ! normal3
1319 created new head
1319 created new head
1320 $ hg st
1320 $ hg st
1321 ! large3
1321 ! large3
1322 ! normal3
1322 ! normal3
1323 $ hg up -r.
1323 $ hg up -r.
1324 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1324 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1325 $ hg st
1325 $ hg st
1326 ! large3
1326 ! large3
1327 ! normal3
1327 ! normal3
1328 $ hg up -Cr.
1328 $ hg up -Cr.
1329 getting changed largefiles
1329 getting changed largefiles
1330 error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob)
1330 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d
1331 0 largefiles updated, 0 removed
1331 0 largefiles updated, 0 removed
1332 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1332 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1333 $ hg st
1333 $ hg st
1334 ! large3
1334 ! large3
1335 $ hg rollback
1335 $ hg rollback
1336 repository tip rolled back to revision 9 (undo commit)
1336 repository tip rolled back to revision 9 (undo commit)
1337 working directory now based on revision 6
1337 working directory now based on revision 6
1338
1338
1339 Merge with revision with missing largefile - and make sure it tries to fetch it.
1339 Merge with revision with missing largefile - and make sure it tries to fetch it.
1340
1340
1341 $ hg up -Cqr null
1341 $ hg up -Cqr null
1342 $ echo f > f
1342 $ echo f > f
1343 $ hg ci -Am branch
1343 $ hg ci -Am branch
1344 adding f
1344 adding f
1345 Invoking status precommit hook
1345 Invoking status precommit hook
1346 A f
1346 A f
1347 created new head
1347 created new head
1348 $ hg merge -r 6
1348 $ hg merge -r 6
1349 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1349 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1350 (branch merge, don't forget to commit)
1350 (branch merge, don't forget to commit)
1351 getting changed largefiles
1351 getting changed largefiles
1352 error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob)
1352 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:$TESTTMP/d
1353 1 largefiles updated, 0 removed
1353 1 largefiles updated, 0 removed
1354
1354
1355 $ hg rollback -q
1355 $ hg rollback -q
1356 $ hg up -Cq
1356 $ hg up -Cq
1357
1357
1358 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1358 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1359
1359
1360 $ hg pull --all-largefiles
1360 $ hg pull --all-largefiles
1361 pulling from $TESTTMP/d (glob)
1361 pulling from $TESTTMP/d (glob)
1362 searching for changes
1362 searching for changes
1363 no changes found
1363 no changes found
1364
1364
1365 Merging does not revert to old versions of largefiles and also check
1365 Merging does not revert to old versions of largefiles and also check
1366 that merging after having pulled from a non-default remote works
1366 that merging after having pulled from a non-default remote works
1367 correctly.
1367 correctly.
1368
1368
1369 $ cd ..
1369 $ cd ..
1370 $ hg clone -r 7 e temp
1370 $ hg clone -r 7 e temp
1371 adding changesets
1371 adding changesets
1372 adding manifests
1372 adding manifests
1373 adding file changes
1373 adding file changes
1374 added 8 changesets with 24 changes to 10 files
1374 added 8 changesets with 24 changes to 10 files
1375 updating to branch default
1375 updating to branch default
1376 getting changed largefiles
1376 getting changed largefiles
1377 3 largefiles updated, 0 removed
1377 3 largefiles updated, 0 removed
1378 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1378 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1379 $ hg clone temp f
1379 $ hg clone temp f
1380 updating to branch default
1380 updating to branch default
1381 getting changed largefiles
1381 getting changed largefiles
1382 3 largefiles updated, 0 removed
1382 3 largefiles updated, 0 removed
1383 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1383 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1384 # Delete the largefiles in the largefiles system cache so that we have an
1384 # Delete the largefiles in the largefiles system cache so that we have an
1385 # opportunity to test that caching after a pull works.
1385 # opportunity to test that caching after a pull works.
1386 $ rm "${USERCACHE}"/*
1386 $ rm "${USERCACHE}"/*
1387 $ cd f
1387 $ cd f
1388 $ echo "large4-merge-test" > sub/large4
1388 $ echo "large4-merge-test" > sub/large4
1389 $ hg commit -m "Modify large4 to test merge"
1389 $ hg commit -m "Modify large4 to test merge"
1390 Invoking status precommit hook
1390 Invoking status precommit hook
1391 M sub/large4
1391 M sub/large4
1392 # Test --cache-largefiles flag
1392 # Test --cache-largefiles flag
1393 $ hg pull --lfrev 'heads(pulled())' ../e
1393 $ hg pull --lfrev 'heads(pulled())' ../e
1394 pulling from ../e
1394 pulling from ../e
1395 searching for changes
1395 searching for changes
1396 adding changesets
1396 adding changesets
1397 adding manifests
1397 adding manifests
1398 adding file changes
1398 adding file changes
1399 added 2 changesets with 4 changes to 4 files (+1 heads)
1399 added 2 changesets with 4 changes to 4 files (+1 heads)
1400 (run 'hg heads' to see heads, 'hg merge' to merge)
1400 (run 'hg heads' to see heads, 'hg merge' to merge)
1401 2 largefiles cached
1401 2 largefiles cached
1402 $ hg merge
1402 $ hg merge
1403 merging sub/large4
1403 merging sub/large4
1404 largefile sub/large4 has a merge conflict
1404 largefile sub/large4 has a merge conflict
1405 keep (l)ocal or take (o)ther? l
1405 keep (l)ocal or take (o)ther? l
1406 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1406 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1407 (branch merge, don't forget to commit)
1407 (branch merge, don't forget to commit)
1408 getting changed largefiles
1408 getting changed largefiles
1409 1 largefiles updated, 0 removed
1409 1 largefiles updated, 0 removed
1410 $ hg commit -m "Merge repos e and f"
1410 $ hg commit -m "Merge repos e and f"
1411 Invoking status precommit hook
1411 Invoking status precommit hook
1412 M normal3
1412 M normal3
1413 M sub/normal4
1413 M sub/normal4
1414 M sub2/large6
1414 M sub2/large6
1415 $ cat normal3
1415 $ cat normal3
1416 normal3-modified
1416 normal3-modified
1417 $ cat sub/normal4
1417 $ cat sub/normal4
1418 normal4-modified
1418 normal4-modified
1419 $ cat sub/large4
1419 $ cat sub/large4
1420 large4-merge-test
1420 large4-merge-test
1421 $ cat sub2/large6
1421 $ cat sub2/large6
1422 large6-modified
1422 large6-modified
1423 $ cat sub2/large7
1423 $ cat sub2/large7
1424 large7
1424 large7
1425
1425
1426 Test status after merging with a branch that introduces a new largefile:
1426 Test status after merging with a branch that introduces a new largefile:
1427
1427
1428 $ echo large > large
1428 $ echo large > large
1429 $ hg add --large large
1429 $ hg add --large large
1430 $ hg commit -m 'add largefile'
1430 $ hg commit -m 'add largefile'
1431 Invoking status precommit hook
1431 Invoking status precommit hook
1432 A large
1432 A large
1433 $ hg update -q ".^"
1433 $ hg update -q ".^"
1434 $ echo change >> normal3
1434 $ echo change >> normal3
1435 $ hg commit -m 'some change'
1435 $ hg commit -m 'some change'
1436 Invoking status precommit hook
1436 Invoking status precommit hook
1437 M normal3
1437 M normal3
1438 created new head
1438 created new head
1439 $ hg merge
1439 $ hg merge
1440 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1440 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1441 (branch merge, don't forget to commit)
1441 (branch merge, don't forget to commit)
1442 getting changed largefiles
1442 getting changed largefiles
1443 1 largefiles updated, 0 removed
1443 1 largefiles updated, 0 removed
1444 $ hg status
1444 $ hg status
1445 M large
1445 M large
1446
1446
1447 - make sure update of merge with removed largefiles fails as expected
1447 - make sure update of merge with removed largefiles fails as expected
1448 $ hg rm sub2/large6
1448 $ hg rm sub2/large6
1449 $ hg up -r.
1449 $ hg up -r.
1450 abort: outstanding uncommitted merges
1450 abort: outstanding uncommitted merges
1451 [255]
1451 [255]
1452
1452
1453 - revert should be able to revert files introduced in a pending merge
1453 - revert should be able to revert files introduced in a pending merge
1454 $ hg revert --all -r .
1454 $ hg revert --all -r .
1455 removing .hglf/large (glob)
1455 removing .hglf/large (glob)
1456 undeleting .hglf/sub2/large6 (glob)
1456 undeleting .hglf/sub2/large6 (glob)
1457
1457
1458 Test that a normal file and a largefile with the same name and path cannot
1458 Test that a normal file and a largefile with the same name and path cannot
1459 coexist.
1459 coexist.
1460
1460
1461 $ rm sub2/large7
1461 $ rm sub2/large7
1462 $ echo "largeasnormal" > sub2/large7
1462 $ echo "largeasnormal" > sub2/large7
1463 $ hg add sub2/large7
1463 $ hg add sub2/large7
1464 sub2/large7 already a largefile
1464 sub2/large7 already a largefile
1465
1465
1466 Test that transplanting a largefile change works correctly.
1466 Test that transplanting a largefile change works correctly.
1467
1467
1468 $ cd ..
1468 $ cd ..
1469 $ hg clone -r 8 d g
1469 $ hg clone -r 8 d g
1470 adding changesets
1470 adding changesets
1471 adding manifests
1471 adding manifests
1472 adding file changes
1472 adding file changes
1473 added 9 changesets with 26 changes to 10 files
1473 added 9 changesets with 26 changes to 10 files
1474 updating to branch default
1474 updating to branch default
1475 getting changed largefiles
1475 getting changed largefiles
1476 3 largefiles updated, 0 removed
1476 3 largefiles updated, 0 removed
1477 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1477 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1478 $ cd g
1478 $ cd g
1479 $ hg transplant -s ../d 598410d3eb9a
1479 $ hg transplant -s ../d 598410d3eb9a
1480 searching for changes
1480 searching for changes
1481 searching for changes
1481 searching for changes
1482 adding changesets
1482 adding changesets
1483 adding manifests
1483 adding manifests
1484 adding file changes
1484 adding file changes
1485 added 1 changesets with 2 changes to 2 files
1485 added 1 changesets with 2 changes to 2 files
1486 getting changed largefiles
1486 getting changed largefiles
1487 1 largefiles updated, 0 removed
1487 1 largefiles updated, 0 removed
1488 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1488 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1489 9:598410d3eb9a modify normal file largefile in repo d
1489 9:598410d3eb9a modify normal file largefile in repo d
1490 8:a381d2c8c80e modify normal file and largefile in repo b
1490 8:a381d2c8c80e modify normal file and largefile in repo b
1491 7:daea875e9014 add/edit more largefiles
1491 7:daea875e9014 add/edit more largefiles
1492 6:4355d653f84f edit files yet again
1492 6:4355d653f84f edit files yet again
1493 5:9d5af5072dbd edit files again
1493 5:9d5af5072dbd edit files again
1494 4:74c02385b94c move files
1494 4:74c02385b94c move files
1495 3:9e8fbc4bce62 copy files
1495 3:9e8fbc4bce62 copy files
1496 2:51a0ae4d5864 remove files
1496 2:51a0ae4d5864 remove files
1497 1:ce8896473775 edit files
1497 1:ce8896473775 edit files
1498 0:30d30fe6a5be add files
1498 0:30d30fe6a5be add files
1499 $ cat normal3
1499 $ cat normal3
1500 normal3-modified
1500 normal3-modified
1501 $ cat sub/normal4
1501 $ cat sub/normal4
1502 normal4-modified
1502 normal4-modified
1503 $ cat sub/large4
1503 $ cat sub/large4
1504 large4-modified
1504 large4-modified
1505 $ cat sub2/large6
1505 $ cat sub2/large6
1506 large6-modified
1506 large6-modified
1507 $ cat sub2/large7
1507 $ cat sub2/large7
1508 large7
1508 large7
1509
1509
1510 Cat a largefile
1510 Cat a largefile
1511 $ hg cat normal3
1511 $ hg cat normal3
1512 normal3-modified
1512 normal3-modified
1513 $ hg cat sub/large4
1513 $ hg cat sub/large4
1514 large4-modified
1514 large4-modified
1515 $ rm "${USERCACHE}"/*
1515 $ rm "${USERCACHE}"/*
1516 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1516 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1517 $ cat cat.out
1517 $ cat cat.out
1518 large4-modified
1518 large4-modified
1519 $ rm cat.out
1519 $ rm cat.out
1520 $ hg cat -r a381d2c8c80e normal3
1520 $ hg cat -r a381d2c8c80e normal3
1521 normal3-modified
1521 normal3-modified
1522 $ hg cat -r '.^' normal3
1522 $ hg cat -r '.^' normal3
1523 normal3-modified
1523 normal3-modified
1524 $ hg cat -r '.^' sub/large4 doesntexist
1524 $ hg cat -r '.^' sub/large4 doesntexist
1525 large4-modified
1525 large4-modified
1526 doesntexist: no such file in rev a381d2c8c80e
1526 doesntexist: no such file in rev a381d2c8c80e
1527 $ hg --cwd sub cat -r '.^' large4
1527 $ hg --cwd sub cat -r '.^' large4
1528 large4-modified
1528 large4-modified
1529 $ hg --cwd sub cat -r '.^' ../normal3
1529 $ hg --cwd sub cat -r '.^' ../normal3
1530 normal3-modified
1530 normal3-modified
1531
1531
1532 Test that renaming a largefile results in correct output for status
1532 Test that renaming a largefile results in correct output for status
1533
1533
1534 $ hg rename sub/large4 large4-renamed
1534 $ hg rename sub/large4 large4-renamed
1535 $ hg commit -m "test rename output"
1535 $ hg commit -m "test rename output"
1536 Invoking status precommit hook
1536 Invoking status precommit hook
1537 A large4-renamed
1537 A large4-renamed
1538 R sub/large4
1538 R sub/large4
1539 $ cat large4-renamed
1539 $ cat large4-renamed
1540 large4-modified
1540 large4-modified
1541 $ cd sub2
1541 $ cd sub2
1542 $ hg rename large6 large6-renamed
1542 $ hg rename large6 large6-renamed
1543 $ hg st
1543 $ hg st
1544 A sub2/large6-renamed
1544 A sub2/large6-renamed
1545 R sub2/large6
1545 R sub2/large6
1546 $ cd ..
1546 $ cd ..
1547
1547
1548 Test --normal flag
1548 Test --normal flag
1549
1549
1550 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1550 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1551 $ hg add --normal --large new-largefile
1551 $ hg add --normal --large new-largefile
1552 abort: --normal cannot be used with --large
1552 abort: --normal cannot be used with --large
1553 [255]
1553 [255]
1554 $ hg add --normal new-largefile
1554 $ hg add --normal new-largefile
1555 new-largefile: up to 69 MB of RAM may be required to manage this file
1555 new-largefile: up to 69 MB of RAM may be required to manage this file
1556 (use 'hg revert new-largefile' to cancel the pending addition)
1556 (use 'hg revert new-largefile' to cancel the pending addition)
1557 $ cd ..
1557 $ cd ..
1558
1558
1559 #if serve
1559 #if serve
1560 vanilla clients not locked out from largefiles servers on vanilla repos
1560 vanilla clients not locked out from largefiles servers on vanilla repos
1561 $ mkdir r1
1561 $ mkdir r1
1562 $ cd r1
1562 $ cd r1
1563 $ hg init
1563 $ hg init
1564 $ echo c1 > f1
1564 $ echo c1 > f1
1565 $ hg add f1
1565 $ hg add f1
1566 $ hg commit -m "m1"
1566 $ hg commit -m "m1"
1567 Invoking status precommit hook
1567 Invoking status precommit hook
1568 A f1
1568 A f1
1569 $ cd ..
1569 $ cd ..
1570 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1570 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1571 $ cat hg.pid >> $DAEMON_PIDS
1571 $ cat hg.pid >> $DAEMON_PIDS
1572 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1572 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1573 requesting all changes
1573 requesting all changes
1574 adding changesets
1574 adding changesets
1575 adding manifests
1575 adding manifests
1576 adding file changes
1576 adding file changes
1577 added 1 changesets with 1 changes to 1 files
1577 added 1 changesets with 1 changes to 1 files
1578 updating to branch default
1578 updating to branch default
1579 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1579 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1580
1580
1581 largefiles clients still work with vanilla servers
1581 largefiles clients still work with vanilla servers
1582 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1582 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1583 $ cat hg.pid >> $DAEMON_PIDS
1583 $ cat hg.pid >> $DAEMON_PIDS
1584 $ hg clone http://localhost:$HGPORT1 r3
1584 $ hg clone http://localhost:$HGPORT1 r3
1585 requesting all changes
1585 requesting all changes
1586 adding changesets
1586 adding changesets
1587 adding manifests
1587 adding manifests
1588 adding file changes
1588 adding file changes
1589 added 1 changesets with 1 changes to 1 files
1589 added 1 changesets with 1 changes to 1 files
1590 updating to branch default
1590 updating to branch default
1591 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1591 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1592 #endif
1592 #endif
1593
1593
1594
1594
1595 vanilla clients locked out from largefiles http repos
1595 vanilla clients locked out from largefiles http repos
1596 $ mkdir r4
1596 $ mkdir r4
1597 $ cd r4
1597 $ cd r4
1598 $ hg init
1598 $ hg init
1599 $ echo c1 > f1
1599 $ echo c1 > f1
1600 $ hg add --large f1
1600 $ hg add --large f1
1601 $ hg commit -m "m1"
1601 $ hg commit -m "m1"
1602 Invoking status precommit hook
1602 Invoking status precommit hook
1603 A f1
1603 A f1
1604 $ cd ..
1604 $ cd ..
1605
1605
1606 largefiles can be pushed locally (issue3583)
1606 largefiles can be pushed locally (issue3583)
1607 $ hg init dest
1607 $ hg init dest
1608 $ cd r4
1608 $ cd r4
1609 $ hg outgoing ../dest
1609 $ hg outgoing ../dest
1610 comparing with ../dest
1610 comparing with ../dest
1611 searching for changes
1611 searching for changes
1612 changeset: 0:639881c12b4c
1612 changeset: 0:639881c12b4c
1613 tag: tip
1613 tag: tip
1614 user: test
1614 user: test
1615 date: Thu Jan 01 00:00:00 1970 +0000
1615 date: Thu Jan 01 00:00:00 1970 +0000
1616 summary: m1
1616 summary: m1
1617
1617
1618 $ hg push ../dest
1618 $ hg push ../dest
1619 pushing to ../dest
1619 pushing to ../dest
1620 searching for changes
1620 searching for changes
1621 searching for changes
1621 searching for changes
1622 adding changesets
1622 adding changesets
1623 adding manifests
1623 adding manifests
1624 adding file changes
1624 adding file changes
1625 added 1 changesets with 1 changes to 1 files
1625 added 1 changesets with 1 changes to 1 files
1626
1626
1627 exit code with nothing outgoing (issue3611)
1627 exit code with nothing outgoing (issue3611)
1628 $ hg outgoing ../dest
1628 $ hg outgoing ../dest
1629 comparing with ../dest
1629 comparing with ../dest
1630 searching for changes
1630 searching for changes
1631 no changes found
1631 no changes found
1632 [1]
1632 [1]
1633 $ cd ..
1633 $ cd ..
1634
1634
1635 #if serve
1635 #if serve
1636 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1636 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1637 $ cat hg.pid >> $DAEMON_PIDS
1637 $ cat hg.pid >> $DAEMON_PIDS
1638 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1638 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1639 abort: remote error:
1639 abort: remote error:
1640
1640
1641 This repository uses the largefiles extension.
1641 This repository uses the largefiles extension.
1642
1642
1643 Please enable it in your Mercurial config file.
1643 Please enable it in your Mercurial config file.
1644 [255]
1644 [255]
1645
1645
1646 used all HGPORTs, kill all daemons
1646 used all HGPORTs, kill all daemons
1647 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1647 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1648 #endif
1648 #endif
1649
1649
1650 vanilla clients locked out from largefiles ssh repos
1650 vanilla clients locked out from largefiles ssh repos
1651 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1651 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1652 abort: remote error:
1652 abort: remote error:
1653
1653
1654 This repository uses the largefiles extension.
1654 This repository uses the largefiles extension.
1655
1655
1656 Please enable it in your Mercurial config file.
1656 Please enable it in your Mercurial config file.
1657 [255]
1657 [255]
1658
1658
1659 #if serve
1659 #if serve
1660
1660
1661 largefiles clients refuse to push largefiles repos to vanilla servers
1661 largefiles clients refuse to push largefiles repos to vanilla servers
1662 $ mkdir r6
1662 $ mkdir r6
1663 $ cd r6
1663 $ cd r6
1664 $ hg init
1664 $ hg init
1665 $ echo c1 > f1
1665 $ echo c1 > f1
1666 $ hg add f1
1666 $ hg add f1
1667 $ hg commit -m "m1"
1667 $ hg commit -m "m1"
1668 Invoking status precommit hook
1668 Invoking status precommit hook
1669 A f1
1669 A f1
1670 $ cat >> .hg/hgrc <<!
1670 $ cat >> .hg/hgrc <<!
1671 > [web]
1671 > [web]
1672 > push_ssl = false
1672 > push_ssl = false
1673 > allow_push = *
1673 > allow_push = *
1674 > !
1674 > !
1675 $ cd ..
1675 $ cd ..
1676 $ hg clone r6 r7
1676 $ hg clone r6 r7
1677 updating to branch default
1677 updating to branch default
1678 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1678 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1679 $ cd r7
1679 $ cd r7
1680 $ echo c2 > f2
1680 $ echo c2 > f2
1681 $ hg add --large f2
1681 $ hg add --large f2
1682 $ hg commit -m "m2"
1682 $ hg commit -m "m2"
1683 Invoking status precommit hook
1683 Invoking status precommit hook
1684 A f2
1684 A f2
1685 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1685 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1686 $ cat ../hg.pid >> $DAEMON_PIDS
1686 $ cat ../hg.pid >> $DAEMON_PIDS
1687 $ hg push http://localhost:$HGPORT
1687 $ hg push http://localhost:$HGPORT
1688 pushing to http://localhost:$HGPORT/
1688 pushing to http://localhost:$HGPORT/
1689 searching for changes
1689 searching for changes
1690 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1690 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1691 [255]
1691 [255]
1692 $ cd ..
1692 $ cd ..
1693
1693
1694 putlfile errors are shown (issue3123)
1694 putlfile errors are shown (issue3123)
1695 Corrupt the cached largefile in r7 and move it out of the servers usercache
1695 Corrupt the cached largefile in r7 and move it out of the servers usercache
1696 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1696 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1697 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1697 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1698 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1698 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1699 $ hg init empty
1699 $ hg init empty
1700 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1700 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1701 > --config 'web.allow_push=*' --config web.push_ssl=False
1701 > --config 'web.allow_push=*' --config web.push_ssl=False
1702 $ cat hg.pid >> $DAEMON_PIDS
1702 $ cat hg.pid >> $DAEMON_PIDS
1703 $ hg push -R r7 http://localhost:$HGPORT1
1703 $ hg push -R r7 http://localhost:$HGPORT1
1704 pushing to http://localhost:$HGPORT1/
1704 pushing to http://localhost:$HGPORT1/
1705 searching for changes
1705 searching for changes
1706 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1706 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1707 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1707 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1708 [255]
1708 [255]
1709 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1709 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1710 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1710 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1711 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1711 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1712 $ hg push -R r7 http://localhost:$HGPORT1
1712 $ hg push -R r7 http://localhost:$HGPORT1
1713 pushing to http://localhost:$HGPORT1/
1713 pushing to http://localhost:$HGPORT1/
1714 searching for changes
1714 searching for changes
1715 searching for changes
1715 searching for changes
1716 remote: adding changesets
1716 remote: adding changesets
1717 remote: adding manifests
1717 remote: adding manifests
1718 remote: adding file changes
1718 remote: adding file changes
1719 remote: added 2 changesets with 2 changes to 2 files
1719 remote: added 2 changesets with 2 changes to 2 files
1720 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1720 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1721 server side corruption
1721 server side corruption
1722 $ rm -rf empty
1722 $ rm -rf empty
1723
1723
1724 Push a largefiles repository to a served empty repository
1724 Push a largefiles repository to a served empty repository
1725 $ hg init r8
1725 $ hg init r8
1726 $ echo c3 > r8/f1
1726 $ echo c3 > r8/f1
1727 $ hg add --large r8/f1 -R r8
1727 $ hg add --large r8/f1 -R r8
1728 $ hg commit -m "m1" -R r8
1728 $ hg commit -m "m1" -R r8
1729 Invoking status precommit hook
1729 Invoking status precommit hook
1730 A f1
1730 A f1
1731 $ hg init empty
1731 $ hg init empty
1732 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1732 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1733 > --config 'web.allow_push=*' --config web.push_ssl=False
1733 > --config 'web.allow_push=*' --config web.push_ssl=False
1734 $ cat hg.pid >> $DAEMON_PIDS
1734 $ cat hg.pid >> $DAEMON_PIDS
1735 $ rm "${USERCACHE}"/*
1735 $ rm "${USERCACHE}"/*
1736 $ hg push -R r8 http://localhost:$HGPORT2/#default
1736 $ hg push -R r8 http://localhost:$HGPORT2/#default
1737 pushing to http://localhost:$HGPORT2/
1737 pushing to http://localhost:$HGPORT2/
1738 searching for changes
1738 searching for changes
1739 searching for changes
1739 searching for changes
1740 remote: adding changesets
1740 remote: adding changesets
1741 remote: adding manifests
1741 remote: adding manifests
1742 remote: adding file changes
1742 remote: adding file changes
1743 remote: added 1 changesets with 1 changes to 1 files
1743 remote: added 1 changesets with 1 changes to 1 files
1744 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1744 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1745 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1745 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1746
1746
1747 Clone over http, no largefiles pulled on clone.
1747 Clone over http, no largefiles pulled on clone.
1748
1748
1749 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1749 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1750 adding changesets
1750 adding changesets
1751 adding manifests
1751 adding manifests
1752 adding file changes
1752 adding file changes
1753 added 1 changesets with 1 changes to 1 files
1753 added 1 changesets with 1 changes to 1 files
1754
1754
1755 test 'verify' with remotestore:
1755 test 'verify' with remotestore:
1756
1756
1757 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1757 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1758 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1758 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1759 $ hg -R http-clone verify --large --lfa
1759 $ hg -R http-clone verify --large --lfa
1760 checking changesets
1760 checking changesets
1761 checking manifests
1761 checking manifests
1762 crosschecking files in changesets and manifests
1762 crosschecking files in changesets and manifests
1763 checking files
1763 checking files
1764 1 files, 1 changesets, 1 total revisions
1764 1 files, 1 changesets, 1 total revisions
1765 searching 1 changesets for largefiles
1765 searching 1 changesets for largefiles
1766 changeset 0:cf03e5bb9936: f1 missing
1766 changeset 0:cf03e5bb9936: f1 missing
1767 verified existence of 1 revisions of 1 largefiles
1767 verified existence of 1 revisions of 1 largefiles
1768 [1]
1768 [1]
1769 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1769 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1770 $ hg -R http-clone -q verify --large --lfa
1770 $ hg -R http-clone -q verify --large --lfa
1771
1771
1772 largefiles pulled on update - a largefile missing on the server:
1772 largefiles pulled on update - a largefile missing on the server:
1773 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1773 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1774 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1774 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1775 getting changed largefiles
1775 getting changed largefiles
1776 abort: remotestore: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 is missing
1776 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
1777 [255]
1777 0 largefiles updated, 0 removed
1778 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1779 $ hg -R http-clone st
1780 ! f1
1778 $ hg -R http-clone up -Cqr null
1781 $ hg -R http-clone up -Cqr null
1779
1782
1780 largefiles pulled on update - a largefile corrupted on the server:
1783 largefiles pulled on update - a largefile corrupted on the server:
1781 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1784 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1782 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1785 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1783 getting changed largefiles
1786 getting changed largefiles
1784 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1787 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1785 0 largefiles updated, 0 removed
1788 0 largefiles updated, 0 removed
1786 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1789 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1787 $ hg -R http-clone st
1790 $ hg -R http-clone st
1788 ! f1
1791 ! f1
1789 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1792 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1790 $ [ ! -f http-clone/f1 ]
1793 $ [ ! -f http-clone/f1 ]
1791 $ [ ! -f http-clone-usercache ]
1794 $ [ ! -f http-clone-usercache ]
1792 $ hg -R http-clone verify --large --lfc
1795 $ hg -R http-clone verify --large --lfc
1793 checking changesets
1796 checking changesets
1794 checking manifests
1797 checking manifests
1795 crosschecking files in changesets and manifests
1798 crosschecking files in changesets and manifests
1796 checking files
1799 checking files
1797 1 files, 1 changesets, 1 total revisions
1800 1 files, 1 changesets, 1 total revisions
1798 searching 1 changesets for largefiles
1801 searching 1 changesets for largefiles
1799 verified contents of 1 revisions of 1 largefiles
1802 verified contents of 1 revisions of 1 largefiles
1800 $ hg -R http-clone up -Cqr null
1803 $ hg -R http-clone up -Cqr null
1801
1804
1802 largefiles pulled on update - no server side problems:
1805 largefiles pulled on update - no server side problems:
1803 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1806 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1804 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1807 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1805 resolving manifests
1808 resolving manifests
1806 branchmerge: False, force: False, partial: False
1809 branchmerge: False, force: False, partial: False
1807 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1810 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1808 .hglf/f1: remote created -> g
1811 .hglf/f1: remote created -> g
1809 getting .hglf/f1
1812 getting .hglf/f1
1810 updating: .hglf/f1 1/1 files (100.00%)
1813 updating: .hglf/f1 1/1 files (100.00%)
1811 getting changed largefiles
1814 getting changed largefiles
1812 using http://localhost:$HGPORT2/
1815 using http://localhost:$HGPORT2/
1813 sending capabilities command
1816 sending capabilities command
1817 sending batch command
1814 getting largefiles: 0/1 lfile (0.00%)
1818 getting largefiles: 0/1 lfile (0.00%)
1815 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1819 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1816 sending batch command
1817 sending getlfile command
1820 sending getlfile command
1818 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1821 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1819 1 largefiles updated, 0 removed
1822 1 largefiles updated, 0 removed
1820 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1823 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1821
1824
1822 $ ls http-clone-usercache/*
1825 $ ls http-clone-usercache/*
1823 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1826 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1824
1827
1825 $ rm -rf empty http-clone*
1828 $ rm -rf empty http-clone*
1826
1829
1827 used all HGPORTs, kill all daemons
1830 used all HGPORTs, kill all daemons
1828 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1831 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1829
1832
1830 #endif
1833 #endif
1831
1834
1832
1835
1833 #if unix-permissions
1836 #if unix-permissions
1834
1837
1835 Clone a local repository owned by another user
1838 Clone a local repository owned by another user
1836 We have to simulate that here by setting $HOME and removing write permissions
1839 We have to simulate that here by setting $HOME and removing write permissions
1837 $ ORIGHOME="$HOME"
1840 $ ORIGHOME="$HOME"
1838 $ mkdir alice
1841 $ mkdir alice
1839 $ HOME="`pwd`/alice"
1842 $ HOME="`pwd`/alice"
1840 $ cd alice
1843 $ cd alice
1841 $ hg init pubrepo
1844 $ hg init pubrepo
1842 $ cd pubrepo
1845 $ cd pubrepo
1843 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1846 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1844 $ hg add --large a-large-file
1847 $ hg add --large a-large-file
1845 $ hg commit -m "Add a large file"
1848 $ hg commit -m "Add a large file"
1846 Invoking status precommit hook
1849 Invoking status precommit hook
1847 A a-large-file
1850 A a-large-file
1848 $ cd ..
1851 $ cd ..
1849 $ chmod -R a-w pubrepo
1852 $ chmod -R a-w pubrepo
1850 $ cd ..
1853 $ cd ..
1851 $ mkdir bob
1854 $ mkdir bob
1852 $ HOME="`pwd`/bob"
1855 $ HOME="`pwd`/bob"
1853 $ cd bob
1856 $ cd bob
1854 $ hg clone --pull ../alice/pubrepo pubrepo
1857 $ hg clone --pull ../alice/pubrepo pubrepo
1855 requesting all changes
1858 requesting all changes
1856 adding changesets
1859 adding changesets
1857 adding manifests
1860 adding manifests
1858 adding file changes
1861 adding file changes
1859 added 1 changesets with 1 changes to 1 files
1862 added 1 changesets with 1 changes to 1 files
1860 updating to branch default
1863 updating to branch default
1861 getting changed largefiles
1864 getting changed largefiles
1862 1 largefiles updated, 0 removed
1865 1 largefiles updated, 0 removed
1863 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1866 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1864 $ cd ..
1867 $ cd ..
1865 $ chmod -R u+w alice/pubrepo
1868 $ chmod -R u+w alice/pubrepo
1866 $ HOME="$ORIGHOME"
1869 $ HOME="$ORIGHOME"
1867
1870
1868 #endif
1871 #endif
1869
1872
1870 #if symlink
1873 #if symlink
1871
1874
1872 Symlink to a large largefile should behave the same as a symlink to a normal file
1875 Symlink to a large largefile should behave the same as a symlink to a normal file
1873 $ hg init largesymlink
1876 $ hg init largesymlink
1874 $ cd largesymlink
1877 $ cd largesymlink
1875 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1878 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1876 $ hg add --large largefile
1879 $ hg add --large largefile
1877 $ hg commit -m "commit a large file"
1880 $ hg commit -m "commit a large file"
1878 Invoking status precommit hook
1881 Invoking status precommit hook
1879 A largefile
1882 A largefile
1880 $ ln -s largefile largelink
1883 $ ln -s largefile largelink
1881 $ hg add largelink
1884 $ hg add largelink
1882 $ hg commit -m "commit a large symlink"
1885 $ hg commit -m "commit a large symlink"
1883 Invoking status precommit hook
1886 Invoking status precommit hook
1884 A largelink
1887 A largelink
1885 $ rm -f largelink
1888 $ rm -f largelink
1886 $ hg up >/dev/null
1889 $ hg up >/dev/null
1887 $ test -f largelink
1890 $ test -f largelink
1888 [1]
1891 [1]
1889 $ test -L largelink
1892 $ test -L largelink
1890 [1]
1893 [1]
1891 $ rm -f largelink # make next part of the test independent of the previous
1894 $ rm -f largelink # make next part of the test independent of the previous
1892 $ hg up -C >/dev/null
1895 $ hg up -C >/dev/null
1893 $ test -f largelink
1896 $ test -f largelink
1894 $ test -L largelink
1897 $ test -L largelink
1895 $ cd ..
1898 $ cd ..
1896
1899
1897 #endif
1900 #endif
1898
1901
1899 test for pattern matching on 'hg status':
1902 test for pattern matching on 'hg status':
1900 to boost performance, largefiles checks whether specified patterns are
1903 to boost performance, largefiles checks whether specified patterns are
1901 related to largefiles in working directory (NOT to STANDIN) or not.
1904 related to largefiles in working directory (NOT to STANDIN) or not.
1902
1905
1903 $ hg init statusmatch
1906 $ hg init statusmatch
1904 $ cd statusmatch
1907 $ cd statusmatch
1905
1908
1906 $ mkdir -p a/b/c/d
1909 $ mkdir -p a/b/c/d
1907 $ echo normal > a/b/c/d/e.normal.txt
1910 $ echo normal > a/b/c/d/e.normal.txt
1908 $ hg add a/b/c/d/e.normal.txt
1911 $ hg add a/b/c/d/e.normal.txt
1909 $ echo large > a/b/c/d/e.large.txt
1912 $ echo large > a/b/c/d/e.large.txt
1910 $ hg add --large a/b/c/d/e.large.txt
1913 $ hg add --large a/b/c/d/e.large.txt
1911 $ mkdir -p a/b/c/x
1914 $ mkdir -p a/b/c/x
1912 $ echo normal > a/b/c/x/y.normal.txt
1915 $ echo normal > a/b/c/x/y.normal.txt
1913 $ hg add a/b/c/x/y.normal.txt
1916 $ hg add a/b/c/x/y.normal.txt
1914 $ hg commit -m 'add files'
1917 $ hg commit -m 'add files'
1915 Invoking status precommit hook
1918 Invoking status precommit hook
1916 A a/b/c/d/e.large.txt
1919 A a/b/c/d/e.large.txt
1917 A a/b/c/d/e.normal.txt
1920 A a/b/c/d/e.normal.txt
1918 A a/b/c/x/y.normal.txt
1921 A a/b/c/x/y.normal.txt
1919
1922
1920 (1) no pattern: no performance boost
1923 (1) no pattern: no performance boost
1921 $ hg status -A
1924 $ hg status -A
1922 C a/b/c/d/e.large.txt
1925 C a/b/c/d/e.large.txt
1923 C a/b/c/d/e.normal.txt
1926 C a/b/c/d/e.normal.txt
1924 C a/b/c/x/y.normal.txt
1927 C a/b/c/x/y.normal.txt
1925
1928
1926 (2) pattern not related to largefiles: performance boost
1929 (2) pattern not related to largefiles: performance boost
1927 $ hg status -A a/b/c/x
1930 $ hg status -A a/b/c/x
1928 C a/b/c/x/y.normal.txt
1931 C a/b/c/x/y.normal.txt
1929
1932
1930 (3) pattern related to largefiles: no performance boost
1933 (3) pattern related to largefiles: no performance boost
1931 $ hg status -A a/b/c/d
1934 $ hg status -A a/b/c/d
1932 C a/b/c/d/e.large.txt
1935 C a/b/c/d/e.large.txt
1933 C a/b/c/d/e.normal.txt
1936 C a/b/c/d/e.normal.txt
1934
1937
1935 (4) pattern related to STANDIN (not to largefiles): performance boost
1938 (4) pattern related to STANDIN (not to largefiles): performance boost
1936 $ hg status -A .hglf/a
1939 $ hg status -A .hglf/a
1937 C .hglf/a/b/c/d/e.large.txt
1940 C .hglf/a/b/c/d/e.large.txt
1938
1941
1939 (5) mixed case: no performance boost
1942 (5) mixed case: no performance boost
1940 $ hg status -A a/b/c/x a/b/c/d
1943 $ hg status -A a/b/c/x a/b/c/d
1941 C a/b/c/d/e.large.txt
1944 C a/b/c/d/e.large.txt
1942 C a/b/c/d/e.normal.txt
1945 C a/b/c/d/e.normal.txt
1943 C a/b/c/x/y.normal.txt
1946 C a/b/c/x/y.normal.txt
1944
1947
1945 verify that largefiles doesn't break filesets
1948 verify that largefiles doesn't break filesets
1946
1949
1947 $ hg log --rev . --exclude "set:binary()"
1950 $ hg log --rev . --exclude "set:binary()"
1948 changeset: 0:41bd42f10efa
1951 changeset: 0:41bd42f10efa
1949 tag: tip
1952 tag: tip
1950 user: test
1953 user: test
1951 date: Thu Jan 01 00:00:00 1970 +0000
1954 date: Thu Jan 01 00:00:00 1970 +0000
1952 summary: add files
1955 summary: add files
1953
1956
1954 verify that large files in subrepos handled properly
1957 verify that large files in subrepos handled properly
1955 $ hg init subrepo
1958 $ hg init subrepo
1956 $ echo "subrepo = subrepo" > .hgsub
1959 $ echo "subrepo = subrepo" > .hgsub
1957 $ hg add .hgsub
1960 $ hg add .hgsub
1958 $ hg ci -m "add subrepo"
1961 $ hg ci -m "add subrepo"
1959 Invoking status precommit hook
1962 Invoking status precommit hook
1960 A .hgsub
1963 A .hgsub
1961 ? .hgsubstate
1964 ? .hgsubstate
1962 $ echo "rev 1" > subrepo/large.txt
1965 $ echo "rev 1" > subrepo/large.txt
1963 $ hg -R subrepo add --large subrepo/large.txt
1966 $ hg -R subrepo add --large subrepo/large.txt
1964 $ hg sum
1967 $ hg sum
1965 parent: 1:8ee150ea2e9c tip
1968 parent: 1:8ee150ea2e9c tip
1966 add subrepo
1969 add subrepo
1967 branch: default
1970 branch: default
1968 commit: 1 subrepos
1971 commit: 1 subrepos
1969 update: (current)
1972 update: (current)
1970 $ hg st
1973 $ hg st
1971 $ hg st -S
1974 $ hg st -S
1972 A subrepo/large.txt
1975 A subrepo/large.txt
1973 $ hg ci -S -m "commit top repo"
1976 $ hg ci -S -m "commit top repo"
1974 committing subrepository subrepo
1977 committing subrepository subrepo
1975 Invoking status precommit hook
1978 Invoking status precommit hook
1976 A large.txt
1979 A large.txt
1977 Invoking status precommit hook
1980 Invoking status precommit hook
1978 M .hgsubstate
1981 M .hgsubstate
1979 # No differences
1982 # No differences
1980 $ hg st -S
1983 $ hg st -S
1981 $ hg sum
1984 $ hg sum
1982 parent: 2:ce4cd0c527a6 tip
1985 parent: 2:ce4cd0c527a6 tip
1983 commit top repo
1986 commit top repo
1984 branch: default
1987 branch: default
1985 commit: (clean)
1988 commit: (clean)
1986 update: (current)
1989 update: (current)
1987 $ echo "rev 2" > subrepo/large.txt
1990 $ echo "rev 2" > subrepo/large.txt
1988 $ hg st -S
1991 $ hg st -S
1989 M subrepo/large.txt
1992 M subrepo/large.txt
1990 $ hg sum
1993 $ hg sum
1991 parent: 2:ce4cd0c527a6 tip
1994 parent: 2:ce4cd0c527a6 tip
1992 commit top repo
1995 commit top repo
1993 branch: default
1996 branch: default
1994 commit: 1 subrepos
1997 commit: 1 subrepos
1995 update: (current)
1998 update: (current)
1996 $ hg ci -m "this commit should fail without -S"
1999 $ hg ci -m "this commit should fail without -S"
1997 abort: uncommitted changes in subrepo subrepo
2000 abort: uncommitted changes in subrepo subrepo
1998 (use --subrepos for recursive commit)
2001 (use --subrepos for recursive commit)
1999 [255]
2002 [255]
2000
2003
2001 Add a normal file to the subrepo, then test archiving
2004 Add a normal file to the subrepo, then test archiving
2002
2005
2003 $ echo 'normal file' > subrepo/normal.txt
2006 $ echo 'normal file' > subrepo/normal.txt
2004 $ hg -R subrepo add subrepo/normal.txt
2007 $ hg -R subrepo add subrepo/normal.txt
2005
2008
2006 Lock in subrepo, otherwise the change isn't archived
2009 Lock in subrepo, otherwise the change isn't archived
2007
2010
2008 $ hg ci -S -m "add normal file to top level"
2011 $ hg ci -S -m "add normal file to top level"
2009 committing subrepository subrepo
2012 committing subrepository subrepo
2010 Invoking status precommit hook
2013 Invoking status precommit hook
2011 M large.txt
2014 M large.txt
2012 A normal.txt
2015 A normal.txt
2013 Invoking status precommit hook
2016 Invoking status precommit hook
2014 M .hgsubstate
2017 M .hgsubstate
2015 $ hg archive -S ../lf_subrepo_archive
2018 $ hg archive -S ../lf_subrepo_archive
2016 $ find ../lf_subrepo_archive | sort
2019 $ find ../lf_subrepo_archive | sort
2017 ../lf_subrepo_archive
2020 ../lf_subrepo_archive
2018 ../lf_subrepo_archive/.hg_archival.txt
2021 ../lf_subrepo_archive/.hg_archival.txt
2019 ../lf_subrepo_archive/.hgsub
2022 ../lf_subrepo_archive/.hgsub
2020 ../lf_subrepo_archive/.hgsubstate
2023 ../lf_subrepo_archive/.hgsubstate
2021 ../lf_subrepo_archive/a
2024 ../lf_subrepo_archive/a
2022 ../lf_subrepo_archive/a/b
2025 ../lf_subrepo_archive/a/b
2023 ../lf_subrepo_archive/a/b/c
2026 ../lf_subrepo_archive/a/b/c
2024 ../lf_subrepo_archive/a/b/c/d
2027 ../lf_subrepo_archive/a/b/c/d
2025 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2028 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2026 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2029 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2027 ../lf_subrepo_archive/a/b/c/x
2030 ../lf_subrepo_archive/a/b/c/x
2028 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2031 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2029 ../lf_subrepo_archive/subrepo
2032 ../lf_subrepo_archive/subrepo
2030 ../lf_subrepo_archive/subrepo/large.txt
2033 ../lf_subrepo_archive/subrepo/large.txt
2031 ../lf_subrepo_archive/subrepo/normal.txt
2034 ../lf_subrepo_archive/subrepo/normal.txt
2032
2035
2033 Test update with subrepos.
2036 Test update with subrepos.
2034
2037
2035 $ hg update 0
2038 $ hg update 0
2036 getting changed largefiles
2039 getting changed largefiles
2037 0 largefiles updated, 1 removed
2040 0 largefiles updated, 1 removed
2038 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2041 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2039 $ hg status -S
2042 $ hg status -S
2040 $ hg update tip
2043 $ hg update tip
2041 getting changed largefiles
2044 getting changed largefiles
2042 1 largefiles updated, 0 removed
2045 1 largefiles updated, 0 removed
2043 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2046 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2044 $ hg status -S
2047 $ hg status -S
2045 # modify a large file
2048 # modify a large file
2046 $ echo "modified" > subrepo/large.txt
2049 $ echo "modified" > subrepo/large.txt
2047 $ hg st -S
2050 $ hg st -S
2048 M subrepo/large.txt
2051 M subrepo/large.txt
2049 # update -C should revert the change.
2052 # update -C should revert the change.
2050 $ hg update -C
2053 $ hg update -C
2051 getting changed largefiles
2054 getting changed largefiles
2052 1 largefiles updated, 0 removed
2055 1 largefiles updated, 0 removed
2053 getting changed largefiles
2056 getting changed largefiles
2054 0 largefiles updated, 0 removed
2057 0 largefiles updated, 0 removed
2055 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2058 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2056 $ hg status -S
2059 $ hg status -S
2057
2060
2058 Test archiving a revision that references a subrepo that is not yet
2061 Test archiving a revision that references a subrepo that is not yet
2059 cloned (see test-subrepo-recursion.t):
2062 cloned (see test-subrepo-recursion.t):
2060
2063
2061 $ hg clone -U . ../empty
2064 $ hg clone -U . ../empty
2062 $ cd ../empty
2065 $ cd ../empty
2063 $ hg archive --subrepos -r tip ../archive.tar.gz
2066 $ hg archive --subrepos -r tip ../archive.tar.gz
2064 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2067 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2065 $ cd ..
2068 $ cd ..
2066
2069
2067 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2070 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2068
2071
2069 $ hg init addrm2
2072 $ hg init addrm2
2070 $ cd addrm2
2073 $ cd addrm2
2071 $ touch large.dat
2074 $ touch large.dat
2072 $ touch large2.dat
2075 $ touch large2.dat
2073 $ touch normal
2076 $ touch normal
2074 $ hg add --large large.dat
2077 $ hg add --large large.dat
2075 $ hg addremove -v
2078 $ hg addremove -v
2076 adding large2.dat as a largefile
2079 adding large2.dat as a largefile
2077 adding normal
2080 adding normal
2078
2081
2079 Test that forgetting all largefiles reverts to islfilesrepo() == False
2082 Test that forgetting all largefiles reverts to islfilesrepo() == False
2080 (addremove will add *.dat as normal files now)
2083 (addremove will add *.dat as normal files now)
2081 $ hg forget large.dat
2084 $ hg forget large.dat
2082 $ hg forget large2.dat
2085 $ hg forget large2.dat
2083 $ hg addremove -v
2086 $ hg addremove -v
2084 adding large.dat
2087 adding large.dat
2085 adding large2.dat
2088 adding large2.dat
2086
2089
2087 Test commit's addremove option prior to the first commit
2090 Test commit's addremove option prior to the first commit
2088 $ hg forget large.dat
2091 $ hg forget large.dat
2089 $ hg forget large2.dat
2092 $ hg forget large2.dat
2090 $ hg add --large large.dat
2093 $ hg add --large large.dat
2091 $ hg ci -Am "commit"
2094 $ hg ci -Am "commit"
2092 adding large2.dat as a largefile
2095 adding large2.dat as a largefile
2093 Invoking status precommit hook
2096 Invoking status precommit hook
2094 A large.dat
2097 A large.dat
2095 A large2.dat
2098 A large2.dat
2096 A normal
2099 A normal
2097 $ find .hglf | sort
2100 $ find .hglf | sort
2098 .hglf
2101 .hglf
2099 .hglf/large.dat
2102 .hglf/large.dat
2100 .hglf/large2.dat
2103 .hglf/large2.dat
2101
2104
2102 Test actions on largefiles using relative paths from subdir
2105 Test actions on largefiles using relative paths from subdir
2103
2106
2104 $ mkdir sub
2107 $ mkdir sub
2105 $ cd sub
2108 $ cd sub
2106 $ echo anotherlarge > anotherlarge
2109 $ echo anotherlarge > anotherlarge
2107 $ hg add --large anotherlarge
2110 $ hg add --large anotherlarge
2108 $ hg st
2111 $ hg st
2109 A sub/anotherlarge
2112 A sub/anotherlarge
2110 $ hg st anotherlarge
2113 $ hg st anotherlarge
2111 A anotherlarge
2114 A anotherlarge
2112 $ hg commit -m anotherlarge anotherlarge
2115 $ hg commit -m anotherlarge anotherlarge
2113 Invoking status precommit hook
2116 Invoking status precommit hook
2114 A sub/anotherlarge
2117 A sub/anotherlarge
2115 $ hg log anotherlarge
2118 $ hg log anotherlarge
2116 changeset: 1:9627a577c5e9
2119 changeset: 1:9627a577c5e9
2117 tag: tip
2120 tag: tip
2118 user: test
2121 user: test
2119 date: Thu Jan 01 00:00:00 1970 +0000
2122 date: Thu Jan 01 00:00:00 1970 +0000
2120 summary: anotherlarge
2123 summary: anotherlarge
2121
2124
2122 $ echo more >> anotherlarge
2125 $ echo more >> anotherlarge
2123 $ hg st .
2126 $ hg st .
2124 M anotherlarge
2127 M anotherlarge
2125 $ hg cat anotherlarge
2128 $ hg cat anotherlarge
2126 anotherlarge
2129 anotherlarge
2127 $ hg revert anotherlarge
2130 $ hg revert anotherlarge
2128 $ hg st
2131 $ hg st
2129 ? sub/anotherlarge.orig
2132 ? sub/anotherlarge.orig
2130 $ cd ..
2133 $ cd ..
2131
2134
2132 $ cd ..
2135 $ cd ..
2133
2136
2134 issue3651: summary/outgoing with largefiles shows "no remote repo"
2137 issue3651: summary/outgoing with largefiles shows "no remote repo"
2135 unexpectedly
2138 unexpectedly
2136
2139
2137 $ mkdir issue3651
2140 $ mkdir issue3651
2138 $ cd issue3651
2141 $ cd issue3651
2139
2142
2140 $ hg init src
2143 $ hg init src
2141 $ echo a > src/a
2144 $ echo a > src/a
2142 $ hg -R src add --large src/a
2145 $ hg -R src add --large src/a
2143 $ hg -R src commit -m '#0'
2146 $ hg -R src commit -m '#0'
2144 Invoking status precommit hook
2147 Invoking status precommit hook
2145 A a
2148 A a
2146
2149
2147 check messages when no remote repository is specified:
2150 check messages when no remote repository is specified:
2148 "no remote repo" route for "hg outgoing --large" is not tested here,
2151 "no remote repo" route for "hg outgoing --large" is not tested here,
2149 because it can't be reproduced easily.
2152 because it can't be reproduced easily.
2150
2153
2151 $ hg init clone1
2154 $ hg init clone1
2152 $ hg -R clone1 -q pull src
2155 $ hg -R clone1 -q pull src
2153 $ hg -R clone1 -q update
2156 $ hg -R clone1 -q update
2154 $ hg -R clone1 paths | grep default
2157 $ hg -R clone1 paths | grep default
2155 [1]
2158 [1]
2156
2159
2157 $ hg -R clone1 summary --large
2160 $ hg -R clone1 summary --large
2158 parent: 0:fc0bd45326d3 tip
2161 parent: 0:fc0bd45326d3 tip
2159 #0
2162 #0
2160 branch: default
2163 branch: default
2161 commit: (clean)
2164 commit: (clean)
2162 update: (current)
2165 update: (current)
2163 largefiles: (no remote repo)
2166 largefiles: (no remote repo)
2164
2167
2165 check messages when there is no files to upload:
2168 check messages when there is no files to upload:
2166
2169
2167 $ hg -q clone src clone2
2170 $ hg -q clone src clone2
2168 $ hg -R clone2 paths | grep default
2171 $ hg -R clone2 paths | grep default
2169 default = $TESTTMP/issue3651/src (glob)
2172 default = $TESTTMP/issue3651/src (glob)
2170
2173
2171 $ hg -R clone2 summary --large
2174 $ hg -R clone2 summary --large
2172 parent: 0:fc0bd45326d3 tip
2175 parent: 0:fc0bd45326d3 tip
2173 #0
2176 #0
2174 branch: default
2177 branch: default
2175 commit: (clean)
2178 commit: (clean)
2176 update: (current)
2179 update: (current)
2177 searching for changes
2180 searching for changes
2178 largefiles: (no files to upload)
2181 largefiles: (no files to upload)
2179 $ hg -R clone2 outgoing --large
2182 $ hg -R clone2 outgoing --large
2180 comparing with $TESTTMP/issue3651/src (glob)
2183 comparing with $TESTTMP/issue3651/src (glob)
2181 searching for changes
2184 searching for changes
2182 no changes found
2185 no changes found
2183 searching for changes
2186 searching for changes
2184 largefiles: no files to upload
2187 largefiles: no files to upload
2185 [1]
2188 [1]
2186
2189
2187 check messages when there are files to upload:
2190 check messages when there are files to upload:
2188
2191
2189 $ echo b > clone2/b
2192 $ echo b > clone2/b
2190 $ hg -R clone2 add --large clone2/b
2193 $ hg -R clone2 add --large clone2/b
2191 $ hg -R clone2 commit -m '#1'
2194 $ hg -R clone2 commit -m '#1'
2192 Invoking status precommit hook
2195 Invoking status precommit hook
2193 A b
2196 A b
2194 $ hg -R clone2 summary --large
2197 $ hg -R clone2 summary --large
2195 parent: 1:1acbe71ce432 tip
2198 parent: 1:1acbe71ce432 tip
2196 #1
2199 #1
2197 branch: default
2200 branch: default
2198 commit: (clean)
2201 commit: (clean)
2199 update: (current)
2202 update: (current)
2200 searching for changes
2203 searching for changes
2201 largefiles: 1 to upload
2204 largefiles: 1 to upload
2202 $ hg -R clone2 outgoing --large
2205 $ hg -R clone2 outgoing --large
2203 comparing with $TESTTMP/issue3651/src (glob)
2206 comparing with $TESTTMP/issue3651/src (glob)
2204 searching for changes
2207 searching for changes
2205 changeset: 1:1acbe71ce432
2208 changeset: 1:1acbe71ce432
2206 tag: tip
2209 tag: tip
2207 user: test
2210 user: test
2208 date: Thu Jan 01 00:00:00 1970 +0000
2211 date: Thu Jan 01 00:00:00 1970 +0000
2209 summary: #1
2212 summary: #1
2210
2213
2211 searching for changes
2214 searching for changes
2212 largefiles to upload:
2215 largefiles to upload:
2213 b
2216 b
2214
2217
2215
2218
2216 $ cd ..
2219 $ cd ..
@@ -1,350 +1,350 b''
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
2 $ mkdir "${USERCACHE}"
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > largefiles =
5 > largefiles =
6 > share =
6 > share =
7 > graphlog =
7 > graphlog =
8 > mq =
8 > mq =
9 > convert =
9 > convert =
10 > [largefiles]
10 > [largefiles]
11 > minsize = 0.5
11 > minsize = 0.5
12 > patterns = **.other
12 > patterns = **.other
13 > **.dat
13 > **.dat
14 > usercache=${USERCACHE}
14 > usercache=${USERCACHE}
15 > EOF
15 > EOF
16
16
17 "lfconvert" works
17 "lfconvert" works
18 $ hg init bigfile-repo
18 $ hg init bigfile-repo
19 $ cd bigfile-repo
19 $ cd bigfile-repo
20 $ cat >> .hg/hgrc <<EOF
20 $ cat >> .hg/hgrc <<EOF
21 > [extensions]
21 > [extensions]
22 > largefiles = !
22 > largefiles = !
23 > EOF
23 > EOF
24 $ mkdir sub
24 $ mkdir sub
25 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
25 $ dd if=/dev/zero bs=1k count=256 > large 2> /dev/null
26 $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null
26 $ dd if=/dev/zero bs=1k count=256 > large2 2> /dev/null
27 $ echo normal > normal1
27 $ echo normal > normal1
28 $ echo alsonormal > sub/normal2
28 $ echo alsonormal > sub/normal2
29 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
29 $ dd if=/dev/zero bs=1k count=10 > sub/maybelarge.dat 2> /dev/null
30 $ hg addremove
30 $ hg addremove
31 adding large
31 adding large
32 adding large2
32 adding large2
33 adding normal1
33 adding normal1
34 adding sub/maybelarge.dat
34 adding sub/maybelarge.dat
35 adding sub/normal2
35 adding sub/normal2
36 $ hg commit -m"add large, normal1" large normal1
36 $ hg commit -m"add large, normal1" large normal1
37 $ hg commit -m"add sub/*" sub
37 $ hg commit -m"add sub/*" sub
38
38
39 Test tag parsing
39 Test tag parsing
40 $ cat >> .hgtags <<EOF
40 $ cat >> .hgtags <<EOF
41 > IncorrectlyFormattedTag!
41 > IncorrectlyFormattedTag!
42 > invalidhash sometag
42 > invalidhash sometag
43 > 0123456789abcdef anothertag
43 > 0123456789abcdef anothertag
44 > EOF
44 > EOF
45 $ hg add .hgtags
45 $ hg add .hgtags
46 $ hg commit -m"add large2" large2 .hgtags
46 $ hg commit -m"add large2" large2 .hgtags
47
47
48 Test link+rename largefile codepath
48 Test link+rename largefile codepath
49 $ [ -d .hg/largefiles ] && echo fail || echo pass
49 $ [ -d .hg/largefiles ] && echo fail || echo pass
50 pass
50 pass
51 $ cd ..
51 $ cd ..
52 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
52 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
53 initializing destination largefiles-repo
53 initializing destination largefiles-repo
54 skipping incorrectly formatted tag IncorrectlyFormattedTag!
54 skipping incorrectly formatted tag IncorrectlyFormattedTag!
55 skipping incorrectly formatted id invalidhash
55 skipping incorrectly formatted id invalidhash
56 no mapping for id 0123456789abcdef
56 no mapping for id 0123456789abcdef
57 #if symlink
57 #if symlink
58 $ hg --cwd bigfile-repo rename large2 large3
58 $ hg --cwd bigfile-repo rename large2 large3
59 $ ln -sf large bigfile-repo/large3
59 $ ln -sf large bigfile-repo/large3
60 $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3
60 $ hg --cwd bigfile-repo commit -m"make large2 a symlink" large2 large3
61 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink
61 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo-symlink
62 initializing destination largefiles-repo-symlink
62 initializing destination largefiles-repo-symlink
63 skipping incorrectly formatted tag IncorrectlyFormattedTag!
63 skipping incorrectly formatted tag IncorrectlyFormattedTag!
64 skipping incorrectly formatted id invalidhash
64 skipping incorrectly formatted id invalidhash
65 no mapping for id 0123456789abcdef
65 no mapping for id 0123456789abcdef
66 abort: renamed/copied largefile large3 becomes symlink
66 abort: renamed/copied largefile large3 becomes symlink
67 [255]
67 [255]
68 #endif
68 #endif
69 $ cd bigfile-repo
69 $ cd bigfile-repo
70 $ hg strip --no-backup 2
70 $ hg strip --no-backup 2
71 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
71 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
72 $ cd ..
72 $ cd ..
73 $ rm -rf largefiles-repo largefiles-repo-symlink
73 $ rm -rf largefiles-repo largefiles-repo-symlink
74
74
75 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
75 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
76 initializing destination largefiles-repo
76 initializing destination largefiles-repo
77
77
78 "lfconvert" converts content correctly
78 "lfconvert" converts content correctly
79 $ cd largefiles-repo
79 $ cd largefiles-repo
80 $ hg up
80 $ hg up
81 getting changed largefiles
81 getting changed largefiles
82 2 largefiles updated, 0 removed
82 2 largefiles updated, 0 removed
83 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
83 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
84 $ hg locate
84 $ hg locate
85 .hglf/large
85 .hglf/large
86 .hglf/sub/maybelarge.dat
86 .hglf/sub/maybelarge.dat
87 normal1
87 normal1
88 sub/normal2
88 sub/normal2
89 $ cat normal1
89 $ cat normal1
90 normal
90 normal
91 $ cat sub/normal2
91 $ cat sub/normal2
92 alsonormal
92 alsonormal
93 $ "$TESTDIR/md5sum.py" large sub/maybelarge.dat
93 $ "$TESTDIR/md5sum.py" large sub/maybelarge.dat
94 ec87a838931d4d5d2e94a04644788a55 large
94 ec87a838931d4d5d2e94a04644788a55 large
95 1276481102f218c981e0324180bafd9f sub/maybelarge.dat
95 1276481102f218c981e0324180bafd9f sub/maybelarge.dat
96
96
97 "lfconvert" adds 'largefiles' to .hg/requires.
97 "lfconvert" adds 'largefiles' to .hg/requires.
98 $ cat .hg/requires
98 $ cat .hg/requires
99 dotencode
99 dotencode
100 fncache
100 fncache
101 largefiles
101 largefiles
102 revlogv1
102 revlogv1
103 store
103 store
104
104
105 "lfconvert" includes a newline at the end of the standin files.
105 "lfconvert" includes a newline at the end of the standin files.
106 $ cat .hglf/large .hglf/sub/maybelarge.dat
106 $ cat .hglf/large .hglf/sub/maybelarge.dat
107 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
107 2e000fa7e85759c7f4c254d4d9c33ef481e459a7
108 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
108 34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c
109 $ cd ..
109 $ cd ..
110
110
111 add some changesets to rename/remove/merge
111 add some changesets to rename/remove/merge
112 $ cd bigfile-repo
112 $ cd bigfile-repo
113 $ hg mv -q sub stuff
113 $ hg mv -q sub stuff
114 $ hg commit -m"rename sub/ to stuff/"
114 $ hg commit -m"rename sub/ to stuff/"
115 $ hg update -q 1
115 $ hg update -q 1
116 $ echo blah >> normal3
116 $ echo blah >> normal3
117 $ echo blah >> sub/normal2
117 $ echo blah >> sub/normal2
118 $ echo blah >> sub/maybelarge.dat
118 $ echo blah >> sub/maybelarge.dat
119 $ "$TESTDIR/md5sum.py" sub/maybelarge.dat
119 $ "$TESTDIR/md5sum.py" sub/maybelarge.dat
120 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat
120 1dd0b99ff80e19cff409702a1d3f5e15 sub/maybelarge.dat
121 $ hg commit -A -m"add normal3, modify sub/*"
121 $ hg commit -A -m"add normal3, modify sub/*"
122 adding normal3
122 adding normal3
123 created new head
123 created new head
124 $ hg rm large normal3
124 $ hg rm large normal3
125 $ hg commit -q -m"remove large, normal3"
125 $ hg commit -q -m"remove large, normal3"
126 $ hg merge
126 $ hg merge
127 merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat
127 merging sub/maybelarge.dat and stuff/maybelarge.dat to stuff/maybelarge.dat
128 warning: $TESTTMP/bigfile-repo/stuff/maybelarge.dat looks like a binary file. (glob)
128 warning: $TESTTMP/bigfile-repo/stuff/maybelarge.dat looks like a binary file. (glob)
129 merging stuff/maybelarge.dat incomplete! (edit conflicts, then use 'hg resolve --mark')
129 merging stuff/maybelarge.dat incomplete! (edit conflicts, then use 'hg resolve --mark')
130 merging sub/normal2 and stuff/normal2 to stuff/normal2
130 merging sub/normal2 and stuff/normal2 to stuff/normal2
131 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
131 0 files updated, 1 files merged, 0 files removed, 1 files unresolved
132 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
132 use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon
133 [1]
133 [1]
134 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
134 $ hg cat -r . sub/maybelarge.dat > stuff/maybelarge.dat
135 $ hg resolve -m stuff/maybelarge.dat
135 $ hg resolve -m stuff/maybelarge.dat
136 $ hg commit -m"merge"
136 $ hg commit -m"merge"
137 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
137 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
138 @ 5:4884f215abda merge
138 @ 5:4884f215abda merge
139 |\
139 |\
140 | o 4:7285f817b77e remove large, normal3
140 | o 4:7285f817b77e remove large, normal3
141 | |
141 | |
142 | o 3:67e3892e3534 add normal3, modify sub/*
142 | o 3:67e3892e3534 add normal3, modify sub/*
143 | |
143 | |
144 o | 2:c96c8beb5d56 rename sub/ to stuff/
144 o | 2:c96c8beb5d56 rename sub/ to stuff/
145 |/
145 |/
146 o 1:020c65d24e11 add sub/*
146 o 1:020c65d24e11 add sub/*
147 |
147 |
148 o 0:117b8328f97a add large, normal1
148 o 0:117b8328f97a add large, normal1
149
149
150 $ cd ..
150 $ cd ..
151
151
152 lfconvert with rename, merge, and remove
152 lfconvert with rename, merge, and remove
153 $ rm -rf largefiles-repo
153 $ rm -rf largefiles-repo
154 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
154 $ hg lfconvert --size 0.2 bigfile-repo largefiles-repo
155 initializing destination largefiles-repo
155 initializing destination largefiles-repo
156 $ cd largefiles-repo
156 $ cd largefiles-repo
157 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
157 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
158 o 5:8e05f5f2b77e merge
158 o 5:8e05f5f2b77e merge
159 |\
159 |\
160 | o 4:a5a02de7a8e4 remove large, normal3
160 | o 4:a5a02de7a8e4 remove large, normal3
161 | |
161 | |
162 | o 3:55759520c76f add normal3, modify sub/*
162 | o 3:55759520c76f add normal3, modify sub/*
163 | |
163 | |
164 o | 2:261ad3f3f037 rename sub/ to stuff/
164 o | 2:261ad3f3f037 rename sub/ to stuff/
165 |/
165 |/
166 o 1:334e5237836d add sub/*
166 o 1:334e5237836d add sub/*
167 |
167 |
168 o 0:d4892ec57ce2 add large, normal1
168 o 0:d4892ec57ce2 add large, normal1
169
169
170 $ hg locate -r 2
170 $ hg locate -r 2
171 .hglf/large
171 .hglf/large
172 .hglf/stuff/maybelarge.dat
172 .hglf/stuff/maybelarge.dat
173 normal1
173 normal1
174 stuff/normal2
174 stuff/normal2
175 $ hg locate -r 3
175 $ hg locate -r 3
176 .hglf/large
176 .hglf/large
177 .hglf/sub/maybelarge.dat
177 .hglf/sub/maybelarge.dat
178 normal1
178 normal1
179 normal3
179 normal3
180 sub/normal2
180 sub/normal2
181 $ hg locate -r 4
181 $ hg locate -r 4
182 .hglf/sub/maybelarge.dat
182 .hglf/sub/maybelarge.dat
183 normal1
183 normal1
184 sub/normal2
184 sub/normal2
185 $ hg locate -r 5
185 $ hg locate -r 5
186 .hglf/stuff/maybelarge.dat
186 .hglf/stuff/maybelarge.dat
187 normal1
187 normal1
188 stuff/normal2
188 stuff/normal2
189 $ hg update
189 $ hg update
190 getting changed largefiles
190 getting changed largefiles
191 1 largefiles updated, 0 removed
191 1 largefiles updated, 0 removed
192 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
192 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
193 $ cat stuff/normal2
193 $ cat stuff/normal2
194 alsonormal
194 alsonormal
195 blah
195 blah
196 $ "$TESTDIR/md5sum.py" stuff/maybelarge.dat
196 $ "$TESTDIR/md5sum.py" stuff/maybelarge.dat
197 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat
197 1dd0b99ff80e19cff409702a1d3f5e15 stuff/maybelarge.dat
198 $ cat .hglf/stuff/maybelarge.dat
198 $ cat .hglf/stuff/maybelarge.dat
199 76236b6a2c6102826c61af4297dd738fb3b1de38
199 76236b6a2c6102826c61af4297dd738fb3b1de38
200 $ cd ..
200 $ cd ..
201
201
202 "lfconvert" error cases
202 "lfconvert" error cases
203 $ hg lfconvert http://localhost/foo foo
203 $ hg lfconvert http://localhost/foo foo
204 abort: http://localhost/foo is not a local Mercurial repo
204 abort: http://localhost/foo is not a local Mercurial repo
205 [255]
205 [255]
206 $ hg lfconvert foo ssh://localhost/foo
206 $ hg lfconvert foo ssh://localhost/foo
207 abort: ssh://localhost/foo is not a local Mercurial repo
207 abort: ssh://localhost/foo is not a local Mercurial repo
208 [255]
208 [255]
209 $ hg lfconvert nosuchrepo foo
209 $ hg lfconvert nosuchrepo foo
210 abort: repository nosuchrepo not found!
210 abort: repository nosuchrepo not found!
211 [255]
211 [255]
212 $ hg share -q -U bigfile-repo shared
212 $ hg share -q -U bigfile-repo shared
213 $ printf 'bogus' > shared/.hg/sharedpath
213 $ printf 'bogus' > shared/.hg/sharedpath
214 $ hg lfconvert shared foo
214 $ hg lfconvert shared foo
215 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus! (glob)
215 abort: .hg/sharedpath points to nonexistent directory $TESTTMP/bogus! (glob)
216 [255]
216 [255]
217 $ hg lfconvert bigfile-repo largefiles-repo
217 $ hg lfconvert bigfile-repo largefiles-repo
218 initializing destination largefiles-repo
218 initializing destination largefiles-repo
219 abort: repository largefiles-repo already exists!
219 abort: repository largefiles-repo already exists!
220 [255]
220 [255]
221
221
222 add another largefile to the new largefiles repo
222 add another largefile to the new largefiles repo
223 $ cd largefiles-repo
223 $ cd largefiles-repo
224 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
224 $ dd if=/dev/zero bs=1k count=1k > anotherlarge 2> /dev/null
225 $ hg add --lfsize=1 anotherlarge
225 $ hg add --lfsize=1 anotherlarge
226 $ hg commit -m "add anotherlarge (should be a largefile)"
226 $ hg commit -m "add anotherlarge (should be a largefile)"
227 $ cat .hglf/anotherlarge
227 $ cat .hglf/anotherlarge
228 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
228 3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3
229 $ cd ..
229 $ cd ..
230
230
231 round-trip: converting back to a normal (non-largefiles) repo with
231 round-trip: converting back to a normal (non-largefiles) repo with
232 "lfconvert --to-normal" should give the same as ../bigfile-repo
232 "lfconvert --to-normal" should give the same as ../bigfile-repo
233 $ cd largefiles-repo
233 $ cd largefiles-repo
234 $ hg lfconvert --to-normal . ../normal-repo
234 $ hg lfconvert --to-normal . ../normal-repo
235 initializing destination ../normal-repo
235 initializing destination ../normal-repo
236 $ cd ../normal-repo
236 $ cd ../normal-repo
237 $ cat >> .hg/hgrc <<EOF
237 $ cat >> .hg/hgrc <<EOF
238 > [extensions]
238 > [extensions]
239 > largefiles = !
239 > largefiles = !
240 > EOF
240 > EOF
241
241
242 # Hmmm: the changeset ID for rev 5 is different from the original
242 # Hmmm: the changeset ID for rev 5 is different from the original
243 # normal repo (../bigfile-repo), because the changelog filelist
243 # normal repo (../bigfile-repo), because the changelog filelist
244 # differs between the two incarnations of rev 5: this repo includes
244 # differs between the two incarnations of rev 5: this repo includes
245 # 'large' in the list, but ../bigfile-repo does not. Since rev 5
245 # 'large' in the list, but ../bigfile-repo does not. Since rev 5
246 # removes 'large' relative to the first parent in both repos, it seems
246 # removes 'large' relative to the first parent in both repos, it seems
247 # to me that lfconvert is doing a *better* job than
247 # to me that lfconvert is doing a *better* job than
248 # "hg remove" + "hg merge" + "hg commit".
248 # "hg remove" + "hg merge" + "hg commit".
249 # $ hg -R ../bigfile-repo debugdata -c 5
249 # $ hg -R ../bigfile-repo debugdata -c 5
250 # $ hg debugdata -c 5
250 # $ hg debugdata -c 5
251 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
251 $ hg glog --template "{rev}:{node|short} {desc|firstline}\n"
252 o 6:1635824e6f59 add anotherlarge (should be a largefile)
252 o 6:1635824e6f59 add anotherlarge (should be a largefile)
253 |
253 |
254 o 5:7215f8deeaaf merge
254 o 5:7215f8deeaaf merge
255 |\
255 |\
256 | o 4:7285f817b77e remove large, normal3
256 | o 4:7285f817b77e remove large, normal3
257 | |
257 | |
258 | o 3:67e3892e3534 add normal3, modify sub/*
258 | o 3:67e3892e3534 add normal3, modify sub/*
259 | |
259 | |
260 o | 2:c96c8beb5d56 rename sub/ to stuff/
260 o | 2:c96c8beb5d56 rename sub/ to stuff/
261 |/
261 |/
262 o 1:020c65d24e11 add sub/*
262 o 1:020c65d24e11 add sub/*
263 |
263 |
264 o 0:117b8328f97a add large, normal1
264 o 0:117b8328f97a add large, normal1
265
265
266 $ hg update
266 $ hg update
267 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
267 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
268 $ hg locate
268 $ hg locate
269 anotherlarge
269 anotherlarge
270 normal1
270 normal1
271 stuff/maybelarge.dat
271 stuff/maybelarge.dat
272 stuff/normal2
272 stuff/normal2
273 $ [ -d .hg/largefiles ] && echo fail || echo pass
273 $ [ -d .hg/largefiles ] && echo fail || echo pass
274 pass
274 pass
275
275
276 $ cd ..
276 $ cd ..
277
277
278 Clearing the usercache ensures that commitctx doesn't try to cache largefiles
278 Clearing the usercache ensures that commitctx doesn't try to cache largefiles
279 from the working dir on a convert.
279 from the working dir on a convert.
280 $ rm "${USERCACHE}"/*
280 $ rm "${USERCACHE}"/*
281 $ hg convert largefiles-repo
281 $ hg convert largefiles-repo
282 assuming destination largefiles-repo-hg
282 assuming destination largefiles-repo-hg
283 initializing destination largefiles-repo-hg repository
283 initializing destination largefiles-repo-hg repository
284 scanning source...
284 scanning source...
285 sorting...
285 sorting...
286 converting...
286 converting...
287 6 add large, normal1
287 6 add large, normal1
288 5 add sub/*
288 5 add sub/*
289 4 rename sub/ to stuff/
289 4 rename sub/ to stuff/
290 3 add normal3, modify sub/*
290 3 add normal3, modify sub/*
291 2 remove large, normal3
291 2 remove large, normal3
292 1 merge
292 1 merge
293 0 add anotherlarge (should be a largefile)
293 0 add anotherlarge (should be a largefile)
294
294
295 $ hg -R largefiles-repo-hg glog --template "{rev}:{node|short} {desc|firstline}\n"
295 $ hg -R largefiles-repo-hg glog --template "{rev}:{node|short} {desc|firstline}\n"
296 o 6:17126745edfd add anotherlarge (should be a largefile)
296 o 6:17126745edfd add anotherlarge (should be a largefile)
297 |
297 |
298 o 5:9cc5aa7204f0 merge
298 o 5:9cc5aa7204f0 merge
299 |\
299 |\
300 | o 4:a5a02de7a8e4 remove large, normal3
300 | o 4:a5a02de7a8e4 remove large, normal3
301 | |
301 | |
302 | o 3:55759520c76f add normal3, modify sub/*
302 | o 3:55759520c76f add normal3, modify sub/*
303 | |
303 | |
304 o | 2:261ad3f3f037 rename sub/ to stuff/
304 o | 2:261ad3f3f037 rename sub/ to stuff/
305 |/
305 |/
306 o 1:334e5237836d add sub/*
306 o 1:334e5237836d add sub/*
307 |
307 |
308 o 0:d4892ec57ce2 add large, normal1
308 o 0:d4892ec57ce2 add large, normal1
309
309
310 Verify will fail (for now) if the usercache is purged before converting, since
310 Verify will fail (for now) if the usercache is purged before converting, since
311 largefiles are not cached in the converted repo's local store by the conversion
311 largefiles are not cached in the converted repo's local store by the conversion
312 process.
312 process.
313 $ hg -R largefiles-repo-hg verify --large --lfa
313 $ hg -R largefiles-repo-hg verify --large --lfa
314 checking changesets
314 checking changesets
315 checking manifests
315 checking manifests
316 crosschecking files in changesets and manifests
316 crosschecking files in changesets and manifests
317 checking files
317 checking files
318 8 files, 7 changesets, 12 total revisions
318 8 files, 7 changesets, 12 total revisions
319 searching 7 changesets for largefiles
319 searching 7 changesets for largefiles
320 changeset 0:d4892ec57ce2: large references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/2e000fa7e85759c7f4c254d4d9c33ef481e459a7 (glob)
320 changeset 0:d4892ec57ce2: large references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/2e000fa7e85759c7f4c254d4d9c33ef481e459a7 (glob)
321 changeset 1:334e5237836d: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c (glob)
321 changeset 1:334e5237836d: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c (glob)
322 changeset 2:261ad3f3f037: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c (glob)
322 changeset 2:261ad3f3f037: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/34e163be8e43c5631d8b92e9c43ab0bf0fa62b9c (glob)
323 changeset 3:55759520c76f: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 (glob)
323 changeset 3:55759520c76f: sub/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 (glob)
324 changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 (glob)
324 changeset 5:9cc5aa7204f0: stuff/maybelarge.dat references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/76236b6a2c6102826c61af4297dd738fb3b1de38 (glob)
325 changeset 6:17126745edfd: anotherlarge references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 (glob)
325 changeset 6:17126745edfd: anotherlarge references missing $TESTTMP/largefiles-repo-hg/.hg/largefiles/3b71f43ff30f4b15b5cd85dd9e95ebc7e84eb5a3 (glob)
326 verified existence of 6 revisions of 4 largefiles
326 verified existence of 6 revisions of 4 largefiles
327 [1]
327 [1]
328 $ hg -R largefiles-repo-hg showconfig paths
328 $ hg -R largefiles-repo-hg showconfig paths
329
329
330
330
331 Avoid a traceback if a largefile isn't available (issue3519)
331 Avoid a traceback if a largefile isn't available (issue3519)
332
332
333 Ensure the largefile can be cached in the source if necessary
333 Ensure the largefile can be cached in the source if necessary
334 $ hg clone -U largefiles-repo issue3519
334 $ hg clone -U largefiles-repo issue3519
335 $ rm -f "${USERCACHE}"/*
335 $ rm -f "${USERCACHE}"/*
336 $ hg lfconvert --to-normal issue3519 normalized3519
336 $ hg lfconvert --to-normal issue3519 normalized3519
337 initializing destination normalized3519
337 initializing destination normalized3519
338
338
339 Ensure the abort message is useful if a largefile is entirely unavailable
339 Ensure the abort message is useful if a largefile is entirely unavailable
340 $ rm -rf normalized3519
340 $ rm -rf normalized3519
341 $ rm "${USERCACHE}"/*
341 $ rm "${USERCACHE}"/*
342 $ rm issue3519/.hg/largefiles/*
342 $ rm issue3519/.hg/largefiles/*
343 $ rm largefiles-repo/.hg/largefiles/*
343 $ rm largefiles-repo/.hg/largefiles/*
344 $ hg lfconvert --to-normal issue3519 normalized3519
344 $ hg lfconvert --to-normal issue3519 normalized3519
345 initializing destination normalized3519
345 initializing destination normalized3519
346 error getting id 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 from url file:$TESTTMP/largefiles-repo for file large: can't get file locally (glob)
346 large: largefile 2e000fa7e85759c7f4c254d4d9c33ef481e459a7 not available from file:$TESTTMP/largefiles-repo
347 abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
347 abort: missing largefile 'large' from revision d4892ec57ce212905215fad1d9018f56b99202ad
348 [255]
348 [255]
349
349
350
350
General Comments 0
You need to be logged in to leave comments. Login now