Show More
@@ -237,13 +237,15 b' def reposetup(ui, repo):' | |||
|
237 | 237 | |
|
238 | 238 | if 'lfs' not in repo.requirements: |
|
239 | 239 | def checkrequireslfs(ui, repo, **kwargs): |
|
240 |
if 'lfs' |
|
|
241 | last = kwargs.get(r'node_last') | |
|
242 | _bin = node.bin | |
|
243 | if last: | |
|
244 | s = repo.set('%n:%n', _bin(kwargs[r'node']), _bin(last)) | |
|
245 |
|
|
|
246 |
|
|
|
240 | if 'lfs' in repo.requirements: | |
|
241 | return 0 | |
|
242 | ||
|
243 | last = kwargs.get(r'node_last') | |
|
244 | _bin = node.bin | |
|
245 | if last: | |
|
246 | s = repo.set('%n:%n', _bin(kwargs[r'node']), _bin(last)) | |
|
247 | else: | |
|
248 | s = repo.set('%n', _bin(kwargs[r'node'])) | |
|
247 | 249 | match = repo.narrowmatch() |
|
248 | 250 | for ctx in s: |
|
249 | 251 | # TODO: is there a way to just walk the files in the commit? |
@@ -244,6 +244,30 b" should have an 'lfs' requirement after i" | |||
|
244 | 244 | $TESTTMP/client3_pull/.hg/requires:lfs (lfsremote-on !) |
|
245 | 245 | $TESTTMP/server/.hg/requires:lfs (lfsremote-on !) |
|
246 | 246 | |
|
247 | Test that the commit/changegroup requirement check hook can be run multiple | |
|
248 | times. | |
|
249 | ||
|
250 | $ hg clone -qr 0 http://localhost:$HGPORT $TESTTMP/cmdserve_client3 | |
|
251 | ||
|
252 | $ cd ../cmdserve_client3 | |
|
253 | ||
|
254 | >>> from __future__ import absolute_import | |
|
255 | >>> from hgclient import check, readchannel, runcommand | |
|
256 | >>> @check | |
|
257 | ... def addrequirement(server): | |
|
258 | ... readchannel(server) | |
|
259 | ... # change the repo in a way that adds the lfs requirement | |
|
260 | ... runcommand(server, ['pull', '-qu']) | |
|
261 | ... # Now cause the requirement adding hook to fire again, without going | |
|
262 | ... # through reposetup() again. | |
|
263 | ... with open('file.txt', 'wb') as fp: | |
|
264 | ... fp.write('data') | |
|
265 | ... runcommand(server, ['ci', '-Aqm', 'non-lfs']) | |
|
266 | *** runcommand pull -qu | |
|
267 | *** runcommand ci -Aqm non-lfs | |
|
268 | ||
|
269 | $ cd ../client | |
|
270 | ||
|
247 | 271 | The difference here is the push failed above when the extension isn't |
|
248 | 272 | enabled on the server. |
|
249 | 273 | $ hg identify http://localhost:$HGPORT |
General Comments 0
You need to be logged in to leave comments.
Login now