Show More
@@ -1,1503 +1,1504 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 | from __future__ import absolute_import |
|
10 | from __future__ import absolute_import | |
11 |
|
11 | |||
12 | import copy |
|
12 | import copy | |
13 | import os |
|
13 | import os | |
14 |
|
14 | |||
15 | from mercurial.i18n import _ |
|
15 | from mercurial.i18n import _ | |
16 |
|
16 | |||
17 | from mercurial.hgweb import ( |
|
17 | from mercurial.hgweb import ( | |
18 | webcommands, |
|
18 | webcommands, | |
19 | ) |
|
19 | ) | |
20 |
|
20 | |||
21 | from mercurial import ( |
|
21 | from mercurial import ( | |
22 | archival, |
|
22 | archival, | |
23 | cmdutil, |
|
23 | cmdutil, | |
24 | copies as copiesmod, |
|
24 | copies as copiesmod, | |
25 | error, |
|
25 | error, | |
26 | exchange, |
|
26 | exchange, | |
27 | extensions, |
|
27 | extensions, | |
28 | exthelper, |
|
28 | exthelper, | |
29 | filemerge, |
|
29 | filemerge, | |
30 | hg, |
|
30 | hg, | |
31 | logcmdutil, |
|
31 | logcmdutil, | |
32 | match as matchmod, |
|
32 | match as matchmod, | |
33 | merge, |
|
33 | merge, | |
34 | pathutil, |
|
34 | pathutil, | |
35 | pycompat, |
|
35 | pycompat, | |
36 | scmutil, |
|
36 | scmutil, | |
37 | smartset, |
|
37 | smartset, | |
38 | subrepo, |
|
38 | subrepo, | |
39 | upgrade, |
|
39 | upgrade, | |
40 | url as urlmod, |
|
40 | url as urlmod, | |
41 | util, |
|
41 | util, | |
42 | ) |
|
42 | ) | |
43 |
|
43 | |||
44 | from . import ( |
|
44 | from . import ( | |
45 | lfcommands, |
|
45 | lfcommands, | |
46 | lfutil, |
|
46 | lfutil, | |
47 | storefactory, |
|
47 | storefactory, | |
48 | ) |
|
48 | ) | |
49 |
|
49 | |||
50 | eh = exthelper.exthelper() |
|
50 | eh = exthelper.exthelper() | |
51 |
|
51 | |||
52 | # -- Utility functions: commonly/repeatedly needed functionality --------------- |
|
52 | # -- Utility functions: commonly/repeatedly needed functionality --------------- | |
53 |
|
53 | |||
54 | def composelargefilematcher(match, manifest): |
|
54 | def composelargefilematcher(match, manifest): | |
55 | '''create a matcher that matches only the largefiles in the original |
|
55 | '''create a matcher that matches only the largefiles in the original | |
56 | matcher''' |
|
56 | matcher''' | |
57 | m = copy.copy(match) |
|
57 | m = copy.copy(match) | |
58 | lfile = lambda f: lfutil.standin(f) in manifest |
|
58 | lfile = lambda f: lfutil.standin(f) in manifest | |
59 | m._files = [lf for lf in m._files if lfile(lf)] |
|
59 | m._files = [lf for lf in m._files if lfile(lf)] | |
60 | m._fileset = set(m._files) |
|
60 | m._fileset = set(m._files) | |
61 | m.always = lambda: False |
|
61 | m.always = lambda: False | |
62 | origmatchfn = m.matchfn |
|
62 | origmatchfn = m.matchfn | |
63 | m.matchfn = lambda f: lfile(f) and origmatchfn(f) |
|
63 | m.matchfn = lambda f: lfile(f) and origmatchfn(f) | |
64 | return m |
|
64 | return m | |
65 |
|
65 | |||
66 | def composenormalfilematcher(match, manifest, exclude=None): |
|
66 | def composenormalfilematcher(match, manifest, exclude=None): | |
67 | excluded = set() |
|
67 | excluded = set() | |
68 | if exclude is not None: |
|
68 | if exclude is not None: | |
69 | excluded.update(exclude) |
|
69 | excluded.update(exclude) | |
70 |
|
70 | |||
71 | m = copy.copy(match) |
|
71 | m = copy.copy(match) | |
72 | notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in |
|
72 | notlfile = lambda f: not (lfutil.isstandin(f) or lfutil.standin(f) in | |
73 | manifest or f in excluded) |
|
73 | manifest or f in excluded) | |
74 | m._files = [lf for lf in m._files if notlfile(lf)] |
|
74 | m._files = [lf for lf in m._files if notlfile(lf)] | |
75 | m._fileset = set(m._files) |
|
75 | m._fileset = set(m._files) | |
76 | m.always = lambda: False |
|
76 | m.always = lambda: False | |
77 | origmatchfn = m.matchfn |
|
77 | origmatchfn = m.matchfn | |
78 | m.matchfn = lambda f: notlfile(f) and origmatchfn(f) |
|
78 | m.matchfn = lambda f: notlfile(f) and origmatchfn(f) | |
79 | return m |
|
79 | return m | |
80 |
|
80 | |||
81 | def addlargefiles(ui, repo, isaddremove, matcher, uipathfn, **opts): |
|
81 | def addlargefiles(ui, repo, isaddremove, matcher, uipathfn, **opts): | |
82 | large = opts.get(r'large') |
|
82 | large = opts.get(r'large') | |
83 | lfsize = lfutil.getminsize( |
|
83 | lfsize = lfutil.getminsize( | |
84 | ui, lfutil.islfilesrepo(repo), opts.get(r'lfsize')) |
|
84 | ui, lfutil.islfilesrepo(repo), opts.get(r'lfsize')) | |
85 |
|
85 | |||
86 | lfmatcher = None |
|
86 | lfmatcher = None | |
87 | if lfutil.islfilesrepo(repo): |
|
87 | if lfutil.islfilesrepo(repo): | |
88 | lfpats = ui.configlist(lfutil.longname, 'patterns') |
|
88 | lfpats = ui.configlist(lfutil.longname, 'patterns') | |
89 | if lfpats: |
|
89 | if lfpats: | |
90 | lfmatcher = matchmod.match(repo.root, '', list(lfpats)) |
|
90 | lfmatcher = matchmod.match(repo.root, '', list(lfpats)) | |
91 |
|
91 | |||
92 | lfnames = [] |
|
92 | lfnames = [] | |
93 | m = matcher |
|
93 | m = matcher | |
94 |
|
94 | |||
95 | wctx = repo[None] |
|
95 | wctx = repo[None] | |
96 | for f in wctx.walk(matchmod.badmatch(m, lambda x, y: None)): |
|
96 | for f in wctx.walk(matchmod.badmatch(m, lambda x, y: None)): | |
97 | exact = m.exact(f) |
|
97 | exact = m.exact(f) | |
98 | lfile = lfutil.standin(f) in wctx |
|
98 | lfile = lfutil.standin(f) in wctx | |
99 | nfile = f in wctx |
|
99 | nfile = f in wctx | |
100 | exists = lfile or nfile |
|
100 | exists = lfile or nfile | |
101 |
|
101 | |||
102 | # Don't warn the user when they attempt to add a normal tracked file. |
|
102 | # Don't warn the user when they attempt to add a normal tracked file. | |
103 | # The normal add code will do that for us. |
|
103 | # The normal add code will do that for us. | |
104 | if exact and exists: |
|
104 | if exact and exists: | |
105 | if lfile: |
|
105 | if lfile: | |
106 | ui.warn(_('%s already a largefile\n') % uipathfn(f)) |
|
106 | ui.warn(_('%s already a largefile\n') % uipathfn(f)) | |
107 | continue |
|
107 | continue | |
108 |
|
108 | |||
109 | if (exact or not exists) and not lfutil.isstandin(f): |
|
109 | if (exact or not exists) and not lfutil.isstandin(f): | |
110 | # In case the file was removed previously, but not committed |
|
110 | # In case the file was removed previously, but not committed | |
111 | # (issue3507) |
|
111 | # (issue3507) | |
112 | if not repo.wvfs.exists(f): |
|
112 | if not repo.wvfs.exists(f): | |
113 | continue |
|
113 | continue | |
114 |
|
114 | |||
115 | abovemin = (lfsize and |
|
115 | abovemin = (lfsize and | |
116 | repo.wvfs.lstat(f).st_size >= lfsize * 1024 * 1024) |
|
116 | repo.wvfs.lstat(f).st_size >= lfsize * 1024 * 1024) | |
117 | if large or abovemin or (lfmatcher and lfmatcher(f)): |
|
117 | if large or abovemin or (lfmatcher and lfmatcher(f)): | |
118 | lfnames.append(f) |
|
118 | lfnames.append(f) | |
119 | if ui.verbose or not exact: |
|
119 | if ui.verbose or not exact: | |
120 | ui.status(_('adding %s as a largefile\n') % uipathfn(f)) |
|
120 | ui.status(_('adding %s as a largefile\n') % uipathfn(f)) | |
121 |
|
121 | |||
122 | bad = [] |
|
122 | bad = [] | |
123 |
|
123 | |||
124 | # Need to lock, otherwise there could be a race condition between |
|
124 | # Need to lock, otherwise there could be a race condition between | |
125 | # when standins are created and added to the repo. |
|
125 | # when standins are created and added to the repo. | |
126 | with repo.wlock(): |
|
126 | with repo.wlock(): | |
127 | if not opts.get(r'dry_run'): |
|
127 | if not opts.get(r'dry_run'): | |
128 | standins = [] |
|
128 | standins = [] | |
129 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
129 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
130 | for f in lfnames: |
|
130 | for f in lfnames: | |
131 | standinname = lfutil.standin(f) |
|
131 | standinname = lfutil.standin(f) | |
132 | lfutil.writestandin(repo, standinname, hash='', |
|
132 | lfutil.writestandin(repo, standinname, hash='', | |
133 | executable=lfutil.getexecutable(repo.wjoin(f))) |
|
133 | executable=lfutil.getexecutable(repo.wjoin(f))) | |
134 | standins.append(standinname) |
|
134 | standins.append(standinname) | |
135 | if lfdirstate[f] == 'r': |
|
135 | if lfdirstate[f] == 'r': | |
136 | lfdirstate.normallookup(f) |
|
136 | lfdirstate.normallookup(f) | |
137 | else: |
|
137 | else: | |
138 | lfdirstate.add(f) |
|
138 | lfdirstate.add(f) | |
139 | lfdirstate.write() |
|
139 | lfdirstate.write() | |
140 | bad += [lfutil.splitstandin(f) |
|
140 | bad += [lfutil.splitstandin(f) | |
141 | for f in repo[None].add(standins) |
|
141 | for f in repo[None].add(standins) | |
142 | if f in m.files()] |
|
142 | if f in m.files()] | |
143 |
|
143 | |||
144 | added = [f for f in lfnames if f not in bad] |
|
144 | added = [f for f in lfnames if f not in bad] | |
145 | return added, bad |
|
145 | return added, bad | |
146 |
|
146 | |||
147 | def removelargefiles(ui, repo, isaddremove, matcher, uipathfn, dryrun, **opts): |
|
147 | def removelargefiles(ui, repo, isaddremove, matcher, uipathfn, dryrun, **opts): | |
148 | after = opts.get(r'after') |
|
148 | after = opts.get(r'after') | |
149 | m = composelargefilematcher(matcher, repo[None].manifest()) |
|
149 | m = composelargefilematcher(matcher, repo[None].manifest()) | |
150 | try: |
|
150 | try: | |
151 | repo.lfstatus = True |
|
151 | repo.lfstatus = True | |
152 | s = repo.status(match=m, clean=not isaddremove) |
|
152 | s = repo.status(match=m, clean=not isaddremove) | |
153 | finally: |
|
153 | finally: | |
154 | repo.lfstatus = False |
|
154 | repo.lfstatus = False | |
155 | manifest = repo[None].manifest() |
|
155 | manifest = repo[None].manifest() | |
156 | modified, added, deleted, clean = [[f for f in list |
|
156 | modified, added, deleted, clean = [[f for f in list | |
157 | if lfutil.standin(f) in manifest] |
|
157 | if lfutil.standin(f) in manifest] | |
158 | for list in (s.modified, s.added, |
|
158 | for list in (s.modified, s.added, | |
159 | s.deleted, s.clean)] |
|
159 | s.deleted, s.clean)] | |
160 |
|
160 | |||
161 | def warn(files, msg): |
|
161 | def warn(files, msg): | |
162 | for f in files: |
|
162 | for f in files: | |
163 | ui.warn(msg % uipathfn(f)) |
|
163 | ui.warn(msg % uipathfn(f)) | |
164 | return int(len(files) > 0) |
|
164 | return int(len(files) > 0) | |
165 |
|
165 | |||
166 | if after: |
|
166 | if after: | |
167 | remove = deleted |
|
167 | remove = deleted | |
168 | result = warn(modified + added + clean, |
|
168 | result = warn(modified + added + clean, | |
169 | _('not removing %s: file still exists\n')) |
|
169 | _('not removing %s: file still exists\n')) | |
170 | else: |
|
170 | else: | |
171 | remove = deleted + clean |
|
171 | remove = deleted + clean | |
172 | result = warn(modified, _('not removing %s: file is modified (use -f' |
|
172 | result = warn(modified, _('not removing %s: file is modified (use -f' | |
173 | ' to force removal)\n')) |
|
173 | ' to force removal)\n')) | |
174 | result = warn(added, _('not removing %s: file has been marked for add' |
|
174 | result = warn(added, _('not removing %s: file has been marked for add' | |
175 | ' (use forget to undo)\n')) or result |
|
175 | ' (use forget to undo)\n')) or result | |
176 |
|
176 | |||
177 | # Need to lock because standin files are deleted then removed from the |
|
177 | # Need to lock because standin files are deleted then removed from the | |
178 | # repository and we could race in-between. |
|
178 | # repository and we could race in-between. | |
179 | with repo.wlock(): |
|
179 | with repo.wlock(): | |
180 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
180 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
181 | for f in sorted(remove): |
|
181 | for f in sorted(remove): | |
182 | if ui.verbose or not m.exact(f): |
|
182 | if ui.verbose or not m.exact(f): | |
183 | ui.status(_('removing %s\n') % uipathfn(f)) |
|
183 | ui.status(_('removing %s\n') % uipathfn(f)) | |
184 |
|
184 | |||
185 | if not dryrun: |
|
185 | if not dryrun: | |
186 | if not after: |
|
186 | if not after: | |
187 | repo.wvfs.unlinkpath(f, ignoremissing=True) |
|
187 | repo.wvfs.unlinkpath(f, ignoremissing=True) | |
188 |
|
188 | |||
189 | if dryrun: |
|
189 | if dryrun: | |
190 | return result |
|
190 | return result | |
191 |
|
191 | |||
192 | remove = [lfutil.standin(f) for f in remove] |
|
192 | remove = [lfutil.standin(f) for f in remove] | |
193 | # If this is being called by addremove, let the original addremove |
|
193 | # If this is being called by addremove, let the original addremove | |
194 | # function handle this. |
|
194 | # function handle this. | |
195 | if not isaddremove: |
|
195 | if not isaddremove: | |
196 | for f in remove: |
|
196 | for f in remove: | |
197 | repo.wvfs.unlinkpath(f, ignoremissing=True) |
|
197 | repo.wvfs.unlinkpath(f, ignoremissing=True) | |
198 | repo[None].forget(remove) |
|
198 | repo[None].forget(remove) | |
199 |
|
199 | |||
200 | for f in remove: |
|
200 | for f in remove: | |
201 | lfutil.synclfdirstate(repo, lfdirstate, lfutil.splitstandin(f), |
|
201 | lfutil.synclfdirstate(repo, lfdirstate, lfutil.splitstandin(f), | |
202 | False) |
|
202 | False) | |
203 |
|
203 | |||
204 | lfdirstate.write() |
|
204 | lfdirstate.write() | |
205 |
|
205 | |||
206 | return result |
|
206 | return result | |
207 |
|
207 | |||
208 | # For overriding mercurial.hgweb.webcommands so that largefiles will |
|
208 | # For overriding mercurial.hgweb.webcommands so that largefiles will | |
209 | # appear at their right place in the manifests. |
|
209 | # appear at their right place in the manifests. | |
210 | @eh.wrapfunction(webcommands, 'decodepath') |
|
210 | @eh.wrapfunction(webcommands, 'decodepath') | |
211 | def decodepath(orig, path): |
|
211 | def decodepath(orig, path): | |
212 | return lfutil.splitstandin(path) or path |
|
212 | return lfutil.splitstandin(path) or path | |
213 |
|
213 | |||
214 | # -- Wrappers: modify existing commands -------------------------------- |
|
214 | # -- Wrappers: modify existing commands -------------------------------- | |
215 |
|
215 | |||
216 | @eh.wrapcommand('add', |
|
216 | @eh.wrapcommand('add', | |
217 | opts=[('', 'large', None, _('add as largefile')), |
|
217 | opts=[('', 'large', None, _('add as largefile')), | |
218 | ('', 'normal', None, _('add as normal file')), |
|
218 | ('', 'normal', None, _('add as normal file')), | |
219 | ('', 'lfsize', '', _('add all files above this size (in megabytes) ' |
|
219 | ('', 'lfsize', '', _('add all files above this size (in megabytes) ' | |
220 | 'as largefiles (default: 10)'))]) |
|
220 | 'as largefiles (default: 10)'))]) | |
221 | def overrideadd(orig, ui, repo, *pats, **opts): |
|
221 | def overrideadd(orig, ui, repo, *pats, **opts): | |
222 | if opts.get(r'normal') and opts.get(r'large'): |
|
222 | if opts.get(r'normal') and opts.get(r'large'): | |
223 | raise error.Abort(_('--normal cannot be used with --large')) |
|
223 | raise error.Abort(_('--normal cannot be used with --large')) | |
224 | return orig(ui, repo, *pats, **opts) |
|
224 | return orig(ui, repo, *pats, **opts) | |
225 |
|
225 | |||
226 | @eh.wrapfunction(cmdutil, 'add') |
|
226 | @eh.wrapfunction(cmdutil, 'add') | |
227 | def cmdutiladd(orig, ui, repo, matcher, prefix, uipathfn, explicitonly, **opts): |
|
227 | def cmdutiladd(orig, ui, repo, matcher, prefix, uipathfn, explicitonly, **opts): | |
228 | # The --normal flag short circuits this override |
|
228 | # The --normal flag short circuits this override | |
229 | if opts.get(r'normal'): |
|
229 | if opts.get(r'normal'): | |
230 | return orig(ui, repo, matcher, prefix, uipathfn, explicitonly, **opts) |
|
230 | return orig(ui, repo, matcher, prefix, uipathfn, explicitonly, **opts) | |
231 |
|
231 | |||
232 | ladded, lbad = addlargefiles(ui, repo, False, matcher, uipathfn, **opts) |
|
232 | ladded, lbad = addlargefiles(ui, repo, False, matcher, uipathfn, **opts) | |
233 | normalmatcher = composenormalfilematcher(matcher, repo[None].manifest(), |
|
233 | normalmatcher = composenormalfilematcher(matcher, repo[None].manifest(), | |
234 | ladded) |
|
234 | ladded) | |
235 | bad = orig(ui, repo, normalmatcher, prefix, uipathfn, explicitonly, **opts) |
|
235 | bad = orig(ui, repo, normalmatcher, prefix, uipathfn, explicitonly, **opts) | |
236 |
|
236 | |||
237 | bad.extend(f for f in lbad) |
|
237 | bad.extend(f for f in lbad) | |
238 | return bad |
|
238 | return bad | |
239 |
|
239 | |||
240 | @eh.wrapfunction(cmdutil, 'remove') |
|
240 | @eh.wrapfunction(cmdutil, 'remove') | |
241 | def cmdutilremove(orig, ui, repo, matcher, prefix, uipathfn, after, force, |
|
241 | def cmdutilremove(orig, ui, repo, matcher, prefix, uipathfn, after, force, | |
242 | subrepos, dryrun): |
|
242 | subrepos, dryrun): | |
243 | normalmatcher = composenormalfilematcher(matcher, repo[None].manifest()) |
|
243 | normalmatcher = composenormalfilematcher(matcher, repo[None].manifest()) | |
244 | result = orig(ui, repo, normalmatcher, prefix, uipathfn, after, force, |
|
244 | result = orig(ui, repo, normalmatcher, prefix, uipathfn, after, force, | |
245 | subrepos, dryrun) |
|
245 | subrepos, dryrun) | |
246 | return removelargefiles(ui, repo, False, matcher, uipathfn, dryrun, |
|
246 | return removelargefiles(ui, repo, False, matcher, uipathfn, dryrun, | |
247 | after=after, force=force) or result |
|
247 | after=after, force=force) or result | |
248 |
|
248 | |||
249 | @eh.wrapfunction(subrepo.hgsubrepo, 'status') |
|
249 | @eh.wrapfunction(subrepo.hgsubrepo, 'status') | |
250 | def overridestatusfn(orig, repo, rev2, **opts): |
|
250 | def overridestatusfn(orig, repo, rev2, **opts): | |
251 | try: |
|
251 | try: | |
252 | repo._repo.lfstatus = True |
|
252 | repo._repo.lfstatus = True | |
253 | return orig(repo, rev2, **opts) |
|
253 | return orig(repo, rev2, **opts) | |
254 | finally: |
|
254 | finally: | |
255 | repo._repo.lfstatus = False |
|
255 | repo._repo.lfstatus = False | |
256 |
|
256 | |||
257 | @eh.wrapcommand('status') |
|
257 | @eh.wrapcommand('status') | |
258 | def overridestatus(orig, ui, repo, *pats, **opts): |
|
258 | def overridestatus(orig, ui, repo, *pats, **opts): | |
259 | try: |
|
259 | try: | |
260 | repo.lfstatus = True |
|
260 | repo.lfstatus = True | |
261 | return orig(ui, repo, *pats, **opts) |
|
261 | return orig(ui, repo, *pats, **opts) | |
262 | finally: |
|
262 | finally: | |
263 | repo.lfstatus = False |
|
263 | repo.lfstatus = False | |
264 |
|
264 | |||
265 | @eh.wrapfunction(subrepo.hgsubrepo, 'dirty') |
|
265 | @eh.wrapfunction(subrepo.hgsubrepo, 'dirty') | |
266 | def overridedirty(orig, repo, ignoreupdate=False, missing=False): |
|
266 | def overridedirty(orig, repo, ignoreupdate=False, missing=False): | |
267 | try: |
|
267 | try: | |
268 | repo._repo.lfstatus = True |
|
268 | repo._repo.lfstatus = True | |
269 | return orig(repo, ignoreupdate=ignoreupdate, missing=missing) |
|
269 | return orig(repo, ignoreupdate=ignoreupdate, missing=missing) | |
270 | finally: |
|
270 | finally: | |
271 | repo._repo.lfstatus = False |
|
271 | repo._repo.lfstatus = False | |
272 |
|
272 | |||
273 | @eh.wrapcommand('log') |
|
273 | @eh.wrapcommand('log') | |
274 | def overridelog(orig, ui, repo, *pats, **opts): |
|
274 | def overridelog(orig, ui, repo, *pats, **opts): | |
275 | def overridematchandpats(orig, ctx, pats=(), opts=None, globbed=False, |
|
275 | def overridematchandpats(orig, ctx, pats=(), opts=None, globbed=False, | |
276 | default='relpath', badfn=None): |
|
276 | default='relpath', badfn=None): | |
277 | """Matcher that merges root directory with .hglf, suitable for log. |
|
277 | """Matcher that merges root directory with .hglf, suitable for log. | |
278 | It is still possible to match .hglf directly. |
|
278 | It is still possible to match .hglf directly. | |
279 | For any listed files run log on the standin too. |
|
279 | For any listed files run log on the standin too. | |
280 | matchfn tries both the given filename and with .hglf stripped. |
|
280 | matchfn tries both the given filename and with .hglf stripped. | |
281 | """ |
|
281 | """ | |
282 | if opts is None: |
|
282 | if opts is None: | |
283 | opts = {} |
|
283 | opts = {} | |
284 | matchandpats = orig(ctx, pats, opts, globbed, default, badfn=badfn) |
|
284 | matchandpats = orig(ctx, pats, opts, globbed, default, badfn=badfn) | |
285 | m, p = copy.copy(matchandpats) |
|
285 | m, p = copy.copy(matchandpats) | |
286 |
|
286 | |||
287 | if m.always(): |
|
287 | if m.always(): | |
288 | # We want to match everything anyway, so there's no benefit trying |
|
288 | # We want to match everything anyway, so there's no benefit trying | |
289 | # to add standins. |
|
289 | # to add standins. | |
290 | return matchandpats |
|
290 | return matchandpats | |
291 |
|
291 | |||
292 | pats = set(p) |
|
292 | pats = set(p) | |
293 |
|
293 | |||
294 | def fixpats(pat, tostandin=lfutil.standin): |
|
294 | def fixpats(pat, tostandin=lfutil.standin): | |
295 | if pat.startswith('set:'): |
|
295 | if pat.startswith('set:'): | |
296 | return pat |
|
296 | return pat | |
297 |
|
297 | |||
298 | kindpat = matchmod._patsplit(pat, None) |
|
298 | kindpat = matchmod._patsplit(pat, None) | |
299 |
|
299 | |||
300 | if kindpat[0] is not None: |
|
300 | if kindpat[0] is not None: | |
301 | return kindpat[0] + ':' + tostandin(kindpat[1]) |
|
301 | return kindpat[0] + ':' + tostandin(kindpat[1]) | |
302 | return tostandin(kindpat[1]) |
|
302 | return tostandin(kindpat[1]) | |
303 |
|
303 | |||
304 | cwd = repo.getcwd() |
|
304 | cwd = repo.getcwd() | |
305 | if cwd: |
|
305 | if cwd: | |
306 | hglf = lfutil.shortname |
|
306 | hglf = lfutil.shortname | |
307 | back = util.pconvert(repo.pathto(hglf)[:-len(hglf)]) |
|
307 | back = util.pconvert(repo.pathto(hglf)[:-len(hglf)]) | |
308 |
|
308 | |||
309 | def tostandin(f): |
|
309 | def tostandin(f): | |
310 | # The file may already be a standin, so truncate the back |
|
310 | # The file may already be a standin, so truncate the back | |
311 | # prefix and test before mangling it. This avoids turning |
|
311 | # prefix and test before mangling it. This avoids turning | |
312 | # 'glob:../.hglf/foo*' into 'glob:../.hglf/../.hglf/foo*'. |
|
312 | # 'glob:../.hglf/foo*' into 'glob:../.hglf/../.hglf/foo*'. | |
313 | if f.startswith(back) and lfutil.splitstandin(f[len(back):]): |
|
313 | if f.startswith(back) and lfutil.splitstandin(f[len(back):]): | |
314 | return f |
|
314 | return f | |
315 |
|
315 | |||
316 | # An absolute path is from outside the repo, so truncate the |
|
316 | # An absolute path is from outside the repo, so truncate the | |
317 | # path to the root before building the standin. Otherwise cwd |
|
317 | # path to the root before building the standin. Otherwise cwd | |
318 | # is somewhere in the repo, relative to root, and needs to be |
|
318 | # is somewhere in the repo, relative to root, and needs to be | |
319 | # prepended before building the standin. |
|
319 | # prepended before building the standin. | |
320 | if os.path.isabs(cwd): |
|
320 | if os.path.isabs(cwd): | |
321 | f = f[len(back):] |
|
321 | f = f[len(back):] | |
322 | else: |
|
322 | else: | |
323 | f = cwd + '/' + f |
|
323 | f = cwd + '/' + f | |
324 | return back + lfutil.standin(f) |
|
324 | return back + lfutil.standin(f) | |
325 | else: |
|
325 | else: | |
326 | def tostandin(f): |
|
326 | def tostandin(f): | |
327 | if lfutil.isstandin(f): |
|
327 | if lfutil.isstandin(f): | |
328 | return f |
|
328 | return f | |
329 | return lfutil.standin(f) |
|
329 | return lfutil.standin(f) | |
330 | pats.update(fixpats(f, tostandin) for f in p) |
|
330 | pats.update(fixpats(f, tostandin) for f in p) | |
331 |
|
331 | |||
332 | for i in range(0, len(m._files)): |
|
332 | for i in range(0, len(m._files)): | |
333 | # Don't add '.hglf' to m.files, since that is already covered by '.' |
|
333 | # Don't add '.hglf' to m.files, since that is already covered by '.' | |
334 | if m._files[i] == '.': |
|
334 | if m._files[i] == '.': | |
335 | continue |
|
335 | continue | |
336 | standin = lfutil.standin(m._files[i]) |
|
336 | standin = lfutil.standin(m._files[i]) | |
337 | # If the "standin" is a directory, append instead of replace to |
|
337 | # If the "standin" is a directory, append instead of replace to | |
338 | # support naming a directory on the command line with only |
|
338 | # support naming a directory on the command line with only | |
339 | # largefiles. The original directory is kept to support normal |
|
339 | # largefiles. The original directory is kept to support normal | |
340 | # files. |
|
340 | # files. | |
341 | if standin in ctx: |
|
341 | if standin in ctx: | |
342 | m._files[i] = standin |
|
342 | m._files[i] = standin | |
343 | elif m._files[i] not in ctx and repo.wvfs.isdir(standin): |
|
343 | elif m._files[i] not in ctx and repo.wvfs.isdir(standin): | |
344 | m._files.append(standin) |
|
344 | m._files.append(standin) | |
345 |
|
345 | |||
346 | m._fileset = set(m._files) |
|
346 | m._fileset = set(m._files) | |
347 | m.always = lambda: False |
|
347 | m.always = lambda: False | |
348 | origmatchfn = m.matchfn |
|
348 | origmatchfn = m.matchfn | |
349 | def lfmatchfn(f): |
|
349 | def lfmatchfn(f): | |
350 | lf = lfutil.splitstandin(f) |
|
350 | lf = lfutil.splitstandin(f) | |
351 | if lf is not None and origmatchfn(lf): |
|
351 | if lf is not None and origmatchfn(lf): | |
352 | return True |
|
352 | return True | |
353 | r = origmatchfn(f) |
|
353 | r = origmatchfn(f) | |
354 | return r |
|
354 | return r | |
355 | m.matchfn = lfmatchfn |
|
355 | m.matchfn = lfmatchfn | |
356 |
|
356 | |||
357 | ui.debug('updated patterns: %s\n' % ', '.join(sorted(pats))) |
|
357 | ui.debug('updated patterns: %s\n' % ', '.join(sorted(pats))) | |
358 | return m, pats |
|
358 | return m, pats | |
359 |
|
359 | |||
360 | # For hg log --patch, the match object is used in two different senses: |
|
360 | # For hg log --patch, the match object is used in two different senses: | |
361 | # (1) to determine what revisions should be printed out, and |
|
361 | # (1) to determine what revisions should be printed out, and | |
362 | # (2) to determine what files to print out diffs for. |
|
362 | # (2) to determine what files to print out diffs for. | |
363 | # The magic matchandpats override should be used for case (1) but not for |
|
363 | # The magic matchandpats override should be used for case (1) but not for | |
364 | # case (2). |
|
364 | # case (2). | |
365 | oldmatchandpats = scmutil.matchandpats |
|
365 | oldmatchandpats = scmutil.matchandpats | |
366 | def overridemakefilematcher(orig, repo, pats, opts, badfn=None): |
|
366 | def overridemakefilematcher(orig, repo, pats, opts, badfn=None): | |
367 | wctx = repo[None] |
|
367 | wctx = repo[None] | |
368 | match, pats = oldmatchandpats(wctx, pats, opts, badfn=badfn) |
|
368 | match, pats = oldmatchandpats(wctx, pats, opts, badfn=badfn) | |
369 | return lambda ctx: match |
|
369 | return lambda ctx: match | |
370 |
|
370 | |||
371 | wrappedmatchandpats = extensions.wrappedfunction(scmutil, 'matchandpats', |
|
371 | wrappedmatchandpats = extensions.wrappedfunction(scmutil, 'matchandpats', | |
372 | overridematchandpats) |
|
372 | overridematchandpats) | |
373 | wrappedmakefilematcher = extensions.wrappedfunction( |
|
373 | wrappedmakefilematcher = extensions.wrappedfunction( | |
374 | logcmdutil, '_makenofollowfilematcher', overridemakefilematcher) |
|
374 | logcmdutil, '_makenofollowfilematcher', overridemakefilematcher) | |
375 | with wrappedmatchandpats, wrappedmakefilematcher: |
|
375 | with wrappedmatchandpats, wrappedmakefilematcher: | |
376 | return orig(ui, repo, *pats, **opts) |
|
376 | return orig(ui, repo, *pats, **opts) | |
377 |
|
377 | |||
378 | @eh.wrapcommand('verify', |
|
378 | @eh.wrapcommand('verify', | |
379 | opts=[('', 'large', None, |
|
379 | opts=[('', 'large', None, | |
380 | _('verify that all largefiles in current revision exists')), |
|
380 | _('verify that all largefiles in current revision exists')), | |
381 | ('', 'lfa', None, |
|
381 | ('', 'lfa', None, | |
382 | _('verify largefiles in all revisions, not just current')), |
|
382 | _('verify largefiles in all revisions, not just current')), | |
383 | ('', 'lfc', None, |
|
383 | ('', 'lfc', None, | |
384 | _('verify local largefile contents, not just existence'))]) |
|
384 | _('verify local largefile contents, not just existence'))]) | |
385 | def overrideverify(orig, ui, repo, *pats, **opts): |
|
385 | def overrideverify(orig, ui, repo, *pats, **opts): | |
386 | large = opts.pop(r'large', False) |
|
386 | large = opts.pop(r'large', False) | |
387 | all = opts.pop(r'lfa', False) |
|
387 | all = opts.pop(r'lfa', False) | |
388 | contents = opts.pop(r'lfc', False) |
|
388 | contents = opts.pop(r'lfc', False) | |
389 |
|
389 | |||
390 | result = orig(ui, repo, *pats, **opts) |
|
390 | result = orig(ui, repo, *pats, **opts) | |
391 | if large or all or contents: |
|
391 | if large or all or contents: | |
392 | result = result or lfcommands.verifylfiles(ui, repo, all, contents) |
|
392 | result = result or lfcommands.verifylfiles(ui, repo, all, contents) | |
393 | return result |
|
393 | return result | |
394 |
|
394 | |||
395 | @eh.wrapcommand('debugstate', |
|
395 | @eh.wrapcommand('debugstate', | |
396 | opts=[('', 'large', None, _('display largefiles dirstate'))]) |
|
396 | opts=[('', 'large', None, _('display largefiles dirstate'))]) | |
397 | def overridedebugstate(orig, ui, repo, *pats, **opts): |
|
397 | def overridedebugstate(orig, ui, repo, *pats, **opts): | |
398 | large = opts.pop(r'large', False) |
|
398 | large = opts.pop(r'large', False) | |
399 | if large: |
|
399 | if large: | |
400 | class fakerepo(object): |
|
400 | class fakerepo(object): | |
401 | dirstate = lfutil.openlfdirstate(ui, repo) |
|
401 | dirstate = lfutil.openlfdirstate(ui, repo) | |
402 | orig(ui, fakerepo, *pats, **opts) |
|
402 | orig(ui, fakerepo, *pats, **opts) | |
403 | else: |
|
403 | else: | |
404 | orig(ui, repo, *pats, **opts) |
|
404 | orig(ui, repo, *pats, **opts) | |
405 |
|
405 | |||
406 | # Before starting the manifest merge, merge.updates will call |
|
406 | # Before starting the manifest merge, merge.updates will call | |
407 | # _checkunknownfile to check if there are any files in the merged-in |
|
407 | # _checkunknownfile to check if there are any files in the merged-in | |
408 | # changeset that collide with unknown files in the working copy. |
|
408 | # changeset that collide with unknown files in the working copy. | |
409 | # |
|
409 | # | |
410 | # The largefiles are seen as unknown, so this prevents us from merging |
|
410 | # The largefiles are seen as unknown, so this prevents us from merging | |
411 | # in a file 'foo' if we already have a largefile with the same name. |
|
411 | # in a file 'foo' if we already have a largefile with the same name. | |
412 | # |
|
412 | # | |
413 | # The overridden function filters the unknown files by removing any |
|
413 | # The overridden function filters the unknown files by removing any | |
414 | # largefiles. This makes the merge proceed and we can then handle this |
|
414 | # largefiles. This makes the merge proceed and we can then handle this | |
415 | # case further in the overridden calculateupdates function below. |
|
415 | # case further in the overridden calculateupdates function below. | |
416 | @eh.wrapfunction(merge, '_checkunknownfile') |
|
416 | @eh.wrapfunction(merge, '_checkunknownfile') | |
417 | def overridecheckunknownfile(origfn, repo, wctx, mctx, f, f2=None): |
|
417 | def overridecheckunknownfile(origfn, repo, wctx, mctx, f, f2=None): | |
418 | if lfutil.standin(repo.dirstate.normalize(f)) in wctx: |
|
418 | if lfutil.standin(repo.dirstate.normalize(f)) in wctx: | |
419 | return False |
|
419 | return False | |
420 | return origfn(repo, wctx, mctx, f, f2) |
|
420 | return origfn(repo, wctx, mctx, f, f2) | |
421 |
|
421 | |||
422 | # The manifest merge handles conflicts on the manifest level. We want |
|
422 | # The manifest merge handles conflicts on the manifest level. We want | |
423 | # to handle changes in largefile-ness of files at this level too. |
|
423 | # to handle changes in largefile-ness of files at this level too. | |
424 | # |
|
424 | # | |
425 | # The strategy is to run the original calculateupdates and then process |
|
425 | # The strategy is to run the original calculateupdates and then process | |
426 | # the action list it outputs. There are two cases we need to deal with: |
|
426 | # the action list it outputs. There are two cases we need to deal with: | |
427 | # |
|
427 | # | |
428 | # 1. Normal file in p1, largefile in p2. Here the largefile is |
|
428 | # 1. Normal file in p1, largefile in p2. Here the largefile is | |
429 | # detected via its standin file, which will enter the working copy |
|
429 | # detected via its standin file, which will enter the working copy | |
430 | # with a "get" action. It is not "merge" since the standin is all |
|
430 | # with a "get" action. It is not "merge" since the standin is all | |
431 | # Mercurial is concerned with at this level -- the link to the |
|
431 | # Mercurial is concerned with at this level -- the link to the | |
432 | # existing normal file is not relevant here. |
|
432 | # existing normal file is not relevant here. | |
433 | # |
|
433 | # | |
434 | # 2. Largefile in p1, normal file in p2. Here we get a "merge" action |
|
434 | # 2. Largefile in p1, normal file in p2. Here we get a "merge" action | |
435 | # since the largefile will be present in the working copy and |
|
435 | # since the largefile will be present in the working copy and | |
436 | # different from the normal file in p2. Mercurial therefore |
|
436 | # different from the normal file in p2. Mercurial therefore | |
437 | # triggers a merge action. |
|
437 | # triggers a merge action. | |
438 | # |
|
438 | # | |
439 | # In both cases, we prompt the user and emit new actions to either |
|
439 | # In both cases, we prompt the user and emit new actions to either | |
440 | # remove the standin (if the normal file was kept) or to remove the |
|
440 | # remove the standin (if the normal file was kept) or to remove the | |
441 | # normal file and get the standin (if the largefile was kept). The |
|
441 | # normal file and get the standin (if the largefile was kept). The | |
442 | # default prompt answer is to use the largefile version since it was |
|
442 | # default prompt answer is to use the largefile version since it was | |
443 | # presumably changed on purpose. |
|
443 | # presumably changed on purpose. | |
444 | # |
|
444 | # | |
445 | # Finally, the merge.applyupdates function will then take care of |
|
445 | # Finally, the merge.applyupdates function will then take care of | |
446 | # writing the files into the working copy and lfcommands.updatelfiles |
|
446 | # writing the files into the working copy and lfcommands.updatelfiles | |
447 | # will update the largefiles. |
|
447 | # will update the largefiles. | |
448 | @eh.wrapfunction(merge, 'calculateupdates') |
|
448 | @eh.wrapfunction(merge, 'calculateupdates') | |
449 | def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force, |
|
449 | def overridecalculateupdates(origfn, repo, p1, p2, pas, branchmerge, force, | |
450 | acceptremote, *args, **kwargs): |
|
450 | acceptremote, *args, **kwargs): | |
451 | overwrite = force and not branchmerge |
|
451 | overwrite = force and not branchmerge | |
452 | actions, diverge, renamedelete = origfn( |
|
452 | actions, diverge, renamedelete = origfn( | |
453 | repo, p1, p2, pas, branchmerge, force, acceptremote, *args, **kwargs) |
|
453 | repo, p1, p2, pas, branchmerge, force, acceptremote, *args, **kwargs) | |
454 |
|
454 | |||
455 | if overwrite: |
|
455 | if overwrite: | |
456 | return actions, diverge, renamedelete |
|
456 | return actions, diverge, renamedelete | |
457 |
|
457 | |||
458 | # Convert to dictionary with filename as key and action as value. |
|
458 | # Convert to dictionary with filename as key and action as value. | |
459 | lfiles = set() |
|
459 | lfiles = set() | |
460 | for f in actions: |
|
460 | for f in actions: | |
461 | splitstandin = lfutil.splitstandin(f) |
|
461 | splitstandin = lfutil.splitstandin(f) | |
462 | if splitstandin in p1: |
|
462 | if splitstandin in p1: | |
463 | lfiles.add(splitstandin) |
|
463 | lfiles.add(splitstandin) | |
464 | elif lfutil.standin(f) in p1: |
|
464 | elif lfutil.standin(f) in p1: | |
465 | lfiles.add(f) |
|
465 | lfiles.add(f) | |
466 |
|
466 | |||
467 | for lfile in sorted(lfiles): |
|
467 | for lfile in sorted(lfiles): | |
468 | standin = lfutil.standin(lfile) |
|
468 | standin = lfutil.standin(lfile) | |
469 | (lm, largs, lmsg) = actions.get(lfile, (None, None, None)) |
|
469 | (lm, largs, lmsg) = actions.get(lfile, (None, None, None)) | |
470 | (sm, sargs, smsg) = actions.get(standin, (None, None, None)) |
|
470 | (sm, sargs, smsg) = actions.get(standin, (None, None, None)) | |
471 | if sm in ('g', 'dc') and lm != 'r': |
|
471 | if sm in ('g', 'dc') and lm != 'r': | |
472 | if sm == 'dc': |
|
472 | if sm == 'dc': | |
473 | f1, f2, fa, move, anc = sargs |
|
473 | f1, f2, fa, move, anc = sargs | |
474 | sargs = (p2[f2].flags(), False) |
|
474 | sargs = (p2[f2].flags(), False) | |
475 | # Case 1: normal file in the working copy, largefile in |
|
475 | # Case 1: normal file in the working copy, largefile in | |
476 | # the second parent |
|
476 | # the second parent | |
477 | usermsg = _('remote turned local normal file %s into a largefile\n' |
|
477 | usermsg = _('remote turned local normal file %s into a largefile\n' | |
478 | 'use (l)argefile or keep (n)ormal file?' |
|
478 | 'use (l)argefile or keep (n)ormal file?' | |
479 | '$$ &Largefile $$ &Normal file') % lfile |
|
479 | '$$ &Largefile $$ &Normal file') % lfile | |
480 | if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile |
|
480 | if repo.ui.promptchoice(usermsg, 0) == 0: # pick remote largefile | |
481 | actions[lfile] = ('r', None, 'replaced by standin') |
|
481 | actions[lfile] = ('r', None, 'replaced by standin') | |
482 | actions[standin] = ('g', sargs, 'replaces standin') |
|
482 | actions[standin] = ('g', sargs, 'replaces standin') | |
483 | else: # keep local normal file |
|
483 | else: # keep local normal file | |
484 | actions[lfile] = ('k', None, 'replaces standin') |
|
484 | actions[lfile] = ('k', None, 'replaces standin') | |
485 | if branchmerge: |
|
485 | if branchmerge: | |
486 | actions[standin] = ('k', None, 'replaced by non-standin') |
|
486 | actions[standin] = ('k', None, 'replaced by non-standin') | |
487 | else: |
|
487 | else: | |
488 | actions[standin] = ('r', None, 'replaced by non-standin') |
|
488 | actions[standin] = ('r', None, 'replaced by non-standin') | |
489 | elif lm in ('g', 'dc') and sm != 'r': |
|
489 | elif lm in ('g', 'dc') and sm != 'r': | |
490 | if lm == 'dc': |
|
490 | if lm == 'dc': | |
491 | f1, f2, fa, move, anc = largs |
|
491 | f1, f2, fa, move, anc = largs | |
492 | largs = (p2[f2].flags(), False) |
|
492 | largs = (p2[f2].flags(), False) | |
493 | # Case 2: largefile in the working copy, normal file in |
|
493 | # Case 2: largefile in the working copy, normal file in | |
494 | # the second parent |
|
494 | # the second parent | |
495 | usermsg = _('remote turned local largefile %s into a normal file\n' |
|
495 | usermsg = _('remote turned local largefile %s into a normal file\n' | |
496 | 'keep (l)argefile or use (n)ormal file?' |
|
496 | 'keep (l)argefile or use (n)ormal file?' | |
497 | '$$ &Largefile $$ &Normal file') % lfile |
|
497 | '$$ &Largefile $$ &Normal file') % lfile | |
498 | if repo.ui.promptchoice(usermsg, 0) == 0: # keep local largefile |
|
498 | if repo.ui.promptchoice(usermsg, 0) == 0: # keep local largefile | |
499 | if branchmerge: |
|
499 | if branchmerge: | |
500 | # largefile can be restored from standin safely |
|
500 | # largefile can be restored from standin safely | |
501 | actions[lfile] = ('k', None, 'replaced by standin') |
|
501 | actions[lfile] = ('k', None, 'replaced by standin') | |
502 | actions[standin] = ('k', None, 'replaces standin') |
|
502 | actions[standin] = ('k', None, 'replaces standin') | |
503 | else: |
|
503 | else: | |
504 | # "lfile" should be marked as "removed" without |
|
504 | # "lfile" should be marked as "removed" without | |
505 | # removal of itself |
|
505 | # removal of itself | |
506 | actions[lfile] = ('lfmr', None, |
|
506 | actions[lfile] = ('lfmr', None, | |
507 | 'forget non-standin largefile') |
|
507 | 'forget non-standin largefile') | |
508 |
|
508 | |||
509 | # linear-merge should treat this largefile as 're-added' |
|
509 | # linear-merge should treat this largefile as 're-added' | |
510 | actions[standin] = ('a', None, 'keep standin') |
|
510 | actions[standin] = ('a', None, 'keep standin') | |
511 | else: # pick remote normal file |
|
511 | else: # pick remote normal file | |
512 | actions[lfile] = ('g', largs, 'replaces standin') |
|
512 | actions[lfile] = ('g', largs, 'replaces standin') | |
513 | actions[standin] = ('r', None, 'replaced by non-standin') |
|
513 | actions[standin] = ('r', None, 'replaced by non-standin') | |
514 |
|
514 | |||
515 | return actions, diverge, renamedelete |
|
515 | return actions, diverge, renamedelete | |
516 |
|
516 | |||
517 | @eh.wrapfunction(merge, 'recordupdates') |
|
517 | @eh.wrapfunction(merge, 'recordupdates') | |
518 | def mergerecordupdates(orig, repo, actions, branchmerge, getfiledata): |
|
518 | def mergerecordupdates(orig, repo, actions, branchmerge, getfiledata): | |
519 | if 'lfmr' in actions: |
|
519 | if 'lfmr' in actions: | |
520 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) |
|
520 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) | |
521 | for lfile, args, msg in actions['lfmr']: |
|
521 | for lfile, args, msg in actions['lfmr']: | |
522 | # this should be executed before 'orig', to execute 'remove' |
|
522 | # this should be executed before 'orig', to execute 'remove' | |
523 | # before all other actions |
|
523 | # before all other actions | |
524 | repo.dirstate.remove(lfile) |
|
524 | repo.dirstate.remove(lfile) | |
525 | # make sure lfile doesn't get synclfdirstate'd as normal |
|
525 | # make sure lfile doesn't get synclfdirstate'd as normal | |
526 | lfdirstate.add(lfile) |
|
526 | lfdirstate.add(lfile) | |
527 | lfdirstate.write() |
|
527 | lfdirstate.write() | |
528 |
|
528 | |||
529 | return orig(repo, actions, branchmerge, getfiledata) |
|
529 | return orig(repo, actions, branchmerge, getfiledata) | |
530 |
|
530 | |||
531 | # Override filemerge to prompt the user about how they wish to merge |
|
531 | # Override filemerge to prompt the user about how they wish to merge | |
532 | # largefiles. This will handle identical edits without prompting the user. |
|
532 | # largefiles. This will handle identical edits without prompting the user. | |
533 | @eh.wrapfunction(filemerge, '_filemerge') |
|
533 | @eh.wrapfunction(filemerge, '_filemerge') | |
534 | def overridefilemerge(origfn, premerge, repo, wctx, mynode, orig, fcd, fco, fca, |
|
534 | def overridefilemerge(origfn, premerge, repo, wctx, mynode, orig, fcd, fco, fca, | |
535 | labels=None): |
|
535 | labels=None): | |
536 | if not lfutil.isstandin(orig) or fcd.isabsent() or fco.isabsent(): |
|
536 | if not lfutil.isstandin(orig) or fcd.isabsent() or fco.isabsent(): | |
537 | return origfn(premerge, repo, wctx, mynode, orig, fcd, fco, fca, |
|
537 | return origfn(premerge, repo, wctx, mynode, orig, fcd, fco, fca, | |
538 | labels=labels) |
|
538 | labels=labels) | |
539 |
|
539 | |||
540 | ahash = lfutil.readasstandin(fca).lower() |
|
540 | ahash = lfutil.readasstandin(fca).lower() | |
541 | dhash = lfutil.readasstandin(fcd).lower() |
|
541 | dhash = lfutil.readasstandin(fcd).lower() | |
542 | ohash = lfutil.readasstandin(fco).lower() |
|
542 | ohash = lfutil.readasstandin(fco).lower() | |
543 | if (ohash != ahash and |
|
543 | if (ohash != ahash and | |
544 | ohash != dhash and |
|
544 | ohash != dhash and | |
545 | (dhash == ahash or |
|
545 | (dhash == ahash or | |
546 | repo.ui.promptchoice( |
|
546 | repo.ui.promptchoice( | |
547 | _('largefile %s has a merge conflict\nancestor was %s\n' |
|
547 | _('largefile %s has a merge conflict\nancestor was %s\n' | |
548 |
'keep (l)ocal %s or\n |
|
548 | 'you can keep (l)ocal %s or take (o)ther %s.\n' | |
|
549 | 'what do you want to do?' | |||
549 | '$$ &Local $$ &Other') % |
|
550 | '$$ &Local $$ &Other') % | |
550 | (lfutil.splitstandin(orig), ahash, dhash, ohash), |
|
551 | (lfutil.splitstandin(orig), ahash, dhash, ohash), | |
551 | 0) == 1)): |
|
552 | 0) == 1)): | |
552 | repo.wwrite(fcd.path(), fco.data(), fco.flags()) |
|
553 | repo.wwrite(fcd.path(), fco.data(), fco.flags()) | |
553 | return True, 0, False |
|
554 | return True, 0, False | |
554 |
|
555 | |||
555 | @eh.wrapfunction(copiesmod, 'pathcopies') |
|
556 | @eh.wrapfunction(copiesmod, 'pathcopies') | |
556 | def copiespathcopies(orig, ctx1, ctx2, match=None): |
|
557 | def copiespathcopies(orig, ctx1, ctx2, match=None): | |
557 | copies = orig(ctx1, ctx2, match=match) |
|
558 | copies = orig(ctx1, ctx2, match=match) | |
558 | updated = {} |
|
559 | updated = {} | |
559 |
|
560 | |||
560 | for k, v in copies.iteritems(): |
|
561 | for k, v in copies.iteritems(): | |
561 | updated[lfutil.splitstandin(k) or k] = lfutil.splitstandin(v) or v |
|
562 | updated[lfutil.splitstandin(k) or k] = lfutil.splitstandin(v) or v | |
562 |
|
563 | |||
563 | return updated |
|
564 | return updated | |
564 |
|
565 | |||
565 | # Copy first changes the matchers to match standins instead of |
|
566 | # Copy first changes the matchers to match standins instead of | |
566 | # largefiles. Then it overrides util.copyfile in that function it |
|
567 | # largefiles. Then it overrides util.copyfile in that function it | |
567 | # checks if the destination largefile already exists. It also keeps a |
|
568 | # checks if the destination largefile already exists. It also keeps a | |
568 | # list of copied files so that the largefiles can be copied and the |
|
569 | # list of copied files so that the largefiles can be copied and the | |
569 | # dirstate updated. |
|
570 | # dirstate updated. | |
570 | @eh.wrapfunction(cmdutil, 'copy') |
|
571 | @eh.wrapfunction(cmdutil, 'copy') | |
571 | def overridecopy(orig, ui, repo, pats, opts, rename=False): |
|
572 | def overridecopy(orig, ui, repo, pats, opts, rename=False): | |
572 | # doesn't remove largefile on rename |
|
573 | # doesn't remove largefile on rename | |
573 | if len(pats) < 2: |
|
574 | if len(pats) < 2: | |
574 | # this isn't legal, let the original function deal with it |
|
575 | # this isn't legal, let the original function deal with it | |
575 | return orig(ui, repo, pats, opts, rename) |
|
576 | return orig(ui, repo, pats, opts, rename) | |
576 |
|
577 | |||
577 | # This could copy both lfiles and normal files in one command, |
|
578 | # This could copy both lfiles and normal files in one command, | |
578 | # but we don't want to do that. First replace their matcher to |
|
579 | # but we don't want to do that. First replace their matcher to | |
579 | # only match normal files and run it, then replace it to just |
|
580 | # only match normal files and run it, then replace it to just | |
580 | # match largefiles and run it again. |
|
581 | # match largefiles and run it again. | |
581 | nonormalfiles = False |
|
582 | nonormalfiles = False | |
582 | nolfiles = False |
|
583 | nolfiles = False | |
583 | manifest = repo[None].manifest() |
|
584 | manifest = repo[None].manifest() | |
584 | def normalfilesmatchfn(orig, ctx, pats=(), opts=None, globbed=False, |
|
585 | def normalfilesmatchfn(orig, ctx, pats=(), opts=None, globbed=False, | |
585 | default='relpath', badfn=None): |
|
586 | default='relpath', badfn=None): | |
586 | if opts is None: |
|
587 | if opts is None: | |
587 | opts = {} |
|
588 | opts = {} | |
588 | match = orig(ctx, pats, opts, globbed, default, badfn=badfn) |
|
589 | match = orig(ctx, pats, opts, globbed, default, badfn=badfn) | |
589 | return composenormalfilematcher(match, manifest) |
|
590 | return composenormalfilematcher(match, manifest) | |
590 | with extensions.wrappedfunction(scmutil, 'match', normalfilesmatchfn): |
|
591 | with extensions.wrappedfunction(scmutil, 'match', normalfilesmatchfn): | |
591 | try: |
|
592 | try: | |
592 | result = orig(ui, repo, pats, opts, rename) |
|
593 | result = orig(ui, repo, pats, opts, rename) | |
593 | except error.Abort as e: |
|
594 | except error.Abort as e: | |
594 | if pycompat.bytestr(e) != _('no files to copy'): |
|
595 | if pycompat.bytestr(e) != _('no files to copy'): | |
595 | raise e |
|
596 | raise e | |
596 | else: |
|
597 | else: | |
597 | nonormalfiles = True |
|
598 | nonormalfiles = True | |
598 | result = 0 |
|
599 | result = 0 | |
599 |
|
600 | |||
600 | # The first rename can cause our current working directory to be removed. |
|
601 | # The first rename can cause our current working directory to be removed. | |
601 | # In that case there is nothing left to copy/rename so just quit. |
|
602 | # In that case there is nothing left to copy/rename so just quit. | |
602 | try: |
|
603 | try: | |
603 | repo.getcwd() |
|
604 | repo.getcwd() | |
604 | except OSError: |
|
605 | except OSError: | |
605 | return result |
|
606 | return result | |
606 |
|
607 | |||
607 | def makestandin(relpath): |
|
608 | def makestandin(relpath): | |
608 | path = pathutil.canonpath(repo.root, repo.getcwd(), relpath) |
|
609 | path = pathutil.canonpath(repo.root, repo.getcwd(), relpath) | |
609 | return repo.wvfs.join(lfutil.standin(path)) |
|
610 | return repo.wvfs.join(lfutil.standin(path)) | |
610 |
|
611 | |||
611 | fullpats = scmutil.expandpats(pats) |
|
612 | fullpats = scmutil.expandpats(pats) | |
612 | dest = fullpats[-1] |
|
613 | dest = fullpats[-1] | |
613 |
|
614 | |||
614 | if os.path.isdir(dest): |
|
615 | if os.path.isdir(dest): | |
615 | if not os.path.isdir(makestandin(dest)): |
|
616 | if not os.path.isdir(makestandin(dest)): | |
616 | os.makedirs(makestandin(dest)) |
|
617 | os.makedirs(makestandin(dest)) | |
617 |
|
618 | |||
618 | try: |
|
619 | try: | |
619 | # When we call orig below it creates the standins but we don't add |
|
620 | # When we call orig below it creates the standins but we don't add | |
620 | # them to the dir state until later so lock during that time. |
|
621 | # them to the dir state until later so lock during that time. | |
621 | wlock = repo.wlock() |
|
622 | wlock = repo.wlock() | |
622 |
|
623 | |||
623 | manifest = repo[None].manifest() |
|
624 | manifest = repo[None].manifest() | |
624 | def overridematch(orig, ctx, pats=(), opts=None, globbed=False, |
|
625 | def overridematch(orig, ctx, pats=(), opts=None, globbed=False, | |
625 | default='relpath', badfn=None): |
|
626 | default='relpath', badfn=None): | |
626 | if opts is None: |
|
627 | if opts is None: | |
627 | opts = {} |
|
628 | opts = {} | |
628 | newpats = [] |
|
629 | newpats = [] | |
629 | # The patterns were previously mangled to add the standin |
|
630 | # The patterns were previously mangled to add the standin | |
630 | # directory; we need to remove that now |
|
631 | # directory; we need to remove that now | |
631 | for pat in pats: |
|
632 | for pat in pats: | |
632 | if matchmod.patkind(pat) is None and lfutil.shortname in pat: |
|
633 | if matchmod.patkind(pat) is None and lfutil.shortname in pat: | |
633 | newpats.append(pat.replace(lfutil.shortname, '')) |
|
634 | newpats.append(pat.replace(lfutil.shortname, '')) | |
634 | else: |
|
635 | else: | |
635 | newpats.append(pat) |
|
636 | newpats.append(pat) | |
636 | match = orig(ctx, newpats, opts, globbed, default, badfn=badfn) |
|
637 | match = orig(ctx, newpats, opts, globbed, default, badfn=badfn) | |
637 | m = copy.copy(match) |
|
638 | m = copy.copy(match) | |
638 | lfile = lambda f: lfutil.standin(f) in manifest |
|
639 | lfile = lambda f: lfutil.standin(f) in manifest | |
639 | m._files = [lfutil.standin(f) for f in m._files if lfile(f)] |
|
640 | m._files = [lfutil.standin(f) for f in m._files if lfile(f)] | |
640 | m._fileset = set(m._files) |
|
641 | m._fileset = set(m._files) | |
641 | origmatchfn = m.matchfn |
|
642 | origmatchfn = m.matchfn | |
642 | def matchfn(f): |
|
643 | def matchfn(f): | |
643 | lfile = lfutil.splitstandin(f) |
|
644 | lfile = lfutil.splitstandin(f) | |
644 | return (lfile is not None and |
|
645 | return (lfile is not None and | |
645 | (f in manifest) and |
|
646 | (f in manifest) and | |
646 | origmatchfn(lfile) or |
|
647 | origmatchfn(lfile) or | |
647 | None) |
|
648 | None) | |
648 | m.matchfn = matchfn |
|
649 | m.matchfn = matchfn | |
649 | return m |
|
650 | return m | |
650 | listpats = [] |
|
651 | listpats = [] | |
651 | for pat in pats: |
|
652 | for pat in pats: | |
652 | if matchmod.patkind(pat) is not None: |
|
653 | if matchmod.patkind(pat) is not None: | |
653 | listpats.append(pat) |
|
654 | listpats.append(pat) | |
654 | else: |
|
655 | else: | |
655 | listpats.append(makestandin(pat)) |
|
656 | listpats.append(makestandin(pat)) | |
656 |
|
657 | |||
657 | copiedfiles = [] |
|
658 | copiedfiles = [] | |
658 | def overridecopyfile(orig, src, dest, *args, **kwargs): |
|
659 | def overridecopyfile(orig, src, dest, *args, **kwargs): | |
659 | if (lfutil.shortname in src and |
|
660 | if (lfutil.shortname in src and | |
660 | dest.startswith(repo.wjoin(lfutil.shortname))): |
|
661 | dest.startswith(repo.wjoin(lfutil.shortname))): | |
661 | destlfile = dest.replace(lfutil.shortname, '') |
|
662 | destlfile = dest.replace(lfutil.shortname, '') | |
662 | if not opts['force'] and os.path.exists(destlfile): |
|
663 | if not opts['force'] and os.path.exists(destlfile): | |
663 | raise IOError('', |
|
664 | raise IOError('', | |
664 | _('destination largefile already exists')) |
|
665 | _('destination largefile already exists')) | |
665 | copiedfiles.append((src, dest)) |
|
666 | copiedfiles.append((src, dest)) | |
666 | orig(src, dest, *args, **kwargs) |
|
667 | orig(src, dest, *args, **kwargs) | |
667 | with extensions.wrappedfunction(util, 'copyfile', overridecopyfile): |
|
668 | with extensions.wrappedfunction(util, 'copyfile', overridecopyfile): | |
668 | with extensions.wrappedfunction(scmutil, 'match', overridematch): |
|
669 | with extensions.wrappedfunction(scmutil, 'match', overridematch): | |
669 | result += orig(ui, repo, listpats, opts, rename) |
|
670 | result += orig(ui, repo, listpats, opts, rename) | |
670 |
|
671 | |||
671 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
672 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
672 | for (src, dest) in copiedfiles: |
|
673 | for (src, dest) in copiedfiles: | |
673 | if (lfutil.shortname in src and |
|
674 | if (lfutil.shortname in src and | |
674 | dest.startswith(repo.wjoin(lfutil.shortname))): |
|
675 | dest.startswith(repo.wjoin(lfutil.shortname))): | |
675 | srclfile = src.replace(repo.wjoin(lfutil.standin('')), '') |
|
676 | srclfile = src.replace(repo.wjoin(lfutil.standin('')), '') | |
676 | destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '') |
|
677 | destlfile = dest.replace(repo.wjoin(lfutil.standin('')), '') | |
677 | destlfiledir = repo.wvfs.dirname(repo.wjoin(destlfile)) or '.' |
|
678 | destlfiledir = repo.wvfs.dirname(repo.wjoin(destlfile)) or '.' | |
678 | if not os.path.isdir(destlfiledir): |
|
679 | if not os.path.isdir(destlfiledir): | |
679 | os.makedirs(destlfiledir) |
|
680 | os.makedirs(destlfiledir) | |
680 | if rename: |
|
681 | if rename: | |
681 | os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile)) |
|
682 | os.rename(repo.wjoin(srclfile), repo.wjoin(destlfile)) | |
682 |
|
683 | |||
683 | # The file is gone, but this deletes any empty parent |
|
684 | # The file is gone, but this deletes any empty parent | |
684 | # directories as a side-effect. |
|
685 | # directories as a side-effect. | |
685 | repo.wvfs.unlinkpath(srclfile, ignoremissing=True) |
|
686 | repo.wvfs.unlinkpath(srclfile, ignoremissing=True) | |
686 | lfdirstate.remove(srclfile) |
|
687 | lfdirstate.remove(srclfile) | |
687 | else: |
|
688 | else: | |
688 | util.copyfile(repo.wjoin(srclfile), |
|
689 | util.copyfile(repo.wjoin(srclfile), | |
689 | repo.wjoin(destlfile)) |
|
690 | repo.wjoin(destlfile)) | |
690 |
|
691 | |||
691 | lfdirstate.add(destlfile) |
|
692 | lfdirstate.add(destlfile) | |
692 | lfdirstate.write() |
|
693 | lfdirstate.write() | |
693 | except error.Abort as e: |
|
694 | except error.Abort as e: | |
694 | if pycompat.bytestr(e) != _('no files to copy'): |
|
695 | if pycompat.bytestr(e) != _('no files to copy'): | |
695 | raise e |
|
696 | raise e | |
696 | else: |
|
697 | else: | |
697 | nolfiles = True |
|
698 | nolfiles = True | |
698 | finally: |
|
699 | finally: | |
699 | wlock.release() |
|
700 | wlock.release() | |
700 |
|
701 | |||
701 | if nolfiles and nonormalfiles: |
|
702 | if nolfiles and nonormalfiles: | |
702 | raise error.Abort(_('no files to copy')) |
|
703 | raise error.Abort(_('no files to copy')) | |
703 |
|
704 | |||
704 | return result |
|
705 | return result | |
705 |
|
706 | |||
706 | # When the user calls revert, we have to be careful to not revert any |
|
707 | # When the user calls revert, we have to be careful to not revert any | |
707 | # changes to other largefiles accidentally. This means we have to keep |
|
708 | # changes to other largefiles accidentally. This means we have to keep | |
708 | # track of the largefiles that are being reverted so we only pull down |
|
709 | # track of the largefiles that are being reverted so we only pull down | |
709 | # the necessary largefiles. |
|
710 | # the necessary largefiles. | |
710 | # |
|
711 | # | |
711 | # Standins are only updated (to match the hash of largefiles) before |
|
712 | # Standins are only updated (to match the hash of largefiles) before | |
712 | # commits. Update the standins then run the original revert, changing |
|
713 | # commits. Update the standins then run the original revert, changing | |
713 | # the matcher to hit standins instead of largefiles. Based on the |
|
714 | # the matcher to hit standins instead of largefiles. Based on the | |
714 | # resulting standins update the largefiles. |
|
715 | # resulting standins update the largefiles. | |
715 | @eh.wrapfunction(cmdutil, 'revert') |
|
716 | @eh.wrapfunction(cmdutil, 'revert') | |
716 | def overriderevert(orig, ui, repo, ctx, parents, *pats, **opts): |
|
717 | def overriderevert(orig, ui, repo, ctx, parents, *pats, **opts): | |
717 | # Because we put the standins in a bad state (by updating them) |
|
718 | # Because we put the standins in a bad state (by updating them) | |
718 | # and then return them to a correct state we need to lock to |
|
719 | # and then return them to a correct state we need to lock to | |
719 | # prevent others from changing them in their incorrect state. |
|
720 | # prevent others from changing them in their incorrect state. | |
720 | with repo.wlock(): |
|
721 | with repo.wlock(): | |
721 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
722 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
722 | s = lfutil.lfdirstatestatus(lfdirstate, repo) |
|
723 | s = lfutil.lfdirstatestatus(lfdirstate, repo) | |
723 | lfdirstate.write() |
|
724 | lfdirstate.write() | |
724 | for lfile in s.modified: |
|
725 | for lfile in s.modified: | |
725 | lfutil.updatestandin(repo, lfile, lfutil.standin(lfile)) |
|
726 | lfutil.updatestandin(repo, lfile, lfutil.standin(lfile)) | |
726 | for lfile in s.deleted: |
|
727 | for lfile in s.deleted: | |
727 | fstandin = lfutil.standin(lfile) |
|
728 | fstandin = lfutil.standin(lfile) | |
728 | if (repo.wvfs.exists(fstandin)): |
|
729 | if (repo.wvfs.exists(fstandin)): | |
729 | repo.wvfs.unlink(fstandin) |
|
730 | repo.wvfs.unlink(fstandin) | |
730 |
|
731 | |||
731 | oldstandins = lfutil.getstandinsstate(repo) |
|
732 | oldstandins = lfutil.getstandinsstate(repo) | |
732 |
|
733 | |||
733 | def overridematch(orig, mctx, pats=(), opts=None, globbed=False, |
|
734 | def overridematch(orig, mctx, pats=(), opts=None, globbed=False, | |
734 | default='relpath', badfn=None): |
|
735 | default='relpath', badfn=None): | |
735 | if opts is None: |
|
736 | if opts is None: | |
736 | opts = {} |
|
737 | opts = {} | |
737 | match = orig(mctx, pats, opts, globbed, default, badfn=badfn) |
|
738 | match = orig(mctx, pats, opts, globbed, default, badfn=badfn) | |
738 | m = copy.copy(match) |
|
739 | m = copy.copy(match) | |
739 |
|
740 | |||
740 | # revert supports recursing into subrepos, and though largefiles |
|
741 | # revert supports recursing into subrepos, and though largefiles | |
741 | # currently doesn't work correctly in that case, this match is |
|
742 | # currently doesn't work correctly in that case, this match is | |
742 | # called, so the lfdirstate above may not be the correct one for |
|
743 | # called, so the lfdirstate above may not be the correct one for | |
743 | # this invocation of match. |
|
744 | # this invocation of match. | |
744 | lfdirstate = lfutil.openlfdirstate(mctx.repo().ui, mctx.repo(), |
|
745 | lfdirstate = lfutil.openlfdirstate(mctx.repo().ui, mctx.repo(), | |
745 | False) |
|
746 | False) | |
746 |
|
747 | |||
747 | wctx = repo[None] |
|
748 | wctx = repo[None] | |
748 | matchfiles = [] |
|
749 | matchfiles = [] | |
749 | for f in m._files: |
|
750 | for f in m._files: | |
750 | standin = lfutil.standin(f) |
|
751 | standin = lfutil.standin(f) | |
751 | if standin in ctx or standin in mctx: |
|
752 | if standin in ctx or standin in mctx: | |
752 | matchfiles.append(standin) |
|
753 | matchfiles.append(standin) | |
753 | elif standin in wctx or lfdirstate[f] == 'r': |
|
754 | elif standin in wctx or lfdirstate[f] == 'r': | |
754 | continue |
|
755 | continue | |
755 | else: |
|
756 | else: | |
756 | matchfiles.append(f) |
|
757 | matchfiles.append(f) | |
757 | m._files = matchfiles |
|
758 | m._files = matchfiles | |
758 | m._fileset = set(m._files) |
|
759 | m._fileset = set(m._files) | |
759 | origmatchfn = m.matchfn |
|
760 | origmatchfn = m.matchfn | |
760 | def matchfn(f): |
|
761 | def matchfn(f): | |
761 | lfile = lfutil.splitstandin(f) |
|
762 | lfile = lfutil.splitstandin(f) | |
762 | if lfile is not None: |
|
763 | if lfile is not None: | |
763 | return (origmatchfn(lfile) and |
|
764 | return (origmatchfn(lfile) and | |
764 | (f in ctx or f in mctx)) |
|
765 | (f in ctx or f in mctx)) | |
765 | return origmatchfn(f) |
|
766 | return origmatchfn(f) | |
766 | m.matchfn = matchfn |
|
767 | m.matchfn = matchfn | |
767 | return m |
|
768 | return m | |
768 | with extensions.wrappedfunction(scmutil, 'match', overridematch): |
|
769 | with extensions.wrappedfunction(scmutil, 'match', overridematch): | |
769 | orig(ui, repo, ctx, parents, *pats, **opts) |
|
770 | orig(ui, repo, ctx, parents, *pats, **opts) | |
770 |
|
771 | |||
771 | newstandins = lfutil.getstandinsstate(repo) |
|
772 | newstandins = lfutil.getstandinsstate(repo) | |
772 | filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) |
|
773 | filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) | |
773 | # lfdirstate should be 'normallookup'-ed for updated files, |
|
774 | # lfdirstate should be 'normallookup'-ed for updated files, | |
774 | # because reverting doesn't touch dirstate for 'normal' files |
|
775 | # because reverting doesn't touch dirstate for 'normal' files | |
775 | # when target revision is explicitly specified: in such case, |
|
776 | # when target revision is explicitly specified: in such case, | |
776 | # 'n' and valid timestamp in dirstate doesn't ensure 'clean' |
|
777 | # 'n' and valid timestamp in dirstate doesn't ensure 'clean' | |
777 | # of target (standin) file. |
|
778 | # of target (standin) file. | |
778 | lfcommands.updatelfiles(ui, repo, filelist, printmessage=False, |
|
779 | lfcommands.updatelfiles(ui, repo, filelist, printmessage=False, | |
779 | normallookup=True) |
|
780 | normallookup=True) | |
780 |
|
781 | |||
781 | # after pulling changesets, we need to take some extra care to get |
|
782 | # after pulling changesets, we need to take some extra care to get | |
782 | # largefiles updated remotely |
|
783 | # largefiles updated remotely | |
783 | @eh.wrapcommand('pull', |
|
784 | @eh.wrapcommand('pull', | |
784 | opts=[('', 'all-largefiles', None, |
|
785 | opts=[('', 'all-largefiles', None, | |
785 | _('download all pulled versions of largefiles (DEPRECATED)')), |
|
786 | _('download all pulled versions of largefiles (DEPRECATED)')), | |
786 | ('', 'lfrev', [], |
|
787 | ('', 'lfrev', [], | |
787 | _('download largefiles for these revisions'), _('REV'))]) |
|
788 | _('download largefiles for these revisions'), _('REV'))]) | |
788 | def overridepull(orig, ui, repo, source=None, **opts): |
|
789 | def overridepull(orig, ui, repo, source=None, **opts): | |
789 | revsprepull = len(repo) |
|
790 | revsprepull = len(repo) | |
790 | if not source: |
|
791 | if not source: | |
791 | source = 'default' |
|
792 | source = 'default' | |
792 | repo.lfpullsource = source |
|
793 | repo.lfpullsource = source | |
793 | result = orig(ui, repo, source, **opts) |
|
794 | result = orig(ui, repo, source, **opts) | |
794 | revspostpull = len(repo) |
|
795 | revspostpull = len(repo) | |
795 | lfrevs = opts.get(r'lfrev', []) |
|
796 | lfrevs = opts.get(r'lfrev', []) | |
796 | if opts.get(r'all_largefiles'): |
|
797 | if opts.get(r'all_largefiles'): | |
797 | lfrevs.append('pulled()') |
|
798 | lfrevs.append('pulled()') | |
798 | if lfrevs and revspostpull > revsprepull: |
|
799 | if lfrevs and revspostpull > revsprepull: | |
799 | numcached = 0 |
|
800 | numcached = 0 | |
800 | repo.firstpulled = revsprepull # for pulled() revset expression |
|
801 | repo.firstpulled = revsprepull # for pulled() revset expression | |
801 | try: |
|
802 | try: | |
802 | for rev in scmutil.revrange(repo, lfrevs): |
|
803 | for rev in scmutil.revrange(repo, lfrevs): | |
803 | ui.note(_('pulling largefiles for revision %d\n') % rev) |
|
804 | ui.note(_('pulling largefiles for revision %d\n') % rev) | |
804 | (cached, missing) = lfcommands.cachelfiles(ui, repo, rev) |
|
805 | (cached, missing) = lfcommands.cachelfiles(ui, repo, rev) | |
805 | numcached += len(cached) |
|
806 | numcached += len(cached) | |
806 | finally: |
|
807 | finally: | |
807 | del repo.firstpulled |
|
808 | del repo.firstpulled | |
808 | ui.status(_("%d largefiles cached\n") % numcached) |
|
809 | ui.status(_("%d largefiles cached\n") % numcached) | |
809 | return result |
|
810 | return result | |
810 |
|
811 | |||
811 | @eh.wrapcommand('push', |
|
812 | @eh.wrapcommand('push', | |
812 | opts=[('', 'lfrev', [], |
|
813 | opts=[('', 'lfrev', [], | |
813 | _('upload largefiles for these revisions'), _('REV'))]) |
|
814 | _('upload largefiles for these revisions'), _('REV'))]) | |
814 | def overridepush(orig, ui, repo, *args, **kwargs): |
|
815 | def overridepush(orig, ui, repo, *args, **kwargs): | |
815 | """Override push command and store --lfrev parameters in opargs""" |
|
816 | """Override push command and store --lfrev parameters in opargs""" | |
816 | lfrevs = kwargs.pop(r'lfrev', None) |
|
817 | lfrevs = kwargs.pop(r'lfrev', None) | |
817 | if lfrevs: |
|
818 | if lfrevs: | |
818 | opargs = kwargs.setdefault(r'opargs', {}) |
|
819 | opargs = kwargs.setdefault(r'opargs', {}) | |
819 | opargs['lfrevs'] = scmutil.revrange(repo, lfrevs) |
|
820 | opargs['lfrevs'] = scmutil.revrange(repo, lfrevs) | |
820 | return orig(ui, repo, *args, **kwargs) |
|
821 | return orig(ui, repo, *args, **kwargs) | |
821 |
|
822 | |||
822 | @eh.wrapfunction(exchange, 'pushoperation') |
|
823 | @eh.wrapfunction(exchange, 'pushoperation') | |
823 | def exchangepushoperation(orig, *args, **kwargs): |
|
824 | def exchangepushoperation(orig, *args, **kwargs): | |
824 | """Override pushoperation constructor and store lfrevs parameter""" |
|
825 | """Override pushoperation constructor and store lfrevs parameter""" | |
825 | lfrevs = kwargs.pop(r'lfrevs', None) |
|
826 | lfrevs = kwargs.pop(r'lfrevs', None) | |
826 | pushop = orig(*args, **kwargs) |
|
827 | pushop = orig(*args, **kwargs) | |
827 | pushop.lfrevs = lfrevs |
|
828 | pushop.lfrevs = lfrevs | |
828 | return pushop |
|
829 | return pushop | |
829 |
|
830 | |||
830 | @eh.revsetpredicate('pulled()') |
|
831 | @eh.revsetpredicate('pulled()') | |
831 | def pulledrevsetsymbol(repo, subset, x): |
|
832 | def pulledrevsetsymbol(repo, subset, x): | |
832 | """Changesets that just has been pulled. |
|
833 | """Changesets that just has been pulled. | |
833 |
|
834 | |||
834 | Only available with largefiles from pull --lfrev expressions. |
|
835 | Only available with largefiles from pull --lfrev expressions. | |
835 |
|
836 | |||
836 | .. container:: verbose |
|
837 | .. container:: verbose | |
837 |
|
838 | |||
838 | Some examples: |
|
839 | Some examples: | |
839 |
|
840 | |||
840 | - pull largefiles for all new changesets:: |
|
841 | - pull largefiles for all new changesets:: | |
841 |
|
842 | |||
842 | hg pull -lfrev "pulled()" |
|
843 | hg pull -lfrev "pulled()" | |
843 |
|
844 | |||
844 | - pull largefiles for all new branch heads:: |
|
845 | - pull largefiles for all new branch heads:: | |
845 |
|
846 | |||
846 | hg pull -lfrev "head(pulled()) and not closed()" |
|
847 | hg pull -lfrev "head(pulled()) and not closed()" | |
847 |
|
848 | |||
848 | """ |
|
849 | """ | |
849 |
|
850 | |||
850 | try: |
|
851 | try: | |
851 | firstpulled = repo.firstpulled |
|
852 | firstpulled = repo.firstpulled | |
852 | except AttributeError: |
|
853 | except AttributeError: | |
853 | raise error.Abort(_("pulled() only available in --lfrev")) |
|
854 | raise error.Abort(_("pulled() only available in --lfrev")) | |
854 | return smartset.baseset([r for r in subset if r >= firstpulled]) |
|
855 | return smartset.baseset([r for r in subset if r >= firstpulled]) | |
855 |
|
856 | |||
856 | @eh.wrapcommand('clone', |
|
857 | @eh.wrapcommand('clone', | |
857 | opts=[('', 'all-largefiles', None, |
|
858 | opts=[('', 'all-largefiles', None, | |
858 | _('download all versions of all largefiles'))]) |
|
859 | _('download all versions of all largefiles'))]) | |
859 | def overrideclone(orig, ui, source, dest=None, **opts): |
|
860 | def overrideclone(orig, ui, source, dest=None, **opts): | |
860 | d = dest |
|
861 | d = dest | |
861 | if d is None: |
|
862 | if d is None: | |
862 | d = hg.defaultdest(source) |
|
863 | d = hg.defaultdest(source) | |
863 | if opts.get(r'all_largefiles') and not hg.islocal(d): |
|
864 | if opts.get(r'all_largefiles') and not hg.islocal(d): | |
864 | raise error.Abort(_( |
|
865 | raise error.Abort(_( | |
865 | '--all-largefiles is incompatible with non-local destination %s') % |
|
866 | '--all-largefiles is incompatible with non-local destination %s') % | |
866 | d) |
|
867 | d) | |
867 |
|
868 | |||
868 | return orig(ui, source, dest, **opts) |
|
869 | return orig(ui, source, dest, **opts) | |
869 |
|
870 | |||
870 | @eh.wrapfunction(hg, 'clone') |
|
871 | @eh.wrapfunction(hg, 'clone') | |
871 | def hgclone(orig, ui, opts, *args, **kwargs): |
|
872 | def hgclone(orig, ui, opts, *args, **kwargs): | |
872 | result = orig(ui, opts, *args, **kwargs) |
|
873 | result = orig(ui, opts, *args, **kwargs) | |
873 |
|
874 | |||
874 | if result is not None: |
|
875 | if result is not None: | |
875 | sourcerepo, destrepo = result |
|
876 | sourcerepo, destrepo = result | |
876 | repo = destrepo.local() |
|
877 | repo = destrepo.local() | |
877 |
|
878 | |||
878 | # When cloning to a remote repo (like through SSH), no repo is available |
|
879 | # When cloning to a remote repo (like through SSH), no repo is available | |
879 | # from the peer. Therefore the largefiles can't be downloaded and the |
|
880 | # from the peer. Therefore the largefiles can't be downloaded and the | |
880 | # hgrc can't be updated. |
|
881 | # hgrc can't be updated. | |
881 | if not repo: |
|
882 | if not repo: | |
882 | return result |
|
883 | return result | |
883 |
|
884 | |||
884 | # Caching is implicitly limited to 'rev' option, since the dest repo was |
|
885 | # Caching is implicitly limited to 'rev' option, since the dest repo was | |
885 | # truncated at that point. The user may expect a download count with |
|
886 | # truncated at that point. The user may expect a download count with | |
886 | # this option, so attempt whether or not this is a largefile repo. |
|
887 | # this option, so attempt whether or not this is a largefile repo. | |
887 | if opts.get('all_largefiles'): |
|
888 | if opts.get('all_largefiles'): | |
888 | success, missing = lfcommands.downloadlfiles(ui, repo, None) |
|
889 | success, missing = lfcommands.downloadlfiles(ui, repo, None) | |
889 |
|
890 | |||
890 | if missing != 0: |
|
891 | if missing != 0: | |
891 | return None |
|
892 | return None | |
892 |
|
893 | |||
893 | return result |
|
894 | return result | |
894 |
|
895 | |||
895 | @eh.wrapcommand('rebase', extension='rebase') |
|
896 | @eh.wrapcommand('rebase', extension='rebase') | |
896 | def overriderebase(orig, ui, repo, **opts): |
|
897 | def overriderebase(orig, ui, repo, **opts): | |
897 | if not util.safehasattr(repo, '_largefilesenabled'): |
|
898 | if not util.safehasattr(repo, '_largefilesenabled'): | |
898 | return orig(ui, repo, **opts) |
|
899 | return orig(ui, repo, **opts) | |
899 |
|
900 | |||
900 | resuming = opts.get(r'continue') |
|
901 | resuming = opts.get(r'continue') | |
901 | repo._lfcommithooks.append(lfutil.automatedcommithook(resuming)) |
|
902 | repo._lfcommithooks.append(lfutil.automatedcommithook(resuming)) | |
902 | repo._lfstatuswriters.append(lambda *msg, **opts: None) |
|
903 | repo._lfstatuswriters.append(lambda *msg, **opts: None) | |
903 | try: |
|
904 | try: | |
904 | return orig(ui, repo, **opts) |
|
905 | return orig(ui, repo, **opts) | |
905 | finally: |
|
906 | finally: | |
906 | repo._lfstatuswriters.pop() |
|
907 | repo._lfstatuswriters.pop() | |
907 | repo._lfcommithooks.pop() |
|
908 | repo._lfcommithooks.pop() | |
908 |
|
909 | |||
909 | @eh.wrapcommand('archive') |
|
910 | @eh.wrapcommand('archive') | |
910 | def overridearchivecmd(orig, ui, repo, dest, **opts): |
|
911 | def overridearchivecmd(orig, ui, repo, dest, **opts): | |
911 | repo.unfiltered().lfstatus = True |
|
912 | repo.unfiltered().lfstatus = True | |
912 |
|
913 | |||
913 | try: |
|
914 | try: | |
914 | return orig(ui, repo.unfiltered(), dest, **opts) |
|
915 | return orig(ui, repo.unfiltered(), dest, **opts) | |
915 | finally: |
|
916 | finally: | |
916 | repo.unfiltered().lfstatus = False |
|
917 | repo.unfiltered().lfstatus = False | |
917 |
|
918 | |||
918 | @eh.wrapfunction(webcommands, 'archive') |
|
919 | @eh.wrapfunction(webcommands, 'archive') | |
919 | def hgwebarchive(orig, web): |
|
920 | def hgwebarchive(orig, web): | |
920 | web.repo.lfstatus = True |
|
921 | web.repo.lfstatus = True | |
921 |
|
922 | |||
922 | try: |
|
923 | try: | |
923 | return orig(web) |
|
924 | return orig(web) | |
924 | finally: |
|
925 | finally: | |
925 | web.repo.lfstatus = False |
|
926 | web.repo.lfstatus = False | |
926 |
|
927 | |||
927 | @eh.wrapfunction(archival, 'archive') |
|
928 | @eh.wrapfunction(archival, 'archive') | |
928 | def overridearchive(orig, repo, dest, node, kind, decode=True, match=None, |
|
929 | def overridearchive(orig, repo, dest, node, kind, decode=True, match=None, | |
929 | prefix='', mtime=None, subrepos=None): |
|
930 | prefix='', mtime=None, subrepos=None): | |
930 | # For some reason setting repo.lfstatus in hgwebarchive only changes the |
|
931 | # For some reason setting repo.lfstatus in hgwebarchive only changes the | |
931 | # unfiltered repo's attr, so check that as well. |
|
932 | # unfiltered repo's attr, so check that as well. | |
932 | if not repo.lfstatus and not repo.unfiltered().lfstatus: |
|
933 | if not repo.lfstatus and not repo.unfiltered().lfstatus: | |
933 | return orig(repo, dest, node, kind, decode, match, prefix, mtime, |
|
934 | return orig(repo, dest, node, kind, decode, match, prefix, mtime, | |
934 | subrepos) |
|
935 | subrepos) | |
935 |
|
936 | |||
936 | # No need to lock because we are only reading history and |
|
937 | # No need to lock because we are only reading history and | |
937 | # largefile caches, neither of which are modified. |
|
938 | # largefile caches, neither of which are modified. | |
938 | if node is not None: |
|
939 | if node is not None: | |
939 | lfcommands.cachelfiles(repo.ui, repo, node) |
|
940 | lfcommands.cachelfiles(repo.ui, repo, node) | |
940 |
|
941 | |||
941 | if kind not in archival.archivers: |
|
942 | if kind not in archival.archivers: | |
942 | raise error.Abort(_("unknown archive type '%s'") % kind) |
|
943 | raise error.Abort(_("unknown archive type '%s'") % kind) | |
943 |
|
944 | |||
944 | ctx = repo[node] |
|
945 | ctx = repo[node] | |
945 |
|
946 | |||
946 | if kind == 'files': |
|
947 | if kind == 'files': | |
947 | if prefix: |
|
948 | if prefix: | |
948 | raise error.Abort( |
|
949 | raise error.Abort( | |
949 | _('cannot give prefix when archiving to files')) |
|
950 | _('cannot give prefix when archiving to files')) | |
950 | else: |
|
951 | else: | |
951 | prefix = archival.tidyprefix(dest, kind, prefix) |
|
952 | prefix = archival.tidyprefix(dest, kind, prefix) | |
952 |
|
953 | |||
953 | def write(name, mode, islink, getdata): |
|
954 | def write(name, mode, islink, getdata): | |
954 | if match and not match(name): |
|
955 | if match and not match(name): | |
955 | return |
|
956 | return | |
956 | data = getdata() |
|
957 | data = getdata() | |
957 | if decode: |
|
958 | if decode: | |
958 | data = repo.wwritedata(name, data) |
|
959 | data = repo.wwritedata(name, data) | |
959 | archiver.addfile(prefix + name, mode, islink, data) |
|
960 | archiver.addfile(prefix + name, mode, islink, data) | |
960 |
|
961 | |||
961 | archiver = archival.archivers[kind](dest, mtime or ctx.date()[0]) |
|
962 | archiver = archival.archivers[kind](dest, mtime or ctx.date()[0]) | |
962 |
|
963 | |||
963 | if repo.ui.configbool("ui", "archivemeta"): |
|
964 | if repo.ui.configbool("ui", "archivemeta"): | |
964 | write('.hg_archival.txt', 0o644, False, |
|
965 | write('.hg_archival.txt', 0o644, False, | |
965 | lambda: archival.buildmetadata(ctx)) |
|
966 | lambda: archival.buildmetadata(ctx)) | |
966 |
|
967 | |||
967 | for f in ctx: |
|
968 | for f in ctx: | |
968 | ff = ctx.flags(f) |
|
969 | ff = ctx.flags(f) | |
969 | getdata = ctx[f].data |
|
970 | getdata = ctx[f].data | |
970 | lfile = lfutil.splitstandin(f) |
|
971 | lfile = lfutil.splitstandin(f) | |
971 | if lfile is not None: |
|
972 | if lfile is not None: | |
972 | if node is not None: |
|
973 | if node is not None: | |
973 | path = lfutil.findfile(repo, getdata().strip()) |
|
974 | path = lfutil.findfile(repo, getdata().strip()) | |
974 |
|
975 | |||
975 | if path is None: |
|
976 | if path is None: | |
976 | raise error.Abort( |
|
977 | raise error.Abort( | |
977 | _('largefile %s not found in repo store or system cache') |
|
978 | _('largefile %s not found in repo store or system cache') | |
978 | % lfile) |
|
979 | % lfile) | |
979 | else: |
|
980 | else: | |
980 | path = lfile |
|
981 | path = lfile | |
981 |
|
982 | |||
982 | f = lfile |
|
983 | f = lfile | |
983 |
|
984 | |||
984 | getdata = lambda: util.readfile(path) |
|
985 | getdata = lambda: util.readfile(path) | |
985 | write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, getdata) |
|
986 | write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, getdata) | |
986 |
|
987 | |||
987 | if subrepos: |
|
988 | if subrepos: | |
988 | for subpath in sorted(ctx.substate): |
|
989 | for subpath in sorted(ctx.substate): | |
989 | sub = ctx.workingsub(subpath) |
|
990 | sub = ctx.workingsub(subpath) | |
990 | submatch = matchmod.subdirmatcher(subpath, match) |
|
991 | submatch = matchmod.subdirmatcher(subpath, match) | |
991 | subprefix = prefix + subpath + '/' |
|
992 | subprefix = prefix + subpath + '/' | |
992 | sub._repo.lfstatus = True |
|
993 | sub._repo.lfstatus = True | |
993 | sub.archive(archiver, subprefix, submatch) |
|
994 | sub.archive(archiver, subprefix, submatch) | |
994 |
|
995 | |||
995 | archiver.done() |
|
996 | archiver.done() | |
996 |
|
997 | |||
997 | @eh.wrapfunction(subrepo.hgsubrepo, 'archive') |
|
998 | @eh.wrapfunction(subrepo.hgsubrepo, 'archive') | |
998 | def hgsubrepoarchive(orig, repo, archiver, prefix, match=None, decode=True): |
|
999 | def hgsubrepoarchive(orig, repo, archiver, prefix, match=None, decode=True): | |
999 | lfenabled = util.safehasattr(repo._repo, '_largefilesenabled') |
|
1000 | lfenabled = util.safehasattr(repo._repo, '_largefilesenabled') | |
1000 | if not lfenabled or not repo._repo.lfstatus: |
|
1001 | if not lfenabled or not repo._repo.lfstatus: | |
1001 | return orig(repo, archiver, prefix, match, decode) |
|
1002 | return orig(repo, archiver, prefix, match, decode) | |
1002 |
|
1003 | |||
1003 | repo._get(repo._state + ('hg',)) |
|
1004 | repo._get(repo._state + ('hg',)) | |
1004 | rev = repo._state[1] |
|
1005 | rev = repo._state[1] | |
1005 | ctx = repo._repo[rev] |
|
1006 | ctx = repo._repo[rev] | |
1006 |
|
1007 | |||
1007 | if ctx.node() is not None: |
|
1008 | if ctx.node() is not None: | |
1008 | lfcommands.cachelfiles(repo.ui, repo._repo, ctx.node()) |
|
1009 | lfcommands.cachelfiles(repo.ui, repo._repo, ctx.node()) | |
1009 |
|
1010 | |||
1010 | def write(name, mode, islink, getdata): |
|
1011 | def write(name, mode, islink, getdata): | |
1011 | # At this point, the standin has been replaced with the largefile name, |
|
1012 | # At this point, the standin has been replaced with the largefile name, | |
1012 | # so the normal matcher works here without the lfutil variants. |
|
1013 | # so the normal matcher works here without the lfutil variants. | |
1013 | if match and not match(f): |
|
1014 | if match and not match(f): | |
1014 | return |
|
1015 | return | |
1015 | data = getdata() |
|
1016 | data = getdata() | |
1016 | if decode: |
|
1017 | if decode: | |
1017 | data = repo._repo.wwritedata(name, data) |
|
1018 | data = repo._repo.wwritedata(name, data) | |
1018 |
|
1019 | |||
1019 | archiver.addfile(prefix + name, mode, islink, data) |
|
1020 | archiver.addfile(prefix + name, mode, islink, data) | |
1020 |
|
1021 | |||
1021 | for f in ctx: |
|
1022 | for f in ctx: | |
1022 | ff = ctx.flags(f) |
|
1023 | ff = ctx.flags(f) | |
1023 | getdata = ctx[f].data |
|
1024 | getdata = ctx[f].data | |
1024 | lfile = lfutil.splitstandin(f) |
|
1025 | lfile = lfutil.splitstandin(f) | |
1025 | if lfile is not None: |
|
1026 | if lfile is not None: | |
1026 | if ctx.node() is not None: |
|
1027 | if ctx.node() is not None: | |
1027 | path = lfutil.findfile(repo._repo, getdata().strip()) |
|
1028 | path = lfutil.findfile(repo._repo, getdata().strip()) | |
1028 |
|
1029 | |||
1029 | if path is None: |
|
1030 | if path is None: | |
1030 | raise error.Abort( |
|
1031 | raise error.Abort( | |
1031 | _('largefile %s not found in repo store or system cache') |
|
1032 | _('largefile %s not found in repo store or system cache') | |
1032 | % lfile) |
|
1033 | % lfile) | |
1033 | else: |
|
1034 | else: | |
1034 | path = lfile |
|
1035 | path = lfile | |
1035 |
|
1036 | |||
1036 | f = lfile |
|
1037 | f = lfile | |
1037 |
|
1038 | |||
1038 | getdata = lambda: util.readfile(os.path.join(prefix, path)) |
|
1039 | getdata = lambda: util.readfile(os.path.join(prefix, path)) | |
1039 |
|
1040 | |||
1040 | write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, getdata) |
|
1041 | write(f, 'x' in ff and 0o755 or 0o644, 'l' in ff, getdata) | |
1041 |
|
1042 | |||
1042 | for subpath in sorted(ctx.substate): |
|
1043 | for subpath in sorted(ctx.substate): | |
1043 | sub = ctx.workingsub(subpath) |
|
1044 | sub = ctx.workingsub(subpath) | |
1044 | submatch = matchmod.subdirmatcher(subpath, match) |
|
1045 | submatch = matchmod.subdirmatcher(subpath, match) | |
1045 | subprefix = prefix + subpath + '/' |
|
1046 | subprefix = prefix + subpath + '/' | |
1046 | sub._repo.lfstatus = True |
|
1047 | sub._repo.lfstatus = True | |
1047 | sub.archive(archiver, subprefix, submatch, decode) |
|
1048 | sub.archive(archiver, subprefix, submatch, decode) | |
1048 |
|
1049 | |||
1049 | # If a largefile is modified, the change is not reflected in its |
|
1050 | # If a largefile is modified, the change is not reflected in its | |
1050 | # standin until a commit. cmdutil.bailifchanged() raises an exception |
|
1051 | # standin until a commit. cmdutil.bailifchanged() raises an exception | |
1051 | # if the repo has uncommitted changes. Wrap it to also check if |
|
1052 | # if the repo has uncommitted changes. Wrap it to also check if | |
1052 | # largefiles were changed. This is used by bisect, backout and fetch. |
|
1053 | # largefiles were changed. This is used by bisect, backout and fetch. | |
1053 | @eh.wrapfunction(cmdutil, 'bailifchanged') |
|
1054 | @eh.wrapfunction(cmdutil, 'bailifchanged') | |
1054 | def overridebailifchanged(orig, repo, *args, **kwargs): |
|
1055 | def overridebailifchanged(orig, repo, *args, **kwargs): | |
1055 | orig(repo, *args, **kwargs) |
|
1056 | orig(repo, *args, **kwargs) | |
1056 | repo.lfstatus = True |
|
1057 | repo.lfstatus = True | |
1057 | s = repo.status() |
|
1058 | s = repo.status() | |
1058 | repo.lfstatus = False |
|
1059 | repo.lfstatus = False | |
1059 | if s.modified or s.added or s.removed or s.deleted: |
|
1060 | if s.modified or s.added or s.removed or s.deleted: | |
1060 | raise error.Abort(_('uncommitted changes')) |
|
1061 | raise error.Abort(_('uncommitted changes')) | |
1061 |
|
1062 | |||
1062 | @eh.wrapfunction(cmdutil, 'postcommitstatus') |
|
1063 | @eh.wrapfunction(cmdutil, 'postcommitstatus') | |
1063 | def postcommitstatus(orig, repo, *args, **kwargs): |
|
1064 | def postcommitstatus(orig, repo, *args, **kwargs): | |
1064 | repo.lfstatus = True |
|
1065 | repo.lfstatus = True | |
1065 | try: |
|
1066 | try: | |
1066 | return orig(repo, *args, **kwargs) |
|
1067 | return orig(repo, *args, **kwargs) | |
1067 | finally: |
|
1068 | finally: | |
1068 | repo.lfstatus = False |
|
1069 | repo.lfstatus = False | |
1069 |
|
1070 | |||
1070 | @eh.wrapfunction(cmdutil, 'forget') |
|
1071 | @eh.wrapfunction(cmdutil, 'forget') | |
1071 | def cmdutilforget(orig, ui, repo, match, prefix, uipathfn, explicitonly, dryrun, |
|
1072 | def cmdutilforget(orig, ui, repo, match, prefix, uipathfn, explicitonly, dryrun, | |
1072 | interactive): |
|
1073 | interactive): | |
1073 | normalmatcher = composenormalfilematcher(match, repo[None].manifest()) |
|
1074 | normalmatcher = composenormalfilematcher(match, repo[None].manifest()) | |
1074 | bad, forgot = orig(ui, repo, normalmatcher, prefix, uipathfn, explicitonly, |
|
1075 | bad, forgot = orig(ui, repo, normalmatcher, prefix, uipathfn, explicitonly, | |
1075 | dryrun, interactive) |
|
1076 | dryrun, interactive) | |
1076 | m = composelargefilematcher(match, repo[None].manifest()) |
|
1077 | m = composelargefilematcher(match, repo[None].manifest()) | |
1077 |
|
1078 | |||
1078 | try: |
|
1079 | try: | |
1079 | repo.lfstatus = True |
|
1080 | repo.lfstatus = True | |
1080 | s = repo.status(match=m, clean=True) |
|
1081 | s = repo.status(match=m, clean=True) | |
1081 | finally: |
|
1082 | finally: | |
1082 | repo.lfstatus = False |
|
1083 | repo.lfstatus = False | |
1083 | manifest = repo[None].manifest() |
|
1084 | manifest = repo[None].manifest() | |
1084 | forget = sorted(s.modified + s.added + s.deleted + s.clean) |
|
1085 | forget = sorted(s.modified + s.added + s.deleted + s.clean) | |
1085 | forget = [f for f in forget if lfutil.standin(f) in manifest] |
|
1086 | forget = [f for f in forget if lfutil.standin(f) in manifest] | |
1086 |
|
1087 | |||
1087 | for f in forget: |
|
1088 | for f in forget: | |
1088 | fstandin = lfutil.standin(f) |
|
1089 | fstandin = lfutil.standin(f) | |
1089 | if fstandin not in repo.dirstate and not repo.wvfs.isdir(fstandin): |
|
1090 | if fstandin not in repo.dirstate and not repo.wvfs.isdir(fstandin): | |
1090 | ui.warn(_('not removing %s: file is already untracked\n') |
|
1091 | ui.warn(_('not removing %s: file is already untracked\n') | |
1091 | % uipathfn(f)) |
|
1092 | % uipathfn(f)) | |
1092 | bad.append(f) |
|
1093 | bad.append(f) | |
1093 |
|
1094 | |||
1094 | for f in forget: |
|
1095 | for f in forget: | |
1095 | if ui.verbose or not m.exact(f): |
|
1096 | if ui.verbose or not m.exact(f): | |
1096 | ui.status(_('removing %s\n') % uipathfn(f)) |
|
1097 | ui.status(_('removing %s\n') % uipathfn(f)) | |
1097 |
|
1098 | |||
1098 | # Need to lock because standin files are deleted then removed from the |
|
1099 | # Need to lock because standin files are deleted then removed from the | |
1099 | # repository and we could race in-between. |
|
1100 | # repository and we could race in-between. | |
1100 | with repo.wlock(): |
|
1101 | with repo.wlock(): | |
1101 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
1102 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
1102 | for f in forget: |
|
1103 | for f in forget: | |
1103 | if lfdirstate[f] == 'a': |
|
1104 | if lfdirstate[f] == 'a': | |
1104 | lfdirstate.drop(f) |
|
1105 | lfdirstate.drop(f) | |
1105 | else: |
|
1106 | else: | |
1106 | lfdirstate.remove(f) |
|
1107 | lfdirstate.remove(f) | |
1107 | lfdirstate.write() |
|
1108 | lfdirstate.write() | |
1108 | standins = [lfutil.standin(f) for f in forget] |
|
1109 | standins = [lfutil.standin(f) for f in forget] | |
1109 | for f in standins: |
|
1110 | for f in standins: | |
1110 | repo.wvfs.unlinkpath(f, ignoremissing=True) |
|
1111 | repo.wvfs.unlinkpath(f, ignoremissing=True) | |
1111 | rejected = repo[None].forget(standins) |
|
1112 | rejected = repo[None].forget(standins) | |
1112 |
|
1113 | |||
1113 | bad.extend(f for f in rejected if f in m.files()) |
|
1114 | bad.extend(f for f in rejected if f in m.files()) | |
1114 | forgot.extend(f for f in forget if f not in rejected) |
|
1115 | forgot.extend(f for f in forget if f not in rejected) | |
1115 | return bad, forgot |
|
1116 | return bad, forgot | |
1116 |
|
1117 | |||
1117 | def _getoutgoings(repo, other, missing, addfunc): |
|
1118 | def _getoutgoings(repo, other, missing, addfunc): | |
1118 | """get pairs of filename and largefile hash in outgoing revisions |
|
1119 | """get pairs of filename and largefile hash in outgoing revisions | |
1119 | in 'missing'. |
|
1120 | in 'missing'. | |
1120 |
|
1121 | |||
1121 | largefiles already existing on 'other' repository are ignored. |
|
1122 | largefiles already existing on 'other' repository are ignored. | |
1122 |
|
1123 | |||
1123 | 'addfunc' is invoked with each unique pairs of filename and |
|
1124 | 'addfunc' is invoked with each unique pairs of filename and | |
1124 | largefile hash value. |
|
1125 | largefile hash value. | |
1125 | """ |
|
1126 | """ | |
1126 | knowns = set() |
|
1127 | knowns = set() | |
1127 | lfhashes = set() |
|
1128 | lfhashes = set() | |
1128 | def dedup(fn, lfhash): |
|
1129 | def dedup(fn, lfhash): | |
1129 | k = (fn, lfhash) |
|
1130 | k = (fn, lfhash) | |
1130 | if k not in knowns: |
|
1131 | if k not in knowns: | |
1131 | knowns.add(k) |
|
1132 | knowns.add(k) | |
1132 | lfhashes.add(lfhash) |
|
1133 | lfhashes.add(lfhash) | |
1133 | lfutil.getlfilestoupload(repo, missing, dedup) |
|
1134 | lfutil.getlfilestoupload(repo, missing, dedup) | |
1134 | if lfhashes: |
|
1135 | if lfhashes: | |
1135 | lfexists = storefactory.openstore(repo, other).exists(lfhashes) |
|
1136 | lfexists = storefactory.openstore(repo, other).exists(lfhashes) | |
1136 | for fn, lfhash in knowns: |
|
1137 | for fn, lfhash in knowns: | |
1137 | if not lfexists[lfhash]: # lfhash doesn't exist on "other" |
|
1138 | if not lfexists[lfhash]: # lfhash doesn't exist on "other" | |
1138 | addfunc(fn, lfhash) |
|
1139 | addfunc(fn, lfhash) | |
1139 |
|
1140 | |||
1140 | def outgoinghook(ui, repo, other, opts, missing): |
|
1141 | def outgoinghook(ui, repo, other, opts, missing): | |
1141 | if opts.pop('large', None): |
|
1142 | if opts.pop('large', None): | |
1142 | lfhashes = set() |
|
1143 | lfhashes = set() | |
1143 | if ui.debugflag: |
|
1144 | if ui.debugflag: | |
1144 | toupload = {} |
|
1145 | toupload = {} | |
1145 | def addfunc(fn, lfhash): |
|
1146 | def addfunc(fn, lfhash): | |
1146 | if fn not in toupload: |
|
1147 | if fn not in toupload: | |
1147 | toupload[fn] = [] |
|
1148 | toupload[fn] = [] | |
1148 | toupload[fn].append(lfhash) |
|
1149 | toupload[fn].append(lfhash) | |
1149 | lfhashes.add(lfhash) |
|
1150 | lfhashes.add(lfhash) | |
1150 | def showhashes(fn): |
|
1151 | def showhashes(fn): | |
1151 | for lfhash in sorted(toupload[fn]): |
|
1152 | for lfhash in sorted(toupload[fn]): | |
1152 | ui.debug(' %s\n' % (lfhash)) |
|
1153 | ui.debug(' %s\n' % (lfhash)) | |
1153 | else: |
|
1154 | else: | |
1154 | toupload = set() |
|
1155 | toupload = set() | |
1155 | def addfunc(fn, lfhash): |
|
1156 | def addfunc(fn, lfhash): | |
1156 | toupload.add(fn) |
|
1157 | toupload.add(fn) | |
1157 | lfhashes.add(lfhash) |
|
1158 | lfhashes.add(lfhash) | |
1158 | def showhashes(fn): |
|
1159 | def showhashes(fn): | |
1159 | pass |
|
1160 | pass | |
1160 | _getoutgoings(repo, other, missing, addfunc) |
|
1161 | _getoutgoings(repo, other, missing, addfunc) | |
1161 |
|
1162 | |||
1162 | if not toupload: |
|
1163 | if not toupload: | |
1163 | ui.status(_('largefiles: no files to upload\n')) |
|
1164 | ui.status(_('largefiles: no files to upload\n')) | |
1164 | else: |
|
1165 | else: | |
1165 | ui.status(_('largefiles to upload (%d entities):\n') |
|
1166 | ui.status(_('largefiles to upload (%d entities):\n') | |
1166 | % (len(lfhashes))) |
|
1167 | % (len(lfhashes))) | |
1167 | for file in sorted(toupload): |
|
1168 | for file in sorted(toupload): | |
1168 | ui.status(lfutil.splitstandin(file) + '\n') |
|
1169 | ui.status(lfutil.splitstandin(file) + '\n') | |
1169 | showhashes(file) |
|
1170 | showhashes(file) | |
1170 | ui.status('\n') |
|
1171 | ui.status('\n') | |
1171 |
|
1172 | |||
1172 | @eh.wrapcommand('outgoing', |
|
1173 | @eh.wrapcommand('outgoing', | |
1173 | opts=[('', 'large', None, _('display outgoing largefiles'))]) |
|
1174 | opts=[('', 'large', None, _('display outgoing largefiles'))]) | |
1174 | def _outgoingcmd(orig, *args, **kwargs): |
|
1175 | def _outgoingcmd(orig, *args, **kwargs): | |
1175 | # Nothing to do here other than add the extra help option- the hook above |
|
1176 | # Nothing to do here other than add the extra help option- the hook above | |
1176 | # processes it. |
|
1177 | # processes it. | |
1177 | return orig(*args, **kwargs) |
|
1178 | return orig(*args, **kwargs) | |
1178 |
|
1179 | |||
1179 | def summaryremotehook(ui, repo, opts, changes): |
|
1180 | def summaryremotehook(ui, repo, opts, changes): | |
1180 | largeopt = opts.get('large', False) |
|
1181 | largeopt = opts.get('large', False) | |
1181 | if changes is None: |
|
1182 | if changes is None: | |
1182 | if largeopt: |
|
1183 | if largeopt: | |
1183 | return (False, True) # only outgoing check is needed |
|
1184 | return (False, True) # only outgoing check is needed | |
1184 | else: |
|
1185 | else: | |
1185 | return (False, False) |
|
1186 | return (False, False) | |
1186 | elif largeopt: |
|
1187 | elif largeopt: | |
1187 | url, branch, peer, outgoing = changes[1] |
|
1188 | url, branch, peer, outgoing = changes[1] | |
1188 | if peer is None: |
|
1189 | if peer is None: | |
1189 | # i18n: column positioning for "hg summary" |
|
1190 | # i18n: column positioning for "hg summary" | |
1190 | ui.status(_('largefiles: (no remote repo)\n')) |
|
1191 | ui.status(_('largefiles: (no remote repo)\n')) | |
1191 | return |
|
1192 | return | |
1192 |
|
1193 | |||
1193 | toupload = set() |
|
1194 | toupload = set() | |
1194 | lfhashes = set() |
|
1195 | lfhashes = set() | |
1195 | def addfunc(fn, lfhash): |
|
1196 | def addfunc(fn, lfhash): | |
1196 | toupload.add(fn) |
|
1197 | toupload.add(fn) | |
1197 | lfhashes.add(lfhash) |
|
1198 | lfhashes.add(lfhash) | |
1198 | _getoutgoings(repo, peer, outgoing.missing, addfunc) |
|
1199 | _getoutgoings(repo, peer, outgoing.missing, addfunc) | |
1199 |
|
1200 | |||
1200 | if not toupload: |
|
1201 | if not toupload: | |
1201 | # i18n: column positioning for "hg summary" |
|
1202 | # i18n: column positioning for "hg summary" | |
1202 | ui.status(_('largefiles: (no files to upload)\n')) |
|
1203 | ui.status(_('largefiles: (no files to upload)\n')) | |
1203 | else: |
|
1204 | else: | |
1204 | # i18n: column positioning for "hg summary" |
|
1205 | # i18n: column positioning for "hg summary" | |
1205 | ui.status(_('largefiles: %d entities for %d files to upload\n') |
|
1206 | ui.status(_('largefiles: %d entities for %d files to upload\n') | |
1206 | % (len(lfhashes), len(toupload))) |
|
1207 | % (len(lfhashes), len(toupload))) | |
1207 |
|
1208 | |||
1208 | @eh.wrapcommand('summary', |
|
1209 | @eh.wrapcommand('summary', | |
1209 | opts=[('', 'large', None, _('display outgoing largefiles'))]) |
|
1210 | opts=[('', 'large', None, _('display outgoing largefiles'))]) | |
1210 | def overridesummary(orig, ui, repo, *pats, **opts): |
|
1211 | def overridesummary(orig, ui, repo, *pats, **opts): | |
1211 | try: |
|
1212 | try: | |
1212 | repo.lfstatus = True |
|
1213 | repo.lfstatus = True | |
1213 | orig(ui, repo, *pats, **opts) |
|
1214 | orig(ui, repo, *pats, **opts) | |
1214 | finally: |
|
1215 | finally: | |
1215 | repo.lfstatus = False |
|
1216 | repo.lfstatus = False | |
1216 |
|
1217 | |||
1217 | @eh.wrapfunction(scmutil, 'addremove') |
|
1218 | @eh.wrapfunction(scmutil, 'addremove') | |
1218 | def scmutiladdremove(orig, repo, matcher, prefix, uipathfn, opts=None): |
|
1219 | def scmutiladdremove(orig, repo, matcher, prefix, uipathfn, opts=None): | |
1219 | if opts is None: |
|
1220 | if opts is None: | |
1220 | opts = {} |
|
1221 | opts = {} | |
1221 | if not lfutil.islfilesrepo(repo): |
|
1222 | if not lfutil.islfilesrepo(repo): | |
1222 | return orig(repo, matcher, prefix, uipathfn, opts) |
|
1223 | return orig(repo, matcher, prefix, uipathfn, opts) | |
1223 | # Get the list of missing largefiles so we can remove them |
|
1224 | # Get the list of missing largefiles so we can remove them | |
1224 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) |
|
1225 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) | |
1225 | unsure, s = lfdirstate.status(matchmod.always(), subrepos=[], |
|
1226 | unsure, s = lfdirstate.status(matchmod.always(), subrepos=[], | |
1226 | ignored=False, clean=False, unknown=False) |
|
1227 | ignored=False, clean=False, unknown=False) | |
1227 |
|
1228 | |||
1228 | # Call into the normal remove code, but the removing of the standin, we want |
|
1229 | # Call into the normal remove code, but the removing of the standin, we want | |
1229 | # to have handled by original addremove. Monkey patching here makes sure |
|
1230 | # to have handled by original addremove. Monkey patching here makes sure | |
1230 | # we don't remove the standin in the largefiles code, preventing a very |
|
1231 | # we don't remove the standin in the largefiles code, preventing a very | |
1231 | # confused state later. |
|
1232 | # confused state later. | |
1232 | if s.deleted: |
|
1233 | if s.deleted: | |
1233 | m = copy.copy(matcher) |
|
1234 | m = copy.copy(matcher) | |
1234 |
|
1235 | |||
1235 | # The m._files and m._map attributes are not changed to the deleted list |
|
1236 | # The m._files and m._map attributes are not changed to the deleted list | |
1236 | # because that affects the m.exact() test, which in turn governs whether |
|
1237 | # because that affects the m.exact() test, which in turn governs whether | |
1237 | # or not the file name is printed, and how. Simply limit the original |
|
1238 | # or not the file name is printed, and how. Simply limit the original | |
1238 | # matches to those in the deleted status list. |
|
1239 | # matches to those in the deleted status list. | |
1239 | matchfn = m.matchfn |
|
1240 | matchfn = m.matchfn | |
1240 | m.matchfn = lambda f: f in s.deleted and matchfn(f) |
|
1241 | m.matchfn = lambda f: f in s.deleted and matchfn(f) | |
1241 |
|
1242 | |||
1242 | removelargefiles(repo.ui, repo, True, m, uipathfn, opts.get('dry_run'), |
|
1243 | removelargefiles(repo.ui, repo, True, m, uipathfn, opts.get('dry_run'), | |
1243 | **pycompat.strkwargs(opts)) |
|
1244 | **pycompat.strkwargs(opts)) | |
1244 | # Call into the normal add code, and any files that *should* be added as |
|
1245 | # Call into the normal add code, and any files that *should* be added as | |
1245 | # largefiles will be |
|
1246 | # largefiles will be | |
1246 | added, bad = addlargefiles(repo.ui, repo, True, matcher, uipathfn, |
|
1247 | added, bad = addlargefiles(repo.ui, repo, True, matcher, uipathfn, | |
1247 | **pycompat.strkwargs(opts)) |
|
1248 | **pycompat.strkwargs(opts)) | |
1248 | # Now that we've handled largefiles, hand off to the original addremove |
|
1249 | # Now that we've handled largefiles, hand off to the original addremove | |
1249 | # function to take care of the rest. Make sure it doesn't do anything with |
|
1250 | # function to take care of the rest. Make sure it doesn't do anything with | |
1250 | # largefiles by passing a matcher that will ignore them. |
|
1251 | # largefiles by passing a matcher that will ignore them. | |
1251 | matcher = composenormalfilematcher(matcher, repo[None].manifest(), added) |
|
1252 | matcher = composenormalfilematcher(matcher, repo[None].manifest(), added) | |
1252 | return orig(repo, matcher, prefix, uipathfn, opts) |
|
1253 | return orig(repo, matcher, prefix, uipathfn, opts) | |
1253 |
|
1254 | |||
1254 | # Calling purge with --all will cause the largefiles to be deleted. |
|
1255 | # Calling purge with --all will cause the largefiles to be deleted. | |
1255 | # Override repo.status to prevent this from happening. |
|
1256 | # Override repo.status to prevent this from happening. | |
1256 | @eh.wrapcommand('purge', extension='purge') |
|
1257 | @eh.wrapcommand('purge', extension='purge') | |
1257 | def overridepurge(orig, ui, repo, *dirs, **opts): |
|
1258 | def overridepurge(orig, ui, repo, *dirs, **opts): | |
1258 | # XXX Monkey patching a repoview will not work. The assigned attribute will |
|
1259 | # XXX Monkey patching a repoview will not work. The assigned attribute will | |
1259 | # be set on the unfiltered repo, but we will only lookup attributes in the |
|
1260 | # be set on the unfiltered repo, but we will only lookup attributes in the | |
1260 | # unfiltered repo if the lookup in the repoview object itself fails. As the |
|
1261 | # unfiltered repo if the lookup in the repoview object itself fails. As the | |
1261 | # monkey patched method exists on the repoview class the lookup will not |
|
1262 | # monkey patched method exists on the repoview class the lookup will not | |
1262 | # fail. As a result, the original version will shadow the monkey patched |
|
1263 | # fail. As a result, the original version will shadow the monkey patched | |
1263 | # one, defeating the monkey patch. |
|
1264 | # one, defeating the monkey patch. | |
1264 | # |
|
1265 | # | |
1265 | # As a work around we use an unfiltered repo here. We should do something |
|
1266 | # As a work around we use an unfiltered repo here. We should do something | |
1266 | # cleaner instead. |
|
1267 | # cleaner instead. | |
1267 | repo = repo.unfiltered() |
|
1268 | repo = repo.unfiltered() | |
1268 | oldstatus = repo.status |
|
1269 | oldstatus = repo.status | |
1269 | def overridestatus(node1='.', node2=None, match=None, ignored=False, |
|
1270 | def overridestatus(node1='.', node2=None, match=None, ignored=False, | |
1270 | clean=False, unknown=False, listsubrepos=False): |
|
1271 | clean=False, unknown=False, listsubrepos=False): | |
1271 | r = oldstatus(node1, node2, match, ignored, clean, unknown, |
|
1272 | r = oldstatus(node1, node2, match, ignored, clean, unknown, | |
1272 | listsubrepos) |
|
1273 | listsubrepos) | |
1273 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
1274 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
1274 | unknown = [f for f in r.unknown if lfdirstate[f] == '?'] |
|
1275 | unknown = [f for f in r.unknown if lfdirstate[f] == '?'] | |
1275 | ignored = [f for f in r.ignored if lfdirstate[f] == '?'] |
|
1276 | ignored = [f for f in r.ignored if lfdirstate[f] == '?'] | |
1276 | return scmutil.status(r.modified, r.added, r.removed, r.deleted, |
|
1277 | return scmutil.status(r.modified, r.added, r.removed, r.deleted, | |
1277 | unknown, ignored, r.clean) |
|
1278 | unknown, ignored, r.clean) | |
1278 | repo.status = overridestatus |
|
1279 | repo.status = overridestatus | |
1279 | orig(ui, repo, *dirs, **opts) |
|
1280 | orig(ui, repo, *dirs, **opts) | |
1280 | repo.status = oldstatus |
|
1281 | repo.status = oldstatus | |
1281 |
|
1282 | |||
1282 | @eh.wrapcommand('rollback') |
|
1283 | @eh.wrapcommand('rollback') | |
1283 | def overriderollback(orig, ui, repo, **opts): |
|
1284 | def overriderollback(orig, ui, repo, **opts): | |
1284 | with repo.wlock(): |
|
1285 | with repo.wlock(): | |
1285 | before = repo.dirstate.parents() |
|
1286 | before = repo.dirstate.parents() | |
1286 | orphans = set(f for f in repo.dirstate |
|
1287 | orphans = set(f for f in repo.dirstate | |
1287 | if lfutil.isstandin(f) and repo.dirstate[f] != 'r') |
|
1288 | if lfutil.isstandin(f) and repo.dirstate[f] != 'r') | |
1288 | result = orig(ui, repo, **opts) |
|
1289 | result = orig(ui, repo, **opts) | |
1289 | after = repo.dirstate.parents() |
|
1290 | after = repo.dirstate.parents() | |
1290 | if before == after: |
|
1291 | if before == after: | |
1291 | return result # no need to restore standins |
|
1292 | return result # no need to restore standins | |
1292 |
|
1293 | |||
1293 | pctx = repo['.'] |
|
1294 | pctx = repo['.'] | |
1294 | for f in repo.dirstate: |
|
1295 | for f in repo.dirstate: | |
1295 | if lfutil.isstandin(f): |
|
1296 | if lfutil.isstandin(f): | |
1296 | orphans.discard(f) |
|
1297 | orphans.discard(f) | |
1297 | if repo.dirstate[f] == 'r': |
|
1298 | if repo.dirstate[f] == 'r': | |
1298 | repo.wvfs.unlinkpath(f, ignoremissing=True) |
|
1299 | repo.wvfs.unlinkpath(f, ignoremissing=True) | |
1299 | elif f in pctx: |
|
1300 | elif f in pctx: | |
1300 | fctx = pctx[f] |
|
1301 | fctx = pctx[f] | |
1301 | repo.wwrite(f, fctx.data(), fctx.flags()) |
|
1302 | repo.wwrite(f, fctx.data(), fctx.flags()) | |
1302 | else: |
|
1303 | else: | |
1303 | # content of standin is not so important in 'a', |
|
1304 | # content of standin is not so important in 'a', | |
1304 | # 'm' or 'n' (coming from the 2nd parent) cases |
|
1305 | # 'm' or 'n' (coming from the 2nd parent) cases | |
1305 | lfutil.writestandin(repo, f, '', False) |
|
1306 | lfutil.writestandin(repo, f, '', False) | |
1306 | for standin in orphans: |
|
1307 | for standin in orphans: | |
1307 | repo.wvfs.unlinkpath(standin, ignoremissing=True) |
|
1308 | repo.wvfs.unlinkpath(standin, ignoremissing=True) | |
1308 |
|
1309 | |||
1309 | lfdirstate = lfutil.openlfdirstate(ui, repo) |
|
1310 | lfdirstate = lfutil.openlfdirstate(ui, repo) | |
1310 | orphans = set(lfdirstate) |
|
1311 | orphans = set(lfdirstate) | |
1311 | lfiles = lfutil.listlfiles(repo) |
|
1312 | lfiles = lfutil.listlfiles(repo) | |
1312 | for file in lfiles: |
|
1313 | for file in lfiles: | |
1313 | lfutil.synclfdirstate(repo, lfdirstate, file, True) |
|
1314 | lfutil.synclfdirstate(repo, lfdirstate, file, True) | |
1314 | orphans.discard(file) |
|
1315 | orphans.discard(file) | |
1315 | for lfile in orphans: |
|
1316 | for lfile in orphans: | |
1316 | lfdirstate.drop(lfile) |
|
1317 | lfdirstate.drop(lfile) | |
1317 | lfdirstate.write() |
|
1318 | lfdirstate.write() | |
1318 | return result |
|
1319 | return result | |
1319 |
|
1320 | |||
1320 | @eh.wrapcommand('transplant', extension='transplant') |
|
1321 | @eh.wrapcommand('transplant', extension='transplant') | |
1321 | def overridetransplant(orig, ui, repo, *revs, **opts): |
|
1322 | def overridetransplant(orig, ui, repo, *revs, **opts): | |
1322 | resuming = opts.get(r'continue') |
|
1323 | resuming = opts.get(r'continue') | |
1323 | repo._lfcommithooks.append(lfutil.automatedcommithook(resuming)) |
|
1324 | repo._lfcommithooks.append(lfutil.automatedcommithook(resuming)) | |
1324 | repo._lfstatuswriters.append(lambda *msg, **opts: None) |
|
1325 | repo._lfstatuswriters.append(lambda *msg, **opts: None) | |
1325 | try: |
|
1326 | try: | |
1326 | result = orig(ui, repo, *revs, **opts) |
|
1327 | result = orig(ui, repo, *revs, **opts) | |
1327 | finally: |
|
1328 | finally: | |
1328 | repo._lfstatuswriters.pop() |
|
1329 | repo._lfstatuswriters.pop() | |
1329 | repo._lfcommithooks.pop() |
|
1330 | repo._lfcommithooks.pop() | |
1330 | return result |
|
1331 | return result | |
1331 |
|
1332 | |||
1332 | @eh.wrapcommand('cat') |
|
1333 | @eh.wrapcommand('cat') | |
1333 | def overridecat(orig, ui, repo, file1, *pats, **opts): |
|
1334 | def overridecat(orig, ui, repo, file1, *pats, **opts): | |
1334 | opts = pycompat.byteskwargs(opts) |
|
1335 | opts = pycompat.byteskwargs(opts) | |
1335 | ctx = scmutil.revsingle(repo, opts.get('rev')) |
|
1336 | ctx = scmutil.revsingle(repo, opts.get('rev')) | |
1336 | err = 1 |
|
1337 | err = 1 | |
1337 | notbad = set() |
|
1338 | notbad = set() | |
1338 | m = scmutil.match(ctx, (file1,) + pats, opts) |
|
1339 | m = scmutil.match(ctx, (file1,) + pats, opts) | |
1339 | origmatchfn = m.matchfn |
|
1340 | origmatchfn = m.matchfn | |
1340 | def lfmatchfn(f): |
|
1341 | def lfmatchfn(f): | |
1341 | if origmatchfn(f): |
|
1342 | if origmatchfn(f): | |
1342 | return True |
|
1343 | return True | |
1343 | lf = lfutil.splitstandin(f) |
|
1344 | lf = lfutil.splitstandin(f) | |
1344 | if lf is None: |
|
1345 | if lf is None: | |
1345 | return False |
|
1346 | return False | |
1346 | notbad.add(lf) |
|
1347 | notbad.add(lf) | |
1347 | return origmatchfn(lf) |
|
1348 | return origmatchfn(lf) | |
1348 | m.matchfn = lfmatchfn |
|
1349 | m.matchfn = lfmatchfn | |
1349 | origbadfn = m.bad |
|
1350 | origbadfn = m.bad | |
1350 | def lfbadfn(f, msg): |
|
1351 | def lfbadfn(f, msg): | |
1351 | if not f in notbad: |
|
1352 | if not f in notbad: | |
1352 | origbadfn(f, msg) |
|
1353 | origbadfn(f, msg) | |
1353 | m.bad = lfbadfn |
|
1354 | m.bad = lfbadfn | |
1354 |
|
1355 | |||
1355 | origvisitdirfn = m.visitdir |
|
1356 | origvisitdirfn = m.visitdir | |
1356 | def lfvisitdirfn(dir): |
|
1357 | def lfvisitdirfn(dir): | |
1357 | if dir == lfutil.shortname: |
|
1358 | if dir == lfutil.shortname: | |
1358 | return True |
|
1359 | return True | |
1359 | ret = origvisitdirfn(dir) |
|
1360 | ret = origvisitdirfn(dir) | |
1360 | if ret: |
|
1361 | if ret: | |
1361 | return ret |
|
1362 | return ret | |
1362 | lf = lfutil.splitstandin(dir) |
|
1363 | lf = lfutil.splitstandin(dir) | |
1363 | if lf is None: |
|
1364 | if lf is None: | |
1364 | return False |
|
1365 | return False | |
1365 | return origvisitdirfn(lf) |
|
1366 | return origvisitdirfn(lf) | |
1366 | m.visitdir = lfvisitdirfn |
|
1367 | m.visitdir = lfvisitdirfn | |
1367 |
|
1368 | |||
1368 | for f in ctx.walk(m): |
|
1369 | for f in ctx.walk(m): | |
1369 | with cmdutil.makefileobj(ctx, opts.get('output'), pathname=f) as fp: |
|
1370 | with cmdutil.makefileobj(ctx, opts.get('output'), pathname=f) as fp: | |
1370 | lf = lfutil.splitstandin(f) |
|
1371 | lf = lfutil.splitstandin(f) | |
1371 | if lf is None or origmatchfn(f): |
|
1372 | if lf is None or origmatchfn(f): | |
1372 | # duplicating unreachable code from commands.cat |
|
1373 | # duplicating unreachable code from commands.cat | |
1373 | data = ctx[f].data() |
|
1374 | data = ctx[f].data() | |
1374 | if opts.get('decode'): |
|
1375 | if opts.get('decode'): | |
1375 | data = repo.wwritedata(f, data) |
|
1376 | data = repo.wwritedata(f, data) | |
1376 | fp.write(data) |
|
1377 | fp.write(data) | |
1377 | else: |
|
1378 | else: | |
1378 | hash = lfutil.readasstandin(ctx[f]) |
|
1379 | hash = lfutil.readasstandin(ctx[f]) | |
1379 | if not lfutil.inusercache(repo.ui, hash): |
|
1380 | if not lfutil.inusercache(repo.ui, hash): | |
1380 | store = storefactory.openstore(repo) |
|
1381 | store = storefactory.openstore(repo) | |
1381 | success, missing = store.get([(lf, hash)]) |
|
1382 | success, missing = store.get([(lf, hash)]) | |
1382 | if len(success) != 1: |
|
1383 | if len(success) != 1: | |
1383 | raise error.Abort( |
|
1384 | raise error.Abort( | |
1384 | _('largefile %s is not in cache and could not be ' |
|
1385 | _('largefile %s is not in cache and could not be ' | |
1385 | 'downloaded') % lf) |
|
1386 | 'downloaded') % lf) | |
1386 | path = lfutil.usercachepath(repo.ui, hash) |
|
1387 | path = lfutil.usercachepath(repo.ui, hash) | |
1387 | with open(path, "rb") as fpin: |
|
1388 | with open(path, "rb") as fpin: | |
1388 | for chunk in util.filechunkiter(fpin): |
|
1389 | for chunk in util.filechunkiter(fpin): | |
1389 | fp.write(chunk) |
|
1390 | fp.write(chunk) | |
1390 | err = 0 |
|
1391 | err = 0 | |
1391 | return err |
|
1392 | return err | |
1392 |
|
1393 | |||
1393 | @eh.wrapfunction(merge, 'update') |
|
1394 | @eh.wrapfunction(merge, 'update') | |
1394 | def mergeupdate(orig, repo, node, branchmerge, force, |
|
1395 | def mergeupdate(orig, repo, node, branchmerge, force, | |
1395 | *args, **kwargs): |
|
1396 | *args, **kwargs): | |
1396 | matcher = kwargs.get(r'matcher', None) |
|
1397 | matcher = kwargs.get(r'matcher', None) | |
1397 | # note if this is a partial update |
|
1398 | # note if this is a partial update | |
1398 | partial = matcher and not matcher.always() |
|
1399 | partial = matcher and not matcher.always() | |
1399 | with repo.wlock(): |
|
1400 | with repo.wlock(): | |
1400 | # branch | | | |
|
1401 | # branch | | | | |
1401 | # merge | force | partial | action |
|
1402 | # merge | force | partial | action | |
1402 | # -------+-------+---------+-------------- |
|
1403 | # -------+-------+---------+-------------- | |
1403 | # x | x | x | linear-merge |
|
1404 | # x | x | x | linear-merge | |
1404 | # o | x | x | branch-merge |
|
1405 | # o | x | x | branch-merge | |
1405 | # x | o | x | overwrite (as clean update) |
|
1406 | # x | o | x | overwrite (as clean update) | |
1406 | # o | o | x | force-branch-merge (*1) |
|
1407 | # o | o | x | force-branch-merge (*1) | |
1407 | # x | x | o | (*) |
|
1408 | # x | x | o | (*) | |
1408 | # o | x | o | (*) |
|
1409 | # o | x | o | (*) | |
1409 | # x | o | o | overwrite (as revert) |
|
1410 | # x | o | o | overwrite (as revert) | |
1410 | # o | o | o | (*) |
|
1411 | # o | o | o | (*) | |
1411 | # |
|
1412 | # | |
1412 | # (*) don't care |
|
1413 | # (*) don't care | |
1413 | # (*1) deprecated, but used internally (e.g: "rebase --collapse") |
|
1414 | # (*1) deprecated, but used internally (e.g: "rebase --collapse") | |
1414 |
|
1415 | |||
1415 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) |
|
1416 | lfdirstate = lfutil.openlfdirstate(repo.ui, repo) | |
1416 | unsure, s = lfdirstate.status(matchmod.always(), subrepos=[], |
|
1417 | unsure, s = lfdirstate.status(matchmod.always(), subrepos=[], | |
1417 | ignored=False, clean=True, unknown=False) |
|
1418 | ignored=False, clean=True, unknown=False) | |
1418 | oldclean = set(s.clean) |
|
1419 | oldclean = set(s.clean) | |
1419 | pctx = repo['.'] |
|
1420 | pctx = repo['.'] | |
1420 | dctx = repo[node] |
|
1421 | dctx = repo[node] | |
1421 | for lfile in unsure + s.modified: |
|
1422 | for lfile in unsure + s.modified: | |
1422 | lfileabs = repo.wvfs.join(lfile) |
|
1423 | lfileabs = repo.wvfs.join(lfile) | |
1423 | if not repo.wvfs.exists(lfileabs): |
|
1424 | if not repo.wvfs.exists(lfileabs): | |
1424 | continue |
|
1425 | continue | |
1425 | lfhash = lfutil.hashfile(lfileabs) |
|
1426 | lfhash = lfutil.hashfile(lfileabs) | |
1426 | standin = lfutil.standin(lfile) |
|
1427 | standin = lfutil.standin(lfile) | |
1427 | lfutil.writestandin(repo, standin, lfhash, |
|
1428 | lfutil.writestandin(repo, standin, lfhash, | |
1428 | lfutil.getexecutable(lfileabs)) |
|
1429 | lfutil.getexecutable(lfileabs)) | |
1429 | if (standin in pctx and |
|
1430 | if (standin in pctx and | |
1430 | lfhash == lfutil.readasstandin(pctx[standin])): |
|
1431 | lfhash == lfutil.readasstandin(pctx[standin])): | |
1431 | oldclean.add(lfile) |
|
1432 | oldclean.add(lfile) | |
1432 | for lfile in s.added: |
|
1433 | for lfile in s.added: | |
1433 | fstandin = lfutil.standin(lfile) |
|
1434 | fstandin = lfutil.standin(lfile) | |
1434 | if fstandin not in dctx: |
|
1435 | if fstandin not in dctx: | |
1435 | # in this case, content of standin file is meaningless |
|
1436 | # in this case, content of standin file is meaningless | |
1436 | # (in dctx, lfile is unknown, or normal file) |
|
1437 | # (in dctx, lfile is unknown, or normal file) | |
1437 | continue |
|
1438 | continue | |
1438 | lfutil.updatestandin(repo, lfile, fstandin) |
|
1439 | lfutil.updatestandin(repo, lfile, fstandin) | |
1439 | # mark all clean largefiles as dirty, just in case the update gets |
|
1440 | # mark all clean largefiles as dirty, just in case the update gets | |
1440 | # interrupted before largefiles and lfdirstate are synchronized |
|
1441 | # interrupted before largefiles and lfdirstate are synchronized | |
1441 | for lfile in oldclean: |
|
1442 | for lfile in oldclean: | |
1442 | lfdirstate.normallookup(lfile) |
|
1443 | lfdirstate.normallookup(lfile) | |
1443 | lfdirstate.write() |
|
1444 | lfdirstate.write() | |
1444 |
|
1445 | |||
1445 | oldstandins = lfutil.getstandinsstate(repo) |
|
1446 | oldstandins = lfutil.getstandinsstate(repo) | |
1446 | # Make sure the merge runs on disk, not in-memory. largefiles is not a |
|
1447 | # Make sure the merge runs on disk, not in-memory. largefiles is not a | |
1447 | # good candidate for in-memory merge (large files, custom dirstate, |
|
1448 | # good candidate for in-memory merge (large files, custom dirstate, | |
1448 | # matcher usage). |
|
1449 | # matcher usage). | |
1449 | kwargs[r'wc'] = repo[None] |
|
1450 | kwargs[r'wc'] = repo[None] | |
1450 | result = orig(repo, node, branchmerge, force, *args, **kwargs) |
|
1451 | result = orig(repo, node, branchmerge, force, *args, **kwargs) | |
1451 |
|
1452 | |||
1452 | newstandins = lfutil.getstandinsstate(repo) |
|
1453 | newstandins = lfutil.getstandinsstate(repo) | |
1453 | filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) |
|
1454 | filelist = lfutil.getlfilestoupdate(oldstandins, newstandins) | |
1454 |
|
1455 | |||
1455 | # to avoid leaving all largefiles as dirty and thus rehash them, mark |
|
1456 | # to avoid leaving all largefiles as dirty and thus rehash them, mark | |
1456 | # all the ones that didn't change as clean |
|
1457 | # all the ones that didn't change as clean | |
1457 | for lfile in oldclean.difference(filelist): |
|
1458 | for lfile in oldclean.difference(filelist): | |
1458 | lfdirstate.normal(lfile) |
|
1459 | lfdirstate.normal(lfile) | |
1459 | lfdirstate.write() |
|
1460 | lfdirstate.write() | |
1460 |
|
1461 | |||
1461 | if branchmerge or force or partial: |
|
1462 | if branchmerge or force or partial: | |
1462 | filelist.extend(s.deleted + s.removed) |
|
1463 | filelist.extend(s.deleted + s.removed) | |
1463 |
|
1464 | |||
1464 | lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, |
|
1465 | lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, | |
1465 | normallookup=partial) |
|
1466 | normallookup=partial) | |
1466 |
|
1467 | |||
1467 | return result |
|
1468 | return result | |
1468 |
|
1469 | |||
1469 | @eh.wrapfunction(scmutil, 'marktouched') |
|
1470 | @eh.wrapfunction(scmutil, 'marktouched') | |
1470 | def scmutilmarktouched(orig, repo, files, *args, **kwargs): |
|
1471 | def scmutilmarktouched(orig, repo, files, *args, **kwargs): | |
1471 | result = orig(repo, files, *args, **kwargs) |
|
1472 | result = orig(repo, files, *args, **kwargs) | |
1472 |
|
1473 | |||
1473 | filelist = [] |
|
1474 | filelist = [] | |
1474 | for f in files: |
|
1475 | for f in files: | |
1475 | lf = lfutil.splitstandin(f) |
|
1476 | lf = lfutil.splitstandin(f) | |
1476 | if lf is not None: |
|
1477 | if lf is not None: | |
1477 | filelist.append(lf) |
|
1478 | filelist.append(lf) | |
1478 | if filelist: |
|
1479 | if filelist: | |
1479 | lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, |
|
1480 | lfcommands.updatelfiles(repo.ui, repo, filelist=filelist, | |
1480 | printmessage=False, normallookup=True) |
|
1481 | printmessage=False, normallookup=True) | |
1481 |
|
1482 | |||
1482 | return result |
|
1483 | return result | |
1483 |
|
1484 | |||
1484 | @eh.wrapfunction(upgrade, 'preservedrequirements') |
|
1485 | @eh.wrapfunction(upgrade, 'preservedrequirements') | |
1485 | @eh.wrapfunction(upgrade, 'supporteddestrequirements') |
|
1486 | @eh.wrapfunction(upgrade, 'supporteddestrequirements') | |
1486 | def upgraderequirements(orig, repo): |
|
1487 | def upgraderequirements(orig, repo): | |
1487 | reqs = orig(repo) |
|
1488 | reqs = orig(repo) | |
1488 | if 'largefiles' in repo.requirements: |
|
1489 | if 'largefiles' in repo.requirements: | |
1489 | reqs.add('largefiles') |
|
1490 | reqs.add('largefiles') | |
1490 | return reqs |
|
1491 | return reqs | |
1491 |
|
1492 | |||
1492 | _lfscheme = 'largefile://' |
|
1493 | _lfscheme = 'largefile://' | |
1493 |
|
1494 | |||
1494 | @eh.wrapfunction(urlmod, 'open') |
|
1495 | @eh.wrapfunction(urlmod, 'open') | |
1495 | def openlargefile(orig, ui, url_, data=None): |
|
1496 | def openlargefile(orig, ui, url_, data=None): | |
1496 | if url_.startswith(_lfscheme): |
|
1497 | if url_.startswith(_lfscheme): | |
1497 | if data: |
|
1498 | if data: | |
1498 | msg = "cannot use data on a 'largefile://' url" |
|
1499 | msg = "cannot use data on a 'largefile://' url" | |
1499 | raise error.ProgrammingError(msg) |
|
1500 | raise error.ProgrammingError(msg) | |
1500 | lfid = url_[len(_lfscheme):] |
|
1501 | lfid = url_[len(_lfscheme):] | |
1501 | return storefactory.getlfile(ui, lfid) |
|
1502 | return storefactory.getlfile(ui, lfid) | |
1502 | else: |
|
1503 | else: | |
1503 | return orig(ui, url_, data=data) |
|
1504 | return orig(ui, url_, data=data) |
@@ -1,1315 +1,1315 b'' | |||||
1 | This file contains testcases that tend to be related to special cases or less |
|
1 | This file contains testcases that tend to be related to special cases or less | |
2 | common commands affecting largefile. |
|
2 | common commands affecting largefile. | |
3 |
|
3 | |||
4 | $ hg init requirements |
|
4 | $ hg init requirements | |
5 | $ cd requirements |
|
5 | $ cd requirements | |
6 |
|
6 | |||
7 | # largefiles not loaded by default. |
|
7 | # largefiles not loaded by default. | |
8 |
|
8 | |||
9 | $ hg config extensions |
|
9 | $ hg config extensions | |
10 | [1] |
|
10 | [1] | |
11 |
|
11 | |||
12 | # Adding largefiles to requires file will auto-load largefiles extension. |
|
12 | # Adding largefiles to requires file will auto-load largefiles extension. | |
13 |
|
13 | |||
14 | $ echo largefiles >> .hg/requires |
|
14 | $ echo largefiles >> .hg/requires | |
15 | $ hg config extensions |
|
15 | $ hg config extensions | |
16 | extensions.largefiles= |
|
16 | extensions.largefiles= | |
17 |
|
17 | |||
18 | # But only if there is no config entry for the extension already. |
|
18 | # But only if there is no config entry for the extension already. | |
19 |
|
19 | |||
20 | $ cat > .hg/hgrc << EOF |
|
20 | $ cat > .hg/hgrc << EOF | |
21 | > [extensions] |
|
21 | > [extensions] | |
22 | > largefiles=! |
|
22 | > largefiles=! | |
23 | > EOF |
|
23 | > EOF | |
24 |
|
24 | |||
25 | $ hg config extensions |
|
25 | $ hg config extensions | |
26 | abort: repository requires features unknown to this Mercurial: largefiles! |
|
26 | abort: repository requires features unknown to this Mercurial: largefiles! | |
27 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
27 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
28 | [255] |
|
28 | [255] | |
29 |
|
29 | |||
30 | $ cat > .hg/hgrc << EOF |
|
30 | $ cat > .hg/hgrc << EOF | |
31 | > [extensions] |
|
31 | > [extensions] | |
32 | > largefiles= |
|
32 | > largefiles= | |
33 | > EOF |
|
33 | > EOF | |
34 |
|
34 | |||
35 | $ hg config extensions |
|
35 | $ hg config extensions | |
36 | extensions.largefiles= |
|
36 | extensions.largefiles= | |
37 |
|
37 | |||
38 | $ cat > .hg/hgrc << EOF |
|
38 | $ cat > .hg/hgrc << EOF | |
39 | > [extensions] |
|
39 | > [extensions] | |
40 | > largefiles = missing.py |
|
40 | > largefiles = missing.py | |
41 | > EOF |
|
41 | > EOF | |
42 |
|
42 | |||
43 | $ hg config extensions |
|
43 | $ hg config extensions | |
44 | *** failed to import extension largefiles from missing.py: [Errno 2] $ENOENT$: 'missing.py' |
|
44 | *** failed to import extension largefiles from missing.py: [Errno 2] $ENOENT$: 'missing.py' | |
45 | abort: repository requires features unknown to this Mercurial: largefiles! |
|
45 | abort: repository requires features unknown to this Mercurial: largefiles! | |
46 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
46 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
47 | [255] |
|
47 | [255] | |
48 |
|
48 | |||
49 | $ cd .. |
|
49 | $ cd .. | |
50 |
|
50 | |||
51 | Each sections should be independent of each others. |
|
51 | Each sections should be independent of each others. | |
52 |
|
52 | |||
53 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE |
|
53 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE | |
54 | $ mkdir "${USERCACHE}" |
|
54 | $ mkdir "${USERCACHE}" | |
55 | $ cat >> $HGRCPATH <<EOF |
|
55 | $ cat >> $HGRCPATH <<EOF | |
56 | > [extensions] |
|
56 | > [extensions] | |
57 | > largefiles= |
|
57 | > largefiles= | |
58 | > purge= |
|
58 | > purge= | |
59 | > rebase= |
|
59 | > rebase= | |
60 | > transplant= |
|
60 | > transplant= | |
61 | > [phases] |
|
61 | > [phases] | |
62 | > publish=False |
|
62 | > publish=False | |
63 | > [largefiles] |
|
63 | > [largefiles] | |
64 | > minsize=2 |
|
64 | > minsize=2 | |
65 | > patterns=glob:**.dat |
|
65 | > patterns=glob:**.dat | |
66 | > usercache=${USERCACHE} |
|
66 | > usercache=${USERCACHE} | |
67 | > [hooks] |
|
67 | > [hooks] | |
68 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" |
|
68 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" | |
69 | > EOF |
|
69 | > EOF | |
70 |
|
70 | |||
71 |
|
71 | |||
72 |
|
72 | |||
73 | Test copies and moves from a directory other than root (issue3516) |
|
73 | Test copies and moves from a directory other than root (issue3516) | |
74 | ========================================================================= |
|
74 | ========================================================================= | |
75 |
|
75 | |||
76 | $ hg init lf_cpmv |
|
76 | $ hg init lf_cpmv | |
77 | $ cd lf_cpmv |
|
77 | $ cd lf_cpmv | |
78 | $ mkdir dira |
|
78 | $ mkdir dira | |
79 | $ mkdir dira/dirb |
|
79 | $ mkdir dira/dirb | |
80 | $ touch dira/dirb/largefile |
|
80 | $ touch dira/dirb/largefile | |
81 | $ hg add --large dira/dirb/largefile |
|
81 | $ hg add --large dira/dirb/largefile | |
82 | $ hg commit -m "added" |
|
82 | $ hg commit -m "added" | |
83 | Invoking status precommit hook |
|
83 | Invoking status precommit hook | |
84 | A dira/dirb/largefile |
|
84 | A dira/dirb/largefile | |
85 | $ cd dira |
|
85 | $ cd dira | |
86 | $ hg cp dirb/largefile foo/largefile |
|
86 | $ hg cp dirb/largefile foo/largefile | |
87 |
|
87 | |||
88 | TODO: Ideally, this should mention the largefile, not the standin |
|
88 | TODO: Ideally, this should mention the largefile, not the standin | |
89 | $ hg log -T '{rev}\n' --stat 'set:clean()' |
|
89 | $ hg log -T '{rev}\n' --stat 'set:clean()' | |
90 | 0 |
|
90 | 0 | |
91 | .hglf/dira/dirb/largefile | 1 + |
|
91 | .hglf/dira/dirb/largefile | 1 + | |
92 | 1 files changed, 1 insertions(+), 0 deletions(-) |
|
92 | 1 files changed, 1 insertions(+), 0 deletions(-) | |
93 |
|
93 | |||
94 | $ hg ci -m "deep copy" |
|
94 | $ hg ci -m "deep copy" | |
95 | Invoking status precommit hook |
|
95 | Invoking status precommit hook | |
96 | A dira/foo/largefile |
|
96 | A dira/foo/largefile | |
97 | $ find . | sort |
|
97 | $ find . | sort | |
98 | . |
|
98 | . | |
99 | ./dirb |
|
99 | ./dirb | |
100 | ./dirb/largefile |
|
100 | ./dirb/largefile | |
101 | ./foo |
|
101 | ./foo | |
102 | ./foo/largefile |
|
102 | ./foo/largefile | |
103 | $ hg mv foo/largefile baz/largefile |
|
103 | $ hg mv foo/largefile baz/largefile | |
104 | $ hg ci -m "moved" |
|
104 | $ hg ci -m "moved" | |
105 | Invoking status precommit hook |
|
105 | Invoking status precommit hook | |
106 | A dira/baz/largefile |
|
106 | A dira/baz/largefile | |
107 | R dira/foo/largefile |
|
107 | R dira/foo/largefile | |
108 | $ find . | sort |
|
108 | $ find . | sort | |
109 | . |
|
109 | . | |
110 | ./baz |
|
110 | ./baz | |
111 | ./baz/largefile |
|
111 | ./baz/largefile | |
112 | ./dirb |
|
112 | ./dirb | |
113 | ./dirb/largefile |
|
113 | ./dirb/largefile | |
114 | $ cd .. |
|
114 | $ cd .. | |
115 | $ hg mv dira dirc |
|
115 | $ hg mv dira dirc | |
116 | moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile |
|
116 | moving .hglf/dira/baz/largefile to .hglf/dirc/baz/largefile | |
117 | moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile |
|
117 | moving .hglf/dira/dirb/largefile to .hglf/dirc/dirb/largefile | |
118 | $ find * | sort |
|
118 | $ find * | sort | |
119 | dirc |
|
119 | dirc | |
120 | dirc/baz |
|
120 | dirc/baz | |
121 | dirc/baz/largefile |
|
121 | dirc/baz/largefile | |
122 | dirc/dirb |
|
122 | dirc/dirb | |
123 | dirc/dirb/largefile |
|
123 | dirc/dirb/largefile | |
124 |
|
124 | |||
125 | $ hg clone -q . ../fetch |
|
125 | $ hg clone -q . ../fetch | |
126 | $ hg --config extensions.fetch= fetch ../fetch |
|
126 | $ hg --config extensions.fetch= fetch ../fetch | |
127 | abort: uncommitted changes |
|
127 | abort: uncommitted changes | |
128 | [255] |
|
128 | [255] | |
129 | $ hg up -qC |
|
129 | $ hg up -qC | |
130 | $ cd .. |
|
130 | $ cd .. | |
131 |
|
131 | |||
132 | Clone a local repository owned by another user |
|
132 | Clone a local repository owned by another user | |
133 | =================================================== |
|
133 | =================================================== | |
134 |
|
134 | |||
135 | #if unix-permissions |
|
135 | #if unix-permissions | |
136 |
|
136 | |||
137 | We have to simulate that here by setting $HOME and removing write permissions |
|
137 | We have to simulate that here by setting $HOME and removing write permissions | |
138 | $ ORIGHOME="$HOME" |
|
138 | $ ORIGHOME="$HOME" | |
139 | $ mkdir alice |
|
139 | $ mkdir alice | |
140 | $ HOME="`pwd`/alice" |
|
140 | $ HOME="`pwd`/alice" | |
141 | $ cd alice |
|
141 | $ cd alice | |
142 | $ hg init pubrepo |
|
142 | $ hg init pubrepo | |
143 | $ cd pubrepo |
|
143 | $ cd pubrepo | |
144 | $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null |
|
144 | $ dd if=/dev/zero bs=1k count=11k > a-large-file 2> /dev/null | |
145 | $ hg add --large a-large-file |
|
145 | $ hg add --large a-large-file | |
146 | $ hg commit -m "Add a large file" |
|
146 | $ hg commit -m "Add a large file" | |
147 | Invoking status precommit hook |
|
147 | Invoking status precommit hook | |
148 | A a-large-file |
|
148 | A a-large-file | |
149 | $ cd .. |
|
149 | $ cd .. | |
150 | $ chmod -R a-w pubrepo |
|
150 | $ chmod -R a-w pubrepo | |
151 | $ cd .. |
|
151 | $ cd .. | |
152 | $ mkdir bob |
|
152 | $ mkdir bob | |
153 | $ HOME="`pwd`/bob" |
|
153 | $ HOME="`pwd`/bob" | |
154 | $ cd bob |
|
154 | $ cd bob | |
155 | $ hg clone --pull ../alice/pubrepo pubrepo |
|
155 | $ hg clone --pull ../alice/pubrepo pubrepo | |
156 | requesting all changes |
|
156 | requesting all changes | |
157 | adding changesets |
|
157 | adding changesets | |
158 | adding manifests |
|
158 | adding manifests | |
159 | adding file changes |
|
159 | adding file changes | |
160 | added 1 changesets with 1 changes to 1 files |
|
160 | added 1 changesets with 1 changes to 1 files | |
161 | new changesets 09a186cfa6da (1 drafts) |
|
161 | new changesets 09a186cfa6da (1 drafts) | |
162 | updating to branch default |
|
162 | updating to branch default | |
163 | getting changed largefiles |
|
163 | getting changed largefiles | |
164 | 1 largefiles updated, 0 removed |
|
164 | 1 largefiles updated, 0 removed | |
165 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
165 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
166 | $ cd .. |
|
166 | $ cd .. | |
167 | $ chmod -R u+w alice/pubrepo |
|
167 | $ chmod -R u+w alice/pubrepo | |
168 | $ HOME="$ORIGHOME" |
|
168 | $ HOME="$ORIGHOME" | |
169 |
|
169 | |||
170 | #endif |
|
170 | #endif | |
171 |
|
171 | |||
172 |
|
172 | |||
173 | Symlink to a large largefile should behave the same as a symlink to a normal file |
|
173 | Symlink to a large largefile should behave the same as a symlink to a normal file | |
174 | ===================================================================================== |
|
174 | ===================================================================================== | |
175 |
|
175 | |||
176 | #if symlink |
|
176 | #if symlink | |
177 |
|
177 | |||
178 | $ hg init largesymlink |
|
178 | $ hg init largesymlink | |
179 | $ cd largesymlink |
|
179 | $ cd largesymlink | |
180 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null |
|
180 | $ dd if=/dev/zero bs=1k count=10k of=largefile 2>/dev/null | |
181 | $ hg add --large largefile |
|
181 | $ hg add --large largefile | |
182 | $ hg commit -m "commit a large file" |
|
182 | $ hg commit -m "commit a large file" | |
183 | Invoking status precommit hook |
|
183 | Invoking status precommit hook | |
184 | A largefile |
|
184 | A largefile | |
185 | $ ln -s largefile largelink |
|
185 | $ ln -s largefile largelink | |
186 | $ hg add largelink |
|
186 | $ hg add largelink | |
187 | $ hg commit -m "commit a large symlink" |
|
187 | $ hg commit -m "commit a large symlink" | |
188 | Invoking status precommit hook |
|
188 | Invoking status precommit hook | |
189 | A largelink |
|
189 | A largelink | |
190 | $ rm -f largelink |
|
190 | $ rm -f largelink | |
191 | $ hg up >/dev/null |
|
191 | $ hg up >/dev/null | |
192 | $ test -f largelink |
|
192 | $ test -f largelink | |
193 | [1] |
|
193 | [1] | |
194 | $ test -L largelink |
|
194 | $ test -L largelink | |
195 | [1] |
|
195 | [1] | |
196 | $ rm -f largelink # make next part of the test independent of the previous |
|
196 | $ rm -f largelink # make next part of the test independent of the previous | |
197 | $ hg up -C >/dev/null |
|
197 | $ hg up -C >/dev/null | |
198 | $ test -f largelink |
|
198 | $ test -f largelink | |
199 | $ test -L largelink |
|
199 | $ test -L largelink | |
200 | $ cd .. |
|
200 | $ cd .. | |
201 |
|
201 | |||
202 | #endif |
|
202 | #endif | |
203 |
|
203 | |||
204 |
|
204 | |||
205 | test for pattern matching on 'hg status': |
|
205 | test for pattern matching on 'hg status': | |
206 | ============================================== |
|
206 | ============================================== | |
207 |
|
207 | |||
208 |
|
208 | |||
209 | to boost performance, largefiles checks whether specified patterns are |
|
209 | to boost performance, largefiles checks whether specified patterns are | |
210 | related to largefiles in working directory (NOT to STANDIN) or not. |
|
210 | related to largefiles in working directory (NOT to STANDIN) or not. | |
211 |
|
211 | |||
212 | $ hg init statusmatch |
|
212 | $ hg init statusmatch | |
213 | $ cd statusmatch |
|
213 | $ cd statusmatch | |
214 |
|
214 | |||
215 | $ mkdir -p a/b/c/d |
|
215 | $ mkdir -p a/b/c/d | |
216 | $ echo normal > a/b/c/d/e.normal.txt |
|
216 | $ echo normal > a/b/c/d/e.normal.txt | |
217 | $ hg add a/b/c/d/e.normal.txt |
|
217 | $ hg add a/b/c/d/e.normal.txt | |
218 | $ echo large > a/b/c/d/e.large.txt |
|
218 | $ echo large > a/b/c/d/e.large.txt | |
219 | $ hg add --large a/b/c/d/e.large.txt |
|
219 | $ hg add --large a/b/c/d/e.large.txt | |
220 | $ mkdir -p a/b/c/x |
|
220 | $ mkdir -p a/b/c/x | |
221 | $ echo normal > a/b/c/x/y.normal.txt |
|
221 | $ echo normal > a/b/c/x/y.normal.txt | |
222 | $ hg add a/b/c/x/y.normal.txt |
|
222 | $ hg add a/b/c/x/y.normal.txt | |
223 | $ hg commit -m 'add files' |
|
223 | $ hg commit -m 'add files' | |
224 | Invoking status precommit hook |
|
224 | Invoking status precommit hook | |
225 | A a/b/c/d/e.large.txt |
|
225 | A a/b/c/d/e.large.txt | |
226 | A a/b/c/d/e.normal.txt |
|
226 | A a/b/c/d/e.normal.txt | |
227 | A a/b/c/x/y.normal.txt |
|
227 | A a/b/c/x/y.normal.txt | |
228 |
|
228 | |||
229 | (1) no pattern: no performance boost |
|
229 | (1) no pattern: no performance boost | |
230 | $ hg status -A |
|
230 | $ hg status -A | |
231 | C a/b/c/d/e.large.txt |
|
231 | C a/b/c/d/e.large.txt | |
232 | C a/b/c/d/e.normal.txt |
|
232 | C a/b/c/d/e.normal.txt | |
233 | C a/b/c/x/y.normal.txt |
|
233 | C a/b/c/x/y.normal.txt | |
234 |
|
234 | |||
235 | (2) pattern not related to largefiles: performance boost |
|
235 | (2) pattern not related to largefiles: performance boost | |
236 | $ hg status -A a/b/c/x |
|
236 | $ hg status -A a/b/c/x | |
237 | C a/b/c/x/y.normal.txt |
|
237 | C a/b/c/x/y.normal.txt | |
238 |
|
238 | |||
239 | (3) pattern related to largefiles: no performance boost |
|
239 | (3) pattern related to largefiles: no performance boost | |
240 | $ hg status -A a/b/c/d |
|
240 | $ hg status -A a/b/c/d | |
241 | C a/b/c/d/e.large.txt |
|
241 | C a/b/c/d/e.large.txt | |
242 | C a/b/c/d/e.normal.txt |
|
242 | C a/b/c/d/e.normal.txt | |
243 |
|
243 | |||
244 | (4) pattern related to STANDIN (not to largefiles): performance boost |
|
244 | (4) pattern related to STANDIN (not to largefiles): performance boost | |
245 | $ hg status -A .hglf/a |
|
245 | $ hg status -A .hglf/a | |
246 | C .hglf/a/b/c/d/e.large.txt |
|
246 | C .hglf/a/b/c/d/e.large.txt | |
247 |
|
247 | |||
248 | (5) mixed case: no performance boost |
|
248 | (5) mixed case: no performance boost | |
249 | $ hg status -A a/b/c/x a/b/c/d |
|
249 | $ hg status -A a/b/c/x a/b/c/d | |
250 | C a/b/c/d/e.large.txt |
|
250 | C a/b/c/d/e.large.txt | |
251 | C a/b/c/d/e.normal.txt |
|
251 | C a/b/c/d/e.normal.txt | |
252 | C a/b/c/x/y.normal.txt |
|
252 | C a/b/c/x/y.normal.txt | |
253 |
|
253 | |||
254 | verify that largefiles doesn't break filesets |
|
254 | verify that largefiles doesn't break filesets | |
255 |
|
255 | |||
256 | $ hg log --rev . --exclude "set:binary()" |
|
256 | $ hg log --rev . --exclude "set:binary()" | |
257 | changeset: 0:41bd42f10efa |
|
257 | changeset: 0:41bd42f10efa | |
258 | tag: tip |
|
258 | tag: tip | |
259 | user: test |
|
259 | user: test | |
260 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
260 | date: Thu Jan 01 00:00:00 1970 +0000 | |
261 | summary: add files |
|
261 | summary: add files | |
262 |
|
262 | |||
263 | sharing a largefile repo automatically enables largefiles on the share |
|
263 | sharing a largefile repo automatically enables largefiles on the share | |
264 |
|
264 | |||
265 | $ hg share --config extensions.share= . ../shared_lfrepo |
|
265 | $ hg share --config extensions.share= . ../shared_lfrepo | |
266 | updating working directory |
|
266 | updating working directory | |
267 | getting changed largefiles |
|
267 | getting changed largefiles | |
268 | 1 largefiles updated, 0 removed |
|
268 | 1 largefiles updated, 0 removed | |
269 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
269 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
270 | $ grep largefiles ../shared_lfrepo/.hg/requires |
|
270 | $ grep largefiles ../shared_lfrepo/.hg/requires | |
271 | largefiles |
|
271 | largefiles | |
272 |
|
272 | |||
273 | verify that large files in subrepos handled properly |
|
273 | verify that large files in subrepos handled properly | |
274 | $ hg init subrepo |
|
274 | $ hg init subrepo | |
275 | $ echo "subrepo = subrepo" > .hgsub |
|
275 | $ echo "subrepo = subrepo" > .hgsub | |
276 | $ hg add .hgsub |
|
276 | $ hg add .hgsub | |
277 | $ hg ci -m "add subrepo" |
|
277 | $ hg ci -m "add subrepo" | |
278 | Invoking status precommit hook |
|
278 | Invoking status precommit hook | |
279 | A .hgsub |
|
279 | A .hgsub | |
280 | ? .hgsubstate |
|
280 | ? .hgsubstate | |
281 | $ echo "rev 1" > subrepo/large.txt |
|
281 | $ echo "rev 1" > subrepo/large.txt | |
282 | $ hg add --large subrepo/large.txt |
|
282 | $ hg add --large subrepo/large.txt | |
283 | $ hg sum |
|
283 | $ hg sum | |
284 | parent: 1:8ee150ea2e9c tip |
|
284 | parent: 1:8ee150ea2e9c tip | |
285 | add subrepo |
|
285 | add subrepo | |
286 | branch: default |
|
286 | branch: default | |
287 | commit: 1 subrepos |
|
287 | commit: 1 subrepos | |
288 | update: (current) |
|
288 | update: (current) | |
289 | phases: 2 draft |
|
289 | phases: 2 draft | |
290 | $ hg st |
|
290 | $ hg st | |
291 | $ hg st -S |
|
291 | $ hg st -S | |
292 | A subrepo/large.txt |
|
292 | A subrepo/large.txt | |
293 | $ hg ci -S -m "commit top repo" |
|
293 | $ hg ci -S -m "commit top repo" | |
294 | committing subrepository subrepo |
|
294 | committing subrepository subrepo | |
295 | Invoking status precommit hook |
|
295 | Invoking status precommit hook | |
296 | A large.txt |
|
296 | A large.txt | |
297 | Invoking status precommit hook |
|
297 | Invoking status precommit hook | |
298 | M .hgsubstate |
|
298 | M .hgsubstate | |
299 | # No differences |
|
299 | # No differences | |
300 | $ hg st -S |
|
300 | $ hg st -S | |
301 | $ hg sum |
|
301 | $ hg sum | |
302 | parent: 2:ce4cd0c527a6 tip |
|
302 | parent: 2:ce4cd0c527a6 tip | |
303 | commit top repo |
|
303 | commit top repo | |
304 | branch: default |
|
304 | branch: default | |
305 | commit: (clean) |
|
305 | commit: (clean) | |
306 | update: (current) |
|
306 | update: (current) | |
307 | phases: 3 draft |
|
307 | phases: 3 draft | |
308 | $ echo "rev 2" > subrepo/large.txt |
|
308 | $ echo "rev 2" > subrepo/large.txt | |
309 | $ hg st -S |
|
309 | $ hg st -S | |
310 | M subrepo/large.txt |
|
310 | M subrepo/large.txt | |
311 | $ hg sum |
|
311 | $ hg sum | |
312 | parent: 2:ce4cd0c527a6 tip |
|
312 | parent: 2:ce4cd0c527a6 tip | |
313 | commit top repo |
|
313 | commit top repo | |
314 | branch: default |
|
314 | branch: default | |
315 | commit: 1 subrepos |
|
315 | commit: 1 subrepos | |
316 | update: (current) |
|
316 | update: (current) | |
317 | phases: 3 draft |
|
317 | phases: 3 draft | |
318 | $ hg ci -m "this commit should fail without -S" |
|
318 | $ hg ci -m "this commit should fail without -S" | |
319 | abort: uncommitted changes in subrepository "subrepo" |
|
319 | abort: uncommitted changes in subrepository "subrepo" | |
320 | (use --subrepos for recursive commit) |
|
320 | (use --subrepos for recursive commit) | |
321 | [255] |
|
321 | [255] | |
322 |
|
322 | |||
323 | Add a normal file to the subrepo, then test archiving |
|
323 | Add a normal file to the subrepo, then test archiving | |
324 |
|
324 | |||
325 | $ echo 'normal file' > subrepo/normal.txt |
|
325 | $ echo 'normal file' > subrepo/normal.txt | |
326 | $ touch large.dat |
|
326 | $ touch large.dat | |
327 | $ mv subrepo/large.txt subrepo/renamed-large.txt |
|
327 | $ mv subrepo/large.txt subrepo/renamed-large.txt | |
328 | $ hg addremove -S --dry-run |
|
328 | $ hg addremove -S --dry-run | |
329 | adding large.dat as a largefile |
|
329 | adding large.dat as a largefile | |
330 | removing subrepo/large.txt |
|
330 | removing subrepo/large.txt | |
331 | adding subrepo/normal.txt |
|
331 | adding subrepo/normal.txt | |
332 | adding subrepo/renamed-large.txt |
|
332 | adding subrepo/renamed-large.txt | |
333 | $ hg status -S |
|
333 | $ hg status -S | |
334 | ! subrepo/large.txt |
|
334 | ! subrepo/large.txt | |
335 | ? large.dat |
|
335 | ? large.dat | |
336 | ? subrepo/normal.txt |
|
336 | ? subrepo/normal.txt | |
337 | ? subrepo/renamed-large.txt |
|
337 | ? subrepo/renamed-large.txt | |
338 |
|
338 | |||
339 | $ hg addremove --dry-run subrepo |
|
339 | $ hg addremove --dry-run subrepo | |
340 | removing subrepo/large.txt |
|
340 | removing subrepo/large.txt | |
341 | adding subrepo/normal.txt |
|
341 | adding subrepo/normal.txt | |
342 | adding subrepo/renamed-large.txt |
|
342 | adding subrepo/renamed-large.txt | |
343 | $ hg status -S |
|
343 | $ hg status -S | |
344 | ! subrepo/large.txt |
|
344 | ! subrepo/large.txt | |
345 | ? large.dat |
|
345 | ? large.dat | |
346 | ? subrepo/normal.txt |
|
346 | ? subrepo/normal.txt | |
347 | ? subrepo/renamed-large.txt |
|
347 | ? subrepo/renamed-large.txt | |
348 | $ cd .. |
|
348 | $ cd .. | |
349 |
|
349 | |||
350 | $ hg -R statusmatch addremove --dry-run statusmatch/subrepo |
|
350 | $ hg -R statusmatch addremove --dry-run statusmatch/subrepo | |
351 | removing statusmatch/subrepo/large.txt |
|
351 | removing statusmatch/subrepo/large.txt | |
352 | adding statusmatch/subrepo/normal.txt |
|
352 | adding statusmatch/subrepo/normal.txt | |
353 | adding statusmatch/subrepo/renamed-large.txt |
|
353 | adding statusmatch/subrepo/renamed-large.txt | |
354 | $ hg -R statusmatch status -S |
|
354 | $ hg -R statusmatch status -S | |
355 | ! subrepo/large.txt |
|
355 | ! subrepo/large.txt | |
356 | ? large.dat |
|
356 | ? large.dat | |
357 | ? subrepo/normal.txt |
|
357 | ? subrepo/normal.txt | |
358 | ? subrepo/renamed-large.txt |
|
358 | ? subrepo/renamed-large.txt | |
359 |
|
359 | |||
360 | $ hg -R statusmatch addremove --dry-run -S |
|
360 | $ hg -R statusmatch addremove --dry-run -S | |
361 | adding large.dat as a largefile |
|
361 | adding large.dat as a largefile | |
362 | removing subrepo/large.txt |
|
362 | removing subrepo/large.txt | |
363 | adding subrepo/normal.txt |
|
363 | adding subrepo/normal.txt | |
364 | adding subrepo/renamed-large.txt |
|
364 | adding subrepo/renamed-large.txt | |
365 | $ cd statusmatch |
|
365 | $ cd statusmatch | |
366 |
|
366 | |||
367 | $ mv subrepo/renamed-large.txt subrepo/large.txt |
|
367 | $ mv subrepo/renamed-large.txt subrepo/large.txt | |
368 | $ hg addremove subrepo |
|
368 | $ hg addremove subrepo | |
369 | adding subrepo/normal.txt |
|
369 | adding subrepo/normal.txt | |
370 | $ hg forget subrepo/normal.txt |
|
370 | $ hg forget subrepo/normal.txt | |
371 |
|
371 | |||
372 | $ hg addremove -S |
|
372 | $ hg addremove -S | |
373 | adding large.dat as a largefile |
|
373 | adding large.dat as a largefile | |
374 | adding subrepo/normal.txt |
|
374 | adding subrepo/normal.txt | |
375 | $ rm large.dat |
|
375 | $ rm large.dat | |
376 |
|
376 | |||
377 | $ hg addremove subrepo |
|
377 | $ hg addremove subrepo | |
378 | $ hg addremove -S |
|
378 | $ hg addremove -S | |
379 | removing large.dat |
|
379 | removing large.dat | |
380 |
|
380 | |||
381 | Lock in subrepo, otherwise the change isn't archived |
|
381 | Lock in subrepo, otherwise the change isn't archived | |
382 |
|
382 | |||
383 | $ hg ci -S -m "add normal file to top level" |
|
383 | $ hg ci -S -m "add normal file to top level" | |
384 | committing subrepository subrepo |
|
384 | committing subrepository subrepo | |
385 | Invoking status precommit hook |
|
385 | Invoking status precommit hook | |
386 | M large.txt |
|
386 | M large.txt | |
387 | A normal.txt |
|
387 | A normal.txt | |
388 | Invoking status precommit hook |
|
388 | Invoking status precommit hook | |
389 | M .hgsubstate |
|
389 | M .hgsubstate | |
390 | $ hg archive -S ../lf_subrepo_archive |
|
390 | $ hg archive -S ../lf_subrepo_archive | |
391 | $ find ../lf_subrepo_archive | sort |
|
391 | $ find ../lf_subrepo_archive | sort | |
392 | ../lf_subrepo_archive |
|
392 | ../lf_subrepo_archive | |
393 | ../lf_subrepo_archive/.hg_archival.txt |
|
393 | ../lf_subrepo_archive/.hg_archival.txt | |
394 | ../lf_subrepo_archive/.hgsub |
|
394 | ../lf_subrepo_archive/.hgsub | |
395 | ../lf_subrepo_archive/.hgsubstate |
|
395 | ../lf_subrepo_archive/.hgsubstate | |
396 | ../lf_subrepo_archive/a |
|
396 | ../lf_subrepo_archive/a | |
397 | ../lf_subrepo_archive/a/b |
|
397 | ../lf_subrepo_archive/a/b | |
398 | ../lf_subrepo_archive/a/b/c |
|
398 | ../lf_subrepo_archive/a/b/c | |
399 | ../lf_subrepo_archive/a/b/c/d |
|
399 | ../lf_subrepo_archive/a/b/c/d | |
400 | ../lf_subrepo_archive/a/b/c/d/e.large.txt |
|
400 | ../lf_subrepo_archive/a/b/c/d/e.large.txt | |
401 | ../lf_subrepo_archive/a/b/c/d/e.normal.txt |
|
401 | ../lf_subrepo_archive/a/b/c/d/e.normal.txt | |
402 | ../lf_subrepo_archive/a/b/c/x |
|
402 | ../lf_subrepo_archive/a/b/c/x | |
403 | ../lf_subrepo_archive/a/b/c/x/y.normal.txt |
|
403 | ../lf_subrepo_archive/a/b/c/x/y.normal.txt | |
404 | ../lf_subrepo_archive/subrepo |
|
404 | ../lf_subrepo_archive/subrepo | |
405 | ../lf_subrepo_archive/subrepo/large.txt |
|
405 | ../lf_subrepo_archive/subrepo/large.txt | |
406 | ../lf_subrepo_archive/subrepo/normal.txt |
|
406 | ../lf_subrepo_archive/subrepo/normal.txt | |
407 | $ cat ../lf_subrepo_archive/.hg_archival.txt |
|
407 | $ cat ../lf_subrepo_archive/.hg_archival.txt | |
408 | repo: 41bd42f10efa43698cc02052ea0977771cba506d |
|
408 | repo: 41bd42f10efa43698cc02052ea0977771cba506d | |
409 | node: d56a95e6522858bc08a724c4fe2bdee066d1c30b |
|
409 | node: d56a95e6522858bc08a724c4fe2bdee066d1c30b | |
410 | branch: default |
|
410 | branch: default | |
411 | latesttag: null |
|
411 | latesttag: null | |
412 | latesttagdistance: 4 |
|
412 | latesttagdistance: 4 | |
413 | changessincelatesttag: 4 |
|
413 | changessincelatesttag: 4 | |
414 |
|
414 | |||
415 | Test update with subrepos. |
|
415 | Test update with subrepos. | |
416 |
|
416 | |||
417 | $ hg update 0 |
|
417 | $ hg update 0 | |
418 | getting changed largefiles |
|
418 | getting changed largefiles | |
419 | 0 largefiles updated, 1 removed |
|
419 | 0 largefiles updated, 1 removed | |
420 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
420 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
421 | $ hg status -S |
|
421 | $ hg status -S | |
422 | $ hg update tip |
|
422 | $ hg update tip | |
423 | getting changed largefiles |
|
423 | getting changed largefiles | |
424 | 1 largefiles updated, 0 removed |
|
424 | 1 largefiles updated, 0 removed | |
425 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
425 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
426 | $ hg status -S |
|
426 | $ hg status -S | |
427 | # modify a large file |
|
427 | # modify a large file | |
428 | $ echo "modified" > subrepo/large.txt |
|
428 | $ echo "modified" > subrepo/large.txt | |
429 | $ hg st -S |
|
429 | $ hg st -S | |
430 | M subrepo/large.txt |
|
430 | M subrepo/large.txt | |
431 | # update -C should revert the change. |
|
431 | # update -C should revert the change. | |
432 | $ hg update -C |
|
432 | $ hg update -C | |
433 | getting changed largefiles |
|
433 | getting changed largefiles | |
434 | 1 largefiles updated, 0 removed |
|
434 | 1 largefiles updated, 0 removed | |
435 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
435 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
436 | $ hg status -S |
|
436 | $ hg status -S | |
437 |
|
437 | |||
438 | Forget doesn't change the content of the file |
|
438 | Forget doesn't change the content of the file | |
439 | $ echo 'pre-forget content' > subrepo/large.txt |
|
439 | $ echo 'pre-forget content' > subrepo/large.txt | |
440 | $ hg forget -v subrepo/large.txt |
|
440 | $ hg forget -v subrepo/large.txt | |
441 | removing subrepo/large.txt |
|
441 | removing subrepo/large.txt | |
442 | $ cat subrepo/large.txt |
|
442 | $ cat subrepo/large.txt | |
443 | pre-forget content |
|
443 | pre-forget content | |
444 |
|
444 | |||
445 | Test reverting a forgotten file |
|
445 | Test reverting a forgotten file | |
446 | $ hg revert -R subrepo subrepo/large.txt |
|
446 | $ hg revert -R subrepo subrepo/large.txt | |
447 | $ hg status -SA subrepo/large.txt |
|
447 | $ hg status -SA subrepo/large.txt | |
448 | C subrepo/large.txt |
|
448 | C subrepo/large.txt | |
449 |
|
449 | |||
450 | $ hg rm -v subrepo/large.txt |
|
450 | $ hg rm -v subrepo/large.txt | |
451 | removing subrepo/large.txt |
|
451 | removing subrepo/large.txt | |
452 | $ hg revert -R subrepo subrepo/large.txt |
|
452 | $ hg revert -R subrepo subrepo/large.txt | |
453 | $ rm subrepo/large.txt |
|
453 | $ rm subrepo/large.txt | |
454 | $ hg addremove -S |
|
454 | $ hg addremove -S | |
455 | removing subrepo/large.txt |
|
455 | removing subrepo/large.txt | |
456 | $ hg st -S |
|
456 | $ hg st -S | |
457 | R subrepo/large.txt |
|
457 | R subrepo/large.txt | |
458 |
|
458 | |||
459 | Test archiving a revision that references a subrepo that is not yet |
|
459 | Test archiving a revision that references a subrepo that is not yet | |
460 | cloned (see test-subrepo-recursion.t): |
|
460 | cloned (see test-subrepo-recursion.t): | |
461 |
|
461 | |||
462 | $ hg clone -U . ../empty |
|
462 | $ hg clone -U . ../empty | |
463 | $ cd ../empty |
|
463 | $ cd ../empty | |
464 | $ hg archive --subrepos -r tip ../archive.tar.gz |
|
464 | $ hg archive --subrepos -r tip ../archive.tar.gz | |
465 | cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo |
|
465 | cloning subrepo subrepo from $TESTTMP/statusmatch/subrepo | |
466 | $ cd .. |
|
466 | $ cd .. | |
467 |
|
467 | |||
468 |
|
468 | |||
469 |
|
469 | |||
470 |
|
470 | |||
471 |
|
471 | |||
472 |
|
472 | |||
473 | Test addremove, forget and others |
|
473 | Test addremove, forget and others | |
474 | ============================================== |
|
474 | ============================================== | |
475 |
|
475 | |||
476 | Test that addremove picks up largefiles prior to the initial commit (issue3541) |
|
476 | Test that addremove picks up largefiles prior to the initial commit (issue3541) | |
477 |
|
477 | |||
478 | $ hg init addrm2 |
|
478 | $ hg init addrm2 | |
479 | $ cd addrm2 |
|
479 | $ cd addrm2 | |
480 | $ touch large.dat |
|
480 | $ touch large.dat | |
481 | $ touch large2.dat |
|
481 | $ touch large2.dat | |
482 | $ touch normal |
|
482 | $ touch normal | |
483 | $ hg add --large large.dat |
|
483 | $ hg add --large large.dat | |
484 | $ hg addremove -v |
|
484 | $ hg addremove -v | |
485 | adding large2.dat as a largefile |
|
485 | adding large2.dat as a largefile | |
486 | adding normal |
|
486 | adding normal | |
487 |
|
487 | |||
488 | Test that forgetting all largefiles reverts to islfilesrepo() == False |
|
488 | Test that forgetting all largefiles reverts to islfilesrepo() == False | |
489 | (addremove will add *.dat as normal files now) |
|
489 | (addremove will add *.dat as normal files now) | |
490 | $ hg forget large.dat |
|
490 | $ hg forget large.dat | |
491 | $ hg forget large2.dat |
|
491 | $ hg forget large2.dat | |
492 | $ hg addremove -v |
|
492 | $ hg addremove -v | |
493 | adding large.dat |
|
493 | adding large.dat | |
494 | adding large2.dat |
|
494 | adding large2.dat | |
495 |
|
495 | |||
496 | Test commit's addremove option prior to the first commit |
|
496 | Test commit's addremove option prior to the first commit | |
497 | $ hg forget large.dat |
|
497 | $ hg forget large.dat | |
498 | $ hg forget large2.dat |
|
498 | $ hg forget large2.dat | |
499 | $ hg add --large large.dat |
|
499 | $ hg add --large large.dat | |
500 | $ hg ci -Am "commit" |
|
500 | $ hg ci -Am "commit" | |
501 | adding large2.dat as a largefile |
|
501 | adding large2.dat as a largefile | |
502 | Invoking status precommit hook |
|
502 | Invoking status precommit hook | |
503 | A large.dat |
|
503 | A large.dat | |
504 | A large2.dat |
|
504 | A large2.dat | |
505 | A normal |
|
505 | A normal | |
506 | $ find .hglf | sort |
|
506 | $ find .hglf | sort | |
507 | .hglf |
|
507 | .hglf | |
508 | .hglf/large.dat |
|
508 | .hglf/large.dat | |
509 | .hglf/large2.dat |
|
509 | .hglf/large2.dat | |
510 |
|
510 | |||
511 | Test actions on largefiles using relative paths from subdir |
|
511 | Test actions on largefiles using relative paths from subdir | |
512 |
|
512 | |||
513 | $ mkdir sub |
|
513 | $ mkdir sub | |
514 | $ cd sub |
|
514 | $ cd sub | |
515 | $ echo anotherlarge > anotherlarge |
|
515 | $ echo anotherlarge > anotherlarge | |
516 | $ hg add --large anotherlarge |
|
516 | $ hg add --large anotherlarge | |
517 | $ hg st |
|
517 | $ hg st | |
518 | A sub/anotherlarge |
|
518 | A sub/anotherlarge | |
519 | $ hg st anotherlarge |
|
519 | $ hg st anotherlarge | |
520 | A anotherlarge |
|
520 | A anotherlarge | |
521 | $ hg commit -m anotherlarge anotherlarge |
|
521 | $ hg commit -m anotherlarge anotherlarge | |
522 | Invoking status precommit hook |
|
522 | Invoking status precommit hook | |
523 | A sub/anotherlarge |
|
523 | A sub/anotherlarge | |
524 | $ hg log anotherlarge |
|
524 | $ hg log anotherlarge | |
525 | changeset: 1:9627a577c5e9 |
|
525 | changeset: 1:9627a577c5e9 | |
526 | tag: tip |
|
526 | tag: tip | |
527 | user: test |
|
527 | user: test | |
528 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
528 | date: Thu Jan 01 00:00:00 1970 +0000 | |
529 | summary: anotherlarge |
|
529 | summary: anotherlarge | |
530 |
|
530 | |||
531 | $ hg --debug log -T '{rev}: {desc}\n' ../sub/anotherlarge |
|
531 | $ hg --debug log -T '{rev}: {desc}\n' ../sub/anotherlarge | |
532 | updated patterns: ../.hglf/sub/../sub/anotherlarge, ../sub/anotherlarge |
|
532 | updated patterns: ../.hglf/sub/../sub/anotherlarge, ../sub/anotherlarge | |
533 | 1: anotherlarge |
|
533 | 1: anotherlarge | |
534 |
|
534 | |||
535 | $ hg log -G anotherlarge |
|
535 | $ hg log -G anotherlarge | |
536 | @ changeset: 1:9627a577c5e9 |
|
536 | @ changeset: 1:9627a577c5e9 | |
537 | | tag: tip |
|
537 | | tag: tip | |
538 | ~ user: test |
|
538 | ~ user: test | |
539 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
539 | date: Thu Jan 01 00:00:00 1970 +0000 | |
540 | summary: anotherlarge |
|
540 | summary: anotherlarge | |
541 |
|
541 | |||
542 |
|
542 | |||
543 | $ hg log glob:another* |
|
543 | $ hg log glob:another* | |
544 | changeset: 1:9627a577c5e9 |
|
544 | changeset: 1:9627a577c5e9 | |
545 | tag: tip |
|
545 | tag: tip | |
546 | user: test |
|
546 | user: test | |
547 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
547 | date: Thu Jan 01 00:00:00 1970 +0000 | |
548 | summary: anotherlarge |
|
548 | summary: anotherlarge | |
549 |
|
549 | |||
550 | $ hg --debug log -T '{rev}: {desc}\n' -G glob:another* |
|
550 | $ hg --debug log -T '{rev}: {desc}\n' -G glob:another* | |
551 | updated patterns: glob:../.hglf/sub/another*, glob:another* |
|
551 | updated patterns: glob:../.hglf/sub/another*, glob:another* | |
552 | @ 1: anotherlarge |
|
552 | @ 1: anotherlarge | |
553 | | |
|
553 | | | |
554 | ~ |
|
554 | ~ | |
555 |
|
555 | |||
556 | #if no-msys |
|
556 | #if no-msys | |
557 | $ hg --debug log -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys |
|
557 | $ hg --debug log -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys | |
558 | updated patterns: glob:../.hglf/sub/another* |
|
558 | updated patterns: glob:../.hglf/sub/another* | |
559 | 1: anotherlarge |
|
559 | 1: anotherlarge | |
560 |
|
560 | |||
561 | $ hg --debug log -G -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys |
|
561 | $ hg --debug log -G -T '{rev}: {desc}\n' 'glob:../.hglf/sub/another*' # no-msys | |
562 | updated patterns: glob:../.hglf/sub/another* |
|
562 | updated patterns: glob:../.hglf/sub/another* | |
563 | @ 1: anotherlarge |
|
563 | @ 1: anotherlarge | |
564 | | |
|
564 | | | |
565 | ~ |
|
565 | ~ | |
566 | #endif |
|
566 | #endif | |
567 |
|
567 | |||
568 | $ echo more >> anotherlarge |
|
568 | $ echo more >> anotherlarge | |
569 | $ hg st . |
|
569 | $ hg st . | |
570 | M anotherlarge |
|
570 | M anotherlarge | |
571 | $ hg cat anotherlarge |
|
571 | $ hg cat anotherlarge | |
572 | anotherlarge |
|
572 | anotherlarge | |
573 | $ hg revert anotherlarge |
|
573 | $ hg revert anotherlarge | |
574 | $ hg st |
|
574 | $ hg st | |
575 | ? sub/anotherlarge.orig |
|
575 | ? sub/anotherlarge.orig | |
576 |
|
576 | |||
577 | Test orig files go where we want them |
|
577 | Test orig files go where we want them | |
578 | $ echo moremore >> anotherlarge |
|
578 | $ echo moremore >> anotherlarge | |
579 | $ hg revert anotherlarge -v --config 'ui.origbackuppath=.hg/origbackups' |
|
579 | $ hg revert anotherlarge -v --config 'ui.origbackuppath=.hg/origbackups' | |
580 | creating directory: $TESTTMP/addrm2/.hg/origbackups/.hglf/sub |
|
580 | creating directory: $TESTTMP/addrm2/.hg/origbackups/.hglf/sub | |
581 | saving current version of ../.hglf/sub/anotherlarge as ../.hg/origbackups/.hglf/sub/anotherlarge |
|
581 | saving current version of ../.hglf/sub/anotherlarge as ../.hg/origbackups/.hglf/sub/anotherlarge | |
582 | reverting ../.hglf/sub/anotherlarge |
|
582 | reverting ../.hglf/sub/anotherlarge | |
583 | creating directory: $TESTTMP/addrm2/.hg/origbackups/sub |
|
583 | creating directory: $TESTTMP/addrm2/.hg/origbackups/sub | |
584 | found 90c622cf65cebe75c5842f9136c459333faf392e in store |
|
584 | found 90c622cf65cebe75c5842f9136c459333faf392e in store | |
585 | found 90c622cf65cebe75c5842f9136c459333faf392e in store |
|
585 | found 90c622cf65cebe75c5842f9136c459333faf392e in store | |
586 | $ ls ../.hg/origbackups/sub |
|
586 | $ ls ../.hg/origbackups/sub | |
587 | anotherlarge |
|
587 | anotherlarge | |
588 | $ cd .. |
|
588 | $ cd .. | |
589 |
|
589 | |||
590 | Test glob logging from the root dir |
|
590 | Test glob logging from the root dir | |
591 | $ hg log glob:**another* |
|
591 | $ hg log glob:**another* | |
592 | changeset: 1:9627a577c5e9 |
|
592 | changeset: 1:9627a577c5e9 | |
593 | tag: tip |
|
593 | tag: tip | |
594 | user: test |
|
594 | user: test | |
595 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
595 | date: Thu Jan 01 00:00:00 1970 +0000 | |
596 | summary: anotherlarge |
|
596 | summary: anotherlarge | |
597 |
|
597 | |||
598 | $ hg log -G glob:**another* |
|
598 | $ hg log -G glob:**another* | |
599 | @ changeset: 1:9627a577c5e9 |
|
599 | @ changeset: 1:9627a577c5e9 | |
600 | | tag: tip |
|
600 | | tag: tip | |
601 | ~ user: test |
|
601 | ~ user: test | |
602 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
602 | date: Thu Jan 01 00:00:00 1970 +0000 | |
603 | summary: anotherlarge |
|
603 | summary: anotherlarge | |
604 |
|
604 | |||
605 |
|
605 | |||
606 | $ cd .. |
|
606 | $ cd .. | |
607 |
|
607 | |||
608 | Log from outer space |
|
608 | Log from outer space | |
609 | $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/sub/anotherlarge' |
|
609 | $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/sub/anotherlarge' | |
610 | updated patterns: addrm2/.hglf/sub/anotherlarge, addrm2/sub/anotherlarge |
|
610 | updated patterns: addrm2/.hglf/sub/anotherlarge, addrm2/sub/anotherlarge | |
611 | 1: anotherlarge |
|
611 | 1: anotherlarge | |
612 | $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/.hglf/sub/anotherlarge' |
|
612 | $ hg --debug log -R addrm2 -T '{rev}: {desc}\n' 'addrm2/.hglf/sub/anotherlarge' | |
613 | updated patterns: addrm2/.hglf/sub/anotherlarge |
|
613 | updated patterns: addrm2/.hglf/sub/anotherlarge | |
614 | 1: anotherlarge |
|
614 | 1: anotherlarge | |
615 |
|
615 | |||
616 |
|
616 | |||
617 | Check error message while exchange |
|
617 | Check error message while exchange | |
618 | ========================================================= |
|
618 | ========================================================= | |
619 |
|
619 | |||
620 | issue3651: summary/outgoing with largefiles shows "no remote repo" |
|
620 | issue3651: summary/outgoing with largefiles shows "no remote repo" | |
621 | unexpectedly |
|
621 | unexpectedly | |
622 |
|
622 | |||
623 | $ mkdir issue3651 |
|
623 | $ mkdir issue3651 | |
624 | $ cd issue3651 |
|
624 | $ cd issue3651 | |
625 |
|
625 | |||
626 | $ hg init src |
|
626 | $ hg init src | |
627 | $ echo a > src/a |
|
627 | $ echo a > src/a | |
628 | $ hg -R src add --large src/a |
|
628 | $ hg -R src add --large src/a | |
629 | $ hg -R src commit -m '#0' |
|
629 | $ hg -R src commit -m '#0' | |
630 | Invoking status precommit hook |
|
630 | Invoking status precommit hook | |
631 | A a |
|
631 | A a | |
632 |
|
632 | |||
633 | check messages when no remote repository is specified: |
|
633 | check messages when no remote repository is specified: | |
634 | "no remote repo" route for "hg outgoing --large" is not tested here, |
|
634 | "no remote repo" route for "hg outgoing --large" is not tested here, | |
635 | because it can't be reproduced easily. |
|
635 | because it can't be reproduced easily. | |
636 |
|
636 | |||
637 | $ hg init clone1 |
|
637 | $ hg init clone1 | |
638 | $ hg -R clone1 -q pull src |
|
638 | $ hg -R clone1 -q pull src | |
639 | $ hg -R clone1 -q update |
|
639 | $ hg -R clone1 -q update | |
640 | $ hg -R clone1 paths | grep default |
|
640 | $ hg -R clone1 paths | grep default | |
641 | [1] |
|
641 | [1] | |
642 |
|
642 | |||
643 | $ hg -R clone1 summary --large |
|
643 | $ hg -R clone1 summary --large | |
644 | parent: 0:fc0bd45326d3 tip |
|
644 | parent: 0:fc0bd45326d3 tip | |
645 | #0 |
|
645 | #0 | |
646 | branch: default |
|
646 | branch: default | |
647 | commit: (clean) |
|
647 | commit: (clean) | |
648 | update: (current) |
|
648 | update: (current) | |
649 | phases: 1 draft |
|
649 | phases: 1 draft | |
650 | largefiles: (no remote repo) |
|
650 | largefiles: (no remote repo) | |
651 |
|
651 | |||
652 | check messages when there is no files to upload: |
|
652 | check messages when there is no files to upload: | |
653 |
|
653 | |||
654 | $ hg -q clone src clone2 |
|
654 | $ hg -q clone src clone2 | |
655 | $ hg -R clone2 paths | grep default |
|
655 | $ hg -R clone2 paths | grep default | |
656 | default = $TESTTMP/issue3651/src |
|
656 | default = $TESTTMP/issue3651/src | |
657 |
|
657 | |||
658 | $ hg -R clone2 summary --large |
|
658 | $ hg -R clone2 summary --large | |
659 | parent: 0:fc0bd45326d3 tip |
|
659 | parent: 0:fc0bd45326d3 tip | |
660 | #0 |
|
660 | #0 | |
661 | branch: default |
|
661 | branch: default | |
662 | commit: (clean) |
|
662 | commit: (clean) | |
663 | update: (current) |
|
663 | update: (current) | |
664 | phases: 1 draft |
|
664 | phases: 1 draft | |
665 | largefiles: (no files to upload) |
|
665 | largefiles: (no files to upload) | |
666 | $ hg -R clone2 outgoing --large |
|
666 | $ hg -R clone2 outgoing --large | |
667 | comparing with $TESTTMP/issue3651/src |
|
667 | comparing with $TESTTMP/issue3651/src | |
668 | searching for changes |
|
668 | searching for changes | |
669 | no changes found |
|
669 | no changes found | |
670 | largefiles: no files to upload |
|
670 | largefiles: no files to upload | |
671 | [1] |
|
671 | [1] | |
672 |
|
672 | |||
673 | $ hg -R clone2 outgoing --large --graph --template "{rev}" |
|
673 | $ hg -R clone2 outgoing --large --graph --template "{rev}" | |
674 | comparing with $TESTTMP/issue3651/src |
|
674 | comparing with $TESTTMP/issue3651/src | |
675 | searching for changes |
|
675 | searching for changes | |
676 | no changes found |
|
676 | no changes found | |
677 | largefiles: no files to upload |
|
677 | largefiles: no files to upload | |
678 |
|
678 | |||
679 | check messages when there are files to upload: |
|
679 | check messages when there are files to upload: | |
680 |
|
680 | |||
681 | $ echo b > clone2/b |
|
681 | $ echo b > clone2/b | |
682 | $ hg -R clone2 add --large clone2/b |
|
682 | $ hg -R clone2 add --large clone2/b | |
683 | $ hg -R clone2 commit -m '#1' |
|
683 | $ hg -R clone2 commit -m '#1' | |
684 | Invoking status precommit hook |
|
684 | Invoking status precommit hook | |
685 | A b |
|
685 | A b | |
686 | $ hg -R clone2 summary --large |
|
686 | $ hg -R clone2 summary --large | |
687 | parent: 1:1acbe71ce432 tip |
|
687 | parent: 1:1acbe71ce432 tip | |
688 | #1 |
|
688 | #1 | |
689 | branch: default |
|
689 | branch: default | |
690 | commit: (clean) |
|
690 | commit: (clean) | |
691 | update: (current) |
|
691 | update: (current) | |
692 | phases: 2 draft |
|
692 | phases: 2 draft | |
693 | largefiles: 1 entities for 1 files to upload |
|
693 | largefiles: 1 entities for 1 files to upload | |
694 | $ hg -R clone2 outgoing --large |
|
694 | $ hg -R clone2 outgoing --large | |
695 | comparing with $TESTTMP/issue3651/src |
|
695 | comparing with $TESTTMP/issue3651/src | |
696 | searching for changes |
|
696 | searching for changes | |
697 | changeset: 1:1acbe71ce432 |
|
697 | changeset: 1:1acbe71ce432 | |
698 | tag: tip |
|
698 | tag: tip | |
699 | user: test |
|
699 | user: test | |
700 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
700 | date: Thu Jan 01 00:00:00 1970 +0000 | |
701 | summary: #1 |
|
701 | summary: #1 | |
702 |
|
702 | |||
703 | largefiles to upload (1 entities): |
|
703 | largefiles to upload (1 entities): | |
704 | b |
|
704 | b | |
705 |
|
705 | |||
706 | $ hg -R clone2 outgoing --large --graph --template "{rev}" |
|
706 | $ hg -R clone2 outgoing --large --graph --template "{rev}" | |
707 | comparing with $TESTTMP/issue3651/src |
|
707 | comparing with $TESTTMP/issue3651/src | |
708 | searching for changes |
|
708 | searching for changes | |
709 | @ 1 |
|
709 | @ 1 | |
710 |
|
710 | |||
711 | largefiles to upload (1 entities): |
|
711 | largefiles to upload (1 entities): | |
712 | b |
|
712 | b | |
713 |
|
713 | |||
714 |
|
714 | |||
715 | $ cp clone2/b clone2/b1 |
|
715 | $ cp clone2/b clone2/b1 | |
716 | $ cp clone2/b clone2/b2 |
|
716 | $ cp clone2/b clone2/b2 | |
717 | $ hg -R clone2 add --large clone2/b1 clone2/b2 |
|
717 | $ hg -R clone2 add --large clone2/b1 clone2/b2 | |
718 | $ hg -R clone2 commit -m '#2: add largefiles referring same entity' |
|
718 | $ hg -R clone2 commit -m '#2: add largefiles referring same entity' | |
719 | Invoking status precommit hook |
|
719 | Invoking status precommit hook | |
720 | A b1 |
|
720 | A b1 | |
721 | A b2 |
|
721 | A b2 | |
722 | $ hg -R clone2 summary --large |
|
722 | $ hg -R clone2 summary --large | |
723 | parent: 2:6095d0695d70 tip |
|
723 | parent: 2:6095d0695d70 tip | |
724 | #2: add largefiles referring same entity |
|
724 | #2: add largefiles referring same entity | |
725 | branch: default |
|
725 | branch: default | |
726 | commit: (clean) |
|
726 | commit: (clean) | |
727 | update: (current) |
|
727 | update: (current) | |
728 | phases: 3 draft |
|
728 | phases: 3 draft | |
729 | largefiles: 1 entities for 3 files to upload |
|
729 | largefiles: 1 entities for 3 files to upload | |
730 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" |
|
730 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" | |
731 | comparing with $TESTTMP/issue3651/src |
|
731 | comparing with $TESTTMP/issue3651/src | |
732 | searching for changes |
|
732 | searching for changes | |
733 | 1:1acbe71ce432 |
|
733 | 1:1acbe71ce432 | |
734 | 2:6095d0695d70 |
|
734 | 2:6095d0695d70 | |
735 | largefiles to upload (1 entities): |
|
735 | largefiles to upload (1 entities): | |
736 | b |
|
736 | b | |
737 | b1 |
|
737 | b1 | |
738 | b2 |
|
738 | b2 | |
739 |
|
739 | |||
740 | $ hg -R clone2 cat -r 1 clone2/.hglf/b |
|
740 | $ hg -R clone2 cat -r 1 clone2/.hglf/b | |
741 | 89e6c98d92887913cadf06b2adb97f26cde4849b |
|
741 | 89e6c98d92887913cadf06b2adb97f26cde4849b | |
742 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true |
|
742 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true | |
743 | comparing with $TESTTMP/issue3651/src |
|
743 | comparing with $TESTTMP/issue3651/src | |
744 | query 1; heads |
|
744 | query 1; heads | |
745 | searching for changes |
|
745 | searching for changes | |
746 | all remote heads known locally |
|
746 | all remote heads known locally | |
747 | 1:1acbe71ce432 |
|
747 | 1:1acbe71ce432 | |
748 | 2:6095d0695d70 |
|
748 | 2:6095d0695d70 | |
749 | finding outgoing largefiles: 0/2 revisions (0.00%) |
|
749 | finding outgoing largefiles: 0/2 revisions (0.00%) | |
750 | finding outgoing largefiles: 1/2 revisions (50.00%) |
|
750 | finding outgoing largefiles: 1/2 revisions (50.00%) | |
751 | largefiles to upload (1 entities): |
|
751 | largefiles to upload (1 entities): | |
752 | b |
|
752 | b | |
753 | 89e6c98d92887913cadf06b2adb97f26cde4849b |
|
753 | 89e6c98d92887913cadf06b2adb97f26cde4849b | |
754 | b1 |
|
754 | b1 | |
755 | 89e6c98d92887913cadf06b2adb97f26cde4849b |
|
755 | 89e6c98d92887913cadf06b2adb97f26cde4849b | |
756 | b2 |
|
756 | b2 | |
757 | 89e6c98d92887913cadf06b2adb97f26cde4849b |
|
757 | 89e6c98d92887913cadf06b2adb97f26cde4849b | |
758 |
|
758 | |||
759 |
|
759 | |||
760 | $ echo bbb > clone2/b |
|
760 | $ echo bbb > clone2/b | |
761 | $ hg -R clone2 commit -m '#3: add new largefile entity as existing file' |
|
761 | $ hg -R clone2 commit -m '#3: add new largefile entity as existing file' | |
762 | Invoking status precommit hook |
|
762 | Invoking status precommit hook | |
763 | M b |
|
763 | M b | |
764 | $ echo bbbb > clone2/b |
|
764 | $ echo bbbb > clone2/b | |
765 | $ hg -R clone2 commit -m '#4: add new largefile entity as existing file' |
|
765 | $ hg -R clone2 commit -m '#4: add new largefile entity as existing file' | |
766 | Invoking status precommit hook |
|
766 | Invoking status precommit hook | |
767 | M b |
|
767 | M b | |
768 | $ cp clone2/b1 clone2/b |
|
768 | $ cp clone2/b1 clone2/b | |
769 | $ hg -R clone2 commit -m '#5: refer existing largefile entity again' |
|
769 | $ hg -R clone2 commit -m '#5: refer existing largefile entity again' | |
770 | Invoking status precommit hook |
|
770 | Invoking status precommit hook | |
771 | M b |
|
771 | M b | |
772 | $ hg -R clone2 summary --large |
|
772 | $ hg -R clone2 summary --large | |
773 | parent: 5:036794ea641c tip |
|
773 | parent: 5:036794ea641c tip | |
774 | #5: refer existing largefile entity again |
|
774 | #5: refer existing largefile entity again | |
775 | branch: default |
|
775 | branch: default | |
776 | commit: (clean) |
|
776 | commit: (clean) | |
777 | update: (current) |
|
777 | update: (current) | |
778 | phases: 6 draft |
|
778 | phases: 6 draft | |
779 | largefiles: 3 entities for 3 files to upload |
|
779 | largefiles: 3 entities for 3 files to upload | |
780 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" |
|
780 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" | |
781 | comparing with $TESTTMP/issue3651/src |
|
781 | comparing with $TESTTMP/issue3651/src | |
782 | searching for changes |
|
782 | searching for changes | |
783 | 1:1acbe71ce432 |
|
783 | 1:1acbe71ce432 | |
784 | 2:6095d0695d70 |
|
784 | 2:6095d0695d70 | |
785 | 3:7983dce246cc |
|
785 | 3:7983dce246cc | |
786 | 4:233f12ada4ae |
|
786 | 4:233f12ada4ae | |
787 | 5:036794ea641c |
|
787 | 5:036794ea641c | |
788 | largefiles to upload (3 entities): |
|
788 | largefiles to upload (3 entities): | |
789 | b |
|
789 | b | |
790 | b1 |
|
790 | b1 | |
791 | b2 |
|
791 | b2 | |
792 |
|
792 | |||
793 | $ hg -R clone2 cat -r 3 clone2/.hglf/b |
|
793 | $ hg -R clone2 cat -r 3 clone2/.hglf/b | |
794 | c801c9cfe94400963fcb683246217d5db77f9a9a |
|
794 | c801c9cfe94400963fcb683246217d5db77f9a9a | |
795 | $ hg -R clone2 cat -r 4 clone2/.hglf/b |
|
795 | $ hg -R clone2 cat -r 4 clone2/.hglf/b | |
796 | 13f9ed0898e315bf59dc2973fec52037b6f441a2 |
|
796 | 13f9ed0898e315bf59dc2973fec52037b6f441a2 | |
797 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true |
|
797 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true | |
798 | comparing with $TESTTMP/issue3651/src |
|
798 | comparing with $TESTTMP/issue3651/src | |
799 | query 1; heads |
|
799 | query 1; heads | |
800 | searching for changes |
|
800 | searching for changes | |
801 | all remote heads known locally |
|
801 | all remote heads known locally | |
802 | 1:1acbe71ce432 |
|
802 | 1:1acbe71ce432 | |
803 | 2:6095d0695d70 |
|
803 | 2:6095d0695d70 | |
804 | 3:7983dce246cc |
|
804 | 3:7983dce246cc | |
805 | 4:233f12ada4ae |
|
805 | 4:233f12ada4ae | |
806 | 5:036794ea641c |
|
806 | 5:036794ea641c | |
807 | finding outgoing largefiles: 0/5 revisions (0.00%) |
|
807 | finding outgoing largefiles: 0/5 revisions (0.00%) | |
808 | finding outgoing largefiles: 1/5 revisions (20.00%) |
|
808 | finding outgoing largefiles: 1/5 revisions (20.00%) | |
809 | finding outgoing largefiles: 2/5 revisions (40.00%) |
|
809 | finding outgoing largefiles: 2/5 revisions (40.00%) | |
810 | finding outgoing largefiles: 3/5 revisions (60.00%) |
|
810 | finding outgoing largefiles: 3/5 revisions (60.00%) | |
811 | finding outgoing largefiles: 4/5 revisions (80.00%) |
|
811 | finding outgoing largefiles: 4/5 revisions (80.00%) | |
812 | largefiles to upload (3 entities): |
|
812 | largefiles to upload (3 entities): | |
813 | b |
|
813 | b | |
814 | 13f9ed0898e315bf59dc2973fec52037b6f441a2 |
|
814 | 13f9ed0898e315bf59dc2973fec52037b6f441a2 | |
815 | 89e6c98d92887913cadf06b2adb97f26cde4849b |
|
815 | 89e6c98d92887913cadf06b2adb97f26cde4849b | |
816 | c801c9cfe94400963fcb683246217d5db77f9a9a |
|
816 | c801c9cfe94400963fcb683246217d5db77f9a9a | |
817 | b1 |
|
817 | b1 | |
818 | 89e6c98d92887913cadf06b2adb97f26cde4849b |
|
818 | 89e6c98d92887913cadf06b2adb97f26cde4849b | |
819 | b2 |
|
819 | b2 | |
820 | 89e6c98d92887913cadf06b2adb97f26cde4849b |
|
820 | 89e6c98d92887913cadf06b2adb97f26cde4849b | |
821 |
|
821 | |||
822 |
|
822 | |||
823 | Pushing revision #1 causes uploading entity 89e6c98d9288, which is |
|
823 | Pushing revision #1 causes uploading entity 89e6c98d9288, which is | |
824 | shared also by largefiles b1, b2 in revision #2 and b in revision #5. |
|
824 | shared also by largefiles b1, b2 in revision #2 and b in revision #5. | |
825 |
|
825 | |||
826 | Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg |
|
826 | Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg | |
827 | summary" and "hg outgoing", even though files in outgoing revision #2 |
|
827 | summary" and "hg outgoing", even though files in outgoing revision #2 | |
828 | and #5 refer it. |
|
828 | and #5 refer it. | |
829 |
|
829 | |||
830 | $ hg -R clone2 push -r 1 -q |
|
830 | $ hg -R clone2 push -r 1 -q | |
831 | $ hg -R clone2 summary --large |
|
831 | $ hg -R clone2 summary --large | |
832 | parent: 5:036794ea641c tip |
|
832 | parent: 5:036794ea641c tip | |
833 | #5: refer existing largefile entity again |
|
833 | #5: refer existing largefile entity again | |
834 | branch: default |
|
834 | branch: default | |
835 | commit: (clean) |
|
835 | commit: (clean) | |
836 | update: (current) |
|
836 | update: (current) | |
837 | phases: 6 draft |
|
837 | phases: 6 draft | |
838 | largefiles: 2 entities for 1 files to upload |
|
838 | largefiles: 2 entities for 1 files to upload | |
839 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" |
|
839 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" | |
840 | comparing with $TESTTMP/issue3651/src |
|
840 | comparing with $TESTTMP/issue3651/src | |
841 | searching for changes |
|
841 | searching for changes | |
842 | 2:6095d0695d70 |
|
842 | 2:6095d0695d70 | |
843 | 3:7983dce246cc |
|
843 | 3:7983dce246cc | |
844 | 4:233f12ada4ae |
|
844 | 4:233f12ada4ae | |
845 | 5:036794ea641c |
|
845 | 5:036794ea641c | |
846 | largefiles to upload (2 entities): |
|
846 | largefiles to upload (2 entities): | |
847 | b |
|
847 | b | |
848 |
|
848 | |||
849 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true |
|
849 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug --config progress.debug=true | |
850 | comparing with $TESTTMP/issue3651/src |
|
850 | comparing with $TESTTMP/issue3651/src | |
851 | query 1; heads |
|
851 | query 1; heads | |
852 | searching for changes |
|
852 | searching for changes | |
853 | all remote heads known locally |
|
853 | all remote heads known locally | |
854 | 2:6095d0695d70 |
|
854 | 2:6095d0695d70 | |
855 | 3:7983dce246cc |
|
855 | 3:7983dce246cc | |
856 | 4:233f12ada4ae |
|
856 | 4:233f12ada4ae | |
857 | 5:036794ea641c |
|
857 | 5:036794ea641c | |
858 | finding outgoing largefiles: 0/4 revisions (0.00%) |
|
858 | finding outgoing largefiles: 0/4 revisions (0.00%) | |
859 | finding outgoing largefiles: 1/4 revisions (25.00%) |
|
859 | finding outgoing largefiles: 1/4 revisions (25.00%) | |
860 | finding outgoing largefiles: 2/4 revisions (50.00%) |
|
860 | finding outgoing largefiles: 2/4 revisions (50.00%) | |
861 | finding outgoing largefiles: 3/4 revisions (75.00%) |
|
861 | finding outgoing largefiles: 3/4 revisions (75.00%) | |
862 | largefiles to upload (2 entities): |
|
862 | largefiles to upload (2 entities): | |
863 | b |
|
863 | b | |
864 | 13f9ed0898e315bf59dc2973fec52037b6f441a2 |
|
864 | 13f9ed0898e315bf59dc2973fec52037b6f441a2 | |
865 | c801c9cfe94400963fcb683246217d5db77f9a9a |
|
865 | c801c9cfe94400963fcb683246217d5db77f9a9a | |
866 |
|
866 | |||
867 |
|
867 | |||
868 | $ cd .. |
|
868 | $ cd .. | |
869 |
|
869 | |||
870 | merge action 'd' for 'local renamed directory to d2/g' which has no filename |
|
870 | merge action 'd' for 'local renamed directory to d2/g' which has no filename | |
871 | ================================================================================== |
|
871 | ================================================================================== | |
872 |
|
872 | |||
873 | $ hg init merge-action |
|
873 | $ hg init merge-action | |
874 | $ cd merge-action |
|
874 | $ cd merge-action | |
875 | $ touch l |
|
875 | $ touch l | |
876 | $ hg add --large l |
|
876 | $ hg add --large l | |
877 | $ mkdir d1 |
|
877 | $ mkdir d1 | |
878 | $ touch d1/f |
|
878 | $ touch d1/f | |
879 | $ hg ci -Aqm0 |
|
879 | $ hg ci -Aqm0 | |
880 | Invoking status precommit hook |
|
880 | Invoking status precommit hook | |
881 | A d1/f |
|
881 | A d1/f | |
882 | A l |
|
882 | A l | |
883 | $ echo > d1/f |
|
883 | $ echo > d1/f | |
884 | $ touch d1/g |
|
884 | $ touch d1/g | |
885 | $ hg ci -Aqm1 |
|
885 | $ hg ci -Aqm1 | |
886 | Invoking status precommit hook |
|
886 | Invoking status precommit hook | |
887 | M d1/f |
|
887 | M d1/f | |
888 | A d1/g |
|
888 | A d1/g | |
889 | $ hg up -qr0 |
|
889 | $ hg up -qr0 | |
890 | $ hg mv d1 d2 |
|
890 | $ hg mv d1 d2 | |
891 | moving d1/f to d2/f |
|
891 | moving d1/f to d2/f | |
892 | $ hg ci -qm2 |
|
892 | $ hg ci -qm2 | |
893 | Invoking status precommit hook |
|
893 | Invoking status precommit hook | |
894 | A d2/f |
|
894 | A d2/f | |
895 | R d1/f |
|
895 | R d1/f | |
896 | $ hg merge |
|
896 | $ hg merge | |
897 | merging d2/f and d1/f to d2/f |
|
897 | merging d2/f and d1/f to d2/f | |
898 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
898 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
899 | (branch merge, don't forget to commit) |
|
899 | (branch merge, don't forget to commit) | |
900 | $ cd .. |
|
900 | $ cd .. | |
901 |
|
901 | |||
902 |
|
902 | |||
903 | Merge conflicts: |
|
903 | Merge conflicts: | |
904 | ===================== |
|
904 | ===================== | |
905 |
|
905 | |||
906 | $ hg init merge |
|
906 | $ hg init merge | |
907 | $ cd merge |
|
907 | $ cd merge | |
908 | $ echo 0 > f-different |
|
908 | $ echo 0 > f-different | |
909 | $ echo 0 > f-same |
|
909 | $ echo 0 > f-same | |
910 | $ echo 0 > f-unchanged-1 |
|
910 | $ echo 0 > f-unchanged-1 | |
911 | $ echo 0 > f-unchanged-2 |
|
911 | $ echo 0 > f-unchanged-2 | |
912 | $ hg add --large * |
|
912 | $ hg add --large * | |
913 | $ hg ci -m0 |
|
913 | $ hg ci -m0 | |
914 | Invoking status precommit hook |
|
914 | Invoking status precommit hook | |
915 | A f-different |
|
915 | A f-different | |
916 | A f-same |
|
916 | A f-same | |
917 | A f-unchanged-1 |
|
917 | A f-unchanged-1 | |
918 | A f-unchanged-2 |
|
918 | A f-unchanged-2 | |
919 | $ echo tmp1 > f-unchanged-1 |
|
919 | $ echo tmp1 > f-unchanged-1 | |
920 | $ echo tmp1 > f-unchanged-2 |
|
920 | $ echo tmp1 > f-unchanged-2 | |
921 | $ echo tmp1 > f-same |
|
921 | $ echo tmp1 > f-same | |
922 | $ hg ci -m1 |
|
922 | $ hg ci -m1 | |
923 | Invoking status precommit hook |
|
923 | Invoking status precommit hook | |
924 | M f-same |
|
924 | M f-same | |
925 | M f-unchanged-1 |
|
925 | M f-unchanged-1 | |
926 | M f-unchanged-2 |
|
926 | M f-unchanged-2 | |
927 | $ echo 2 > f-different |
|
927 | $ echo 2 > f-different | |
928 | $ echo 0 > f-unchanged-1 |
|
928 | $ echo 0 > f-unchanged-1 | |
929 | $ echo 1 > f-unchanged-2 |
|
929 | $ echo 1 > f-unchanged-2 | |
930 | $ echo 1 > f-same |
|
930 | $ echo 1 > f-same | |
931 | $ hg ci -m2 |
|
931 | $ hg ci -m2 | |
932 | Invoking status precommit hook |
|
932 | Invoking status precommit hook | |
933 | M f-different |
|
933 | M f-different | |
934 | M f-same |
|
934 | M f-same | |
935 | M f-unchanged-1 |
|
935 | M f-unchanged-1 | |
936 | M f-unchanged-2 |
|
936 | M f-unchanged-2 | |
937 | $ hg up -qr0 |
|
937 | $ hg up -qr0 | |
938 | $ echo tmp2 > f-unchanged-1 |
|
938 | $ echo tmp2 > f-unchanged-1 | |
939 | $ echo tmp2 > f-unchanged-2 |
|
939 | $ echo tmp2 > f-unchanged-2 | |
940 | $ echo tmp2 > f-same |
|
940 | $ echo tmp2 > f-same | |
941 | $ hg ci -m3 |
|
941 | $ hg ci -m3 | |
942 | Invoking status precommit hook |
|
942 | Invoking status precommit hook | |
943 | M f-same |
|
943 | M f-same | |
944 | M f-unchanged-1 |
|
944 | M f-unchanged-1 | |
945 | M f-unchanged-2 |
|
945 | M f-unchanged-2 | |
946 | created new head |
|
946 | created new head | |
947 | $ echo 1 > f-different |
|
947 | $ echo 1 > f-different | |
948 | $ echo 1 > f-unchanged-1 |
|
948 | $ echo 1 > f-unchanged-1 | |
949 | $ echo 0 > f-unchanged-2 |
|
949 | $ echo 0 > f-unchanged-2 | |
950 | $ echo 1 > f-same |
|
950 | $ echo 1 > f-same | |
951 | $ hg ci -m4 |
|
951 | $ hg ci -m4 | |
952 | Invoking status precommit hook |
|
952 | Invoking status precommit hook | |
953 | M f-different |
|
953 | M f-different | |
954 | M f-same |
|
954 | M f-same | |
955 | M f-unchanged-1 |
|
955 | M f-unchanged-1 | |
956 | M f-unchanged-2 |
|
956 | M f-unchanged-2 | |
957 | $ hg merge |
|
957 | $ hg merge | |
958 | largefile f-different has a merge conflict |
|
958 | largefile f-different has a merge conflict | |
959 | ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7 |
|
959 | ancestor was 09d2af8dd22201dd8d48e5dcfcaed281ff9422c7 | |
960 | keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or |
|
960 | you can keep (l)ocal e5fa44f2b31c1fb553b6021e7360d07d5d91ff5e or take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a. | |
961 | take (o)ther 7448d8798a4380162d4b56f9b452e2f6f9e24e7a? l |
|
961 | what do you want to do? l | |
962 | getting changed largefiles |
|
962 | getting changed largefiles | |
963 | 1 largefiles updated, 0 removed |
|
963 | 1 largefiles updated, 0 removed | |
964 | 0 files updated, 4 files merged, 0 files removed, 0 files unresolved |
|
964 | 0 files updated, 4 files merged, 0 files removed, 0 files unresolved | |
965 | (branch merge, don't forget to commit) |
|
965 | (branch merge, don't forget to commit) | |
966 | $ cat f-different |
|
966 | $ cat f-different | |
967 | 1 |
|
967 | 1 | |
968 | $ cat f-same |
|
968 | $ cat f-same | |
969 | 1 |
|
969 | 1 | |
970 | $ cat f-unchanged-1 |
|
970 | $ cat f-unchanged-1 | |
971 | 1 |
|
971 | 1 | |
972 | $ cat f-unchanged-2 |
|
972 | $ cat f-unchanged-2 | |
973 | 1 |
|
973 | 1 | |
974 | $ cd .. |
|
974 | $ cd .. | |
975 |
|
975 | |||
976 | Test largefile insulation (do not enabled a side effect |
|
976 | Test largefile insulation (do not enabled a side effect | |
977 | ======================================================== |
|
977 | ======================================================== | |
978 |
|
978 | |||
979 | Check whether "largefiles" feature is supported only in repositories |
|
979 | Check whether "largefiles" feature is supported only in repositories | |
980 | enabling largefiles extension. |
|
980 | enabling largefiles extension. | |
981 |
|
981 | |||
982 | $ mkdir individualenabling |
|
982 | $ mkdir individualenabling | |
983 | $ cd individualenabling |
|
983 | $ cd individualenabling | |
984 |
|
984 | |||
985 | $ hg init enabledlocally |
|
985 | $ hg init enabledlocally | |
986 | $ echo large > enabledlocally/large |
|
986 | $ echo large > enabledlocally/large | |
987 | $ hg -R enabledlocally add --large enabledlocally/large |
|
987 | $ hg -R enabledlocally add --large enabledlocally/large | |
988 | $ hg -R enabledlocally commit -m '#0' |
|
988 | $ hg -R enabledlocally commit -m '#0' | |
989 | Invoking status precommit hook |
|
989 | Invoking status precommit hook | |
990 | A large |
|
990 | A large | |
991 |
|
991 | |||
992 | $ hg init notenabledlocally |
|
992 | $ hg init notenabledlocally | |
993 | $ echo large > notenabledlocally/large |
|
993 | $ echo large > notenabledlocally/large | |
994 | $ hg -R notenabledlocally add --large notenabledlocally/large |
|
994 | $ hg -R notenabledlocally add --large notenabledlocally/large | |
995 | $ hg -R notenabledlocally commit -m '#0' |
|
995 | $ hg -R notenabledlocally commit -m '#0' | |
996 | Invoking status precommit hook |
|
996 | Invoking status precommit hook | |
997 | A large |
|
997 | A large | |
998 |
|
998 | |||
999 | $ cat >> $HGRCPATH <<EOF |
|
999 | $ cat >> $HGRCPATH <<EOF | |
1000 | > [extensions] |
|
1000 | > [extensions] | |
1001 | > # disable globally |
|
1001 | > # disable globally | |
1002 | > largefiles=! |
|
1002 | > largefiles=! | |
1003 | > EOF |
|
1003 | > EOF | |
1004 | $ cat >> enabledlocally/.hg/hgrc <<EOF |
|
1004 | $ cat >> enabledlocally/.hg/hgrc <<EOF | |
1005 | > [extensions] |
|
1005 | > [extensions] | |
1006 | > # enable locally |
|
1006 | > # enable locally | |
1007 | > largefiles= |
|
1007 | > largefiles= | |
1008 | > EOF |
|
1008 | > EOF | |
1009 | $ hg -R enabledlocally root |
|
1009 | $ hg -R enabledlocally root | |
1010 | $TESTTMP/individualenabling/enabledlocally |
|
1010 | $TESTTMP/individualenabling/enabledlocally | |
1011 | $ hg -R notenabledlocally root |
|
1011 | $ hg -R notenabledlocally root | |
1012 | abort: repository requires features unknown to this Mercurial: largefiles! |
|
1012 | abort: repository requires features unknown to this Mercurial: largefiles! | |
1013 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
1013 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
1014 | [255] |
|
1014 | [255] | |
1015 |
|
1015 | |||
1016 | $ hg init push-dst |
|
1016 | $ hg init push-dst | |
1017 | $ hg -R enabledlocally push push-dst |
|
1017 | $ hg -R enabledlocally push push-dst | |
1018 | pushing to push-dst |
|
1018 | pushing to push-dst | |
1019 | abort: required features are not supported in the destination: largefiles |
|
1019 | abort: required features are not supported in the destination: largefiles | |
1020 | [255] |
|
1020 | [255] | |
1021 |
|
1021 | |||
1022 | $ hg init pull-src |
|
1022 | $ hg init pull-src | |
1023 | $ hg -R pull-src pull enabledlocally |
|
1023 | $ hg -R pull-src pull enabledlocally | |
1024 | pulling from enabledlocally |
|
1024 | pulling from enabledlocally | |
1025 | abort: required features are not supported in the destination: largefiles |
|
1025 | abort: required features are not supported in the destination: largefiles | |
1026 | [255] |
|
1026 | [255] | |
1027 |
|
1027 | |||
1028 | $ hg clone enabledlocally clone-dst |
|
1028 | $ hg clone enabledlocally clone-dst | |
1029 | abort: repository requires features unknown to this Mercurial: largefiles! |
|
1029 | abort: repository requires features unknown to this Mercurial: largefiles! | |
1030 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
1030 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
1031 | [255] |
|
1031 | [255] | |
1032 | $ test -d clone-dst |
|
1032 | $ test -d clone-dst | |
1033 | [1] |
|
1033 | [1] | |
1034 | $ hg clone --pull enabledlocally clone-pull-dst |
|
1034 | $ hg clone --pull enabledlocally clone-pull-dst | |
1035 | abort: required features are not supported in the destination: largefiles |
|
1035 | abort: required features are not supported in the destination: largefiles | |
1036 | [255] |
|
1036 | [255] | |
1037 | $ test -d clone-pull-dst |
|
1037 | $ test -d clone-pull-dst | |
1038 | [1] |
|
1038 | [1] | |
1039 |
|
1039 | |||
1040 | #if serve |
|
1040 | #if serve | |
1041 |
|
1041 | |||
1042 | Test largefiles specific peer setup, when largefiles is enabled |
|
1042 | Test largefiles specific peer setup, when largefiles is enabled | |
1043 | locally (issue4109) |
|
1043 | locally (issue4109) | |
1044 |
|
1044 | |||
1045 | $ hg showconfig extensions | grep largefiles |
|
1045 | $ hg showconfig extensions | grep largefiles | |
1046 | extensions.largefiles=! |
|
1046 | extensions.largefiles=! | |
1047 | $ mkdir -p $TESTTMP/individualenabling/usercache |
|
1047 | $ mkdir -p $TESTTMP/individualenabling/usercache | |
1048 |
|
1048 | |||
1049 | $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid |
|
1049 | $ hg serve -R enabledlocally -d -p $HGPORT --pid-file hg.pid | |
1050 | $ cat hg.pid >> $DAEMON_PIDS |
|
1050 | $ cat hg.pid >> $DAEMON_PIDS | |
1051 |
|
1051 | |||
1052 | $ hg init pull-dst |
|
1052 | $ hg init pull-dst | |
1053 | $ cat > pull-dst/.hg/hgrc <<EOF |
|
1053 | $ cat > pull-dst/.hg/hgrc <<EOF | |
1054 | > [extensions] |
|
1054 | > [extensions] | |
1055 | > # enable locally |
|
1055 | > # enable locally | |
1056 | > largefiles= |
|
1056 | > largefiles= | |
1057 | > [largefiles] |
|
1057 | > [largefiles] | |
1058 | > # ignore system cache to force largefiles specific wire proto access |
|
1058 | > # ignore system cache to force largefiles specific wire proto access | |
1059 | > usercache=$TESTTMP/individualenabling/usercache |
|
1059 | > usercache=$TESTTMP/individualenabling/usercache | |
1060 | > EOF |
|
1060 | > EOF | |
1061 | $ hg -R pull-dst -q pull -u http://localhost:$HGPORT |
|
1061 | $ hg -R pull-dst -q pull -u http://localhost:$HGPORT | |
1062 |
|
1062 | |||
1063 | $ killdaemons.py |
|
1063 | $ killdaemons.py | |
1064 | #endif |
|
1064 | #endif | |
1065 |
|
1065 | |||
1066 | Test overridden functions work correctly even for repos disabling |
|
1066 | Test overridden functions work correctly even for repos disabling | |
1067 | largefiles (issue4547) |
|
1067 | largefiles (issue4547) | |
1068 |
|
1068 | |||
1069 | $ hg showconfig extensions | grep largefiles |
|
1069 | $ hg showconfig extensions | grep largefiles | |
1070 | extensions.largefiles=! |
|
1070 | extensions.largefiles=! | |
1071 |
|
1071 | |||
1072 | (test updating implied by clone) |
|
1072 | (test updating implied by clone) | |
1073 |
|
1073 | |||
1074 | $ hg init enabled-but-no-largefiles |
|
1074 | $ hg init enabled-but-no-largefiles | |
1075 | $ echo normal1 > enabled-but-no-largefiles/normal1 |
|
1075 | $ echo normal1 > enabled-but-no-largefiles/normal1 | |
1076 | $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal1 |
|
1076 | $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal1 | |
1077 | $ hg -R enabled-but-no-largefiles commit -m '#0@enabled-but-no-largefiles' |
|
1077 | $ hg -R enabled-but-no-largefiles commit -m '#0@enabled-but-no-largefiles' | |
1078 | Invoking status precommit hook |
|
1078 | Invoking status precommit hook | |
1079 | A normal1 |
|
1079 | A normal1 | |
1080 | $ cat >> enabled-but-no-largefiles/.hg/hgrc <<EOF |
|
1080 | $ cat >> enabled-but-no-largefiles/.hg/hgrc <<EOF | |
1081 | > [extensions] |
|
1081 | > [extensions] | |
1082 | > # enable locally |
|
1082 | > # enable locally | |
1083 | > largefiles= |
|
1083 | > largefiles= | |
1084 | > EOF |
|
1084 | > EOF | |
1085 | $ hg clone -q enabled-but-no-largefiles no-largefiles |
|
1085 | $ hg clone -q enabled-but-no-largefiles no-largefiles | |
1086 |
|
1086 | |||
1087 | $ echo normal2 > enabled-but-no-largefiles/normal2 |
|
1087 | $ echo normal2 > enabled-but-no-largefiles/normal2 | |
1088 | $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2 |
|
1088 | $ hg -R enabled-but-no-largefiles add enabled-but-no-largefiles/normal2 | |
1089 | $ hg -R enabled-but-no-largefiles commit -m '#1@enabled-but-no-largefiles' |
|
1089 | $ hg -R enabled-but-no-largefiles commit -m '#1@enabled-but-no-largefiles' | |
1090 | Invoking status precommit hook |
|
1090 | Invoking status precommit hook | |
1091 | A normal2 |
|
1091 | A normal2 | |
1092 |
|
1092 | |||
1093 | $ echo normal3 > no-largefiles/normal3 |
|
1093 | $ echo normal3 > no-largefiles/normal3 | |
1094 | $ hg -R no-largefiles add no-largefiles/normal3 |
|
1094 | $ hg -R no-largefiles add no-largefiles/normal3 | |
1095 | $ hg -R no-largefiles commit -m '#1@no-largefiles' |
|
1095 | $ hg -R no-largefiles commit -m '#1@no-largefiles' | |
1096 | Invoking status precommit hook |
|
1096 | Invoking status precommit hook | |
1097 | A normal3 |
|
1097 | A normal3 | |
1098 |
|
1098 | |||
1099 | $ hg -R no-largefiles -q pull --rebase |
|
1099 | $ hg -R no-largefiles -q pull --rebase | |
1100 | Invoking status precommit hook |
|
1100 | Invoking status precommit hook | |
1101 | A normal3 |
|
1101 | A normal3 | |
1102 |
|
1102 | |||
1103 | (test reverting) |
|
1103 | (test reverting) | |
1104 |
|
1104 | |||
1105 | $ hg init subrepo-root |
|
1105 | $ hg init subrepo-root | |
1106 | $ cat >> subrepo-root/.hg/hgrc <<EOF |
|
1106 | $ cat >> subrepo-root/.hg/hgrc <<EOF | |
1107 | > [extensions] |
|
1107 | > [extensions] | |
1108 | > # enable locally |
|
1108 | > # enable locally | |
1109 | > largefiles= |
|
1109 | > largefiles= | |
1110 | > EOF |
|
1110 | > EOF | |
1111 | $ echo large > subrepo-root/large |
|
1111 | $ echo large > subrepo-root/large | |
1112 | $ mkdir -p subrepo-root/dir/subdir |
|
1112 | $ mkdir -p subrepo-root/dir/subdir | |
1113 | $ echo large2 > subrepo-root/dir/subdir/large.bin |
|
1113 | $ echo large2 > subrepo-root/dir/subdir/large.bin | |
1114 | $ hg -R subrepo-root add --large subrepo-root/large subrepo-root/dir/subdir/large.bin |
|
1114 | $ hg -R subrepo-root add --large subrepo-root/large subrepo-root/dir/subdir/large.bin | |
1115 | $ hg clone -q no-largefiles subrepo-root/no-largefiles |
|
1115 | $ hg clone -q no-largefiles subrepo-root/no-largefiles | |
1116 | $ cat > subrepo-root/.hgsub <<EOF |
|
1116 | $ cat > subrepo-root/.hgsub <<EOF | |
1117 | > no-largefiles = no-largefiles |
|
1117 | > no-largefiles = no-largefiles | |
1118 | > EOF |
|
1118 | > EOF | |
1119 | $ hg -R subrepo-root add subrepo-root/.hgsub |
|
1119 | $ hg -R subrepo-root add subrepo-root/.hgsub | |
1120 | $ hg -R subrepo-root commit -m '#0' |
|
1120 | $ hg -R subrepo-root commit -m '#0' | |
1121 | Invoking status precommit hook |
|
1121 | Invoking status precommit hook | |
1122 | A .hgsub |
|
1122 | A .hgsub | |
1123 | A dir/subdir/large.bin |
|
1123 | A dir/subdir/large.bin | |
1124 | A large |
|
1124 | A large | |
1125 | ? .hgsubstate |
|
1125 | ? .hgsubstate | |
1126 | $ echo dirty >> subrepo-root/large |
|
1126 | $ echo dirty >> subrepo-root/large | |
1127 | $ echo dirty >> subrepo-root/no-largefiles/normal1 |
|
1127 | $ echo dirty >> subrepo-root/no-largefiles/normal1 | |
1128 | $ hg -R subrepo-root status -S |
|
1128 | $ hg -R subrepo-root status -S | |
1129 | M large |
|
1129 | M large | |
1130 | M no-largefiles/normal1 |
|
1130 | M no-largefiles/normal1 | |
1131 | $ hg -R subrepo-root extdiff -p echo -S --config extensions.extdiff= |
|
1131 | $ hg -R subrepo-root extdiff -p echo -S --config extensions.extdiff= | |
1132 | "*\\no-largefiles\\normal1" "*\\no-largefiles\\normal1" (glob) (windows !) |
|
1132 | "*\\no-largefiles\\normal1" "*\\no-largefiles\\normal1" (glob) (windows !) | |
1133 | */no-largefiles/normal1 */no-largefiles/normal1 (glob) (no-windows !) |
|
1133 | */no-largefiles/normal1 */no-largefiles/normal1 (glob) (no-windows !) | |
1134 | [1] |
|
1134 | [1] | |
1135 | $ hg -R subrepo-root revert --all |
|
1135 | $ hg -R subrepo-root revert --all | |
1136 | reverting subrepo-root/.hglf/large |
|
1136 | reverting subrepo-root/.hglf/large | |
1137 | reverting subrepo no-largefiles |
|
1137 | reverting subrepo no-largefiles | |
1138 | reverting subrepo-root/no-largefiles/normal1 |
|
1138 | reverting subrepo-root/no-largefiles/normal1 | |
1139 |
|
1139 | |||
1140 | Move (and then undo) a directory move with only largefiles. |
|
1140 | Move (and then undo) a directory move with only largefiles. | |
1141 |
|
1141 | |||
1142 | $ cd subrepo-root |
|
1142 | $ cd subrepo-root | |
1143 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* |
|
1143 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* | |
1144 | .hglf/ |
|
1144 | .hglf/ | |
1145 | .hglf/dir/ |
|
1145 | .hglf/dir/ | |
1146 | .hglf/dir/subdir/ |
|
1146 | .hglf/dir/subdir/ | |
1147 | .hglf/dir/subdir/large.bin |
|
1147 | .hglf/dir/subdir/large.bin | |
1148 | .hglf/large |
|
1148 | .hglf/large | |
1149 | dir/ |
|
1149 | dir/ | |
1150 | dir/subdir/ |
|
1150 | dir/subdir/ | |
1151 | dir/subdir/large.bin |
|
1151 | dir/subdir/large.bin | |
1152 | large |
|
1152 | large | |
1153 | large.orig |
|
1153 | large.orig | |
1154 |
|
1154 | |||
1155 | $ hg mv dir/subdir dir/subdir2 |
|
1155 | $ hg mv dir/subdir dir/subdir2 | |
1156 | moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin |
|
1156 | moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin | |
1157 |
|
1157 | |||
1158 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* |
|
1158 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* | |
1159 | .hglf/ |
|
1159 | .hglf/ | |
1160 | .hglf/dir/ |
|
1160 | .hglf/dir/ | |
1161 | .hglf/dir/subdir2/ |
|
1161 | .hglf/dir/subdir2/ | |
1162 | .hglf/dir/subdir2/large.bin |
|
1162 | .hglf/dir/subdir2/large.bin | |
1163 | .hglf/large |
|
1163 | .hglf/large | |
1164 | dir/ |
|
1164 | dir/ | |
1165 | dir/subdir2/ |
|
1165 | dir/subdir2/ | |
1166 | dir/subdir2/large.bin |
|
1166 | dir/subdir2/large.bin | |
1167 | large |
|
1167 | large | |
1168 | large.orig |
|
1168 | large.orig | |
1169 | $ hg status -C |
|
1169 | $ hg status -C | |
1170 | A dir/subdir2/large.bin |
|
1170 | A dir/subdir2/large.bin | |
1171 | dir/subdir/large.bin |
|
1171 | dir/subdir/large.bin | |
1172 | R dir/subdir/large.bin |
|
1172 | R dir/subdir/large.bin | |
1173 | ? large.orig |
|
1173 | ? large.orig | |
1174 |
|
1174 | |||
1175 | $ echo 'modified' > dir/subdir2/large.bin |
|
1175 | $ echo 'modified' > dir/subdir2/large.bin | |
1176 | $ hg status -C |
|
1176 | $ hg status -C | |
1177 | A dir/subdir2/large.bin |
|
1177 | A dir/subdir2/large.bin | |
1178 | dir/subdir/large.bin |
|
1178 | dir/subdir/large.bin | |
1179 | R dir/subdir/large.bin |
|
1179 | R dir/subdir/large.bin | |
1180 | ? large.orig |
|
1180 | ? large.orig | |
1181 |
|
1181 | |||
1182 | $ hg revert --all |
|
1182 | $ hg revert --all | |
1183 | forgetting .hglf/dir/subdir2/large.bin |
|
1183 | forgetting .hglf/dir/subdir2/large.bin | |
1184 | undeleting .hglf/dir/subdir/large.bin |
|
1184 | undeleting .hglf/dir/subdir/large.bin | |
1185 | reverting subrepo no-largefiles |
|
1185 | reverting subrepo no-largefiles | |
1186 |
|
1186 | |||
1187 | $ hg status -C |
|
1187 | $ hg status -C | |
1188 | ? dir/subdir2/large.bin |
|
1188 | ? dir/subdir2/large.bin | |
1189 | ? large.orig |
|
1189 | ? large.orig | |
1190 |
|
1190 | |||
1191 | The content of the forgotten file shouldn't be clobbered |
|
1191 | The content of the forgotten file shouldn't be clobbered | |
1192 |
|
1192 | |||
1193 | $ cat dir/subdir2/large.bin |
|
1193 | $ cat dir/subdir2/large.bin | |
1194 | modified |
|
1194 | modified | |
1195 |
|
1195 | |||
1196 | The standin for subdir2 should be deleted, not just dropped |
|
1196 | The standin for subdir2 should be deleted, not just dropped | |
1197 |
|
1197 | |||
1198 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* |
|
1198 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* | |
1199 | .hglf/ |
|
1199 | .hglf/ | |
1200 | .hglf/dir/ |
|
1200 | .hglf/dir/ | |
1201 | .hglf/dir/subdir/ |
|
1201 | .hglf/dir/subdir/ | |
1202 | .hglf/dir/subdir/large.bin |
|
1202 | .hglf/dir/subdir/large.bin | |
1203 | .hglf/large |
|
1203 | .hglf/large | |
1204 | dir/ |
|
1204 | dir/ | |
1205 | dir/subdir/ |
|
1205 | dir/subdir/ | |
1206 | dir/subdir/large.bin |
|
1206 | dir/subdir/large.bin | |
1207 | dir/subdir2/ |
|
1207 | dir/subdir2/ | |
1208 | dir/subdir2/large.bin |
|
1208 | dir/subdir2/large.bin | |
1209 | large |
|
1209 | large | |
1210 | large.orig |
|
1210 | large.orig | |
1211 |
|
1211 | |||
1212 | $ rm -r dir/subdir2 |
|
1212 | $ rm -r dir/subdir2 | |
1213 |
|
1213 | |||
1214 | 'subdir' should not be in the destination. It would be if the subdir2 directory |
|
1214 | 'subdir' should not be in the destination. It would be if the subdir2 directory | |
1215 | existed under .hglf/. |
|
1215 | existed under .hglf/. | |
1216 | $ hg mv dir/subdir dir/subdir2 |
|
1216 | $ hg mv dir/subdir dir/subdir2 | |
1217 | moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin |
|
1217 | moving .hglf/dir/subdir/large.bin to .hglf/dir/subdir2/large.bin | |
1218 |
|
1218 | |||
1219 | $ hg status -C |
|
1219 | $ hg status -C | |
1220 | A dir/subdir2/large.bin |
|
1220 | A dir/subdir2/large.bin | |
1221 | dir/subdir/large.bin |
|
1221 | dir/subdir/large.bin | |
1222 | R dir/subdir/large.bin |
|
1222 | R dir/subdir/large.bin | |
1223 | ? large.orig |
|
1223 | ? large.orig | |
1224 |
|
1224 | |||
1225 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* |
|
1225 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* | |
1226 | .hglf/ |
|
1226 | .hglf/ | |
1227 | .hglf/dir/ |
|
1227 | .hglf/dir/ | |
1228 | .hglf/dir/subdir2/ |
|
1228 | .hglf/dir/subdir2/ | |
1229 | .hglf/dir/subdir2/large.bin |
|
1229 | .hglf/dir/subdir2/large.bin | |
1230 | .hglf/large |
|
1230 | .hglf/large | |
1231 | dir/ |
|
1231 | dir/ | |
1232 | dir/subdir2/ |
|
1232 | dir/subdir2/ | |
1233 | dir/subdir2/large.bin |
|
1233 | dir/subdir2/large.bin | |
1234 | large |
|
1234 | large | |
1235 | large.orig |
|
1235 | large.orig | |
1236 |
|
1236 | |||
1237 | Start from scratch, and rename something other than the final path component. |
|
1237 | Start from scratch, and rename something other than the final path component. | |
1238 |
|
1238 | |||
1239 | $ hg up -qC . |
|
1239 | $ hg up -qC . | |
1240 | $ hg --config extensions.purge= purge |
|
1240 | $ hg --config extensions.purge= purge | |
1241 |
|
1241 | |||
1242 | $ hg mv dir/subdir dir2/subdir |
|
1242 | $ hg mv dir/subdir dir2/subdir | |
1243 | moving .hglf/dir/subdir/large.bin to .hglf/dir2/subdir/large.bin |
|
1243 | moving .hglf/dir/subdir/large.bin to .hglf/dir2/subdir/large.bin | |
1244 |
|
1244 | |||
1245 | $ hg status -C |
|
1245 | $ hg status -C | |
1246 | A dir2/subdir/large.bin |
|
1246 | A dir2/subdir/large.bin | |
1247 | dir/subdir/large.bin |
|
1247 | dir/subdir/large.bin | |
1248 | R dir/subdir/large.bin |
|
1248 | R dir/subdir/large.bin | |
1249 |
|
1249 | |||
1250 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* |
|
1250 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* | |
1251 | .hglf/ |
|
1251 | .hglf/ | |
1252 | .hglf/dir2/ |
|
1252 | .hglf/dir2/ | |
1253 | .hglf/dir2/subdir/ |
|
1253 | .hglf/dir2/subdir/ | |
1254 | .hglf/dir2/subdir/large.bin |
|
1254 | .hglf/dir2/subdir/large.bin | |
1255 | .hglf/large |
|
1255 | .hglf/large | |
1256 | dir2/ |
|
1256 | dir2/ | |
1257 | dir2/subdir/ |
|
1257 | dir2/subdir/ | |
1258 | dir2/subdir/large.bin |
|
1258 | dir2/subdir/large.bin | |
1259 | large |
|
1259 | large | |
1260 |
|
1260 | |||
1261 | $ hg revert --all |
|
1261 | $ hg revert --all | |
1262 | forgetting .hglf/dir2/subdir/large.bin |
|
1262 | forgetting .hglf/dir2/subdir/large.bin | |
1263 | undeleting .hglf/dir/subdir/large.bin |
|
1263 | undeleting .hglf/dir/subdir/large.bin | |
1264 | reverting subrepo no-largefiles |
|
1264 | reverting subrepo no-largefiles | |
1265 |
|
1265 | |||
1266 | $ hg status -C |
|
1266 | $ hg status -C | |
1267 | ? dir2/subdir/large.bin |
|
1267 | ? dir2/subdir/large.bin | |
1268 |
|
1268 | |||
1269 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* |
|
1269 | $ "$PYTHON" $TESTDIR/list-tree.py .hglf dir* large* | |
1270 | .hglf/ |
|
1270 | .hglf/ | |
1271 | .hglf/dir/ |
|
1271 | .hglf/dir/ | |
1272 | .hglf/dir/subdir/ |
|
1272 | .hglf/dir/subdir/ | |
1273 | .hglf/dir/subdir/large.bin |
|
1273 | .hglf/dir/subdir/large.bin | |
1274 | .hglf/large |
|
1274 | .hglf/large | |
1275 | dir/ |
|
1275 | dir/ | |
1276 | dir/subdir/ |
|
1276 | dir/subdir/ | |
1277 | dir/subdir/large.bin |
|
1277 | dir/subdir/large.bin | |
1278 | dir2/ |
|
1278 | dir2/ | |
1279 | dir2/subdir/ |
|
1279 | dir2/subdir/ | |
1280 | dir2/subdir/large.bin |
|
1280 | dir2/subdir/large.bin | |
1281 | large |
|
1281 | large | |
1282 |
|
1282 | |||
1283 | $ cd ../.. |
|
1283 | $ cd ../.. | |
1284 |
|
1284 | |||
1285 | Test "pull --rebase" when rebase is enabled before largefiles (issue3861) |
|
1285 | Test "pull --rebase" when rebase is enabled before largefiles (issue3861) | |
1286 | ========================================================================= |
|
1286 | ========================================================================= | |
1287 |
|
1287 | |||
1288 | $ hg showconfig extensions | grep largefiles |
|
1288 | $ hg showconfig extensions | grep largefiles | |
1289 | extensions.largefiles=! |
|
1289 | extensions.largefiles=! | |
1290 |
|
1290 | |||
1291 | $ mkdir issue3861 |
|
1291 | $ mkdir issue3861 | |
1292 | $ cd issue3861 |
|
1292 | $ cd issue3861 | |
1293 | $ hg init src |
|
1293 | $ hg init src | |
1294 | $ hg clone -q src dst |
|
1294 | $ hg clone -q src dst | |
1295 | $ echo a > src/a |
|
1295 | $ echo a > src/a | |
1296 | $ hg -R src commit -Aqm "#0" |
|
1296 | $ hg -R src commit -Aqm "#0" | |
1297 | Invoking status precommit hook |
|
1297 | Invoking status precommit hook | |
1298 | A a |
|
1298 | A a | |
1299 |
|
1299 | |||
1300 | $ cat >> dst/.hg/hgrc <<EOF |
|
1300 | $ cat >> dst/.hg/hgrc <<EOF | |
1301 | > [extensions] |
|
1301 | > [extensions] | |
1302 | > largefiles= |
|
1302 | > largefiles= | |
1303 | > EOF |
|
1303 | > EOF | |
1304 | $ hg -R dst pull --rebase |
|
1304 | $ hg -R dst pull --rebase | |
1305 | pulling from $TESTTMP/issue3861/src |
|
1305 | pulling from $TESTTMP/issue3861/src | |
1306 | requesting all changes |
|
1306 | requesting all changes | |
1307 | adding changesets |
|
1307 | adding changesets | |
1308 | adding manifests |
|
1308 | adding manifests | |
1309 | adding file changes |
|
1309 | adding file changes | |
1310 | added 1 changesets with 1 changes to 1 files |
|
1310 | added 1 changesets with 1 changes to 1 files | |
1311 | new changesets bf5e395ced2c (1 drafts) |
|
1311 | new changesets bf5e395ced2c (1 drafts) | |
1312 | nothing to rebase - updating instead |
|
1312 | nothing to rebase - updating instead | |
1313 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1313 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1314 |
|
1314 | |||
1315 | $ cd .. |
|
1315 | $ cd .. |
@@ -1,795 +1,795 b'' | |||||
1 | #require no-reposimplestore |
|
1 | #require no-reposimplestore | |
2 |
|
2 | |||
3 | This file focuses mainly on updating largefiles in the working |
|
3 | This file focuses mainly on updating largefiles in the working | |
4 | directory (and ".hg/largefiles/dirstate") |
|
4 | directory (and ".hg/largefiles/dirstate") | |
5 |
|
5 | |||
6 | $ cat >> $HGRCPATH <<EOF |
|
6 | $ cat >> $HGRCPATH <<EOF | |
7 | > [ui] |
|
7 | > [ui] | |
8 | > merge = internal:merge |
|
8 | > merge = internal:merge | |
9 | > [extensions] |
|
9 | > [extensions] | |
10 | > largefiles = |
|
10 | > largefiles = | |
11 | > [extdiff] |
|
11 | > [extdiff] | |
12 | > # for portability: |
|
12 | > # for portability: | |
13 | > pdiff = sh "$RUNTESTDIR/pdiff" |
|
13 | > pdiff = sh "$RUNTESTDIR/pdiff" | |
14 | > EOF |
|
14 | > EOF | |
15 |
|
15 | |||
16 | $ hg init repo |
|
16 | $ hg init repo | |
17 | $ cd repo |
|
17 | $ cd repo | |
18 |
|
18 | |||
19 | $ echo large1 > large1 |
|
19 | $ echo large1 > large1 | |
20 | $ echo large2 > large2 |
|
20 | $ echo large2 > large2 | |
21 | $ hg add --large large1 large2 |
|
21 | $ hg add --large large1 large2 | |
22 | $ echo normal1 > normal1 |
|
22 | $ echo normal1 > normal1 | |
23 | $ hg add normal1 |
|
23 | $ hg add normal1 | |
24 | $ hg commit -m '#0' |
|
24 | $ hg commit -m '#0' | |
25 | $ echo 'large1 in #1' > large1 |
|
25 | $ echo 'large1 in #1' > large1 | |
26 | $ echo 'normal1 in #1' > normal1 |
|
26 | $ echo 'normal1 in #1' > normal1 | |
27 | $ hg commit -m '#1' |
|
27 | $ hg commit -m '#1' | |
28 | $ hg pdiff -r '.^' --config extensions.extdiff= |
|
28 | $ hg pdiff -r '.^' --config extensions.extdiff= | |
29 | diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1 |
|
29 | diff -Nru repo.0d9d9b8dc9a3/.hglf/large1 repo/.hglf/large1 | |
30 | --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob) |
|
30 | --- repo.0d9d9b8dc9a3/.hglf/large1 * (glob) | |
31 | +++ repo/.hglf/large1 * (glob) |
|
31 | +++ repo/.hglf/large1 * (glob) | |
32 | @@ -1* +1* @@ (glob) |
|
32 | @@ -1* +1* @@ (glob) | |
33 | -4669e532d5b2c093a78eca010077e708a071bb64 |
|
33 | -4669e532d5b2c093a78eca010077e708a071bb64 | |
34 | +58e24f733a964da346e2407a2bee99d9001184f5 |
|
34 | +58e24f733a964da346e2407a2bee99d9001184f5 | |
35 | diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1 |
|
35 | diff -Nru repo.0d9d9b8dc9a3/normal1 repo/normal1 | |
36 | --- repo.0d9d9b8dc9a3/normal1 * (glob) |
|
36 | --- repo.0d9d9b8dc9a3/normal1 * (glob) | |
37 | +++ repo/normal1 * (glob) |
|
37 | +++ repo/normal1 * (glob) | |
38 | @@ -1* +1* @@ (glob) |
|
38 | @@ -1* +1* @@ (glob) | |
39 | -normal1 |
|
39 | -normal1 | |
40 | +normal1 in #1 |
|
40 | +normal1 in #1 | |
41 | [1] |
|
41 | [1] | |
42 | $ hg update -q -C 0 |
|
42 | $ hg update -q -C 0 | |
43 | $ echo 'large2 in #2' > large2 |
|
43 | $ echo 'large2 in #2' > large2 | |
44 | $ hg commit -m '#2' |
|
44 | $ hg commit -m '#2' | |
45 | created new head |
|
45 | created new head | |
46 |
|
46 | |||
47 | Test that update also updates the lfdirstate of 'unsure' largefiles after |
|
47 | Test that update also updates the lfdirstate of 'unsure' largefiles after | |
48 | hashing them: |
|
48 | hashing them: | |
49 |
|
49 | |||
50 | The previous operations will usually have left us with largefiles with a mtime |
|
50 | The previous operations will usually have left us with largefiles with a mtime | |
51 | within the same second as the dirstate was written. |
|
51 | within the same second as the dirstate was written. | |
52 | The lfdirstate entries will thus have been written with an invalidated/unset |
|
52 | The lfdirstate entries will thus have been written with an invalidated/unset | |
53 | mtime to make sure further changes within the same second is detected. |
|
53 | mtime to make sure further changes within the same second is detected. | |
54 | We will however occasionally be "lucky" and get a tick between writing |
|
54 | We will however occasionally be "lucky" and get a tick between writing | |
55 | largefiles and writing dirstate so we get valid lfdirstate timestamps. The |
|
55 | largefiles and writing dirstate so we get valid lfdirstate timestamps. The | |
56 | following verification is thus disabled but can be verified manually. |
|
56 | following verification is thus disabled but can be verified manually. | |
57 |
|
57 | |||
58 | #if false |
|
58 | #if false | |
59 | $ hg debugdirstate --large --nodate |
|
59 | $ hg debugdirstate --large --nodate | |
60 | n 644 7 unset large1 |
|
60 | n 644 7 unset large1 | |
61 | n 644 13 unset large2 |
|
61 | n 644 13 unset large2 | |
62 | #endif |
|
62 | #endif | |
63 |
|
63 | |||
64 | Wait to make sure we get a tick so the mtime of the largefiles become valid. |
|
64 | Wait to make sure we get a tick so the mtime of the largefiles become valid. | |
65 |
|
65 | |||
66 | $ sleep 1 |
|
66 | $ sleep 1 | |
67 |
|
67 | |||
68 | A linear merge will update standins before performing the actual merge. It will |
|
68 | A linear merge will update standins before performing the actual merge. It will | |
69 | do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and |
|
69 | do a lfdirstate status walk and find 'unset'/'unsure' files, hash them, and | |
70 | update the corresponding standins. |
|
70 | update the corresponding standins. | |
71 | Verify that it actually marks the clean files as clean in lfdirstate so |
|
71 | Verify that it actually marks the clean files as clean in lfdirstate so | |
72 | we don't have to hash them again next time we update. |
|
72 | we don't have to hash them again next time we update. | |
73 |
|
73 | |||
74 | $ hg up |
|
74 | $ hg up | |
75 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
75 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
76 | updated to "f74e50bd9e55: #2" |
|
76 | updated to "f74e50bd9e55: #2" | |
77 | 1 other heads for branch "default" |
|
77 | 1 other heads for branch "default" | |
78 | $ hg debugdirstate --large --nodate |
|
78 | $ hg debugdirstate --large --nodate | |
79 | n 644 7 set large1 |
|
79 | n 644 7 set large1 | |
80 | n 644 13 set large2 |
|
80 | n 644 13 set large2 | |
81 |
|
81 | |||
82 | Test that lfdirstate keeps track of last modification of largefiles and |
|
82 | Test that lfdirstate keeps track of last modification of largefiles and | |
83 | prevents unnecessary hashing of content - also after linear/noop update |
|
83 | prevents unnecessary hashing of content - also after linear/noop update | |
84 |
|
84 | |||
85 | $ sleep 1 |
|
85 | $ sleep 1 | |
86 | $ hg st |
|
86 | $ hg st | |
87 | $ hg debugdirstate --large --nodate |
|
87 | $ hg debugdirstate --large --nodate | |
88 | n 644 7 set large1 |
|
88 | n 644 7 set large1 | |
89 | n 644 13 set large2 |
|
89 | n 644 13 set large2 | |
90 | $ hg up |
|
90 | $ hg up | |
91 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
91 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
92 | updated to "f74e50bd9e55: #2" |
|
92 | updated to "f74e50bd9e55: #2" | |
93 | 1 other heads for branch "default" |
|
93 | 1 other heads for branch "default" | |
94 | $ hg debugdirstate --large --nodate |
|
94 | $ hg debugdirstate --large --nodate | |
95 | n 644 7 set large1 |
|
95 | n 644 7 set large1 | |
96 | n 644 13 set large2 |
|
96 | n 644 13 set large2 | |
97 |
|
97 | |||
98 | Test that "hg merge" updates largefiles from "other" correctly |
|
98 | Test that "hg merge" updates largefiles from "other" correctly | |
99 |
|
99 | |||
100 | (getting largefiles from "other" normally) |
|
100 | (getting largefiles from "other" normally) | |
101 |
|
101 | |||
102 | $ hg status -A large1 |
|
102 | $ hg status -A large1 | |
103 | C large1 |
|
103 | C large1 | |
104 | $ cat large1 |
|
104 | $ cat large1 | |
105 | large1 |
|
105 | large1 | |
106 | $ cat .hglf/large1 |
|
106 | $ cat .hglf/large1 | |
107 | 4669e532d5b2c093a78eca010077e708a071bb64 |
|
107 | 4669e532d5b2c093a78eca010077e708a071bb64 | |
108 | $ hg merge --config debug.dirstate.delaywrite=2 |
|
108 | $ hg merge --config debug.dirstate.delaywrite=2 | |
109 | getting changed largefiles |
|
109 | getting changed largefiles | |
110 | 1 largefiles updated, 0 removed |
|
110 | 1 largefiles updated, 0 removed | |
111 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
111 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
112 | (branch merge, don't forget to commit) |
|
112 | (branch merge, don't forget to commit) | |
113 | $ hg status -A large1 |
|
113 | $ hg status -A large1 | |
114 | M large1 |
|
114 | M large1 | |
115 | $ cat large1 |
|
115 | $ cat large1 | |
116 | large1 in #1 |
|
116 | large1 in #1 | |
117 | $ cat .hglf/large1 |
|
117 | $ cat .hglf/large1 | |
118 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
118 | 58e24f733a964da346e2407a2bee99d9001184f5 | |
119 | $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]' |
|
119 | $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]' | |
120 | -4669e532d5b2c093a78eca010077e708a071bb64 |
|
120 | -4669e532d5b2c093a78eca010077e708a071bb64 | |
121 | +58e24f733a964da346e2407a2bee99d9001184f5 |
|
121 | +58e24f733a964da346e2407a2bee99d9001184f5 | |
122 |
|
122 | |||
123 | (getting largefiles from "other" via conflict prompt) |
|
123 | (getting largefiles from "other" via conflict prompt) | |
124 |
|
124 | |||
125 | $ hg update -q -C 2 |
|
125 | $ hg update -q -C 2 | |
126 | $ echo 'large1 in #3' > large1 |
|
126 | $ echo 'large1 in #3' > large1 | |
127 | $ echo 'normal1 in #3' > normal1 |
|
127 | $ echo 'normal1 in #3' > normal1 | |
128 | $ hg commit -m '#3' |
|
128 | $ hg commit -m '#3' | |
129 | $ cat .hglf/large1 |
|
129 | $ cat .hglf/large1 | |
130 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
130 | e5bb990443d6a92aaf7223813720f7566c9dd05b | |
131 | $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF |
|
131 | $ hg merge --config debug.dirstate.delaywrite=2 --config ui.interactive=True <<EOF | |
132 | > o |
|
132 | > o | |
133 | > EOF |
|
133 | > EOF | |
134 | largefile large1 has a merge conflict |
|
134 | largefile large1 has a merge conflict | |
135 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
135 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |
136 | keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or |
|
136 | you can keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5. | |
137 | take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o |
|
137 | what do you want to do? o | |
138 | merging normal1 |
|
138 | merging normal1 | |
139 | warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark') |
|
139 | warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark') | |
140 | getting changed largefiles |
|
140 | getting changed largefiles | |
141 | 1 largefiles updated, 0 removed |
|
141 | 1 largefiles updated, 0 removed | |
142 | 0 files updated, 1 files merged, 0 files removed, 1 files unresolved |
|
142 | 0 files updated, 1 files merged, 0 files removed, 1 files unresolved | |
143 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
|
143 | use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | |
144 | [1] |
|
144 | [1] | |
145 | $ hg status -A large1 |
|
145 | $ hg status -A large1 | |
146 | M large1 |
|
146 | M large1 | |
147 | $ cat large1 |
|
147 | $ cat large1 | |
148 | large1 in #1 |
|
148 | large1 in #1 | |
149 | $ cat .hglf/large1 |
|
149 | $ cat .hglf/large1 | |
150 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
150 | 58e24f733a964da346e2407a2bee99d9001184f5 | |
151 | $ rm normal1.orig |
|
151 | $ rm normal1.orig | |
152 |
|
152 | |||
153 | (merge non-existing largefiles from "other" via conflict prompt - |
|
153 | (merge non-existing largefiles from "other" via conflict prompt - | |
154 | make sure the following commit doesn't abort in a confusing way when trying to |
|
154 | make sure the following commit doesn't abort in a confusing way when trying to | |
155 | mark the non-existing file as normal in lfdirstate) |
|
155 | mark the non-existing file as normal in lfdirstate) | |
156 |
|
156 | |||
157 | $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 . |
|
157 | $ mv .hg/largefiles/58e24f733a964da346e2407a2bee99d9001184f5 . | |
158 | $ hg update -q -C 3 |
|
158 | $ hg update -q -C 3 | |
159 | $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF |
|
159 | $ hg merge --config largefiles.usercache=not --config debug.dirstate.delaywrite=2 --tool :local --config ui.interactive=True <<EOF | |
160 | > o |
|
160 | > o | |
161 | > EOF |
|
161 | > EOF | |
162 | largefile large1 has a merge conflict |
|
162 | largefile large1 has a merge conflict | |
163 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
163 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |
164 | keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or |
|
164 | you can keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5. | |
165 | take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o |
|
165 | what do you want to do? o | |
166 | getting changed largefiles |
|
166 | getting changed largefiles | |
167 | large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob) |
|
167 | large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob) | |
168 | 0 largefiles updated, 0 removed |
|
168 | 0 largefiles updated, 0 removed | |
169 | 0 files updated, 2 files merged, 0 files removed, 0 files unresolved |
|
169 | 0 files updated, 2 files merged, 0 files removed, 0 files unresolved | |
170 | (branch merge, don't forget to commit) |
|
170 | (branch merge, don't forget to commit) | |
171 | $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not |
|
171 | $ hg commit -m '1-2-3 testing' --config largefiles.usercache=not | |
172 | large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store |
|
172 | large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from local store | |
173 | $ hg up -C . --config largefiles.usercache=not |
|
173 | $ hg up -C . --config largefiles.usercache=not | |
174 | getting changed largefiles |
|
174 | getting changed largefiles | |
175 | large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob) |
|
175 | large1: largefile 58e24f733a964da346e2407a2bee99d9001184f5 not available from file:/*/$TESTTMP/repo (glob) | |
176 | 0 largefiles updated, 0 removed |
|
176 | 0 largefiles updated, 0 removed | |
177 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
177 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
178 | $ hg st large1 |
|
178 | $ hg st large1 | |
179 | ! large1 |
|
179 | ! large1 | |
180 | $ hg rollback -q |
|
180 | $ hg rollback -q | |
181 | $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/ |
|
181 | $ mv 58e24f733a964da346e2407a2bee99d9001184f5 .hg/largefiles/ | |
182 |
|
182 | |||
183 | Test that "hg revert -r REV" updates largefiles from "REV" correctly |
|
183 | Test that "hg revert -r REV" updates largefiles from "REV" correctly | |
184 |
|
184 | |||
185 | $ hg update -q -C 3 |
|
185 | $ hg update -q -C 3 | |
186 | $ hg status -A large1 |
|
186 | $ hg status -A large1 | |
187 | C large1 |
|
187 | C large1 | |
188 | $ cat large1 |
|
188 | $ cat large1 | |
189 | large1 in #3 |
|
189 | large1 in #3 | |
190 | $ cat .hglf/large1 |
|
190 | $ cat .hglf/large1 | |
191 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
191 | e5bb990443d6a92aaf7223813720f7566c9dd05b | |
192 | $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]' |
|
192 | $ hg diff -c 1 --nodates .hglf/large1 | grep '^[+-][0-9a-z]' | |
193 | -4669e532d5b2c093a78eca010077e708a071bb64 |
|
193 | -4669e532d5b2c093a78eca010077e708a071bb64 | |
194 | +58e24f733a964da346e2407a2bee99d9001184f5 |
|
194 | +58e24f733a964da346e2407a2bee99d9001184f5 | |
195 | $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1 |
|
195 | $ hg revert --no-backup -r 1 --config debug.dirstate.delaywrite=2 large1 | |
196 | $ hg status -A large1 |
|
196 | $ hg status -A large1 | |
197 | M large1 |
|
197 | M large1 | |
198 | $ cat large1 |
|
198 | $ cat large1 | |
199 | large1 in #1 |
|
199 | large1 in #1 | |
200 | $ cat .hglf/large1 |
|
200 | $ cat .hglf/large1 | |
201 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
201 | 58e24f733a964da346e2407a2bee99d9001184f5 | |
202 |
|
202 | |||
203 | Test that "hg rollback" restores status of largefiles correctly |
|
203 | Test that "hg rollback" restores status of largefiles correctly | |
204 |
|
204 | |||
205 | $ hg update -C -q |
|
205 | $ hg update -C -q | |
206 | $ hg remove large1 |
|
206 | $ hg remove large1 | |
207 | $ test -f .hglf/large1 |
|
207 | $ test -f .hglf/large1 | |
208 | [1] |
|
208 | [1] | |
209 | $ hg forget large2 |
|
209 | $ hg forget large2 | |
210 | $ test -f .hglf/large2 |
|
210 | $ test -f .hglf/large2 | |
211 | [1] |
|
211 | [1] | |
212 | $ echo largeX > largeX |
|
212 | $ echo largeX > largeX | |
213 | $ hg add --large largeX |
|
213 | $ hg add --large largeX | |
214 | $ cat .hglf/largeX |
|
214 | $ cat .hglf/largeX | |
215 |
|
215 | |||
216 | $ hg commit -m 'will be rollback-ed soon' |
|
216 | $ hg commit -m 'will be rollback-ed soon' | |
217 | $ echo largeY > largeY |
|
217 | $ echo largeY > largeY | |
218 | $ hg add --large largeY |
|
218 | $ hg add --large largeY | |
219 |
|
219 | |||
220 | $ hg status -A large1 |
|
220 | $ hg status -A large1 | |
221 | large1: $ENOENT$ |
|
221 | large1: $ENOENT$ | |
222 |
|
222 | |||
223 | $ hg status -A large2 |
|
223 | $ hg status -A large2 | |
224 | ? large2 |
|
224 | ? large2 | |
225 | $ hg status -A largeX |
|
225 | $ hg status -A largeX | |
226 | C largeX |
|
226 | C largeX | |
227 | $ hg status -A largeY |
|
227 | $ hg status -A largeY | |
228 | A largeY |
|
228 | A largeY | |
229 | $ hg rollback |
|
229 | $ hg rollback | |
230 | repository tip rolled back to revision 3 (undo commit) |
|
230 | repository tip rolled back to revision 3 (undo commit) | |
231 | working directory now based on revision 3 |
|
231 | working directory now based on revision 3 | |
232 | $ hg status -A large1 |
|
232 | $ hg status -A large1 | |
233 | R large1 |
|
233 | R large1 | |
234 | $ test -f .hglf/large1 |
|
234 | $ test -f .hglf/large1 | |
235 | [1] |
|
235 | [1] | |
236 | $ hg status -A large2 |
|
236 | $ hg status -A large2 | |
237 | R large2 |
|
237 | R large2 | |
238 | $ test -f .hglf/large2 |
|
238 | $ test -f .hglf/large2 | |
239 | [1] |
|
239 | [1] | |
240 | $ hg status -A largeX |
|
240 | $ hg status -A largeX | |
241 | A largeX |
|
241 | A largeX | |
242 | $ cat .hglf/largeX |
|
242 | $ cat .hglf/largeX | |
243 |
|
243 | |||
244 | $ hg status -A largeY |
|
244 | $ hg status -A largeY | |
245 | ? largeY |
|
245 | ? largeY | |
246 | $ test -f .hglf/largeY |
|
246 | $ test -f .hglf/largeY | |
247 | [1] |
|
247 | [1] | |
248 | $ rm largeY |
|
248 | $ rm largeY | |
249 |
|
249 | |||
250 | Test that "hg rollback" restores standins correctly |
|
250 | Test that "hg rollback" restores standins correctly | |
251 |
|
251 | |||
252 | $ hg commit -m 'will be rollback-ed soon' |
|
252 | $ hg commit -m 'will be rollback-ed soon' | |
253 | $ hg update -q -C 2 |
|
253 | $ hg update -q -C 2 | |
254 | $ cat large1 |
|
254 | $ cat large1 | |
255 | large1 |
|
255 | large1 | |
256 | $ cat .hglf/large1 |
|
256 | $ cat .hglf/large1 | |
257 | 4669e532d5b2c093a78eca010077e708a071bb64 |
|
257 | 4669e532d5b2c093a78eca010077e708a071bb64 | |
258 | $ cat large2 |
|
258 | $ cat large2 | |
259 | large2 in #2 |
|
259 | large2 in #2 | |
260 | $ cat .hglf/large2 |
|
260 | $ cat .hglf/large2 | |
261 | 3cfce6277e7668985707b6887ce56f9f62f6ccd9 |
|
261 | 3cfce6277e7668985707b6887ce56f9f62f6ccd9 | |
262 |
|
262 | |||
263 | $ hg rollback -q -f |
|
263 | $ hg rollback -q -f | |
264 | $ cat large1 |
|
264 | $ cat large1 | |
265 | large1 |
|
265 | large1 | |
266 | $ cat .hglf/large1 |
|
266 | $ cat .hglf/large1 | |
267 | 4669e532d5b2c093a78eca010077e708a071bb64 |
|
267 | 4669e532d5b2c093a78eca010077e708a071bb64 | |
268 | $ cat large2 |
|
268 | $ cat large2 | |
269 | large2 in #2 |
|
269 | large2 in #2 | |
270 | $ cat .hglf/large2 |
|
270 | $ cat .hglf/large2 | |
271 | 3cfce6277e7668985707b6887ce56f9f62f6ccd9 |
|
271 | 3cfce6277e7668985707b6887ce56f9f62f6ccd9 | |
272 |
|
272 | |||
273 | (rollback the parent of the working directory, when the parent of it |
|
273 | (rollback the parent of the working directory, when the parent of it | |
274 | is not branch-tip) |
|
274 | is not branch-tip) | |
275 |
|
275 | |||
276 | $ hg update -q -C 1 |
|
276 | $ hg update -q -C 1 | |
277 | $ cat .hglf/large1 |
|
277 | $ cat .hglf/large1 | |
278 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
278 | 58e24f733a964da346e2407a2bee99d9001184f5 | |
279 | $ cat .hglf/large2 |
|
279 | $ cat .hglf/large2 | |
280 | 1deebade43c8c498a3c8daddac0244dc55d1331d |
|
280 | 1deebade43c8c498a3c8daddac0244dc55d1331d | |
281 |
|
281 | |||
282 | $ echo normalX > normalX |
|
282 | $ echo normalX > normalX | |
283 | $ hg add normalX |
|
283 | $ hg add normalX | |
284 | $ hg commit -m 'will be rollback-ed soon' |
|
284 | $ hg commit -m 'will be rollback-ed soon' | |
285 | $ hg rollback -q |
|
285 | $ hg rollback -q | |
286 |
|
286 | |||
287 | $ cat .hglf/large1 |
|
287 | $ cat .hglf/large1 | |
288 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
288 | 58e24f733a964da346e2407a2bee99d9001184f5 | |
289 | $ cat .hglf/large2 |
|
289 | $ cat .hglf/large2 | |
290 | 1deebade43c8c498a3c8daddac0244dc55d1331d |
|
290 | 1deebade43c8c498a3c8daddac0244dc55d1331d | |
291 | $ rm normalX |
|
291 | $ rm normalX | |
292 |
|
292 | |||
293 | Test that "hg status" shows status of largefiles correctly just after |
|
293 | Test that "hg status" shows status of largefiles correctly just after | |
294 | automated commit like rebase/transplant |
|
294 | automated commit like rebase/transplant | |
295 |
|
295 | |||
296 | $ cat >> .hg/hgrc <<EOF |
|
296 | $ cat >> .hg/hgrc <<EOF | |
297 | > [extensions] |
|
297 | > [extensions] | |
298 | > rebase = |
|
298 | > rebase = | |
299 | > strip = |
|
299 | > strip = | |
300 | > transplant = |
|
300 | > transplant = | |
301 | > EOF |
|
301 | > EOF | |
302 | $ hg update -q -C 1 |
|
302 | $ hg update -q -C 1 | |
303 | $ hg remove large1 |
|
303 | $ hg remove large1 | |
304 | $ echo largeX > largeX |
|
304 | $ echo largeX > largeX | |
305 | $ hg add --large largeX |
|
305 | $ hg add --large largeX | |
306 | $ hg commit -m '#4' |
|
306 | $ hg commit -m '#4' | |
307 |
|
307 | |||
308 | $ hg rebase -s 1 -d 2 --keep |
|
308 | $ hg rebase -s 1 -d 2 --keep | |
309 | rebasing 1:72518492caa6 "#1" |
|
309 | rebasing 1:72518492caa6 "#1" | |
310 | rebasing 4:07d6153b5c04 "#4" (tip) |
|
310 | rebasing 4:07d6153b5c04 "#4" (tip) | |
311 |
|
311 | |||
312 | $ hg status -A large1 |
|
312 | $ hg status -A large1 | |
313 | large1: $ENOENT$ |
|
313 | large1: $ENOENT$ | |
314 |
|
314 | |||
315 | $ hg status -A largeX |
|
315 | $ hg status -A largeX | |
316 | C largeX |
|
316 | C largeX | |
317 | $ hg strip -q 5 |
|
317 | $ hg strip -q 5 | |
318 |
|
318 | |||
319 | $ hg update -q -C 2 |
|
319 | $ hg update -q -C 2 | |
320 | $ hg transplant -q 1 4 |
|
320 | $ hg transplant -q 1 4 | |
321 |
|
321 | |||
322 | $ hg status -A large1 |
|
322 | $ hg status -A large1 | |
323 | large1: $ENOENT$ |
|
323 | large1: $ENOENT$ | |
324 |
|
324 | |||
325 | $ hg status -A largeX |
|
325 | $ hg status -A largeX | |
326 | C largeX |
|
326 | C largeX | |
327 | $ hg strip -q 5 |
|
327 | $ hg strip -q 5 | |
328 |
|
328 | |||
329 | $ hg update -q -C 2 |
|
329 | $ hg update -q -C 2 | |
330 | $ hg transplant -q --merge 1 --merge 4 |
|
330 | $ hg transplant -q --merge 1 --merge 4 | |
331 |
|
331 | |||
332 | $ hg status -A large1 |
|
332 | $ hg status -A large1 | |
333 | large1: $ENOENT$ |
|
333 | large1: $ENOENT$ | |
334 |
|
334 | |||
335 | $ hg status -A largeX |
|
335 | $ hg status -A largeX | |
336 | C largeX |
|
336 | C largeX | |
337 | $ hg strip -q 5 |
|
337 | $ hg strip -q 5 | |
338 |
|
338 | |||
339 | Test that linear merge can detect modification (and conflict) correctly |
|
339 | Test that linear merge can detect modification (and conflict) correctly | |
340 |
|
340 | |||
341 | (linear merge without conflict) |
|
341 | (linear merge without conflict) | |
342 |
|
342 | |||
343 | $ echo 'large2 for linear merge (no conflict)' > large2 |
|
343 | $ echo 'large2 for linear merge (no conflict)' > large2 | |
344 | $ hg update 3 --config debug.dirstate.delaywrite=2 |
|
344 | $ hg update 3 --config debug.dirstate.delaywrite=2 | |
345 | getting changed largefiles |
|
345 | getting changed largefiles | |
346 | 1 largefiles updated, 0 removed |
|
346 | 1 largefiles updated, 0 removed | |
347 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
347 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
348 | $ hg status -A large2 |
|
348 | $ hg status -A large2 | |
349 | M large2 |
|
349 | M large2 | |
350 | $ cat large2 |
|
350 | $ cat large2 | |
351 | large2 for linear merge (no conflict) |
|
351 | large2 for linear merge (no conflict) | |
352 | $ cat .hglf/large2 |
|
352 | $ cat .hglf/large2 | |
353 | 9c4bf8f1b33536d6e5f89447e10620cfe52ea710 |
|
353 | 9c4bf8f1b33536d6e5f89447e10620cfe52ea710 | |
354 |
|
354 | |||
355 | (linear merge with conflict, choosing "other") |
|
355 | (linear merge with conflict, choosing "other") | |
356 |
|
356 | |||
357 | $ hg update -q -C 2 |
|
357 | $ hg update -q -C 2 | |
358 | $ echo 'large1 for linear merge (conflict)' > large1 |
|
358 | $ echo 'large1 for linear merge (conflict)' > large1 | |
359 | $ hg update 3 --config ui.interactive=True <<EOF |
|
359 | $ hg update 3 --config ui.interactive=True <<EOF | |
360 | > o |
|
360 | > o | |
361 | > EOF |
|
361 | > EOF | |
362 | largefile large1 has a merge conflict |
|
362 | largefile large1 has a merge conflict | |
363 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
363 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |
364 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
364 | you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. | |
365 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? o |
|
365 | what do you want to do? o | |
366 | getting changed largefiles |
|
366 | getting changed largefiles | |
367 | 1 largefiles updated, 0 removed |
|
367 | 1 largefiles updated, 0 removed | |
368 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
368 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
369 | $ hg status -A large1 |
|
369 | $ hg status -A large1 | |
370 | C large1 |
|
370 | C large1 | |
371 | $ cat large1 |
|
371 | $ cat large1 | |
372 | large1 in #3 |
|
372 | large1 in #3 | |
373 | $ cat .hglf/large1 |
|
373 | $ cat .hglf/large1 | |
374 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
374 | e5bb990443d6a92aaf7223813720f7566c9dd05b | |
375 |
|
375 | |||
376 | (linear merge with conflict, choosing "local") |
|
376 | (linear merge with conflict, choosing "local") | |
377 |
|
377 | |||
378 | $ hg update -q -C 2 |
|
378 | $ hg update -q -C 2 | |
379 | $ echo 'large1 for linear merge (conflict)' > large1 |
|
379 | $ echo 'large1 for linear merge (conflict)' > large1 | |
380 | $ hg update 3 --config debug.dirstate.delaywrite=2 |
|
380 | $ hg update 3 --config debug.dirstate.delaywrite=2 | |
381 | largefile large1 has a merge conflict |
|
381 | largefile large1 has a merge conflict | |
382 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
382 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |
383 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
383 | you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. | |
384 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l |
|
384 | what do you want to do? l | |
385 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
385 | 1 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
386 | $ hg status -A large1 |
|
386 | $ hg status -A large1 | |
387 | M large1 |
|
387 | M large1 | |
388 | $ cat large1 |
|
388 | $ cat large1 | |
389 | large1 for linear merge (conflict) |
|
389 | large1 for linear merge (conflict) | |
390 | $ cat .hglf/large1 |
|
390 | $ cat .hglf/large1 | |
391 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 |
|
391 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 | |
392 |
|
392 | |||
393 | Test a linear merge to a revision containing same-name normal file |
|
393 | Test a linear merge to a revision containing same-name normal file | |
394 |
|
394 | |||
395 | $ hg update -q -C 3 |
|
395 | $ hg update -q -C 3 | |
396 | $ hg remove large2 |
|
396 | $ hg remove large2 | |
397 | $ echo 'large2 as normal file' > large2 |
|
397 | $ echo 'large2 as normal file' > large2 | |
398 | $ hg add large2 |
|
398 | $ hg add large2 | |
399 | $ echo 'large3 as normal file' > large3 |
|
399 | $ echo 'large3 as normal file' > large3 | |
400 | $ hg add large3 |
|
400 | $ hg add large3 | |
401 | $ hg commit -m '#5' |
|
401 | $ hg commit -m '#5' | |
402 | $ hg manifest |
|
402 | $ hg manifest | |
403 | .hglf/large1 |
|
403 | .hglf/large1 | |
404 | large2 |
|
404 | large2 | |
405 | large3 |
|
405 | large3 | |
406 | normal1 |
|
406 | normal1 | |
407 |
|
407 | |||
408 | (modified largefile is already switched to normal) |
|
408 | (modified largefile is already switched to normal) | |
409 |
|
409 | |||
410 | $ hg update -q -C 2 |
|
410 | $ hg update -q -C 2 | |
411 | $ echo 'modified large2 for linear merge' > large2 |
|
411 | $ echo 'modified large2 for linear merge' > large2 | |
412 | $ hg update -q 5 |
|
412 | $ hg update -q 5 | |
413 | remote turned local largefile large2 into a normal file |
|
413 | remote turned local largefile large2 into a normal file | |
414 | keep (l)argefile or use (n)ormal file? l |
|
414 | keep (l)argefile or use (n)ormal file? l | |
415 | $ hg debugdirstate --no-dates | grep large2 |
|
415 | $ hg debugdirstate --no-dates | grep large2 | |
416 | a 0 -1 unset .hglf/large2 |
|
416 | a 0 -1 unset .hglf/large2 | |
417 | r 0 0 set large2 |
|
417 | r 0 0 set large2 | |
418 | $ hg status -A large2 |
|
418 | $ hg status -A large2 | |
419 | A large2 |
|
419 | A large2 | |
420 | $ cat large2 |
|
420 | $ cat large2 | |
421 | modified large2 for linear merge |
|
421 | modified large2 for linear merge | |
422 |
|
422 | |||
423 | (added largefile is already committed as normal) |
|
423 | (added largefile is already committed as normal) | |
424 |
|
424 | |||
425 | $ hg update -q -C 2 |
|
425 | $ hg update -q -C 2 | |
426 | $ echo 'large3 as large file for linear merge' > large3 |
|
426 | $ echo 'large3 as large file for linear merge' > large3 | |
427 | $ hg add --large large3 |
|
427 | $ hg add --large large3 | |
428 | $ hg update -q 5 |
|
428 | $ hg update -q 5 | |
429 | remote turned local largefile large3 into a normal file |
|
429 | remote turned local largefile large3 into a normal file | |
430 | keep (l)argefile or use (n)ormal file? l |
|
430 | keep (l)argefile or use (n)ormal file? l | |
431 | $ hg debugdirstate --no-dates | grep large3 |
|
431 | $ hg debugdirstate --no-dates | grep large3 | |
432 | a 0 -1 unset .hglf/large3 |
|
432 | a 0 -1 unset .hglf/large3 | |
433 | r 0 0 set large3 |
|
433 | r 0 0 set large3 | |
434 | $ hg status -A large3 |
|
434 | $ hg status -A large3 | |
435 | A large3 |
|
435 | A large3 | |
436 | $ cat large3 |
|
436 | $ cat large3 | |
437 | large3 as large file for linear merge |
|
437 | large3 as large file for linear merge | |
438 | $ rm -f large3 .hglf/large3 |
|
438 | $ rm -f large3 .hglf/large3 | |
439 |
|
439 | |||
440 | Test that the internal linear merging works correctly |
|
440 | Test that the internal linear merging works correctly | |
441 | (both heads are stripped to keep pairing of revision number and commit log) |
|
441 | (both heads are stripped to keep pairing of revision number and commit log) | |
442 |
|
442 | |||
443 | $ hg update -q -C 2 |
|
443 | $ hg update -q -C 2 | |
444 | $ hg strip 3 4 |
|
444 | $ hg strip 3 4 | |
445 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg |
|
445 | saved backup bundle to $TESTTMP/repo/.hg/strip-backup/9530e27857f7-2e7b195d-backup.hg | |
446 | $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP |
|
446 | $ mv .hg/strip-backup/9530e27857f7-2e7b195d-backup.hg $TESTTMP | |
447 |
|
447 | |||
448 | (internal linear merging at "hg pull --update") |
|
448 | (internal linear merging at "hg pull --update") | |
449 |
|
449 | |||
450 | $ echo 'large1 for linear merge (conflict)' > large1 |
|
450 | $ echo 'large1 for linear merge (conflict)' > large1 | |
451 | $ echo 'large2 for linear merge (conflict with normal file)' > large2 |
|
451 | $ echo 'large2 for linear merge (conflict with normal file)' > large2 | |
452 | $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg |
|
452 | $ hg pull --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg | |
453 | pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg |
|
453 | pulling from $TESTTMP/9530e27857f7-2e7b195d-backup.hg | |
454 | searching for changes |
|
454 | searching for changes | |
455 | adding changesets |
|
455 | adding changesets | |
456 | adding manifests |
|
456 | adding manifests | |
457 | adding file changes |
|
457 | adding file changes | |
458 | added 3 changesets with 5 changes to 5 files |
|
458 | added 3 changesets with 5 changes to 5 files | |
459 | new changesets 9530e27857f7:d65e59e952a9 (3 drafts) |
|
459 | new changesets 9530e27857f7:d65e59e952a9 (3 drafts) | |
460 | remote turned local largefile large2 into a normal file |
|
460 | remote turned local largefile large2 into a normal file | |
461 | keep (l)argefile or use (n)ormal file? l |
|
461 | keep (l)argefile or use (n)ormal file? l | |
462 | largefile large1 has a merge conflict |
|
462 | largefile large1 has a merge conflict | |
463 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
463 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |
464 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
464 | you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. | |
465 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l |
|
465 | what do you want to do? l | |
466 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
466 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
467 | updated to "d65e59e952a9: #5" |
|
467 | updated to "d65e59e952a9: #5" | |
468 | 1 other heads for branch "default" |
|
468 | 1 other heads for branch "default" | |
469 |
|
469 | |||
470 | $ hg status -A large1 |
|
470 | $ hg status -A large1 | |
471 | M large1 |
|
471 | M large1 | |
472 | $ cat large1 |
|
472 | $ cat large1 | |
473 | large1 for linear merge (conflict) |
|
473 | large1 for linear merge (conflict) | |
474 | $ cat .hglf/large1 |
|
474 | $ cat .hglf/large1 | |
475 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 |
|
475 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 | |
476 | $ hg status -A large2 |
|
476 | $ hg status -A large2 | |
477 | A large2 |
|
477 | A large2 | |
478 | $ cat large2 |
|
478 | $ cat large2 | |
479 | large2 for linear merge (conflict with normal file) |
|
479 | large2 for linear merge (conflict with normal file) | |
480 | $ cat .hglf/large2 |
|
480 | $ cat .hglf/large2 | |
481 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 |
|
481 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 | |
482 |
|
482 | |||
483 | (internal linear merging at "hg unbundle --update") |
|
483 | (internal linear merging at "hg unbundle --update") | |
484 |
|
484 | |||
485 | $ hg update -q -C 2 |
|
485 | $ hg update -q -C 2 | |
486 | $ hg rollback -q |
|
486 | $ hg rollback -q | |
487 |
|
487 | |||
488 | $ echo 'large1 for linear merge (conflict)' > large1 |
|
488 | $ echo 'large1 for linear merge (conflict)' > large1 | |
489 | $ echo 'large2 for linear merge (conflict with normal file)' > large2 |
|
489 | $ echo 'large2 for linear merge (conflict with normal file)' > large2 | |
490 | $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg |
|
490 | $ hg unbundle --update --config debug.dirstate.delaywrite=2 $TESTTMP/9530e27857f7-2e7b195d-backup.hg | |
491 | adding changesets |
|
491 | adding changesets | |
492 | adding manifests |
|
492 | adding manifests | |
493 | adding file changes |
|
493 | adding file changes | |
494 | added 3 changesets with 5 changes to 5 files |
|
494 | added 3 changesets with 5 changes to 5 files | |
495 | new changesets 9530e27857f7:d65e59e952a9 (3 drafts) |
|
495 | new changesets 9530e27857f7:d65e59e952a9 (3 drafts) | |
496 | remote turned local largefile large2 into a normal file |
|
496 | remote turned local largefile large2 into a normal file | |
497 | keep (l)argefile or use (n)ormal file? l |
|
497 | keep (l)argefile or use (n)ormal file? l | |
498 | largefile large1 has a merge conflict |
|
498 | largefile large1 has a merge conflict | |
499 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
499 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |
500 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
500 | you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. | |
501 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l |
|
501 | what do you want to do? l | |
502 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
502 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
503 | updated to "d65e59e952a9: #5" |
|
503 | updated to "d65e59e952a9: #5" | |
504 | 1 other heads for branch "default" |
|
504 | 1 other heads for branch "default" | |
505 |
|
505 | |||
506 | $ hg status -A large1 |
|
506 | $ hg status -A large1 | |
507 | M large1 |
|
507 | M large1 | |
508 | $ cat large1 |
|
508 | $ cat large1 | |
509 | large1 for linear merge (conflict) |
|
509 | large1 for linear merge (conflict) | |
510 | $ cat .hglf/large1 |
|
510 | $ cat .hglf/large1 | |
511 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 |
|
511 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 | |
512 | $ hg status -A large2 |
|
512 | $ hg status -A large2 | |
513 | A large2 |
|
513 | A large2 | |
514 | $ cat large2 |
|
514 | $ cat large2 | |
515 | large2 for linear merge (conflict with normal file) |
|
515 | large2 for linear merge (conflict with normal file) | |
516 | $ cat .hglf/large2 |
|
516 | $ cat .hglf/large2 | |
517 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 |
|
517 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 | |
518 |
|
518 | |||
519 | (internal linear merging in subrepo at "hg update") |
|
519 | (internal linear merging in subrepo at "hg update") | |
520 |
|
520 | |||
521 | $ cd .. |
|
521 | $ cd .. | |
522 | $ hg init subparent |
|
522 | $ hg init subparent | |
523 | $ cd subparent |
|
523 | $ cd subparent | |
524 |
|
524 | |||
525 | $ hg clone -q -u 2 ../repo sub |
|
525 | $ hg clone -q -u 2 ../repo sub | |
526 | $ cat > .hgsub <<EOF |
|
526 | $ cat > .hgsub <<EOF | |
527 | > sub = sub |
|
527 | > sub = sub | |
528 | > EOF |
|
528 | > EOF | |
529 | $ hg add .hgsub |
|
529 | $ hg add .hgsub | |
530 | $ hg commit -m '#0@parent' |
|
530 | $ hg commit -m '#0@parent' | |
531 | $ cat .hgsubstate |
|
531 | $ cat .hgsubstate | |
532 | f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub |
|
532 | f74e50bd9e5594b7cf1e6c5cbab86ddd25f3ca2f sub | |
533 | $ hg -R sub update -q |
|
533 | $ hg -R sub update -q | |
534 | $ hg commit -m '#1@parent' |
|
534 | $ hg commit -m '#1@parent' | |
535 | $ cat .hgsubstate |
|
535 | $ cat .hgsubstate | |
536 | d65e59e952a9638e2ce863b41a420ca723dd3e8d sub |
|
536 | d65e59e952a9638e2ce863b41a420ca723dd3e8d sub | |
537 | $ hg update -q 0 |
|
537 | $ hg update -q 0 | |
538 |
|
538 | |||
539 | $ echo 'large1 for linear merge (conflict)' > sub/large1 |
|
539 | $ echo 'large1 for linear merge (conflict)' > sub/large1 | |
540 | $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2 |
|
540 | $ echo 'large2 for linear merge (conflict with normal file)' > sub/large2 | |
541 | $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF |
|
541 | $ hg update --config ui.interactive=True --config debug.dirstate.delaywrite=2 <<EOF | |
542 | > m |
|
542 | > m | |
543 | > r |
|
543 | > r | |
544 | > l |
|
544 | > l | |
545 | > l |
|
545 | > l | |
546 | > EOF |
|
546 | > EOF | |
547 | subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9) |
|
547 | subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9) | |
548 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m |
|
548 | (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m | |
549 | subrepository sources for sub differ (in checked out version) |
|
549 | subrepository sources for sub differ (in checked out version) | |
550 | use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r |
|
550 | use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r | |
551 | remote turned local largefile large2 into a normal file |
|
551 | remote turned local largefile large2 into a normal file | |
552 | keep (l)argefile or use (n)ormal file? l |
|
552 | keep (l)argefile or use (n)ormal file? l | |
553 | largefile large1 has a merge conflict |
|
553 | largefile large1 has a merge conflict | |
554 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
554 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |
555 | keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or |
|
555 | you can keep (l)ocal ba94c2efe5b7c5e0af8d189295ce00553b0612b7 or take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b. | |
556 | take (o)ther e5bb990443d6a92aaf7223813720f7566c9dd05b? l |
|
556 | what do you want to do? l | |
557 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
557 | 2 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
558 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
558 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
559 |
|
559 | |||
560 | $ hg -R sub status -A sub/large1 |
|
560 | $ hg -R sub status -A sub/large1 | |
561 | M sub/large1 |
|
561 | M sub/large1 | |
562 | $ cat sub/large1 |
|
562 | $ cat sub/large1 | |
563 | large1 for linear merge (conflict) |
|
563 | large1 for linear merge (conflict) | |
564 | $ cat sub/.hglf/large1 |
|
564 | $ cat sub/.hglf/large1 | |
565 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 |
|
565 | ba94c2efe5b7c5e0af8d189295ce00553b0612b7 | |
566 | $ hg -R sub status -A sub/large2 |
|
566 | $ hg -R sub status -A sub/large2 | |
567 | A sub/large2 |
|
567 | A sub/large2 | |
568 | $ cat sub/large2 |
|
568 | $ cat sub/large2 | |
569 | large2 for linear merge (conflict with normal file) |
|
569 | large2 for linear merge (conflict with normal file) | |
570 | $ cat sub/.hglf/large2 |
|
570 | $ cat sub/.hglf/large2 | |
571 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 |
|
571 | d7591fe9be0f6227d90bddf3e4f52ff41fc1f544 | |
572 |
|
572 | |||
573 | $ cd .. |
|
573 | $ cd .. | |
574 | $ cd repo |
|
574 | $ cd repo | |
575 |
|
575 | |||
576 | Test that rebase updates largefiles in the working directory even if |
|
576 | Test that rebase updates largefiles in the working directory even if | |
577 | it is aborted by conflict. |
|
577 | it is aborted by conflict. | |
578 |
|
578 | |||
579 | $ hg update -q -C 3 |
|
579 | $ hg update -q -C 3 | |
580 | $ cat .hglf/large1 |
|
580 | $ cat .hglf/large1 | |
581 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
581 | e5bb990443d6a92aaf7223813720f7566c9dd05b | |
582 | $ cat large1 |
|
582 | $ cat large1 | |
583 | large1 in #3 |
|
583 | large1 in #3 | |
584 | $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF |
|
584 | $ hg rebase -s 1 -d 3 --keep --config ui.interactive=True <<EOF | |
585 | > o |
|
585 | > o | |
586 | > EOF |
|
586 | > EOF | |
587 | rebasing 1:72518492caa6 "#1" |
|
587 | rebasing 1:72518492caa6 "#1" | |
588 | largefile large1 has a merge conflict |
|
588 | largefile large1 has a merge conflict | |
589 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 |
|
589 | ancestor was 4669e532d5b2c093a78eca010077e708a071bb64 | |
590 | keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or |
|
590 | you can keep (l)ocal e5bb990443d6a92aaf7223813720f7566c9dd05b or take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5. | |
591 | take (o)ther 58e24f733a964da346e2407a2bee99d9001184f5? o |
|
591 | what do you want to do? o | |
592 | merging normal1 |
|
592 | merging normal1 | |
593 | warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark') |
|
593 | warning: conflicts while merging normal1! (edit, then use 'hg resolve --mark') | |
594 | unresolved conflicts (see hg resolve, then hg rebase --continue) |
|
594 | unresolved conflicts (see hg resolve, then hg rebase --continue) | |
595 | [1] |
|
595 | [1] | |
596 | $ cat .hglf/large1 |
|
596 | $ cat .hglf/large1 | |
597 | 58e24f733a964da346e2407a2bee99d9001184f5 |
|
597 | 58e24f733a964da346e2407a2bee99d9001184f5 | |
598 | $ cat large1 |
|
598 | $ cat large1 | |
599 | large1 in #1 |
|
599 | large1 in #1 | |
600 | $ rm normal1.orig |
|
600 | $ rm normal1.orig | |
601 |
|
601 | |||
602 | Test that rebase updates standins for manually modified largefiles at |
|
602 | Test that rebase updates standins for manually modified largefiles at | |
603 | the 1st commit of resuming. |
|
603 | the 1st commit of resuming. | |
604 |
|
604 | |||
605 | $ echo "manually modified before 'hg rebase --continue'" > large1 |
|
605 | $ echo "manually modified before 'hg rebase --continue'" > large1 | |
606 | $ hg resolve -m normal1 |
|
606 | $ hg resolve -m normal1 | |
607 | (no more unresolved files) |
|
607 | (no more unresolved files) | |
608 | continue: hg rebase --continue |
|
608 | continue: hg rebase --continue | |
609 | $ hg rebase --continue --config ui.interactive=True <<EOF |
|
609 | $ hg rebase --continue --config ui.interactive=True <<EOF | |
610 | > c |
|
610 | > c | |
611 | > EOF |
|
611 | > EOF | |
612 | rebasing 1:72518492caa6 "#1" |
|
612 | rebasing 1:72518492caa6 "#1" | |
613 | rebasing 4:07d6153b5c04 "#4" |
|
613 | rebasing 4:07d6153b5c04 "#4" | |
614 | file '.hglf/large1' was deleted in other [source] but was modified in local [dest]. |
|
614 | file '.hglf/large1' was deleted in other [source] but was modified in local [dest]. | |
615 | You can use (c)hanged version, (d)elete, or leave (u)nresolved. |
|
615 | You can use (c)hanged version, (d)elete, or leave (u)nresolved. | |
616 | What do you want to do? c |
|
616 | What do you want to do? c | |
617 |
|
617 | |||
618 | $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]' |
|
618 | $ hg diff -c "tip~1" --nodates .hglf/large1 | grep '^[+-][0-9a-z]' | |
619 | -e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
619 | -e5bb990443d6a92aaf7223813720f7566c9dd05b | |
620 | +8a4f783556e7dea21139ca0466eafce954c75c13 |
|
620 | +8a4f783556e7dea21139ca0466eafce954c75c13 | |
621 | $ rm -f large1 |
|
621 | $ rm -f large1 | |
622 | $ hg update -q -C tip |
|
622 | $ hg update -q -C tip | |
623 | $ cat large1 |
|
623 | $ cat large1 | |
624 | manually modified before 'hg rebase --continue' |
|
624 | manually modified before 'hg rebase --continue' | |
625 |
|
625 | |||
626 | Test that transplant updates largefiles, of which standins are safely |
|
626 | Test that transplant updates largefiles, of which standins are safely | |
627 | changed, even if it is aborted by conflict of other. |
|
627 | changed, even if it is aborted by conflict of other. | |
628 |
|
628 | |||
629 | $ hg update -q -C 5 |
|
629 | $ hg update -q -C 5 | |
630 | $ cat .hglf/large1 |
|
630 | $ cat .hglf/large1 | |
631 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
631 | e5bb990443d6a92aaf7223813720f7566c9dd05b | |
632 | $ cat large1 |
|
632 | $ cat large1 | |
633 | large1 in #3 |
|
633 | large1 in #3 | |
634 | $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]' |
|
634 | $ hg diff -c 4 .hglf/largeX | grep '^[+-][0-9a-z]' | |
635 | +fa44618ea25181aff4f48b70428294790cec9f61 |
|
635 | +fa44618ea25181aff4f48b70428294790cec9f61 | |
636 | $ hg transplant 4 |
|
636 | $ hg transplant 4 | |
637 | applying 07d6153b5c04 |
|
637 | applying 07d6153b5c04 | |
638 | patching file .hglf/large1 |
|
638 | patching file .hglf/large1 | |
639 | Hunk #1 FAILED at 0 |
|
639 | Hunk #1 FAILED at 0 | |
640 | 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej |
|
640 | 1 out of 1 hunks FAILED -- saving rejects to file .hglf/large1.rej | |
641 | patch failed to apply |
|
641 | patch failed to apply | |
642 | abort: fix up the working directory and run hg transplant --continue |
|
642 | abort: fix up the working directory and run hg transplant --continue | |
643 | [255] |
|
643 | [255] | |
644 | $ hg status -A large1 |
|
644 | $ hg status -A large1 | |
645 | C large1 |
|
645 | C large1 | |
646 | $ cat .hglf/large1 |
|
646 | $ cat .hglf/large1 | |
647 | e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
647 | e5bb990443d6a92aaf7223813720f7566c9dd05b | |
648 | $ cat large1 |
|
648 | $ cat large1 | |
649 | large1 in #3 |
|
649 | large1 in #3 | |
650 | $ hg status -A largeX |
|
650 | $ hg status -A largeX | |
651 | A largeX |
|
651 | A largeX | |
652 | $ cat .hglf/largeX |
|
652 | $ cat .hglf/largeX | |
653 | fa44618ea25181aff4f48b70428294790cec9f61 |
|
653 | fa44618ea25181aff4f48b70428294790cec9f61 | |
654 | $ cat largeX |
|
654 | $ cat largeX | |
655 | largeX |
|
655 | largeX | |
656 |
|
656 | |||
657 | Test that transplant updates standins for manually modified largefiles |
|
657 | Test that transplant updates standins for manually modified largefiles | |
658 | at the 1st commit of resuming. |
|
658 | at the 1st commit of resuming. | |
659 |
|
659 | |||
660 | $ echo "manually modified before 'hg transplant --continue'" > large1 |
|
660 | $ echo "manually modified before 'hg transplant --continue'" > large1 | |
661 | $ hg transplant --continue |
|
661 | $ hg transplant --continue | |
662 | 07d6153b5c04 transplanted as f1bf30eb88cc |
|
662 | 07d6153b5c04 transplanted as f1bf30eb88cc | |
663 | $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]' |
|
663 | $ hg diff -c tip .hglf/large1 | grep '^[+-][0-9a-z]' | |
664 | -e5bb990443d6a92aaf7223813720f7566c9dd05b |
|
664 | -e5bb990443d6a92aaf7223813720f7566c9dd05b | |
665 | +6a4f36d4075fbe0f30ec1d26ca44e63c05903671 |
|
665 | +6a4f36d4075fbe0f30ec1d26ca44e63c05903671 | |
666 | $ rm -f large1 |
|
666 | $ rm -f large1 | |
667 | $ hg update -q -C tip |
|
667 | $ hg update -q -C tip | |
668 | $ cat large1 |
|
668 | $ cat large1 | |
669 | manually modified before 'hg transplant --continue' |
|
669 | manually modified before 'hg transplant --continue' | |
670 |
|
670 | |||
671 | Test that "hg status" doesn't show removal of largefiles not managed |
|
671 | Test that "hg status" doesn't show removal of largefiles not managed | |
672 | in the target context. |
|
672 | in the target context. | |
673 |
|
673 | |||
674 | $ hg update -q -C 4 |
|
674 | $ hg update -q -C 4 | |
675 | $ hg remove largeX |
|
675 | $ hg remove largeX | |
676 | $ hg status -A largeX |
|
676 | $ hg status -A largeX | |
677 | R largeX |
|
677 | R largeX | |
678 | $ hg status -A --rev '.^1' largeX |
|
678 | $ hg status -A --rev '.^1' largeX | |
679 |
|
679 | |||
680 | #if execbit |
|
680 | #if execbit | |
681 |
|
681 | |||
682 | Test that "hg status" against revisions other than parent notices exec |
|
682 | Test that "hg status" against revisions other than parent notices exec | |
683 | bit changes of largefiles. |
|
683 | bit changes of largefiles. | |
684 |
|
684 | |||
685 | $ hg update -q -C 4 |
|
685 | $ hg update -q -C 4 | |
686 |
|
686 | |||
687 | (the case that large2 doesn't have exec bit in the target context but |
|
687 | (the case that large2 doesn't have exec bit in the target context but | |
688 | in the working context) |
|
688 | in the working context) | |
689 |
|
689 | |||
690 | $ chmod +x large2 |
|
690 | $ chmod +x large2 | |
691 | $ hg status -A --rev 0 large2 |
|
691 | $ hg status -A --rev 0 large2 | |
692 | M large2 |
|
692 | M large2 | |
693 | $ hg commit -m 'chmod +x large2' |
|
693 | $ hg commit -m 'chmod +x large2' | |
694 |
|
694 | |||
695 | (the case that large2 has exec bit in the target context but not in |
|
695 | (the case that large2 has exec bit in the target context but not in | |
696 | the working context) |
|
696 | the working context) | |
697 |
|
697 | |||
698 | $ echo dummy > dummy |
|
698 | $ echo dummy > dummy | |
699 | $ hg add dummy |
|
699 | $ hg add dummy | |
700 | $ hg commit -m 'revision for separation' |
|
700 | $ hg commit -m 'revision for separation' | |
701 | $ chmod -x large2 |
|
701 | $ chmod -x large2 | |
702 | $ hg status -A --rev '.^1' large2 |
|
702 | $ hg status -A --rev '.^1' large2 | |
703 | M large2 |
|
703 | M large2 | |
704 |
|
704 | |||
705 | #else |
|
705 | #else | |
706 |
|
706 | |||
707 | Test that "hg status" against revisions other than parent ignores exec |
|
707 | Test that "hg status" against revisions other than parent ignores exec | |
708 | bit correctly on the platform being unaware of it. |
|
708 | bit correctly on the platform being unaware of it. | |
709 |
|
709 | |||
710 | $ hg update -q -C 4 |
|
710 | $ hg update -q -C 4 | |
711 |
|
711 | |||
712 | $ cat > ../exec-bit.patch <<EOF |
|
712 | $ cat > ../exec-bit.patch <<EOF | |
713 | > # HG changeset patch |
|
713 | > # HG changeset patch | |
714 | > # User test |
|
714 | > # User test | |
715 | > # Date 0 0 |
|
715 | > # Date 0 0 | |
716 | > # Thu Jan 01 00:00:00 1970 +0000 |
|
716 | > # Thu Jan 01 00:00:00 1970 +0000 | |
717 | > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90 |
|
717 | > # Node ID be1b433a65b12b27b5519d92213e14f7e1769b90 | |
718 | > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727 |
|
718 | > # Parent 07d6153b5c04313efb75deec9ba577de7faeb727 | |
719 | > chmod +x large2 |
|
719 | > chmod +x large2 | |
720 | > |
|
720 | > | |
721 | > diff --git a/.hglf/large2 b/.hglf/large2 |
|
721 | > diff --git a/.hglf/large2 b/.hglf/large2 | |
722 | > old mode 100644 |
|
722 | > old mode 100644 | |
723 | > new mode 100755 |
|
723 | > new mode 100755 | |
724 | > EOF |
|
724 | > EOF | |
725 | $ hg import --exact --bypass ../exec-bit.patch |
|
725 | $ hg import --exact --bypass ../exec-bit.patch | |
726 | applying ../exec-bit.patch |
|
726 | applying ../exec-bit.patch | |
727 | $ hg status -A --rev tip large2 |
|
727 | $ hg status -A --rev tip large2 | |
728 | C large2 |
|
728 | C large2 | |
729 |
|
729 | |||
730 | #endif |
|
730 | #endif | |
731 |
|
731 | |||
732 | The fileset revset is evaluated for each revision, instead of once on wdir(), |
|
732 | The fileset revset is evaluated for each revision, instead of once on wdir(), | |
733 | and then patterns matched on each revision. Here, no exec bits are set in |
|
733 | and then patterns matched on each revision. Here, no exec bits are set in | |
734 | wdir(), but a matching revision is detected. |
|
734 | wdir(), but a matching revision is detected. | |
735 |
|
735 | |||
736 | (Teach large2 is not an executable. Maybe this is a bug of largefiles.) |
|
736 | (Teach large2 is not an executable. Maybe this is a bug of largefiles.) | |
737 | #if execbit |
|
737 | #if execbit | |
738 | $ chmod -x .hglf/large2 |
|
738 | $ chmod -x .hglf/large2 | |
739 | #endif |
|
739 | #endif | |
740 |
|
740 | |||
741 | $ hg files 'set:exec()' |
|
741 | $ hg files 'set:exec()' | |
742 | [1] |
|
742 | [1] | |
743 | $ hg log -qr 'file("set:exec()")' |
|
743 | $ hg log -qr 'file("set:exec()")' | |
744 | 9:be1b433a65b1 |
|
744 | 9:be1b433a65b1 | |
745 |
|
745 | |||
746 | Test a fatal error interrupting an update. Verify that status report dirty |
|
746 | Test a fatal error interrupting an update. Verify that status report dirty | |
747 | files correctly after an interrupted update. Also verify that checking all |
|
747 | files correctly after an interrupted update. Also verify that checking all | |
748 | hashes reveals it isn't clean. |
|
748 | hashes reveals it isn't clean. | |
749 |
|
749 | |||
750 | Start with clean dirstates: |
|
750 | Start with clean dirstates: | |
751 | $ hg up --quiet --clean --rev "8^" |
|
751 | $ hg up --quiet --clean --rev "8^" | |
752 | $ sleep 1 |
|
752 | $ sleep 1 | |
753 | $ hg st |
|
753 | $ hg st | |
754 | Update standins without updating largefiles - large1 is modified and largeX is |
|
754 | Update standins without updating largefiles - large1 is modified and largeX is | |
755 | added: |
|
755 | added: | |
756 | $ cat << EOF > ../crashupdatelfiles.py |
|
756 | $ cat << EOF > ../crashupdatelfiles.py | |
757 | > import hgext.largefiles.lfutil |
|
757 | > import hgext.largefiles.lfutil | |
758 | > def getlfilestoupdate(oldstandins, newstandins): |
|
758 | > def getlfilestoupdate(oldstandins, newstandins): | |
759 | > raise SystemExit(7) |
|
759 | > raise SystemExit(7) | |
760 | > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate |
|
760 | > hgext.largefiles.lfutil.getlfilestoupdate = getlfilestoupdate | |
761 | > EOF |
|
761 | > EOF | |
762 | $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py |
|
762 | $ hg up -Cr "8" --config extensions.crashupdatelfiles=../crashupdatelfiles.py | |
763 | [7] |
|
763 | [7] | |
764 | Check large1 content and status ... and that update will undo modifications: |
|
764 | Check large1 content and status ... and that update will undo modifications: | |
765 | $ cat large1 |
|
765 | $ cat large1 | |
766 | large1 in #3 |
|
766 | large1 in #3 | |
767 | $ hg st |
|
767 | $ hg st | |
768 | M large1 |
|
768 | M large1 | |
769 | ! largeX |
|
769 | ! largeX | |
770 | $ hg up -Cr . |
|
770 | $ hg up -Cr . | |
771 | getting changed largefiles |
|
771 | getting changed largefiles | |
772 | 2 largefiles updated, 0 removed |
|
772 | 2 largefiles updated, 0 removed | |
773 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
773 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
774 | $ cat large1 |
|
774 | $ cat large1 | |
775 | manually modified before 'hg transplant --continue' |
|
775 | manually modified before 'hg transplant --continue' | |
776 | $ hg st |
|
776 | $ hg st | |
777 | Force largefiles rehashing and check that all changes have been caught by |
|
777 | Force largefiles rehashing and check that all changes have been caught by | |
778 | status and update: |
|
778 | status and update: | |
779 | $ rm .hg/largefiles/dirstate |
|
779 | $ rm .hg/largefiles/dirstate | |
780 | $ hg st |
|
780 | $ hg st | |
781 |
|
781 | |||
782 | $ cd .. |
|
782 | $ cd .. | |
783 |
|
783 | |||
784 | Test that "hg convert" avoids copying largefiles from the working |
|
784 | Test that "hg convert" avoids copying largefiles from the working | |
785 | directory into store, because "hg convert" doesn't update largefiles |
|
785 | directory into store, because "hg convert" doesn't update largefiles | |
786 | in the working directory (removing files under ".cache/largefiles" |
|
786 | in the working directory (removing files under ".cache/largefiles" | |
787 | forces "hg convert" to copy corresponding largefiles) |
|
787 | forces "hg convert" to copy corresponding largefiles) | |
788 |
|
788 | |||
789 | $ cat >> $HGRCPATH <<EOF |
|
789 | $ cat >> $HGRCPATH <<EOF | |
790 | > [extensions] |
|
790 | > [extensions] | |
791 | > convert = |
|
791 | > convert = | |
792 | > EOF |
|
792 | > EOF | |
793 |
|
793 | |||
794 | $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671 |
|
794 | $ rm $TESTTMP/.cache/largefiles/6a4f36d4075fbe0f30ec1d26ca44e63c05903671 | |
795 | $ hg convert -q repo repo.converted |
|
795 | $ hg convert -q repo repo.converted |
@@ -1,1889 +1,1889 b'' | |||||
1 | This file used to contains all largefile tests. |
|
1 | This file used to contains all largefile tests. | |
2 | Do not add any new tests in this file as it his already far too long to run. |
|
2 | Do not add any new tests in this file as it his already far too long to run. | |
3 |
|
3 | |||
4 | It contains all the testing of the basic concepts of large file in a single block. |
|
4 | It contains all the testing of the basic concepts of large file in a single block. | |
5 |
|
5 | |||
6 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE |
|
6 | $ USERCACHE="$TESTTMP/cache"; export USERCACHE | |
7 | $ mkdir "${USERCACHE}" |
|
7 | $ mkdir "${USERCACHE}" | |
8 | $ cat >> $HGRCPATH <<EOF |
|
8 | $ cat >> $HGRCPATH <<EOF | |
9 | > [extensions] |
|
9 | > [extensions] | |
10 | > largefiles= |
|
10 | > largefiles= | |
11 | > purge= |
|
11 | > purge= | |
12 | > rebase= |
|
12 | > rebase= | |
13 | > transplant= |
|
13 | > transplant= | |
14 | > [phases] |
|
14 | > [phases] | |
15 | > publish=False |
|
15 | > publish=False | |
16 | > [largefiles] |
|
16 | > [largefiles] | |
17 | > minsize=2 |
|
17 | > minsize=2 | |
18 | > patterns=glob:**.dat |
|
18 | > patterns=glob:**.dat | |
19 | > usercache=${USERCACHE} |
|
19 | > usercache=${USERCACHE} | |
20 | > [hooks] |
|
20 | > [hooks] | |
21 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" |
|
21 | > precommit=sh -c "echo \\"Invoking status precommit hook\\"; hg status" | |
22 | > EOF |
|
22 | > EOF | |
23 |
|
23 | |||
24 | Create the repo with a couple of revisions of both large and normal |
|
24 | Create the repo with a couple of revisions of both large and normal | |
25 | files. |
|
25 | files. | |
26 | Test status and dirstate of largefiles and that summary output is correct. |
|
26 | Test status and dirstate of largefiles and that summary output is correct. | |
27 |
|
27 | |||
28 | $ hg init a |
|
28 | $ hg init a | |
29 | $ cd a |
|
29 | $ cd a | |
30 | $ mkdir sub |
|
30 | $ mkdir sub | |
31 | $ echo normal1 > normal1 |
|
31 | $ echo normal1 > normal1 | |
32 | $ echo normal2 > sub/normal2 |
|
32 | $ echo normal2 > sub/normal2 | |
33 | $ echo large1 > large1 |
|
33 | $ echo large1 > large1 | |
34 | $ echo large2 > sub/large2 |
|
34 | $ echo large2 > sub/large2 | |
35 | $ hg add normal1 sub/normal2 |
|
35 | $ hg add normal1 sub/normal2 | |
36 | $ hg add --large large1 sub/large2 |
|
36 | $ hg add --large large1 sub/large2 | |
37 | $ hg commit -m "add files" |
|
37 | $ hg commit -m "add files" | |
38 | Invoking status precommit hook |
|
38 | Invoking status precommit hook | |
39 | A large1 |
|
39 | A large1 | |
40 | A normal1 |
|
40 | A normal1 | |
41 | A sub/large2 |
|
41 | A sub/large2 | |
42 | A sub/normal2 |
|
42 | A sub/normal2 | |
43 | $ touch large1 sub/large2 |
|
43 | $ touch large1 sub/large2 | |
44 | $ sleep 1 |
|
44 | $ sleep 1 | |
45 | $ hg st |
|
45 | $ hg st | |
46 | $ hg debugstate --no-dates |
|
46 | $ hg debugstate --no-dates | |
47 | n 644 41 set .hglf/large1 |
|
47 | n 644 41 set .hglf/large1 | |
48 | n 644 41 set .hglf/sub/large2 |
|
48 | n 644 41 set .hglf/sub/large2 | |
49 | n 644 8 set normal1 |
|
49 | n 644 8 set normal1 | |
50 | n 644 8 set sub/normal2 |
|
50 | n 644 8 set sub/normal2 | |
51 | $ hg debugstate --large --no-dates |
|
51 | $ hg debugstate --large --no-dates | |
52 | n 644 7 set large1 |
|
52 | n 644 7 set large1 | |
53 | n 644 7 set sub/large2 |
|
53 | n 644 7 set sub/large2 | |
54 | $ echo normal11 > normal1 |
|
54 | $ echo normal11 > normal1 | |
55 | $ echo normal22 > sub/normal2 |
|
55 | $ echo normal22 > sub/normal2 | |
56 | $ echo large11 > large1 |
|
56 | $ echo large11 > large1 | |
57 | $ echo large22 > sub/large2 |
|
57 | $ echo large22 > sub/large2 | |
58 | $ hg commit -m "edit files" |
|
58 | $ hg commit -m "edit files" | |
59 | Invoking status precommit hook |
|
59 | Invoking status precommit hook | |
60 | M large1 |
|
60 | M large1 | |
61 | M normal1 |
|
61 | M normal1 | |
62 | M sub/large2 |
|
62 | M sub/large2 | |
63 | M sub/normal2 |
|
63 | M sub/normal2 | |
64 | $ hg sum --large |
|
64 | $ hg sum --large | |
65 | parent: 1:ce8896473775 tip |
|
65 | parent: 1:ce8896473775 tip | |
66 | edit files |
|
66 | edit files | |
67 | branch: default |
|
67 | branch: default | |
68 | commit: (clean) |
|
68 | commit: (clean) | |
69 | update: (current) |
|
69 | update: (current) | |
70 | phases: 2 draft |
|
70 | phases: 2 draft | |
71 | largefiles: (no remote repo) |
|
71 | largefiles: (no remote repo) | |
72 |
|
72 | |||
73 | Commit preserved largefile contents. |
|
73 | Commit preserved largefile contents. | |
74 |
|
74 | |||
75 | $ cat normal1 |
|
75 | $ cat normal1 | |
76 | normal11 |
|
76 | normal11 | |
77 | $ cat large1 |
|
77 | $ cat large1 | |
78 | large11 |
|
78 | large11 | |
79 | $ cat sub/normal2 |
|
79 | $ cat sub/normal2 | |
80 | normal22 |
|
80 | normal22 | |
81 | $ cat sub/large2 |
|
81 | $ cat sub/large2 | |
82 | large22 |
|
82 | large22 | |
83 |
|
83 | |||
84 | Test status, subdir and unknown files |
|
84 | Test status, subdir and unknown files | |
85 |
|
85 | |||
86 | $ echo unknown > sub/unknown |
|
86 | $ echo unknown > sub/unknown | |
87 | $ hg st --all |
|
87 | $ hg st --all | |
88 | ? sub/unknown |
|
88 | ? sub/unknown | |
89 | C large1 |
|
89 | C large1 | |
90 | C normal1 |
|
90 | C normal1 | |
91 | C sub/large2 |
|
91 | C sub/large2 | |
92 | C sub/normal2 |
|
92 | C sub/normal2 | |
93 | $ hg st --all sub |
|
93 | $ hg st --all sub | |
94 | ? sub/unknown |
|
94 | ? sub/unknown | |
95 | C sub/large2 |
|
95 | C sub/large2 | |
96 | C sub/normal2 |
|
96 | C sub/normal2 | |
97 | $ rm sub/unknown |
|
97 | $ rm sub/unknown | |
98 |
|
98 | |||
99 | Test messages and exit codes for remove warning cases |
|
99 | Test messages and exit codes for remove warning cases | |
100 |
|
100 | |||
101 | $ hg remove -A large1 |
|
101 | $ hg remove -A large1 | |
102 | not removing large1: file still exists |
|
102 | not removing large1: file still exists | |
103 | [1] |
|
103 | [1] | |
104 | $ echo 'modified' > large1 |
|
104 | $ echo 'modified' > large1 | |
105 | $ hg remove large1 |
|
105 | $ hg remove large1 | |
106 | not removing large1: file is modified (use -f to force removal) |
|
106 | not removing large1: file is modified (use -f to force removal) | |
107 | [1] |
|
107 | [1] | |
108 | $ echo 'new' > normalnew |
|
108 | $ echo 'new' > normalnew | |
109 | $ hg add normalnew |
|
109 | $ hg add normalnew | |
110 | $ echo 'new' > largenew |
|
110 | $ echo 'new' > largenew | |
111 | $ hg add --large normalnew |
|
111 | $ hg add --large normalnew | |
112 | normalnew already tracked! |
|
112 | normalnew already tracked! | |
113 | $ hg remove normalnew largenew |
|
113 | $ hg remove normalnew largenew | |
114 | not removing largenew: file is untracked |
|
114 | not removing largenew: file is untracked | |
115 | not removing normalnew: file has been marked for add (use 'hg forget' to undo add) |
|
115 | not removing normalnew: file has been marked for add (use 'hg forget' to undo add) | |
116 | [1] |
|
116 | [1] | |
117 | $ rm normalnew largenew |
|
117 | $ rm normalnew largenew | |
118 | $ hg up -Cq |
|
118 | $ hg up -Cq | |
119 |
|
119 | |||
120 | Remove both largefiles and normal files. |
|
120 | Remove both largefiles and normal files. | |
121 |
|
121 | |||
122 | $ hg remove normal1 large1 |
|
122 | $ hg remove normal1 large1 | |
123 | $ hg status large1 |
|
123 | $ hg status large1 | |
124 | R large1 |
|
124 | R large1 | |
125 | $ hg commit -m "remove files" |
|
125 | $ hg commit -m "remove files" | |
126 | Invoking status precommit hook |
|
126 | Invoking status precommit hook | |
127 | R large1 |
|
127 | R large1 | |
128 | R normal1 |
|
128 | R normal1 | |
129 | $ ls |
|
129 | $ ls | |
130 | sub |
|
130 | sub | |
131 | $ echo "testlargefile" > large1-test |
|
131 | $ echo "testlargefile" > large1-test | |
132 | $ hg add --large large1-test |
|
132 | $ hg add --large large1-test | |
133 | $ hg st |
|
133 | $ hg st | |
134 | A large1-test |
|
134 | A large1-test | |
135 | $ hg rm large1-test |
|
135 | $ hg rm large1-test | |
136 | not removing large1-test: file has been marked for add (use forget to undo) |
|
136 | not removing large1-test: file has been marked for add (use forget to undo) | |
137 | [1] |
|
137 | [1] | |
138 | $ hg st |
|
138 | $ hg st | |
139 | A large1-test |
|
139 | A large1-test | |
140 | $ hg forget large1-test |
|
140 | $ hg forget large1-test | |
141 | $ hg st |
|
141 | $ hg st | |
142 | ? large1-test |
|
142 | ? large1-test | |
143 | $ hg remove large1-test |
|
143 | $ hg remove large1-test | |
144 | not removing large1-test: file is untracked |
|
144 | not removing large1-test: file is untracked | |
145 | [1] |
|
145 | [1] | |
146 | $ hg forget large1-test |
|
146 | $ hg forget large1-test | |
147 | not removing large1-test: file is already untracked |
|
147 | not removing large1-test: file is already untracked | |
148 | [1] |
|
148 | [1] | |
149 | $ rm large1-test |
|
149 | $ rm large1-test | |
150 |
|
150 | |||
151 | Copy both largefiles and normal files (testing that status output is correct). |
|
151 | Copy both largefiles and normal files (testing that status output is correct). | |
152 |
|
152 | |||
153 | $ hg cp sub/normal2 normal1 |
|
153 | $ hg cp sub/normal2 normal1 | |
154 | $ hg cp sub/large2 large1 |
|
154 | $ hg cp sub/large2 large1 | |
155 | $ hg commit -m "copy files" |
|
155 | $ hg commit -m "copy files" | |
156 | Invoking status precommit hook |
|
156 | Invoking status precommit hook | |
157 | A large1 |
|
157 | A large1 | |
158 | A normal1 |
|
158 | A normal1 | |
159 | $ cat normal1 |
|
159 | $ cat normal1 | |
160 | normal22 |
|
160 | normal22 | |
161 | $ cat large1 |
|
161 | $ cat large1 | |
162 | large22 |
|
162 | large22 | |
163 |
|
163 | |||
164 | Test moving largefiles and verify that normal files are also unaffected. |
|
164 | Test moving largefiles and verify that normal files are also unaffected. | |
165 |
|
165 | |||
166 | $ hg mv normal1 normal3 |
|
166 | $ hg mv normal1 normal3 | |
167 | $ hg mv large1 large3 |
|
167 | $ hg mv large1 large3 | |
168 | $ hg mv sub/normal2 sub/normal4 |
|
168 | $ hg mv sub/normal2 sub/normal4 | |
169 | $ hg mv sub/large2 sub/large4 |
|
169 | $ hg mv sub/large2 sub/large4 | |
170 | $ hg commit -m "move files" |
|
170 | $ hg commit -m "move files" | |
171 | Invoking status precommit hook |
|
171 | Invoking status precommit hook | |
172 | A large3 |
|
172 | A large3 | |
173 | A normal3 |
|
173 | A normal3 | |
174 | A sub/large4 |
|
174 | A sub/large4 | |
175 | A sub/normal4 |
|
175 | A sub/normal4 | |
176 | R large1 |
|
176 | R large1 | |
177 | R normal1 |
|
177 | R normal1 | |
178 | R sub/large2 |
|
178 | R sub/large2 | |
179 | R sub/normal2 |
|
179 | R sub/normal2 | |
180 | $ cat normal3 |
|
180 | $ cat normal3 | |
181 | normal22 |
|
181 | normal22 | |
182 | $ cat large3 |
|
182 | $ cat large3 | |
183 | large22 |
|
183 | large22 | |
184 | $ cat sub/normal4 |
|
184 | $ cat sub/normal4 | |
185 | normal22 |
|
185 | normal22 | |
186 | $ cat sub/large4 |
|
186 | $ cat sub/large4 | |
187 | large22 |
|
187 | large22 | |
188 |
|
188 | |||
189 |
|
189 | |||
190 | #if serve |
|
190 | #if serve | |
191 | Test display of largefiles in hgweb |
|
191 | Test display of largefiles in hgweb | |
192 |
|
192 | |||
193 | $ hg serve -d -p $HGPORT --pid-file ../hg.pid |
|
193 | $ hg serve -d -p $HGPORT --pid-file ../hg.pid | |
194 | $ cat ../hg.pid >> $DAEMON_PIDS |
|
194 | $ cat ../hg.pid >> $DAEMON_PIDS | |
195 | $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw' |
|
195 | $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/?style=raw' | |
196 | 200 Script output follows |
|
196 | 200 Script output follows | |
197 |
|
197 | |||
198 |
|
198 | |||
199 | drwxr-xr-x sub |
|
199 | drwxr-xr-x sub | |
200 | -rw-r--r-- 41 large3 |
|
200 | -rw-r--r-- 41 large3 | |
201 | -rw-r--r-- 9 normal3 |
|
201 | -rw-r--r-- 9 normal3 | |
202 |
|
202 | |||
203 |
|
203 | |||
204 | $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw' |
|
204 | $ get-with-headers.py $LOCALIP:$HGPORT 'file/tip/sub/?style=raw' | |
205 | 200 Script output follows |
|
205 | 200 Script output follows | |
206 |
|
206 | |||
207 |
|
207 | |||
208 | -rw-r--r-- 41 large4 |
|
208 | -rw-r--r-- 41 large4 | |
209 | -rw-r--r-- 9 normal4 |
|
209 | -rw-r--r-- 9 normal4 | |
210 |
|
210 | |||
211 |
|
211 | |||
212 | $ killdaemons.py |
|
212 | $ killdaemons.py | |
213 | #endif |
|
213 | #endif | |
214 |
|
214 | |||
215 | Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail) |
|
215 | Test largefiles can be loaded in hgweb (wrapcommand() shouldn't fail) | |
216 |
|
216 | |||
217 | $ cat <<EOF > "$TESTTMP/hgweb.cgi" |
|
217 | $ cat <<EOF > "$TESTTMP/hgweb.cgi" | |
218 | > #!$PYTHON |
|
218 | > #!$PYTHON | |
219 | > from mercurial import demandimport; demandimport.enable() |
|
219 | > from mercurial import demandimport; demandimport.enable() | |
220 | > from mercurial.hgweb import hgweb |
|
220 | > from mercurial.hgweb import hgweb | |
221 | > from mercurial.hgweb import wsgicgi |
|
221 | > from mercurial.hgweb import wsgicgi | |
222 | > application = hgweb(b'.', b'test repo') |
|
222 | > application = hgweb(b'.', b'test repo') | |
223 | > wsgicgi.launch(application) |
|
223 | > wsgicgi.launch(application) | |
224 | > EOF |
|
224 | > EOF | |
225 | $ . "$TESTDIR/cgienv" |
|
225 | $ . "$TESTDIR/cgienv" | |
226 |
|
226 | |||
227 | $ SCRIPT_NAME='' \ |
|
227 | $ SCRIPT_NAME='' \ | |
228 | > "$PYTHON" "$TESTTMP/hgweb.cgi" > /dev/null |
|
228 | > "$PYTHON" "$TESTTMP/hgweb.cgi" > /dev/null | |
229 |
|
229 | |||
230 | Test archiving the various revisions. These hit corner cases known with |
|
230 | Test archiving the various revisions. These hit corner cases known with | |
231 | archiving. |
|
231 | archiving. | |
232 |
|
232 | |||
233 | $ hg archive -r 0 ../archive0 |
|
233 | $ hg archive -r 0 ../archive0 | |
234 | $ hg archive -r 1 ../archive1 |
|
234 | $ hg archive -r 1 ../archive1 | |
235 | $ hg archive -r 2 ../archive2 |
|
235 | $ hg archive -r 2 ../archive2 | |
236 | $ hg archive -r 3 ../archive3 |
|
236 | $ hg archive -r 3 ../archive3 | |
237 | $ hg archive -r 4 ../archive4 |
|
237 | $ hg archive -r 4 ../archive4 | |
238 | $ cd ../archive0 |
|
238 | $ cd ../archive0 | |
239 | $ cat normal1 |
|
239 | $ cat normal1 | |
240 | normal1 |
|
240 | normal1 | |
241 | $ cat large1 |
|
241 | $ cat large1 | |
242 | large1 |
|
242 | large1 | |
243 | $ cat sub/normal2 |
|
243 | $ cat sub/normal2 | |
244 | normal2 |
|
244 | normal2 | |
245 | $ cat sub/large2 |
|
245 | $ cat sub/large2 | |
246 | large2 |
|
246 | large2 | |
247 | $ cd ../archive1 |
|
247 | $ cd ../archive1 | |
248 | $ cat normal1 |
|
248 | $ cat normal1 | |
249 | normal11 |
|
249 | normal11 | |
250 | $ cat large1 |
|
250 | $ cat large1 | |
251 | large11 |
|
251 | large11 | |
252 | $ cat sub/normal2 |
|
252 | $ cat sub/normal2 | |
253 | normal22 |
|
253 | normal22 | |
254 | $ cat sub/large2 |
|
254 | $ cat sub/large2 | |
255 | large22 |
|
255 | large22 | |
256 | $ cd ../archive2 |
|
256 | $ cd ../archive2 | |
257 | $ ls |
|
257 | $ ls | |
258 | sub |
|
258 | sub | |
259 | $ cat sub/normal2 |
|
259 | $ cat sub/normal2 | |
260 | normal22 |
|
260 | normal22 | |
261 | $ cat sub/large2 |
|
261 | $ cat sub/large2 | |
262 | large22 |
|
262 | large22 | |
263 | $ cd ../archive3 |
|
263 | $ cd ../archive3 | |
264 | $ cat normal1 |
|
264 | $ cat normal1 | |
265 | normal22 |
|
265 | normal22 | |
266 | $ cat large1 |
|
266 | $ cat large1 | |
267 | large22 |
|
267 | large22 | |
268 | $ cat sub/normal2 |
|
268 | $ cat sub/normal2 | |
269 | normal22 |
|
269 | normal22 | |
270 | $ cat sub/large2 |
|
270 | $ cat sub/large2 | |
271 | large22 |
|
271 | large22 | |
272 | $ cd ../archive4 |
|
272 | $ cd ../archive4 | |
273 | $ cat normal3 |
|
273 | $ cat normal3 | |
274 | normal22 |
|
274 | normal22 | |
275 | $ cat large3 |
|
275 | $ cat large3 | |
276 | large22 |
|
276 | large22 | |
277 | $ cat sub/normal4 |
|
277 | $ cat sub/normal4 | |
278 | normal22 |
|
278 | normal22 | |
279 | $ cat sub/large4 |
|
279 | $ cat sub/large4 | |
280 | large22 |
|
280 | large22 | |
281 |
|
281 | |||
282 | Commit corner case: specify files to commit. |
|
282 | Commit corner case: specify files to commit. | |
283 |
|
283 | |||
284 | $ cd ../a |
|
284 | $ cd ../a | |
285 | $ echo normal3 > normal3 |
|
285 | $ echo normal3 > normal3 | |
286 | $ echo large3 > large3 |
|
286 | $ echo large3 > large3 | |
287 | $ echo normal4 > sub/normal4 |
|
287 | $ echo normal4 > sub/normal4 | |
288 | $ echo large4 > sub/large4 |
|
288 | $ echo large4 > sub/large4 | |
289 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" |
|
289 | $ hg commit normal3 large3 sub/normal4 sub/large4 -m "edit files again" | |
290 | Invoking status precommit hook |
|
290 | Invoking status precommit hook | |
291 | M large3 |
|
291 | M large3 | |
292 | M normal3 |
|
292 | M normal3 | |
293 | M sub/large4 |
|
293 | M sub/large4 | |
294 | M sub/normal4 |
|
294 | M sub/normal4 | |
295 | $ cat normal3 |
|
295 | $ cat normal3 | |
296 | normal3 |
|
296 | normal3 | |
297 | $ cat large3 |
|
297 | $ cat large3 | |
298 | large3 |
|
298 | large3 | |
299 | $ cat sub/normal4 |
|
299 | $ cat sub/normal4 | |
300 | normal4 |
|
300 | normal4 | |
301 | $ cat sub/large4 |
|
301 | $ cat sub/large4 | |
302 | large4 |
|
302 | large4 | |
303 |
|
303 | |||
304 | One more commit corner case: commit from a subdirectory. |
|
304 | One more commit corner case: commit from a subdirectory. | |
305 |
|
305 | |||
306 | $ cd ../a |
|
306 | $ cd ../a | |
307 | $ echo normal33 > normal3 |
|
307 | $ echo normal33 > normal3 | |
308 | $ echo large33 > large3 |
|
308 | $ echo large33 > large3 | |
309 | $ echo normal44 > sub/normal4 |
|
309 | $ echo normal44 > sub/normal4 | |
310 | $ echo large44 > sub/large4 |
|
310 | $ echo large44 > sub/large4 | |
311 | $ cd sub |
|
311 | $ cd sub | |
312 | $ hg commit -m "edit files yet again" |
|
312 | $ hg commit -m "edit files yet again" | |
313 | Invoking status precommit hook |
|
313 | Invoking status precommit hook | |
314 | M large3 |
|
314 | M large3 | |
315 | M normal3 |
|
315 | M normal3 | |
316 | M sub/large4 |
|
316 | M sub/large4 | |
317 | M sub/normal4 |
|
317 | M sub/normal4 | |
318 | $ cat ../normal3 |
|
318 | $ cat ../normal3 | |
319 | normal33 |
|
319 | normal33 | |
320 | $ cat ../large3 |
|
320 | $ cat ../large3 | |
321 | large33 |
|
321 | large33 | |
322 | $ cat normal4 |
|
322 | $ cat normal4 | |
323 | normal44 |
|
323 | normal44 | |
324 | $ cat large4 |
|
324 | $ cat large4 | |
325 | large44 |
|
325 | large44 | |
326 |
|
326 | |||
327 | Committing standins is not allowed. |
|
327 | Committing standins is not allowed. | |
328 |
|
328 | |||
329 | $ cd .. |
|
329 | $ cd .. | |
330 | $ echo large3 > large3 |
|
330 | $ echo large3 > large3 | |
331 | $ hg commit .hglf/large3 -m "try to commit standin" |
|
331 | $ hg commit .hglf/large3 -m "try to commit standin" | |
332 | abort: file ".hglf/large3" is a largefile standin |
|
332 | abort: file ".hglf/large3" is a largefile standin | |
333 | (commit the largefile itself instead) |
|
333 | (commit the largefile itself instead) | |
334 | [255] |
|
334 | [255] | |
335 |
|
335 | |||
336 | Corner cases for adding largefiles. |
|
336 | Corner cases for adding largefiles. | |
337 |
|
337 | |||
338 | $ echo large5 > large5 |
|
338 | $ echo large5 > large5 | |
339 | $ hg add --large large5 |
|
339 | $ hg add --large large5 | |
340 | $ hg add --large large5 |
|
340 | $ hg add --large large5 | |
341 | large5 already a largefile |
|
341 | large5 already a largefile | |
342 | $ mkdir sub2 |
|
342 | $ mkdir sub2 | |
343 | $ echo large6 > sub2/large6 |
|
343 | $ echo large6 > sub2/large6 | |
344 | $ echo large7 > sub2/large7 |
|
344 | $ echo large7 > sub2/large7 | |
345 | $ hg add --large sub2 |
|
345 | $ hg add --large sub2 | |
346 | adding sub2/large6 as a largefile |
|
346 | adding sub2/large6 as a largefile | |
347 | adding sub2/large7 as a largefile |
|
347 | adding sub2/large7 as a largefile | |
348 | $ hg st |
|
348 | $ hg st | |
349 | M large3 |
|
349 | M large3 | |
350 | A large5 |
|
350 | A large5 | |
351 | A sub2/large6 |
|
351 | A sub2/large6 | |
352 | A sub2/large7 |
|
352 | A sub2/large7 | |
353 |
|
353 | |||
354 | Committing directories containing only largefiles. |
|
354 | Committing directories containing only largefiles. | |
355 |
|
355 | |||
356 | $ mkdir -p z/y/x/m |
|
356 | $ mkdir -p z/y/x/m | |
357 | $ touch z/y/x/m/large1 |
|
357 | $ touch z/y/x/m/large1 | |
358 | $ touch z/y/x/large2 |
|
358 | $ touch z/y/x/large2 | |
359 | $ hg add --large z/y/x/m/large1 z/y/x/large2 |
|
359 | $ hg add --large z/y/x/m/large1 z/y/x/large2 | |
360 | $ hg commit -m "Subdir with directory only containing largefiles" z |
|
360 | $ hg commit -m "Subdir with directory only containing largefiles" z | |
361 | Invoking status precommit hook |
|
361 | Invoking status precommit hook | |
362 | M large3 |
|
362 | M large3 | |
363 | A large5 |
|
363 | A large5 | |
364 | A sub2/large6 |
|
364 | A sub2/large6 | |
365 | A sub2/large7 |
|
365 | A sub2/large7 | |
366 | A z/y/x/large2 |
|
366 | A z/y/x/large2 | |
367 | A z/y/x/m/large1 |
|
367 | A z/y/x/m/large1 | |
368 |
|
368 | |||
369 | (and a bit of log testing) |
|
369 | (and a bit of log testing) | |
370 |
|
370 | |||
371 | $ hg log -T '{rev}\n' z/y/x/m/large1 |
|
371 | $ hg log -T '{rev}\n' z/y/x/m/large1 | |
372 | 7 |
|
372 | 7 | |
373 | $ hg log -T '{rev}\n' z/y/x/m # with only a largefile |
|
373 | $ hg log -T '{rev}\n' z/y/x/m # with only a largefile | |
374 | 7 |
|
374 | 7 | |
375 |
|
375 | |||
376 | $ hg rollback --quiet |
|
376 | $ hg rollback --quiet | |
377 | $ touch z/y/x/m/normal |
|
377 | $ touch z/y/x/m/normal | |
378 | $ hg add z/y/x/m/normal |
|
378 | $ hg add z/y/x/m/normal | |
379 | $ hg commit -m "Subdir with mixed contents" z |
|
379 | $ hg commit -m "Subdir with mixed contents" z | |
380 | Invoking status precommit hook |
|
380 | Invoking status precommit hook | |
381 | M large3 |
|
381 | M large3 | |
382 | A large5 |
|
382 | A large5 | |
383 | A sub2/large6 |
|
383 | A sub2/large6 | |
384 | A sub2/large7 |
|
384 | A sub2/large7 | |
385 | A z/y/x/large2 |
|
385 | A z/y/x/large2 | |
386 | A z/y/x/m/large1 |
|
386 | A z/y/x/m/large1 | |
387 | A z/y/x/m/normal |
|
387 | A z/y/x/m/normal | |
388 | $ hg st |
|
388 | $ hg st | |
389 | M large3 |
|
389 | M large3 | |
390 | A large5 |
|
390 | A large5 | |
391 | A sub2/large6 |
|
391 | A sub2/large6 | |
392 | A sub2/large7 |
|
392 | A sub2/large7 | |
393 | $ hg rollback --quiet |
|
393 | $ hg rollback --quiet | |
394 | $ hg revert z/y/x/large2 z/y/x/m/large1 |
|
394 | $ hg revert z/y/x/large2 z/y/x/m/large1 | |
395 | $ rm z/y/x/large2 z/y/x/m/large1 |
|
395 | $ rm z/y/x/large2 z/y/x/m/large1 | |
396 | $ hg commit -m "Subdir with normal contents" z |
|
396 | $ hg commit -m "Subdir with normal contents" z | |
397 | Invoking status precommit hook |
|
397 | Invoking status precommit hook | |
398 | M large3 |
|
398 | M large3 | |
399 | A large5 |
|
399 | A large5 | |
400 | A sub2/large6 |
|
400 | A sub2/large6 | |
401 | A sub2/large7 |
|
401 | A sub2/large7 | |
402 | A z/y/x/m/normal |
|
402 | A z/y/x/m/normal | |
403 | $ hg st |
|
403 | $ hg st | |
404 | M large3 |
|
404 | M large3 | |
405 | A large5 |
|
405 | A large5 | |
406 | A sub2/large6 |
|
406 | A sub2/large6 | |
407 | A sub2/large7 |
|
407 | A sub2/large7 | |
408 | $ hg rollback --quiet |
|
408 | $ hg rollback --quiet | |
409 | $ hg revert --quiet z |
|
409 | $ hg revert --quiet z | |
410 | $ hg commit -m "Empty subdir" z |
|
410 | $ hg commit -m "Empty subdir" z | |
411 | abort: z: no match under directory! |
|
411 | abort: z: no match under directory! | |
412 | [255] |
|
412 | [255] | |
413 | $ rm -rf z |
|
413 | $ rm -rf z | |
414 | $ hg ci -m "standin" .hglf |
|
414 | $ hg ci -m "standin" .hglf | |
415 | abort: file ".hglf" is a largefile standin |
|
415 | abort: file ".hglf" is a largefile standin | |
416 | (commit the largefile itself instead) |
|
416 | (commit the largefile itself instead) | |
417 | [255] |
|
417 | [255] | |
418 |
|
418 | |||
419 | Test "hg status" with combination of 'file pattern' and 'directory |
|
419 | Test "hg status" with combination of 'file pattern' and 'directory | |
420 | pattern' for largefiles: |
|
420 | pattern' for largefiles: | |
421 |
|
421 | |||
422 | $ hg status sub2/large6 sub2 |
|
422 | $ hg status sub2/large6 sub2 | |
423 | A sub2/large6 |
|
423 | A sub2/large6 | |
424 | A sub2/large7 |
|
424 | A sub2/large7 | |
425 |
|
425 | |||
426 | Config settings (pattern **.dat, minsize 2 MB) are respected. |
|
426 | Config settings (pattern **.dat, minsize 2 MB) are respected. | |
427 |
|
427 | |||
428 | $ echo testdata > test.dat |
|
428 | $ echo testdata > test.dat | |
429 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null |
|
429 | $ dd bs=1k count=2k if=/dev/zero of=reallylarge > /dev/null 2> /dev/null | |
430 | $ hg add |
|
430 | $ hg add | |
431 | adding reallylarge as a largefile |
|
431 | adding reallylarge as a largefile | |
432 | adding test.dat as a largefile |
|
432 | adding test.dat as a largefile | |
433 |
|
433 | |||
434 | Test that minsize and --lfsize handle float values; |
|
434 | Test that minsize and --lfsize handle float values; | |
435 | also tests that --lfsize overrides largefiles.minsize. |
|
435 | also tests that --lfsize overrides largefiles.minsize. | |
436 | (0.250 MB = 256 kB = 262144 B) |
|
436 | (0.250 MB = 256 kB = 262144 B) | |
437 |
|
437 | |||
438 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null |
|
438 | $ dd if=/dev/zero of=ratherlarge bs=1024 count=256 > /dev/null 2> /dev/null | |
439 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null |
|
439 | $ dd if=/dev/zero of=medium bs=1024 count=128 > /dev/null 2> /dev/null | |
440 | $ hg --config largefiles.minsize=.25 add |
|
440 | $ hg --config largefiles.minsize=.25 add | |
441 | adding ratherlarge as a largefile |
|
441 | adding ratherlarge as a largefile | |
442 | adding medium |
|
442 | adding medium | |
443 | $ hg forget medium |
|
443 | $ hg forget medium | |
444 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
444 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
445 | adding medium as a largefile |
|
445 | adding medium as a largefile | |
446 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null |
|
446 | $ dd if=/dev/zero of=notlarge bs=1024 count=127 > /dev/null 2> /dev/null | |
447 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 |
|
447 | $ hg --config largefiles.minsize=.25 add --lfsize=.125 | |
448 | adding notlarge |
|
448 | adding notlarge | |
449 | $ hg forget notlarge |
|
449 | $ hg forget notlarge | |
450 |
|
450 | |||
451 | Test forget on largefiles. |
|
451 | Test forget on largefiles. | |
452 |
|
452 | |||
453 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium |
|
453 | $ hg forget large3 large5 test.dat reallylarge ratherlarge medium | |
454 | $ hg commit -m "add/edit more largefiles" |
|
454 | $ hg commit -m "add/edit more largefiles" | |
455 | Invoking status precommit hook |
|
455 | Invoking status precommit hook | |
456 | A sub2/large6 |
|
456 | A sub2/large6 | |
457 | A sub2/large7 |
|
457 | A sub2/large7 | |
458 | R large3 |
|
458 | R large3 | |
459 | ? large5 |
|
459 | ? large5 | |
460 | ? medium |
|
460 | ? medium | |
461 | ? notlarge |
|
461 | ? notlarge | |
462 | ? ratherlarge |
|
462 | ? ratherlarge | |
463 | ? reallylarge |
|
463 | ? reallylarge | |
464 | ? test.dat |
|
464 | ? test.dat | |
465 | $ hg st |
|
465 | $ hg st | |
466 | ? large3 |
|
466 | ? large3 | |
467 | ? large5 |
|
467 | ? large5 | |
468 | ? medium |
|
468 | ? medium | |
469 | ? notlarge |
|
469 | ? notlarge | |
470 | ? ratherlarge |
|
470 | ? ratherlarge | |
471 | ? reallylarge |
|
471 | ? reallylarge | |
472 | ? test.dat |
|
472 | ? test.dat | |
473 |
|
473 | |||
474 | Purge with largefiles: verify that largefiles are still in the working |
|
474 | Purge with largefiles: verify that largefiles are still in the working | |
475 | dir after a purge. |
|
475 | dir after a purge. | |
476 |
|
476 | |||
477 | $ hg purge --all |
|
477 | $ hg purge --all | |
478 | $ cat sub/large4 |
|
478 | $ cat sub/large4 | |
479 | large44 |
|
479 | large44 | |
480 | $ cat sub2/large6 |
|
480 | $ cat sub2/large6 | |
481 | large6 |
|
481 | large6 | |
482 | $ cat sub2/large7 |
|
482 | $ cat sub2/large7 | |
483 | large7 |
|
483 | large7 | |
484 |
|
484 | |||
485 | Test addremove: verify that files that should be added as largefiles are added as |
|
485 | Test addremove: verify that files that should be added as largefiles are added as | |
486 | such and that already-existing largefiles are not added as normal files by |
|
486 | such and that already-existing largefiles are not added as normal files by | |
487 | accident. |
|
487 | accident. | |
488 |
|
488 | |||
489 | $ rm normal3 |
|
489 | $ rm normal3 | |
490 | $ rm sub/large4 |
|
490 | $ rm sub/large4 | |
491 | $ echo "testing addremove with patterns" > testaddremove.dat |
|
491 | $ echo "testing addremove with patterns" > testaddremove.dat | |
492 | $ echo "normaladdremove" > normaladdremove |
|
492 | $ echo "normaladdremove" > normaladdremove | |
493 | $ hg addremove |
|
493 | $ hg addremove | |
494 | removing sub/large4 |
|
494 | removing sub/large4 | |
495 | adding testaddremove.dat as a largefile |
|
495 | adding testaddremove.dat as a largefile | |
496 | removing normal3 |
|
496 | removing normal3 | |
497 | adding normaladdremove |
|
497 | adding normaladdremove | |
498 |
|
498 | |||
499 | Test addremove with -R |
|
499 | Test addremove with -R | |
500 |
|
500 | |||
501 | $ hg up -C |
|
501 | $ hg up -C | |
502 | getting changed largefiles |
|
502 | getting changed largefiles | |
503 | 1 largefiles updated, 0 removed |
|
503 | 1 largefiles updated, 0 removed | |
504 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
504 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
505 | $ rm normal3 |
|
505 | $ rm normal3 | |
506 | $ rm sub/large4 |
|
506 | $ rm sub/large4 | |
507 | $ echo "testing addremove with patterns" > testaddremove.dat |
|
507 | $ echo "testing addremove with patterns" > testaddremove.dat | |
508 | $ echo "normaladdremove" > normaladdremove |
|
508 | $ echo "normaladdremove" > normaladdremove | |
509 | $ cd .. |
|
509 | $ cd .. | |
510 | $ hg -R a -v addremove |
|
510 | $ hg -R a -v addremove | |
511 | removing sub/large4 |
|
511 | removing sub/large4 | |
512 | adding testaddremove.dat as a largefile |
|
512 | adding testaddremove.dat as a largefile | |
513 | removing normal3 |
|
513 | removing normal3 | |
514 | adding normaladdremove |
|
514 | adding normaladdremove | |
515 | $ cd a |
|
515 | $ cd a | |
516 |
|
516 | |||
517 | Test 3364 |
|
517 | Test 3364 | |
518 | $ hg clone . ../addrm |
|
518 | $ hg clone . ../addrm | |
519 | updating to branch default |
|
519 | updating to branch default | |
520 | getting changed largefiles |
|
520 | getting changed largefiles | |
521 | 3 largefiles updated, 0 removed |
|
521 | 3 largefiles updated, 0 removed | |
522 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
522 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
523 | $ cd ../addrm |
|
523 | $ cd ../addrm | |
524 | $ cat >> .hg/hgrc <<EOF |
|
524 | $ cat >> .hg/hgrc <<EOF | |
525 | > [hooks] |
|
525 | > [hooks] | |
526 | > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A" |
|
526 | > post-commit.stat=sh -c "echo \\"Invoking status postcommit hook\\"; hg status -A" | |
527 | > EOF |
|
527 | > EOF | |
528 | $ touch foo |
|
528 | $ touch foo | |
529 | $ hg add --large foo |
|
529 | $ hg add --large foo | |
530 | $ hg ci -m "add foo" |
|
530 | $ hg ci -m "add foo" | |
531 | Invoking status precommit hook |
|
531 | Invoking status precommit hook | |
532 | A foo |
|
532 | A foo | |
533 | Invoking status postcommit hook |
|
533 | Invoking status postcommit hook | |
534 | C foo |
|
534 | C foo | |
535 | C normal3 |
|
535 | C normal3 | |
536 | C sub/large4 |
|
536 | C sub/large4 | |
537 | C sub/normal4 |
|
537 | C sub/normal4 | |
538 | C sub2/large6 |
|
538 | C sub2/large6 | |
539 | C sub2/large7 |
|
539 | C sub2/large7 | |
540 | $ rm foo |
|
540 | $ rm foo | |
541 | $ hg st |
|
541 | $ hg st | |
542 | ! foo |
|
542 | ! foo | |
543 | hmm.. no precommit invoked, but there is a postcommit?? |
|
543 | hmm.. no precommit invoked, but there is a postcommit?? | |
544 | $ hg ci -m "will not checkin" |
|
544 | $ hg ci -m "will not checkin" | |
545 | nothing changed (1 missing files, see 'hg status') |
|
545 | nothing changed (1 missing files, see 'hg status') | |
546 | Invoking status postcommit hook |
|
546 | Invoking status postcommit hook | |
547 | ! foo |
|
547 | ! foo | |
548 | C normal3 |
|
548 | C normal3 | |
549 | C sub/large4 |
|
549 | C sub/large4 | |
550 | C sub/normal4 |
|
550 | C sub/normal4 | |
551 | C sub2/large6 |
|
551 | C sub2/large6 | |
552 | C sub2/large7 |
|
552 | C sub2/large7 | |
553 | [1] |
|
553 | [1] | |
554 | $ hg addremove |
|
554 | $ hg addremove | |
555 | removing foo |
|
555 | removing foo | |
556 | $ hg st |
|
556 | $ hg st | |
557 | R foo |
|
557 | R foo | |
558 | $ hg ci -m "used to say nothing changed" |
|
558 | $ hg ci -m "used to say nothing changed" | |
559 | Invoking status precommit hook |
|
559 | Invoking status precommit hook | |
560 | R foo |
|
560 | R foo | |
561 | Invoking status postcommit hook |
|
561 | Invoking status postcommit hook | |
562 | C normal3 |
|
562 | C normal3 | |
563 | C sub/large4 |
|
563 | C sub/large4 | |
564 | C sub/normal4 |
|
564 | C sub/normal4 | |
565 | C sub2/large6 |
|
565 | C sub2/large6 | |
566 | C sub2/large7 |
|
566 | C sub2/large7 | |
567 | $ hg st |
|
567 | $ hg st | |
568 |
|
568 | |||
569 | Test 3507 (both normal files and largefiles were a problem) |
|
569 | Test 3507 (both normal files and largefiles were a problem) | |
570 |
|
570 | |||
571 | $ touch normal |
|
571 | $ touch normal | |
572 | $ touch large |
|
572 | $ touch large | |
573 | $ hg add normal |
|
573 | $ hg add normal | |
574 | $ hg add --large large |
|
574 | $ hg add --large large | |
575 | $ hg ci -m "added" |
|
575 | $ hg ci -m "added" | |
576 | Invoking status precommit hook |
|
576 | Invoking status precommit hook | |
577 | A large |
|
577 | A large | |
578 | A normal |
|
578 | A normal | |
579 | Invoking status postcommit hook |
|
579 | Invoking status postcommit hook | |
580 | C large |
|
580 | C large | |
581 | C normal |
|
581 | C normal | |
582 | C normal3 |
|
582 | C normal3 | |
583 | C sub/large4 |
|
583 | C sub/large4 | |
584 | C sub/normal4 |
|
584 | C sub/normal4 | |
585 | C sub2/large6 |
|
585 | C sub2/large6 | |
586 | C sub2/large7 |
|
586 | C sub2/large7 | |
587 | $ hg remove normal |
|
587 | $ hg remove normal | |
588 | $ hg addremove --traceback |
|
588 | $ hg addremove --traceback | |
589 | $ hg ci -m "addremoved normal" |
|
589 | $ hg ci -m "addremoved normal" | |
590 | Invoking status precommit hook |
|
590 | Invoking status precommit hook | |
591 | R normal |
|
591 | R normal | |
592 | Invoking status postcommit hook |
|
592 | Invoking status postcommit hook | |
593 | C large |
|
593 | C large | |
594 | C normal3 |
|
594 | C normal3 | |
595 | C sub/large4 |
|
595 | C sub/large4 | |
596 | C sub/normal4 |
|
596 | C sub/normal4 | |
597 | C sub2/large6 |
|
597 | C sub2/large6 | |
598 | C sub2/large7 |
|
598 | C sub2/large7 | |
599 | $ hg up -C '.^' |
|
599 | $ hg up -C '.^' | |
600 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
600 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
601 | $ hg remove large |
|
601 | $ hg remove large | |
602 | $ hg addremove --traceback |
|
602 | $ hg addremove --traceback | |
603 | $ hg ci -m "removed large" |
|
603 | $ hg ci -m "removed large" | |
604 | Invoking status precommit hook |
|
604 | Invoking status precommit hook | |
605 | R large |
|
605 | R large | |
606 | created new head |
|
606 | created new head | |
607 | Invoking status postcommit hook |
|
607 | Invoking status postcommit hook | |
608 | C normal |
|
608 | C normal | |
609 | C normal3 |
|
609 | C normal3 | |
610 | C sub/large4 |
|
610 | C sub/large4 | |
611 | C sub/normal4 |
|
611 | C sub/normal4 | |
612 | C sub2/large6 |
|
612 | C sub2/large6 | |
613 | C sub2/large7 |
|
613 | C sub2/large7 | |
614 |
|
614 | |||
615 | Test commit -A (issue3542) |
|
615 | Test commit -A (issue3542) | |
616 | $ echo large8 > large8 |
|
616 | $ echo large8 > large8 | |
617 | $ hg add --large large8 |
|
617 | $ hg add --large large8 | |
618 | $ hg ci -Am 'this used to add large8 as normal and commit both' |
|
618 | $ hg ci -Am 'this used to add large8 as normal and commit both' | |
619 | Invoking status precommit hook |
|
619 | Invoking status precommit hook | |
620 | A large8 |
|
620 | A large8 | |
621 | Invoking status postcommit hook |
|
621 | Invoking status postcommit hook | |
622 | C large8 |
|
622 | C large8 | |
623 | C normal |
|
623 | C normal | |
624 | C normal3 |
|
624 | C normal3 | |
625 | C sub/large4 |
|
625 | C sub/large4 | |
626 | C sub/normal4 |
|
626 | C sub/normal4 | |
627 | C sub2/large6 |
|
627 | C sub2/large6 | |
628 | C sub2/large7 |
|
628 | C sub2/large7 | |
629 | $ rm large8 |
|
629 | $ rm large8 | |
630 | $ hg ci -Am 'this used to not notice the rm' |
|
630 | $ hg ci -Am 'this used to not notice the rm' | |
631 | removing large8 |
|
631 | removing large8 | |
632 | Invoking status precommit hook |
|
632 | Invoking status precommit hook | |
633 | R large8 |
|
633 | R large8 | |
634 | Invoking status postcommit hook |
|
634 | Invoking status postcommit hook | |
635 | C normal |
|
635 | C normal | |
636 | C normal3 |
|
636 | C normal3 | |
637 | C sub/large4 |
|
637 | C sub/large4 | |
638 | C sub/normal4 |
|
638 | C sub/normal4 | |
639 | C sub2/large6 |
|
639 | C sub2/large6 | |
640 | C sub2/large7 |
|
640 | C sub2/large7 | |
641 |
|
641 | |||
642 | Test that a standin can't be added as a large file |
|
642 | Test that a standin can't be added as a large file | |
643 |
|
643 | |||
644 | $ touch large |
|
644 | $ touch large | |
645 | $ hg add --large large |
|
645 | $ hg add --large large | |
646 | $ hg ci -m "add" |
|
646 | $ hg ci -m "add" | |
647 | Invoking status precommit hook |
|
647 | Invoking status precommit hook | |
648 | A large |
|
648 | A large | |
649 | Invoking status postcommit hook |
|
649 | Invoking status postcommit hook | |
650 | C large |
|
650 | C large | |
651 | C normal |
|
651 | C normal | |
652 | C normal3 |
|
652 | C normal3 | |
653 | C sub/large4 |
|
653 | C sub/large4 | |
654 | C sub/normal4 |
|
654 | C sub/normal4 | |
655 | C sub2/large6 |
|
655 | C sub2/large6 | |
656 | C sub2/large7 |
|
656 | C sub2/large7 | |
657 | $ hg remove large |
|
657 | $ hg remove large | |
658 | $ touch large |
|
658 | $ touch large | |
659 | $ hg addremove --config largefiles.patterns=**large --traceback |
|
659 | $ hg addremove --config largefiles.patterns=**large --traceback | |
660 | adding large as a largefile |
|
660 | adding large as a largefile | |
661 |
|
661 | |||
662 | Test that outgoing --large works (with revsets too) |
|
662 | Test that outgoing --large works (with revsets too) | |
663 | $ hg outgoing --rev '.^' --large |
|
663 | $ hg outgoing --rev '.^' --large | |
664 | comparing with $TESTTMP/a |
|
664 | comparing with $TESTTMP/a | |
665 | searching for changes |
|
665 | searching for changes | |
666 | changeset: 8:c02fd3b77ec4 |
|
666 | changeset: 8:c02fd3b77ec4 | |
667 | user: test |
|
667 | user: test | |
668 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
668 | date: Thu Jan 01 00:00:00 1970 +0000 | |
669 | summary: add foo |
|
669 | summary: add foo | |
670 |
|
670 | |||
671 | changeset: 9:289dd08c9bbb |
|
671 | changeset: 9:289dd08c9bbb | |
672 | user: test |
|
672 | user: test | |
673 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
673 | date: Thu Jan 01 00:00:00 1970 +0000 | |
674 | summary: used to say nothing changed |
|
674 | summary: used to say nothing changed | |
675 |
|
675 | |||
676 | changeset: 10:34f23ac6ac12 |
|
676 | changeset: 10:34f23ac6ac12 | |
677 | user: test |
|
677 | user: test | |
678 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
678 | date: Thu Jan 01 00:00:00 1970 +0000 | |
679 | summary: added |
|
679 | summary: added | |
680 |
|
680 | |||
681 | changeset: 12:710c1b2f523c |
|
681 | changeset: 12:710c1b2f523c | |
682 | parent: 10:34f23ac6ac12 |
|
682 | parent: 10:34f23ac6ac12 | |
683 | user: test |
|
683 | user: test | |
684 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
684 | date: Thu Jan 01 00:00:00 1970 +0000 | |
685 | summary: removed large |
|
685 | summary: removed large | |
686 |
|
686 | |||
687 | changeset: 13:0a3e75774479 |
|
687 | changeset: 13:0a3e75774479 | |
688 | user: test |
|
688 | user: test | |
689 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
689 | date: Thu Jan 01 00:00:00 1970 +0000 | |
690 | summary: this used to add large8 as normal and commit both |
|
690 | summary: this used to add large8 as normal and commit both | |
691 |
|
691 | |||
692 | changeset: 14:84f3d378175c |
|
692 | changeset: 14:84f3d378175c | |
693 | user: test |
|
693 | user: test | |
694 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
694 | date: Thu Jan 01 00:00:00 1970 +0000 | |
695 | summary: this used to not notice the rm |
|
695 | summary: this used to not notice the rm | |
696 |
|
696 | |||
697 | largefiles to upload (1 entities): |
|
697 | largefiles to upload (1 entities): | |
698 | large8 |
|
698 | large8 | |
699 |
|
699 | |||
700 | $ cd ../a |
|
700 | $ cd ../a | |
701 |
|
701 | |||
702 | Clone a largefiles repo. |
|
702 | Clone a largefiles repo. | |
703 |
|
703 | |||
704 | $ hg clone . ../b |
|
704 | $ hg clone . ../b | |
705 | updating to branch default |
|
705 | updating to branch default | |
706 | getting changed largefiles |
|
706 | getting changed largefiles | |
707 | 3 largefiles updated, 0 removed |
|
707 | 3 largefiles updated, 0 removed | |
708 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
708 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
709 | $ cd ../b |
|
709 | $ cd ../b | |
710 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
710 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
711 | 7:daea875e9014 add/edit more largefiles |
|
711 | 7:daea875e9014 add/edit more largefiles | |
712 | 6:4355d653f84f edit files yet again |
|
712 | 6:4355d653f84f edit files yet again | |
713 | 5:9d5af5072dbd edit files again |
|
713 | 5:9d5af5072dbd edit files again | |
714 | 4:74c02385b94c move files |
|
714 | 4:74c02385b94c move files | |
715 | 3:9e8fbc4bce62 copy files |
|
715 | 3:9e8fbc4bce62 copy files | |
716 | 2:51a0ae4d5864 remove files |
|
716 | 2:51a0ae4d5864 remove files | |
717 | 1:ce8896473775 edit files |
|
717 | 1:ce8896473775 edit files | |
718 | 0:30d30fe6a5be add files |
|
718 | 0:30d30fe6a5be add files | |
719 | $ cat normal3 |
|
719 | $ cat normal3 | |
720 | normal33 |
|
720 | normal33 | |
721 |
|
721 | |||
722 | Test graph log |
|
722 | Test graph log | |
723 |
|
723 | |||
724 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' |
|
724 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' | |
725 | @ 7:daea875e9014 add/edit more largefiles |
|
725 | @ 7:daea875e9014 add/edit more largefiles | |
726 | | |
|
726 | | | |
727 | o 6:4355d653f84f edit files yet again |
|
727 | o 6:4355d653f84f edit files yet again | |
728 | | |
|
728 | | | |
729 | o 5:9d5af5072dbd edit files again |
|
729 | o 5:9d5af5072dbd edit files again | |
730 | | |
|
730 | | | |
731 | o 4:74c02385b94c move files |
|
731 | o 4:74c02385b94c move files | |
732 | | |
|
732 | | | |
733 | o 3:9e8fbc4bce62 copy files |
|
733 | o 3:9e8fbc4bce62 copy files | |
734 | | |
|
734 | | | |
735 | o 2:51a0ae4d5864 remove files |
|
735 | o 2:51a0ae4d5864 remove files | |
736 | | |
|
736 | | | |
737 | o 1:ce8896473775 edit files |
|
737 | o 1:ce8896473775 edit files | |
738 | | |
|
738 | | | |
739 | o 0:30d30fe6a5be add files |
|
739 | o 0:30d30fe6a5be add files | |
740 |
|
740 | |||
741 |
|
741 | |||
742 | Test log with --patch |
|
742 | Test log with --patch | |
743 |
|
743 | |||
744 | $ hg log --patch -r 6::7 |
|
744 | $ hg log --patch -r 6::7 | |
745 | changeset: 6:4355d653f84f |
|
745 | changeset: 6:4355d653f84f | |
746 | user: test |
|
746 | user: test | |
747 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
747 | date: Thu Jan 01 00:00:00 1970 +0000 | |
748 | summary: edit files yet again |
|
748 | summary: edit files yet again | |
749 |
|
749 | |||
750 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3 |
|
750 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3 | |
751 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 |
|
751 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
752 | +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 |
|
752 | +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
753 | @@ -1,1 +1,1 @@ |
|
753 | @@ -1,1 +1,1 @@ | |
754 | -baaf12afde9d8d67f25dab6dced0d2bf77dba47c |
|
754 | -baaf12afde9d8d67f25dab6dced0d2bf77dba47c | |
755 | +7838695e10da2bb75ac1156565f40a2595fa2fa0 |
|
755 | +7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
756 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 |
|
756 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 | |
757 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
757 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
758 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
758 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
759 | @@ -1,1 +1,1 @@ |
|
759 | @@ -1,1 +1,1 @@ | |
760 | -aeb2210d19f02886dde00dac279729a48471e2f9 |
|
760 | -aeb2210d19f02886dde00dac279729a48471e2f9 | |
761 | +971fb41e78fea4f8e0ba5244784239371cb00591 |
|
761 | +971fb41e78fea4f8e0ba5244784239371cb00591 | |
762 | diff -r 9d5af5072dbd -r 4355d653f84f normal3 |
|
762 | diff -r 9d5af5072dbd -r 4355d653f84f normal3 | |
763 | --- a/normal3 Thu Jan 01 00:00:00 1970 +0000 |
|
763 | --- a/normal3 Thu Jan 01 00:00:00 1970 +0000 | |
764 | +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000 |
|
764 | +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000 | |
765 | @@ -1,1 +1,1 @@ |
|
765 | @@ -1,1 +1,1 @@ | |
766 | -normal3 |
|
766 | -normal3 | |
767 | +normal33 |
|
767 | +normal33 | |
768 | diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 |
|
768 | diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 | |
769 | --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 |
|
769 | --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
770 | +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 |
|
770 | +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
771 | @@ -1,1 +1,1 @@ |
|
771 | @@ -1,1 +1,1 @@ | |
772 | -normal4 |
|
772 | -normal4 | |
773 | +normal44 |
|
773 | +normal44 | |
774 |
|
774 | |||
775 | changeset: 7:daea875e9014 |
|
775 | changeset: 7:daea875e9014 | |
776 | tag: tip |
|
776 | tag: tip | |
777 | user: test |
|
777 | user: test | |
778 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
778 | date: Thu Jan 01 00:00:00 1970 +0000 | |
779 | summary: add/edit more largefiles |
|
779 | summary: add/edit more largefiles | |
780 |
|
780 | |||
781 | diff -r 4355d653f84f -r daea875e9014 .hglf/large3 |
|
781 | diff -r 4355d653f84f -r daea875e9014 .hglf/large3 | |
782 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 |
|
782 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
783 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
783 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
784 | @@ -1,1 +0,0 @@ |
|
784 | @@ -1,1 +0,0 @@ | |
785 | -7838695e10da2bb75ac1156565f40a2595fa2fa0 |
|
785 | -7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
786 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6 |
|
786 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6 | |
787 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
787 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
788 | +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000 |
|
788 | +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000 | |
789 | @@ -0,0 +1,1 @@ |
|
789 | @@ -0,0 +1,1 @@ | |
790 | +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 |
|
790 | +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 | |
791 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7 |
|
791 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7 | |
792 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
792 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
793 | +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000 |
|
793 | +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000 | |
794 | @@ -0,0 +1,1 @@ |
|
794 | @@ -0,0 +1,1 @@ | |
795 | +bb3151689acb10f0c3125c560d5e63df914bc1af |
|
795 | +bb3151689acb10f0c3125c560d5e63df914bc1af | |
796 |
|
796 | |||
797 |
|
797 | |||
798 | $ hg log --patch -r 6::7 sub/ |
|
798 | $ hg log --patch -r 6::7 sub/ | |
799 | changeset: 6:4355d653f84f |
|
799 | changeset: 6:4355d653f84f | |
800 | user: test |
|
800 | user: test | |
801 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
801 | date: Thu Jan 01 00:00:00 1970 +0000 | |
802 | summary: edit files yet again |
|
802 | summary: edit files yet again | |
803 |
|
803 | |||
804 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 |
|
804 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 | |
805 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
805 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
806 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
806 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
807 | @@ -1,1 +1,1 @@ |
|
807 | @@ -1,1 +1,1 @@ | |
808 | -aeb2210d19f02886dde00dac279729a48471e2f9 |
|
808 | -aeb2210d19f02886dde00dac279729a48471e2f9 | |
809 | +971fb41e78fea4f8e0ba5244784239371cb00591 |
|
809 | +971fb41e78fea4f8e0ba5244784239371cb00591 | |
810 | diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 |
|
810 | diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 | |
811 | --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 |
|
811 | --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
812 | +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 |
|
812 | +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
813 | @@ -1,1 +1,1 @@ |
|
813 | @@ -1,1 +1,1 @@ | |
814 | -normal4 |
|
814 | -normal4 | |
815 | +normal44 |
|
815 | +normal44 | |
816 |
|
816 | |||
817 |
|
817 | |||
818 | log with both --follow and --patch |
|
818 | log with both --follow and --patch | |
819 |
|
819 | |||
820 | $ hg log --follow --patch --limit 2 |
|
820 | $ hg log --follow --patch --limit 2 | |
821 | changeset: 7:daea875e9014 |
|
821 | changeset: 7:daea875e9014 | |
822 | tag: tip |
|
822 | tag: tip | |
823 | user: test |
|
823 | user: test | |
824 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
824 | date: Thu Jan 01 00:00:00 1970 +0000 | |
825 | summary: add/edit more largefiles |
|
825 | summary: add/edit more largefiles | |
826 |
|
826 | |||
827 | diff -r 4355d653f84f -r daea875e9014 .hglf/large3 |
|
827 | diff -r 4355d653f84f -r daea875e9014 .hglf/large3 | |
828 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 |
|
828 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
829 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
829 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
830 | @@ -1,1 +0,0 @@ |
|
830 | @@ -1,1 +0,0 @@ | |
831 | -7838695e10da2bb75ac1156565f40a2595fa2fa0 |
|
831 | -7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
832 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6 |
|
832 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6 | |
833 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
833 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
834 | +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000 |
|
834 | +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000 | |
835 | @@ -0,0 +1,1 @@ |
|
835 | @@ -0,0 +1,1 @@ | |
836 | +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 |
|
836 | +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 | |
837 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7 |
|
837 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7 | |
838 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
838 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
839 | +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000 |
|
839 | +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000 | |
840 | @@ -0,0 +1,1 @@ |
|
840 | @@ -0,0 +1,1 @@ | |
841 | +bb3151689acb10f0c3125c560d5e63df914bc1af |
|
841 | +bb3151689acb10f0c3125c560d5e63df914bc1af | |
842 |
|
842 | |||
843 | changeset: 6:4355d653f84f |
|
843 | changeset: 6:4355d653f84f | |
844 | user: test |
|
844 | user: test | |
845 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
845 | date: Thu Jan 01 00:00:00 1970 +0000 | |
846 | summary: edit files yet again |
|
846 | summary: edit files yet again | |
847 |
|
847 | |||
848 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3 |
|
848 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3 | |
849 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 |
|
849 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
850 | +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 |
|
850 | +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
851 | @@ -1,1 +1,1 @@ |
|
851 | @@ -1,1 +1,1 @@ | |
852 | -baaf12afde9d8d67f25dab6dced0d2bf77dba47c |
|
852 | -baaf12afde9d8d67f25dab6dced0d2bf77dba47c | |
853 | +7838695e10da2bb75ac1156565f40a2595fa2fa0 |
|
853 | +7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
854 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 |
|
854 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 | |
855 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
855 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
856 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
856 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
857 | @@ -1,1 +1,1 @@ |
|
857 | @@ -1,1 +1,1 @@ | |
858 | -aeb2210d19f02886dde00dac279729a48471e2f9 |
|
858 | -aeb2210d19f02886dde00dac279729a48471e2f9 | |
859 | +971fb41e78fea4f8e0ba5244784239371cb00591 |
|
859 | +971fb41e78fea4f8e0ba5244784239371cb00591 | |
860 | diff -r 9d5af5072dbd -r 4355d653f84f normal3 |
|
860 | diff -r 9d5af5072dbd -r 4355d653f84f normal3 | |
861 | --- a/normal3 Thu Jan 01 00:00:00 1970 +0000 |
|
861 | --- a/normal3 Thu Jan 01 00:00:00 1970 +0000 | |
862 | +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000 |
|
862 | +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000 | |
863 | @@ -1,1 +1,1 @@ |
|
863 | @@ -1,1 +1,1 @@ | |
864 | -normal3 |
|
864 | -normal3 | |
865 | +normal33 |
|
865 | +normal33 | |
866 | diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 |
|
866 | diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 | |
867 | --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 |
|
867 | --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
868 | +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 |
|
868 | +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
869 | @@ -1,1 +1,1 @@ |
|
869 | @@ -1,1 +1,1 @@ | |
870 | -normal4 |
|
870 | -normal4 | |
871 | +normal44 |
|
871 | +normal44 | |
872 |
|
872 | |||
873 | $ hg log --follow --patch sub/large4 |
|
873 | $ hg log --follow --patch sub/large4 | |
874 | changeset: 6:4355d653f84f |
|
874 | changeset: 6:4355d653f84f | |
875 | user: test |
|
875 | user: test | |
876 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
876 | date: Thu Jan 01 00:00:00 1970 +0000 | |
877 | summary: edit files yet again |
|
877 | summary: edit files yet again | |
878 |
|
878 | |||
879 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 |
|
879 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 | |
880 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
880 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
881 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
881 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
882 | @@ -1,1 +1,1 @@ |
|
882 | @@ -1,1 +1,1 @@ | |
883 | -aeb2210d19f02886dde00dac279729a48471e2f9 |
|
883 | -aeb2210d19f02886dde00dac279729a48471e2f9 | |
884 | +971fb41e78fea4f8e0ba5244784239371cb00591 |
|
884 | +971fb41e78fea4f8e0ba5244784239371cb00591 | |
885 |
|
885 | |||
886 | changeset: 5:9d5af5072dbd |
|
886 | changeset: 5:9d5af5072dbd | |
887 | user: test |
|
887 | user: test | |
888 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
888 | date: Thu Jan 01 00:00:00 1970 +0000 | |
889 | summary: edit files again |
|
889 | summary: edit files again | |
890 |
|
890 | |||
891 | diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4 |
|
891 | diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4 | |
892 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
892 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
893 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
893 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
894 | @@ -1,1 +1,1 @@ |
|
894 | @@ -1,1 +1,1 @@ | |
895 | -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
895 | -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
896 | +aeb2210d19f02886dde00dac279729a48471e2f9 |
|
896 | +aeb2210d19f02886dde00dac279729a48471e2f9 | |
897 |
|
897 | |||
898 | changeset: 4:74c02385b94c |
|
898 | changeset: 4:74c02385b94c | |
899 | user: test |
|
899 | user: test | |
900 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
900 | date: Thu Jan 01 00:00:00 1970 +0000 | |
901 | summary: move files |
|
901 | summary: move files | |
902 |
|
902 | |||
903 | diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4 |
|
903 | diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4 | |
904 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
904 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
905 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 |
|
905 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
906 | @@ -0,0 +1,1 @@ |
|
906 | @@ -0,0 +1,1 @@ | |
907 | +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
907 | +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
908 |
|
908 | |||
909 | changeset: 1:ce8896473775 |
|
909 | changeset: 1:ce8896473775 | |
910 | user: test |
|
910 | user: test | |
911 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
911 | date: Thu Jan 01 00:00:00 1970 +0000 | |
912 | summary: edit files |
|
912 | summary: edit files | |
913 |
|
913 | |||
914 | diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2 |
|
914 | diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2 | |
915 | --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 |
|
915 | --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 | |
916 | +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 |
|
916 | +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 | |
917 | @@ -1,1 +1,1 @@ |
|
917 | @@ -1,1 +1,1 @@ | |
918 | -1deebade43c8c498a3c8daddac0244dc55d1331d |
|
918 | -1deebade43c8c498a3c8daddac0244dc55d1331d | |
919 | +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
919 | +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
920 |
|
920 | |||
921 | changeset: 0:30d30fe6a5be |
|
921 | changeset: 0:30d30fe6a5be | |
922 | user: test |
|
922 | user: test | |
923 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
923 | date: Thu Jan 01 00:00:00 1970 +0000 | |
924 | summary: add files |
|
924 | summary: add files | |
925 |
|
925 | |||
926 | diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2 |
|
926 | diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2 | |
927 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
|
927 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
928 | +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 |
|
928 | +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 | |
929 | @@ -0,0 +1,1 @@ |
|
929 | @@ -0,0 +1,1 @@ | |
930 | +1deebade43c8c498a3c8daddac0244dc55d1331d |
|
930 | +1deebade43c8c498a3c8daddac0244dc55d1331d | |
931 |
|
931 | |||
932 | $ cat sub/normal4 |
|
932 | $ cat sub/normal4 | |
933 | normal44 |
|
933 | normal44 | |
934 | $ cat sub/large4 |
|
934 | $ cat sub/large4 | |
935 | large44 |
|
935 | large44 | |
936 | $ cat sub2/large6 |
|
936 | $ cat sub2/large6 | |
937 | large6 |
|
937 | large6 | |
938 | $ cat sub2/large7 |
|
938 | $ cat sub2/large7 | |
939 | large7 |
|
939 | large7 | |
940 | $ hg log -qf sub2/large7 |
|
940 | $ hg log -qf sub2/large7 | |
941 | 7:daea875e9014 |
|
941 | 7:daea875e9014 | |
942 | $ hg log -Gqf sub2/large7 |
|
942 | $ hg log -Gqf sub2/large7 | |
943 | @ 7:daea875e9014 |
|
943 | @ 7:daea875e9014 | |
944 | | |
|
944 | | | |
945 | ~ |
|
945 | ~ | |
946 | $ cd .. |
|
946 | $ cd .. | |
947 |
|
947 | |||
948 | Test log from outside repo |
|
948 | Test log from outside repo | |
949 |
|
949 | |||
950 | $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n' |
|
950 | $ hg log b/sub -T '{rev}:{node|short} {desc|firstline}\n' | |
951 | 6:4355d653f84f edit files yet again |
|
951 | 6:4355d653f84f edit files yet again | |
952 | 5:9d5af5072dbd edit files again |
|
952 | 5:9d5af5072dbd edit files again | |
953 | 4:74c02385b94c move files |
|
953 | 4:74c02385b94c move files | |
954 | 1:ce8896473775 edit files |
|
954 | 1:ce8896473775 edit files | |
955 | 0:30d30fe6a5be add files |
|
955 | 0:30d30fe6a5be add files | |
956 |
|
956 | |||
957 | Test clone at revision |
|
957 | Test clone at revision | |
958 |
|
958 | |||
959 | $ hg clone a -r 3 c |
|
959 | $ hg clone a -r 3 c | |
960 | adding changesets |
|
960 | adding changesets | |
961 | adding manifests |
|
961 | adding manifests | |
962 | adding file changes |
|
962 | adding file changes | |
963 | added 4 changesets with 10 changes to 4 files |
|
963 | added 4 changesets with 10 changes to 4 files | |
964 | new changesets 30d30fe6a5be:9e8fbc4bce62 (4 drafts) |
|
964 | new changesets 30d30fe6a5be:9e8fbc4bce62 (4 drafts) | |
965 | updating to branch default |
|
965 | updating to branch default | |
966 | getting changed largefiles |
|
966 | getting changed largefiles | |
967 | 2 largefiles updated, 0 removed |
|
967 | 2 largefiles updated, 0 removed | |
968 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
968 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
969 | $ cd c |
|
969 | $ cd c | |
970 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
970 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
971 | 3:9e8fbc4bce62 copy files |
|
971 | 3:9e8fbc4bce62 copy files | |
972 | 2:51a0ae4d5864 remove files |
|
972 | 2:51a0ae4d5864 remove files | |
973 | 1:ce8896473775 edit files |
|
973 | 1:ce8896473775 edit files | |
974 | 0:30d30fe6a5be add files |
|
974 | 0:30d30fe6a5be add files | |
975 | $ cat normal1 |
|
975 | $ cat normal1 | |
976 | normal22 |
|
976 | normal22 | |
977 | $ cat large1 |
|
977 | $ cat large1 | |
978 | large22 |
|
978 | large22 | |
979 | $ cat sub/normal2 |
|
979 | $ cat sub/normal2 | |
980 | normal22 |
|
980 | normal22 | |
981 | $ cat sub/large2 |
|
981 | $ cat sub/large2 | |
982 | large22 |
|
982 | large22 | |
983 |
|
983 | |||
984 | Old revisions of a clone have correct largefiles content (this also |
|
984 | Old revisions of a clone have correct largefiles content (this also | |
985 | tests update). |
|
985 | tests update). | |
986 |
|
986 | |||
987 | $ hg update -r 1 |
|
987 | $ hg update -r 1 | |
988 | getting changed largefiles |
|
988 | getting changed largefiles | |
989 | 1 largefiles updated, 0 removed |
|
989 | 1 largefiles updated, 0 removed | |
990 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
990 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
991 | $ cat large1 |
|
991 | $ cat large1 | |
992 | large11 |
|
992 | large11 | |
993 | $ cat sub/large2 |
|
993 | $ cat sub/large2 | |
994 | large22 |
|
994 | large22 | |
995 | $ cd .. |
|
995 | $ cd .. | |
996 |
|
996 | |||
997 | Test cloning with --all-largefiles flag |
|
997 | Test cloning with --all-largefiles flag | |
998 |
|
998 | |||
999 | $ rm "${USERCACHE}"/* |
|
999 | $ rm "${USERCACHE}"/* | |
1000 | $ hg clone --all-largefiles a a-backup |
|
1000 | $ hg clone --all-largefiles a a-backup | |
1001 | updating to branch default |
|
1001 | updating to branch default | |
1002 | getting changed largefiles |
|
1002 | getting changed largefiles | |
1003 | 3 largefiles updated, 0 removed |
|
1003 | 3 largefiles updated, 0 removed | |
1004 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1004 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1005 | 8 additional largefiles cached |
|
1005 | 8 additional largefiles cached | |
1006 |
|
1006 | |||
1007 | $ rm "${USERCACHE}"/* |
|
1007 | $ rm "${USERCACHE}"/* | |
1008 | $ hg clone --all-largefiles -u 0 a a-clone0 |
|
1008 | $ hg clone --all-largefiles -u 0 a a-clone0 | |
1009 | updating to branch default |
|
1009 | updating to branch default | |
1010 | getting changed largefiles |
|
1010 | getting changed largefiles | |
1011 | 2 largefiles updated, 0 removed |
|
1011 | 2 largefiles updated, 0 removed | |
1012 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1012 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1013 | 9 additional largefiles cached |
|
1013 | 9 additional largefiles cached | |
1014 | $ hg -R a-clone0 sum |
|
1014 | $ hg -R a-clone0 sum | |
1015 | parent: 0:30d30fe6a5be |
|
1015 | parent: 0:30d30fe6a5be | |
1016 | add files |
|
1016 | add files | |
1017 | branch: default |
|
1017 | branch: default | |
1018 | commit: (clean) |
|
1018 | commit: (clean) | |
1019 | update: 7 new changesets (update) |
|
1019 | update: 7 new changesets (update) | |
1020 | phases: 8 draft |
|
1020 | phases: 8 draft | |
1021 |
|
1021 | |||
1022 | $ rm "${USERCACHE}"/* |
|
1022 | $ rm "${USERCACHE}"/* | |
1023 | $ hg clone --all-largefiles -u 1 a a-clone1 |
|
1023 | $ hg clone --all-largefiles -u 1 a a-clone1 | |
1024 | updating to branch default |
|
1024 | updating to branch default | |
1025 | getting changed largefiles |
|
1025 | getting changed largefiles | |
1026 | 2 largefiles updated, 0 removed |
|
1026 | 2 largefiles updated, 0 removed | |
1027 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1027 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1028 | 8 additional largefiles cached |
|
1028 | 8 additional largefiles cached | |
1029 | $ hg -R a-clone1 verify --large --lfa --lfc |
|
1029 | $ hg -R a-clone1 verify --large --lfa --lfc | |
1030 | checking changesets |
|
1030 | checking changesets | |
1031 | checking manifests |
|
1031 | checking manifests | |
1032 | crosschecking files in changesets and manifests |
|
1032 | crosschecking files in changesets and manifests | |
1033 | checking files |
|
1033 | checking files | |
1034 | checked 8 changesets with 24 changes to 10 files |
|
1034 | checked 8 changesets with 24 changes to 10 files | |
1035 | searching 8 changesets for largefiles |
|
1035 | searching 8 changesets for largefiles | |
1036 | verified contents of 13 revisions of 6 largefiles |
|
1036 | verified contents of 13 revisions of 6 largefiles | |
1037 | $ hg -R a-clone1 sum |
|
1037 | $ hg -R a-clone1 sum | |
1038 | parent: 1:ce8896473775 |
|
1038 | parent: 1:ce8896473775 | |
1039 | edit files |
|
1039 | edit files | |
1040 | branch: default |
|
1040 | branch: default | |
1041 | commit: (clean) |
|
1041 | commit: (clean) | |
1042 | update: 6 new changesets (update) |
|
1042 | update: 6 new changesets (update) | |
1043 | phases: 8 draft |
|
1043 | phases: 8 draft | |
1044 |
|
1044 | |||
1045 | $ rm "${USERCACHE}"/* |
|
1045 | $ rm "${USERCACHE}"/* | |
1046 | $ hg clone --all-largefiles -U a a-clone-u |
|
1046 | $ hg clone --all-largefiles -U a a-clone-u | |
1047 | 11 additional largefiles cached |
|
1047 | 11 additional largefiles cached | |
1048 | $ hg -R a-clone-u sum |
|
1048 | $ hg -R a-clone-u sum | |
1049 | parent: -1:000000000000 (no revision checked out) |
|
1049 | parent: -1:000000000000 (no revision checked out) | |
1050 | branch: default |
|
1050 | branch: default | |
1051 | commit: (clean) |
|
1051 | commit: (clean) | |
1052 | update: 8 new changesets (update) |
|
1052 | update: 8 new changesets (update) | |
1053 | phases: 8 draft |
|
1053 | phases: 8 draft | |
1054 |
|
1054 | |||
1055 | Show computed destination directory: |
|
1055 | Show computed destination directory: | |
1056 |
|
1056 | |||
1057 | $ mkdir xyz |
|
1057 | $ mkdir xyz | |
1058 | $ cd xyz |
|
1058 | $ cd xyz | |
1059 | $ hg clone ../a |
|
1059 | $ hg clone ../a | |
1060 | destination directory: a |
|
1060 | destination directory: a | |
1061 | updating to branch default |
|
1061 | updating to branch default | |
1062 | getting changed largefiles |
|
1062 | getting changed largefiles | |
1063 | 3 largefiles updated, 0 removed |
|
1063 | 3 largefiles updated, 0 removed | |
1064 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1064 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1065 | $ cd .. |
|
1065 | $ cd .. | |
1066 |
|
1066 | |||
1067 | Clone URL without path: |
|
1067 | Clone URL without path: | |
1068 |
|
1068 | |||
1069 | $ hg clone file:// |
|
1069 | $ hg clone file:// | |
1070 | abort: repository / not found! |
|
1070 | abort: repository / not found! | |
1071 | [255] |
|
1071 | [255] | |
1072 |
|
1072 | |||
1073 | Ensure base clone command argument validation |
|
1073 | Ensure base clone command argument validation | |
1074 |
|
1074 | |||
1075 | $ hg clone -U -u 0 a a-clone-failure |
|
1075 | $ hg clone -U -u 0 a a-clone-failure | |
1076 | abort: cannot specify both --noupdate and --updaterev |
|
1076 | abort: cannot specify both --noupdate and --updaterev | |
1077 | [255] |
|
1077 | [255] | |
1078 |
|
1078 | |||
1079 | $ hg clone --all-largefiles a ssh://localhost/a |
|
1079 | $ hg clone --all-largefiles a ssh://localhost/a | |
1080 | abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a |
|
1080 | abort: --all-largefiles is incompatible with non-local destination ssh://localhost/a | |
1081 | [255] |
|
1081 | [255] | |
1082 |
|
1082 | |||
1083 | Test pulling with --all-largefiles flag. Also test that the largefiles are |
|
1083 | Test pulling with --all-largefiles flag. Also test that the largefiles are | |
1084 | downloaded from 'default' instead of 'default-push' when no source is specified |
|
1084 | downloaded from 'default' instead of 'default-push' when no source is specified | |
1085 | (issue3584) |
|
1085 | (issue3584) | |
1086 |
|
1086 | |||
1087 | $ rm -Rf a-backup |
|
1087 | $ rm -Rf a-backup | |
1088 | $ hg clone -r 1 a a-backup |
|
1088 | $ hg clone -r 1 a a-backup | |
1089 | adding changesets |
|
1089 | adding changesets | |
1090 | adding manifests |
|
1090 | adding manifests | |
1091 | adding file changes |
|
1091 | adding file changes | |
1092 | added 2 changesets with 8 changes to 4 files |
|
1092 | added 2 changesets with 8 changes to 4 files | |
1093 | new changesets 30d30fe6a5be:ce8896473775 (2 drafts) |
|
1093 | new changesets 30d30fe6a5be:ce8896473775 (2 drafts) | |
1094 | updating to branch default |
|
1094 | updating to branch default | |
1095 | getting changed largefiles |
|
1095 | getting changed largefiles | |
1096 | 2 largefiles updated, 0 removed |
|
1096 | 2 largefiles updated, 0 removed | |
1097 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1097 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1098 | $ rm "${USERCACHE}"/* |
|
1098 | $ rm "${USERCACHE}"/* | |
1099 | $ cd a-backup |
|
1099 | $ cd a-backup | |
1100 | $ hg pull --all-largefiles --config paths.default-push=bogus/path |
|
1100 | $ hg pull --all-largefiles --config paths.default-push=bogus/path | |
1101 | pulling from $TESTTMP/a |
|
1101 | pulling from $TESTTMP/a | |
1102 | searching for changes |
|
1102 | searching for changes | |
1103 | adding changesets |
|
1103 | adding changesets | |
1104 | adding manifests |
|
1104 | adding manifests | |
1105 | adding file changes |
|
1105 | adding file changes | |
1106 | added 6 changesets with 16 changes to 8 files |
|
1106 | added 6 changesets with 16 changes to 8 files | |
1107 | new changesets 51a0ae4d5864:daea875e9014 (6 drafts) |
|
1107 | new changesets 51a0ae4d5864:daea875e9014 (6 drafts) | |
1108 | (run 'hg update' to get a working copy) |
|
1108 | (run 'hg update' to get a working copy) | |
1109 | 6 largefiles cached |
|
1109 | 6 largefiles cached | |
1110 |
|
1110 | |||
1111 | redo pull with --lfrev and check it pulls largefiles for the right revs |
|
1111 | redo pull with --lfrev and check it pulls largefiles for the right revs | |
1112 |
|
1112 | |||
1113 | $ hg rollback |
|
1113 | $ hg rollback | |
1114 | repository tip rolled back to revision 1 (undo pull) |
|
1114 | repository tip rolled back to revision 1 (undo pull) | |
1115 | $ hg pull -v --lfrev 'heads(pulled())+min(pulled())' |
|
1115 | $ hg pull -v --lfrev 'heads(pulled())+min(pulled())' | |
1116 | pulling from $TESTTMP/a |
|
1116 | pulling from $TESTTMP/a | |
1117 | searching for changes |
|
1117 | searching for changes | |
1118 | all local heads known remotely |
|
1118 | all local heads known remotely | |
1119 | 6 changesets found |
|
1119 | 6 changesets found | |
1120 | uncompressed size of bundle content: |
|
1120 | uncompressed size of bundle content: | |
1121 | 1389 (changelog) |
|
1121 | 1389 (changelog) | |
1122 | 1599 (manifests) |
|
1122 | 1599 (manifests) | |
1123 | 254 .hglf/large1 |
|
1123 | 254 .hglf/large1 | |
1124 | 564 .hglf/large3 |
|
1124 | 564 .hglf/large3 | |
1125 | 572 .hglf/sub/large4 |
|
1125 | 572 .hglf/sub/large4 | |
1126 | 182 .hglf/sub2/large6 |
|
1126 | 182 .hglf/sub2/large6 | |
1127 | 182 .hglf/sub2/large7 |
|
1127 | 182 .hglf/sub2/large7 | |
1128 | 212 normal1 |
|
1128 | 212 normal1 | |
1129 | 457 normal3 |
|
1129 | 457 normal3 | |
1130 | 465 sub/normal4 |
|
1130 | 465 sub/normal4 | |
1131 | adding changesets |
|
1131 | adding changesets | |
1132 | adding manifests |
|
1132 | adding manifests | |
1133 | adding file changes |
|
1133 | adding file changes | |
1134 | added 6 changesets with 16 changes to 8 files |
|
1134 | added 6 changesets with 16 changes to 8 files | |
1135 | new changesets 51a0ae4d5864:daea875e9014 (6 drafts) |
|
1135 | new changesets 51a0ae4d5864:daea875e9014 (6 drafts) | |
1136 | calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles |
|
1136 | calling hook changegroup.lfiles: hgext.largefiles.reposetup.checkrequireslfiles | |
1137 | (run 'hg update' to get a working copy) |
|
1137 | (run 'hg update' to get a working copy) | |
1138 | pulling largefiles for revision 7 |
|
1138 | pulling largefiles for revision 7 | |
1139 | found 971fb41e78fea4f8e0ba5244784239371cb00591 in store |
|
1139 | found 971fb41e78fea4f8e0ba5244784239371cb00591 in store | |
1140 | found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store |
|
1140 | found 0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 in store | |
1141 | found bb3151689acb10f0c3125c560d5e63df914bc1af in store |
|
1141 | found bb3151689acb10f0c3125c560d5e63df914bc1af in store | |
1142 | pulling largefiles for revision 2 |
|
1142 | pulling largefiles for revision 2 | |
1143 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store |
|
1143 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store | |
1144 | 0 largefiles cached |
|
1144 | 0 largefiles cached | |
1145 |
|
1145 | |||
1146 | lfpull |
|
1146 | lfpull | |
1147 |
|
1147 | |||
1148 | $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull |
|
1148 | $ hg lfpull -r : --config largefiles.usercache=usercache-lfpull | |
1149 | 2 largefiles cached |
|
1149 | 2 largefiles cached | |
1150 | $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull |
|
1150 | $ hg lfpull -v -r 4+2 --config largefiles.usercache=usercache-lfpull | |
1151 | pulling largefiles for revision 4 |
|
1151 | pulling largefiles for revision 4 | |
1152 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store |
|
1152 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store | |
1153 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store |
|
1153 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store | |
1154 | pulling largefiles for revision 2 |
|
1154 | pulling largefiles for revision 2 | |
1155 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store |
|
1155 | found eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 in store | |
1156 | 0 largefiles cached |
|
1156 | 0 largefiles cached | |
1157 |
|
1157 | |||
1158 | $ ls usercache-lfpull/* | sort |
|
1158 | $ ls usercache-lfpull/* | sort | |
1159 | usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d |
|
1159 | usercache-lfpull/1deebade43c8c498a3c8daddac0244dc55d1331d | |
1160 | usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64 |
|
1160 | usercache-lfpull/4669e532d5b2c093a78eca010077e708a071bb64 | |
1161 |
|
1161 | |||
1162 | $ cd .. |
|
1162 | $ cd .. | |
1163 |
|
1163 | |||
1164 | Rebasing between two repositories does not revert largefiles to old |
|
1164 | Rebasing between two repositories does not revert largefiles to old | |
1165 | revisions (this was a very bad bug that took a lot of work to fix). |
|
1165 | revisions (this was a very bad bug that took a lot of work to fix). | |
1166 |
|
1166 | |||
1167 | $ hg clone a d |
|
1167 | $ hg clone a d | |
1168 | updating to branch default |
|
1168 | updating to branch default | |
1169 | getting changed largefiles |
|
1169 | getting changed largefiles | |
1170 | 3 largefiles updated, 0 removed |
|
1170 | 3 largefiles updated, 0 removed | |
1171 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1171 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1172 | $ cd b |
|
1172 | $ cd b | |
1173 | $ echo large4-modified > sub/large4 |
|
1173 | $ echo large4-modified > sub/large4 | |
1174 | $ echo normal3-modified > normal3 |
|
1174 | $ echo normal3-modified > normal3 | |
1175 | $ hg commit -m "modify normal file and largefile in repo b" |
|
1175 | $ hg commit -m "modify normal file and largefile in repo b" | |
1176 | Invoking status precommit hook |
|
1176 | Invoking status precommit hook | |
1177 | M normal3 |
|
1177 | M normal3 | |
1178 | M sub/large4 |
|
1178 | M sub/large4 | |
1179 | $ cd ../d |
|
1179 | $ cd ../d | |
1180 | $ echo large6-modified > sub2/large6 |
|
1180 | $ echo large6-modified > sub2/large6 | |
1181 | $ echo normal4-modified > sub/normal4 |
|
1181 | $ echo normal4-modified > sub/normal4 | |
1182 | $ hg commit -m "modify normal file largefile in repo d" |
|
1182 | $ hg commit -m "modify normal file largefile in repo d" | |
1183 | Invoking status precommit hook |
|
1183 | Invoking status precommit hook | |
1184 | M sub/normal4 |
|
1184 | M sub/normal4 | |
1185 | M sub2/large6 |
|
1185 | M sub2/large6 | |
1186 | $ cd .. |
|
1186 | $ cd .. | |
1187 | $ hg clone d e |
|
1187 | $ hg clone d e | |
1188 | updating to branch default |
|
1188 | updating to branch default | |
1189 | getting changed largefiles |
|
1189 | getting changed largefiles | |
1190 | 3 largefiles updated, 0 removed |
|
1190 | 3 largefiles updated, 0 removed | |
1191 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1191 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1192 | $ cd d |
|
1192 | $ cd d | |
1193 |
|
1193 | |||
1194 | More rebase testing, but also test that the largefiles are downloaded from |
|
1194 | More rebase testing, but also test that the largefiles are downloaded from | |
1195 | 'default-push' when no source is specified (issue3584). (The largefile from the |
|
1195 | 'default-push' when no source is specified (issue3584). (The largefile from the | |
1196 | pulled revision is however not downloaded but found in the local cache.) |
|
1196 | pulled revision is however not downloaded but found in the local cache.) | |
1197 | Largefiles are fetched for the new pulled revision, not for existing revisions, |
|
1197 | Largefiles are fetched for the new pulled revision, not for existing revisions, | |
1198 | rebased or not. |
|
1198 | rebased or not. | |
1199 |
|
1199 | |||
1200 | $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] |
|
1200 | $ [ ! -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] | |
1201 | $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b |
|
1201 | $ hg pull --rebase --all-largefiles --config paths.default-push=bogus/path --config paths.default=../b | |
1202 | pulling from $TESTTMP/b |
|
1202 | pulling from $TESTTMP/b | |
1203 | searching for changes |
|
1203 | searching for changes | |
1204 | adding changesets |
|
1204 | adding changesets | |
1205 | adding manifests |
|
1205 | adding manifests | |
1206 | adding file changes |
|
1206 | adding file changes | |
1207 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
1207 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
1208 | new changesets a381d2c8c80e (1 drafts) |
|
1208 | new changesets a381d2c8c80e (1 drafts) | |
1209 | 0 largefiles cached |
|
1209 | 0 largefiles cached | |
1210 | rebasing 8:f574fb32bb45 "modify normal file largefile in repo d" |
|
1210 | rebasing 8:f574fb32bb45 "modify normal file largefile in repo d" | |
1211 | Invoking status precommit hook |
|
1211 | Invoking status precommit hook | |
1212 | M sub/normal4 |
|
1212 | M sub/normal4 | |
1213 | M sub2/large6 |
|
1213 | M sub2/large6 | |
1214 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg |
|
1214 | saved backup bundle to $TESTTMP/d/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg | |
1215 | $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] |
|
1215 | $ [ -f .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 ] | |
1216 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
1216 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
1217 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1217 | 9:598410d3eb9a modify normal file largefile in repo d | |
1218 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1218 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1219 | 7:daea875e9014 add/edit more largefiles |
|
1219 | 7:daea875e9014 add/edit more largefiles | |
1220 | 6:4355d653f84f edit files yet again |
|
1220 | 6:4355d653f84f edit files yet again | |
1221 | 5:9d5af5072dbd edit files again |
|
1221 | 5:9d5af5072dbd edit files again | |
1222 | 4:74c02385b94c move files |
|
1222 | 4:74c02385b94c move files | |
1223 | 3:9e8fbc4bce62 copy files |
|
1223 | 3:9e8fbc4bce62 copy files | |
1224 | 2:51a0ae4d5864 remove files |
|
1224 | 2:51a0ae4d5864 remove files | |
1225 | 1:ce8896473775 edit files |
|
1225 | 1:ce8896473775 edit files | |
1226 | 0:30d30fe6a5be add files |
|
1226 | 0:30d30fe6a5be add files | |
1227 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' |
|
1227 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' | |
1228 | @ 9:598410d3eb9a modify normal file largefile in repo d |
|
1228 | @ 9:598410d3eb9a modify normal file largefile in repo d | |
1229 | | |
|
1229 | | | |
1230 | o 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1230 | o 8:a381d2c8c80e modify normal file and largefile in repo b | |
1231 | | |
|
1231 | | | |
1232 | o 7:daea875e9014 add/edit more largefiles |
|
1232 | o 7:daea875e9014 add/edit more largefiles | |
1233 | | |
|
1233 | | | |
1234 | o 6:4355d653f84f edit files yet again |
|
1234 | o 6:4355d653f84f edit files yet again | |
1235 | | |
|
1235 | | | |
1236 | o 5:9d5af5072dbd edit files again |
|
1236 | o 5:9d5af5072dbd edit files again | |
1237 | | |
|
1237 | | | |
1238 | o 4:74c02385b94c move files |
|
1238 | o 4:74c02385b94c move files | |
1239 | | |
|
1239 | | | |
1240 | o 3:9e8fbc4bce62 copy files |
|
1240 | o 3:9e8fbc4bce62 copy files | |
1241 | | |
|
1241 | | | |
1242 | o 2:51a0ae4d5864 remove files |
|
1242 | o 2:51a0ae4d5864 remove files | |
1243 | | |
|
1243 | | | |
1244 | o 1:ce8896473775 edit files |
|
1244 | o 1:ce8896473775 edit files | |
1245 | | |
|
1245 | | | |
1246 | o 0:30d30fe6a5be add files |
|
1246 | o 0:30d30fe6a5be add files | |
1247 |
|
1247 | |||
1248 | $ cat normal3 |
|
1248 | $ cat normal3 | |
1249 | normal3-modified |
|
1249 | normal3-modified | |
1250 | $ cat sub/normal4 |
|
1250 | $ cat sub/normal4 | |
1251 | normal4-modified |
|
1251 | normal4-modified | |
1252 | $ cat sub/large4 |
|
1252 | $ cat sub/large4 | |
1253 | large4-modified |
|
1253 | large4-modified | |
1254 | $ cat sub2/large6 |
|
1254 | $ cat sub2/large6 | |
1255 | large6-modified |
|
1255 | large6-modified | |
1256 | $ cat sub2/large7 |
|
1256 | $ cat sub2/large7 | |
1257 | large7 |
|
1257 | large7 | |
1258 | $ cd ../e |
|
1258 | $ cd ../e | |
1259 | $ hg pull ../b |
|
1259 | $ hg pull ../b | |
1260 | pulling from ../b |
|
1260 | pulling from ../b | |
1261 | searching for changes |
|
1261 | searching for changes | |
1262 | adding changesets |
|
1262 | adding changesets | |
1263 | adding manifests |
|
1263 | adding manifests | |
1264 | adding file changes |
|
1264 | adding file changes | |
1265 | added 1 changesets with 2 changes to 2 files (+1 heads) |
|
1265 | added 1 changesets with 2 changes to 2 files (+1 heads) | |
1266 | new changesets a381d2c8c80e (1 drafts) |
|
1266 | new changesets a381d2c8c80e (1 drafts) | |
1267 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
1267 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
1268 | $ hg rebase |
|
1268 | $ hg rebase | |
1269 | rebasing 8:f574fb32bb45 "modify normal file largefile in repo d" |
|
1269 | rebasing 8:f574fb32bb45 "modify normal file largefile in repo d" | |
1270 | Invoking status precommit hook |
|
1270 | Invoking status precommit hook | |
1271 | M sub/normal4 |
|
1271 | M sub/normal4 | |
1272 | M sub2/large6 |
|
1272 | M sub2/large6 | |
1273 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg |
|
1273 | saved backup bundle to $TESTTMP/e/.hg/strip-backup/f574fb32bb45-dd1d9f80-rebase.hg | |
1274 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
1274 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
1275 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1275 | 9:598410d3eb9a modify normal file largefile in repo d | |
1276 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1276 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1277 | 7:daea875e9014 add/edit more largefiles |
|
1277 | 7:daea875e9014 add/edit more largefiles | |
1278 | 6:4355d653f84f edit files yet again |
|
1278 | 6:4355d653f84f edit files yet again | |
1279 | 5:9d5af5072dbd edit files again |
|
1279 | 5:9d5af5072dbd edit files again | |
1280 | 4:74c02385b94c move files |
|
1280 | 4:74c02385b94c move files | |
1281 | 3:9e8fbc4bce62 copy files |
|
1281 | 3:9e8fbc4bce62 copy files | |
1282 | 2:51a0ae4d5864 remove files |
|
1282 | 2:51a0ae4d5864 remove files | |
1283 | 1:ce8896473775 edit files |
|
1283 | 1:ce8896473775 edit files | |
1284 | 0:30d30fe6a5be add files |
|
1284 | 0:30d30fe6a5be add files | |
1285 | $ cat normal3 |
|
1285 | $ cat normal3 | |
1286 | normal3-modified |
|
1286 | normal3-modified | |
1287 | $ cat sub/normal4 |
|
1287 | $ cat sub/normal4 | |
1288 | normal4-modified |
|
1288 | normal4-modified | |
1289 | $ cat sub/large4 |
|
1289 | $ cat sub/large4 | |
1290 | large4-modified |
|
1290 | large4-modified | |
1291 | $ cat sub2/large6 |
|
1291 | $ cat sub2/large6 | |
1292 | large6-modified |
|
1292 | large6-modified | |
1293 | $ cat sub2/large7 |
|
1293 | $ cat sub2/large7 | |
1294 | large7 |
|
1294 | large7 | |
1295 |
|
1295 | |||
1296 | Log on largefiles |
|
1296 | Log on largefiles | |
1297 |
|
1297 | |||
1298 | - same output |
|
1298 | - same output | |
1299 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 |
|
1299 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 | |
1300 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1300 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1301 | 6:4355d653f84f edit files yet again |
|
1301 | 6:4355d653f84f edit files yet again | |
1302 | 5:9d5af5072dbd edit files again |
|
1302 | 5:9d5af5072dbd edit files again | |
1303 | 4:74c02385b94c move files |
|
1303 | 4:74c02385b94c move files | |
1304 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 |
|
1304 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 | |
1305 | o 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1305 | o 8:a381d2c8c80e modify normal file and largefile in repo b | |
1306 | : |
|
1306 | : | |
1307 | o 6:4355d653f84f edit files yet again |
|
1307 | o 6:4355d653f84f edit files yet again | |
1308 | | |
|
1308 | | | |
1309 | o 5:9d5af5072dbd edit files again |
|
1309 | o 5:9d5af5072dbd edit files again | |
1310 | | |
|
1310 | | | |
1311 | o 4:74c02385b94c move files |
|
1311 | o 4:74c02385b94c move files | |
1312 | | |
|
1312 | | | |
1313 | ~ |
|
1313 | ~ | |
1314 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4 |
|
1314 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub/large4 | |
1315 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1315 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1316 | 6:4355d653f84f edit files yet again |
|
1316 | 6:4355d653f84f edit files yet again | |
1317 | 5:9d5af5072dbd edit files again |
|
1317 | 5:9d5af5072dbd edit files again | |
1318 | 4:74c02385b94c move files |
|
1318 | 4:74c02385b94c move files | |
1319 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 |
|
1319 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub/large4 | |
1320 | o 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1320 | o 8:a381d2c8c80e modify normal file and largefile in repo b | |
1321 | : |
|
1321 | : | |
1322 | o 6:4355d653f84f edit files yet again |
|
1322 | o 6:4355d653f84f edit files yet again | |
1323 | | |
|
1323 | | | |
1324 | o 5:9d5af5072dbd edit files again |
|
1324 | o 5:9d5af5072dbd edit files again | |
1325 | | |
|
1325 | | | |
1326 | o 4:74c02385b94c move files |
|
1326 | o 4:74c02385b94c move files | |
1327 | | |
|
1327 | | | |
1328 | ~ |
|
1328 | ~ | |
1329 |
|
1329 | |||
1330 | - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal |
|
1330 | - .hglf only matches largefiles, without .hglf it matches 9 bco sub/normal | |
1331 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub |
|
1331 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub | |
1332 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1332 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1333 | 6:4355d653f84f edit files yet again |
|
1333 | 6:4355d653f84f edit files yet again | |
1334 | 5:9d5af5072dbd edit files again |
|
1334 | 5:9d5af5072dbd edit files again | |
1335 | 4:74c02385b94c move files |
|
1335 | 4:74c02385b94c move files | |
1336 | 1:ce8896473775 edit files |
|
1336 | 1:ce8896473775 edit files | |
1337 | 0:30d30fe6a5be add files |
|
1337 | 0:30d30fe6a5be add files | |
1338 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub |
|
1338 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' .hglf/sub | |
1339 | o 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1339 | o 8:a381d2c8c80e modify normal file and largefile in repo b | |
1340 | : |
|
1340 | : | |
1341 | o 6:4355d653f84f edit files yet again |
|
1341 | o 6:4355d653f84f edit files yet again | |
1342 | | |
|
1342 | | | |
1343 | o 5:9d5af5072dbd edit files again |
|
1343 | o 5:9d5af5072dbd edit files again | |
1344 | | |
|
1344 | | | |
1345 | o 4:74c02385b94c move files |
|
1345 | o 4:74c02385b94c move files | |
1346 | : |
|
1346 | : | |
1347 | o 1:ce8896473775 edit files |
|
1347 | o 1:ce8896473775 edit files | |
1348 | | |
|
1348 | | | |
1349 | o 0:30d30fe6a5be add files |
|
1349 | o 0:30d30fe6a5be add files | |
1350 |
|
1350 | |||
1351 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub |
|
1351 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' sub | |
1352 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1352 | 9:598410d3eb9a modify normal file largefile in repo d | |
1353 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1353 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1354 | 6:4355d653f84f edit files yet again |
|
1354 | 6:4355d653f84f edit files yet again | |
1355 | 5:9d5af5072dbd edit files again |
|
1355 | 5:9d5af5072dbd edit files again | |
1356 | 4:74c02385b94c move files |
|
1356 | 4:74c02385b94c move files | |
1357 | 1:ce8896473775 edit files |
|
1357 | 1:ce8896473775 edit files | |
1358 | 0:30d30fe6a5be add files |
|
1358 | 0:30d30fe6a5be add files | |
1359 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub |
|
1359 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' sub | |
1360 | @ 9:598410d3eb9a modify normal file largefile in repo d |
|
1360 | @ 9:598410d3eb9a modify normal file largefile in repo d | |
1361 | | |
|
1361 | | | |
1362 | o 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1362 | o 8:a381d2c8c80e modify normal file and largefile in repo b | |
1363 | : |
|
1363 | : | |
1364 | o 6:4355d653f84f edit files yet again |
|
1364 | o 6:4355d653f84f edit files yet again | |
1365 | | |
|
1365 | | | |
1366 | o 5:9d5af5072dbd edit files again |
|
1366 | o 5:9d5af5072dbd edit files again | |
1367 | | |
|
1367 | | | |
1368 | o 4:74c02385b94c move files |
|
1368 | o 4:74c02385b94c move files | |
1369 | : |
|
1369 | : | |
1370 | o 1:ce8896473775 edit files |
|
1370 | o 1:ce8896473775 edit files | |
1371 | | |
|
1371 | | | |
1372 | o 0:30d30fe6a5be add files |
|
1372 | o 0:30d30fe6a5be add files | |
1373 |
|
1373 | |||
1374 | - globbing gives same result |
|
1374 | - globbing gives same result | |
1375 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*' |
|
1375 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*' | |
1376 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1376 | 9:598410d3eb9a modify normal file largefile in repo d | |
1377 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1377 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1378 | 6:4355d653f84f edit files yet again |
|
1378 | 6:4355d653f84f edit files yet again | |
1379 | 5:9d5af5072dbd edit files again |
|
1379 | 5:9d5af5072dbd edit files again | |
1380 | 4:74c02385b94c move files |
|
1380 | 4:74c02385b94c move files | |
1381 | 1:ce8896473775 edit files |
|
1381 | 1:ce8896473775 edit files | |
1382 | 0:30d30fe6a5be add files |
|
1382 | 0:30d30fe6a5be add files | |
1383 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*' |
|
1383 | $ hg log -G --template '{rev}:{node|short} {desc|firstline}\n' 'glob:sub/*' | |
1384 | @ 9:598410d3eb9a modify normal file largefile in repo d |
|
1384 | @ 9:598410d3eb9a modify normal file largefile in repo d | |
1385 | | |
|
1385 | | | |
1386 | o 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1386 | o 8:a381d2c8c80e modify normal file and largefile in repo b | |
1387 | : |
|
1387 | : | |
1388 | o 6:4355d653f84f edit files yet again |
|
1388 | o 6:4355d653f84f edit files yet again | |
1389 | | |
|
1389 | | | |
1390 | o 5:9d5af5072dbd edit files again |
|
1390 | o 5:9d5af5072dbd edit files again | |
1391 | | |
|
1391 | | | |
1392 | o 4:74c02385b94c move files |
|
1392 | o 4:74c02385b94c move files | |
1393 | : |
|
1393 | : | |
1394 | o 1:ce8896473775 edit files |
|
1394 | o 1:ce8896473775 edit files | |
1395 | | |
|
1395 | | | |
1396 | o 0:30d30fe6a5be add files |
|
1396 | o 0:30d30fe6a5be add files | |
1397 |
|
1397 | |||
1398 | Rollback on largefiles. |
|
1398 | Rollback on largefiles. | |
1399 |
|
1399 | |||
1400 | $ echo large4-modified-again > sub/large4 |
|
1400 | $ echo large4-modified-again > sub/large4 | |
1401 | $ hg commit -m "Modify large4 again" |
|
1401 | $ hg commit -m "Modify large4 again" | |
1402 | Invoking status precommit hook |
|
1402 | Invoking status precommit hook | |
1403 | M sub/large4 |
|
1403 | M sub/large4 | |
1404 | $ hg rollback |
|
1404 | $ hg rollback | |
1405 | repository tip rolled back to revision 9 (undo commit) |
|
1405 | repository tip rolled back to revision 9 (undo commit) | |
1406 | working directory now based on revision 9 |
|
1406 | working directory now based on revision 9 | |
1407 | $ hg st |
|
1407 | $ hg st | |
1408 | M sub/large4 |
|
1408 | M sub/large4 | |
1409 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
1409 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
1410 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1410 | 9:598410d3eb9a modify normal file largefile in repo d | |
1411 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1411 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1412 | 7:daea875e9014 add/edit more largefiles |
|
1412 | 7:daea875e9014 add/edit more largefiles | |
1413 | 6:4355d653f84f edit files yet again |
|
1413 | 6:4355d653f84f edit files yet again | |
1414 | 5:9d5af5072dbd edit files again |
|
1414 | 5:9d5af5072dbd edit files again | |
1415 | 4:74c02385b94c move files |
|
1415 | 4:74c02385b94c move files | |
1416 | 3:9e8fbc4bce62 copy files |
|
1416 | 3:9e8fbc4bce62 copy files | |
1417 | 2:51a0ae4d5864 remove files |
|
1417 | 2:51a0ae4d5864 remove files | |
1418 | 1:ce8896473775 edit files |
|
1418 | 1:ce8896473775 edit files | |
1419 | 0:30d30fe6a5be add files |
|
1419 | 0:30d30fe6a5be add files | |
1420 | $ cat sub/large4 |
|
1420 | $ cat sub/large4 | |
1421 | large4-modified-again |
|
1421 | large4-modified-again | |
1422 |
|
1422 | |||
1423 | "update --check" refuses to update with uncommitted changes. |
|
1423 | "update --check" refuses to update with uncommitted changes. | |
1424 | $ hg update --check 8 |
|
1424 | $ hg update --check 8 | |
1425 | abort: uncommitted changes |
|
1425 | abort: uncommitted changes | |
1426 | [255] |
|
1426 | [255] | |
1427 |
|
1427 | |||
1428 | "update --clean" leaves correct largefiles in working copy, even when there is |
|
1428 | "update --clean" leaves correct largefiles in working copy, even when there is | |
1429 | .orig files from revert in .hglf. |
|
1429 | .orig files from revert in .hglf. | |
1430 |
|
1430 | |||
1431 | $ echo mistake > sub2/large7 |
|
1431 | $ echo mistake > sub2/large7 | |
1432 | $ hg revert sub2/large7 |
|
1432 | $ hg revert sub2/large7 | |
1433 | $ cat sub2/large7 |
|
1433 | $ cat sub2/large7 | |
1434 | large7 |
|
1434 | large7 | |
1435 | $ cat sub2/large7.orig |
|
1435 | $ cat sub2/large7.orig | |
1436 | mistake |
|
1436 | mistake | |
1437 | $ test ! -f .hglf/sub2/large7.orig |
|
1437 | $ test ! -f .hglf/sub2/large7.orig | |
1438 |
|
1438 | |||
1439 | $ hg -q update --clean -r null |
|
1439 | $ hg -q update --clean -r null | |
1440 | $ hg update --clean |
|
1440 | $ hg update --clean | |
1441 | getting changed largefiles |
|
1441 | getting changed largefiles | |
1442 | 3 largefiles updated, 0 removed |
|
1442 | 3 largefiles updated, 0 removed | |
1443 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1443 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1444 | $ cat normal3 |
|
1444 | $ cat normal3 | |
1445 | normal3-modified |
|
1445 | normal3-modified | |
1446 | $ cat sub/normal4 |
|
1446 | $ cat sub/normal4 | |
1447 | normal4-modified |
|
1447 | normal4-modified | |
1448 | $ cat sub/large4 |
|
1448 | $ cat sub/large4 | |
1449 | large4-modified |
|
1449 | large4-modified | |
1450 | $ cat sub2/large6 |
|
1450 | $ cat sub2/large6 | |
1451 | large6-modified |
|
1451 | large6-modified | |
1452 | $ cat sub2/large7 |
|
1452 | $ cat sub2/large7 | |
1453 | large7 |
|
1453 | large7 | |
1454 | $ cat sub2/large7.orig |
|
1454 | $ cat sub2/large7.orig | |
1455 | mistake |
|
1455 | mistake | |
1456 | $ test ! -f .hglf/sub2/large7.orig |
|
1456 | $ test ! -f .hglf/sub2/large7.orig | |
1457 |
|
1457 | |||
1458 | verify that largefile .orig file no longer is overwritten on every update -C: |
|
1458 | verify that largefile .orig file no longer is overwritten on every update -C: | |
1459 | $ hg update --clean |
|
1459 | $ hg update --clean | |
1460 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1460 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1461 | $ cat sub2/large7.orig |
|
1461 | $ cat sub2/large7.orig | |
1462 | mistake |
|
1462 | mistake | |
1463 | $ rm sub2/large7.orig |
|
1463 | $ rm sub2/large7.orig | |
1464 |
|
1464 | |||
1465 | Now "update check" is happy. |
|
1465 | Now "update check" is happy. | |
1466 | $ hg update --check 8 |
|
1466 | $ hg update --check 8 | |
1467 | getting changed largefiles |
|
1467 | getting changed largefiles | |
1468 | 1 largefiles updated, 0 removed |
|
1468 | 1 largefiles updated, 0 removed | |
1469 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1469 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1470 | $ hg update --check |
|
1470 | $ hg update --check | |
1471 | getting changed largefiles |
|
1471 | getting changed largefiles | |
1472 | 1 largefiles updated, 0 removed |
|
1472 | 1 largefiles updated, 0 removed | |
1473 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1473 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1474 |
|
1474 | |||
1475 | Test removing empty largefiles directories on update |
|
1475 | Test removing empty largefiles directories on update | |
1476 | $ test -d sub2 && echo "sub2 exists" |
|
1476 | $ test -d sub2 && echo "sub2 exists" | |
1477 | sub2 exists |
|
1477 | sub2 exists | |
1478 | $ hg update -q null |
|
1478 | $ hg update -q null | |
1479 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
1479 | $ test -d sub2 && echo "error: sub2 should not exist anymore" | |
1480 | [1] |
|
1480 | [1] | |
1481 | $ hg update -q |
|
1481 | $ hg update -q | |
1482 |
|
1482 | |||
1483 | Test hg remove removes empty largefiles directories |
|
1483 | Test hg remove removes empty largefiles directories | |
1484 | $ test -d sub2 && echo "sub2 exists" |
|
1484 | $ test -d sub2 && echo "sub2 exists" | |
1485 | sub2 exists |
|
1485 | sub2 exists | |
1486 | $ hg remove sub2/* |
|
1486 | $ hg remove sub2/* | |
1487 | $ test -d sub2 && echo "error: sub2 should not exist anymore" |
|
1487 | $ test -d sub2 && echo "error: sub2 should not exist anymore" | |
1488 | [1] |
|
1488 | [1] | |
1489 | $ hg revert sub2/large6 sub2/large7 |
|
1489 | $ hg revert sub2/large6 sub2/large7 | |
1490 |
|
1490 | |||
1491 | "revert" works on largefiles (and normal files too). |
|
1491 | "revert" works on largefiles (and normal files too). | |
1492 | $ echo hack3 >> normal3 |
|
1492 | $ echo hack3 >> normal3 | |
1493 | $ echo hack4 >> sub/normal4 |
|
1493 | $ echo hack4 >> sub/normal4 | |
1494 | $ echo hack4 >> sub/large4 |
|
1494 | $ echo hack4 >> sub/large4 | |
1495 | $ rm sub2/large6 |
|
1495 | $ rm sub2/large6 | |
1496 | $ hg revert sub2/large6 |
|
1496 | $ hg revert sub2/large6 | |
1497 | $ hg rm sub2/large6 |
|
1497 | $ hg rm sub2/large6 | |
1498 | $ echo new >> sub2/large8 |
|
1498 | $ echo new >> sub2/large8 | |
1499 | $ hg add --large sub2/large8 |
|
1499 | $ hg add --large sub2/large8 | |
1500 | # XXX we don't really want to report that we're reverting the standin; |
|
1500 | # XXX we don't really want to report that we're reverting the standin; | |
1501 | # that's just an implementation detail. But I don't see an obvious fix. ;-( |
|
1501 | # that's just an implementation detail. But I don't see an obvious fix. ;-( | |
1502 | $ hg revert sub |
|
1502 | $ hg revert sub | |
1503 | reverting .hglf/sub/large4 |
|
1503 | reverting .hglf/sub/large4 | |
1504 | reverting sub/normal4 |
|
1504 | reverting sub/normal4 | |
1505 | $ hg status |
|
1505 | $ hg status | |
1506 | M normal3 |
|
1506 | M normal3 | |
1507 | A sub2/large8 |
|
1507 | A sub2/large8 | |
1508 | R sub2/large6 |
|
1508 | R sub2/large6 | |
1509 | ? sub/large4.orig |
|
1509 | ? sub/large4.orig | |
1510 | ? sub/normal4.orig |
|
1510 | ? sub/normal4.orig | |
1511 | $ cat sub/normal4 |
|
1511 | $ cat sub/normal4 | |
1512 | normal4-modified |
|
1512 | normal4-modified | |
1513 | $ cat sub/large4 |
|
1513 | $ cat sub/large4 | |
1514 | large4-modified |
|
1514 | large4-modified | |
1515 | $ hg revert -a --no-backup |
|
1515 | $ hg revert -a --no-backup | |
1516 | forgetting .hglf/sub2/large8 |
|
1516 | forgetting .hglf/sub2/large8 | |
1517 | reverting normal3 |
|
1517 | reverting normal3 | |
1518 | undeleting .hglf/sub2/large6 |
|
1518 | undeleting .hglf/sub2/large6 | |
1519 | $ hg status |
|
1519 | $ hg status | |
1520 | ? sub/large4.orig |
|
1520 | ? sub/large4.orig | |
1521 | ? sub/normal4.orig |
|
1521 | ? sub/normal4.orig | |
1522 | ? sub2/large8 |
|
1522 | ? sub2/large8 | |
1523 | $ cat normal3 |
|
1523 | $ cat normal3 | |
1524 | normal3-modified |
|
1524 | normal3-modified | |
1525 | $ cat sub2/large6 |
|
1525 | $ cat sub2/large6 | |
1526 | large6-modified |
|
1526 | large6-modified | |
1527 | $ rm sub/*.orig sub2/large8 |
|
1527 | $ rm sub/*.orig sub2/large8 | |
1528 |
|
1528 | |||
1529 | revert some files to an older revision |
|
1529 | revert some files to an older revision | |
1530 | $ hg revert --no-backup -r 8 sub2 |
|
1530 | $ hg revert --no-backup -r 8 sub2 | |
1531 | reverting .hglf/sub2/large6 |
|
1531 | reverting .hglf/sub2/large6 | |
1532 | $ cat sub2/large6 |
|
1532 | $ cat sub2/large6 | |
1533 | large6 |
|
1533 | large6 | |
1534 | $ hg revert --no-backup -C -r '.^' sub2 |
|
1534 | $ hg revert --no-backup -C -r '.^' sub2 | |
1535 | $ hg revert --no-backup sub2 |
|
1535 | $ hg revert --no-backup sub2 | |
1536 | reverting .hglf/sub2/large6 |
|
1536 | reverting .hglf/sub2/large6 | |
1537 | $ hg status |
|
1537 | $ hg status | |
1538 |
|
1538 | |||
1539 | "verify --large" actually verifies largefiles |
|
1539 | "verify --large" actually verifies largefiles | |
1540 |
|
1540 | |||
1541 | - Where Do We Come From? What Are We? Where Are We Going? |
|
1541 | - Where Do We Come From? What Are We? Where Are We Going? | |
1542 | $ pwd |
|
1542 | $ pwd | |
1543 | $TESTTMP/e |
|
1543 | $TESTTMP/e | |
1544 | $ hg paths |
|
1544 | $ hg paths | |
1545 | default = $TESTTMP/d |
|
1545 | default = $TESTTMP/d | |
1546 |
|
1546 | |||
1547 | $ hg verify --large |
|
1547 | $ hg verify --large | |
1548 | checking changesets |
|
1548 | checking changesets | |
1549 | checking manifests |
|
1549 | checking manifests | |
1550 | crosschecking files in changesets and manifests |
|
1550 | crosschecking files in changesets and manifests | |
1551 | checking files |
|
1551 | checking files | |
1552 | checked 10 changesets with 28 changes to 10 files |
|
1552 | checked 10 changesets with 28 changes to 10 files | |
1553 | searching 1 changesets for largefiles |
|
1553 | searching 1 changesets for largefiles | |
1554 | verified existence of 3 revisions of 3 largefiles |
|
1554 | verified existence of 3 revisions of 3 largefiles | |
1555 |
|
1555 | |||
1556 | - introduce missing blob in local store repo and remote store |
|
1556 | - introduce missing blob in local store repo and remote store | |
1557 | and make sure that this is caught: |
|
1557 | and make sure that this is caught: | |
1558 |
|
1558 | |||
1559 | $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 . |
|
1559 | $ mv $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 . | |
1560 | $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 |
|
1560 | $ rm .hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 | |
1561 | $ hg verify --large |
|
1561 | $ hg verify --large | |
1562 | checking changesets |
|
1562 | checking changesets | |
1563 | checking manifests |
|
1563 | checking manifests | |
1564 | crosschecking files in changesets and manifests |
|
1564 | crosschecking files in changesets and manifests | |
1565 | checking files |
|
1565 | checking files | |
1566 | checked 10 changesets with 28 changes to 10 files |
|
1566 | checked 10 changesets with 28 changes to 10 files | |
1567 | searching 1 changesets for largefiles |
|
1567 | searching 1 changesets for largefiles | |
1568 | changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 |
|
1568 | changeset 9:598410d3eb9a: sub/large4 references missing $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 | |
1569 | verified existence of 3 revisions of 3 largefiles |
|
1569 | verified existence of 3 revisions of 3 largefiles | |
1570 | [1] |
|
1570 | [1] | |
1571 |
|
1571 | |||
1572 | - introduce corruption and make sure that it is caught when checking content: |
|
1572 | - introduce corruption and make sure that it is caught when checking content: | |
1573 | $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 |
|
1573 | $ echo '5 cents' > $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 | |
1574 | $ hg verify -q --large --lfc |
|
1574 | $ hg verify -q --large --lfc | |
1575 | changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 |
|
1575 | changeset 9:598410d3eb9a: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/e166e74c7303192238d60af5a9c4ce9bef0b7928 | |
1576 | [1] |
|
1576 | [1] | |
1577 |
|
1577 | |||
1578 | - cleanup |
|
1578 | - cleanup | |
1579 | $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/ |
|
1579 | $ cp e166e74c7303192238d60af5a9c4ce9bef0b7928 $TESTTMP/d/.hg/largefiles/ | |
1580 | $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/ |
|
1580 | $ mv e166e74c7303192238d60af5a9c4ce9bef0b7928 .hg/largefiles/ | |
1581 |
|
1581 | |||
1582 | - verifying all revisions will fail because we didn't clone all largefiles to d: |
|
1582 | - verifying all revisions will fail because we didn't clone all largefiles to d: | |
1583 | $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
1583 | $ echo 'T-shirt' > $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
1584 | $ hg verify -q --lfa --lfc |
|
1584 | $ hg verify -q --lfa --lfc | |
1585 | changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 |
|
1585 | changeset 0:30d30fe6a5be: large1 references missing $TESTTMP/d/.hg/largefiles/4669e532d5b2c093a78eca010077e708a071bb64 | |
1586 | changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d |
|
1586 | changeset 0:30d30fe6a5be: sub/large2 references missing $TESTTMP/d/.hg/largefiles/1deebade43c8c498a3c8daddac0244dc55d1331d | |
1587 | changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f |
|
1587 | changeset 1:ce8896473775: large1 references missing $TESTTMP/d/.hg/largefiles/5f78770c0e77ba4287ad6ef3071c9bf9c379742f | |
1588 | changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
1588 | changeset 1:ce8896473775: sub/large2 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
1589 | changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
1589 | changeset 3:9e8fbc4bce62: large1 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
1590 | changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
1590 | changeset 4:74c02385b94c: large3 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
1591 | changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
1591 | changeset 4:74c02385b94c: sub/large4 references corrupted $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
1592 | changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c |
|
1592 | changeset 5:9d5af5072dbd: large3 references missing $TESTTMP/d/.hg/largefiles/baaf12afde9d8d67f25dab6dced0d2bf77dba47c | |
1593 | changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 |
|
1593 | changeset 5:9d5af5072dbd: sub/large4 references missing $TESTTMP/d/.hg/largefiles/aeb2210d19f02886dde00dac279729a48471e2f9 | |
1594 | changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 |
|
1594 | changeset 6:4355d653f84f: large3 references missing $TESTTMP/d/.hg/largefiles/7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
1595 | [1] |
|
1595 | [1] | |
1596 |
|
1596 | |||
1597 | - cleanup |
|
1597 | - cleanup | |
1598 | $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 |
|
1598 | $ rm $TESTTMP/d/.hg/largefiles/eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
1599 | $ rm -f .hglf/sub/*.orig |
|
1599 | $ rm -f .hglf/sub/*.orig | |
1600 |
|
1600 | |||
1601 | Update to revision with missing largefile - and make sure it really is missing |
|
1601 | Update to revision with missing largefile - and make sure it really is missing | |
1602 |
|
1602 | |||
1603 | $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0 |
|
1603 | $ rm ${USERCACHE}/7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
1604 | $ hg up -r 6 |
|
1604 | $ hg up -r 6 | |
1605 | getting changed largefiles |
|
1605 | getting changed largefiles | |
1606 | large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob) |
|
1606 | large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob) | |
1607 | 1 largefiles updated, 2 removed |
|
1607 | 1 largefiles updated, 2 removed | |
1608 | 4 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1608 | 4 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
1609 | $ rm normal3 |
|
1609 | $ rm normal3 | |
1610 | $ echo >> sub/normal4 |
|
1610 | $ echo >> sub/normal4 | |
1611 | $ hg ci -m 'commit with missing files' |
|
1611 | $ hg ci -m 'commit with missing files' | |
1612 | Invoking status precommit hook |
|
1612 | Invoking status precommit hook | |
1613 | M sub/normal4 |
|
1613 | M sub/normal4 | |
1614 | ! large3 |
|
1614 | ! large3 | |
1615 | ! normal3 |
|
1615 | ! normal3 | |
1616 | created new head |
|
1616 | created new head | |
1617 | $ hg st |
|
1617 | $ hg st | |
1618 | ! large3 |
|
1618 | ! large3 | |
1619 | ! normal3 |
|
1619 | ! normal3 | |
1620 | $ hg up -r. |
|
1620 | $ hg up -r. | |
1621 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1621 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1622 | $ hg st |
|
1622 | $ hg st | |
1623 | ! large3 |
|
1623 | ! large3 | |
1624 | ! normal3 |
|
1624 | ! normal3 | |
1625 | $ hg up -Cr. |
|
1625 | $ hg up -Cr. | |
1626 | getting changed largefiles |
|
1626 | getting changed largefiles | |
1627 | large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob) |
|
1627 | large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob) | |
1628 | 0 largefiles updated, 0 removed |
|
1628 | 0 largefiles updated, 0 removed | |
1629 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1629 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1630 | $ hg st |
|
1630 | $ hg st | |
1631 | ! large3 |
|
1631 | ! large3 | |
1632 | $ hg rollback |
|
1632 | $ hg rollback | |
1633 | repository tip rolled back to revision 9 (undo commit) |
|
1633 | repository tip rolled back to revision 9 (undo commit) | |
1634 | working directory now based on revision 6 |
|
1634 | working directory now based on revision 6 | |
1635 |
|
1635 | |||
1636 | Merge with revision with missing largefile - and make sure it tries to fetch it. |
|
1636 | Merge with revision with missing largefile - and make sure it tries to fetch it. | |
1637 |
|
1637 | |||
1638 | $ hg up -Cqr null |
|
1638 | $ hg up -Cqr null | |
1639 | $ echo f > f |
|
1639 | $ echo f > f | |
1640 | $ hg ci -Am branch |
|
1640 | $ hg ci -Am branch | |
1641 | adding f |
|
1641 | adding f | |
1642 | Invoking status precommit hook |
|
1642 | Invoking status precommit hook | |
1643 | A f |
|
1643 | A f | |
1644 | created new head |
|
1644 | created new head | |
1645 | $ hg merge -r 6 |
|
1645 | $ hg merge -r 6 | |
1646 | getting changed largefiles |
|
1646 | getting changed largefiles | |
1647 | large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob) |
|
1647 | large3: largefile 7838695e10da2bb75ac1156565f40a2595fa2fa0 not available from file:/*/$TESTTMP/d (glob) | |
1648 | 1 largefiles updated, 0 removed |
|
1648 | 1 largefiles updated, 0 removed | |
1649 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1649 | 4 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1650 | (branch merge, don't forget to commit) |
|
1650 | (branch merge, don't forget to commit) | |
1651 |
|
1651 | |||
1652 | $ hg rollback -q |
|
1652 | $ hg rollback -q | |
1653 | $ hg up -Cq |
|
1653 | $ hg up -Cq | |
1654 |
|
1654 | |||
1655 | Pulling 0 revisions with --all-largefiles should not fetch for all revisions |
|
1655 | Pulling 0 revisions with --all-largefiles should not fetch for all revisions | |
1656 |
|
1656 | |||
1657 | $ hg pull --all-largefiles |
|
1657 | $ hg pull --all-largefiles | |
1658 | pulling from $TESTTMP/d |
|
1658 | pulling from $TESTTMP/d | |
1659 | searching for changes |
|
1659 | searching for changes | |
1660 | no changes found |
|
1660 | no changes found | |
1661 |
|
1661 | |||
1662 | Merging does not revert to old versions of largefiles and also check |
|
1662 | Merging does not revert to old versions of largefiles and also check | |
1663 | that merging after having pulled from a non-default remote works |
|
1663 | that merging after having pulled from a non-default remote works | |
1664 | correctly. |
|
1664 | correctly. | |
1665 |
|
1665 | |||
1666 | $ cd .. |
|
1666 | $ cd .. | |
1667 | $ hg clone -r 7 e temp |
|
1667 | $ hg clone -r 7 e temp | |
1668 | adding changesets |
|
1668 | adding changesets | |
1669 | adding manifests |
|
1669 | adding manifests | |
1670 | adding file changes |
|
1670 | adding file changes | |
1671 | added 8 changesets with 24 changes to 10 files |
|
1671 | added 8 changesets with 24 changes to 10 files | |
1672 | new changesets 30d30fe6a5be:daea875e9014 (8 drafts) |
|
1672 | new changesets 30d30fe6a5be:daea875e9014 (8 drafts) | |
1673 | updating to branch default |
|
1673 | updating to branch default | |
1674 | getting changed largefiles |
|
1674 | getting changed largefiles | |
1675 | 3 largefiles updated, 0 removed |
|
1675 | 3 largefiles updated, 0 removed | |
1676 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1676 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1677 | $ hg clone temp f |
|
1677 | $ hg clone temp f | |
1678 | updating to branch default |
|
1678 | updating to branch default | |
1679 | getting changed largefiles |
|
1679 | getting changed largefiles | |
1680 | 3 largefiles updated, 0 removed |
|
1680 | 3 largefiles updated, 0 removed | |
1681 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1681 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1682 | # Delete the largefiles in the largefiles system cache so that we have an |
|
1682 | # Delete the largefiles in the largefiles system cache so that we have an | |
1683 | # opportunity to test that caching after a pull works. |
|
1683 | # opportunity to test that caching after a pull works. | |
1684 | $ rm "${USERCACHE}"/* |
|
1684 | $ rm "${USERCACHE}"/* | |
1685 | $ cd f |
|
1685 | $ cd f | |
1686 | $ echo "large4-merge-test" > sub/large4 |
|
1686 | $ echo "large4-merge-test" > sub/large4 | |
1687 | $ hg commit -m "Modify large4 to test merge" |
|
1687 | $ hg commit -m "Modify large4 to test merge" | |
1688 | Invoking status precommit hook |
|
1688 | Invoking status precommit hook | |
1689 | M sub/large4 |
|
1689 | M sub/large4 | |
1690 | # Test --cache-largefiles flag |
|
1690 | # Test --cache-largefiles flag | |
1691 | $ hg pull --lfrev 'heads(pulled())' ../e |
|
1691 | $ hg pull --lfrev 'heads(pulled())' ../e | |
1692 | pulling from ../e |
|
1692 | pulling from ../e | |
1693 | searching for changes |
|
1693 | searching for changes | |
1694 | adding changesets |
|
1694 | adding changesets | |
1695 | adding manifests |
|
1695 | adding manifests | |
1696 | adding file changes |
|
1696 | adding file changes | |
1697 | added 2 changesets with 4 changes to 4 files (+1 heads) |
|
1697 | added 2 changesets with 4 changes to 4 files (+1 heads) | |
1698 | new changesets a381d2c8c80e:598410d3eb9a (2 drafts) |
|
1698 | new changesets a381d2c8c80e:598410d3eb9a (2 drafts) | |
1699 | (run 'hg heads' to see heads, 'hg merge' to merge) |
|
1699 | (run 'hg heads' to see heads, 'hg merge' to merge) | |
1700 | 2 largefiles cached |
|
1700 | 2 largefiles cached | |
1701 | $ hg merge |
|
1701 | $ hg merge | |
1702 | largefile sub/large4 has a merge conflict |
|
1702 | largefile sub/large4 has a merge conflict | |
1703 | ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591 |
|
1703 | ancestor was 971fb41e78fea4f8e0ba5244784239371cb00591 | |
1704 | keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or |
|
1704 | you can keep (l)ocal d846f26643bfa8ec210be40cc93cc6b7ff1128ea or take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928. | |
1705 | take (o)ther e166e74c7303192238d60af5a9c4ce9bef0b7928? l |
|
1705 | what do you want to do? l | |
1706 | getting changed largefiles |
|
1706 | getting changed largefiles | |
1707 | 1 largefiles updated, 0 removed |
|
1707 | 1 largefiles updated, 0 removed | |
1708 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1708 | 3 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
1709 | (branch merge, don't forget to commit) |
|
1709 | (branch merge, don't forget to commit) | |
1710 | $ hg commit -m "Merge repos e and f" |
|
1710 | $ hg commit -m "Merge repos e and f" | |
1711 | Invoking status precommit hook |
|
1711 | Invoking status precommit hook | |
1712 | M normal3 |
|
1712 | M normal3 | |
1713 | M sub/normal4 |
|
1713 | M sub/normal4 | |
1714 | M sub2/large6 |
|
1714 | M sub2/large6 | |
1715 | $ cat normal3 |
|
1715 | $ cat normal3 | |
1716 | normal3-modified |
|
1716 | normal3-modified | |
1717 | $ cat sub/normal4 |
|
1717 | $ cat sub/normal4 | |
1718 | normal4-modified |
|
1718 | normal4-modified | |
1719 | $ cat sub/large4 |
|
1719 | $ cat sub/large4 | |
1720 | large4-merge-test |
|
1720 | large4-merge-test | |
1721 | $ cat sub2/large6 |
|
1721 | $ cat sub2/large6 | |
1722 | large6-modified |
|
1722 | large6-modified | |
1723 | $ cat sub2/large7 |
|
1723 | $ cat sub2/large7 | |
1724 | large7 |
|
1724 | large7 | |
1725 |
|
1725 | |||
1726 | Test status after merging with a branch that introduces a new largefile: |
|
1726 | Test status after merging with a branch that introduces a new largefile: | |
1727 |
|
1727 | |||
1728 | $ echo large > large |
|
1728 | $ echo large > large | |
1729 | $ hg add --large large |
|
1729 | $ hg add --large large | |
1730 | $ hg commit -m 'add largefile' |
|
1730 | $ hg commit -m 'add largefile' | |
1731 | Invoking status precommit hook |
|
1731 | Invoking status precommit hook | |
1732 | A large |
|
1732 | A large | |
1733 | $ hg update -q ".^" |
|
1733 | $ hg update -q ".^" | |
1734 | $ echo change >> normal3 |
|
1734 | $ echo change >> normal3 | |
1735 | $ hg commit -m 'some change' |
|
1735 | $ hg commit -m 'some change' | |
1736 | Invoking status precommit hook |
|
1736 | Invoking status precommit hook | |
1737 | M normal3 |
|
1737 | M normal3 | |
1738 | created new head |
|
1738 | created new head | |
1739 | $ hg merge |
|
1739 | $ hg merge | |
1740 | getting changed largefiles |
|
1740 | getting changed largefiles | |
1741 | 1 largefiles updated, 0 removed |
|
1741 | 1 largefiles updated, 0 removed | |
1742 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1742 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1743 | (branch merge, don't forget to commit) |
|
1743 | (branch merge, don't forget to commit) | |
1744 | $ hg status |
|
1744 | $ hg status | |
1745 | M large |
|
1745 | M large | |
1746 |
|
1746 | |||
1747 | - make sure update of merge with removed largefiles fails as expected |
|
1747 | - make sure update of merge with removed largefiles fails as expected | |
1748 | $ hg rm sub2/large6 |
|
1748 | $ hg rm sub2/large6 | |
1749 | $ hg up -r. |
|
1749 | $ hg up -r. | |
1750 | abort: outstanding uncommitted merge |
|
1750 | abort: outstanding uncommitted merge | |
1751 | [255] |
|
1751 | [255] | |
1752 |
|
1752 | |||
1753 | - revert should be able to revert files introduced in a pending merge |
|
1753 | - revert should be able to revert files introduced in a pending merge | |
1754 | $ hg revert --all -r . |
|
1754 | $ hg revert --all -r . | |
1755 | removing .hglf/large |
|
1755 | removing .hglf/large | |
1756 | undeleting .hglf/sub2/large6 |
|
1756 | undeleting .hglf/sub2/large6 | |
1757 |
|
1757 | |||
1758 | Test that a normal file and a largefile with the same name and path cannot |
|
1758 | Test that a normal file and a largefile with the same name and path cannot | |
1759 | coexist. |
|
1759 | coexist. | |
1760 |
|
1760 | |||
1761 | $ rm sub2/large7 |
|
1761 | $ rm sub2/large7 | |
1762 | $ echo "largeasnormal" > sub2/large7 |
|
1762 | $ echo "largeasnormal" > sub2/large7 | |
1763 | $ hg add sub2/large7 |
|
1763 | $ hg add sub2/large7 | |
1764 | sub2/large7 already a largefile |
|
1764 | sub2/large7 already a largefile | |
1765 |
|
1765 | |||
1766 | Test that transplanting a largefile change works correctly. |
|
1766 | Test that transplanting a largefile change works correctly. | |
1767 |
|
1767 | |||
1768 | $ cd .. |
|
1768 | $ cd .. | |
1769 | $ hg clone -r 8 d g |
|
1769 | $ hg clone -r 8 d g | |
1770 | adding changesets |
|
1770 | adding changesets | |
1771 | adding manifests |
|
1771 | adding manifests | |
1772 | adding file changes |
|
1772 | adding file changes | |
1773 | added 9 changesets with 26 changes to 10 files |
|
1773 | added 9 changesets with 26 changes to 10 files | |
1774 | new changesets 30d30fe6a5be:a381d2c8c80e (9 drafts) |
|
1774 | new changesets 30d30fe6a5be:a381d2c8c80e (9 drafts) | |
1775 | updating to branch default |
|
1775 | updating to branch default | |
1776 | getting changed largefiles |
|
1776 | getting changed largefiles | |
1777 | 3 largefiles updated, 0 removed |
|
1777 | 3 largefiles updated, 0 removed | |
1778 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1778 | 5 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
1779 | $ cd g |
|
1779 | $ cd g | |
1780 | $ hg transplant -s ../d 598410d3eb9a |
|
1780 | $ hg transplant -s ../d 598410d3eb9a | |
1781 | searching for changes |
|
1781 | searching for changes | |
1782 | searching for changes |
|
1782 | searching for changes | |
1783 | adding changesets |
|
1783 | adding changesets | |
1784 | adding manifests |
|
1784 | adding manifests | |
1785 | adding file changes |
|
1785 | adding file changes | |
1786 | added 1 changesets with 2 changes to 2 files |
|
1786 | added 1 changesets with 2 changes to 2 files | |
1787 | new changesets 598410d3eb9a (1 drafts) |
|
1787 | new changesets 598410d3eb9a (1 drafts) | |
1788 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' |
|
1788 | $ hg log --template '{rev}:{node|short} {desc|firstline}\n' | |
1789 | 9:598410d3eb9a modify normal file largefile in repo d |
|
1789 | 9:598410d3eb9a modify normal file largefile in repo d | |
1790 | 8:a381d2c8c80e modify normal file and largefile in repo b |
|
1790 | 8:a381d2c8c80e modify normal file and largefile in repo b | |
1791 | 7:daea875e9014 add/edit more largefiles |
|
1791 | 7:daea875e9014 add/edit more largefiles | |
1792 | 6:4355d653f84f edit files yet again |
|
1792 | 6:4355d653f84f edit files yet again | |
1793 | 5:9d5af5072dbd edit files again |
|
1793 | 5:9d5af5072dbd edit files again | |
1794 | 4:74c02385b94c move files |
|
1794 | 4:74c02385b94c move files | |
1795 | 3:9e8fbc4bce62 copy files |
|
1795 | 3:9e8fbc4bce62 copy files | |
1796 | 2:51a0ae4d5864 remove files |
|
1796 | 2:51a0ae4d5864 remove files | |
1797 | 1:ce8896473775 edit files |
|
1797 | 1:ce8896473775 edit files | |
1798 | 0:30d30fe6a5be add files |
|
1798 | 0:30d30fe6a5be add files | |
1799 | $ cat normal3 |
|
1799 | $ cat normal3 | |
1800 | normal3-modified |
|
1800 | normal3-modified | |
1801 | $ cat sub/normal4 |
|
1801 | $ cat sub/normal4 | |
1802 | normal4-modified |
|
1802 | normal4-modified | |
1803 | $ cat sub/large4 |
|
1803 | $ cat sub/large4 | |
1804 | large4-modified |
|
1804 | large4-modified | |
1805 | $ cat sub2/large6 |
|
1805 | $ cat sub2/large6 | |
1806 | large6-modified |
|
1806 | large6-modified | |
1807 | $ cat sub2/large7 |
|
1807 | $ cat sub2/large7 | |
1808 | large7 |
|
1808 | large7 | |
1809 |
|
1809 | |||
1810 | Cat a largefile |
|
1810 | Cat a largefile | |
1811 | $ hg cat normal3 |
|
1811 | $ hg cat normal3 | |
1812 | normal3-modified |
|
1812 | normal3-modified | |
1813 | $ hg cat sub/large4 |
|
1813 | $ hg cat sub/large4 | |
1814 | large4-modified |
|
1814 | large4-modified | |
1815 | $ rm "${USERCACHE}"/* |
|
1815 | $ rm "${USERCACHE}"/* | |
1816 | $ hg cat -r a381d2c8c80e -o cat.out sub/large4 |
|
1816 | $ hg cat -r a381d2c8c80e -o cat.out sub/large4 | |
1817 | $ cat cat.out |
|
1817 | $ cat cat.out | |
1818 | large4-modified |
|
1818 | large4-modified | |
1819 | $ rm cat.out |
|
1819 | $ rm cat.out | |
1820 | $ hg cat -r a381d2c8c80e normal3 |
|
1820 | $ hg cat -r a381d2c8c80e normal3 | |
1821 | normal3-modified |
|
1821 | normal3-modified | |
1822 | $ hg cat -r '.^' normal3 |
|
1822 | $ hg cat -r '.^' normal3 | |
1823 | normal3-modified |
|
1823 | normal3-modified | |
1824 | $ hg cat -r '.^' sub/large4 doesntexist |
|
1824 | $ hg cat -r '.^' sub/large4 doesntexist | |
1825 | large4-modified |
|
1825 | large4-modified | |
1826 | doesntexist: no such file in rev a381d2c8c80e |
|
1826 | doesntexist: no such file in rev a381d2c8c80e | |
1827 | $ hg --cwd sub cat -r '.^' large4 |
|
1827 | $ hg --cwd sub cat -r '.^' large4 | |
1828 | large4-modified |
|
1828 | large4-modified | |
1829 | $ hg --cwd sub cat -r '.^' ../normal3 |
|
1829 | $ hg --cwd sub cat -r '.^' ../normal3 | |
1830 | normal3-modified |
|
1830 | normal3-modified | |
1831 | Cat a standin |
|
1831 | Cat a standin | |
1832 | $ hg cat .hglf/sub/large4 |
|
1832 | $ hg cat .hglf/sub/large4 | |
1833 | e166e74c7303192238d60af5a9c4ce9bef0b7928 |
|
1833 | e166e74c7303192238d60af5a9c4ce9bef0b7928 | |
1834 | $ hg cat .hglf/normal3 |
|
1834 | $ hg cat .hglf/normal3 | |
1835 | .hglf/normal3: no such file in rev 598410d3eb9a |
|
1835 | .hglf/normal3: no such file in rev 598410d3eb9a | |
1836 | [1] |
|
1836 | [1] | |
1837 |
|
1837 | |||
1838 | Test that renaming a largefile results in correct output for status |
|
1838 | Test that renaming a largefile results in correct output for status | |
1839 |
|
1839 | |||
1840 | $ hg rename sub/large4 large4-renamed |
|
1840 | $ hg rename sub/large4 large4-renamed | |
1841 | $ hg commit -m "test rename output" |
|
1841 | $ hg commit -m "test rename output" | |
1842 | Invoking status precommit hook |
|
1842 | Invoking status precommit hook | |
1843 | A large4-renamed |
|
1843 | A large4-renamed | |
1844 | R sub/large4 |
|
1844 | R sub/large4 | |
1845 | $ cat large4-renamed |
|
1845 | $ cat large4-renamed | |
1846 | large4-modified |
|
1846 | large4-modified | |
1847 | $ cd sub2 |
|
1847 | $ cd sub2 | |
1848 | $ hg rename large6 large6-renamed |
|
1848 | $ hg rename large6 large6-renamed | |
1849 | $ hg st |
|
1849 | $ hg st | |
1850 | A sub2/large6-renamed |
|
1850 | A sub2/large6-renamed | |
1851 | R sub2/large6 |
|
1851 | R sub2/large6 | |
1852 | $ cd .. |
|
1852 | $ cd .. | |
1853 |
|
1853 | |||
1854 | Test --normal flag |
|
1854 | Test --normal flag | |
1855 |
|
1855 | |||
1856 | $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null |
|
1856 | $ dd if=/dev/zero bs=2k count=11k > new-largefile 2> /dev/null | |
1857 | $ hg add --normal --large new-largefile |
|
1857 | $ hg add --normal --large new-largefile | |
1858 | abort: --normal cannot be used with --large |
|
1858 | abort: --normal cannot be used with --large | |
1859 | [255] |
|
1859 | [255] | |
1860 | $ hg add --normal new-largefile |
|
1860 | $ hg add --normal new-largefile | |
1861 | new-largefile: up to 69 MB of RAM may be required to manage this file |
|
1861 | new-largefile: up to 69 MB of RAM may be required to manage this file | |
1862 | (use 'hg revert new-largefile' to cancel the pending addition) |
|
1862 | (use 'hg revert new-largefile' to cancel the pending addition) | |
1863 | $ hg revert new-largefile |
|
1863 | $ hg revert new-largefile | |
1864 | $ hg --config ui.large-file-limit=22M add --normal new-largefile |
|
1864 | $ hg --config ui.large-file-limit=22M add --normal new-largefile | |
1865 |
|
1865 | |||
1866 | Test explicit commit of switch between normal and largefile - make sure both |
|
1866 | Test explicit commit of switch between normal and largefile - make sure both | |
1867 | the add and the remove is committed. |
|
1867 | the add and the remove is committed. | |
1868 |
|
1868 | |||
1869 | $ hg up -qC |
|
1869 | $ hg up -qC | |
1870 | $ hg forget normal3 large4-renamed |
|
1870 | $ hg forget normal3 large4-renamed | |
1871 | $ hg add --large normal3 |
|
1871 | $ hg add --large normal3 | |
1872 | $ hg add large4-renamed |
|
1872 | $ hg add large4-renamed | |
1873 | $ hg commit -m 'swap' normal3 large4-renamed |
|
1873 | $ hg commit -m 'swap' normal3 large4-renamed | |
1874 | Invoking status precommit hook |
|
1874 | Invoking status precommit hook | |
1875 | A large4-renamed |
|
1875 | A large4-renamed | |
1876 | A normal3 |
|
1876 | A normal3 | |
1877 | ? new-largefile |
|
1877 | ? new-largefile | |
1878 | ? sub2/large6-renamed |
|
1878 | ? sub2/large6-renamed | |
1879 | $ hg mani |
|
1879 | $ hg mani | |
1880 | .hglf/normal3 |
|
1880 | .hglf/normal3 | |
1881 | .hglf/sub2/large6 |
|
1881 | .hglf/sub2/large6 | |
1882 | .hglf/sub2/large7 |
|
1882 | .hglf/sub2/large7 | |
1883 | large4-renamed |
|
1883 | large4-renamed | |
1884 | sub/normal4 |
|
1884 | sub/normal4 | |
1885 |
|
1885 | |||
1886 | $ cd .. |
|
1886 | $ cd .. | |
1887 |
|
1887 | |||
1888 |
|
1888 | |||
1889 |
|
1889 |
General Comments 0
You need to be logged in to leave comments.
Login now