Show More
@@ -1,205 +1,214 b'' | |||||
1 | # lfs - hash-preserving large file support using Git-LFS protocol |
|
1 | # lfs - hash-preserving large file support using Git-LFS protocol | |
2 | # |
|
2 | # | |
3 | # Copyright 2017 Facebook, Inc. |
|
3 | # Copyright 2017 Facebook, Inc. | |
4 | # |
|
4 | # | |
5 | # This software may be used and distributed according to the terms of the |
|
5 | # This software may be used and distributed according to the terms of the | |
6 | # GNU General Public License version 2 or any later version. |
|
6 | # GNU General Public License version 2 or any later version. | |
7 |
|
7 | |||
8 | """lfs - large file support (EXPERIMENTAL) |
|
8 | """lfs - large file support (EXPERIMENTAL) | |
9 |
|
9 | |||
10 | Configs:: |
|
10 | Configs:: | |
11 |
|
11 | |||
12 | [lfs] |
|
12 | [lfs] | |
13 | # Remote endpoint. Multiple protocols are supported: |
|
13 | # Remote endpoint. Multiple protocols are supported: | |
14 | # - http(s)://user:pass@example.com/path |
|
14 | # - http(s)://user:pass@example.com/path | |
15 | # git-lfs endpoint |
|
15 | # git-lfs endpoint | |
16 | # - file:///tmp/path |
|
16 | # - file:///tmp/path | |
17 | # local filesystem, usually for testing |
|
17 | # local filesystem, usually for testing | |
18 | # if unset, lfs will prompt setting this when it must use this value. |
|
18 | # if unset, lfs will prompt setting this when it must use this value. | |
19 | # (default: unset) |
|
19 | # (default: unset) | |
20 | url = https://example.com/lfs |
|
20 | url = https://example.com/lfs | |
21 |
|
21 | |||
22 | # size of a file to make it use LFS |
|
22 | # size of a file to make it use LFS | |
23 | threshold = 10M |
|
23 | threshold = 10M | |
24 |
|
24 | |||
25 | # how many times to retry before giving up on transferring an object |
|
25 | # how many times to retry before giving up on transferring an object | |
26 | retry = 5 |
|
26 | retry = 5 | |
27 |
|
27 | |||
28 | # the local directory to store lfs files for sharing across local clones. |
|
28 | # the local directory to store lfs files for sharing across local clones. | |
29 | # If not set, the cache is located in an OS specific cache location. |
|
29 | # If not set, the cache is located in an OS specific cache location. | |
30 | usercache = /path/to/global/cache |
|
30 | usercache = /path/to/global/cache | |
31 | """ |
|
31 | """ | |
32 |
|
32 | |||
33 | from __future__ import absolute_import |
|
33 | from __future__ import absolute_import | |
34 |
|
34 | |||
35 | from mercurial.i18n import _ |
|
35 | from mercurial.i18n import _ | |
36 |
|
36 | |||
37 | from mercurial import ( |
|
37 | from mercurial import ( | |
38 | bundle2, |
|
38 | bundle2, | |
39 | changegroup, |
|
39 | changegroup, | |
40 | context, |
|
40 | context, | |
41 | exchange, |
|
41 | exchange, | |
42 | extensions, |
|
42 | extensions, | |
43 | filelog, |
|
43 | filelog, | |
44 | hg, |
|
44 | hg, | |
45 | localrepo, |
|
45 | localrepo, | |
|
46 | node, | |||
46 | registrar, |
|
47 | registrar, | |
47 | revlog, |
|
48 | revlog, | |
48 | scmutil, |
|
49 | scmutil, | |
49 | upgrade, |
|
50 | upgrade, | |
50 | vfs as vfsmod, |
|
51 | vfs as vfsmod, | |
51 | ) |
|
52 | ) | |
52 |
|
53 | |||
53 | from . import ( |
|
54 | from . import ( | |
54 | blobstore, |
|
55 | blobstore, | |
55 | wrapper, |
|
56 | wrapper, | |
56 | ) |
|
57 | ) | |
57 |
|
58 | |||
58 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
|
59 | # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | |
59 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
|
60 | # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | |
60 | # be specifying the version(s) of Mercurial they are tested with, or |
|
61 | # be specifying the version(s) of Mercurial they are tested with, or | |
61 | # leave the attribute unspecified. |
|
62 | # leave the attribute unspecified. | |
62 | testedwith = 'ships-with-hg-core' |
|
63 | testedwith = 'ships-with-hg-core' | |
63 |
|
64 | |||
64 | configtable = {} |
|
65 | configtable = {} | |
65 | configitem = registrar.configitem(configtable) |
|
66 | configitem = registrar.configitem(configtable) | |
66 |
|
67 | |||
67 | configitem('experimental', 'lfs.user-agent', |
|
68 | configitem('experimental', 'lfs.user-agent', | |
68 | default=None, |
|
69 | default=None, | |
69 | ) |
|
70 | ) | |
70 |
|
71 | |||
71 | configitem('lfs', 'url', |
|
72 | configitem('lfs', 'url', | |
72 | default=configitem.dynamicdefault, |
|
73 | default=configitem.dynamicdefault, | |
73 | ) |
|
74 | ) | |
74 | configitem('lfs', 'usercache', |
|
75 | configitem('lfs', 'usercache', | |
75 | default=None, |
|
76 | default=None, | |
76 | ) |
|
77 | ) | |
77 | configitem('lfs', 'threshold', |
|
78 | configitem('lfs', 'threshold', | |
78 | default=None, |
|
79 | default=None, | |
79 | ) |
|
80 | ) | |
80 | configitem('lfs', 'retry', |
|
81 | configitem('lfs', 'retry', | |
81 | default=5, |
|
82 | default=5, | |
82 | ) |
|
83 | ) | |
83 | # Deprecated |
|
84 | # Deprecated | |
84 | configitem('lfs', 'remotestore', |
|
85 | configitem('lfs', 'remotestore', | |
85 | default=None, |
|
86 | default=None, | |
86 | ) |
|
87 | ) | |
87 | # Deprecated |
|
88 | # Deprecated | |
88 | configitem('lfs', 'dummy', |
|
89 | configitem('lfs', 'dummy', | |
89 | default=None, |
|
90 | default=None, | |
90 | ) |
|
91 | ) | |
91 | # Deprecated |
|
92 | # Deprecated | |
92 | configitem('lfs', 'git-lfs', |
|
93 | configitem('lfs', 'git-lfs', | |
93 | default=None, |
|
94 | default=None, | |
94 | ) |
|
95 | ) | |
95 |
|
96 | |||
96 | cmdtable = {} |
|
97 | cmdtable = {} | |
97 | command = registrar.command(cmdtable) |
|
98 | command = registrar.command(cmdtable) | |
98 |
|
99 | |||
99 | templatekeyword = registrar.templatekeyword() |
|
100 | templatekeyword = registrar.templatekeyword() | |
100 |
|
101 | |||
101 | def featuresetup(ui, supported): |
|
102 | def featuresetup(ui, supported): | |
102 | # don't die on seeing a repo with the lfs requirement |
|
103 | # don't die on seeing a repo with the lfs requirement | |
103 | supported |= {'lfs'} |
|
104 | supported |= {'lfs'} | |
104 |
|
105 | |||
105 | def uisetup(ui): |
|
106 | def uisetup(ui): | |
106 | localrepo.localrepository.featuresetupfuncs.add(featuresetup) |
|
107 | localrepo.localrepository.featuresetupfuncs.add(featuresetup) | |
107 |
|
108 | |||
108 | def reposetup(ui, repo): |
|
109 | def reposetup(ui, repo): | |
109 | # Nothing to do with a remote repo |
|
110 | # Nothing to do with a remote repo | |
110 | if not repo.local(): |
|
111 | if not repo.local(): | |
111 | return |
|
112 | return | |
112 |
|
113 | |||
113 | threshold = repo.ui.configbytes('lfs', 'threshold') |
|
114 | threshold = repo.ui.configbytes('lfs', 'threshold') | |
114 |
|
115 | |||
115 | repo.svfs.options['lfsthreshold'] = threshold |
|
116 | repo.svfs.options['lfsthreshold'] = threshold | |
116 | repo.svfs.lfslocalblobstore = blobstore.local(repo) |
|
117 | repo.svfs.lfslocalblobstore = blobstore.local(repo) | |
117 | repo.svfs.lfsremoteblobstore = blobstore.remote(repo) |
|
118 | repo.svfs.lfsremoteblobstore = blobstore.remote(repo) | |
118 |
|
119 | |||
119 | # Push hook |
|
120 | # Push hook | |
120 | repo.prepushoutgoinghooks.add('lfs', wrapper.prepush) |
|
121 | repo.prepushoutgoinghooks.add('lfs', wrapper.prepush) | |
121 |
|
122 | |||
122 | if 'lfs' not in repo.requirements: |
|
123 | if 'lfs' not in repo.requirements: | |
123 | def checkrequireslfs(ui, repo, **kwargs): |
|
124 | def checkrequireslfs(ui, repo, **kwargs): | |
124 | if 'lfs' not in repo.requirements: |
|
125 | if 'lfs' not in repo.requirements: | |
125 |
|
|
126 | last = kwargs.get('node_last') | |
|
127 | _bin = node.bin | |||
|
128 | if last: | |||
|
129 | s = repo.set('%n:%n', _bin(kwargs['node']), _bin(last)) | |||
|
130 | else: | |||
|
131 | s = repo.set('%n', _bin(kwargs['node'])) | |||
|
132 | for ctx in s: | |||
126 | # TODO: is there a way to just walk the files in the commit? |
|
133 | # TODO: is there a way to just walk the files in the commit? | |
127 | if any(ctx[f].islfs() for f in ctx.files() if f in ctx): |
|
134 | if any(ctx[f].islfs() for f in ctx.files() if f in ctx): | |
128 | repo.requirements.add('lfs') |
|
135 | repo.requirements.add('lfs') | |
129 | repo._writerequirements() |
|
136 | repo._writerequirements() | |
|
137 | break | |||
130 |
|
138 | |||
131 | ui.setconfig('hooks', 'commit.lfs', checkrequireslfs, 'lfs') |
|
139 | ui.setconfig('hooks', 'commit.lfs', checkrequireslfs, 'lfs') | |
|
140 | ui.setconfig('hooks', 'pretxnchangegroup.lfs', checkrequireslfs, 'lfs') | |||
132 |
|
141 | |||
133 | def wrapfilelog(filelog): |
|
142 | def wrapfilelog(filelog): | |
134 | wrapfunction = extensions.wrapfunction |
|
143 | wrapfunction = extensions.wrapfunction | |
135 |
|
144 | |||
136 | wrapfunction(filelog, 'addrevision', wrapper.filelogaddrevision) |
|
145 | wrapfunction(filelog, 'addrevision', wrapper.filelogaddrevision) | |
137 | wrapfunction(filelog, 'renamed', wrapper.filelogrenamed) |
|
146 | wrapfunction(filelog, 'renamed', wrapper.filelogrenamed) | |
138 | wrapfunction(filelog, 'size', wrapper.filelogsize) |
|
147 | wrapfunction(filelog, 'size', wrapper.filelogsize) | |
139 |
|
148 | |||
140 | def extsetup(ui): |
|
149 | def extsetup(ui): | |
141 | wrapfilelog(filelog.filelog) |
|
150 | wrapfilelog(filelog.filelog) | |
142 |
|
151 | |||
143 | wrapfunction = extensions.wrapfunction |
|
152 | wrapfunction = extensions.wrapfunction | |
144 |
|
153 | |||
145 | wrapfunction(scmutil, 'wrapconvertsink', wrapper.convertsink) |
|
154 | wrapfunction(scmutil, 'wrapconvertsink', wrapper.convertsink) | |
146 |
|
155 | |||
147 | wrapfunction(upgrade, '_finishdatamigration', |
|
156 | wrapfunction(upgrade, '_finishdatamigration', | |
148 | wrapper.upgradefinishdatamigration) |
|
157 | wrapper.upgradefinishdatamigration) | |
149 |
|
158 | |||
150 | wrapfunction(upgrade, 'preservedrequirements', |
|
159 | wrapfunction(upgrade, 'preservedrequirements', | |
151 | wrapper.upgraderequirements) |
|
160 | wrapper.upgraderequirements) | |
152 |
|
161 | |||
153 | wrapfunction(upgrade, 'supporteddestrequirements', |
|
162 | wrapfunction(upgrade, 'supporteddestrequirements', | |
154 | wrapper.upgraderequirements) |
|
163 | wrapper.upgraderequirements) | |
155 |
|
164 | |||
156 | wrapfunction(changegroup, |
|
165 | wrapfunction(changegroup, | |
157 | 'supportedoutgoingversions', |
|
166 | 'supportedoutgoingversions', | |
158 | wrapper.supportedoutgoingversions) |
|
167 | wrapper.supportedoutgoingversions) | |
159 | wrapfunction(changegroup, |
|
168 | wrapfunction(changegroup, | |
160 | 'allsupportedversions', |
|
169 | 'allsupportedversions', | |
161 | wrapper.allsupportedversions) |
|
170 | wrapper.allsupportedversions) | |
162 |
|
171 | |||
163 | wrapfunction(context.basefilectx, 'cmp', wrapper.filectxcmp) |
|
172 | wrapfunction(context.basefilectx, 'cmp', wrapper.filectxcmp) | |
164 | wrapfunction(context.basefilectx, 'isbinary', wrapper.filectxisbinary) |
|
173 | wrapfunction(context.basefilectx, 'isbinary', wrapper.filectxisbinary) | |
165 | context.basefilectx.islfs = wrapper.filectxislfs |
|
174 | context.basefilectx.islfs = wrapper.filectxislfs | |
166 |
|
175 | |||
167 | revlog.addflagprocessor( |
|
176 | revlog.addflagprocessor( | |
168 | revlog.REVIDX_EXTSTORED, |
|
177 | revlog.REVIDX_EXTSTORED, | |
169 | ( |
|
178 | ( | |
170 | wrapper.readfromstore, |
|
179 | wrapper.readfromstore, | |
171 | wrapper.writetostore, |
|
180 | wrapper.writetostore, | |
172 | wrapper.bypasscheckhash, |
|
181 | wrapper.bypasscheckhash, | |
173 | ), |
|
182 | ), | |
174 | ) |
|
183 | ) | |
175 |
|
184 | |||
176 | wrapfunction(hg, 'clone', wrapper.hgclone) |
|
185 | wrapfunction(hg, 'clone', wrapper.hgclone) | |
177 | wrapfunction(hg, 'postshare', wrapper.hgpostshare) |
|
186 | wrapfunction(hg, 'postshare', wrapper.hgpostshare) | |
178 |
|
187 | |||
179 | # Make bundle choose changegroup3 instead of changegroup2. This affects |
|
188 | # Make bundle choose changegroup3 instead of changegroup2. This affects | |
180 | # "hg bundle" command. Note: it does not cover all bundle formats like |
|
189 | # "hg bundle" command. Note: it does not cover all bundle formats like | |
181 | # "packed1". Using "packed1" with lfs will likely cause trouble. |
|
190 | # "packed1". Using "packed1" with lfs will likely cause trouble. | |
182 | names = [k for k, v in exchange._bundlespeccgversions.items() if v == '02'] |
|
191 | names = [k for k, v in exchange._bundlespeccgversions.items() if v == '02'] | |
183 | for k in names: |
|
192 | for k in names: | |
184 | exchange._bundlespeccgversions[k] = '03' |
|
193 | exchange._bundlespeccgversions[k] = '03' | |
185 |
|
194 | |||
186 | # bundlerepo uses "vfsmod.readonlyvfs(othervfs)", we need to make sure lfs |
|
195 | # bundlerepo uses "vfsmod.readonlyvfs(othervfs)", we need to make sure lfs | |
187 | # options and blob stores are passed from othervfs to the new readonlyvfs. |
|
196 | # options and blob stores are passed from othervfs to the new readonlyvfs. | |
188 | wrapfunction(vfsmod.readonlyvfs, '__init__', wrapper.vfsinit) |
|
197 | wrapfunction(vfsmod.readonlyvfs, '__init__', wrapper.vfsinit) | |
189 |
|
198 | |||
190 | # when writing a bundle via "hg bundle" command, upload related LFS blobs |
|
199 | # when writing a bundle via "hg bundle" command, upload related LFS blobs | |
191 | wrapfunction(bundle2, 'writenewbundle', wrapper.writenewbundle) |
|
200 | wrapfunction(bundle2, 'writenewbundle', wrapper.writenewbundle) | |
192 |
|
201 | |||
193 | @templatekeyword('lfs_files') |
|
202 | @templatekeyword('lfs_files') | |
194 | def lfsfiles(repo, ctx, **args): |
|
203 | def lfsfiles(repo, ctx, **args): | |
195 | """List of strings. LFS files added or modified by the changeset.""" |
|
204 | """List of strings. LFS files added or modified by the changeset.""" | |
196 | pointers = wrapper.pointersfromctx(ctx) # {path: pointer} |
|
205 | pointers = wrapper.pointersfromctx(ctx) # {path: pointer} | |
197 | return sorted(pointers.keys()) |
|
206 | return sorted(pointers.keys()) | |
198 |
|
207 | |||
199 | @command('debuglfsupload', |
|
208 | @command('debuglfsupload', | |
200 | [('r', 'rev', [], _('upload large files introduced by REV'))]) |
|
209 | [('r', 'rev', [], _('upload large files introduced by REV'))]) | |
201 | def debuglfsupload(ui, repo, **opts): |
|
210 | def debuglfsupload(ui, repo, **opts): | |
202 | """upload lfs blobs added by the working copy parent or given revisions""" |
|
211 | """upload lfs blobs added by the working copy parent or given revisions""" | |
203 | revs = opts.get('rev', []) |
|
212 | revs = opts.get('rev', []) | |
204 | pointers = wrapper.extractpointers(repo, scmutil.revrange(repo, revs)) |
|
213 | pointers = wrapper.extractpointers(repo, scmutil.revrange(repo, revs)) | |
205 | wrapper.uploadblobs(repo, pointers) |
|
214 | wrapper.uploadblobs(repo, pointers) |
@@ -1,292 +1,299 b'' | |||||
1 | #testcases lfsremote-on lfsremote-off |
|
1 | #testcases lfsremote-on lfsremote-off | |
2 | #require serve |
|
2 | #require serve | |
3 |
|
3 | |||
4 | This test splits `hg serve` with and without using the extension into separate |
|
4 | This test splits `hg serve` with and without using the extension into separate | |
5 | tests cases. The tests are broken down as follows, where "LFS"/"No-LFS" |
|
5 | tests cases. The tests are broken down as follows, where "LFS"/"No-LFS" | |
6 | indicates whether or not there are commits that use an LFS file, and "D"/"E" |
|
6 | indicates whether or not there are commits that use an LFS file, and "D"/"E" | |
7 | indicates whether or not the extension is loaded. The "X" cases are not tested |
|
7 | indicates whether or not the extension is loaded. The "X" cases are not tested | |
8 | individually, because the lfs requirement causes the process to bail early if |
|
8 | individually, because the lfs requirement causes the process to bail early if | |
9 | the extension is disabled. |
|
9 | the extension is disabled. | |
10 |
|
10 | |||
11 | . Server |
|
11 | . Server | |
12 | . |
|
12 | . | |
13 | . No-LFS LFS |
|
13 | . No-LFS LFS | |
14 | . +----------------------------+ |
|
14 | . +----------------------------+ | |
15 | . | || D | E | D | E | |
|
15 | . | || D | E | D | E | | |
16 | . |---++=======================| |
|
16 | . |---++=======================| | |
17 | . C | D || N/A | #1 | X | #4 | |
|
17 | . C | D || N/A | #1 | X | #4 | | |
18 | . l No +---++-----------------------| |
|
18 | . l No +---++-----------------------| | |
19 | . i LFS | E || #2 | #2 | X | #5 | |
|
19 | . i LFS | E || #2 | #2 | X | #5 | | |
20 | . e +---++-----------------------| |
|
20 | . e +---++-----------------------| | |
21 | . n | D || X | X | X | X | |
|
21 | . n | D || X | X | X | X | | |
22 | . t LFS |---++-----------------------| |
|
22 | . t LFS |---++-----------------------| | |
23 | . | E || #3 | #3 | X | #6 | |
|
23 | . | E || #3 | #3 | X | #6 | | |
24 | . |---++-----------------------+ |
|
24 | . |---++-----------------------+ | |
25 |
|
25 | |||
26 | $ hg init server |
|
26 | $ hg init server | |
27 | $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires" |
|
27 | $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires" | |
28 |
|
28 | |||
29 | Skip the experimental.changegroup3=True config. Failure to agree on this comes |
|
29 | Skip the experimental.changegroup3=True config. Failure to agree on this comes | |
30 | first, and causes a "ValueError: no common changegroup version" or "abort: |
|
30 | first, and causes a "ValueError: no common changegroup version" or "abort: | |
31 | HTTP Error 500: Internal Server Error", if the extension is only loaded on one |
|
31 | HTTP Error 500: Internal Server Error", if the extension is only loaded on one | |
32 | side. If that *is* enabled, the subsequent failure is "abort: missing processor |
|
32 | side. If that *is* enabled, the subsequent failure is "abort: missing processor | |
33 | for flag '0x2000'!" if the extension is only loaded on one side (possibly also |
|
33 | for flag '0x2000'!" if the extension is only loaded on one side (possibly also | |
34 | masked by the Internal Server Error message). |
|
34 | masked by the Internal Server Error message). | |
35 | $ cat >> $HGRCPATH <<EOF |
|
35 | $ cat >> $HGRCPATH <<EOF | |
36 | > [lfs] |
|
36 | > [lfs] | |
37 | > url=file:$TESTTMP/dummy-remote/ |
|
37 | > url=file:$TESTTMP/dummy-remote/ | |
38 | > threshold=10 |
|
38 | > threshold=10 | |
39 | > [web] |
|
39 | > [web] | |
40 | > allow_push=* |
|
40 | > allow_push=* | |
41 | > push_ssl=False |
|
41 | > push_ssl=False | |
42 | > EOF |
|
42 | > EOF | |
43 |
|
43 | |||
44 | #if lfsremote-on |
|
44 | #if lfsremote-on | |
45 | $ hg --config extensions.lfs= -R server \ |
|
45 | $ hg --config extensions.lfs= -R server \ | |
46 | > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log |
|
46 | > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log | |
47 | #else |
|
47 | #else | |
48 | $ hg --config extensions.lfs=! -R server \ |
|
48 | $ hg --config extensions.lfs=! -R server \ | |
49 | > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log |
|
49 | > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log | |
50 | #endif |
|
50 | #endif | |
51 |
|
51 | |||
52 | $ cat hg.pid >> $DAEMON_PIDS |
|
52 | $ cat hg.pid >> $DAEMON_PIDS | |
53 | $ hg clone -q http://localhost:$HGPORT client |
|
53 | $ hg clone -q http://localhost:$HGPORT client | |
54 | $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES |
|
54 | $ grep 'lfs' client/.hg/requires $SERVER_REQUIRES | |
55 | [1] |
|
55 | [1] | |
56 |
|
56 | |||
57 | -------------------------------------------------------------------------------- |
|
57 | -------------------------------------------------------------------------------- | |
58 | Case #1: client with non-lfs content and the extension disabled; server with |
|
58 | Case #1: client with non-lfs content and the extension disabled; server with | |
59 | non-lfs content, and the extension enabled. |
|
59 | non-lfs content, and the extension enabled. | |
60 |
|
60 | |||
61 | $ cd client |
|
61 | $ cd client | |
62 | $ echo 'non-lfs' > nonlfs.txt |
|
62 | $ echo 'non-lfs' > nonlfs.txt | |
63 | $ hg ci -Aqm 'non-lfs' |
|
63 | $ hg ci -Aqm 'non-lfs' | |
64 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
64 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
65 | [1] |
|
65 | [1] | |
66 |
|
66 | |||
67 | #if lfsremote-on |
|
67 | #if lfsremote-on | |
68 |
|
68 | |||
69 | $ hg push -q |
|
69 | $ hg push -q | |
70 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
70 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
71 | [1] |
|
71 | [1] | |
72 |
|
72 | |||
73 | TODO: fail more gracefully, or don't mandate changegroup3 for non-lfs repos. |
|
73 | TODO: fail more gracefully, or don't mandate changegroup3 for non-lfs repos. | |
74 |
|
74 | |||
75 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone |
|
75 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone | |
76 | abort: HTTP Error 500: Internal Server Error |
|
76 | abort: HTTP Error 500: Internal Server Error | |
77 | [255] |
|
77 | [255] | |
78 | $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES |
|
78 | $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES | |
79 | grep: $TESTTMP/client1_clone/.hg/requires: $ENOENT$ |
|
79 | grep: $TESTTMP/client1_clone/.hg/requires: $ENOENT$ | |
80 | [2] |
|
80 | [2] | |
81 |
|
81 | |||
82 | TODO: fail more gracefully, or don't mandate changegroup3 for non-lfs repos. |
|
82 | TODO: fail more gracefully, or don't mandate changegroup3 for non-lfs repos. | |
83 |
|
83 | |||
84 | $ hg init $TESTTMP/client1_pull |
|
84 | $ hg init $TESTTMP/client1_pull | |
85 | $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT |
|
85 | $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT | |
86 | abort: HTTP Error 500: Internal Server Error |
|
86 | abort: HTTP Error 500: Internal Server Error | |
87 | [255] |
|
87 | [255] | |
88 | $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES |
|
88 | $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES | |
89 | [1] |
|
89 | [1] | |
90 |
|
90 | |||
91 | $ hg identify http://localhost:$HGPORT |
|
91 | $ hg identify http://localhost:$HGPORT | |
92 | d437e1d24fbd |
|
92 | d437e1d24fbd | |
93 |
|
93 | |||
94 | #endif |
|
94 | #endif | |
95 |
|
95 | |||
96 | -------------------------------------------------------------------------------- |
|
96 | -------------------------------------------------------------------------------- | |
97 | Case #2: client with non-lfs content and the extension enabled; server with |
|
97 | Case #2: client with non-lfs content and the extension enabled; server with | |
98 | non-lfs content, and the extension state controlled by #testcases. |
|
98 | non-lfs content, and the extension state controlled by #testcases. | |
99 |
|
99 | |||
100 | $ cat >> $HGRCPATH <<EOF |
|
100 | $ cat >> $HGRCPATH <<EOF | |
101 | > [extensions] |
|
101 | > [extensions] | |
102 | > lfs = |
|
102 | > lfs = | |
103 | > EOF |
|
103 | > EOF | |
104 | $ echo 'non-lfs' > nonlfs2.txt |
|
104 | $ echo 'non-lfs' > nonlfs2.txt | |
105 | $ hg ci -Aqm 'non-lfs file with lfs client' |
|
105 | $ hg ci -Aqm 'non-lfs file with lfs client' | |
106 |
|
106 | |||
107 | TODO: fail more gracefully here |
|
107 | TODO: fail more gracefully here | |
108 | $ hg push -q 2>&1 | grep '^[A-Z]' || true |
|
108 | $ hg push -q 2>&1 | grep '^[A-Z]' || true | |
109 | Traceback (most recent call last): (lfsremote-off !) |
|
109 | Traceback (most recent call last): (lfsremote-off !) | |
110 | ValueError: no common changegroup version (lfsremote-off !) |
|
110 | ValueError: no common changegroup version (lfsremote-off !) | |
111 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
111 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
112 | [1] |
|
112 | [1] | |
113 |
|
113 | |||
114 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone |
|
114 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client2_clone | |
115 | $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES |
|
115 | $ grep 'lfs' $TESTTMP/client2_clone/.hg/requires $SERVER_REQUIRES | |
116 | [1] |
|
116 | [1] | |
117 |
|
117 | |||
118 | $ hg init $TESTTMP/client2_pull |
|
118 | $ hg init $TESTTMP/client2_pull | |
119 | $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT |
|
119 | $ hg -R $TESTTMP/client2_pull pull -q http://localhost:$HGPORT | |
120 | $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES |
|
120 | $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES | |
121 | [1] |
|
121 | [1] | |
122 |
|
122 | |||
123 | XXX: The difference here is the push failed above when the extension isn't |
|
123 | XXX: The difference here is the push failed above when the extension isn't | |
124 | enabled on the server. The extension shouldn't need to mess with changegroup |
|
124 | enabled on the server. The extension shouldn't need to mess with changegroup | |
125 | versions if there is no lfs content. But the requirement needs to be |
|
125 | versions if there is no lfs content. But the requirement needs to be | |
126 | consistently added before that can be ratcheted back. |
|
126 | consistently added before that can be ratcheted back. | |
127 | $ hg identify http://localhost:$HGPORT |
|
127 | $ hg identify http://localhost:$HGPORT | |
128 | 1477875038c6 (lfsremote-on !) |
|
128 | 1477875038c6 (lfsremote-on !) | |
129 | 000000000000 (lfsremote-off !) |
|
129 | 000000000000 (lfsremote-off !) | |
130 |
|
130 | |||
131 | -------------------------------------------------------------------------------- |
|
131 | -------------------------------------------------------------------------------- | |
132 | Case #3: client with lfs content and the extension enabled; server with |
|
132 | Case #3: client with lfs content and the extension enabled; server with | |
133 | non-lfs content, and the extension state controlled by #testcases. |
|
133 | non-lfs content, and the extension state controlled by #testcases. The server | |
|
134 | should have an 'lfs' requirement after it picks up its first commit with a blob. | |||
134 |
|
135 | |||
135 | TODO: add the 'lfs' requirement on the server for each test in lfsremote-on |
|
|||
136 | $ echo 'this is a big lfs file' > lfs.bin |
|
136 | $ echo 'this is a big lfs file' > lfs.bin | |
137 | $ hg ci -Aqm 'lfs' |
|
137 | $ hg ci -Aqm 'lfs' | |
138 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
138 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
139 | .hg/requires:lfs |
|
139 | .hg/requires:lfs | |
140 |
|
140 | |||
141 | TODO: fail more gracefully here |
|
141 | TODO: fail more gracefully here | |
142 | $ hg push -q 2>&1 | grep '^[A-Z]' || true |
|
142 | $ hg push -q 2>&1 | grep '^[A-Z]' || true | |
143 | Traceback (most recent call last): (lfsremote-off !) |
|
143 | Traceback (most recent call last): (lfsremote-off !) | |
144 | ValueError: no common changegroup version (lfsremote-off !) |
|
144 | ValueError: no common changegroup version (lfsremote-off !) | |
145 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
145 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
146 | .hg/requires:lfs |
|
146 | .hg/requires:lfs | |
|
147 | $TESTTMP/server/.hg/requires:lfs (lfsremote-on !) | |||
147 |
|
148 | |||
148 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone |
|
149 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client3_clone | |
149 | $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES |
|
150 | $ grep 'lfs' $TESTTMP/client3_clone/.hg/requires $SERVER_REQUIRES || true | |
150 | [1] |
|
151 | $TESTTMP/client3_clone/.hg/requires:lfs (lfsremote-on !) | |
|
152 | $TESTTMP/server/.hg/requires:lfs (lfsremote-on !) | |||
151 |
|
153 | |||
152 | $ hg init $TESTTMP/client3_pull |
|
154 | $ hg init $TESTTMP/client3_pull | |
153 | $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT |
|
155 | $ hg -R $TESTTMP/client3_pull pull -q http://localhost:$HGPORT | |
154 | $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES |
|
156 | $ grep 'lfs' $TESTTMP/client3_pull/.hg/requires $SERVER_REQUIRES || true | |
155 | [1] |
|
157 | $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !) | |
|
158 | $TESTTMP/server/.hg/requires:lfs (lfsremote-on !) | |||
156 |
|
159 | |||
157 | XXX: The difference here is the push failed above when the extension isn't |
|
160 | XXX: The difference here is the push failed above when the extension isn't | |
158 | enabled on the server. The extension shouldn't need to mess with changegroup |
|
161 | enabled on the server. The extension shouldn't need to mess with changegroup | |
159 | versions if there is no lfs content. But the requirement needs to be |
|
162 | versions if there is no lfs content. But the requirement needs to be | |
160 | consistently added before that can be ratcheted back. |
|
163 | consistently added before that can be ratcheted back. | |
161 | $ hg identify http://localhost:$HGPORT |
|
164 | $ hg identify http://localhost:$HGPORT | |
162 | 8374dc4052cb (lfsremote-on !) |
|
165 | 8374dc4052cb (lfsremote-on !) | |
163 | 000000000000 (lfsremote-off !) |
|
166 | 000000000000 (lfsremote-off !) | |
164 |
|
167 | |||
165 | Don't bother testing the lfsremote-off cases- the server won't be able |
|
168 | Don't bother testing the lfsremote-off cases- the server won't be able | |
166 | to launch if there's lfs content and the extension is disabled. |
|
169 | to launch if there's lfs content and the extension is disabled. | |
167 |
|
170 | |||
168 | #if lfsremote-on |
|
171 | #if lfsremote-on | |
169 |
|
172 | |||
170 | -------------------------------------------------------------------------------- |
|
173 | -------------------------------------------------------------------------------- | |
171 | Case #4: client with non-lfs content and the extension disabled; server with |
|
174 | Case #4: client with non-lfs content and the extension disabled; server with | |
172 | lfs content, and the extension enabled. |
|
175 | lfs content, and the extension enabled. | |
173 |
|
176 | |||
174 | $ cat >> $HGRCPATH <<EOF |
|
177 | $ cat >> $HGRCPATH <<EOF | |
175 | > [extensions] |
|
178 | > [extensions] | |
176 | > lfs = ! |
|
179 | > lfs = ! | |
177 | > EOF |
|
180 | > EOF | |
178 |
|
181 | |||
179 | $ hg init $TESTTMP/client4 |
|
182 | $ hg init $TESTTMP/client4 | |
180 | $ cd $TESTTMP/client4 |
|
183 | $ cd $TESTTMP/client4 | |
181 | $ cat >> .hg/hgrc <<EOF |
|
184 | $ cat >> .hg/hgrc <<EOF | |
182 | > [paths] |
|
185 | > [paths] | |
183 | > default = http://localhost:$HGPORT |
|
186 | > default = http://localhost:$HGPORT | |
184 | > EOF |
|
187 | > EOF | |
185 | $ echo 'non-lfs' > nonlfs2.txt |
|
188 | $ echo 'non-lfs' > nonlfs2.txt | |
186 | $ hg ci -Aqm 'non-lfs' |
|
189 | $ hg ci -Aqm 'non-lfs' | |
187 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
190 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
188 | [1] |
|
191 | $TESTTMP/server/.hg/requires:lfs | |
189 |
|
192 | |||
190 | $ hg push -q --force |
|
193 | $ hg push -q --force | |
191 | warning: repository is unrelated |
|
194 | warning: repository is unrelated | |
192 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
195 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
193 | [1] |
|
196 | $TESTTMP/server/.hg/requires:lfs | |
194 |
|
197 | |||
195 | TODO: fail more gracefully. |
|
198 | TODO: fail more gracefully. | |
196 |
|
199 | |||
197 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client4_clone |
|
200 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client4_clone | |
198 | abort: HTTP Error 500: Internal Server Error |
|
201 | abort: HTTP Error 500: Internal Server Error | |
199 | [255] |
|
202 | [255] | |
200 | $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES |
|
203 | $ grep 'lfs' $TESTTMP/client4_clone/.hg/requires $SERVER_REQUIRES | |
201 | grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$ |
|
204 | grep: $TESTTMP/client4_clone/.hg/requires: $ENOENT$ | |
|
205 | $TESTTMP/server/.hg/requires:lfs | |||
202 | [2] |
|
206 | [2] | |
203 |
|
207 | |||
204 | TODO: fail more gracefully. |
|
208 | TODO: fail more gracefully. | |
205 |
|
209 | |||
206 | $ hg init $TESTTMP/client4_pull |
|
210 | $ hg init $TESTTMP/client4_pull | |
207 | $ hg -R $TESTTMP/client4_pull pull -q http://localhost:$HGPORT |
|
211 | $ hg -R $TESTTMP/client4_pull pull -q http://localhost:$HGPORT | |
208 | abort: HTTP Error 500: Internal Server Error |
|
212 | abort: HTTP Error 500: Internal Server Error | |
209 | [255] |
|
213 | [255] | |
210 | $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES |
|
214 | $ grep 'lfs' $TESTTMP/client4_pull/.hg/requires $SERVER_REQUIRES | |
211 | [1] |
|
215 | $TESTTMP/server/.hg/requires:lfs | |
212 |
|
216 | |||
213 | $ hg identify http://localhost:$HGPORT |
|
217 | $ hg identify http://localhost:$HGPORT | |
214 | 03b080fa9d93 |
|
218 | 03b080fa9d93 | |
215 |
|
219 | |||
216 | -------------------------------------------------------------------------------- |
|
220 | -------------------------------------------------------------------------------- | |
217 | Case #5: client with non-lfs content and the extension enabled; server with |
|
221 | Case #5: client with non-lfs content and the extension enabled; server with | |
218 | lfs content, and the extension enabled. |
|
222 | lfs content, and the extension enabled. | |
219 |
|
223 | |||
220 | $ cat >> $HGRCPATH <<EOF |
|
224 | $ cat >> $HGRCPATH <<EOF | |
221 | > [extensions] |
|
225 | > [extensions] | |
222 | > lfs = |
|
226 | > lfs = | |
223 | > EOF |
|
227 | > EOF | |
224 | $ echo 'non-lfs' > nonlfs3.txt |
|
228 | $ echo 'non-lfs' > nonlfs3.txt | |
225 | $ hg ci -Aqm 'non-lfs file with lfs client' |
|
229 | $ hg ci -Aqm 'non-lfs file with lfs client' | |
226 |
|
230 | |||
227 | $ hg push -q |
|
231 | $ hg push -q | |
228 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
232 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
229 | [1] |
|
233 | $TESTTMP/server/.hg/requires:lfs | |
230 |
|
234 | |||
231 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone |
|
235 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client5_clone | |
232 | $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES |
|
236 | $ grep 'lfs' $TESTTMP/client5_clone/.hg/requires $SERVER_REQUIRES | |
233 | [1] |
|
237 | $TESTTMP/client5_clone/.hg/requires:lfs | |
|
238 | $TESTTMP/server/.hg/requires:lfs | |||
234 |
|
239 | |||
235 | $ hg init $TESTTMP/client5_pull |
|
240 | $ hg init $TESTTMP/client5_pull | |
236 | $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT |
|
241 | $ hg -R $TESTTMP/client5_pull pull -q http://localhost:$HGPORT | |
237 | $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES |
|
242 | $ grep 'lfs' $TESTTMP/client5_pull/.hg/requires $SERVER_REQUIRES | |
238 | [1] |
|
243 | $TESTTMP/client5_pull/.hg/requires:lfs | |
|
244 | $TESTTMP/server/.hg/requires:lfs | |||
239 |
|
245 | |||
240 | $ hg identify http://localhost:$HGPORT |
|
246 | $ hg identify http://localhost:$HGPORT | |
241 | c729025cc5e3 |
|
247 | c729025cc5e3 | |
242 |
|
248 | |||
243 | -------------------------------------------------------------------------------- |
|
249 | -------------------------------------------------------------------------------- | |
244 | Case #6: client with lfs content and the extension enabled; server with |
|
250 | Case #6: client with lfs content and the extension enabled; server with | |
245 | lfs content, and the extension enabled. |
|
251 | lfs content, and the extension enabled. | |
246 |
|
252 | |||
247 | TODO: add the 'lfs' requirement on the server for each test |
|
|||
248 |
|
||||
249 | $ echo 'this is another lfs file' > lfs2.txt |
|
253 | $ echo 'this is another lfs file' > lfs2.txt | |
250 | $ hg ci -Aqm 'lfs file with lfs client' |
|
254 | $ hg ci -Aqm 'lfs file with lfs client' | |
251 |
|
255 | |||
252 | $ hg push -q |
|
256 | $ hg push -q | |
253 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES |
|
257 | $ grep 'lfs' .hg/requires $SERVER_REQUIRES | |
254 | .hg/requires:lfs |
|
258 | .hg/requires:lfs | |
|
259 | $TESTTMP/server/.hg/requires:lfs | |||
255 |
|
260 | |||
256 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone |
|
261 | $ hg clone -q http://localhost:$HGPORT $TESTTMP/client6_clone | |
257 | $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES |
|
262 | $ grep 'lfs' $TESTTMP/client6_clone/.hg/requires $SERVER_REQUIRES | |
258 | [1] |
|
263 | $TESTTMP/client6_clone/.hg/requires:lfs | |
|
264 | $TESTTMP/server/.hg/requires:lfs | |||
259 |
|
265 | |||
260 | $ hg init $TESTTMP/client6_pull |
|
266 | $ hg init $TESTTMP/client6_pull | |
261 | $ hg -R $TESTTMP/client6_pull pull -q http://localhost:$HGPORT |
|
267 | $ hg -R $TESTTMP/client6_pull pull -q http://localhost:$HGPORT | |
262 | $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES |
|
268 | $ grep 'lfs' $TESTTMP/client6_pull/.hg/requires $SERVER_REQUIRES | |
263 | [1] |
|
269 | $TESTTMP/client6_pull/.hg/requires:lfs | |
|
270 | $TESTTMP/server/.hg/requires:lfs | |||
264 |
|
271 | |||
265 | $ hg identify http://localhost:$HGPORT |
|
272 | $ hg identify http://localhost:$HGPORT | |
266 | d3b84d50eacb |
|
273 | d3b84d50eacb | |
267 |
|
274 | |||
268 | -------------------------------------------------------------------------------- |
|
275 | -------------------------------------------------------------------------------- | |
269 | Misc: process dies early if a requirement exists and the extension is disabled |
|
276 | Misc: process dies early if a requirement exists and the extension is disabled | |
270 |
|
277 | |||
271 | $ hg --config extensions.lfs=! summary |
|
278 | $ hg --config extensions.lfs=! summary | |
272 | abort: repository requires features unknown to this Mercurial: lfs! |
|
279 | abort: repository requires features unknown to this Mercurial: lfs! | |
273 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) |
|
280 | (see https://mercurial-scm.org/wiki/MissingRequirement for more information) | |
274 | [255] |
|
281 | [255] | |
275 |
|
282 | |||
276 | #endif |
|
283 | #endif | |
277 |
|
284 | |||
278 | $ $PYTHON $TESTDIR/killdaemons.py $DAEMON_PIDS |
|
285 | $ $PYTHON $TESTDIR/killdaemons.py $DAEMON_PIDS | |
279 |
|
286 | |||
280 | #if lfsremote-on |
|
287 | #if lfsremote-on | |
281 | $ cat $TESTTMP/errors.log | grep '^[A-Z]' |
|
288 | $ cat $TESTTMP/errors.log | grep '^[A-Z]' | |
282 | Traceback (most recent call last): |
|
289 | Traceback (most recent call last): | |
283 | ValueError: no common changegroup version |
|
290 | ValueError: no common changegroup version | |
284 | Traceback (most recent call last): |
|
291 | Traceback (most recent call last): | |
285 | ValueError: no common changegroup version |
|
292 | ValueError: no common changegroup version | |
286 | Traceback (most recent call last): |
|
293 | Traceback (most recent call last): | |
287 | ValueError: no common changegroup version |
|
294 | ValueError: no common changegroup version | |
288 | Traceback (most recent call last): |
|
295 | Traceback (most recent call last): | |
289 | ValueError: no common changegroup version |
|
296 | ValueError: no common changegroup version | |
290 | #else |
|
297 | #else | |
291 | $ cat $TESTTMP/errors.log |
|
298 | $ cat $TESTTMP/errors.log | |
292 | #endif |
|
299 | #endif |
@@ -1,187 +1,188 b'' | |||||
1 | #require lfs-test-server |
|
1 | #require lfs-test-server | |
2 |
|
2 | |||
3 | $ LFS_LISTEN="tcp://:$HGPORT" |
|
3 | $ LFS_LISTEN="tcp://:$HGPORT" | |
4 | $ LFS_HOST="localhost:$HGPORT" |
|
4 | $ LFS_HOST="localhost:$HGPORT" | |
5 | $ LFS_PUBLIC=1 |
|
5 | $ LFS_PUBLIC=1 | |
6 | $ export LFS_LISTEN LFS_HOST LFS_PUBLIC |
|
6 | $ export LFS_LISTEN LFS_HOST LFS_PUBLIC | |
7 | #if no-windows |
|
7 | #if no-windows | |
8 | $ lfs-test-server &> lfs-server.log & |
|
8 | $ lfs-test-server &> lfs-server.log & | |
9 | $ echo $! >> $DAEMON_PIDS |
|
9 | $ echo $! >> $DAEMON_PIDS | |
10 | #else |
|
10 | #else | |
11 | $ cat >> $TESTTMP/spawn.py <<EOF |
|
11 | $ cat >> $TESTTMP/spawn.py <<EOF | |
12 | > import os |
|
12 | > import os | |
13 | > import subprocess |
|
13 | > import subprocess | |
14 | > import sys |
|
14 | > import sys | |
15 | > |
|
15 | > | |
16 | > for path in os.environ["PATH"].split(os.pathsep): |
|
16 | > for path in os.environ["PATH"].split(os.pathsep): | |
17 | > exe = os.path.join(path, 'lfs-test-server.exe') |
|
17 | > exe = os.path.join(path, 'lfs-test-server.exe') | |
18 | > if os.path.exists(exe): |
|
18 | > if os.path.exists(exe): | |
19 | > with open('lfs-server.log', 'wb') as out: |
|
19 | > with open('lfs-server.log', 'wb') as out: | |
20 | > p = subprocess.Popen(exe, stdout=out, stderr=out) |
|
20 | > p = subprocess.Popen(exe, stdout=out, stderr=out) | |
21 | > sys.stdout.write('%s\n' % p.pid) |
|
21 | > sys.stdout.write('%s\n' % p.pid) | |
22 | > sys.exit(0) |
|
22 | > sys.exit(0) | |
23 | > sys.exit(1) |
|
23 | > sys.exit(1) | |
24 | > EOF |
|
24 | > EOF | |
25 | $ $PYTHON $TESTTMP/spawn.py >> $DAEMON_PIDS |
|
25 | $ $PYTHON $TESTTMP/spawn.py >> $DAEMON_PIDS | |
26 | #endif |
|
26 | #endif | |
27 |
|
27 | |||
28 | $ cat >> $HGRCPATH <<EOF |
|
28 | $ cat >> $HGRCPATH <<EOF | |
29 | > [extensions] |
|
29 | > [extensions] | |
30 | > lfs= |
|
30 | > lfs= | |
31 | > [lfs] |
|
31 | > [lfs] | |
32 | > url=http://foo:bar@$LFS_HOST/ |
|
32 | > url=http://foo:bar@$LFS_HOST/ | |
33 | > threshold=1 |
|
33 | > threshold=1 | |
34 | > EOF |
|
34 | > EOF | |
35 |
|
35 | |||
36 | $ hg init repo1 |
|
36 | $ hg init repo1 | |
37 | $ cd repo1 |
|
37 | $ cd repo1 | |
38 | $ echo THIS-IS-LFS > a |
|
38 | $ echo THIS-IS-LFS > a | |
39 | $ hg commit -m a -A a |
|
39 | $ hg commit -m a -A a | |
40 |
|
40 | |||
41 | $ hg init ../repo2 |
|
41 | $ hg init ../repo2 | |
42 | $ hg push ../repo2 -v |
|
42 | $ hg push ../repo2 -v | |
43 | pushing to ../repo2 |
|
43 | pushing to ../repo2 | |
44 | searching for changes |
|
44 | searching for changes | |
45 | lfs: uploading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) |
|
45 | lfs: uploading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) | |
46 | lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b |
|
46 | lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b | |
47 | 1 changesets found |
|
47 | 1 changesets found | |
48 | uncompressed size of bundle content: |
|
48 | uncompressed size of bundle content: | |
49 | * (changelog) (glob) |
|
49 | * (changelog) (glob) | |
50 | * (manifests) (glob) |
|
50 | * (manifests) (glob) | |
51 | * a (glob) |
|
51 | * a (glob) | |
52 | adding changesets |
|
52 | adding changesets | |
53 | adding manifests |
|
53 | adding manifests | |
54 | adding file changes |
|
54 | adding file changes | |
55 | added 1 changesets with 1 changes to 1 files |
|
55 | added 1 changesets with 1 changes to 1 files | |
|
56 | calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs | |||
56 |
|
57 | |||
57 | Clear the cache to force a download |
|
58 | Clear the cache to force a download | |
58 | $ rm -rf `hg config lfs.usercache` |
|
59 | $ rm -rf `hg config lfs.usercache` | |
59 | $ cd ../repo2 |
|
60 | $ cd ../repo2 | |
60 | $ hg update tip -v |
|
61 | $ hg update tip -v | |
61 | resolving manifests |
|
62 | resolving manifests | |
62 | getting a |
|
63 | getting a | |
63 | lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) |
|
64 | lfs: downloading 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b (12 bytes) | |
64 | lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache |
|
65 | lfs: adding 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b to the usercache | |
65 | lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b |
|
66 | lfs: processed: 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b | |
66 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
|
67 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | |
67 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
68 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
68 |
|
69 | |||
69 | When the server has some blobs already |
|
70 | When the server has some blobs already | |
70 |
|
71 | |||
71 | $ hg mv a b |
|
72 | $ hg mv a b | |
72 | $ echo ANOTHER-LARGE-FILE > c |
|
73 | $ echo ANOTHER-LARGE-FILE > c | |
73 | $ echo ANOTHER-LARGE-FILE2 > d |
|
74 | $ echo ANOTHER-LARGE-FILE2 > d | |
74 | $ hg commit -m b-and-c -A b c d |
|
75 | $ hg commit -m b-and-c -A b c d | |
75 | $ hg push ../repo1 -v | grep -v '^ ' |
|
76 | $ hg push ../repo1 -v | grep -v '^ ' | |
76 | pushing to ../repo1 |
|
77 | pushing to ../repo1 | |
77 | searching for changes |
|
78 | searching for changes | |
78 | lfs: need to transfer 2 objects (39 bytes) |
|
79 | lfs: need to transfer 2 objects (39 bytes) | |
79 | lfs: uploading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) |
|
80 | lfs: uploading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) | |
80 | lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 |
|
81 | lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 | |
81 | lfs: uploading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) |
|
82 | lfs: uploading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | |
82 | lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
|
83 | lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
83 | 1 changesets found |
|
84 | 1 changesets found | |
84 | uncompressed size of bundle content: |
|
85 | uncompressed size of bundle content: | |
85 | adding changesets |
|
86 | adding changesets | |
86 | adding manifests |
|
87 | adding manifests | |
87 | adding file changes |
|
88 | adding file changes | |
88 | added 1 changesets with 3 changes to 3 files |
|
89 | added 1 changesets with 3 changes to 3 files | |
89 |
|
90 | |||
90 | Clear the cache to force a download |
|
91 | Clear the cache to force a download | |
91 | $ rm -rf `hg config lfs.usercache` |
|
92 | $ rm -rf `hg config lfs.usercache` | |
92 | $ hg --repo ../repo1 update tip -v |
|
93 | $ hg --repo ../repo1 update tip -v | |
93 | resolving manifests |
|
94 | resolving manifests | |
94 | getting b |
|
95 | getting b | |
95 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
|
96 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | |
96 | getting c |
|
97 | getting c | |
97 | lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) |
|
98 | lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | |
98 | lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache |
|
99 | lfs: adding d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 to the usercache | |
99 | lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
|
100 | lfs: processed: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
100 | lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store |
|
101 | lfs: found d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 in the local lfs store | |
101 | getting d |
|
102 | getting d | |
102 | lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) |
|
103 | lfs: downloading 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 (20 bytes) | |
103 | lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache |
|
104 | lfs: adding 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 to the usercache | |
104 | lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 |
|
105 | lfs: processed: 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 | |
105 | lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store |
|
106 | lfs: found 37a65ab78d5ecda767e8622c248b5dbff1e68b1678ab0e730d5eb8601ec8ad19 in the local lfs store | |
106 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
107 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
107 |
|
108 | |||
108 | Test a corrupt file download, but clear the cache first to force a download. |
|
109 | Test a corrupt file download, but clear the cache first to force a download. | |
109 |
|
110 | |||
110 | $ rm -rf `hg config lfs.usercache` |
|
111 | $ rm -rf `hg config lfs.usercache` | |
111 | $ cp $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob |
|
112 | $ cp $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 blob | |
112 | $ echo 'damage' > $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
|
113 | $ echo 'damage' > $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
113 | $ rm ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
|
114 | $ rm ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
114 | $ rm ../repo1/* |
|
115 | $ rm ../repo1/* | |
115 |
|
116 | |||
116 | XXX: suggesting `hg verify` won't help with a corrupt file on the lfs server. |
|
117 | XXX: suggesting `hg verify` won't help with a corrupt file on the lfs server. | |
117 | $ hg --repo ../repo1 update -C tip -v |
|
118 | $ hg --repo ../repo1 update -C tip -v | |
118 | resolving manifests |
|
119 | resolving manifests | |
119 | getting a |
|
120 | getting a | |
120 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
|
121 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | |
121 | getting b |
|
122 | getting b | |
122 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store |
|
123 | lfs: found 31cf46fbc4ecd458a0943c5b4881f1f5a6dd36c53d6167d5b69ac45149b38e5b in the local lfs store | |
123 | getting c |
|
124 | getting c | |
124 | lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) |
|
125 | lfs: downloading d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 (19 bytes) | |
125 | abort: detected corrupt lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
|
126 | abort: detected corrupt lfs object: d11e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
126 | (run hg verify) |
|
127 | (run hg verify) | |
127 | [255] |
|
128 | [255] | |
128 |
|
129 | |||
129 | The corrupted blob is not added to the usercache or local store |
|
130 | The corrupted blob is not added to the usercache or local store | |
130 |
|
131 | |||
131 | $ test -f ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
|
132 | $ test -f ../repo1/.hg/store/lfs/objects/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
132 | [1] |
|
133 | [1] | |
133 | $ test -f `hg config lfs.usercache`/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
|
134 | $ test -f `hg config lfs.usercache`/d1/1e1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
134 | [1] |
|
135 | [1] | |
135 | $ cp blob $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 |
|
136 | $ cp blob $TESTTMP/lfs-content/d1/1e/1a642b60813aee592094109b406089b8dff4cb157157f753418ec7857998 | |
136 |
|
137 | |||
137 | Test a corrupted file upload |
|
138 | Test a corrupted file upload | |
138 |
|
139 | |||
139 | $ echo 'another lfs blob' > b |
|
140 | $ echo 'another lfs blob' > b | |
140 | $ hg ci -m 'another blob' |
|
141 | $ hg ci -m 'another blob' | |
141 | $ echo 'damage' > .hg/store/lfs/objects/e6/59058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 |
|
142 | $ echo 'damage' > .hg/store/lfs/objects/e6/59058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 | |
142 | $ hg push -v ../repo1 |
|
143 | $ hg push -v ../repo1 | |
143 | pushing to ../repo1 |
|
144 | pushing to ../repo1 | |
144 | searching for changes |
|
145 | searching for changes | |
145 | lfs: uploading e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 (17 bytes) |
|
146 | lfs: uploading e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 (17 bytes) | |
146 | abort: detected corrupt lfs object: e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 |
|
147 | abort: detected corrupt lfs object: e659058e26b07b39d2a9c7145b3f99b41f797b6621c8076600e9cb7ee88291f0 | |
147 | (run hg verify) |
|
148 | (run hg verify) | |
148 | [255] |
|
149 | [255] | |
149 |
|
150 | |||
150 | Check error message when the remote missed a blob: |
|
151 | Check error message when the remote missed a blob: | |
151 |
|
152 | |||
152 | $ echo FFFFF > b |
|
153 | $ echo FFFFF > b | |
153 | $ hg commit -m b -A b |
|
154 | $ hg commit -m b -A b | |
154 | $ echo FFFFF >> b |
|
155 | $ echo FFFFF >> b | |
155 | $ hg commit -m b b |
|
156 | $ hg commit -m b b | |
156 | $ rm -rf .hg/store/lfs |
|
157 | $ rm -rf .hg/store/lfs | |
157 | $ rm -rf `hg config lfs.usercache` |
|
158 | $ rm -rf `hg config lfs.usercache` | |
158 | $ hg update -C '.^' |
|
159 | $ hg update -C '.^' | |
159 | abort: LFS server claims required objects do not exist: |
|
160 | abort: LFS server claims required objects do not exist: | |
160 | 8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13! |
|
161 | 8e6ea5f6c066b44a0efa43bcce86aea73f17e6e23f0663df0251e7524e140a13! | |
161 | [255] |
|
162 | [255] | |
162 |
|
163 | |||
163 | Check error message when object does not exist: |
|
164 | Check error message when object does not exist: | |
164 |
|
165 | |||
165 | $ hg init test && cd test |
|
166 | $ hg init test && cd test | |
166 | $ echo "[extensions]" >> .hg/hgrc |
|
167 | $ echo "[extensions]" >> .hg/hgrc | |
167 | $ echo "lfs=" >> .hg/hgrc |
|
168 | $ echo "lfs=" >> .hg/hgrc | |
168 | $ echo "[lfs]" >> .hg/hgrc |
|
169 | $ echo "[lfs]" >> .hg/hgrc | |
169 | $ echo "threshold=1" >> .hg/hgrc |
|
170 | $ echo "threshold=1" >> .hg/hgrc | |
170 | $ echo a > a |
|
171 | $ echo a > a | |
171 | $ hg add a |
|
172 | $ hg add a | |
172 | $ hg commit -m 'test' |
|
173 | $ hg commit -m 'test' | |
173 | $ echo aaaaa > a |
|
174 | $ echo aaaaa > a | |
174 | $ hg commit -m 'largefile' |
|
175 | $ hg commit -m 'largefile' | |
175 | $ hg debugdata .hg/store/data/a.i 1 # verify this is no the file content but includes "oid", the LFS "pointer". |
|
176 | $ hg debugdata .hg/store/data/a.i 1 # verify this is no the file content but includes "oid", the LFS "pointer". | |
176 | version https://git-lfs.github.com/spec/v1 |
|
177 | version https://git-lfs.github.com/spec/v1 | |
177 | oid sha256:bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a |
|
178 | oid sha256:bdc26931acfb734b142a8d675f205becf27560dc461f501822de13274fe6fc8a | |
178 | size 6 |
|
179 | size 6 | |
179 | x-is-binary 0 |
|
180 | x-is-binary 0 | |
180 | $ cd .. |
|
181 | $ cd .. | |
181 | $ rm -rf `hg config lfs.usercache` |
|
182 | $ rm -rf `hg config lfs.usercache` | |
182 | $ hg --config 'lfs.url=https://dewey-lfs.vip.facebook.com/lfs' clone test test2 |
|
183 | $ hg --config 'lfs.url=https://dewey-lfs.vip.facebook.com/lfs' clone test test2 | |
183 | updating to branch default |
|
184 | updating to branch default | |
184 | abort: LFS server error. Remote object for file data/a.i not found:(.*)! (re) |
|
185 | abort: LFS server error. Remote object for file data/a.i not found:(.*)! (re) | |
185 | [255] |
|
186 | [255] | |
186 |
|
187 | |||
187 | $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
|
188 | $ $PYTHON $RUNTESTDIR/killdaemons.py $DAEMON_PIDS |
@@ -1,914 +1,916 b'' | |||||
1 | # Initial setup |
|
1 | # Initial setup | |
2 |
|
2 | |||
3 | $ cat >> $HGRCPATH << EOF |
|
3 | $ cat >> $HGRCPATH << EOF | |
4 | > [extensions] |
|
4 | > [extensions] | |
5 | > lfs= |
|
5 | > lfs= | |
6 | > [lfs] |
|
6 | > [lfs] | |
7 | > threshold=1000B |
|
7 | > threshold=1000B | |
8 | > EOF |
|
8 | > EOF | |
9 |
|
9 | |||
10 | $ LONG=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB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CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
11 |
|
11 | |||
12 | # Prepare server and enable extension |
|
12 | # Prepare server and enable extension | |
13 | $ hg init server |
|
13 | $ hg init server | |
14 | $ hg clone -q server client |
|
14 | $ hg clone -q server client | |
15 | $ cd client |
|
15 | $ cd client | |
16 |
|
16 | |||
17 | # Commit small file |
|
17 | # Commit small file | |
18 | $ echo s > smallfile |
|
18 | $ echo s > smallfile | |
19 | $ hg commit -Aqm "add small file" |
|
19 | $ hg commit -Aqm "add small file" | |
20 |
|
20 | |||
21 | # Commit large file |
|
21 | # Commit large file | |
22 | $ echo $LONG > largefile |
|
22 | $ echo $LONG > largefile | |
23 | $ grep lfs .hg/requires |
|
23 | $ grep lfs .hg/requires | |
24 | [1] |
|
24 | [1] | |
25 | $ hg commit --traceback -Aqm "add large file" |
|
25 | $ hg commit --traceback -Aqm "add large file" | |
26 | $ grep lfs .hg/requires |
|
26 | $ grep lfs .hg/requires | |
27 | lfs |
|
27 | lfs | |
28 |
|
28 | |||
29 | # Ensure metadata is stored |
|
29 | # Ensure metadata is stored | |
30 | $ hg debugdata largefile 0 |
|
30 | $ hg debugdata largefile 0 | |
31 | version https://git-lfs.github.com/spec/v1 |
|
31 | version https://git-lfs.github.com/spec/v1 | |
32 | oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b |
|
32 | oid sha256:f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b | |
33 | size 1501 |
|
33 | size 1501 | |
34 | x-is-binary 0 |
|
34 | x-is-binary 0 | |
35 |
|
35 | |||
36 | # Check the blobstore is populated |
|
36 | # Check the blobstore is populated | |
37 | $ find .hg/store/lfs/objects | sort |
|
37 | $ find .hg/store/lfs/objects | sort | |
38 | .hg/store/lfs/objects |
|
38 | .hg/store/lfs/objects | |
39 | .hg/store/lfs/objects/f1 |
|
39 | .hg/store/lfs/objects/f1 | |
40 | .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b |
|
40 | .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b | |
41 |
|
41 | |||
42 | # Check the blob stored contains the actual contents of the file |
|
42 | # Check the blob stored contains the actual contents of the file | |
43 | $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b |
|
43 | $ cat .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b | |
44 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB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CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
45 |
|
45 | |||
46 | # Push changes to the server |
|
46 | # Push changes to the server | |
47 |
|
47 | |||
48 | $ hg push |
|
48 | $ hg push | |
49 | pushing to $TESTTMP/server |
|
49 | pushing to $TESTTMP/server | |
50 | searching for changes |
|
50 | searching for changes | |
51 | abort: lfs.url needs to be configured |
|
51 | abort: lfs.url needs to be configured | |
52 | [255] |
|
52 | [255] | |
53 |
|
53 | |||
54 | $ cat >> $HGRCPATH << EOF |
|
54 | $ cat >> $HGRCPATH << EOF | |
55 | > [lfs] |
|
55 | > [lfs] | |
56 | > url=file:$TESTTMP/dummy-remote/ |
|
56 | > url=file:$TESTTMP/dummy-remote/ | |
57 | > EOF |
|
57 | > EOF | |
58 |
|
58 | |||
59 |
|
|
59 | Push to a local non-lfs repo with the extension enabled will add the | |
60 | lfs requirement |
|
60 | lfs requirement | |
61 |
|
61 | |||
62 | $ grep lfs $TESTTMP/server/.hg/requires |
|
62 | $ grep lfs $TESTTMP/server/.hg/requires | |
63 | [1] |
|
63 | [1] | |
64 | $ hg push -v | egrep -v '^(uncompressed| )' |
|
64 | $ hg push -v | egrep -v '^(uncompressed| )' | |
65 | pushing to $TESTTMP/server |
|
65 | pushing to $TESTTMP/server | |
66 | searching for changes |
|
66 | searching for changes | |
67 | lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store |
|
67 | lfs: found f11e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b in the local lfs store | |
68 | 2 changesets found |
|
68 | 2 changesets found | |
69 | adding changesets |
|
69 | adding changesets | |
70 | adding manifests |
|
70 | adding manifests | |
71 | adding file changes |
|
71 | adding file changes | |
72 | added 2 changesets with 2 changes to 2 files |
|
72 | added 2 changesets with 2 changes to 2 files | |
|
73 | calling hook pretxnchangegroup.lfs: hgext.lfs.checkrequireslfs | |||
73 | $ grep lfs $TESTTMP/server/.hg/requires |
|
74 | $ grep lfs $TESTTMP/server/.hg/requires | |
74 | [1] |
|
75 | lfs | |
75 |
|
76 | |||
76 | # Unknown URL scheme |
|
77 | # Unknown URL scheme | |
77 |
|
78 | |||
78 | $ hg push --config lfs.url=ftp://foobar |
|
79 | $ hg push --config lfs.url=ftp://foobar | |
79 | abort: lfs: unknown url scheme: ftp |
|
80 | abort: lfs: unknown url scheme: ftp | |
80 | [255] |
|
81 | [255] | |
81 |
|
82 | |||
82 | $ cd ../ |
|
83 | $ cd ../ | |
83 |
|
84 | |||
84 | # Initialize new client (not cloning) and setup extension |
|
85 | # Initialize new client (not cloning) and setup extension | |
85 | $ hg init client2 |
|
86 | $ hg init client2 | |
86 | $ cd client2 |
|
87 | $ cd client2 | |
87 | $ cat >> .hg/hgrc <<EOF |
|
88 | $ cat >> .hg/hgrc <<EOF | |
88 | > [paths] |
|
89 | > [paths] | |
89 | > default = $TESTTMP/server |
|
90 | > default = $TESTTMP/server | |
90 | > EOF |
|
91 | > EOF | |
91 |
|
92 | |||
92 | # Pull from server |
|
93 | # Pull from server | |
93 |
|
94 | |||
94 |
|
|
95 | Pulling a local lfs repo into a local non-lfs repo with the extension | |
95 |
enabled |
|
96 | enabled adds the lfs requirement | |
96 |
|
97 | |||
97 | $ grep lfs .hg/requires $TESTTMP/server/.hg/requires |
|
98 | $ grep lfs .hg/requires $TESTTMP/server/.hg/requires | |
98 | [1] |
|
99 | $TESTTMP/server/.hg/requires:lfs | |
99 | $ hg pull default |
|
100 | $ hg pull default | |
100 | pulling from $TESTTMP/server |
|
101 | pulling from $TESTTMP/server | |
101 | requesting all changes |
|
102 | requesting all changes | |
102 | adding changesets |
|
103 | adding changesets | |
103 | adding manifests |
|
104 | adding manifests | |
104 | adding file changes |
|
105 | adding file changes | |
105 | added 2 changesets with 2 changes to 2 files |
|
106 | added 2 changesets with 2 changes to 2 files | |
106 | new changesets b29ba743f89d:00c137947d30 |
|
107 | new changesets b29ba743f89d:00c137947d30 | |
107 | (run 'hg update' to get a working copy) |
|
108 | (run 'hg update' to get a working copy) | |
108 | $ grep lfs .hg/requires $TESTTMP/server/.hg/requires |
|
109 | $ grep lfs .hg/requires $TESTTMP/server/.hg/requires | |
109 | [1] |
|
110 | .hg/requires:lfs | |
|
111 | $TESTTMP/server/.hg/requires:lfs | |||
110 |
|
112 | |||
111 | # Check the blobstore is not yet populated |
|
113 | # Check the blobstore is not yet populated | |
112 | $ [ -d .hg/store/lfs/objects ] |
|
114 | $ [ -d .hg/store/lfs/objects ] | |
113 | [1] |
|
115 | [1] | |
114 |
|
116 | |||
115 | # Update to the last revision containing the large file |
|
117 | # Update to the last revision containing the large file | |
116 | $ hg update |
|
118 | $ hg update | |
117 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
119 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
118 |
|
120 | |||
119 | # Check the blobstore has been populated on update |
|
121 | # Check the blobstore has been populated on update | |
120 | $ find .hg/store/lfs/objects | sort |
|
122 | $ find .hg/store/lfs/objects | sort | |
121 | .hg/store/lfs/objects |
|
123 | .hg/store/lfs/objects | |
122 | .hg/store/lfs/objects/f1 |
|
124 | .hg/store/lfs/objects/f1 | |
123 | .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b |
|
125 | .hg/store/lfs/objects/f1/1e77c257047a398492d8d6cb9f6acf3aa7c4384bb23080b43546053e183e4b | |
124 |
|
126 | |||
125 | # Check the contents of the file are fetched from blobstore when requested |
|
127 | # Check the contents of the file are fetched from blobstore when requested | |
126 | $ hg cat -r . largefile |
|
128 | $ hg cat -r . largefile | |
127 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB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CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
128 |
|
130 | |||
129 | # Check the file has been copied in the working copy |
|
131 | # Check the file has been copied in the working copy | |
130 | $ cat largefile |
|
132 | $ cat largefile | |
131 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB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CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC | |
132 |
|
134 | |||
133 | $ cd .. |
|
135 | $ cd .. | |
134 |
|
136 | |||
135 | # Check rename, and switch between large and small files |
|
137 | # Check rename, and switch between large and small files | |
136 |
|
138 | |||
137 | $ hg init repo3 |
|
139 | $ hg init repo3 | |
138 | $ cd repo3 |
|
140 | $ cd repo3 | |
139 | $ cat >> .hg/hgrc << EOF |
|
141 | $ cat >> .hg/hgrc << EOF | |
140 | > [lfs] |
|
142 | > [lfs] | |
141 | > threshold=10B |
|
143 | > threshold=10B | |
142 | > EOF |
|
144 | > EOF | |
143 |
|
145 | |||
144 | $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large |
|
146 | $ echo LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS > large | |
145 | $ echo SHORTER > small |
|
147 | $ echo SHORTER > small | |
146 | $ hg add . -q |
|
148 | $ hg add . -q | |
147 | $ hg commit -m 'commit with lfs content' |
|
149 | $ hg commit -m 'commit with lfs content' | |
148 |
|
150 | |||
149 | $ hg mv large l |
|
151 | $ hg mv large l | |
150 | $ hg mv small s |
|
152 | $ hg mv small s | |
151 | $ hg commit -m 'renames' |
|
153 | $ hg commit -m 'renames' | |
152 |
|
154 | |||
153 | $ echo SHORT > l |
|
155 | $ echo SHORT > l | |
154 | $ echo BECOME-LARGER-FROM-SHORTER > s |
|
156 | $ echo BECOME-LARGER-FROM-SHORTER > s | |
155 | $ hg commit -m 'large to small, small to large' |
|
157 | $ hg commit -m 'large to small, small to large' | |
156 |
|
158 | |||
157 | $ echo 1 >> l |
|
159 | $ echo 1 >> l | |
158 | $ echo 2 >> s |
|
160 | $ echo 2 >> s | |
159 | $ hg commit -m 'random modifications' |
|
161 | $ hg commit -m 'random modifications' | |
160 |
|
162 | |||
161 | $ echo RESTORE-TO-BE-LARGE > l |
|
163 | $ echo RESTORE-TO-BE-LARGE > l | |
162 | $ echo SHORTER > s |
|
164 | $ echo SHORTER > s | |
163 | $ hg commit -m 'switch large and small again' |
|
165 | $ hg commit -m 'switch large and small again' | |
164 |
|
166 | |||
165 | # Test lfs_files template |
|
167 | # Test lfs_files template | |
166 |
|
168 | |||
167 | $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n' |
|
169 | $ hg log -r 'all()' -T '{rev} {join(lfs_files, ", ")}\n' | |
168 | 0 large |
|
170 | 0 large | |
169 | 1 l |
|
171 | 1 l | |
170 | 2 s |
|
172 | 2 s | |
171 | 3 s |
|
173 | 3 s | |
172 | 4 l |
|
174 | 4 l | |
173 |
|
175 | |||
174 | # Push and pull the above repo |
|
176 | # Push and pull the above repo | |
175 |
|
177 | |||
176 | $ hg --cwd .. init repo4 |
|
178 | $ hg --cwd .. init repo4 | |
177 | $ hg push ../repo4 |
|
179 | $ hg push ../repo4 | |
178 | pushing to ../repo4 |
|
180 | pushing to ../repo4 | |
179 | searching for changes |
|
181 | searching for changes | |
180 | adding changesets |
|
182 | adding changesets | |
181 | adding manifests |
|
183 | adding manifests | |
182 | adding file changes |
|
184 | adding file changes | |
183 | added 5 changesets with 10 changes to 4 files |
|
185 | added 5 changesets with 10 changes to 4 files | |
184 |
|
186 | |||
185 | $ hg --cwd .. init repo5 |
|
187 | $ hg --cwd .. init repo5 | |
186 | $ hg --cwd ../repo5 pull ../repo3 |
|
188 | $ hg --cwd ../repo5 pull ../repo3 | |
187 | pulling from ../repo3 |
|
189 | pulling from ../repo3 | |
188 | requesting all changes |
|
190 | requesting all changes | |
189 | adding changesets |
|
191 | adding changesets | |
190 | adding manifests |
|
192 | adding manifests | |
191 | adding file changes |
|
193 | adding file changes | |
192 | added 5 changesets with 10 changes to 4 files |
|
194 | added 5 changesets with 10 changes to 4 files | |
193 | new changesets fd47a419c4f7:5adf850972b9 |
|
195 | new changesets fd47a419c4f7:5adf850972b9 | |
194 | (run 'hg update' to get a working copy) |
|
196 | (run 'hg update' to get a working copy) | |
195 |
|
197 | |||
196 | $ cd .. |
|
198 | $ cd .. | |
197 |
|
199 | |||
198 | # Test clone |
|
200 | # Test clone | |
199 |
|
201 | |||
200 | $ hg init repo6 |
|
202 | $ hg init repo6 | |
201 | $ cd repo6 |
|
203 | $ cd repo6 | |
202 | $ cat >> .hg/hgrc << EOF |
|
204 | $ cat >> .hg/hgrc << EOF | |
203 | > [lfs] |
|
205 | > [lfs] | |
204 | > threshold=30B |
|
206 | > threshold=30B | |
205 | > EOF |
|
207 | > EOF | |
206 |
|
208 | |||
207 | $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large |
|
209 | $ echo LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES > large | |
208 | $ echo SMALL > small |
|
210 | $ echo SMALL > small | |
209 | $ hg commit -Aqm 'create a lfs file' large small |
|
211 | $ hg commit -Aqm 'create a lfs file' large small | |
210 | $ hg debuglfsupload -r 'all()' -v |
|
212 | $ hg debuglfsupload -r 'all()' -v | |
211 | lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store |
|
213 | lfs: found 8e92251415339ae9b148c8da89ed5ec665905166a1ab11b09dca8fad83344738 in the local lfs store | |
212 |
|
214 | |||
213 | $ cd .. |
|
215 | $ cd .. | |
214 |
|
216 | |||
215 | $ hg clone repo6 repo7 |
|
217 | $ hg clone repo6 repo7 | |
216 | updating to branch default |
|
218 | updating to branch default | |
217 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
219 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
218 | $ cd repo7 |
|
220 | $ cd repo7 | |
219 | $ hg config extensions --debug | grep lfs |
|
221 | $ hg config extensions --debug | grep lfs | |
220 | $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob) |
|
222 | $TESTTMP/repo7/.hg/hgrc:*: extensions.lfs= (glob) | |
221 | $ cat large |
|
223 | $ cat large | |
222 | LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES |
|
224 | LARGE-BECAUSE-IT-IS-MORE-THAN-30-BYTES | |
223 | $ cat small |
|
225 | $ cat small | |
224 | SMALL |
|
226 | SMALL | |
225 |
|
227 | |||
226 | $ cd .. |
|
228 | $ cd .. | |
227 |
|
229 | |||
228 | $ hg --config extensions.share= share repo7 sharedrepo |
|
230 | $ hg --config extensions.share= share repo7 sharedrepo | |
229 | updating working directory |
|
231 | updating working directory | |
230 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
232 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
231 | $ hg -R sharedrepo config extensions --debug | grep lfs |
|
233 | $ hg -R sharedrepo config extensions --debug | grep lfs | |
232 | $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob) |
|
234 | $TESTTMP/sharedrepo/.hg/hgrc:*: extensions.lfs= (glob) | |
233 |
|
235 | |||
234 | # Test rename and status |
|
236 | # Test rename and status | |
235 |
|
237 | |||
236 | $ hg init repo8 |
|
238 | $ hg init repo8 | |
237 | $ cd repo8 |
|
239 | $ cd repo8 | |
238 | $ cat >> .hg/hgrc << EOF |
|
240 | $ cat >> .hg/hgrc << EOF | |
239 | > [lfs] |
|
241 | > [lfs] | |
240 | > threshold=10B |
|
242 | > threshold=10B | |
241 | > EOF |
|
243 | > EOF | |
242 |
|
244 | |||
243 | $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1 |
|
245 | $ echo THIS-IS-LFS-BECAUSE-10-BYTES > a1 | |
244 | $ echo SMALL > a2 |
|
246 | $ echo SMALL > a2 | |
245 | $ hg commit -m a -A a1 a2 |
|
247 | $ hg commit -m a -A a1 a2 | |
246 | $ hg status |
|
248 | $ hg status | |
247 | $ hg mv a1 b1 |
|
249 | $ hg mv a1 b1 | |
248 | $ hg mv a2 a1 |
|
250 | $ hg mv a2 a1 | |
249 | $ hg mv b1 a2 |
|
251 | $ hg mv b1 a2 | |
250 | $ hg commit -m b |
|
252 | $ hg commit -m b | |
251 | $ hg status |
|
253 | $ hg status | |
252 | >>> with open('a2', 'wb') as f: |
|
254 | >>> with open('a2', 'wb') as f: | |
253 | ... f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA') |
|
255 | ... f.write(b'\1\nSTART-WITH-HG-FILELOG-METADATA') | |
254 | >>> with open('a1', 'wb') as f: |
|
256 | >>> with open('a1', 'wb') as f: | |
255 | ... f.write(b'\1\nMETA\n') |
|
257 | ... f.write(b'\1\nMETA\n') | |
256 | $ hg commit -m meta |
|
258 | $ hg commit -m meta | |
257 | $ hg status |
|
259 | $ hg status | |
258 | $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n' |
|
260 | $ hg log -T '{rev}: {file_copies} | {file_dels} | {file_adds}\n' | |
259 | 2: | | |
|
261 | 2: | | | |
260 | 1: a1 (a2)a2 (a1) | | |
|
262 | 1: a1 (a2)a2 (a1) | | | |
261 | 0: | | a1 a2 |
|
263 | 0: | | a1 a2 | |
262 |
|
264 | |||
263 | $ for n in a1 a2; do |
|
265 | $ for n in a1 a2; do | |
264 | > for r in 0 1 2; do |
|
266 | > for r in 0 1 2; do | |
265 | > printf '\n%s @ %s\n' $n $r |
|
267 | > printf '\n%s @ %s\n' $n $r | |
266 | > hg debugdata $n $r |
|
268 | > hg debugdata $n $r | |
267 | > done |
|
269 | > done | |
268 | > done |
|
270 | > done | |
269 |
|
271 | |||
270 | a1 @ 0 |
|
272 | a1 @ 0 | |
271 | version https://git-lfs.github.com/spec/v1 |
|
273 | version https://git-lfs.github.com/spec/v1 | |
272 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
274 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
273 | size 29 |
|
275 | size 29 | |
274 | x-is-binary 0 |
|
276 | x-is-binary 0 | |
275 |
|
277 | |||
276 | a1 @ 1 |
|
278 | a1 @ 1 | |
277 | \x01 (esc) |
|
279 | \x01 (esc) | |
278 | copy: a2 |
|
280 | copy: a2 | |
279 | copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9 |
|
281 | copyrev: 50470ad23cf937b1f4b9f80bfe54df38e65b50d9 | |
280 | \x01 (esc) |
|
282 | \x01 (esc) | |
281 | SMALL |
|
283 | SMALL | |
282 |
|
284 | |||
283 | a1 @ 2 |
|
285 | a1 @ 2 | |
284 | \x01 (esc) |
|
286 | \x01 (esc) | |
285 | \x01 (esc) |
|
287 | \x01 (esc) | |
286 | \x01 (esc) |
|
288 | \x01 (esc) | |
287 | META |
|
289 | META | |
288 |
|
290 | |||
289 | a2 @ 0 |
|
291 | a2 @ 0 | |
290 | SMALL |
|
292 | SMALL | |
291 |
|
293 | |||
292 | a2 @ 1 |
|
294 | a2 @ 1 | |
293 | version https://git-lfs.github.com/spec/v1 |
|
295 | version https://git-lfs.github.com/spec/v1 | |
294 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
296 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
295 | size 29 |
|
297 | size 29 | |
296 | x-hg-copy a1 |
|
298 | x-hg-copy a1 | |
297 | x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4 |
|
299 | x-hg-copyrev be23af27908a582af43e5cda209a5a9b319de8d4 | |
298 | x-is-binary 0 |
|
300 | x-is-binary 0 | |
299 |
|
301 | |||
300 | a2 @ 2 |
|
302 | a2 @ 2 | |
301 | version https://git-lfs.github.com/spec/v1 |
|
303 | version https://git-lfs.github.com/spec/v1 | |
302 | oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943 |
|
304 | oid sha256:876dadc86a8542f9798048f2c47f51dbf8e4359aed883e8ec80c5db825f0d943 | |
303 | size 32 |
|
305 | size 32 | |
304 | x-is-binary 0 |
|
306 | x-is-binary 0 | |
305 |
|
307 | |||
306 | # Verify commit hashes include rename metadata |
|
308 | # Verify commit hashes include rename metadata | |
307 |
|
309 | |||
308 | $ hg log -T '{rev}:{node|short} {desc}\n' |
|
310 | $ hg log -T '{rev}:{node|short} {desc}\n' | |
309 | 2:0fae949de7fa meta |
|
311 | 2:0fae949de7fa meta | |
310 | 1:9cd6bdffdac0 b |
|
312 | 1:9cd6bdffdac0 b | |
311 | 0:7f96794915f7 a |
|
313 | 0:7f96794915f7 a | |
312 |
|
314 | |||
313 | $ cd .. |
|
315 | $ cd .. | |
314 |
|
316 | |||
315 | # Test bundle |
|
317 | # Test bundle | |
316 |
|
318 | |||
317 | $ hg init repo9 |
|
319 | $ hg init repo9 | |
318 | $ cd repo9 |
|
320 | $ cd repo9 | |
319 | $ cat >> .hg/hgrc << EOF |
|
321 | $ cat >> .hg/hgrc << EOF | |
320 | > [lfs] |
|
322 | > [lfs] | |
321 | > threshold=10B |
|
323 | > threshold=10B | |
322 | > [diff] |
|
324 | > [diff] | |
323 | > git=1 |
|
325 | > git=1 | |
324 | > EOF |
|
326 | > EOF | |
325 |
|
327 | |||
326 | $ for i in 0 single two three 4; do |
|
328 | $ for i in 0 single two three 4; do | |
327 | > echo 'THIS-IS-LFS-'$i > a |
|
329 | > echo 'THIS-IS-LFS-'$i > a | |
328 | > hg commit -m a-$i -A a |
|
330 | > hg commit -m a-$i -A a | |
329 | > done |
|
331 | > done | |
330 |
|
332 | |||
331 | $ hg update 2 -q |
|
333 | $ hg update 2 -q | |
332 | $ echo 'THIS-IS-LFS-2-CHILD' > a |
|
334 | $ echo 'THIS-IS-LFS-2-CHILD' > a | |
333 | $ hg commit -m branching -q |
|
335 | $ hg commit -m branching -q | |
334 |
|
336 | |||
335 | $ hg bundle --base 1 bundle.hg -v |
|
337 | $ hg bundle --base 1 bundle.hg -v | |
336 | lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store |
|
338 | lfs: found 5ab7a3739a5feec94a562d070a14f36dba7cad17e5484a4a89eea8e5f3166888 in the local lfs store | |
337 | lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store |
|
339 | lfs: found a9c7d1cd6ce2b9bbdf46ed9a862845228717b921c089d0d42e3bcaed29eb612e in the local lfs store | |
338 | lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store |
|
340 | lfs: found f693890c49c409ec33673b71e53f297681f76c1166daf33b2ad7ebf8b1d3237e in the local lfs store | |
339 | lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store |
|
341 | lfs: found fda198fea753eb66a252e9856915e1f5cddbe41723bd4b695ece2604ad3c9f75 in the local lfs store | |
340 | 4 changesets found |
|
342 | 4 changesets found | |
341 | uncompressed size of bundle content: |
|
343 | uncompressed size of bundle content: | |
342 | * (changelog) (glob) |
|
344 | * (changelog) (glob) | |
343 | * (manifests) (glob) |
|
345 | * (manifests) (glob) | |
344 | * a (glob) |
|
346 | * a (glob) | |
345 | $ hg --config extensions.strip= strip -r 2 --no-backup --force -q |
|
347 | $ hg --config extensions.strip= strip -r 2 --no-backup --force -q | |
346 | $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a |
|
348 | $ hg -R bundle.hg log -p -T '{rev} {desc}\n' a | |
347 | 5 branching |
|
349 | 5 branching | |
348 | diff --git a/a b/a |
|
350 | diff --git a/a b/a | |
349 | --- a/a |
|
351 | --- a/a | |
350 | +++ b/a |
|
352 | +++ b/a | |
351 | @@ -1,1 +1,1 @@ |
|
353 | @@ -1,1 +1,1 @@ | |
352 | -THIS-IS-LFS-two |
|
354 | -THIS-IS-LFS-two | |
353 | +THIS-IS-LFS-2-CHILD |
|
355 | +THIS-IS-LFS-2-CHILD | |
354 |
|
356 | |||
355 | 4 a-4 |
|
357 | 4 a-4 | |
356 | diff --git a/a b/a |
|
358 | diff --git a/a b/a | |
357 | --- a/a |
|
359 | --- a/a | |
358 | +++ b/a |
|
360 | +++ b/a | |
359 | @@ -1,1 +1,1 @@ |
|
361 | @@ -1,1 +1,1 @@ | |
360 | -THIS-IS-LFS-three |
|
362 | -THIS-IS-LFS-three | |
361 | +THIS-IS-LFS-4 |
|
363 | +THIS-IS-LFS-4 | |
362 |
|
364 | |||
363 | 3 a-three |
|
365 | 3 a-three | |
364 | diff --git a/a b/a |
|
366 | diff --git a/a b/a | |
365 | --- a/a |
|
367 | --- a/a | |
366 | +++ b/a |
|
368 | +++ b/a | |
367 | @@ -1,1 +1,1 @@ |
|
369 | @@ -1,1 +1,1 @@ | |
368 | -THIS-IS-LFS-two |
|
370 | -THIS-IS-LFS-two | |
369 | +THIS-IS-LFS-three |
|
371 | +THIS-IS-LFS-three | |
370 |
|
372 | |||
371 | 2 a-two |
|
373 | 2 a-two | |
372 | diff --git a/a b/a |
|
374 | diff --git a/a b/a | |
373 | --- a/a |
|
375 | --- a/a | |
374 | +++ b/a |
|
376 | +++ b/a | |
375 | @@ -1,1 +1,1 @@ |
|
377 | @@ -1,1 +1,1 @@ | |
376 | -THIS-IS-LFS-single |
|
378 | -THIS-IS-LFS-single | |
377 | +THIS-IS-LFS-two |
|
379 | +THIS-IS-LFS-two | |
378 |
|
380 | |||
379 | 1 a-single |
|
381 | 1 a-single | |
380 | diff --git a/a b/a |
|
382 | diff --git a/a b/a | |
381 | --- a/a |
|
383 | --- a/a | |
382 | +++ b/a |
|
384 | +++ b/a | |
383 | @@ -1,1 +1,1 @@ |
|
385 | @@ -1,1 +1,1 @@ | |
384 | -THIS-IS-LFS-0 |
|
386 | -THIS-IS-LFS-0 | |
385 | +THIS-IS-LFS-single |
|
387 | +THIS-IS-LFS-single | |
386 |
|
388 | |||
387 | 0 a-0 |
|
389 | 0 a-0 | |
388 | diff --git a/a b/a |
|
390 | diff --git a/a b/a | |
389 | new file mode 100644 |
|
391 | new file mode 100644 | |
390 | --- /dev/null |
|
392 | --- /dev/null | |
391 | +++ b/a |
|
393 | +++ b/a | |
392 | @@ -0,0 +1,1 @@ |
|
394 | @@ -0,0 +1,1 @@ | |
393 | +THIS-IS-LFS-0 |
|
395 | +THIS-IS-LFS-0 | |
394 |
|
396 | |||
395 | $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q |
|
397 | $ hg bundle -R bundle.hg --base 1 bundle-again.hg -q | |
396 | $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a |
|
398 | $ hg -R bundle-again.hg log -p -T '{rev} {desc}\n' a | |
397 | 5 branching |
|
399 | 5 branching | |
398 | diff --git a/a b/a |
|
400 | diff --git a/a b/a | |
399 | --- a/a |
|
401 | --- a/a | |
400 | +++ b/a |
|
402 | +++ b/a | |
401 | @@ -1,1 +1,1 @@ |
|
403 | @@ -1,1 +1,1 @@ | |
402 | -THIS-IS-LFS-two |
|
404 | -THIS-IS-LFS-two | |
403 | +THIS-IS-LFS-2-CHILD |
|
405 | +THIS-IS-LFS-2-CHILD | |
404 |
|
406 | |||
405 | 4 a-4 |
|
407 | 4 a-4 | |
406 | diff --git a/a b/a |
|
408 | diff --git a/a b/a | |
407 | --- a/a |
|
409 | --- a/a | |
408 | +++ b/a |
|
410 | +++ b/a | |
409 | @@ -1,1 +1,1 @@ |
|
411 | @@ -1,1 +1,1 @@ | |
410 | -THIS-IS-LFS-three |
|
412 | -THIS-IS-LFS-three | |
411 | +THIS-IS-LFS-4 |
|
413 | +THIS-IS-LFS-4 | |
412 |
|
414 | |||
413 | 3 a-three |
|
415 | 3 a-three | |
414 | diff --git a/a b/a |
|
416 | diff --git a/a b/a | |
415 | --- a/a |
|
417 | --- a/a | |
416 | +++ b/a |
|
418 | +++ b/a | |
417 | @@ -1,1 +1,1 @@ |
|
419 | @@ -1,1 +1,1 @@ | |
418 | -THIS-IS-LFS-two |
|
420 | -THIS-IS-LFS-two | |
419 | +THIS-IS-LFS-three |
|
421 | +THIS-IS-LFS-three | |
420 |
|
422 | |||
421 | 2 a-two |
|
423 | 2 a-two | |
422 | diff --git a/a b/a |
|
424 | diff --git a/a b/a | |
423 | --- a/a |
|
425 | --- a/a | |
424 | +++ b/a |
|
426 | +++ b/a | |
425 | @@ -1,1 +1,1 @@ |
|
427 | @@ -1,1 +1,1 @@ | |
426 | -THIS-IS-LFS-single |
|
428 | -THIS-IS-LFS-single | |
427 | +THIS-IS-LFS-two |
|
429 | +THIS-IS-LFS-two | |
428 |
|
430 | |||
429 | 1 a-single |
|
431 | 1 a-single | |
430 | diff --git a/a b/a |
|
432 | diff --git a/a b/a | |
431 | --- a/a |
|
433 | --- a/a | |
432 | +++ b/a |
|
434 | +++ b/a | |
433 | @@ -1,1 +1,1 @@ |
|
435 | @@ -1,1 +1,1 @@ | |
434 | -THIS-IS-LFS-0 |
|
436 | -THIS-IS-LFS-0 | |
435 | +THIS-IS-LFS-single |
|
437 | +THIS-IS-LFS-single | |
436 |
|
438 | |||
437 | 0 a-0 |
|
439 | 0 a-0 | |
438 | diff --git a/a b/a |
|
440 | diff --git a/a b/a | |
439 | new file mode 100644 |
|
441 | new file mode 100644 | |
440 | --- /dev/null |
|
442 | --- /dev/null | |
441 | +++ b/a |
|
443 | +++ b/a | |
442 | @@ -0,0 +1,1 @@ |
|
444 | @@ -0,0 +1,1 @@ | |
443 | +THIS-IS-LFS-0 |
|
445 | +THIS-IS-LFS-0 | |
444 |
|
446 | |||
445 | $ cd .. |
|
447 | $ cd .. | |
446 |
|
448 | |||
447 | # Test isbinary |
|
449 | # Test isbinary | |
448 |
|
450 | |||
449 | $ hg init repo10 |
|
451 | $ hg init repo10 | |
450 | $ cd repo10 |
|
452 | $ cd repo10 | |
451 | $ cat >> .hg/hgrc << EOF |
|
453 | $ cat >> .hg/hgrc << EOF | |
452 | > [extensions] |
|
454 | > [extensions] | |
453 | > lfs= |
|
455 | > lfs= | |
454 | > [lfs] |
|
456 | > [lfs] | |
455 | > threshold=1 |
|
457 | > threshold=1 | |
456 | > EOF |
|
458 | > EOF | |
457 | $ $PYTHON <<'EOF' |
|
459 | $ $PYTHON <<'EOF' | |
458 | > def write(path, content): |
|
460 | > def write(path, content): | |
459 | > with open(path, 'wb') as f: |
|
461 | > with open(path, 'wb') as f: | |
460 | > f.write(content) |
|
462 | > f.write(content) | |
461 | > write('a', b'\0\0') |
|
463 | > write('a', b'\0\0') | |
462 | > write('b', b'\1\n') |
|
464 | > write('b', b'\1\n') | |
463 | > write('c', b'\1\n\0') |
|
465 | > write('c', b'\1\n\0') | |
464 | > write('d', b'xx') |
|
466 | > write('d', b'xx') | |
465 | > EOF |
|
467 | > EOF | |
466 | $ hg add a b c d |
|
468 | $ hg add a b c d | |
467 | $ hg diff --stat |
|
469 | $ hg diff --stat | |
468 | a | Bin |
|
470 | a | Bin | |
469 | b | 1 + |
|
471 | b | 1 + | |
470 | c | Bin |
|
472 | c | Bin | |
471 | d | 1 + |
|
473 | d | 1 + | |
472 | 4 files changed, 2 insertions(+), 0 deletions(-) |
|
474 | 4 files changed, 2 insertions(+), 0 deletions(-) | |
473 | $ hg commit -m binarytest |
|
475 | $ hg commit -m binarytest | |
474 | $ cat > $TESTTMP/dumpbinary.py << EOF |
|
476 | $ cat > $TESTTMP/dumpbinary.py << EOF | |
475 | > def reposetup(ui, repo): |
|
477 | > def reposetup(ui, repo): | |
476 | > for n in 'abcd': |
|
478 | > for n in 'abcd': | |
477 | > ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary())) |
|
479 | > ui.write(('%s: binary=%s\n') % (n, repo['.'][n].isbinary())) | |
478 | > EOF |
|
480 | > EOF | |
479 | $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace |
|
481 | $ hg --config extensions.dumpbinary=$TESTTMP/dumpbinary.py id --trace | |
480 | a: binary=True |
|
482 | a: binary=True | |
481 | b: binary=False |
|
483 | b: binary=False | |
482 | c: binary=True |
|
484 | c: binary=True | |
483 | d: binary=False |
|
485 | d: binary=False | |
484 | b55353847f02 tip |
|
486 | b55353847f02 tip | |
485 |
|
487 | |||
486 | $ cd .. |
|
488 | $ cd .. | |
487 |
|
489 | |||
488 | # Test fctx.cmp fastpath - diff without LFS blobs |
|
490 | # Test fctx.cmp fastpath - diff without LFS blobs | |
489 |
|
491 | |||
490 | $ hg init repo11 |
|
492 | $ hg init repo11 | |
491 | $ cd repo11 |
|
493 | $ cd repo11 | |
492 | $ cat >> .hg/hgrc <<EOF |
|
494 | $ cat >> .hg/hgrc <<EOF | |
493 | > [lfs] |
|
495 | > [lfs] | |
494 | > threshold=1 |
|
496 | > threshold=1 | |
495 | > EOF |
|
497 | > EOF | |
496 | $ cat > ../patch.diff <<EOF |
|
498 | $ cat > ../patch.diff <<EOF | |
497 | > # HG changeset patch |
|
499 | > # HG changeset patch | |
498 | > 2 |
|
500 | > 2 | |
499 | > |
|
501 | > | |
500 | > diff --git a/a b/a |
|
502 | > diff --git a/a b/a | |
501 | > old mode 100644 |
|
503 | > old mode 100644 | |
502 | > new mode 100755 |
|
504 | > new mode 100755 | |
503 | > EOF |
|
505 | > EOF | |
504 |
|
506 | |||
505 | $ for i in 1 2 3; do |
|
507 | $ for i in 1 2 3; do | |
506 | > cp ../repo10/a a |
|
508 | > cp ../repo10/a a | |
507 | > if [ $i = 3 ]; then |
|
509 | > if [ $i = 3 ]; then | |
508 | > # make a content-only change |
|
510 | > # make a content-only change | |
509 | > hg import -q --bypass ../patch.diff |
|
511 | > hg import -q --bypass ../patch.diff | |
510 | > hg update -q |
|
512 | > hg update -q | |
511 | > rm ../patch.diff |
|
513 | > rm ../patch.diff | |
512 | > else |
|
514 | > else | |
513 | > echo $i >> a |
|
515 | > echo $i >> a | |
514 | > hg commit -m $i -A a |
|
516 | > hg commit -m $i -A a | |
515 | > fi |
|
517 | > fi | |
516 | > done |
|
518 | > done | |
517 | $ [ -d .hg/store/lfs/objects ] |
|
519 | $ [ -d .hg/store/lfs/objects ] | |
518 |
|
520 | |||
519 | $ cd .. |
|
521 | $ cd .. | |
520 |
|
522 | |||
521 | $ hg clone repo11 repo12 --noupdate |
|
523 | $ hg clone repo11 repo12 --noupdate | |
522 | $ cd repo12 |
|
524 | $ cd repo12 | |
523 | $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git |
|
525 | $ hg log --removed -p a -T '{desc}\n' --config diff.nobinary=1 --git | |
524 | 2 |
|
526 | 2 | |
525 | diff --git a/a b/a |
|
527 | diff --git a/a b/a | |
526 | old mode 100644 |
|
528 | old mode 100644 | |
527 | new mode 100755 |
|
529 | new mode 100755 | |
528 |
|
530 | |||
529 | 2 |
|
531 | 2 | |
530 | diff --git a/a b/a |
|
532 | diff --git a/a b/a | |
531 | Binary file a has changed |
|
533 | Binary file a has changed | |
532 |
|
534 | |||
533 | 1 |
|
535 | 1 | |
534 | diff --git a/a b/a |
|
536 | diff --git a/a b/a | |
535 | new file mode 100644 |
|
537 | new file mode 100644 | |
536 | Binary file a has changed |
|
538 | Binary file a has changed | |
537 |
|
539 | |||
538 | $ [ -d .hg/store/lfs/objects ] |
|
540 | $ [ -d .hg/store/lfs/objects ] | |
539 | [1] |
|
541 | [1] | |
540 |
|
542 | |||
541 | $ cd .. |
|
543 | $ cd .. | |
542 |
|
544 | |||
543 | # Verify the repos |
|
545 | # Verify the repos | |
544 |
|
546 | |||
545 | $ cat > $TESTTMP/dumpflog.py << EOF |
|
547 | $ cat > $TESTTMP/dumpflog.py << EOF | |
546 | > # print raw revision sizes, flags, and hashes for certain files |
|
548 | > # print raw revision sizes, flags, and hashes for certain files | |
547 | > import hashlib |
|
549 | > import hashlib | |
548 | > from mercurial import revlog |
|
550 | > from mercurial import revlog | |
549 | > from mercurial.node import short |
|
551 | > from mercurial.node import short | |
550 | > def hash(rawtext): |
|
552 | > def hash(rawtext): | |
551 | > h = hashlib.sha512() |
|
553 | > h = hashlib.sha512() | |
552 | > h.update(rawtext) |
|
554 | > h.update(rawtext) | |
553 | > return h.hexdigest()[:4] |
|
555 | > return h.hexdigest()[:4] | |
554 | > def reposetup(ui, repo): |
|
556 | > def reposetup(ui, repo): | |
555 | > # these 2 files are interesting |
|
557 | > # these 2 files are interesting | |
556 | > for name in ['l', 's']: |
|
558 | > for name in ['l', 's']: | |
557 | > fl = repo.file(name) |
|
559 | > fl = repo.file(name) | |
558 | > if len(fl) == 0: |
|
560 | > if len(fl) == 0: | |
559 | > continue |
|
561 | > continue | |
560 | > sizes = [revlog.revlog.rawsize(fl, i) for i in fl] |
|
562 | > sizes = [revlog.revlog.rawsize(fl, i) for i in fl] | |
561 | > texts = [fl.revision(i, raw=True) for i in fl] |
|
563 | > texts = [fl.revision(i, raw=True) for i in fl] | |
562 | > flags = [int(fl.flags(i)) for i in fl] |
|
564 | > flags = [int(fl.flags(i)) for i in fl] | |
563 | > hashes = [hash(t) for t in texts] |
|
565 | > hashes = [hash(t) for t in texts] | |
564 | > print(' %s: rawsizes=%r flags=%r hashes=%r' |
|
566 | > print(' %s: rawsizes=%r flags=%r hashes=%r' | |
565 | > % (name, sizes, flags, hashes)) |
|
567 | > % (name, sizes, flags, hashes)) | |
566 | > EOF |
|
568 | > EOF | |
567 |
|
569 | |||
568 | $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \ |
|
570 | $ for i in client client2 server repo3 repo4 repo5 repo6 repo7 repo8 repo9 \ | |
569 | > repo10; do |
|
571 | > repo10; do | |
570 | > echo 'repo:' $i |
|
572 | > echo 'repo:' $i | |
571 | > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q |
|
573 | > hg --cwd $i verify --config extensions.dumpflog=$TESTTMP/dumpflog.py -q | |
572 | > done |
|
574 | > done | |
573 | repo: client |
|
575 | repo: client | |
574 | repo: client2 |
|
576 | repo: client2 | |
575 | repo: server |
|
577 | repo: server | |
576 | repo: repo3 |
|
578 | repo: repo3 | |
577 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] |
|
579 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] | |
578 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] |
|
580 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] | |
579 | repo: repo4 |
|
581 | repo: repo4 | |
580 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] |
|
582 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] | |
581 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] |
|
583 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] | |
582 | repo: repo5 |
|
584 | repo: repo5 | |
583 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] |
|
585 | l: rawsizes=[211, 6, 8, 141] flags=[8192, 0, 0, 8192] hashes=['d2b8', '948c', 'cc88', '724d'] | |
584 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] |
|
586 | s: rawsizes=[74, 141, 141, 8] flags=[0, 8192, 8192, 0] hashes=['3c80', 'fce0', '874a', '826b'] | |
585 | repo: repo6 |
|
587 | repo: repo6 | |
586 | repo: repo7 |
|
588 | repo: repo7 | |
587 | repo: repo8 |
|
589 | repo: repo8 | |
588 | repo: repo9 |
|
590 | repo: repo9 | |
589 | repo: repo10 |
|
591 | repo: repo10 | |
590 |
|
592 | |||
591 | repo12 doesn't have any cached lfs files and its source never pushed its |
|
593 | repo12 doesn't have any cached lfs files and its source never pushed its | |
592 | files. Therefore, the files don't exist in the remote store. Use the files in |
|
594 | files. Therefore, the files don't exist in the remote store. Use the files in | |
593 | the user cache. |
|
595 | the user cache. | |
594 |
|
596 | |||
595 | $ test -d $TESTTMP/repo12/.hg/store/lfs/objects |
|
597 | $ test -d $TESTTMP/repo12/.hg/store/lfs/objects | |
596 | [1] |
|
598 | [1] | |
597 |
|
599 | |||
598 | $ hg --config extensions.share= share repo12 repo13 |
|
600 | $ hg --config extensions.share= share repo12 repo13 | |
599 | updating working directory |
|
601 | updating working directory | |
600 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
602 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
601 | $ hg -R repo13 -q verify |
|
603 | $ hg -R repo13 -q verify | |
602 |
|
604 | |||
603 | $ hg clone repo12 repo14 |
|
605 | $ hg clone repo12 repo14 | |
604 | updating to branch default |
|
606 | updating to branch default | |
605 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
607 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
606 | $ hg -R repo14 -q verify |
|
608 | $ hg -R repo14 -q verify | |
607 |
|
609 | |||
608 | If the source repo doesn't have the blob (maybe it was pulled or cloned with |
|
610 | If the source repo doesn't have the blob (maybe it was pulled or cloned with | |
609 | --noupdate), the blob is still accessible via the global cache to send to the |
|
611 | --noupdate), the blob is still accessible via the global cache to send to the | |
610 | remote store. |
|
612 | remote store. | |
611 |
|
613 | |||
612 | $ rm -rf $TESTTMP/repo14/.hg/store/lfs |
|
614 | $ rm -rf $TESTTMP/repo14/.hg/store/lfs | |
613 | $ hg init repo15 |
|
615 | $ hg init repo15 | |
614 | $ hg -R repo14 push repo15 |
|
616 | $ hg -R repo14 push repo15 | |
615 | pushing to repo15 |
|
617 | pushing to repo15 | |
616 | searching for changes |
|
618 | searching for changes | |
617 | adding changesets |
|
619 | adding changesets | |
618 | adding manifests |
|
620 | adding manifests | |
619 | adding file changes |
|
621 | adding file changes | |
620 | added 3 changesets with 2 changes to 1 files |
|
622 | added 3 changesets with 2 changes to 1 files | |
621 | $ hg -R repo14 -q verify |
|
623 | $ hg -R repo14 -q verify | |
622 |
|
624 | |||
623 | Test damaged file scenarios. (This also damages the usercache because of the |
|
625 | Test damaged file scenarios. (This also damages the usercache because of the | |
624 | hardlinks.) |
|
626 | hardlinks.) | |
625 |
|
627 | |||
626 | $ echo 'damage' >> repo5/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
628 | $ echo 'damage' >> repo5/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
627 |
|
629 | |||
628 | Repo with damaged lfs objects in any revision will fail verification. |
|
630 | Repo with damaged lfs objects in any revision will fail verification. | |
629 |
|
631 | |||
630 | $ hg -R repo5 verify |
|
632 | $ hg -R repo5 verify | |
631 | checking changesets |
|
633 | checking changesets | |
632 | checking manifests |
|
634 | checking manifests | |
633 | crosschecking files in changesets and manifests |
|
635 | crosschecking files in changesets and manifests | |
634 | checking files |
|
636 | checking files | |
635 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 |
|
637 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | |
636 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 |
|
638 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | |
637 | 4 files, 5 changesets, 10 total revisions |
|
639 | 4 files, 5 changesets, 10 total revisions | |
638 | 2 integrity errors encountered! |
|
640 | 2 integrity errors encountered! | |
639 | (first damaged changeset appears to be 0) |
|
641 | (first damaged changeset appears to be 0) | |
640 | [1] |
|
642 | [1] | |
641 |
|
643 | |||
642 | Updates work after cloning a damaged repo, if the damaged lfs objects aren't in |
|
644 | Updates work after cloning a damaged repo, if the damaged lfs objects aren't in | |
643 | the update destination. Those objects won't be added to the new repo's store |
|
645 | the update destination. Those objects won't be added to the new repo's store | |
644 | because they aren't accessed. |
|
646 | because they aren't accessed. | |
645 |
|
647 | |||
646 | $ hg clone -v repo5 fromcorrupt |
|
648 | $ hg clone -v repo5 fromcorrupt | |
647 | updating to branch default |
|
649 | updating to branch default | |
648 | resolving manifests |
|
650 | resolving manifests | |
649 | getting l |
|
651 | getting l | |
650 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache |
|
652 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the usercache | |
651 | getting s |
|
653 | getting s | |
652 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
654 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
653 | $ test -f fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
655 | $ test -f fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
654 | [1] |
|
656 | [1] | |
655 |
|
657 | |||
656 | Verify will copy/link all lfs objects into the local store that aren't already |
|
658 | Verify will copy/link all lfs objects into the local store that aren't already | |
657 | present. Bypass the corrupted usercache to show that verify works when fed by |
|
659 | present. Bypass the corrupted usercache to show that verify works when fed by | |
658 | the (uncorrupted) remote store. |
|
660 | the (uncorrupted) remote store. | |
659 |
|
661 | |||
660 | $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v |
|
662 | $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v | |
661 | repository uses revlog format 1 |
|
663 | repository uses revlog format 1 | |
662 | checking changesets |
|
664 | checking changesets | |
663 | checking manifests |
|
665 | checking manifests | |
664 | crosschecking files in changesets and manifests |
|
666 | crosschecking files in changesets and manifests | |
665 | checking files |
|
667 | checking files | |
666 | lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache |
|
668 | lfs: adding 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e to the usercache | |
667 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store |
|
669 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store | |
668 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
670 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
669 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store |
|
671 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store | |
670 | lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache |
|
672 | lfs: adding 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 to the usercache | |
671 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store |
|
673 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | |
672 | lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache |
|
674 | lfs: adding b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c to the usercache | |
673 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store |
|
675 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | |
674 | 4 files, 5 changesets, 10 total revisions |
|
676 | 4 files, 5 changesets, 10 total revisions | |
675 |
|
677 | |||
676 | Verify will not copy/link a corrupted file from the usercache into the local |
|
678 | Verify will not copy/link a corrupted file from the usercache into the local | |
677 | store, and poison it. (The verify with a good remote now works.) |
|
679 | store, and poison it. (The verify with a good remote now works.) | |
678 |
|
680 | |||
679 | $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
681 | $ rm -r fromcorrupt/.hg/store/lfs/objects/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
680 | $ hg -R fromcorrupt verify -v |
|
682 | $ hg -R fromcorrupt verify -v | |
681 | repository uses revlog format 1 |
|
683 | repository uses revlog format 1 | |
682 | checking changesets |
|
684 | checking changesets | |
683 | checking manifests |
|
685 | checking manifests | |
684 | crosschecking files in changesets and manifests |
|
686 | crosschecking files in changesets and manifests | |
685 | checking files |
|
687 | checking files | |
686 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 |
|
688 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | |
687 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
689 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
688 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 |
|
690 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | |
689 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store |
|
691 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | |
690 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store |
|
692 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | |
691 | 4 files, 5 changesets, 10 total revisions |
|
693 | 4 files, 5 changesets, 10 total revisions | |
692 | 2 integrity errors encountered! |
|
694 | 2 integrity errors encountered! | |
693 | (first damaged changeset appears to be 0) |
|
695 | (first damaged changeset appears to be 0) | |
694 | [1] |
|
696 | [1] | |
695 | $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v |
|
697 | $ hg -R fromcorrupt --config lfs.usercache=emptycache verify -v | |
696 | repository uses revlog format 1 |
|
698 | repository uses revlog format 1 | |
697 | checking changesets |
|
699 | checking changesets | |
698 | checking manifests |
|
700 | checking manifests | |
699 | crosschecking files in changesets and manifests |
|
701 | crosschecking files in changesets and manifests | |
700 | checking files |
|
702 | checking files | |
701 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache |
|
703 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the usercache | |
702 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
704 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
703 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store |
|
705 | lfs: found 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e in the local lfs store | |
704 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store |
|
706 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | |
705 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store |
|
707 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | |
706 | 4 files, 5 changesets, 10 total revisions |
|
708 | 4 files, 5 changesets, 10 total revisions | |
707 |
|
709 | |||
708 | Damaging a file required by the update destination fails the update. |
|
710 | Damaging a file required by the update destination fails the update. | |
709 |
|
711 | |||
710 | $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
712 | $ echo 'damage' >> $TESTTMP/dummy-remote/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
711 | $ hg --config lfs.usercache=emptycache clone -v repo5 fromcorrupt2 |
|
713 | $ hg --config lfs.usercache=emptycache clone -v repo5 fromcorrupt2 | |
712 | updating to branch default |
|
714 | updating to branch default | |
713 | resolving manifests |
|
715 | resolving manifests | |
714 | getting l |
|
716 | getting l | |
715 | abort: detected corrupt lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
717 | abort: detected corrupt lfs object: 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
716 | (run hg verify) |
|
718 | (run hg verify) | |
717 | [255] |
|
719 | [255] | |
718 |
|
720 | |||
719 | A corrupted lfs blob is not transferred from a file://remotestore to the |
|
721 | A corrupted lfs blob is not transferred from a file://remotestore to the | |
720 | usercache or local store. |
|
722 | usercache or local store. | |
721 |
|
723 | |||
722 | $ test -f emptycache/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
724 | $ test -f emptycache/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
723 | [1] |
|
725 | [1] | |
724 | $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
726 | $ test -f fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
725 | [1] |
|
727 | [1] | |
726 |
|
728 | |||
727 | $ hg -R fromcorrupt2 verify |
|
729 | $ hg -R fromcorrupt2 verify | |
728 | checking changesets |
|
730 | checking changesets | |
729 | checking manifests |
|
731 | checking manifests | |
730 | crosschecking files in changesets and manifests |
|
732 | crosschecking files in changesets and manifests | |
731 | checking files |
|
733 | checking files | |
732 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 |
|
734 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | |
733 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 |
|
735 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | |
734 | 4 files, 5 changesets, 10 total revisions |
|
736 | 4 files, 5 changesets, 10 total revisions | |
735 | 2 integrity errors encountered! |
|
737 | 2 integrity errors encountered! | |
736 | (first damaged changeset appears to be 0) |
|
738 | (first damaged changeset appears to be 0) | |
737 | [1] |
|
739 | [1] | |
738 |
|
740 | |||
739 | Corrupt local files are not sent upstream. (The alternate dummy remote |
|
741 | Corrupt local files are not sent upstream. (The alternate dummy remote | |
740 | avoids the corrupt lfs object in the original remote.) |
|
742 | avoids the corrupt lfs object in the original remote.) | |
741 |
|
743 | |||
742 | $ mkdir $TESTTMP/dummy-remote2 |
|
744 | $ mkdir $TESTTMP/dummy-remote2 | |
743 | $ hg init dest |
|
745 | $ hg init dest | |
744 | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest |
|
746 | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 push -v dest | |
745 | pushing to dest |
|
747 | pushing to dest | |
746 | searching for changes |
|
748 | searching for changes | |
747 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
749 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
748 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store |
|
750 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | |
749 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store |
|
751 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | |
750 | abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
752 | abort: detected corrupt lfs object: 66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
751 | (run hg verify) |
|
753 | (run hg verify) | |
752 | [255] |
|
754 | [255] | |
753 |
|
755 | |||
754 | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v |
|
756 | $ hg -R fromcorrupt2 --config lfs.url=file:///$TESTTMP/dummy-remote2 verify -v | |
755 | repository uses revlog format 1 |
|
757 | repository uses revlog format 1 | |
756 | checking changesets |
|
758 | checking changesets | |
757 | checking manifests |
|
759 | checking manifests | |
758 | crosschecking files in changesets and manifests |
|
760 | crosschecking files in changesets and manifests | |
759 | checking files |
|
761 | checking files | |
760 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 |
|
762 | l@1: unpacking 46a2f24864bc: integrity check failed on data/l.i:0 | |
761 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store |
|
763 | lfs: found 22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b in the local lfs store | |
762 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 |
|
764 | large@0: unpacking 2c531e0992ff: integrity check failed on data/large.i:0 | |
763 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store |
|
765 | lfs: found 89b6070915a3d573ff3599d1cda305bc5e38549b15c4847ab034169da66e1ca8 in the local lfs store | |
764 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store |
|
766 | lfs: found b1a6ea88da0017a0e77db139a54618986e9a2489bee24af9fe596de9daac498c in the local lfs store | |
765 | 4 files, 5 changesets, 10 total revisions |
|
767 | 4 files, 5 changesets, 10 total revisions | |
766 | 2 integrity errors encountered! |
|
768 | 2 integrity errors encountered! | |
767 | (first damaged changeset appears to be 0) |
|
769 | (first damaged changeset appears to be 0) | |
768 | [1] |
|
770 | [1] | |
769 |
|
771 | |||
770 | $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 |
|
772 | $ cat $TESTTMP/dummy-remote2/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 | |
771 | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
773 | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
772 | $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 |
|
774 | $ cat fromcorrupt2/.hg/store/lfs/objects/22/f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | $TESTDIR/f --sha256 | |
773 | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b |
|
775 | sha256=22f66a3fc0b9bf3f012c814303995ec07099b3a9ce02a7af84b5970811074a3b | |
774 | $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
776 | $ test -f $TESTTMP/dummy-remote2/66/100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
775 | [1] |
|
777 | [1] | |
776 |
|
778 | |||
777 | Accessing a corrupt file will complain |
|
779 | Accessing a corrupt file will complain | |
778 |
|
780 | |||
779 | $ hg --cwd fromcorrupt2 cat -r 0 large |
|
781 | $ hg --cwd fromcorrupt2 cat -r 0 large | |
780 | abort: integrity check failed on data/large.i:0! |
|
782 | abort: integrity check failed on data/large.i:0! | |
781 | [255] |
|
783 | [255] | |
782 |
|
784 | |||
783 | lfs -> normal -> lfs round trip conversions are possible. The threshold for the |
|
785 | lfs -> normal -> lfs round trip conversions are possible. The threshold for the | |
784 | lfs destination is specified here because it was originally listed in the local |
|
786 | lfs destination is specified here because it was originally listed in the local | |
785 | .hgrc, and the global one is too high to trigger lfs usage. For lfs -> normal, |
|
787 | .hgrc, and the global one is too high to trigger lfs usage. For lfs -> normal, | |
786 | there's no 'lfs' destination repo requirement. For normal -> lfs, there is. |
|
788 | there's no 'lfs' destination repo requirement. For normal -> lfs, there is. | |
787 |
|
789 | |||
788 | XXX: There's not a great way to ensure that the conversion to normal files |
|
790 | XXX: There's not a great way to ensure that the conversion to normal files | |
789 | actually converts _everything_ to normal. The extension needs to be loaded for |
|
791 | actually converts _everything_ to normal. The extension needs to be loaded for | |
790 | the source, but there's no way to disable it for the destination. The best that |
|
792 | the source, but there's no way to disable it for the destination. The best that | |
791 | can be done is to raise the threshold so that lfs isn't used on the destination. |
|
793 | can be done is to raise the threshold so that lfs isn't used on the destination. | |
792 | It doesn't like using '!' to unset the value on the command line. |
|
794 | It doesn't like using '!' to unset the value on the command line. | |
793 |
|
795 | |||
794 | $ hg --config extensions.convert= --config lfs.threshold=1000M \ |
|
796 | $ hg --config extensions.convert= --config lfs.threshold=1000M \ | |
795 | > convert repo8 convert_normal |
|
797 | > convert repo8 convert_normal | |
796 | initializing destination convert_normal repository |
|
798 | initializing destination convert_normal repository | |
797 | scanning source... |
|
799 | scanning source... | |
798 | sorting... |
|
800 | sorting... | |
799 | converting... |
|
801 | converting... | |
800 | 2 a |
|
802 | 2 a | |
801 | 1 b |
|
803 | 1 b | |
802 | 0 meta |
|
804 | 0 meta | |
803 | $ grep 'lfs' convert_normal/.hg/requires |
|
805 | $ grep 'lfs' convert_normal/.hg/requires | |
804 | [1] |
|
806 | [1] | |
805 | $ hg --cwd convert_normal debugdata a1 0 |
|
807 | $ hg --cwd convert_normal debugdata a1 0 | |
806 | THIS-IS-LFS-BECAUSE-10-BYTES |
|
808 | THIS-IS-LFS-BECAUSE-10-BYTES | |
807 |
|
809 | |||
808 | $ hg --config extensions.convert= --config lfs.threshold=10B \ |
|
810 | $ hg --config extensions.convert= --config lfs.threshold=10B \ | |
809 | > convert convert_normal convert_lfs |
|
811 | > convert convert_normal convert_lfs | |
810 | initializing destination convert_lfs repository |
|
812 | initializing destination convert_lfs repository | |
811 | scanning source... |
|
813 | scanning source... | |
812 | sorting... |
|
814 | sorting... | |
813 | converting... |
|
815 | converting... | |
814 | 2 a |
|
816 | 2 a | |
815 | 1 b |
|
817 | 1 b | |
816 | 0 meta |
|
818 | 0 meta | |
817 | $ hg --cwd convert_lfs debugdata a1 0 |
|
819 | $ hg --cwd convert_lfs debugdata a1 0 | |
818 | version https://git-lfs.github.com/spec/v1 |
|
820 | version https://git-lfs.github.com/spec/v1 | |
819 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 |
|
821 | oid sha256:5bb8341bee63b3649f222b2215bde37322bea075a30575aa685d8f8d21c77024 | |
820 | size 29 |
|
822 | size 29 | |
821 | x-is-binary 0 |
|
823 | x-is-binary 0 | |
822 | $ grep 'lfs' convert_lfs/.hg/requires |
|
824 | $ grep 'lfs' convert_lfs/.hg/requires | |
823 | lfs |
|
825 | lfs | |
824 |
|
826 | |||
825 | This convert is trickier, because it contains deleted files (via `hg mv`) |
|
827 | This convert is trickier, because it contains deleted files (via `hg mv`) | |
826 |
|
828 | |||
827 | $ hg --config extensions.convert= --config lfs.threshold=1000M \ |
|
829 | $ hg --config extensions.convert= --config lfs.threshold=1000M \ | |
828 | > convert repo3 convert_normal2 |
|
830 | > convert repo3 convert_normal2 | |
829 | initializing destination convert_normal2 repository |
|
831 | initializing destination convert_normal2 repository | |
830 | scanning source... |
|
832 | scanning source... | |
831 | sorting... |
|
833 | sorting... | |
832 | converting... |
|
834 | converting... | |
833 | 4 commit with lfs content |
|
835 | 4 commit with lfs content | |
834 | 3 renames |
|
836 | 3 renames | |
835 | 2 large to small, small to large |
|
837 | 2 large to small, small to large | |
836 | 1 random modifications |
|
838 | 1 random modifications | |
837 | 0 switch large and small again |
|
839 | 0 switch large and small again | |
838 | $ grep 'lfs' convert_normal2/.hg/requires |
|
840 | $ grep 'lfs' convert_normal2/.hg/requires | |
839 | [1] |
|
841 | [1] | |
840 | $ hg --cwd convert_normal2 debugdata large 0 |
|
842 | $ hg --cwd convert_normal2 debugdata large 0 | |
841 | LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS |
|
843 | LONGER-THAN-TEN-BYTES-WILL-TRIGGER-LFS | |
842 |
|
844 | |||
843 | $ hg --config extensions.convert= --config lfs.threshold=10B \ |
|
845 | $ hg --config extensions.convert= --config lfs.threshold=10B \ | |
844 | > convert convert_normal2 convert_lfs2 |
|
846 | > convert convert_normal2 convert_lfs2 | |
845 | initializing destination convert_lfs2 repository |
|
847 | initializing destination convert_lfs2 repository | |
846 | scanning source... |
|
848 | scanning source... | |
847 | sorting... |
|
849 | sorting... | |
848 | converting... |
|
850 | converting... | |
849 | 4 commit with lfs content |
|
851 | 4 commit with lfs content | |
850 | 3 renames |
|
852 | 3 renames | |
851 | 2 large to small, small to large |
|
853 | 2 large to small, small to large | |
852 | 1 random modifications |
|
854 | 1 random modifications | |
853 | 0 switch large and small again |
|
855 | 0 switch large and small again | |
854 | $ grep 'lfs' convert_lfs2/.hg/requires |
|
856 | $ grep 'lfs' convert_lfs2/.hg/requires | |
855 | lfs |
|
857 | lfs | |
856 | $ hg --cwd convert_lfs2 debugdata large 0 |
|
858 | $ hg --cwd convert_lfs2 debugdata large 0 | |
857 | version https://git-lfs.github.com/spec/v1 |
|
859 | version https://git-lfs.github.com/spec/v1 | |
858 | oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e |
|
860 | oid sha256:66100b384bf761271b407d79fc30cdd0554f3b2c5d944836e936d584b88ce88e | |
859 | size 39 |
|
861 | size 39 | |
860 | x-is-binary 0 |
|
862 | x-is-binary 0 | |
861 |
|
863 | |||
862 | $ hg -R convert_lfs2 config --debug extensions | grep lfs |
|
864 | $ hg -R convert_lfs2 config --debug extensions | grep lfs | |
863 | $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob) |
|
865 | $TESTTMP/convert_lfs2/.hg/hgrc:*: extensions.lfs= (glob) | |
864 |
|
866 | |||
865 | Committing deleted files works: |
|
867 | Committing deleted files works: | |
866 |
|
868 | |||
867 | $ hg init $TESTTMP/repo-del |
|
869 | $ hg init $TESTTMP/repo-del | |
868 | $ cd $TESTTMP/repo-del |
|
870 | $ cd $TESTTMP/repo-del | |
869 | $ echo 1 > A |
|
871 | $ echo 1 > A | |
870 | $ hg commit -m 'add A' -A A |
|
872 | $ hg commit -m 'add A' -A A | |
871 | $ hg rm A |
|
873 | $ hg rm A | |
872 | $ hg commit -m 'rm A' |
|
874 | $ hg commit -m 'rm A' | |
873 | $ cd .. |
|
875 | $ cd .. | |
874 |
|
876 | |||
875 |
|
|
877 | Unbundling adds a requirement to a non-lfs repo, if necessary. | |
876 |
|
878 | |||
877 | $ hg bundle -R $TESTTMP/repo-del -qr 0 --base null nolfs.hg |
|
879 | $ hg bundle -R $TESTTMP/repo-del -qr 0 --base null nolfs.hg | |
878 | $ hg bundle -R convert_lfs2 -qr tip --base null lfs.hg |
|
880 | $ hg bundle -R convert_lfs2 -qr tip --base null lfs.hg | |
879 | $ hg init unbundle |
|
881 | $ hg init unbundle | |
880 | $ hg pull -R unbundle -q nolfs.hg |
|
882 | $ hg pull -R unbundle -q nolfs.hg | |
881 | $ grep lfs unbundle/.hg/requires |
|
883 | $ grep lfs unbundle/.hg/requires | |
882 | [1] |
|
884 | [1] | |
883 | $ hg pull -R unbundle -q lfs.hg |
|
885 | $ hg pull -R unbundle -q lfs.hg | |
884 | $ grep lfs unbundle/.hg/requires |
|
886 | $ grep lfs unbundle/.hg/requires | |
885 | [1] |
|
887 | lfs | |
886 |
|
888 | |||
887 | $ hg init no_lfs |
|
889 | $ hg init no_lfs | |
888 | $ cat >> no_lfs/.hg/hgrc <<EOF |
|
890 | $ cat >> no_lfs/.hg/hgrc <<EOF | |
889 | > [experimental] |
|
891 | > [experimental] | |
890 | > changegroup3 = True |
|
892 | > changegroup3 = True | |
891 | > [extensions] |
|
893 | > [extensions] | |
892 | > lfs=! |
|
894 | > lfs=! | |
893 | > EOF |
|
895 | > EOF | |
894 | $ cp -R no_lfs no_lfs2 |
|
896 | $ cp -R no_lfs no_lfs2 | |
895 |
|
897 | |||
896 | Pushing from a local lfs repo to a local repo without an lfs requirement and |
|
898 | Pushing from a local lfs repo to a local repo without an lfs requirement and | |
897 | with lfs disabled, fails. |
|
899 | with lfs disabled, fails. | |
898 |
|
900 | |||
899 | $ hg push -R convert_lfs2 no_lfs |
|
901 | $ hg push -R convert_lfs2 no_lfs | |
900 | pushing to no_lfs |
|
902 | pushing to no_lfs | |
901 | abort: required features are not supported in the destination: lfs |
|
903 | abort: required features are not supported in the destination: lfs | |
902 | [255] |
|
904 | [255] | |
903 | $ grep lfs no_lfs/.hg/requires |
|
905 | $ grep lfs no_lfs/.hg/requires | |
904 | [1] |
|
906 | [1] | |
905 |
|
907 | |||
906 | Pulling from a local lfs repo to a local repo without an lfs requirement and |
|
908 | Pulling from a local lfs repo to a local repo without an lfs requirement and | |
907 | with lfs disabled, fails. |
|
909 | with lfs disabled, fails. | |
908 |
|
910 | |||
909 | $ hg pull -R no_lfs2 convert_lfs2 |
|
911 | $ hg pull -R no_lfs2 convert_lfs2 | |
910 | pulling from convert_lfs2 |
|
912 | pulling from convert_lfs2 | |
911 | abort: required features are not supported in the destination: lfs |
|
913 | abort: required features are not supported in the destination: lfs | |
912 | [255] |
|
914 | [255] | |
913 | $ grep lfs no_lfs2/.hg/requires |
|
915 | $ grep lfs no_lfs2/.hg/requires | |
914 | [1] |
|
916 | [1] |
General Comments 0
You need to be logged in to leave comments.
Login now