Show More
@@ -1,462 +1,471 | |||||
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 types |
|
11 | import types | |
12 | import os |
|
12 | import os | |
13 |
|
13 | |||
14 | from mercurial import context, error, manifest, match as match_, util |
|
14 | from mercurial import context, error, manifest, match as match_, util | |
15 | from mercurial import node as node_ |
|
15 | from mercurial import node as node_ | |
16 | from mercurial.i18n import _ |
|
16 | from mercurial.i18n import _ | |
17 |
|
17 | |||
18 | import lfcommands |
|
18 | import lfcommands | |
19 | import proto |
|
19 | import proto | |
20 | import lfutil |
|
20 | import lfutil | |
21 |
|
21 | |||
22 | def reposetup(ui, repo): |
|
22 | def reposetup(ui, repo): | |
23 | # wire repositories should be given new wireproto functions but not the |
|
23 | # wire repositories should be given new wireproto functions but not the | |
24 | # other largefiles modifications |
|
24 | # other largefiles modifications | |
25 | if not repo.local(): |
|
25 | if not repo.local(): | |
26 | return proto.wirereposetup(ui, repo) |
|
26 | return proto.wirereposetup(ui, repo) | |
27 |
|
27 | |||
28 | for name in ('status', 'commitctx', 'commit', 'push'): |
|
28 | for name in ('status', 'commitctx', 'commit', 'push'): | |
29 | method = getattr(repo, name) |
|
29 | method = getattr(repo, name) | |
30 | if (isinstance(method, types.FunctionType) and |
|
30 | if (isinstance(method, types.FunctionType) and | |
31 | method.func_name == 'wrap'): |
|
31 | method.func_name == 'wrap'): | |
32 | ui.warn(_('largefiles: repo method %r appears to have already been' |
|
32 | ui.warn(_('largefiles: repo method %r appears to have already been' | |
33 | ' wrapped by another extension: ' |
|
33 | ' wrapped by another extension: ' | |
34 | 'largefiles may behave incorrectly\n') |
|
34 | 'largefiles may behave incorrectly\n') | |
35 | % name) |
|
35 | % name) | |
36 |
|
36 | |||
37 | class lfilesrepo(repo.__class__): |
|
37 | class lfilesrepo(repo.__class__): | |
38 | lfstatus = False |
|
38 | lfstatus = False | |
39 | def status_nolfiles(self, *args, **kwargs): |
|
39 | def status_nolfiles(self, *args, **kwargs): | |
40 | return super(lfilesrepo, self).status(*args, **kwargs) |
|
40 | return super(lfilesrepo, self).status(*args, **kwargs) | |
41 |
|
41 | |||
42 | # When lfstatus is set, return a context that gives the names |
|
42 | # When lfstatus is set, return a context that gives the names | |
43 | # of largefiles instead of their corresponding standins and |
|
43 | # of largefiles instead of their corresponding standins and | |
44 | # identifies the largefiles as always binary, regardless of |
|
44 | # identifies the largefiles as always binary, regardless of | |
45 | # their actual contents. |
|
45 | # their actual contents. | |
46 | def __getitem__(self, changeid): |
|
46 | def __getitem__(self, changeid): | |
47 | ctx = super(lfilesrepo, self).__getitem__(changeid) |
|
47 | ctx = super(lfilesrepo, self).__getitem__(changeid) | |
48 | if self.lfstatus: |
|
48 | if self.lfstatus: | |
49 | class lfilesmanifestdict(manifest.manifestdict): |
|
49 | class lfilesmanifestdict(manifest.manifestdict): | |
50 | def __contains__(self, filename): |
|
50 | def __contains__(self, filename): | |
51 | if super(lfilesmanifestdict, |
|
51 | if super(lfilesmanifestdict, | |
52 | self).__contains__(filename): |
|
52 | self).__contains__(filename): | |
53 | return True |
|
53 | return True | |
54 | return super(lfilesmanifestdict, |
|
54 | return super(lfilesmanifestdict, | |
55 | self).__contains__(lfutil.standin(filename)) |
|
55 | self).__contains__(lfutil.standin(filename)) | |
56 | class lfilesctx(ctx.__class__): |
|
56 | class lfilesctx(ctx.__class__): | |
57 | def files(self): |
|
57 | def files(self): | |
58 | filenames = super(lfilesctx, self).files() |
|
58 | filenames = super(lfilesctx, self).files() | |
59 | return [lfutil.splitstandin(f) or f for f in filenames] |
|
59 | return [lfutil.splitstandin(f) or f for f in filenames] | |
60 | def manifest(self): |
|
60 | def manifest(self): | |
61 | man1 = super(lfilesctx, self).manifest() |
|
61 | man1 = super(lfilesctx, self).manifest() | |
62 | man1.__class__ = lfilesmanifestdict |
|
62 | man1.__class__ = lfilesmanifestdict | |
63 | return man1 |
|
63 | return man1 | |
64 | def filectx(self, path, fileid=None, filelog=None): |
|
64 | def filectx(self, path, fileid=None, filelog=None): | |
65 | try: |
|
65 | try: | |
66 | if filelog is not None: |
|
66 | if filelog is not None: | |
67 | result = super(lfilesctx, self).filectx( |
|
67 | result = super(lfilesctx, self).filectx( | |
68 | path, fileid, filelog) |
|
68 | path, fileid, filelog) | |
69 | else: |
|
69 | else: | |
70 | result = super(lfilesctx, self).filectx( |
|
70 | result = super(lfilesctx, self).filectx( | |
71 | path, fileid) |
|
71 | path, fileid) | |
72 | except error.LookupError: |
|
72 | except error.LookupError: | |
73 | # Adding a null character will cause Mercurial to |
|
73 | # Adding a null character will cause Mercurial to | |
74 | # identify this as a binary file. |
|
74 | # identify this as a binary file. | |
75 | if filelog is not None: |
|
75 | if filelog is not None: | |
76 | result = super(lfilesctx, self).filectx( |
|
76 | result = super(lfilesctx, self).filectx( | |
77 | lfutil.standin(path), fileid, filelog) |
|
77 | lfutil.standin(path), fileid, filelog) | |
78 | else: |
|
78 | else: | |
79 | result = super(lfilesctx, self).filectx( |
|
79 | result = super(lfilesctx, self).filectx( | |
80 | lfutil.standin(path), fileid) |
|
80 | lfutil.standin(path), fileid) | |
81 | olddata = result.data |
|
81 | olddata = result.data | |
82 | result.data = lambda: olddata() + '\0' |
|
82 | result.data = lambda: olddata() + '\0' | |
83 | return result |
|
83 | return result | |
84 | ctx.__class__ = lfilesctx |
|
84 | ctx.__class__ = lfilesctx | |
85 | return ctx |
|
85 | return ctx | |
86 |
|
86 | |||
87 | # Figure out the status of big files and insert them into the |
|
87 | # Figure out the status of big files and insert them into the | |
88 | # appropriate list in the result. Also removes standin files |
|
88 | # appropriate list in the result. Also removes standin files | |
89 | # from the listing. Revert to the original status if |
|
89 | # from the listing. Revert to the original status if | |
90 | # self.lfstatus is False. |
|
90 | # self.lfstatus is False. | |
91 | def status(self, node1='.', node2=None, match=None, ignored=False, |
|
91 | def status(self, node1='.', node2=None, match=None, ignored=False, | |
92 | clean=False, unknown=False, listsubrepos=False): |
|
92 | clean=False, unknown=False, listsubrepos=False): | |
93 | listignored, listclean, listunknown = ignored, clean, unknown |
|
93 | listignored, listclean, listunknown = ignored, clean, unknown | |
94 | if not self.lfstatus: |
|
94 | if not self.lfstatus: | |
95 | return super(lfilesrepo, self).status(node1, node2, match, |
|
95 | return super(lfilesrepo, self).status(node1, node2, match, | |
96 | listignored, listclean, listunknown, listsubrepos) |
|
96 | listignored, listclean, listunknown, listsubrepos) | |
97 | else: |
|
97 | else: | |
98 | # some calls in this function rely on the old version of status |
|
98 | # some calls in this function rely on the old version of status | |
99 | self.lfstatus = False |
|
99 | self.lfstatus = False | |
100 | if isinstance(node1, context.changectx): |
|
100 | if isinstance(node1, context.changectx): | |
101 | ctx1 = node1 |
|
101 | ctx1 = node1 | |
102 | else: |
|
102 | else: | |
103 | ctx1 = repo[node1] |
|
103 | ctx1 = repo[node1] | |
104 | if isinstance(node2, context.changectx): |
|
104 | if isinstance(node2, context.changectx): | |
105 | ctx2 = node2 |
|
105 | ctx2 = node2 | |
106 | else: |
|
106 | else: | |
107 | ctx2 = repo[node2] |
|
107 | ctx2 = repo[node2] | |
108 | working = ctx2.rev() is None |
|
108 | working = ctx2.rev() is None | |
109 | parentworking = working and ctx1 == self['.'] |
|
109 | parentworking = working and ctx1 == self['.'] | |
110 |
|
110 | |||
111 | def inctx(file, ctx): |
|
111 | def inctx(file, ctx): | |
112 | try: |
|
112 | try: | |
113 | if ctx.rev() is None: |
|
113 | if ctx.rev() is None: | |
114 | return file in ctx.manifest() |
|
114 | return file in ctx.manifest() | |
115 | ctx[file] |
|
115 | ctx[file] | |
116 | return True |
|
116 | return True | |
117 | except KeyError: |
|
117 | except KeyError: | |
118 | return False |
|
118 | return False | |
119 |
|
119 | |||
120 | if match is None: |
|
120 | if match is None: | |
121 | match = match_.always(self.root, self.getcwd()) |
|
121 | match = match_.always(self.root, self.getcwd()) | |
122 |
|
122 | |||
123 | # First check if there were files specified on the |
|
123 | # First check if there were files specified on the | |
124 | # command line. If there were, and none of them were |
|
124 | # command line. If there were, and none of them were | |
125 | # largefiles, we should just bail here and let super |
|
125 | # largefiles, we should just bail here and let super | |
126 | # handle it -- thus gaining a big performance boost. |
|
126 | # handle it -- thus gaining a big performance boost. | |
127 | lfdirstate = lfutil.openlfdirstate(ui, self) |
|
127 | lfdirstate = lfutil.openlfdirstate(ui, self) | |
128 | if match.files() and not match.anypats(): |
|
128 | if match.files() and not match.anypats(): | |
129 | for f in lfdirstate: |
|
129 | for f in lfdirstate: | |
130 | if match(f): |
|
130 | if match(f): | |
131 | break |
|
131 | break | |
132 | else: |
|
132 | else: | |
133 | return super(lfilesrepo, self).status(node1, node2, |
|
133 | return super(lfilesrepo, self).status(node1, node2, | |
134 | match, listignored, listclean, |
|
134 | match, listignored, listclean, | |
135 | listunknown, listsubrepos) |
|
135 | listunknown, listsubrepos) | |
136 |
|
136 | |||
137 | # Create a copy of match that matches standins instead |
|
137 | # Create a copy of match that matches standins instead | |
138 | # of largefiles. |
|
138 | # of largefiles. | |
139 | def tostandin(file): |
|
139 | def tostandins(files): | |
140 | if working: |
|
140 | if not working: | |
141 |
|
|
141 | return files | |
142 |
|
|
142 | newfiles = [] | |
143 |
|
|
143 | dirstate = repo.dirstate | |
144 |
|
|
144 | for f in files: | |
145 | return file |
|
145 | sf = lfutil.standin(f) | |
|
146 | if sf in dirstate: | |||
|
147 | newfiles.append(sf) | |||
|
148 | elif sf in dirstate.dirs(): | |||
|
149 | # Directory entries could be regular or | |||
|
150 | # standin, check both | |||
|
151 | newfiles.extend((f, sf)) | |||
|
152 | else: | |||
|
153 | newfiles.append(f) | |||
|
154 | return newfiles | |||
146 |
|
155 | |||
147 | # Create a function that we can use to override what is |
|
156 | # Create a function that we can use to override what is | |
148 | # normally the ignore matcher. We've already checked |
|
157 | # normally the ignore matcher. We've already checked | |
149 | # for ignored files on the first dirstate walk, and |
|
158 | # for ignored files on the first dirstate walk, and | |
150 | # unecessarily re-checking here causes a huge performance |
|
159 | # unecessarily re-checking here causes a huge performance | |
151 | # hit because lfdirstate only knows about largefiles |
|
160 | # hit because lfdirstate only knows about largefiles | |
152 | def _ignoreoverride(self): |
|
161 | def _ignoreoverride(self): | |
153 | return False |
|
162 | return False | |
154 |
|
163 | |||
155 | m = copy.copy(match) |
|
164 | m = copy.copy(match) | |
156 |
m._files = |
|
165 | m._files = tostandins(m._files) | |
157 |
|
166 | |||
158 | # Get ignored files here even if we weren't asked for them; we |
|
167 | # Get ignored files here even if we weren't asked for them; we | |
159 | # must use the result here for filtering later |
|
168 | # must use the result here for filtering later | |
160 | result = super(lfilesrepo, self).status(node1, node2, m, |
|
169 | result = super(lfilesrepo, self).status(node1, node2, m, | |
161 | True, clean, unknown, listsubrepos) |
|
170 | True, clean, unknown, listsubrepos) | |
162 | if working: |
|
171 | if working: | |
163 | try: |
|
172 | try: | |
164 | # Any non-largefiles that were explicitly listed must be |
|
173 | # Any non-largefiles that were explicitly listed must be | |
165 | # taken out or lfdirstate.status will report an error. |
|
174 | # taken out or lfdirstate.status will report an error. | |
166 | # The status of these files was already computed using |
|
175 | # The status of these files was already computed using | |
167 | # super's status. |
|
176 | # super's status. | |
168 | # Override lfdirstate's ignore matcher to not do |
|
177 | # Override lfdirstate's ignore matcher to not do | |
169 | # anything |
|
178 | # anything | |
170 | origignore = lfdirstate._ignore |
|
179 | origignore = lfdirstate._ignore | |
171 | lfdirstate._ignore = _ignoreoverride |
|
180 | lfdirstate._ignore = _ignoreoverride | |
172 |
|
181 | |||
173 | def sfindirstate(f): |
|
182 | def sfindirstate(f): | |
174 | sf = lfutil.standin(f) |
|
183 | sf = lfutil.standin(f) | |
175 | dirstate = repo.dirstate |
|
184 | dirstate = repo.dirstate | |
176 | return sf in dirstate or sf in dirstate.dirs() |
|
185 | return sf in dirstate or sf in dirstate.dirs() | |
177 | match._files = [f for f in match._files |
|
186 | match._files = [f for f in match._files | |
178 | if sfindirstate(f)] |
|
187 | if sfindirstate(f)] | |
179 | # Don't waste time getting the ignored and unknown |
|
188 | # Don't waste time getting the ignored and unknown | |
180 | # files again; we already have them |
|
189 | # files again; we already have them | |
181 | s = lfdirstate.status(match, [], False, |
|
190 | s = lfdirstate.status(match, [], False, | |
182 | listclean, False) |
|
191 | listclean, False) | |
183 | (unsure, modified, added, removed, missing, unknown, |
|
192 | (unsure, modified, added, removed, missing, unknown, | |
184 | ignored, clean) = s |
|
193 | ignored, clean) = s | |
185 | # Replace the list of ignored and unknown files with |
|
194 | # Replace the list of ignored and unknown files with | |
186 | # the previously caclulated lists, and strip out the |
|
195 | # the previously caclulated lists, and strip out the | |
187 | # largefiles |
|
196 | # largefiles | |
188 | lfiles = set(lfdirstate._map) |
|
197 | lfiles = set(lfdirstate._map) | |
189 | ignored = set(result[5]).difference(lfiles) |
|
198 | ignored = set(result[5]).difference(lfiles) | |
190 | unknown = set(result[4]).difference(lfiles) |
|
199 | unknown = set(result[4]).difference(lfiles) | |
191 | if parentworking: |
|
200 | if parentworking: | |
192 | for lfile in unsure: |
|
201 | for lfile in unsure: | |
193 | standin = lfutil.standin(lfile) |
|
202 | standin = lfutil.standin(lfile) | |
194 | if standin not in ctx1: |
|
203 | if standin not in ctx1: | |
195 | # from second parent |
|
204 | # from second parent | |
196 | modified.append(lfile) |
|
205 | modified.append(lfile) | |
197 | elif ctx1[standin].data().strip() \ |
|
206 | elif ctx1[standin].data().strip() \ | |
198 | != lfutil.hashfile(self.wjoin(lfile)): |
|
207 | != lfutil.hashfile(self.wjoin(lfile)): | |
199 | modified.append(lfile) |
|
208 | modified.append(lfile) | |
200 | else: |
|
209 | else: | |
201 | clean.append(lfile) |
|
210 | clean.append(lfile) | |
202 | lfdirstate.normal(lfile) |
|
211 | lfdirstate.normal(lfile) | |
203 | else: |
|
212 | else: | |
204 | tocheck = unsure + modified + added + clean |
|
213 | tocheck = unsure + modified + added + clean | |
205 | modified, added, clean = [], [], [] |
|
214 | modified, added, clean = [], [], [] | |
206 |
|
215 | |||
207 | for lfile in tocheck: |
|
216 | for lfile in tocheck: | |
208 | standin = lfutil.standin(lfile) |
|
217 | standin = lfutil.standin(lfile) | |
209 | if inctx(standin, ctx1): |
|
218 | if inctx(standin, ctx1): | |
210 | if ctx1[standin].data().strip() != \ |
|
219 | if ctx1[standin].data().strip() != \ | |
211 | lfutil.hashfile(self.wjoin(lfile)): |
|
220 | lfutil.hashfile(self.wjoin(lfile)): | |
212 | modified.append(lfile) |
|
221 | modified.append(lfile) | |
213 | else: |
|
222 | else: | |
214 | clean.append(lfile) |
|
223 | clean.append(lfile) | |
215 | else: |
|
224 | else: | |
216 | added.append(lfile) |
|
225 | added.append(lfile) | |
217 | finally: |
|
226 | finally: | |
218 | # Replace the original ignore function |
|
227 | # Replace the original ignore function | |
219 | lfdirstate._ignore = origignore |
|
228 | lfdirstate._ignore = origignore | |
220 |
|
229 | |||
221 | for standin in ctx1.manifest(): |
|
230 | for standin in ctx1.manifest(): | |
222 | if not lfutil.isstandin(standin): |
|
231 | if not lfutil.isstandin(standin): | |
223 | continue |
|
232 | continue | |
224 | lfile = lfutil.splitstandin(standin) |
|
233 | lfile = lfutil.splitstandin(standin) | |
225 | if not match(lfile): |
|
234 | if not match(lfile): | |
226 | continue |
|
235 | continue | |
227 | if lfile not in lfdirstate: |
|
236 | if lfile not in lfdirstate: | |
228 | removed.append(lfile) |
|
237 | removed.append(lfile) | |
229 |
|
238 | |||
230 | # Filter result lists |
|
239 | # Filter result lists | |
231 | result = list(result) |
|
240 | result = list(result) | |
232 |
|
241 | |||
233 | # Largefiles are not really removed when they're |
|
242 | # Largefiles are not really removed when they're | |
234 | # still in the normal dirstate. Likewise, normal |
|
243 | # still in the normal dirstate. Likewise, normal | |
235 | # files are not really removed if it's still in |
|
244 | # files are not really removed if it's still in | |
236 | # lfdirstate. This happens in merges where files |
|
245 | # lfdirstate. This happens in merges where files | |
237 | # change type. |
|
246 | # change type. | |
238 | removed = [f for f in removed if f not in repo.dirstate] |
|
247 | removed = [f for f in removed if f not in repo.dirstate] | |
239 | result[2] = [f for f in result[2] if f not in lfdirstate] |
|
248 | result[2] = [f for f in result[2] if f not in lfdirstate] | |
240 |
|
249 | |||
241 | # Unknown files |
|
250 | # Unknown files | |
242 | unknown = set(unknown).difference(ignored) |
|
251 | unknown = set(unknown).difference(ignored) | |
243 | result[4] = [f for f in unknown |
|
252 | result[4] = [f for f in unknown | |
244 | if (repo.dirstate[f] == '?' and |
|
253 | if (repo.dirstate[f] == '?' and | |
245 | not lfutil.isstandin(f))] |
|
254 | not lfutil.isstandin(f))] | |
246 | # Ignored files were calculated earlier by the dirstate, |
|
255 | # Ignored files were calculated earlier by the dirstate, | |
247 | # and we already stripped out the largefiles from the list |
|
256 | # and we already stripped out the largefiles from the list | |
248 | result[5] = ignored |
|
257 | result[5] = ignored | |
249 | # combine normal files and largefiles |
|
258 | # combine normal files and largefiles | |
250 | normals = [[fn for fn in filelist |
|
259 | normals = [[fn for fn in filelist | |
251 | if not lfutil.isstandin(fn)] |
|
260 | if not lfutil.isstandin(fn)] | |
252 | for filelist in result] |
|
261 | for filelist in result] | |
253 | lfiles = (modified, added, removed, missing, [], [], clean) |
|
262 | lfiles = (modified, added, removed, missing, [], [], clean) | |
254 | result = [sorted(list1 + list2) |
|
263 | result = [sorted(list1 + list2) | |
255 | for (list1, list2) in zip(normals, lfiles)] |
|
264 | for (list1, list2) in zip(normals, lfiles)] | |
256 | else: |
|
265 | else: | |
257 | def toname(f): |
|
266 | def toname(f): | |
258 | if lfutil.isstandin(f): |
|
267 | if lfutil.isstandin(f): | |
259 | return lfutil.splitstandin(f) |
|
268 | return lfutil.splitstandin(f) | |
260 | return f |
|
269 | return f | |
261 | result = [[toname(f) for f in items] for items in result] |
|
270 | result = [[toname(f) for f in items] for items in result] | |
262 |
|
271 | |||
263 | if not listunknown: |
|
272 | if not listunknown: | |
264 | result[4] = [] |
|
273 | result[4] = [] | |
265 | if not listignored: |
|
274 | if not listignored: | |
266 | result[5] = [] |
|
275 | result[5] = [] | |
267 | if not listclean: |
|
276 | if not listclean: | |
268 | result[6] = [] |
|
277 | result[6] = [] | |
269 | self.lfstatus = True |
|
278 | self.lfstatus = True | |
270 | return result |
|
279 | return result | |
271 |
|
280 | |||
272 | # As part of committing, copy all of the largefiles into the |
|
281 | # As part of committing, copy all of the largefiles into the | |
273 | # cache. |
|
282 | # cache. | |
274 | def commitctx(self, *args, **kwargs): |
|
283 | def commitctx(self, *args, **kwargs): | |
275 | node = super(lfilesrepo, self).commitctx(*args, **kwargs) |
|
284 | node = super(lfilesrepo, self).commitctx(*args, **kwargs) | |
276 | lfutil.copyalltostore(self, node) |
|
285 | lfutil.copyalltostore(self, node) | |
277 | return node |
|
286 | return node | |
278 |
|
287 | |||
279 | # Before commit, largefile standins have not had their |
|
288 | # Before commit, largefile standins have not had their | |
280 | # contents updated to reflect the hash of their largefile. |
|
289 | # contents updated to reflect the hash of their largefile. | |
281 | # Do that here. |
|
290 | # Do that here. | |
282 | def commit(self, text="", user=None, date=None, match=None, |
|
291 | def commit(self, text="", user=None, date=None, match=None, | |
283 | force=False, editor=False, extra={}): |
|
292 | force=False, editor=False, extra={}): | |
284 | orig = super(lfilesrepo, self).commit |
|
293 | orig = super(lfilesrepo, self).commit | |
285 |
|
294 | |||
286 | wlock = repo.wlock() |
|
295 | wlock = repo.wlock() | |
287 | try: |
|
296 | try: | |
288 | # Case 0: Rebase or Transplant |
|
297 | # Case 0: Rebase or Transplant | |
289 | # We have to take the time to pull down the new largefiles now. |
|
298 | # We have to take the time to pull down the new largefiles now. | |
290 | # Otherwise, any largefiles that were modified in the |
|
299 | # Otherwise, any largefiles that were modified in the | |
291 | # destination changesets get overwritten, either by the rebase |
|
300 | # destination changesets get overwritten, either by the rebase | |
292 | # or in the first commit after the rebase or transplant. |
|
301 | # or in the first commit after the rebase or transplant. | |
293 | # updatelfiles will update the dirstate to mark any pulled |
|
302 | # updatelfiles will update the dirstate to mark any pulled | |
294 | # largefiles as modified |
|
303 | # largefiles as modified | |
295 | if getattr(repo, "_isrebasing", False) or \ |
|
304 | if getattr(repo, "_isrebasing", False) or \ | |
296 | getattr(repo, "_istransplanting", False): |
|
305 | getattr(repo, "_istransplanting", False): | |
297 | lfcommands.updatelfiles(repo.ui, repo, filelist=None, |
|
306 | lfcommands.updatelfiles(repo.ui, repo, filelist=None, | |
298 | printmessage=False) |
|
307 | printmessage=False) | |
299 | result = orig(text=text, user=user, date=date, match=match, |
|
308 | result = orig(text=text, user=user, date=date, match=match, | |
300 | force=force, editor=editor, extra=extra) |
|
309 | force=force, editor=editor, extra=extra) | |
301 | return result |
|
310 | return result | |
302 | # Case 1: user calls commit with no specific files or |
|
311 | # Case 1: user calls commit with no specific files or | |
303 | # include/exclude patterns: refresh and commit all files that |
|
312 | # include/exclude patterns: refresh and commit all files that | |
304 | # are "dirty". |
|
313 | # are "dirty". | |
305 | if ((match is None) or |
|
314 | if ((match is None) or | |
306 | (not match.anypats() and not match.files())): |
|
315 | (not match.anypats() and not match.files())): | |
307 | # Spend a bit of time here to get a list of files we know |
|
316 | # Spend a bit of time here to get a list of files we know | |
308 | # are modified so we can compare only against those. |
|
317 | # are modified so we can compare only against those. | |
309 | # It can cost a lot of time (several seconds) |
|
318 | # It can cost a lot of time (several seconds) | |
310 | # otherwise to update all standins if the largefiles are |
|
319 | # otherwise to update all standins if the largefiles are | |
311 | # large. |
|
320 | # large. | |
312 | lfdirstate = lfutil.openlfdirstate(ui, self) |
|
321 | lfdirstate = lfutil.openlfdirstate(ui, self) | |
313 | dirtymatch = match_.always(repo.root, repo.getcwd()) |
|
322 | dirtymatch = match_.always(repo.root, repo.getcwd()) | |
314 | s = lfdirstate.status(dirtymatch, [], False, False, False) |
|
323 | s = lfdirstate.status(dirtymatch, [], False, False, False) | |
315 | modifiedfiles = [] |
|
324 | modifiedfiles = [] | |
316 | for i in s: |
|
325 | for i in s: | |
317 | modifiedfiles.extend(i) |
|
326 | modifiedfiles.extend(i) | |
318 | lfiles = lfutil.listlfiles(self) |
|
327 | lfiles = lfutil.listlfiles(self) | |
319 | # this only loops through largefiles that exist (not |
|
328 | # this only loops through largefiles that exist (not | |
320 | # removed/renamed) |
|
329 | # removed/renamed) | |
321 | for lfile in lfiles: |
|
330 | for lfile in lfiles: | |
322 | if lfile in modifiedfiles: |
|
331 | if lfile in modifiedfiles: | |
323 | if os.path.exists( |
|
332 | if os.path.exists( | |
324 | self.wjoin(lfutil.standin(lfile))): |
|
333 | self.wjoin(lfutil.standin(lfile))): | |
325 | # this handles the case where a rebase is being |
|
334 | # this handles the case where a rebase is being | |
326 | # performed and the working copy is not updated |
|
335 | # performed and the working copy is not updated | |
327 | # yet. |
|
336 | # yet. | |
328 | if os.path.exists(self.wjoin(lfile)): |
|
337 | if os.path.exists(self.wjoin(lfile)): | |
329 | lfutil.updatestandin(self, |
|
338 | lfutil.updatestandin(self, | |
330 | lfutil.standin(lfile)) |
|
339 | lfutil.standin(lfile)) | |
331 | lfdirstate.normal(lfile) |
|
340 | lfdirstate.normal(lfile) | |
332 | for lfile in lfdirstate: |
|
341 | for lfile in lfdirstate: | |
333 | if lfile in modifiedfiles: |
|
342 | if lfile in modifiedfiles: | |
334 | if not os.path.exists( |
|
343 | if not os.path.exists( | |
335 | repo.wjoin(lfutil.standin(lfile))): |
|
344 | repo.wjoin(lfutil.standin(lfile))): | |
336 | lfdirstate.drop(lfile) |
|
345 | lfdirstate.drop(lfile) | |
337 |
|
346 | |||
338 | result = orig(text=text, user=user, date=date, match=match, |
|
347 | result = orig(text=text, user=user, date=date, match=match, | |
339 | force=force, editor=editor, extra=extra) |
|
348 | force=force, editor=editor, extra=extra) | |
340 | # This needs to be after commit; otherwise precommit hooks |
|
349 | # This needs to be after commit; otherwise precommit hooks | |
341 | # get the wrong status |
|
350 | # get the wrong status | |
342 | lfdirstate.write() |
|
351 | lfdirstate.write() | |
343 | return result |
|
352 | return result | |
344 |
|
353 | |||
345 | for f in match.files(): |
|
354 | for f in match.files(): | |
346 | if lfutil.isstandin(f): |
|
355 | if lfutil.isstandin(f): | |
347 | raise util.Abort( |
|
356 | raise util.Abort( | |
348 | _('file "%s" is a largefile standin') % f, |
|
357 | _('file "%s" is a largefile standin') % f, | |
349 | hint=('commit the largefile itself instead')) |
|
358 | hint=('commit the largefile itself instead')) | |
350 |
|
359 | |||
351 | # Case 2: user calls commit with specified patterns: refresh |
|
360 | # Case 2: user calls commit with specified patterns: refresh | |
352 | # any matching big files. |
|
361 | # any matching big files. | |
353 | smatcher = lfutil.composestandinmatcher(self, match) |
|
362 | smatcher = lfutil.composestandinmatcher(self, match) | |
354 | standins = lfutil.dirstatewalk(self.dirstate, smatcher) |
|
363 | standins = lfutil.dirstatewalk(self.dirstate, smatcher) | |
355 |
|
364 | |||
356 | # No matching big files: get out of the way and pass control to |
|
365 | # No matching big files: get out of the way and pass control to | |
357 | # the usual commit() method. |
|
366 | # the usual commit() method. | |
358 | if not standins: |
|
367 | if not standins: | |
359 | return orig(text=text, user=user, date=date, match=match, |
|
368 | return orig(text=text, user=user, date=date, match=match, | |
360 | force=force, editor=editor, extra=extra) |
|
369 | force=force, editor=editor, extra=extra) | |
361 |
|
370 | |||
362 | # Refresh all matching big files. It's possible that the |
|
371 | # Refresh all matching big files. It's possible that the | |
363 | # commit will end up failing, in which case the big files will |
|
372 | # commit will end up failing, in which case the big files will | |
364 | # stay refreshed. No harm done: the user modified them and |
|
373 | # stay refreshed. No harm done: the user modified them and | |
365 | # asked to commit them, so sooner or later we're going to |
|
374 | # asked to commit them, so sooner or later we're going to | |
366 | # refresh the standins. Might as well leave them refreshed. |
|
375 | # refresh the standins. Might as well leave them refreshed. | |
367 | lfdirstate = lfutil.openlfdirstate(ui, self) |
|
376 | lfdirstate = lfutil.openlfdirstate(ui, self) | |
368 | for standin in standins: |
|
377 | for standin in standins: | |
369 | lfile = lfutil.splitstandin(standin) |
|
378 | lfile = lfutil.splitstandin(standin) | |
370 | if lfdirstate[lfile] <> 'r': |
|
379 | if lfdirstate[lfile] <> 'r': | |
371 | lfutil.updatestandin(self, standin) |
|
380 | lfutil.updatestandin(self, standin) | |
372 | lfdirstate.normal(lfile) |
|
381 | lfdirstate.normal(lfile) | |
373 | else: |
|
382 | else: | |
374 | lfdirstate.drop(lfile) |
|
383 | lfdirstate.drop(lfile) | |
375 |
|
384 | |||
376 | # Cook up a new matcher that only matches regular files or |
|
385 | # Cook up a new matcher that only matches regular files or | |
377 | # standins corresponding to the big files requested by the |
|
386 | # standins corresponding to the big files requested by the | |
378 | # user. Have to modify _files to prevent commit() from |
|
387 | # user. Have to modify _files to prevent commit() from | |
379 | # complaining "not tracked" for big files. |
|
388 | # complaining "not tracked" for big files. | |
380 | lfiles = lfutil.listlfiles(repo) |
|
389 | lfiles = lfutil.listlfiles(repo) | |
381 | match = copy.copy(match) |
|
390 | match = copy.copy(match) | |
382 | origmatchfn = match.matchfn |
|
391 | origmatchfn = match.matchfn | |
383 |
|
392 | |||
384 | # Check both the list of largefiles and the list of |
|
393 | # Check both the list of largefiles and the list of | |
385 | # standins because if a largefile was removed, it |
|
394 | # standins because if a largefile was removed, it | |
386 | # won't be in the list of largefiles at this point |
|
395 | # won't be in the list of largefiles at this point | |
387 | match._files += sorted(standins) |
|
396 | match._files += sorted(standins) | |
388 |
|
397 | |||
389 | actualfiles = [] |
|
398 | actualfiles = [] | |
390 | for f in match._files: |
|
399 | for f in match._files: | |
391 | fstandin = lfutil.standin(f) |
|
400 | fstandin = lfutil.standin(f) | |
392 |
|
401 | |||
393 | # ignore known largefiles and standins |
|
402 | # ignore known largefiles and standins | |
394 | if f in lfiles or fstandin in standins: |
|
403 | if f in lfiles or fstandin in standins: | |
395 | continue |
|
404 | continue | |
396 |
|
405 | |||
397 | # append directory separator to avoid collisions |
|
406 | # append directory separator to avoid collisions | |
398 | if not fstandin.endswith(os.sep): |
|
407 | if not fstandin.endswith(os.sep): | |
399 | fstandin += os.sep |
|
408 | fstandin += os.sep | |
400 |
|
409 | |||
401 | actualfiles.append(f) |
|
410 | actualfiles.append(f) | |
402 | match._files = actualfiles |
|
411 | match._files = actualfiles | |
403 |
|
412 | |||
404 | def matchfn(f): |
|
413 | def matchfn(f): | |
405 | if origmatchfn(f): |
|
414 | if origmatchfn(f): | |
406 | return f not in lfiles |
|
415 | return f not in lfiles | |
407 | else: |
|
416 | else: | |
408 | return f in standins |
|
417 | return f in standins | |
409 |
|
418 | |||
410 | match.matchfn = matchfn |
|
419 | match.matchfn = matchfn | |
411 | result = orig(text=text, user=user, date=date, match=match, |
|
420 | result = orig(text=text, user=user, date=date, match=match, | |
412 | force=force, editor=editor, extra=extra) |
|
421 | force=force, editor=editor, extra=extra) | |
413 | # This needs to be after commit; otherwise precommit hooks |
|
422 | # This needs to be after commit; otherwise precommit hooks | |
414 | # get the wrong status |
|
423 | # get the wrong status | |
415 | lfdirstate.write() |
|
424 | lfdirstate.write() | |
416 | return result |
|
425 | return result | |
417 | finally: |
|
426 | finally: | |
418 | wlock.release() |
|
427 | wlock.release() | |
419 |
|
428 | |||
420 | def push(self, remote, force=False, revs=None, newbranch=False): |
|
429 | def push(self, remote, force=False, revs=None, newbranch=False): | |
421 | o = lfutil.findoutgoing(repo, remote, force) |
|
430 | o = lfutil.findoutgoing(repo, remote, force) | |
422 | if o: |
|
431 | if o: | |
423 | toupload = set() |
|
432 | toupload = set() | |
424 | o = repo.changelog.nodesbetween(o, revs)[0] |
|
433 | o = repo.changelog.nodesbetween(o, revs)[0] | |
425 | for n in o: |
|
434 | for n in o: | |
426 | parents = [p for p in repo.changelog.parents(n) |
|
435 | parents = [p for p in repo.changelog.parents(n) | |
427 | if p != node_.nullid] |
|
436 | if p != node_.nullid] | |
428 | ctx = repo[n] |
|
437 | ctx = repo[n] | |
429 | files = set(ctx.files()) |
|
438 | files = set(ctx.files()) | |
430 | if len(parents) == 2: |
|
439 | if len(parents) == 2: | |
431 | mc = ctx.manifest() |
|
440 | mc = ctx.manifest() | |
432 | mp1 = ctx.parents()[0].manifest() |
|
441 | mp1 = ctx.parents()[0].manifest() | |
433 | mp2 = ctx.parents()[1].manifest() |
|
442 | mp2 = ctx.parents()[1].manifest() | |
434 | for f in mp1: |
|
443 | for f in mp1: | |
435 | if f not in mc: |
|
444 | if f not in mc: | |
436 | files.add(f) |
|
445 | files.add(f) | |
437 | for f in mp2: |
|
446 | for f in mp2: | |
438 | if f not in mc: |
|
447 | if f not in mc: | |
439 | files.add(f) |
|
448 | files.add(f) | |
440 | for f in mc: |
|
449 | for f in mc: | |
441 | if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, |
|
450 | if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, | |
442 | None): |
|
451 | None): | |
443 | files.add(f) |
|
452 | files.add(f) | |
444 |
|
453 | |||
445 | toupload = toupload.union( |
|
454 | toupload = toupload.union( | |
446 | set([ctx[f].data().strip() |
|
455 | set([ctx[f].data().strip() | |
447 | for f in files |
|
456 | for f in files | |
448 | if lfutil.isstandin(f) and f in ctx])) |
|
457 | if lfutil.isstandin(f) and f in ctx])) | |
449 | lfcommands.uploadlfiles(ui, self, remote, toupload) |
|
458 | lfcommands.uploadlfiles(ui, self, remote, toupload) | |
450 | return super(lfilesrepo, self).push(remote, force, revs, |
|
459 | return super(lfilesrepo, self).push(remote, force, revs, | |
451 | newbranch) |
|
460 | newbranch) | |
452 |
|
461 | |||
453 | repo.__class__ = lfilesrepo |
|
462 | repo.__class__ = lfilesrepo | |
454 |
|
463 | |||
455 | def checkrequireslfiles(ui, repo, **kwargs): |
|
464 | def checkrequireslfiles(ui, repo, **kwargs): | |
456 | if 'largefiles' not in repo.requirements and util.any( |
|
465 | if 'largefiles' not in repo.requirements and util.any( | |
457 | lfutil.shortname+'/' in f[0] for f in repo.store.datafiles()): |
|
466 | lfutil.shortname+'/' in f[0] for f in repo.store.datafiles()): | |
458 | repo.requirements.add('largefiles') |
|
467 | repo.requirements.add('largefiles') | |
459 | repo._writerequirements() |
|
468 | repo._writerequirements() | |
460 |
|
469 | |||
461 | ui.setconfig('hooks', 'changegroup.lfiles', checkrequireslfiles) |
|
470 | ui.setconfig('hooks', 'changegroup.lfiles', checkrequireslfiles) | |
462 | ui.setconfig('hooks', 'commit.lfiles', checkrequireslfiles) |
|
471 | ui.setconfig('hooks', 'commit.lfiles', checkrequireslfiles) |
@@ -1,1099 +1,1114 | |||||
1 | $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80 |
|
1 | $ "$TESTDIR/hghave" symlink unix-permissions serve || exit 80 | |
2 | $ USERCACHE=`pwd`/cache; export USERCACHE |
|
2 | $ USERCACHE=`pwd`/cache; export USERCACHE | |
3 | $ mkdir -p ${USERCACHE} |
|
3 | $ mkdir -p ${USERCACHE} | |
4 | $ cat >> $HGRCPATH <<EOF |
|
4 | $ cat >> $HGRCPATH <<EOF | |
5 | > [extensions] |
|
5 | > [extensions] | |
6 | > largefiles= |
|
6 | > largefiles= | |
7 | > purge= |
|
7 | > purge= | |
8 | > rebase= |
|
8 | > rebase= | |
9 | > transplant= |
|
9 | > transplant= | |
10 | > [phases] |
|
10 | > [phases] | |
11 | > publish=False |
|
11 | > publish=False | |
12 | > [largefiles] |
|
12 | > [largefiles] | |
13 | > minsize=2 |
|
13 | > minsize=2 | |
14 | > patterns=glob:**.dat |
|
14 | > patterns=glob:**.dat | |
15 | > usercache=${USERCACHE} |
|
15 | > usercache=${USERCACHE} | |
16 | > [hooks] |
|
16 | > [hooks] | |
17 | > precommit=echo "Invoking status precommit hook"; hg status |
|
17 | > precommit=echo "Invoking status precommit hook"; hg status | |
18 | > EOF |
|
18 | > EOF | |
19 |
|
19 | |||
20 | Create the repo with a couple of revisions of both large and normal |
|
20 | Create the repo with a couple of revisions of both large and normal | |
21 | files, testing that status correctly shows largefiles and that summary output |
|
21 | files, testing that status correctly shows largefiles and that summary output | |
22 | is correct. |
|
22 | is correct. | |
23 |
|
23 | |||
24 | $ hg init a |
|
24 | $ hg init a | |
25 | $ cd a |
|
25 | $ cd a | |
26 | $ mkdir sub |
|
26 | $ mkdir sub | |
27 | $ echo normal1 > normal1 |
|
27 | $ echo normal1 > normal1 | |
28 | $ echo normal2 > sub/normal2 |
|
28 | $ echo normal2 > sub/normal2 | |
29 | $ echo large1 > large1 |
|
29 | $ echo large1 > large1 | |
30 | $ echo large2 > sub/large2 |
|
30 | $ echo large2 > sub/large2 | |
31 | $ hg add normal1 sub/normal2 |
|
31 | $ hg add normal1 sub/normal2 | |
32 | $ hg add --large large1 sub/large2 |
|
32 | $ hg add --large large1 sub/large2 | |
33 | $ hg commit -m "add files" |
|
33 | $ hg commit -m "add files" | |
34 | Invoking status precommit hook |
|
34 | Invoking status precommit hook | |
35 | A large1 |
|
35 | A large1 | |
36 | A normal1 |
|
36 | A normal1 | |
37 | A sub/large2 |
|
37 | A sub/large2 | |
38 | A sub/normal2 |
|
38 | A sub/normal2 | |
39 | $ echo normal11 > normal1 |
|
39 | $ echo normal11 > normal1 | |
40 | $ echo normal22 > sub/normal2 |
|
40 | $ echo normal22 > sub/normal2 | |
41 | $ echo large11 > large1 |
|
41 | $ echo large11 > large1 | |
42 | $ echo large22 > sub/large2 |
|
42 | $ echo large22 > sub/large2 | |
43 | $ hg commit -m "edit files" |
|
43 | $ hg commit -m "edit files" | |
44 | Invoking status precommit hook |
|
44 | Invoking status precommit hook | |
45 | M large1 |
|
45 | M large1 | |
46 | M normal1 |
|
46 | M normal1 | |
47 | M sub/large2 |
|
47 | M sub/large2 | |
48 | M sub/normal2 |
|
48 | M sub/normal2 | |
49 | $ hg sum --large |
|
49 | $ hg sum --large | |
50 | parent: 1:ce8896473775 tip |
|
50 | parent: 1:ce8896473775 tip | |
51 | edit files |
|
51 | edit files | |
52 | branch: default |
|
52 | branch: default | |
53 | commit: (clean) |
|
53 | commit: (clean) | |
54 | update: (current) |
|
54 | update: (current) | |
55 | largefiles: No remote repo |
|
55 | largefiles: No remote repo | |
56 |
|
56 | |||
57 | Commit preserved largefile contents. |
|
57 | Commit preserved largefile contents. | |
58 |
|
58 | |||
59 | $ cat normal1 |
|
59 | $ cat normal1 | |
60 | normal11 |
|
60 | normal11 | |
61 | $ cat large1 |
|
61 | $ cat large1 | |
62 | large11 |
|
62 | large11 | |
63 | $ cat sub/normal2 |
|
63 | $ cat sub/normal2 | |
64 | normal22 |
|
64 | normal22 | |
65 | $ cat sub/large2 |
|
65 | $ cat sub/large2 | |
66 | large22 |
|
66 | large22 | |
67 |
|
67 | |||
|
68 | Test status, subdir and unknown files | |||
|
69 | ||||
|
70 | $ echo unknown > sub/unknown | |||
|
71 | $ hg st --all | |||
|
72 | ? sub/unknown | |||
|
73 | C large1 | |||
|
74 | C normal1 | |||
|
75 | C sub/large2 | |||
|
76 | C sub/normal2 | |||
|
77 | $ hg st --all sub | |||
|
78 | ? sub/unknown | |||
|
79 | C sub/large2 | |||
|
80 | C sub/normal2 | |||
|
81 | $ rm sub/unknown | |||
|
82 | ||||
68 | Remove both largefiles and normal files. |
|
83 | Remove both largefiles and normal files. | |
69 |
|
84 | |||
70 | $ hg remove normal1 large1 |
|
85 | $ hg remove normal1 large1 | |
71 | $ hg status large1 |
|
86 | $ hg status large1 | |
72 | R large1 |
|
87 | R large1 | |
73 | $ hg commit -m "remove files" |
|
88 | $ hg commit -m "remove files" | |
74 | Invoking status precommit hook |
|
89 | Invoking status precommit hook | |
75 | R large1 |
|
90 | R large1 | |
76 | R normal1 |
|
91 | R normal1 | |
77 | $ ls |
|
92 | $ ls | |
78 | sub |
|
93 | sub | |
79 | $ echo "testlargefile" > large1-test |
|
94 | $ echo "testlargefile" > large1-test | |
80 | $ hg add --large large1-test |
|
95 | $ hg add --large large1-test | |
81 | $ hg st |
|
96 | $ hg st | |
82 | A large1-test |
|
97 | A large1-test | |
83 | $ hg rm large1-test |
|
98 | $ hg rm large1-test | |
84 | not removing large1-test: file has been marked for add (use forget to undo) |
|
99 | not removing large1-test: file has been marked for add (use forget to undo) | |
85 | $ hg st |
|
100 | $ hg st | |
86 | A large1-test |
|
101 | A large1-test | |
87 | $ hg forget large1-test |
|
102 | $ hg forget large1-test | |
88 | $ hg st |
|
103 | $ hg st | |
89 | ? large1-test |
|
104 | ? large1-test | |
90 | $ rm large1-test |
|
105 | $ rm large1-test | |
91 |
|
106 | |||
92 | Copy both largefiles and normal files (testing that status output is correct). |
|
107 | Copy both largefiles and normal files (testing that status output is correct). | |
93 |
|
108 | |||
94 | $ hg cp sub/normal2 normal1 |
|
109 | $ hg cp sub/normal2 normal1 | |
95 | $ hg cp sub/large2 large1 |
|
110 | $ hg cp sub/large2 large1 | |
96 | $ hg commit -m "copy files" |
|
111 | $ hg commit -m "copy files" | |
97 | Invoking status precommit hook |
|
112 | Invoking status precommit hook | |
98 | A large1 |
|
113 | A large1 | |
99 | A normal1 |
|
114 | A normal1 | |
100 | $ cat normal1 |
|
115 | $ cat normal1 | |
101 | normal22 |
|
116 | normal22 | |
102 | $ cat large1 |
|
117 | $ cat large1 | |
103 | large22 |
|
118 | large22 | |
104 |
|
119 | |||
105 | Test moving largefiles and verify that normal files are also unaffected. |
|
120 | Test moving largefiles and verify that normal files are also unaffected. | |
106 |
|
121 | |||
107 | $ hg mv normal1 normal3 |
|
122 | $ hg mv normal1 normal3 | |
108 | $ hg mv large1 large3 |
|
123 | $ hg mv large1 large3 | |
109 | $ hg mv sub/normal2 sub/normal4 |
|
124 | $ hg mv sub/normal2 sub/normal4 | |
110 | $ hg mv sub/large2 sub/large4 |
|
125 | $ hg mv sub/large2 sub/large4 | |
111 | $ hg commit -m "move files" |
|
126 | $ hg commit -m "move files" | |
112 | Invoking status precommit hook |
|
127 | Invoking status precommit hook | |
113 | A large3 |
|
128 | A large3 | |
114 | A normal3 |
|
129 | A normal3 | |
115 | A sub/large4 |
|
130 | A sub/large4 | |
116 | A sub/normal4 |
|
131 | A sub/normal4 | |
117 | R large1 |
|
132 | R large1 | |
118 | R normal1 |
|
133 | R normal1 | |
119 | R sub/large2 |
|
134 | R sub/large2 | |
120 | R sub/normal2 |
|
135 | R sub/normal2 | |
121 | $ cat normal3 |
|
136 | $ cat normal3 | |
122 | normal22 |
|
137 | normal22 | |
123 | $ cat large3 |
|
138 | $ cat large3 | |
124 | large22 |
|
139 | large22 | |
125 | $ cat sub/normal4 |
|
140 | $ cat sub/normal4 | |
126 | normal22 |
|
141 | normal22 | |
127 | $ cat sub/large4 |
|
142 | $ cat sub/large4 | |
128 | large22 |
|
143 | large22 | |
129 |
|
144 | |||
130 | Test display of largefiles in hgweb |
|
145 | Test display of largefiles in hgweb | |
131 |
|
146 | |||
132 | $ hg serve -d -p $HGPORT --pid-file ../hg.pid |
|
147 | $ hg serve -d -p $HGPORT --pid-file ../hg.pid | |
133 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
148 | $ cat ../hg.pid >> $DAEMON_PIDS | |
134 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/?style=raw' |
|
149 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/?style=raw' | |
135 | 200 Script output follows |
|
150 | 200 Script output follows | |
136 |
|
151 | |||
137 |
|
152 | |||
138 | drwxr-xr-x sub |
|
153 | drwxr-xr-x sub | |
139 | -rw-r--r-- 41 large3 |
|
154 | -rw-r--r-- 41 large3 | |
140 | -rw-r--r-- 9 normal3 |
|
155 | -rw-r--r-- 9 normal3 | |
141 |
|
156 | |||
142 |
|
157 | |||
143 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/sub/?style=raw' |
|
158 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT '/file/tip/sub/?style=raw' | |
144 | 200 Script output follows |
|
159 | 200 Script output follows | |
145 |
|
160 | |||
146 |
|
161 | |||
147 | -rw-r--r-- 41 large4 |
|
162 | -rw-r--r-- 41 large4 | |
148 | -rw-r--r-- 9 normal4 |
|
163 | -rw-r--r-- 9 normal4 | |
149 |
|
164 | |||
150 |
|
165 | |||
151 | $ "$TESTDIR/killdaemons.py" |
|
166 | $ "$TESTDIR/killdaemons.py" | |
152 |
|
167 | |||
153 | Test archiving the various revisions. These hit corner cases known with |
|
168 | Test archiving the various revisions. These hit corner cases known with | |
154 | archiving. |
|
169 | archiving. | |
155 |
|
170 | |||
156 | $ hg archive -r 0 ../archive0 |
|
171 | $ hg archive -r 0 ../archive0 | |
157 | $ hg archive -r 1 ../archive1 |
|
172 | $ hg archive -r 1 ../archive1 | |
158 | $ hg archive -r 2 ../archive2 |
|
173 | $ hg archive -r 2 ../archive2 | |
159 | $ hg archive -r 3 ../archive3 |
|
174 | $ hg archive -r 3 ../archive3 | |
160 | $ hg archive -r 4 ../archive4 |
|
175 | $ hg archive -r 4 ../archive4 | |
161 | $ cd ../archive0 |
|
176 | $ cd ../archive0 | |
162 | $ cat normal1 |
|
177 | $ cat normal1 | |
163 | normal1 |
|
178 | normal1 | |
164 | $ cat large1 |
|
179 | $ cat large1 | |
165 | large1 |
|
180 | large1 | |
166 | $ cat sub/normal2 |
|
181 | $ cat sub/normal2 | |
167 | normal2 |
|
182 | normal2 | |
168 | $ cat sub/large2 |
|
183 | $ cat sub/large2 | |
169 | large2 |
|
184 | large2 | |
170 | $ cd ../archive1 |
|
185 | $ cd ../archive1 | |
171 | $ cat normal1 |
|
186 | $ cat normal1 | |
172 | normal11 |
|
187 | normal11 | |
173 | $ cat large1 |
|
188 | $ cat large1 | |
174 | large11 |
|
189 | large11 | |
175 | $ cat sub/normal2 |
|
190 | $ cat sub/normal2 | |
176 | normal22 |
|
191 | normal22 | |
177 | $ cat sub/large2 |
|
192 | $ cat sub/large2 | |
178 | large22 |
|
193 | large22 | |
179 | $ cd ../archive2 |
|
194 | $ cd ../archive2 | |
180 | $ ls |
|
195 | $ ls | |
181 | sub |
|
196 | sub | |
182 | $ cat sub/normal2 |
|
197 | $ cat sub/normal2 | |
183 | normal22 |
|
198 | normal22 | |
184 | $ cat sub/large2 |
|
199 | $ cat sub/large2 | |
185 | large22 |
|
200 | large22 | |
186 | $ cd ../archive3 |
|
201 | $ cd ../archive3 | |
187 | $ cat normal1 |
|
202 | $ cat normal1 | |
188 | normal22 |
|
203 | normal22 | |
189 | $ cat large1 |
|
204 | $ cat large1 | |
190 | large22 |
|
205 | large22 | |
191 | $ cat sub/normal2 |
|
206 | $ cat sub/normal2 | |
192 | normal22 |
|
207 | normal22 | |
193 | $ cat sub/large2 |
|
208 | $ cat sub/large2 | |
194 | large22 |
|
209 | large22 | |
195 | $ cd ../archive4 |
|
210 | $ cd ../archive4 | |
196 | $ cat normal3 |
|
211 | $ cat normal3 | |
197 | normal22 |
|
212 | normal22 | |
198 | $ cat large3 |
|
213 | $ cat large3 | |
199 | large22 |
|
214 | large22 | |
200 | $ cat sub/normal4 |
|
215 | $ cat sub/normal4 | |
201 | normal22 |
|
216 | normal22 | |
202 | $ cat sub/large4 |
|
217 | $ cat sub/large4 | |
203 | large22 |
|
218 | large22 | |
204 |
|
219 | |||
205 | Commit corner case: specify files to commit. |
|
220 | Commit corner case: specify files to commit. | |
206 |
|
221 | |||
207 | $ cd ../a |
|
222 | $ cd ../a | |
208 | $ echo normal3 > normal3 |
|
223 | $ echo normal3 > normal3 | |
209 | $ echo large3 > large3 |
|
224 | $ echo large3 > large3 | |
210 | $ echo normal4 > sub/normal4 |
|
225 | $ echo normal4 > sub/normal4 | |
211 | $ echo large4 > sub/large4 |
|
226 | $ echo large4 > sub/large4 | |
212 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" |
|
227 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" | |
213 | Invoking status precommit hook |
|
228 | Invoking status precommit hook | |
214 | M large3 |
|
229 | M large3 | |
215 | M normal3 |
|
230 | M normal3 | |
216 | M sub/large4 |
|
231 | M sub/large4 | |
217 | M sub/normal4 |
|
232 | M sub/normal4 | |
218 | $ cat normal3 |
|
233 | $ cat normal3 | |
219 | normal3 |
|
234 | normal3 | |
220 | $ cat large3 |
|
235 | $ cat large3 | |
221 | large3 |
|
236 | large3 | |
222 | $ cat sub/normal4 |
|
237 | $ cat sub/normal4 | |
223 | normal4 |
|
238 | normal4 | |
224 | $ cat sub/large4 |
|
239 | $ cat sub/large4 | |
225 | large4 |
|
240 | large4 | |
226 |
|
241 | |||
227 | One more commit corner case: commit from a subdirectory. |
|
242 | One more commit corner case: commit from a subdirectory. | |
228 |
|
243 | |||
229 | $ cd ../a |
|
244 | $ cd ../a | |
230 | $ echo normal33 > normal3 |
|
245 | $ echo normal33 > normal3 | |
231 | $ echo large33 > large3 |
|
246 | $ echo large33 > large3 | |
232 | $ echo normal44 > sub/normal4 |
|
247 | $ echo normal44 > sub/normal4 | |
233 | $ echo large44 > sub/large4 |
|
248 | $ echo large44 > sub/large4 | |
234 | $ cd sub |
|
249 | $ cd sub | |
235 | $ hg commit -m "edit files yet again" |
|
250 | $ hg commit -m "edit files yet again" | |
236 | Invoking status precommit hook |
|
251 | Invoking status precommit hook | |
237 | M large3 |
|
252 | M large3 | |
238 | M normal3 |
|
253 | M normal3 | |
239 | M sub/large4 |
|
254 | M sub/large4 | |
240 | M sub/normal4 |
|
255 | M sub/normal4 | |
241 | $ cat ../normal3 |
|
256 | $ cat ../normal3 | |
242 | normal33 |
|
257 | normal33 | |
243 | $ cat ../large3 |
|
258 | $ cat ../large3 | |
244 | large33 |
|
259 | large33 | |
245 | $ cat normal4 |
|
260 | $ cat normal4 | |
246 | normal44 |
|
261 | normal44 | |
247 | $ cat large4 |
|
262 | $ cat large4 | |
248 | large44 |
|
263 | large44 | |
249 |
|
264 | |||
250 | Committing standins is not allowed. |
|
265 | Committing standins is not allowed. | |
251 |
|
266 | |||
252 | $ cd .. |
|
267 | $ cd .. | |
253 | $ echo large3 > large3 |
|
268 | $ echo large3 > large3 | |
254 | $ hg commit .hglf/large3 -m "try to commit standin" |
|
269 | $ hg commit .hglf/large3 -m "try to commit standin" | |
255 | abort: file ".hglf/large3" is a largefile standin |
|
270 | abort: file ".hglf/large3" is a largefile standin | |
256 | (commit the largefile itself instead) |
|
271 | (commit the largefile itself instead) | |
257 | [255] |
|
272 | [255] | |
258 |
|
273 | |||
259 | Corner cases for adding largefiles. |
|
274 | Corner cases for adding largefiles. | |
260 |
|
275 | |||
261 | $ echo large5 > large5 |
|
276 | $ echo large5 > large5 | |
262 | $ hg add --large large5 |
|
277 | $ hg add --large large5 | |
263 | $ hg add --large large5 |
|
278 | $ hg add --large large5 | |
264 | large5 already a largefile |
|
279 | large5 already a largefile | |
265 | $ mkdir sub2 |
|
280 | $ mkdir sub2 | |
266 | $ echo large6 > sub2/large6 |
|
281 | $ echo large6 > sub2/large6 | |
267 | $ echo large7 > sub2/large7 |
|
282 | $ echo large7 > sub2/large7 | |
268 | $ hg add --large sub2 |
|
283 | $ hg add --large sub2 | |
269 | adding sub2/large6 as a largefile (glob) |
|
284 | adding sub2/large6 as a largefile (glob) | |
270 | adding sub2/large7 as a largefile (glob) |
|
285 | adding sub2/large7 as a largefile (glob) | |
271 | $ hg st |
|
286 | $ hg st | |
272 | M large3 |
|
287 | M large3 | |
273 | A large5 |
|
288 | A large5 | |
274 | A sub2/large6 |
|
289 | A sub2/large6 | |
275 | A sub2/large7 |
|
290 | A sub2/large7 | |
276 |
|
291 | |||
277 | Test "hg status" with combination of 'file pattern' and 'directory |
|
292 | Test "hg status" with combination of 'file pattern' and 'directory | |
278 | pattern' for largefiles: |
|
293 | pattern' for largefiles: | |
279 |
|
294 | |||
280 | $ hg status sub2/large6 sub2 |
|
295 | $ hg status sub2/large6 sub2 | |
281 | A sub2/large6 |
|
296 | A sub2/large6 | |
282 | A sub2/large7 |
|
297 | A sub2/large7 | |
283 |
|
298 | |||
284 | Config settings (pattern **.dat, minsize 2 MB) are respected. |
|
299 | Config settings (pattern **.dat, minsize 2 MB) are respected. | |
285 |
|
300 | |||
286 | $ echo testdata > test.dat |
|
301 | $ echo testdata > test.dat | |
287 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null |
|
302 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null | |
288 | $ hg add |
|
303 | $ hg add | |
289 | adding reallylarge as a largefile |
|
304 | adding reallylarge as a largefile | |
290 | adding test.dat as a largefile |
|
305 | adding test.dat as a largefile | |
291 |
|
306 | |||
292 | Test that minsize and --lfsize handle float values; |
|
307 | Test that minsize and --lfsize handle float values; | |
293 | also tests that --lfsize overrides largefiles.minsize. |
|
308 | also tests that --lfsize overrides largefiles.minsize. | |
294 | (0.250 MB = 256 kB = 262144 B) |
|
309 | (0.250 MB = 256 kB = 262144 B) | |
295 |
|
310 | |||
296 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null |
|
311 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null | |
297 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null |
|
312 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null | |
298 | $ hg --config largefiles.minsize=.25 add |
|
313 | $ hg --config largefiles.minsize=.25 add | |
299 | adding ratherlarge as a largefile |
|
314 | adding ratherlarge as a largefile | |
300 | adding medium |
|
315 | adding medium | |
301 | $ hg forget medium |
|
316 | $ hg forget medium | |
302 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
317 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
303 | adding medium as a largefile |
|
318 | adding medium as a largefile | |
304 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null |
|
319 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null | |
305 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
320 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
306 | adding notlarge |
|
321 | adding notlarge | |
307 | $ hg forget notlarge |
|
322 | $ hg forget notlarge | |
308 |
|
323 | |||
309 | Test forget on largefiles. |
|
324 | Test forget on largefiles. | |
310 |
|
325 | |||
311 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium |
|
326 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium | |
312 | $ hg commit -m "add/edit more largefiles" |
|
327 | $ hg commit -m "add/edit more largefiles" | |
313 | Invoking status precommit hook |
|
328 | Invoking status precommit hook | |
314 | A sub2/large6 |
|
329 | A sub2/large6 | |
315 | A sub2/large7 |
|
330 | A sub2/large7 | |
316 | R large3 |
|
331 | R large3 | |
317 | ? large5 |
|
332 | ? large5 | |
318 | ? medium |
|
333 | ? medium | |
319 | ? notlarge |
|
334 | ? notlarge | |
320 | ? ratherlarge |
|
335 | ? ratherlarge | |
321 | ? reallylarge |
|
336 | ? reallylarge | |
322 | ? test.dat |
|
337 | ? test.dat | |
323 | $ hg st |
|
338 | $ hg st | |
324 | ? large3 |
|
339 | ? large3 | |
325 | ? large5 |
|
340 | ? large5 | |
326 | ? medium |
|
341 | ? medium | |
327 | ? notlarge |
|
342 | ? notlarge | |
328 | ? ratherlarge |
|
343 | ? ratherlarge | |
329 | ? reallylarge |
|
344 | ? reallylarge | |
330 | ? test.dat |
|
345 | ? test.dat | |
331 |
|
346 | |||
332 | Purge with largefiles: verify that largefiles are still in the working |
|
347 | Purge with largefiles: verify that largefiles are still in the working | |
333 | dir after a purge. |
|
348 | dir after a purge. | |
334 |
|
349 | |||
335 | $ hg purge --all |
|
350 | $ hg purge --all | |
336 | $ cat sub/large4 |
|
351 | $ cat sub/large4 | |
337 | large44 |
|
352 | large44 | |
338 | $ cat sub2/large6 |
|
353 | $ cat sub2/large6 | |
339 | large6 |
|
354 | large6 | |
340 | $ cat sub2/large7 |
|
355 | $ cat sub2/large7 | |
341 | large7 |
|
356 | large7 | |
342 |
|
357 | |||
343 | Test addremove: verify that files that should be added as largfiles are added as |
|
358 | Test addremove: verify that files that should be added as largfiles are added as | |
344 | such and that already-existing largfiles are not added as normal files by |
|
359 | such and that already-existing largfiles are not added as normal files by | |
345 | accident. |
|
360 | accident. | |
346 |
|
361 | |||
347 | $ rm normal3 |
|
362 | $ rm normal3 | |
348 | $ rm sub/large4 |
|
363 | $ rm sub/large4 | |
349 | $ echo "testing addremove with patterns" > testaddremove.dat |
|
364 | $ echo "testing addremove with patterns" > testaddremove.dat | |
350 | $ echo "normaladdremove" > normaladdremove |
|
365 | $ echo "normaladdremove" > normaladdremove | |
351 | $ hg addremove |
|
366 | $ hg addremove | |
352 | removing sub/large4 |
|
367 | removing sub/large4 | |
353 | adding testaddremove.dat as a largefile |
|
368 | adding testaddremove.dat as a largefile | |
354 | removing normal3 |
|
369 | removing normal3 | |
355 | adding normaladdremove |
|
370 | adding normaladdremove | |
356 |
|
371 | |||
357 | Clone a largefiles repo. |
|
372 | Clone a largefiles repo. | |
358 |
|
373 | |||
359 | $ hg clone . ../b |
|
374 | $ hg clone . ../b | |
360 | updating to branch default |
|
375 | updating to branch default | |
361 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
376 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
362 | getting changed largefiles |
|
377 | getting changed largefiles | |
363 | 3 largefiles updated, 0 removed |
|
378 | 3 largefiles updated, 0 removed | |
364 | $ cd ../b |
|
379 | $ cd ../b | |
365 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
380 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
366 | 7:daea875e9014 add/edit more largefiles |
|
381 | 7:daea875e9014 add/edit more largefiles | |
367 | 6:4355d653f84f edit files yet again |
|
382 | 6:4355d653f84f edit files yet again | |
368 | 5:9d5af5072dbd edit files again |
|
383 | 5:9d5af5072dbd edit files again | |
369 | 4:74c02385b94c move files |
|
384 | 4:74c02385b94c move files | |
370 | 3:9e8fbc4bce62 copy files |
|
385 | 3:9e8fbc4bce62 copy files | |
371 | 2:51a0ae4d5864 remove files |
|
386 | 2:51a0ae4d5864 remove files | |
372 | 1:ce8896473775 edit files |
|
387 | 1:ce8896473775 edit files | |
373 | 0:30d30fe6a5be add files |
|
388 | 0:30d30fe6a5be add files | |
374 | $ cat normal3 |
|
389 | $ cat normal3 | |
375 | normal33 |
|
390 | normal33 | |
376 | $ cat sub/normal4 |
|
391 | $ cat sub/normal4 | |
377 | normal44 |
|
392 | normal44 | |
378 | $ cat sub/large4 |
|
393 | $ cat sub/large4 | |
379 | large44 |
|
394 | large44 | |
380 | $ cat sub2/large6 |
|
395 | $ cat sub2/large6 | |
381 | large6 |
|
396 | large6 | |
382 | $ cat sub2/large7 |
|
397 | $ cat sub2/large7 | |
383 | large7 |
|
398 | large7 | |
384 | $ cd .. |
|
399 | $ cd .. | |
385 | $ hg clone a -r 3 c |
|
400 | $ hg clone a -r 3 c | |
386 | adding changesets |
|
401 | adding changesets | |
387 | adding manifests |
|
402 | adding manifests | |
388 | adding file changes |
|
403 | adding file changes | |
389 | added 4 changesets with 10 changes to 4 files |
|
404 | added 4 changesets with 10 changes to 4 files | |
390 | updating to branch default |
|
405 | updating to branch default | |
391 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
406 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
392 | getting changed largefiles |
|
407 | getting changed largefiles | |
393 | 2 largefiles updated, 0 removed |
|
408 | 2 largefiles updated, 0 removed | |
394 | $ cd c |
|
409 | $ cd c | |
395 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
410 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
396 | 3:9e8fbc4bce62 copy files |
|
411 | 3:9e8fbc4bce62 copy files | |
397 | 2:51a0ae4d5864 remove files |
|
412 | 2:51a0ae4d5864 remove files | |
398 | 1:ce8896473775 edit files |
|
413 | 1:ce8896473775 edit files | |
399 | 0:30d30fe6a5be add files |
|
414 | 0:30d30fe6a5be add files | |
400 | $ cat normal1 |
|
415 | $ cat normal1 | |
401 | normal22 |
|
416 | normal22 | |
402 | $ cat large1 |
|
417 | $ cat large1 | |
403 | large22 |
|
418 | large22 | |
404 | $ cat sub/normal2 |
|
419 | $ cat sub/normal2 | |
405 | normal22 |
|
420 | normal22 | |
406 | $ cat sub/large2 |
|
421 | $ cat sub/large2 | |
407 | large22 |
|
422 | large22 | |
408 |
|
423 | |||
409 | Old revisions of a clone have correct largefiles content (this also |
|
424 | Old revisions of a clone have correct largefiles content (this also | |
410 | tests update). |
|
425 | tests update). | |
411 |
|
426 | |||
412 | $ hg update -r 1 |
|
427 | $ hg update -r 1 | |
413 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
428 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
414 | getting changed largefiles |
|
429 | getting changed largefiles | |
415 | 1 largefiles updated, 0 removed |
|
430 | 1 largefiles updated, 0 removed | |
416 | $ cat large1 |
|
431 | $ cat large1 | |
417 | large11 |
|
432 | large11 | |
418 | $ cat sub/large2 |
|
433 | $ cat sub/large2 | |
419 | large22 |
|
434 | large22 | |
420 |
|
435 | |||
421 | Rebasing between two repositories does not revert largefiles to old |
|
436 | Rebasing between two repositories does not revert largefiles to old | |
422 | revisions (this was a very bad bug that took a lot of work to fix). |
|
437 | revisions (this was a very bad bug that took a lot of work to fix). | |
423 |
|
438 | |||
424 | $ cd .. |
|
439 | $ cd .. | |
425 | $ hg clone a d |
|
440 | $ hg clone a d | |
426 | updating to branch default |
|
441 | updating to branch default | |
427 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
442 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
428 | getting changed largefiles |
|
443 | getting changed largefiles | |
429 | 3 largefiles updated, 0 removed |
|
444 | 3 largefiles updated, 0 removed | |
430 | $ cd b |
|
445 | $ cd b | |
431 | $ echo large4-modified > sub/large4 |
|
446 | $ echo large4-modified > sub/large4 | |
432 | $ echo normal3-modified > normal3 |
|
447 | $ echo normal3-modified > normal3 | |
433 | $ hg commit -m "modify normal file and largefile in repo b" |
|
448 | $ hg commit -m "modify normal file and largefile in repo b" | |
434 | Invoking status precommit hook |
|
449 | Invoking status precommit hook | |
435 | M normal3 |
|
450 | M normal3 | |
436 | M sub/large4 |
|
451 | M sub/large4 | |
437 | $ cd ../d |
|
452 | $ cd ../d | |
438 | $ echo large6-modified > sub2/large6 |
|
453 | $ echo large6-modified > sub2/large6 | |
439 | $ echo normal4-modified > sub/normal4 |
|
454 | $ echo normal4-modified > sub/normal4 | |
440 | $ hg commit -m "modify normal file largefile in repo d" |
|
455 | $ hg commit -m "modify normal file largefile in repo d" | |
441 | Invoking status precommit hook |
|
456 | Invoking status precommit hook | |
442 | M sub/normal4 |
|
457 | M sub/normal4 | |
443 | M sub2/large6 |
|
458 | M sub2/large6 | |
444 | $ cd .. |
|
459 | $ cd .. | |
445 | $ hg clone d e |
|
460 | $ hg clone d e | |
446 | updating to branch default |
|
461 | updating to branch default | |
447 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
462 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
448 | getting changed largefiles |
|
463 | getting changed largefiles | |
449 | 3 largefiles updated, 0 removed |
|
464 | 3 largefiles updated, 0 removed | |
450 | $ cd d |
|
465 | $ cd d | |
451 | $ hg pull --rebase ../b |
|
466 | $ hg pull --rebase ../b | |
452 | pulling from ../b |
|
467 | pulling from ../b | |
453 | searching for changes |
|
468 | searching for changes | |
454 | adding changesets |
|
469 | adding changesets | |
455 | adding manifests |
|
470 | adding manifests | |
456 | adding file changes |
|
471 | adding file changes | |
457 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
472 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
458 | Invoking status precommit hook |
|
473 | Invoking status precommit hook | |
459 | M sub/normal4 |
|
474 | M sub/normal4 | |
460 | M sub2/large6 |
|
475 | M sub2/large6 | |
461 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg |
|
476 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg | |
462 | nothing to rebase |
|
477 | nothing to rebase | |
463 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
478 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
464 | 9:598410d3eb9a modify normal file largefile in repo d |
|
479 | 9:598410d3eb9a modify normal file largefile in repo d | |
465 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
480 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
466 | 7:daea875e9014 add/edit more largefiles |
|
481 | 7:daea875e9014 add/edit more largefiles | |
467 | 6:4355d653f84f edit files yet again |
|
482 | 6:4355d653f84f edit files yet again | |
468 | 5:9d5af5072dbd edit files again |
|
483 | 5:9d5af5072dbd edit files again | |
469 | 4:74c02385b94c move files |
|
484 | 4:74c02385b94c move files | |
470 | 3:9e8fbc4bce62 copy files |
|
485 | 3:9e8fbc4bce62 copy files | |
471 | 2:51a0ae4d5864 remove files |
|
486 | 2:51a0ae4d5864 remove files | |
472 | 1:ce8896473775 edit files |
|
487 | 1:ce8896473775 edit files | |
473 | 0:30d30fe6a5be add files |
|
488 | 0:30d30fe6a5be add files | |
474 | $ cat normal3 |
|
489 | $ cat normal3 | |
475 | normal3-modified |
|
490 | normal3-modified | |
476 | $ cat sub/normal4 |
|
491 | $ cat sub/normal4 | |
477 | normal4-modified |
|
492 | normal4-modified | |
478 | $ cat sub/large4 |
|
493 | $ cat sub/large4 | |
479 | large4-modified |
|
494 | large4-modified | |
480 | $ cat sub2/large6 |
|
495 | $ cat sub2/large6 | |
481 | large6-modified |
|
496 | large6-modified | |
482 | $ cat sub2/large7 |
|
497 | $ cat sub2/large7 | |
483 | large7 |
|
498 | large7 | |
484 | $ cd ../e |
|
499 | $ cd ../e | |
485 | $ hg pull ../b |
|
500 | $ hg pull ../b | |
486 | pulling from ../b |
|
501 | pulling from ../b | |
487 | searching for changes |
|
502 | searching for changes | |
488 | adding changesets |
|
503 | adding changesets | |
489 | adding manifests |
|
504 | adding manifests | |
490 | adding file changes |
|
505 | adding file changes | |
491 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
506 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
492 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
507 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
493 | caching new largefiles |
|
508 | caching new largefiles | |
494 | 0 largefiles cached |
|
509 | 0 largefiles cached | |
495 | $ hg rebase |
|
510 | $ hg rebase | |
496 | Invoking status precommit hook |
|
511 | Invoking status precommit hook | |
497 | M sub/normal4 |
|
512 | M sub/normal4 | |
498 | M sub2/large6 |
|
513 | M sub2/large6 | |
499 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg |
|
514 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg | |
500 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
515 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
501 | 9:598410d3eb9a modify normal file largefile in repo d |
|
516 | 9:598410d3eb9a modify normal file largefile in repo d | |
502 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
517 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
503 | 7:daea875e9014 add/edit more largefiles |
|
518 | 7:daea875e9014 add/edit more largefiles | |
504 | 6:4355d653f84f edit files yet again |
|
519 | 6:4355d653f84f edit files yet again | |
505 | 5:9d5af5072dbd edit files again |
|
520 | 5:9d5af5072dbd edit files again | |
506 | 4:74c02385b94c move files |
|
521 | 4:74c02385b94c move files | |
507 | 3:9e8fbc4bce62 copy files |
|
522 | 3:9e8fbc4bce62 copy files | |
508 | 2:51a0ae4d5864 remove files |
|
523 | 2:51a0ae4d5864 remove files | |
509 | 1:ce8896473775 edit files |
|
524 | 1:ce8896473775 edit files | |
510 | 0:30d30fe6a5be add files |
|
525 | 0:30d30fe6a5be add files | |
511 | $ cat normal3 |
|
526 | $ cat normal3 | |
512 | normal3-modified |
|
527 | normal3-modified | |
513 | $ cat sub/normal4 |
|
528 | $ cat sub/normal4 | |
514 | normal4-modified |
|
529 | normal4-modified | |
515 | $ cat sub/large4 |
|
530 | $ cat sub/large4 | |
516 | large4-modified |
|
531 | large4-modified | |
517 | $ cat sub2/large6 |
|
532 | $ cat sub2/large6 | |
518 | large6-modified |
|
533 | large6-modified | |
519 | $ cat sub2/large7 |
|
534 | $ cat sub2/large7 | |
520 | large7 |
|
535 | large7 | |
521 |
|
536 | |||
522 | Rollback on largefiles. |
|
537 | Rollback on largefiles. | |
523 |
|
538 | |||
524 | $ echo large4-modified-again > sub/large4 |
|
539 | $ echo large4-modified-again > sub/large4 | |
525 | $ hg commit -m "Modify large4 again" |
|
540 | $ hg commit -m "Modify large4 again" | |
526 | Invoking status precommit hook |
|
541 | Invoking status precommit hook | |
527 | M sub/large4 |
|
542 | M sub/large4 | |
528 | $ hg rollback |
|
543 | $ hg rollback | |
529 | repository tip rolled back to revision 9 (undo commit) |
|
544 | repository tip rolled back to revision 9 (undo commit) | |
530 | working directory now based on revision 9 |
|
545 | working directory now based on revision 9 | |
531 | $ hg st |
|
546 | $ hg st | |
532 | M sub/large4 |
|
547 | M sub/large4 | |
533 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
548 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
534 | 9:598410d3eb9a modify normal file largefile in repo d |
|
549 | 9:598410d3eb9a modify normal file largefile in repo d | |
535 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
550 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
536 | 7:daea875e9014 add/edit more largefiles |
|
551 | 7:daea875e9014 add/edit more largefiles | |
537 | 6:4355d653f84f edit files yet again |
|
552 | 6:4355d653f84f edit files yet again | |
538 | 5:9d5af5072dbd edit files again |
|
553 | 5:9d5af5072dbd edit files again | |
539 | 4:74c02385b94c move files |
|
554 | 4:74c02385b94c move files | |
540 | 3:9e8fbc4bce62 copy files |
|
555 | 3:9e8fbc4bce62 copy files | |
541 | 2:51a0ae4d5864 remove files |
|
556 | 2:51a0ae4d5864 remove files | |
542 | 1:ce8896473775 edit files |
|
557 | 1:ce8896473775 edit files | |
543 | 0:30d30fe6a5be add files |
|
558 | 0:30d30fe6a5be add files | |
544 | $ cat sub/large4 |
|
559 | $ cat sub/large4 | |
545 | large4-modified-again |
|
560 | large4-modified-again | |
546 |
|
561 | |||
547 | "update --check" refuses to update with uncommitted changes. |
|
562 | "update --check" refuses to update with uncommitted changes. | |
548 | $ hg update --check 8 |
|
563 | $ hg update --check 8 | |
549 | abort: uncommitted local changes |
|
564 | abort: uncommitted local changes | |
550 | [255] |
|
565 | [255] | |
551 |
|
566 | |||
552 | "update --clean" leaves correct largefiles in working copy. |
|
567 | "update --clean" leaves correct largefiles in working copy. | |
553 |
|
568 | |||
554 | $ hg update --clean |
|
569 | $ hg update --clean | |
555 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
570 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
556 | getting changed largefiles |
|
571 | getting changed largefiles | |
557 | 1 largefiles updated, 0 removed |
|
572 | 1 largefiles updated, 0 removed | |
558 | $ cat normal3 |
|
573 | $ cat normal3 | |
559 | normal3-modified |
|
574 | normal3-modified | |
560 | $ cat sub/normal4 |
|
575 | $ cat sub/normal4 | |
561 | normal4-modified |
|
576 | normal4-modified | |
562 | $ cat sub/large4 |
|
577 | $ cat sub/large4 | |
563 | large4-modified |
|
578 | large4-modified | |
564 | $ cat sub2/large6 |
|
579 | $ cat sub2/large6 | |
565 | large6-modified |
|
580 | large6-modified | |
566 | $ cat sub2/large7 |
|
581 | $ cat sub2/large7 | |
567 | large7 |
|
582 | large7 | |
568 |
|
583 | |||
569 | Now "update check" is happy. |
|
584 | Now "update check" is happy. | |
570 | $ hg update --check 8 |
|
585 | $ hg update --check 8 | |
571 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
586 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
572 | getting changed largefiles |
|
587 | getting changed largefiles | |
573 | 1 largefiles updated, 0 removed |
|
588 | 1 largefiles updated, 0 removed | |
574 | $ hg update --check |
|
589 | $ hg update --check | |
575 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
590 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
576 | getting changed largefiles |
|
591 | getting changed largefiles | |
577 | 1 largefiles updated, 0 removed |
|
592 | 1 largefiles updated, 0 removed | |
578 |
|
593 | |||
579 | Test removing empty largefiles directories on update |
|
594 | Test removing empty largefiles directories on update | |
580 | $ test -d sub2 && echo "sub2 exists" |
|
595 | $ test -d sub2 && echo "sub2 exists" | |
581 | sub2 exists |
|
596 | sub2 exists | |
582 | $ hg update -q null |
|
597 | $ hg update -q null | |
583 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
598 | $ test -d sub2 && echo "error: sub2 should not exist anymore" | |
584 | [1] |
|
599 | [1] | |
585 | $ hg update -q |
|
600 | $ hg update -q | |
586 |
|
601 | |||
587 | Test hg remove removes empty largefiles directories |
|
602 | Test hg remove removes empty largefiles directories | |
588 | $ test -d sub2 && echo "sub2 exists" |
|
603 | $ test -d sub2 && echo "sub2 exists" | |
589 | sub2 exists |
|
604 | sub2 exists | |
590 | $ hg remove sub2/* |
|
605 | $ hg remove sub2/* | |
591 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
606 | $ test -d sub2 && echo "error: sub2 should not exist anymore" | |
592 | [1] |
|
607 | [1] | |
593 | $ hg revert sub2/large6 sub2/large7 |
|
608 | $ hg revert sub2/large6 sub2/large7 | |
594 |
|
609 | |||
595 | "revert" works on largefiles (and normal files too). |
|
610 | "revert" works on largefiles (and normal files too). | |
596 | $ echo hack3 >> normal3 |
|
611 | $ echo hack3 >> normal3 | |
597 | $ echo hack4 >> sub/normal4 |
|
612 | $ echo hack4 >> sub/normal4 | |
598 | $ echo hack4 >> sub/large4 |
|
613 | $ echo hack4 >> sub/large4 | |
599 | $ rm sub2/large6 |
|
614 | $ rm sub2/large6 | |
600 | $ hg revert sub2/large6 |
|
615 | $ hg revert sub2/large6 | |
601 | $ hg rm sub2/large6 |
|
616 | $ hg rm sub2/large6 | |
602 | $ echo new >> sub2/large8 |
|
617 | $ echo new >> sub2/large8 | |
603 | $ hg add --large sub2/large8 |
|
618 | $ hg add --large sub2/large8 | |
604 | # XXX we don't really want to report that we're reverting the standin; |
|
619 | # XXX we don't really want to report that we're reverting the standin; | |
605 | # that's just an implementation detail. But I don't see an obvious fix. ;-( |
|
620 | # that's just an implementation detail. But I don't see an obvious fix. ;-( | |
606 | $ hg revert sub |
|
621 | $ hg revert sub | |
607 | reverting .hglf/sub/large4 (glob) |
|
622 | reverting .hglf/sub/large4 (glob) | |
608 | reverting sub/normal4 (glob) |
|
623 | reverting sub/normal4 (glob) | |
609 | $ hg status |
|
624 | $ hg status | |
610 | M normal3 |
|
625 | M normal3 | |
611 | A sub2/large8 |
|
626 | A sub2/large8 | |
612 | R sub2/large6 |
|
627 | R sub2/large6 | |
613 | ? sub/large4.orig |
|
628 | ? sub/large4.orig | |
614 | ? sub/normal4.orig |
|
629 | ? sub/normal4.orig | |
615 | $ cat sub/normal4 |
|
630 | $ cat sub/normal4 | |
616 | normal4-modified |
|
631 | normal4-modified | |
617 | $ cat sub/large4 |
|
632 | $ cat sub/large4 | |
618 | large4-modified |
|
633 | large4-modified | |
619 | $ hg revert -a --no-backup |
|
634 | $ hg revert -a --no-backup | |
620 | undeleting .hglf/sub2/large6 (glob) |
|
635 | undeleting .hglf/sub2/large6 (glob) | |
621 | forgetting .hglf/sub2/large8 (glob) |
|
636 | forgetting .hglf/sub2/large8 (glob) | |
622 | reverting normal3 |
|
637 | reverting normal3 | |
623 | $ hg status |
|
638 | $ hg status | |
624 | ? sub/large4.orig |
|
639 | ? sub/large4.orig | |
625 | ? sub/normal4.orig |
|
640 | ? sub/normal4.orig | |
626 | ? sub2/large8 |
|
641 | ? sub2/large8 | |
627 | $ cat normal3 |
|
642 | $ cat normal3 | |
628 | normal3-modified |
|
643 | normal3-modified | |
629 | $ cat sub2/large6 |
|
644 | $ cat sub2/large6 | |
630 | large6-modified |
|
645 | large6-modified | |
631 | $ rm sub/*.orig sub2/large8 |
|
646 | $ rm sub/*.orig sub2/large8 | |
632 |
|
647 | |||
633 | revert some files to an older revision |
|
648 | revert some files to an older revision | |
634 | $ hg revert --no-backup -r 8 sub2 |
|
649 | $ hg revert --no-backup -r 8 sub2 | |
635 | reverting .hglf/sub2/large6 (glob) |
|
650 | reverting .hglf/sub2/large6 (glob) | |
636 | $ cat sub2/large6 |
|
651 | $ cat sub2/large6 | |
637 | large6 |
|
652 | large6 | |
638 | $ hg revert --no-backup sub2 |
|
653 | $ hg revert --no-backup sub2 | |
639 | reverting .hglf/sub2/large6 (glob) |
|
654 | reverting .hglf/sub2/large6 (glob) | |
640 | $ hg status |
|
655 | $ hg status | |
641 |
|
656 | |||
642 | "verify --large" actually verifies largefiles |
|
657 | "verify --large" actually verifies largefiles | |
643 |
|
658 | |||
644 | $ hg verify --large |
|
659 | $ hg verify --large | |
645 | checking changesets |
|
660 | checking changesets | |
646 | checking manifests |
|
661 | checking manifests | |
647 | crosschecking files in changesets and manifests |
|
662 | crosschecking files in changesets and manifests | |
648 | checking files |
|
663 | checking files | |
649 | 10 files, 10 changesets, 28 total revisions |
|
664 | 10 files, 10 changesets, 28 total revisions | |
650 | searching 1 changesets for largefiles |
|
665 | searching 1 changesets for largefiles | |
651 | verified existence of 3 revisions of 3 largefiles |
|
666 | verified existence of 3 revisions of 3 largefiles | |
652 |
|
667 | |||
653 | Merging does not revert to old versions of largefiles and also check |
|
668 | Merging does not revert to old versions of largefiles and also check | |
654 | that merging after having pulled from a non-default remote works |
|
669 | that merging after having pulled from a non-default remote works | |
655 | correctly. |
|
670 | correctly. | |
656 |
|
671 | |||
657 | $ cd .. |
|
672 | $ cd .. | |
658 | $ hg clone -r 7 e temp |
|
673 | $ hg clone -r 7 e temp | |
659 | adding changesets |
|
674 | adding changesets | |
660 | adding manifests |
|
675 | adding manifests | |
661 | adding file changes |
|
676 | adding file changes | |
662 | added 8 changesets with 24 changes to 10 files |
|
677 | added 8 changesets with 24 changes to 10 files | |
663 | updating to branch default |
|
678 | updating to branch default | |
664 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
679 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
665 | getting changed largefiles |
|
680 | getting changed largefiles | |
666 | 3 largefiles updated, 0 removed |
|
681 | 3 largefiles updated, 0 removed | |
667 | $ hg clone temp f |
|
682 | $ hg clone temp f | |
668 | updating to branch default |
|
683 | updating to branch default | |
669 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
684 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
670 | getting changed largefiles |
|
685 | getting changed largefiles | |
671 | 3 largefiles updated, 0 removed |
|
686 | 3 largefiles updated, 0 removed | |
672 | # Delete the largefiles in the largefiles system cache so that we have an |
|
687 | # Delete the largefiles in the largefiles system cache so that we have an | |
673 | # opportunity to test that caching after a pull works. |
|
688 | # opportunity to test that caching after a pull works. | |
674 | $ rm ${USERCACHE}/* |
|
689 | $ rm ${USERCACHE}/* | |
675 | $ cd f |
|
690 | $ cd f | |
676 | $ echo "large4-merge-test" > sub/large4 |
|
691 | $ echo "large4-merge-test" > sub/large4 | |
677 | $ hg commit -m "Modify large4 to test merge" |
|
692 | $ hg commit -m "Modify large4 to test merge" | |
678 | Invoking status precommit hook |
|
693 | Invoking status precommit hook | |
679 | M sub/large4 |
|
694 | M sub/large4 | |
680 | $ hg pull ../e |
|
695 | $ hg pull ../e | |
681 | pulling from ../e |
|
696 | pulling from ../e | |
682 | searching for changes |
|
697 | searching for changes | |
683 | adding changesets |
|
698 | adding changesets | |
684 | adding manifests |
|
699 | adding manifests | |
685 | adding file changes |
|
700 | adding file changes | |
686 | added 2 changesets with 4 changes to 4 files (+1 heads) |
|
701 | added 2 changesets with 4 changes to 4 files (+1 heads) | |
687 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
702 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
688 | caching new largefiles |
|
703 | caching new largefiles | |
689 | 2 largefiles cached |
|
704 | 2 largefiles cached | |
690 | $ hg merge |
|
705 | $ hg merge | |
691 | merging sub/large4 |
|
706 | merging sub/large4 | |
692 | largefile sub/large4 has a merge conflict |
|
707 | largefile sub/large4 has a merge conflict | |
693 | keep (l)ocal or take (o)ther? l |
|
708 | keep (l)ocal or take (o)ther? l | |
694 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
709 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
695 | (branch merge, don't forget to commit) |
|
710 | (branch merge, don't forget to commit) | |
696 | getting changed largefiles |
|
711 | getting changed largefiles | |
697 | 1 largefiles updated, 0 removed |
|
712 | 1 largefiles updated, 0 removed | |
698 | $ hg commit -m "Merge repos e and f" |
|
713 | $ hg commit -m "Merge repos e and f" | |
699 | Invoking status precommit hook |
|
714 | Invoking status precommit hook | |
700 | M normal3 |
|
715 | M normal3 | |
701 | M sub/normal4 |
|
716 | M sub/normal4 | |
702 | M sub2/large6 |
|
717 | M sub2/large6 | |
703 | $ cat normal3 |
|
718 | $ cat normal3 | |
704 | normal3-modified |
|
719 | normal3-modified | |
705 | $ cat sub/normal4 |
|
720 | $ cat sub/normal4 | |
706 | normal4-modified |
|
721 | normal4-modified | |
707 | $ cat sub/large4 |
|
722 | $ cat sub/large4 | |
708 | large4-merge-test |
|
723 | large4-merge-test | |
709 | $ cat sub2/large6 |
|
724 | $ cat sub2/large6 | |
710 | large6-modified |
|
725 | large6-modified | |
711 | $ cat sub2/large7 |
|
726 | $ cat sub2/large7 | |
712 | large7 |
|
727 | large7 | |
713 |
|
728 | |||
714 | Test status after merging with a branch that introduces a new largefile: |
|
729 | Test status after merging with a branch that introduces a new largefile: | |
715 |
|
730 | |||
716 | $ echo large > large |
|
731 | $ echo large > large | |
717 | $ hg add --large large |
|
732 | $ hg add --large large | |
718 | $ hg commit -m 'add largefile' |
|
733 | $ hg commit -m 'add largefile' | |
719 | Invoking status precommit hook |
|
734 | Invoking status precommit hook | |
720 | A large |
|
735 | A large | |
721 | $ hg update -q ".^" |
|
736 | $ hg update -q ".^" | |
722 | $ echo change >> normal3 |
|
737 | $ echo change >> normal3 | |
723 | $ hg commit -m 'some change' |
|
738 | $ hg commit -m 'some change' | |
724 | Invoking status precommit hook |
|
739 | Invoking status precommit hook | |
725 | M normal3 |
|
740 | M normal3 | |
726 | created new head |
|
741 | created new head | |
727 | $ hg merge |
|
742 | $ hg merge | |
728 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
743 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
729 | (branch merge, don't forget to commit) |
|
744 | (branch merge, don't forget to commit) | |
730 | getting changed largefiles |
|
745 | getting changed largefiles | |
731 | 1 largefiles updated, 0 removed |
|
746 | 1 largefiles updated, 0 removed | |
732 | $ hg status |
|
747 | $ hg status | |
733 | M large |
|
748 | M large | |
734 |
|
749 | |||
735 | Test that a normal file and a largefile with the same name and path cannot |
|
750 | Test that a normal file and a largefile with the same name and path cannot | |
736 | coexist. |
|
751 | coexist. | |
737 |
|
752 | |||
738 | $ rm sub2/large7 |
|
753 | $ rm sub2/large7 | |
739 | $ echo "largeasnormal" > sub2/large7 |
|
754 | $ echo "largeasnormal" > sub2/large7 | |
740 | $ hg add sub2/large7 |
|
755 | $ hg add sub2/large7 | |
741 | sub2/large7 already a largefile |
|
756 | sub2/large7 already a largefile | |
742 |
|
757 | |||
743 | Test that transplanting a largefile change works correctly. |
|
758 | Test that transplanting a largefile change works correctly. | |
744 |
|
759 | |||
745 | $ cd .. |
|
760 | $ cd .. | |
746 | $ hg clone -r 8 d g |
|
761 | $ hg clone -r 8 d g | |
747 | adding changesets |
|
762 | adding changesets | |
748 | adding manifests |
|
763 | adding manifests | |
749 | adding file changes |
|
764 | adding file changes | |
750 | added 9 changesets with 26 changes to 10 files |
|
765 | added 9 changesets with 26 changes to 10 files | |
751 | updating to branch default |
|
766 | updating to branch default | |
752 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
767 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
753 | getting changed largefiles |
|
768 | getting changed largefiles | |
754 | 3 largefiles updated, 0 removed |
|
769 | 3 largefiles updated, 0 removed | |
755 | $ cd g |
|
770 | $ cd g | |
756 | $ hg transplant -s ../d 598410d3eb9a |
|
771 | $ hg transplant -s ../d 598410d3eb9a | |
757 | searching for changes |
|
772 | searching for changes | |
758 | searching for changes |
|
773 | searching for changes | |
759 | adding changesets |
|
774 | adding changesets | |
760 | adding manifests |
|
775 | adding manifests | |
761 | adding file changes |
|
776 | adding file changes | |
762 | added 1 changesets with 2 changes to 2 files |
|
777 | added 1 changesets with 2 changes to 2 files | |
763 | getting changed largefiles |
|
778 | getting changed largefiles | |
764 | 1 largefiles updated, 0 removed |
|
779 | 1 largefiles updated, 0 removed | |
765 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
780 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
766 | 9:598410d3eb9a modify normal file largefile in repo d |
|
781 | 9:598410d3eb9a modify normal file largefile in repo d | |
767 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
782 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
768 | 7:daea875e9014 add/edit more largefiles |
|
783 | 7:daea875e9014 add/edit more largefiles | |
769 | 6:4355d653f84f edit files yet again |
|
784 | 6:4355d653f84f edit files yet again | |
770 | 5:9d5af5072dbd edit files again |
|
785 | 5:9d5af5072dbd edit files again | |
771 | 4:74c02385b94c move files |
|
786 | 4:74c02385b94c move files | |
772 | 3:9e8fbc4bce62 copy files |
|
787 | 3:9e8fbc4bce62 copy files | |
773 | 2:51a0ae4d5864 remove files |
|
788 | 2:51a0ae4d5864 remove files | |
774 | 1:ce8896473775 edit files |
|
789 | 1:ce8896473775 edit files | |
775 | 0:30d30fe6a5be add files |
|
790 | 0:30d30fe6a5be add files | |
776 | $ cat normal3 |
|
791 | $ cat normal3 | |
777 | normal3-modified |
|
792 | normal3-modified | |
778 | $ cat sub/normal4 |
|
793 | $ cat sub/normal4 | |
779 | normal4-modified |
|
794 | normal4-modified | |
780 | $ cat sub/large4 |
|
795 | $ cat sub/large4 | |
781 | large4-modified |
|
796 | large4-modified | |
782 | $ cat sub2/large6 |
|
797 | $ cat sub2/large6 | |
783 | large6-modified |
|
798 | large6-modified | |
784 | $ cat sub2/large7 |
|
799 | $ cat sub2/large7 | |
785 | large7 |
|
800 | large7 | |
786 |
|
801 | |||
787 | Cat a largefile |
|
802 | Cat a largefile | |
788 | $ hg cat normal3 |
|
803 | $ hg cat normal3 | |
789 | normal3-modified |
|
804 | normal3-modified | |
790 | $ hg cat sub/large4 |
|
805 | $ hg cat sub/large4 | |
791 | large4-modified |
|
806 | large4-modified | |
792 | $ rm ${USERCACHE}/* |
|
807 | $ rm ${USERCACHE}/* | |
793 | $ hg cat -r a381d2c8c80e -o cat.out sub/large4 |
|
808 | $ hg cat -r a381d2c8c80e -o cat.out sub/large4 | |
794 | $ cat cat.out |
|
809 | $ cat cat.out | |
795 | large4-modified |
|
810 | large4-modified | |
796 | $ rm cat.out |
|
811 | $ rm cat.out | |
797 | $ hg cat -r a381d2c8c80e normal3 |
|
812 | $ hg cat -r a381d2c8c80e normal3 | |
798 | normal3-modified |
|
813 | normal3-modified | |
799 |
|
814 | |||
800 | Test that renaming a largefile results in correct output for status |
|
815 | Test that renaming a largefile results in correct output for status | |
801 |
|
816 | |||
802 | $ hg rename sub/large4 large4-renamed |
|
817 | $ hg rename sub/large4 large4-renamed | |
803 | $ hg commit -m "test rename output" |
|
818 | $ hg commit -m "test rename output" | |
804 | Invoking status precommit hook |
|
819 | Invoking status precommit hook | |
805 | A large4-renamed |
|
820 | A large4-renamed | |
806 | R sub/large4 |
|
821 | R sub/large4 | |
807 | $ cat large4-renamed |
|
822 | $ cat large4-renamed | |
808 | large4-modified |
|
823 | large4-modified | |
809 | $ cd sub2 |
|
824 | $ cd sub2 | |
810 | $ hg rename large6 large6-renamed |
|
825 | $ hg rename large6 large6-renamed | |
811 | $ hg st |
|
826 | $ hg st | |
812 | A sub2/large6-renamed |
|
827 | A sub2/large6-renamed | |
813 | R sub2/large6 |
|
828 | R sub2/large6 | |
814 | $ cd .. |
|
829 | $ cd .. | |
815 |
|
830 | |||
816 | Test --normal flag |
|
831 | Test --normal flag | |
817 |
|
832 | |||
818 | $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null |
|
833 | $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null | |
819 | $ hg add --normal --large new-largefile |
|
834 | $ hg add --normal --large new-largefile | |
820 | abort: --normal cannot be used with --large |
|
835 | abort: --normal cannot be used with --large | |
821 | [255] |
|
836 | [255] | |
822 | $ hg add --normal new-largefile |
|
837 | $ hg add --normal new-largefile | |
823 | new-largefile: up to 69 MB of RAM may be required to manage this file |
|
838 | new-largefile: up to 69 MB of RAM may be required to manage this file | |
824 | (use 'hg revert new-largefile' to cancel the pending addition) |
|
839 | (use 'hg revert new-largefile' to cancel the pending addition) | |
825 | $ cd .. |
|
840 | $ cd .. | |
826 |
|
841 | |||
827 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
842 | vanilla clients not locked out from largefiles servers on vanilla repos | |
828 | $ mkdir r1 |
|
843 | $ mkdir r1 | |
829 | $ cd r1 |
|
844 | $ cd r1 | |
830 | $ hg init |
|
845 | $ hg init | |
831 | $ echo c1 > f1 |
|
846 | $ echo c1 > f1 | |
832 | $ hg add f1 |
|
847 | $ hg add f1 | |
833 | $ hg commit -m "m1" |
|
848 | $ hg commit -m "m1" | |
834 | Invoking status precommit hook |
|
849 | Invoking status precommit hook | |
835 | A f1 |
|
850 | A f1 | |
836 | $ cd .. |
|
851 | $ cd .. | |
837 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
852 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid | |
838 | $ cat hg.pid >> $DAEMON_PIDS |
|
853 | $ cat hg.pid >> $DAEMON_PIDS | |
839 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
854 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 | |
840 | requesting all changes |
|
855 | requesting all changes | |
841 | adding changesets |
|
856 | adding changesets | |
842 | adding manifests |
|
857 | adding manifests | |
843 | adding file changes |
|
858 | adding file changes | |
844 | added 1 changesets with 1 changes to 1 files |
|
859 | added 1 changesets with 1 changes to 1 files | |
845 | updating to branch default |
|
860 | updating to branch default | |
846 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
861 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
847 |
|
862 | |||
848 | largefiles clients still work with vanilla servers |
|
863 | largefiles clients still work with vanilla servers | |
849 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid |
|
864 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid | |
850 | $ cat hg.pid >> $DAEMON_PIDS |
|
865 | $ cat hg.pid >> $DAEMON_PIDS | |
851 | $ hg clone http://localhost:$HGPORT1 r3 |
|
866 | $ hg clone http://localhost:$HGPORT1 r3 | |
852 | requesting all changes |
|
867 | requesting all changes | |
853 | adding changesets |
|
868 | adding changesets | |
854 | adding manifests |
|
869 | adding manifests | |
855 | adding file changes |
|
870 | adding file changes | |
856 | added 1 changesets with 1 changes to 1 files |
|
871 | added 1 changesets with 1 changes to 1 files | |
857 | updating to branch default |
|
872 | updating to branch default | |
858 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
873 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
859 |
|
874 | |||
860 | vanilla clients locked out from largefiles http repos |
|
875 | vanilla clients locked out from largefiles http repos | |
861 | $ mkdir r4 |
|
876 | $ mkdir r4 | |
862 | $ cd r4 |
|
877 | $ cd r4 | |
863 | $ hg init |
|
878 | $ hg init | |
864 | $ echo c1 > f1 |
|
879 | $ echo c1 > f1 | |
865 | $ hg add --large f1 |
|
880 | $ hg add --large f1 | |
866 | $ hg commit -m "m1" |
|
881 | $ hg commit -m "m1" | |
867 | Invoking status precommit hook |
|
882 | Invoking status precommit hook | |
868 | A f1 |
|
883 | A f1 | |
869 | $ cd .. |
|
884 | $ cd .. | |
870 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
885 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid | |
871 | $ cat hg.pid >> $DAEMON_PIDS |
|
886 | $ cat hg.pid >> $DAEMON_PIDS | |
872 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
887 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 | |
873 | abort: remote error: |
|
888 | abort: remote error: | |
874 |
|
889 | |||
875 | This repository uses the largefiles extension. |
|
890 | This repository uses the largefiles extension. | |
876 |
|
891 | |||
877 | Please enable it in your Mercurial config file. |
|
892 | Please enable it in your Mercurial config file. | |
878 | [255] |
|
893 | [255] | |
879 |
|
894 | |||
880 | used all HGPORTs, kill all daemons |
|
895 | used all HGPORTs, kill all daemons | |
881 | $ "$TESTDIR/killdaemons.py" |
|
896 | $ "$TESTDIR/killdaemons.py" | |
882 |
|
897 | |||
883 | vanilla clients locked out from largefiles ssh repos |
|
898 | vanilla clients locked out from largefiles ssh repos | |
884 | $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 |
|
899 | $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 | |
885 | abort: remote error: |
|
900 | abort: remote error: | |
886 |
|
901 | |||
887 | This repository uses the largefiles extension. |
|
902 | This repository uses the largefiles extension. | |
888 |
|
903 | |||
889 | Please enable it in your Mercurial config file. |
|
904 | Please enable it in your Mercurial config file. | |
890 | [255] |
|
905 | [255] | |
891 |
|
906 | |||
892 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
907 | largefiles clients refuse to push largefiles repos to vanilla servers | |
893 | $ mkdir r6 |
|
908 | $ mkdir r6 | |
894 | $ cd r6 |
|
909 | $ cd r6 | |
895 | $ hg init |
|
910 | $ hg init | |
896 | $ echo c1 > f1 |
|
911 | $ echo c1 > f1 | |
897 | $ hg add f1 |
|
912 | $ hg add f1 | |
898 | $ hg commit -m "m1" |
|
913 | $ hg commit -m "m1" | |
899 | Invoking status precommit hook |
|
914 | Invoking status precommit hook | |
900 | A f1 |
|
915 | A f1 | |
901 | $ cat >> .hg/hgrc <<! |
|
916 | $ cat >> .hg/hgrc <<! | |
902 | > [web] |
|
917 | > [web] | |
903 | > push_ssl = false |
|
918 | > push_ssl = false | |
904 | > allow_push = * |
|
919 | > allow_push = * | |
905 | > ! |
|
920 | > ! | |
906 | $ cd .. |
|
921 | $ cd .. | |
907 | $ hg clone r6 r7 |
|
922 | $ hg clone r6 r7 | |
908 | updating to branch default |
|
923 | updating to branch default | |
909 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
924 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
910 | $ cd r7 |
|
925 | $ cd r7 | |
911 | $ echo c2 > f2 |
|
926 | $ echo c2 > f2 | |
912 | $ hg add --large f2 |
|
927 | $ hg add --large f2 | |
913 | $ hg commit -m "m2" |
|
928 | $ hg commit -m "m2" | |
914 | Invoking status precommit hook |
|
929 | Invoking status precommit hook | |
915 | A f2 |
|
930 | A f2 | |
916 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid |
|
931 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid | |
917 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
932 | $ cat ../hg.pid >> $DAEMON_PIDS | |
918 | $ hg push http://localhost:$HGPORT |
|
933 | $ hg push http://localhost:$HGPORT | |
919 | pushing to http://localhost:$HGPORT/ |
|
934 | pushing to http://localhost:$HGPORT/ | |
920 | searching for changes |
|
935 | searching for changes | |
921 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store |
|
936 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store | |
922 | [255] |
|
937 | [255] | |
923 | $ cd .. |
|
938 | $ cd .. | |
924 |
|
939 | |||
925 | putlfile errors are shown (issue3123) |
|
940 | putlfile errors are shown (issue3123) | |
926 | Corrupt the cached largefile in r7 |
|
941 | Corrupt the cached largefile in r7 | |
927 | $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
942 | $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
928 | $ hg init empty |
|
943 | $ hg init empty | |
929 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ |
|
944 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ | |
930 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
945 | > --config 'web.allow_push=*' --config web.push_ssl=False | |
931 | $ cat hg.pid >> $DAEMON_PIDS |
|
946 | $ cat hg.pid >> $DAEMON_PIDS | |
932 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
947 | $ hg push -R r7 http://localhost:$HGPORT1 | |
933 | pushing to http://localhost:$HGPORT1/ |
|
948 | pushing to http://localhost:$HGPORT1/ | |
934 | searching for changes |
|
949 | searching for changes | |
935 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash |
|
950 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash | |
936 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ |
|
951 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ | |
937 | [255] |
|
952 | [255] | |
938 | $ rm -rf empty |
|
953 | $ rm -rf empty | |
939 |
|
954 | |||
940 | Clone a local repository owned by another user |
|
955 | Clone a local repository owned by another user | |
941 | We have to simulate that here by setting $HOME and removing write permissions |
|
956 | We have to simulate that here by setting $HOME and removing write permissions | |
942 | $ ORIGHOME="$HOME" |
|
957 | $ ORIGHOME="$HOME" | |
943 | $ mkdir alice |
|
958 | $ mkdir alice | |
944 | $ HOME="`pwd`/alice" |
|
959 | $ HOME="`pwd`/alice" | |
945 | $ cd alice |
|
960 | $ cd alice | |
946 | $ hg init pubrepo |
|
961 | $ hg init pubrepo | |
947 | $ cd pubrepo |
|
962 | $ cd pubrepo | |
948 | $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null |
|
963 | $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null | |
949 | $ hg add --large a-large-file |
|
964 | $ hg add --large a-large-file | |
950 | $ hg commit -m "Add a large file" |
|
965 | $ hg commit -m "Add a large file" | |
951 | Invoking status precommit hook |
|
966 | Invoking status precommit hook | |
952 | A a-large-file |
|
967 | A a-large-file | |
953 | $ cd .. |
|
968 | $ cd .. | |
954 | $ chmod -R a-w pubrepo |
|
969 | $ chmod -R a-w pubrepo | |
955 | $ cd .. |
|
970 | $ cd .. | |
956 | $ mkdir bob |
|
971 | $ mkdir bob | |
957 | $ HOME="`pwd`/bob" |
|
972 | $ HOME="`pwd`/bob" | |
958 | $ cd bob |
|
973 | $ cd bob | |
959 | $ hg clone --pull ../alice/pubrepo pubrepo |
|
974 | $ hg clone --pull ../alice/pubrepo pubrepo | |
960 | requesting all changes |
|
975 | requesting all changes | |
961 | adding changesets |
|
976 | adding changesets | |
962 | adding manifests |
|
977 | adding manifests | |
963 | adding file changes |
|
978 | adding file changes | |
964 | added 1 changesets with 1 changes to 1 files |
|
979 | added 1 changesets with 1 changes to 1 files | |
965 | updating to branch default |
|
980 | updating to branch default | |
966 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
981 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
967 | getting changed largefiles |
|
982 | getting changed largefiles | |
968 | 1 largefiles updated, 0 removed |
|
983 | 1 largefiles updated, 0 removed | |
969 | $ cd .. |
|
984 | $ cd .. | |
970 | $ chmod -R u+w alice/pubrepo |
|
985 | $ chmod -R u+w alice/pubrepo | |
971 | $ HOME="$ORIGHOME" |
|
986 | $ HOME="$ORIGHOME" | |
972 |
|
987 | |||
973 | Symlink to a large largefile should behave the same as a symlink to a normal file |
|
988 | Symlink to a large largefile should behave the same as a symlink to a normal file | |
974 | $ hg init largesymlink |
|
989 | $ hg init largesymlink | |
975 | $ cd largesymlink |
|
990 | $ cd largesymlink | |
976 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null |
|
991 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null | |
977 | $ hg add --large largefile |
|
992 | $ hg add --large largefile | |
978 | $ hg commit -m "commit a large file" |
|
993 | $ hg commit -m "commit a large file" | |
979 | Invoking status precommit hook |
|
994 | Invoking status precommit hook | |
980 | A largefile |
|
995 | A largefile | |
981 | $ ln -s largefile largelink |
|
996 | $ ln -s largefile largelink | |
982 | $ hg add largelink |
|
997 | $ hg add largelink | |
983 | $ hg commit -m "commit a large symlink" |
|
998 | $ hg commit -m "commit a large symlink" | |
984 | Invoking status precommit hook |
|
999 | Invoking status precommit hook | |
985 | A largelink |
|
1000 | A largelink | |
986 | $ rm -f largelink |
|
1001 | $ rm -f largelink | |
987 | $ hg up >/dev/null |
|
1002 | $ hg up >/dev/null | |
988 | $ test -f largelink |
|
1003 | $ test -f largelink | |
989 | [1] |
|
1004 | [1] | |
990 | $ test -L largelink |
|
1005 | $ test -L largelink | |
991 | [1] |
|
1006 | [1] | |
992 | $ rm -f largelink # make next part of the test independent of the previous |
|
1007 | $ rm -f largelink # make next part of the test independent of the previous | |
993 | $ hg up -C >/dev/null |
|
1008 | $ hg up -C >/dev/null | |
994 | $ test -f largelink |
|
1009 | $ test -f largelink | |
995 | $ test -L largelink |
|
1010 | $ test -L largelink | |
996 | $ cd .. |
|
1011 | $ cd .. | |
997 |
|
1012 | |||
998 | test for pattern matching on 'hg status': |
|
1013 | test for pattern matching on 'hg status': | |
999 | to boost performance, largefiles checks whether specified patterns are |
|
1014 | to boost performance, largefiles checks whether specified patterns are | |
1000 | related to largefiles in working directory (NOT to STANDIN) or not. |
|
1015 | related to largefiles in working directory (NOT to STANDIN) or not. | |
1001 |
|
1016 | |||
1002 | $ hg init statusmatch |
|
1017 | $ hg init statusmatch | |
1003 | $ cd statusmatch |
|
1018 | $ cd statusmatch | |
1004 |
|
1019 | |||
1005 | $ mkdir -p a/b/c/d |
|
1020 | $ mkdir -p a/b/c/d | |
1006 | $ echo normal > a/b/c/d/e.normal.txt |
|
1021 | $ echo normal > a/b/c/d/e.normal.txt | |
1007 | $ hg add a/b/c/d/e.normal.txt |
|
1022 | $ hg add a/b/c/d/e.normal.txt | |
1008 | $ echo large > a/b/c/d/e.large.txt |
|
1023 | $ echo large > a/b/c/d/e.large.txt | |
1009 | $ hg add --large a/b/c/d/e.large.txt |
|
1024 | $ hg add --large a/b/c/d/e.large.txt | |
1010 | $ mkdir -p a/b/c/x |
|
1025 | $ mkdir -p a/b/c/x | |
1011 | $ echo normal > a/b/c/x/y.normal.txt |
|
1026 | $ echo normal > a/b/c/x/y.normal.txt | |
1012 | $ hg add a/b/c/x/y.normal.txt |
|
1027 | $ hg add a/b/c/x/y.normal.txt | |
1013 | $ hg commit -m 'add files' |
|
1028 | $ hg commit -m 'add files' | |
1014 | Invoking status precommit hook |
|
1029 | Invoking status precommit hook | |
1015 | A a/b/c/d/e.large.txt |
|
1030 | A a/b/c/d/e.large.txt | |
1016 | A a/b/c/d/e.normal.txt |
|
1031 | A a/b/c/d/e.normal.txt | |
1017 | A a/b/c/x/y.normal.txt |
|
1032 | A a/b/c/x/y.normal.txt | |
1018 |
|
1033 | |||
1019 | (1) no pattern: no performance boost |
|
1034 | (1) no pattern: no performance boost | |
1020 | $ hg status -A |
|
1035 | $ hg status -A | |
1021 | C a/b/c/d/e.large.txt |
|
1036 | C a/b/c/d/e.large.txt | |
1022 | C a/b/c/d/e.normal.txt |
|
1037 | C a/b/c/d/e.normal.txt | |
1023 | C a/b/c/x/y.normal.txt |
|
1038 | C a/b/c/x/y.normal.txt | |
1024 |
|
1039 | |||
1025 | (2) pattern not related to largefiles: performance boost |
|
1040 | (2) pattern not related to largefiles: performance boost | |
1026 | $ hg status -A a/b/c/x |
|
1041 | $ hg status -A a/b/c/x | |
1027 | C a/b/c/x/y.normal.txt |
|
1042 | C a/b/c/x/y.normal.txt | |
1028 |
|
1043 | |||
1029 | (3) pattern related to largefiles: no performance boost |
|
1044 | (3) pattern related to largefiles: no performance boost | |
1030 | $ hg status -A a/b/c/d |
|
1045 | $ hg status -A a/b/c/d | |
1031 | C a/b/c/d/e.large.txt |
|
1046 | C a/b/c/d/e.large.txt | |
1032 | C a/b/c/d/e.normal.txt |
|
1047 | C a/b/c/d/e.normal.txt | |
1033 |
|
1048 | |||
1034 | (4) pattern related to STANDIN (not to largefiles): performance boost |
|
1049 | (4) pattern related to STANDIN (not to largefiles): performance boost | |
1035 | $ hg status -A .hglf/a |
|
1050 | $ hg status -A .hglf/a | |
1036 | C .hglf/a/b/c/d/e.large.txt |
|
1051 | C .hglf/a/b/c/d/e.large.txt | |
1037 |
|
1052 | |||
1038 | (5) mixed case: no performance boost |
|
1053 | (5) mixed case: no performance boost | |
1039 | $ hg status -A a/b/c/x a/b/c/d |
|
1054 | $ hg status -A a/b/c/x a/b/c/d | |
1040 | C a/b/c/d/e.large.txt |
|
1055 | C a/b/c/d/e.large.txt | |
1041 | C a/b/c/d/e.normal.txt |
|
1056 | C a/b/c/d/e.normal.txt | |
1042 | C a/b/c/x/y.normal.txt |
|
1057 | C a/b/c/x/y.normal.txt | |
1043 |
|
1058 | |||
1044 | verify that largefiles doesn't break filesets |
|
1059 | verify that largefiles doesn't break filesets | |
1045 |
|
1060 | |||
1046 | $ hg log --rev . --exclude "set:binary()" |
|
1061 | $ hg log --rev . --exclude "set:binary()" | |
1047 | changeset: 0:41bd42f10efa |
|
1062 | changeset: 0:41bd42f10efa | |
1048 | tag: tip |
|
1063 | tag: tip | |
1049 | user: test |
|
1064 | user: test | |
1050 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1065 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1051 | summary: add files |
|
1066 | summary: add files | |
1052 |
|
1067 | |||
1053 | verify that large files in subrepos handled properly |
|
1068 | verify that large files in subrepos handled properly | |
1054 | $ hg init subrepo |
|
1069 | $ hg init subrepo | |
1055 | $ echo "subrepo = subrepo" > .hgsub |
|
1070 | $ echo "subrepo = subrepo" > .hgsub | |
1056 | $ hg add .hgsub |
|
1071 | $ hg add .hgsub | |
1057 | $ hg ci -m "add subrepo" |
|
1072 | $ hg ci -m "add subrepo" | |
1058 | Invoking status precommit hook |
|
1073 | Invoking status precommit hook | |
1059 | A .hgsub |
|
1074 | A .hgsub | |
1060 | ? .hgsubstate |
|
1075 | ? .hgsubstate | |
1061 | $ echo "rev 1" > subrepo/large.txt |
|
1076 | $ echo "rev 1" > subrepo/large.txt | |
1062 | $ hg -R subrepo add --large subrepo/large.txt |
|
1077 | $ hg -R subrepo add --large subrepo/large.txt | |
1063 | $ hg sum |
|
1078 | $ hg sum | |
1064 | parent: 1:8ee150ea2e9c tip |
|
1079 | parent: 1:8ee150ea2e9c tip | |
1065 | add subrepo |
|
1080 | add subrepo | |
1066 | branch: default |
|
1081 | branch: default | |
1067 | commit: 1 subrepos |
|
1082 | commit: 1 subrepos | |
1068 | update: (current) |
|
1083 | update: (current) | |
1069 | $ hg st |
|
1084 | $ hg st | |
1070 | $ hg st -S |
|
1085 | $ hg st -S | |
1071 | A subrepo/large.txt |
|
1086 | A subrepo/large.txt | |
1072 | $ hg ci -S -m "commit top repo" |
|
1087 | $ hg ci -S -m "commit top repo" | |
1073 | committing subrepository subrepo |
|
1088 | committing subrepository subrepo | |
1074 | Invoking status precommit hook |
|
1089 | Invoking status precommit hook | |
1075 | A large.txt |
|
1090 | A large.txt | |
1076 | Invoking status precommit hook |
|
1091 | Invoking status precommit hook | |
1077 | M .hgsubstate |
|
1092 | M .hgsubstate | |
1078 | # No differences |
|
1093 | # No differences | |
1079 | $ hg st -S |
|
1094 | $ hg st -S | |
1080 | $ hg sum |
|
1095 | $ hg sum | |
1081 | parent: 2:ce4cd0c527a6 tip |
|
1096 | parent: 2:ce4cd0c527a6 tip | |
1082 | commit top repo |
|
1097 | commit top repo | |
1083 | branch: default |
|
1098 | branch: default | |
1084 | commit: (clean) |
|
1099 | commit: (clean) | |
1085 | update: (current) |
|
1100 | update: (current) | |
1086 | $ echo "rev 2" > subrepo/large.txt |
|
1101 | $ echo "rev 2" > subrepo/large.txt | |
1087 | $ hg st -S |
|
1102 | $ hg st -S | |
1088 | M subrepo/large.txt |
|
1103 | M subrepo/large.txt | |
1089 | $ hg sum |
|
1104 | $ hg sum | |
1090 | parent: 2:ce4cd0c527a6 tip |
|
1105 | parent: 2:ce4cd0c527a6 tip | |
1091 | commit top repo |
|
1106 | commit top repo | |
1092 | branch: default |
|
1107 | branch: default | |
1093 | commit: 1 subrepos |
|
1108 | commit: 1 subrepos | |
1094 | update: (current) |
|
1109 | update: (current) | |
1095 | $ hg ci -m "this commit should fail without -S" |
|
1110 | $ hg ci -m "this commit should fail without -S" | |
1096 | abort: uncommitted changes in subrepo subrepo |
|
1111 | abort: uncommitted changes in subrepo subrepo | |
1097 | (use --subrepos for recursive commit) |
|
1112 | (use --subrepos for recursive commit) | |
1098 | [255] |
|
1113 | [255] | |
1099 | $ cd .. |
|
1114 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now