##// END OF EJS Templates
lfs: allow non-lfs exchanges when the extension is only enabled on one side...
Matt Harbison -
r35521:2526579a default
parent child Browse files
Show More
@@ -28,8 +28,9 b' from . import ('
28
28
29 def supportedoutgoingversions(orig, repo):
29 def supportedoutgoingversions(orig, repo):
30 versions = orig(repo)
30 versions = orig(repo)
31 versions.discard('01')
31 if 'lfs' in repo.requirements:
32 versions.discard('02')
32 versions.discard('01')
33 versions.discard('02')
33 versions.add('03')
34 versions.add('03')
34 return versions
35 return versions
35
36
@@ -70,21 +70,12 b' non-lfs content, and the extension enabl'
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.
74
75 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
73 $ hg clone -q http://localhost:$HGPORT $TESTTMP/client1_clone
76 abort: HTTP Error 500: Internal Server Error
77 [255]
78 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
74 $ grep 'lfs' $TESTTMP/client1_clone/.hg/requires $SERVER_REQUIRES
79 grep: $TESTTMP/client1_clone/.hg/requires: $ENOENT$
75 [1]
80 [2]
81
82 TODO: fail more gracefully, or don't mandate changegroup3 for non-lfs repos.
83
76
84 $ hg init $TESTTMP/client1_pull
77 $ hg init $TESTTMP/client1_pull
85 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
78 $ hg -R $TESTTMP/client1_pull pull -q http://localhost:$HGPORT
86 abort: HTTP Error 500: Internal Server Error
87 [255]
88 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
79 $ grep 'lfs' $TESTTMP/client1_pull/.hg/requires $SERVER_REQUIRES
89 [1]
80 [1]
90
81
@@ -104,10 +95,10 b' non-lfs content, and the extension state'
104 $ echo 'non-lfs' > nonlfs2.txt
95 $ echo 'non-lfs' > nonlfs2.txt
105 $ hg ci -Aqm 'non-lfs file with lfs client'
96 $ hg ci -Aqm 'non-lfs file with lfs client'
106
97
107 TODO: fail more gracefully here
98 Since no lfs content has been added yet, the push is allowed, even when the
108 $ hg push -q 2>&1 | grep '^[A-Z]' || true
99 extension is not enabled remotely.
109 Traceback (most recent call last): (lfsremote-off !)
100
110 ValueError: no common changegroup version (lfsremote-off !)
101 $ hg push -q
111 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
102 $ grep 'lfs' .hg/requires $SERVER_REQUIRES
112 [1]
103 [1]
113
104
@@ -120,13 +111,8 b' TODO: fail more gracefully here'
120 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
111 $ grep 'lfs' $TESTTMP/client2_pull/.hg/requires $SERVER_REQUIRES
121 [1]
112 [1]
122
113
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
125 versions if there is no lfs content. But the requirement needs to be
126 consistently added before that can be ratcheted back.
127 $ hg identify http://localhost:$HGPORT
114 $ hg identify http://localhost:$HGPORT
128 1477875038c6 (lfsremote-on !)
115 1477875038c6
129 000000000000 (lfsremote-off !)
130
116
131 --------------------------------------------------------------------------------
117 --------------------------------------------------------------------------------
132 Case #3: client with lfs content and the extension enabled; server with
118 Case #3: client with lfs content and the extension enabled; server with
@@ -157,13 +143,11 b' TODO: fail more gracefully here'
157 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
143 $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !)
158 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
144 $TESTTMP/server/.hg/requires:lfs (lfsremote-on !)
159
145
160 XXX: The difference here is the push failed above when the extension isn't
146 The difference here is the push failed above when the extension isn't
161 enabled on the server. The extension shouldn't need to mess with changegroup
147 enabled on the server.
162 versions if there is no lfs content. But the requirement needs to be
163 consistently added before that can be ratcheted back.
164 $ hg identify http://localhost:$HGPORT
148 $ hg identify http://localhost:$HGPORT
165 8374dc4052cb (lfsremote-on !)
149 8374dc4052cb (lfsremote-on !)
166 000000000000 (lfsremote-off !)
150 1477875038c6 (lfsremote-off !)
167
151
168 Don't bother testing the lfsremote-off cases- the server won't be able
152 Don't bother testing the lfsremote-off cases- the server won't be able
169 to launch if there's lfs content and the extension is disabled.
153 to launch if there's lfs content and the extension is disabled.
@@ -290,10 +274,6 b' Misc: process dies early if a requiremen'
290 ValueError: no common changegroup version
274 ValueError: no common changegroup version
291 Traceback (most recent call last):
275 Traceback (most recent call last):
292 ValueError: no common changegroup version
276 ValueError: no common changegroup version
293 Traceback (most recent call last):
294 ValueError: no common changegroup version
295 Traceback (most recent call last):
296 ValueError: no common changegroup version
297 #else
277 #else
298 $ cat $TESTTMP/errors.log
278 $ cat $TESTTMP/errors.log
299 #endif
279 #endif
General Comments 0
You need to be logged in to leave comments. Login now