git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 2/5] Use CVS's -f option if available (ignore user's ~/.cvsrc file)

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Feb 21, 2009, 13:04 UTC
Message-ID
<7d834a5a7542df6bfa8963bb6440cc4b4531ead7.1235220105.git.mhagger@alum.mit.edu>
In-Reply-To
<ee46eff8fc1cb2d0ad3d8dfac2fbe4d79f225e3a.1235220105.git.mhagger@alum.mit.edu>

A user's ~/.cvsrc file can change the basic behavior of CVS commands. Therefore we should ignore it in order to ensure consistent results from the test suite.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
---
 t/lib-cvs.sh         |    3 +++
 t/t9600-cvsimport.sh |   16 ++++++++--------
 2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/t/lib-cvs.sh b/t/lib-cvs.sh
index bfc1c12..6738901 100644
--- a/t/lib-cvs.sh
+++ b/t/lib-cvs.sh
@@ -14,6 +14,9 @@ then
 	exit
 fi
 
+CVS="cvs -f"
+export CVS
+
 cvsps_version=`cvsps -h 2>&1 | sed -ne 's/cvsps version //p'`
 case "$cvsps_version" in
 2.1 | 2.2*)
diff --git a/t/t9600-cvsimport.sh b/t/t9600-cvsimport.sh
index 98077ab..3110a8c 100755
--- a/t/t9600-cvsimport.sh
+++ b/t/t9600-cvsimport.sh
@@ -6,12 +6,12 @@ test_description='git cvsimport basic tests'
 CVSROOT=$(pwd)/cvsroot
 export CVSROOT
 
-test_expect_success 'setup cvsroot' 'cvs init'
+test_expect_success 'setup cvsroot' '$CVS init'
 
 test_expect_success 'setup a cvs module' '
 
 	mkdir "$CVSROOT/module" &&
-	cvs co -d module-cvs module &&
+	$CVS co -d module-cvs module &&
 	cd module-cvs &&
 	cat <<EOF >o_fortuna &&
 O Fortuna
@@ -30,13 +30,13 @@ egestatem,
 potestatem
 dissolvit ut glaciem.
 EOF
-	cvs add o_fortuna &&
+	$CVS add o_fortuna &&
 	cat <<EOF >message &&
 add "O Fortuna" lyrics
 
 These public domain lyrics make an excellent sample text.
 EOF
-	cvs commit -F message &&
+	$CVS commit -F message &&
 	cd ..
 '
 
@@ -74,7 +74,7 @@ translate to English
 
 My Latin is terrible.
 EOF
-	cvs commit -F message &&
+	$CVS commit -F message &&
 	cd ..
 '
 
@@ -92,8 +92,8 @@ test_expect_success 'update cvs module' '
 
 	cd module-cvs &&
 		echo 1 >tick &&
-		cvs add tick &&
-		cvs commit -m 1
+		$CVS add tick &&
+		$CVS commit -m 1
 	cd ..
 
 '
@@ -111,7 +111,7 @@ test_expect_success 'cvsimport.module config works' '
 
 test_expect_success 'import from a CVS working tree' '
 
-	cvs co -d import-from-wt module &&
+	$CVS co -d import-from-wt module &&
 	cd import-from-wt &&
 		git cvsimport -a -z0 &&
 		echo 1 >expect &&
-- 
1.6.1.3
Previous: Michael HaggertyNext: Michael Haggerty
Message 3 of 14 in “Add more tests of cvsimport”
  1. 0/4 Add more tests of cvsimportMichael Haggerty, Feb 21, 2009
  2. 1/5 Start a library for cvsimport-related testsMichael Haggerty, Feb 21, 2009
  3. 2/5 Use CVS's -f option if available (ignore user's ~/.cvsrc file)Michael Haggerty, Feb 21, 2009
  4. 3/5 Test contents of entire cvsimported "master" tree contentsMichael Haggerty, Feb 21, 2009
  5. 4/5 Add some tests of git-cvsimport's handling of vendor branchesMichael Haggerty, Feb 21, 2009
  6. 5/5 Add a test of "git cvsimport"'s handling of tags and branchesMichael Haggerty, Feb 21, 2009
  7. Junio C HamanoFeb 22, 2009
  8. 0/5 Add more tests of cvsimportMichael Haggerty, Feb 23, 2009
  9. 1/5 Start a library for cvsimport-related testsMichael Haggerty, Feb 23, 2009
  10. 2/5 Use CVS's -f option if available (ignore user's ~/.cvsrc file)Michael Haggerty, Feb 23, 2009
  11. 3/5 Test contents of entire cvsimported "master" tree contentsMichael Haggerty, Feb 23, 2009
  12. 4/5 Add some tests of git-cvsimport's handling of vendor branchesMichael Haggerty, Feb 23, 2009
  13. 5/5 Add a test of "git cvsimport"'s handling of tags and branchesMichael Haggerty, Feb 23, 2009
  14. Junio C HamanoFeb 22, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.