tests/test-lfs-serve.t
changeset 41433 3757a968d63a
parent 41423 2a1bb442593b
child 41703 47c4ac5035a6
equal deleted inserted replaced
41432:080a5c83914f 41433:3757a968d63a
   357 
   357 
   358   $ mv $HGRCPATH $HGRCPATH.tmp
   358   $ mv $HGRCPATH $HGRCPATH.tmp
   359   $ cp $HGRCPATH.orig $HGRCPATH
   359   $ cp $HGRCPATH.orig $HGRCPATH
   360 
   360 
   361   >>> from __future__ import absolute_import
   361   >>> from __future__ import absolute_import
   362   >>> from hgclient import check, readchannel, runcommand
   362   >>> from hgclient import bprint, check, readchannel, runcommand, stdout
   363   >>> @check
   363   >>> @check
   364   ... def checkflags(server):
   364   ... def checkflags(server):
   365   ...     readchannel(server)
   365   ...     readchannel(server)
   366   ...     print('')
   366   ...     bprint(b'')
   367   ...     print('# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
   367   ...     bprint(b'# LFS required- both lfs and non-lfs revlogs have 0x2000 flag')
       
   368   ...     stdout.flush()
   368   ...     runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
   369   ...     runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
   369   ...                b'../server'])
   370   ...                b'../server'])
   370   ...     runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
   371   ...     runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
   371   ...                b'../server'])
   372   ...                b'../server'])
   372   ...     runcommand(server, [b'config', b'extensions', b'--cwd',
   373   ...     runcommand(server, [b'config', b'extensions', b'--cwd',
   373   ...                b'../server'])
   374   ...                b'../server'])
   374   ... 
   375   ... 
   375   ...     print("\n# LFS not enabled- revlogs don't have 0x2000 flag")
   376   ...     bprint(b"\n# LFS not enabled- revlogs don't have 0x2000 flag")
       
   377   ...     stdout.flush()
   376   ...     runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
   378   ...     runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
   377   ...     runcommand(server, [b'config', b'extensions'])
   379   ...     runcommand(server, [b'config', b'extensions'])
   378   
   380   
   379   # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
   381   # LFS required- both lfs and non-lfs revlogs have 0x2000 flag
   380   *** runcommand debugprocessors lfs.bin -R ../server
   382   *** runcommand debugprocessors lfs.bin -R ../server
   401   > [extensions]
   403   > [extensions]
   402   > lfs = !
   404   > lfs = !
   403   > EOF
   405   > EOF
   404 
   406 
   405   >>> from __future__ import absolute_import, print_function
   407   >>> from __future__ import absolute_import, print_function
   406   >>> from hgclient import check, readchannel, runcommand
   408   >>> from hgclient import bprint, check, readchannel, runcommand, stdout
   407   >>> @check
   409   >>> @check
   408   ... def checkflags2(server):
   410   ... def checkflags2(server):
   409   ...     readchannel(server)
   411   ...     readchannel(server)
   410   ...     print('')
   412   ...     bprint(b'')
   411   ...     print('# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
   413   ...     bprint(b'# LFS enabled- both lfs and non-lfs revlogs have 0x2000 flag')
       
   414   ...     stdout.flush()
   412   ...     runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
   415   ...     runcommand(server, [b'debugprocessors', b'lfs.bin', b'-R',
   413   ...                b'../server'])
   416   ...                b'../server'])
   414   ...     runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
   417   ...     runcommand(server, [b'debugprocessors', b'nonlfs2.txt', b'-R',
   415   ...                b'../server'])
   418   ...                b'../server'])
   416   ...     runcommand(server, [b'config', b'extensions', b'--cwd',
   419   ...     runcommand(server, [b'config', b'extensions', b'--cwd',
   417   ...                b'../server'])
   420   ...                b'../server'])
   418   ... 
   421   ... 
   419   ...     print('\n# LFS enabled without requirement- revlogs have 0x2000 flag')
   422   ...     bprint(b'\n# LFS enabled without requirement- revlogs have 0x2000 flag')
       
   423   ...     stdout.flush()
   420   ...     runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
   424   ...     runcommand(server, [b'debugprocessors', b'nonlfs3.txt'])
   421   ...     runcommand(server, [b'config', b'extensions'])
   425   ...     runcommand(server, [b'config', b'extensions'])
   422   ... 
   426   ... 
   423   ...     print("\n# LFS disabled locally- revlogs don't have 0x2000 flag")
   427   ...     bprint(b"\n# LFS disabled locally- revlogs don't have 0x2000 flag")
       
   428   ...     stdout.flush()
   424   ...     runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
   429   ...     runcommand(server, [b'debugprocessors', b'nonlfs.txt', b'-R',
   425   ...                b'../nonlfs'])
   430   ...                b'../nonlfs'])
   426   ...     runcommand(server, [b'config', b'extensions', b'--cwd',
   431   ...     runcommand(server, [b'config', b'extensions', b'--cwd',
   427   ...                b'../nonlfs'])
   432   ...                b'../nonlfs'])
   428   
   433