summaryrefslogtreecommitdiff
path: root/tests/test-hardlinks.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-hardlinks.t')
-rw-r--r--tests/test-hardlinks.t28
1 files changed, 4 insertions, 24 deletions
diff --git a/tests/test-hardlinks.t b/tests/test-hardlinks.t
index 65978e1..5f00a61 100644
--- a/tests/test-hardlinks.t
+++ b/tests/test-hardlinks.t
@@ -1,11 +1,8 @@
- $ "$TESTDIR/hghave" hardlink || exit 80
-
$ cat > nlinks.py <<EOF
- > import sys
- > from mercurial import util
+ > import os, sys
> for f in sorted(sys.stdin.readlines()):
> f = f[:-1]
- > print util.nlinks(f), f
+ > print os.lstat(f).st_nlink, f
> EOF
$ nlinksdir()
@@ -48,16 +45,13 @@ Prepare repo r1:
1 r1/.hg/store/data/d1/f2.i
1 r1/.hg/store/data/f1.i
1 r1/.hg/store/fncache
- 1 r1/.hg/store/phaseroots
1 r1/.hg/store/undo
- 1 r1/.hg/store/undo.phaseroots
Create hardlinked clone r2:
$ hg clone -U --debug r1 r2
linked 7 files
- listing keys for "bookmarks"
Create non-hardlinked clone r3:
@@ -79,9 +73,7 @@ Repos r1 and r2 should now contain hardlinked files:
2 r1/.hg/store/data/d1/f2.i
2 r1/.hg/store/data/f1.i
2 r1/.hg/store/fncache
- 1 r1/.hg/store/phaseroots
1 r1/.hg/store/undo
- 1 r1/.hg/store/undo.phaseroots
$ nlinksdir r2/.hg/store
2 r2/.hg/store/00changelog.i
@@ -98,18 +90,13 @@ Repo r3 should not be hardlinked:
1 r3/.hg/store/data/d1/f2.i
1 r3/.hg/store/data/f1.i
1 r3/.hg/store/fncache
- 1 r3/.hg/store/phaseroots
1 r3/.hg/store/undo
- 1 r3/.hg/store/undo.phaseroots
Create a non-inlined filelog in r3:
$ cd r3/d1
- >>> f = open('data1', 'wb')
- >>> for x in range(10000):
- ... f.write("%s\n" % str(x))
- >>> f.close()
+ $ python -c 'for x in range(10000): print x' >> data1
$ for j in 0 1 2 3 4 5 6 7 8 9; do
> cat data1 >> f2
> hg commit -m$j
@@ -123,9 +110,7 @@ Create a non-inlined filelog in r3:
1 r3/.hg/store/data/d1/f2.i
1 r3/.hg/store/data/f1.i
1 r3/.hg/store/fncache
- 1 r3/.hg/store/phaseroots
1 r3/.hg/store/undo
- 1 r3/.hg/store/undo.phaseroots
Push to repo r1 should break up most hardlinks in r2:
@@ -138,7 +123,7 @@ Push to repo r1 should break up most hardlinks in r2:
$ cd r3
$ hg push
- pushing to $TESTTMP/r1 (glob)
+ pushing to $TESTTMP/r1
searching for changes
adding changesets
adding manifests
@@ -208,9 +193,7 @@ r4 has hardlinks in the working dir (not just inside .hg):
2 r4/.hg/store/data/d1/f2.i
2 r4/.hg/store/data/f1.i
2 r4/.hg/store/fncache
- 2 r4/.hg/store/phaseroots
2 r4/.hg/store/undo
- 2 r4/.hg/store/undo.phaseroots
2 r4/.hg/undo.bookmarks
2 r4/.hg/undo.branch
2 r4/.hg/undo.desc
@@ -239,9 +222,7 @@ Update back to revision 11 in r4 should break hardlink of file f1:
2 r4/.hg/store/data/d1/f2.i
2 r4/.hg/store/data/f1.i
2 r4/.hg/store/fncache
- 2 r4/.hg/store/phaseroots
2 r4/.hg/store/undo
- 2 r4/.hg/store/undo.phaseroots
2 r4/.hg/undo.bookmarks
2 r4/.hg/undo.branch
2 r4/.hg/undo.desc
@@ -349,4 +330,3 @@ Test tags hardlinking:
$ cat ../b/.hg/localtags
4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo
- $ cd ..