# HG changeset patch # User Adrian Buehlmann # Date 1290443571 -3600 # Node ID 8cb33163b391ccb0d509388180e4ef3123189dd9 # Parent 026053f691a49bf46f1dad8e1a34c08225a429f8 tests: integrate test-hardlinks-safety.t into test-hardlinks.t Should make running the testsuite a bit faster. Also, test-hardlinks.t and test-hardlinks-safety.t now have enough infrastructure in common. diff -r 026053f691a4 -r 8cb33163b391 tests/test-hardlinks-safety.t --- a/tests/test-hardlinks-safety.t Wed Nov 17 21:18:44 2010 -0500 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,106 +0,0 @@ -some implementations of cp can't create hardlinks - - $ cat > cp.py < from mercurial import util - > import sys - > util.copyfiles(sys.argv[1], sys.argv[2], hardlink=True) - > EOF - -Test hardlinking outside hg: - - $ mkdir x - $ echo foo > x/a - - $ python cp.py x y - $ echo bar >> y/a - -No diff if hardlink: - - $ diff x/a y/a - -Test mq hardlinking: - - $ echo "[extensions]" >> $HGRCPATH - $ echo "mq=" >> $HGRCPATH - - $ hg init a - $ cd a - - $ hg qimport -n foo - << EOF - > # HG changeset patch - > # Date 1 0 - > diff -r 2588a8b53d66 a - > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 - > +++ b/a Wed Jul 23 15:54:29 2008 +0200 - > @@ -0,0 +1,1 @@ - > +a - > EOF - adding foo to series file - - $ hg qpush - applying foo - now at: foo - - $ cd .. - $ python cp.py a b - $ cd b - - $ hg qimport -n bar - << EOF - > # HG changeset patch - > # Date 2 0 - > diff -r 2588a8b53d66 a - > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 - > +++ b/b Wed Jul 23 15:54:29 2008 +0200 - > @@ -0,0 +1,1 @@ - > +b - > EOF - adding bar to series file - - $ hg qpush - applying bar - now at: bar - - $ cat .hg/patches/status - 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo - 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar - - $ cat .hg/patches/series - foo - bar - - $ cat ../a/.hg/patches/status - 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo - - $ cat ../a/.hg/patches/series - foo - -Test tags hardlinking: - - $ hg qdel -r qbase:qtip - patch foo finalized without changeset message - patch bar finalized without changeset message - - $ hg tag -l lfoo - $ hg tag foo - - $ cd .. - $ python cp.py b c - $ cd c - - $ hg tag -l -r 0 lbar - $ hg tag -r 0 bar - - $ cat .hgtags - 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo - 430ed4828a74fa4047bc816a25500f7472ab4bfe bar - - $ cat .hg/localtags - 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo - 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar - - $ cat ../b/.hgtags - 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo - - $ cat ../b/.hg/localtags - 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo - diff -r 026053f691a4 -r 8cb33163b391 tests/test-hardlinks.t --- a/tests/test-hardlinks.t Wed Nov 17 21:18:44 2010 -0500 +++ b/tests/test-hardlinks.t Mon Nov 22 17:32:51 2010 +0100 @@ -230,3 +230,102 @@ 2 r4/d1/f2 1 r4/f1 + +Test hardlinking outside hg: + + $ mkdir x + $ echo foo > x/a + + $ linkcp x y + $ echo bar >> y/a + +No diff if hardlink: + + $ diff x/a y/a + +Test mq hardlinking: + + $ echo "[extensions]" >> $HGRCPATH + $ echo "mq=" >> $HGRCPATH + + $ hg init a + $ cd a + + $ hg qimport -n foo - << EOF + > # HG changeset patch + > # Date 1 0 + > diff -r 2588a8b53d66 a + > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + > +++ b/a Wed Jul 23 15:54:29 2008 +0200 + > @@ -0,0 +1,1 @@ + > +a + > EOF + adding foo to series file + + $ hg qpush + applying foo + now at: foo + + $ cd .. + $ linkcp a b + $ cd b + + $ hg qimport -n bar - << EOF + > # HG changeset patch + > # Date 2 0 + > diff -r 2588a8b53d66 a + > --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + > +++ b/b Wed Jul 23 15:54:29 2008 +0200 + > @@ -0,0 +1,1 @@ + > +b + > EOF + adding bar to series file + + $ hg qpush + applying bar + now at: bar + + $ cat .hg/patches/status + 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo + 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c:bar + + $ cat .hg/patches/series + foo + bar + + $ cat ../a/.hg/patches/status + 430ed4828a74fa4047bc816a25500f7472ab4bfe:foo + + $ cat ../a/.hg/patches/series + foo + +Test tags hardlinking: + + $ hg qdel -r qbase:qtip + patch foo finalized without changeset message + patch bar finalized without changeset message + + $ hg tag -l lfoo + $ hg tag foo + + $ cd .. + $ linkcp b c + $ cd c + + $ hg tag -l -r 0 lbar + $ hg tag -r 0 bar + + $ cat .hgtags + 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo + 430ed4828a74fa4047bc816a25500f7472ab4bfe bar + + $ cat .hg/localtags + 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo + 430ed4828a74fa4047bc816a25500f7472ab4bfe lbar + + $ cat ../b/.hgtags + 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c foo + + $ cat ../b/.hg/localtags + 4e7abb4840c46a910f6d7b4d3c3fc7e5209e684c lfoo +