# HG changeset patch # User Benoit Boissinot # Date 1216822485 -7200 # Node ID c016dc1a8e91e465b84ccccca9bbbcea8d99de17 # Parent cbdfd08eabc96116d801d0e2e7d1856adfdde911# Parent 08d9e0f974d9476ee0a0628f4db28d74574cbe06 merge with -stable diff -r cbdfd08eabc9 -r c016dc1a8e91 mercurial/util.py --- a/mercurial/util.py Tue Jul 22 13:03:31 2008 -0500 +++ b/mercurial/util.py Wed Jul 23 16:14:45 2008 +0200 @@ -1500,7 +1500,7 @@ mode += "b" # for that other OS nlink = -1 - if mode[0] != "r": + if mode not in ("r", "rb"): try: nlink = nlinks(f) except OSError: diff -r cbdfd08eabc9 -r c016dc1a8e91 tests/test-hardlinks-safety --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hardlinks-safety Wed Jul 23 16:14:45 2008 +0200 @@ -0,0 +1,62 @@ +#!/bin/sh + +# test mq hardlinking +echo "[extensions]" >> $HGRCPATH +echo "mq=" >> $HGRCPATH + +echo % init +hg init a +cd a + +hg qimport -n foo - << EOF +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 + +hg qpush + +cd .. +cp -al a b +cd b + +hg qimport -n bar - << EOF +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 + +hg qpush + +cat .hg/patches/status +echo % +cat .hg/patches/series +echo %%% +cat ../a/.hg/patches/status +echo % +cat ../a/.hg/patches/series + +# test tags hardlinking +hg qdel -r qbase:qtip + +hg tag -l lfoo +hg tag foo + +cd .. +cp -al b c +cd c + +hg tag -l -r 0 lbar +hg tag -r 0 bar +echo %%% +cat .hgtags +echo % +cat .hg/localtags +echo %%% +cat ../b/.hgtags +echo % +cat ../b/.hg/localtags diff -r cbdfd08eabc9 -r c016dc1a8e91 tests/test-hardlinks-safety.out --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-hardlinks-safety.out Wed Jul 23 16:14:45 2008 +0200 @@ -0,0 +1,26 @@ +% init +adding foo to series file +applying foo +Now at: foo +adding bar to series file +applying bar +Now at: bar +9373c9d7b61ff62edc4685b85115a54aa92cd6fa:foo +6dd08b80614ae7ed7f9224fb089e90deb999ae76:bar +% +foo +bar +%%% +9373c9d7b61ff62edc4685b85115a54aa92cd6fa:foo +% +foo +%%% +6dd08b80614ae7ed7f9224fb089e90deb999ae76 foo +9373c9d7b61ff62edc4685b85115a54aa92cd6fa bar +% +6dd08b80614ae7ed7f9224fb089e90deb999ae76 lfoo +9373c9d7b61ff62edc4685b85115a54aa92cd6fa lbar +%%% +6dd08b80614ae7ed7f9224fb089e90deb999ae76 foo +% +6dd08b80614ae7ed7f9224fb089e90deb999ae76 lfoo