tests/test-hardlinks.t
changeset 16918 b112e265b78a
parent 16913 f2719b387380
child 16971 8aeb2f1ae94c
equal deleted inserted replaced
16917:bebe376b938f 16918:b112e265b78a
     1   $ "$TESTDIR/hghave" no-windows || exit 80
       
     2 
       
     3   $ cat > nlinks.py <<EOF
     1   $ cat > nlinks.py <<EOF
     4   > import os, sys
     2   > import sys
       
     3   > from mercurial import util
     5   > for f in sorted(sys.stdin.readlines()):
     4   > for f in sorted(sys.stdin.readlines()):
     6   >     f = f[:-1]
     5   >     f = f[:-1]
     7   >     print os.lstat(f).st_nlink, f
     6   >     print util.nlinks(f), f
     8   > EOF
     7   > EOF
     9 
     8 
    10   $ nlinksdir()
     9   $ nlinksdir()
    11   > {
    10   > {
    12   >     find $1 -type f | python $TESTTMP/nlinks.py
    11   >     find $1 -type f | python $TESTTMP/nlinks.py
   102 
   101 
   103 
   102 
   104 Create a non-inlined filelog in r3:
   103 Create a non-inlined filelog in r3:
   105 
   104 
   106   $ cd r3/d1
   105   $ cd r3/d1
   107   $ python -c 'for x in range(10000): print x' >> data1
   106   >>> f = open('data1', 'wb')
       
   107   >>> for x in range(10000):
       
   108   ...     f.write("%s\n" % str(x))
       
   109   >>> f.close()
   108   $ for j in 0 1 2 3 4 5 6 7 8 9; do
   110   $ for j in 0 1 2 3 4 5 6 7 8 9; do
   109   >   cat data1 >> f2
   111   >   cat data1 >> f2
   110   >   hg commit -m$j
   112   >   hg commit -m$j
   111   > done
   113   > done
   112   $ cd ../..
   114   $ cd ../..
   131   checking files
   133   checking files
   132   2 files, 2 changesets, 2 total revisions
   134   2 files, 2 changesets, 2 total revisions
   133 
   135 
   134   $ cd r3
   136   $ cd r3
   135   $ hg push
   137   $ hg push
   136   pushing to $TESTTMP/r1
   138   pushing to $TESTTMP/r1 (glob)
   137   searching for changes
   139   searching for changes
   138   adding changesets
   140   adding changesets
   139   adding manifests
   141   adding manifests
   140   adding file changes
   142   adding file changes
   141   added 10 changesets with 10 changes to 1 files
   143   added 10 changesets with 10 changes to 1 files