threads / rfc / 26219

RFC patcht9157-*.sh: Add an svn version check

Subject: [RFC/PATCH] t9157-*.sh: Add an svn version check

## tl;dr

10 messages between Jan 6, 2011 and Jan 11, 2011. Diffs are folded; open one to read it.

replies: 9people: 6as markdown or json

Ramsay Jones· Jan 6, 2011, 18:29 UTC · lore
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---

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(-)
Show changes to t/t9157-git-svn-fetch-merge.sh +8 −0
diff --git a/t/t9157-git-svn-fetch-merge.sh b/t/t9157-git-svn-fetch-merge.sh
index da582c5..accf61e 100755
--- a/t/t9157-git-svn-fetch-merge.sh
+++ b/t/t9157-git-svn-fetch-merge.sh
@@ -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 &&
-- 
1.7.3
Eric Wong· Jan 7, 2011, 17:31 UTC · re: Ramsay Jones · lore

Re: [RFC/PATCH] t9157-*.sh: Add an svn version check

Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:
Show 12 quoted lines
> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> ---
> 
> 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 ...

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
Acked-by: Eric Wong <normalperson@yhbt.net>
-- 
Eric Wong
Steven Walter· Jan 7, 2011, 17:44 UTC · re: Eric Wong · lore

Re: [RFC/PATCH] t9157-*.sh: Add an svn version check

On Fri, Jan 7, 2011 at 12:31 PM, Eric Wong <normalperson@yhbt.net> wrote:
Show 5 quoted lines
> Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:
>> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> ---
>
> Consider this
> Acked-by: Eric Wong <normalperson@yhbt.net>
Acked-by: Steven Walter <stevenrwalter@gmail.com>
-- 
-Steven Walter <stevenrwalter@gmail.com>
Eric Wong· Jan 7, 2011, 18:02 UTC · re: Steven Walter · lore

Re: [RFC/PATCH] t9157-*.sh: Add an svn version check

Steven Walter <stevenrwalter@gmail.com> wrote:
Show 8 quoted lines
> On Fri, Jan 7, 2011 at 12:31 PM, Eric Wong <normalperson@yhbt.net> wrote:
> > Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:
> >> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> ---
> >
> > Consider this
> > Acked-by: Eric Wong <normalperson@yhbt.net>
> 
> Acked-by: Steven Walter <stevenrwalter@gmail.com>

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 <stevenrwalter@gmail.com>
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.

Acked-by: Eric Wong <normalperson@yhbt.net>
---
 t/t9157-git-svn-fetch-merge.sh |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)
Show changes to t/t9157-git-svn-fetch-merge.sh +7 −3
diff --git a/t/t9157-git-svn-fetch-merge.sh b/t/t9157-git-svn-fetch-merge.sh
index da582c5..424e1fa 100755
--- a/t/t9157-git-svn-fetch-merge.sh
+++ b/t/t9157-git-svn-fetch-merge.sh
@@ -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"
 	) &&
-- 
Eric Wong
Jonathan Nieder· Jan 7, 2011, 18:19 UTC · re: Eric Wong · lore

Re: [RFC/PATCH] t9157-*.sh: Add an svn version check

Eric Wong wrote:
Show 9 quoted lines
> 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 <stevenrwalter@gmail.com>
> 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
Eric Wong· Jan 7, 2011, 18:39 UTC · re: Jonathan Nieder · lore

Re: [RFC/PATCH] t9157-*.sh: Add an svn version check

Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 15 quoted lines
> Eric Wong wrote:
> 
> > 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 <stevenrwalter@gmail.com>
> > 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.

-- 
Eric Wong
Eric Wong· Jan 7, 2011, 22:22 UTC · re: Steven Walter · lore

Re: [RFC/PATCH] t9157-*.sh: Add an svn version check

Steven Walter <stevenrwalter@gmail.com> wrote:
Show 8 quoted lines
> On Fri, Jan 7, 2011 at 12:31 PM, Eric Wong <normalperson@yhbt.net> wrote:
> > Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:
> >> Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> ---
> >
> > Consider this
> > Acked-by: Eric Wong <normalperson@yhbt.net>
> 
> Acked-by: Steven Walter <stevenrwalter@gmail.com>

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
-- 
Eric Wong
Anders Kaseorg· Jan 8, 2011, 09:19 UTC · re: Ramsay Jones · lore

Re: [RFC/PATCH] t9157-*.sh: Add an svn version check

On Thu, 2011-01-06 at 18:29 +0000, Ramsay Jones wrote:
> +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
Ramsay Jones· Jan 11, 2011, 18:21 UTC · re: Anders Kaseorg · lore

Re: [RFC/PATCH] t9157-*.sh: Add an svn version check

Anders Kaseorg wrote:
Show 9 quoted lines
> On Thu, 2011-01-06 at 18:29 +0000, Ramsay Jones wrote:
>> +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 <ramsay@ramsay1.demon.co.uk>
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 <andersk@MIT.EDU>]
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 t/t9157-git-svn-fetch-merge.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Show changes to t/t9157-git-svn-fetch-merge.sh +1 −1
diff --git a/t/t9157-git-svn-fetch-merge.sh b/t/t9157-git-svn-fetch-merge.sh
index accf61e..991d2aa 100755
--- a/t/t9157-git-svn-fetch-merge.sh
+++ b/t/t9157-git-svn-fetch-merge.sh
@@ -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
 	;;
-- 
1.7.3

← back to recent threads