33 $ export PYTHONPATH |
33 $ export PYTHONPATH |
34 |
34 |
35 $ hg init server |
35 $ hg init server |
36 $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires" |
36 $ SERVER_REQUIRES="$TESTTMP/server/.hg/requires" |
37 |
37 |
|
38 $ cat > $TESTTMP/debugprocessors.py <<EOF |
|
39 > from mercurial import ( |
|
40 > cmdutil, |
|
41 > commands, |
|
42 > pycompat, |
|
43 > registrar, |
|
44 > ) |
|
45 > cmdtable = {} |
|
46 > command = registrar.command(cmdtable) |
|
47 > @command(b'debugprocessors', [], b'FILE') |
|
48 > def debugprocessors(ui, repo, file_=None, **opts): |
|
49 > opts = pycompat.byteskwargs(opts) |
|
50 > opts[b'changelog'] = False |
|
51 > opts[b'manifest'] = False |
|
52 > opts[b'dir'] = False |
|
53 > rl = cmdutil.openrevlog(repo, b'debugprocessors', file_, opts) |
|
54 > for flag, proc in rl._flagprocessors.iteritems(): |
|
55 > ui.status(b"registered processor '%#x'\n" % (flag)) |
|
56 > EOF |
|
57 |
38 Skip the experimental.changegroup3=True config. Failure to agree on this comes |
58 Skip the experimental.changegroup3=True config. Failure to agree on this comes |
39 first, and causes a "ValueError: no common changegroup version" or "abort: |
59 first, and causes a "ValueError: no common changegroup version" or "abort: |
40 HTTP Error 500: Internal Server Error", if the extension is only loaded on one |
60 HTTP Error 500: Internal Server Error", if the extension is only loaded on one |
41 side. If that *is* enabled, the subsequent failure is "abort: missing processor |
61 side. If that *is* enabled, the subsequent failure is "abort: missing processor |
42 for flag '0x2000'!" if the extension is only loaded on one side (possibly also |
62 for flag '0x2000'!" if the extension is only loaded on one side (possibly also |
43 masked by the Internal Server Error message). |
63 masked by the Internal Server Error message). |
44 $ cat >> $HGRCPATH <<EOF |
64 $ cat >> $HGRCPATH <<EOF |
|
65 > [extensions] |
|
66 > debugprocessors = $TESTTMP/debugprocessors.py |
45 > [experimental] |
67 > [experimental] |
46 > lfs.disableusercache = True |
68 > lfs.disableusercache = True |
47 > [lfs] |
69 > [lfs] |
48 > threshold=10 |
70 > threshold=10 |
49 > [web] |
71 > [web] |
50 > allow_push=* |
72 > allow_push=* |
51 > push_ssl=False |
73 > push_ssl=False |
52 > EOF |
74 > EOF |
|
75 |
|
76 $ cp $HGRCPATH $HGRCPATH.orig |
53 |
77 |
54 #if lfsremote-on |
78 #if lfsremote-on |
55 $ hg --config extensions.lfs= -R server \ |
79 $ hg --config extensions.lfs= -R server \ |
56 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log |
80 > serve -p $HGPORT -d --pid-file=hg.pid --errorlog=$TESTTMP/errors.log |
57 #else |
81 #else |
305 $TESTTMP/server/.hg/requires:lfs |
329 $TESTTMP/server/.hg/requires:lfs |
306 |
330 |
307 $ hg identify http://localhost:$HGPORT |
331 $ hg identify http://localhost:$HGPORT |
308 c729025cc5e3 |
332 c729025cc5e3 |
309 |
333 |
|
334 $ mv $HGRCPATH $HGRCPATH.tmp |
|
335 $ cp $HGRCPATH.orig $HGRCPATH |
|
336 |
|
337 >>> from __future__ import absolute_import |
|
338 >>> from hgclient import check, readchannel, runcommand |
|
339 >>> @check |
|
340 ... def checkflags(server): |
|
341 ... readchannel(server) |
|
342 ... print('') |
|
343 ... print('# LFS required- both lfs and non-lfs revlogs have 0x2000 flag') |
|
344 ... runcommand(server, ['debugprocessors', 'lfs.bin', '-R', |
|
345 ... '../server']) |
|
346 ... runcommand(server, ['debugprocessors', 'nonlfs2.txt', '-R', |
|
347 ... '../server']) |
|
348 ... runcommand(server, ['config', 'extensions', '--cwd', |
|
349 ... '../server']) |
|
350 ... |
|
351 ... print("\n# LFS not enabled- revlogs don't have 0x2000 flag") |
|
352 ... runcommand(server, ['debugprocessors', 'nonlfs3.txt']) |
|
353 ... runcommand(server, ['config', 'extensions']) |
|
354 |
|
355 # LFS required- both lfs and non-lfs revlogs have 0x2000 flag |
|
356 *** runcommand debugprocessors lfs.bin -R ../server |
|
357 registered processor '0x8000' |
|
358 registered processor '0x2000' |
|
359 *** runcommand debugprocessors nonlfs2.txt -R ../server |
|
360 registered processor '0x8000' |
|
361 registered processor '0x2000' |
|
362 *** runcommand config extensions --cwd ../server |
|
363 extensions.debugprocessors=$TESTTMP/debugprocessors.py |
|
364 extensions.lfs= |
|
365 |
|
366 # LFS not enabled- revlogs don't have 0x2000 flag |
|
367 *** runcommand debugprocessors nonlfs3.txt |
|
368 registered processor '0x8000' |
|
369 *** runcommand config extensions |
|
370 extensions.debugprocessors=$TESTTMP/debugprocessors.py |
|
371 |
|
372 $ rm $HGRCPATH |
|
373 $ mv $HGRCPATH.tmp $HGRCPATH |
|
374 |
|
375 $ hg clone $TESTTMP/client $TESTTMP/nonlfs -qr 0 --config extensions.lfs= |
|
376 $ cat >> $TESTTMP/nonlfs/.hg/hgrc <<EOF |
|
377 > [extensions] |
|
378 > lfs = ! |
|
379 > EOF |
|
380 |
|
381 >>> from __future__ import absolute_import, print_function |
|
382 >>> from hgclient import check, readchannel, runcommand |
|
383 >>> @check |
|
384 ... def checkflags2(server): |
|
385 ... readchannel(server) |
|
386 ... print('') |
|
387 ... print('# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag') |
|
388 ... runcommand(server, ['debugprocessors', 'lfs.bin', '-R', |
|
389 ... '../server']) |
|
390 ... runcommand(server, ['debugprocessors', 'nonlfs2.txt', '-R', |
|
391 ... '../server']) |
|
392 ... runcommand(server, ['config', 'extensions', '--cwd', |
|
393 ... '../server']) |
|
394 ... |
|
395 ... print('\n# LFS enabled without requirement- revlogs have 0x2000 flag') |
|
396 ... runcommand(server, ['debugprocessors', 'nonlfs3.txt']) |
|
397 ... runcommand(server, ['config', 'extensions']) |
|
398 ... |
|
399 ... print("\n# LFS disabled locally- revlogs don't have 0x2000 flag") |
|
400 ... runcommand(server, ['debugprocessors', 'nonlfs.txt', '-R', |
|
401 ... '../nonlfs']) |
|
402 ... runcommand(server, ['config', 'extensions', '--cwd', |
|
403 ... '../nonlfs']) |
|
404 |
|
405 # LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag |
|
406 *** runcommand debugprocessors lfs.bin -R ../server |
|
407 registered processor '0x8000' |
|
408 registered processor '0x2000' |
|
409 *** runcommand debugprocessors nonlfs2.txt -R ../server |
|
410 registered processor '0x8000' |
|
411 registered processor '0x2000' |
|
412 *** runcommand config extensions --cwd ../server |
|
413 extensions.debugprocessors=$TESTTMP/debugprocessors.py |
|
414 extensions.lfs= |
|
415 |
|
416 # LFS enabled without requirement- revlogs have 0x2000 flag |
|
417 *** runcommand debugprocessors nonlfs3.txt |
|
418 registered processor '0x8000' |
|
419 registered processor '0x2000' |
|
420 *** runcommand config extensions |
|
421 extensions.debugprocessors=$TESTTMP/debugprocessors.py |
|
422 extensions.lfs= |
|
423 |
|
424 # LFS disabled locally- revlogs don't have 0x2000 flag |
|
425 *** runcommand debugprocessors nonlfs.txt -R ../nonlfs |
|
426 registered processor '0x8000' |
|
427 *** runcommand config extensions --cwd ../nonlfs |
|
428 extensions.debugprocessors=$TESTTMP/debugprocessors.py |
|
429 extensions.lfs=! |
|
430 |
310 -------------------------------------------------------------------------------- |
431 -------------------------------------------------------------------------------- |
311 Case #6: client with lfs content and the extension enabled; server with |
432 Case #6: client with lfs content and the extension enabled; server with |
312 lfs content, and the extension enabled. |
433 lfs content, and the extension enabled. |
313 |
434 |
314 $ echo 'this is another lfs file' > lfs2.txt |
435 $ echo 'this is another lfs file' > lfs2.txt |