tests/test-lfs-serve.t
changeset 42478 561cd02c58ff
parent 41704 3b0ba4575c8c
child 42897 d7304434390f
equal deleted inserted replaced
42477:e658ac39fe41 42478:561cd02c58ff
   535   $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
   535   $ hg -R $TESTTMP/client6_clone ci -Aqm 'add lfs pair'
   536   $ hg -R $TESTTMP/client6_clone push -q
   536   $ hg -R $TESTTMP/client6_clone push -q
   537 
   537 
   538   $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
   538   $ hg clone -qU http://localhost:$HGPORT $TESTTMP/bulkfetch
   539 
   539 
       
   540 Cat doesn't prefetch unless data is needed (e.g. '-T {rawdata}' doesn't need it)
       
   541 
       
   542   $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{rawdata}\n{path}\n'
       
   543   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
       
   544   version https://git-lfs.github.com/spec/v1
       
   545   oid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
       
   546   size 20
       
   547   x-is-binary 0
       
   548   
       
   549   lfspair1.bin
       
   550 
       
   551   $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T json
       
   552   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
       
   553   [lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
       
   554   lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
       
   555   lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
       
   556   lfs: downloaded 1 files (20 bytes)
       
   557   lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
       
   558   
       
   559    {
       
   560     "data": "this is an lfs file\n",
       
   561     "path": "lfspair1.bin",
       
   562     "rawdata": "version https://git-lfs.github.com/spec/v1\noid sha256:cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782\nsize 20\nx-is-binary 0\n"
       
   563    }
       
   564   ]
       
   565 
       
   566   $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
       
   567 
       
   568   $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair1.bin -T '{data}\n'
       
   569   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
       
   570   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
       
   571   lfs: downloading cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 (20 bytes)
       
   572   lfs: processed: cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782
       
   573   lfs: downloaded 1 files (20 bytes)
       
   574   lfs: found cf1b2787b74e66547d931b6ebe28ff63303e803cb2baa14a8f57c4383d875782 in the local lfs store
       
   575   this is an lfs file
       
   576   
       
   577   $ hg --cwd $TESTTMP/bulkfetch cat -vr tip lfspair2.bin
       
   578   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
       
   579   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
       
   580   lfs: downloading d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e (24 bytes)
       
   581   lfs: processed: d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e
       
   582   lfs: downloaded 1 files (24 bytes)
       
   583   lfs: found d96eda2c74b56e95cfb5ffb66b6503e198cc6fc4a09dc877de925feebc65786e in the local lfs store
       
   584   this is an lfs file too
       
   585 
   540 Export will prefetch all needed files across all needed revisions
   586 Export will prefetch all needed files across all needed revisions
   541 
   587 
       
   588   $ rm -r $TESTTMP/bulkfetch/.hg/store/lfs
   542   $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
   589   $ hg -R $TESTTMP/bulkfetch -v export -r 0:tip -o all.export
   543   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
   590   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
   544   exporting patches:
   591   exporting patches:
   545   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
   592   lfs: assuming remote store: http://localhost:$HGPORT/.git/info/lfs
   546   lfs: need to transfer 4 objects (92 bytes)
   593   lfs: need to transfer 4 objects (92 bytes)