tests/test-largefiles.t
changeset 17089 0c1d10351869
parent 17088 31f7dd50ed40
child 17092 5d0d99952494
equal deleted inserted replaced
17088:31f7dd50ed40 17089:0c1d10351869
     1   $ "$TESTDIR/hghave" serve || exit 80
       
     2   $ USERCACHE="$TESTTMP/cache"; export USERCACHE
     1   $ USERCACHE="$TESTTMP/cache"; export USERCACHE
     3   $ mkdir -p ${USERCACHE}
     2   $ mkdir -p "${USERCACHE}"
     4   $ cat >> $HGRCPATH <<EOF
     3   $ cat >> $HGRCPATH <<EOF
     5   > [extensions]
     4   > [extensions]
     6   > largefiles=
     5   > largefiles=
     7   > purge=
     6   > purge=
     8   > rebase=
     7   > rebase=
   140   $ cat sub/normal4
   139   $ cat sub/normal4
   141   normal22
   140   normal22
   142   $ cat sub/large4
   141   $ cat sub/large4
   143   large22
   142   large22
   144 
   143 
       
   144 #if hgweb
   145 Test display of largefiles in hgweb
   145 Test display of largefiles in hgweb
   146 
   146 
   147   $ hg serve -d -p $HGPORT --pid-file ../hg.pid
   147   $ hg serve -d -p $HGPORT --pid-file ../hg.pid
   148   $ cat ../hg.pid >> $DAEMON_PIDS
   148   $ cat ../hg.pid >> $DAEMON_PIDS
   149   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
   149   $ "$TESTDIR/get-with-headers.py" 127.0.0.1:$HGPORT 'file/tip/?style=raw'
   162   -rw-r--r-- 41 large4
   162   -rw-r--r-- 41 large4
   163   -rw-r--r-- 9 normal4
   163   -rw-r--r-- 9 normal4
   164   
   164   
   165   
   165   
   166   $ "$TESTDIR/killdaemons.py"
   166   $ "$TESTDIR/killdaemons.py"
       
   167 #endif
   167 
   168 
   168 Test archiving the various revisions.  These hit corner cases known with
   169 Test archiving the various revisions.  These hit corner cases known with
   169 archiving.
   170 archiving.
   170 
   171 
   171   $ hg archive -r 0 ../archive0
   172   $ hg archive -r 0 ../archive0
   434   large22
   435   large22
   435   $ cd ..
   436   $ cd ..
   436 
   437 
   437 Test cloning with --all-largefiles flag
   438 Test cloning with --all-largefiles flag
   438 
   439 
   439   $ rm -Rf ${USERCACHE}/*
   440   $ rm -Rf "${USERCACHE}"/*
   440   $ hg clone --all-largefiles a a-backup
   441   $ hg clone --all-largefiles a a-backup
   441   updating to branch default
   442   updating to branch default
   442   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   443   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   443   getting changed largefiles
   444   getting changed largefiles
   444   3 largefiles updated, 0 removed
   445   3 largefiles updated, 0 removed
   458   added 2 changesets with 8 changes to 4 files
   459   added 2 changesets with 8 changes to 4 files
   459   updating to branch default
   460   updating to branch default
   460   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   461   4 files updated, 0 files merged, 0 files removed, 0 files unresolved
   461   getting changed largefiles
   462   getting changed largefiles
   462   2 largefiles updated, 0 removed
   463   2 largefiles updated, 0 removed
   463   $ rm -Rf ${USERCACHE}/*
   464   $ rm -Rf "${USERCACHE}"/*
   464   $ cd a-backup
   465   $ cd a-backup
   465   $ hg pull --all-largefiles
   466   $ hg pull --all-largefiles
   466   pulling from $TESTTMP/a (glob)
   467   pulling from $TESTTMP/a (glob)
   467   searching for changes
   468   searching for changes
   468   adding changesets
   469   adding changesets
   725   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   726   5 files updated, 0 files merged, 0 files removed, 0 files unresolved
   726   getting changed largefiles
   727   getting changed largefiles
   727   3 largefiles updated, 0 removed
   728   3 largefiles updated, 0 removed
   728 # Delete the largefiles in the largefiles system cache so that we have an
   729 # Delete the largefiles in the largefiles system cache so that we have an
   729 # opportunity to test that caching after a pull works.
   730 # opportunity to test that caching after a pull works.
   730   $ rm ${USERCACHE}/*
   731   $ rm "${USERCACHE}"/*
   731   $ cd f
   732   $ cd f
   732   $ echo "large4-merge-test" > sub/large4
   733   $ echo "large4-merge-test" > sub/large4
   733   $ hg commit -m "Modify large4 to test merge"
   734   $ hg commit -m "Modify large4 to test merge"
   734   Invoking status precommit hook
   735   Invoking status precommit hook
   735   M sub/large4
   736   M sub/large4
   843 Cat a largefile
   844 Cat a largefile
   844   $ hg cat normal3
   845   $ hg cat normal3
   845   normal3-modified
   846   normal3-modified
   846   $ hg cat sub/large4
   847   $ hg cat sub/large4
   847   large4-modified
   848   large4-modified
   848   $ rm ${USERCACHE}/*
   849   $ rm "${USERCACHE}"/*
   849   $ hg cat -r a381d2c8c80e -o cat.out sub/large4
   850   $ hg cat -r a381d2c8c80e -o cat.out sub/large4
   850   $ cat cat.out
   851   $ cat cat.out
   851   large4-modified
   852   large4-modified
   852   $ rm cat.out
   853   $ rm cat.out
   853   $ hg cat -r a381d2c8c80e normal3
   854   $ hg cat -r a381d2c8c80e normal3
   878   $ hg add --normal new-largefile
   879   $ hg add --normal new-largefile
   879   new-largefile: up to 69 MB of RAM may be required to manage this file
   880   new-largefile: up to 69 MB of RAM may be required to manage this file
   880   (use 'hg revert new-largefile' to cancel the pending addition)
   881   (use 'hg revert new-largefile' to cancel the pending addition)
   881   $ cd ..
   882   $ cd ..
   882 
   883 
       
   884 #if serve
   883 vanilla clients not locked out from largefiles servers on vanilla repos
   885 vanilla clients not locked out from largefiles servers on vanilla repos
   884   $ mkdir r1
   886   $ mkdir r1
   885   $ cd r1
   887   $ cd r1
   886   $ hg init
   888   $ hg init
   887   $ echo c1 > f1
   889   $ echo c1 > f1
   910   adding manifests
   912   adding manifests
   911   adding file changes
   913   adding file changes
   912   added 1 changesets with 1 changes to 1 files
   914   added 1 changesets with 1 changes to 1 files
   913   updating to branch default
   915   updating to branch default
   914   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   916   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
   917 #endif
       
   918 
   915 
   919 
   916 vanilla clients locked out from largefiles http repos
   920 vanilla clients locked out from largefiles http repos
   917   $ mkdir r4
   921   $ mkdir r4
   918   $ cd r4
   922   $ cd r4
   919   $ hg init
   923   $ hg init
   921   $ hg add --large f1
   925   $ hg add --large f1
   922   $ hg commit -m "m1"
   926   $ hg commit -m "m1"
   923   Invoking status precommit hook
   927   Invoking status precommit hook
   924   A f1
   928   A f1
   925   $ cd ..
   929   $ cd ..
       
   930 
       
   931 #if serve
   926   $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
   932   $ hg serve -R r4 -d -p $HGPORT2 --pid-file hg.pid
   927   $ cat hg.pid >> $DAEMON_PIDS
   933   $ cat hg.pid >> $DAEMON_PIDS
   928   $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
   934   $ hg --config extensions.largefiles=! clone http://localhost:$HGPORT2 r5
   929   abort: remote error:
   935   abort: remote error:
   930   
   936   
   933   Please enable it in your Mercurial config file.
   939   Please enable it in your Mercurial config file.
   934   [255]
   940   [255]
   935 
   941 
   936 used all HGPORTs, kill all daemons
   942 used all HGPORTs, kill all daemons
   937   $ "$TESTDIR/killdaemons.py"
   943   $ "$TESTDIR/killdaemons.py"
       
   944 #endif
   938 
   945 
   939 vanilla clients locked out from largefiles ssh repos
   946 vanilla clients locked out from largefiles ssh repos
   940   $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
   947   $ hg --config extensions.largefiles=! clone -e "python \"$TESTDIR/dummyssh\"" ssh://user@dummy/r4 r5
   941   abort: remote error:
   948   abort: remote error:
   942   
   949   
   943   This repository uses the largefiles extension.
   950   This repository uses the largefiles extension.
   944   
   951   
   945   Please enable it in your Mercurial config file.
   952   Please enable it in your Mercurial config file.
   946   [255]
   953   [255]
   947 
   954 
       
   955 #if serve
       
   956 
   948 largefiles clients refuse to push largefiles repos to vanilla servers
   957 largefiles clients refuse to push largefiles repos to vanilla servers
   949   $ mkdir r6
   958   $ mkdir r6
   950   $ cd r6
   959   $ cd r6
   951   $ hg init
   960   $ hg init
   952   $ echo c1 > f1
   961   $ echo c1 > f1
   978   [255]
   987   [255]
   979   $ cd ..
   988   $ cd ..
   980 
   989 
   981 putlfile errors are shown (issue3123)
   990 putlfile errors are shown (issue3123)
   982 Corrupt the cached largefile in r7
   991 Corrupt the cached largefile in r7
   983   $ echo corruption > $USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8
   992   $ echo corruption > "$USERCACHE/4cdac4d8b084d0b599525cf732437fb337d422a8"
   984   $ hg init empty
   993   $ hg init empty
   985   $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
   994   $ hg serve -R empty -d -p $HGPORT1 --pid-file hg.pid \
   986   >   --config 'web.allow_push=*' --config web.push_ssl=False
   995   >   --config 'web.allow_push=*' --config web.push_ssl=False
   987   $ cat hg.pid >> $DAEMON_PIDS
   996   $ cat hg.pid >> $DAEMON_PIDS
   988   $ hg push -R r7 http://localhost:$HGPORT1
   997   $ hg push -R r7 http://localhost:$HGPORT1
  1002   A f1
  1011   A f1
  1003   $ hg init empty
  1012   $ hg init empty
  1004   $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
  1013   $ hg serve -R empty -d -p $HGPORT2 --pid-file hg.pid \
  1005   >   --config 'web.allow_push=*' --config web.push_ssl=False
  1014   >   --config 'web.allow_push=*' --config web.push_ssl=False
  1006   $ cat hg.pid >> $DAEMON_PIDS
  1015   $ cat hg.pid >> $DAEMON_PIDS
  1007   $ rm ${USERCACHE}/*
  1016   $ rm "${USERCACHE}"/*
  1008   $ hg push -R r8 http://localhost:$HGPORT2
  1017   $ hg push -R r8 http://localhost:$HGPORT2
  1009   pushing to http://localhost:$HGPORT2/
  1018   pushing to http://localhost:$HGPORT2/
  1010   searching for changes
  1019   searching for changes
  1011   searching for changes
  1020   searching for changes
  1012   remote: adding changesets
  1021   remote: adding changesets
  1015   remote: added 1 changesets with 1 changes to 1 files
  1024   remote: added 1 changesets with 1 changes to 1 files
  1016   $ rm -rf empty
  1025   $ rm -rf empty
  1017 
  1026 
  1018 used all HGPORTs, kill all daemons
  1027 used all HGPORTs, kill all daemons
  1019   $ "$TESTDIR/killdaemons.py"
  1028   $ "$TESTDIR/killdaemons.py"
       
  1029 
       
  1030 #endif
       
  1031 
  1020 
  1032 
  1021 #if unix-permissions
  1033 #if unix-permissions
  1022 
  1034 
  1023 Clone a local repository owned by another user
  1035 Clone a local repository owned by another user
  1024 We have to simulate that here by setting $HOME and removing write permissions
  1036 We have to simulate that here by setting $HOME and removing write permissions