Show More
@@ -1,409 +1,413 b'' | |||||
1 | # Copyright 2009-2010 Gregory P. Ward |
|
1 | # Copyright 2009-2010 Gregory P. Ward | |
2 | # Copyright 2009-2010 Intelerad Medical Systems Incorporated |
|
2 | # Copyright 2009-2010 Intelerad Medical Systems Incorporated | |
3 | # Copyright 2010-2011 Fog Creek Software |
|
3 | # Copyright 2010-2011 Fog Creek Software | |
4 | # Copyright 2010-2011 Unity Technologies |
|
4 | # Copyright 2010-2011 Unity Technologies | |
5 | # |
|
5 | # | |
6 | # This software may be used and distributed according to the terms of the |
|
6 | # This software may be used and distributed according to the terms of the | |
7 | # GNU General Public License version 2 or any later version. |
|
7 | # GNU General Public License version 2 or any later version. | |
8 |
|
8 | |||
9 | '''setup for largefiles repositories: reposetup''' |
|
9 | '''setup for largefiles repositories: reposetup''' | |
10 | import copy |
|
10 | import copy | |
11 | import types |
|
11 | import types | |
12 | import os |
|
12 | import os | |
13 | import re |
|
13 | import re | |
14 |
|
14 | |||
15 | from mercurial import context, error, manifest, match as match_, node, util |
|
15 | from mercurial import context, error, manifest, match as match_, node, util | |
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 not (isinstance(method, types.MethodType) and |
|
30 | #if not (isinstance(method, types.MethodType) and | |
31 | # method.im_func is repo.__class__.commitctx.im_func): |
|
31 | # method.im_func is repo.__class__.commitctx.im_func): | |
32 | if (isinstance(method, types.FunctionType) and |
|
32 | if (isinstance(method, types.FunctionType) and | |
33 | method.func_name == 'wrap'): |
|
33 | method.func_name == 'wrap'): | |
34 | ui.warn(_('largefiles: repo method %r appears to have already been' |
|
34 | ui.warn(_('largefiles: repo method %r appears to have already been' | |
35 | ' wrapped by another extension: ' |
|
35 | ' wrapped by another extension: ' | |
36 | 'largefiles may behave incorrectly\n') |
|
36 | 'largefiles may behave incorrectly\n') | |
37 | % name) |
|
37 | % name) | |
38 |
|
38 | |||
39 | class lfiles_repo(repo.__class__): |
|
39 | class lfiles_repo(repo.__class__): | |
40 | lfstatus = False |
|
40 | lfstatus = False | |
41 | def status_nolfiles(self, *args, **kwargs): |
|
41 | def status_nolfiles(self, *args, **kwargs): | |
42 | return super(lfiles_repo, self).status(*args, **kwargs) |
|
42 | return super(lfiles_repo, self).status(*args, **kwargs) | |
43 |
|
43 | |||
44 | # When lfstatus is set, return a context that gives the names |
|
44 | # When lfstatus is set, return a context that gives the names | |
45 | # of largefiles instead of their corresponding standins and |
|
45 | # of largefiles instead of their corresponding standins and | |
46 | # identifies the largefiles as always binary, regardless of |
|
46 | # identifies the largefiles as always binary, regardless of | |
47 | # their actual contents. |
|
47 | # their actual contents. | |
48 | def __getitem__(self, changeid): |
|
48 | def __getitem__(self, changeid): | |
49 | ctx = super(lfiles_repo, self).__getitem__(changeid) |
|
49 | ctx = super(lfiles_repo, self).__getitem__(changeid) | |
50 | if self.lfstatus: |
|
50 | if self.lfstatus: | |
51 | class lfiles_manifestdict(manifest.manifestdict): |
|
51 | class lfiles_manifestdict(manifest.manifestdict): | |
52 | def __contains__(self, filename): |
|
52 | def __contains__(self, filename): | |
53 | if super(lfiles_manifestdict, |
|
53 | if super(lfiles_manifestdict, | |
54 | self).__contains__(filename): |
|
54 | self).__contains__(filename): | |
55 | return True |
|
55 | return True | |
56 | return super(lfiles_manifestdict, |
|
56 | return super(lfiles_manifestdict, | |
57 | self).__contains__(lfutil.shortname+'/' + filename) |
|
57 | self).__contains__(lfutil.shortname+'/' + filename) | |
58 | class lfiles_ctx(ctx.__class__): |
|
58 | class lfiles_ctx(ctx.__class__): | |
59 | def files(self): |
|
59 | def files(self): | |
60 | filenames = super(lfiles_ctx, self).files() |
|
60 | filenames = super(lfiles_ctx, self).files() | |
61 | return [re.sub('^\\'+lfutil.shortname+'/', '', |
|
61 | return [re.sub('^\\'+lfutil.shortname+'/', '', | |
62 | filename) for filename in filenames] |
|
62 | filename) for filename in filenames] | |
63 | def manifest(self): |
|
63 | def manifest(self): | |
64 | man1 = super(lfiles_ctx, self).manifest() |
|
64 | man1 = super(lfiles_ctx, self).manifest() | |
65 | man1.__class__ = lfiles_manifestdict |
|
65 | man1.__class__ = lfiles_manifestdict | |
66 | return man1 |
|
66 | return man1 | |
67 | def filectx(self, path, fileid=None, filelog=None): |
|
67 | def filectx(self, path, fileid=None, filelog=None): | |
68 | try: |
|
68 | try: | |
69 | result = super(lfiles_ctx, self).filectx(path, |
|
69 | result = super(lfiles_ctx, self).filectx(path, | |
70 | fileid, filelog) |
|
70 | fileid, filelog) | |
71 | except error.LookupError: |
|
71 | except error.LookupError: | |
72 | # Adding a null character will cause Mercurial to |
|
72 | # Adding a null character will cause Mercurial to | |
73 | # identify this as a binary file. |
|
73 | # identify this as a binary file. | |
74 | result = super(lfiles_ctx, self).filectx( |
|
74 | result = super(lfiles_ctx, self).filectx( | |
75 | lfutil.shortname + '/' + path, fileid, |
|
75 | lfutil.shortname + '/' + path, fileid, | |
76 | filelog) |
|
76 | filelog) | |
77 | olddata = result.data |
|
77 | olddata = result.data | |
78 | result.data = lambda: olddata() + '\0' |
|
78 | result.data = lambda: olddata() + '\0' | |
79 | return result |
|
79 | return result | |
80 | ctx.__class__ = lfiles_ctx |
|
80 | ctx.__class__ = lfiles_ctx | |
81 | return ctx |
|
81 | return ctx | |
82 |
|
82 | |||
83 | # Figure out the status of big files and insert them into the |
|
83 | # Figure out the status of big files and insert them into the | |
84 | # appropriate list in the result. Also removes standin files |
|
84 | # appropriate list in the result. Also removes standin files | |
85 | # from the listing. Revert to the original status if |
|
85 | # from the listing. Revert to the original status if | |
86 | # self.lfstatus is False. |
|
86 | # self.lfstatus is False. | |
87 | def status(self, node1='.', node2=None, match=None, ignored=False, |
|
87 | def status(self, node1='.', node2=None, match=None, ignored=False, | |
88 | clean=False, unknown=False, listsubrepos=False): |
|
88 | clean=False, unknown=False, listsubrepos=False): | |
89 | listignored, listclean, listunknown = ignored, clean, unknown |
|
89 | listignored, listclean, listunknown = ignored, clean, unknown | |
90 | if not self.lfstatus: |
|
90 | if not self.lfstatus: | |
91 | try: |
|
91 | try: | |
92 | return super(lfiles_repo, self).status(node1, node2, match, |
|
92 | return super(lfiles_repo, self).status(node1, node2, match, | |
93 | listignored, listclean, listunknown, listsubrepos) |
|
93 | listignored, listclean, listunknown, listsubrepos) | |
94 | except TypeError: |
|
94 | except TypeError: | |
95 | return super(lfiles_repo, self).status(node1, node2, match, |
|
95 | return super(lfiles_repo, self).status(node1, node2, match, | |
96 | listignored, listclean, listunknown) |
|
96 | listignored, listclean, listunknown) | |
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 | # Create a copy of match that matches standins instead |
|
123 | # Create a copy of match that matches standins instead | |
124 | # of largefiles. |
|
124 | # of largefiles. | |
125 | def tostandin(file): |
|
125 | def tostandin(file): | |
126 | if inctx(lfutil.standin(file), ctx2): |
|
126 | if inctx(lfutil.standin(file), ctx2): | |
127 | return lfutil.standin(file) |
|
127 | return lfutil.standin(file) | |
128 | return file |
|
128 | return file | |
129 |
|
129 | |||
130 | m = copy.copy(match) |
|
130 | m = copy.copy(match) | |
131 | m._files = [tostandin(f) for f in m._files] |
|
131 | m._files = [tostandin(f) for f in m._files] | |
132 |
|
132 | |||
133 | # get ignored, clean, and unknown but remove them |
|
133 | # get ignored, clean, and unknown but remove them | |
134 | # later if they were not asked for |
|
134 | # later if they were not asked for | |
135 | try: |
|
135 | try: | |
136 | result = super(lfiles_repo, self).status(node1, node2, m, |
|
136 | result = super(lfiles_repo, self).status(node1, node2, m, | |
137 | True, True, True, listsubrepos) |
|
137 | True, True, True, listsubrepos) | |
138 | except TypeError: |
|
138 | except TypeError: | |
139 | result = super(lfiles_repo, self).status(node1, node2, m, |
|
139 | result = super(lfiles_repo, self).status(node1, node2, m, | |
140 | True, True, True) |
|
140 | True, True, True) | |
141 | if working: |
|
141 | if working: | |
142 | # hold the wlock while we read largefiles and |
|
142 | # hold the wlock while we read largefiles and | |
143 | # update the lfdirstate |
|
143 | # update the lfdirstate | |
144 | wlock = repo.wlock() |
|
144 | wlock = repo.wlock() | |
145 | try: |
|
145 | try: | |
146 | # Any non-largefiles that were explicitly listed must be |
|
146 | # Any non-largefiles that were explicitly listed must be | |
147 | # taken out or lfdirstate.status will report an error. |
|
147 | # taken out or lfdirstate.status will report an error. | |
148 | # The status of these files was already computed using |
|
148 | # The status of these files was already computed using | |
149 | # super's status. |
|
149 | # super's status. | |
150 | lfdirstate = lfutil.openlfdirstate(ui, self) |
|
150 | lfdirstate = lfutil.openlfdirstate(ui, self) | |
151 | match._files = [f for f in match._files if f in |
|
151 | match._files = [f for f in match._files if f in | |
152 | lfdirstate] |
|
152 | lfdirstate] | |
153 | s = lfdirstate.status(match, [], listignored, |
|
153 | s = lfdirstate.status(match, [], listignored, | |
154 | listclean, listunknown) |
|
154 | listclean, listunknown) | |
155 | (unsure, modified, added, removed, missing, unknown, |
|
155 | (unsure, modified, added, removed, missing, unknown, | |
156 | ignored, clean) = s |
|
156 | ignored, clean) = s | |
157 | if parentworking: |
|
157 | if parentworking: | |
158 | for lfile in unsure: |
|
158 | for lfile in unsure: | |
159 |
|
|
159 | standin = lfutil.standin(lfile) | |
|
160 | if standin not in ctx1: | |||
|
161 | # from second parent | |||
|
162 | modified.append(lfile) | |||
|
163 | elif ctx1[standin].data().strip() \ | |||
160 | != lfutil.hashfile(self.wjoin(lfile)): |
|
164 | != lfutil.hashfile(self.wjoin(lfile)): | |
161 | modified.append(lfile) |
|
165 | modified.append(lfile) | |
162 | else: |
|
166 | else: | |
163 | clean.append(lfile) |
|
167 | clean.append(lfile) | |
164 | lfdirstate.normal(lfile) |
|
168 | lfdirstate.normal(lfile) | |
165 | lfdirstate.write() |
|
169 | lfdirstate.write() | |
166 | else: |
|
170 | else: | |
167 | tocheck = unsure + modified + added + clean |
|
171 | tocheck = unsure + modified + added + clean | |
168 | modified, added, clean = [], [], [] |
|
172 | modified, added, clean = [], [], [] | |
169 |
|
173 | |||
170 | for lfile in tocheck: |
|
174 | for lfile in tocheck: | |
171 | standin = lfutil.standin(lfile) |
|
175 | standin = lfutil.standin(lfile) | |
172 | if inctx(standin, ctx1): |
|
176 | if inctx(standin, ctx1): | |
173 | if ctx1[standin].data().strip() != \ |
|
177 | if ctx1[standin].data().strip() != \ | |
174 | lfutil.hashfile(self.wjoin(lfile)): |
|
178 | lfutil.hashfile(self.wjoin(lfile)): | |
175 | modified.append(lfile) |
|
179 | modified.append(lfile) | |
176 | else: |
|
180 | else: | |
177 | clean.append(lfile) |
|
181 | clean.append(lfile) | |
178 | else: |
|
182 | else: | |
179 | added.append(lfile) |
|
183 | added.append(lfile) | |
180 | finally: |
|
184 | finally: | |
181 | wlock.release() |
|
185 | wlock.release() | |
182 |
|
186 | |||
183 | for standin in ctx1.manifest(): |
|
187 | for standin in ctx1.manifest(): | |
184 | if not lfutil.isstandin(standin): |
|
188 | if not lfutil.isstandin(standin): | |
185 | continue |
|
189 | continue | |
186 | lfile = lfutil.splitstandin(standin) |
|
190 | lfile = lfutil.splitstandin(standin) | |
187 | if not match(lfile): |
|
191 | if not match(lfile): | |
188 | continue |
|
192 | continue | |
189 | if lfile not in lfdirstate: |
|
193 | if lfile not in lfdirstate: | |
190 | removed.append(lfile) |
|
194 | removed.append(lfile) | |
191 | # Handle unknown and ignored differently |
|
195 | # Handle unknown and ignored differently | |
192 | lfiles = (modified, added, removed, missing, [], [], clean) |
|
196 | lfiles = (modified, added, removed, missing, [], [], clean) | |
193 | result = list(result) |
|
197 | result = list(result) | |
194 | # Unknown files |
|
198 | # Unknown files | |
195 | result[4] = [f for f in unknown |
|
199 | result[4] = [f for f in unknown | |
196 | if (repo.dirstate[f] == '?' and |
|
200 | if (repo.dirstate[f] == '?' and | |
197 | not lfutil.isstandin(f))] |
|
201 | not lfutil.isstandin(f))] | |
198 | # Ignored files must be ignored by both the dirstate and |
|
202 | # Ignored files must be ignored by both the dirstate and | |
199 | # lfdirstate |
|
203 | # lfdirstate | |
200 | result[5] = set(ignored).intersection(set(result[5])) |
|
204 | result[5] = set(ignored).intersection(set(result[5])) | |
201 | # combine normal files and largefiles |
|
205 | # combine normal files and largefiles | |
202 | normals = [[fn for fn in filelist |
|
206 | normals = [[fn for fn in filelist | |
203 | if not lfutil.isstandin(fn)] |
|
207 | if not lfutil.isstandin(fn)] | |
204 | for filelist in result] |
|
208 | for filelist in result] | |
205 | result = [sorted(list1 + list2) |
|
209 | result = [sorted(list1 + list2) | |
206 | for (list1, list2) in zip(normals, lfiles)] |
|
210 | for (list1, list2) in zip(normals, lfiles)] | |
207 | else: |
|
211 | else: | |
208 | def toname(f): |
|
212 | def toname(f): | |
209 | if lfutil.isstandin(f): |
|
213 | if lfutil.isstandin(f): | |
210 | return lfutil.splitstandin(f) |
|
214 | return lfutil.splitstandin(f) | |
211 | return f |
|
215 | return f | |
212 | result = [[toname(f) for f in items] for items in result] |
|
216 | result = [[toname(f) for f in items] for items in result] | |
213 |
|
217 | |||
214 | if not listunknown: |
|
218 | if not listunknown: | |
215 | result[4] = [] |
|
219 | result[4] = [] | |
216 | if not listignored: |
|
220 | if not listignored: | |
217 | result[5] = [] |
|
221 | result[5] = [] | |
218 | if not listclean: |
|
222 | if not listclean: | |
219 | result[6] = [] |
|
223 | result[6] = [] | |
220 | self.lfstatus = True |
|
224 | self.lfstatus = True | |
221 | return result |
|
225 | return result | |
222 |
|
226 | |||
223 | # As part of committing, copy all of the largefiles into the |
|
227 | # As part of committing, copy all of the largefiles into the | |
224 | # cache. |
|
228 | # cache. | |
225 | def commitctx(self, *args, **kwargs): |
|
229 | def commitctx(self, *args, **kwargs): | |
226 | node = super(lfiles_repo, self).commitctx(*args, **kwargs) |
|
230 | node = super(lfiles_repo, self).commitctx(*args, **kwargs) | |
227 | ctx = self[node] |
|
231 | ctx = self[node] | |
228 | for filename in ctx.files(): |
|
232 | for filename in ctx.files(): | |
229 | if lfutil.isstandin(filename) and filename in ctx.manifest(): |
|
233 | if lfutil.isstandin(filename) and filename in ctx.manifest(): | |
230 | realfile = lfutil.splitstandin(filename) |
|
234 | realfile = lfutil.splitstandin(filename) | |
231 | lfutil.copytostore(self, ctx.node(), realfile) |
|
235 | lfutil.copytostore(self, ctx.node(), realfile) | |
232 |
|
236 | |||
233 | return node |
|
237 | return node | |
234 |
|
238 | |||
235 | # Before commit, largefile standins have not had their |
|
239 | # Before commit, largefile standins have not had their | |
236 | # contents updated to reflect the hash of their largefile. |
|
240 | # contents updated to reflect the hash of their largefile. | |
237 | # Do that here. |
|
241 | # Do that here. | |
238 | def commit(self, text="", user=None, date=None, match=None, |
|
242 | def commit(self, text="", user=None, date=None, match=None, | |
239 | force=False, editor=False, extra={}): |
|
243 | force=False, editor=False, extra={}): | |
240 | orig = super(lfiles_repo, self).commit |
|
244 | orig = super(lfiles_repo, self).commit | |
241 |
|
245 | |||
242 | wlock = repo.wlock() |
|
246 | wlock = repo.wlock() | |
243 | try: |
|
247 | try: | |
244 | if getattr(repo, "_isrebasing", False): |
|
248 | if getattr(repo, "_isrebasing", False): | |
245 | # We have to take the time to pull down the new |
|
249 | # We have to take the time to pull down the new | |
246 | # largefiles now. Otherwise if we are rebasing, |
|
250 | # largefiles now. Otherwise if we are rebasing, | |
247 | # any largefiles that were modified in the |
|
251 | # any largefiles that were modified in the | |
248 | # destination changesets get overwritten, either |
|
252 | # destination changesets get overwritten, either | |
249 | # by the rebase or in the first commit after the |
|
253 | # by the rebase or in the first commit after the | |
250 | # rebase. |
|
254 | # rebase. | |
251 | lfcommands.updatelfiles(repo.ui, repo) |
|
255 | lfcommands.updatelfiles(repo.ui, repo) | |
252 | # Case 1: user calls commit with no specific files or |
|
256 | # Case 1: user calls commit with no specific files or | |
253 | # include/exclude patterns: refresh and commit all files that |
|
257 | # include/exclude patterns: refresh and commit all files that | |
254 | # are "dirty". |
|
258 | # are "dirty". | |
255 | if ((match is None) or |
|
259 | if ((match is None) or | |
256 | (not match.anypats() and not match.files())): |
|
260 | (not match.anypats() and not match.files())): | |
257 | # Spend a bit of time here to get a list of files we know |
|
261 | # Spend a bit of time here to get a list of files we know | |
258 | # are modified so we can compare only against those. |
|
262 | # are modified so we can compare only against those. | |
259 | # It can cost a lot of time (several seconds) |
|
263 | # It can cost a lot of time (several seconds) | |
260 | # otherwise to update all standins if the largefiles are |
|
264 | # otherwise to update all standins if the largefiles are | |
261 | # large. |
|
265 | # large. | |
262 | lfdirstate = lfutil.openlfdirstate(ui, self) |
|
266 | lfdirstate = lfutil.openlfdirstate(ui, self) | |
263 | dirtymatch = match_.always(repo.root, repo.getcwd()) |
|
267 | dirtymatch = match_.always(repo.root, repo.getcwd()) | |
264 | s = lfdirstate.status(dirtymatch, [], False, False, False) |
|
268 | s = lfdirstate.status(dirtymatch, [], False, False, False) | |
265 | modifiedfiles = [] |
|
269 | modifiedfiles = [] | |
266 | for i in s: |
|
270 | for i in s: | |
267 | modifiedfiles.extend(i) |
|
271 | modifiedfiles.extend(i) | |
268 | lfiles = lfutil.listlfiles(self) |
|
272 | lfiles = lfutil.listlfiles(self) | |
269 | # this only loops through largefiles that exist (not |
|
273 | # this only loops through largefiles that exist (not | |
270 | # removed/renamed) |
|
274 | # removed/renamed) | |
271 | for lfile in lfiles: |
|
275 | for lfile in lfiles: | |
272 | if lfile in modifiedfiles: |
|
276 | if lfile in modifiedfiles: | |
273 | if os.path.exists(self.wjoin(lfutil.standin(lfile))): |
|
277 | if os.path.exists(self.wjoin(lfutil.standin(lfile))): | |
274 | # this handles the case where a rebase is being |
|
278 | # this handles the case where a rebase is being | |
275 | # performed and the working copy is not updated |
|
279 | # performed and the working copy is not updated | |
276 | # yet. |
|
280 | # yet. | |
277 | if os.path.exists(self.wjoin(lfile)): |
|
281 | if os.path.exists(self.wjoin(lfile)): | |
278 | lfutil.updatestandin(self, |
|
282 | lfutil.updatestandin(self, | |
279 | lfutil.standin(lfile)) |
|
283 | lfutil.standin(lfile)) | |
280 | lfdirstate.normal(lfile) |
|
284 | lfdirstate.normal(lfile) | |
281 | for lfile in lfdirstate: |
|
285 | for lfile in lfdirstate: | |
282 | if lfile in modifiedfiles: |
|
286 | if lfile in modifiedfiles: | |
283 | if not os.path.exists( |
|
287 | if not os.path.exists( | |
284 | repo.wjoin(lfutil.standin(lfile))): |
|
288 | repo.wjoin(lfutil.standin(lfile))): | |
285 | lfdirstate.drop(lfile) |
|
289 | lfdirstate.drop(lfile) | |
286 | lfdirstate.write() |
|
290 | lfdirstate.write() | |
287 |
|
291 | |||
288 | return orig(text=text, user=user, date=date, match=match, |
|
292 | return orig(text=text, user=user, date=date, match=match, | |
289 | force=force, editor=editor, extra=extra) |
|
293 | force=force, editor=editor, extra=extra) | |
290 |
|
294 | |||
291 | for f in match.files(): |
|
295 | for f in match.files(): | |
292 | if lfutil.isstandin(f): |
|
296 | if lfutil.isstandin(f): | |
293 | raise util.Abort( |
|
297 | raise util.Abort( | |
294 | _('file "%s" is a largefile standin') % f, |
|
298 | _('file "%s" is a largefile standin') % f, | |
295 | hint=('commit the largefile itself instead')) |
|
299 | hint=('commit the largefile itself instead')) | |
296 |
|
300 | |||
297 | # Case 2: user calls commit with specified patterns: refresh |
|
301 | # Case 2: user calls commit with specified patterns: refresh | |
298 | # any matching big files. |
|
302 | # any matching big files. | |
299 | smatcher = lfutil.composestandinmatcher(self, match) |
|
303 | smatcher = lfutil.composestandinmatcher(self, match) | |
300 | standins = lfutil.dirstate_walk(self.dirstate, smatcher) |
|
304 | standins = lfutil.dirstate_walk(self.dirstate, smatcher) | |
301 |
|
305 | |||
302 | # No matching big files: get out of the way and pass control to |
|
306 | # No matching big files: get out of the way and pass control to | |
303 | # the usual commit() method. |
|
307 | # the usual commit() method. | |
304 | if not standins: |
|
308 | if not standins: | |
305 | return orig(text=text, user=user, date=date, match=match, |
|
309 | return orig(text=text, user=user, date=date, match=match, | |
306 | force=force, editor=editor, extra=extra) |
|
310 | force=force, editor=editor, extra=extra) | |
307 |
|
311 | |||
308 | # Refresh all matching big files. It's possible that the |
|
312 | # Refresh all matching big files. It's possible that the | |
309 | # commit will end up failing, in which case the big files will |
|
313 | # commit will end up failing, in which case the big files will | |
310 | # stay refreshed. No harm done: the user modified them and |
|
314 | # stay refreshed. No harm done: the user modified them and | |
311 | # asked to commit them, so sooner or later we're going to |
|
315 | # asked to commit them, so sooner or later we're going to | |
312 | # refresh the standins. Might as well leave them refreshed. |
|
316 | # refresh the standins. Might as well leave them refreshed. | |
313 | lfdirstate = lfutil.openlfdirstate(ui, self) |
|
317 | lfdirstate = lfutil.openlfdirstate(ui, self) | |
314 | for standin in standins: |
|
318 | for standin in standins: | |
315 | lfile = lfutil.splitstandin(standin) |
|
319 | lfile = lfutil.splitstandin(standin) | |
316 | if lfdirstate[lfile] <> 'r': |
|
320 | if lfdirstate[lfile] <> 'r': | |
317 | lfutil.updatestandin(self, standin) |
|
321 | lfutil.updatestandin(self, standin) | |
318 | lfdirstate.normal(lfile) |
|
322 | lfdirstate.normal(lfile) | |
319 | else: |
|
323 | else: | |
320 | lfdirstate.drop(lfile) |
|
324 | lfdirstate.drop(lfile) | |
321 | lfdirstate.write() |
|
325 | lfdirstate.write() | |
322 |
|
326 | |||
323 | # Cook up a new matcher that only matches regular files or |
|
327 | # Cook up a new matcher that only matches regular files or | |
324 | # standins corresponding to the big files requested by the |
|
328 | # standins corresponding to the big files requested by the | |
325 | # user. Have to modify _files to prevent commit() from |
|
329 | # user. Have to modify _files to prevent commit() from | |
326 | # complaining "not tracked" for big files. |
|
330 | # complaining "not tracked" for big files. | |
327 | lfiles = lfutil.listlfiles(repo) |
|
331 | lfiles = lfutil.listlfiles(repo) | |
328 | match = copy.copy(match) |
|
332 | match = copy.copy(match) | |
329 | orig_matchfn = match.matchfn |
|
333 | orig_matchfn = match.matchfn | |
330 |
|
334 | |||
331 | # Check both the list of largefiles and the list of |
|
335 | # Check both the list of largefiles and the list of | |
332 | # standins because if a largefile was removed, it |
|
336 | # standins because if a largefile was removed, it | |
333 | # won't be in the list of largefiles at this point |
|
337 | # won't be in the list of largefiles at this point | |
334 | match._files += sorted(standins) |
|
338 | match._files += sorted(standins) | |
335 |
|
339 | |||
336 | actualfiles = [] |
|
340 | actualfiles = [] | |
337 | for f in match._files: |
|
341 | for f in match._files: | |
338 | fstandin = lfutil.standin(f) |
|
342 | fstandin = lfutil.standin(f) | |
339 |
|
343 | |||
340 | # ignore known largefiles and standins |
|
344 | # ignore known largefiles and standins | |
341 | if f in lfiles or fstandin in standins: |
|
345 | if f in lfiles or fstandin in standins: | |
342 | continue |
|
346 | continue | |
343 |
|
347 | |||
344 | # append directory separator to avoid collisions |
|
348 | # append directory separator to avoid collisions | |
345 | if not fstandin.endswith(os.sep): |
|
349 | if not fstandin.endswith(os.sep): | |
346 | fstandin += os.sep |
|
350 | fstandin += os.sep | |
347 |
|
351 | |||
348 | # prevalidate matching standin directories |
|
352 | # prevalidate matching standin directories | |
349 | if util.any(st for st in match._files |
|
353 | if util.any(st for st in match._files | |
350 | if st.startswith(fstandin)): |
|
354 | if st.startswith(fstandin)): | |
351 | continue |
|
355 | continue | |
352 | actualfiles.append(f) |
|
356 | actualfiles.append(f) | |
353 | match._files = actualfiles |
|
357 | match._files = actualfiles | |
354 |
|
358 | |||
355 | def matchfn(f): |
|
359 | def matchfn(f): | |
356 | if orig_matchfn(f): |
|
360 | if orig_matchfn(f): | |
357 | return f not in lfiles |
|
361 | return f not in lfiles | |
358 | else: |
|
362 | else: | |
359 | return f in standins |
|
363 | return f in standins | |
360 |
|
364 | |||
361 | match.matchfn = matchfn |
|
365 | match.matchfn = matchfn | |
362 | return orig(text=text, user=user, date=date, match=match, |
|
366 | return orig(text=text, user=user, date=date, match=match, | |
363 | force=force, editor=editor, extra=extra) |
|
367 | force=force, editor=editor, extra=extra) | |
364 | finally: |
|
368 | finally: | |
365 | wlock.release() |
|
369 | wlock.release() | |
366 |
|
370 | |||
367 | def push(self, remote, force=False, revs=None, newbranch=False): |
|
371 | def push(self, remote, force=False, revs=None, newbranch=False): | |
368 | o = lfutil.findoutgoing(repo, remote, force) |
|
372 | o = lfutil.findoutgoing(repo, remote, force) | |
369 | if o: |
|
373 | if o: | |
370 | toupload = set() |
|
374 | toupload = set() | |
371 | o = repo.changelog.nodesbetween(o, revs)[0] |
|
375 | o = repo.changelog.nodesbetween(o, revs)[0] | |
372 | for n in o: |
|
376 | for n in o: | |
373 | parents = [p for p in repo.changelog.parents(n) |
|
377 | parents = [p for p in repo.changelog.parents(n) | |
374 | if p != node.nullid] |
|
378 | if p != node.nullid] | |
375 | ctx = repo[n] |
|
379 | ctx = repo[n] | |
376 | files = set(ctx.files()) |
|
380 | files = set(ctx.files()) | |
377 | if len(parents) == 2: |
|
381 | if len(parents) == 2: | |
378 | mc = ctx.manifest() |
|
382 | mc = ctx.manifest() | |
379 | mp1 = ctx.parents()[0].manifest() |
|
383 | mp1 = ctx.parents()[0].manifest() | |
380 | mp2 = ctx.parents()[1].manifest() |
|
384 | mp2 = ctx.parents()[1].manifest() | |
381 | for f in mp1: |
|
385 | for f in mp1: | |
382 | if f not in mc: |
|
386 | if f not in mc: | |
383 | files.add(f) |
|
387 | files.add(f) | |
384 | for f in mp2: |
|
388 | for f in mp2: | |
385 | if f not in mc: |
|
389 | if f not in mc: | |
386 | files.add(f) |
|
390 | files.add(f) | |
387 | for f in mc: |
|
391 | for f in mc: | |
388 | if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, |
|
392 | if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, | |
389 | None): |
|
393 | None): | |
390 | files.add(f) |
|
394 | files.add(f) | |
391 |
|
395 | |||
392 | toupload = toupload.union( |
|
396 | toupload = toupload.union( | |
393 | set([ctx[f].data().strip() |
|
397 | set([ctx[f].data().strip() | |
394 | for f in files |
|
398 | for f in files | |
395 | if lfutil.isstandin(f) and f in ctx])) |
|
399 | if lfutil.isstandin(f) and f in ctx])) | |
396 | lfcommands.uploadlfiles(ui, self, remote, toupload) |
|
400 | lfcommands.uploadlfiles(ui, self, remote, toupload) | |
397 | return super(lfiles_repo, self).push(remote, force, revs, |
|
401 | return super(lfiles_repo, self).push(remote, force, revs, | |
398 | newbranch) |
|
402 | newbranch) | |
399 |
|
403 | |||
400 | repo.__class__ = lfiles_repo |
|
404 | repo.__class__ = lfiles_repo | |
401 |
|
405 | |||
402 | def checkrequireslfiles(ui, repo, **kwargs): |
|
406 | def checkrequireslfiles(ui, repo, **kwargs): | |
403 | if 'largefiles' not in repo.requirements and util.any( |
|
407 | if 'largefiles' not in repo.requirements and util.any( | |
404 | lfutil.shortname+'/' in f[0] for f in repo.store.datafiles()): |
|
408 | lfutil.shortname+'/' in f[0] for f in repo.store.datafiles()): | |
405 | repo.requirements.add('largefiles') |
|
409 | repo.requirements.add('largefiles') | |
406 | repo._writerequirements() |
|
410 | repo._writerequirements() | |
407 |
|
411 | |||
408 | ui.setconfig('hooks', 'changegroup.lfiles', checkrequireslfiles) |
|
412 | ui.setconfig('hooks', 'changegroup.lfiles', checkrequireslfiles) | |
409 | ui.setconfig('hooks', 'commit.lfiles', checkrequireslfiles) |
|
413 | ui.setconfig('hooks', 'commit.lfiles', checkrequireslfiles) |
@@ -1,857 +1,874 b'' | |||||
1 | $ cat >> $HGRCPATH <<EOF |
|
1 | $ cat >> $HGRCPATH <<EOF | |
2 | > [extensions] |
|
2 | > [extensions] | |
3 | > largefiles= |
|
3 | > largefiles= | |
4 | > purge= |
|
4 | > purge= | |
5 | > rebase= |
|
5 | > rebase= | |
6 | > transplant= |
|
6 | > transplant= | |
7 | > [largefiles] |
|
7 | > [largefiles] | |
8 | > minsize=2 |
|
8 | > minsize=2 | |
9 | > patterns=glob:**.dat |
|
9 | > patterns=glob:**.dat | |
10 | > EOF |
|
10 | > EOF | |
11 |
|
11 | |||
12 | Create the repo with a couple of revisions of both large and normal |
|
12 | Create the repo with a couple of revisions of both large and normal | |
13 | files, testing that status correctly shows largefiles. |
|
13 | files, testing that status correctly shows largefiles. | |
14 |
|
14 | |||
15 | $ hg init a |
|
15 | $ hg init a | |
16 | $ cd a |
|
16 | $ cd a | |
17 | $ mkdir sub |
|
17 | $ mkdir sub | |
18 | $ echo normal1 > normal1 |
|
18 | $ echo normal1 > normal1 | |
19 | $ echo normal2 > sub/normal2 |
|
19 | $ echo normal2 > sub/normal2 | |
20 | $ echo large1 > large1 |
|
20 | $ echo large1 > large1 | |
21 | $ echo large2 > sub/large2 |
|
21 | $ echo large2 > sub/large2 | |
22 | $ hg add normal1 sub/normal2 |
|
22 | $ hg add normal1 sub/normal2 | |
23 | $ hg add --large large1 sub/large2 |
|
23 | $ hg add --large large1 sub/large2 | |
24 | $ hg commit -m "add files" |
|
24 | $ hg commit -m "add files" | |
25 | $ echo normal11 > normal1 |
|
25 | $ echo normal11 > normal1 | |
26 | $ echo normal22 > sub/normal2 |
|
26 | $ echo normal22 > sub/normal2 | |
27 | $ echo large11 > large1 |
|
27 | $ echo large11 > large1 | |
28 | $ echo large22 > sub/large2 |
|
28 | $ echo large22 > sub/large2 | |
29 | $ hg st |
|
29 | $ hg st | |
30 | M large1 |
|
30 | M large1 | |
31 | M normal1 |
|
31 | M normal1 | |
32 | M sub/large2 |
|
32 | M sub/large2 | |
33 | M sub/normal2 |
|
33 | M sub/normal2 | |
34 | $ hg commit -m "edit files" |
|
34 | $ hg commit -m "edit files" | |
35 |
|
35 | |||
36 | Commit preserved largefile contents. |
|
36 | Commit preserved largefile contents. | |
37 |
|
37 | |||
38 | $ cat normal1 |
|
38 | $ cat normal1 | |
39 | normal11 |
|
39 | normal11 | |
40 | $ cat large1 |
|
40 | $ cat large1 | |
41 | large11 |
|
41 | large11 | |
42 | $ cat sub/normal2 |
|
42 | $ cat sub/normal2 | |
43 | normal22 |
|
43 | normal22 | |
44 | $ cat sub/large2 |
|
44 | $ cat sub/large2 | |
45 | large22 |
|
45 | large22 | |
46 |
|
46 | |||
47 | Remove both largefiles and normal files. |
|
47 | Remove both largefiles and normal files. | |
48 |
|
48 | |||
49 | $ hg remove normal1 large1 |
|
49 | $ hg remove normal1 large1 | |
50 | $ hg commit -m "remove files" |
|
50 | $ hg commit -m "remove files" | |
51 | $ ls |
|
51 | $ ls | |
52 | sub |
|
52 | sub | |
53 |
|
53 | |||
54 | Copy both largefiles and normal files (testing that status output is correct). |
|
54 | Copy both largefiles and normal files (testing that status output is correct). | |
55 |
|
55 | |||
56 | $ hg cp sub/normal2 normal1 |
|
56 | $ hg cp sub/normal2 normal1 | |
57 | $ hg cp sub/large2 large1 |
|
57 | $ hg cp sub/large2 large1 | |
58 | $ hg st |
|
58 | $ hg st | |
59 | A large1 |
|
59 | A large1 | |
60 | A normal1 |
|
60 | A normal1 | |
61 | $ hg commit -m "copy files" |
|
61 | $ hg commit -m "copy files" | |
62 | $ cat normal1 |
|
62 | $ cat normal1 | |
63 | normal22 |
|
63 | normal22 | |
64 | $ cat large1 |
|
64 | $ cat large1 | |
65 | large22 |
|
65 | large22 | |
66 |
|
66 | |||
67 | Test moving largefiles and verify that normal files are also unaffected. |
|
67 | Test moving largefiles and verify that normal files are also unaffected. | |
68 |
|
68 | |||
69 | $ hg mv normal1 normal3 |
|
69 | $ hg mv normal1 normal3 | |
70 | $ hg mv large1 large3 |
|
70 | $ hg mv large1 large3 | |
71 | $ hg mv sub/normal2 sub/normal4 |
|
71 | $ hg mv sub/normal2 sub/normal4 | |
72 | $ hg mv sub/large2 sub/large4 |
|
72 | $ hg mv sub/large2 sub/large4 | |
73 | $ hg commit -m "move files" |
|
73 | $ hg commit -m "move files" | |
74 | $ cat normal3 |
|
74 | $ cat normal3 | |
75 | normal22 |
|
75 | normal22 | |
76 | $ cat large3 |
|
76 | $ cat large3 | |
77 | large22 |
|
77 | large22 | |
78 | $ cat sub/normal4 |
|
78 | $ cat sub/normal4 | |
79 | normal22 |
|
79 | normal22 | |
80 | $ cat sub/large4 |
|
80 | $ cat sub/large4 | |
81 | large22 |
|
81 | large22 | |
82 |
|
82 | |||
83 | Test archiving the various revisions. These hit corner cases known with |
|
83 | Test archiving the various revisions. These hit corner cases known with | |
84 | archiving. |
|
84 | archiving. | |
85 |
|
85 | |||
86 | $ hg archive -r 0 ../archive0 |
|
86 | $ hg archive -r 0 ../archive0 | |
87 | $ hg archive -r 1 ../archive1 |
|
87 | $ hg archive -r 1 ../archive1 | |
88 | $ hg archive -r 2 ../archive2 |
|
88 | $ hg archive -r 2 ../archive2 | |
89 | $ hg archive -r 3 ../archive3 |
|
89 | $ hg archive -r 3 ../archive3 | |
90 | $ hg archive -r 4 ../archive4 |
|
90 | $ hg archive -r 4 ../archive4 | |
91 | $ cd ../archive0 |
|
91 | $ cd ../archive0 | |
92 | $ cat normal1 |
|
92 | $ cat normal1 | |
93 | normal1 |
|
93 | normal1 | |
94 | $ cat large1 |
|
94 | $ cat large1 | |
95 | large1 |
|
95 | large1 | |
96 | $ cat sub/normal2 |
|
96 | $ cat sub/normal2 | |
97 | normal2 |
|
97 | normal2 | |
98 | $ cat sub/large2 |
|
98 | $ cat sub/large2 | |
99 | large2 |
|
99 | large2 | |
100 | $ cd ../archive1 |
|
100 | $ cd ../archive1 | |
101 | $ cat normal1 |
|
101 | $ cat normal1 | |
102 | normal11 |
|
102 | normal11 | |
103 | $ cat large1 |
|
103 | $ cat large1 | |
104 | large11 |
|
104 | large11 | |
105 | $ cat sub/normal2 |
|
105 | $ cat sub/normal2 | |
106 | normal22 |
|
106 | normal22 | |
107 | $ cat sub/large2 |
|
107 | $ cat sub/large2 | |
108 | large22 |
|
108 | large22 | |
109 | $ cd ../archive2 |
|
109 | $ cd ../archive2 | |
110 | $ ls |
|
110 | $ ls | |
111 | sub |
|
111 | sub | |
112 | $ cat sub/normal2 |
|
112 | $ cat sub/normal2 | |
113 | normal22 |
|
113 | normal22 | |
114 | $ cat sub/large2 |
|
114 | $ cat sub/large2 | |
115 | large22 |
|
115 | large22 | |
116 | $ cd ../archive3 |
|
116 | $ cd ../archive3 | |
117 | $ cat normal1 |
|
117 | $ cat normal1 | |
118 | normal22 |
|
118 | normal22 | |
119 | $ cat large1 |
|
119 | $ cat large1 | |
120 | large22 |
|
120 | large22 | |
121 | $ cat sub/normal2 |
|
121 | $ cat sub/normal2 | |
122 | normal22 |
|
122 | normal22 | |
123 | $ cat sub/large2 |
|
123 | $ cat sub/large2 | |
124 | large22 |
|
124 | large22 | |
125 | $ cd ../archive4 |
|
125 | $ cd ../archive4 | |
126 | $ cat normal3 |
|
126 | $ cat normal3 | |
127 | normal22 |
|
127 | normal22 | |
128 | $ cat large3 |
|
128 | $ cat large3 | |
129 | large22 |
|
129 | large22 | |
130 | $ cat sub/normal4 |
|
130 | $ cat sub/normal4 | |
131 | normal22 |
|
131 | normal22 | |
132 | $ cat sub/large4 |
|
132 | $ cat sub/large4 | |
133 | large22 |
|
133 | large22 | |
134 |
|
134 | |||
135 | Commit corner case: specify files to commit. |
|
135 | Commit corner case: specify files to commit. | |
136 |
|
136 | |||
137 | $ cd ../a |
|
137 | $ cd ../a | |
138 | $ echo normal3 > normal3 |
|
138 | $ echo normal3 > normal3 | |
139 | $ echo large3 > large3 |
|
139 | $ echo large3 > large3 | |
140 | $ echo normal4 > sub/normal4 |
|
140 | $ echo normal4 > sub/normal4 | |
141 | $ echo large4 > sub/large4 |
|
141 | $ echo large4 > sub/large4 | |
142 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" |
|
142 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" | |
143 | $ cat normal3 |
|
143 | $ cat normal3 | |
144 | normal3 |
|
144 | normal3 | |
145 | $ cat large3 |
|
145 | $ cat large3 | |
146 | large3 |
|
146 | large3 | |
147 | $ cat sub/normal4 |
|
147 | $ cat sub/normal4 | |
148 | normal4 |
|
148 | normal4 | |
149 | $ cat sub/large4 |
|
149 | $ cat sub/large4 | |
150 | large4 |
|
150 | large4 | |
151 |
|
151 | |||
152 | One more commit corner case: commit from a subdirectory. |
|
152 | One more commit corner case: commit from a subdirectory. | |
153 |
|
153 | |||
154 | $ cd ../a |
|
154 | $ cd ../a | |
155 | $ echo normal33 > normal3 |
|
155 | $ echo normal33 > normal3 | |
156 | $ echo large33 > large3 |
|
156 | $ echo large33 > large3 | |
157 | $ echo normal44 > sub/normal4 |
|
157 | $ echo normal44 > sub/normal4 | |
158 | $ echo large44 > sub/large4 |
|
158 | $ echo large44 > sub/large4 | |
159 | $ cd sub |
|
159 | $ cd sub | |
160 | $ hg commit -m "edit files yet again" |
|
160 | $ hg commit -m "edit files yet again" | |
161 | $ cat ../normal3 |
|
161 | $ cat ../normal3 | |
162 | normal33 |
|
162 | normal33 | |
163 | $ cat ../large3 |
|
163 | $ cat ../large3 | |
164 | large33 |
|
164 | large33 | |
165 | $ cat normal4 |
|
165 | $ cat normal4 | |
166 | normal44 |
|
166 | normal44 | |
167 | $ cat large4 |
|
167 | $ cat large4 | |
168 | large44 |
|
168 | large44 | |
169 |
|
169 | |||
170 | Committing standins is not allowed. |
|
170 | Committing standins is not allowed. | |
171 |
|
171 | |||
172 | $ cd .. |
|
172 | $ cd .. | |
173 | $ echo large3 > large3 |
|
173 | $ echo large3 > large3 | |
174 | $ hg commit .hglf/large3 -m "try to commit standin" |
|
174 | $ hg commit .hglf/large3 -m "try to commit standin" | |
175 | abort: file ".hglf/large3" is a largefile standin |
|
175 | abort: file ".hglf/large3" is a largefile standin | |
176 | (commit the largefile itself instead) |
|
176 | (commit the largefile itself instead) | |
177 | [255] |
|
177 | [255] | |
178 |
|
178 | |||
179 | Corner cases for adding largefiles. |
|
179 | Corner cases for adding largefiles. | |
180 |
|
180 | |||
181 | $ echo large5 > large5 |
|
181 | $ echo large5 > large5 | |
182 | $ hg add --large large5 |
|
182 | $ hg add --large large5 | |
183 | $ hg add --large large5 |
|
183 | $ hg add --large large5 | |
184 | large5 already a largefile |
|
184 | large5 already a largefile | |
185 | $ mkdir sub2 |
|
185 | $ mkdir sub2 | |
186 | $ echo large6 > sub2/large6 |
|
186 | $ echo large6 > sub2/large6 | |
187 | $ echo large7 > sub2/large7 |
|
187 | $ echo large7 > sub2/large7 | |
188 | $ hg add --large sub2 |
|
188 | $ hg add --large sub2 | |
189 | adding sub2/large6 as a largefile |
|
189 | adding sub2/large6 as a largefile | |
190 | adding sub2/large7 as a largefile |
|
190 | adding sub2/large7 as a largefile | |
191 | $ hg st |
|
191 | $ hg st | |
192 | M large3 |
|
192 | M large3 | |
193 | A large5 |
|
193 | A large5 | |
194 | A sub2/large6 |
|
194 | A sub2/large6 | |
195 | A sub2/large7 |
|
195 | A sub2/large7 | |
196 |
|
196 | |||
197 | Config settings (pattern **.dat, minsize 2 MB) are respected. |
|
197 | Config settings (pattern **.dat, minsize 2 MB) are respected. | |
198 |
|
198 | |||
199 | $ echo testdata > test.dat |
|
199 | $ echo testdata > test.dat | |
200 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null |
|
200 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null | |
201 | $ hg add |
|
201 | $ hg add | |
202 | adding reallylarge as a largefile |
|
202 | adding reallylarge as a largefile | |
203 | adding test.dat as a largefile |
|
203 | adding test.dat as a largefile | |
204 |
|
204 | |||
205 | Test that minsize and --lfsize handle float values; |
|
205 | Test that minsize and --lfsize handle float values; | |
206 | also tests that --lfsize overrides largefiles.minsize. |
|
206 | also tests that --lfsize overrides largefiles.minsize. | |
207 | (0.250 MB = 256 kB = 262144 B) |
|
207 | (0.250 MB = 256 kB = 262144 B) | |
208 |
|
208 | |||
209 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null |
|
209 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null | |
210 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null |
|
210 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null | |
211 | $ hg --config largefiles.minsize=.25 add |
|
211 | $ hg --config largefiles.minsize=.25 add | |
212 | adding ratherlarge as a largefile |
|
212 | adding ratherlarge as a largefile | |
213 | adding medium |
|
213 | adding medium | |
214 | $ hg forget medium |
|
214 | $ hg forget medium | |
215 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
215 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
216 | adding medium as a largefile |
|
216 | adding medium as a largefile | |
217 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null |
|
217 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null | |
218 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
218 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
219 | adding notlarge |
|
219 | adding notlarge | |
220 | $ hg forget notlarge |
|
220 | $ hg forget notlarge | |
221 |
|
221 | |||
222 | Test forget on largefiles. |
|
222 | Test forget on largefiles. | |
223 |
|
223 | |||
224 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium |
|
224 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium | |
225 | $ hg st |
|
225 | $ hg st | |
226 | A sub2/large6 |
|
226 | A sub2/large6 | |
227 | A sub2/large7 |
|
227 | A sub2/large7 | |
228 | R large3 |
|
228 | R large3 | |
229 | ? large5 |
|
229 | ? large5 | |
230 | ? medium |
|
230 | ? medium | |
231 | ? notlarge |
|
231 | ? notlarge | |
232 | ? ratherlarge |
|
232 | ? ratherlarge | |
233 | ? reallylarge |
|
233 | ? reallylarge | |
234 | ? test.dat |
|
234 | ? test.dat | |
235 | $ hg commit -m "add/edit more largefiles" |
|
235 | $ hg commit -m "add/edit more largefiles" | |
236 | $ hg st |
|
236 | $ hg st | |
237 | ? large3 |
|
237 | ? large3 | |
238 | ? large5 |
|
238 | ? large5 | |
239 | ? medium |
|
239 | ? medium | |
240 | ? notlarge |
|
240 | ? notlarge | |
241 | ? ratherlarge |
|
241 | ? ratherlarge | |
242 | ? reallylarge |
|
242 | ? reallylarge | |
243 | ? test.dat |
|
243 | ? test.dat | |
244 |
|
244 | |||
245 | Purge with largefiles: verify that largefiles are still in the working |
|
245 | Purge with largefiles: verify that largefiles are still in the working | |
246 | dir after a purge. |
|
246 | dir after a purge. | |
247 |
|
247 | |||
248 | $ hg purge --all |
|
248 | $ hg purge --all | |
249 | $ cat sub/large4 |
|
249 | $ cat sub/large4 | |
250 | large44 |
|
250 | large44 | |
251 | $ cat sub2/large6 |
|
251 | $ cat sub2/large6 | |
252 | large6 |
|
252 | large6 | |
253 | $ cat sub2/large7 |
|
253 | $ cat sub2/large7 | |
254 | large7 |
|
254 | large7 | |
255 |
|
255 | |||
256 | Clone a largefiles repo. |
|
256 | Clone a largefiles repo. | |
257 |
|
257 | |||
258 | $ hg clone . ../b |
|
258 | $ hg clone . ../b | |
259 | updating to branch default |
|
259 | updating to branch default | |
260 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
260 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
261 | getting changed largefiles |
|
261 | getting changed largefiles | |
262 | 3 largefiles updated, 0 removed |
|
262 | 3 largefiles updated, 0 removed | |
263 | $ cd ../b |
|
263 | $ cd ../b | |
264 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
264 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
265 | 7:daea875e9014 add/edit more largefiles |
|
265 | 7:daea875e9014 add/edit more largefiles | |
266 | 6:4355d653f84f edit files yet again |
|
266 | 6:4355d653f84f edit files yet again | |
267 | 5:9d5af5072dbd edit files again |
|
267 | 5:9d5af5072dbd edit files again | |
268 | 4:74c02385b94c move files |
|
268 | 4:74c02385b94c move files | |
269 | 3:9e8fbc4bce62 copy files |
|
269 | 3:9e8fbc4bce62 copy files | |
270 | 2:51a0ae4d5864 remove files |
|
270 | 2:51a0ae4d5864 remove files | |
271 | 1:ce8896473775 edit files |
|
271 | 1:ce8896473775 edit files | |
272 | 0:30d30fe6a5be add files |
|
272 | 0:30d30fe6a5be add files | |
273 | $ cat normal3 |
|
273 | $ cat normal3 | |
274 | normal33 |
|
274 | normal33 | |
275 | $ cat sub/normal4 |
|
275 | $ cat sub/normal4 | |
276 | normal44 |
|
276 | normal44 | |
277 | $ cat sub/large4 |
|
277 | $ cat sub/large4 | |
278 | large44 |
|
278 | large44 | |
279 | $ cat sub2/large6 |
|
279 | $ cat sub2/large6 | |
280 | large6 |
|
280 | large6 | |
281 | $ cat sub2/large7 |
|
281 | $ cat sub2/large7 | |
282 | large7 |
|
282 | large7 | |
283 | $ cd .. |
|
283 | $ cd .. | |
284 | $ hg clone a -r 3 c |
|
284 | $ hg clone a -r 3 c | |
285 | adding changesets |
|
285 | adding changesets | |
286 | adding manifests |
|
286 | adding manifests | |
287 | adding file changes |
|
287 | adding file changes | |
288 | added 4 changesets with 10 changes to 4 files |
|
288 | added 4 changesets with 10 changes to 4 files | |
289 | updating to branch default |
|
289 | updating to branch default | |
290 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
290 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
291 | getting changed largefiles |
|
291 | getting changed largefiles | |
292 | 2 largefiles updated, 0 removed |
|
292 | 2 largefiles updated, 0 removed | |
293 | $ cd c |
|
293 | $ cd c | |
294 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
294 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
295 | 3:9e8fbc4bce62 copy files |
|
295 | 3:9e8fbc4bce62 copy files | |
296 | 2:51a0ae4d5864 remove files |
|
296 | 2:51a0ae4d5864 remove files | |
297 | 1:ce8896473775 edit files |
|
297 | 1:ce8896473775 edit files | |
298 | 0:30d30fe6a5be add files |
|
298 | 0:30d30fe6a5be add files | |
299 | $ cat normal1 |
|
299 | $ cat normal1 | |
300 | normal22 |
|
300 | normal22 | |
301 | $ cat large1 |
|
301 | $ cat large1 | |
302 | large22 |
|
302 | large22 | |
303 | $ cat sub/normal2 |
|
303 | $ cat sub/normal2 | |
304 | normal22 |
|
304 | normal22 | |
305 | $ cat sub/large2 |
|
305 | $ cat sub/large2 | |
306 | large22 |
|
306 | large22 | |
307 |
|
307 | |||
308 | Old revisions of a clone have correct largefiles content (this also |
|
308 | Old revisions of a clone have correct largefiles content (this also | |
309 | tests update). |
|
309 | tests update). | |
310 |
|
310 | |||
311 | $ hg update -r 1 |
|
311 | $ hg update -r 1 | |
312 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
312 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
313 | getting changed largefiles |
|
313 | getting changed largefiles | |
314 | 1 largefiles updated, 0 removed |
|
314 | 1 largefiles updated, 0 removed | |
315 | $ cat large1 |
|
315 | $ cat large1 | |
316 | large11 |
|
316 | large11 | |
317 | $ cat sub/large2 |
|
317 | $ cat sub/large2 | |
318 | large22 |
|
318 | large22 | |
319 |
|
319 | |||
320 | Rebasing between two repositories does not revert largefiles to old |
|
320 | Rebasing between two repositories does not revert largefiles to old | |
321 | revisions (this was a very bad bug that took a lot of work to fix). |
|
321 | revisions (this was a very bad bug that took a lot of work to fix). | |
322 |
|
322 | |||
323 | $ cd .. |
|
323 | $ cd .. | |
324 | $ hg clone a d |
|
324 | $ hg clone a d | |
325 | updating to branch default |
|
325 | updating to branch default | |
326 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
326 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
327 | getting changed largefiles |
|
327 | getting changed largefiles | |
328 | 3 largefiles updated, 0 removed |
|
328 | 3 largefiles updated, 0 removed | |
329 | $ cd b |
|
329 | $ cd b | |
330 | $ echo large4-modified > sub/large4 |
|
330 | $ echo large4-modified > sub/large4 | |
331 | $ echo normal3-modified > normal3 |
|
331 | $ echo normal3-modified > normal3 | |
332 | $ hg commit -m "modify normal file and largefile in repo b" |
|
332 | $ hg commit -m "modify normal file and largefile in repo b" | |
333 | $ cd ../d |
|
333 | $ cd ../d | |
334 | $ echo large6-modified > sub2/large6 |
|
334 | $ echo large6-modified > sub2/large6 | |
335 | $ echo normal4-modified > sub/normal4 |
|
335 | $ echo normal4-modified > sub/normal4 | |
336 | $ hg commit -m "modify normal file largefile in repo d" |
|
336 | $ hg commit -m "modify normal file largefile in repo d" | |
337 | $ cd .. |
|
337 | $ cd .. | |
338 | $ hg clone d e |
|
338 | $ hg clone d e | |
339 | updating to branch default |
|
339 | updating to branch default | |
340 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
340 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
341 | getting changed largefiles |
|
341 | getting changed largefiles | |
342 | 3 largefiles updated, 0 removed |
|
342 | 3 largefiles updated, 0 removed | |
343 | $ cd d |
|
343 | $ cd d | |
344 | $ hg pull --rebase ../b |
|
344 | $ hg pull --rebase ../b | |
345 | pulling from ../b |
|
345 | pulling from ../b | |
346 | searching for changes |
|
346 | searching for changes | |
347 | adding changesets |
|
347 | adding changesets | |
348 | adding manifests |
|
348 | adding manifests | |
349 | adding file changes |
|
349 | adding file changes | |
350 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
350 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
351 | getting changed largefiles |
|
351 | getting changed largefiles | |
352 | 1 largefiles updated, 0 removed |
|
352 | 1 largefiles updated, 0 removed | |
353 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg |
|
353 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg | |
354 | nothing to rebase |
|
354 | nothing to rebase | |
355 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
355 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
356 | 9:598410d3eb9a modify normal file largefile in repo d |
|
356 | 9:598410d3eb9a modify normal file largefile in repo d | |
357 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
357 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
358 | 7:daea875e9014 add/edit more largefiles |
|
358 | 7:daea875e9014 add/edit more largefiles | |
359 | 6:4355d653f84f edit files yet again |
|
359 | 6:4355d653f84f edit files yet again | |
360 | 5:9d5af5072dbd edit files again |
|
360 | 5:9d5af5072dbd edit files again | |
361 | 4:74c02385b94c move files |
|
361 | 4:74c02385b94c move files | |
362 | 3:9e8fbc4bce62 copy files |
|
362 | 3:9e8fbc4bce62 copy files | |
363 | 2:51a0ae4d5864 remove files |
|
363 | 2:51a0ae4d5864 remove files | |
364 | 1:ce8896473775 edit files |
|
364 | 1:ce8896473775 edit files | |
365 | 0:30d30fe6a5be add files |
|
365 | 0:30d30fe6a5be add files | |
366 | $ cat normal3 |
|
366 | $ cat normal3 | |
367 | normal3-modified |
|
367 | normal3-modified | |
368 | $ cat sub/normal4 |
|
368 | $ cat sub/normal4 | |
369 | normal4-modified |
|
369 | normal4-modified | |
370 | $ cat sub/large4 |
|
370 | $ cat sub/large4 | |
371 | large4-modified |
|
371 | large4-modified | |
372 | $ cat sub2/large6 |
|
372 | $ cat sub2/large6 | |
373 | large6-modified |
|
373 | large6-modified | |
374 | $ cat sub2/large7 |
|
374 | $ cat sub2/large7 | |
375 | large7 |
|
375 | large7 | |
376 | $ cd ../e |
|
376 | $ cd ../e | |
377 | $ hg pull ../b |
|
377 | $ hg pull ../b | |
378 | pulling from ../b |
|
378 | pulling from ../b | |
379 | searching for changes |
|
379 | searching for changes | |
380 | adding changesets |
|
380 | adding changesets | |
381 | adding manifests |
|
381 | adding manifests | |
382 | adding file changes |
|
382 | adding file changes | |
383 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
383 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
384 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
384 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
385 | $ hg rebase |
|
385 | $ hg rebase | |
386 | getting changed largefiles |
|
386 | getting changed largefiles | |
387 | 1 largefiles updated, 0 removed |
|
387 | 1 largefiles updated, 0 removed | |
388 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg |
|
388 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg | |
389 | $ hg log |
|
389 | $ hg log | |
390 | changeset: 9:598410d3eb9a |
|
390 | changeset: 9:598410d3eb9a | |
391 | tag: tip |
|
391 | tag: tip | |
392 | user: test |
|
392 | user: test | |
393 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
393 | date: Thu Jan 01 00:00:00 1970 +0000 | |
394 | summary: modify normal file largefile in repo d |
|
394 | summary: modify normal file largefile in repo d | |
395 |
|
395 | |||
396 | changeset: 8:a381d2c8c80e |
|
396 | changeset: 8:a381d2c8c80e | |
397 | user: test |
|
397 | user: test | |
398 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
398 | date: Thu Jan 01 00:00:00 1970 +0000 | |
399 | summary: modify normal file and largefile in repo b |
|
399 | summary: modify normal file and largefile in repo b | |
400 |
|
400 | |||
401 | changeset: 7:daea875e9014 |
|
401 | changeset: 7:daea875e9014 | |
402 | user: test |
|
402 | user: test | |
403 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
403 | date: Thu Jan 01 00:00:00 1970 +0000 | |
404 | summary: add/edit more largefiles |
|
404 | summary: add/edit more largefiles | |
405 |
|
405 | |||
406 | changeset: 6:4355d653f84f |
|
406 | changeset: 6:4355d653f84f | |
407 | user: test |
|
407 | user: test | |
408 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
408 | date: Thu Jan 01 00:00:00 1970 +0000 | |
409 | summary: edit files yet again |
|
409 | summary: edit files yet again | |
410 |
|
410 | |||
411 | changeset: 5:9d5af5072dbd |
|
411 | changeset: 5:9d5af5072dbd | |
412 | user: test |
|
412 | user: test | |
413 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
413 | date: Thu Jan 01 00:00:00 1970 +0000 | |
414 | summary: edit files again |
|
414 | summary: edit files again | |
415 |
|
415 | |||
416 | changeset: 4:74c02385b94c |
|
416 | changeset: 4:74c02385b94c | |
417 | user: test |
|
417 | user: test | |
418 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
418 | date: Thu Jan 01 00:00:00 1970 +0000 | |
419 | summary: move files |
|
419 | summary: move files | |
420 |
|
420 | |||
421 | changeset: 3:9e8fbc4bce62 |
|
421 | changeset: 3:9e8fbc4bce62 | |
422 | user: test |
|
422 | user: test | |
423 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
423 | date: Thu Jan 01 00:00:00 1970 +0000 | |
424 | summary: copy files |
|
424 | summary: copy files | |
425 |
|
425 | |||
426 | changeset: 2:51a0ae4d5864 |
|
426 | changeset: 2:51a0ae4d5864 | |
427 | user: test |
|
427 | user: test | |
428 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
428 | date: Thu Jan 01 00:00:00 1970 +0000 | |
429 | summary: remove files |
|
429 | summary: remove files | |
430 |
|
430 | |||
431 | changeset: 1:ce8896473775 |
|
431 | changeset: 1:ce8896473775 | |
432 | user: test |
|
432 | user: test | |
433 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
433 | date: Thu Jan 01 00:00:00 1970 +0000 | |
434 | summary: edit files |
|
434 | summary: edit files | |
435 |
|
435 | |||
436 | changeset: 0:30d30fe6a5be |
|
436 | changeset: 0:30d30fe6a5be | |
437 | user: test |
|
437 | user: test | |
438 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
438 | date: Thu Jan 01 00:00:00 1970 +0000 | |
439 | summary: add files |
|
439 | summary: add files | |
440 |
|
440 | |||
441 | $ cat normal3 |
|
441 | $ cat normal3 | |
442 | normal3-modified |
|
442 | normal3-modified | |
443 | $ cat sub/normal4 |
|
443 | $ cat sub/normal4 | |
444 | normal4-modified |
|
444 | normal4-modified | |
445 | $ cat sub/large4 |
|
445 | $ cat sub/large4 | |
446 | large4-modified |
|
446 | large4-modified | |
447 | $ cat sub2/large6 |
|
447 | $ cat sub2/large6 | |
448 | large6-modified |
|
448 | large6-modified | |
449 | $ cat sub2/large7 |
|
449 | $ cat sub2/large7 | |
450 | large7 |
|
450 | large7 | |
451 |
|
451 | |||
452 | Rollback on largefiles. |
|
452 | Rollback on largefiles. | |
453 |
|
453 | |||
454 | $ echo large4-modified-again > sub/large4 |
|
454 | $ echo large4-modified-again > sub/large4 | |
455 | $ hg commit -m "Modify large4 again" |
|
455 | $ hg commit -m "Modify large4 again" | |
456 | $ hg rollback |
|
456 | $ hg rollback | |
457 | repository tip rolled back to revision 9 (undo commit) |
|
457 | repository tip rolled back to revision 9 (undo commit) | |
458 | working directory now based on revision 9 |
|
458 | working directory now based on revision 9 | |
459 | $ hg st |
|
459 | $ hg st | |
460 | M sub/large4 |
|
460 | M sub/large4 | |
461 | $ hg log |
|
461 | $ hg log | |
462 | changeset: 9:598410d3eb9a |
|
462 | changeset: 9:598410d3eb9a | |
463 | tag: tip |
|
463 | tag: tip | |
464 | user: test |
|
464 | user: test | |
465 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
465 | date: Thu Jan 01 00:00:00 1970 +0000 | |
466 | summary: modify normal file largefile in repo d |
|
466 | summary: modify normal file largefile in repo d | |
467 |
|
467 | |||
468 | changeset: 8:a381d2c8c80e |
|
468 | changeset: 8:a381d2c8c80e | |
469 | user: test |
|
469 | user: test | |
470 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
470 | date: Thu Jan 01 00:00:00 1970 +0000 | |
471 | summary: modify normal file and largefile in repo b |
|
471 | summary: modify normal file and largefile in repo b | |
472 |
|
472 | |||
473 | changeset: 7:daea875e9014 |
|
473 | changeset: 7:daea875e9014 | |
474 | user: test |
|
474 | user: test | |
475 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
475 | date: Thu Jan 01 00:00:00 1970 +0000 | |
476 | summary: add/edit more largefiles |
|
476 | summary: add/edit more largefiles | |
477 |
|
477 | |||
478 | changeset: 6:4355d653f84f |
|
478 | changeset: 6:4355d653f84f | |
479 | user: test |
|
479 | user: test | |
480 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
480 | date: Thu Jan 01 00:00:00 1970 +0000 | |
481 | summary: edit files yet again |
|
481 | summary: edit files yet again | |
482 |
|
482 | |||
483 | changeset: 5:9d5af5072dbd |
|
483 | changeset: 5:9d5af5072dbd | |
484 | user: test |
|
484 | user: test | |
485 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
485 | date: Thu Jan 01 00:00:00 1970 +0000 | |
486 | summary: edit files again |
|
486 | summary: edit files again | |
487 |
|
487 | |||
488 | changeset: 4:74c02385b94c |
|
488 | changeset: 4:74c02385b94c | |
489 | user: test |
|
489 | user: test | |
490 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
490 | date: Thu Jan 01 00:00:00 1970 +0000 | |
491 | summary: move files |
|
491 | summary: move files | |
492 |
|
492 | |||
493 | changeset: 3:9e8fbc4bce62 |
|
493 | changeset: 3:9e8fbc4bce62 | |
494 | user: test |
|
494 | user: test | |
495 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
495 | date: Thu Jan 01 00:00:00 1970 +0000 | |
496 | summary: copy files |
|
496 | summary: copy files | |
497 |
|
497 | |||
498 | changeset: 2:51a0ae4d5864 |
|
498 | changeset: 2:51a0ae4d5864 | |
499 | user: test |
|
499 | user: test | |
500 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
500 | date: Thu Jan 01 00:00:00 1970 +0000 | |
501 | summary: remove files |
|
501 | summary: remove files | |
502 |
|
502 | |||
503 | changeset: 1:ce8896473775 |
|
503 | changeset: 1:ce8896473775 | |
504 | user: test |
|
504 | user: test | |
505 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
505 | date: Thu Jan 01 00:00:00 1970 +0000 | |
506 | summary: edit files |
|
506 | summary: edit files | |
507 |
|
507 | |||
508 | changeset: 0:30d30fe6a5be |
|
508 | changeset: 0:30d30fe6a5be | |
509 | user: test |
|
509 | user: test | |
510 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
510 | date: Thu Jan 01 00:00:00 1970 +0000 | |
511 | summary: add files |
|
511 | summary: add files | |
512 |
|
512 | |||
513 | $ cat sub/large4 |
|
513 | $ cat sub/large4 | |
514 | large4-modified-again |
|
514 | large4-modified-again | |
515 |
|
515 | |||
516 | "update --check" refuses to update with uncommitted changes. |
|
516 | "update --check" refuses to update with uncommitted changes. | |
517 | $ hg update --check 8 |
|
517 | $ hg update --check 8 | |
518 | abort: uncommitted local changes |
|
518 | abort: uncommitted local changes | |
519 | [255] |
|
519 | [255] | |
520 |
|
520 | |||
521 | "update --clean" leaves correct largefiles in working copy. |
|
521 | "update --clean" leaves correct largefiles in working copy. | |
522 |
|
522 | |||
523 | $ hg update --clean |
|
523 | $ hg update --clean | |
524 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
524 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
525 | getting changed largefiles |
|
525 | getting changed largefiles | |
526 | 1 largefiles updated, 0 removed |
|
526 | 1 largefiles updated, 0 removed | |
527 | $ cat normal3 |
|
527 | $ cat normal3 | |
528 | normal3-modified |
|
528 | normal3-modified | |
529 | $ cat sub/normal4 |
|
529 | $ cat sub/normal4 | |
530 | normal4-modified |
|
530 | normal4-modified | |
531 | $ cat sub/large4 |
|
531 | $ cat sub/large4 | |
532 | large4-modified |
|
532 | large4-modified | |
533 | $ cat sub2/large6 |
|
533 | $ cat sub2/large6 | |
534 | large6-modified |
|
534 | large6-modified | |
535 | $ cat sub2/large7 |
|
535 | $ cat sub2/large7 | |
536 | large7 |
|
536 | large7 | |
537 |
|
537 | |||
538 | Now "update check" is happy. |
|
538 | Now "update check" is happy. | |
539 | $ hg update --check 8 |
|
539 | $ hg update --check 8 | |
540 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
540 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
541 | getting changed largefiles |
|
541 | getting changed largefiles | |
542 | 1 largefiles updated, 0 removed |
|
542 | 1 largefiles updated, 0 removed | |
543 | $ hg update --check |
|
543 | $ hg update --check | |
544 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
544 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
545 | getting changed largefiles |
|
545 | getting changed largefiles | |
546 | 1 largefiles updated, 0 removed |
|
546 | 1 largefiles updated, 0 removed | |
547 |
|
547 | |||
548 | "revert" works on largefiles (and normal files too). |
|
548 | "revert" works on largefiles (and normal files too). | |
549 | $ echo hack3 >> normal3 |
|
549 | $ echo hack3 >> normal3 | |
550 | $ echo hack4 >> sub/normal4 |
|
550 | $ echo hack4 >> sub/normal4 | |
551 | $ echo hack4 >> sub/large4 |
|
551 | $ echo hack4 >> sub/large4 | |
552 | $ hg rm sub2/large6 |
|
552 | $ hg rm sub2/large6 | |
553 | $ echo new >> sub2/large8 |
|
553 | $ echo new >> sub2/large8 | |
554 | $ hg add --large sub2/large8 |
|
554 | $ hg add --large sub2/large8 | |
555 | # XXX we don't really want to report that we're reverting the standin; |
|
555 | # XXX we don't really want to report that we're reverting the standin; | |
556 | # that's just an implementation detail. But I don't see an obvious fix. ;-( |
|
556 | # that's just an implementation detail. But I don't see an obvious fix. ;-( | |
557 | $ hg revert sub |
|
557 | $ hg revert sub | |
558 | reverting .hglf/sub/large4 |
|
558 | reverting .hglf/sub/large4 | |
559 | reverting sub/normal4 |
|
559 | reverting sub/normal4 | |
560 | $ hg status |
|
560 | $ hg status | |
561 | M normal3 |
|
561 | M normal3 | |
562 | A sub2/large8 |
|
562 | A sub2/large8 | |
563 | R sub2/large6 |
|
563 | R sub2/large6 | |
564 | ? sub/large4.orig |
|
564 | ? sub/large4.orig | |
565 | ? sub/normal4.orig |
|
565 | ? sub/normal4.orig | |
566 | $ cat sub/normal4 |
|
566 | $ cat sub/normal4 | |
567 | normal4-modified |
|
567 | normal4-modified | |
568 | $ cat sub/large4 |
|
568 | $ cat sub/large4 | |
569 | large4-modified |
|
569 | large4-modified | |
570 | $ hg revert -a --no-backup |
|
570 | $ hg revert -a --no-backup | |
571 | undeleting .hglf/sub2/large6 |
|
571 | undeleting .hglf/sub2/large6 | |
572 | forgetting .hglf/sub2/large8 |
|
572 | forgetting .hglf/sub2/large8 | |
573 | reverting normal3 |
|
573 | reverting normal3 | |
574 | $ hg status |
|
574 | $ hg status | |
575 | ? sub/large4.orig |
|
575 | ? sub/large4.orig | |
576 | ? sub/normal4.orig |
|
576 | ? sub/normal4.orig | |
577 | ? sub2/large8 |
|
577 | ? sub2/large8 | |
578 | $ cat normal3 |
|
578 | $ cat normal3 | |
579 | normal3-modified |
|
579 | normal3-modified | |
580 | $ cat sub2/large6 |
|
580 | $ cat sub2/large6 | |
581 | large6-modified |
|
581 | large6-modified | |
582 | $ rm sub/*.orig sub2/large8 |
|
582 | $ rm sub/*.orig sub2/large8 | |
583 |
|
583 | |||
584 | revert some files to an older revision |
|
584 | revert some files to an older revision | |
585 | $ hg revert --no-backup -r 8 sub2 |
|
585 | $ hg revert --no-backup -r 8 sub2 | |
586 | reverting .hglf/sub2/large6 |
|
586 | reverting .hglf/sub2/large6 | |
587 | $ cat sub2/large6 |
|
587 | $ cat sub2/large6 | |
588 | large6 |
|
588 | large6 | |
589 | $ hg revert --no-backup sub2 |
|
589 | $ hg revert --no-backup sub2 | |
590 | reverting .hglf/sub2/large6 |
|
590 | reverting .hglf/sub2/large6 | |
591 | $ hg status |
|
591 | $ hg status | |
592 |
|
592 | |||
593 | "verify --large" actually verifies largefiles |
|
593 | "verify --large" actually verifies largefiles | |
594 |
|
594 | |||
595 | $ hg verify --large |
|
595 | $ hg verify --large | |
596 | checking changesets |
|
596 | checking changesets | |
597 | checking manifests |
|
597 | checking manifests | |
598 | crosschecking files in changesets and manifests |
|
598 | crosschecking files in changesets and manifests | |
599 | checking files |
|
599 | checking files | |
600 | 10 files, 10 changesets, 28 total revisions |
|
600 | 10 files, 10 changesets, 28 total revisions | |
601 | searching 1 changesets for largefiles |
|
601 | searching 1 changesets for largefiles | |
602 | verified existence of 3 revisions of 3 largefiles |
|
602 | verified existence of 3 revisions of 3 largefiles | |
603 |
|
603 | |||
604 | Merging does not revert to old versions of largefiles (this has also |
|
604 | Merging does not revert to old versions of largefiles (this has also | |
605 | been very problematic). |
|
605 | been very problematic). | |
606 |
|
606 | |||
607 | $ cd .. |
|
607 | $ cd .. | |
608 | $ hg clone -r 7 e f |
|
608 | $ hg clone -r 7 e f | |
609 | adding changesets |
|
609 | adding changesets | |
610 | adding manifests |
|
610 | adding manifests | |
611 | adding file changes |
|
611 | adding file changes | |
612 | added 8 changesets with 24 changes to 10 files |
|
612 | added 8 changesets with 24 changes to 10 files | |
613 | updating to branch default |
|
613 | updating to branch default | |
614 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
614 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
615 | getting changed largefiles |
|
615 | getting changed largefiles | |
616 | 3 largefiles updated, 0 removed |
|
616 | 3 largefiles updated, 0 removed | |
617 | $ cd f |
|
617 | $ cd f | |
618 | $ echo "large4-merge-test" > sub/large4 |
|
618 | $ echo "large4-merge-test" > sub/large4 | |
619 | $ hg commit -m "Modify large4 to test merge" |
|
619 | $ hg commit -m "Modify large4 to test merge" | |
620 | $ hg pull ../e |
|
620 | $ hg pull ../e | |
621 | pulling from ../e |
|
621 | pulling from ../e | |
622 | searching for changes |
|
622 | searching for changes | |
623 | adding changesets |
|
623 | adding changesets | |
624 | adding manifests |
|
624 | adding manifests | |
625 | adding file changes |
|
625 | adding file changes | |
626 | added 2 changesets with 4 changes to 4 files (+1 heads) |
|
626 | added 2 changesets with 4 changes to 4 files (+1 heads) | |
627 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
627 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
628 | $ hg merge |
|
628 | $ hg merge | |
629 | merging sub/large4 |
|
629 | merging sub/large4 | |
630 | largefile sub/large4 has a merge conflict |
|
630 | largefile sub/large4 has a merge conflict | |
631 | keep (l)ocal or take (o)ther? l |
|
631 | keep (l)ocal or take (o)ther? l | |
632 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
632 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
633 | (branch merge, don't forget to commit) |
|
633 | (branch merge, don't forget to commit) | |
634 | getting changed largefiles |
|
634 | getting changed largefiles | |
635 | 1 largefiles updated, 0 removed |
|
635 | 1 largefiles updated, 0 removed | |
636 | $ hg commit -m "Merge repos e and f" |
|
636 | $ hg commit -m "Merge repos e and f" | |
637 | $ cat normal3 |
|
637 | $ cat normal3 | |
638 | normal3-modified |
|
638 | normal3-modified | |
639 | $ cat sub/normal4 |
|
639 | $ cat sub/normal4 | |
640 | normal4-modified |
|
640 | normal4-modified | |
641 | $ cat sub/large4 |
|
641 | $ cat sub/large4 | |
642 | large4-merge-test |
|
642 | large4-merge-test | |
643 | $ cat sub2/large6 |
|
643 | $ cat sub2/large6 | |
644 | large6-modified |
|
644 | large6-modified | |
645 | $ cat sub2/large7 |
|
645 | $ cat sub2/large7 | |
646 | large7 |
|
646 | large7 | |
647 |
|
647 | |||
|
648 | Test status after merging with a branch that introduces a new largefile: | |||
|
649 | ||||
|
650 | $ echo large > large | |||
|
651 | $ hg add --large large | |||
|
652 | $ hg commit -m 'add largefile' | |||
|
653 | $ hg update -q ".^" | |||
|
654 | $ echo change >> normal3 | |||
|
655 | $ hg commit -m 'some change' | |||
|
656 | created new head | |||
|
657 | $ hg merge | |||
|
658 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
659 | (branch merge, don't forget to commit) | |||
|
660 | getting changed largefiles | |||
|
661 | 1 largefiles updated, 0 removed | |||
|
662 | $ hg status | |||
|
663 | M large | |||
|
664 | ||||
648 | Test that a normal file and a largefile with the same name and path cannot |
|
665 | Test that a normal file and a largefile with the same name and path cannot | |
649 | coexist. |
|
666 | coexist. | |
650 |
|
667 | |||
651 | $ rm sub2/large7 |
|
668 | $ rm sub2/large7 | |
652 | $ echo "largeasnormal" > sub2/large7 |
|
669 | $ echo "largeasnormal" > sub2/large7 | |
653 | $ hg add sub2/large7 |
|
670 | $ hg add sub2/large7 | |
654 | sub2/large7 already a largefile |
|
671 | sub2/large7 already a largefile | |
655 |
|
672 | |||
656 | Test that transplanting a largefile change works correctly. |
|
673 | Test that transplanting a largefile change works correctly. | |
657 |
|
674 | |||
658 | $ cd .. |
|
675 | $ cd .. | |
659 | $ hg clone -r 8 d g |
|
676 | $ hg clone -r 8 d g | |
660 | adding changesets |
|
677 | adding changesets | |
661 | adding manifests |
|
678 | adding manifests | |
662 | adding file changes |
|
679 | adding file changes | |
663 | added 9 changesets with 26 changes to 10 files |
|
680 | added 9 changesets with 26 changes to 10 files | |
664 | updating to branch default |
|
681 | updating to branch default | |
665 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
682 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
666 | getting changed largefiles |
|
683 | getting changed largefiles | |
667 | 3 largefiles updated, 0 removed |
|
684 | 3 largefiles updated, 0 removed | |
668 | $ cd g |
|
685 | $ cd g | |
669 | $ hg transplant -s ../d 598410d3eb9a |
|
686 | $ hg transplant -s ../d 598410d3eb9a | |
670 | searching for changes |
|
687 | searching for changes | |
671 | searching for changes |
|
688 | searching for changes | |
672 | adding changesets |
|
689 | adding changesets | |
673 | adding manifests |
|
690 | adding manifests | |
674 | adding file changes |
|
691 | adding file changes | |
675 | added 1 changesets with 2 changes to 2 files |
|
692 | added 1 changesets with 2 changes to 2 files | |
676 | getting changed largefiles |
|
693 | getting changed largefiles | |
677 | 1 largefiles updated, 0 removed |
|
694 | 1 largefiles updated, 0 removed | |
678 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
695 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
679 | 9:598410d3eb9a modify normal file largefile in repo d |
|
696 | 9:598410d3eb9a modify normal file largefile in repo d | |
680 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
697 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
681 | 7:daea875e9014 add/edit more largefiles |
|
698 | 7:daea875e9014 add/edit more largefiles | |
682 | 6:4355d653f84f edit files yet again |
|
699 | 6:4355d653f84f edit files yet again | |
683 | 5:9d5af5072dbd edit files again |
|
700 | 5:9d5af5072dbd edit files again | |
684 | 4:74c02385b94c move files |
|
701 | 4:74c02385b94c move files | |
685 | 3:9e8fbc4bce62 copy files |
|
702 | 3:9e8fbc4bce62 copy files | |
686 | 2:51a0ae4d5864 remove files |
|
703 | 2:51a0ae4d5864 remove files | |
687 | 1:ce8896473775 edit files |
|
704 | 1:ce8896473775 edit files | |
688 | 0:30d30fe6a5be add files |
|
705 | 0:30d30fe6a5be add files | |
689 | $ cat normal3 |
|
706 | $ cat normal3 | |
690 | normal3-modified |
|
707 | normal3-modified | |
691 | $ cat sub/normal4 |
|
708 | $ cat sub/normal4 | |
692 | normal4-modified |
|
709 | normal4-modified | |
693 | $ cat sub/large4 |
|
710 | $ cat sub/large4 | |
694 | large4-modified |
|
711 | large4-modified | |
695 | $ cat sub2/large6 |
|
712 | $ cat sub2/large6 | |
696 | large6-modified |
|
713 | large6-modified | |
697 | $ cat sub2/large7 |
|
714 | $ cat sub2/large7 | |
698 | large7 |
|
715 | large7 | |
699 |
|
716 | |||
700 | Test that renaming a largefile results in correct output for status |
|
717 | Test that renaming a largefile results in correct output for status | |
701 |
|
718 | |||
702 | $ hg rename sub/large4 large4-renamed |
|
719 | $ hg rename sub/large4 large4-renamed | |
703 | $ hg st |
|
720 | $ hg st | |
704 | A large4-renamed |
|
721 | A large4-renamed | |
705 | R sub/large4 |
|
722 | R sub/large4 | |
706 | $ hg commit -m "test rename output" |
|
723 | $ hg commit -m "test rename output" | |
707 | $ cat large4-renamed |
|
724 | $ cat large4-renamed | |
708 | large4-modified |
|
725 | large4-modified | |
709 | $ cd sub2 |
|
726 | $ cd sub2 | |
710 | $ hg rename large6 large6-renamed |
|
727 | $ hg rename large6 large6-renamed | |
711 | $ hg st |
|
728 | $ hg st | |
712 | A sub2/large6-renamed |
|
729 | A sub2/large6-renamed | |
713 | R sub2/large6 |
|
730 | R sub2/large6 | |
714 | $ cd ../.. |
|
731 | $ cd ../.. | |
715 |
|
732 | |||
716 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
733 | vanilla clients not locked out from largefiles servers on vanilla repos | |
717 | $ mkdir r1 |
|
734 | $ mkdir r1 | |
718 | $ cd r1 |
|
735 | $ cd r1 | |
719 | $ hg init |
|
736 | $ hg init | |
720 | $ echo c1 > f1 |
|
737 | $ echo c1 > f1 | |
721 | $ hg add f1 |
|
738 | $ hg add f1 | |
722 | $ hg com -m "m1" |
|
739 | $ hg com -m "m1" | |
723 | $ cd .. |
|
740 | $ cd .. | |
724 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
741 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid | |
725 | $ cat hg.pid >> $DAEMON_PIDS |
|
742 | $ cat hg.pid >> $DAEMON_PIDS | |
726 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
743 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 | |
727 | requesting all changes |
|
744 | requesting all changes | |
728 | adding changesets |
|
745 | adding changesets | |
729 | adding manifests |
|
746 | adding manifests | |
730 | adding file changes |
|
747 | adding file changes | |
731 | added 1 changesets with 1 changes to 1 files |
|
748 | added 1 changesets with 1 changes to 1 files | |
732 | updating to branch default |
|
749 | updating to branch default | |
733 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
750 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
734 |
|
751 | |||
735 | largefiles clients still work with vanilla servers |
|
752 | largefiles clients still work with vanilla servers | |
736 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid |
|
753 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid | |
737 | $ cat hg.pid >> $DAEMON_PIDS |
|
754 | $ cat hg.pid >> $DAEMON_PIDS | |
738 | $ hg clone http://localhost:$HGPORT1 r3 |
|
755 | $ hg clone http://localhost:$HGPORT1 r3 | |
739 | requesting all changes |
|
756 | requesting all changes | |
740 | adding changesets |
|
757 | adding changesets | |
741 | adding manifests |
|
758 | adding manifests | |
742 | adding file changes |
|
759 | adding file changes | |
743 | added 1 changesets with 1 changes to 1 files |
|
760 | added 1 changesets with 1 changes to 1 files | |
744 | updating to branch default |
|
761 | updating to branch default | |
745 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
762 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
746 |
|
763 | |||
747 | vanilla clients locked out from largefiles http repos |
|
764 | vanilla clients locked out from largefiles http repos | |
748 | $ mkdir r4 |
|
765 | $ mkdir r4 | |
749 | $ cd r4 |
|
766 | $ cd r4 | |
750 | $ hg init |
|
767 | $ hg init | |
751 | $ echo c1 > f1 |
|
768 | $ echo c1 > f1 | |
752 | $ hg add --large f1 |
|
769 | $ hg add --large f1 | |
753 | $ hg com -m "m1" |
|
770 | $ hg com -m "m1" | |
754 | $ cd .. |
|
771 | $ cd .. | |
755 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
772 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid | |
756 | $ cat hg.pid >> $DAEMON_PIDS |
|
773 | $ cat hg.pid >> $DAEMON_PIDS | |
757 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
774 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 | |
758 | abort: remote error: |
|
775 | abort: remote error: | |
759 |
|
776 | |||
760 | This repository uses the largefiles extension. |
|
777 | This repository uses the largefiles extension. | |
761 |
|
778 | |||
762 | Please enable it in your Mercurial config file. |
|
779 | Please enable it in your Mercurial config file. | |
763 | [255] |
|
780 | [255] | |
764 |
|
781 | |||
765 | used all HGPORTs, kill all daemons |
|
782 | used all HGPORTs, kill all daemons | |
766 | $ "$TESTDIR/killdaemons.py" |
|
783 | $ "$TESTDIR/killdaemons.py" | |
767 |
|
784 | |||
768 | vanilla clients locked out from largefiles ssh repos |
|
785 | vanilla clients locked out from largefiles ssh repos | |
769 | $ hg --config extensions.largefiles=! clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/r4 r5 |
|
786 | $ hg --config extensions.largefiles=! clone -e "python $TESTDIR/dummyssh" ssh://user@dummy/r4 r5 | |
770 | abort: remote error: |
|
787 | abort: remote error: | |
771 |
|
788 | |||
772 | This repository uses the largefiles extension. |
|
789 | This repository uses the largefiles extension. | |
773 |
|
790 | |||
774 | Please enable it in your Mercurial config file. |
|
791 | Please enable it in your Mercurial config file. | |
775 | [255] |
|
792 | [255] | |
776 |
|
793 | |||
777 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
794 | largefiles clients refuse to push largefiles repos to vanilla servers | |
778 | $ mkdir r6 |
|
795 | $ mkdir r6 | |
779 | $ cd r6 |
|
796 | $ cd r6 | |
780 | $ hg init |
|
797 | $ hg init | |
781 | $ echo c1 > f1 |
|
798 | $ echo c1 > f1 | |
782 | $ hg add f1 |
|
799 | $ hg add f1 | |
783 | $ hg com -m "m1" |
|
800 | $ hg com -m "m1" | |
784 | $ cat >> .hg/hgrc <<! |
|
801 | $ cat >> .hg/hgrc <<! | |
785 | > [web] |
|
802 | > [web] | |
786 | > push_ssl = false |
|
803 | > push_ssl = false | |
787 | > allow_push = * |
|
804 | > allow_push = * | |
788 | > ! |
|
805 | > ! | |
789 |
$ |
|
806 | $ cd .. | |
790 |
$ |
|
807 | $ hg clone r6 r7 | |
791 |
|
|
808 | updating to branch default | |
792 |
|
|
809 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
793 |
$ |
|
810 | $ cd r7 | |
794 |
$ |
|
811 | $ echo c2 > f2 | |
795 |
$ |
|
812 | $ hg add --large f2 | |
796 |
$ |
|
813 | $ hg com -m "m2" | |
797 |
$ |
|
814 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid | |
798 |
$ |
|
815 | $ cat ../hg.pid >> $DAEMON_PIDS | |
799 | $ hg push http://localhost:$HGPORT |
|
816 | $ hg push http://localhost:$HGPORT | |
800 | pushing to http://localhost:$HGPORT/ |
|
817 | pushing to http://localhost:$HGPORT/ | |
801 | searching for changes |
|
818 | searching for changes | |
802 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store |
|
819 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store | |
803 | [255] |
|
820 | [255] | |
804 | $ cd .. |
|
821 | $ cd .. | |
805 |
|
822 | |||
806 | Clone a local repository owned by another user |
|
823 | Clone a local repository owned by another user | |
807 | We have to simulate that here by setting $HOME and removing write permissions |
|
824 | We have to simulate that here by setting $HOME and removing write permissions | |
808 | $ ORIGHOME="$HOME" |
|
825 | $ ORIGHOME="$HOME" | |
809 | $ mkdir alice |
|
826 | $ mkdir alice | |
810 | $ HOME="`pwd`/alice" |
|
827 | $ HOME="`pwd`/alice" | |
811 | $ cd alice |
|
828 | $ cd alice | |
812 | $ hg init pubrepo |
|
829 | $ hg init pubrepo | |
813 | $ cd pubrepo |
|
830 | $ cd pubrepo | |
814 | $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null |
|
831 | $ dd if=/dev/urandom bs=1k count=11k > a-large-file 2> /dev/null | |
815 | $ hg add --large a-large-file |
|
832 | $ hg add --large a-large-file | |
816 | $ hg commit -m "Add a large file" |
|
833 | $ hg commit -m "Add a large file" | |
817 | $ cd .. |
|
834 | $ cd .. | |
818 | $ chmod -R a-w pubrepo |
|
835 | $ chmod -R a-w pubrepo | |
819 | $ cd .. |
|
836 | $ cd .. | |
820 | $ mkdir bob |
|
837 | $ mkdir bob | |
821 | $ HOME="`pwd`/bob" |
|
838 | $ HOME="`pwd`/bob" | |
822 | $ cd bob |
|
839 | $ cd bob | |
823 | $ hg clone --pull ../alice/pubrepo pubrepo |
|
840 | $ hg clone --pull ../alice/pubrepo pubrepo | |
824 | requesting all changes |
|
841 | requesting all changes | |
825 | adding changesets |
|
842 | adding changesets | |
826 | adding manifests |
|
843 | adding manifests | |
827 | adding file changes |
|
844 | adding file changes | |
828 | added 1 changesets with 1 changes to 1 files |
|
845 | added 1 changesets with 1 changes to 1 files | |
829 | updating to branch default |
|
846 | updating to branch default | |
830 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
847 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
831 | getting changed largefiles |
|
848 | getting changed largefiles | |
832 | 1 largefiles updated, 0 removed |
|
849 | 1 largefiles updated, 0 removed | |
833 | $ cd .. |
|
850 | $ cd .. | |
834 | $ HOME="$ORIGHOME" |
|
851 | $ HOME="$ORIGHOME" | |
835 |
|
852 | |||
836 | Symlink to a large largefile should behave the same as a symlink to a normal file |
|
853 | Symlink to a large largefile should behave the same as a symlink to a normal file | |
837 | $ hg init largesymlink |
|
854 | $ hg init largesymlink | |
838 | $ cd largesymlink |
|
855 | $ cd largesymlink | |
839 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null |
|
856 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null | |
840 | $ hg add --large largefile |
|
857 | $ hg add --large largefile | |
841 | $ hg commit -m "commit a large file" |
|
858 | $ hg commit -m "commit a large file" | |
842 | $ ln -s largefile largelink |
|
859 | $ ln -s largefile largelink | |
843 | $ hg add largelink |
|
860 | $ hg add largelink | |
844 | $ hg commit -m "commit a large symlink" |
|
861 | $ hg commit -m "commit a large symlink" | |
845 | $ rm -f largelink |
|
862 | $ rm -f largelink | |
846 | $ hg up >/dev/null |
|
863 | $ hg up >/dev/null | |
847 | $ test -f largelink |
|
864 | $ test -f largelink | |
848 | [1] |
|
865 | [1] | |
849 | $ test -L largelink |
|
866 | $ test -L largelink | |
850 | [1] |
|
867 | [1] | |
851 | $ rm -f largelink # make next part of the test independent of the previous |
|
868 | $ rm -f largelink # make next part of the test independent of the previous | |
852 | $ hg up -C >/dev/null |
|
869 | $ hg up -C >/dev/null | |
853 | $ test -f largelink |
|
870 | $ test -f largelink | |
854 | $ test -L largelink |
|
871 | $ test -L largelink | |
855 | $ cd .. |
|
872 | $ cd .. | |
856 |
|
873 | |||
857 |
|
874 |
General Comments 0
You need to be logged in to leave comments.
Login now