##// END OF EJS Templates
hg: introduce "wirepeersetupfuncs" to setup wire peer by extensions (issue4109)...
FUJIWARA Katsunori -
r20858:bc56ec9e stable
parent child Browse files
Show More
@@ -1,128 +1,130 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 '''track large binary files
9 '''track large binary files
10
10
11 Large binary files tend to be not very compressible, not very
11 Large binary files tend to be not very compressible, not very
12 diffable, and not at all mergeable. Such files are not handled
12 diffable, and not at all mergeable. Such files are not handled
13 efficiently by Mercurial's storage format (revlog), which is based on
13 efficiently by Mercurial's storage format (revlog), which is based on
14 compressed binary deltas; storing large binary files as regular
14 compressed binary deltas; storing large binary files as regular
15 Mercurial files wastes bandwidth and disk space and increases
15 Mercurial files wastes bandwidth and disk space and increases
16 Mercurial's memory usage. The largefiles extension addresses these
16 Mercurial's memory usage. The largefiles extension addresses these
17 problems by adding a centralized client-server layer on top of
17 problems by adding a centralized client-server layer on top of
18 Mercurial: largefiles live in a *central store* out on the network
18 Mercurial: largefiles live in a *central store* out on the network
19 somewhere, and you only fetch the revisions that you need when you
19 somewhere, and you only fetch the revisions that you need when you
20 need them.
20 need them.
21
21
22 largefiles works by maintaining a "standin file" in .hglf/ for each
22 largefiles works by maintaining a "standin file" in .hglf/ for each
23 largefile. The standins are small (41 bytes: an SHA-1 hash plus
23 largefile. The standins are small (41 bytes: an SHA-1 hash plus
24 newline) and are tracked by Mercurial. Largefile revisions are
24 newline) and are tracked by Mercurial. Largefile revisions are
25 identified by the SHA-1 hash of their contents, which is written to
25 identified by the SHA-1 hash of their contents, which is written to
26 the standin. largefiles uses that revision ID to get/put largefile
26 the standin. largefiles uses that revision ID to get/put largefile
27 revisions from/to the central store. This saves both disk space and
27 revisions from/to the central store. This saves both disk space and
28 bandwidth, since you don't need to retrieve all historical revisions
28 bandwidth, since you don't need to retrieve all historical revisions
29 of large files when you clone or pull.
29 of large files when you clone or pull.
30
30
31 To start a new repository or add new large binary files, just add
31 To start a new repository or add new large binary files, just add
32 --large to your :hg:`add` command. For example::
32 --large to your :hg:`add` command. For example::
33
33
34 $ dd if=/dev/urandom of=randomdata count=2000
34 $ dd if=/dev/urandom of=randomdata count=2000
35 $ hg add --large randomdata
35 $ hg add --large randomdata
36 $ hg commit -m 'add randomdata as a largefile'
36 $ hg commit -m 'add randomdata as a largefile'
37
37
38 When you push a changeset that adds/modifies largefiles to a remote
38 When you push a changeset that adds/modifies largefiles to a remote
39 repository, its largefile revisions will be uploaded along with it.
39 repository, its largefile revisions will be uploaded along with it.
40 Note that the remote Mercurial must also have the largefiles extension
40 Note that the remote Mercurial must also have the largefiles extension
41 enabled for this to work.
41 enabled for this to work.
42
42
43 When you pull a changeset that affects largefiles from a remote
43 When you pull a changeset that affects largefiles from a remote
44 repository, the largefiles for the changeset will by default not be
44 repository, the largefiles for the changeset will by default not be
45 pulled down. However, when you update to such a revision, any
45 pulled down. However, when you update to such a revision, any
46 largefiles needed by that revision are downloaded and cached (if
46 largefiles needed by that revision are downloaded and cached (if
47 they have never been downloaded before). One way to pull largefiles
47 they have never been downloaded before). One way to pull largefiles
48 when pulling is thus to use --update, which will update your working
48 when pulling is thus to use --update, which will update your working
49 copy to the latest pulled revision (and thereby downloading any new
49 copy to the latest pulled revision (and thereby downloading any new
50 largefiles).
50 largefiles).
51
51
52 If you want to pull largefiles you don't need for update yet, then
52 If you want to pull largefiles you don't need for update yet, then
53 you can use pull with the `--lfrev` option or the :hg:`lfpull` command.
53 you can use pull with the `--lfrev` option or the :hg:`lfpull` command.
54
54
55 If you know you are pulling from a non-default location and want to
55 If you know you are pulling from a non-default location and want to
56 download all the largefiles that correspond to the new changesets at
56 download all the largefiles that correspond to the new changesets at
57 the same time, then you can pull with `--lfrev "pulled()"`.
57 the same time, then you can pull with `--lfrev "pulled()"`.
58
58
59 If you just want to ensure that you will have the largefiles needed to
59 If you just want to ensure that you will have the largefiles needed to
60 merge or rebase with new heads that you are pulling, then you can pull
60 merge or rebase with new heads that you are pulling, then you can pull
61 with `--lfrev "head(pulled())"` flag to pre-emptively download any largefiles
61 with `--lfrev "head(pulled())"` flag to pre-emptively download any largefiles
62 that are new in the heads you are pulling.
62 that are new in the heads you are pulling.
63
63
64 Keep in mind that network access may now be required to update to
64 Keep in mind that network access may now be required to update to
65 changesets that you have not previously updated to. The nature of the
65 changesets that you have not previously updated to. The nature of the
66 largefiles extension means that updating is no longer guaranteed to
66 largefiles extension means that updating is no longer guaranteed to
67 be a local-only operation.
67 be a local-only operation.
68
68
69 If you already have large files tracked by Mercurial without the
69 If you already have large files tracked by Mercurial without the
70 largefiles extension, you will need to convert your repository in
70 largefiles extension, you will need to convert your repository in
71 order to benefit from largefiles. This is done with the
71 order to benefit from largefiles. This is done with the
72 :hg:`lfconvert` command::
72 :hg:`lfconvert` command::
73
73
74 $ hg lfconvert --size 10 oldrepo newrepo
74 $ hg lfconvert --size 10 oldrepo newrepo
75
75
76 In repositories that already have largefiles in them, any new file
76 In repositories that already have largefiles in them, any new file
77 over 10MB will automatically be added as a largefile. To change this
77 over 10MB will automatically be added as a largefile. To change this
78 threshold, set ``largefiles.minsize`` in your Mercurial config file
78 threshold, set ``largefiles.minsize`` in your Mercurial config file
79 to the minimum size in megabytes to track as a largefile, or use the
79 to the minimum size in megabytes to track as a largefile, or use the
80 --lfsize option to the add command (also in megabytes)::
80 --lfsize option to the add command (also in megabytes)::
81
81
82 [largefiles]
82 [largefiles]
83 minsize = 2
83 minsize = 2
84
84
85 $ hg add --lfsize 2
85 $ hg add --lfsize 2
86
86
87 The ``largefiles.patterns`` config option allows you to specify a list
87 The ``largefiles.patterns`` config option allows you to specify a list
88 of filename patterns (see :hg:`help patterns`) that should always be
88 of filename patterns (see :hg:`help patterns`) that should always be
89 tracked as largefiles::
89 tracked as largefiles::
90
90
91 [largefiles]
91 [largefiles]
92 patterns =
92 patterns =
93 *.jpg
93 *.jpg
94 re:.*\.(png|bmp)$
94 re:.*\.(png|bmp)$
95 library.zip
95 library.zip
96 content/audio/*
96 content/audio/*
97
97
98 Files that match one of these patterns will be added as largefiles
98 Files that match one of these patterns will be added as largefiles
99 regardless of their size.
99 regardless of their size.
100
100
101 The ``largefiles.minsize`` and ``largefiles.patterns`` config options
101 The ``largefiles.minsize`` and ``largefiles.patterns`` config options
102 will be ignored for any repositories not already containing a
102 will be ignored for any repositories not already containing a
103 largefile. To add the first largefile to a repository, you must
103 largefile. To add the first largefile to a repository, you must
104 explicitly do so with the --large flag passed to the :hg:`add`
104 explicitly do so with the --large flag passed to the :hg:`add`
105 command.
105 command.
106 '''
106 '''
107
107
108 from mercurial import commands, localrepo
108 from mercurial import commands, hg, localrepo
109
109
110 import lfcommands
110 import lfcommands
111 import proto
111 import reposetup
112 import reposetup
112 import uisetup as uisetupmod
113 import uisetup as uisetupmod
113
114
114 testedwith = 'internal'
115 testedwith = 'internal'
115
116
116 reposetup = reposetup.reposetup
117 reposetup = reposetup.reposetup
117
118
118 def featuresetup(ui, supported):
119 def featuresetup(ui, supported):
119 # don't die on seeing a repo with the largefiles requirement
120 # don't die on seeing a repo with the largefiles requirement
120 supported |= set(['largefiles'])
121 supported |= set(['largefiles'])
121
122
122 def uisetup(ui):
123 def uisetup(ui):
123 localrepo.localrepository.featuresetupfuncs.add(featuresetup)
124 localrepo.localrepository.featuresetupfuncs.add(featuresetup)
125 hg.wirepeersetupfuncs.append(proto.wirereposetup)
124 uisetupmod.uisetup(ui)
126 uisetupmod.uisetup(ui)
125
127
126 commands.norepo += " lfconvert"
128 commands.norepo += " lfconvert"
127
129
128 cmdtable = lfcommands.cmdtable
130 cmdtable = lfcommands.cmdtable
@@ -1,514 +1,513 b''
1 # Copyright 2009-2010 Gregory P. Ward
1 # Copyright 2009-2010 Gregory P. Ward
2 # Copyright 2009-2010 Intelerad Medical Systems Incorporated
2 # Copyright 2009-2010 Intelerad Medical Systems Incorporated
3 # Copyright 2010-2011 Fog Creek Software
3 # Copyright 2010-2011 Fog Creek Software
4 # Copyright 2010-2011 Unity Technologies
4 # Copyright 2010-2011 Unity Technologies
5 #
5 #
6 # This software may be used and distributed according to the terms of the
6 # This software may be used and distributed according to the terms of the
7 # GNU General Public License version 2 or any later version.
7 # GNU General Public License version 2 or any later version.
8
8
9 '''setup for largefiles repositories: reposetup'''
9 '''setup for largefiles repositories: reposetup'''
10 import copy
10 import copy
11 import os
11 import os
12
12
13 from mercurial import error, manifest, match as match_, util, discovery
13 from mercurial import error, manifest, match as match_, util, discovery
14 from mercurial import node as node_
14 from mercurial import node as node_
15 from mercurial.i18n import _
15 from mercurial.i18n import _
16 from mercurial import localrepo
16 from mercurial import localrepo
17
17
18 import lfcommands
18 import lfcommands
19 import proto
20 import lfutil
19 import lfutil
21
20
22 def reposetup(ui, repo):
21 def reposetup(ui, repo):
23 # wire repositories should be given new wireproto functions but not the
22 # wire repositories should be given new wireproto functions
24 # other largefiles modifications
23 # by "proto.wirereposetup()" via "hg.wirepeersetupfuncs"
25 if not repo.local():
24 if not repo.local():
26 return proto.wirereposetup(ui, repo)
25 return
27
26
28 class lfilesrepo(repo.__class__):
27 class lfilesrepo(repo.__class__):
29 lfstatus = False
28 lfstatus = False
30 def status_nolfiles(self, *args, **kwargs):
29 def status_nolfiles(self, *args, **kwargs):
31 return super(lfilesrepo, self).status(*args, **kwargs)
30 return super(lfilesrepo, self).status(*args, **kwargs)
32
31
33 # When lfstatus is set, return a context that gives the names
32 # When lfstatus is set, return a context that gives the names
34 # of largefiles instead of their corresponding standins and
33 # of largefiles instead of their corresponding standins and
35 # identifies the largefiles as always binary, regardless of
34 # identifies the largefiles as always binary, regardless of
36 # their actual contents.
35 # their actual contents.
37 def __getitem__(self, changeid):
36 def __getitem__(self, changeid):
38 ctx = super(lfilesrepo, self).__getitem__(changeid)
37 ctx = super(lfilesrepo, self).__getitem__(changeid)
39 if self.lfstatus:
38 if self.lfstatus:
40 class lfilesmanifestdict(manifest.manifestdict):
39 class lfilesmanifestdict(manifest.manifestdict):
41 def __contains__(self, filename):
40 def __contains__(self, filename):
42 if super(lfilesmanifestdict,
41 if super(lfilesmanifestdict,
43 self).__contains__(filename):
42 self).__contains__(filename):
44 return True
43 return True
45 return super(lfilesmanifestdict,
44 return super(lfilesmanifestdict,
46 self).__contains__(lfutil.standin(filename))
45 self).__contains__(lfutil.standin(filename))
47 class lfilesctx(ctx.__class__):
46 class lfilesctx(ctx.__class__):
48 def files(self):
47 def files(self):
49 filenames = super(lfilesctx, self).files()
48 filenames = super(lfilesctx, self).files()
50 return [lfutil.splitstandin(f) or f for f in filenames]
49 return [lfutil.splitstandin(f) or f for f in filenames]
51 def manifest(self):
50 def manifest(self):
52 man1 = super(lfilesctx, self).manifest()
51 man1 = super(lfilesctx, self).manifest()
53 man1.__class__ = lfilesmanifestdict
52 man1.__class__ = lfilesmanifestdict
54 return man1
53 return man1
55 def filectx(self, path, fileid=None, filelog=None):
54 def filectx(self, path, fileid=None, filelog=None):
56 try:
55 try:
57 if filelog is not None:
56 if filelog is not None:
58 result = super(lfilesctx, self).filectx(
57 result = super(lfilesctx, self).filectx(
59 path, fileid, filelog)
58 path, fileid, filelog)
60 else:
59 else:
61 result = super(lfilesctx, self).filectx(
60 result = super(lfilesctx, self).filectx(
62 path, fileid)
61 path, fileid)
63 except error.LookupError:
62 except error.LookupError:
64 # Adding a null character will cause Mercurial to
63 # Adding a null character will cause Mercurial to
65 # identify this as a binary file.
64 # identify this as a binary file.
66 if filelog is not None:
65 if filelog is not None:
67 result = super(lfilesctx, self).filectx(
66 result = super(lfilesctx, self).filectx(
68 lfutil.standin(path), fileid, filelog)
67 lfutil.standin(path), fileid, filelog)
69 else:
68 else:
70 result = super(lfilesctx, self).filectx(
69 result = super(lfilesctx, self).filectx(
71 lfutil.standin(path), fileid)
70 lfutil.standin(path), fileid)
72 olddata = result.data
71 olddata = result.data
73 result.data = lambda: olddata() + '\0'
72 result.data = lambda: olddata() + '\0'
74 return result
73 return result
75 ctx.__class__ = lfilesctx
74 ctx.__class__ = lfilesctx
76 return ctx
75 return ctx
77
76
78 # Figure out the status of big files and insert them into the
77 # Figure out the status of big files and insert them into the
79 # appropriate list in the result. Also removes standin files
78 # appropriate list in the result. Also removes standin files
80 # from the listing. Revert to the original status if
79 # from the listing. Revert to the original status if
81 # self.lfstatus is False.
80 # self.lfstatus is False.
82 # XXX large file status is buggy when used on repo proxy.
81 # XXX large file status is buggy when used on repo proxy.
83 # XXX this needs to be investigated.
82 # XXX this needs to be investigated.
84 @localrepo.unfilteredmethod
83 @localrepo.unfilteredmethod
85 def status(self, node1='.', node2=None, match=None, ignored=False,
84 def status(self, node1='.', node2=None, match=None, ignored=False,
86 clean=False, unknown=False, listsubrepos=False):
85 clean=False, unknown=False, listsubrepos=False):
87 listignored, listclean, listunknown = ignored, clean, unknown
86 listignored, listclean, listunknown = ignored, clean, unknown
88 if not self.lfstatus:
87 if not self.lfstatus:
89 return super(lfilesrepo, self).status(node1, node2, match,
88 return super(lfilesrepo, self).status(node1, node2, match,
90 listignored, listclean, listunknown, listsubrepos)
89 listignored, listclean, listunknown, listsubrepos)
91 else:
90 else:
92 # some calls in this function rely on the old version of status
91 # some calls in this function rely on the old version of status
93 self.lfstatus = False
92 self.lfstatus = False
94 ctx1 = self[node1]
93 ctx1 = self[node1]
95 ctx2 = self[node2]
94 ctx2 = self[node2]
96 working = ctx2.rev() is None
95 working = ctx2.rev() is None
97 parentworking = working and ctx1 == self['.']
96 parentworking = working and ctx1 == self['.']
98
97
99 def inctx(file, ctx):
98 def inctx(file, ctx):
100 try:
99 try:
101 if ctx.rev() is None:
100 if ctx.rev() is None:
102 return file in ctx.manifest()
101 return file in ctx.manifest()
103 ctx[file]
102 ctx[file]
104 return True
103 return True
105 except KeyError:
104 except KeyError:
106 return False
105 return False
107
106
108 if match is None:
107 if match is None:
109 match = match_.always(self.root, self.getcwd())
108 match = match_.always(self.root, self.getcwd())
110
109
111 wlock = None
110 wlock = None
112 try:
111 try:
113 try:
112 try:
114 # updating the dirstate is optional
113 # updating the dirstate is optional
115 # so we don't wait on the lock
114 # so we don't wait on the lock
116 wlock = self.wlock(False)
115 wlock = self.wlock(False)
117 except error.LockError:
116 except error.LockError:
118 pass
117 pass
119
118
120 # First check if there were files specified on the
119 # First check if there were files specified on the
121 # command line. If there were, and none of them were
120 # command line. If there were, and none of them were
122 # largefiles, we should just bail here and let super
121 # largefiles, we should just bail here and let super
123 # handle it -- thus gaining a big performance boost.
122 # handle it -- thus gaining a big performance boost.
124 lfdirstate = lfutil.openlfdirstate(ui, self)
123 lfdirstate = lfutil.openlfdirstate(ui, self)
125 if match.files() and not match.anypats():
124 if match.files() and not match.anypats():
126 for f in lfdirstate:
125 for f in lfdirstate:
127 if match(f):
126 if match(f):
128 break
127 break
129 else:
128 else:
130 return super(lfilesrepo, self).status(node1, node2,
129 return super(lfilesrepo, self).status(node1, node2,
131 match, listignored, listclean,
130 match, listignored, listclean,
132 listunknown, listsubrepos)
131 listunknown, listsubrepos)
133
132
134 # Create a copy of match that matches standins instead
133 # Create a copy of match that matches standins instead
135 # of largefiles.
134 # of largefiles.
136 def tostandins(files):
135 def tostandins(files):
137 if not working:
136 if not working:
138 return files
137 return files
139 newfiles = []
138 newfiles = []
140 dirstate = self.dirstate
139 dirstate = self.dirstate
141 for f in files:
140 for f in files:
142 sf = lfutil.standin(f)
141 sf = lfutil.standin(f)
143 if sf in dirstate:
142 if sf in dirstate:
144 newfiles.append(sf)
143 newfiles.append(sf)
145 elif sf in dirstate.dirs():
144 elif sf in dirstate.dirs():
146 # Directory entries could be regular or
145 # Directory entries could be regular or
147 # standin, check both
146 # standin, check both
148 newfiles.extend((f, sf))
147 newfiles.extend((f, sf))
149 else:
148 else:
150 newfiles.append(f)
149 newfiles.append(f)
151 return newfiles
150 return newfiles
152
151
153 m = copy.copy(match)
152 m = copy.copy(match)
154 m._files = tostandins(m._files)
153 m._files = tostandins(m._files)
155
154
156 result = super(lfilesrepo, self).status(node1, node2, m,
155 result = super(lfilesrepo, self).status(node1, node2, m,
157 ignored, clean, unknown, listsubrepos)
156 ignored, clean, unknown, listsubrepos)
158 if working:
157 if working:
159
158
160 def sfindirstate(f):
159 def sfindirstate(f):
161 sf = lfutil.standin(f)
160 sf = lfutil.standin(f)
162 dirstate = self.dirstate
161 dirstate = self.dirstate
163 return sf in dirstate or sf in dirstate.dirs()
162 return sf in dirstate or sf in dirstate.dirs()
164
163
165 match._files = [f for f in match._files
164 match._files = [f for f in match._files
166 if sfindirstate(f)]
165 if sfindirstate(f)]
167 # Don't waste time getting the ignored and unknown
166 # Don't waste time getting the ignored and unknown
168 # files from lfdirstate
167 # files from lfdirstate
169 s = lfdirstate.status(match, [], False,
168 s = lfdirstate.status(match, [], False,
170 listclean, False)
169 listclean, False)
171 (unsure, modified, added, removed, missing, _unknown,
170 (unsure, modified, added, removed, missing, _unknown,
172 _ignored, clean) = s
171 _ignored, clean) = s
173 if parentworking:
172 if parentworking:
174 for lfile in unsure:
173 for lfile in unsure:
175 standin = lfutil.standin(lfile)
174 standin = lfutil.standin(lfile)
176 if standin not in ctx1:
175 if standin not in ctx1:
177 # from second parent
176 # from second parent
178 modified.append(lfile)
177 modified.append(lfile)
179 elif ctx1[standin].data().strip() \
178 elif ctx1[standin].data().strip() \
180 != lfutil.hashfile(self.wjoin(lfile)):
179 != lfutil.hashfile(self.wjoin(lfile)):
181 modified.append(lfile)
180 modified.append(lfile)
182 else:
181 else:
183 clean.append(lfile)
182 clean.append(lfile)
184 lfdirstate.normal(lfile)
183 lfdirstate.normal(lfile)
185 else:
184 else:
186 tocheck = unsure + modified + added + clean
185 tocheck = unsure + modified + added + clean
187 modified, added, clean = [], [], []
186 modified, added, clean = [], [], []
188
187
189 for lfile in tocheck:
188 for lfile in tocheck:
190 standin = lfutil.standin(lfile)
189 standin = lfutil.standin(lfile)
191 if inctx(standin, ctx1):
190 if inctx(standin, ctx1):
192 if ctx1[standin].data().strip() != \
191 if ctx1[standin].data().strip() != \
193 lfutil.hashfile(self.wjoin(lfile)):
192 lfutil.hashfile(self.wjoin(lfile)):
194 modified.append(lfile)
193 modified.append(lfile)
195 else:
194 else:
196 clean.append(lfile)
195 clean.append(lfile)
197 else:
196 else:
198 added.append(lfile)
197 added.append(lfile)
199
198
200 # Standins no longer found in lfdirstate has been
199 # Standins no longer found in lfdirstate has been
201 # removed
200 # removed
202 for standin in ctx1.manifest():
201 for standin in ctx1.manifest():
203 if not lfutil.isstandin(standin):
202 if not lfutil.isstandin(standin):
204 continue
203 continue
205 lfile = lfutil.splitstandin(standin)
204 lfile = lfutil.splitstandin(standin)
206 if not match(lfile):
205 if not match(lfile):
207 continue
206 continue
208 if lfile not in lfdirstate:
207 if lfile not in lfdirstate:
209 removed.append(lfile)
208 removed.append(lfile)
210
209
211 # Filter result lists
210 # Filter result lists
212 result = list(result)
211 result = list(result)
213
212
214 # Largefiles are not really removed when they're
213 # Largefiles are not really removed when they're
215 # still in the normal dirstate. Likewise, normal
214 # still in the normal dirstate. Likewise, normal
216 # files are not really removed if they are still in
215 # files are not really removed if they are still in
217 # lfdirstate. This happens in merges where files
216 # lfdirstate. This happens in merges where files
218 # change type.
217 # change type.
219 removed = [f for f in removed
218 removed = [f for f in removed
220 if f not in self.dirstate]
219 if f not in self.dirstate]
221 result[2] = [f for f in result[2]
220 result[2] = [f for f in result[2]
222 if f not in lfdirstate]
221 if f not in lfdirstate]
223
222
224 lfiles = set(lfdirstate._map)
223 lfiles = set(lfdirstate._map)
225 # Unknown files
224 # Unknown files
226 result[4] = set(result[4]).difference(lfiles)
225 result[4] = set(result[4]).difference(lfiles)
227 # Ignored files
226 # Ignored files
228 result[5] = set(result[5]).difference(lfiles)
227 result[5] = set(result[5]).difference(lfiles)
229 # combine normal files and largefiles
228 # combine normal files and largefiles
230 normals = [[fn for fn in filelist
229 normals = [[fn for fn in filelist
231 if not lfutil.isstandin(fn)]
230 if not lfutil.isstandin(fn)]
232 for filelist in result]
231 for filelist in result]
233 lfiles = (modified, added, removed, missing, [], [],
232 lfiles = (modified, added, removed, missing, [], [],
234 clean)
233 clean)
235 result = [sorted(list1 + list2)
234 result = [sorted(list1 + list2)
236 for (list1, list2) in zip(normals, lfiles)]
235 for (list1, list2) in zip(normals, lfiles)]
237 else:
236 else:
238 def toname(f):
237 def toname(f):
239 if lfutil.isstandin(f):
238 if lfutil.isstandin(f):
240 return lfutil.splitstandin(f)
239 return lfutil.splitstandin(f)
241 return f
240 return f
242 result = [[toname(f) for f in items]
241 result = [[toname(f) for f in items]
243 for items in result]
242 for items in result]
244
243
245 if wlock:
244 if wlock:
246 lfdirstate.write()
245 lfdirstate.write()
247
246
248 finally:
247 finally:
249 if wlock:
248 if wlock:
250 wlock.release()
249 wlock.release()
251
250
252 if not listunknown:
251 if not listunknown:
253 result[4] = []
252 result[4] = []
254 if not listignored:
253 if not listignored:
255 result[5] = []
254 result[5] = []
256 if not listclean:
255 if not listclean:
257 result[6] = []
256 result[6] = []
258 self.lfstatus = True
257 self.lfstatus = True
259 return result
258 return result
260
259
261 # As part of committing, copy all of the largefiles into the
260 # As part of committing, copy all of the largefiles into the
262 # cache.
261 # cache.
263 def commitctx(self, *args, **kwargs):
262 def commitctx(self, *args, **kwargs):
264 node = super(lfilesrepo, self).commitctx(*args, **kwargs)
263 node = super(lfilesrepo, self).commitctx(*args, **kwargs)
265 lfutil.copyalltostore(self, node)
264 lfutil.copyalltostore(self, node)
266 return node
265 return node
267
266
268 # Before commit, largefile standins have not had their
267 # Before commit, largefile standins have not had their
269 # contents updated to reflect the hash of their largefile.
268 # contents updated to reflect the hash of their largefile.
270 # Do that here.
269 # Do that here.
271 def commit(self, text="", user=None, date=None, match=None,
270 def commit(self, text="", user=None, date=None, match=None,
272 force=False, editor=False, extra={}):
271 force=False, editor=False, extra={}):
273 orig = super(lfilesrepo, self).commit
272 orig = super(lfilesrepo, self).commit
274
273
275 wlock = self.wlock()
274 wlock = self.wlock()
276 try:
275 try:
277 # Case 0: Rebase or Transplant
276 # Case 0: Rebase or Transplant
278 # We have to take the time to pull down the new largefiles now.
277 # We have to take the time to pull down the new largefiles now.
279 # Otherwise, any largefiles that were modified in the
278 # Otherwise, any largefiles that were modified in the
280 # destination changesets get overwritten, either by the rebase
279 # destination changesets get overwritten, either by the rebase
281 # or in the first commit after the rebase or transplant.
280 # or in the first commit after the rebase or transplant.
282 # updatelfiles will update the dirstate to mark any pulled
281 # updatelfiles will update the dirstate to mark any pulled
283 # largefiles as modified
282 # largefiles as modified
284 if getattr(self, "_isrebasing", False) or \
283 if getattr(self, "_isrebasing", False) or \
285 getattr(self, "_istransplanting", False):
284 getattr(self, "_istransplanting", False):
286 lfcommands.updatelfiles(self.ui, self, filelist=None,
285 lfcommands.updatelfiles(self.ui, self, filelist=None,
287 printmessage=False)
286 printmessage=False)
288 result = orig(text=text, user=user, date=date, match=match,
287 result = orig(text=text, user=user, date=date, match=match,
289 force=force, editor=editor, extra=extra)
288 force=force, editor=editor, extra=extra)
290 return result
289 return result
291 # Case 1: user calls commit with no specific files or
290 # Case 1: user calls commit with no specific files or
292 # include/exclude patterns: refresh and commit all files that
291 # include/exclude patterns: refresh and commit all files that
293 # are "dirty".
292 # are "dirty".
294 if ((match is None) or
293 if ((match is None) or
295 (not match.anypats() and not match.files())):
294 (not match.anypats() and not match.files())):
296 # Spend a bit of time here to get a list of files we know
295 # Spend a bit of time here to get a list of files we know
297 # are modified so we can compare only against those.
296 # are modified so we can compare only against those.
298 # It can cost a lot of time (several seconds)
297 # It can cost a lot of time (several seconds)
299 # otherwise to update all standins if the largefiles are
298 # otherwise to update all standins if the largefiles are
300 # large.
299 # large.
301 lfdirstate = lfutil.openlfdirstate(ui, self)
300 lfdirstate = lfutil.openlfdirstate(ui, self)
302 dirtymatch = match_.always(self.root, self.getcwd())
301 dirtymatch = match_.always(self.root, self.getcwd())
303 s = lfdirstate.status(dirtymatch, [], False, False, False)
302 s = lfdirstate.status(dirtymatch, [], False, False, False)
304 (unsure, modified, added, removed, _missing, _unknown,
303 (unsure, modified, added, removed, _missing, _unknown,
305 _ignored, _clean) = s
304 _ignored, _clean) = s
306 modifiedfiles = unsure + modified + added + removed
305 modifiedfiles = unsure + modified + added + removed
307 lfiles = lfutil.listlfiles(self)
306 lfiles = lfutil.listlfiles(self)
308 # this only loops through largefiles that exist (not
307 # this only loops through largefiles that exist (not
309 # removed/renamed)
308 # removed/renamed)
310 for lfile in lfiles:
309 for lfile in lfiles:
311 if lfile in modifiedfiles:
310 if lfile in modifiedfiles:
312 if os.path.exists(
311 if os.path.exists(
313 self.wjoin(lfutil.standin(lfile))):
312 self.wjoin(lfutil.standin(lfile))):
314 # this handles the case where a rebase is being
313 # this handles the case where a rebase is being
315 # performed and the working copy is not updated
314 # performed and the working copy is not updated
316 # yet.
315 # yet.
317 if os.path.exists(self.wjoin(lfile)):
316 if os.path.exists(self.wjoin(lfile)):
318 lfutil.updatestandin(self,
317 lfutil.updatestandin(self,
319 lfutil.standin(lfile))
318 lfutil.standin(lfile))
320 lfdirstate.normal(lfile)
319 lfdirstate.normal(lfile)
321
320
322 result = orig(text=text, user=user, date=date, match=match,
321 result = orig(text=text, user=user, date=date, match=match,
323 force=force, editor=editor, extra=extra)
322 force=force, editor=editor, extra=extra)
324
323
325 if result is not None:
324 if result is not None:
326 for lfile in lfdirstate:
325 for lfile in lfdirstate:
327 if lfile in modifiedfiles:
326 if lfile in modifiedfiles:
328 if (not os.path.exists(self.wjoin(
327 if (not os.path.exists(self.wjoin(
329 lfutil.standin(lfile)))) or \
328 lfutil.standin(lfile)))) or \
330 (not os.path.exists(self.wjoin(lfile))):
329 (not os.path.exists(self.wjoin(lfile))):
331 lfdirstate.drop(lfile)
330 lfdirstate.drop(lfile)
332
331
333 # This needs to be after commit; otherwise precommit hooks
332 # This needs to be after commit; otherwise precommit hooks
334 # get the wrong status
333 # get the wrong status
335 lfdirstate.write()
334 lfdirstate.write()
336 return result
335 return result
337
336
338 lfiles = lfutil.listlfiles(self)
337 lfiles = lfutil.listlfiles(self)
339 match._files = self._subdirlfs(match.files(), lfiles)
338 match._files = self._subdirlfs(match.files(), lfiles)
340
339
341 # Case 2: user calls commit with specified patterns: refresh
340 # Case 2: user calls commit with specified patterns: refresh
342 # any matching big files.
341 # any matching big files.
343 smatcher = lfutil.composestandinmatcher(self, match)
342 smatcher = lfutil.composestandinmatcher(self, match)
344 standins = self.dirstate.walk(smatcher, [], False, False)
343 standins = self.dirstate.walk(smatcher, [], False, False)
345
344
346 # No matching big files: get out of the way and pass control to
345 # No matching big files: get out of the way and pass control to
347 # the usual commit() method.
346 # the usual commit() method.
348 if not standins:
347 if not standins:
349 return orig(text=text, user=user, date=date, match=match,
348 return orig(text=text, user=user, date=date, match=match,
350 force=force, editor=editor, extra=extra)
349 force=force, editor=editor, extra=extra)
351
350
352 # Refresh all matching big files. It's possible that the
351 # Refresh all matching big files. It's possible that the
353 # commit will end up failing, in which case the big files will
352 # commit will end up failing, in which case the big files will
354 # stay refreshed. No harm done: the user modified them and
353 # stay refreshed. No harm done: the user modified them and
355 # asked to commit them, so sooner or later we're going to
354 # asked to commit them, so sooner or later we're going to
356 # refresh the standins. Might as well leave them refreshed.
355 # refresh the standins. Might as well leave them refreshed.
357 lfdirstate = lfutil.openlfdirstate(ui, self)
356 lfdirstate = lfutil.openlfdirstate(ui, self)
358 for standin in standins:
357 for standin in standins:
359 lfile = lfutil.splitstandin(standin)
358 lfile = lfutil.splitstandin(standin)
360 if lfdirstate[lfile] != 'r':
359 if lfdirstate[lfile] != 'r':
361 lfutil.updatestandin(self, standin)
360 lfutil.updatestandin(self, standin)
362 lfdirstate.normal(lfile)
361 lfdirstate.normal(lfile)
363 else:
362 else:
364 lfdirstate.drop(lfile)
363 lfdirstate.drop(lfile)
365
364
366 # Cook up a new matcher that only matches regular files or
365 # Cook up a new matcher that only matches regular files or
367 # standins corresponding to the big files requested by the
366 # standins corresponding to the big files requested by the
368 # user. Have to modify _files to prevent commit() from
367 # user. Have to modify _files to prevent commit() from
369 # complaining "not tracked" for big files.
368 # complaining "not tracked" for big files.
370 match = copy.copy(match)
369 match = copy.copy(match)
371 origmatchfn = match.matchfn
370 origmatchfn = match.matchfn
372
371
373 # Check both the list of largefiles and the list of
372 # Check both the list of largefiles and the list of
374 # standins because if a largefile was removed, it
373 # standins because if a largefile was removed, it
375 # won't be in the list of largefiles at this point
374 # won't be in the list of largefiles at this point
376 match._files += sorted(standins)
375 match._files += sorted(standins)
377
376
378 actualfiles = []
377 actualfiles = []
379 for f in match._files:
378 for f in match._files:
380 fstandin = lfutil.standin(f)
379 fstandin = lfutil.standin(f)
381
380
382 # ignore known largefiles and standins
381 # ignore known largefiles and standins
383 if f in lfiles or fstandin in standins:
382 if f in lfiles or fstandin in standins:
384 continue
383 continue
385
384
386 # append directory separator to avoid collisions
385 # append directory separator to avoid collisions
387 if not fstandin.endswith(os.sep):
386 if not fstandin.endswith(os.sep):
388 fstandin += os.sep
387 fstandin += os.sep
389
388
390 actualfiles.append(f)
389 actualfiles.append(f)
391 match._files = actualfiles
390 match._files = actualfiles
392
391
393 def matchfn(f):
392 def matchfn(f):
394 if origmatchfn(f):
393 if origmatchfn(f):
395 return f not in lfiles
394 return f not in lfiles
396 else:
395 else:
397 return f in standins
396 return f in standins
398
397
399 match.matchfn = matchfn
398 match.matchfn = matchfn
400 result = orig(text=text, user=user, date=date, match=match,
399 result = orig(text=text, user=user, date=date, match=match,
401 force=force, editor=editor, extra=extra)
400 force=force, editor=editor, extra=extra)
402 # This needs to be after commit; otherwise precommit hooks
401 # This needs to be after commit; otherwise precommit hooks
403 # get the wrong status
402 # get the wrong status
404 lfdirstate.write()
403 lfdirstate.write()
405 return result
404 return result
406 finally:
405 finally:
407 wlock.release()
406 wlock.release()
408
407
409 def push(self, remote, force=False, revs=None, newbranch=False):
408 def push(self, remote, force=False, revs=None, newbranch=False):
410 if remote.local():
409 if remote.local():
411 missing = set(self.requirements) - remote.local().supported
410 missing = set(self.requirements) - remote.local().supported
412 if missing:
411 if missing:
413 msg = _("required features are not"
412 msg = _("required features are not"
414 " supported in the destination:"
413 " supported in the destination:"
415 " %s") % (', '.join(sorted(missing)))
414 " %s") % (', '.join(sorted(missing)))
416 raise util.Abort(msg)
415 raise util.Abort(msg)
417
416
418 outgoing = discovery.findcommonoutgoing(repo, remote.peer(),
417 outgoing = discovery.findcommonoutgoing(repo, remote.peer(),
419 force=force)
418 force=force)
420 if outgoing.missing:
419 if outgoing.missing:
421 toupload = set()
420 toupload = set()
422 o = self.changelog.nodesbetween(outgoing.missing, revs)[0]
421 o = self.changelog.nodesbetween(outgoing.missing, revs)[0]
423 for n in o:
422 for n in o:
424 parents = [p for p in self.changelog.parents(n)
423 parents = [p for p in self.changelog.parents(n)
425 if p != node_.nullid]
424 if p != node_.nullid]
426 ctx = self[n]
425 ctx = self[n]
427 files = set(ctx.files())
426 files = set(ctx.files())
428 if len(parents) == 2:
427 if len(parents) == 2:
429 mc = ctx.manifest()
428 mc = ctx.manifest()
430 mp1 = ctx.parents()[0].manifest()
429 mp1 = ctx.parents()[0].manifest()
431 mp2 = ctx.parents()[1].manifest()
430 mp2 = ctx.parents()[1].manifest()
432 for f in mp1:
431 for f in mp1:
433 if f not in mc:
432 if f not in mc:
434 files.add(f)
433 files.add(f)
435 for f in mp2:
434 for f in mp2:
436 if f not in mc:
435 if f not in mc:
437 files.add(f)
436 files.add(f)
438 for f in mc:
437 for f in mc:
439 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f,
438 if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f,
440 None):
439 None):
441 files.add(f)
440 files.add(f)
442
441
443 toupload = toupload.union(
442 toupload = toupload.union(
444 set([ctx[f].data().strip()
443 set([ctx[f].data().strip()
445 for f in files
444 for f in files
446 if lfutil.isstandin(f) and f in ctx]))
445 if lfutil.isstandin(f) and f in ctx]))
447 lfcommands.uploadlfiles(ui, self, remote, toupload)
446 lfcommands.uploadlfiles(ui, self, remote, toupload)
448 return super(lfilesrepo, self).push(remote, force=force, revs=revs,
447 return super(lfilesrepo, self).push(remote, force=force, revs=revs,
449 newbranch=newbranch)
448 newbranch=newbranch)
450
449
451 def _subdirlfs(self, files, lfiles):
450 def _subdirlfs(self, files, lfiles):
452 '''
451 '''
453 Adjust matched file list
452 Adjust matched file list
454 If we pass a directory to commit whose only commitable files
453 If we pass a directory to commit whose only commitable files
455 are largefiles, the core commit code aborts before finding
454 are largefiles, the core commit code aborts before finding
456 the largefiles.
455 the largefiles.
457 So we do the following:
456 So we do the following:
458 For directories that only have largefiles as matches,
457 For directories that only have largefiles as matches,
459 we explicitly add the largefiles to the match list and remove
458 we explicitly add the largefiles to the match list and remove
460 the directory.
459 the directory.
461 In other cases, we leave the match list unmodified.
460 In other cases, we leave the match list unmodified.
462 '''
461 '''
463 actualfiles = []
462 actualfiles = []
464 dirs = []
463 dirs = []
465 regulars = []
464 regulars = []
466
465
467 for f in files:
466 for f in files:
468 if lfutil.isstandin(f + '/'):
467 if lfutil.isstandin(f + '/'):
469 raise util.Abort(
468 raise util.Abort(
470 _('file "%s" is a largefile standin') % f,
469 _('file "%s" is a largefile standin') % f,
471 hint=('commit the largefile itself instead'))
470 hint=('commit the largefile itself instead'))
472 # Scan directories
471 # Scan directories
473 if os.path.isdir(self.wjoin(f)):
472 if os.path.isdir(self.wjoin(f)):
474 dirs.append(f)
473 dirs.append(f)
475 else:
474 else:
476 regulars.append(f)
475 regulars.append(f)
477
476
478 for f in dirs:
477 for f in dirs:
479 matcheddir = False
478 matcheddir = False
480 d = self.dirstate.normalize(f) + '/'
479 d = self.dirstate.normalize(f) + '/'
481 # Check for matched normal files
480 # Check for matched normal files
482 for mf in regulars:
481 for mf in regulars:
483 if self.dirstate.normalize(mf).startswith(d):
482 if self.dirstate.normalize(mf).startswith(d):
484 actualfiles.append(f)
483 actualfiles.append(f)
485 matcheddir = True
484 matcheddir = True
486 break
485 break
487 if not matcheddir:
486 if not matcheddir:
488 # If no normal match, manually append
487 # If no normal match, manually append
489 # any matching largefiles
488 # any matching largefiles
490 for lf in lfiles:
489 for lf in lfiles:
491 if self.dirstate.normalize(lf).startswith(d):
490 if self.dirstate.normalize(lf).startswith(d):
492 actualfiles.append(lf)
491 actualfiles.append(lf)
493 if not matcheddir:
492 if not matcheddir:
494 actualfiles.append(lfutil.standin(f))
493 actualfiles.append(lfutil.standin(f))
495 matcheddir = True
494 matcheddir = True
496 # Nothing in dir, so readd it
495 # Nothing in dir, so readd it
497 # and let commit reject it
496 # and let commit reject it
498 if not matcheddir:
497 if not matcheddir:
499 actualfiles.append(f)
498 actualfiles.append(f)
500
499
501 # Always add normal files
500 # Always add normal files
502 actualfiles += regulars
501 actualfiles += regulars
503 return actualfiles
502 return actualfiles
504
503
505 repo.__class__ = lfilesrepo
504 repo.__class__ = lfilesrepo
506
505
507 def checkrequireslfiles(ui, repo, **kwargs):
506 def checkrequireslfiles(ui, repo, **kwargs):
508 if 'largefiles' not in repo.requirements and util.any(
507 if 'largefiles' not in repo.requirements and util.any(
509 lfutil.shortname+'/' in f[0] for f in repo.store.datafiles()):
508 lfutil.shortname+'/' in f[0] for f in repo.store.datafiles()):
510 repo.requirements.add('largefiles')
509 repo.requirements.add('largefiles')
511 repo._writerequirements()
510 repo._writerequirements()
512
511
513 ui.setconfig('hooks', 'changegroup.lfiles', checkrequireslfiles)
512 ui.setconfig('hooks', 'changegroup.lfiles', checkrequireslfiles)
514 ui.setconfig('hooks', 'commit.lfiles', checkrequireslfiles)
513 ui.setconfig('hooks', 'commit.lfiles', checkrequireslfiles)
@@ -1,633 +1,639 b''
1 # hg.py - repository classes for mercurial
1 # hg.py - repository classes for mercurial
2 #
2 #
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
3 # Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
4 # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
4 # Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
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 from i18n import _
9 from i18n import _
10 from lock import release
10 from lock import release
11 from node import hex, nullid
11 from node import hex, nullid
12 import localrepo, bundlerepo, unionrepo, httppeer, sshpeer, statichttprepo
12 import localrepo, bundlerepo, unionrepo, httppeer, sshpeer, statichttprepo
13 import bookmarks, lock, util, extensions, error, node, scmutil, phases, url
13 import bookmarks, lock, util, extensions, error, node, scmutil, phases, url
14 import cmdutil, discovery
14 import cmdutil, discovery
15 import merge as mergemod
15 import merge as mergemod
16 import verify as verifymod
16 import verify as verifymod
17 import errno, os, shutil
17 import errno, os, shutil
18
18
19 def _local(path):
19 def _local(path):
20 path = util.expandpath(util.urllocalpath(path))
20 path = util.expandpath(util.urllocalpath(path))
21 return (os.path.isfile(path) and bundlerepo or localrepo)
21 return (os.path.isfile(path) and bundlerepo or localrepo)
22
22
23 def addbranchrevs(lrepo, other, branches, revs):
23 def addbranchrevs(lrepo, other, branches, revs):
24 peer = other.peer() # a courtesy to callers using a localrepo for other
24 peer = other.peer() # a courtesy to callers using a localrepo for other
25 hashbranch, branches = branches
25 hashbranch, branches = branches
26 if not hashbranch and not branches:
26 if not hashbranch and not branches:
27 return revs or None, revs and revs[0] or None
27 return revs or None, revs and revs[0] or None
28 revs = revs and list(revs) or []
28 revs = revs and list(revs) or []
29 if not peer.capable('branchmap'):
29 if not peer.capable('branchmap'):
30 if branches:
30 if branches:
31 raise util.Abort(_("remote branch lookup not supported"))
31 raise util.Abort(_("remote branch lookup not supported"))
32 revs.append(hashbranch)
32 revs.append(hashbranch)
33 return revs, revs[0]
33 return revs, revs[0]
34 branchmap = peer.branchmap()
34 branchmap = peer.branchmap()
35
35
36 def primary(branch):
36 def primary(branch):
37 if branch == '.':
37 if branch == '.':
38 if not lrepo:
38 if not lrepo:
39 raise util.Abort(_("dirstate branch not accessible"))
39 raise util.Abort(_("dirstate branch not accessible"))
40 branch = lrepo.dirstate.branch()
40 branch = lrepo.dirstate.branch()
41 if branch in branchmap:
41 if branch in branchmap:
42 revs.extend(node.hex(r) for r in reversed(branchmap[branch]))
42 revs.extend(node.hex(r) for r in reversed(branchmap[branch]))
43 return True
43 return True
44 else:
44 else:
45 return False
45 return False
46
46
47 for branch in branches:
47 for branch in branches:
48 if not primary(branch):
48 if not primary(branch):
49 raise error.RepoLookupError(_("unknown branch '%s'") % branch)
49 raise error.RepoLookupError(_("unknown branch '%s'") % branch)
50 if hashbranch:
50 if hashbranch:
51 if not primary(hashbranch):
51 if not primary(hashbranch):
52 revs.append(hashbranch)
52 revs.append(hashbranch)
53 return revs, revs[0]
53 return revs, revs[0]
54
54
55 def parseurl(path, branches=None):
55 def parseurl(path, branches=None):
56 '''parse url#branch, returning (url, (branch, branches))'''
56 '''parse url#branch, returning (url, (branch, branches))'''
57
57
58 u = util.url(path)
58 u = util.url(path)
59 branch = None
59 branch = None
60 if u.fragment:
60 if u.fragment:
61 branch = u.fragment
61 branch = u.fragment
62 u.fragment = None
62 u.fragment = None
63 return str(u), (branch, branches or [])
63 return str(u), (branch, branches or [])
64
64
65 schemes = {
65 schemes = {
66 'bundle': bundlerepo,
66 'bundle': bundlerepo,
67 'union': unionrepo,
67 'union': unionrepo,
68 'file': _local,
68 'file': _local,
69 'http': httppeer,
69 'http': httppeer,
70 'https': httppeer,
70 'https': httppeer,
71 'ssh': sshpeer,
71 'ssh': sshpeer,
72 'static-http': statichttprepo,
72 'static-http': statichttprepo,
73 }
73 }
74
74
75 def _peerlookup(path):
75 def _peerlookup(path):
76 u = util.url(path)
76 u = util.url(path)
77 scheme = u.scheme or 'file'
77 scheme = u.scheme or 'file'
78 thing = schemes.get(scheme) or schemes['file']
78 thing = schemes.get(scheme) or schemes['file']
79 try:
79 try:
80 return thing(path)
80 return thing(path)
81 except TypeError:
81 except TypeError:
82 return thing
82 return thing
83
83
84 def islocal(repo):
84 def islocal(repo):
85 '''return true if repo (or path pointing to repo) is local'''
85 '''return true if repo (or path pointing to repo) is local'''
86 if isinstance(repo, str):
86 if isinstance(repo, str):
87 try:
87 try:
88 return _peerlookup(repo).islocal(repo)
88 return _peerlookup(repo).islocal(repo)
89 except AttributeError:
89 except AttributeError:
90 return False
90 return False
91 return repo.local()
91 return repo.local()
92
92
93 def openpath(ui, path):
93 def openpath(ui, path):
94 '''open path with open if local, url.open if remote'''
94 '''open path with open if local, url.open if remote'''
95 pathurl = util.url(path, parsequery=False, parsefragment=False)
95 pathurl = util.url(path, parsequery=False, parsefragment=False)
96 if pathurl.islocal():
96 if pathurl.islocal():
97 return util.posixfile(pathurl.localpath(), 'rb')
97 return util.posixfile(pathurl.localpath(), 'rb')
98 else:
98 else:
99 return url.open(ui, path)
99 return url.open(ui, path)
100
100
101 # a list of (ui, repo) functions called for wire peer initialization
102 wirepeersetupfuncs = []
103
101 def _peerorrepo(ui, path, create=False):
104 def _peerorrepo(ui, path, create=False):
102 """return a repository object for the specified path"""
105 """return a repository object for the specified path"""
103 obj = _peerlookup(path).instance(ui, path, create)
106 obj = _peerlookup(path).instance(ui, path, create)
104 ui = getattr(obj, "ui", ui)
107 ui = getattr(obj, "ui", ui)
105 for name, module in extensions.extensions(ui):
108 for name, module in extensions.extensions(ui):
106 hook = getattr(module, 'reposetup', None)
109 hook = getattr(module, 'reposetup', None)
107 if hook:
110 if hook:
108 hook(ui, obj)
111 hook(ui, obj)
112 if not obj.local():
113 for f in wirepeersetupfuncs:
114 f(ui, obj)
109 return obj
115 return obj
110
116
111 def repository(ui, path='', create=False):
117 def repository(ui, path='', create=False):
112 """return a repository object for the specified path"""
118 """return a repository object for the specified path"""
113 peer = _peerorrepo(ui, path, create)
119 peer = _peerorrepo(ui, path, create)
114 repo = peer.local()
120 repo = peer.local()
115 if not repo:
121 if not repo:
116 raise util.Abort(_("repository '%s' is not local") %
122 raise util.Abort(_("repository '%s' is not local") %
117 (path or peer.url()))
123 (path or peer.url()))
118 return repo.filtered('visible')
124 return repo.filtered('visible')
119
125
120 def peer(uiorrepo, opts, path, create=False):
126 def peer(uiorrepo, opts, path, create=False):
121 '''return a repository peer for the specified path'''
127 '''return a repository peer for the specified path'''
122 rui = remoteui(uiorrepo, opts)
128 rui = remoteui(uiorrepo, opts)
123 return _peerorrepo(rui, path, create).peer()
129 return _peerorrepo(rui, path, create).peer()
124
130
125 def defaultdest(source):
131 def defaultdest(source):
126 '''return default destination of clone if none is given'''
132 '''return default destination of clone if none is given'''
127 return os.path.basename(os.path.normpath(util.url(source).path or ''))
133 return os.path.basename(os.path.normpath(util.url(source).path or ''))
128
134
129 def share(ui, source, dest=None, update=True):
135 def share(ui, source, dest=None, update=True):
130 '''create a shared repository'''
136 '''create a shared repository'''
131
137
132 if not islocal(source):
138 if not islocal(source):
133 raise util.Abort(_('can only share local repositories'))
139 raise util.Abort(_('can only share local repositories'))
134
140
135 if not dest:
141 if not dest:
136 dest = defaultdest(source)
142 dest = defaultdest(source)
137 else:
143 else:
138 dest = ui.expandpath(dest)
144 dest = ui.expandpath(dest)
139
145
140 if isinstance(source, str):
146 if isinstance(source, str):
141 origsource = ui.expandpath(source)
147 origsource = ui.expandpath(source)
142 source, branches = parseurl(origsource)
148 source, branches = parseurl(origsource)
143 srcrepo = repository(ui, source)
149 srcrepo = repository(ui, source)
144 rev, checkout = addbranchrevs(srcrepo, srcrepo, branches, None)
150 rev, checkout = addbranchrevs(srcrepo, srcrepo, branches, None)
145 else:
151 else:
146 srcrepo = source.local()
152 srcrepo = source.local()
147 origsource = source = srcrepo.url()
153 origsource = source = srcrepo.url()
148 checkout = None
154 checkout = None
149
155
150 sharedpath = srcrepo.sharedpath # if our source is already sharing
156 sharedpath = srcrepo.sharedpath # if our source is already sharing
151
157
152 root = os.path.realpath(dest)
158 root = os.path.realpath(dest)
153 roothg = os.path.join(root, '.hg')
159 roothg = os.path.join(root, '.hg')
154
160
155 if os.path.exists(roothg):
161 if os.path.exists(roothg):
156 raise util.Abort(_('destination already exists'))
162 raise util.Abort(_('destination already exists'))
157
163
158 if not os.path.isdir(root):
164 if not os.path.isdir(root):
159 os.mkdir(root)
165 os.mkdir(root)
160 util.makedir(roothg, notindexed=True)
166 util.makedir(roothg, notindexed=True)
161
167
162 requirements = ''
168 requirements = ''
163 try:
169 try:
164 requirements = srcrepo.opener.read('requires')
170 requirements = srcrepo.opener.read('requires')
165 except IOError, inst:
171 except IOError, inst:
166 if inst.errno != errno.ENOENT:
172 if inst.errno != errno.ENOENT:
167 raise
173 raise
168
174
169 requirements += 'shared\n'
175 requirements += 'shared\n'
170 util.writefile(os.path.join(roothg, 'requires'), requirements)
176 util.writefile(os.path.join(roothg, 'requires'), requirements)
171 util.writefile(os.path.join(roothg, 'sharedpath'), sharedpath)
177 util.writefile(os.path.join(roothg, 'sharedpath'), sharedpath)
172
178
173 r = repository(ui, root)
179 r = repository(ui, root)
174
180
175 default = srcrepo.ui.config('paths', 'default')
181 default = srcrepo.ui.config('paths', 'default')
176 if default:
182 if default:
177 fp = r.opener("hgrc", "w", text=True)
183 fp = r.opener("hgrc", "w", text=True)
178 fp.write("[paths]\n")
184 fp.write("[paths]\n")
179 fp.write("default = %s\n" % default)
185 fp.write("default = %s\n" % default)
180 fp.close()
186 fp.close()
181
187
182 if update:
188 if update:
183 r.ui.status(_("updating working directory\n"))
189 r.ui.status(_("updating working directory\n"))
184 if update is not True:
190 if update is not True:
185 checkout = update
191 checkout = update
186 for test in (checkout, 'default', 'tip'):
192 for test in (checkout, 'default', 'tip'):
187 if test is None:
193 if test is None:
188 continue
194 continue
189 try:
195 try:
190 uprev = r.lookup(test)
196 uprev = r.lookup(test)
191 break
197 break
192 except error.RepoLookupError:
198 except error.RepoLookupError:
193 continue
199 continue
194 _update(r, uprev)
200 _update(r, uprev)
195
201
196 def copystore(ui, srcrepo, destpath):
202 def copystore(ui, srcrepo, destpath):
197 '''copy files from store of srcrepo in destpath
203 '''copy files from store of srcrepo in destpath
198
204
199 returns destlock
205 returns destlock
200 '''
206 '''
201 destlock = None
207 destlock = None
202 try:
208 try:
203 hardlink = None
209 hardlink = None
204 num = 0
210 num = 0
205 srcpublishing = srcrepo.ui.configbool('phases', 'publish', True)
211 srcpublishing = srcrepo.ui.configbool('phases', 'publish', True)
206 srcvfs = scmutil.vfs(srcrepo.sharedpath)
212 srcvfs = scmutil.vfs(srcrepo.sharedpath)
207 dstvfs = scmutil.vfs(destpath)
213 dstvfs = scmutil.vfs(destpath)
208 for f in srcrepo.store.copylist():
214 for f in srcrepo.store.copylist():
209 if srcpublishing and f.endswith('phaseroots'):
215 if srcpublishing and f.endswith('phaseroots'):
210 continue
216 continue
211 dstbase = os.path.dirname(f)
217 dstbase = os.path.dirname(f)
212 if dstbase and not dstvfs.exists(dstbase):
218 if dstbase and not dstvfs.exists(dstbase):
213 dstvfs.mkdir(dstbase)
219 dstvfs.mkdir(dstbase)
214 if srcvfs.exists(f):
220 if srcvfs.exists(f):
215 if f.endswith('data'):
221 if f.endswith('data'):
216 # 'dstbase' may be empty (e.g. revlog format 0)
222 # 'dstbase' may be empty (e.g. revlog format 0)
217 lockfile = os.path.join(dstbase, "lock")
223 lockfile = os.path.join(dstbase, "lock")
218 # lock to avoid premature writing to the target
224 # lock to avoid premature writing to the target
219 destlock = lock.lock(dstvfs, lockfile)
225 destlock = lock.lock(dstvfs, lockfile)
220 hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f),
226 hardlink, n = util.copyfiles(srcvfs.join(f), dstvfs.join(f),
221 hardlink)
227 hardlink)
222 num += n
228 num += n
223 if hardlink:
229 if hardlink:
224 ui.debug("linked %d files\n" % num)
230 ui.debug("linked %d files\n" % num)
225 else:
231 else:
226 ui.debug("copied %d files\n" % num)
232 ui.debug("copied %d files\n" % num)
227 return destlock
233 return destlock
228 except: # re-raises
234 except: # re-raises
229 release(destlock)
235 release(destlock)
230 raise
236 raise
231
237
232 def clone(ui, peeropts, source, dest=None, pull=False, rev=None,
238 def clone(ui, peeropts, source, dest=None, pull=False, rev=None,
233 update=True, stream=False, branch=None):
239 update=True, stream=False, branch=None):
234 """Make a copy of an existing repository.
240 """Make a copy of an existing repository.
235
241
236 Create a copy of an existing repository in a new directory. The
242 Create a copy of an existing repository in a new directory. The
237 source and destination are URLs, as passed to the repository
243 source and destination are URLs, as passed to the repository
238 function. Returns a pair of repository peers, the source and
244 function. Returns a pair of repository peers, the source and
239 newly created destination.
245 newly created destination.
240
246
241 The location of the source is added to the new repository's
247 The location of the source is added to the new repository's
242 .hg/hgrc file, as the default to be used for future pulls and
248 .hg/hgrc file, as the default to be used for future pulls and
243 pushes.
249 pushes.
244
250
245 If an exception is raised, the partly cloned/updated destination
251 If an exception is raised, the partly cloned/updated destination
246 repository will be deleted.
252 repository will be deleted.
247
253
248 Arguments:
254 Arguments:
249
255
250 source: repository object or URL
256 source: repository object or URL
251
257
252 dest: URL of destination repository to create (defaults to base
258 dest: URL of destination repository to create (defaults to base
253 name of source repository)
259 name of source repository)
254
260
255 pull: always pull from source repository, even in local case
261 pull: always pull from source repository, even in local case
256
262
257 stream: stream raw data uncompressed from repository (fast over
263 stream: stream raw data uncompressed from repository (fast over
258 LAN, slow over WAN)
264 LAN, slow over WAN)
259
265
260 rev: revision to clone up to (implies pull=True)
266 rev: revision to clone up to (implies pull=True)
261
267
262 update: update working directory after clone completes, if
268 update: update working directory after clone completes, if
263 destination is local repository (True means update to default rev,
269 destination is local repository (True means update to default rev,
264 anything else is treated as a revision)
270 anything else is treated as a revision)
265
271
266 branch: branches to clone
272 branch: branches to clone
267 """
273 """
268
274
269 if isinstance(source, str):
275 if isinstance(source, str):
270 origsource = ui.expandpath(source)
276 origsource = ui.expandpath(source)
271 source, branch = parseurl(origsource, branch)
277 source, branch = parseurl(origsource, branch)
272 srcpeer = peer(ui, peeropts, source)
278 srcpeer = peer(ui, peeropts, source)
273 else:
279 else:
274 srcpeer = source.peer() # in case we were called with a localrepo
280 srcpeer = source.peer() # in case we were called with a localrepo
275 branch = (None, branch or [])
281 branch = (None, branch or [])
276 origsource = source = srcpeer.url()
282 origsource = source = srcpeer.url()
277 rev, checkout = addbranchrevs(srcpeer, srcpeer, branch, rev)
283 rev, checkout = addbranchrevs(srcpeer, srcpeer, branch, rev)
278
284
279 if dest is None:
285 if dest is None:
280 dest = defaultdest(source)
286 dest = defaultdest(source)
281 ui.status(_("destination directory: %s\n") % dest)
287 ui.status(_("destination directory: %s\n") % dest)
282 else:
288 else:
283 dest = ui.expandpath(dest)
289 dest = ui.expandpath(dest)
284
290
285 dest = util.urllocalpath(dest)
291 dest = util.urllocalpath(dest)
286 source = util.urllocalpath(source)
292 source = util.urllocalpath(source)
287
293
288 if not dest:
294 if not dest:
289 raise util.Abort(_("empty destination path is not valid"))
295 raise util.Abort(_("empty destination path is not valid"))
290 if os.path.exists(dest):
296 if os.path.exists(dest):
291 if not os.path.isdir(dest):
297 if not os.path.isdir(dest):
292 raise util.Abort(_("destination '%s' already exists") % dest)
298 raise util.Abort(_("destination '%s' already exists") % dest)
293 elif os.listdir(dest):
299 elif os.listdir(dest):
294 raise util.Abort(_("destination '%s' is not empty") % dest)
300 raise util.Abort(_("destination '%s' is not empty") % dest)
295
301
296 srclock = destlock = cleandir = None
302 srclock = destlock = cleandir = None
297 srcrepo = srcpeer.local()
303 srcrepo = srcpeer.local()
298 try:
304 try:
299 abspath = origsource
305 abspath = origsource
300 if islocal(origsource):
306 if islocal(origsource):
301 abspath = os.path.abspath(util.urllocalpath(origsource))
307 abspath = os.path.abspath(util.urllocalpath(origsource))
302
308
303 if islocal(dest):
309 if islocal(dest):
304 cleandir = dest
310 cleandir = dest
305
311
306 copy = False
312 copy = False
307 if (srcrepo and srcrepo.cancopy() and islocal(dest)
313 if (srcrepo and srcrepo.cancopy() and islocal(dest)
308 and not phases.hassecret(srcrepo)):
314 and not phases.hassecret(srcrepo)):
309 copy = not pull and not rev
315 copy = not pull and not rev
310
316
311 if copy:
317 if copy:
312 try:
318 try:
313 # we use a lock here because if we race with commit, we
319 # we use a lock here because if we race with commit, we
314 # can end up with extra data in the cloned revlogs that's
320 # can end up with extra data in the cloned revlogs that's
315 # not pointed to by changesets, thus causing verify to
321 # not pointed to by changesets, thus causing verify to
316 # fail
322 # fail
317 srclock = srcrepo.lock(wait=False)
323 srclock = srcrepo.lock(wait=False)
318 except error.LockError:
324 except error.LockError:
319 copy = False
325 copy = False
320
326
321 if copy:
327 if copy:
322 srcrepo.hook('preoutgoing', throw=True, source='clone')
328 srcrepo.hook('preoutgoing', throw=True, source='clone')
323 hgdir = os.path.realpath(os.path.join(dest, ".hg"))
329 hgdir = os.path.realpath(os.path.join(dest, ".hg"))
324 if not os.path.exists(dest):
330 if not os.path.exists(dest):
325 os.mkdir(dest)
331 os.mkdir(dest)
326 else:
332 else:
327 # only clean up directories we create ourselves
333 # only clean up directories we create ourselves
328 cleandir = hgdir
334 cleandir = hgdir
329 try:
335 try:
330 destpath = hgdir
336 destpath = hgdir
331 util.makedir(destpath, notindexed=True)
337 util.makedir(destpath, notindexed=True)
332 except OSError, inst:
338 except OSError, inst:
333 if inst.errno == errno.EEXIST:
339 if inst.errno == errno.EEXIST:
334 cleandir = None
340 cleandir = None
335 raise util.Abort(_("destination '%s' already exists")
341 raise util.Abort(_("destination '%s' already exists")
336 % dest)
342 % dest)
337 raise
343 raise
338
344
339 destlock = copystore(ui, srcrepo, destpath)
345 destlock = copystore(ui, srcrepo, destpath)
340
346
341 # Recomputing branch cache might be slow on big repos,
347 # Recomputing branch cache might be slow on big repos,
342 # so just copy it
348 # so just copy it
343 dstcachedir = os.path.join(destpath, 'cache')
349 dstcachedir = os.path.join(destpath, 'cache')
344 srcbranchcache = srcrepo.sjoin('cache/branch2')
350 srcbranchcache = srcrepo.sjoin('cache/branch2')
345 dstbranchcache = os.path.join(dstcachedir, 'branch2')
351 dstbranchcache = os.path.join(dstcachedir, 'branch2')
346 if os.path.exists(srcbranchcache):
352 if os.path.exists(srcbranchcache):
347 if not os.path.exists(dstcachedir):
353 if not os.path.exists(dstcachedir):
348 os.mkdir(dstcachedir)
354 os.mkdir(dstcachedir)
349 util.copyfile(srcbranchcache, dstbranchcache)
355 util.copyfile(srcbranchcache, dstbranchcache)
350
356
351 # we need to re-init the repo after manually copying the data
357 # we need to re-init the repo after manually copying the data
352 # into it
358 # into it
353 destpeer = peer(srcrepo, peeropts, dest)
359 destpeer = peer(srcrepo, peeropts, dest)
354 srcrepo.hook('outgoing', source='clone',
360 srcrepo.hook('outgoing', source='clone',
355 node=node.hex(node.nullid))
361 node=node.hex(node.nullid))
356 else:
362 else:
357 try:
363 try:
358 destpeer = peer(srcrepo or ui, peeropts, dest, create=True)
364 destpeer = peer(srcrepo or ui, peeropts, dest, create=True)
359 # only pass ui when no srcrepo
365 # only pass ui when no srcrepo
360 except OSError, inst:
366 except OSError, inst:
361 if inst.errno == errno.EEXIST:
367 if inst.errno == errno.EEXIST:
362 cleandir = None
368 cleandir = None
363 raise util.Abort(_("destination '%s' already exists")
369 raise util.Abort(_("destination '%s' already exists")
364 % dest)
370 % dest)
365 raise
371 raise
366
372
367 revs = None
373 revs = None
368 if rev:
374 if rev:
369 if not srcpeer.capable('lookup'):
375 if not srcpeer.capable('lookup'):
370 raise util.Abort(_("src repository does not support "
376 raise util.Abort(_("src repository does not support "
371 "revision lookup and so doesn't "
377 "revision lookup and so doesn't "
372 "support clone by revision"))
378 "support clone by revision"))
373 revs = [srcpeer.lookup(r) for r in rev]
379 revs = [srcpeer.lookup(r) for r in rev]
374 checkout = revs[0]
380 checkout = revs[0]
375 if destpeer.local():
381 if destpeer.local():
376 destpeer.local().clone(srcpeer, heads=revs, stream=stream)
382 destpeer.local().clone(srcpeer, heads=revs, stream=stream)
377 elif srcrepo:
383 elif srcrepo:
378 srcrepo.push(destpeer, revs=revs)
384 srcrepo.push(destpeer, revs=revs)
379 else:
385 else:
380 raise util.Abort(_("clone from remote to remote not supported"))
386 raise util.Abort(_("clone from remote to remote not supported"))
381
387
382 cleandir = None
388 cleandir = None
383
389
384 # clone all bookmarks except divergent ones
390 # clone all bookmarks except divergent ones
385 destrepo = destpeer.local()
391 destrepo = destpeer.local()
386 if destrepo and srcpeer.capable("pushkey"):
392 if destrepo and srcpeer.capable("pushkey"):
387 rb = srcpeer.listkeys('bookmarks')
393 rb = srcpeer.listkeys('bookmarks')
388 marks = destrepo._bookmarks
394 marks = destrepo._bookmarks
389 for k, n in rb.iteritems():
395 for k, n in rb.iteritems():
390 try:
396 try:
391 m = destrepo.lookup(n)
397 m = destrepo.lookup(n)
392 marks[k] = m
398 marks[k] = m
393 except error.RepoLookupError:
399 except error.RepoLookupError:
394 pass
400 pass
395 if rb:
401 if rb:
396 marks.write()
402 marks.write()
397 elif srcrepo and destpeer.capable("pushkey"):
403 elif srcrepo and destpeer.capable("pushkey"):
398 for k, n in srcrepo._bookmarks.iteritems():
404 for k, n in srcrepo._bookmarks.iteritems():
399 destpeer.pushkey('bookmarks', k, '', hex(n))
405 destpeer.pushkey('bookmarks', k, '', hex(n))
400
406
401 if destrepo:
407 if destrepo:
402 fp = destrepo.opener("hgrc", "w", text=True)
408 fp = destrepo.opener("hgrc", "w", text=True)
403 fp.write("[paths]\n")
409 fp.write("[paths]\n")
404 u = util.url(abspath)
410 u = util.url(abspath)
405 u.passwd = None
411 u.passwd = None
406 defaulturl = str(u)
412 defaulturl = str(u)
407 fp.write("default = %s\n" % defaulturl)
413 fp.write("default = %s\n" % defaulturl)
408 fp.close()
414 fp.close()
409
415
410 destrepo.ui.setconfig('paths', 'default', defaulturl)
416 destrepo.ui.setconfig('paths', 'default', defaulturl)
411
417
412 if update:
418 if update:
413 if update is not True:
419 if update is not True:
414 checkout = srcpeer.lookup(update)
420 checkout = srcpeer.lookup(update)
415 uprev = None
421 uprev = None
416 status = None
422 status = None
417 if checkout is not None:
423 if checkout is not None:
418 try:
424 try:
419 uprev = destrepo.lookup(checkout)
425 uprev = destrepo.lookup(checkout)
420 except error.RepoLookupError:
426 except error.RepoLookupError:
421 pass
427 pass
422 if uprev is None:
428 if uprev is None:
423 try:
429 try:
424 uprev = destrepo._bookmarks['@']
430 uprev = destrepo._bookmarks['@']
425 update = '@'
431 update = '@'
426 bn = destrepo[uprev].branch()
432 bn = destrepo[uprev].branch()
427 if bn == 'default':
433 if bn == 'default':
428 status = _("updating to bookmark @\n")
434 status = _("updating to bookmark @\n")
429 else:
435 else:
430 status = _("updating to bookmark @ on branch %s\n"
436 status = _("updating to bookmark @ on branch %s\n"
431 % bn)
437 % bn)
432 except KeyError:
438 except KeyError:
433 try:
439 try:
434 uprev = destrepo.branchtip('default')
440 uprev = destrepo.branchtip('default')
435 except error.RepoLookupError:
441 except error.RepoLookupError:
436 uprev = destrepo.lookup('tip')
442 uprev = destrepo.lookup('tip')
437 if not status:
443 if not status:
438 bn = destrepo[uprev].branch()
444 bn = destrepo[uprev].branch()
439 status = _("updating to branch %s\n") % bn
445 status = _("updating to branch %s\n") % bn
440 destrepo.ui.status(status)
446 destrepo.ui.status(status)
441 _update(destrepo, uprev)
447 _update(destrepo, uprev)
442 if update in destrepo._bookmarks:
448 if update in destrepo._bookmarks:
443 bookmarks.setcurrent(destrepo, update)
449 bookmarks.setcurrent(destrepo, update)
444 finally:
450 finally:
445 release(srclock, destlock)
451 release(srclock, destlock)
446 if cleandir is not None:
452 if cleandir is not None:
447 shutil.rmtree(cleandir, True)
453 shutil.rmtree(cleandir, True)
448 if srcpeer is not None:
454 if srcpeer is not None:
449 srcpeer.close()
455 srcpeer.close()
450 return srcpeer, destpeer
456 return srcpeer, destpeer
451
457
452 def _showstats(repo, stats):
458 def _showstats(repo, stats):
453 repo.ui.status(_("%d files updated, %d files merged, "
459 repo.ui.status(_("%d files updated, %d files merged, "
454 "%d files removed, %d files unresolved\n") % stats)
460 "%d files removed, %d files unresolved\n") % stats)
455
461
456 def updaterepo(repo, node, overwrite):
462 def updaterepo(repo, node, overwrite):
457 """Update the working directory to node.
463 """Update the working directory to node.
458
464
459 When overwrite is set, changes are clobbered, merged else
465 When overwrite is set, changes are clobbered, merged else
460
466
461 returns stats (see pydoc mercurial.merge.applyupdates)"""
467 returns stats (see pydoc mercurial.merge.applyupdates)"""
462 return mergemod.update(repo, node, False, overwrite, None)
468 return mergemod.update(repo, node, False, overwrite, None)
463
469
464 def update(repo, node):
470 def update(repo, node):
465 """update the working directory to node, merging linear changes"""
471 """update the working directory to node, merging linear changes"""
466 stats = updaterepo(repo, node, False)
472 stats = updaterepo(repo, node, False)
467 _showstats(repo, stats)
473 _showstats(repo, stats)
468 if stats[3]:
474 if stats[3]:
469 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
475 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges\n"))
470 return stats[3] > 0
476 return stats[3] > 0
471
477
472 # naming conflict in clone()
478 # naming conflict in clone()
473 _update = update
479 _update = update
474
480
475 def clean(repo, node, show_stats=True):
481 def clean(repo, node, show_stats=True):
476 """forcibly switch the working directory to node, clobbering changes"""
482 """forcibly switch the working directory to node, clobbering changes"""
477 stats = updaterepo(repo, node, True)
483 stats = updaterepo(repo, node, True)
478 util.unlinkpath(repo.join('graftstate'), ignoremissing=True)
484 util.unlinkpath(repo.join('graftstate'), ignoremissing=True)
479 if show_stats:
485 if show_stats:
480 _showstats(repo, stats)
486 _showstats(repo, stats)
481 return stats[3] > 0
487 return stats[3] > 0
482
488
483 def merge(repo, node, force=None, remind=True):
489 def merge(repo, node, force=None, remind=True):
484 """Branch merge with node, resolving changes. Return true if any
490 """Branch merge with node, resolving changes. Return true if any
485 unresolved conflicts."""
491 unresolved conflicts."""
486 stats = mergemod.update(repo, node, True, force, False)
492 stats = mergemod.update(repo, node, True, force, False)
487 _showstats(repo, stats)
493 _showstats(repo, stats)
488 if stats[3]:
494 if stats[3]:
489 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges "
495 repo.ui.status(_("use 'hg resolve' to retry unresolved file merges "
490 "or 'hg update -C .' to abandon\n"))
496 "or 'hg update -C .' to abandon\n"))
491 elif remind:
497 elif remind:
492 repo.ui.status(_("(branch merge, don't forget to commit)\n"))
498 repo.ui.status(_("(branch merge, don't forget to commit)\n"))
493 return stats[3] > 0
499 return stats[3] > 0
494
500
495 def _incoming(displaychlist, subreporecurse, ui, repo, source,
501 def _incoming(displaychlist, subreporecurse, ui, repo, source,
496 opts, buffered=False):
502 opts, buffered=False):
497 """
503 """
498 Helper for incoming / gincoming.
504 Helper for incoming / gincoming.
499 displaychlist gets called with
505 displaychlist gets called with
500 (remoterepo, incomingchangesetlist, displayer) parameters,
506 (remoterepo, incomingchangesetlist, displayer) parameters,
501 and is supposed to contain only code that can't be unified.
507 and is supposed to contain only code that can't be unified.
502 """
508 """
503 source, branches = parseurl(ui.expandpath(source), opts.get('branch'))
509 source, branches = parseurl(ui.expandpath(source), opts.get('branch'))
504 other = peer(repo, opts, source)
510 other = peer(repo, opts, source)
505 ui.status(_('comparing with %s\n') % util.hidepassword(source))
511 ui.status(_('comparing with %s\n') % util.hidepassword(source))
506 revs, checkout = addbranchrevs(repo, other, branches, opts.get('rev'))
512 revs, checkout = addbranchrevs(repo, other, branches, opts.get('rev'))
507
513
508 if revs:
514 if revs:
509 revs = [other.lookup(rev) for rev in revs]
515 revs = [other.lookup(rev) for rev in revs]
510 other, chlist, cleanupfn = bundlerepo.getremotechanges(ui, repo, other,
516 other, chlist, cleanupfn = bundlerepo.getremotechanges(ui, repo, other,
511 revs, opts["bundle"], opts["force"])
517 revs, opts["bundle"], opts["force"])
512 try:
518 try:
513 if not chlist:
519 if not chlist:
514 ui.status(_("no changes found\n"))
520 ui.status(_("no changes found\n"))
515 return subreporecurse()
521 return subreporecurse()
516
522
517 displayer = cmdutil.show_changeset(ui, other, opts, buffered)
523 displayer = cmdutil.show_changeset(ui, other, opts, buffered)
518 displaychlist(other, chlist, displayer)
524 displaychlist(other, chlist, displayer)
519 displayer.close()
525 displayer.close()
520 finally:
526 finally:
521 cleanupfn()
527 cleanupfn()
522 subreporecurse()
528 subreporecurse()
523 return 0 # exit code is zero since we found incoming changes
529 return 0 # exit code is zero since we found incoming changes
524
530
525 def incoming(ui, repo, source, opts):
531 def incoming(ui, repo, source, opts):
526 def subreporecurse():
532 def subreporecurse():
527 ret = 1
533 ret = 1
528 if opts.get('subrepos'):
534 if opts.get('subrepos'):
529 ctx = repo[None]
535 ctx = repo[None]
530 for subpath in sorted(ctx.substate):
536 for subpath in sorted(ctx.substate):
531 sub = ctx.sub(subpath)
537 sub = ctx.sub(subpath)
532 ret = min(ret, sub.incoming(ui, source, opts))
538 ret = min(ret, sub.incoming(ui, source, opts))
533 return ret
539 return ret
534
540
535 def display(other, chlist, displayer):
541 def display(other, chlist, displayer):
536 limit = cmdutil.loglimit(opts)
542 limit = cmdutil.loglimit(opts)
537 if opts.get('newest_first'):
543 if opts.get('newest_first'):
538 chlist.reverse()
544 chlist.reverse()
539 count = 0
545 count = 0
540 for n in chlist:
546 for n in chlist:
541 if limit is not None and count >= limit:
547 if limit is not None and count >= limit:
542 break
548 break
543 parents = [p for p in other.changelog.parents(n) if p != nullid]
549 parents = [p for p in other.changelog.parents(n) if p != nullid]
544 if opts.get('no_merges') and len(parents) == 2:
550 if opts.get('no_merges') and len(parents) == 2:
545 continue
551 continue
546 count += 1
552 count += 1
547 displayer.show(other[n])
553 displayer.show(other[n])
548 return _incoming(display, subreporecurse, ui, repo, source, opts)
554 return _incoming(display, subreporecurse, ui, repo, source, opts)
549
555
550 def _outgoing(ui, repo, dest, opts):
556 def _outgoing(ui, repo, dest, opts):
551 dest = ui.expandpath(dest or 'default-push', dest or 'default')
557 dest = ui.expandpath(dest or 'default-push', dest or 'default')
552 dest, branches = parseurl(dest, opts.get('branch'))
558 dest, branches = parseurl(dest, opts.get('branch'))
553 ui.status(_('comparing with %s\n') % util.hidepassword(dest))
559 ui.status(_('comparing with %s\n') % util.hidepassword(dest))
554 revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
560 revs, checkout = addbranchrevs(repo, repo, branches, opts.get('rev'))
555 if revs:
561 if revs:
556 revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
562 revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)]
557
563
558 other = peer(repo, opts, dest)
564 other = peer(repo, opts, dest)
559 outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other, revs,
565 outgoing = discovery.findcommonoutgoing(repo.unfiltered(), other, revs,
560 force=opts.get('force'))
566 force=opts.get('force'))
561 o = outgoing.missing
567 o = outgoing.missing
562 if not o:
568 if not o:
563 scmutil.nochangesfound(repo.ui, repo, outgoing.excluded)
569 scmutil.nochangesfound(repo.ui, repo, outgoing.excluded)
564 return None
570 return None
565 return o
571 return o
566
572
567 def outgoing(ui, repo, dest, opts):
573 def outgoing(ui, repo, dest, opts):
568 def recurse():
574 def recurse():
569 ret = 1
575 ret = 1
570 if opts.get('subrepos'):
576 if opts.get('subrepos'):
571 ctx = repo[None]
577 ctx = repo[None]
572 for subpath in sorted(ctx.substate):
578 for subpath in sorted(ctx.substate):
573 sub = ctx.sub(subpath)
579 sub = ctx.sub(subpath)
574 ret = min(ret, sub.outgoing(ui, dest, opts))
580 ret = min(ret, sub.outgoing(ui, dest, opts))
575 return ret
581 return ret
576
582
577 limit = cmdutil.loglimit(opts)
583 limit = cmdutil.loglimit(opts)
578 o = _outgoing(ui, repo, dest, opts)
584 o = _outgoing(ui, repo, dest, opts)
579 if o is None:
585 if o is None:
580 return recurse()
586 return recurse()
581
587
582 if opts.get('newest_first'):
588 if opts.get('newest_first'):
583 o.reverse()
589 o.reverse()
584 displayer = cmdutil.show_changeset(ui, repo, opts)
590 displayer = cmdutil.show_changeset(ui, repo, opts)
585 count = 0
591 count = 0
586 for n in o:
592 for n in o:
587 if limit is not None and count >= limit:
593 if limit is not None and count >= limit:
588 break
594 break
589 parents = [p for p in repo.changelog.parents(n) if p != nullid]
595 parents = [p for p in repo.changelog.parents(n) if p != nullid]
590 if opts.get('no_merges') and len(parents) == 2:
596 if opts.get('no_merges') and len(parents) == 2:
591 continue
597 continue
592 count += 1
598 count += 1
593 displayer.show(repo[n])
599 displayer.show(repo[n])
594 displayer.close()
600 displayer.close()
595 recurse()
601 recurse()
596 return 0 # exit code is zero since we found outgoing changes
602 return 0 # exit code is zero since we found outgoing changes
597
603
598 def revert(repo, node, choose):
604 def revert(repo, node, choose):
599 """revert changes to revision in node without updating dirstate"""
605 """revert changes to revision in node without updating dirstate"""
600 return mergemod.update(repo, node, False, True, choose)[3] > 0
606 return mergemod.update(repo, node, False, True, choose)[3] > 0
601
607
602 def verify(repo):
608 def verify(repo):
603 """verify the consistency of a repository"""
609 """verify the consistency of a repository"""
604 return verifymod.verify(repo)
610 return verifymod.verify(repo)
605
611
606 def remoteui(src, opts):
612 def remoteui(src, opts):
607 'build a remote ui from ui or repo and opts'
613 'build a remote ui from ui or repo and opts'
608 if util.safehasattr(src, 'baseui'): # looks like a repository
614 if util.safehasattr(src, 'baseui'): # looks like a repository
609 dst = src.baseui.copy() # drop repo-specific config
615 dst = src.baseui.copy() # drop repo-specific config
610 src = src.ui # copy target options from repo
616 src = src.ui # copy target options from repo
611 else: # assume it's a global ui object
617 else: # assume it's a global ui object
612 dst = src.copy() # keep all global options
618 dst = src.copy() # keep all global options
613
619
614 # copy ssh-specific options
620 # copy ssh-specific options
615 for o in 'ssh', 'remotecmd':
621 for o in 'ssh', 'remotecmd':
616 v = opts.get(o) or src.config('ui', o)
622 v = opts.get(o) or src.config('ui', o)
617 if v:
623 if v:
618 dst.setconfig("ui", o, v)
624 dst.setconfig("ui", o, v)
619
625
620 # copy bundle-specific options
626 # copy bundle-specific options
621 r = src.config('bundle', 'mainreporoot')
627 r = src.config('bundle', 'mainreporoot')
622 if r:
628 if r:
623 dst.setconfig('bundle', 'mainreporoot', r)
629 dst.setconfig('bundle', 'mainreporoot', r)
624
630
625 # copy selected local settings to the remote ui
631 # copy selected local settings to the remote ui
626 for sect in ('auth', 'hostfingerprints', 'http_proxy'):
632 for sect in ('auth', 'hostfingerprints', 'http_proxy'):
627 for key, val in src.configitems(sect):
633 for key, val in src.configitems(sect):
628 dst.setconfig(sect, key, val)
634 dst.setconfig(sect, key, val)
629 v = src.config('web', 'cacerts')
635 v = src.config('web', 'cacerts')
630 if v:
636 if v:
631 dst.setconfig('web', 'cacerts', util.expandpath(v))
637 dst.setconfig('web', 'cacerts', util.expandpath(v))
632
638
633 return dst
639 return dst
@@ -1,2288 +1,2314 b''
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
1 $ USERCACHE="$TESTTMP/cache"; export USERCACHE
2 $ mkdir "${USERCACHE}"
2 $ mkdir "${USERCACHE}"
3 $ cat >> $HGRCPATH <<EOF
3 $ cat >> $HGRCPATH <<EOF
4 > [extensions]
4 > [extensions]
5 > largefiles=
5 > largefiles=
6 > purge=
6 > purge=
7 > rebase=
7 > rebase=
8 > transplant=
8 > transplant=
9 > [phases]
9 > [phases]
10 > publish=False
10 > publish=False
11 > [largefiles]
11 > [largefiles]
12 > minsize=2
12 > minsize=2
13 > patterns=glob:**.dat
13 > patterns=glob:**.dat
14 > usercache=${USERCACHE}
14 > usercache=${USERCACHE}
15 > [hooks]
15 > [hooks]
16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
16 > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status"
17 > EOF
17 > EOF
18
18
19 Create the repo with a couple of revisions of both large and normal
19 Create the repo with a couple of revisions of both large and normal
20 files.
20 files.
21 Test status and dirstate of largefiles and that summary output is correct.
21 Test status and dirstate of largefiles and that summary output is correct.
22
22
23 $ hg init a
23 $ hg init a
24 $ cd a
24 $ cd a
25 $ mkdir sub
25 $ mkdir sub
26 $ echo normal1 > normal1
26 $ echo normal1 > normal1
27 $ echo normal2 > sub/normal2
27 $ echo normal2 > sub/normal2
28 $ echo large1 > large1
28 $ echo large1 > large1
29 $ echo large2 > sub/large2
29 $ echo large2 > sub/large2
30 $ hg add normal1 sub/normal2
30 $ hg add normal1 sub/normal2
31 $ hg add --large large1 sub/large2
31 $ hg add --large large1 sub/large2
32 $ hg commit -m "add files"
32 $ hg commit -m "add files"
33 Invoking status precommit hook
33 Invoking status precommit hook
34 A large1
34 A large1
35 A normal1
35 A normal1
36 A sub/large2
36 A sub/large2
37 A sub/normal2
37 A sub/normal2
38 $ touch large1 sub/large2
38 $ touch large1 sub/large2
39 $ sleep 1
39 $ sleep 1
40 $ hg st
40 $ hg st
41 $ hg debugstate --nodates
41 $ hg debugstate --nodates
42 n 644 41 .hglf/large1
42 n 644 41 .hglf/large1
43 n 644 41 .hglf/sub/large2
43 n 644 41 .hglf/sub/large2
44 n 644 8 normal1
44 n 644 8 normal1
45 n 644 8 sub/normal2
45 n 644 8 sub/normal2
46 $ hg debugstate --large
46 $ hg debugstate --large
47 n 644 7 large1
47 n 644 7 large1
48 n 644 7 sub/large2
48 n 644 7 sub/large2
49 $ echo normal11 > normal1
49 $ echo normal11 > normal1
50 $ echo normal22 > sub/normal2
50 $ echo normal22 > sub/normal2
51 $ echo large11 > large1
51 $ echo large11 > large1
52 $ echo large22 > sub/large2
52 $ echo large22 > sub/large2
53 $ hg commit -m "edit files"
53 $ hg commit -m "edit files"
54 Invoking status precommit hook
54 Invoking status precommit hook
55 M large1
55 M large1
56 M normal1
56 M normal1
57 M sub/large2
57 M sub/large2
58 M sub/normal2
58 M sub/normal2
59 $ hg sum --large
59 $ hg sum --large
60 parent: 1:ce8896473775 tip
60 parent: 1:ce8896473775 tip
61 edit files
61 edit files
62 branch: default
62 branch: default
63 commit: (clean)
63 commit: (clean)
64 update: (current)
64 update: (current)
65 largefiles: (no remote repo)
65 largefiles: (no remote repo)
66
66
67 Commit preserved largefile contents.
67 Commit preserved largefile contents.
68
68
69 $ cat normal1
69 $ cat normal1
70 normal11
70 normal11
71 $ cat large1
71 $ cat large1
72 large11
72 large11
73 $ cat sub/normal2
73 $ cat sub/normal2
74 normal22
74 normal22
75 $ cat sub/large2
75 $ cat sub/large2
76 large22
76 large22
77
77
78 Test status, subdir and unknown files
78 Test status, subdir and unknown files
79
79
80 $ echo unknown > sub/unknown
80 $ echo unknown > sub/unknown
81 $ hg st --all
81 $ hg st --all
82 ? sub/unknown
82 ? sub/unknown
83 C large1
83 C large1
84 C normal1
84 C normal1
85 C sub/large2
85 C sub/large2
86 C sub/normal2
86 C sub/normal2
87 $ hg st --all sub
87 $ hg st --all sub
88 ? sub/unknown
88 ? sub/unknown
89 C sub/large2
89 C sub/large2
90 C sub/normal2
90 C sub/normal2
91 $ rm sub/unknown
91 $ rm sub/unknown
92
92
93 Test messages and exit codes for remove warning cases
93 Test messages and exit codes for remove warning cases
94
94
95 $ hg remove -A large1
95 $ hg remove -A large1
96 not removing large1: file still exists
96 not removing large1: file still exists
97 [1]
97 [1]
98 $ echo 'modified' > large1
98 $ echo 'modified' > large1
99 $ hg remove large1
99 $ hg remove large1
100 not removing large1: file is modified (use -f to force removal)
100 not removing large1: file is modified (use -f to force removal)
101 [1]
101 [1]
102 $ echo 'new' > normalnew
102 $ echo 'new' > normalnew
103 $ hg add normalnew
103 $ hg add normalnew
104 $ echo 'new' > largenew
104 $ echo 'new' > largenew
105 $ hg add --large normalnew
105 $ hg add --large normalnew
106 normalnew already tracked!
106 normalnew already tracked!
107 $ hg remove normalnew largenew
107 $ hg remove normalnew largenew
108 not removing largenew: file is untracked
108 not removing largenew: file is untracked
109 not removing normalnew: file has been marked for add (use forget to undo)
109 not removing normalnew: file has been marked for add (use forget to undo)
110 [1]
110 [1]
111 $ rm normalnew largenew
111 $ rm normalnew largenew
112 $ hg up -Cq
112 $ hg up -Cq
113
113
114 Remove both largefiles and normal files.
114 Remove both largefiles and normal files.
115
115
116 $ hg remove normal1 large1
116 $ hg remove normal1 large1
117 $ hg status large1
117 $ hg status large1
118 R large1
118 R large1
119 $ hg commit -m "remove files"
119 $ hg commit -m "remove files"
120 Invoking status precommit hook
120 Invoking status precommit hook
121 R large1
121 R large1
122 R normal1
122 R normal1
123 $ ls
123 $ ls
124 sub
124 sub
125 $ echo "testlargefile" > large1-test
125 $ echo "testlargefile" > large1-test
126 $ hg add --large large1-test
126 $ hg add --large large1-test
127 $ hg st
127 $ hg st
128 A large1-test
128 A large1-test
129 $ hg rm large1-test
129 $ hg rm large1-test
130 not removing large1-test: file has been marked for add (use forget to undo)
130 not removing large1-test: file has been marked for add (use forget to undo)
131 [1]
131 [1]
132 $ hg st
132 $ hg st
133 A large1-test
133 A large1-test
134 $ hg forget large1-test
134 $ hg forget large1-test
135 $ hg st
135 $ hg st
136 ? large1-test
136 ? large1-test
137 $ hg remove large1-test
137 $ hg remove large1-test
138 not removing large1-test: file is untracked
138 not removing large1-test: file is untracked
139 [1]
139 [1]
140 $ hg forget large1-test
140 $ hg forget large1-test
141 not removing large1-test: file is already untracked
141 not removing large1-test: file is already untracked
142 [1]
142 [1]
143 $ rm large1-test
143 $ rm large1-test
144
144
145 Copy both largefiles and normal files (testing that status output is correct).
145 Copy both largefiles and normal files (testing that status output is correct).
146
146
147 $ hg cp sub/normal2 normal1
147 $ hg cp sub/normal2 normal1
148 $ hg cp sub/large2 large1
148 $ hg cp sub/large2 large1
149 $ hg commit -m "copy files"
149 $ hg commit -m "copy files"
150 Invoking status precommit hook
150 Invoking status precommit hook
151 A large1
151 A large1
152 A normal1
152 A normal1
153 $ cat normal1
153 $ cat normal1
154 normal22
154 normal22
155 $ cat large1
155 $ cat large1
156 large22
156 large22
157
157
158 Test moving largefiles and verify that normal files are also unaffected.
158 Test moving largefiles and verify that normal files are also unaffected.
159
159
160 $ hg mv normal1 normal3
160 $ hg mv normal1 normal3
161 $ hg mv large1 large3
161 $ hg mv large1 large3
162 $ hg mv sub/normal2 sub/normal4
162 $ hg mv sub/normal2 sub/normal4
163 $ hg mv sub/large2 sub/large4
163 $ hg mv sub/large2 sub/large4
164 $ hg commit -m "move files"
164 $ hg commit -m "move files"
165 Invoking status precommit hook
165 Invoking status precommit hook
166 A large3
166 A large3
167 A normal3
167 A normal3
168 A sub/large4
168 A sub/large4
169 A sub/normal4
169 A sub/normal4
170 R large1
170 R large1
171 R normal1
171 R normal1
172 R sub/large2
172 R sub/large2
173 R sub/normal2
173 R sub/normal2
174 $ cat normal3
174 $ cat normal3
175 normal22
175 normal22
176 $ cat large3
176 $ cat large3
177 large22
177 large22
178 $ cat sub/normal4
178 $ cat sub/normal4
179 normal22
179 normal22
180 $ cat sub/large4
180 $ cat sub/large4
181 large22
181 large22
182
182
183 Test copies and moves from a directory other than root (issue3516)
183 Test copies and moves from a directory other than root (issue3516)
184
184
185 $ cd ..
185 $ cd ..
186 $ hg init lf_cpmv
186 $ hg init lf_cpmv
187 $ cd lf_cpmv
187 $ cd lf_cpmv
188 $ mkdir dira
188 $ mkdir dira
189 $ mkdir dira/dirb
189 $ mkdir dira/dirb
190 $ touch dira/dirb/largefile
190 $ touch dira/dirb/largefile
191 $ hg add --large dira/dirb/largefile
191 $ hg add --large dira/dirb/largefile
192 $ hg commit -m "added"
192 $ hg commit -m "added"
193 Invoking status precommit hook
193 Invoking status precommit hook
194 A dira/dirb/largefile
194 A dira/dirb/largefile
195 $ cd dira
195 $ cd dira
196 $ hg cp dirb/largefile foo/largefile
196 $ hg cp dirb/largefile foo/largefile
197 $ hg ci -m "deep copy"
197 $ hg ci -m "deep copy"
198 Invoking status precommit hook
198 Invoking status precommit hook
199 A dira/foo/largefile
199 A dira/foo/largefile
200 $ find . | sort
200 $ find . | sort
201 .
201 .
202 ./dirb
202 ./dirb
203 ./dirb/largefile
203 ./dirb/largefile
204 ./foo
204 ./foo
205 ./foo/largefile
205 ./foo/largefile
206 $ hg mv foo/largefile baz/largefile
206 $ hg mv foo/largefile baz/largefile
207 $ hg ci -m "moved"
207 $ hg ci -m "moved"
208 Invoking status precommit hook
208 Invoking status precommit hook
209 A dira/baz/largefile
209 A dira/baz/largefile
210 R dira/foo/largefile
210 R dira/foo/largefile
211 $ find . | sort
211 $ find . | sort
212 .
212 .
213 ./baz
213 ./baz
214 ./baz/largefile
214 ./baz/largefile
215 ./dirb
215 ./dirb
216 ./dirb/largefile
216 ./dirb/largefile
217 ./foo
217 ./foo
218 $ cd ../../a
218 $ cd ../../a
219
219
220 #if serve
220 #if serve
221 Test display of largefiles in hgweb
221 Test display of largefiles in hgweb
222
222
223 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
223 $ hg serve -d -p $HGPORT --pid-file ../hg.pid
224 $ cat ../hg.pid >> $DAEMON_PIDS
224 $ cat ../hg.pid >> $DAEMON_PIDS
225 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
225 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
226 200 Script output follows
226 200 Script output follows
227
227
228
228
229 drwxr-xr-x sub
229 drwxr-xr-x sub
230 -rw-r--r-- 41 large3
230 -rw-r--r-- 41 large3
231 -rw-r--r-- 9 normal3
231 -rw-r--r-- 9 normal3
232
232
233
233
234 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
234 $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw'
235 200 Script output follows
235 200 Script output follows
236
236
237
237
238 -rw-r--r-- 41 large4
238 -rw-r--r-- 41 large4
239 -rw-r--r-- 9 normal4
239 -rw-r--r-- 9 normal4
240
240
241
241
242 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
242 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
243 #endif
243 #endif
244
244
245 Test archiving the various revisions. These hit corner cases known with
245 Test archiving the various revisions. These hit corner cases known with
246 archiving.
246 archiving.
247
247
248 $ hg archive -r 0 ../archive0
248 $ hg archive -r 0 ../archive0
249 $ hg archive -r 1 ../archive1
249 $ hg archive -r 1 ../archive1
250 $ hg archive -r 2 ../archive2
250 $ hg archive -r 2 ../archive2
251 $ hg archive -r 3 ../archive3
251 $ hg archive -r 3 ../archive3
252 $ hg archive -r 4 ../archive4
252 $ hg archive -r 4 ../archive4
253 $ cd ../archive0
253 $ cd ../archive0
254 $ cat normal1
254 $ cat normal1
255 normal1
255 normal1
256 $ cat large1
256 $ cat large1
257 large1
257 large1
258 $ cat sub/normal2
258 $ cat sub/normal2
259 normal2
259 normal2
260 $ cat sub/large2
260 $ cat sub/large2
261 large2
261 large2
262 $ cd ../archive1
262 $ cd ../archive1
263 $ cat normal1
263 $ cat normal1
264 normal11
264 normal11
265 $ cat large1
265 $ cat large1
266 large11
266 large11
267 $ cat sub/normal2
267 $ cat sub/normal2
268 normal22
268 normal22
269 $ cat sub/large2
269 $ cat sub/large2
270 large22
270 large22
271 $ cd ../archive2
271 $ cd ../archive2
272 $ ls
272 $ ls
273 sub
273 sub
274 $ cat sub/normal2
274 $ cat sub/normal2
275 normal22
275 normal22
276 $ cat sub/large2
276 $ cat sub/large2
277 large22
277 large22
278 $ cd ../archive3
278 $ cd ../archive3
279 $ cat normal1
279 $ cat normal1
280 normal22
280 normal22
281 $ cat large1
281 $ cat large1
282 large22
282 large22
283 $ cat sub/normal2
283 $ cat sub/normal2
284 normal22
284 normal22
285 $ cat sub/large2
285 $ cat sub/large2
286 large22
286 large22
287 $ cd ../archive4
287 $ cd ../archive4
288 $ cat normal3
288 $ cat normal3
289 normal22
289 normal22
290 $ cat large3
290 $ cat large3
291 large22
291 large22
292 $ cat sub/normal4
292 $ cat sub/normal4
293 normal22
293 normal22
294 $ cat sub/large4
294 $ cat sub/large4
295 large22
295 large22
296
296
297 Commit corner case: specify files to commit.
297 Commit corner case: specify files to commit.
298
298
299 $ cd ../a
299 $ cd ../a
300 $ echo normal3 > normal3
300 $ echo normal3 > normal3
301 $ echo large3 > large3
301 $ echo large3 > large3
302 $ echo normal4 > sub/normal4
302 $ echo normal4 > sub/normal4
303 $ echo large4 > sub/large4
303 $ echo large4 > sub/large4
304 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
304 $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again"
305 Invoking status precommit hook
305 Invoking status precommit hook
306 M large3
306 M large3
307 M normal3
307 M normal3
308 M sub/large4
308 M sub/large4
309 M sub/normal4
309 M sub/normal4
310 $ cat normal3
310 $ cat normal3
311 normal3
311 normal3
312 $ cat large3
312 $ cat large3
313 large3
313 large3
314 $ cat sub/normal4
314 $ cat sub/normal4
315 normal4
315 normal4
316 $ cat sub/large4
316 $ cat sub/large4
317 large4
317 large4
318
318
319 One more commit corner case: commit from a subdirectory.
319 One more commit corner case: commit from a subdirectory.
320
320
321 $ cd ../a
321 $ cd ../a
322 $ echo normal33 > normal3
322 $ echo normal33 > normal3
323 $ echo large33 > large3
323 $ echo large33 > large3
324 $ echo normal44 > sub/normal4
324 $ echo normal44 > sub/normal4
325 $ echo large44 > sub/large4
325 $ echo large44 > sub/large4
326 $ cd sub
326 $ cd sub
327 $ hg commit -m "edit files yet again"
327 $ hg commit -m "edit files yet again"
328 Invoking status precommit hook
328 Invoking status precommit hook
329 M large3
329 M large3
330 M normal3
330 M normal3
331 M sub/large4
331 M sub/large4
332 M sub/normal4
332 M sub/normal4
333 $ cat ../normal3
333 $ cat ../normal3
334 normal33
334 normal33
335 $ cat ../large3
335 $ cat ../large3
336 large33
336 large33
337 $ cat normal4
337 $ cat normal4
338 normal44
338 normal44
339 $ cat large4
339 $ cat large4
340 large44
340 large44
341
341
342 Committing standins is not allowed.
342 Committing standins is not allowed.
343
343
344 $ cd ..
344 $ cd ..
345 $ echo large3 > large3
345 $ echo large3 > large3
346 $ hg commit .hglf/large3 -m "try to commit standin"
346 $ hg commit .hglf/large3 -m "try to commit standin"
347 abort: file ".hglf/large3" is a largefile standin
347 abort: file ".hglf/large3" is a largefile standin
348 (commit the largefile itself instead)
348 (commit the largefile itself instead)
349 [255]
349 [255]
350
350
351 Corner cases for adding largefiles.
351 Corner cases for adding largefiles.
352
352
353 $ echo large5 > large5
353 $ echo large5 > large5
354 $ hg add --large large5
354 $ hg add --large large5
355 $ hg add --large large5
355 $ hg add --large large5
356 large5 already a largefile
356 large5 already a largefile
357 $ mkdir sub2
357 $ mkdir sub2
358 $ echo large6 > sub2/large6
358 $ echo large6 > sub2/large6
359 $ echo large7 > sub2/large7
359 $ echo large7 > sub2/large7
360 $ hg add --large sub2
360 $ hg add --large sub2
361 adding sub2/large6 as a largefile (glob)
361 adding sub2/large6 as a largefile (glob)
362 adding sub2/large7 as a largefile (glob)
362 adding sub2/large7 as a largefile (glob)
363 $ hg st
363 $ hg st
364 M large3
364 M large3
365 A large5
365 A large5
366 A sub2/large6
366 A sub2/large6
367 A sub2/large7
367 A sub2/large7
368
368
369 Committing directories containing only largefiles.
369 Committing directories containing only largefiles.
370
370
371 $ mkdir -p z/y/x/m
371 $ mkdir -p z/y/x/m
372 $ touch z/y/x/m/large1
372 $ touch z/y/x/m/large1
373 $ touch z/y/x/large2
373 $ touch z/y/x/large2
374 $ hg add --large z/y/x/m/large1 z/y/x/large2
374 $ hg add --large z/y/x/m/large1 z/y/x/large2
375 $ hg commit -m "Subdir with directory only containing largefiles" z
375 $ hg commit -m "Subdir with directory only containing largefiles" z
376 Invoking status precommit hook
376 Invoking status precommit hook
377 M large3
377 M large3
378 A large5
378 A large5
379 A sub2/large6
379 A sub2/large6
380 A sub2/large7
380 A sub2/large7
381 A z/y/x/large2
381 A z/y/x/large2
382 A z/y/x/m/large1
382 A z/y/x/m/large1
383 $ hg rollback --quiet
383 $ hg rollback --quiet
384 $ touch z/y/x/m/normal
384 $ touch z/y/x/m/normal
385 $ hg add z/y/x/m/normal
385 $ hg add z/y/x/m/normal
386 $ hg commit -m "Subdir with mixed contents" z
386 $ hg commit -m "Subdir with mixed contents" z
387 Invoking status precommit hook
387 Invoking status precommit hook
388 M large3
388 M large3
389 A large5
389 A large5
390 A sub2/large6
390 A sub2/large6
391 A sub2/large7
391 A sub2/large7
392 A z/y/x/large2
392 A z/y/x/large2
393 A z/y/x/m/large1
393 A z/y/x/m/large1
394 A z/y/x/m/normal
394 A z/y/x/m/normal
395 $ hg st
395 $ hg st
396 M large3
396 M large3
397 A large5
397 A large5
398 A sub2/large6
398 A sub2/large6
399 A sub2/large7
399 A sub2/large7
400 $ hg rollback --quiet
400 $ hg rollback --quiet
401 $ hg revert z/y/x/large2 z/y/x/m/large1
401 $ hg revert z/y/x/large2 z/y/x/m/large1
402 $ rm z/y/x/large2 z/y/x/m/large1
402 $ rm z/y/x/large2 z/y/x/m/large1
403 $ hg commit -m "Subdir with normal contents" z
403 $ hg commit -m "Subdir with normal contents" z
404 Invoking status precommit hook
404 Invoking status precommit hook
405 M large3
405 M large3
406 A large5
406 A large5
407 A sub2/large6
407 A sub2/large6
408 A sub2/large7
408 A sub2/large7
409 A z/y/x/m/normal
409 A z/y/x/m/normal
410 $ hg st
410 $ hg st
411 M large3
411 M large3
412 A large5
412 A large5
413 A sub2/large6
413 A sub2/large6
414 A sub2/large7
414 A sub2/large7
415 $ hg rollback --quiet
415 $ hg rollback --quiet
416 $ hg revert --quiet z
416 $ hg revert --quiet z
417 $ hg commit -m "Empty subdir" z
417 $ hg commit -m "Empty subdir" z
418 abort: z: no match under directory!
418 abort: z: no match under directory!
419 [255]
419 [255]
420 $ rm -rf z
420 $ rm -rf z
421 $ hg ci -m "standin" .hglf
421 $ hg ci -m "standin" .hglf
422 abort: file ".hglf" is a largefile standin
422 abort: file ".hglf" is a largefile standin
423 (commit the largefile itself instead)
423 (commit the largefile itself instead)
424 [255]
424 [255]
425
425
426 Test "hg status" with combination of 'file pattern' and 'directory
426 Test "hg status" with combination of 'file pattern' and 'directory
427 pattern' for largefiles:
427 pattern' for largefiles:
428
428
429 $ hg status sub2/large6 sub2
429 $ hg status sub2/large6 sub2
430 A sub2/large6
430 A sub2/large6
431 A sub2/large7
431 A sub2/large7
432
432
433 Config settings (pattern **.dat, minsize 2 MB) are respected.
433 Config settings (pattern **.dat, minsize 2 MB) are respected.
434
434
435 $ echo testdata > test.dat
435 $ echo testdata > test.dat
436 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
436 $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null
437 $ hg add
437 $ hg add
438 adding reallylarge as a largefile
438 adding reallylarge as a largefile
439 adding test.dat as a largefile
439 adding test.dat as a largefile
440
440
441 Test that minsize and --lfsize handle float values;
441 Test that minsize and --lfsize handle float values;
442 also tests that --lfsize overrides largefiles.minsize.
442 also tests that --lfsize overrides largefiles.minsize.
443 (0.250 MB = 256 kB = 262144 B)
443 (0.250 MB = 256 kB = 262144 B)
444
444
445 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
445 $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null
446 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
446 $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null
447 $ hg --config largefiles.minsize=.25 add
447 $ hg --config largefiles.minsize=.25 add
448 adding ratherlarge as a largefile
448 adding ratherlarge as a largefile
449 adding medium
449 adding medium
450 $ hg forget medium
450 $ hg forget medium
451 $ hg --config largefiles.minsize=.25 add --lfsize=.125
451 $ hg --config largefiles.minsize=.25 add --lfsize=.125
452 adding medium as a largefile
452 adding medium as a largefile
453 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
453 $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null
454 $ hg --config largefiles.minsize=.25 add --lfsize=.125
454 $ hg --config largefiles.minsize=.25 add --lfsize=.125
455 adding notlarge
455 adding notlarge
456 $ hg forget notlarge
456 $ hg forget notlarge
457
457
458 Test forget on largefiles.
458 Test forget on largefiles.
459
459
460 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
460 $ hg forget large3 large5 test.dat reallylarge ratherlarge medium
461 $ hg commit -m "add/edit more largefiles"
461 $ hg commit -m "add/edit more largefiles"
462 Invoking status precommit hook
462 Invoking status precommit hook
463 A sub2/large6
463 A sub2/large6
464 A sub2/large7
464 A sub2/large7
465 R large3
465 R large3
466 ? large5
466 ? large5
467 ? medium
467 ? medium
468 ? notlarge
468 ? notlarge
469 ? ratherlarge
469 ? ratherlarge
470 ? reallylarge
470 ? reallylarge
471 ? test.dat
471 ? test.dat
472 $ hg st
472 $ hg st
473 ? large3
473 ? large3
474 ? large5
474 ? large5
475 ? medium
475 ? medium
476 ? notlarge
476 ? notlarge
477 ? ratherlarge
477 ? ratherlarge
478 ? reallylarge
478 ? reallylarge
479 ? test.dat
479 ? test.dat
480
480
481 Purge with largefiles: verify that largefiles are still in the working
481 Purge with largefiles: verify that largefiles are still in the working
482 dir after a purge.
482 dir after a purge.
483
483
484 $ hg purge --all
484 $ hg purge --all
485 $ cat sub/large4
485 $ cat sub/large4
486 large44
486 large44
487 $ cat sub2/large6
487 $ cat sub2/large6
488 large6
488 large6
489 $ cat sub2/large7
489 $ cat sub2/large7
490 large7
490 large7
491
491
492 Test addremove: verify that files that should be added as largfiles are added as
492 Test addremove: verify that files that should be added as largfiles are added as
493 such and that already-existing largfiles are not added as normal files by
493 such and that already-existing largfiles are not added as normal files by
494 accident.
494 accident.
495
495
496 $ rm normal3
496 $ rm normal3
497 $ rm sub/large4
497 $ rm sub/large4
498 $ echo "testing addremove with patterns" > testaddremove.dat
498 $ echo "testing addremove with patterns" > testaddremove.dat
499 $ echo "normaladdremove" > normaladdremove
499 $ echo "normaladdremove" > normaladdremove
500 $ hg addremove
500 $ hg addremove
501 removing sub/large4
501 removing sub/large4
502 adding testaddremove.dat as a largefile
502 adding testaddremove.dat as a largefile
503 removing normal3
503 removing normal3
504 adding normaladdremove
504 adding normaladdremove
505
505
506 Test addremove with -R
506 Test addremove with -R
507
507
508 $ hg up -C
508 $ hg up -C
509 getting changed largefiles
509 getting changed largefiles
510 1 largefiles updated, 0 removed
510 1 largefiles updated, 0 removed
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
511 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
512 $ rm normal3
512 $ rm normal3
513 $ rm sub/large4
513 $ rm sub/large4
514 $ echo "testing addremove with patterns" > testaddremove.dat
514 $ echo "testing addremove with patterns" > testaddremove.dat
515 $ echo "normaladdremove" > normaladdremove
515 $ echo "normaladdremove" > normaladdremove
516 $ cd ..
516 $ cd ..
517 $ hg -R a addremove
517 $ hg -R a addremove
518 removing sub/large4
518 removing sub/large4
519 adding a/testaddremove.dat as a largefile (glob)
519 adding a/testaddremove.dat as a largefile (glob)
520 removing normal3
520 removing normal3
521 adding normaladdremove
521 adding normaladdremove
522 $ cd a
522 $ cd a
523
523
524 Test 3364
524 Test 3364
525 $ hg clone . ../addrm
525 $ hg clone . ../addrm
526 updating to branch default
526 updating to branch default
527 getting changed largefiles
527 getting changed largefiles
528 3 largefiles updated, 0 removed
528 3 largefiles updated, 0 removed
529 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
529 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
530 $ cd ../addrm
530 $ cd ../addrm
531 $ cat >> .hg/hgrc <<EOF
531 $ cat >> .hg/hgrc <<EOF
532 > [hooks]
532 > [hooks]
533 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
533 > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A"
534 > EOF
534 > EOF
535 $ touch foo
535 $ touch foo
536 $ hg add --large foo
536 $ hg add --large foo
537 $ hg ci -m "add foo"
537 $ hg ci -m "add foo"
538 Invoking status precommit hook
538 Invoking status precommit hook
539 A foo
539 A foo
540 Invoking status postcommit hook
540 Invoking status postcommit hook
541 C foo
541 C foo
542 C normal3
542 C normal3
543 C sub/large4
543 C sub/large4
544 C sub/normal4
544 C sub/normal4
545 C sub2/large6
545 C sub2/large6
546 C sub2/large7
546 C sub2/large7
547 $ rm foo
547 $ rm foo
548 $ hg st
548 $ hg st
549 ! foo
549 ! foo
550 hmm.. no precommit invoked, but there is a postcommit??
550 hmm.. no precommit invoked, but there is a postcommit??
551 $ hg ci -m "will not checkin"
551 $ hg ci -m "will not checkin"
552 nothing changed
552 nothing changed
553 Invoking status postcommit hook
553 Invoking status postcommit hook
554 ! foo
554 ! foo
555 C normal3
555 C normal3
556 C sub/large4
556 C sub/large4
557 C sub/normal4
557 C sub/normal4
558 C sub2/large6
558 C sub2/large6
559 C sub2/large7
559 C sub2/large7
560 [1]
560 [1]
561 $ hg addremove
561 $ hg addremove
562 removing foo
562 removing foo
563 $ hg st
563 $ hg st
564 R foo
564 R foo
565 $ hg ci -m "used to say nothing changed"
565 $ hg ci -m "used to say nothing changed"
566 Invoking status precommit hook
566 Invoking status precommit hook
567 R foo
567 R foo
568 Invoking status postcommit hook
568 Invoking status postcommit hook
569 C normal3
569 C normal3
570 C sub/large4
570 C sub/large4
571 C sub/normal4
571 C sub/normal4
572 C sub2/large6
572 C sub2/large6
573 C sub2/large7
573 C sub2/large7
574 $ hg st
574 $ hg st
575
575
576 Test 3507 (both normal files and largefiles were a problem)
576 Test 3507 (both normal files and largefiles were a problem)
577
577
578 $ touch normal
578 $ touch normal
579 $ touch large
579 $ touch large
580 $ hg add normal
580 $ hg add normal
581 $ hg add --large large
581 $ hg add --large large
582 $ hg ci -m "added"
582 $ hg ci -m "added"
583 Invoking status precommit hook
583 Invoking status precommit hook
584 A large
584 A large
585 A normal
585 A normal
586 Invoking status postcommit hook
586 Invoking status postcommit hook
587 C large
587 C large
588 C normal
588 C normal
589 C normal3
589 C normal3
590 C sub/large4
590 C sub/large4
591 C sub/normal4
591 C sub/normal4
592 C sub2/large6
592 C sub2/large6
593 C sub2/large7
593 C sub2/large7
594 $ hg remove normal
594 $ hg remove normal
595 $ hg addremove --traceback
595 $ hg addremove --traceback
596 $ hg ci -m "addremoved normal"
596 $ hg ci -m "addremoved normal"
597 Invoking status precommit hook
597 Invoking status precommit hook
598 R normal
598 R normal
599 Invoking status postcommit hook
599 Invoking status postcommit hook
600 C large
600 C large
601 C normal3
601 C normal3
602 C sub/large4
602 C sub/large4
603 C sub/normal4
603 C sub/normal4
604 C sub2/large6
604 C sub2/large6
605 C sub2/large7
605 C sub2/large7
606 $ hg up -C '.^'
606 $ hg up -C '.^'
607 getting changed largefiles
607 getting changed largefiles
608 0 largefiles updated, 0 removed
608 0 largefiles updated, 0 removed
609 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
609 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
610 $ hg remove large
610 $ hg remove large
611 $ hg addremove --traceback
611 $ hg addremove --traceback
612 $ hg ci -m "removed large"
612 $ hg ci -m "removed large"
613 Invoking status precommit hook
613 Invoking status precommit hook
614 R large
614 R large
615 created new head
615 created new head
616 Invoking status postcommit hook
616 Invoking status postcommit hook
617 C normal
617 C normal
618 C normal3
618 C normal3
619 C sub/large4
619 C sub/large4
620 C sub/normal4
620 C sub/normal4
621 C sub2/large6
621 C sub2/large6
622 C sub2/large7
622 C sub2/large7
623
623
624 Test commit -A (issue 3542)
624 Test commit -A (issue 3542)
625 $ echo large8 > large8
625 $ echo large8 > large8
626 $ hg add --large large8
626 $ hg add --large large8
627 $ hg ci -Am 'this used to add large8 as normal and commit both'
627 $ hg ci -Am 'this used to add large8 as normal and commit both'
628 Invoking status precommit hook
628 Invoking status precommit hook
629 A large8
629 A large8
630 Invoking status postcommit hook
630 Invoking status postcommit hook
631 C large8
631 C large8
632 C normal
632 C normal
633 C normal3
633 C normal3
634 C sub/large4
634 C sub/large4
635 C sub/normal4
635 C sub/normal4
636 C sub2/large6
636 C sub2/large6
637 C sub2/large7
637 C sub2/large7
638 $ rm large8
638 $ rm large8
639 $ hg ci -Am 'this used to not notice the rm'
639 $ hg ci -Am 'this used to not notice the rm'
640 removing large8
640 removing large8
641 Invoking status precommit hook
641 Invoking status precommit hook
642 R large8
642 R large8
643 Invoking status postcommit hook
643 Invoking status postcommit hook
644 C normal
644 C normal
645 C normal3
645 C normal3
646 C sub/large4
646 C sub/large4
647 C sub/normal4
647 C sub/normal4
648 C sub2/large6
648 C sub2/large6
649 C sub2/large7
649 C sub2/large7
650
650
651 Test that a standin can't be added as a large file
651 Test that a standin can't be added as a large file
652
652
653 $ touch large
653 $ touch large
654 $ hg add --large large
654 $ hg add --large large
655 $ hg ci -m "add"
655 $ hg ci -m "add"
656 Invoking status precommit hook
656 Invoking status precommit hook
657 A large
657 A large
658 Invoking status postcommit hook
658 Invoking status postcommit hook
659 C large
659 C large
660 C normal
660 C normal
661 C normal3
661 C normal3
662 C sub/large4
662 C sub/large4
663 C sub/normal4
663 C sub/normal4
664 C sub2/large6
664 C sub2/large6
665 C sub2/large7
665 C sub2/large7
666 $ hg remove large
666 $ hg remove large
667 $ touch large
667 $ touch large
668 $ hg addremove --config largefiles.patterns=**large --traceback
668 $ hg addremove --config largefiles.patterns=**large --traceback
669 adding large as a largefile
669 adding large as a largefile
670
670
671 Test that outgoing --large works (with revsets too)
671 Test that outgoing --large works (with revsets too)
672 $ hg outgoing --rev '.^' --large
672 $ hg outgoing --rev '.^' --large
673 comparing with $TESTTMP/a (glob)
673 comparing with $TESTTMP/a (glob)
674 searching for changes
674 searching for changes
675 changeset: 8:c02fd3b77ec4
675 changeset: 8:c02fd3b77ec4
676 user: test
676 user: test
677 date: Thu Jan 01 00:00:00 1970 +0000
677 date: Thu Jan 01 00:00:00 1970 +0000
678 summary: add foo
678 summary: add foo
679
679
680 changeset: 9:289dd08c9bbb
680 changeset: 9:289dd08c9bbb
681 user: test
681 user: test
682 date: Thu Jan 01 00:00:00 1970 +0000
682 date: Thu Jan 01 00:00:00 1970 +0000
683 summary: used to say nothing changed
683 summary: used to say nothing changed
684
684
685 changeset: 10:34f23ac6ac12
685 changeset: 10:34f23ac6ac12
686 user: test
686 user: test
687 date: Thu Jan 01 00:00:00 1970 +0000
687 date: Thu Jan 01 00:00:00 1970 +0000
688 summary: added
688 summary: added
689
689
690 changeset: 12:710c1b2f523c
690 changeset: 12:710c1b2f523c
691 parent: 10:34f23ac6ac12
691 parent: 10:34f23ac6ac12
692 user: test
692 user: test
693 date: Thu Jan 01 00:00:00 1970 +0000
693 date: Thu Jan 01 00:00:00 1970 +0000
694 summary: removed large
694 summary: removed large
695
695
696 changeset: 13:0a3e75774479
696 changeset: 13:0a3e75774479
697 user: test
697 user: test
698 date: Thu Jan 01 00:00:00 1970 +0000
698 date: Thu Jan 01 00:00:00 1970 +0000
699 summary: this used to add large8 as normal and commit both
699 summary: this used to add large8 as normal and commit both
700
700
701 changeset: 14:84f3d378175c
701 changeset: 14:84f3d378175c
702 user: test
702 user: test
703 date: Thu Jan 01 00:00:00 1970 +0000
703 date: Thu Jan 01 00:00:00 1970 +0000
704 summary: this used to not notice the rm
704 summary: this used to not notice the rm
705
705
706 searching for changes
706 searching for changes
707 largefiles to upload:
707 largefiles to upload:
708 foo
708 foo
709 large
709 large
710 large8
710 large8
711
711
712 $ cd ../a
712 $ cd ../a
713
713
714 Clone a largefiles repo.
714 Clone a largefiles repo.
715
715
716 $ hg clone . ../b
716 $ hg clone . ../b
717 updating to branch default
717 updating to branch default
718 getting changed largefiles
718 getting changed largefiles
719 3 largefiles updated, 0 removed
719 3 largefiles updated, 0 removed
720 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
720 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
721 $ cd ../b
721 $ cd ../b
722 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
722 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
723 7:daea875e9014 add/edit more largefiles
723 7:daea875e9014 add/edit more largefiles
724 6:4355d653f84f edit files yet again
724 6:4355d653f84f edit files yet again
725 5:9d5af5072dbd edit files again
725 5:9d5af5072dbd edit files again
726 4:74c02385b94c move files
726 4:74c02385b94c move files
727 3:9e8fbc4bce62 copy files
727 3:9e8fbc4bce62 copy files
728 2:51a0ae4d5864 remove files
728 2:51a0ae4d5864 remove files
729 1:ce8896473775 edit files
729 1:ce8896473775 edit files
730 0:30d30fe6a5be add files
730 0:30d30fe6a5be add files
731 $ cat normal3
731 $ cat normal3
732 normal33
732 normal33
733 $ cat sub/normal4
733 $ cat sub/normal4
734 normal44
734 normal44
735 $ cat sub/large4
735 $ cat sub/large4
736 large44
736 large44
737 $ cat sub2/large6
737 $ cat sub2/large6
738 large6
738 large6
739 $ cat sub2/large7
739 $ cat sub2/large7
740 large7
740 large7
741 $ hg log -qf sub2/large7
741 $ hg log -qf sub2/large7
742 7:daea875e9014
742 7:daea875e9014
743 $ cd ..
743 $ cd ..
744 $ hg clone a -r 3 c
744 $ hg clone a -r 3 c
745 adding changesets
745 adding changesets
746 adding manifests
746 adding manifests
747 adding file changes
747 adding file changes
748 added 4 changesets with 10 changes to 4 files
748 added 4 changesets with 10 changes to 4 files
749 updating to branch default
749 updating to branch default
750 getting changed largefiles
750 getting changed largefiles
751 2 largefiles updated, 0 removed
751 2 largefiles updated, 0 removed
752 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
752 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
753 $ cd c
753 $ cd c
754 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
754 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
755 3:9e8fbc4bce62 copy files
755 3:9e8fbc4bce62 copy files
756 2:51a0ae4d5864 remove files
756 2:51a0ae4d5864 remove files
757 1:ce8896473775 edit files
757 1:ce8896473775 edit files
758 0:30d30fe6a5be add files
758 0:30d30fe6a5be add files
759 $ cat normal1
759 $ cat normal1
760 normal22
760 normal22
761 $ cat large1
761 $ cat large1
762 large22
762 large22
763 $ cat sub/normal2
763 $ cat sub/normal2
764 normal22
764 normal22
765 $ cat sub/large2
765 $ cat sub/large2
766 large22
766 large22
767
767
768 Old revisions of a clone have correct largefiles content (this also
768 Old revisions of a clone have correct largefiles content (this also
769 tests update).
769 tests update).
770
770
771 $ hg update -r 1
771 $ hg update -r 1
772 getting changed largefiles
772 getting changed largefiles
773 1 largefiles updated, 0 removed
773 1 largefiles updated, 0 removed
774 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
774 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
775 $ cat large1
775 $ cat large1
776 large11
776 large11
777 $ cat sub/large2
777 $ cat sub/large2
778 large22
778 large22
779 $ cd ..
779 $ cd ..
780
780
781 Test cloning with --all-largefiles flag
781 Test cloning with --all-largefiles flag
782
782
783 $ rm "${USERCACHE}"/*
783 $ rm "${USERCACHE}"/*
784 $ hg clone --all-largefiles a a-backup
784 $ hg clone --all-largefiles a a-backup
785 updating to branch default
785 updating to branch default
786 getting changed largefiles
786 getting changed largefiles
787 3 largefiles updated, 0 removed
787 3 largefiles updated, 0 removed
788 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
788 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
789 8 additional largefiles cached
789 8 additional largefiles cached
790
790
791 $ rm "${USERCACHE}"/*
791 $ rm "${USERCACHE}"/*
792 $ hg clone --all-largefiles -u 0 a a-clone0
792 $ hg clone --all-largefiles -u 0 a a-clone0
793 updating to branch default
793 updating to branch default
794 getting changed largefiles
794 getting changed largefiles
795 2 largefiles updated, 0 removed
795 2 largefiles updated, 0 removed
796 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
796 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
797 9 additional largefiles cached
797 9 additional largefiles cached
798 $ hg -R a-clone0 sum
798 $ hg -R a-clone0 sum
799 parent: 0:30d30fe6a5be
799 parent: 0:30d30fe6a5be
800 add files
800 add files
801 branch: default
801 branch: default
802 commit: (clean)
802 commit: (clean)
803 update: 7 new changesets (update)
803 update: 7 new changesets (update)
804
804
805 $ rm "${USERCACHE}"/*
805 $ rm "${USERCACHE}"/*
806 $ hg clone --all-largefiles -u 1 a a-clone1
806 $ hg clone --all-largefiles -u 1 a a-clone1
807 updating to branch default
807 updating to branch default
808 getting changed largefiles
808 getting changed largefiles
809 2 largefiles updated, 0 removed
809 2 largefiles updated, 0 removed
810 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
810 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
811 8 additional largefiles cached
811 8 additional largefiles cached
812 $ hg -R a-clone1 verify --large --lfa --lfc
812 $ hg -R a-clone1 verify --large --lfa --lfc
813 checking changesets
813 checking changesets
814 checking manifests
814 checking manifests
815 crosschecking files in changesets and manifests
815 crosschecking files in changesets and manifests
816 checking files
816 checking files
817 10 files, 8 changesets, 24 total revisions
817 10 files, 8 changesets, 24 total revisions
818 searching 8 changesets for largefiles
818 searching 8 changesets for largefiles
819 verified contents of 13 revisions of 6 largefiles
819 verified contents of 13 revisions of 6 largefiles
820 $ hg -R a-clone1 sum
820 $ hg -R a-clone1 sum
821 parent: 1:ce8896473775
821 parent: 1:ce8896473775
822 edit files
822 edit files
823 branch: default
823 branch: default
824 commit: (clean)
824 commit: (clean)
825 update: 6 new changesets (update)
825 update: 6 new changesets (update)
826
826
827 $ rm "${USERCACHE}"/*
827 $ rm "${USERCACHE}"/*
828 $ hg clone --all-largefiles -U a a-clone-u
828 $ hg clone --all-largefiles -U a a-clone-u
829 11 additional largefiles cached
829 11 additional largefiles cached
830 $ hg -R a-clone-u sum
830 $ hg -R a-clone-u sum
831 parent: -1:000000000000 (no revision checked out)
831 parent: -1:000000000000 (no revision checked out)
832 branch: default
832 branch: default
833 commit: (clean)
833 commit: (clean)
834 update: 8 new changesets (update)
834 update: 8 new changesets (update)
835
835
836 Show computed destination directory:
836 Show computed destination directory:
837
837
838 $ mkdir xyz
838 $ mkdir xyz
839 $ cd xyz
839 $ cd xyz
840 $ hg clone ../a
840 $ hg clone ../a
841 destination directory: a
841 destination directory: a
842 updating to branch default
842 updating to branch default
843 getting changed largefiles
843 getting changed largefiles
844 3 largefiles updated, 0 removed
844 3 largefiles updated, 0 removed
845 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
845 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
846 $ cd ..
846 $ cd ..
847
847
848 Clone URL without path:
848 Clone URL without path:
849
849
850 $ hg clone file://
850 $ hg clone file://
851 abort: repository / not found!
851 abort: repository / not found!
852 [255]
852 [255]
853
853
854 Ensure base clone command argument validation
854 Ensure base clone command argument validation
855
855
856 $ hg clone -U -u 0 a a-clone-failure
856 $ hg clone -U -u 0 a a-clone-failure
857 abort: cannot specify both --noupdate and --updaterev
857 abort: cannot specify both --noupdate and --updaterev
858 [255]
858 [255]
859
859
860 $ hg clone --all-largefiles a ssh://localhost/a
860 $ hg clone --all-largefiles a ssh://localhost/a
861 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
861 abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a
862 [255]
862 [255]
863
863
864 Test pulling with --all-largefiles flag. Also test that the largefiles are
864 Test pulling with --all-largefiles flag. Also test that the largefiles are
865 downloaded from 'default' instead of 'default-push' when no source is specified
865 downloaded from 'default' instead of 'default-push' when no source is specified
866 (issue3584)
866 (issue3584)
867
867
868 $ rm -Rf a-backup
868 $ rm -Rf a-backup
869 $ hg clone -r 1 a a-backup
869 $ hg clone -r 1 a a-backup
870 adding changesets
870 adding changesets
871 adding manifests
871 adding manifests
872 adding file changes
872 adding file changes
873 added 2 changesets with 8 changes to 4 files
873 added 2 changesets with 8 changes to 4 files
874 updating to branch default
874 updating to branch default
875 getting changed largefiles
875 getting changed largefiles
876 2 largefiles updated, 0 removed
876 2 largefiles updated, 0 removed
877 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
877 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
878 $ rm "${USERCACHE}"/*
878 $ rm "${USERCACHE}"/*
879 $ cd a-backup
879 $ cd a-backup
880 $ hg pull --all-largefiles --config paths.default-push=bogus/path
880 $ hg pull --all-largefiles --config paths.default-push=bogus/path
881 pulling from $TESTTMP/a (glob)
881 pulling from $TESTTMP/a (glob)
882 searching for changes
882 searching for changes
883 adding changesets
883 adding changesets
884 adding manifests
884 adding manifests
885 adding file changes
885 adding file changes
886 added 6 changesets with 16 changes to 8 files
886 added 6 changesets with 16 changes to 8 files
887 (run 'hg update' to get a working copy)
887 (run 'hg update' to get a working copy)
888 6 largefiles cached
888 6 largefiles cached
889
889
890 redo pull with --lfrev and check it pulls largefiles for the right revs
890 redo pull with --lfrev and check it pulls largefiles for the right revs
891
891
892 $ hg rollback
892 $ hg rollback
893 repository tip rolled back to revision 1 (undo pull)
893 repository tip rolled back to revision 1 (undo pull)
894 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
894 $ hg pull -v --lfrev 'heads(pulled())+min(pulled())'
895 pulling from $TESTTMP/a (glob)
895 pulling from $TESTTMP/a (glob)
896 searching for changes
896 searching for changes
897 all local heads known remotely
897 all local heads known remotely
898 6 changesets found
898 6 changesets found
899 adding changesets
899 adding changesets
900 adding manifests
900 adding manifests
901 adding file changes
901 adding file changes
902 added 6 changesets with 16 changes to 8 files
902 added 6 changesets with 16 changes to 8 files
903 calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob)
903 calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob)
904 (run 'hg update' to get a working copy)
904 (run 'hg update' to get a working copy)
905 pulling largefiles for revision 7
905 pulling largefiles for revision 7
906 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
906 found 971fb41e78fea4f8e0ba5244784239371cb00591 in store
907 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
907 found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store
908 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
908 found bb3151689acb10f0c3125c560d5e63df914bc1af in store
909 pulling largefiles for revision 2
909 pulling largefiles for revision 2
910 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
910 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
911 0 largefiles cached
911 0 largefiles cached
912
912
913 lfpull
913 lfpull
914
914
915 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
915 $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull
916 2 largefiles cached
916 2 largefiles cached
917 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
917 $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull
918 pulling largefiles for revision 4
918 pulling largefiles for revision 4
919 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
919 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
920 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
920 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
921 pulling largefiles for revision 2
921 pulling largefiles for revision 2
922 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
922 found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store
923 0 largefiles cached
923 0 largefiles cached
924
924
925 $ ls usercache-lfpull/* | sort
925 $ ls usercache-lfpull/* | sort
926 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
926 usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d
927 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
927 usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64
928
928
929 $ cd ..
929 $ cd ..
930
930
931 Rebasing between two repositories does not revert largefiles to old
931 Rebasing between two repositories does not revert largefiles to old
932 revisions (this was a very bad bug that took a lot of work to fix).
932 revisions (this was a very bad bug that took a lot of work to fix).
933
933
934 $ hg clone a d
934 $ hg clone a d
935 updating to branch default
935 updating to branch default
936 getting changed largefiles
936 getting changed largefiles
937 3 largefiles updated, 0 removed
937 3 largefiles updated, 0 removed
938 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
938 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
939 $ cd b
939 $ cd b
940 $ echo large4-modified > sub/large4
940 $ echo large4-modified > sub/large4
941 $ echo normal3-modified > normal3
941 $ echo normal3-modified > normal3
942 $ hg commit -m "modify normal file and largefile in repo b"
942 $ hg commit -m "modify normal file and largefile in repo b"
943 Invoking status precommit hook
943 Invoking status precommit hook
944 M normal3
944 M normal3
945 M sub/large4
945 M sub/large4
946 $ cd ../d
946 $ cd ../d
947 $ echo large6-modified > sub2/large6
947 $ echo large6-modified > sub2/large6
948 $ echo normal4-modified > sub/normal4
948 $ echo normal4-modified > sub/normal4
949 $ hg commit -m "modify normal file largefile in repo d"
949 $ hg commit -m "modify normal file largefile in repo d"
950 Invoking status precommit hook
950 Invoking status precommit hook
951 M sub/normal4
951 M sub/normal4
952 M sub2/large6
952 M sub2/large6
953 $ cd ..
953 $ cd ..
954 $ hg clone d e
954 $ hg clone d e
955 updating to branch default
955 updating to branch default
956 getting changed largefiles
956 getting changed largefiles
957 3 largefiles updated, 0 removed
957 3 largefiles updated, 0 removed
958 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
958 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
959 $ cd d
959 $ cd d
960
960
961 More rebase testing, but also test that the largefiles are downloaded from
961 More rebase testing, but also test that the largefiles are downloaded from
962 'default-push' when no source is specified (issue3584). (The largefile from the
962 'default-push' when no source is specified (issue3584). (The largefile from the
963 pulled revision is however not downloaded but found in the local cache.)
963 pulled revision is however not downloaded but found in the local cache.)
964 Largefiles are fetched for the new pulled revision, not for existing revisions,
964 Largefiles are fetched for the new pulled revision, not for existing revisions,
965 rebased or not.
965 rebased or not.
966
966
967 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
967 $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
968 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
968 $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b
969 pulling from $TESTTMP/b (glob)
969 pulling from $TESTTMP/b (glob)
970 searching for changes
970 searching for changes
971 adding changesets
971 adding changesets
972 adding manifests
972 adding manifests
973 adding file changes
973 adding file changes
974 added 1 changesets with 2 changes to 2 files (+1 heads)
974 added 1 changesets with 2 changes to 2 files (+1 heads)
975 Invoking status precommit hook
975 Invoking status precommit hook
976 M sub/normal4
976 M sub/normal4
977 M sub2/large6
977 M sub2/large6
978 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
978 saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
979 0 largefiles cached
979 0 largefiles cached
980 nothing to rebase - working directory parent is also destination
980 nothing to rebase - working directory parent is also destination
981 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
981 $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ]
982 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
982 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
983 9:598410d3eb9a modify normal file largefile in repo d
983 9:598410d3eb9a modify normal file largefile in repo d
984 8:a381d2c8c80e modify normal file and largefile in repo b
984 8:a381d2c8c80e modify normal file and largefile in repo b
985 7:daea875e9014 add/edit more largefiles
985 7:daea875e9014 add/edit more largefiles
986 6:4355d653f84f edit files yet again
986 6:4355d653f84f edit files yet again
987 5:9d5af5072dbd edit files again
987 5:9d5af5072dbd edit files again
988 4:74c02385b94c move files
988 4:74c02385b94c move files
989 3:9e8fbc4bce62 copy files
989 3:9e8fbc4bce62 copy files
990 2:51a0ae4d5864 remove files
990 2:51a0ae4d5864 remove files
991 1:ce8896473775 edit files
991 1:ce8896473775 edit files
992 0:30d30fe6a5be add files
992 0:30d30fe6a5be add files
993 $ cat normal3
993 $ cat normal3
994 normal3-modified
994 normal3-modified
995 $ cat sub/normal4
995 $ cat sub/normal4
996 normal4-modified
996 normal4-modified
997 $ cat sub/large4
997 $ cat sub/large4
998 large4-modified
998 large4-modified
999 $ cat sub2/large6
999 $ cat sub2/large6
1000 large6-modified
1000 large6-modified
1001 $ cat sub2/large7
1001 $ cat sub2/large7
1002 large7
1002 large7
1003 $ cd ../e
1003 $ cd ../e
1004 $ hg pull ../b
1004 $ hg pull ../b
1005 pulling from ../b
1005 pulling from ../b
1006 searching for changes
1006 searching for changes
1007 adding changesets
1007 adding changesets
1008 adding manifests
1008 adding manifests
1009 adding file changes
1009 adding file changes
1010 added 1 changesets with 2 changes to 2 files (+1 heads)
1010 added 1 changesets with 2 changes to 2 files (+1 heads)
1011 (run 'hg heads' to see heads, 'hg merge' to merge)
1011 (run 'hg heads' to see heads, 'hg merge' to merge)
1012 $ hg rebase
1012 $ hg rebase
1013 Invoking status precommit hook
1013 Invoking status precommit hook
1014 M sub/normal4
1014 M sub/normal4
1015 M sub2/large6
1015 M sub2/large6
1016 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1016 saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob)
1017 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1017 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1018 9:598410d3eb9a modify normal file largefile in repo d
1018 9:598410d3eb9a modify normal file largefile in repo d
1019 8:a381d2c8c80e modify normal file and largefile in repo b
1019 8:a381d2c8c80e modify normal file and largefile in repo b
1020 7:daea875e9014 add/edit more largefiles
1020 7:daea875e9014 add/edit more largefiles
1021 6:4355d653f84f edit files yet again
1021 6:4355d653f84f edit files yet again
1022 5:9d5af5072dbd edit files again
1022 5:9d5af5072dbd edit files again
1023 4:74c02385b94c move files
1023 4:74c02385b94c move files
1024 3:9e8fbc4bce62 copy files
1024 3:9e8fbc4bce62 copy files
1025 2:51a0ae4d5864 remove files
1025 2:51a0ae4d5864 remove files
1026 1:ce8896473775 edit files
1026 1:ce8896473775 edit files
1027 0:30d30fe6a5be add files
1027 0:30d30fe6a5be add files
1028 $ cat normal3
1028 $ cat normal3
1029 normal3-modified
1029 normal3-modified
1030 $ cat sub/normal4
1030 $ cat sub/normal4
1031 normal4-modified
1031 normal4-modified
1032 $ cat sub/large4
1032 $ cat sub/large4
1033 large4-modified
1033 large4-modified
1034 $ cat sub2/large6
1034 $ cat sub2/large6
1035 large6-modified
1035 large6-modified
1036 $ cat sub2/large7
1036 $ cat sub2/large7
1037 large7
1037 large7
1038
1038
1039 Log on largefiles
1039 Log on largefiles
1040
1040
1041 - same output
1041 - same output
1042 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1042 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4
1043 8:a381d2c8c80e modify normal file and largefile in repo b
1043 8:a381d2c8c80e modify normal file and largefile in repo b
1044 6:4355d653f84f edit files yet again
1044 6:4355d653f84f edit files yet again
1045 5:9d5af5072dbd edit files again
1045 5:9d5af5072dbd edit files again
1046 4:74c02385b94c move files
1046 4:74c02385b94c move files
1047 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1047 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4
1048 8:a381d2c8c80e modify normal file and largefile in repo b
1048 8:a381d2c8c80e modify normal file and largefile in repo b
1049 6:4355d653f84f edit files yet again
1049 6:4355d653f84f edit files yet again
1050 5:9d5af5072dbd edit files again
1050 5:9d5af5072dbd edit files again
1051 4:74c02385b94c move files
1051 4:74c02385b94c move files
1052
1052
1053 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1053 - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal
1054 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1054 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub
1055 8:a381d2c8c80e modify normal file and largefile in repo b
1055 8:a381d2c8c80e modify normal file and largefile in repo b
1056 6:4355d653f84f edit files yet again
1056 6:4355d653f84f edit files yet again
1057 5:9d5af5072dbd edit files again
1057 5:9d5af5072dbd edit files again
1058 4:74c02385b94c move files
1058 4:74c02385b94c move files
1059 1:ce8896473775 edit files
1059 1:ce8896473775 edit files
1060 0:30d30fe6a5be add files
1060 0:30d30fe6a5be add files
1061 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1061 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub
1062 9:598410d3eb9a modify normal file largefile in repo d
1062 9:598410d3eb9a modify normal file largefile in repo d
1063 8:a381d2c8c80e modify normal file and largefile in repo b
1063 8:a381d2c8c80e modify normal file and largefile in repo b
1064 6:4355d653f84f edit files yet again
1064 6:4355d653f84f edit files yet again
1065 5:9d5af5072dbd edit files again
1065 5:9d5af5072dbd edit files again
1066 4:74c02385b94c move files
1066 4:74c02385b94c move files
1067 1:ce8896473775 edit files
1067 1:ce8896473775 edit files
1068 0:30d30fe6a5be add files
1068 0:30d30fe6a5be add files
1069
1069
1070 - globbing gives same result
1070 - globbing gives same result
1071 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1071 $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*'
1072 9:598410d3eb9a modify normal file largefile in repo d
1072 9:598410d3eb9a modify normal file largefile in repo d
1073 8:a381d2c8c80e modify normal file and largefile in repo b
1073 8:a381d2c8c80e modify normal file and largefile in repo b
1074 6:4355d653f84f edit files yet again
1074 6:4355d653f84f edit files yet again
1075 5:9d5af5072dbd edit files again
1075 5:9d5af5072dbd edit files again
1076 4:74c02385b94c move files
1076 4:74c02385b94c move files
1077 1:ce8896473775 edit files
1077 1:ce8896473775 edit files
1078 0:30d30fe6a5be add files
1078 0:30d30fe6a5be add files
1079
1079
1080 Rollback on largefiles.
1080 Rollback on largefiles.
1081
1081
1082 $ echo large4-modified-again > sub/large4
1082 $ echo large4-modified-again > sub/large4
1083 $ hg commit -m "Modify large4 again"
1083 $ hg commit -m "Modify large4 again"
1084 Invoking status precommit hook
1084 Invoking status precommit hook
1085 M sub/large4
1085 M sub/large4
1086 $ hg rollback
1086 $ hg rollback
1087 repository tip rolled back to revision 9 (undo commit)
1087 repository tip rolled back to revision 9 (undo commit)
1088 working directory now based on revision 9
1088 working directory now based on revision 9
1089 $ hg st
1089 $ hg st
1090 M sub/large4
1090 M sub/large4
1091 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1091 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1092 9:598410d3eb9a modify normal file largefile in repo d
1092 9:598410d3eb9a modify normal file largefile in repo d
1093 8:a381d2c8c80e modify normal file and largefile in repo b
1093 8:a381d2c8c80e modify normal file and largefile in repo b
1094 7:daea875e9014 add/edit more largefiles
1094 7:daea875e9014 add/edit more largefiles
1095 6:4355d653f84f edit files yet again
1095 6:4355d653f84f edit files yet again
1096 5:9d5af5072dbd edit files again
1096 5:9d5af5072dbd edit files again
1097 4:74c02385b94c move files
1097 4:74c02385b94c move files
1098 3:9e8fbc4bce62 copy files
1098 3:9e8fbc4bce62 copy files
1099 2:51a0ae4d5864 remove files
1099 2:51a0ae4d5864 remove files
1100 1:ce8896473775 edit files
1100 1:ce8896473775 edit files
1101 0:30d30fe6a5be add files
1101 0:30d30fe6a5be add files
1102 $ cat sub/large4
1102 $ cat sub/large4
1103 large4-modified-again
1103 large4-modified-again
1104
1104
1105 "update --check" refuses to update with uncommitted changes.
1105 "update --check" refuses to update with uncommitted changes.
1106 $ hg update --check 8
1106 $ hg update --check 8
1107 abort: uncommitted changes
1107 abort: uncommitted changes
1108 [255]
1108 [255]
1109
1109
1110 "update --clean" leaves correct largefiles in working copy, even when there is
1110 "update --clean" leaves correct largefiles in working copy, even when there is
1111 .orig files from revert in .hglf.
1111 .orig files from revert in .hglf.
1112
1112
1113 $ echo mistake > sub2/large7
1113 $ echo mistake > sub2/large7
1114 $ hg revert sub2/large7
1114 $ hg revert sub2/large7
1115 $ hg -q update --clean -r null
1115 $ hg -q update --clean -r null
1116 $ hg update --clean
1116 $ hg update --clean
1117 getting changed largefiles
1117 getting changed largefiles
1118 3 largefiles updated, 0 removed
1118 3 largefiles updated, 0 removed
1119 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1119 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1120 $ cat normal3
1120 $ cat normal3
1121 normal3-modified
1121 normal3-modified
1122 $ cat sub/normal4
1122 $ cat sub/normal4
1123 normal4-modified
1123 normal4-modified
1124 $ cat sub/large4
1124 $ cat sub/large4
1125 large4-modified
1125 large4-modified
1126 $ cat sub2/large6
1126 $ cat sub2/large6
1127 large6-modified
1127 large6-modified
1128 $ cat sub2/large7
1128 $ cat sub2/large7
1129 large7
1129 large7
1130 $ cat sub2/large7.orig
1130 $ cat sub2/large7.orig
1131 mistake
1131 mistake
1132 $ cat .hglf/sub2/large7.orig
1132 $ cat .hglf/sub2/large7.orig
1133 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1133 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31
1134
1134
1135 demonstrate misfeature: .orig file is overwritten on every update -C,
1135 demonstrate misfeature: .orig file is overwritten on every update -C,
1136 also when clean:
1136 also when clean:
1137 $ hg update --clean
1137 $ hg update --clean
1138 getting changed largefiles
1138 getting changed largefiles
1139 0 largefiles updated, 0 removed
1139 0 largefiles updated, 0 removed
1140 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1140 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1141 $ cat sub2/large7.orig
1141 $ cat sub2/large7.orig
1142 large7
1142 large7
1143 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1143 $ rm sub2/large7.orig .hglf/sub2/large7.orig
1144
1144
1145 Now "update check" is happy.
1145 Now "update check" is happy.
1146 $ hg update --check 8
1146 $ hg update --check 8
1147 getting changed largefiles
1147 getting changed largefiles
1148 1 largefiles updated, 0 removed
1148 1 largefiles updated, 0 removed
1149 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1149 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1150 $ hg update --check
1150 $ hg update --check
1151 getting changed largefiles
1151 getting changed largefiles
1152 1 largefiles updated, 0 removed
1152 1 largefiles updated, 0 removed
1153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1153 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1154
1154
1155 Test removing empty largefiles directories on update
1155 Test removing empty largefiles directories on update
1156 $ test -d sub2 && echo "sub2 exists"
1156 $ test -d sub2 && echo "sub2 exists"
1157 sub2 exists
1157 sub2 exists
1158 $ hg update -q null
1158 $ hg update -q null
1159 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1159 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1160 [1]
1160 [1]
1161 $ hg update -q
1161 $ hg update -q
1162
1162
1163 Test hg remove removes empty largefiles directories
1163 Test hg remove removes empty largefiles directories
1164 $ test -d sub2 && echo "sub2 exists"
1164 $ test -d sub2 && echo "sub2 exists"
1165 sub2 exists
1165 sub2 exists
1166 $ hg remove sub2/*
1166 $ hg remove sub2/*
1167 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1167 $ test -d sub2 && echo "error: sub2 should not exist anymore"
1168 [1]
1168 [1]
1169 $ hg revert sub2/large6 sub2/large7
1169 $ hg revert sub2/large6 sub2/large7
1170
1170
1171 "revert" works on largefiles (and normal files too).
1171 "revert" works on largefiles (and normal files too).
1172 $ echo hack3 >> normal3
1172 $ echo hack3 >> normal3
1173 $ echo hack4 >> sub/normal4
1173 $ echo hack4 >> sub/normal4
1174 $ echo hack4 >> sub/large4
1174 $ echo hack4 >> sub/large4
1175 $ rm sub2/large6
1175 $ rm sub2/large6
1176 $ hg revert sub2/large6
1176 $ hg revert sub2/large6
1177 $ hg rm sub2/large6
1177 $ hg rm sub2/large6
1178 $ echo new >> sub2/large8
1178 $ echo new >> sub2/large8
1179 $ hg add --large sub2/large8
1179 $ hg add --large sub2/large8
1180 # XXX we don't really want to report that we're reverting the standin;
1180 # XXX we don't really want to report that we're reverting the standin;
1181 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1181 # that's just an implementation detail. But I don't see an obvious fix. ;-(
1182 $ hg revert sub
1182 $ hg revert sub
1183 reverting .hglf/sub/large4 (glob)
1183 reverting .hglf/sub/large4 (glob)
1184 reverting sub/normal4 (glob)
1184 reverting sub/normal4 (glob)
1185 $ hg status
1185 $ hg status
1186 M normal3
1186 M normal3
1187 A sub2/large8
1187 A sub2/large8
1188 R sub2/large6
1188 R sub2/large6
1189 ? sub/large4.orig
1189 ? sub/large4.orig
1190 ? sub/normal4.orig
1190 ? sub/normal4.orig
1191 $ cat sub/normal4
1191 $ cat sub/normal4
1192 normal4-modified
1192 normal4-modified
1193 $ cat sub/large4
1193 $ cat sub/large4
1194 large4-modified
1194 large4-modified
1195 $ hg revert -a --no-backup
1195 $ hg revert -a --no-backup
1196 undeleting .hglf/sub2/large6 (glob)
1196 undeleting .hglf/sub2/large6 (glob)
1197 forgetting .hglf/sub2/large8 (glob)
1197 forgetting .hglf/sub2/large8 (glob)
1198 reverting normal3
1198 reverting normal3
1199 $ hg status
1199 $ hg status
1200 ? sub/large4.orig
1200 ? sub/large4.orig
1201 ? sub/normal4.orig
1201 ? sub/normal4.orig
1202 ? sub2/large8
1202 ? sub2/large8
1203 $ cat normal3
1203 $ cat normal3
1204 normal3-modified
1204 normal3-modified
1205 $ cat sub2/large6
1205 $ cat sub2/large6
1206 large6-modified
1206 large6-modified
1207 $ rm sub/*.orig sub2/large8
1207 $ rm sub/*.orig sub2/large8
1208
1208
1209 revert some files to an older revision
1209 revert some files to an older revision
1210 $ hg revert --no-backup -r 8 sub2
1210 $ hg revert --no-backup -r 8 sub2
1211 reverting .hglf/sub2/large6 (glob)
1211 reverting .hglf/sub2/large6 (glob)
1212 $ cat sub2/large6
1212 $ cat sub2/large6
1213 large6
1213 large6
1214 $ hg revert --no-backup -C -r '.^' sub2
1214 $ hg revert --no-backup -C -r '.^' sub2
1215 reverting .hglf/sub2/large6 (glob)
1215 reverting .hglf/sub2/large6 (glob)
1216 $ hg revert --no-backup sub2
1216 $ hg revert --no-backup sub2
1217 reverting .hglf/sub2/large6 (glob)
1217 reverting .hglf/sub2/large6 (glob)
1218 $ hg status
1218 $ hg status
1219
1219
1220 "verify --large" actually verifies largefiles
1220 "verify --large" actually verifies largefiles
1221
1221
1222 - Where Do We Come From? What Are We? Where Are We Going?
1222 - Where Do We Come From? What Are We? Where Are We Going?
1223 $ pwd
1223 $ pwd
1224 $TESTTMP/e
1224 $TESTTMP/e
1225 $ hg paths
1225 $ hg paths
1226 default = $TESTTMP/d (glob)
1226 default = $TESTTMP/d (glob)
1227
1227
1228 $ hg verify --large
1228 $ hg verify --large
1229 checking changesets
1229 checking changesets
1230 checking manifests
1230 checking manifests
1231 crosschecking files in changesets and manifests
1231 crosschecking files in changesets and manifests
1232 checking files
1232 checking files
1233 10 files, 10 changesets, 28 total revisions
1233 10 files, 10 changesets, 28 total revisions
1234 searching 1 changesets for largefiles
1234 searching 1 changesets for largefiles
1235 verified existence of 3 revisions of 3 largefiles
1235 verified existence of 3 revisions of 3 largefiles
1236
1236
1237 - introduce missing blob in local store repo and make sure that this is caught:
1237 - introduce missing blob in local store repo and make sure that this is caught:
1238 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1238 $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 .
1239 $ hg verify --large
1239 $ hg verify --large
1240 checking changesets
1240 checking changesets
1241 checking manifests
1241 checking manifests
1242 crosschecking files in changesets and manifests
1242 crosschecking files in changesets and manifests
1243 checking files
1243 checking files
1244 10 files, 10 changesets, 28 total revisions
1244 10 files, 10 changesets, 28 total revisions
1245 searching 1 changesets for largefiles
1245 searching 1 changesets for largefiles
1246 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1246 changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1247 verified existence of 3 revisions of 3 largefiles
1247 verified existence of 3 revisions of 3 largefiles
1248 [1]
1248 [1]
1249
1249
1250 - introduce corruption and make sure that it is caught when checking content:
1250 - introduce corruption and make sure that it is caught when checking content:
1251 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1251 $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928
1252 $ hg verify -q --large --lfc
1252 $ hg verify -q --large --lfc
1253 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1253 changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob)
1254 [1]
1254 [1]
1255
1255
1256 - cleanup
1256 - cleanup
1257 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1257 $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/
1258
1258
1259 - verifying all revisions will fail because we didn't clone all largefiles to d:
1259 - verifying all revisions will fail because we didn't clone all largefiles to d:
1260 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1260 $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1261 $ hg verify -q --lfa --lfc
1261 $ hg verify -q --lfa --lfc
1262 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1262 changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob)
1263 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1263 changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob)
1264 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1264 changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob)
1265 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1265 changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1266 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1266 changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1267 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1267 changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1268 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1268 changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob)
1269 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1269 changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob)
1270 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1270 changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob)
1271 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1271 changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob)
1272 [1]
1272 [1]
1273
1273
1274 - cleanup
1274 - cleanup
1275 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1275 $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4
1276 $ rm -f .hglf/sub/*.orig
1276 $ rm -f .hglf/sub/*.orig
1277
1277
1278 Update to revision with missing largefile - and make sure it really is missing
1278 Update to revision with missing largefile - and make sure it really is missing
1279
1279
1280 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1280 $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0
1281 $ hg up -r 6
1281 $ hg up -r 6
1282 getting changed largefiles
1282 getting changed largefiles
1283 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1283 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1284 1 largefiles updated, 2 removed
1284 1 largefiles updated, 2 removed
1285 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1285 4 files updated, 0 files merged, 2 files removed, 0 files unresolved
1286 $ rm normal3
1286 $ rm normal3
1287 $ echo >> sub/normal4
1287 $ echo >> sub/normal4
1288 $ hg ci -m 'commit with missing files'
1288 $ hg ci -m 'commit with missing files'
1289 Invoking status precommit hook
1289 Invoking status precommit hook
1290 M sub/normal4
1290 M sub/normal4
1291 ! large3
1291 ! large3
1292 ! normal3
1292 ! normal3
1293 created new head
1293 created new head
1294 $ hg st
1294 $ hg st
1295 ! large3
1295 ! large3
1296 ! normal3
1296 ! normal3
1297 $ hg up -r.
1297 $ hg up -r.
1298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1298 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1299 $ hg st
1299 $ hg st
1300 ! large3
1300 ! large3
1301 ! normal3
1301 ! normal3
1302 $ hg up -Cr.
1302 $ hg up -Cr.
1303 getting changed largefiles
1303 getting changed largefiles
1304 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1304 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1305 0 largefiles updated, 0 removed
1305 0 largefiles updated, 0 removed
1306 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1306 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1307 $ hg st
1307 $ hg st
1308 ! large3
1308 ! large3
1309 $ hg rollback
1309 $ hg rollback
1310 repository tip rolled back to revision 9 (undo commit)
1310 repository tip rolled back to revision 9 (undo commit)
1311 working directory now based on revision 6
1311 working directory now based on revision 6
1312
1312
1313 Merge with revision with missing largefile - and make sure it tries to fetch it.
1313 Merge with revision with missing largefile - and make sure it tries to fetch it.
1314
1314
1315 $ hg up -Cqr null
1315 $ hg up -Cqr null
1316 $ echo f > f
1316 $ echo f > f
1317 $ hg ci -Am branch
1317 $ hg ci -Am branch
1318 adding f
1318 adding f
1319 Invoking status precommit hook
1319 Invoking status precommit hook
1320 A f
1320 A f
1321 created new head
1321 created new head
1322 $ hg merge -r 6
1322 $ hg merge -r 6
1323 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1323 4 files updated, 0 files merged, 0 files removed, 0 files unresolved
1324 (branch merge, don't forget to commit)
1324 (branch merge, don't forget to commit)
1325 getting changed largefiles
1325 getting changed largefiles
1326 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1326 large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file://$TESTTMP/d (glob)
1327 1 largefiles updated, 0 removed
1327 1 largefiles updated, 0 removed
1328
1328
1329 $ hg rollback -q
1329 $ hg rollback -q
1330 $ hg up -Cq
1330 $ hg up -Cq
1331
1331
1332 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1332 Pulling 0 revisions with --all-largefiles should not fetch for all revisions
1333
1333
1334 $ hg pull --all-largefiles
1334 $ hg pull --all-largefiles
1335 pulling from $TESTTMP/d (glob)
1335 pulling from $TESTTMP/d (glob)
1336 searching for changes
1336 searching for changes
1337 no changes found
1337 no changes found
1338
1338
1339 Merging does not revert to old versions of largefiles and also check
1339 Merging does not revert to old versions of largefiles and also check
1340 that merging after having pulled from a non-default remote works
1340 that merging after having pulled from a non-default remote works
1341 correctly.
1341 correctly.
1342
1342
1343 $ cd ..
1343 $ cd ..
1344 $ hg clone -r 7 e temp
1344 $ hg clone -r 7 e temp
1345 adding changesets
1345 adding changesets
1346 adding manifests
1346 adding manifests
1347 adding file changes
1347 adding file changes
1348 added 8 changesets with 24 changes to 10 files
1348 added 8 changesets with 24 changes to 10 files
1349 updating to branch default
1349 updating to branch default
1350 getting changed largefiles
1350 getting changed largefiles
1351 3 largefiles updated, 0 removed
1351 3 largefiles updated, 0 removed
1352 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1352 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1353 $ hg clone temp f
1353 $ hg clone temp f
1354 updating to branch default
1354 updating to branch default
1355 getting changed largefiles
1355 getting changed largefiles
1356 3 largefiles updated, 0 removed
1356 3 largefiles updated, 0 removed
1357 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1357 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1358 # Delete the largefiles in the largefiles system cache so that we have an
1358 # Delete the largefiles in the largefiles system cache so that we have an
1359 # opportunity to test that caching after a pull works.
1359 # opportunity to test that caching after a pull works.
1360 $ rm "${USERCACHE}"/*
1360 $ rm "${USERCACHE}"/*
1361 $ cd f
1361 $ cd f
1362 $ echo "large4-merge-test" > sub/large4
1362 $ echo "large4-merge-test" > sub/large4
1363 $ hg commit -m "Modify large4 to test merge"
1363 $ hg commit -m "Modify large4 to test merge"
1364 Invoking status precommit hook
1364 Invoking status precommit hook
1365 M sub/large4
1365 M sub/large4
1366 # Test --cache-largefiles flag
1366 # Test --cache-largefiles flag
1367 $ hg pull --lfrev 'heads(pulled())' ../e
1367 $ hg pull --lfrev 'heads(pulled())' ../e
1368 pulling from ../e
1368 pulling from ../e
1369 searching for changes
1369 searching for changes
1370 adding changesets
1370 adding changesets
1371 adding manifests
1371 adding manifests
1372 adding file changes
1372 adding file changes
1373 added 2 changesets with 4 changes to 4 files (+1 heads)
1373 added 2 changesets with 4 changes to 4 files (+1 heads)
1374 (run 'hg heads' to see heads, 'hg merge' to merge)
1374 (run 'hg heads' to see heads, 'hg merge' to merge)
1375 2 largefiles cached
1375 2 largefiles cached
1376 $ hg merge
1376 $ hg merge
1377 largefile sub/large4 has a merge conflict
1377 largefile sub/large4 has a merge conflict
1378 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1378 ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591
1379 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1379 keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or
1380 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1380 take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l
1381 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1381 3 files updated, 1 files merged, 0 files removed, 0 files unresolved
1382 (branch merge, don't forget to commit)
1382 (branch merge, don't forget to commit)
1383 getting changed largefiles
1383 getting changed largefiles
1384 1 largefiles updated, 0 removed
1384 1 largefiles updated, 0 removed
1385 $ hg commit -m "Merge repos e and f"
1385 $ hg commit -m "Merge repos e and f"
1386 Invoking status precommit hook
1386 Invoking status precommit hook
1387 M normal3
1387 M normal3
1388 M sub/normal4
1388 M sub/normal4
1389 M sub2/large6
1389 M sub2/large6
1390 $ cat normal3
1390 $ cat normal3
1391 normal3-modified
1391 normal3-modified
1392 $ cat sub/normal4
1392 $ cat sub/normal4
1393 normal4-modified
1393 normal4-modified
1394 $ cat sub/large4
1394 $ cat sub/large4
1395 large4-merge-test
1395 large4-merge-test
1396 $ cat sub2/large6
1396 $ cat sub2/large6
1397 large6-modified
1397 large6-modified
1398 $ cat sub2/large7
1398 $ cat sub2/large7
1399 large7
1399 large7
1400
1400
1401 Test status after merging with a branch that introduces a new largefile:
1401 Test status after merging with a branch that introduces a new largefile:
1402
1402
1403 $ echo large > large
1403 $ echo large > large
1404 $ hg add --large large
1404 $ hg add --large large
1405 $ hg commit -m 'add largefile'
1405 $ hg commit -m 'add largefile'
1406 Invoking status precommit hook
1406 Invoking status precommit hook
1407 A large
1407 A large
1408 $ hg update -q ".^"
1408 $ hg update -q ".^"
1409 $ echo change >> normal3
1409 $ echo change >> normal3
1410 $ hg commit -m 'some change'
1410 $ hg commit -m 'some change'
1411 Invoking status precommit hook
1411 Invoking status precommit hook
1412 M normal3
1412 M normal3
1413 created new head
1413 created new head
1414 $ hg merge
1414 $ hg merge
1415 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1415 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1416 (branch merge, don't forget to commit)
1416 (branch merge, don't forget to commit)
1417 getting changed largefiles
1417 getting changed largefiles
1418 1 largefiles updated, 0 removed
1418 1 largefiles updated, 0 removed
1419 $ hg status
1419 $ hg status
1420 M large
1420 M large
1421
1421
1422 - make sure update of merge with removed largefiles fails as expected
1422 - make sure update of merge with removed largefiles fails as expected
1423 $ hg rm sub2/large6
1423 $ hg rm sub2/large6
1424 $ hg up -r.
1424 $ hg up -r.
1425 abort: outstanding uncommitted merges
1425 abort: outstanding uncommitted merges
1426 [255]
1426 [255]
1427
1427
1428 - revert should be able to revert files introduced in a pending merge
1428 - revert should be able to revert files introduced in a pending merge
1429 $ hg revert --all -r .
1429 $ hg revert --all -r .
1430 removing .hglf/large (glob)
1430 removing .hglf/large (glob)
1431 undeleting .hglf/sub2/large6 (glob)
1431 undeleting .hglf/sub2/large6 (glob)
1432
1432
1433 Test that a normal file and a largefile with the same name and path cannot
1433 Test that a normal file and a largefile with the same name and path cannot
1434 coexist.
1434 coexist.
1435
1435
1436 $ rm sub2/large7
1436 $ rm sub2/large7
1437 $ echo "largeasnormal" > sub2/large7
1437 $ echo "largeasnormal" > sub2/large7
1438 $ hg add sub2/large7
1438 $ hg add sub2/large7
1439 sub2/large7 already a largefile
1439 sub2/large7 already a largefile
1440
1440
1441 Test that transplanting a largefile change works correctly.
1441 Test that transplanting a largefile change works correctly.
1442
1442
1443 $ cd ..
1443 $ cd ..
1444 $ hg clone -r 8 d g
1444 $ hg clone -r 8 d g
1445 adding changesets
1445 adding changesets
1446 adding manifests
1446 adding manifests
1447 adding file changes
1447 adding file changes
1448 added 9 changesets with 26 changes to 10 files
1448 added 9 changesets with 26 changes to 10 files
1449 updating to branch default
1449 updating to branch default
1450 getting changed largefiles
1450 getting changed largefiles
1451 3 largefiles updated, 0 removed
1451 3 largefiles updated, 0 removed
1452 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1452 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1453 $ cd g
1453 $ cd g
1454 $ hg transplant -s ../d 598410d3eb9a
1454 $ hg transplant -s ../d 598410d3eb9a
1455 searching for changes
1455 searching for changes
1456 searching for changes
1456 searching for changes
1457 adding changesets
1457 adding changesets
1458 adding manifests
1458 adding manifests
1459 adding file changes
1459 adding file changes
1460 added 1 changesets with 2 changes to 2 files
1460 added 1 changesets with 2 changes to 2 files
1461 getting changed largefiles
1461 getting changed largefiles
1462 1 largefiles updated, 0 removed
1462 1 largefiles updated, 0 removed
1463 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1463 $ hg log --template '{rev}:{node|short} {desc|firstline}\n'
1464 9:598410d3eb9a modify normal file largefile in repo d
1464 9:598410d3eb9a modify normal file largefile in repo d
1465 8:a381d2c8c80e modify normal file and largefile in repo b
1465 8:a381d2c8c80e modify normal file and largefile in repo b
1466 7:daea875e9014 add/edit more largefiles
1466 7:daea875e9014 add/edit more largefiles
1467 6:4355d653f84f edit files yet again
1467 6:4355d653f84f edit files yet again
1468 5:9d5af5072dbd edit files again
1468 5:9d5af5072dbd edit files again
1469 4:74c02385b94c move files
1469 4:74c02385b94c move files
1470 3:9e8fbc4bce62 copy files
1470 3:9e8fbc4bce62 copy files
1471 2:51a0ae4d5864 remove files
1471 2:51a0ae4d5864 remove files
1472 1:ce8896473775 edit files
1472 1:ce8896473775 edit files
1473 0:30d30fe6a5be add files
1473 0:30d30fe6a5be add files
1474 $ cat normal3
1474 $ cat normal3
1475 normal3-modified
1475 normal3-modified
1476 $ cat sub/normal4
1476 $ cat sub/normal4
1477 normal4-modified
1477 normal4-modified
1478 $ cat sub/large4
1478 $ cat sub/large4
1479 large4-modified
1479 large4-modified
1480 $ cat sub2/large6
1480 $ cat sub2/large6
1481 large6-modified
1481 large6-modified
1482 $ cat sub2/large7
1482 $ cat sub2/large7
1483 large7
1483 large7
1484
1484
1485 Cat a largefile
1485 Cat a largefile
1486 $ hg cat normal3
1486 $ hg cat normal3
1487 normal3-modified
1487 normal3-modified
1488 $ hg cat sub/large4
1488 $ hg cat sub/large4
1489 large4-modified
1489 large4-modified
1490 $ rm "${USERCACHE}"/*
1490 $ rm "${USERCACHE}"/*
1491 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1491 $ hg cat -r a381d2c8c80e -o cat.out sub/large4
1492 $ cat cat.out
1492 $ cat cat.out
1493 large4-modified
1493 large4-modified
1494 $ rm cat.out
1494 $ rm cat.out
1495 $ hg cat -r a381d2c8c80e normal3
1495 $ hg cat -r a381d2c8c80e normal3
1496 normal3-modified
1496 normal3-modified
1497 $ hg cat -r '.^' normal3
1497 $ hg cat -r '.^' normal3
1498 normal3-modified
1498 normal3-modified
1499 $ hg cat -r '.^' sub/large4 doesntexist
1499 $ hg cat -r '.^' sub/large4 doesntexist
1500 large4-modified
1500 large4-modified
1501 doesntexist: no such file in rev a381d2c8c80e
1501 doesntexist: no such file in rev a381d2c8c80e
1502 $ hg --cwd sub cat -r '.^' large4
1502 $ hg --cwd sub cat -r '.^' large4
1503 large4-modified
1503 large4-modified
1504 $ hg --cwd sub cat -r '.^' ../normal3
1504 $ hg --cwd sub cat -r '.^' ../normal3
1505 normal3-modified
1505 normal3-modified
1506
1506
1507 Test that renaming a largefile results in correct output for status
1507 Test that renaming a largefile results in correct output for status
1508
1508
1509 $ hg rename sub/large4 large4-renamed
1509 $ hg rename sub/large4 large4-renamed
1510 $ hg commit -m "test rename output"
1510 $ hg commit -m "test rename output"
1511 Invoking status precommit hook
1511 Invoking status precommit hook
1512 A large4-renamed
1512 A large4-renamed
1513 R sub/large4
1513 R sub/large4
1514 $ cat large4-renamed
1514 $ cat large4-renamed
1515 large4-modified
1515 large4-modified
1516 $ cd sub2
1516 $ cd sub2
1517 $ hg rename large6 large6-renamed
1517 $ hg rename large6 large6-renamed
1518 $ hg st
1518 $ hg st
1519 A sub2/large6-renamed
1519 A sub2/large6-renamed
1520 R sub2/large6
1520 R sub2/large6
1521 $ cd ..
1521 $ cd ..
1522
1522
1523 Test --normal flag
1523 Test --normal flag
1524
1524
1525 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1525 $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null
1526 $ hg add --normal --large new-largefile
1526 $ hg add --normal --large new-largefile
1527 abort: --normal cannot be used with --large
1527 abort: --normal cannot be used with --large
1528 [255]
1528 [255]
1529 $ hg add --normal new-largefile
1529 $ hg add --normal new-largefile
1530 new-largefile: up to 69 MB of RAM may be required to manage this file
1530 new-largefile: up to 69 MB of RAM may be required to manage this file
1531 (use 'hg revert new-largefile' to cancel the pending addition)
1531 (use 'hg revert new-largefile' to cancel the pending addition)
1532 $ cd ..
1532 $ cd ..
1533
1533
1534 #if serve
1534 #if serve
1535 vanilla clients not locked out from largefiles servers on vanilla repos
1535 vanilla clients not locked out from largefiles servers on vanilla repos
1536 $ mkdir r1
1536 $ mkdir r1
1537 $ cd r1
1537 $ cd r1
1538 $ hg init
1538 $ hg init
1539 $ echo c1 > f1
1539 $ echo c1 > f1
1540 $ hg add f1
1540 $ hg add f1
1541 $ hg commit -m "m1"
1541 $ hg commit -m "m1"
1542 Invoking status precommit hook
1542 Invoking status precommit hook
1543 A f1
1543 A f1
1544 $ cd ..
1544 $ cd ..
1545 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1545 $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid
1546 $ cat hg.pid >> $DAEMON_PIDS
1546 $ cat hg.pid >> $DAEMON_PIDS
1547 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1547 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2
1548 requesting all changes
1548 requesting all changes
1549 adding changesets
1549 adding changesets
1550 adding manifests
1550 adding manifests
1551 adding file changes
1551 adding file changes
1552 added 1 changesets with 1 changes to 1 files
1552 added 1 changesets with 1 changes to 1 files
1553 updating to branch default
1553 updating to branch default
1554 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1554 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1555
1555
1556 largefiles clients still work with vanilla servers
1556 largefiles clients still work with vanilla servers
1557 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1557 $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid
1558 $ cat hg.pid >> $DAEMON_PIDS
1558 $ cat hg.pid >> $DAEMON_PIDS
1559 $ hg clone http://localhost:$HGPORT1 r3
1559 $ hg clone http://localhost:$HGPORT1 r3
1560 requesting all changes
1560 requesting all changes
1561 adding changesets
1561 adding changesets
1562 adding manifests
1562 adding manifests
1563 adding file changes
1563 adding file changes
1564 added 1 changesets with 1 changes to 1 files
1564 added 1 changesets with 1 changes to 1 files
1565 updating to branch default
1565 updating to branch default
1566 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1566 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1567 #endif
1567 #endif
1568
1568
1569
1569
1570 vanilla clients locked out from largefiles http repos
1570 vanilla clients locked out from largefiles http repos
1571 $ mkdir r4
1571 $ mkdir r4
1572 $ cd r4
1572 $ cd r4
1573 $ hg init
1573 $ hg init
1574 $ echo c1 > f1
1574 $ echo c1 > f1
1575 $ hg add --large f1
1575 $ hg add --large f1
1576 $ hg commit -m "m1"
1576 $ hg commit -m "m1"
1577 Invoking status precommit hook
1577 Invoking status precommit hook
1578 A f1
1578 A f1
1579 $ cd ..
1579 $ cd ..
1580
1580
1581 largefiles can be pushed locally (issue3583)
1581 largefiles can be pushed locally (issue3583)
1582 $ hg init dest
1582 $ hg init dest
1583 $ cd r4
1583 $ cd r4
1584 $ hg outgoing ../dest
1584 $ hg outgoing ../dest
1585 comparing with ../dest
1585 comparing with ../dest
1586 searching for changes
1586 searching for changes
1587 changeset: 0:639881c12b4c
1587 changeset: 0:639881c12b4c
1588 tag: tip
1588 tag: tip
1589 user: test
1589 user: test
1590 date: Thu Jan 01 00:00:00 1970 +0000
1590 date: Thu Jan 01 00:00:00 1970 +0000
1591 summary: m1
1591 summary: m1
1592
1592
1593 $ hg push ../dest
1593 $ hg push ../dest
1594 pushing to ../dest
1594 pushing to ../dest
1595 searching for changes
1595 searching for changes
1596 searching for changes
1596 searching for changes
1597 adding changesets
1597 adding changesets
1598 adding manifests
1598 adding manifests
1599 adding file changes
1599 adding file changes
1600 added 1 changesets with 1 changes to 1 files
1600 added 1 changesets with 1 changes to 1 files
1601
1601
1602 exit code with nothing outgoing (issue3611)
1602 exit code with nothing outgoing (issue3611)
1603 $ hg outgoing ../dest
1603 $ hg outgoing ../dest
1604 comparing with ../dest
1604 comparing with ../dest
1605 searching for changes
1605 searching for changes
1606 no changes found
1606 no changes found
1607 [1]
1607 [1]
1608 $ cd ..
1608 $ cd ..
1609
1609
1610 #if serve
1610 #if serve
1611 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1611 $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
1612 $ cat hg.pid >> $DAEMON_PIDS
1612 $ cat hg.pid >> $DAEMON_PIDS
1613 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1613 $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
1614 abort: remote error:
1614 abort: remote error:
1615
1615
1616 This repository uses the largefiles extension.
1616 This repository uses the largefiles extension.
1617
1617
1618 Please enable it in your Mercurial config file.
1618 Please enable it in your Mercurial config file.
1619 [255]
1619 [255]
1620
1620
1621 used all HGPORTs, kill all daemons
1621 used all HGPORTs, kill all daemons
1622 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1622 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1623 #endif
1623 #endif
1624
1624
1625 vanilla clients locked out from largefiles ssh repos
1625 vanilla clients locked out from largefiles ssh repos
1626 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1626 $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
1627 abort: remote error:
1627 abort: remote error:
1628
1628
1629 This repository uses the largefiles extension.
1629 This repository uses the largefiles extension.
1630
1630
1631 Please enable it in your Mercurial config file.
1631 Please enable it in your Mercurial config file.
1632 [255]
1632 [255]
1633
1633
1634 #if serve
1634 #if serve
1635
1635
1636 largefiles clients refuse to push largefiles repos to vanilla servers
1636 largefiles clients refuse to push largefiles repos to vanilla servers
1637 $ mkdir r6
1637 $ mkdir r6
1638 $ cd r6
1638 $ cd r6
1639 $ hg init
1639 $ hg init
1640 $ echo c1 > f1
1640 $ echo c1 > f1
1641 $ hg add f1
1641 $ hg add f1
1642 $ hg commit -m "m1"
1642 $ hg commit -m "m1"
1643 Invoking status precommit hook
1643 Invoking status precommit hook
1644 A f1
1644 A f1
1645 $ cat >> .hg/hgrc <<!
1645 $ cat >> .hg/hgrc <<!
1646 > [web]
1646 > [web]
1647 > push_ssl = false
1647 > push_ssl = false
1648 > allow_push = *
1648 > allow_push = *
1649 > !
1649 > !
1650 $ cd ..
1650 $ cd ..
1651 $ hg clone r6 r7
1651 $ hg clone r6 r7
1652 updating to branch default
1652 updating to branch default
1653 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1653 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1654 $ cd r7
1654 $ cd r7
1655 $ echo c2 > f2
1655 $ echo c2 > f2
1656 $ hg add --large f2
1656 $ hg add --large f2
1657 $ hg commit -m "m2"
1657 $ hg commit -m "m2"
1658 Invoking status precommit hook
1658 Invoking status precommit hook
1659 A f2
1659 A f2
1660 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1660 $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid
1661 $ cat ../hg.pid >> $DAEMON_PIDS
1661 $ cat ../hg.pid >> $DAEMON_PIDS
1662 $ hg push http://localhost:$HGPORT
1662 $ hg push http://localhost:$HGPORT
1663 pushing to http://localhost:$HGPORT/
1663 pushing to http://localhost:$HGPORT/
1664 searching for changes
1664 searching for changes
1665 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1665 abort: http://localhost:$HGPORT/ does not appear to be a largefile store
1666 [255]
1666 [255]
1667 $ cd ..
1667 $ cd ..
1668
1668
1669 putlfile errors are shown (issue3123)
1669 putlfile errors are shown (issue3123)
1670 Corrupt the cached largefile in r7 and move it out of the servers usercache
1670 Corrupt the cached largefile in r7 and move it out of the servers usercache
1671 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1671 $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 .
1672 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1672 $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1673 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1673 $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
1674 $ hg init empty
1674 $ hg init empty
1675 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1675 $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
1676 > --config 'web.allow_push=*' --config web.push_ssl=False
1676 > --config 'web.allow_push=*' --config web.push_ssl=False
1677 $ cat hg.pid >> $DAEMON_PIDS
1677 $ cat hg.pid >> $DAEMON_PIDS
1678 $ hg push -R r7 http://localhost:$HGPORT1
1678 $ hg push -R r7 http://localhost:$HGPORT1
1679 pushing to http://localhost:$HGPORT1/
1679 pushing to http://localhost:$HGPORT1/
1680 searching for changes
1680 searching for changes
1681 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1681 remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash
1682 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1682 abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob)
1683 [255]
1683 [255]
1684 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1684 $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1685 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1685 Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic
1686 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1686 $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1687 $ hg push -R r7 http://localhost:$HGPORT1
1687 $ hg push -R r7 http://localhost:$HGPORT1
1688 pushing to http://localhost:$HGPORT1/
1688 pushing to http://localhost:$HGPORT1/
1689 searching for changes
1689 searching for changes
1690 searching for changes
1690 searching for changes
1691 remote: adding changesets
1691 remote: adding changesets
1692 remote: adding manifests
1692 remote: adding manifests
1693 remote: adding file changes
1693 remote: adding file changes
1694 remote: added 2 changesets with 2 changes to 2 files
1694 remote: added 2 changesets with 2 changes to 2 files
1695 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1695 $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8
1696 server side corruption
1696 server side corruption
1697 $ rm -rf empty
1697 $ rm -rf empty
1698
1698
1699 Push a largefiles repository to a served empty repository
1699 Push a largefiles repository to a served empty repository
1700 $ hg init r8
1700 $ hg init r8
1701 $ echo c3 > r8/f1
1701 $ echo c3 > r8/f1
1702 $ hg add --large r8/f1 -R r8
1702 $ hg add --large r8/f1 -R r8
1703 $ hg commit -m "m1" -R r8
1703 $ hg commit -m "m1" -R r8
1704 Invoking status precommit hook
1704 Invoking status precommit hook
1705 A f1
1705 A f1
1706 $ hg init empty
1706 $ hg init empty
1707 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1707 $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
1708 > --config 'web.allow_push=*' --config web.push_ssl=False
1708 > --config 'web.allow_push=*' --config web.push_ssl=False
1709 $ cat hg.pid >> $DAEMON_PIDS
1709 $ cat hg.pid >> $DAEMON_PIDS
1710 $ rm "${USERCACHE}"/*
1710 $ rm "${USERCACHE}"/*
1711 $ hg push -R r8 http://localhost:$HGPORT2/#default
1711 $ hg push -R r8 http://localhost:$HGPORT2/#default
1712 pushing to http://localhost:$HGPORT2/
1712 pushing to http://localhost:$HGPORT2/
1713 searching for changes
1713 searching for changes
1714 searching for changes
1714 searching for changes
1715 remote: adding changesets
1715 remote: adding changesets
1716 remote: adding manifests
1716 remote: adding manifests
1717 remote: adding file changes
1717 remote: adding file changes
1718 remote: added 1 changesets with 1 changes to 1 files
1718 remote: added 1 changesets with 1 changes to 1 files
1719 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1719 $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1720 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1720 $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1721
1721
1722 Clone over http, no largefiles pulled on clone.
1722 Clone over http, no largefiles pulled on clone.
1723
1723
1724 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1724 $ hg clone http://localhost:$HGPORT2/#default http-clone -U
1725 adding changesets
1725 adding changesets
1726 adding manifests
1726 adding manifests
1727 adding file changes
1727 adding file changes
1728 added 1 changesets with 1 changes to 1 files
1728 added 1 changesets with 1 changes to 1 files
1729
1729
1730 test 'verify' with remotestore:
1730 test 'verify' with remotestore:
1731
1731
1732 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1732 $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90
1733 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1733 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1734 $ hg -R http-clone verify --large --lfa
1734 $ hg -R http-clone verify --large --lfa
1735 checking changesets
1735 checking changesets
1736 checking manifests
1736 checking manifests
1737 crosschecking files in changesets and manifests
1737 crosschecking files in changesets and manifests
1738 checking files
1738 checking files
1739 1 files, 1 changesets, 1 total revisions
1739 1 files, 1 changesets, 1 total revisions
1740 searching 1 changesets for largefiles
1740 searching 1 changesets for largefiles
1741 changeset 0:cf03e5bb9936: f1 missing
1741 changeset 0:cf03e5bb9936: f1 missing
1742 verified existence of 1 revisions of 1 largefiles
1742 verified existence of 1 revisions of 1 largefiles
1743 [1]
1743 [1]
1744 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1744 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1745 $ hg -R http-clone -q verify --large --lfa
1745 $ hg -R http-clone -q verify --large --lfa
1746
1746
1747 largefiles pulled on update - a largefile missing on the server:
1747 largefiles pulled on update - a largefile missing on the server:
1748 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1748 $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 .
1749 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1749 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1750 getting changed largefiles
1750 getting changed largefiles
1751 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
1751 f1: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 not available from http://localhost:$HGPORT2/
1752 0 largefiles updated, 0 removed
1752 0 largefiles updated, 0 removed
1753 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1753 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1754 $ hg -R http-clone st
1754 $ hg -R http-clone st
1755 ! f1
1755 ! f1
1756 $ hg -R http-clone up -Cqr null
1756 $ hg -R http-clone up -Cqr null
1757
1757
1758 largefiles pulled on update - a largefile corrupted on the server:
1758 largefiles pulled on update - a largefile corrupted on the server:
1759 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1759 $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90
1760 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1760 $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache
1761 getting changed largefiles
1761 getting changed largefiles
1762 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1762 f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27)
1763 0 largefiles updated, 0 removed
1763 0 largefiles updated, 0 removed
1764 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1764 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1765 $ hg -R http-clone st
1765 $ hg -R http-clone st
1766 ! f1
1766 ! f1
1767 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1767 $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ]
1768 $ [ ! -f http-clone/f1 ]
1768 $ [ ! -f http-clone/f1 ]
1769 $ [ ! -f http-clone-usercache ]
1769 $ [ ! -f http-clone-usercache ]
1770 $ hg -R http-clone verify --large --lfc
1770 $ hg -R http-clone verify --large --lfc
1771 checking changesets
1771 checking changesets
1772 checking manifests
1772 checking manifests
1773 crosschecking files in changesets and manifests
1773 crosschecking files in changesets and manifests
1774 checking files
1774 checking files
1775 1 files, 1 changesets, 1 total revisions
1775 1 files, 1 changesets, 1 total revisions
1776 searching 1 changesets for largefiles
1776 searching 1 changesets for largefiles
1777 verified contents of 1 revisions of 1 largefiles
1777 verified contents of 1 revisions of 1 largefiles
1778 $ hg -R http-clone up -Cqr null
1778 $ hg -R http-clone up -Cqr null
1779
1779
1780 largefiles pulled on update - no server side problems:
1780 largefiles pulled on update - no server side problems:
1781 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1781 $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/
1782 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1782 $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache
1783 resolving manifests
1783 resolving manifests
1784 branchmerge: False, force: False, partial: False
1784 branchmerge: False, force: False, partial: False
1785 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1785 ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936
1786 .hglf/f1: remote created -> g
1786 .hglf/f1: remote created -> g
1787 getting .hglf/f1
1787 getting .hglf/f1
1788 updating: .hglf/f1 1/1 files (100.00%)
1788 updating: .hglf/f1 1/1 files (100.00%)
1789 getting changed largefiles
1789 getting changed largefiles
1790 using http://localhost:$HGPORT2/
1790 using http://localhost:$HGPORT2/
1791 sending capabilities command
1791 sending capabilities command
1792 sending batch command
1792 sending batch command
1793 getting largefiles: 0/1 lfile (0.00%)
1793 getting largefiles: 0/1 lfile (0.00%)
1794 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1794 getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90
1795 sending getlfile command
1795 sending getlfile command
1796 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1796 found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store
1797 1 largefiles updated, 0 removed
1797 1 largefiles updated, 0 removed
1798 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1798 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1799
1799
1800 $ ls http-clone-usercache/*
1800 $ ls http-clone-usercache/*
1801 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1801 http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90
1802
1802
1803 $ rm -rf empty http-clone*
1803 $ rm -rf empty http-clone*
1804
1804
1805 used all HGPORTs, kill all daemons
1805 used all HGPORTs, kill all daemons
1806 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1806 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
1807
1807
1808 #endif
1808 #endif
1809
1809
1810
1810
1811 #if unix-permissions
1811 #if unix-permissions
1812
1812
1813 Clone a local repository owned by another user
1813 Clone a local repository owned by another user
1814 We have to simulate that here by setting $HOME and removing write permissions
1814 We have to simulate that here by setting $HOME and removing write permissions
1815 $ ORIGHOME="$HOME"
1815 $ ORIGHOME="$HOME"
1816 $ mkdir alice
1816 $ mkdir alice
1817 $ HOME="`pwd`/alice"
1817 $ HOME="`pwd`/alice"
1818 $ cd alice
1818 $ cd alice
1819 $ hg init pubrepo
1819 $ hg init pubrepo
1820 $ cd pubrepo
1820 $ cd pubrepo
1821 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1821 $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null
1822 $ hg add --large a-large-file
1822 $ hg add --large a-large-file
1823 $ hg commit -m "Add a large file"
1823 $ hg commit -m "Add a large file"
1824 Invoking status precommit hook
1824 Invoking status precommit hook
1825 A a-large-file
1825 A a-large-file
1826 $ cd ..
1826 $ cd ..
1827 $ chmod -R a-w pubrepo
1827 $ chmod -R a-w pubrepo
1828 $ cd ..
1828 $ cd ..
1829 $ mkdir bob
1829 $ mkdir bob
1830 $ HOME="`pwd`/bob"
1830 $ HOME="`pwd`/bob"
1831 $ cd bob
1831 $ cd bob
1832 $ hg clone --pull ../alice/pubrepo pubrepo
1832 $ hg clone --pull ../alice/pubrepo pubrepo
1833 requesting all changes
1833 requesting all changes
1834 adding changesets
1834 adding changesets
1835 adding manifests
1835 adding manifests
1836 adding file changes
1836 adding file changes
1837 added 1 changesets with 1 changes to 1 files
1837 added 1 changesets with 1 changes to 1 files
1838 updating to branch default
1838 updating to branch default
1839 getting changed largefiles
1839 getting changed largefiles
1840 1 largefiles updated, 0 removed
1840 1 largefiles updated, 0 removed
1841 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1841 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1842 $ cd ..
1842 $ cd ..
1843 $ chmod -R u+w alice/pubrepo
1843 $ chmod -R u+w alice/pubrepo
1844 $ HOME="$ORIGHOME"
1844 $ HOME="$ORIGHOME"
1845
1845
1846 #endif
1846 #endif
1847
1847
1848 #if symlink
1848 #if symlink
1849
1849
1850 Symlink to a large largefile should behave the same as a symlink to a normal file
1850 Symlink to a large largefile should behave the same as a symlink to a normal file
1851 $ hg init largesymlink
1851 $ hg init largesymlink
1852 $ cd largesymlink
1852 $ cd largesymlink
1853 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1853 $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null
1854 $ hg add --large largefile
1854 $ hg add --large largefile
1855 $ hg commit -m "commit a large file"
1855 $ hg commit -m "commit a large file"
1856 Invoking status precommit hook
1856 Invoking status precommit hook
1857 A largefile
1857 A largefile
1858 $ ln -s largefile largelink
1858 $ ln -s largefile largelink
1859 $ hg add largelink
1859 $ hg add largelink
1860 $ hg commit -m "commit a large symlink"
1860 $ hg commit -m "commit a large symlink"
1861 Invoking status precommit hook
1861 Invoking status precommit hook
1862 A largelink
1862 A largelink
1863 $ rm -f largelink
1863 $ rm -f largelink
1864 $ hg up >/dev/null
1864 $ hg up >/dev/null
1865 $ test -f largelink
1865 $ test -f largelink
1866 [1]
1866 [1]
1867 $ test -L largelink
1867 $ test -L largelink
1868 [1]
1868 [1]
1869 $ rm -f largelink # make next part of the test independent of the previous
1869 $ rm -f largelink # make next part of the test independent of the previous
1870 $ hg up -C >/dev/null
1870 $ hg up -C >/dev/null
1871 $ test -f largelink
1871 $ test -f largelink
1872 $ test -L largelink
1872 $ test -L largelink
1873 $ cd ..
1873 $ cd ..
1874
1874
1875 #endif
1875 #endif
1876
1876
1877 test for pattern matching on 'hg status':
1877 test for pattern matching on 'hg status':
1878 to boost performance, largefiles checks whether specified patterns are
1878 to boost performance, largefiles checks whether specified patterns are
1879 related to largefiles in working directory (NOT to STANDIN) or not.
1879 related to largefiles in working directory (NOT to STANDIN) or not.
1880
1880
1881 $ hg init statusmatch
1881 $ hg init statusmatch
1882 $ cd statusmatch
1882 $ cd statusmatch
1883
1883
1884 $ mkdir -p a/b/c/d
1884 $ mkdir -p a/b/c/d
1885 $ echo normal > a/b/c/d/e.normal.txt
1885 $ echo normal > a/b/c/d/e.normal.txt
1886 $ hg add a/b/c/d/e.normal.txt
1886 $ hg add a/b/c/d/e.normal.txt
1887 $ echo large > a/b/c/d/e.large.txt
1887 $ echo large > a/b/c/d/e.large.txt
1888 $ hg add --large a/b/c/d/e.large.txt
1888 $ hg add --large a/b/c/d/e.large.txt
1889 $ mkdir -p a/b/c/x
1889 $ mkdir -p a/b/c/x
1890 $ echo normal > a/b/c/x/y.normal.txt
1890 $ echo normal > a/b/c/x/y.normal.txt
1891 $ hg add a/b/c/x/y.normal.txt
1891 $ hg add a/b/c/x/y.normal.txt
1892 $ hg commit -m 'add files'
1892 $ hg commit -m 'add files'
1893 Invoking status precommit hook
1893 Invoking status precommit hook
1894 A a/b/c/d/e.large.txt
1894 A a/b/c/d/e.large.txt
1895 A a/b/c/d/e.normal.txt
1895 A a/b/c/d/e.normal.txt
1896 A a/b/c/x/y.normal.txt
1896 A a/b/c/x/y.normal.txt
1897
1897
1898 (1) no pattern: no performance boost
1898 (1) no pattern: no performance boost
1899 $ hg status -A
1899 $ hg status -A
1900 C a/b/c/d/e.large.txt
1900 C a/b/c/d/e.large.txt
1901 C a/b/c/d/e.normal.txt
1901 C a/b/c/d/e.normal.txt
1902 C a/b/c/x/y.normal.txt
1902 C a/b/c/x/y.normal.txt
1903
1903
1904 (2) pattern not related to largefiles: performance boost
1904 (2) pattern not related to largefiles: performance boost
1905 $ hg status -A a/b/c/x
1905 $ hg status -A a/b/c/x
1906 C a/b/c/x/y.normal.txt
1906 C a/b/c/x/y.normal.txt
1907
1907
1908 (3) pattern related to largefiles: no performance boost
1908 (3) pattern related to largefiles: no performance boost
1909 $ hg status -A a/b/c/d
1909 $ hg status -A a/b/c/d
1910 C a/b/c/d/e.large.txt
1910 C a/b/c/d/e.large.txt
1911 C a/b/c/d/e.normal.txt
1911 C a/b/c/d/e.normal.txt
1912
1912
1913 (4) pattern related to STANDIN (not to largefiles): performance boost
1913 (4) pattern related to STANDIN (not to largefiles): performance boost
1914 $ hg status -A .hglf/a
1914 $ hg status -A .hglf/a
1915 C .hglf/a/b/c/d/e.large.txt
1915 C .hglf/a/b/c/d/e.large.txt
1916
1916
1917 (5) mixed case: no performance boost
1917 (5) mixed case: no performance boost
1918 $ hg status -A a/b/c/x a/b/c/d
1918 $ hg status -A a/b/c/x a/b/c/d
1919 C a/b/c/d/e.large.txt
1919 C a/b/c/d/e.large.txt
1920 C a/b/c/d/e.normal.txt
1920 C a/b/c/d/e.normal.txt
1921 C a/b/c/x/y.normal.txt
1921 C a/b/c/x/y.normal.txt
1922
1922
1923 verify that largefiles doesn't break filesets
1923 verify that largefiles doesn't break filesets
1924
1924
1925 $ hg log --rev . --exclude "set:binary()"
1925 $ hg log --rev . --exclude "set:binary()"
1926 changeset: 0:41bd42f10efa
1926 changeset: 0:41bd42f10efa
1927 tag: tip
1927 tag: tip
1928 user: test
1928 user: test
1929 date: Thu Jan 01 00:00:00 1970 +0000
1929 date: Thu Jan 01 00:00:00 1970 +0000
1930 summary: add files
1930 summary: add files
1931
1931
1932 verify that large files in subrepos handled properly
1932 verify that large files in subrepos handled properly
1933 $ hg init subrepo
1933 $ hg init subrepo
1934 $ echo "subrepo = subrepo" > .hgsub
1934 $ echo "subrepo = subrepo" > .hgsub
1935 $ hg add .hgsub
1935 $ hg add .hgsub
1936 $ hg ci -m "add subrepo"
1936 $ hg ci -m "add subrepo"
1937 Invoking status precommit hook
1937 Invoking status precommit hook
1938 A .hgsub
1938 A .hgsub
1939 ? .hgsubstate
1939 ? .hgsubstate
1940 $ echo "rev 1" > subrepo/large.txt
1940 $ echo "rev 1" > subrepo/large.txt
1941 $ hg -R subrepo add --large subrepo/large.txt
1941 $ hg -R subrepo add --large subrepo/large.txt
1942 $ hg sum
1942 $ hg sum
1943 parent: 1:8ee150ea2e9c tip
1943 parent: 1:8ee150ea2e9c tip
1944 add subrepo
1944 add subrepo
1945 branch: default
1945 branch: default
1946 commit: 1 subrepos
1946 commit: 1 subrepos
1947 update: (current)
1947 update: (current)
1948 $ hg st
1948 $ hg st
1949 $ hg st -S
1949 $ hg st -S
1950 A subrepo/large.txt
1950 A subrepo/large.txt
1951 $ hg ci -S -m "commit top repo"
1951 $ hg ci -S -m "commit top repo"
1952 committing subrepository subrepo
1952 committing subrepository subrepo
1953 Invoking status precommit hook
1953 Invoking status precommit hook
1954 A large.txt
1954 A large.txt
1955 Invoking status precommit hook
1955 Invoking status precommit hook
1956 M .hgsubstate
1956 M .hgsubstate
1957 # No differences
1957 # No differences
1958 $ hg st -S
1958 $ hg st -S
1959 $ hg sum
1959 $ hg sum
1960 parent: 2:ce4cd0c527a6 tip
1960 parent: 2:ce4cd0c527a6 tip
1961 commit top repo
1961 commit top repo
1962 branch: default
1962 branch: default
1963 commit: (clean)
1963 commit: (clean)
1964 update: (current)
1964 update: (current)
1965 $ echo "rev 2" > subrepo/large.txt
1965 $ echo "rev 2" > subrepo/large.txt
1966 $ hg st -S
1966 $ hg st -S
1967 M subrepo/large.txt
1967 M subrepo/large.txt
1968 $ hg sum
1968 $ hg sum
1969 parent: 2:ce4cd0c527a6 tip
1969 parent: 2:ce4cd0c527a6 tip
1970 commit top repo
1970 commit top repo
1971 branch: default
1971 branch: default
1972 commit: 1 subrepos
1972 commit: 1 subrepos
1973 update: (current)
1973 update: (current)
1974 $ hg ci -m "this commit should fail without -S"
1974 $ hg ci -m "this commit should fail without -S"
1975 abort: uncommitted changes in subrepo subrepo
1975 abort: uncommitted changes in subrepo subrepo
1976 (use --subrepos for recursive commit)
1976 (use --subrepos for recursive commit)
1977 [255]
1977 [255]
1978
1978
1979 Add a normal file to the subrepo, then test archiving
1979 Add a normal file to the subrepo, then test archiving
1980
1980
1981 $ echo 'normal file' > subrepo/normal.txt
1981 $ echo 'normal file' > subrepo/normal.txt
1982 $ hg -R subrepo add subrepo/normal.txt
1982 $ hg -R subrepo add subrepo/normal.txt
1983
1983
1984 Lock in subrepo, otherwise the change isn't archived
1984 Lock in subrepo, otherwise the change isn't archived
1985
1985
1986 $ hg ci -S -m "add normal file to top level"
1986 $ hg ci -S -m "add normal file to top level"
1987 committing subrepository subrepo
1987 committing subrepository subrepo
1988 Invoking status precommit hook
1988 Invoking status precommit hook
1989 M large.txt
1989 M large.txt
1990 A normal.txt
1990 A normal.txt
1991 Invoking status precommit hook
1991 Invoking status precommit hook
1992 M .hgsubstate
1992 M .hgsubstate
1993 $ hg archive -S ../lf_subrepo_archive
1993 $ hg archive -S ../lf_subrepo_archive
1994 $ find ../lf_subrepo_archive | sort
1994 $ find ../lf_subrepo_archive | sort
1995 ../lf_subrepo_archive
1995 ../lf_subrepo_archive
1996 ../lf_subrepo_archive/.hg_archival.txt
1996 ../lf_subrepo_archive/.hg_archival.txt
1997 ../lf_subrepo_archive/.hgsub
1997 ../lf_subrepo_archive/.hgsub
1998 ../lf_subrepo_archive/.hgsubstate
1998 ../lf_subrepo_archive/.hgsubstate
1999 ../lf_subrepo_archive/a
1999 ../lf_subrepo_archive/a
2000 ../lf_subrepo_archive/a/b
2000 ../lf_subrepo_archive/a/b
2001 ../lf_subrepo_archive/a/b/c
2001 ../lf_subrepo_archive/a/b/c
2002 ../lf_subrepo_archive/a/b/c/d
2002 ../lf_subrepo_archive/a/b/c/d
2003 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2003 ../lf_subrepo_archive/a/b/c/d/e.large.txt
2004 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2004 ../lf_subrepo_archive/a/b/c/d/e.normal.txt
2005 ../lf_subrepo_archive/a/b/c/x
2005 ../lf_subrepo_archive/a/b/c/x
2006 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2006 ../lf_subrepo_archive/a/b/c/x/y.normal.txt
2007 ../lf_subrepo_archive/subrepo
2007 ../lf_subrepo_archive/subrepo
2008 ../lf_subrepo_archive/subrepo/large.txt
2008 ../lf_subrepo_archive/subrepo/large.txt
2009 ../lf_subrepo_archive/subrepo/normal.txt
2009 ../lf_subrepo_archive/subrepo/normal.txt
2010
2010
2011 Test update with subrepos.
2011 Test update with subrepos.
2012
2012
2013 $ hg update 0
2013 $ hg update 0
2014 getting changed largefiles
2014 getting changed largefiles
2015 0 largefiles updated, 1 removed
2015 0 largefiles updated, 1 removed
2016 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2016 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
2017 $ hg status -S
2017 $ hg status -S
2018 $ hg update tip
2018 $ hg update tip
2019 getting changed largefiles
2019 getting changed largefiles
2020 1 largefiles updated, 0 removed
2020 1 largefiles updated, 0 removed
2021 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2021 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2022 $ hg status -S
2022 $ hg status -S
2023 # modify a large file
2023 # modify a large file
2024 $ echo "modified" > subrepo/large.txt
2024 $ echo "modified" > subrepo/large.txt
2025 $ hg st -S
2025 $ hg st -S
2026 M subrepo/large.txt
2026 M subrepo/large.txt
2027 # update -C should revert the change.
2027 # update -C should revert the change.
2028 $ hg update -C
2028 $ hg update -C
2029 getting changed largefiles
2029 getting changed largefiles
2030 1 largefiles updated, 0 removed
2030 1 largefiles updated, 0 removed
2031 getting changed largefiles
2031 getting changed largefiles
2032 0 largefiles updated, 0 removed
2032 0 largefiles updated, 0 removed
2033 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2033 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
2034 $ hg status -S
2034 $ hg status -S
2035
2035
2036 Test archiving a revision that references a subrepo that is not yet
2036 Test archiving a revision that references a subrepo that is not yet
2037 cloned (see test-subrepo-recursion.t):
2037 cloned (see test-subrepo-recursion.t):
2038
2038
2039 $ hg clone -U . ../empty
2039 $ hg clone -U . ../empty
2040 $ cd ../empty
2040 $ cd ../empty
2041 $ hg archive --subrepos -r tip ../archive.tar.gz
2041 $ hg archive --subrepos -r tip ../archive.tar.gz
2042 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2042 cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo
2043 $ cd ..
2043 $ cd ..
2044
2044
2045 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2045 Test that addremove picks up largefiles prior to the initial commit (issue3541)
2046
2046
2047 $ hg init addrm2
2047 $ hg init addrm2
2048 $ cd addrm2
2048 $ cd addrm2
2049 $ touch large.dat
2049 $ touch large.dat
2050 $ touch large2.dat
2050 $ touch large2.dat
2051 $ touch normal
2051 $ touch normal
2052 $ hg add --large large.dat
2052 $ hg add --large large.dat
2053 $ hg addremove -v
2053 $ hg addremove -v
2054 adding large2.dat as a largefile
2054 adding large2.dat as a largefile
2055 adding normal
2055 adding normal
2056
2056
2057 Test that forgetting all largefiles reverts to islfilesrepo() == False
2057 Test that forgetting all largefiles reverts to islfilesrepo() == False
2058 (addremove will add *.dat as normal files now)
2058 (addremove will add *.dat as normal files now)
2059 $ hg forget large.dat
2059 $ hg forget large.dat
2060 $ hg forget large2.dat
2060 $ hg forget large2.dat
2061 $ hg addremove -v
2061 $ hg addremove -v
2062 adding large.dat
2062 adding large.dat
2063 adding large2.dat
2063 adding large2.dat
2064
2064
2065 Test commit's addremove option prior to the first commit
2065 Test commit's addremove option prior to the first commit
2066 $ hg forget large.dat
2066 $ hg forget large.dat
2067 $ hg forget large2.dat
2067 $ hg forget large2.dat
2068 $ hg add --large large.dat
2068 $ hg add --large large.dat
2069 $ hg ci -Am "commit"
2069 $ hg ci -Am "commit"
2070 adding large2.dat as a largefile
2070 adding large2.dat as a largefile
2071 Invoking status precommit hook
2071 Invoking status precommit hook
2072 A large.dat
2072 A large.dat
2073 A large2.dat
2073 A large2.dat
2074 A normal
2074 A normal
2075 $ find .hglf | sort
2075 $ find .hglf | sort
2076 .hglf
2076 .hglf
2077 .hglf/large.dat
2077 .hglf/large.dat
2078 .hglf/large2.dat
2078 .hglf/large2.dat
2079
2079
2080 Test actions on largefiles using relative paths from subdir
2080 Test actions on largefiles using relative paths from subdir
2081
2081
2082 $ mkdir sub
2082 $ mkdir sub
2083 $ cd sub
2083 $ cd sub
2084 $ echo anotherlarge > anotherlarge
2084 $ echo anotherlarge > anotherlarge
2085 $ hg add --large anotherlarge
2085 $ hg add --large anotherlarge
2086 $ hg st
2086 $ hg st
2087 A sub/anotherlarge
2087 A sub/anotherlarge
2088 $ hg st anotherlarge
2088 $ hg st anotherlarge
2089 A anotherlarge
2089 A anotherlarge
2090 $ hg commit -m anotherlarge anotherlarge
2090 $ hg commit -m anotherlarge anotherlarge
2091 Invoking status precommit hook
2091 Invoking status precommit hook
2092 A sub/anotherlarge
2092 A sub/anotherlarge
2093 $ hg log anotherlarge
2093 $ hg log anotherlarge
2094 changeset: 1:9627a577c5e9
2094 changeset: 1:9627a577c5e9
2095 tag: tip
2095 tag: tip
2096 user: test
2096 user: test
2097 date: Thu Jan 01 00:00:00 1970 +0000
2097 date: Thu Jan 01 00:00:00 1970 +0000
2098 summary: anotherlarge
2098 summary: anotherlarge
2099
2099
2100 $ echo more >> anotherlarge
2100 $ echo more >> anotherlarge
2101 $ hg st .
2101 $ hg st .
2102 M anotherlarge
2102 M anotherlarge
2103 $ hg cat anotherlarge
2103 $ hg cat anotherlarge
2104 anotherlarge
2104 anotherlarge
2105 $ hg revert anotherlarge
2105 $ hg revert anotherlarge
2106 $ hg st
2106 $ hg st
2107 ? sub/anotherlarge.orig
2107 ? sub/anotherlarge.orig
2108 $ cd ..
2108 $ cd ..
2109
2109
2110 $ cd ..
2110 $ cd ..
2111
2111
2112 issue3651: summary/outgoing with largefiles shows "no remote repo"
2112 issue3651: summary/outgoing with largefiles shows "no remote repo"
2113 unexpectedly
2113 unexpectedly
2114
2114
2115 $ mkdir issue3651
2115 $ mkdir issue3651
2116 $ cd issue3651
2116 $ cd issue3651
2117
2117
2118 $ hg init src
2118 $ hg init src
2119 $ echo a > src/a
2119 $ echo a > src/a
2120 $ hg -R src add --large src/a
2120 $ hg -R src add --large src/a
2121 $ hg -R src commit -m '#0'
2121 $ hg -R src commit -m '#0'
2122 Invoking status precommit hook
2122 Invoking status precommit hook
2123 A a
2123 A a
2124
2124
2125 check messages when no remote repository is specified:
2125 check messages when no remote repository is specified:
2126 "no remote repo" route for "hg outgoing --large" is not tested here,
2126 "no remote repo" route for "hg outgoing --large" is not tested here,
2127 because it can't be reproduced easily.
2127 because it can't be reproduced easily.
2128
2128
2129 $ hg init clone1
2129 $ hg init clone1
2130 $ hg -R clone1 -q pull src
2130 $ hg -R clone1 -q pull src
2131 $ hg -R clone1 -q update
2131 $ hg -R clone1 -q update
2132 $ hg -R clone1 paths | grep default
2132 $ hg -R clone1 paths | grep default
2133 [1]
2133 [1]
2134
2134
2135 $ hg -R clone1 summary --large
2135 $ hg -R clone1 summary --large
2136 parent: 0:fc0bd45326d3 tip
2136 parent: 0:fc0bd45326d3 tip
2137 #0
2137 #0
2138 branch: default
2138 branch: default
2139 commit: (clean)
2139 commit: (clean)
2140 update: (current)
2140 update: (current)
2141 largefiles: (no remote repo)
2141 largefiles: (no remote repo)
2142
2142
2143 check messages when there is no files to upload:
2143 check messages when there is no files to upload:
2144
2144
2145 $ hg -q clone src clone2
2145 $ hg -q clone src clone2
2146 $ hg -R clone2 paths | grep default
2146 $ hg -R clone2 paths | grep default
2147 default = $TESTTMP/issue3651/src (glob)
2147 default = $TESTTMP/issue3651/src (glob)
2148
2148
2149 $ hg -R clone2 summary --large
2149 $ hg -R clone2 summary --large
2150 parent: 0:fc0bd45326d3 tip
2150 parent: 0:fc0bd45326d3 tip
2151 #0
2151 #0
2152 branch: default
2152 branch: default
2153 commit: (clean)
2153 commit: (clean)
2154 update: (current)
2154 update: (current)
2155 searching for changes
2155 searching for changes
2156 largefiles: (no files to upload)
2156 largefiles: (no files to upload)
2157 $ hg -R clone2 outgoing --large
2157 $ hg -R clone2 outgoing --large
2158 comparing with $TESTTMP/issue3651/src (glob)
2158 comparing with $TESTTMP/issue3651/src (glob)
2159 searching for changes
2159 searching for changes
2160 no changes found
2160 no changes found
2161 searching for changes
2161 searching for changes
2162 largefiles: no files to upload
2162 largefiles: no files to upload
2163 [1]
2163 [1]
2164
2164
2165 check messages when there are files to upload:
2165 check messages when there are files to upload:
2166
2166
2167 $ echo b > clone2/b
2167 $ echo b > clone2/b
2168 $ hg -R clone2 add --large clone2/b
2168 $ hg -R clone2 add --large clone2/b
2169 $ hg -R clone2 commit -m '#1'
2169 $ hg -R clone2 commit -m '#1'
2170 Invoking status precommit hook
2170 Invoking status precommit hook
2171 A b
2171 A b
2172 $ hg -R clone2 summary --large
2172 $ hg -R clone2 summary --large
2173 parent: 1:1acbe71ce432 tip
2173 parent: 1:1acbe71ce432 tip
2174 #1
2174 #1
2175 branch: default
2175 branch: default
2176 commit: (clean)
2176 commit: (clean)
2177 update: (current)
2177 update: (current)
2178 searching for changes
2178 searching for changes
2179 largefiles: 1 to upload
2179 largefiles: 1 to upload
2180 $ hg -R clone2 outgoing --large
2180 $ hg -R clone2 outgoing --large
2181 comparing with $TESTTMP/issue3651/src (glob)
2181 comparing with $TESTTMP/issue3651/src (glob)
2182 searching for changes
2182 searching for changes
2183 changeset: 1:1acbe71ce432
2183 changeset: 1:1acbe71ce432
2184 tag: tip
2184 tag: tip
2185 user: test
2185 user: test
2186 date: Thu Jan 01 00:00:00 1970 +0000
2186 date: Thu Jan 01 00:00:00 1970 +0000
2187 summary: #1
2187 summary: #1
2188
2188
2189 searching for changes
2189 searching for changes
2190 largefiles to upload:
2190 largefiles to upload:
2191 b
2191 b
2192
2192
2193
2193
2194 $ cd ..
2194 $ cd ..
2195
2195
2196 merge action 'd' for 'local renamed directory to d2/g' which has no filename
2196 merge action 'd' for 'local renamed directory to d2/g' which has no filename
2197
2197
2198 $ hg init merge-action
2198 $ hg init merge-action
2199 $ cd merge-action
2199 $ cd merge-action
2200 $ touch l
2200 $ touch l
2201 $ hg add --large l
2201 $ hg add --large l
2202 $ mkdir d1
2202 $ mkdir d1
2203 $ touch d1/f
2203 $ touch d1/f
2204 $ hg ci -Aqm0
2204 $ hg ci -Aqm0
2205 Invoking status precommit hook
2205 Invoking status precommit hook
2206 A d1/f
2206 A d1/f
2207 A l
2207 A l
2208 $ echo > d1/f
2208 $ echo > d1/f
2209 $ touch d1/g
2209 $ touch d1/g
2210 $ hg ci -Aqm1
2210 $ hg ci -Aqm1
2211 Invoking status precommit hook
2211 Invoking status precommit hook
2212 M d1/f
2212 M d1/f
2213 A d1/g
2213 A d1/g
2214 $ hg up -qr0
2214 $ hg up -qr0
2215 $ hg mv d1 d2
2215 $ hg mv d1 d2
2216 moving d1/f to d2/f (glob)
2216 moving d1/f to d2/f (glob)
2217 $ hg ci -qm2
2217 $ hg ci -qm2
2218 Invoking status precommit hook
2218 Invoking status precommit hook
2219 A d2/f
2219 A d2/f
2220 R d1/f
2220 R d1/f
2221 $ hg merge
2221 $ hg merge
2222 merging d2/f and d1/f to d2/f
2222 merging d2/f and d1/f to d2/f
2223 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
2223 1 files updated, 1 files merged, 0 files removed, 0 files unresolved
2224 (branch merge, don't forget to commit)
2224 (branch merge, don't forget to commit)
2225 getting changed largefiles
2225 getting changed largefiles
2226 0 largefiles updated, 0 removed
2226 0 largefiles updated, 0 removed
2227 $ cd ..
2227 $ cd ..
2228
2228
2229 Check whether "largefiles" feature is supported only in repositories
2229 Check whether "largefiles" feature is supported only in repositories
2230 enabling largefiles extension.
2230 enabling largefiles extension.
2231
2231
2232 $ mkdir individualenabling
2232 $ mkdir individualenabling
2233 $ cd individualenabling
2233 $ cd individualenabling
2234
2234
2235 $ hg init enabledlocally
2235 $ hg init enabledlocally
2236 $ echo large > enabledlocally/large
2236 $ echo large > enabledlocally/large
2237 $ hg -R enabledlocally add --large enabledlocally/large
2237 $ hg -R enabledlocally add --large enabledlocally/large
2238 $ hg -R enabledlocally commit -m '#0'
2238 $ hg -R enabledlocally commit -m '#0'
2239 Invoking status precommit hook
2239 Invoking status precommit hook
2240 A large
2240 A large
2241
2241
2242 $ hg init notenabledlocally
2242 $ hg init notenabledlocally
2243 $ echo large > notenabledlocally/large
2243 $ echo large > notenabledlocally/large
2244 $ hg -R notenabledlocally add --large notenabledlocally/large
2244 $ hg -R notenabledlocally add --large notenabledlocally/large
2245 $ hg -R notenabledlocally commit -m '#0'
2245 $ hg -R notenabledlocally commit -m '#0'
2246 Invoking status precommit hook
2246 Invoking status precommit hook
2247 A large
2247 A large
2248
2248
2249 $ cat >> $HGRCPATH <<EOF
2249 $ cat >> $HGRCPATH <<EOF
2250 > [extensions]
2250 > [extensions]
2251 > # disable globally
2251 > # disable globally
2252 > largefiles=!
2252 > largefiles=!
2253 > EOF
2253 > EOF
2254 $ cat >> enabledlocally/.hg/hgrc <<EOF
2254 $ cat >> enabledlocally/.hg/hgrc <<EOF
2255 > [extensions]
2255 > [extensions]
2256 > # enable locally
2256 > # enable locally
2257 > largefiles=
2257 > largefiles=
2258 > EOF
2258 > EOF
2259 $ hg -R enabledlocally root
2259 $ hg -R enabledlocally root
2260 $TESTTMP/individualenabling/enabledlocally (glob)
2260 $TESTTMP/individualenabling/enabledlocally (glob)
2261 $ hg -R notenabledlocally root
2261 $ hg -R notenabledlocally root
2262 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
2262 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
2263 [255]
2263 [255]
2264
2264
2265 $ hg init push-dst
2265 $ hg init push-dst
2266 $ hg -R enabledlocally push push-dst
2266 $ hg -R enabledlocally push push-dst
2267 pushing to push-dst
2267 pushing to push-dst
2268 abort: required features are not supported in the destination: largefiles
2268 abort: required features are not supported in the destination: largefiles
2269 [255]
2269 [255]
2270
2270
2271 $ hg init pull-src
2271 $ hg init pull-src
2272 $ hg -R pull-src pull enabledlocally
2272 $ hg -R pull-src pull enabledlocally
2273 pulling from enabledlocally
2273 pulling from enabledlocally
2274 abort: required features are not supported in the destination: largefiles
2274 abort: required features are not supported in the destination: largefiles
2275 [255]
2275 [255]
2276
2276
2277 $ hg clone enabledlocally clone-dst
2277 $ hg clone enabledlocally clone-dst
2278 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
2278 abort: unknown repository format: requires features 'largefiles' (upgrade Mercurial)!
2279 [255]
2279 [255]
2280 $ test -d clone-dst
2280 $ test -d clone-dst
2281 [1]
2281 [1]
2282 $ hg clone --pull enabledlocally clone-pull-dst
2282 $ hg clone --pull enabledlocally clone-pull-dst
2283 abort: required features are not supported in the destination: largefiles
2283 abort: required features are not supported in the destination: largefiles
2284 [255]
2284 [255]
2285 $ test -d clone-pull-dst
2285 $ test -d clone-pull-dst
2286 [1]
2286 [1]
2287
2287
2288 #if serve
2289
2290 Test largefiles specific peer setup, when largefiles is enabled
2291 locally (issue4109)
2292
2293 $ hg showconfig extensions | grep largefiles
2294 extensions.largefiles=!
2295 $ mkdir -p $TESTTMP/individualenabling/usercache
2296
2297 $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid
2298 $ cat hg.pid >> $DAEMON_PIDS
2299
2300 $ hg init pull-dst
2301 $ cat > pull-dst/.hg/hgrc <<EOF
2302 > [extensions]
2303 > # enable locally
2304 > largefiles=
2305 > [largefiles]
2306 > # ignore system cache to force largefiles specific wire proto access
2307 > usercache=$TESTTMP/individualenabling/usercache
2308 > EOF
2309 $ hg -R pull-dst -q pull -u http://localhost:$HGPORT
2310
2311 $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS
2312 #endif
2313
2288 $ cd ..
2314 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now