git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Michael Haggerty <mhagger@alum.mit.edu>
Cc: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Git Mailing List" <git@vger.kernel.org>,
	"Martin Langhoff" <martin@catalyst.net.nz>
Subject: Re: [BUG RFC/PATCH] git-cvsimport
Date: Mon, 16 Aug 2010 09:25:01 -0700	[thread overview]
Message-ID: <7vpqxicyoy.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4C68BD66.9060506@alum.mit.edu> (Michael Haggerty's message of "Mon\, 16 Aug 2010 06\:24\:06 +0200")

Michael Haggerty <mhagger@alum.mit.edu> writes:

> My guess is that cvsps is using CVS commands to access the test CVS
> repository, and that CVS wants to write to the file CVSROOT/history to
> log what is being done.  The logging behavior can be turned off either:
> ...
> Apparently -R and "$CVSREADONLYFS" were added in CVS 1.12.1, which was
> released in 2003.

That unfortunately does not solve much.  t9602 seems to want to create a
new CVSROOT/val-tags file, so if Ævar wants to keep the source tree
read-only, the test CVS repository needs to be copied to a scratch place.

Perhaps something like this?  I actually have to wonder why cvsIMPORT
needs to write into anywhere, though.

-- >8 --
Subject: cvs tests: do not touch test CVS repositories shipped with source

Some tests in t96xx series (cvsimport) want to write into the control area
(CVSROOT) of their test CVS repositories, but this does not work well when
the source area is made read-only (test trash directories are moved via
--root=else/where option).

Copy the supplied test CVS repository to a scratch place at the beginning
of these tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/Makefile                         |    1 -
 t/lib-cvs.sh                       |    6 ++++++
 t/t9601-cvsimport-vendor-branch.sh |    3 +--
 t/t9602-cvsimport-branches-tags.sh |    3 +--
 t/t9603-cvsimport-patchsets.sh     |    3 +--
 5 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/t/Makefile b/t/Makefile
index cf5f9e2..876d2ca 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -28,7 +28,6 @@ pre-clean:
 
 clean:
 	$(RM) -r 'trash directory'.* test-results
-	$(RM) t????/cvsroot/CVSROOT/?*
 	$(RM) -r valgrind/bin
 
 aggregate-results-and-cleanup: $(T)
diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index 648d161..b51d2e1 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -30,6 +30,12 @@ case "$cvsps_version" in
 	;;
 esac
 
+setup_cvs_test_repository () {
+	CVSROOT="$(pwd)/.cvsroot" &&
+	cp -r "$TEST_DIRECTORY/$1/cvsroot" "$CVSROOT" &&
+	export CVSROOT
+}
+
 test_cvs_co () {
 	# Usage: test_cvs_co BRANCH_NAME
 	rm -rf module-cvs-"$1"
diff --git a/t/t9601-cvsimport-vendor-branch.sh b/t/t9601-cvsimport-vendor-branch.sh
index 3afaf56..b23479f 100755
--- a/t/t9601-cvsimport-vendor-branch.sh
+++ b/t/t9601-cvsimport-vendor-branch.sh
@@ -34,8 +34,7 @@
 test_description='git cvsimport handling of vendor branches'
 . ./lib-cvs.sh
 
-CVSROOT="$TEST_DIRECTORY"/t9601/cvsroot
-export CVSROOT
+setup_cvs_test_repository t9601
 
 test_expect_success 'import a module with a vendor branch' '
 
diff --git a/t/t9602-cvsimport-branches-tags.sh b/t/t9602-cvsimport-branches-tags.sh
index 67878b2..ed01d8a 100755
--- a/t/t9602-cvsimport-branches-tags.sh
+++ b/t/t9602-cvsimport-branches-tags.sh
@@ -6,8 +6,7 @@
 test_description='git cvsimport handling of branches and tags'
 . ./lib-cvs.sh
 
-CVSROOT="$TEST_DIRECTORY"/t9602/cvsroot
-export CVSROOT
+setup_cvs_test_repository t9602
 
 test_expect_success 'import module' '
 
diff --git a/t/t9603-cvsimport-patchsets.sh b/t/t9603-cvsimport-patchsets.sh
index 958bdce..93c4fa8 100755
--- a/t/t9603-cvsimport-patchsets.sh
+++ b/t/t9603-cvsimport-patchsets.sh
@@ -14,8 +14,7 @@
 test_description='git cvsimport testing for correct patchset estimation'
 . ./lib-cvs.sh
 
-CVSROOT="$TEST_DIRECTORY"/t9603/cvsroot
-export CVSROOT
+setup_cvs_test_repository t9603
 
 test_expect_failure 'import with criss cross times on revisions' '
 

  reply	other threads:[~2010-08-16 16:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-14 15:33 [BUG RFC/PATCH] git-cvsimport Ævar Arnfjörð Bjarmason
2010-08-14 21:09 ` Jonathan Nieder
2010-08-14 21:39   ` Ævar Arnfjörð Bjarmason
2010-08-16  4:24 ` Michael Haggerty
2010-08-16 16:25   ` Junio C Hamano [this message]
2010-08-16 17:43     ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vpqxicyoy.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=martin@catalyst.net.nz \
    --cc=mhagger@alum.mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).