Show More
@@ -1,1217 +1,1214 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 | '''Overridden Mercurial commands and functions for the largefiles extension''' |
|
9 | '''Overridden Mercurial commands and functions for the largefiles extension''' | |
10 |
|
10 | |||
11 | import os |
|
11 | import os | |
12 | import copy |
|
12 | import copy | |
13 |
|
13 | |||
14 | from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \ |
|
14 | from mercurial import hg, commands, util, cmdutil, scmutil, match as match_, \ | |
15 | node, archival, error, merge, discovery |
|
15 | node, archival, error, merge, discovery | |
16 | from mercurial.i18n import _ |
|
16 | from mercurial.i18n import _ | |
17 | from mercurial.node import hex |
|
17 | from mercurial.node import hex | |
18 | from hgext import rebase |
|
18 | from hgext import rebase | |
19 |
|
19 | |||
20 | import lfutil |
|
20 | import lfutil | |
21 | import lfcommands |
|
21 | import lfcommands | |
22 | import basestore |
|
22 | import basestore | |
23 |
|
23 | |||
24 | # -- Utility functions: commonly/repeatedly needed functionality --------------- |
|
24 | # -- Utility functions: commonly/repeatedly needed functionality --------------- | |
25 |
|
25 | |||
26 | def installnormalfilesmatchfn(manifest): |
|
26 | def installnormalfilesmatchfn(manifest): | |
27 | '''overrides scmutil.match so that the matcher it returns will ignore all |
|
27 | '''overrides scmutil.match so that the matcher it returns will ignore all | |
28 | largefiles''' |
|
28 | largefiles''' | |
29 | oldmatch = None # for the closure |
|
29 | oldmatch = None # for the closure | |
30 | def overridematch(ctx, pats=[], opts={}, globbed=False, |
|
30 | def overridematch(ctx, pats=[], opts={}, globbed=False, | |
31 | default='relpath'): |
|
31 | default='relpath'): | |
32 | match = oldmatch(ctx, pats, opts, globbed, default) |
|
32 | match = oldmatch(ctx, pats, opts, globbed, default) | |
33 | m = copy.copy(match) |
|
33 | m = copy.copy(match) | |
34 | notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in |
|
34 | notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in | |
35 | manifest) |
|
35 | manifest) | |
36 | m._files = filter(notlfile, m._files) |
|
36 | m._files = filter(notlfile, m._files) | |
37 | m._fmap = set(m._files) |
|
37 | m._fmap = set(m._files) | |
38 | m._always = False |
|
38 | m._always = False | |
39 | origmatchfn = m.matchfn |
|
39 | origmatchfn = m.matchfn | |
40 | m.matchfn = lambda f: notlfile(f) and origmatchfn(f) or None |
|
40 | m.matchfn = lambda f: notlfile(f) and origmatchfn(f) or None | |
41 | return m |
|
41 | return m | |
42 | oldmatch = installmatchfn(overridematch) |
|
42 | oldmatch = installmatchfn(overridematch) | |
43 |
|
43 | |||
44 | def installmatchfn(f): |
|
44 | def installmatchfn(f): | |
45 | oldmatch = scmutil.match |
|
45 | oldmatch = scmutil.match | |
46 | setattr(f, 'oldmatch', oldmatch) |
|
46 | setattr(f, 'oldmatch', oldmatch) | |
47 | scmutil.match = f |
|
47 | scmutil.match = f | |
48 | return oldmatch |
|
48 | return oldmatch | |
49 |
|
49 | |||
50 | def restorematchfn(): |
|
50 | def restorematchfn(): | |
51 | '''restores scmutil.match to what it was before installnormalfilesmatchfn |
|
51 | '''restores scmutil.match to what it was before installnormalfilesmatchfn | |
52 | was called. no-op if scmutil.match is its original function. |
|
52 | was called. no-op if scmutil.match is its original function. | |
53 |
|
53 | |||
54 | Note that n calls to installnormalfilesmatchfn will require n calls to |
|
54 | Note that n calls to installnormalfilesmatchfn will require n calls to | |
55 | restore matchfn to reverse''' |
|
55 | restore matchfn to reverse''' | |
56 | scmutil.match = getattr(scmutil.match, 'oldmatch', scmutil.match) |
|
56 | scmutil.match = getattr(scmutil.match, 'oldmatch', scmutil.match) | |
57 |
|
57 | |||
58 | def addlargefiles(ui, repo, *pats, **opts): |
|
58 | def addlargefiles(ui, repo, *pats, **opts): | |
59 | large = opts.pop('large', None) |
|
59 | large = opts.pop('large', None) | |
60 | lfsize = lfutil.getminsize( |
|
60 | lfsize = lfutil.getminsize( | |
61 | ui, lfutil.islfilesrepo(repo), opts.pop('lfsize', None)) |
|
61 | ui, lfutil.islfilesrepo(repo), opts.pop('lfsize', None)) | |
62 |
|
62 | |||
63 | lfmatcher = None |
|
63 | lfmatcher = None | |
64 | if lfutil.islfilesrepo(repo): |
|
64 | if lfutil.islfilesrepo(repo): | |
65 | lfpats = ui.configlist(lfutil.longname, 'patterns', default=[]) |
|
65 | lfpats = ui.configlist(lfutil.longname, 'patterns', default=[]) | |
66 | if lfpats: |
|
66 | if lfpats: | |
67 | lfmatcher = match_.match(repo.root, '', list(lfpats)) |
|
67 | lfmatcher = match_.match(repo.root, '', list(lfpats)) | |
68 |
|
68 | |||
69 | lfnames = [] |
|
69 | lfnames = [] | |
70 | m = scmutil.match(repo[None], pats, opts) |
|
70 | m = scmutil.match(repo[None], pats, opts) | |
71 | m.bad = lambda x, y: None |
|
71 | m.bad = lambda x, y: None | |
72 | wctx = repo[None] |
|
72 | wctx = repo[None] | |
73 | for f in repo.walk(m): |
|
73 | for f in repo.walk(m): | |
74 | exact = m.exact(f) |
|
74 | exact = m.exact(f) | |
75 | lfile = lfutil.standin(f) in wctx |
|
75 | lfile = lfutil.standin(f) in wctx | |
76 | nfile = f in wctx |
|
76 | nfile = f in wctx | |
77 | exists = lfile or nfile |
|
77 | exists = lfile or nfile | |
78 |
|
78 | |||
79 | # Don't warn the user when they attempt to add a normal tracked file. |
|
79 | # Don't warn the user when they attempt to add a normal tracked file. | |
80 | # The normal add code will do that for us. |
|
80 | # The normal add code will do that for us. | |
81 | if exact and exists: |
|
81 | if exact and exists: | |
82 | if lfile: |
|
82 | if lfile: | |
83 | ui.warn(_('%s already a largefile\n') % f) |
|
83 | ui.warn(_('%s already a largefile\n') % f) | |
84 | continue |
|
84 | continue | |
85 |
|
85 | |||
86 | if (exact or not exists) and not lfutil.isstandin(f): |
|
86 | if (exact or not exists) and not lfutil.isstandin(f): | |
87 | wfile = repo.wjoin(f) |
|
87 | wfile = repo.wjoin(f) | |
88 |
|
88 | |||
89 | # In case the file was removed previously, but not committed |
|
89 | # In case the file was removed previously, but not committed | |
90 | # (issue3507) |
|
90 | # (issue3507) | |
91 | if not os.path.exists(wfile): |
|
91 | if not os.path.exists(wfile): | |
92 | continue |
|
92 | continue | |
93 |
|
93 | |||
94 | abovemin = (lfsize and |
|
94 | abovemin = (lfsize and | |
95 | os.lstat(wfile).st_size >= lfsize * 1024 * 1024) |
|
95 | os.lstat(wfile).st_size >= lfsize * 1024 * 1024) | |
96 | if large or abovemin or (lfmatcher and lfmatcher(f)): |
|
96 | if large or abovemin or (lfmatcher and lfmatcher(f)): | |
97 | lfnames.append(f) |
|
97 | lfnames.append(f) | |
98 | if ui.verbose or not exact: |
|
98 | if ui.verbose or not exact: | |
99 | ui.status(_('adding %s as a largefile\n') % m.rel(f)) |
|
99 | ui.status(_('adding %s as a largefile\n') % m.rel(f)) | |
100 |
|
100 | |||
101 | bad = [] |
|
101 | bad = [] | |
102 | standins = [] |
|
102 | standins = [] | |
103 |
|
103 | |||
104 | # Need to lock, otherwise there could be a race condition between |
|
104 | # Need to lock, otherwise there could be a race condition between | |
105 | # when standins are created and added to the repo. |
|
105 | # when standins are created and added to the repo. | |
106 | wlock = repo.wlock() |
|
106 | wlock = repo.wlock() | |
107 | try: |
|
107 | try: | |
108 | if not opts.get('dry_run'): |
|
108 | if not opts.get('dry_run'): | |
109 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
109 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
110 | for f in lfnames: |
|
110 | for f in lfnames: | |
111 | standinname = lfutil.standin(f) |
|
111 | standinname = lfutil.standin(f) | |
112 | lfutil.writestandin(repo, standinname, hash='', |
|
112 | lfutil.writestandin(repo, standinname, hash='', | |
113 | executable=lfutil.getexecutable(repo.wjoin(f))) |
|
113 | executable=lfutil.getexecutable(repo.wjoin(f))) | |
114 | standins.append(standinname) |
|
114 | standins.append(standinname) | |
115 | if lfdirstate[f] == 'r': |
|
115 | if lfdirstate[f] == 'r': | |
116 | lfdirstate.normallookup(f) |
|
116 | lfdirstate.normallookup(f) | |
117 | else: |
|
117 | else: | |
118 | lfdirstate.add(f) |
|
118 | lfdirstate.add(f) | |
119 | lfdirstate.write() |
|
119 | lfdirstate.write() | |
120 | bad += [lfutil.splitstandin(f) |
|
120 | bad += [lfutil.splitstandin(f) | |
121 | for f in repo[None].add(standins) |
|
121 | for f in repo[None].add(standins) | |
122 | if f in m.files()] |
|
122 | if f in m.files()] | |
123 | finally: |
|
123 | finally: | |
124 | wlock.release() |
|
124 | wlock.release() | |
125 | return bad |
|
125 | return bad | |
126 |
|
126 | |||
127 | def removelargefiles(ui, repo, *pats, **opts): |
|
127 | def removelargefiles(ui, repo, *pats, **opts): | |
128 | after = opts.get('after') |
|
128 | after = opts.get('after') | |
129 | if not pats and not after: |
|
129 | if not pats and not after: | |
130 | raise util.Abort(_('no files specified')) |
|
130 | raise util.Abort(_('no files specified')) | |
131 | m = scmutil.match(repo[None], pats, opts) |
|
131 | m = scmutil.match(repo[None], pats, opts) | |
132 | try: |
|
132 | try: | |
133 | repo.lfstatus = True |
|
133 | repo.lfstatus = True | |
134 | s = repo.status(match=m, clean=True) |
|
134 | s = repo.status(match=m, clean=True) | |
135 | finally: |
|
135 | finally: | |
136 | repo.lfstatus = False |
|
136 | repo.lfstatus = False | |
137 | manifest = repo[None].manifest() |
|
137 | manifest = repo[None].manifest() | |
138 | modified, added, deleted, clean = [[f for f in list |
|
138 | modified, added, deleted, clean = [[f for f in list | |
139 | if lfutil.standin(f) in manifest] |
|
139 | if lfutil.standin(f) in manifest] | |
140 | for list in [s[0], s[1], s[3], s[6]]] |
|
140 | for list in [s[0], s[1], s[3], s[6]]] | |
141 |
|
141 | |||
142 | def warn(files, msg): |
|
142 | def warn(files, msg): | |
143 | for f in files: |
|
143 | for f in files: | |
144 | ui.warn(msg % m.rel(f)) |
|
144 | ui.warn(msg % m.rel(f)) | |
145 | return int(len(files) > 0) |
|
145 | return int(len(files) > 0) | |
146 |
|
146 | |||
147 | result = 0 |
|
147 | result = 0 | |
148 |
|
148 | |||
149 | if after: |
|
149 | if after: | |
150 | remove, forget = deleted, [] |
|
150 | remove, forget = deleted, [] | |
151 | result = warn(modified + added + clean, |
|
151 | result = warn(modified + added + clean, | |
152 | _('not removing %s: file still exists\n')) |
|
152 | _('not removing %s: file still exists\n')) | |
153 | else: |
|
153 | else: | |
154 | remove, forget = deleted + clean, [] |
|
154 | remove, forget = deleted + clean, [] | |
155 | result = warn(modified, _('not removing %s: file is modified (use -f' |
|
155 | result = warn(modified, _('not removing %s: file is modified (use -f' | |
156 | ' to force removal)\n')) |
|
156 | ' to force removal)\n')) | |
157 | result = warn(added, _('not removing %s: file has been marked for add' |
|
157 | result = warn(added, _('not removing %s: file has been marked for add' | |
158 | ' (use forget to undo)\n')) or result |
|
158 | ' (use forget to undo)\n')) or result | |
159 |
|
159 | |||
160 | for f in sorted(remove + forget): |
|
160 | for f in sorted(remove + forget): | |
161 | if ui.verbose or not m.exact(f): |
|
161 | if ui.verbose or not m.exact(f): | |
162 | ui.status(_('removing %s\n') % m.rel(f)) |
|
162 | ui.status(_('removing %s\n') % m.rel(f)) | |
163 |
|
163 | |||
164 | # Need to lock because standin files are deleted then removed from the |
|
164 | # Need to lock because standin files are deleted then removed from the | |
165 | # repository and we could race in-between. |
|
165 | # repository and we could race in-between. | |
166 | wlock = repo.wlock() |
|
166 | wlock = repo.wlock() | |
167 | try: |
|
167 | try: | |
168 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
168 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
169 | for f in remove: |
|
169 | for f in remove: | |
170 | if not after: |
|
170 | if not after: | |
171 | # If this is being called by addremove, notify the user that we |
|
171 | # If this is being called by addremove, notify the user that we | |
172 | # are removing the file. |
|
172 | # are removing the file. | |
173 | if getattr(repo, "_isaddremove", False): |
|
173 | if getattr(repo, "_isaddremove", False): | |
174 | ui.status(_('removing %s\n') % f) |
|
174 | ui.status(_('removing %s\n') % f) | |
175 | util.unlinkpath(repo.wjoin(f), ignoremissing=True) |
|
175 | util.unlinkpath(repo.wjoin(f), ignoremissing=True) | |
176 | lfdirstate.remove(f) |
|
176 | lfdirstate.remove(f) | |
177 | lfdirstate.write() |
|
177 | lfdirstate.write() | |
178 | forget = [lfutil.standin(f) for f in forget] |
|
178 | forget = [lfutil.standin(f) for f in forget] | |
179 | remove = [lfutil.standin(f) for f in remove] |
|
179 | remove = [lfutil.standin(f) for f in remove] | |
180 | repo[None].forget(forget) |
|
180 | repo[None].forget(forget) | |
181 | # If this is being called by addremove, let the original addremove |
|
181 | # If this is being called by addremove, let the original addremove | |
182 | # function handle this. |
|
182 | # function handle this. | |
183 | if not getattr(repo, "_isaddremove", False): |
|
183 | if not getattr(repo, "_isaddremove", False): | |
184 | for f in remove: |
|
184 | for f in remove: | |
185 | util.unlinkpath(repo.wjoin(f), ignoremissing=True) |
|
185 | util.unlinkpath(repo.wjoin(f), ignoremissing=True) | |
186 | repo[None].forget(remove) |
|
186 | repo[None].forget(remove) | |
187 | finally: |
|
187 | finally: | |
188 | wlock.release() |
|
188 | wlock.release() | |
189 |
|
189 | |||
190 | return result |
|
190 | return result | |
191 |
|
191 | |||
192 | # For overriding mercurial.hgweb.webcommands so that largefiles will |
|
192 | # For overriding mercurial.hgweb.webcommands so that largefiles will | |
193 | # appear at their right place in the manifests. |
|
193 | # appear at their right place in the manifests. | |
194 | def decodepath(orig, path): |
|
194 | def decodepath(orig, path): | |
195 | return lfutil.splitstandin(path) or path |
|
195 | return lfutil.splitstandin(path) or path | |
196 |
|
196 | |||
197 | # -- Wrappers: modify existing commands -------------------------------- |
|
197 | # -- Wrappers: modify existing commands -------------------------------- | |
198 |
|
198 | |||
199 | # Add works by going through the files that the user wanted to add and |
|
199 | # Add works by going through the files that the user wanted to add and | |
200 | # checking if they should be added as largefiles. Then it makes a new |
|
200 | # checking if they should be added as largefiles. Then it makes a new | |
201 | # matcher which matches only the normal files and runs the original |
|
201 | # matcher which matches only the normal files and runs the original | |
202 | # version of add. |
|
202 | # version of add. | |
203 | def overrideadd(orig, ui, repo, *pats, **opts): |
|
203 | def overrideadd(orig, ui, repo, *pats, **opts): | |
204 | normal = opts.pop('normal') |
|
204 | normal = opts.pop('normal') | |
205 | if normal: |
|
205 | if normal: | |
206 | if opts.get('large'): |
|
206 | if opts.get('large'): | |
207 | raise util.Abort(_('--normal cannot be used with --large')) |
|
207 | raise util.Abort(_('--normal cannot be used with --large')) | |
208 | return orig(ui, repo, *pats, **opts) |
|
208 | return orig(ui, repo, *pats, **opts) | |
209 | bad = addlargefiles(ui, repo, *pats, **opts) |
|
209 | bad = addlargefiles(ui, repo, *pats, **opts) | |
210 | installnormalfilesmatchfn(repo[None].manifest()) |
|
210 | installnormalfilesmatchfn(repo[None].manifest()) | |
211 | result = orig(ui, repo, *pats, **opts) |
|
211 | result = orig(ui, repo, *pats, **opts) | |
212 | restorematchfn() |
|
212 | restorematchfn() | |
213 |
|
213 | |||
214 | return (result == 1 or bad) and 1 or 0 |
|
214 | return (result == 1 or bad) and 1 or 0 | |
215 |
|
215 | |||
216 | def overrideremove(orig, ui, repo, *pats, **opts): |
|
216 | def overrideremove(orig, ui, repo, *pats, **opts): | |
217 | installnormalfilesmatchfn(repo[None].manifest()) |
|
217 | installnormalfilesmatchfn(repo[None].manifest()) | |
218 | result = orig(ui, repo, *pats, **opts) |
|
218 | result = orig(ui, repo, *pats, **opts) | |
219 | restorematchfn() |
|
219 | restorematchfn() | |
220 | return removelargefiles(ui, repo, *pats, **opts) or result |
|
220 | return removelargefiles(ui, repo, *pats, **opts) or result | |
221 |
|
221 | |||
222 | def overridestatusfn(orig, repo, rev2, **opts): |
|
222 | def overridestatusfn(orig, repo, rev2, **opts): | |
223 | try: |
|
223 | try: | |
224 | repo._repo.lfstatus = True |
|
224 | repo._repo.lfstatus = True | |
225 | return orig(repo, rev2, **opts) |
|
225 | return orig(repo, rev2, **opts) | |
226 | finally: |
|
226 | finally: | |
227 | repo._repo.lfstatus = False |
|
227 | repo._repo.lfstatus = False | |
228 |
|
228 | |||
229 | def overridestatus(orig, ui, repo, *pats, **opts): |
|
229 | def overridestatus(orig, ui, repo, *pats, **opts): | |
230 | try: |
|
230 | try: | |
231 | repo.lfstatus = True |
|
231 | repo.lfstatus = True | |
232 | return orig(ui, repo, *pats, **opts) |
|
232 | return orig(ui, repo, *pats, **opts) | |
233 | finally: |
|
233 | finally: | |
234 | repo.lfstatus = False |
|
234 | repo.lfstatus = False | |
235 |
|
235 | |||
236 | def overridedirty(orig, repo, ignoreupdate=False): |
|
236 | def overridedirty(orig, repo, ignoreupdate=False): | |
237 | try: |
|
237 | try: | |
238 | repo._repo.lfstatus = True |
|
238 | repo._repo.lfstatus = True | |
239 | return orig(repo, ignoreupdate) |
|
239 | return orig(repo, ignoreupdate) | |
240 | finally: |
|
240 | finally: | |
241 | repo._repo.lfstatus = False |
|
241 | repo._repo.lfstatus = False | |
242 |
|
242 | |||
243 | def overridelog(orig, ui, repo, *pats, **opts): |
|
243 | def overridelog(orig, ui, repo, *pats, **opts): | |
244 | def overridematch(ctx, pats=[], opts={}, globbed=False, |
|
244 | def overridematch(ctx, pats=[], opts={}, globbed=False, | |
245 | default='relpath'): |
|
245 | default='relpath'): | |
246 | """Matcher that merges root directory with .hglf, suitable for log. |
|
246 | """Matcher that merges root directory with .hglf, suitable for log. | |
247 | It is still possible to match .hglf directly. |
|
247 | It is still possible to match .hglf directly. | |
248 | For any listed files run log on the standin too. |
|
248 | For any listed files run log on the standin too. | |
249 | matchfn tries both the given filename and with .hglf stripped. |
|
249 | matchfn tries both the given filename and with .hglf stripped. | |
250 | """ |
|
250 | """ | |
251 | match = oldmatch(ctx, pats, opts, globbed, default) |
|
251 | match = oldmatch(ctx, pats, opts, globbed, default) | |
252 | m = copy.copy(match) |
|
252 | m = copy.copy(match) | |
253 | standins = [lfutil.standin(f) for f in m._files] |
|
253 | standins = [lfutil.standin(f) for f in m._files] | |
254 | m._files.extend(standins) |
|
254 | m._files.extend(standins) | |
255 | m._fmap = set(m._files) |
|
255 | m._fmap = set(m._files) | |
256 | m._always = False |
|
256 | m._always = False | |
257 | origmatchfn = m.matchfn |
|
257 | origmatchfn = m.matchfn | |
258 | def lfmatchfn(f): |
|
258 | def lfmatchfn(f): | |
259 | lf = lfutil.splitstandin(f) |
|
259 | lf = lfutil.splitstandin(f) | |
260 | if lf is not None and origmatchfn(lf): |
|
260 | if lf is not None and origmatchfn(lf): | |
261 | return True |
|
261 | return True | |
262 | r = origmatchfn(f) |
|
262 | r = origmatchfn(f) | |
263 | return r |
|
263 | return r | |
264 | m.matchfn = lfmatchfn |
|
264 | m.matchfn = lfmatchfn | |
265 | return m |
|
265 | return m | |
266 | oldmatch = installmatchfn(overridematch) |
|
266 | oldmatch = installmatchfn(overridematch) | |
267 | try: |
|
267 | try: | |
268 | repo.lfstatus = True |
|
268 | repo.lfstatus = True | |
269 | return orig(ui, repo, *pats, **opts) |
|
269 | return orig(ui, repo, *pats, **opts) | |
270 | finally: |
|
270 | finally: | |
271 | repo.lfstatus = False |
|
271 | repo.lfstatus = False | |
272 | restorematchfn() |
|
272 | restorematchfn() | |
273 |
|
273 | |||
274 | def overrideverify(orig, ui, repo, *pats, **opts): |
|
274 | def overrideverify(orig, ui, repo, *pats, **opts): | |
275 | large = opts.pop('large', False) |
|
275 | large = opts.pop('large', False) | |
276 | all = opts.pop('lfa', False) |
|
276 | all = opts.pop('lfa', False) | |
277 | contents = opts.pop('lfc', False) |
|
277 | contents = opts.pop('lfc', False) | |
278 |
|
278 | |||
279 | result = orig(ui, repo, *pats, **opts) |
|
279 | result = orig(ui, repo, *pats, **opts) | |
280 | if large or all or contents: |
|
280 | if large or all or contents: | |
281 | result = result or lfcommands.verifylfiles(ui, repo, all, contents) |
|
281 | result = result or lfcommands.verifylfiles(ui, repo, all, contents) | |
282 | return result |
|
282 | return result | |
283 |
|
283 | |||
284 | def overridedebugstate(orig, ui, repo, *pats, **opts): |
|
284 | def overridedebugstate(orig, ui, repo, *pats, **opts): | |
285 | large = opts.pop('large', False) |
|
285 | large = opts.pop('large', False) | |
286 | if large: |
|
286 | if large: | |
287 | lfcommands.debugdirstate(ui, repo) |
|
287 | lfcommands.debugdirstate(ui, repo) | |
288 | else: |
|
288 | else: | |
289 | orig(ui, repo, *pats, **opts) |
|
289 | orig(ui, repo, *pats, **opts) | |
290 |
|
290 | |||
291 | # Override needs to refresh standins so that update's normal merge |
|
291 | # Override needs to refresh standins so that update's normal merge | |
292 | # will go through properly. Then the other update hook (overriding repo.update) |
|
292 | # will go through properly. Then the other update hook (overriding repo.update) | |
293 | # will get the new files. Filemerge is also overridden so that the merge |
|
293 | # will get the new files. Filemerge is also overridden so that the merge | |
294 | # will merge standins correctly. |
|
294 | # will merge standins correctly. | |
295 | def overrideupdate(orig, ui, repo, *pats, **opts): |
|
295 | def overrideupdate(orig, ui, repo, *pats, **opts): | |
296 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
296 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
297 | s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False, |
|
297 | s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False, | |
298 | False, False) |
|
298 | False, False) | |
299 | (unsure, modified, added, removed, missing, unknown, ignored, clean) = s |
|
299 | (unsure, modified, added, removed, missing, unknown, ignored, clean) = s | |
300 |
|
300 | |||
301 | # Need to lock between the standins getting updated and their |
|
301 | # Need to lock between the standins getting updated and their | |
302 | # largefiles getting updated |
|
302 | # largefiles getting updated | |
303 | wlock = repo.wlock() |
|
303 | wlock = repo.wlock() | |
304 | try: |
|
304 | try: | |
305 | if opts['check']: |
|
305 | if opts['check']: | |
306 | mod = len(modified) > 0 |
|
306 | mod = len(modified) > 0 | |
307 | for lfile in unsure: |
|
307 | for lfile in unsure: | |
308 | standin = lfutil.standin(lfile) |
|
308 | standin = lfutil.standin(lfile) | |
309 | if repo['.'][standin].data().strip() != \ |
|
309 | if repo['.'][standin].data().strip() != \ | |
310 | lfutil.hashfile(repo.wjoin(lfile)): |
|
310 | lfutil.hashfile(repo.wjoin(lfile)): | |
311 | mod = True |
|
311 | mod = True | |
312 | else: |
|
312 | else: | |
313 | lfdirstate.normal(lfile) |
|
313 | lfdirstate.normal(lfile) | |
314 | lfdirstate.write() |
|
314 | lfdirstate.write() | |
315 | if mod: |
|
315 | if mod: | |
316 | raise util.Abort(_('uncommitted local changes')) |
|
316 | raise util.Abort(_('uncommitted local changes')) | |
317 | # XXX handle removed differently |
|
317 | # XXX handle removed differently | |
318 | if not opts['clean']: |
|
318 | if not opts['clean']: | |
319 | for lfile in unsure + modified + added: |
|
319 | for lfile in unsure + modified + added: | |
320 | lfutil.updatestandin(repo, lfutil.standin(lfile)) |
|
320 | lfutil.updatestandin(repo, lfutil.standin(lfile)) | |
321 | finally: |
|
321 | finally: | |
322 | wlock.release() |
|
322 | wlock.release() | |
323 | return orig(ui, repo, *pats, **opts) |
|
323 | return orig(ui, repo, *pats, **opts) | |
324 |
|
324 | |||
325 | # Before starting the manifest merge, merge.updates will call |
|
325 | # Before starting the manifest merge, merge.updates will call | |
326 | # _checkunknown to check if there are any files in the merged-in |
|
326 | # _checkunknown to check if there are any files in the merged-in | |
327 | # changeset that collide with unknown files in the working copy. |
|
327 | # changeset that collide with unknown files in the working copy. | |
328 | # |
|
328 | # | |
329 | # The largefiles are seen as unknown, so this prevents us from merging |
|
329 | # The largefiles are seen as unknown, so this prevents us from merging | |
330 | # in a file 'foo' if we already have a largefile with the same name. |
|
330 | # in a file 'foo' if we already have a largefile with the same name. | |
331 | # |
|
331 | # | |
332 | # The overridden function filters the unknown files by removing any |
|
332 | # The overridden function filters the unknown files by removing any | |
333 | # largefiles. This makes the merge proceed and we can then handle this |
|
333 | # largefiles. This makes the merge proceed and we can then handle this | |
334 | # case further in the overridden manifestmerge function below. |
|
334 | # case further in the overridden manifestmerge function below. | |
335 | def overridecheckunknownfile(origfn, repo, wctx, mctx, f): |
|
335 | def overridecheckunknownfile(origfn, repo, wctx, mctx, f): | |
336 | if lfutil.standin(f) in wctx: |
|
336 | if lfutil.standin(f) in wctx: | |
337 | return False |
|
337 | return False | |
338 | return origfn(repo, wctx, mctx, f) |
|
338 | return origfn(repo, wctx, mctx, f) | |
339 |
|
339 | |||
340 | # The manifest merge handles conflicts on the manifest level. We want |
|
340 | # The manifest merge handles conflicts on the manifest level. We want | |
341 | # to handle changes in largefile-ness of files at this level too. |
|
341 | # to handle changes in largefile-ness of files at this level too. | |
342 | # |
|
342 | # | |
343 | # The strategy is to run the original manifestmerge and then process |
|
343 | # The strategy is to run the original manifestmerge and then process | |
344 | # the action list it outputs. There are two cases we need to deal with: |
|
344 | # the action list it outputs. There are two cases we need to deal with: | |
345 | # |
|
345 | # | |
346 | # 1. Normal file in p1, largefile in p2. Here the largefile is |
|
346 | # 1. Normal file in p1, largefile in p2. Here the largefile is | |
347 | # detected via its standin file, which will enter the working copy |
|
347 | # detected via its standin file, which will enter the working copy | |
348 | # with a "get" action. It is not "merge" since the standin is all |
|
348 | # with a "get" action. It is not "merge" since the standin is all | |
349 | # Mercurial is concerned with at this level -- the link to the |
|
349 | # Mercurial is concerned with at this level -- the link to the | |
350 | # existing normal file is not relevant here. |
|
350 | # existing normal file is not relevant here. | |
351 | # |
|
351 | # | |
352 | # 2. Largefile in p1, normal file in p2. Here we get a "merge" action |
|
352 | # 2. Largefile in p1, normal file in p2. Here we get a "merge" action | |
353 | # since the largefile will be present in the working copy and |
|
353 | # since the largefile will be present in the working copy and | |
354 | # different from the normal file in p2. Mercurial therefore |
|
354 | # different from the normal file in p2. Mercurial therefore | |
355 | # triggers a merge action. |
|
355 | # triggers a merge action. | |
356 | # |
|
356 | # | |
357 | # In both cases, we prompt the user and emit new actions to either |
|
357 | # In both cases, we prompt the user and emit new actions to either | |
358 | # remove the standin (if the normal file was kept) or to remove the |
|
358 | # remove the standin (if the normal file was kept) or to remove the | |
359 | # normal file and get the standin (if the largefile was kept). The |
|
359 | # normal file and get the standin (if the largefile was kept). The | |
360 | # default prompt answer is to use the largefile version since it was |
|
360 | # default prompt answer is to use the largefile version since it was | |
361 | # presumably changed on purpose. |
|
361 | # presumably changed on purpose. | |
362 | # |
|
362 | # | |
363 | # Finally, the merge.applyupdates function will then take care of |
|
363 | # Finally, the merge.applyupdates function will then take care of | |
364 | # writing the files into the working copy and lfcommands.updatelfiles |
|
364 | # writing the files into the working copy and lfcommands.updatelfiles | |
365 | # will update the largefiles. |
|
365 | # will update the largefiles. | |
366 | def overridemanifestmerge(origfn, repo, p1, p2, pa, branchmerge, force, |
|
366 | def overridemanifestmerge(origfn, repo, p1, p2, pa, branchmerge, force, | |
367 | partial, acceptremote=False): |
|
367 | partial, acceptremote=False): | |
368 | overwrite = force and not branchmerge |
|
368 | overwrite = force and not branchmerge | |
369 | actions = origfn(repo, p1, p2, pa, branchmerge, force, partial, |
|
369 | actions = origfn(repo, p1, p2, pa, branchmerge, force, partial, | |
370 | acceptremote) |
|
370 | acceptremote) | |
371 | processed = [] |
|
371 | processed = [] | |
372 |
|
372 | |||
373 | for action in actions: |
|
373 | for action in actions: | |
374 | if overwrite: |
|
374 | if overwrite: | |
375 | processed.append(action) |
|
375 | processed.append(action) | |
376 | continue |
|
376 | continue | |
377 | f, m, args, msg = action |
|
377 | f, m, args, msg = action | |
378 |
|
378 | |||
379 | choices = (_('&Largefile'), _('&Normal file')) |
|
379 | choices = (_('&Largefile'), _('&Normal file')) | |
380 |
|
380 | |||
381 | splitstandin = lfutil.splitstandin(f) |
|
381 | splitstandin = lfutil.splitstandin(f) | |
382 | if (m == "g" and splitstandin is not None and |
|
382 | if (m == "g" and splitstandin is not None and | |
383 | splitstandin in p1 and f in p2): |
|
383 | splitstandin in p1 and f in p2): | |
384 | # Case 1: normal file in the working copy, largefile in |
|
384 | # Case 1: normal file in the working copy, largefile in | |
385 | # the second parent |
|
385 | # the second parent | |
386 | lfile = splitstandin |
|
386 | lfile = splitstandin | |
387 | standin = f |
|
387 | standin = f | |
388 | msg = _('%s has been turned into a largefile\n' |
|
388 | msg = _('%s has been turned into a largefile\n' | |
389 | 'use (l)argefile or keep as (n)ormal file?') % lfile |
|
389 | 'use (l)argefile or keep as (n)ormal file?') % lfile | |
390 | if repo.ui.promptchoice(msg, choices, 0) == 0: |
|
390 | if repo.ui.promptchoice(msg, choices, 0) == 0: | |
391 | processed.append((lfile, "r", None, msg)) |
|
391 | processed.append((lfile, "r", None, msg)) | |
392 | processed.append((standin, "g", (p2.flags(standin),), msg)) |
|
392 | processed.append((standin, "g", (p2.flags(standin),), msg)) | |
393 | else: |
|
393 | else: | |
394 | processed.append((standin, "r", None, msg)) |
|
394 | processed.append((standin, "r", None, msg)) | |
395 | elif m == "g" and lfutil.standin(f) in p1 and f in p2: |
|
395 | elif m == "g" and lfutil.standin(f) in p1 and f in p2: | |
396 | # Case 2: largefile in the working copy, normal file in |
|
396 | # Case 2: largefile in the working copy, normal file in | |
397 | # the second parent |
|
397 | # the second parent | |
398 | standin = lfutil.standin(f) |
|
398 | standin = lfutil.standin(f) | |
399 | lfile = f |
|
399 | lfile = f | |
400 | msg = _('%s has been turned into a normal file\n' |
|
400 | msg = _('%s has been turned into a normal file\n' | |
401 | 'keep as (l)argefile or use (n)ormal file?') % lfile |
|
401 | 'keep as (l)argefile or use (n)ormal file?') % lfile | |
402 | if repo.ui.promptchoice(msg, choices, 0) == 0: |
|
402 | if repo.ui.promptchoice(msg, choices, 0) == 0: | |
403 | processed.append((lfile, "r", None, msg)) |
|
403 | processed.append((lfile, "r", None, msg)) | |
404 | else: |
|
404 | else: | |
405 | processed.append((standin, "r", None, msg)) |
|
405 | processed.append((standin, "r", None, msg)) | |
406 | processed.append((lfile, "g", (p2.flags(lfile),), msg)) |
|
406 | processed.append((lfile, "g", (p2.flags(lfile),), msg)) | |
407 | else: |
|
407 | else: | |
408 | processed.append(action) |
|
408 | processed.append(action) | |
409 |
|
409 | |||
410 | return processed |
|
410 | return processed | |
411 |
|
411 | |||
412 | # Override filemerge to prompt the user about how they wish to merge |
|
412 | # Override filemerge to prompt the user about how they wish to merge | |
413 | # largefiles. This will handle identical edits, and copy/rename + |
|
413 | # largefiles. This will handle identical edits, and copy/rename + | |
414 | # edit without prompting the user. |
|
414 | # edit without prompting the user. | |
415 | def overridefilemerge(origfn, repo, mynode, orig, fcd, fco, fca): |
|
415 | def overridefilemerge(origfn, repo, mynode, orig, fcd, fco, fca): | |
416 | # Use better variable names here. Because this is a wrapper we cannot |
|
416 | # Use better variable names here. Because this is a wrapper we cannot | |
417 | # change the variable names in the function declaration. |
|
417 | # change the variable names in the function declaration. | |
418 | fcdest, fcother, fcancestor = fcd, fco, fca |
|
418 | fcdest, fcother, fcancestor = fcd, fco, fca | |
419 | if not lfutil.isstandin(orig): |
|
419 | if not lfutil.isstandin(orig): | |
420 | return origfn(repo, mynode, orig, fcdest, fcother, fcancestor) |
|
420 | return origfn(repo, mynode, orig, fcdest, fcother, fcancestor) | |
421 | else: |
|
421 | else: | |
422 | if not fcother.cmp(fcdest): # files identical? |
|
422 | if not fcother.cmp(fcdest): # files identical? | |
423 | return None |
|
423 | return None | |
424 |
|
424 | |||
425 | # backwards, use working dir parent as ancestor |
|
425 | # backwards, use working dir parent as ancestor | |
426 | if fcancestor == fcother: |
|
426 | if fcancestor == fcother: | |
427 | fcancestor = fcdest.parents()[0] |
|
427 | fcancestor = fcdest.parents()[0] | |
428 |
|
428 | |||
429 | if orig != fcother.path(): |
|
429 | if orig != fcother.path(): | |
430 | repo.ui.status(_('merging %s and %s to %s\n') |
|
430 | repo.ui.status(_('merging %s and %s to %s\n') | |
431 | % (lfutil.splitstandin(orig), |
|
431 | % (lfutil.splitstandin(orig), | |
432 | lfutil.splitstandin(fcother.path()), |
|
432 | lfutil.splitstandin(fcother.path()), | |
433 | lfutil.splitstandin(fcdest.path()))) |
|
433 | lfutil.splitstandin(fcdest.path()))) | |
434 | else: |
|
434 | else: | |
435 | repo.ui.status(_('merging %s\n') |
|
435 | repo.ui.status(_('merging %s\n') | |
436 | % lfutil.splitstandin(fcdest.path())) |
|
436 | % lfutil.splitstandin(fcdest.path())) | |
437 |
|
437 | |||
438 | if fcancestor.path() != fcother.path() and fcother.data() == \ |
|
438 | if fcancestor.path() != fcother.path() and fcother.data() == \ | |
439 | fcancestor.data(): |
|
439 | fcancestor.data(): | |
440 | return 0 |
|
440 | return 0 | |
441 | if fcancestor.path() != fcdest.path() and fcdest.data() == \ |
|
441 | if fcancestor.path() != fcdest.path() and fcdest.data() == \ | |
442 | fcancestor.data(): |
|
442 | fcancestor.data(): | |
443 | repo.wwrite(fcdest.path(), fcother.data(), fcother.flags()) |
|
443 | repo.wwrite(fcdest.path(), fcother.data(), fcother.flags()) | |
444 | return 0 |
|
444 | return 0 | |
445 |
|
445 | |||
446 | if repo.ui.promptchoice(_('largefile %s has a merge conflict\n' |
|
446 | if repo.ui.promptchoice(_('largefile %s has a merge conflict\n' | |
447 | 'keep (l)ocal or take (o)ther?') % |
|
447 | 'keep (l)ocal or take (o)ther?') % | |
448 | lfutil.splitstandin(orig), |
|
448 | lfutil.splitstandin(orig), | |
449 | (_('&Local'), _('&Other')), 0) == 0: |
|
449 | (_('&Local'), _('&Other')), 0) == 0: | |
450 | return 0 |
|
450 | return 0 | |
451 | else: |
|
451 | else: | |
452 | repo.wwrite(fcdest.path(), fcother.data(), fcother.flags()) |
|
452 | repo.wwrite(fcdest.path(), fcother.data(), fcother.flags()) | |
453 | return 0 |
|
453 | return 0 | |
454 |
|
454 | |||
455 | # Copy first changes the matchers to match standins instead of |
|
455 | # Copy first changes the matchers to match standins instead of | |
456 | # largefiles. Then it overrides util.copyfile in that function it |
|
456 | # largefiles. Then it overrides util.copyfile in that function it | |
457 | # checks if the destination largefile already exists. It also keeps a |
|
457 | # checks if the destination largefile already exists. It also keeps a | |
458 | # list of copied files so that the largefiles can be copied and the |
|
458 | # list of copied files so that the largefiles can be copied and the | |
459 | # dirstate updated. |
|
459 | # dirstate updated. | |
460 | def overridecopy(orig, ui, repo, pats, opts, rename=False): |
|
460 | def overridecopy(orig, ui, repo, pats, opts, rename=False): | |
461 | # doesn't remove largefile on rename |
|
461 | # doesn't remove largefile on rename | |
462 | if len(pats) < 2: |
|
462 | if len(pats) < 2: | |
463 | # this isn't legal, let the original function deal with it |
|
463 | # this isn't legal, let the original function deal with it | |
464 | return orig(ui, repo, pats, opts, rename) |
|
464 | return orig(ui, repo, pats, opts, rename) | |
465 |
|
465 | |||
466 | def makestandin(relpath): |
|
466 | def makestandin(relpath): | |
467 | path = scmutil.canonpath(repo.root, repo.getcwd(), relpath) |
|
467 | path = scmutil.canonpath(repo.root, repo.getcwd(), relpath) | |
468 | return os.path.join(repo.wjoin(lfutil.standin(path))) |
|
468 | return os.path.join(repo.wjoin(lfutil.standin(path))) | |
469 |
|
469 | |||
470 | fullpats = scmutil.expandpats(pats) |
|
470 | fullpats = scmutil.expandpats(pats) | |
471 | dest = fullpats[-1] |
|
471 | dest = fullpats[-1] | |
472 |
|
472 | |||
473 | if os.path.isdir(dest): |
|
473 | if os.path.isdir(dest): | |
474 | if not os.path.isdir(makestandin(dest)): |
|
474 | if not os.path.isdir(makestandin(dest)): | |
475 | os.makedirs(makestandin(dest)) |
|
475 | os.makedirs(makestandin(dest)) | |
476 | # This could copy both lfiles and normal files in one command, |
|
476 | # This could copy both lfiles and normal files in one command, | |
477 | # but we don't want to do that. First replace their matcher to |
|
477 | # but we don't want to do that. First replace their matcher to | |
478 | # only match normal files and run it, then replace it to just |
|
478 | # only match normal files and run it, then replace it to just | |
479 | # match largefiles and run it again. |
|
479 | # match largefiles and run it again. | |
480 | nonormalfiles = False |
|
480 | nonormalfiles = False | |
481 | nolfiles = False |
|
481 | nolfiles = False | |
482 | try: |
|
482 | try: | |
483 | try: |
|
483 | try: | |
484 | installnormalfilesmatchfn(repo[None].manifest()) |
|
484 | installnormalfilesmatchfn(repo[None].manifest()) | |
485 | result = orig(ui, repo, pats, opts, rename) |
|
485 | result = orig(ui, repo, pats, opts, rename) | |
486 | except util.Abort, e: |
|
486 | except util.Abort, e: | |
487 | if str(e) != _('no files to copy'): |
|
487 | if str(e) != _('no files to copy'): | |
488 | raise e |
|
488 | raise e | |
489 | else: |
|
489 | else: | |
490 | nonormalfiles = True |
|
490 | nonormalfiles = True | |
491 | result = 0 |
|
491 | result = 0 | |
492 | finally: |
|
492 | finally: | |
493 | restorematchfn() |
|
493 | restorematchfn() | |
494 |
|
494 | |||
495 | # The first rename can cause our current working directory to be removed. |
|
495 | # The first rename can cause our current working directory to be removed. | |
496 | # In that case there is nothing left to copy/rename so just quit. |
|
496 | # In that case there is nothing left to copy/rename so just quit. | |
497 | try: |
|
497 | try: | |
498 | repo.getcwd() |
|
498 | repo.getcwd() | |
499 | except OSError: |
|
499 | except OSError: | |
500 | return result |
|
500 | return result | |
501 |
|
501 | |||
502 | try: |
|
502 | try: | |
503 | try: |
|
503 | try: | |
504 | # When we call orig below it creates the standins but we don't add |
|
504 | # When we call orig below it creates the standins but we don't add | |
505 | # them to the dir state until later so lock during that time. |
|
505 | # them to the dir state until later so lock during that time. | |
506 | wlock = repo.wlock() |
|
506 | wlock = repo.wlock() | |
507 |
|
507 | |||
508 | manifest = repo[None].manifest() |
|
508 | manifest = repo[None].manifest() | |
509 | oldmatch = None # for the closure |
|
509 | oldmatch = None # for the closure | |
510 | def overridematch(ctx, pats=[], opts={}, globbed=False, |
|
510 | def overridematch(ctx, pats=[], opts={}, globbed=False, | |
511 | default='relpath'): |
|
511 | default='relpath'): | |
512 | newpats = [] |
|
512 | newpats = [] | |
513 | # The patterns were previously mangled to add the standin |
|
513 | # The patterns were previously mangled to add the standin | |
514 | # directory; we need to remove that now |
|
514 | # directory; we need to remove that now | |
515 | for pat in pats: |
|
515 | for pat in pats: | |
516 | if match_.patkind(pat) is None and lfutil.shortname in pat: |
|
516 | if match_.patkind(pat) is None and lfutil.shortname in pat: | |
517 | newpats.append(pat.replace(lfutil.shortname, '')) |
|
517 | newpats.append(pat.replace(lfutil.shortname, '')) | |
518 | else: |
|
518 | else: | |
519 | newpats.append(pat) |
|
519 | newpats.append(pat) | |
520 | match = oldmatch(ctx, newpats, opts, globbed, default) |
|
520 | match = oldmatch(ctx, newpats, opts, globbed, default) | |
521 | m = copy.copy(match) |
|
521 | m = copy.copy(match) | |
522 | lfile = lambda f: lfutil.standin(f) in manifest |
|
522 | lfile = lambda f: lfutil.standin(f) in manifest | |
523 | m._files = [lfutil.standin(f) for f in m._files if lfile(f)] |
|
523 | m._files = [lfutil.standin(f) for f in m._files if lfile(f)] | |
524 | m._fmap = set(m._files) |
|
524 | m._fmap = set(m._files) | |
525 | m._always = False |
|
525 | m._always = False | |
526 | origmatchfn = m.matchfn |
|
526 | origmatchfn = m.matchfn | |
527 | m.matchfn = lambda f: (lfutil.isstandin(f) and |
|
527 | m.matchfn = lambda f: (lfutil.isstandin(f) and | |
528 | (f in manifest) and |
|
528 | (f in manifest) and | |
529 | origmatchfn(lfutil.splitstandin(f)) or |
|
529 | origmatchfn(lfutil.splitstandin(f)) or | |
530 | None) |
|
530 | None) | |
531 | return m |
|
531 | return m | |
532 | oldmatch = installmatchfn(overridematch) |
|
532 | oldmatch = installmatchfn(overridematch) | |
533 | listpats = [] |
|
533 | listpats = [] | |
534 | for pat in pats: |
|
534 | for pat in pats: | |
535 | if match_.patkind(pat) is not None: |
|
535 | if match_.patkind(pat) is not None: | |
536 | listpats.append(pat) |
|
536 | listpats.append(pat) | |
537 | else: |
|
537 | else: | |
538 | listpats.append(makestandin(pat)) |
|
538 | listpats.append(makestandin(pat)) | |
539 |
|
539 | |||
540 | try: |
|
540 | try: | |
541 | origcopyfile = util.copyfile |
|
541 | origcopyfile = util.copyfile | |
542 | copiedfiles = [] |
|
542 | copiedfiles = [] | |
543 | def overridecopyfile(src, dest): |
|
543 | def overridecopyfile(src, dest): | |
544 | if (lfutil.shortname in src and |
|
544 | if (lfutil.shortname in src and | |
545 | dest.startswith(repo.wjoin(lfutil.shortname))): |
|
545 | dest.startswith(repo.wjoin(lfutil.shortname))): | |
546 | destlfile = dest.replace(lfutil.shortname, '') |
|
546 | destlfile = dest.replace(lfutil.shortname, '') | |
547 | if not opts['force'] and os.path.exists(destlfile): |
|
547 | if not opts['force'] and os.path.exists(destlfile): | |
548 | raise IOError('', |
|
548 | raise IOError('', | |
549 | _('destination largefile already exists')) |
|
549 | _('destination largefile already exists')) | |
550 | copiedfiles.append((src, dest)) |
|
550 | copiedfiles.append((src, dest)) | |
551 | origcopyfile(src, dest) |
|
551 | origcopyfile(src, dest) | |
552 |
|
552 | |||
553 | util.copyfile = overridecopyfile |
|
553 | util.copyfile = overridecopyfile | |
554 | result += orig(ui, repo, listpats, opts, rename) |
|
554 | result += orig(ui, repo, listpats, opts, rename) | |
555 | finally: |
|
555 | finally: | |
556 | util.copyfile = origcopyfile |
|
556 | util.copyfile = origcopyfile | |
557 |
|
557 | |||
558 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
558 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
559 | for (src, dest) in copiedfiles: |
|
559 | for (src, dest) in copiedfiles: | |
560 | if (lfutil.shortname in src and |
|
560 | if (lfutil.shortname in src and | |
561 | dest.startswith(repo.wjoin(lfutil.shortname))): |
|
561 | dest.startswith(repo.wjoin(lfutil.shortname))): | |
562 | srclfile = src.replace(repo.wjoin(lfutil.standin('')), '') |
|
562 | srclfile = src.replace(repo.wjoin(lfutil.standin('')), '') | |
563 | destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '') |
|
563 | destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '') | |
564 | destlfiledir = os.path.dirname(repo.wjoin(destlfile)) or '.' |
|
564 | destlfiledir = os.path.dirname(repo.wjoin(destlfile)) or '.' | |
565 | if not os.path.isdir(destlfiledir): |
|
565 | if not os.path.isdir(destlfiledir): | |
566 | os.makedirs(destlfiledir) |
|
566 | os.makedirs(destlfiledir) | |
567 | if rename: |
|
567 | if rename: | |
568 | os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile)) |
|
568 | os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile)) | |
569 | lfdirstate.remove(srclfile) |
|
569 | lfdirstate.remove(srclfile) | |
570 | else: |
|
570 | else: | |
571 | util.copyfile(repo.wjoin(srclfile), |
|
571 | util.copyfile(repo.wjoin(srclfile), | |
572 | repo.wjoin(destlfile)) |
|
572 | repo.wjoin(destlfile)) | |
573 |
|
573 | |||
574 | lfdirstate.add(destlfile) |
|
574 | lfdirstate.add(destlfile) | |
575 | lfdirstate.write() |
|
575 | lfdirstate.write() | |
576 | except util.Abort, e: |
|
576 | except util.Abort, e: | |
577 | if str(e) != _('no files to copy'): |
|
577 | if str(e) != _('no files to copy'): | |
578 | raise e |
|
578 | raise e | |
579 | else: |
|
579 | else: | |
580 | nolfiles = True |
|
580 | nolfiles = True | |
581 | finally: |
|
581 | finally: | |
582 | restorematchfn() |
|
582 | restorematchfn() | |
583 | wlock.release() |
|
583 | wlock.release() | |
584 |
|
584 | |||
585 | if nolfiles and nonormalfiles: |
|
585 | if nolfiles and nonormalfiles: | |
586 | raise util.Abort(_('no files to copy')) |
|
586 | raise util.Abort(_('no files to copy')) | |
587 |
|
587 | |||
588 | return result |
|
588 | return result | |
589 |
|
589 | |||
590 | # When the user calls revert, we have to be careful to not revert any |
|
590 | # When the user calls revert, we have to be careful to not revert any | |
591 | # changes to other largefiles accidentally. This means we have to keep |
|
591 | # changes to other largefiles accidentally. This means we have to keep | |
592 | # track of the largefiles that are being reverted so we only pull down |
|
592 | # track of the largefiles that are being reverted so we only pull down | |
593 | # the necessary largefiles. |
|
593 | # the necessary largefiles. | |
594 | # |
|
594 | # | |
595 | # Standins are only updated (to match the hash of largefiles) before |
|
595 | # Standins are only updated (to match the hash of largefiles) before | |
596 | # commits. Update the standins then run the original revert, changing |
|
596 | # commits. Update the standins then run the original revert, changing | |
597 | # the matcher to hit standins instead of largefiles. Based on the |
|
597 | # the matcher to hit standins instead of largefiles. Based on the | |
598 | # resulting standins update the largefiles. Then return the standins |
|
598 | # resulting standins update the largefiles. Then return the standins | |
599 | # to their proper state |
|
599 | # to their proper state | |
600 | def overriderevert(orig, ui, repo, *pats, **opts): |
|
600 | def overriderevert(orig, ui, repo, *pats, **opts): | |
601 | # Because we put the standins in a bad state (by updating them) |
|
601 | # Because we put the standins in a bad state (by updating them) | |
602 | # and then return them to a correct state we need to lock to |
|
602 | # and then return them to a correct state we need to lock to | |
603 | # prevent others from changing them in their incorrect state. |
|
603 | # prevent others from changing them in their incorrect state. | |
604 | wlock = repo.wlock() |
|
604 | wlock = repo.wlock() | |
605 | try: |
|
605 | try: | |
606 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
606 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
607 | (modified, added, removed, missing, unknown, ignored, clean) = \ |
|
607 | (modified, added, removed, missing, unknown, ignored, clean) = \ | |
608 | lfutil.lfdirstatestatus(lfdirstate, repo, repo['.'].rev()) |
|
608 | lfutil.lfdirstatestatus(lfdirstate, repo, repo['.'].rev()) | |
609 | lfdirstate.write() |
|
609 | lfdirstate.write() | |
610 | for lfile in modified: |
|
610 | for lfile in modified: | |
611 | lfutil.updatestandin(repo, lfutil.standin(lfile)) |
|
611 | lfutil.updatestandin(repo, lfutil.standin(lfile)) | |
612 | for lfile in missing: |
|
612 | for lfile in missing: | |
613 | if (os.path.exists(repo.wjoin(lfutil.standin(lfile)))): |
|
613 | if (os.path.exists(repo.wjoin(lfutil.standin(lfile)))): | |
614 | os.unlink(repo.wjoin(lfutil.standin(lfile))) |
|
614 | os.unlink(repo.wjoin(lfutil.standin(lfile))) | |
615 |
|
615 | |||
616 | try: |
|
616 | try: | |
617 | ctx = scmutil.revsingle(repo, opts.get('rev')) |
|
617 | ctx = scmutil.revsingle(repo, opts.get('rev')) | |
618 | oldmatch = None # for the closure |
|
618 | oldmatch = None # for the closure | |
619 | def overridematch(ctx, pats=[], opts={}, globbed=False, |
|
619 | def overridematch(ctx, pats=[], opts={}, globbed=False, | |
620 | default='relpath'): |
|
620 | default='relpath'): | |
621 | match = oldmatch(ctx, pats, opts, globbed, default) |
|
621 | match = oldmatch(ctx, pats, opts, globbed, default) | |
622 | m = copy.copy(match) |
|
622 | m = copy.copy(match) | |
623 | def tostandin(f): |
|
623 | def tostandin(f): | |
624 | if lfutil.standin(f) in ctx: |
|
624 | if lfutil.standin(f) in ctx: | |
625 | return lfutil.standin(f) |
|
625 | return lfutil.standin(f) | |
626 | elif lfutil.standin(f) in repo[None]: |
|
626 | elif lfutil.standin(f) in repo[None]: | |
627 | return None |
|
627 | return None | |
628 | return f |
|
628 | return f | |
629 | m._files = [tostandin(f) for f in m._files] |
|
629 | m._files = [tostandin(f) for f in m._files] | |
630 | m._files = [f for f in m._files if f is not None] |
|
630 | m._files = [f for f in m._files if f is not None] | |
631 | m._fmap = set(m._files) |
|
631 | m._fmap = set(m._files) | |
632 | m._always = False |
|
632 | m._always = False | |
633 | origmatchfn = m.matchfn |
|
633 | origmatchfn = m.matchfn | |
634 | def matchfn(f): |
|
634 | def matchfn(f): | |
635 | if lfutil.isstandin(f): |
|
635 | if lfutil.isstandin(f): | |
636 | # We need to keep track of what largefiles are being |
|
636 | # We need to keep track of what largefiles are being | |
637 | # matched so we know which ones to update later -- |
|
637 | # matched so we know which ones to update later -- | |
638 | # otherwise we accidentally revert changes to other |
|
638 | # otherwise we accidentally revert changes to other | |
639 | # largefiles. This is repo-specific, so duckpunch the |
|
639 | # largefiles. This is repo-specific, so duckpunch the | |
640 | # repo object to keep the list of largefiles for us |
|
640 | # repo object to keep the list of largefiles for us | |
641 | # later. |
|
641 | # later. | |
642 | if origmatchfn(lfutil.splitstandin(f)) and \ |
|
642 | if origmatchfn(lfutil.splitstandin(f)) and \ | |
643 | (f in repo[None] or f in ctx): |
|
643 | (f in repo[None] or f in ctx): | |
644 | lfileslist = getattr(repo, '_lfilestoupdate', []) |
|
644 | lfileslist = getattr(repo, '_lfilestoupdate', []) | |
645 | lfileslist.append(lfutil.splitstandin(f)) |
|
645 | lfileslist.append(lfutil.splitstandin(f)) | |
646 | repo._lfilestoupdate = lfileslist |
|
646 | repo._lfilestoupdate = lfileslist | |
647 | return True |
|
647 | return True | |
648 | else: |
|
648 | else: | |
649 | return False |
|
649 | return False | |
650 | return origmatchfn(f) |
|
650 | return origmatchfn(f) | |
651 | m.matchfn = matchfn |
|
651 | m.matchfn = matchfn | |
652 | return m |
|
652 | return m | |
653 | oldmatch = installmatchfn(overridematch) |
|
653 | oldmatch = installmatchfn(overridematch) | |
654 | scmutil.match |
|
654 | scmutil.match | |
655 | matches = overridematch(repo[None], pats, opts) |
|
655 | matches = overridematch(repo[None], pats, opts) | |
656 | orig(ui, repo, *pats, **opts) |
|
656 | orig(ui, repo, *pats, **opts) | |
657 | finally: |
|
657 | finally: | |
658 | restorematchfn() |
|
658 | restorematchfn() | |
659 | lfileslist = getattr(repo, '_lfilestoupdate', []) |
|
659 | lfileslist = getattr(repo, '_lfilestoupdate', []) | |
660 | lfcommands.updatelfiles(ui, repo, filelist=lfileslist, |
|
660 | lfcommands.updatelfiles(ui, repo, filelist=lfileslist, | |
661 | printmessage=False) |
|
661 | printmessage=False) | |
662 |
|
662 | |||
663 | # empty out the largefiles list so we start fresh next time |
|
663 | # empty out the largefiles list so we start fresh next time | |
664 | repo._lfilestoupdate = [] |
|
664 | repo._lfilestoupdate = [] | |
665 | for lfile in modified: |
|
665 | for lfile in modified: | |
666 | if lfile in lfileslist: |
|
666 | if lfile in lfileslist: | |
667 | if os.path.exists(repo.wjoin(lfutil.standin(lfile))) and lfile\ |
|
667 | if os.path.exists(repo.wjoin(lfutil.standin(lfile))) and lfile\ | |
668 | in repo['.']: |
|
668 | in repo['.']: | |
669 | lfutil.writestandin(repo, lfutil.standin(lfile), |
|
669 | lfutil.writestandin(repo, lfutil.standin(lfile), | |
670 | repo['.'][lfile].data().strip(), |
|
670 | repo['.'][lfile].data().strip(), | |
671 | 'x' in repo['.'][lfile].flags()) |
|
671 | 'x' in repo['.'][lfile].flags()) | |
672 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
672 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
673 | for lfile in added: |
|
673 | for lfile in added: | |
674 | standin = lfutil.standin(lfile) |
|
674 | standin = lfutil.standin(lfile) | |
675 | if standin not in ctx and (standin in matches or opts.get('all')): |
|
675 | if standin not in ctx and (standin in matches or opts.get('all')): | |
676 | if lfile in lfdirstate: |
|
676 | if lfile in lfdirstate: | |
677 | lfdirstate.drop(lfile) |
|
677 | lfdirstate.drop(lfile) | |
678 | util.unlinkpath(repo.wjoin(standin)) |
|
678 | util.unlinkpath(repo.wjoin(standin)) | |
679 | lfdirstate.write() |
|
679 | lfdirstate.write() | |
680 | finally: |
|
680 | finally: | |
681 | wlock.release() |
|
681 | wlock.release() | |
682 |
|
682 | |||
683 | def hgupdaterepo(orig, repo, node, overwrite): |
|
683 | def hgupdaterepo(orig, repo, node, overwrite): | |
684 | if not overwrite: |
|
684 | if not overwrite: | |
685 | # Only call updatelfiles on the standins that have changed to save time |
|
685 | # Only call updatelfiles on the standins that have changed to save time | |
686 | oldstandins = lfutil.getstandinsstate(repo) |
|
686 | oldstandins = lfutil.getstandinsstate(repo) | |
687 |
|
687 | |||
688 | result = orig(repo, node, overwrite) |
|
688 | result = orig(repo, node, overwrite) | |
689 |
|
689 | |||
690 | filelist = None |
|
690 | filelist = None | |
691 | if not overwrite: |
|
691 | if not overwrite: | |
692 | newstandins = lfutil.getstandinsstate(repo) |
|
692 | newstandins = lfutil.getstandinsstate(repo) | |
693 | filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) |
|
693 | filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) | |
694 | lfcommands.updatelfiles(repo.ui, repo, filelist=filelist) |
|
694 | lfcommands.updatelfiles(repo.ui, repo, filelist=filelist) | |
695 | return result |
|
695 | return result | |
696 |
|
696 | |||
697 | def hgmerge(orig, repo, node, force=None, remind=True): |
|
697 | def hgmerge(orig, repo, node, force=None, remind=True): | |
698 | result = orig(repo, node, force, remind) |
|
698 | result = orig(repo, node, force, remind) | |
699 | lfcommands.updatelfiles(repo.ui, repo) |
|
699 | lfcommands.updatelfiles(repo.ui, repo) | |
700 | return result |
|
700 | return result | |
701 |
|
701 | |||
702 | # When we rebase a repository with remotely changed largefiles, we need to |
|
702 | # When we rebase a repository with remotely changed largefiles, we need to | |
703 | # take some extra care so that the largefiles are correctly updated in the |
|
703 | # take some extra care so that the largefiles are correctly updated in the | |
704 | # working copy |
|
704 | # working copy | |
705 | def overridepull(orig, ui, repo, source=None, **opts): |
|
705 | def overridepull(orig, ui, repo, source=None, **opts): | |
706 | revsprepull = len(repo) |
|
706 | revsprepull = len(repo) | |
707 | if not source: |
|
707 | if not source: | |
708 | source = 'default' |
|
708 | source = 'default' | |
709 | repo.lfpullsource = source |
|
709 | repo.lfpullsource = source | |
710 | if opts.get('rebase', False): |
|
710 | if opts.get('rebase', False): | |
711 | repo._isrebasing = True |
|
711 | repo._isrebasing = True | |
712 | try: |
|
712 | try: | |
713 | if opts.get('update'): |
|
713 | if opts.get('update'): | |
714 | del opts['update'] |
|
714 | del opts['update'] | |
715 | ui.debug('--update and --rebase are not compatible, ignoring ' |
|
715 | ui.debug('--update and --rebase are not compatible, ignoring ' | |
716 | 'the update flag\n') |
|
716 | 'the update flag\n') | |
717 | del opts['rebase'] |
|
717 | del opts['rebase'] | |
718 | cmdutil.bailifchanged(repo) |
|
718 | cmdutil.bailifchanged(repo) | |
719 | origpostincoming = commands.postincoming |
|
719 | origpostincoming = commands.postincoming | |
720 | def _dummy(*args, **kwargs): |
|
720 | def _dummy(*args, **kwargs): | |
721 | pass |
|
721 | pass | |
722 | commands.postincoming = _dummy |
|
722 | commands.postincoming = _dummy | |
723 | try: |
|
723 | try: | |
724 | result = commands.pull(ui, repo, source, **opts) |
|
724 | result = commands.pull(ui, repo, source, **opts) | |
725 | finally: |
|
725 | finally: | |
726 | commands.postincoming = origpostincoming |
|
726 | commands.postincoming = origpostincoming | |
727 | revspostpull = len(repo) |
|
727 | revspostpull = len(repo) | |
728 | if revspostpull > revsprepull: |
|
728 | if revspostpull > revsprepull: | |
729 | result = result or rebase.rebase(ui, repo) |
|
729 | result = result or rebase.rebase(ui, repo) | |
730 | finally: |
|
730 | finally: | |
731 | repo._isrebasing = False |
|
731 | repo._isrebasing = False | |
732 | else: |
|
732 | else: | |
733 | result = orig(ui, repo, source, **opts) |
|
733 | result = orig(ui, repo, source, **opts) | |
734 | revspostpull = len(repo) |
|
734 | revspostpull = len(repo) | |
|
735 | lfrevs = opts.get('lfrev', []) | |||
735 | if opts.get('all_largefiles'): |
|
736 | if opts.get('all_largefiles'): | |
736 | revs = [] |
|
737 | lfrevs.append('pulled()') | |
737 | for rev in xrange(revsprepull, revspostpull): |
|
|||
738 | revs.append(repo[rev].rev()) |
|
|||
739 | lfcommands.downloadlfiles(ui, repo, revs) |
|
|||
740 | lfrevs = opts.get('lfrev', []) |
|
|||
741 | if lfrevs and revspostpull > revsprepull: |
|
738 | if lfrevs and revspostpull > revsprepull: | |
742 | numcached = 0 |
|
739 | numcached = 0 | |
743 | repo.firstpulled = revsprepull # for pulled() revset expression |
|
740 | repo.firstpulled = revsprepull # for pulled() revset expression | |
744 | try: |
|
741 | try: | |
745 | for rev in scmutil.revrange(repo, lfrevs): |
|
742 | for rev in scmutil.revrange(repo, lfrevs): | |
746 | ui.note(_('pulling largefiles for revision %s\n') % rev) |
|
743 | ui.note(_('pulling largefiles for revision %s\n') % rev) | |
747 | (cached, missing) = lfcommands.cachelfiles(ui, repo, rev) |
|
744 | (cached, missing) = lfcommands.cachelfiles(ui, repo, rev) | |
748 | numcached += len(cached) |
|
745 | numcached += len(cached) | |
749 | finally: |
|
746 | finally: | |
750 | del repo.firstpulled |
|
747 | del repo.firstpulled | |
751 | ui.status(_("%d largefiles cached\n") % numcached) |
|
748 | ui.status(_("%d largefiles cached\n") % numcached) | |
752 | return result |
|
749 | return result | |
753 |
|
750 | |||
754 | def pulledrevsetsymbol(repo, subset, x): |
|
751 | def pulledrevsetsymbol(repo, subset, x): | |
755 | """``pulled()`` |
|
752 | """``pulled()`` | |
756 | Changesets that just has been pulled. |
|
753 | Changesets that just has been pulled. | |
757 |
|
754 | |||
758 | Only available with largefiles from pull --lfrev expressions. |
|
755 | Only available with largefiles from pull --lfrev expressions. | |
759 |
|
756 | |||
760 | .. container:: verbose |
|
757 | .. container:: verbose | |
761 |
|
758 | |||
762 | Some examples: |
|
759 | Some examples: | |
763 |
|
760 | |||
764 | - pull largefiles for all new changesets:: |
|
761 | - pull largefiles for all new changesets:: | |
765 |
|
762 | |||
766 | hg pull -lfrev "pulled()" |
|
763 | hg pull -lfrev "pulled()" | |
767 |
|
764 | |||
768 | - pull largefiles for all new branch heads:: |
|
765 | - pull largefiles for all new branch heads:: | |
769 |
|
766 | |||
770 | hg pull -lfrev "head(pulled()) and not closed()" |
|
767 | hg pull -lfrev "head(pulled()) and not closed()" | |
771 |
|
768 | |||
772 | """ |
|
769 | """ | |
773 |
|
770 | |||
774 | try: |
|
771 | try: | |
775 | firstpulled = repo.firstpulled |
|
772 | firstpulled = repo.firstpulled | |
776 | except AttributeError: |
|
773 | except AttributeError: | |
777 | raise util.Abort(_("pulled() only available in --lfrev")) |
|
774 | raise util.Abort(_("pulled() only available in --lfrev")) | |
778 | return [r for r in subset if r >= firstpulled] |
|
775 | return [r for r in subset if r >= firstpulled] | |
779 |
|
776 | |||
780 | def overrideclone(orig, ui, source, dest=None, **opts): |
|
777 | def overrideclone(orig, ui, source, dest=None, **opts): | |
781 | d = dest |
|
778 | d = dest | |
782 | if d is None: |
|
779 | if d is None: | |
783 | d = hg.defaultdest(source) |
|
780 | d = hg.defaultdest(source) | |
784 | if opts.get('all_largefiles') and not hg.islocal(d): |
|
781 | if opts.get('all_largefiles') and not hg.islocal(d): | |
785 | raise util.Abort(_( |
|
782 | raise util.Abort(_( | |
786 | '--all-largefiles is incompatible with non-local destination %s' % |
|
783 | '--all-largefiles is incompatible with non-local destination %s' % | |
787 | d)) |
|
784 | d)) | |
788 |
|
785 | |||
789 | return orig(ui, source, dest, **opts) |
|
786 | return orig(ui, source, dest, **opts) | |
790 |
|
787 | |||
791 | def hgclone(orig, ui, opts, *args, **kwargs): |
|
788 | def hgclone(orig, ui, opts, *args, **kwargs): | |
792 | result = orig(ui, opts, *args, **kwargs) |
|
789 | result = orig(ui, opts, *args, **kwargs) | |
793 |
|
790 | |||
794 | if result is not None: |
|
791 | if result is not None: | |
795 | sourcerepo, destrepo = result |
|
792 | sourcerepo, destrepo = result | |
796 | repo = destrepo.local() |
|
793 | repo = destrepo.local() | |
797 |
|
794 | |||
798 | # Caching is implicitly limited to 'rev' option, since the dest repo was |
|
795 | # Caching is implicitly limited to 'rev' option, since the dest repo was | |
799 | # truncated at that point. The user may expect a download count with |
|
796 | # truncated at that point. The user may expect a download count with | |
800 | # this option, so attempt whether or not this is a largefile repo. |
|
797 | # this option, so attempt whether or not this is a largefile repo. | |
801 | if opts.get('all_largefiles'): |
|
798 | if opts.get('all_largefiles'): | |
802 | success, missing = lfcommands.downloadlfiles(ui, repo, None) |
|
799 | success, missing = lfcommands.downloadlfiles(ui, repo, None) | |
803 |
|
800 | |||
804 | if missing != 0: |
|
801 | if missing != 0: | |
805 | return None |
|
802 | return None | |
806 |
|
803 | |||
807 | return result |
|
804 | return result | |
808 |
|
805 | |||
809 | def overriderebase(orig, ui, repo, **opts): |
|
806 | def overriderebase(orig, ui, repo, **opts): | |
810 | repo._isrebasing = True |
|
807 | repo._isrebasing = True | |
811 | try: |
|
808 | try: | |
812 | return orig(ui, repo, **opts) |
|
809 | return orig(ui, repo, **opts) | |
813 | finally: |
|
810 | finally: | |
814 | repo._isrebasing = False |
|
811 | repo._isrebasing = False | |
815 |
|
812 | |||
816 | def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None, |
|
813 | def overridearchive(orig, repo, dest, node, kind, decode=True, matchfn=None, | |
817 | prefix=None, mtime=None, subrepos=None): |
|
814 | prefix=None, mtime=None, subrepos=None): | |
818 | # No need to lock because we are only reading history and |
|
815 | # No need to lock because we are only reading history and | |
819 | # largefile caches, neither of which are modified. |
|
816 | # largefile caches, neither of which are modified. | |
820 | lfcommands.cachelfiles(repo.ui, repo, node) |
|
817 | lfcommands.cachelfiles(repo.ui, repo, node) | |
821 |
|
818 | |||
822 | if kind not in archival.archivers: |
|
819 | if kind not in archival.archivers: | |
823 | raise util.Abort(_("unknown archive type '%s'") % kind) |
|
820 | raise util.Abort(_("unknown archive type '%s'") % kind) | |
824 |
|
821 | |||
825 | ctx = repo[node] |
|
822 | ctx = repo[node] | |
826 |
|
823 | |||
827 | if kind == 'files': |
|
824 | if kind == 'files': | |
828 | if prefix: |
|
825 | if prefix: | |
829 | raise util.Abort( |
|
826 | raise util.Abort( | |
830 | _('cannot give prefix when archiving to files')) |
|
827 | _('cannot give prefix when archiving to files')) | |
831 | else: |
|
828 | else: | |
832 | prefix = archival.tidyprefix(dest, kind, prefix) |
|
829 | prefix = archival.tidyprefix(dest, kind, prefix) | |
833 |
|
830 | |||
834 | def write(name, mode, islink, getdata): |
|
831 | def write(name, mode, islink, getdata): | |
835 | if matchfn and not matchfn(name): |
|
832 | if matchfn and not matchfn(name): | |
836 | return |
|
833 | return | |
837 | data = getdata() |
|
834 | data = getdata() | |
838 | if decode: |
|
835 | if decode: | |
839 | data = repo.wwritedata(name, data) |
|
836 | data = repo.wwritedata(name, data) | |
840 | archiver.addfile(prefix + name, mode, islink, data) |
|
837 | archiver.addfile(prefix + name, mode, islink, data) | |
841 |
|
838 | |||
842 | archiver = archival.archivers[kind](dest, mtime or ctx.date()[0]) |
|
839 | archiver = archival.archivers[kind](dest, mtime or ctx.date()[0]) | |
843 |
|
840 | |||
844 | if repo.ui.configbool("ui", "archivemeta", True): |
|
841 | if repo.ui.configbool("ui", "archivemeta", True): | |
845 | def metadata(): |
|
842 | def metadata(): | |
846 | base = 'repo: %s\nnode: %s\nbranch: %s\n' % ( |
|
843 | base = 'repo: %s\nnode: %s\nbranch: %s\n' % ( | |
847 | hex(repo.changelog.node(0)), hex(node), ctx.branch()) |
|
844 | hex(repo.changelog.node(0)), hex(node), ctx.branch()) | |
848 |
|
845 | |||
849 | tags = ''.join('tag: %s\n' % t for t in ctx.tags() |
|
846 | tags = ''.join('tag: %s\n' % t for t in ctx.tags() | |
850 | if repo.tagtype(t) == 'global') |
|
847 | if repo.tagtype(t) == 'global') | |
851 | if not tags: |
|
848 | if not tags: | |
852 | repo.ui.pushbuffer() |
|
849 | repo.ui.pushbuffer() | |
853 | opts = {'template': '{latesttag}\n{latesttagdistance}', |
|
850 | opts = {'template': '{latesttag}\n{latesttagdistance}', | |
854 | 'style': '', 'patch': None, 'git': None} |
|
851 | 'style': '', 'patch': None, 'git': None} | |
855 | cmdutil.show_changeset(repo.ui, repo, opts).show(ctx) |
|
852 | cmdutil.show_changeset(repo.ui, repo, opts).show(ctx) | |
856 | ltags, dist = repo.ui.popbuffer().split('\n') |
|
853 | ltags, dist = repo.ui.popbuffer().split('\n') | |
857 | tags = ''.join('latesttag: %s\n' % t for t in ltags.split(':')) |
|
854 | tags = ''.join('latesttag: %s\n' % t for t in ltags.split(':')) | |
858 | tags += 'latesttagdistance: %s\n' % dist |
|
855 | tags += 'latesttagdistance: %s\n' % dist | |
859 |
|
856 | |||
860 | return base + tags |
|
857 | return base + tags | |
861 |
|
858 | |||
862 | write('.hg_archival.txt', 0644, False, metadata) |
|
859 | write('.hg_archival.txt', 0644, False, metadata) | |
863 |
|
860 | |||
864 | for f in ctx: |
|
861 | for f in ctx: | |
865 | ff = ctx.flags(f) |
|
862 | ff = ctx.flags(f) | |
866 | getdata = ctx[f].data |
|
863 | getdata = ctx[f].data | |
867 | if lfutil.isstandin(f): |
|
864 | if lfutil.isstandin(f): | |
868 | path = lfutil.findfile(repo, getdata().strip()) |
|
865 | path = lfutil.findfile(repo, getdata().strip()) | |
869 | if path is None: |
|
866 | if path is None: | |
870 | raise util.Abort( |
|
867 | raise util.Abort( | |
871 | _('largefile %s not found in repo store or system cache') |
|
868 | _('largefile %s not found in repo store or system cache') | |
872 | % lfutil.splitstandin(f)) |
|
869 | % lfutil.splitstandin(f)) | |
873 | f = lfutil.splitstandin(f) |
|
870 | f = lfutil.splitstandin(f) | |
874 |
|
871 | |||
875 | def getdatafn(): |
|
872 | def getdatafn(): | |
876 | fd = None |
|
873 | fd = None | |
877 | try: |
|
874 | try: | |
878 | fd = open(path, 'rb') |
|
875 | fd = open(path, 'rb') | |
879 | return fd.read() |
|
876 | return fd.read() | |
880 | finally: |
|
877 | finally: | |
881 | if fd: |
|
878 | if fd: | |
882 | fd.close() |
|
879 | fd.close() | |
883 |
|
880 | |||
884 | getdata = getdatafn |
|
881 | getdata = getdatafn | |
885 | write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata) |
|
882 | write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata) | |
886 |
|
883 | |||
887 | if subrepos: |
|
884 | if subrepos: | |
888 | for subpath in sorted(ctx.substate): |
|
885 | for subpath in sorted(ctx.substate): | |
889 | sub = ctx.sub(subpath) |
|
886 | sub = ctx.sub(subpath) | |
890 | submatch = match_.narrowmatcher(subpath, matchfn) |
|
887 | submatch = match_.narrowmatcher(subpath, matchfn) | |
891 | sub.archive(repo.ui, archiver, prefix, submatch) |
|
888 | sub.archive(repo.ui, archiver, prefix, submatch) | |
892 |
|
889 | |||
893 | archiver.done() |
|
890 | archiver.done() | |
894 |
|
891 | |||
895 | def hgsubrepoarchive(orig, repo, ui, archiver, prefix, match=None): |
|
892 | def hgsubrepoarchive(orig, repo, ui, archiver, prefix, match=None): | |
896 | repo._get(repo._state + ('hg',)) |
|
893 | repo._get(repo._state + ('hg',)) | |
897 | rev = repo._state[1] |
|
894 | rev = repo._state[1] | |
898 | ctx = repo._repo[rev] |
|
895 | ctx = repo._repo[rev] | |
899 |
|
896 | |||
900 | lfcommands.cachelfiles(ui, repo._repo, ctx.node()) |
|
897 | lfcommands.cachelfiles(ui, repo._repo, ctx.node()) | |
901 |
|
898 | |||
902 | def write(name, mode, islink, getdata): |
|
899 | def write(name, mode, islink, getdata): | |
903 | # At this point, the standin has been replaced with the largefile name, |
|
900 | # At this point, the standin has been replaced with the largefile name, | |
904 | # so the normal matcher works here without the lfutil variants. |
|
901 | # so the normal matcher works here without the lfutil variants. | |
905 | if match and not match(f): |
|
902 | if match and not match(f): | |
906 | return |
|
903 | return | |
907 | data = getdata() |
|
904 | data = getdata() | |
908 |
|
905 | |||
909 | archiver.addfile(prefix + repo._path + '/' + name, mode, islink, data) |
|
906 | archiver.addfile(prefix + repo._path + '/' + name, mode, islink, data) | |
910 |
|
907 | |||
911 | for f in ctx: |
|
908 | for f in ctx: | |
912 | ff = ctx.flags(f) |
|
909 | ff = ctx.flags(f) | |
913 | getdata = ctx[f].data |
|
910 | getdata = ctx[f].data | |
914 | if lfutil.isstandin(f): |
|
911 | if lfutil.isstandin(f): | |
915 | path = lfutil.findfile(repo._repo, getdata().strip()) |
|
912 | path = lfutil.findfile(repo._repo, getdata().strip()) | |
916 | if path is None: |
|
913 | if path is None: | |
917 | raise util.Abort( |
|
914 | raise util.Abort( | |
918 | _('largefile %s not found in repo store or system cache') |
|
915 | _('largefile %s not found in repo store or system cache') | |
919 | % lfutil.splitstandin(f)) |
|
916 | % lfutil.splitstandin(f)) | |
920 | f = lfutil.splitstandin(f) |
|
917 | f = lfutil.splitstandin(f) | |
921 |
|
918 | |||
922 | def getdatafn(): |
|
919 | def getdatafn(): | |
923 | fd = None |
|
920 | fd = None | |
924 | try: |
|
921 | try: | |
925 | fd = open(os.path.join(prefix, path), 'rb') |
|
922 | fd = open(os.path.join(prefix, path), 'rb') | |
926 | return fd.read() |
|
923 | return fd.read() | |
927 | finally: |
|
924 | finally: | |
928 | if fd: |
|
925 | if fd: | |
929 | fd.close() |
|
926 | fd.close() | |
930 |
|
927 | |||
931 | getdata = getdatafn |
|
928 | getdata = getdatafn | |
932 |
|
929 | |||
933 | write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata) |
|
930 | write(f, 'x' in ff and 0755 or 0644, 'l' in ff, getdata) | |
934 |
|
931 | |||
935 | for subpath in sorted(ctx.substate): |
|
932 | for subpath in sorted(ctx.substate): | |
936 | sub = ctx.sub(subpath) |
|
933 | sub = ctx.sub(subpath) | |
937 | submatch = match_.narrowmatcher(subpath, match) |
|
934 | submatch = match_.narrowmatcher(subpath, match) | |
938 | sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/', |
|
935 | sub.archive(ui, archiver, os.path.join(prefix, repo._path) + '/', | |
939 | submatch) |
|
936 | submatch) | |
940 |
|
937 | |||
941 | # If a largefile is modified, the change is not reflected in its |
|
938 | # If a largefile is modified, the change is not reflected in its | |
942 | # standin until a commit. cmdutil.bailifchanged() raises an exception |
|
939 | # standin until a commit. cmdutil.bailifchanged() raises an exception | |
943 | # if the repo has uncommitted changes. Wrap it to also check if |
|
940 | # if the repo has uncommitted changes. Wrap it to also check if | |
944 | # largefiles were changed. This is used by bisect and backout. |
|
941 | # largefiles were changed. This is used by bisect and backout. | |
945 | def overridebailifchanged(orig, repo): |
|
942 | def overridebailifchanged(orig, repo): | |
946 | orig(repo) |
|
943 | orig(repo) | |
947 | repo.lfstatus = True |
|
944 | repo.lfstatus = True | |
948 | modified, added, removed, deleted = repo.status()[:4] |
|
945 | modified, added, removed, deleted = repo.status()[:4] | |
949 | repo.lfstatus = False |
|
946 | repo.lfstatus = False | |
950 | if modified or added or removed or deleted: |
|
947 | if modified or added or removed or deleted: | |
951 | raise util.Abort(_('outstanding uncommitted changes')) |
|
948 | raise util.Abort(_('outstanding uncommitted changes')) | |
952 |
|
949 | |||
953 | # Fetch doesn't use cmdutil.bailifchanged so override it to add the check |
|
950 | # Fetch doesn't use cmdutil.bailifchanged so override it to add the check | |
954 | def overridefetch(orig, ui, repo, *pats, **opts): |
|
951 | def overridefetch(orig, ui, repo, *pats, **opts): | |
955 | repo.lfstatus = True |
|
952 | repo.lfstatus = True | |
956 | modified, added, removed, deleted = repo.status()[:4] |
|
953 | modified, added, removed, deleted = repo.status()[:4] | |
957 | repo.lfstatus = False |
|
954 | repo.lfstatus = False | |
958 | if modified or added or removed or deleted: |
|
955 | if modified or added or removed or deleted: | |
959 | raise util.Abort(_('outstanding uncommitted changes')) |
|
956 | raise util.Abort(_('outstanding uncommitted changes')) | |
960 | return orig(ui, repo, *pats, **opts) |
|
957 | return orig(ui, repo, *pats, **opts) | |
961 |
|
958 | |||
962 | def overrideforget(orig, ui, repo, *pats, **opts): |
|
959 | def overrideforget(orig, ui, repo, *pats, **opts): | |
963 | installnormalfilesmatchfn(repo[None].manifest()) |
|
960 | installnormalfilesmatchfn(repo[None].manifest()) | |
964 | result = orig(ui, repo, *pats, **opts) |
|
961 | result = orig(ui, repo, *pats, **opts) | |
965 | restorematchfn() |
|
962 | restorematchfn() | |
966 | m = scmutil.match(repo[None], pats, opts) |
|
963 | m = scmutil.match(repo[None], pats, opts) | |
967 |
|
964 | |||
968 | try: |
|
965 | try: | |
969 | repo.lfstatus = True |
|
966 | repo.lfstatus = True | |
970 | s = repo.status(match=m, clean=True) |
|
967 | s = repo.status(match=m, clean=True) | |
971 | finally: |
|
968 | finally: | |
972 | repo.lfstatus = False |
|
969 | repo.lfstatus = False | |
973 | forget = sorted(s[0] + s[1] + s[3] + s[6]) |
|
970 | forget = sorted(s[0] + s[1] + s[3] + s[6]) | |
974 | forget = [f for f in forget if lfutil.standin(f) in repo[None].manifest()] |
|
971 | forget = [f for f in forget if lfutil.standin(f) in repo[None].manifest()] | |
975 |
|
972 | |||
976 | for f in forget: |
|
973 | for f in forget: | |
977 | if lfutil.standin(f) not in repo.dirstate and not \ |
|
974 | if lfutil.standin(f) not in repo.dirstate and not \ | |
978 | os.path.isdir(m.rel(lfutil.standin(f))): |
|
975 | os.path.isdir(m.rel(lfutil.standin(f))): | |
979 | ui.warn(_('not removing %s: file is already untracked\n') |
|
976 | ui.warn(_('not removing %s: file is already untracked\n') | |
980 | % m.rel(f)) |
|
977 | % m.rel(f)) | |
981 | result = 1 |
|
978 | result = 1 | |
982 |
|
979 | |||
983 | for f in forget: |
|
980 | for f in forget: | |
984 | if ui.verbose or not m.exact(f): |
|
981 | if ui.verbose or not m.exact(f): | |
985 | ui.status(_('removing %s\n') % m.rel(f)) |
|
982 | ui.status(_('removing %s\n') % m.rel(f)) | |
986 |
|
983 | |||
987 | # Need to lock because standin files are deleted then removed from the |
|
984 | # Need to lock because standin files are deleted then removed from the | |
988 | # repository and we could race in-between. |
|
985 | # repository and we could race in-between. | |
989 | wlock = repo.wlock() |
|
986 | wlock = repo.wlock() | |
990 | try: |
|
987 | try: | |
991 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
988 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
992 | for f in forget: |
|
989 | for f in forget: | |
993 | if lfdirstate[f] == 'a': |
|
990 | if lfdirstate[f] == 'a': | |
994 | lfdirstate.drop(f) |
|
991 | lfdirstate.drop(f) | |
995 | else: |
|
992 | else: | |
996 | lfdirstate.remove(f) |
|
993 | lfdirstate.remove(f) | |
997 | lfdirstate.write() |
|
994 | lfdirstate.write() | |
998 | standins = [lfutil.standin(f) for f in forget] |
|
995 | standins = [lfutil.standin(f) for f in forget] | |
999 | for f in standins: |
|
996 | for f in standins: | |
1000 | util.unlinkpath(repo.wjoin(f), ignoremissing=True) |
|
997 | util.unlinkpath(repo.wjoin(f), ignoremissing=True) | |
1001 | repo[None].forget(standins) |
|
998 | repo[None].forget(standins) | |
1002 | finally: |
|
999 | finally: | |
1003 | wlock.release() |
|
1000 | wlock.release() | |
1004 |
|
1001 | |||
1005 | return result |
|
1002 | return result | |
1006 |
|
1003 | |||
1007 | def getoutgoinglfiles(ui, repo, dest=None, **opts): |
|
1004 | def getoutgoinglfiles(ui, repo, dest=None, **opts): | |
1008 | dest = ui.expandpath(dest or 'default-push', dest or 'default') |
|
1005 | dest = ui.expandpath(dest or 'default-push', dest or 'default') | |
1009 | dest, branches = hg.parseurl(dest, opts.get('branch')) |
|
1006 | dest, branches = hg.parseurl(dest, opts.get('branch')) | |
1010 | revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev')) |
|
1007 | revs, checkout = hg.addbranchrevs(repo, repo, branches, opts.get('rev')) | |
1011 | if revs: |
|
1008 | if revs: | |
1012 | revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)] |
|
1009 | revs = [repo.lookup(rev) for rev in scmutil.revrange(repo, revs)] | |
1013 |
|
1010 | |||
1014 | try: |
|
1011 | try: | |
1015 | remote = hg.peer(repo, opts, dest) |
|
1012 | remote = hg.peer(repo, opts, dest) | |
1016 | except error.RepoError: |
|
1013 | except error.RepoError: | |
1017 | return None |
|
1014 | return None | |
1018 | outgoing = discovery.findcommonoutgoing(repo, remote.peer(), force=False) |
|
1015 | outgoing = discovery.findcommonoutgoing(repo, remote.peer(), force=False) | |
1019 | if not outgoing.missing: |
|
1016 | if not outgoing.missing: | |
1020 | return outgoing.missing |
|
1017 | return outgoing.missing | |
1021 | o = repo.changelog.nodesbetween(outgoing.missing, revs)[0] |
|
1018 | o = repo.changelog.nodesbetween(outgoing.missing, revs)[0] | |
1022 | if opts.get('newest_first'): |
|
1019 | if opts.get('newest_first'): | |
1023 | o.reverse() |
|
1020 | o.reverse() | |
1024 |
|
1021 | |||
1025 | toupload = set() |
|
1022 | toupload = set() | |
1026 | for n in o: |
|
1023 | for n in o: | |
1027 | parents = [p for p in repo.changelog.parents(n) if p != node.nullid] |
|
1024 | parents = [p for p in repo.changelog.parents(n) if p != node.nullid] | |
1028 | ctx = repo[n] |
|
1025 | ctx = repo[n] | |
1029 | files = set(ctx.files()) |
|
1026 | files = set(ctx.files()) | |
1030 | if len(parents) == 2: |
|
1027 | if len(parents) == 2: | |
1031 | mc = ctx.manifest() |
|
1028 | mc = ctx.manifest() | |
1032 | mp1 = ctx.parents()[0].manifest() |
|
1029 | mp1 = ctx.parents()[0].manifest() | |
1033 | mp2 = ctx.parents()[1].manifest() |
|
1030 | mp2 = ctx.parents()[1].manifest() | |
1034 | for f in mp1: |
|
1031 | for f in mp1: | |
1035 | if f not in mc: |
|
1032 | if f not in mc: | |
1036 | files.add(f) |
|
1033 | files.add(f) | |
1037 | for f in mp2: |
|
1034 | for f in mp2: | |
1038 | if f not in mc: |
|
1035 | if f not in mc: | |
1039 | files.add(f) |
|
1036 | files.add(f) | |
1040 | for f in mc: |
|
1037 | for f in mc: | |
1041 | if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None): |
|
1038 | if mc[f] != mp1.get(f, None) or mc[f] != mp2.get(f, None): | |
1042 | files.add(f) |
|
1039 | files.add(f) | |
1043 | toupload = toupload.union( |
|
1040 | toupload = toupload.union( | |
1044 | set([f for f in files if lfutil.isstandin(f) and f in ctx])) |
|
1041 | set([f for f in files if lfutil.isstandin(f) and f in ctx])) | |
1045 | return sorted(toupload) |
|
1042 | return sorted(toupload) | |
1046 |
|
1043 | |||
1047 | def overrideoutgoing(orig, ui, repo, dest=None, **opts): |
|
1044 | def overrideoutgoing(orig, ui, repo, dest=None, **opts): | |
1048 | result = orig(ui, repo, dest, **opts) |
|
1045 | result = orig(ui, repo, dest, **opts) | |
1049 |
|
1046 | |||
1050 | if opts.pop('large', None): |
|
1047 | if opts.pop('large', None): | |
1051 | toupload = getoutgoinglfiles(ui, repo, dest, **opts) |
|
1048 | toupload = getoutgoinglfiles(ui, repo, dest, **opts) | |
1052 | if toupload is None: |
|
1049 | if toupload is None: | |
1053 | ui.status(_('largefiles: No remote repo\n')) |
|
1050 | ui.status(_('largefiles: No remote repo\n')) | |
1054 | elif not toupload: |
|
1051 | elif not toupload: | |
1055 | ui.status(_('largefiles: no files to upload\n')) |
|
1052 | ui.status(_('largefiles: no files to upload\n')) | |
1056 | else: |
|
1053 | else: | |
1057 | ui.status(_('largefiles to upload:\n')) |
|
1054 | ui.status(_('largefiles to upload:\n')) | |
1058 | for file in toupload: |
|
1055 | for file in toupload: | |
1059 | ui.status(lfutil.splitstandin(file) + '\n') |
|
1056 | ui.status(lfutil.splitstandin(file) + '\n') | |
1060 | ui.status('\n') |
|
1057 | ui.status('\n') | |
1061 |
|
1058 | |||
1062 | return result |
|
1059 | return result | |
1063 |
|
1060 | |||
1064 | def overridesummary(orig, ui, repo, *pats, **opts): |
|
1061 | def overridesummary(orig, ui, repo, *pats, **opts): | |
1065 | try: |
|
1062 | try: | |
1066 | repo.lfstatus = True |
|
1063 | repo.lfstatus = True | |
1067 | orig(ui, repo, *pats, **opts) |
|
1064 | orig(ui, repo, *pats, **opts) | |
1068 | finally: |
|
1065 | finally: | |
1069 | repo.lfstatus = False |
|
1066 | repo.lfstatus = False | |
1070 |
|
1067 | |||
1071 | if opts.pop('large', None): |
|
1068 | if opts.pop('large', None): | |
1072 | toupload = getoutgoinglfiles(ui, repo, None, **opts) |
|
1069 | toupload = getoutgoinglfiles(ui, repo, None, **opts) | |
1073 | if toupload is None: |
|
1070 | if toupload is None: | |
1074 | # i18n: column positioning for "hg summary" |
|
1071 | # i18n: column positioning for "hg summary" | |
1075 | ui.status(_('largefiles: (no remote repo)\n')) |
|
1072 | ui.status(_('largefiles: (no remote repo)\n')) | |
1076 | elif not toupload: |
|
1073 | elif not toupload: | |
1077 | # i18n: column positioning for "hg summary" |
|
1074 | # i18n: column positioning for "hg summary" | |
1078 | ui.status(_('largefiles: (no files to upload)\n')) |
|
1075 | ui.status(_('largefiles: (no files to upload)\n')) | |
1079 | else: |
|
1076 | else: | |
1080 | # i18n: column positioning for "hg summary" |
|
1077 | # i18n: column positioning for "hg summary" | |
1081 | ui.status(_('largefiles: %d to upload\n') % len(toupload)) |
|
1078 | ui.status(_('largefiles: %d to upload\n') % len(toupload)) | |
1082 |
|
1079 | |||
1083 | def scmutiladdremove(orig, repo, pats=[], opts={}, dry_run=None, |
|
1080 | def scmutiladdremove(orig, repo, pats=[], opts={}, dry_run=None, | |
1084 | similarity=None): |
|
1081 | similarity=None): | |
1085 | if not lfutil.islfilesrepo(repo): |
|
1082 | if not lfutil.islfilesrepo(repo): | |
1086 | return orig(repo, pats, opts, dry_run, similarity) |
|
1083 | return orig(repo, pats, opts, dry_run, similarity) | |
1087 | # Get the list of missing largefiles so we can remove them |
|
1084 | # Get the list of missing largefiles so we can remove them | |
1088 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) |
|
1085 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) | |
1089 | s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False, |
|
1086 | s = lfdirstate.status(match_.always(repo.root, repo.getcwd()), [], False, | |
1090 | False, False) |
|
1087 | False, False) | |
1091 | (unsure, modified, added, removed, missing, unknown, ignored, clean) = s |
|
1088 | (unsure, modified, added, removed, missing, unknown, ignored, clean) = s | |
1092 |
|
1089 | |||
1093 | # Call into the normal remove code, but the removing of the standin, we want |
|
1090 | # Call into the normal remove code, but the removing of the standin, we want | |
1094 | # to have handled by original addremove. Monkey patching here makes sure |
|
1091 | # to have handled by original addremove. Monkey patching here makes sure | |
1095 | # we don't remove the standin in the largefiles code, preventing a very |
|
1092 | # we don't remove the standin in the largefiles code, preventing a very | |
1096 | # confused state later. |
|
1093 | # confused state later. | |
1097 | if missing: |
|
1094 | if missing: | |
1098 | m = [repo.wjoin(f) for f in missing] |
|
1095 | m = [repo.wjoin(f) for f in missing] | |
1099 | repo._isaddremove = True |
|
1096 | repo._isaddremove = True | |
1100 | removelargefiles(repo.ui, repo, *m, **opts) |
|
1097 | removelargefiles(repo.ui, repo, *m, **opts) | |
1101 | repo._isaddremove = False |
|
1098 | repo._isaddremove = False | |
1102 | # Call into the normal add code, and any files that *should* be added as |
|
1099 | # Call into the normal add code, and any files that *should* be added as | |
1103 | # largefiles will be |
|
1100 | # largefiles will be | |
1104 | addlargefiles(repo.ui, repo, *pats, **opts) |
|
1101 | addlargefiles(repo.ui, repo, *pats, **opts) | |
1105 | # Now that we've handled largefiles, hand off to the original addremove |
|
1102 | # Now that we've handled largefiles, hand off to the original addremove | |
1106 | # function to take care of the rest. Make sure it doesn't do anything with |
|
1103 | # function to take care of the rest. Make sure it doesn't do anything with | |
1107 | # largefiles by installing a matcher that will ignore them. |
|
1104 | # largefiles by installing a matcher that will ignore them. | |
1108 | installnormalfilesmatchfn(repo[None].manifest()) |
|
1105 | installnormalfilesmatchfn(repo[None].manifest()) | |
1109 | result = orig(repo, pats, opts, dry_run, similarity) |
|
1106 | result = orig(repo, pats, opts, dry_run, similarity) | |
1110 | restorematchfn() |
|
1107 | restorematchfn() | |
1111 | return result |
|
1108 | return result | |
1112 |
|
1109 | |||
1113 | # Calling purge with --all will cause the largefiles to be deleted. |
|
1110 | # Calling purge with --all will cause the largefiles to be deleted. | |
1114 | # Override repo.status to prevent this from happening. |
|
1111 | # Override repo.status to prevent this from happening. | |
1115 | def overridepurge(orig, ui, repo, *dirs, **opts): |
|
1112 | def overridepurge(orig, ui, repo, *dirs, **opts): | |
1116 | # XXX large file status is buggy when used on repo proxy. |
|
1113 | # XXX large file status is buggy when used on repo proxy. | |
1117 | # XXX this needs to be investigate. |
|
1114 | # XXX this needs to be investigate. | |
1118 | repo = repo.unfiltered() |
|
1115 | repo = repo.unfiltered() | |
1119 | oldstatus = repo.status |
|
1116 | oldstatus = repo.status | |
1120 | def overridestatus(node1='.', node2=None, match=None, ignored=False, |
|
1117 | def overridestatus(node1='.', node2=None, match=None, ignored=False, | |
1121 | clean=False, unknown=False, listsubrepos=False): |
|
1118 | clean=False, unknown=False, listsubrepos=False): | |
1122 | r = oldstatus(node1, node2, match, ignored, clean, unknown, |
|
1119 | r = oldstatus(node1, node2, match, ignored, clean, unknown, | |
1123 | listsubrepos) |
|
1120 | listsubrepos) | |
1124 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
1121 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
1125 | modified, added, removed, deleted, unknown, ignored, clean = r |
|
1122 | modified, added, removed, deleted, unknown, ignored, clean = r | |
1126 | unknown = [f for f in unknown if lfdirstate[f] == '?'] |
|
1123 | unknown = [f for f in unknown if lfdirstate[f] == '?'] | |
1127 | ignored = [f for f in ignored if lfdirstate[f] == '?'] |
|
1124 | ignored = [f for f in ignored if lfdirstate[f] == '?'] | |
1128 | return modified, added, removed, deleted, unknown, ignored, clean |
|
1125 | return modified, added, removed, deleted, unknown, ignored, clean | |
1129 | repo.status = overridestatus |
|
1126 | repo.status = overridestatus | |
1130 | orig(ui, repo, *dirs, **opts) |
|
1127 | orig(ui, repo, *dirs, **opts) | |
1131 | repo.status = oldstatus |
|
1128 | repo.status = oldstatus | |
1132 |
|
1129 | |||
1133 | def overriderollback(orig, ui, repo, **opts): |
|
1130 | def overriderollback(orig, ui, repo, **opts): | |
1134 | result = orig(ui, repo, **opts) |
|
1131 | result = orig(ui, repo, **opts) | |
1135 | merge.update(repo, node=None, branchmerge=False, force=True, |
|
1132 | merge.update(repo, node=None, branchmerge=False, force=True, | |
1136 | partial=lfutil.isstandin) |
|
1133 | partial=lfutil.isstandin) | |
1137 | wlock = repo.wlock() |
|
1134 | wlock = repo.wlock() | |
1138 | try: |
|
1135 | try: | |
1139 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
1136 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
1140 | lfiles = lfutil.listlfiles(repo) |
|
1137 | lfiles = lfutil.listlfiles(repo) | |
1141 | oldlfiles = lfutil.listlfiles(repo, repo[None].parents()[0].rev()) |
|
1138 | oldlfiles = lfutil.listlfiles(repo, repo[None].parents()[0].rev()) | |
1142 | for file in lfiles: |
|
1139 | for file in lfiles: | |
1143 | if file in oldlfiles: |
|
1140 | if file in oldlfiles: | |
1144 | lfdirstate.normallookup(file) |
|
1141 | lfdirstate.normallookup(file) | |
1145 | else: |
|
1142 | else: | |
1146 | lfdirstate.add(file) |
|
1143 | lfdirstate.add(file) | |
1147 | lfdirstate.write() |
|
1144 | lfdirstate.write() | |
1148 | finally: |
|
1145 | finally: | |
1149 | wlock.release() |
|
1146 | wlock.release() | |
1150 | return result |
|
1147 | return result | |
1151 |
|
1148 | |||
1152 | def overridetransplant(orig, ui, repo, *revs, **opts): |
|
1149 | def overridetransplant(orig, ui, repo, *revs, **opts): | |
1153 | try: |
|
1150 | try: | |
1154 | oldstandins = lfutil.getstandinsstate(repo) |
|
1151 | oldstandins = lfutil.getstandinsstate(repo) | |
1155 | repo._istransplanting = True |
|
1152 | repo._istransplanting = True | |
1156 | result = orig(ui, repo, *revs, **opts) |
|
1153 | result = orig(ui, repo, *revs, **opts) | |
1157 | newstandins = lfutil.getstandinsstate(repo) |
|
1154 | newstandins = lfutil.getstandinsstate(repo) | |
1158 | filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) |
|
1155 | filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) | |
1159 | lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, |
|
1156 | lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, | |
1160 | printmessage=True) |
|
1157 | printmessage=True) | |
1161 | finally: |
|
1158 | finally: | |
1162 | repo._istransplanting = False |
|
1159 | repo._istransplanting = False | |
1163 | return result |
|
1160 | return result | |
1164 |
|
1161 | |||
1165 | def overridecat(orig, ui, repo, file1, *pats, **opts): |
|
1162 | def overridecat(orig, ui, repo, file1, *pats, **opts): | |
1166 | ctx = scmutil.revsingle(repo, opts.get('rev')) |
|
1163 | ctx = scmutil.revsingle(repo, opts.get('rev')) | |
1167 | err = 1 |
|
1164 | err = 1 | |
1168 | notbad = set() |
|
1165 | notbad = set() | |
1169 | m = scmutil.match(ctx, (file1,) + pats, opts) |
|
1166 | m = scmutil.match(ctx, (file1,) + pats, opts) | |
1170 | origmatchfn = m.matchfn |
|
1167 | origmatchfn = m.matchfn | |
1171 | def lfmatchfn(f): |
|
1168 | def lfmatchfn(f): | |
1172 | lf = lfutil.splitstandin(f) |
|
1169 | lf = lfutil.splitstandin(f) | |
1173 | if lf is None: |
|
1170 | if lf is None: | |
1174 | return origmatchfn(f) |
|
1171 | return origmatchfn(f) | |
1175 | notbad.add(lf) |
|
1172 | notbad.add(lf) | |
1176 | return origmatchfn(lf) |
|
1173 | return origmatchfn(lf) | |
1177 | m.matchfn = lfmatchfn |
|
1174 | m.matchfn = lfmatchfn | |
1178 | origbadfn = m.bad |
|
1175 | origbadfn = m.bad | |
1179 | def lfbadfn(f, msg): |
|
1176 | def lfbadfn(f, msg): | |
1180 | if not f in notbad: |
|
1177 | if not f in notbad: | |
1181 | return origbadfn(f, msg) |
|
1178 | return origbadfn(f, msg) | |
1182 | m.bad = lfbadfn |
|
1179 | m.bad = lfbadfn | |
1183 | for f in ctx.walk(m): |
|
1180 | for f in ctx.walk(m): | |
1184 | fp = cmdutil.makefileobj(repo, opts.get('output'), ctx.node(), |
|
1181 | fp = cmdutil.makefileobj(repo, opts.get('output'), ctx.node(), | |
1185 | pathname=f) |
|
1182 | pathname=f) | |
1186 | lf = lfutil.splitstandin(f) |
|
1183 | lf = lfutil.splitstandin(f) | |
1187 | if lf is None: |
|
1184 | if lf is None: | |
1188 | # duplicating unreachable code from commands.cat |
|
1185 | # duplicating unreachable code from commands.cat | |
1189 | data = ctx[f].data() |
|
1186 | data = ctx[f].data() | |
1190 | if opts.get('decode'): |
|
1187 | if opts.get('decode'): | |
1191 | data = repo.wwritedata(f, data) |
|
1188 | data = repo.wwritedata(f, data) | |
1192 | fp.write(data) |
|
1189 | fp.write(data) | |
1193 | else: |
|
1190 | else: | |
1194 | hash = lfutil.readstandin(repo, lf, ctx.rev()) |
|
1191 | hash = lfutil.readstandin(repo, lf, ctx.rev()) | |
1195 | if not lfutil.inusercache(repo.ui, hash): |
|
1192 | if not lfutil.inusercache(repo.ui, hash): | |
1196 | store = basestore._openstore(repo) |
|
1193 | store = basestore._openstore(repo) | |
1197 | success, missing = store.get([(lf, hash)]) |
|
1194 | success, missing = store.get([(lf, hash)]) | |
1198 | if len(success) != 1: |
|
1195 | if len(success) != 1: | |
1199 | raise util.Abort( |
|
1196 | raise util.Abort( | |
1200 | _('largefile %s is not in cache and could not be ' |
|
1197 | _('largefile %s is not in cache and could not be ' | |
1201 | 'downloaded') % lf) |
|
1198 | 'downloaded') % lf) | |
1202 | path = lfutil.usercachepath(repo.ui, hash) |
|
1199 | path = lfutil.usercachepath(repo.ui, hash) | |
1203 | fpin = open(path, "rb") |
|
1200 | fpin = open(path, "rb") | |
1204 | for chunk in lfutil.blockstream(fpin): |
|
1201 | for chunk in lfutil.blockstream(fpin): | |
1205 | fp.write(chunk) |
|
1202 | fp.write(chunk) | |
1206 | fpin.close() |
|
1203 | fpin.close() | |
1207 | fp.close() |
|
1204 | fp.close() | |
1208 | err = 0 |
|
1205 | err = 0 | |
1209 | return err |
|
1206 | return err | |
1210 |
|
1207 | |||
1211 | def mercurialsinkbefore(orig, sink): |
|
1208 | def mercurialsinkbefore(orig, sink): | |
1212 | sink.repo._isconverting = True |
|
1209 | sink.repo._isconverting = True | |
1213 | orig(sink) |
|
1210 | orig(sink) | |
1214 |
|
1211 | |||
1215 | def mercurialsinkafter(orig, sink): |
|
1212 | def mercurialsinkafter(orig, sink): | |
1216 | sink.repo._isconverting = False |
|
1213 | sink.repo._isconverting = False | |
1217 | orig(sink) |
|
1214 | orig(sink) |
@@ -1,2217 +1,2216 b'' | |||||
1 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE |
|
1 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE | |
2 | $ mkdir "${USERCACHE}" |
|
2 | $ mkdir "${USERCACHE}" | |
3 | $ cat >> $HGRCPATH <<EOF |
|
3 | $ cat >> $HGRCPATH <<EOF | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > largefiles= |
|
5 | > largefiles= | |
6 | > purge= |
|
6 | > purge= | |
7 | > rebase= |
|
7 | > rebase= | |
8 | > transplant= |
|
8 | > transplant= | |
9 | > [phases] |
|
9 | > [phases] | |
10 | > publish=False |
|
10 | > publish=False | |
11 | > [largefiles] |
|
11 | > [largefiles] | |
12 | > minsize=2 |
|
12 | > minsize=2 | |
13 | > patterns=glob:**.dat |
|
13 | > patterns=glob:**.dat | |
14 | > usercache=${USERCACHE} |
|
14 | > usercache=${USERCACHE} | |
15 | > [hooks] |
|
15 | > [hooks] | |
16 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" |
|
16 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" | |
17 | > EOF |
|
17 | > EOF | |
18 |
|
18 | |||
19 | Create the repo with a couple of revisions of both large and normal |
|
19 | Create the repo with a couple of revisions of both large and normal | |
20 | files. |
|
20 | files. | |
21 | Test status and dirstate of largefiles and that summary output is correct. |
|
21 | Test status and dirstate of largefiles and that summary output is correct. | |
22 |
|
22 | |||
23 | $ hg init a |
|
23 | $ hg init a | |
24 | $ cd a |
|
24 | $ cd a | |
25 | $ mkdir sub |
|
25 | $ mkdir sub | |
26 | $ echo normal1 > normal1 |
|
26 | $ echo normal1 > normal1 | |
27 | $ echo normal2 > sub/normal2 |
|
27 | $ echo normal2 > sub/normal2 | |
28 | $ echo large1 > large1 |
|
28 | $ echo large1 > large1 | |
29 | $ echo large2 > sub/large2 |
|
29 | $ echo large2 > sub/large2 | |
30 | $ hg add normal1 sub/normal2 |
|
30 | $ hg add normal1 sub/normal2 | |
31 | $ hg add --large large1 sub/large2 |
|
31 | $ hg add --large large1 sub/large2 | |
32 | $ hg commit -m "add files" |
|
32 | $ hg commit -m "add files" | |
33 | Invoking status precommit hook |
|
33 | Invoking status precommit hook | |
34 | A large1 |
|
34 | A large1 | |
35 | A normal1 |
|
35 | A normal1 | |
36 | A sub/large2 |
|
36 | A sub/large2 | |
37 | A sub/normal2 |
|
37 | A sub/normal2 | |
38 | $ touch large1 sub/large2 |
|
38 | $ touch large1 sub/large2 | |
39 | $ sleep 1 |
|
39 | $ sleep 1 | |
40 | $ hg st |
|
40 | $ hg st | |
41 | $ hg debugstate --nodates |
|
41 | $ hg debugstate --nodates | |
42 | n 644 41 .hglf/large1 |
|
42 | n 644 41 .hglf/large1 | |
43 | n 644 41 .hglf/sub/large2 |
|
43 | n 644 41 .hglf/sub/large2 | |
44 | n 644 8 normal1 |
|
44 | n 644 8 normal1 | |
45 | n 644 8 sub/normal2 |
|
45 | n 644 8 sub/normal2 | |
46 | $ hg debugstate --large |
|
46 | $ hg debugstate --large | |
47 | n 644 7 large1 |
|
47 | n 644 7 large1 | |
48 | n 644 7 sub/large2 |
|
48 | n 644 7 sub/large2 | |
49 | $ echo normal11 > normal1 |
|
49 | $ echo normal11 > normal1 | |
50 | $ echo normal22 > sub/normal2 |
|
50 | $ echo normal22 > sub/normal2 | |
51 | $ echo large11 > large1 |
|
51 | $ echo large11 > large1 | |
52 | $ echo large22 > sub/large2 |
|
52 | $ echo large22 > sub/large2 | |
53 | $ hg commit -m "edit files" |
|
53 | $ hg commit -m "edit files" | |
54 | Invoking status precommit hook |
|
54 | Invoking status precommit hook | |
55 | M large1 |
|
55 | M large1 | |
56 | M normal1 |
|
56 | M normal1 | |
57 | M sub/large2 |
|
57 | M sub/large2 | |
58 | M sub/normal2 |
|
58 | M sub/normal2 | |
59 | $ hg sum --large |
|
59 | $ hg sum --large | |
60 | parent: 1:ce8896473775 tip |
|
60 | parent: 1:ce8896473775 tip | |
61 | edit files |
|
61 | edit files | |
62 | branch: default |
|
62 | branch: default | |
63 | commit: (clean) |
|
63 | commit: (clean) | |
64 | update: (current) |
|
64 | update: (current) | |
65 | largefiles: (no remote repo) |
|
65 | largefiles: (no remote repo) | |
66 |
|
66 | |||
67 | Commit preserved largefile contents. |
|
67 | Commit preserved largefile contents. | |
68 |
|
68 | |||
69 | $ cat normal1 |
|
69 | $ cat normal1 | |
70 | normal11 |
|
70 | normal11 | |
71 | $ cat large1 |
|
71 | $ cat large1 | |
72 | large11 |
|
72 | large11 | |
73 | $ cat sub/normal2 |
|
73 | $ cat sub/normal2 | |
74 | normal22 |
|
74 | normal22 | |
75 | $ cat sub/large2 |
|
75 | $ cat sub/large2 | |
76 | large22 |
|
76 | large22 | |
77 |
|
77 | |||
78 | Test status, subdir and unknown files |
|
78 | Test status, subdir and unknown files | |
79 |
|
79 | |||
80 | $ echo unknown > sub/unknown |
|
80 | $ echo unknown > sub/unknown | |
81 | $ hg st --all |
|
81 | $ hg st --all | |
82 | ? sub/unknown |
|
82 | ? sub/unknown | |
83 | C large1 |
|
83 | C large1 | |
84 | C normal1 |
|
84 | C normal1 | |
85 | C sub/large2 |
|
85 | C sub/large2 | |
86 | C sub/normal2 |
|
86 | C sub/normal2 | |
87 | $ hg st --all sub |
|
87 | $ hg st --all sub | |
88 | ? sub/unknown |
|
88 | ? sub/unknown | |
89 | C sub/large2 |
|
89 | C sub/large2 | |
90 | C sub/normal2 |
|
90 | C sub/normal2 | |
91 | $ rm sub/unknown |
|
91 | $ rm sub/unknown | |
92 |
|
92 | |||
93 | Test messages and exit codes for remove warning cases |
|
93 | Test messages and exit codes for remove warning cases | |
94 |
|
94 | |||
95 | $ hg remove -A large1 |
|
95 | $ hg remove -A large1 | |
96 | not removing large1: file still exists |
|
96 | not removing large1: file still exists | |
97 | [1] |
|
97 | [1] | |
98 | $ echo 'modified' > large1 |
|
98 | $ echo 'modified' > large1 | |
99 | $ hg remove large1 |
|
99 | $ hg remove large1 | |
100 | not removing large1: file is modified (use -f to force removal) |
|
100 | not removing large1: file is modified (use -f to force removal) | |
101 | [1] |
|
101 | [1] | |
102 | $ echo 'new' > normalnew |
|
102 | $ echo 'new' > normalnew | |
103 | $ hg add normalnew |
|
103 | $ hg add normalnew | |
104 | $ echo 'new' > largenew |
|
104 | $ echo 'new' > largenew | |
105 | $ hg add --large normalnew |
|
105 | $ hg add --large normalnew | |
106 | normalnew already tracked! |
|
106 | normalnew already tracked! | |
107 | $ hg remove normalnew largenew |
|
107 | $ hg remove normalnew largenew | |
108 | not removing largenew: file is untracked |
|
108 | not removing largenew: file is untracked | |
109 | not removing normalnew: file has been marked for add (use forget to undo) |
|
109 | not removing normalnew: file has been marked for add (use forget to undo) | |
110 | [1] |
|
110 | [1] | |
111 | $ rm normalnew largenew |
|
111 | $ rm normalnew largenew | |
112 | $ hg up -Cq |
|
112 | $ hg up -Cq | |
113 |
|
113 | |||
114 | Remove both largefiles and normal files. |
|
114 | Remove both largefiles and normal files. | |
115 |
|
115 | |||
116 | $ hg remove normal1 large1 |
|
116 | $ hg remove normal1 large1 | |
117 | $ hg status large1 |
|
117 | $ hg status large1 | |
118 | R large1 |
|
118 | R large1 | |
119 | $ hg commit -m "remove files" |
|
119 | $ hg commit -m "remove files" | |
120 | Invoking status precommit hook |
|
120 | Invoking status precommit hook | |
121 | R large1 |
|
121 | R large1 | |
122 | R normal1 |
|
122 | R normal1 | |
123 | $ ls |
|
123 | $ ls | |
124 | sub |
|
124 | sub | |
125 | $ echo "testlargefile" > large1-test |
|
125 | $ echo "testlargefile" > large1-test | |
126 | $ hg add --large large1-test |
|
126 | $ hg add --large large1-test | |
127 | $ hg st |
|
127 | $ hg st | |
128 | A large1-test |
|
128 | A large1-test | |
129 | $ hg rm large1-test |
|
129 | $ hg rm large1-test | |
130 | not removing large1-test: file has been marked for add (use forget to undo) |
|
130 | not removing large1-test: file has been marked for add (use forget to undo) | |
131 | [1] |
|
131 | [1] | |
132 | $ hg st |
|
132 | $ hg st | |
133 | A large1-test |
|
133 | A large1-test | |
134 | $ hg forget large1-test |
|
134 | $ hg forget large1-test | |
135 | $ hg st |
|
135 | $ hg st | |
136 | ? large1-test |
|
136 | ? large1-test | |
137 | $ hg remove large1-test |
|
137 | $ hg remove large1-test | |
138 | not removing large1-test: file is untracked |
|
138 | not removing large1-test: file is untracked | |
139 | [1] |
|
139 | [1] | |
140 | $ hg forget large1-test |
|
140 | $ hg forget large1-test | |
141 | not removing large1-test: file is already untracked |
|
141 | not removing large1-test: file is already untracked | |
142 | [1] |
|
142 | [1] | |
143 | $ rm large1-test |
|
143 | $ rm large1-test | |
144 |
|
144 | |||
145 | Copy both largefiles and normal files (testing that status output is correct). |
|
145 | Copy both largefiles and normal files (testing that status output is correct). | |
146 |
|
146 | |||
147 | $ hg cp sub/normal2 normal1 |
|
147 | $ hg cp sub/normal2 normal1 | |
148 | $ hg cp sub/large2 large1 |
|
148 | $ hg cp sub/large2 large1 | |
149 | $ hg commit -m "copy files" |
|
149 | $ hg commit -m "copy files" | |
150 | Invoking status precommit hook |
|
150 | Invoking status precommit hook | |
151 | A large1 |
|
151 | A large1 | |
152 | A normal1 |
|
152 | A normal1 | |
153 | $ cat normal1 |
|
153 | $ cat normal1 | |
154 | normal22 |
|
154 | normal22 | |
155 | $ cat large1 |
|
155 | $ cat large1 | |
156 | large22 |
|
156 | large22 | |
157 |
|
157 | |||
158 | Test moving largefiles and verify that normal files are also unaffected. |
|
158 | Test moving largefiles and verify that normal files are also unaffected. | |
159 |
|
159 | |||
160 | $ hg mv normal1 normal3 |
|
160 | $ hg mv normal1 normal3 | |
161 | $ hg mv large1 large3 |
|
161 | $ hg mv large1 large3 | |
162 | $ hg mv sub/normal2 sub/normal4 |
|
162 | $ hg mv sub/normal2 sub/normal4 | |
163 | $ hg mv sub/large2 sub/large4 |
|
163 | $ hg mv sub/large2 sub/large4 | |
164 | $ hg commit -m "move files" |
|
164 | $ hg commit -m "move files" | |
165 | Invoking status precommit hook |
|
165 | Invoking status precommit hook | |
166 | A large3 |
|
166 | A large3 | |
167 | A normal3 |
|
167 | A normal3 | |
168 | A sub/large4 |
|
168 | A sub/large4 | |
169 | A sub/normal4 |
|
169 | A sub/normal4 | |
170 | R large1 |
|
170 | R large1 | |
171 | R normal1 |
|
171 | R normal1 | |
172 | R sub/large2 |
|
172 | R sub/large2 | |
173 | R sub/normal2 |
|
173 | R sub/normal2 | |
174 | $ cat normal3 |
|
174 | $ cat normal3 | |
175 | normal22 |
|
175 | normal22 | |
176 | $ cat large3 |
|
176 | $ cat large3 | |
177 | large22 |
|
177 | large22 | |
178 | $ cat sub/normal4 |
|
178 | $ cat sub/normal4 | |
179 | normal22 |
|
179 | normal22 | |
180 | $ cat sub/large4 |
|
180 | $ cat sub/large4 | |
181 | large22 |
|
181 | large22 | |
182 |
|
182 | |||
183 | Test repo method wrapping detection |
|
183 | Test repo method wrapping detection | |
184 |
|
184 | |||
185 | $ cat > $TESTTMP/wrapping1.py <<EOF |
|
185 | $ cat > $TESTTMP/wrapping1.py <<EOF | |
186 | > from hgext import largefiles |
|
186 | > from hgext import largefiles | |
187 | > def reposetup(ui, repo): |
|
187 | > def reposetup(ui, repo): | |
188 | > class derived(repo.__class__): |
|
188 | > class derived(repo.__class__): | |
189 | > def push(self, *args, **kwargs): |
|
189 | > def push(self, *args, **kwargs): | |
190 | > return super(derived, self).push(*args, **kwargs) |
|
190 | > return super(derived, self).push(*args, **kwargs) | |
191 | > repo.__class__ = derived |
|
191 | > repo.__class__ = derived | |
192 | > largefiles.reposetup(ui, repo) |
|
192 | > largefiles.reposetup(ui, repo) | |
193 | > uisetup = largefiles.uisetup |
|
193 | > uisetup = largefiles.uisetup | |
194 | > EOF |
|
194 | > EOF | |
195 | $ hg --config extensions.largefiles=$TESTTMP/wrapping1.py status |
|
195 | $ hg --config extensions.largefiles=$TESTTMP/wrapping1.py status | |
196 | largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly |
|
196 | largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly | |
197 |
|
197 | |||
198 | $ cat > $TESTTMP/wrapping2.py <<EOF |
|
198 | $ cat > $TESTTMP/wrapping2.py <<EOF | |
199 | > from hgext import largefiles |
|
199 | > from hgext import largefiles | |
200 | > def reposetup(ui, repo): |
|
200 | > def reposetup(ui, repo): | |
201 | > orgpush = repo.push |
|
201 | > orgpush = repo.push | |
202 | > def push(*args, **kwargs): |
|
202 | > def push(*args, **kwargs): | |
203 | > return orgpush(*args, **kwargs) |
|
203 | > return orgpush(*args, **kwargs) | |
204 | > repo.push = push |
|
204 | > repo.push = push | |
205 | > largefiles.reposetup(ui, repo) |
|
205 | > largefiles.reposetup(ui, repo) | |
206 | > uisetup = largefiles.uisetup |
|
206 | > uisetup = largefiles.uisetup | |
207 | > EOF |
|
207 | > EOF | |
208 | $ hg --config extensions.largefiles=$TESTTMP/wrapping2.py status |
|
208 | $ hg --config extensions.largefiles=$TESTTMP/wrapping2.py status | |
209 | largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly |
|
209 | largefiles: repo method 'push' appears to have already been wrapped by another extension: largefiles may behave incorrectly | |
210 |
|
210 | |||
211 | Test copies and moves from a directory other than root (issue3516) |
|
211 | Test copies and moves from a directory other than root (issue3516) | |
212 |
|
212 | |||
213 | $ cd .. |
|
213 | $ cd .. | |
214 | $ hg init lf_cpmv |
|
214 | $ hg init lf_cpmv | |
215 | $ cd lf_cpmv |
|
215 | $ cd lf_cpmv | |
216 | $ mkdir dira |
|
216 | $ mkdir dira | |
217 | $ mkdir dira/dirb |
|
217 | $ mkdir dira/dirb | |
218 | $ touch dira/dirb/largefile |
|
218 | $ touch dira/dirb/largefile | |
219 | $ hg add --large dira/dirb/largefile |
|
219 | $ hg add --large dira/dirb/largefile | |
220 | $ hg commit -m "added" |
|
220 | $ hg commit -m "added" | |
221 | Invoking status precommit hook |
|
221 | Invoking status precommit hook | |
222 | A dira/dirb/largefile |
|
222 | A dira/dirb/largefile | |
223 | $ cd dira |
|
223 | $ cd dira | |
224 | $ hg cp dirb/largefile foo/largefile |
|
224 | $ hg cp dirb/largefile foo/largefile | |
225 | $ hg ci -m "deep copy" |
|
225 | $ hg ci -m "deep copy" | |
226 | Invoking status precommit hook |
|
226 | Invoking status precommit hook | |
227 | A dira/foo/largefile |
|
227 | A dira/foo/largefile | |
228 | $ find . | sort |
|
228 | $ find . | sort | |
229 | . |
|
229 | . | |
230 | ./dirb |
|
230 | ./dirb | |
231 | ./dirb/largefile |
|
231 | ./dirb/largefile | |
232 | ./foo |
|
232 | ./foo | |
233 | ./foo/largefile |
|
233 | ./foo/largefile | |
234 | $ hg mv foo/largefile baz/largefile |
|
234 | $ hg mv foo/largefile baz/largefile | |
235 | $ hg ci -m "moved" |
|
235 | $ hg ci -m "moved" | |
236 | Invoking status precommit hook |
|
236 | Invoking status precommit hook | |
237 | A dira/baz/largefile |
|
237 | A dira/baz/largefile | |
238 | R dira/foo/largefile |
|
238 | R dira/foo/largefile | |
239 | $ find . | sort |
|
239 | $ find . | sort | |
240 | . |
|
240 | . | |
241 | ./baz |
|
241 | ./baz | |
242 | ./baz/largefile |
|
242 | ./baz/largefile | |
243 | ./dirb |
|
243 | ./dirb | |
244 | ./dirb/largefile |
|
244 | ./dirb/largefile | |
245 | ./foo |
|
245 | ./foo | |
246 | $ cd ../../a |
|
246 | $ cd ../../a | |
247 |
|
247 | |||
248 | #if serve |
|
248 | #if serve | |
249 | Test display of largefiles in hgweb |
|
249 | Test display of largefiles in hgweb | |
250 |
|
250 | |||
251 | $ hg serve -d -p $HGPORT --pid-file ../hg.pid |
|
251 | $ hg serve -d -p $HGPORT --pid-file ../hg.pid | |
252 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
252 | $ cat ../hg.pid >> $DAEMON_PIDS | |
253 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw' |
|
253 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw' | |
254 | 200 Script output follows |
|
254 | 200 Script output follows | |
255 |
|
255 | |||
256 |
|
256 | |||
257 | drwxr-xr-x sub |
|
257 | drwxr-xr-x sub | |
258 | -rw-r--r-- 41 large3 |
|
258 | -rw-r--r-- 41 large3 | |
259 | -rw-r--r-- 9 normal3 |
|
259 | -rw-r--r-- 9 normal3 | |
260 |
|
260 | |||
261 |
|
261 | |||
262 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw' |
|
262 | $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/sub/?style=raw' | |
263 | 200 Script output follows |
|
263 | 200 Script output follows | |
264 |
|
264 | |||
265 |
|
265 | |||
266 | -rw-r--r-- 41 large4 |
|
266 | -rw-r--r-- 41 large4 | |
267 | -rw-r--r-- 9 normal4 |
|
267 | -rw-r--r-- 9 normal4 | |
268 |
|
268 | |||
269 |
|
269 | |||
270 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
270 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS | |
271 | #endif |
|
271 | #endif | |
272 |
|
272 | |||
273 | Test archiving the various revisions. These hit corner cases known with |
|
273 | Test archiving the various revisions. These hit corner cases known with | |
274 | archiving. |
|
274 | archiving. | |
275 |
|
275 | |||
276 | $ hg archive -r 0 ../archive0 |
|
276 | $ hg archive -r 0 ../archive0 | |
277 | $ hg archive -r 1 ../archive1 |
|
277 | $ hg archive -r 1 ../archive1 | |
278 | $ hg archive -r 2 ../archive2 |
|
278 | $ hg archive -r 2 ../archive2 | |
279 | $ hg archive -r 3 ../archive3 |
|
279 | $ hg archive -r 3 ../archive3 | |
280 | $ hg archive -r 4 ../archive4 |
|
280 | $ hg archive -r 4 ../archive4 | |
281 | $ cd ../archive0 |
|
281 | $ cd ../archive0 | |
282 | $ cat normal1 |
|
282 | $ cat normal1 | |
283 | normal1 |
|
283 | normal1 | |
284 | $ cat large1 |
|
284 | $ cat large1 | |
285 | large1 |
|
285 | large1 | |
286 | $ cat sub/normal2 |
|
286 | $ cat sub/normal2 | |
287 | normal2 |
|
287 | normal2 | |
288 | $ cat sub/large2 |
|
288 | $ cat sub/large2 | |
289 | large2 |
|
289 | large2 | |
290 | $ cd ../archive1 |
|
290 | $ cd ../archive1 | |
291 | $ cat normal1 |
|
291 | $ cat normal1 | |
292 | normal11 |
|
292 | normal11 | |
293 | $ cat large1 |
|
293 | $ cat large1 | |
294 | large11 |
|
294 | large11 | |
295 | $ cat sub/normal2 |
|
295 | $ cat sub/normal2 | |
296 | normal22 |
|
296 | normal22 | |
297 | $ cat sub/large2 |
|
297 | $ cat sub/large2 | |
298 | large22 |
|
298 | large22 | |
299 | $ cd ../archive2 |
|
299 | $ cd ../archive2 | |
300 | $ ls |
|
300 | $ ls | |
301 | sub |
|
301 | sub | |
302 | $ cat sub/normal2 |
|
302 | $ cat sub/normal2 | |
303 | normal22 |
|
303 | normal22 | |
304 | $ cat sub/large2 |
|
304 | $ cat sub/large2 | |
305 | large22 |
|
305 | large22 | |
306 | $ cd ../archive3 |
|
306 | $ cd ../archive3 | |
307 | $ cat normal1 |
|
307 | $ cat normal1 | |
308 | normal22 |
|
308 | normal22 | |
309 | $ cat large1 |
|
309 | $ cat large1 | |
310 | large22 |
|
310 | large22 | |
311 | $ cat sub/normal2 |
|
311 | $ cat sub/normal2 | |
312 | normal22 |
|
312 | normal22 | |
313 | $ cat sub/large2 |
|
313 | $ cat sub/large2 | |
314 | large22 |
|
314 | large22 | |
315 | $ cd ../archive4 |
|
315 | $ cd ../archive4 | |
316 | $ cat normal3 |
|
316 | $ cat normal3 | |
317 | normal22 |
|
317 | normal22 | |
318 | $ cat large3 |
|
318 | $ cat large3 | |
319 | large22 |
|
319 | large22 | |
320 | $ cat sub/normal4 |
|
320 | $ cat sub/normal4 | |
321 | normal22 |
|
321 | normal22 | |
322 | $ cat sub/large4 |
|
322 | $ cat sub/large4 | |
323 | large22 |
|
323 | large22 | |
324 |
|
324 | |||
325 | Commit corner case: specify files to commit. |
|
325 | Commit corner case: specify files to commit. | |
326 |
|
326 | |||
327 | $ cd ../a |
|
327 | $ cd ../a | |
328 | $ echo normal3 > normal3 |
|
328 | $ echo normal3 > normal3 | |
329 | $ echo large3 > large3 |
|
329 | $ echo large3 > large3 | |
330 | $ echo normal4 > sub/normal4 |
|
330 | $ echo normal4 > sub/normal4 | |
331 | $ echo large4 > sub/large4 |
|
331 | $ echo large4 > sub/large4 | |
332 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" |
|
332 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" | |
333 | Invoking status precommit hook |
|
333 | Invoking status precommit hook | |
334 | M large3 |
|
334 | M large3 | |
335 | M normal3 |
|
335 | M normal3 | |
336 | M sub/large4 |
|
336 | M sub/large4 | |
337 | M sub/normal4 |
|
337 | M sub/normal4 | |
338 | $ cat normal3 |
|
338 | $ cat normal3 | |
339 | normal3 |
|
339 | normal3 | |
340 | $ cat large3 |
|
340 | $ cat large3 | |
341 | large3 |
|
341 | large3 | |
342 | $ cat sub/normal4 |
|
342 | $ cat sub/normal4 | |
343 | normal4 |
|
343 | normal4 | |
344 | $ cat sub/large4 |
|
344 | $ cat sub/large4 | |
345 | large4 |
|
345 | large4 | |
346 |
|
346 | |||
347 | One more commit corner case: commit from a subdirectory. |
|
347 | One more commit corner case: commit from a subdirectory. | |
348 |
|
348 | |||
349 | $ cd ../a |
|
349 | $ cd ../a | |
350 | $ echo normal33 > normal3 |
|
350 | $ echo normal33 > normal3 | |
351 | $ echo large33 > large3 |
|
351 | $ echo large33 > large3 | |
352 | $ echo normal44 > sub/normal4 |
|
352 | $ echo normal44 > sub/normal4 | |
353 | $ echo large44 > sub/large4 |
|
353 | $ echo large44 > sub/large4 | |
354 | $ cd sub |
|
354 | $ cd sub | |
355 | $ hg commit -m "edit files yet again" |
|
355 | $ hg commit -m "edit files yet again" | |
356 | Invoking status precommit hook |
|
356 | Invoking status precommit hook | |
357 | M large3 |
|
357 | M large3 | |
358 | M normal3 |
|
358 | M normal3 | |
359 | M sub/large4 |
|
359 | M sub/large4 | |
360 | M sub/normal4 |
|
360 | M sub/normal4 | |
361 | $ cat ../normal3 |
|
361 | $ cat ../normal3 | |
362 | normal33 |
|
362 | normal33 | |
363 | $ cat ../large3 |
|
363 | $ cat ../large3 | |
364 | large33 |
|
364 | large33 | |
365 | $ cat normal4 |
|
365 | $ cat normal4 | |
366 | normal44 |
|
366 | normal44 | |
367 | $ cat large4 |
|
367 | $ cat large4 | |
368 | large44 |
|
368 | large44 | |
369 |
|
369 | |||
370 | Committing standins is not allowed. |
|
370 | Committing standins is not allowed. | |
371 |
|
371 | |||
372 | $ cd .. |
|
372 | $ cd .. | |
373 | $ echo large3 > large3 |
|
373 | $ echo large3 > large3 | |
374 | $ hg commit .hglf/large3 -m "try to commit standin" |
|
374 | $ hg commit .hglf/large3 -m "try to commit standin" | |
375 | abort: file ".hglf/large3" is a largefile standin |
|
375 | abort: file ".hglf/large3" is a largefile standin | |
376 | (commit the largefile itself instead) |
|
376 | (commit the largefile itself instead) | |
377 | [255] |
|
377 | [255] | |
378 |
|
378 | |||
379 | Corner cases for adding largefiles. |
|
379 | Corner cases for adding largefiles. | |
380 |
|
380 | |||
381 | $ echo large5 > large5 |
|
381 | $ echo large5 > large5 | |
382 | $ hg add --large large5 |
|
382 | $ hg add --large large5 | |
383 | $ hg add --large large5 |
|
383 | $ hg add --large large5 | |
384 | large5 already a largefile |
|
384 | large5 already a largefile | |
385 | $ mkdir sub2 |
|
385 | $ mkdir sub2 | |
386 | $ echo large6 > sub2/large6 |
|
386 | $ echo large6 > sub2/large6 | |
387 | $ echo large7 > sub2/large7 |
|
387 | $ echo large7 > sub2/large7 | |
388 | $ hg add --large sub2 |
|
388 | $ hg add --large sub2 | |
389 | adding sub2/large6 as a largefile (glob) |
|
389 | adding sub2/large6 as a largefile (glob) | |
390 | adding sub2/large7 as a largefile (glob) |
|
390 | adding sub2/large7 as a largefile (glob) | |
391 | $ hg st |
|
391 | $ hg st | |
392 | M large3 |
|
392 | M large3 | |
393 | A large5 |
|
393 | A large5 | |
394 | A sub2/large6 |
|
394 | A sub2/large6 | |
395 | A sub2/large7 |
|
395 | A sub2/large7 | |
396 |
|
396 | |||
397 | Committing directories containing only largefiles. |
|
397 | Committing directories containing only largefiles. | |
398 |
|
398 | |||
399 | $ mkdir -p z/y/x/m |
|
399 | $ mkdir -p z/y/x/m | |
400 | $ touch z/y/x/m/large1 |
|
400 | $ touch z/y/x/m/large1 | |
401 | $ touch z/y/x/large2 |
|
401 | $ touch z/y/x/large2 | |
402 | $ hg add --large z/y/x/m/large1 z/y/x/large2 |
|
402 | $ hg add --large z/y/x/m/large1 z/y/x/large2 | |
403 | $ hg commit -m "Subdir with directory only containing largefiles" z |
|
403 | $ hg commit -m "Subdir with directory only containing largefiles" z | |
404 | Invoking status precommit hook |
|
404 | Invoking status precommit hook | |
405 | M large3 |
|
405 | M large3 | |
406 | A large5 |
|
406 | A large5 | |
407 | A sub2/large6 |
|
407 | A sub2/large6 | |
408 | A sub2/large7 |
|
408 | A sub2/large7 | |
409 | A z/y/x/large2 |
|
409 | A z/y/x/large2 | |
410 | A z/y/x/m/large1 |
|
410 | A z/y/x/m/large1 | |
411 | $ hg rollback --quiet |
|
411 | $ hg rollback --quiet | |
412 | $ touch z/y/x/m/normal |
|
412 | $ touch z/y/x/m/normal | |
413 | $ hg add z/y/x/m/normal |
|
413 | $ hg add z/y/x/m/normal | |
414 | $ hg commit -m "Subdir with mixed contents" z |
|
414 | $ hg commit -m "Subdir with mixed contents" z | |
415 | Invoking status precommit hook |
|
415 | Invoking status precommit hook | |
416 | M large3 |
|
416 | M large3 | |
417 | A large5 |
|
417 | A large5 | |
418 | A sub2/large6 |
|
418 | A sub2/large6 | |
419 | A sub2/large7 |
|
419 | A sub2/large7 | |
420 | A z/y/x/large2 |
|
420 | A z/y/x/large2 | |
421 | A z/y/x/m/large1 |
|
421 | A z/y/x/m/large1 | |
422 | A z/y/x/m/normal |
|
422 | A z/y/x/m/normal | |
423 | $ hg st |
|
423 | $ hg st | |
424 | M large3 |
|
424 | M large3 | |
425 | A large5 |
|
425 | A large5 | |
426 | A sub2/large6 |
|
426 | A sub2/large6 | |
427 | A sub2/large7 |
|
427 | A sub2/large7 | |
428 | $ hg rollback --quiet |
|
428 | $ hg rollback --quiet | |
429 | $ hg revert z/y/x/large2 z/y/x/m/large1 |
|
429 | $ hg revert z/y/x/large2 z/y/x/m/large1 | |
430 | $ rm z/y/x/large2 z/y/x/m/large1 |
|
430 | $ rm z/y/x/large2 z/y/x/m/large1 | |
431 | $ hg commit -m "Subdir with normal contents" z |
|
431 | $ hg commit -m "Subdir with normal contents" z | |
432 | Invoking status precommit hook |
|
432 | Invoking status precommit hook | |
433 | M large3 |
|
433 | M large3 | |
434 | A large5 |
|
434 | A large5 | |
435 | A sub2/large6 |
|
435 | A sub2/large6 | |
436 | A sub2/large7 |
|
436 | A sub2/large7 | |
437 | A z/y/x/m/normal |
|
437 | A z/y/x/m/normal | |
438 | $ hg st |
|
438 | $ hg st | |
439 | M large3 |
|
439 | M large3 | |
440 | A large5 |
|
440 | A large5 | |
441 | A sub2/large6 |
|
441 | A sub2/large6 | |
442 | A sub2/large7 |
|
442 | A sub2/large7 | |
443 | $ hg rollback --quiet |
|
443 | $ hg rollback --quiet | |
444 | $ hg revert --quiet z |
|
444 | $ hg revert --quiet z | |
445 | $ hg commit -m "Empty subdir" z |
|
445 | $ hg commit -m "Empty subdir" z | |
446 | abort: z: no match under directory! |
|
446 | abort: z: no match under directory! | |
447 | [255] |
|
447 | [255] | |
448 | $ rm -rf z |
|
448 | $ rm -rf z | |
449 | $ hg ci -m "standin" .hglf |
|
449 | $ hg ci -m "standin" .hglf | |
450 | abort: file ".hglf" is a largefile standin |
|
450 | abort: file ".hglf" is a largefile standin | |
451 | (commit the largefile itself instead) |
|
451 | (commit the largefile itself instead) | |
452 | [255] |
|
452 | [255] | |
453 |
|
453 | |||
454 | Test "hg status" with combination of 'file pattern' and 'directory |
|
454 | Test "hg status" with combination of 'file pattern' and 'directory | |
455 | pattern' for largefiles: |
|
455 | pattern' for largefiles: | |
456 |
|
456 | |||
457 | $ hg status sub2/large6 sub2 |
|
457 | $ hg status sub2/large6 sub2 | |
458 | A sub2/large6 |
|
458 | A sub2/large6 | |
459 | A sub2/large7 |
|
459 | A sub2/large7 | |
460 |
|
460 | |||
461 | Config settings (pattern **.dat, minsize 2 MB) are respected. |
|
461 | Config settings (pattern **.dat, minsize 2 MB) are respected. | |
462 |
|
462 | |||
463 | $ echo testdata > test.dat |
|
463 | $ echo testdata > test.dat | |
464 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null |
|
464 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null | |
465 | $ hg add |
|
465 | $ hg add | |
466 | adding reallylarge as a largefile |
|
466 | adding reallylarge as a largefile | |
467 | adding test.dat as a largefile |
|
467 | adding test.dat as a largefile | |
468 |
|
468 | |||
469 | Test that minsize and --lfsize handle float values; |
|
469 | Test that minsize and --lfsize handle float values; | |
470 | also tests that --lfsize overrides largefiles.minsize. |
|
470 | also tests that --lfsize overrides largefiles.minsize. | |
471 | (0.250 MB = 256 kB = 262144 B) |
|
471 | (0.250 MB = 256 kB = 262144 B) | |
472 |
|
472 | |||
473 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null |
|
473 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null | |
474 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null |
|
474 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null | |
475 | $ hg --config largefiles.minsize=.25 add |
|
475 | $ hg --config largefiles.minsize=.25 add | |
476 | adding ratherlarge as a largefile |
|
476 | adding ratherlarge as a largefile | |
477 | adding medium |
|
477 | adding medium | |
478 | $ hg forget medium |
|
478 | $ hg forget medium | |
479 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
479 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
480 | adding medium as a largefile |
|
480 | adding medium as a largefile | |
481 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null |
|
481 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null | |
482 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
482 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
483 | adding notlarge |
|
483 | adding notlarge | |
484 | $ hg forget notlarge |
|
484 | $ hg forget notlarge | |
485 |
|
485 | |||
486 | Test forget on largefiles. |
|
486 | Test forget on largefiles. | |
487 |
|
487 | |||
488 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium |
|
488 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium | |
489 | $ hg commit -m "add/edit more largefiles" |
|
489 | $ hg commit -m "add/edit more largefiles" | |
490 | Invoking status precommit hook |
|
490 | Invoking status precommit hook | |
491 | A sub2/large6 |
|
491 | A sub2/large6 | |
492 | A sub2/large7 |
|
492 | A sub2/large7 | |
493 | R large3 |
|
493 | R large3 | |
494 | ? large5 |
|
494 | ? large5 | |
495 | ? medium |
|
495 | ? medium | |
496 | ? notlarge |
|
496 | ? notlarge | |
497 | ? ratherlarge |
|
497 | ? ratherlarge | |
498 | ? reallylarge |
|
498 | ? reallylarge | |
499 | ? test.dat |
|
499 | ? test.dat | |
500 | $ hg st |
|
500 | $ hg st | |
501 | ? large3 |
|
501 | ? large3 | |
502 | ? large5 |
|
502 | ? large5 | |
503 | ? medium |
|
503 | ? medium | |
504 | ? notlarge |
|
504 | ? notlarge | |
505 | ? ratherlarge |
|
505 | ? ratherlarge | |
506 | ? reallylarge |
|
506 | ? reallylarge | |
507 | ? test.dat |
|
507 | ? test.dat | |
508 |
|
508 | |||
509 | Purge with largefiles: verify that largefiles are still in the working |
|
509 | Purge with largefiles: verify that largefiles are still in the working | |
510 | dir after a purge. |
|
510 | dir after a purge. | |
511 |
|
511 | |||
512 | $ hg purge --all |
|
512 | $ hg purge --all | |
513 | $ cat sub/large4 |
|
513 | $ cat sub/large4 | |
514 | large44 |
|
514 | large44 | |
515 | $ cat sub2/large6 |
|
515 | $ cat sub2/large6 | |
516 | large6 |
|
516 | large6 | |
517 | $ cat sub2/large7 |
|
517 | $ cat sub2/large7 | |
518 | large7 |
|
518 | large7 | |
519 |
|
519 | |||
520 | Test addremove: verify that files that should be added as largfiles are added as |
|
520 | Test addremove: verify that files that should be added as largfiles are added as | |
521 | such and that already-existing largfiles are not added as normal files by |
|
521 | such and that already-existing largfiles are not added as normal files by | |
522 | accident. |
|
522 | accident. | |
523 |
|
523 | |||
524 | $ rm normal3 |
|
524 | $ rm normal3 | |
525 | $ rm sub/large4 |
|
525 | $ rm sub/large4 | |
526 | $ echo "testing addremove with patterns" > testaddremove.dat |
|
526 | $ echo "testing addremove with patterns" > testaddremove.dat | |
527 | $ echo "normaladdremove" > normaladdremove |
|
527 | $ echo "normaladdremove" > normaladdremove | |
528 | $ hg addremove |
|
528 | $ hg addremove | |
529 | removing sub/large4 |
|
529 | removing sub/large4 | |
530 | adding testaddremove.dat as a largefile |
|
530 | adding testaddremove.dat as a largefile | |
531 | removing normal3 |
|
531 | removing normal3 | |
532 | adding normaladdremove |
|
532 | adding normaladdremove | |
533 |
|
533 | |||
534 | Test addremove with -R |
|
534 | Test addremove with -R | |
535 |
|
535 | |||
536 | $ hg up -C |
|
536 | $ hg up -C | |
537 | getting changed largefiles |
|
537 | getting changed largefiles | |
538 | 1 largefiles updated, 0 removed |
|
538 | 1 largefiles updated, 0 removed | |
539 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
539 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
540 | $ rm normal3 |
|
540 | $ rm normal3 | |
541 | $ rm sub/large4 |
|
541 | $ rm sub/large4 | |
542 | $ echo "testing addremove with patterns" > testaddremove.dat |
|
542 | $ echo "testing addremove with patterns" > testaddremove.dat | |
543 | $ echo "normaladdremove" > normaladdremove |
|
543 | $ echo "normaladdremove" > normaladdremove | |
544 | $ cd .. |
|
544 | $ cd .. | |
545 | $ hg -R a addremove |
|
545 | $ hg -R a addremove | |
546 | removing sub/large4 |
|
546 | removing sub/large4 | |
547 | adding a/testaddremove.dat as a largefile (glob) |
|
547 | adding a/testaddremove.dat as a largefile (glob) | |
548 | removing normal3 |
|
548 | removing normal3 | |
549 | adding normaladdremove |
|
549 | adding normaladdremove | |
550 | $ cd a |
|
550 | $ cd a | |
551 |
|
551 | |||
552 | Test 3364 |
|
552 | Test 3364 | |
553 | $ hg clone . ../addrm |
|
553 | $ hg clone . ../addrm | |
554 | updating to branch default |
|
554 | updating to branch default | |
555 | getting changed largefiles |
|
555 | getting changed largefiles | |
556 | 3 largefiles updated, 0 removed |
|
556 | 3 largefiles updated, 0 removed | |
557 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
557 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
558 | $ cd ../addrm |
|
558 | $ cd ../addrm | |
559 | $ cat >> .hg/hgrc <<EOF |
|
559 | $ cat >> .hg/hgrc <<EOF | |
560 | > [hooks] |
|
560 | > [hooks] | |
561 | > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A" |
|
561 | > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A" | |
562 | > EOF |
|
562 | > EOF | |
563 | $ touch foo |
|
563 | $ touch foo | |
564 | $ hg add --large foo |
|
564 | $ hg add --large foo | |
565 | $ hg ci -m "add foo" |
|
565 | $ hg ci -m "add foo" | |
566 | Invoking status precommit hook |
|
566 | Invoking status precommit hook | |
567 | A foo |
|
567 | A foo | |
568 | Invoking status postcommit hook |
|
568 | Invoking status postcommit hook | |
569 | C foo |
|
569 | C foo | |
570 | C normal3 |
|
570 | C normal3 | |
571 | C sub/large4 |
|
571 | C sub/large4 | |
572 | C sub/normal4 |
|
572 | C sub/normal4 | |
573 | C sub2/large6 |
|
573 | C sub2/large6 | |
574 | C sub2/large7 |
|
574 | C sub2/large7 | |
575 | $ rm foo |
|
575 | $ rm foo | |
576 | $ hg st |
|
576 | $ hg st | |
577 | ! foo |
|
577 | ! foo | |
578 | hmm.. no precommit invoked, but there is a postcommit?? |
|
578 | hmm.. no precommit invoked, but there is a postcommit?? | |
579 | $ hg ci -m "will not checkin" |
|
579 | $ hg ci -m "will not checkin" | |
580 | nothing changed |
|
580 | nothing changed | |
581 | Invoking status postcommit hook |
|
581 | Invoking status postcommit hook | |
582 | ! foo |
|
582 | ! foo | |
583 | C normal3 |
|
583 | C normal3 | |
584 | C sub/large4 |
|
584 | C sub/large4 | |
585 | C sub/normal4 |
|
585 | C sub/normal4 | |
586 | C sub2/large6 |
|
586 | C sub2/large6 | |
587 | C sub2/large7 |
|
587 | C sub2/large7 | |
588 | [1] |
|
588 | [1] | |
589 | $ hg addremove |
|
589 | $ hg addremove | |
590 | removing foo |
|
590 | removing foo | |
591 | $ hg st |
|
591 | $ hg st | |
592 | R foo |
|
592 | R foo | |
593 | $ hg ci -m "used to say nothing changed" |
|
593 | $ hg ci -m "used to say nothing changed" | |
594 | Invoking status precommit hook |
|
594 | Invoking status precommit hook | |
595 | R foo |
|
595 | R foo | |
596 | Invoking status postcommit hook |
|
596 | Invoking status postcommit hook | |
597 | C normal3 |
|
597 | C normal3 | |
598 | C sub/large4 |
|
598 | C sub/large4 | |
599 | C sub/normal4 |
|
599 | C sub/normal4 | |
600 | C sub2/large6 |
|
600 | C sub2/large6 | |
601 | C sub2/large7 |
|
601 | C sub2/large7 | |
602 | $ hg st |
|
602 | $ hg st | |
603 |
|
603 | |||
604 | Test 3507 (both normal files and largefiles were a problem) |
|
604 | Test 3507 (both normal files and largefiles were a problem) | |
605 |
|
605 | |||
606 | $ touch normal |
|
606 | $ touch normal | |
607 | $ touch large |
|
607 | $ touch large | |
608 | $ hg add normal |
|
608 | $ hg add normal | |
609 | $ hg add --large large |
|
609 | $ hg add --large large | |
610 | $ hg ci -m "added" |
|
610 | $ hg ci -m "added" | |
611 | Invoking status precommit hook |
|
611 | Invoking status precommit hook | |
612 | A large |
|
612 | A large | |
613 | A normal |
|
613 | A normal | |
614 | Invoking status postcommit hook |
|
614 | Invoking status postcommit hook | |
615 | C large |
|
615 | C large | |
616 | C normal |
|
616 | C normal | |
617 | C normal3 |
|
617 | C normal3 | |
618 | C sub/large4 |
|
618 | C sub/large4 | |
619 | C sub/normal4 |
|
619 | C sub/normal4 | |
620 | C sub2/large6 |
|
620 | C sub2/large6 | |
621 | C sub2/large7 |
|
621 | C sub2/large7 | |
622 | $ hg remove normal |
|
622 | $ hg remove normal | |
623 | $ hg addremove --traceback |
|
623 | $ hg addremove --traceback | |
624 | $ hg ci -m "addremoved normal" |
|
624 | $ hg ci -m "addremoved normal" | |
625 | Invoking status precommit hook |
|
625 | Invoking status precommit hook | |
626 | R normal |
|
626 | R normal | |
627 | Invoking status postcommit hook |
|
627 | Invoking status postcommit hook | |
628 | C large |
|
628 | C large | |
629 | C normal3 |
|
629 | C normal3 | |
630 | C sub/large4 |
|
630 | C sub/large4 | |
631 | C sub/normal4 |
|
631 | C sub/normal4 | |
632 | C sub2/large6 |
|
632 | C sub2/large6 | |
633 | C sub2/large7 |
|
633 | C sub2/large7 | |
634 | $ hg up -C '.^' |
|
634 | $ hg up -C '.^' | |
635 | getting changed largefiles |
|
635 | getting changed largefiles | |
636 | 0 largefiles updated, 0 removed |
|
636 | 0 largefiles updated, 0 removed | |
637 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
637 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
638 | $ hg remove large |
|
638 | $ hg remove large | |
639 | $ hg addremove --traceback |
|
639 | $ hg addremove --traceback | |
640 | $ hg ci -m "removed large" |
|
640 | $ hg ci -m "removed large" | |
641 | Invoking status precommit hook |
|
641 | Invoking status precommit hook | |
642 | R large |
|
642 | R large | |
643 | created new head |
|
643 | created new head | |
644 | Invoking status postcommit hook |
|
644 | Invoking status postcommit hook | |
645 | C normal |
|
645 | C normal | |
646 | C normal3 |
|
646 | C normal3 | |
647 | C sub/large4 |
|
647 | C sub/large4 | |
648 | C sub/normal4 |
|
648 | C sub/normal4 | |
649 | C sub2/large6 |
|
649 | C sub2/large6 | |
650 | C sub2/large7 |
|
650 | C sub2/large7 | |
651 |
|
651 | |||
652 | Test commit -A (issue 3542) |
|
652 | Test commit -A (issue 3542) | |
653 | $ echo large8 > large8 |
|
653 | $ echo large8 > large8 | |
654 | $ hg add --large large8 |
|
654 | $ hg add --large large8 | |
655 | $ hg ci -Am 'this used to add large8 as normal and commit both' |
|
655 | $ hg ci -Am 'this used to add large8 as normal and commit both' | |
656 | Invoking status precommit hook |
|
656 | Invoking status precommit hook | |
657 | A large8 |
|
657 | A large8 | |
658 | Invoking status postcommit hook |
|
658 | Invoking status postcommit hook | |
659 | C large8 |
|
659 | C large8 | |
660 | C normal |
|
660 | C normal | |
661 | C normal3 |
|
661 | C normal3 | |
662 | C sub/large4 |
|
662 | C sub/large4 | |
663 | C sub/normal4 |
|
663 | C sub/normal4 | |
664 | C sub2/large6 |
|
664 | C sub2/large6 | |
665 | C sub2/large7 |
|
665 | C sub2/large7 | |
666 | $ rm large8 |
|
666 | $ rm large8 | |
667 | $ hg ci -Am 'this used to not notice the rm' |
|
667 | $ hg ci -Am 'this used to not notice the rm' | |
668 | removing large8 |
|
668 | removing large8 | |
669 | Invoking status precommit hook |
|
669 | Invoking status precommit hook | |
670 | R large8 |
|
670 | R large8 | |
671 | Invoking status postcommit hook |
|
671 | Invoking status postcommit hook | |
672 | C normal |
|
672 | C normal | |
673 | C normal3 |
|
673 | C normal3 | |
674 | C sub/large4 |
|
674 | C sub/large4 | |
675 | C sub/normal4 |
|
675 | C sub/normal4 | |
676 | C sub2/large6 |
|
676 | C sub2/large6 | |
677 | C sub2/large7 |
|
677 | C sub2/large7 | |
678 |
|
678 | |||
679 | Test that a standin can't be added as a large file |
|
679 | Test that a standin can't be added as a large file | |
680 |
|
680 | |||
681 | $ touch large |
|
681 | $ touch large | |
682 | $ hg add --large large |
|
682 | $ hg add --large large | |
683 | $ hg ci -m "add" |
|
683 | $ hg ci -m "add" | |
684 | Invoking status precommit hook |
|
684 | Invoking status precommit hook | |
685 | A large |
|
685 | A large | |
686 | Invoking status postcommit hook |
|
686 | Invoking status postcommit hook | |
687 | C large |
|
687 | C large | |
688 | C normal |
|
688 | C normal | |
689 | C normal3 |
|
689 | C normal3 | |
690 | C sub/large4 |
|
690 | C sub/large4 | |
691 | C sub/normal4 |
|
691 | C sub/normal4 | |
692 | C sub2/large6 |
|
692 | C sub2/large6 | |
693 | C sub2/large7 |
|
693 | C sub2/large7 | |
694 | $ hg remove large |
|
694 | $ hg remove large | |
695 | $ touch large |
|
695 | $ touch large | |
696 | $ hg addremove --config largefiles.patterns=**large --traceback |
|
696 | $ hg addremove --config largefiles.patterns=**large --traceback | |
697 | adding large as a largefile |
|
697 | adding large as a largefile | |
698 |
|
698 | |||
699 | Test that outgoing --large works (with revsets too) |
|
699 | Test that outgoing --large works (with revsets too) | |
700 | $ hg outgoing --rev '.^' --large |
|
700 | $ hg outgoing --rev '.^' --large | |
701 | comparing with $TESTTMP/a (glob) |
|
701 | comparing with $TESTTMP/a (glob) | |
702 | searching for changes |
|
702 | searching for changes | |
703 | changeset: 8:c02fd3b77ec4 |
|
703 | changeset: 8:c02fd3b77ec4 | |
704 | user: test |
|
704 | user: test | |
705 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
705 | date: Thu Jan 01 00:00:00 1970 +0000 | |
706 | summary: add foo |
|
706 | summary: add foo | |
707 |
|
707 | |||
708 | changeset: 9:289dd08c9bbb |
|
708 | changeset: 9:289dd08c9bbb | |
709 | user: test |
|
709 | user: test | |
710 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
710 | date: Thu Jan 01 00:00:00 1970 +0000 | |
711 | summary: used to say nothing changed |
|
711 | summary: used to say nothing changed | |
712 |
|
712 | |||
713 | changeset: 10:34f23ac6ac12 |
|
713 | changeset: 10:34f23ac6ac12 | |
714 | user: test |
|
714 | user: test | |
715 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
715 | date: Thu Jan 01 00:00:00 1970 +0000 | |
716 | summary: added |
|
716 | summary: added | |
717 |
|
717 | |||
718 | changeset: 12:710c1b2f523c |
|
718 | changeset: 12:710c1b2f523c | |
719 | parent: 10:34f23ac6ac12 |
|
719 | parent: 10:34f23ac6ac12 | |
720 | user: test |
|
720 | user: test | |
721 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
721 | date: Thu Jan 01 00:00:00 1970 +0000 | |
722 | summary: removed large |
|
722 | summary: removed large | |
723 |
|
723 | |||
724 | changeset: 13:0a3e75774479 |
|
724 | changeset: 13:0a3e75774479 | |
725 | user: test |
|
725 | user: test | |
726 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
726 | date: Thu Jan 01 00:00:00 1970 +0000 | |
727 | summary: this used to add large8 as normal and commit both |
|
727 | summary: this used to add large8 as normal and commit both | |
728 |
|
728 | |||
729 | changeset: 14:84f3d378175c |
|
729 | changeset: 14:84f3d378175c | |
730 | user: test |
|
730 | user: test | |
731 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
731 | date: Thu Jan 01 00:00:00 1970 +0000 | |
732 | summary: this used to not notice the rm |
|
732 | summary: this used to not notice the rm | |
733 |
|
733 | |||
734 | searching for changes |
|
734 | searching for changes | |
735 | largefiles to upload: |
|
735 | largefiles to upload: | |
736 | foo |
|
736 | foo | |
737 | large |
|
737 | large | |
738 | large8 |
|
738 | large8 | |
739 |
|
739 | |||
740 | $ cd ../a |
|
740 | $ cd ../a | |
741 |
|
741 | |||
742 | Clone a largefiles repo. |
|
742 | Clone a largefiles repo. | |
743 |
|
743 | |||
744 | $ hg clone . ../b |
|
744 | $ hg clone . ../b | |
745 | updating to branch default |
|
745 | updating to branch default | |
746 | getting changed largefiles |
|
746 | getting changed largefiles | |
747 | 3 largefiles updated, 0 removed |
|
747 | 3 largefiles updated, 0 removed | |
748 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
748 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
749 | $ cd ../b |
|
749 | $ cd ../b | |
750 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
750 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
751 | 7:daea875e9014 add/edit more largefiles |
|
751 | 7:daea875e9014 add/edit more largefiles | |
752 | 6:4355d653f84f edit files yet again |
|
752 | 6:4355d653f84f edit files yet again | |
753 | 5:9d5af5072dbd edit files again |
|
753 | 5:9d5af5072dbd edit files again | |
754 | 4:74c02385b94c move files |
|
754 | 4:74c02385b94c move files | |
755 | 3:9e8fbc4bce62 copy files |
|
755 | 3:9e8fbc4bce62 copy files | |
756 | 2:51a0ae4d5864 remove files |
|
756 | 2:51a0ae4d5864 remove files | |
757 | 1:ce8896473775 edit files |
|
757 | 1:ce8896473775 edit files | |
758 | 0:30d30fe6a5be add files |
|
758 | 0:30d30fe6a5be add files | |
759 | $ cat normal3 |
|
759 | $ cat normal3 | |
760 | normal33 |
|
760 | normal33 | |
761 | $ cat sub/normal4 |
|
761 | $ cat sub/normal4 | |
762 | normal44 |
|
762 | normal44 | |
763 | $ cat sub/large4 |
|
763 | $ cat sub/large4 | |
764 | large44 |
|
764 | large44 | |
765 | $ cat sub2/large6 |
|
765 | $ cat sub2/large6 | |
766 | large6 |
|
766 | large6 | |
767 | $ cat sub2/large7 |
|
767 | $ cat sub2/large7 | |
768 | large7 |
|
768 | large7 | |
769 | $ cd .. |
|
769 | $ cd .. | |
770 | $ hg clone a -r 3 c |
|
770 | $ hg clone a -r 3 c | |
771 | adding changesets |
|
771 | adding changesets | |
772 | adding manifests |
|
772 | adding manifests | |
773 | adding file changes |
|
773 | adding file changes | |
774 | added 4 changesets with 10 changes to 4 files |
|
774 | added 4 changesets with 10 changes to 4 files | |
775 | updating to branch default |
|
775 | updating to branch default | |
776 | getting changed largefiles |
|
776 | getting changed largefiles | |
777 | 2 largefiles updated, 0 removed |
|
777 | 2 largefiles updated, 0 removed | |
778 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
778 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
779 | $ cd c |
|
779 | $ cd c | |
780 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
780 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
781 | 3:9e8fbc4bce62 copy files |
|
781 | 3:9e8fbc4bce62 copy files | |
782 | 2:51a0ae4d5864 remove files |
|
782 | 2:51a0ae4d5864 remove files | |
783 | 1:ce8896473775 edit files |
|
783 | 1:ce8896473775 edit files | |
784 | 0:30d30fe6a5be add files |
|
784 | 0:30d30fe6a5be add files | |
785 | $ cat normal1 |
|
785 | $ cat normal1 | |
786 | normal22 |
|
786 | normal22 | |
787 | $ cat large1 |
|
787 | $ cat large1 | |
788 | large22 |
|
788 | large22 | |
789 | $ cat sub/normal2 |
|
789 | $ cat sub/normal2 | |
790 | normal22 |
|
790 | normal22 | |
791 | $ cat sub/large2 |
|
791 | $ cat sub/large2 | |
792 | large22 |
|
792 | large22 | |
793 |
|
793 | |||
794 | Old revisions of a clone have correct largefiles content (this also |
|
794 | Old revisions of a clone have correct largefiles content (this also | |
795 | tests update). |
|
795 | tests update). | |
796 |
|
796 | |||
797 | $ hg update -r 1 |
|
797 | $ hg update -r 1 | |
798 | getting changed largefiles |
|
798 | getting changed largefiles | |
799 | 1 largefiles updated, 0 removed |
|
799 | 1 largefiles updated, 0 removed | |
800 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
800 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
801 | $ cat large1 |
|
801 | $ cat large1 | |
802 | large11 |
|
802 | large11 | |
803 | $ cat sub/large2 |
|
803 | $ cat sub/large2 | |
804 | large22 |
|
804 | large22 | |
805 | $ cd .. |
|
805 | $ cd .. | |
806 |
|
806 | |||
807 | Test cloning with --all-largefiles flag |
|
807 | Test cloning with --all-largefiles flag | |
808 |
|
808 | |||
809 | $ rm "${USERCACHE}"/* |
|
809 | $ rm "${USERCACHE}"/* | |
810 | $ hg clone --all-largefiles a a-backup |
|
810 | $ hg clone --all-largefiles a a-backup | |
811 | updating to branch default |
|
811 | updating to branch default | |
812 | getting changed largefiles |
|
812 | getting changed largefiles | |
813 | 3 largefiles updated, 0 removed |
|
813 | 3 largefiles updated, 0 removed | |
814 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
814 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
815 | 8 additional largefiles cached |
|
815 | 8 additional largefiles cached | |
816 |
|
816 | |||
817 | $ rm "${USERCACHE}"/* |
|
817 | $ rm "${USERCACHE}"/* | |
818 | $ hg clone --all-largefiles -u 0 a a-clone0 |
|
818 | $ hg clone --all-largefiles -u 0 a a-clone0 | |
819 | updating to branch default |
|
819 | updating to branch default | |
820 | getting changed largefiles |
|
820 | getting changed largefiles | |
821 | 2 largefiles updated, 0 removed |
|
821 | 2 largefiles updated, 0 removed | |
822 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
822 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
823 | 9 additional largefiles cached |
|
823 | 9 additional largefiles cached | |
824 | $ hg -R a-clone0 sum |
|
824 | $ hg -R a-clone0 sum | |
825 | parent: 0:30d30fe6a5be |
|
825 | parent: 0:30d30fe6a5be | |
826 | add files |
|
826 | add files | |
827 | branch: default |
|
827 | branch: default | |
828 | commit: (clean) |
|
828 | commit: (clean) | |
829 | update: 7 new changesets (update) |
|
829 | update: 7 new changesets (update) | |
830 |
|
830 | |||
831 | $ rm "${USERCACHE}"/* |
|
831 | $ rm "${USERCACHE}"/* | |
832 | $ hg clone --all-largefiles -u 1 a a-clone1 |
|
832 | $ hg clone --all-largefiles -u 1 a a-clone1 | |
833 | updating to branch default |
|
833 | updating to branch default | |
834 | getting changed largefiles |
|
834 | getting changed largefiles | |
835 | 2 largefiles updated, 0 removed |
|
835 | 2 largefiles updated, 0 removed | |
836 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
836 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
837 | 8 additional largefiles cached |
|
837 | 8 additional largefiles cached | |
838 | $ hg -R a-clone1 verify --large --lfa --lfc |
|
838 | $ hg -R a-clone1 verify --large --lfa --lfc | |
839 | checking changesets |
|
839 | checking changesets | |
840 | checking manifests |
|
840 | checking manifests | |
841 | crosschecking files in changesets and manifests |
|
841 | crosschecking files in changesets and manifests | |
842 | checking files |
|
842 | checking files | |
843 | 10 files, 8 changesets, 24 total revisions |
|
843 | 10 files, 8 changesets, 24 total revisions | |
844 | searching 8 changesets for largefiles |
|
844 | searching 8 changesets for largefiles | |
845 | verified contents of 13 revisions of 6 largefiles |
|
845 | verified contents of 13 revisions of 6 largefiles | |
846 | $ hg -R a-clone1 sum |
|
846 | $ hg -R a-clone1 sum | |
847 | parent: 1:ce8896473775 |
|
847 | parent: 1:ce8896473775 | |
848 | edit files |
|
848 | edit files | |
849 | branch: default |
|
849 | branch: default | |
850 | commit: (clean) |
|
850 | commit: (clean) | |
851 | update: 6 new changesets (update) |
|
851 | update: 6 new changesets (update) | |
852 |
|
852 | |||
853 | $ rm "${USERCACHE}"/* |
|
853 | $ rm "${USERCACHE}"/* | |
854 | $ hg clone --all-largefiles -U a a-clone-u |
|
854 | $ hg clone --all-largefiles -U a a-clone-u | |
855 | 11 additional largefiles cached |
|
855 | 11 additional largefiles cached | |
856 | $ hg -R a-clone-u sum |
|
856 | $ hg -R a-clone-u sum | |
857 | parent: -1:000000000000 (no revision checked out) |
|
857 | parent: -1:000000000000 (no revision checked out) | |
858 | branch: default |
|
858 | branch: default | |
859 | commit: (clean) |
|
859 | commit: (clean) | |
860 | update: 8 new changesets (update) |
|
860 | update: 8 new changesets (update) | |
861 |
|
861 | |||
862 | Show computed destination directory: |
|
862 | Show computed destination directory: | |
863 |
|
863 | |||
864 | $ mkdir xyz |
|
864 | $ mkdir xyz | |
865 | $ cd xyz |
|
865 | $ cd xyz | |
866 | $ hg clone ../a |
|
866 | $ hg clone ../a | |
867 | destination directory: a |
|
867 | destination directory: a | |
868 | updating to branch default |
|
868 | updating to branch default | |
869 | getting changed largefiles |
|
869 | getting changed largefiles | |
870 | 3 largefiles updated, 0 removed |
|
870 | 3 largefiles updated, 0 removed | |
871 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
871 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
872 | $ cd .. |
|
872 | $ cd .. | |
873 |
|
873 | |||
874 | Clone URL without path: |
|
874 | Clone URL without path: | |
875 |
|
875 | |||
876 | $ hg clone file:// |
|
876 | $ hg clone file:// | |
877 | abort: repository / not found! |
|
877 | abort: repository / not found! | |
878 | [255] |
|
878 | [255] | |
879 |
|
879 | |||
880 | Ensure base clone command argument validation |
|
880 | Ensure base clone command argument validation | |
881 |
|
881 | |||
882 | $ hg clone -U -u 0 a a-clone-failure |
|
882 | $ hg clone -U -u 0 a a-clone-failure | |
883 | abort: cannot specify both --noupdate and --updaterev |
|
883 | abort: cannot specify both --noupdate and --updaterev | |
884 | [255] |
|
884 | [255] | |
885 |
|
885 | |||
886 | $ hg clone --all-largefiles a ssh://localhost/a |
|
886 | $ hg clone --all-largefiles a ssh://localhost/a | |
887 | abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a |
|
887 | abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a | |
888 | [255] |
|
888 | [255] | |
889 |
|
889 | |||
890 | Test pulling with --all-largefiles flag. Also test that the largefiles are |
|
890 | Test pulling with --all-largefiles flag. Also test that the largefiles are | |
891 | downloaded from 'default' instead of 'default-push' when no source is specified |
|
891 | downloaded from 'default' instead of 'default-push' when no source is specified | |
892 | (issue3584) |
|
892 | (issue3584) | |
893 |
|
893 | |||
894 | $ rm -Rf a-backup |
|
894 | $ rm -Rf a-backup | |
895 | $ hg clone -r 1 a a-backup |
|
895 | $ hg clone -r 1 a a-backup | |
896 | adding changesets |
|
896 | adding changesets | |
897 | adding manifests |
|
897 | adding manifests | |
898 | adding file changes |
|
898 | adding file changes | |
899 | added 2 changesets with 8 changes to 4 files |
|
899 | added 2 changesets with 8 changes to 4 files | |
900 | updating to branch default |
|
900 | updating to branch default | |
901 | getting changed largefiles |
|
901 | getting changed largefiles | |
902 | 2 largefiles updated, 0 removed |
|
902 | 2 largefiles updated, 0 removed | |
903 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
903 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
904 | $ rm "${USERCACHE}"/* |
|
904 | $ rm "${USERCACHE}"/* | |
905 | $ cd a-backup |
|
905 | $ cd a-backup | |
906 | $ hg pull --all-largefiles --config paths.default-push=bogus/path |
|
906 | $ hg pull --all-largefiles --config paths.default-push=bogus/path | |
907 | pulling from $TESTTMP/a (glob) |
|
907 | pulling from $TESTTMP/a (glob) | |
908 | searching for changes |
|
908 | searching for changes | |
909 | adding changesets |
|
909 | adding changesets | |
910 | adding manifests |
|
910 | adding manifests | |
911 | adding file changes |
|
911 | adding file changes | |
912 | added 6 changesets with 16 changes to 8 files |
|
912 | added 6 changesets with 16 changes to 8 files | |
913 | (run 'hg update' to get a working copy) |
|
913 | (run 'hg update' to get a working copy) | |
914 |
6 |
|
914 | 6 largefiles cached | |
915 |
|
915 | |||
916 | redo pull with --lfrev and check it pulls largefiles for the right revs |
|
916 | redo pull with --lfrev and check it pulls largefiles for the right revs | |
917 |
|
917 | |||
918 | $ hg rollback |
|
918 | $ hg rollback | |
919 | repository tip rolled back to revision 1 (undo pull) |
|
919 | repository tip rolled back to revision 1 (undo pull) | |
920 | $ hg pull -v --lfrev 'heads(pulled())+min(pulled())' |
|
920 | $ hg pull -v --lfrev 'heads(pulled())+min(pulled())' | |
921 | pulling from $TESTTMP/a (glob) |
|
921 | pulling from $TESTTMP/a (glob) | |
922 | searching for changes |
|
922 | searching for changes | |
923 | all local heads known remotely |
|
923 | all local heads known remotely | |
924 | 6 changesets found |
|
924 | 6 changesets found | |
925 | adding changesets |
|
925 | adding changesets | |
926 | adding manifests |
|
926 | adding manifests | |
927 | adding file changes |
|
927 | adding file changes | |
928 | added 6 changesets with 16 changes to 8 files |
|
928 | added 6 changesets with 16 changes to 8 files | |
929 | calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob) |
|
929 | calling hook changegroup.lfiles: <function checkrequireslfiles at *> (glob) | |
930 | (run 'hg update' to get a working copy) |
|
930 | (run 'hg update' to get a working copy) | |
931 | pulling largefiles for revision 7 |
|
931 | pulling largefiles for revision 7 | |
932 | found 971fb41e78fea4f8e0ba5244784239371cb00591 in store |
|
932 | found 971fb41e78fea4f8e0ba5244784239371cb00591 in store | |
933 | found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store |
|
933 | found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store | |
934 | found bb3151689acb10f0c3125c560d5e63df914bc1af in store |
|
934 | found bb3151689acb10f0c3125c560d5e63df914bc1af in store | |
935 | pulling largefiles for revision 2 |
|
935 | pulling largefiles for revision 2 | |
936 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store |
|
936 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store | |
937 | 0 largefiles cached |
|
937 | 0 largefiles cached | |
938 |
|
938 | |||
939 | lfpull |
|
939 | lfpull | |
940 |
|
940 | |||
941 | $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull |
|
941 | $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull | |
942 | 2 largefiles cached |
|
942 | 2 largefiles cached | |
943 | $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull |
|
943 | $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull | |
944 | pulling largefiles for revision 4 |
|
944 | pulling largefiles for revision 4 | |
945 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store |
|
945 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store | |
946 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store |
|
946 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store | |
947 | pulling largefiles for revision 2 |
|
947 | pulling largefiles for revision 2 | |
948 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store |
|
948 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store | |
949 | 0 largefiles cached |
|
949 | 0 largefiles cached | |
950 |
|
950 | |||
951 | $ ls usercache-lfpull/* | sort |
|
951 | $ ls usercache-lfpull/* | sort | |
952 | usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d |
|
952 | usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d | |
953 | usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64 |
|
953 | usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64 | |
954 |
|
954 | |||
955 | $ cd .. |
|
955 | $ cd .. | |
956 |
|
956 | |||
957 | Rebasing between two repositories does not revert largefiles to old |
|
957 | Rebasing between two repositories does not revert largefiles to old | |
958 | revisions (this was a very bad bug that took a lot of work to fix). |
|
958 | revisions (this was a very bad bug that took a lot of work to fix). | |
959 |
|
959 | |||
960 | $ hg clone a d |
|
960 | $ hg clone a d | |
961 | updating to branch default |
|
961 | updating to branch default | |
962 | getting changed largefiles |
|
962 | getting changed largefiles | |
963 | 3 largefiles updated, 0 removed |
|
963 | 3 largefiles updated, 0 removed | |
964 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
964 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
965 | $ cd b |
|
965 | $ cd b | |
966 | $ echo large4-modified > sub/large4 |
|
966 | $ echo large4-modified > sub/large4 | |
967 | $ echo normal3-modified > normal3 |
|
967 | $ echo normal3-modified > normal3 | |
968 | $ hg commit -m "modify normal file and largefile in repo b" |
|
968 | $ hg commit -m "modify normal file and largefile in repo b" | |
969 | Invoking status precommit hook |
|
969 | Invoking status precommit hook | |
970 | M normal3 |
|
970 | M normal3 | |
971 | M sub/large4 |
|
971 | M sub/large4 | |
972 | $ cd ../d |
|
972 | $ cd ../d | |
973 | $ echo large6-modified > sub2/large6 |
|
973 | $ echo large6-modified > sub2/large6 | |
974 | $ echo normal4-modified > sub/normal4 |
|
974 | $ echo normal4-modified > sub/normal4 | |
975 | $ hg commit -m "modify normal file largefile in repo d" |
|
975 | $ hg commit -m "modify normal file largefile in repo d" | |
976 | Invoking status precommit hook |
|
976 | Invoking status precommit hook | |
977 | M sub/normal4 |
|
977 | M sub/normal4 | |
978 | M sub2/large6 |
|
978 | M sub2/large6 | |
979 | $ cd .. |
|
979 | $ cd .. | |
980 | $ hg clone d e |
|
980 | $ hg clone d e | |
981 | updating to branch default |
|
981 | updating to branch default | |
982 | getting changed largefiles |
|
982 | getting changed largefiles | |
983 | 3 largefiles updated, 0 removed |
|
983 | 3 largefiles updated, 0 removed | |
984 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
984 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
985 | $ cd d |
|
985 | $ cd d | |
986 |
|
986 | |||
987 | More rebase testing, but also test that the largefiles are downloaded from |
|
987 | More rebase testing, but also test that the largefiles are downloaded from | |
988 | 'default-push' when no source is specified (issue3584). (The largefile from the |
|
988 | 'default-push' when no source is specified (issue3584). (The largefile from the | |
989 | pulled revision is however not downloaded but found in the local cache.) |
|
989 | pulled revision is however not downloaded but found in the local cache.) | |
990 | Largefiles are fetched for the new pulled revision, not for existing revisions, |
|
990 | Largefiles are fetched for the new pulled revision, not for existing revisions, | |
991 | rebased or not. |
|
991 | rebased or not. | |
992 |
|
992 | |||
993 | $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] |
|
993 | $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] | |
994 | $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b |
|
994 | $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b | |
995 | pulling from $TESTTMP/b (glob) |
|
995 | pulling from $TESTTMP/b (glob) | |
996 | searching for changes |
|
996 | searching for changes | |
997 | adding changesets |
|
997 | adding changesets | |
998 | adding manifests |
|
998 | adding manifests | |
999 | adding file changes |
|
999 | adding file changes | |
1000 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
1000 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
1001 | Invoking status precommit hook |
|
1001 | Invoking status precommit hook | |
1002 | M sub/normal4 |
|
1002 | M sub/normal4 | |
1003 | M sub2/large6 |
|
1003 | M sub2/large6 | |
1004 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
1004 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-backup.hg (glob) | |
1005 |
0 |
|
1005 | 0 largefiles cached | |
1006 | nothing to rebase |
|
1006 | nothing to rebase | |
1007 | $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] |
|
1007 | $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] | |
1008 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
1008 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
1009 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1009 | 9:598410d3eb9a modify normal file largefile in repo d | |
1010 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1010 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1011 | 7:daea875e9014 add/edit more largefiles |
|
1011 | 7:daea875e9014 add/edit more largefiles | |
1012 | 6:4355d653f84f edit files yet again |
|
1012 | 6:4355d653f84f edit files yet again | |
1013 | 5:9d5af5072dbd edit files again |
|
1013 | 5:9d5af5072dbd edit files again | |
1014 | 4:74c02385b94c move files |
|
1014 | 4:74c02385b94c move files | |
1015 | 3:9e8fbc4bce62 copy files |
|
1015 | 3:9e8fbc4bce62 copy files | |
1016 | 2:51a0ae4d5864 remove files |
|
1016 | 2:51a0ae4d5864 remove files | |
1017 | 1:ce8896473775 edit files |
|
1017 | 1:ce8896473775 edit files | |
1018 | 0:30d30fe6a5be add files |
|
1018 | 0:30d30fe6a5be add files | |
1019 | $ cat normal3 |
|
1019 | $ cat normal3 | |
1020 | normal3-modified |
|
1020 | normal3-modified | |
1021 | $ cat sub/normal4 |
|
1021 | $ cat sub/normal4 | |
1022 | normal4-modified |
|
1022 | normal4-modified | |
1023 | $ cat sub/large4 |
|
1023 | $ cat sub/large4 | |
1024 | large4-modified |
|
1024 | large4-modified | |
1025 | $ cat sub2/large6 |
|
1025 | $ cat sub2/large6 | |
1026 | large6-modified |
|
1026 | large6-modified | |
1027 | $ cat sub2/large7 |
|
1027 | $ cat sub2/large7 | |
1028 | large7 |
|
1028 | large7 | |
1029 | $ cd ../e |
|
1029 | $ cd ../e | |
1030 | $ hg pull ../b |
|
1030 | $ hg pull ../b | |
1031 | pulling from ../b |
|
1031 | pulling from ../b | |
1032 | searching for changes |
|
1032 | searching for changes | |
1033 | adding changesets |
|
1033 | adding changesets | |
1034 | adding manifests |
|
1034 | adding manifests | |
1035 | adding file changes |
|
1035 | adding file changes | |
1036 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
1036 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
1037 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
1037 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
1038 | $ hg rebase |
|
1038 | $ hg rebase | |
1039 | Invoking status precommit hook |
|
1039 | Invoking status precommit hook | |
1040 | M sub/normal4 |
|
1040 | M sub/normal4 | |
1041 | M sub2/large6 |
|
1041 | M sub2/large6 | |
1042 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob) |
|
1042 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-backup.hg (glob) | |
1043 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
1043 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
1044 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1044 | 9:598410d3eb9a modify normal file largefile in repo d | |
1045 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1045 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1046 | 7:daea875e9014 add/edit more largefiles |
|
1046 | 7:daea875e9014 add/edit more largefiles | |
1047 | 6:4355d653f84f edit files yet again |
|
1047 | 6:4355d653f84f edit files yet again | |
1048 | 5:9d5af5072dbd edit files again |
|
1048 | 5:9d5af5072dbd edit files again | |
1049 | 4:74c02385b94c move files |
|
1049 | 4:74c02385b94c move files | |
1050 | 3:9e8fbc4bce62 copy files |
|
1050 | 3:9e8fbc4bce62 copy files | |
1051 | 2:51a0ae4d5864 remove files |
|
1051 | 2:51a0ae4d5864 remove files | |
1052 | 1:ce8896473775 edit files |
|
1052 | 1:ce8896473775 edit files | |
1053 | 0:30d30fe6a5be add files |
|
1053 | 0:30d30fe6a5be add files | |
1054 | $ cat normal3 |
|
1054 | $ cat normal3 | |
1055 | normal3-modified |
|
1055 | normal3-modified | |
1056 | $ cat sub/normal4 |
|
1056 | $ cat sub/normal4 | |
1057 | normal4-modified |
|
1057 | normal4-modified | |
1058 | $ cat sub/large4 |
|
1058 | $ cat sub/large4 | |
1059 | large4-modified |
|
1059 | large4-modified | |
1060 | $ cat sub2/large6 |
|
1060 | $ cat sub2/large6 | |
1061 | large6-modified |
|
1061 | large6-modified | |
1062 | $ cat sub2/large7 |
|
1062 | $ cat sub2/large7 | |
1063 | large7 |
|
1063 | large7 | |
1064 |
|
1064 | |||
1065 | Log on largefiles |
|
1065 | Log on largefiles | |
1066 |
|
1066 | |||
1067 | - same output |
|
1067 | - same output | |
1068 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 |
|
1068 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 | |
1069 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1069 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1070 | 6:4355d653f84f edit files yet again |
|
1070 | 6:4355d653f84f edit files yet again | |
1071 | 5:9d5af5072dbd edit files again |
|
1071 | 5:9d5af5072dbd edit files again | |
1072 | 4:74c02385b94c move files |
|
1072 | 4:74c02385b94c move files | |
1073 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4 |
|
1073 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4 | |
1074 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1074 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1075 | 6:4355d653f84f edit files yet again |
|
1075 | 6:4355d653f84f edit files yet again | |
1076 | 5:9d5af5072dbd edit files again |
|
1076 | 5:9d5af5072dbd edit files again | |
1077 | 4:74c02385b94c move files |
|
1077 | 4:74c02385b94c move files | |
1078 |
|
1078 | |||
1079 | - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal |
|
1079 | - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal | |
1080 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub |
|
1080 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub | |
1081 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1081 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1082 | 6:4355d653f84f edit files yet again |
|
1082 | 6:4355d653f84f edit files yet again | |
1083 | 5:9d5af5072dbd edit files again |
|
1083 | 5:9d5af5072dbd edit files again | |
1084 | 4:74c02385b94c move files |
|
1084 | 4:74c02385b94c move files | |
1085 | 1:ce8896473775 edit files |
|
1085 | 1:ce8896473775 edit files | |
1086 | 0:30d30fe6a5be add files |
|
1086 | 0:30d30fe6a5be add files | |
1087 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub |
|
1087 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub | |
1088 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1088 | 9:598410d3eb9a modify normal file largefile in repo d | |
1089 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1089 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1090 | 6:4355d653f84f edit files yet again |
|
1090 | 6:4355d653f84f edit files yet again | |
1091 | 5:9d5af5072dbd edit files again |
|
1091 | 5:9d5af5072dbd edit files again | |
1092 | 4:74c02385b94c move files |
|
1092 | 4:74c02385b94c move files | |
1093 | 1:ce8896473775 edit files |
|
1093 | 1:ce8896473775 edit files | |
1094 | 0:30d30fe6a5be add files |
|
1094 | 0:30d30fe6a5be add files | |
1095 |
|
1095 | |||
1096 | - globbing gives same result |
|
1096 | - globbing gives same result | |
1097 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*' |
|
1097 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*' | |
1098 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1098 | 9:598410d3eb9a modify normal file largefile in repo d | |
1099 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1099 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1100 | 6:4355d653f84f edit files yet again |
|
1100 | 6:4355d653f84f edit files yet again | |
1101 | 5:9d5af5072dbd edit files again |
|
1101 | 5:9d5af5072dbd edit files again | |
1102 | 4:74c02385b94c move files |
|
1102 | 4:74c02385b94c move files | |
1103 | 1:ce8896473775 edit files |
|
1103 | 1:ce8896473775 edit files | |
1104 | 0:30d30fe6a5be add files |
|
1104 | 0:30d30fe6a5be add files | |
1105 |
|
1105 | |||
1106 | Rollback on largefiles. |
|
1106 | Rollback on largefiles. | |
1107 |
|
1107 | |||
1108 | $ echo large4-modified-again > sub/large4 |
|
1108 | $ echo large4-modified-again > sub/large4 | |
1109 | $ hg commit -m "Modify large4 again" |
|
1109 | $ hg commit -m "Modify large4 again" | |
1110 | Invoking status precommit hook |
|
1110 | Invoking status precommit hook | |
1111 | M sub/large4 |
|
1111 | M sub/large4 | |
1112 | $ hg rollback |
|
1112 | $ hg rollback | |
1113 | repository tip rolled back to revision 9 (undo commit) |
|
1113 | repository tip rolled back to revision 9 (undo commit) | |
1114 | working directory now based on revision 9 |
|
1114 | working directory now based on revision 9 | |
1115 | $ hg st |
|
1115 | $ hg st | |
1116 | M sub/large4 |
|
1116 | M sub/large4 | |
1117 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
1117 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
1118 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1118 | 9:598410d3eb9a modify normal file largefile in repo d | |
1119 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1119 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1120 | 7:daea875e9014 add/edit more largefiles |
|
1120 | 7:daea875e9014 add/edit more largefiles | |
1121 | 6:4355d653f84f edit files yet again |
|
1121 | 6:4355d653f84f edit files yet again | |
1122 | 5:9d5af5072dbd edit files again |
|
1122 | 5:9d5af5072dbd edit files again | |
1123 | 4:74c02385b94c move files |
|
1123 | 4:74c02385b94c move files | |
1124 | 3:9e8fbc4bce62 copy files |
|
1124 | 3:9e8fbc4bce62 copy files | |
1125 | 2:51a0ae4d5864 remove files |
|
1125 | 2:51a0ae4d5864 remove files | |
1126 | 1:ce8896473775 edit files |
|
1126 | 1:ce8896473775 edit files | |
1127 | 0:30d30fe6a5be add files |
|
1127 | 0:30d30fe6a5be add files | |
1128 | $ cat sub/large4 |
|
1128 | $ cat sub/large4 | |
1129 | large4-modified-again |
|
1129 | large4-modified-again | |
1130 |
|
1130 | |||
1131 | "update --check" refuses to update with uncommitted changes. |
|
1131 | "update --check" refuses to update with uncommitted changes. | |
1132 | $ hg update --check 8 |
|
1132 | $ hg update --check 8 | |
1133 | abort: uncommitted local changes |
|
1133 | abort: uncommitted local changes | |
1134 | [255] |
|
1134 | [255] | |
1135 |
|
1135 | |||
1136 | "update --clean" leaves correct largefiles in working copy, even when there is |
|
1136 | "update --clean" leaves correct largefiles in working copy, even when there is | |
1137 | .orig files from revert in .hglf. |
|
1137 | .orig files from revert in .hglf. | |
1138 |
|
1138 | |||
1139 | $ echo mistake > sub2/large7 |
|
1139 | $ echo mistake > sub2/large7 | |
1140 | $ hg revert sub2/large7 |
|
1140 | $ hg revert sub2/large7 | |
1141 | $ hg -q update --clean -r null |
|
1141 | $ hg -q update --clean -r null | |
1142 | $ hg update --clean |
|
1142 | $ hg update --clean | |
1143 | getting changed largefiles |
|
1143 | getting changed largefiles | |
1144 | 3 largefiles updated, 0 removed |
|
1144 | 3 largefiles updated, 0 removed | |
1145 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1145 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1146 | $ cat normal3 |
|
1146 | $ cat normal3 | |
1147 | normal3-modified |
|
1147 | normal3-modified | |
1148 | $ cat sub/normal4 |
|
1148 | $ cat sub/normal4 | |
1149 | normal4-modified |
|
1149 | normal4-modified | |
1150 | $ cat sub/large4 |
|
1150 | $ cat sub/large4 | |
1151 | large4-modified |
|
1151 | large4-modified | |
1152 | $ cat sub2/large6 |
|
1152 | $ cat sub2/large6 | |
1153 | large6-modified |
|
1153 | large6-modified | |
1154 | $ cat sub2/large7 |
|
1154 | $ cat sub2/large7 | |
1155 | large7 |
|
1155 | large7 | |
1156 | $ cat sub2/large7.orig |
|
1156 | $ cat sub2/large7.orig | |
1157 | mistake |
|
1157 | mistake | |
1158 | $ cat .hglf/sub2/large7.orig |
|
1158 | $ cat .hglf/sub2/large7.orig | |
1159 | 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31 |
|
1159 | 9dbfb2c79b1c40981b258c3efa1b10b03f18ad31 | |
1160 |
|
1160 | |||
1161 | demonstrate misfeature: .orig file is overwritten on every update -C, |
|
1161 | demonstrate misfeature: .orig file is overwritten on every update -C, | |
1162 | also when clean: |
|
1162 | also when clean: | |
1163 | $ hg update --clean |
|
1163 | $ hg update --clean | |
1164 | getting changed largefiles |
|
1164 | getting changed largefiles | |
1165 | 0 largefiles updated, 0 removed |
|
1165 | 0 largefiles updated, 0 removed | |
1166 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1166 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1167 | $ cat sub2/large7.orig |
|
1167 | $ cat sub2/large7.orig | |
1168 | large7 |
|
1168 | large7 | |
1169 | $ rm sub2/large7.orig .hglf/sub2/large7.orig |
|
1169 | $ rm sub2/large7.orig .hglf/sub2/large7.orig | |
1170 |
|
1170 | |||
1171 | Now "update check" is happy. |
|
1171 | Now "update check" is happy. | |
1172 | $ hg update --check 8 |
|
1172 | $ hg update --check 8 | |
1173 | getting changed largefiles |
|
1173 | getting changed largefiles | |
1174 | 1 largefiles updated, 0 removed |
|
1174 | 1 largefiles updated, 0 removed | |
1175 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1175 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1176 | $ hg update --check |
|
1176 | $ hg update --check | |
1177 | getting changed largefiles |
|
1177 | getting changed largefiles | |
1178 | 1 largefiles updated, 0 removed |
|
1178 | 1 largefiles updated, 0 removed | |
1179 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1179 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1180 |
|
1180 | |||
1181 | Test removing empty largefiles directories on update |
|
1181 | Test removing empty largefiles directories on update | |
1182 | $ test -d sub2 && echo "sub2 exists" |
|
1182 | $ test -d sub2 && echo "sub2 exists" | |
1183 | sub2 exists |
|
1183 | sub2 exists | |
1184 | $ hg update -q null |
|
1184 | $ hg update -q null | |
1185 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
1185 | $ test -d sub2 && echo "error: sub2 should not exist anymore" | |
1186 | [1] |
|
1186 | [1] | |
1187 | $ hg update -q |
|
1187 | $ hg update -q | |
1188 |
|
1188 | |||
1189 | Test hg remove removes empty largefiles directories |
|
1189 | Test hg remove removes empty largefiles directories | |
1190 | $ test -d sub2 && echo "sub2 exists" |
|
1190 | $ test -d sub2 && echo "sub2 exists" | |
1191 | sub2 exists |
|
1191 | sub2 exists | |
1192 | $ hg remove sub2/* |
|
1192 | $ hg remove sub2/* | |
1193 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
1193 | $ test -d sub2 && echo "error: sub2 should not exist anymore" | |
1194 | [1] |
|
1194 | [1] | |
1195 | $ hg revert sub2/large6 sub2/large7 |
|
1195 | $ hg revert sub2/large6 sub2/large7 | |
1196 |
|
1196 | |||
1197 | "revert" works on largefiles (and normal files too). |
|
1197 | "revert" works on largefiles (and normal files too). | |
1198 | $ echo hack3 >> normal3 |
|
1198 | $ echo hack3 >> normal3 | |
1199 | $ echo hack4 >> sub/normal4 |
|
1199 | $ echo hack4 >> sub/normal4 | |
1200 | $ echo hack4 >> sub/large4 |
|
1200 | $ echo hack4 >> sub/large4 | |
1201 | $ rm sub2/large6 |
|
1201 | $ rm sub2/large6 | |
1202 | $ hg revert sub2/large6 |
|
1202 | $ hg revert sub2/large6 | |
1203 | $ hg rm sub2/large6 |
|
1203 | $ hg rm sub2/large6 | |
1204 | $ echo new >> sub2/large8 |
|
1204 | $ echo new >> sub2/large8 | |
1205 | $ hg add --large sub2/large8 |
|
1205 | $ hg add --large sub2/large8 | |
1206 | # XXX we don't really want to report that we're reverting the standin; |
|
1206 | # XXX we don't really want to report that we're reverting the standin; | |
1207 | # that's just an implementation detail. But I don't see an obvious fix. ;-( |
|
1207 | # that's just an implementation detail. But I don't see an obvious fix. ;-( | |
1208 | $ hg revert sub |
|
1208 | $ hg revert sub | |
1209 | reverting .hglf/sub/large4 (glob) |
|
1209 | reverting .hglf/sub/large4 (glob) | |
1210 | reverting sub/normal4 (glob) |
|
1210 | reverting sub/normal4 (glob) | |
1211 | $ hg status |
|
1211 | $ hg status | |
1212 | M normal3 |
|
1212 | M normal3 | |
1213 | A sub2/large8 |
|
1213 | A sub2/large8 | |
1214 | R sub2/large6 |
|
1214 | R sub2/large6 | |
1215 | ? sub/large4.orig |
|
1215 | ? sub/large4.orig | |
1216 | ? sub/normal4.orig |
|
1216 | ? sub/normal4.orig | |
1217 | $ cat sub/normal4 |
|
1217 | $ cat sub/normal4 | |
1218 | normal4-modified |
|
1218 | normal4-modified | |
1219 | $ cat sub/large4 |
|
1219 | $ cat sub/large4 | |
1220 | large4-modified |
|
1220 | large4-modified | |
1221 | $ hg revert -a --no-backup |
|
1221 | $ hg revert -a --no-backup | |
1222 | undeleting .hglf/sub2/large6 (glob) |
|
1222 | undeleting .hglf/sub2/large6 (glob) | |
1223 | forgetting .hglf/sub2/large8 (glob) |
|
1223 | forgetting .hglf/sub2/large8 (glob) | |
1224 | reverting normal3 |
|
1224 | reverting normal3 | |
1225 | $ hg status |
|
1225 | $ hg status | |
1226 | ? sub/large4.orig |
|
1226 | ? sub/large4.orig | |
1227 | ? sub/normal4.orig |
|
1227 | ? sub/normal4.orig | |
1228 | ? sub2/large8 |
|
1228 | ? sub2/large8 | |
1229 | $ cat normal3 |
|
1229 | $ cat normal3 | |
1230 | normal3-modified |
|
1230 | normal3-modified | |
1231 | $ cat sub2/large6 |
|
1231 | $ cat sub2/large6 | |
1232 | large6-modified |
|
1232 | large6-modified | |
1233 | $ rm sub/*.orig sub2/large8 |
|
1233 | $ rm sub/*.orig sub2/large8 | |
1234 |
|
1234 | |||
1235 | revert some files to an older revision |
|
1235 | revert some files to an older revision | |
1236 | $ hg revert --no-backup -r 8 sub2 |
|
1236 | $ hg revert --no-backup -r 8 sub2 | |
1237 | reverting .hglf/sub2/large6 (glob) |
|
1237 | reverting .hglf/sub2/large6 (glob) | |
1238 | $ cat sub2/large6 |
|
1238 | $ cat sub2/large6 | |
1239 | large6 |
|
1239 | large6 | |
1240 | $ hg revert --no-backup -C -r '.^' sub2 |
|
1240 | $ hg revert --no-backup -C -r '.^' sub2 | |
1241 | reverting .hglf/sub2/large6 (glob) |
|
1241 | reverting .hglf/sub2/large6 (glob) | |
1242 | $ hg revert --no-backup sub2 |
|
1242 | $ hg revert --no-backup sub2 | |
1243 | reverting .hglf/sub2/large6 (glob) |
|
1243 | reverting .hglf/sub2/large6 (glob) | |
1244 | $ hg status |
|
1244 | $ hg status | |
1245 |
|
1245 | |||
1246 | "verify --large" actually verifies largefiles |
|
1246 | "verify --large" actually verifies largefiles | |
1247 |
|
1247 | |||
1248 | - Where Do We Come From? What Are We? Where Are We Going? |
|
1248 | - Where Do We Come From? What Are We? Where Are We Going? | |
1249 | $ pwd |
|
1249 | $ pwd | |
1250 | $TESTTMP/e |
|
1250 | $TESTTMP/e | |
1251 | $ hg paths |
|
1251 | $ hg paths | |
1252 | default = $TESTTMP/d (glob) |
|
1252 | default = $TESTTMP/d (glob) | |
1253 |
|
1253 | |||
1254 | $ hg verify --large |
|
1254 | $ hg verify --large | |
1255 | checking changesets |
|
1255 | checking changesets | |
1256 | checking manifests |
|
1256 | checking manifests | |
1257 | crosschecking files in changesets and manifests |
|
1257 | crosschecking files in changesets and manifests | |
1258 | checking files |
|
1258 | checking files | |
1259 | 10 files, 10 changesets, 28 total revisions |
|
1259 | 10 files, 10 changesets, 28 total revisions | |
1260 | searching 1 changesets for largefiles |
|
1260 | searching 1 changesets for largefiles | |
1261 | verified existence of 3 revisions of 3 largefiles |
|
1261 | verified existence of 3 revisions of 3 largefiles | |
1262 |
|
1262 | |||
1263 | - introduce missing blob in local store repo and make sure that this is caught: |
|
1263 | - introduce missing blob in local store repo and make sure that this is caught: | |
1264 | $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 . |
|
1264 | $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 . | |
1265 | $ hg verify --large |
|
1265 | $ hg verify --large | |
1266 | checking changesets |
|
1266 | checking changesets | |
1267 | checking manifests |
|
1267 | checking manifests | |
1268 | crosschecking files in changesets and manifests |
|
1268 | crosschecking files in changesets and manifests | |
1269 | checking files |
|
1269 | checking files | |
1270 | 10 files, 10 changesets, 28 total revisions |
|
1270 | 10 files, 10 changesets, 28 total revisions | |
1271 | searching 1 changesets for largefiles |
|
1271 | searching 1 changesets for largefiles | |
1272 | changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob) |
|
1272 | changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob) | |
1273 | verified existence of 3 revisions of 3 largefiles |
|
1273 | verified existence of 3 revisions of 3 largefiles | |
1274 | [1] |
|
1274 | [1] | |
1275 |
|
1275 | |||
1276 | - introduce corruption and make sure that it is caught when checking content: |
|
1276 | - introduce corruption and make sure that it is caught when checking content: | |
1277 | $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 |
|
1277 | $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 | |
1278 | $ hg verify -q --large --lfc |
|
1278 | $ hg verify -q --large --lfc | |
1279 | changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob) |
|
1279 | changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 (glob) | |
1280 | [1] |
|
1280 | [1] | |
1281 |
|
1281 | |||
1282 | - cleanup |
|
1282 | - cleanup | |
1283 | $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/ |
|
1283 | $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/ | |
1284 |
|
1284 | |||
1285 | - verifying all revisions will fail because we didn't clone all largefiles to d: |
|
1285 | - verifying all revisions will fail because we didn't clone all largefiles to d: | |
1286 | $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
1286 | $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
1287 | $ hg verify -q --lfa --lfc |
|
1287 | $ hg verify -q --lfa --lfc | |
1288 | changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob) |
|
1288 | changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 (glob) | |
1289 | changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob) |
|
1289 | changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d (glob) | |
1290 | changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob) |
|
1290 | changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f (glob) | |
1291 | changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob) |
|
1291 | changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob) | |
1292 | changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob) |
|
1292 | changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob) | |
1293 | changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob) |
|
1293 | changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob) | |
1294 | changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob) |
|
1294 | changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 (glob) | |
1295 | changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob) |
|
1295 | changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c (glob) | |
1296 | changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob) |
|
1296 | changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 (glob) | |
1297 | changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob) |
|
1297 | changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 (glob) | |
1298 | [1] |
|
1298 | [1] | |
1299 |
|
1299 | |||
1300 | - cleanup |
|
1300 | - cleanup | |
1301 | $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
1301 | $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
1302 | $ rm -f .hglf/sub/*.orig |
|
1302 | $ rm -f .hglf/sub/*.orig | |
1303 |
|
1303 | |||
1304 | Update to revision with missing largefile - and make sure it really is missing |
|
1304 | Update to revision with missing largefile - and make sure it really is missing | |
1305 |
|
1305 | |||
1306 | $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0 |
|
1306 | $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
1307 | $ hg up -r 6 |
|
1307 | $ hg up -r 6 | |
1308 | getting changed largefiles |
|
1308 | getting changed largefiles | |
1309 | error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob) |
|
1309 | error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob) | |
1310 | 1 largefiles updated, 2 removed |
|
1310 | 1 largefiles updated, 2 removed | |
1311 | 4 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1311 | 4 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1312 | $ rm normal3 |
|
1312 | $ rm normal3 | |
1313 | $ echo >> sub/normal4 |
|
1313 | $ echo >> sub/normal4 | |
1314 | $ hg ci -m 'commit with missing files' |
|
1314 | $ hg ci -m 'commit with missing files' | |
1315 | Invoking status precommit hook |
|
1315 | Invoking status precommit hook | |
1316 | M sub/normal4 |
|
1316 | M sub/normal4 | |
1317 | ! large3 |
|
1317 | ! large3 | |
1318 | ! normal3 |
|
1318 | ! normal3 | |
1319 | created new head |
|
1319 | created new head | |
1320 | $ hg st |
|
1320 | $ hg st | |
1321 | ! large3 |
|
1321 | ! large3 | |
1322 | ! normal3 |
|
1322 | ! normal3 | |
1323 | $ hg up -r. |
|
1323 | $ hg up -r. | |
1324 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1324 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1325 | $ hg st |
|
1325 | $ hg st | |
1326 | ! large3 |
|
1326 | ! large3 | |
1327 | ! normal3 |
|
1327 | ! normal3 | |
1328 | $ hg up -Cr. |
|
1328 | $ hg up -Cr. | |
1329 | getting changed largefiles |
|
1329 | getting changed largefiles | |
1330 | error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob) |
|
1330 | error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob) | |
1331 | 0 largefiles updated, 0 removed |
|
1331 | 0 largefiles updated, 0 removed | |
1332 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1332 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1333 | $ hg st |
|
1333 | $ hg st | |
1334 | ! large3 |
|
1334 | ! large3 | |
1335 | $ hg rollback |
|
1335 | $ hg rollback | |
1336 | repository tip rolled back to revision 9 (undo commit) |
|
1336 | repository tip rolled back to revision 9 (undo commit) | |
1337 | working directory now based on revision 6 |
|
1337 | working directory now based on revision 6 | |
1338 |
|
1338 | |||
1339 | Merge with revision with missing largefile - and make sure it tries to fetch it. |
|
1339 | Merge with revision with missing largefile - and make sure it tries to fetch it. | |
1340 |
|
1340 | |||
1341 | $ hg up -Cqr null |
|
1341 | $ hg up -Cqr null | |
1342 | $ echo f > f |
|
1342 | $ echo f > f | |
1343 | $ hg ci -Am branch |
|
1343 | $ hg ci -Am branch | |
1344 | adding f |
|
1344 | adding f | |
1345 | Invoking status precommit hook |
|
1345 | Invoking status precommit hook | |
1346 | A f |
|
1346 | A f | |
1347 | created new head |
|
1347 | created new head | |
1348 | $ hg merge -r 6 |
|
1348 | $ hg merge -r 6 | |
1349 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1349 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1350 | (branch merge, don't forget to commit) |
|
1350 | (branch merge, don't forget to commit) | |
1351 | getting changed largefiles |
|
1351 | getting changed largefiles | |
1352 | error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob) |
|
1352 | error getting id 7838695e10da2bb75ac1156565f40a2595fa2fa0 from url file:$TESTTMP/d for file large3: can't get file locally (glob) | |
1353 | 1 largefiles updated, 0 removed |
|
1353 | 1 largefiles updated, 0 removed | |
1354 |
|
1354 | |||
1355 | $ hg rollback -q |
|
1355 | $ hg rollback -q | |
1356 | $ hg up -Cq |
|
1356 | $ hg up -Cq | |
1357 |
|
1357 | |||
1358 | Pulling 0 revisions with --all-largefiles should not fetch for all revisions |
|
1358 | Pulling 0 revisions with --all-largefiles should not fetch for all revisions | |
1359 |
|
1359 | |||
1360 | $ hg pull --all-largefiles |
|
1360 | $ hg pull --all-largefiles | |
1361 | pulling from $TESTTMP/d (glob) |
|
1361 | pulling from $TESTTMP/d (glob) | |
1362 | searching for changes |
|
1362 | searching for changes | |
1363 | no changes found |
|
1363 | no changes found | |
1364 | 0 additional largefiles cached |
|
|||
1365 |
|
1364 | |||
1366 | Merging does not revert to old versions of largefiles and also check |
|
1365 | Merging does not revert to old versions of largefiles and also check | |
1367 | that merging after having pulled from a non-default remote works |
|
1366 | that merging after having pulled from a non-default remote works | |
1368 | correctly. |
|
1367 | correctly. | |
1369 |
|
1368 | |||
1370 | $ cd .. |
|
1369 | $ cd .. | |
1371 | $ hg clone -r 7 e temp |
|
1370 | $ hg clone -r 7 e temp | |
1372 | adding changesets |
|
1371 | adding changesets | |
1373 | adding manifests |
|
1372 | adding manifests | |
1374 | adding file changes |
|
1373 | adding file changes | |
1375 | added 8 changesets with 24 changes to 10 files |
|
1374 | added 8 changesets with 24 changes to 10 files | |
1376 | updating to branch default |
|
1375 | updating to branch default | |
1377 | getting changed largefiles |
|
1376 | getting changed largefiles | |
1378 | 3 largefiles updated, 0 removed |
|
1377 | 3 largefiles updated, 0 removed | |
1379 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1378 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1380 | $ hg clone temp f |
|
1379 | $ hg clone temp f | |
1381 | updating to branch default |
|
1380 | updating to branch default | |
1382 | getting changed largefiles |
|
1381 | getting changed largefiles | |
1383 | 3 largefiles updated, 0 removed |
|
1382 | 3 largefiles updated, 0 removed | |
1384 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1383 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1385 | # Delete the largefiles in the largefiles system cache so that we have an |
|
1384 | # Delete the largefiles in the largefiles system cache so that we have an | |
1386 | # opportunity to test that caching after a pull works. |
|
1385 | # opportunity to test that caching after a pull works. | |
1387 | $ rm "${USERCACHE}"/* |
|
1386 | $ rm "${USERCACHE}"/* | |
1388 | $ cd f |
|
1387 | $ cd f | |
1389 | $ echo "large4-merge-test" > sub/large4 |
|
1388 | $ echo "large4-merge-test" > sub/large4 | |
1390 | $ hg commit -m "Modify large4 to test merge" |
|
1389 | $ hg commit -m "Modify large4 to test merge" | |
1391 | Invoking status precommit hook |
|
1390 | Invoking status precommit hook | |
1392 | M sub/large4 |
|
1391 | M sub/large4 | |
1393 | # Test --cache-largefiles flag |
|
1392 | # Test --cache-largefiles flag | |
1394 | $ hg pull --lfrev 'heads(pulled())' ../e |
|
1393 | $ hg pull --lfrev 'heads(pulled())' ../e | |
1395 | pulling from ../e |
|
1394 | pulling from ../e | |
1396 | searching for changes |
|
1395 | searching for changes | |
1397 | adding changesets |
|
1396 | adding changesets | |
1398 | adding manifests |
|
1397 | adding manifests | |
1399 | adding file changes |
|
1398 | adding file changes | |
1400 | added 2 changesets with 4 changes to 4 files (+1 heads) |
|
1399 | added 2 changesets with 4 changes to 4 files (+1 heads) | |
1401 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
1400 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
1402 | 2 largefiles cached |
|
1401 | 2 largefiles cached | |
1403 | $ hg merge |
|
1402 | $ hg merge | |
1404 | merging sub/large4 |
|
1403 | merging sub/large4 | |
1405 | largefile sub/large4 has a merge conflict |
|
1404 | largefile sub/large4 has a merge conflict | |
1406 | keep (l)ocal or take (o)ther? l |
|
1405 | keep (l)ocal or take (o)ther? l | |
1407 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1406 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
1408 | (branch merge, don't forget to commit) |
|
1407 | (branch merge, don't forget to commit) | |
1409 | getting changed largefiles |
|
1408 | getting changed largefiles | |
1410 | 1 largefiles updated, 0 removed |
|
1409 | 1 largefiles updated, 0 removed | |
1411 | $ hg commit -m "Merge repos e and f" |
|
1410 | $ hg commit -m "Merge repos e and f" | |
1412 | Invoking status precommit hook |
|
1411 | Invoking status precommit hook | |
1413 | M normal3 |
|
1412 | M normal3 | |
1414 | M sub/normal4 |
|
1413 | M sub/normal4 | |
1415 | M sub2/large6 |
|
1414 | M sub2/large6 | |
1416 | $ cat normal3 |
|
1415 | $ cat normal3 | |
1417 | normal3-modified |
|
1416 | normal3-modified | |
1418 | $ cat sub/normal4 |
|
1417 | $ cat sub/normal4 | |
1419 | normal4-modified |
|
1418 | normal4-modified | |
1420 | $ cat sub/large4 |
|
1419 | $ cat sub/large4 | |
1421 | large4-merge-test |
|
1420 | large4-merge-test | |
1422 | $ cat sub2/large6 |
|
1421 | $ cat sub2/large6 | |
1423 | large6-modified |
|
1422 | large6-modified | |
1424 | $ cat sub2/large7 |
|
1423 | $ cat sub2/large7 | |
1425 | large7 |
|
1424 | large7 | |
1426 |
|
1425 | |||
1427 | Test status after merging with a branch that introduces a new largefile: |
|
1426 | Test status after merging with a branch that introduces a new largefile: | |
1428 |
|
1427 | |||
1429 | $ echo large > large |
|
1428 | $ echo large > large | |
1430 | $ hg add --large large |
|
1429 | $ hg add --large large | |
1431 | $ hg commit -m 'add largefile' |
|
1430 | $ hg commit -m 'add largefile' | |
1432 | Invoking status precommit hook |
|
1431 | Invoking status precommit hook | |
1433 | A large |
|
1432 | A large | |
1434 | $ hg update -q ".^" |
|
1433 | $ hg update -q ".^" | |
1435 | $ echo change >> normal3 |
|
1434 | $ echo change >> normal3 | |
1436 | $ hg commit -m 'some change' |
|
1435 | $ hg commit -m 'some change' | |
1437 | Invoking status precommit hook |
|
1436 | Invoking status precommit hook | |
1438 | M normal3 |
|
1437 | M normal3 | |
1439 | created new head |
|
1438 | created new head | |
1440 | $ hg merge |
|
1439 | $ hg merge | |
1441 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1440 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1442 | (branch merge, don't forget to commit) |
|
1441 | (branch merge, don't forget to commit) | |
1443 | getting changed largefiles |
|
1442 | getting changed largefiles | |
1444 | 1 largefiles updated, 0 removed |
|
1443 | 1 largefiles updated, 0 removed | |
1445 | $ hg status |
|
1444 | $ hg status | |
1446 | M large |
|
1445 | M large | |
1447 |
|
1446 | |||
1448 | - make sure update of merge with removed largefiles fails as expected |
|
1447 | - make sure update of merge with removed largefiles fails as expected | |
1449 | $ hg rm sub2/large6 |
|
1448 | $ hg rm sub2/large6 | |
1450 | $ hg up -r. |
|
1449 | $ hg up -r. | |
1451 | abort: outstanding uncommitted merges |
|
1450 | abort: outstanding uncommitted merges | |
1452 | [255] |
|
1451 | [255] | |
1453 |
|
1452 | |||
1454 | - revert should be able to revert files introduced in a pending merge |
|
1453 | - revert should be able to revert files introduced in a pending merge | |
1455 | $ hg revert --all -r . |
|
1454 | $ hg revert --all -r . | |
1456 | removing .hglf/large (glob) |
|
1455 | removing .hglf/large (glob) | |
1457 | undeleting .hglf/sub2/large6 (glob) |
|
1456 | undeleting .hglf/sub2/large6 (glob) | |
1458 |
|
1457 | |||
1459 | Test that a normal file and a largefile with the same name and path cannot |
|
1458 | Test that a normal file and a largefile with the same name and path cannot | |
1460 | coexist. |
|
1459 | coexist. | |
1461 |
|
1460 | |||
1462 | $ rm sub2/large7 |
|
1461 | $ rm sub2/large7 | |
1463 | $ echo "largeasnormal" > sub2/large7 |
|
1462 | $ echo "largeasnormal" > sub2/large7 | |
1464 | $ hg add sub2/large7 |
|
1463 | $ hg add sub2/large7 | |
1465 | sub2/large7 already a largefile |
|
1464 | sub2/large7 already a largefile | |
1466 |
|
1465 | |||
1467 | Test that transplanting a largefile change works correctly. |
|
1466 | Test that transplanting a largefile change works correctly. | |
1468 |
|
1467 | |||
1469 | $ cd .. |
|
1468 | $ cd .. | |
1470 | $ hg clone -r 8 d g |
|
1469 | $ hg clone -r 8 d g | |
1471 | adding changesets |
|
1470 | adding changesets | |
1472 | adding manifests |
|
1471 | adding manifests | |
1473 | adding file changes |
|
1472 | adding file changes | |
1474 | added 9 changesets with 26 changes to 10 files |
|
1473 | added 9 changesets with 26 changes to 10 files | |
1475 | updating to branch default |
|
1474 | updating to branch default | |
1476 | getting changed largefiles |
|
1475 | getting changed largefiles | |
1477 | 3 largefiles updated, 0 removed |
|
1476 | 3 largefiles updated, 0 removed | |
1478 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1477 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1479 | $ cd g |
|
1478 | $ cd g | |
1480 | $ hg transplant -s ../d 598410d3eb9a |
|
1479 | $ hg transplant -s ../d 598410d3eb9a | |
1481 | searching for changes |
|
1480 | searching for changes | |
1482 | searching for changes |
|
1481 | searching for changes | |
1483 | adding changesets |
|
1482 | adding changesets | |
1484 | adding manifests |
|
1483 | adding manifests | |
1485 | adding file changes |
|
1484 | adding file changes | |
1486 | added 1 changesets with 2 changes to 2 files |
|
1485 | added 1 changesets with 2 changes to 2 files | |
1487 | getting changed largefiles |
|
1486 | getting changed largefiles | |
1488 | 1 largefiles updated, 0 removed |
|
1487 | 1 largefiles updated, 0 removed | |
1489 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
1488 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
1490 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1489 | 9:598410d3eb9a modify normal file largefile in repo d | |
1491 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1490 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1492 | 7:daea875e9014 add/edit more largefiles |
|
1491 | 7:daea875e9014 add/edit more largefiles | |
1493 | 6:4355d653f84f edit files yet again |
|
1492 | 6:4355d653f84f edit files yet again | |
1494 | 5:9d5af5072dbd edit files again |
|
1493 | 5:9d5af5072dbd edit files again | |
1495 | 4:74c02385b94c move files |
|
1494 | 4:74c02385b94c move files | |
1496 | 3:9e8fbc4bce62 copy files |
|
1495 | 3:9e8fbc4bce62 copy files | |
1497 | 2:51a0ae4d5864 remove files |
|
1496 | 2:51a0ae4d5864 remove files | |
1498 | 1:ce8896473775 edit files |
|
1497 | 1:ce8896473775 edit files | |
1499 | 0:30d30fe6a5be add files |
|
1498 | 0:30d30fe6a5be add files | |
1500 | $ cat normal3 |
|
1499 | $ cat normal3 | |
1501 | normal3-modified |
|
1500 | normal3-modified | |
1502 | $ cat sub/normal4 |
|
1501 | $ cat sub/normal4 | |
1503 | normal4-modified |
|
1502 | normal4-modified | |
1504 | $ cat sub/large4 |
|
1503 | $ cat sub/large4 | |
1505 | large4-modified |
|
1504 | large4-modified | |
1506 | $ cat sub2/large6 |
|
1505 | $ cat sub2/large6 | |
1507 | large6-modified |
|
1506 | large6-modified | |
1508 | $ cat sub2/large7 |
|
1507 | $ cat sub2/large7 | |
1509 | large7 |
|
1508 | large7 | |
1510 |
|
1509 | |||
1511 | Cat a largefile |
|
1510 | Cat a largefile | |
1512 | $ hg cat normal3 |
|
1511 | $ hg cat normal3 | |
1513 | normal3-modified |
|
1512 | normal3-modified | |
1514 | $ hg cat sub/large4 |
|
1513 | $ hg cat sub/large4 | |
1515 | large4-modified |
|
1514 | large4-modified | |
1516 | $ rm "${USERCACHE}"/* |
|
1515 | $ rm "${USERCACHE}"/* | |
1517 | $ hg cat -r a381d2c8c80e -o cat.out sub/large4 |
|
1516 | $ hg cat -r a381d2c8c80e -o cat.out sub/large4 | |
1518 | $ cat cat.out |
|
1517 | $ cat cat.out | |
1519 | large4-modified |
|
1518 | large4-modified | |
1520 | $ rm cat.out |
|
1519 | $ rm cat.out | |
1521 | $ hg cat -r a381d2c8c80e normal3 |
|
1520 | $ hg cat -r a381d2c8c80e normal3 | |
1522 | normal3-modified |
|
1521 | normal3-modified | |
1523 | $ hg cat -r '.^' normal3 |
|
1522 | $ hg cat -r '.^' normal3 | |
1524 | normal3-modified |
|
1523 | normal3-modified | |
1525 | $ hg cat -r '.^' sub/large4 doesntexist |
|
1524 | $ hg cat -r '.^' sub/large4 doesntexist | |
1526 | large4-modified |
|
1525 | large4-modified | |
1527 | doesntexist: no such file in rev a381d2c8c80e |
|
1526 | doesntexist: no such file in rev a381d2c8c80e | |
1528 | $ hg --cwd sub cat -r '.^' large4 |
|
1527 | $ hg --cwd sub cat -r '.^' large4 | |
1529 | large4-modified |
|
1528 | large4-modified | |
1530 | $ hg --cwd sub cat -r '.^' ../normal3 |
|
1529 | $ hg --cwd sub cat -r '.^' ../normal3 | |
1531 | normal3-modified |
|
1530 | normal3-modified | |
1532 |
|
1531 | |||
1533 | Test that renaming a largefile results in correct output for status |
|
1532 | Test that renaming a largefile results in correct output for status | |
1534 |
|
1533 | |||
1535 | $ hg rename sub/large4 large4-renamed |
|
1534 | $ hg rename sub/large4 large4-renamed | |
1536 | $ hg commit -m "test rename output" |
|
1535 | $ hg commit -m "test rename output" | |
1537 | Invoking status precommit hook |
|
1536 | Invoking status precommit hook | |
1538 | A large4-renamed |
|
1537 | A large4-renamed | |
1539 | R sub/large4 |
|
1538 | R sub/large4 | |
1540 | $ cat large4-renamed |
|
1539 | $ cat large4-renamed | |
1541 | large4-modified |
|
1540 | large4-modified | |
1542 | $ cd sub2 |
|
1541 | $ cd sub2 | |
1543 | $ hg rename large6 large6-renamed |
|
1542 | $ hg rename large6 large6-renamed | |
1544 | $ hg st |
|
1543 | $ hg st | |
1545 | A sub2/large6-renamed |
|
1544 | A sub2/large6-renamed | |
1546 | R sub2/large6 |
|
1545 | R sub2/large6 | |
1547 | $ cd .. |
|
1546 | $ cd .. | |
1548 |
|
1547 | |||
1549 | Test --normal flag |
|
1548 | Test --normal flag | |
1550 |
|
1549 | |||
1551 | $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null |
|
1550 | $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null | |
1552 | $ hg add --normal --large new-largefile |
|
1551 | $ hg add --normal --large new-largefile | |
1553 | abort: --normal cannot be used with --large |
|
1552 | abort: --normal cannot be used with --large | |
1554 | [255] |
|
1553 | [255] | |
1555 | $ hg add --normal new-largefile |
|
1554 | $ hg add --normal new-largefile | |
1556 | new-largefile: up to 69 MB of RAM may be required to manage this file |
|
1555 | new-largefile: up to 69 MB of RAM may be required to manage this file | |
1557 | (use 'hg revert new-largefile' to cancel the pending addition) |
|
1556 | (use 'hg revert new-largefile' to cancel the pending addition) | |
1558 | $ cd .. |
|
1557 | $ cd .. | |
1559 |
|
1558 | |||
1560 | #if serve |
|
1559 | #if serve | |
1561 | vanilla clients not locked out from largefiles servers on vanilla repos |
|
1560 | vanilla clients not locked out from largefiles servers on vanilla repos | |
1562 | $ mkdir r1 |
|
1561 | $ mkdir r1 | |
1563 | $ cd r1 |
|
1562 | $ cd r1 | |
1564 | $ hg init |
|
1563 | $ hg init | |
1565 | $ echo c1 > f1 |
|
1564 | $ echo c1 > f1 | |
1566 | $ hg add f1 |
|
1565 | $ hg add f1 | |
1567 | $ hg commit -m "m1" |
|
1566 | $ hg commit -m "m1" | |
1568 | Invoking status precommit hook |
|
1567 | Invoking status precommit hook | |
1569 | A f1 |
|
1568 | A f1 | |
1570 | $ cd .. |
|
1569 | $ cd .. | |
1571 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid |
|
1570 | $ hg serve -R r1 -d -p $HGPORT --pid-file hg.pid | |
1572 | $ cat hg.pid >> $DAEMON_PIDS |
|
1571 | $ cat hg.pid >> $DAEMON_PIDS | |
1573 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 |
|
1572 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT r2 | |
1574 | requesting all changes |
|
1573 | requesting all changes | |
1575 | adding changesets |
|
1574 | adding changesets | |
1576 | adding manifests |
|
1575 | adding manifests | |
1577 | adding file changes |
|
1576 | adding file changes | |
1578 | added 1 changesets with 1 changes to 1 files |
|
1577 | added 1 changesets with 1 changes to 1 files | |
1579 | updating to branch default |
|
1578 | updating to branch default | |
1580 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1579 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1581 |
|
1580 | |||
1582 | largefiles clients still work with vanilla servers |
|
1581 | largefiles clients still work with vanilla servers | |
1583 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid |
|
1582 | $ hg --config extensions.largefiles=! serve -R r1 -d -p $HGPORT1 --pid-file hg.pid | |
1584 | $ cat hg.pid >> $DAEMON_PIDS |
|
1583 | $ cat hg.pid >> $DAEMON_PIDS | |
1585 | $ hg clone http://localhost:$HGPORT1 r3 |
|
1584 | $ hg clone http://localhost:$HGPORT1 r3 | |
1586 | requesting all changes |
|
1585 | requesting all changes | |
1587 | adding changesets |
|
1586 | adding changesets | |
1588 | adding manifests |
|
1587 | adding manifests | |
1589 | adding file changes |
|
1588 | adding file changes | |
1590 | added 1 changesets with 1 changes to 1 files |
|
1589 | added 1 changesets with 1 changes to 1 files | |
1591 | updating to branch default |
|
1590 | updating to branch default | |
1592 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1591 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1593 | #endif |
|
1592 | #endif | |
1594 |
|
1593 | |||
1595 |
|
1594 | |||
1596 | vanilla clients locked out from largefiles http repos |
|
1595 | vanilla clients locked out from largefiles http repos | |
1597 | $ mkdir r4 |
|
1596 | $ mkdir r4 | |
1598 | $ cd r4 |
|
1597 | $ cd r4 | |
1599 | $ hg init |
|
1598 | $ hg init | |
1600 | $ echo c1 > f1 |
|
1599 | $ echo c1 > f1 | |
1601 | $ hg add --large f1 |
|
1600 | $ hg add --large f1 | |
1602 | $ hg commit -m "m1" |
|
1601 | $ hg commit -m "m1" | |
1603 | Invoking status precommit hook |
|
1602 | Invoking status precommit hook | |
1604 | A f1 |
|
1603 | A f1 | |
1605 | $ cd .. |
|
1604 | $ cd .. | |
1606 |
|
1605 | |||
1607 | largefiles can be pushed locally (issue3583) |
|
1606 | largefiles can be pushed locally (issue3583) | |
1608 | $ hg init dest |
|
1607 | $ hg init dest | |
1609 | $ cd r4 |
|
1608 | $ cd r4 | |
1610 | $ hg outgoing ../dest |
|
1609 | $ hg outgoing ../dest | |
1611 | comparing with ../dest |
|
1610 | comparing with ../dest | |
1612 | searching for changes |
|
1611 | searching for changes | |
1613 | changeset: 0:639881c12b4c |
|
1612 | changeset: 0:639881c12b4c | |
1614 | tag: tip |
|
1613 | tag: tip | |
1615 | user: test |
|
1614 | user: test | |
1616 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1615 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1617 | summary: m1 |
|
1616 | summary: m1 | |
1618 |
|
1617 | |||
1619 | $ hg push ../dest |
|
1618 | $ hg push ../dest | |
1620 | pushing to ../dest |
|
1619 | pushing to ../dest | |
1621 | searching for changes |
|
1620 | searching for changes | |
1622 | searching for changes |
|
1621 | searching for changes | |
1623 | adding changesets |
|
1622 | adding changesets | |
1624 | adding manifests |
|
1623 | adding manifests | |
1625 | adding file changes |
|
1624 | adding file changes | |
1626 | added 1 changesets with 1 changes to 1 files |
|
1625 | added 1 changesets with 1 changes to 1 files | |
1627 |
|
1626 | |||
1628 | exit code with nothing outgoing (issue3611) |
|
1627 | exit code with nothing outgoing (issue3611) | |
1629 | $ hg outgoing ../dest |
|
1628 | $ hg outgoing ../dest | |
1630 | comparing with ../dest |
|
1629 | comparing with ../dest | |
1631 | searching for changes |
|
1630 | searching for changes | |
1632 | no changes found |
|
1631 | no changes found | |
1633 | [1] |
|
1632 | [1] | |
1634 | $ cd .. |
|
1633 | $ cd .. | |
1635 |
|
1634 | |||
1636 | #if serve |
|
1635 | #if serve | |
1637 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid |
|
1636 | $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid | |
1638 | $ cat hg.pid >> $DAEMON_PIDS |
|
1637 | $ cat hg.pid >> $DAEMON_PIDS | |
1639 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 |
|
1638 | $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5 | |
1640 | abort: remote error: |
|
1639 | abort: remote error: | |
1641 |
|
1640 | |||
1642 | This repository uses the largefiles extension. |
|
1641 | This repository uses the largefiles extension. | |
1643 |
|
1642 | |||
1644 | Please enable it in your Mercurial config file. |
|
1643 | Please enable it in your Mercurial config file. | |
1645 | [255] |
|
1644 | [255] | |
1646 |
|
1645 | |||
1647 | used all HGPORTs, kill all daemons |
|
1646 | used all HGPORTs, kill all daemons | |
1648 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
1647 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS | |
1649 | #endif |
|
1648 | #endif | |
1650 |
|
1649 | |||
1651 | vanilla clients locked out from largefiles ssh repos |
|
1650 | vanilla clients locked out from largefiles ssh repos | |
1652 | $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 |
|
1651 | $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5 | |
1653 | abort: remote error: |
|
1652 | abort: remote error: | |
1654 |
|
1653 | |||
1655 | This repository uses the largefiles extension. |
|
1654 | This repository uses the largefiles extension. | |
1656 |
|
1655 | |||
1657 | Please enable it in your Mercurial config file. |
|
1656 | Please enable it in your Mercurial config file. | |
1658 | [255] |
|
1657 | [255] | |
1659 |
|
1658 | |||
1660 | #if serve |
|
1659 | #if serve | |
1661 |
|
1660 | |||
1662 | largefiles clients refuse to push largefiles repos to vanilla servers |
|
1661 | largefiles clients refuse to push largefiles repos to vanilla servers | |
1663 | $ mkdir r6 |
|
1662 | $ mkdir r6 | |
1664 | $ cd r6 |
|
1663 | $ cd r6 | |
1665 | $ hg init |
|
1664 | $ hg init | |
1666 | $ echo c1 > f1 |
|
1665 | $ echo c1 > f1 | |
1667 | $ hg add f1 |
|
1666 | $ hg add f1 | |
1668 | $ hg commit -m "m1" |
|
1667 | $ hg commit -m "m1" | |
1669 | Invoking status precommit hook |
|
1668 | Invoking status precommit hook | |
1670 | A f1 |
|
1669 | A f1 | |
1671 | $ cat >> .hg/hgrc <<! |
|
1670 | $ cat >> .hg/hgrc <<! | |
1672 | > [web] |
|
1671 | > [web] | |
1673 | > push_ssl = false |
|
1672 | > push_ssl = false | |
1674 | > allow_push = * |
|
1673 | > allow_push = * | |
1675 | > ! |
|
1674 | > ! | |
1676 | $ cd .. |
|
1675 | $ cd .. | |
1677 | $ hg clone r6 r7 |
|
1676 | $ hg clone r6 r7 | |
1678 | updating to branch default |
|
1677 | updating to branch default | |
1679 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1678 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1680 | $ cd r7 |
|
1679 | $ cd r7 | |
1681 | $ echo c2 > f2 |
|
1680 | $ echo c2 > f2 | |
1682 | $ hg add --large f2 |
|
1681 | $ hg add --large f2 | |
1683 | $ hg commit -m "m2" |
|
1682 | $ hg commit -m "m2" | |
1684 | Invoking status precommit hook |
|
1683 | Invoking status precommit hook | |
1685 | A f2 |
|
1684 | A f2 | |
1686 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid |
|
1685 | $ hg --config extensions.largefiles=! -R ../r6 serve -d -p $HGPORT --pid-file ../hg.pid | |
1687 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
1686 | $ cat ../hg.pid >> $DAEMON_PIDS | |
1688 | $ hg push http://localhost:$HGPORT |
|
1687 | $ hg push http://localhost:$HGPORT | |
1689 | pushing to http://localhost:$HGPORT/ |
|
1688 | pushing to http://localhost:$HGPORT/ | |
1690 | searching for changes |
|
1689 | searching for changes | |
1691 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store |
|
1690 | abort: http://localhost:$HGPORT/ does not appear to be a largefile store | |
1692 | [255] |
|
1691 | [255] | |
1693 | $ cd .. |
|
1692 | $ cd .. | |
1694 |
|
1693 | |||
1695 | putlfile errors are shown (issue3123) |
|
1694 | putlfile errors are shown (issue3123) | |
1696 | Corrupt the cached largefile in r7 and move it out of the servers usercache |
|
1695 | Corrupt the cached largefile in r7 and move it out of the servers usercache | |
1697 | $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 . |
|
1696 | $ mv r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 . | |
1698 | $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
1697 | $ echo 'client side corruption' > r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
1699 | $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8" |
|
1698 | $ rm "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8" | |
1700 | $ hg init empty |
|
1699 | $ hg init empty | |
1701 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ |
|
1700 | $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \ | |
1702 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
1701 | > --config 'web.allow_push=*' --config web.push_ssl=False | |
1703 | $ cat hg.pid >> $DAEMON_PIDS |
|
1702 | $ cat hg.pid >> $DAEMON_PIDS | |
1704 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
1703 | $ hg push -R r7 http://localhost:$HGPORT1 | |
1705 | pushing to http://localhost:$HGPORT1/ |
|
1704 | pushing to http://localhost:$HGPORT1/ | |
1706 | searching for changes |
|
1705 | searching for changes | |
1707 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash |
|
1706 | remote: largefiles: failed to put 4cdac4d8b084d0b599525cf732437fb337d422a8 into store: largefile contents do not match hash | |
1708 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob) |
|
1707 | abort: remotestore: could not put $TESTTMP/r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 to remote store http://localhost:$HGPORT1/ (glob) | |
1709 | [255] |
|
1708 | [255] | |
1710 | $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
1709 | $ mv 4cdac4d8b084d0b599525cf732437fb337d422a8 r7/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
1711 | Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic |
|
1710 | Push of file that exists on server but is corrupted - magic healing would be nice ... but too magic | |
1712 | $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
1711 | $ echo "server side corruption" > empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
1713 | $ hg push -R r7 http://localhost:$HGPORT1 |
|
1712 | $ hg push -R r7 http://localhost:$HGPORT1 | |
1714 | pushing to http://localhost:$HGPORT1/ |
|
1713 | pushing to http://localhost:$HGPORT1/ | |
1715 | searching for changes |
|
1714 | searching for changes | |
1716 | searching for changes |
|
1715 | searching for changes | |
1717 | remote: adding changesets |
|
1716 | remote: adding changesets | |
1718 | remote: adding manifests |
|
1717 | remote: adding manifests | |
1719 | remote: adding file changes |
|
1718 | remote: adding file changes | |
1720 | remote: added 2 changesets with 2 changes to 2 files |
|
1719 | remote: added 2 changesets with 2 changes to 2 files | |
1721 | $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 |
|
1720 | $ cat empty/.hg/largefiles/4cdac4d8b084d0b599525cf732437fb337d422a8 | |
1722 | server side corruption |
|
1721 | server side corruption | |
1723 | $ rm -rf empty |
|
1722 | $ rm -rf empty | |
1724 |
|
1723 | |||
1725 | Push a largefiles repository to a served empty repository |
|
1724 | Push a largefiles repository to a served empty repository | |
1726 | $ hg init r8 |
|
1725 | $ hg init r8 | |
1727 | $ echo c3 > r8/f1 |
|
1726 | $ echo c3 > r8/f1 | |
1728 | $ hg add --large r8/f1 -R r8 |
|
1727 | $ hg add --large r8/f1 -R r8 | |
1729 | $ hg commit -m "m1" -R r8 |
|
1728 | $ hg commit -m "m1" -R r8 | |
1730 | Invoking status precommit hook |
|
1729 | Invoking status precommit hook | |
1731 | A f1 |
|
1730 | A f1 | |
1732 | $ hg init empty |
|
1731 | $ hg init empty | |
1733 | $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \ |
|
1732 | $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \ | |
1734 | > --config 'web.allow_push=*' --config web.push_ssl=False |
|
1733 | > --config 'web.allow_push=*' --config web.push_ssl=False | |
1735 | $ cat hg.pid >> $DAEMON_PIDS |
|
1734 | $ cat hg.pid >> $DAEMON_PIDS | |
1736 | $ rm "${USERCACHE}"/* |
|
1735 | $ rm "${USERCACHE}"/* | |
1737 | $ hg push -R r8 http://localhost:$HGPORT2/#default |
|
1736 | $ hg push -R r8 http://localhost:$HGPORT2/#default | |
1738 | pushing to http://localhost:$HGPORT2/ |
|
1737 | pushing to http://localhost:$HGPORT2/ | |
1739 | searching for changes |
|
1738 | searching for changes | |
1740 | searching for changes |
|
1739 | searching for changes | |
1741 | remote: adding changesets |
|
1740 | remote: adding changesets | |
1742 | remote: adding manifests |
|
1741 | remote: adding manifests | |
1743 | remote: adding file changes |
|
1742 | remote: adding file changes | |
1744 | remote: added 1 changesets with 1 changes to 1 files |
|
1743 | remote: added 1 changesets with 1 changes to 1 files | |
1745 | $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] |
|
1744 | $ [ -f "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] | |
1746 | $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] |
|
1745 | $ [ -f empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] | |
1747 |
|
1746 | |||
1748 | Clone over http, no largefiles pulled on clone. |
|
1747 | Clone over http, no largefiles pulled on clone. | |
1749 |
|
1748 | |||
1750 | $ hg clone http://localhost:$HGPORT2/#default http-clone -U |
|
1749 | $ hg clone http://localhost:$HGPORT2/#default http-clone -U | |
1751 | adding changesets |
|
1750 | adding changesets | |
1752 | adding manifests |
|
1751 | adding manifests | |
1753 | adding file changes |
|
1752 | adding file changes | |
1754 | added 1 changesets with 1 changes to 1 files |
|
1753 | added 1 changesets with 1 changes to 1 files | |
1755 |
|
1754 | |||
1756 | test 'verify' with remotestore: |
|
1755 | test 'verify' with remotestore: | |
1757 |
|
1756 | |||
1758 | $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
1757 | $ rm "${USERCACHE}"/02a439e5c31c526465ab1a0ca1f431f76b827b90 | |
1759 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . |
|
1758 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . | |
1760 | $ hg -R http-clone verify --large --lfa |
|
1759 | $ hg -R http-clone verify --large --lfa | |
1761 | checking changesets |
|
1760 | checking changesets | |
1762 | checking manifests |
|
1761 | checking manifests | |
1763 | crosschecking files in changesets and manifests |
|
1762 | crosschecking files in changesets and manifests | |
1764 | checking files |
|
1763 | checking files | |
1765 | 1 files, 1 changesets, 1 total revisions |
|
1764 | 1 files, 1 changesets, 1 total revisions | |
1766 | searching 1 changesets for largefiles |
|
1765 | searching 1 changesets for largefiles | |
1767 | changeset 0:cf03e5bb9936: f1 missing |
|
1766 | changeset 0:cf03e5bb9936: f1 missing | |
1768 | verified existence of 1 revisions of 1 largefiles |
|
1767 | verified existence of 1 revisions of 1 largefiles | |
1769 | [1] |
|
1768 | [1] | |
1770 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ |
|
1769 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ | |
1771 | $ hg -R http-clone -q verify --large --lfa |
|
1770 | $ hg -R http-clone -q verify --large --lfa | |
1772 |
|
1771 | |||
1773 | largefiles pulled on update - a largefile missing on the server: |
|
1772 | largefiles pulled on update - a largefile missing on the server: | |
1774 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . |
|
1773 | $ mv empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 . | |
1775 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache |
|
1774 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache | |
1776 | getting changed largefiles |
|
1775 | getting changed largefiles | |
1777 | abort: remotestore: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 is missing |
|
1776 | abort: remotestore: largefile 02a439e5c31c526465ab1a0ca1f431f76b827b90 is missing | |
1778 | [255] |
|
1777 | [255] | |
1779 | $ hg -R http-clone up -Cqr null |
|
1778 | $ hg -R http-clone up -Cqr null | |
1780 |
|
1779 | |||
1781 | largefiles pulled on update - a largefile corrupted on the server: |
|
1780 | largefiles pulled on update - a largefile corrupted on the server: | |
1782 | $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
1781 | $ echo corruption > empty/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 | |
1783 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache |
|
1782 | $ hg -R http-clone up --config largefiles.usercache=http-clone-usercache | |
1784 | getting changed largefiles |
|
1783 | getting changed largefiles | |
1785 | f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27) |
|
1784 | f1: data corruption (expected 02a439e5c31c526465ab1a0ca1f431f76b827b90, got 6a7bb2556144babe3899b25e5428123735bb1e27) | |
1786 | 0 largefiles updated, 0 removed |
|
1785 | 0 largefiles updated, 0 removed | |
1787 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1786 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1788 | $ hg -R http-clone st |
|
1787 | $ hg -R http-clone st | |
1789 | ! f1 |
|
1788 | ! f1 | |
1790 | $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] |
|
1789 | $ [ ! -f http-clone/.hg/largefiles/02a439e5c31c526465ab1a0ca1f431f76b827b90 ] | |
1791 | $ [ ! -f http-clone/f1 ] |
|
1790 | $ [ ! -f http-clone/f1 ] | |
1792 | $ [ ! -f http-clone-usercache ] |
|
1791 | $ [ ! -f http-clone-usercache ] | |
1793 | $ hg -R http-clone verify --large --lfc |
|
1792 | $ hg -R http-clone verify --large --lfc | |
1794 | checking changesets |
|
1793 | checking changesets | |
1795 | checking manifests |
|
1794 | checking manifests | |
1796 | crosschecking files in changesets and manifests |
|
1795 | crosschecking files in changesets and manifests | |
1797 | checking files |
|
1796 | checking files | |
1798 | 1 files, 1 changesets, 1 total revisions |
|
1797 | 1 files, 1 changesets, 1 total revisions | |
1799 | searching 1 changesets for largefiles |
|
1798 | searching 1 changesets for largefiles | |
1800 | verified contents of 1 revisions of 1 largefiles |
|
1799 | verified contents of 1 revisions of 1 largefiles | |
1801 | $ hg -R http-clone up -Cqr null |
|
1800 | $ hg -R http-clone up -Cqr null | |
1802 |
|
1801 | |||
1803 | largefiles pulled on update - no server side problems: |
|
1802 | largefiles pulled on update - no server side problems: | |
1804 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ |
|
1803 | $ mv 02a439e5c31c526465ab1a0ca1f431f76b827b90 empty/.hg/largefiles/ | |
1805 | $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache |
|
1804 | $ hg -R http-clone --debug up --config largefiles.usercache=http-clone-usercache | |
1806 | resolving manifests |
|
1805 | resolving manifests | |
1807 | branchmerge: False, force: False, partial: False |
|
1806 | branchmerge: False, force: False, partial: False | |
1808 | ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936 |
|
1807 | ancestor: 000000000000, local: 000000000000+, remote: cf03e5bb9936 | |
1809 | .hglf/f1: remote created -> g |
|
1808 | .hglf/f1: remote created -> g | |
1810 | getting .hglf/f1 |
|
1809 | getting .hglf/f1 | |
1811 | updating: .hglf/f1 1/1 files (100.00%) |
|
1810 | updating: .hglf/f1 1/1 files (100.00%) | |
1812 | getting changed largefiles |
|
1811 | getting changed largefiles | |
1813 | using http://localhost:$HGPORT2/ |
|
1812 | using http://localhost:$HGPORT2/ | |
1814 | sending capabilities command |
|
1813 | sending capabilities command | |
1815 | getting largefiles: 0/1 lfile (0.00%) |
|
1814 | getting largefiles: 0/1 lfile (0.00%) | |
1816 | getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
1815 | getting f1:02a439e5c31c526465ab1a0ca1f431f76b827b90 | |
1817 | sending batch command |
|
1816 | sending batch command | |
1818 | sending getlfile command |
|
1817 | sending getlfile command | |
1819 | found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store |
|
1818 | found 02a439e5c31c526465ab1a0ca1f431f76b827b90 in store | |
1820 | 1 largefiles updated, 0 removed |
|
1819 | 1 largefiles updated, 0 removed | |
1821 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1820 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1822 |
|
1821 | |||
1823 | $ ls http-clone-usercache/* |
|
1822 | $ ls http-clone-usercache/* | |
1824 | http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90 |
|
1823 | http-clone-usercache/02a439e5c31c526465ab1a0ca1f431f76b827b90 | |
1825 |
|
1824 | |||
1826 | $ rm -rf empty http-clone* |
|
1825 | $ rm -rf empty http-clone* | |
1827 |
|
1826 | |||
1828 | used all HGPORTs, kill all daemons |
|
1827 | used all HGPORTs, kill all daemons | |
1829 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS |
|
1828 | $ "$TESTDIR/killdaemons.py" $DAEMON_PIDS | |
1830 |
|
1829 | |||
1831 | #endif |
|
1830 | #endif | |
1832 |
|
1831 | |||
1833 |
|
1832 | |||
1834 | #if unix-permissions |
|
1833 | #if unix-permissions | |
1835 |
|
1834 | |||
1836 | Clone a local repository owned by another user |
|
1835 | Clone a local repository owned by another user | |
1837 | We have to simulate that here by setting $HOME and removing write permissions |
|
1836 | We have to simulate that here by setting $HOME and removing write permissions | |
1838 | $ ORIGHOME="$HOME" |
|
1837 | $ ORIGHOME="$HOME" | |
1839 | $ mkdir alice |
|
1838 | $ mkdir alice | |
1840 | $ HOME="`pwd`/alice" |
|
1839 | $ HOME="`pwd`/alice" | |
1841 | $ cd alice |
|
1840 | $ cd alice | |
1842 | $ hg init pubrepo |
|
1841 | $ hg init pubrepo | |
1843 | $ cd pubrepo |
|
1842 | $ cd pubrepo | |
1844 | $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null |
|
1843 | $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null | |
1845 | $ hg add --large a-large-file |
|
1844 | $ hg add --large a-large-file | |
1846 | $ hg commit -m "Add a large file" |
|
1845 | $ hg commit -m "Add a large file" | |
1847 | Invoking status precommit hook |
|
1846 | Invoking status precommit hook | |
1848 | A a-large-file |
|
1847 | A a-large-file | |
1849 | $ cd .. |
|
1848 | $ cd .. | |
1850 | $ chmod -R a-w pubrepo |
|
1849 | $ chmod -R a-w pubrepo | |
1851 | $ cd .. |
|
1850 | $ cd .. | |
1852 | $ mkdir bob |
|
1851 | $ mkdir bob | |
1853 | $ HOME="`pwd`/bob" |
|
1852 | $ HOME="`pwd`/bob" | |
1854 | $ cd bob |
|
1853 | $ cd bob | |
1855 | $ hg clone --pull ../alice/pubrepo pubrepo |
|
1854 | $ hg clone --pull ../alice/pubrepo pubrepo | |
1856 | requesting all changes |
|
1855 | requesting all changes | |
1857 | adding changesets |
|
1856 | adding changesets | |
1858 | adding manifests |
|
1857 | adding manifests | |
1859 | adding file changes |
|
1858 | adding file changes | |
1860 | added 1 changesets with 1 changes to 1 files |
|
1859 | added 1 changesets with 1 changes to 1 files | |
1861 | updating to branch default |
|
1860 | updating to branch default | |
1862 | getting changed largefiles |
|
1861 | getting changed largefiles | |
1863 | 1 largefiles updated, 0 removed |
|
1862 | 1 largefiles updated, 0 removed | |
1864 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1863 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1865 | $ cd .. |
|
1864 | $ cd .. | |
1866 | $ chmod -R u+w alice/pubrepo |
|
1865 | $ chmod -R u+w alice/pubrepo | |
1867 | $ HOME="$ORIGHOME" |
|
1866 | $ HOME="$ORIGHOME" | |
1868 |
|
1867 | |||
1869 | #endif |
|
1868 | #endif | |
1870 |
|
1869 | |||
1871 | #if symlink |
|
1870 | #if symlink | |
1872 |
|
1871 | |||
1873 | Symlink to a large largefile should behave the same as a symlink to a normal file |
|
1872 | Symlink to a large largefile should behave the same as a symlink to a normal file | |
1874 | $ hg init largesymlink |
|
1873 | $ hg init largesymlink | |
1875 | $ cd largesymlink |
|
1874 | $ cd largesymlink | |
1876 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null |
|
1875 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null | |
1877 | $ hg add --large largefile |
|
1876 | $ hg add --large largefile | |
1878 | $ hg commit -m "commit a large file" |
|
1877 | $ hg commit -m "commit a large file" | |
1879 | Invoking status precommit hook |
|
1878 | Invoking status precommit hook | |
1880 | A largefile |
|
1879 | A largefile | |
1881 | $ ln -s largefile largelink |
|
1880 | $ ln -s largefile largelink | |
1882 | $ hg add largelink |
|
1881 | $ hg add largelink | |
1883 | $ hg commit -m "commit a large symlink" |
|
1882 | $ hg commit -m "commit a large symlink" | |
1884 | Invoking status precommit hook |
|
1883 | Invoking status precommit hook | |
1885 | A largelink |
|
1884 | A largelink | |
1886 | $ rm -f largelink |
|
1885 | $ rm -f largelink | |
1887 | $ hg up >/dev/null |
|
1886 | $ hg up >/dev/null | |
1888 | $ test -f largelink |
|
1887 | $ test -f largelink | |
1889 | [1] |
|
1888 | [1] | |
1890 | $ test -L largelink |
|
1889 | $ test -L largelink | |
1891 | [1] |
|
1890 | [1] | |
1892 | $ rm -f largelink # make next part of the test independent of the previous |
|
1891 | $ rm -f largelink # make next part of the test independent of the previous | |
1893 | $ hg up -C >/dev/null |
|
1892 | $ hg up -C >/dev/null | |
1894 | $ test -f largelink |
|
1893 | $ test -f largelink | |
1895 | $ test -L largelink |
|
1894 | $ test -L largelink | |
1896 | $ cd .. |
|
1895 | $ cd .. | |
1897 |
|
1896 | |||
1898 | #endif |
|
1897 | #endif | |
1899 |
|
1898 | |||
1900 | test for pattern matching on 'hg status': |
|
1899 | test for pattern matching on 'hg status': | |
1901 | to boost performance, largefiles checks whether specified patterns are |
|
1900 | to boost performance, largefiles checks whether specified patterns are | |
1902 | related to largefiles in working directory (NOT to STANDIN) or not. |
|
1901 | related to largefiles in working directory (NOT to STANDIN) or not. | |
1903 |
|
1902 | |||
1904 | $ hg init statusmatch |
|
1903 | $ hg init statusmatch | |
1905 | $ cd statusmatch |
|
1904 | $ cd statusmatch | |
1906 |
|
1905 | |||
1907 | $ mkdir -p a/b/c/d |
|
1906 | $ mkdir -p a/b/c/d | |
1908 | $ echo normal > a/b/c/d/e.normal.txt |
|
1907 | $ echo normal > a/b/c/d/e.normal.txt | |
1909 | $ hg add a/b/c/d/e.normal.txt |
|
1908 | $ hg add a/b/c/d/e.normal.txt | |
1910 | $ echo large > a/b/c/d/e.large.txt |
|
1909 | $ echo large > a/b/c/d/e.large.txt | |
1911 | $ hg add --large a/b/c/d/e.large.txt |
|
1910 | $ hg add --large a/b/c/d/e.large.txt | |
1912 | $ mkdir -p a/b/c/x |
|
1911 | $ mkdir -p a/b/c/x | |
1913 | $ echo normal > a/b/c/x/y.normal.txt |
|
1912 | $ echo normal > a/b/c/x/y.normal.txt | |
1914 | $ hg add a/b/c/x/y.normal.txt |
|
1913 | $ hg add a/b/c/x/y.normal.txt | |
1915 | $ hg commit -m 'add files' |
|
1914 | $ hg commit -m 'add files' | |
1916 | Invoking status precommit hook |
|
1915 | Invoking status precommit hook | |
1917 | A a/b/c/d/e.large.txt |
|
1916 | A a/b/c/d/e.large.txt | |
1918 | A a/b/c/d/e.normal.txt |
|
1917 | A a/b/c/d/e.normal.txt | |
1919 | A a/b/c/x/y.normal.txt |
|
1918 | A a/b/c/x/y.normal.txt | |
1920 |
|
1919 | |||
1921 | (1) no pattern: no performance boost |
|
1920 | (1) no pattern: no performance boost | |
1922 | $ hg status -A |
|
1921 | $ hg status -A | |
1923 | C a/b/c/d/e.large.txt |
|
1922 | C a/b/c/d/e.large.txt | |
1924 | C a/b/c/d/e.normal.txt |
|
1923 | C a/b/c/d/e.normal.txt | |
1925 | C a/b/c/x/y.normal.txt |
|
1924 | C a/b/c/x/y.normal.txt | |
1926 |
|
1925 | |||
1927 | (2) pattern not related to largefiles: performance boost |
|
1926 | (2) pattern not related to largefiles: performance boost | |
1928 | $ hg status -A a/b/c/x |
|
1927 | $ hg status -A a/b/c/x | |
1929 | C a/b/c/x/y.normal.txt |
|
1928 | C a/b/c/x/y.normal.txt | |
1930 |
|
1929 | |||
1931 | (3) pattern related to largefiles: no performance boost |
|
1930 | (3) pattern related to largefiles: no performance boost | |
1932 | $ hg status -A a/b/c/d |
|
1931 | $ hg status -A a/b/c/d | |
1933 | C a/b/c/d/e.large.txt |
|
1932 | C a/b/c/d/e.large.txt | |
1934 | C a/b/c/d/e.normal.txt |
|
1933 | C a/b/c/d/e.normal.txt | |
1935 |
|
1934 | |||
1936 | (4) pattern related to STANDIN (not to largefiles): performance boost |
|
1935 | (4) pattern related to STANDIN (not to largefiles): performance boost | |
1937 | $ hg status -A .hglf/a |
|
1936 | $ hg status -A .hglf/a | |
1938 | C .hglf/a/b/c/d/e.large.txt |
|
1937 | C .hglf/a/b/c/d/e.large.txt | |
1939 |
|
1938 | |||
1940 | (5) mixed case: no performance boost |
|
1939 | (5) mixed case: no performance boost | |
1941 | $ hg status -A a/b/c/x a/b/c/d |
|
1940 | $ hg status -A a/b/c/x a/b/c/d | |
1942 | C a/b/c/d/e.large.txt |
|
1941 | C a/b/c/d/e.large.txt | |
1943 | C a/b/c/d/e.normal.txt |
|
1942 | C a/b/c/d/e.normal.txt | |
1944 | C a/b/c/x/y.normal.txt |
|
1943 | C a/b/c/x/y.normal.txt | |
1945 |
|
1944 | |||
1946 | verify that largefiles doesn't break filesets |
|
1945 | verify that largefiles doesn't break filesets | |
1947 |
|
1946 | |||
1948 | $ hg log --rev . --exclude "set:binary()" |
|
1947 | $ hg log --rev . --exclude "set:binary()" | |
1949 | changeset: 0:41bd42f10efa |
|
1948 | changeset: 0:41bd42f10efa | |
1950 | tag: tip |
|
1949 | tag: tip | |
1951 | user: test |
|
1950 | user: test | |
1952 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1951 | date: Thu Jan 01 00:00:00 1970 +0000 | |
1953 | summary: add files |
|
1952 | summary: add files | |
1954 |
|
1953 | |||
1955 | verify that large files in subrepos handled properly |
|
1954 | verify that large files in subrepos handled properly | |
1956 | $ hg init subrepo |
|
1955 | $ hg init subrepo | |
1957 | $ echo "subrepo = subrepo" > .hgsub |
|
1956 | $ echo "subrepo = subrepo" > .hgsub | |
1958 | $ hg add .hgsub |
|
1957 | $ hg add .hgsub | |
1959 | $ hg ci -m "add subrepo" |
|
1958 | $ hg ci -m "add subrepo" | |
1960 | Invoking status precommit hook |
|
1959 | Invoking status precommit hook | |
1961 | A .hgsub |
|
1960 | A .hgsub | |
1962 | ? .hgsubstate |
|
1961 | ? .hgsubstate | |
1963 | $ echo "rev 1" > subrepo/large.txt |
|
1962 | $ echo "rev 1" > subrepo/large.txt | |
1964 | $ hg -R subrepo add --large subrepo/large.txt |
|
1963 | $ hg -R subrepo add --large subrepo/large.txt | |
1965 | $ hg sum |
|
1964 | $ hg sum | |
1966 | parent: 1:8ee150ea2e9c tip |
|
1965 | parent: 1:8ee150ea2e9c tip | |
1967 | add subrepo |
|
1966 | add subrepo | |
1968 | branch: default |
|
1967 | branch: default | |
1969 | commit: 1 subrepos |
|
1968 | commit: 1 subrepos | |
1970 | update: (current) |
|
1969 | update: (current) | |
1971 | $ hg st |
|
1970 | $ hg st | |
1972 | $ hg st -S |
|
1971 | $ hg st -S | |
1973 | A subrepo/large.txt |
|
1972 | A subrepo/large.txt | |
1974 | $ hg ci -S -m "commit top repo" |
|
1973 | $ hg ci -S -m "commit top repo" | |
1975 | committing subrepository subrepo |
|
1974 | committing subrepository subrepo | |
1976 | Invoking status precommit hook |
|
1975 | Invoking status precommit hook | |
1977 | A large.txt |
|
1976 | A large.txt | |
1978 | Invoking status precommit hook |
|
1977 | Invoking status precommit hook | |
1979 | M .hgsubstate |
|
1978 | M .hgsubstate | |
1980 | # No differences |
|
1979 | # No differences | |
1981 | $ hg st -S |
|
1980 | $ hg st -S | |
1982 | $ hg sum |
|
1981 | $ hg sum | |
1983 | parent: 2:ce4cd0c527a6 tip |
|
1982 | parent: 2:ce4cd0c527a6 tip | |
1984 | commit top repo |
|
1983 | commit top repo | |
1985 | branch: default |
|
1984 | branch: default | |
1986 | commit: (clean) |
|
1985 | commit: (clean) | |
1987 | update: (current) |
|
1986 | update: (current) | |
1988 | $ echo "rev 2" > subrepo/large.txt |
|
1987 | $ echo "rev 2" > subrepo/large.txt | |
1989 | $ hg st -S |
|
1988 | $ hg st -S | |
1990 | M subrepo/large.txt |
|
1989 | M subrepo/large.txt | |
1991 | $ hg sum |
|
1990 | $ hg sum | |
1992 | parent: 2:ce4cd0c527a6 tip |
|
1991 | parent: 2:ce4cd0c527a6 tip | |
1993 | commit top repo |
|
1992 | commit top repo | |
1994 | branch: default |
|
1993 | branch: default | |
1995 | commit: 1 subrepos |
|
1994 | commit: 1 subrepos | |
1996 | update: (current) |
|
1995 | update: (current) | |
1997 | $ hg ci -m "this commit should fail without -S" |
|
1996 | $ hg ci -m "this commit should fail without -S" | |
1998 | abort: uncommitted changes in subrepo subrepo |
|
1997 | abort: uncommitted changes in subrepo subrepo | |
1999 | (use --subrepos for recursive commit) |
|
1998 | (use --subrepos for recursive commit) | |
2000 | [255] |
|
1999 | [255] | |
2001 |
|
2000 | |||
2002 | Add a normal file to the subrepo, then test archiving |
|
2001 | Add a normal file to the subrepo, then test archiving | |
2003 |
|
2002 | |||
2004 | $ echo 'normal file' > subrepo/normal.txt |
|
2003 | $ echo 'normal file' > subrepo/normal.txt | |
2005 | $ hg -R subrepo add subrepo/normal.txt |
|
2004 | $ hg -R subrepo add subrepo/normal.txt | |
2006 |
|
2005 | |||
2007 | Lock in subrepo, otherwise the change isn't archived |
|
2006 | Lock in subrepo, otherwise the change isn't archived | |
2008 |
|
2007 | |||
2009 | $ hg ci -S -m "add normal file to top level" |
|
2008 | $ hg ci -S -m "add normal file to top level" | |
2010 | committing subrepository subrepo |
|
2009 | committing subrepository subrepo | |
2011 | Invoking status precommit hook |
|
2010 | Invoking status precommit hook | |
2012 | M large.txt |
|
2011 | M large.txt | |
2013 | A normal.txt |
|
2012 | A normal.txt | |
2014 | Invoking status precommit hook |
|
2013 | Invoking status precommit hook | |
2015 | M .hgsubstate |
|
2014 | M .hgsubstate | |
2016 | $ hg archive -S ../lf_subrepo_archive |
|
2015 | $ hg archive -S ../lf_subrepo_archive | |
2017 | $ find ../lf_subrepo_archive | sort |
|
2016 | $ find ../lf_subrepo_archive | sort | |
2018 | ../lf_subrepo_archive |
|
2017 | ../lf_subrepo_archive | |
2019 | ../lf_subrepo_archive/.hg_archival.txt |
|
2018 | ../lf_subrepo_archive/.hg_archival.txt | |
2020 | ../lf_subrepo_archive/.hgsub |
|
2019 | ../lf_subrepo_archive/.hgsub | |
2021 | ../lf_subrepo_archive/.hgsubstate |
|
2020 | ../lf_subrepo_archive/.hgsubstate | |
2022 | ../lf_subrepo_archive/a |
|
2021 | ../lf_subrepo_archive/a | |
2023 | ../lf_subrepo_archive/a/b |
|
2022 | ../lf_subrepo_archive/a/b | |
2024 | ../lf_subrepo_archive/a/b/c |
|
2023 | ../lf_subrepo_archive/a/b/c | |
2025 | ../lf_subrepo_archive/a/b/c/d |
|
2024 | ../lf_subrepo_archive/a/b/c/d | |
2026 | ../lf_subrepo_archive/a/b/c/d/e.large.txt |
|
2025 | ../lf_subrepo_archive/a/b/c/d/e.large.txt | |
2027 | ../lf_subrepo_archive/a/b/c/d/e.normal.txt |
|
2026 | ../lf_subrepo_archive/a/b/c/d/e.normal.txt | |
2028 | ../lf_subrepo_archive/a/b/c/x |
|
2027 | ../lf_subrepo_archive/a/b/c/x | |
2029 | ../lf_subrepo_archive/a/b/c/x/y.normal.txt |
|
2028 | ../lf_subrepo_archive/a/b/c/x/y.normal.txt | |
2030 | ../lf_subrepo_archive/subrepo |
|
2029 | ../lf_subrepo_archive/subrepo | |
2031 | ../lf_subrepo_archive/subrepo/large.txt |
|
2030 | ../lf_subrepo_archive/subrepo/large.txt | |
2032 | ../lf_subrepo_archive/subrepo/normal.txt |
|
2031 | ../lf_subrepo_archive/subrepo/normal.txt | |
2033 |
|
2032 | |||
2034 | Test update with subrepos. |
|
2033 | Test update with subrepos. | |
2035 |
|
2034 | |||
2036 | $ hg update 0 |
|
2035 | $ hg update 0 | |
2037 | getting changed largefiles |
|
2036 | getting changed largefiles | |
2038 | 0 largefiles updated, 1 removed |
|
2037 | 0 largefiles updated, 1 removed | |
2039 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
2038 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
2040 | $ hg status -S |
|
2039 | $ hg status -S | |
2041 | $ hg update tip |
|
2040 | $ hg update tip | |
2042 | getting changed largefiles |
|
2041 | getting changed largefiles | |
2043 | 1 largefiles updated, 0 removed |
|
2042 | 1 largefiles updated, 0 removed | |
2044 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2043 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
2045 | $ hg status -S |
|
2044 | $ hg status -S | |
2046 | # modify a large file |
|
2045 | # modify a large file | |
2047 | $ echo "modified" > subrepo/large.txt |
|
2046 | $ echo "modified" > subrepo/large.txt | |
2048 | $ hg st -S |
|
2047 | $ hg st -S | |
2049 | M subrepo/large.txt |
|
2048 | M subrepo/large.txt | |
2050 | # update -C should revert the change. |
|
2049 | # update -C should revert the change. | |
2051 | $ hg update -C |
|
2050 | $ hg update -C | |
2052 | getting changed largefiles |
|
2051 | getting changed largefiles | |
2053 | 1 largefiles updated, 0 removed |
|
2052 | 1 largefiles updated, 0 removed | |
2054 | getting changed largefiles |
|
2053 | getting changed largefiles | |
2055 | 0 largefiles updated, 0 removed |
|
2054 | 0 largefiles updated, 0 removed | |
2056 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
2055 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
2057 | $ hg status -S |
|
2056 | $ hg status -S | |
2058 |
|
2057 | |||
2059 | Test archiving a revision that references a subrepo that is not yet |
|
2058 | Test archiving a revision that references a subrepo that is not yet | |
2060 | cloned (see test-subrepo-recursion.t): |
|
2059 | cloned (see test-subrepo-recursion.t): | |
2061 |
|
2060 | |||
2062 | $ hg clone -U . ../empty |
|
2061 | $ hg clone -U . ../empty | |
2063 | $ cd ../empty |
|
2062 | $ cd ../empty | |
2064 | $ hg archive --subrepos -r tip ../archive.tar.gz |
|
2063 | $ hg archive --subrepos -r tip ../archive.tar.gz | |
2065 | cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo |
|
2064 | cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo | |
2066 | $ cd .. |
|
2065 | $ cd .. | |
2067 |
|
2066 | |||
2068 | Test that addremove picks up largefiles prior to the initial commit (issue3541) |
|
2067 | Test that addremove picks up largefiles prior to the initial commit (issue3541) | |
2069 |
|
2068 | |||
2070 | $ hg init addrm2 |
|
2069 | $ hg init addrm2 | |
2071 | $ cd addrm2 |
|
2070 | $ cd addrm2 | |
2072 | $ touch large.dat |
|
2071 | $ touch large.dat | |
2073 | $ touch large2.dat |
|
2072 | $ touch large2.dat | |
2074 | $ touch normal |
|
2073 | $ touch normal | |
2075 | $ hg add --large large.dat |
|
2074 | $ hg add --large large.dat | |
2076 | $ hg addremove -v |
|
2075 | $ hg addremove -v | |
2077 | adding large2.dat as a largefile |
|
2076 | adding large2.dat as a largefile | |
2078 | adding normal |
|
2077 | adding normal | |
2079 |
|
2078 | |||
2080 | Test that forgetting all largefiles reverts to islfilesrepo() == False |
|
2079 | Test that forgetting all largefiles reverts to islfilesrepo() == False | |
2081 | (addremove will add *.dat as normal files now) |
|
2080 | (addremove will add *.dat as normal files now) | |
2082 | $ hg forget large.dat |
|
2081 | $ hg forget large.dat | |
2083 | $ hg forget large2.dat |
|
2082 | $ hg forget large2.dat | |
2084 | $ hg addremove -v |
|
2083 | $ hg addremove -v | |
2085 | adding large.dat |
|
2084 | adding large.dat | |
2086 | adding large2.dat |
|
2085 | adding large2.dat | |
2087 |
|
2086 | |||
2088 | Test commit's addremove option prior to the first commit |
|
2087 | Test commit's addremove option prior to the first commit | |
2089 | $ hg forget large.dat |
|
2088 | $ hg forget large.dat | |
2090 | $ hg forget large2.dat |
|
2089 | $ hg forget large2.dat | |
2091 | $ hg add --large large.dat |
|
2090 | $ hg add --large large.dat | |
2092 | $ hg ci -Am "commit" |
|
2091 | $ hg ci -Am "commit" | |
2093 | adding large2.dat as a largefile |
|
2092 | adding large2.dat as a largefile | |
2094 | Invoking status precommit hook |
|
2093 | Invoking status precommit hook | |
2095 | A large.dat |
|
2094 | A large.dat | |
2096 | A large2.dat |
|
2095 | A large2.dat | |
2097 | A normal |
|
2096 | A normal | |
2098 | $ find .hglf | sort |
|
2097 | $ find .hglf | sort | |
2099 | .hglf |
|
2098 | .hglf | |
2100 | .hglf/large.dat |
|
2099 | .hglf/large.dat | |
2101 | .hglf/large2.dat |
|
2100 | .hglf/large2.dat | |
2102 |
|
2101 | |||
2103 | Test actions on largefiles using relative paths from subdir |
|
2102 | Test actions on largefiles using relative paths from subdir | |
2104 |
|
2103 | |||
2105 | $ mkdir sub |
|
2104 | $ mkdir sub | |
2106 | $ cd sub |
|
2105 | $ cd sub | |
2107 | $ echo anotherlarge > anotherlarge |
|
2106 | $ echo anotherlarge > anotherlarge | |
2108 | $ hg add --large anotherlarge |
|
2107 | $ hg add --large anotherlarge | |
2109 | $ hg st |
|
2108 | $ hg st | |
2110 | A sub/anotherlarge |
|
2109 | A sub/anotherlarge | |
2111 | $ hg st anotherlarge |
|
2110 | $ hg st anotherlarge | |
2112 | A anotherlarge |
|
2111 | A anotherlarge | |
2113 | $ hg commit -m anotherlarge anotherlarge |
|
2112 | $ hg commit -m anotherlarge anotherlarge | |
2114 | Invoking status precommit hook |
|
2113 | Invoking status precommit hook | |
2115 | A sub/anotherlarge |
|
2114 | A sub/anotherlarge | |
2116 | $ hg log anotherlarge |
|
2115 | $ hg log anotherlarge | |
2117 | changeset: 1:9627a577c5e9 |
|
2116 | changeset: 1:9627a577c5e9 | |
2118 | tag: tip |
|
2117 | tag: tip | |
2119 | user: test |
|
2118 | user: test | |
2120 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
2119 | date: Thu Jan 01 00:00:00 1970 +0000 | |
2121 | summary: anotherlarge |
|
2120 | summary: anotherlarge | |
2122 |
|
2121 | |||
2123 | $ echo more >> anotherlarge |
|
2122 | $ echo more >> anotherlarge | |
2124 | $ hg st . |
|
2123 | $ hg st . | |
2125 | M anotherlarge |
|
2124 | M anotherlarge | |
2126 | $ hg cat anotherlarge |
|
2125 | $ hg cat anotherlarge | |
2127 | anotherlarge |
|
2126 | anotherlarge | |
2128 | $ hg revert anotherlarge |
|
2127 | $ hg revert anotherlarge | |
2129 | $ hg st |
|
2128 | $ hg st | |
2130 | ? sub/anotherlarge.orig |
|
2129 | ? sub/anotherlarge.orig | |
2131 | $ cd .. |
|
2130 | $ cd .. | |
2132 |
|
2131 | |||
2133 | $ cd .. |
|
2132 | $ cd .. | |
2134 |
|
2133 | |||
2135 | issue3651: summary/outgoing with largefiles shows "no remote repo" |
|
2134 | issue3651: summary/outgoing with largefiles shows "no remote repo" | |
2136 | unexpectedly |
|
2135 | unexpectedly | |
2137 |
|
2136 | |||
2138 | $ mkdir issue3651 |
|
2137 | $ mkdir issue3651 | |
2139 | $ cd issue3651 |
|
2138 | $ cd issue3651 | |
2140 |
|
2139 | |||
2141 | $ hg init src |
|
2140 | $ hg init src | |
2142 | $ echo a > src/a |
|
2141 | $ echo a > src/a | |
2143 | $ hg -R src add --large src/a |
|
2142 | $ hg -R src add --large src/a | |
2144 | $ hg -R src commit -m '#0' |
|
2143 | $ hg -R src commit -m '#0' | |
2145 | Invoking status precommit hook |
|
2144 | Invoking status precommit hook | |
2146 | A a |
|
2145 | A a | |
2147 |
|
2146 | |||
2148 | check messages when no remote repository is specified: |
|
2147 | check messages when no remote repository is specified: | |
2149 | "no remote repo" route for "hg outgoing --large" is not tested here, |
|
2148 | "no remote repo" route for "hg outgoing --large" is not tested here, | |
2150 | because it can't be reproduced easily. |
|
2149 | because it can't be reproduced easily. | |
2151 |
|
2150 | |||
2152 | $ hg init clone1 |
|
2151 | $ hg init clone1 | |
2153 | $ hg -R clone1 -q pull src |
|
2152 | $ hg -R clone1 -q pull src | |
2154 | $ hg -R clone1 -q update |
|
2153 | $ hg -R clone1 -q update | |
2155 | $ hg -R clone1 paths | grep default |
|
2154 | $ hg -R clone1 paths | grep default | |
2156 | [1] |
|
2155 | [1] | |
2157 |
|
2156 | |||
2158 | $ hg -R clone1 summary --large |
|
2157 | $ hg -R clone1 summary --large | |
2159 | parent: 0:fc0bd45326d3 tip |
|
2158 | parent: 0:fc0bd45326d3 tip | |
2160 | #0 |
|
2159 | #0 | |
2161 | branch: default |
|
2160 | branch: default | |
2162 | commit: (clean) |
|
2161 | commit: (clean) | |
2163 | update: (current) |
|
2162 | update: (current) | |
2164 | largefiles: (no remote repo) |
|
2163 | largefiles: (no remote repo) | |
2165 |
|
2164 | |||
2166 | check messages when there is no files to upload: |
|
2165 | check messages when there is no files to upload: | |
2167 |
|
2166 | |||
2168 | $ hg -q clone src clone2 |
|
2167 | $ hg -q clone src clone2 | |
2169 | $ hg -R clone2 paths | grep default |
|
2168 | $ hg -R clone2 paths | grep default | |
2170 | default = $TESTTMP/issue3651/src (glob) |
|
2169 | default = $TESTTMP/issue3651/src (glob) | |
2171 |
|
2170 | |||
2172 | $ hg -R clone2 summary --large |
|
2171 | $ hg -R clone2 summary --large | |
2173 | parent: 0:fc0bd45326d3 tip |
|
2172 | parent: 0:fc0bd45326d3 tip | |
2174 | #0 |
|
2173 | #0 | |
2175 | branch: default |
|
2174 | branch: default | |
2176 | commit: (clean) |
|
2175 | commit: (clean) | |
2177 | update: (current) |
|
2176 | update: (current) | |
2178 | searching for changes |
|
2177 | searching for changes | |
2179 | largefiles: (no files to upload) |
|
2178 | largefiles: (no files to upload) | |
2180 | $ hg -R clone2 outgoing --large |
|
2179 | $ hg -R clone2 outgoing --large | |
2181 | comparing with $TESTTMP/issue3651/src (glob) |
|
2180 | comparing with $TESTTMP/issue3651/src (glob) | |
2182 | searching for changes |
|
2181 | searching for changes | |
2183 | no changes found |
|
2182 | no changes found | |
2184 | searching for changes |
|
2183 | searching for changes | |
2185 | largefiles: no files to upload |
|
2184 | largefiles: no files to upload | |
2186 | [1] |
|
2185 | [1] | |
2187 |
|
2186 | |||
2188 | check messages when there are files to upload: |
|
2187 | check messages when there are files to upload: | |
2189 |
|
2188 | |||
2190 | $ echo b > clone2/b |
|
2189 | $ echo b > clone2/b | |
2191 | $ hg -R clone2 add --large clone2/b |
|
2190 | $ hg -R clone2 add --large clone2/b | |
2192 | $ hg -R clone2 commit -m '#1' |
|
2191 | $ hg -R clone2 commit -m '#1' | |
2193 | Invoking status precommit hook |
|
2192 | Invoking status precommit hook | |
2194 | A b |
|
2193 | A b | |
2195 | $ hg -R clone2 summary --large |
|
2194 | $ hg -R clone2 summary --large | |
2196 | parent: 1:1acbe71ce432 tip |
|
2195 | parent: 1:1acbe71ce432 tip | |
2197 | #1 |
|
2196 | #1 | |
2198 | branch: default |
|
2197 | branch: default | |
2199 | commit: (clean) |
|
2198 | commit: (clean) | |
2200 | update: (current) |
|
2199 | update: (current) | |
2201 | searching for changes |
|
2200 | searching for changes | |
2202 | largefiles: 1 to upload |
|
2201 | largefiles: 1 to upload | |
2203 | $ hg -R clone2 outgoing --large |
|
2202 | $ hg -R clone2 outgoing --large | |
2204 | comparing with $TESTTMP/issue3651/src (glob) |
|
2203 | comparing with $TESTTMP/issue3651/src (glob) | |
2205 | searching for changes |
|
2204 | searching for changes | |
2206 | changeset: 1:1acbe71ce432 |
|
2205 | changeset: 1:1acbe71ce432 | |
2207 | tag: tip |
|
2206 | tag: tip | |
2208 | user: test |
|
2207 | user: test | |
2209 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
2208 | date: Thu Jan 01 00:00:00 1970 +0000 | |
2210 | summary: #1 |
|
2209 | summary: #1 | |
2211 |
|
2210 | |||
2212 | searching for changes |
|
2211 | searching for changes | |
2213 | largefiles to upload: |
|
2212 | largefiles to upload: | |
2214 | b |
|
2213 | b | |
2215 |
|
2214 | |||
2216 |
|
2215 | |||
2217 | $ cd .. |
|
2216 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now