Skip to contentSkip to conversation

t9157-*.sh: Add an svn version check

RFC/PATCH Ramsay Jones 6 participants 10 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

---

This test fails for me, because my svn version(s) are too old (1.4.3 and 1.4.6), and so I've got into the habit of running the tests with NO_SVN_TESTS=1. (which is a bit of a shame in terms of test coverage, but it is *much* quicker!)

I don't know the details, but it seems that the 'svn merge' of this vintage does not support the operations required by this test. Unfortunately, I don't know what the minimum required version of svn is, so I'm hoping that someone can take this patch and fix it up properly ...

ATB,
Ramsay Jones

 t/t9157-git-svn-fetch-merge.sh |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
t/t9157-git-svn-fetch-merge.sh +8 -0
index da582c5..accf61e 100755
@@ -6,6 +6,14 @@
 test_description='git svn merge detection'
 . ./lib-git-svn.sh
 
+svn_ver="$(svn --version --quiet)"
+case $svn_ver in
+[0-1].[0-4].[0-6])
+	skip_all="skipping git-svn test - SVN too old ($svn_ver)"
+	test_done
+	;;
+esac
+
 test_expect_success 'initialize source svn repo' '
 	svn_cmd mkdir -m x "$svnrepo"/trunk &&
 	svn_cmd mkdir -m x "$svnrepo"/branches &&
Signature · 1 line
1.7.3
#1 lore raw

t/t9157-git-svn-fetch-merge.sh line 11

Quoted 3 lines · Ramsay Jones
t/t9157-git-svn-fetch-merge.sh +3 -0
+svn_ver="$(svn --version --quiet)"
+case $svn_ver in
+[0-1].[0-4].[0-6])

Thanks for the patch. Can I suggest the more precise

0.* | 1.[0-4].*)

Anders

#2 lore raw
Quoted 9 lines · Anders Kaseorg

Review

Quoted 3 lines · Ramsay Jones
(quoted diff) +3 -0
+svn_ver="$(svn --version --quiet)"
+case $svn_ver in
+[0-1].[0-4].[0-6])

Thanks for the patch. Can I suggest the more precise

0.* | 1.[0-4].*)

Heh, yeah that would be more accurate! Thanks. ;-)

Junio, I've attached a fix-up patch below...

ATB,
Ramsay Jones

--- >8 ---
From: Ramsay Jones <[email protected]>
Date: Mon, 10 Jan 2011 23:21:26 +0000
Subject: [PATCH] t9157-*.sh: Make the svn version check more precise

These tests require an svn version 1.5 or newer to run correctly. In particular, all 1.4.x versions and earlier are too old, so fix up the case label regex to cover this range exactly.

[Fix provided by Anders Kaseorg <[email protected]>]

---
 t/t9157-git-svn-fetch-merge.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
t/t9157-git-svn-fetch-merge.sh +1 -1
index accf61e..991d2aa 100755
@@ -8,7 +8,7 @@ test_description='git svn merge detection'
 
 svn_ver="$(svn --version --quiet)"
 case $svn_ver in
-[0-1].[0-4].[0-6])
+0.* | 1.[0-4].*)
 	skip_all="skipping git-svn test - SVN too old ($svn_ver)"
 	test_done
 	;;
Signature · 1 line
1.7.3
Acked-by
#3 lore raw
In reply to Ramsay Jones
Quoted 7 lines · Ramsay Jones

This test fails for me, because my svn version(s) are too old (1.4.3 and 1.4.6), and so I've got into the habit of running the tests with NO_SVN_TESTS=1. (which is a bit of a shame in terms of test coverage, but it is *much* quicker!)

Quoted 5 lines

I don't know the details, but it seems that the 'svn merge' of this vintage does not support the operations required by this test. Unfortunately, I don't know what the minimum required version of svn is, so I'm hoping that someone can take this patch and fix it up properly ...

I'm fine taking this patch as-is or even making it just apply to all 1.4.x versions. 1.5+ has been out for ages now and eventually the rest of the world will just upgrade.

Consider this

Signature · 1 line
Eric Wong
Acked-by
#5 lore raw
Quoted 8 lines · Steven Walter
Quoted 5 lines · Eric Wong
Quoted 1 line · Ramsay Jones

Consider this

Wait, looking through my backlog, this could fix the problem Ramsay was having but was lost in the shuffle (my fault) :x

Ramsay: does this fix it?

Quoted 1 line

From 9a4f35d6ff9a66b7b5e57c7124a7cd6df0adad7b Mon Sep 17 00:00:00 2001

From: Steven Walter <[email protected]>
Date: Fri, 22 Oct 2010 21:55:58 -0400
Subject: [PATCH] t9157-git-svn-fetch-merge.sh: remove dependency on subversion 1.5

Specify a revision range to "merge" and manually set the svn:mergeinfo property.

---
 t/t9157-git-svn-fetch-merge.sh |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
t/t9157-git-svn-fetch-merge.sh +7 -3
index da582c5..424e1fa 100755
@@ -25,15 +25,19 @@ test_expect_success 'initialize source svn repo' '
 		svn add baz &&
 		svn commit -m x &&
 		svn switch "$svnrepo"/trunk &&
-		svn merge "$svnrepo"/branches/branch1 &&
+		svn merge -r3:7 "$svnrepo"/branches/branch1 &&
+		svn propset svn:mergeinfo "/branches/branch1:4-7" . &&
 		svn commit -m "merge" &&
 		svn switch "$svnrepo"/branches/branch1 &&
 		svn commit -m x &&
 		svn switch "$svnrepo"/branches/branch2 &&
-		svn merge "$svnrepo"/branches/branch1 &&
+		svn merge -r3:8 "$svnrepo"/branches/branch1 &&
+		svn propset svn:mergeinfo "/branches/branch1:4-8" . &&
 		svn commit -m "merge branch1" &&
 		svn switch "$svnrepo"/trunk &&
-		svn merge "$svnrepo"/branches/branch2 &&
+		svn merge -r5:9 "$svnrepo"/branches/branch2 &&
+		svn propset svn:mergeinfo "/branches/branch1:4-8
+/branches/branch2:6-9" . &&
 		svn resolved baz &&
 		svn commit -m "merge branch2"
 	) &&
Signature · 1 line
Eric Wong
#6 lore raw
Quoted 9 lines · Eric Wong

Wait, looking through my backlog, this could fix the problem Ramsay was having but was lost in the shuffle (my fault) :x

Ramsay: does this fix it?

From 9a4f35d6ff9a66b7b5e57c7124a7cd6df0adad7b Mon Sep 17 00:00:00 2001
From: Steven Walter <[email protected]>
Date: Fri, 22 Oct 2010 21:55:58 -0400
Subject: [PATCH] t9157-git-svn-fetch-merge.sh: remove dependency on subversion 1.5

Context, for reference:

http://thread.gmane.org/gmane.linux.kernel/1052314/focus=161717

#7 lore raw
Quoted 7 lines · Jonathan Nieder
Quoted 5 lines · Eric Wong

Wait, looking through my backlog, this could fix the problem Ramsay was having but was lost in the shuffle (my fault) :x

Ramsay: does this fix it?

Quoted 8 lines
Quoted 4 lines

From 9a4f35d6ff9a66b7b5e57c7124a7cd6df0adad7b Mon Sep 17 00:00:00 2001
From: Steven Walter <[email protected]>
Date: Fri, 22 Oct 2010 21:55:58 -0400
Subject: [PATCH] t9157-git-svn-fetch-merge.sh: remove dependency on subversion 1.5

Context, for reference:

http://thread.gmane.org/gmane.linux.kernel/1052314/focus=161717

Ah thanks, I completely forgot about that, too :x I'll take Ramsay's patch.

Signature · 1 line
Eric Wong
#8 lore raw
In reply to Steven Walter
Quoted 8 lines · Steven Walter
Quoted 5 lines · Eric Wong
Quoted 1 line · Ramsay Jones

Consider this

I've pushed out Ramsay's patch along with a small manpage fix that was mailed to me privately to git://git.bogomips.org/git-svn.git

Ramsay Allan Jones (1):
t9157-*.sh: Add an svn version check

StephenB (1):
git svn: fix the final example in man page

Signature · 1 line
Eric Wong