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

10 messages from 2011-01-06 to 2011-01-11. Participants: Ramsay Jones, Eric Wong, Steven Walter, Jonathan Nieder, Junio C Hamano, Anders Kaseorg.
Thread: https://gitlist.dev/t/26219

## Ramsay Jones, 2011-01-06 18:29

Subject: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <4D260A03.90903@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/4D260A03.90903%40ramsay1.demon.co.uk

```

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(-)

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, 2011-01-07 17:31

Subject: Re: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <20110107173114.GA31376@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20110107173114.GA31376%40dcvr.yhbt.net
In-Reply-To: <4D260A03.90903@ramsay1.demon.co.uk>

```
Ramsay Jones <ramsay@ramsay1.demon.co.uk> wrote:
> 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, 2011-01-07 17:44

Subject: Re: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <AANLkTi=VpHtQ+x5hyfCei-=X=ry4X=+TSGg7EKa7zs4j@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTi%3DVpHtQ%2Bx5hyfCei-%3DX%3Dry4X%3D%2BTSGg7EKa7zs4j%40mail.gmail.com
In-Reply-To: <20110107173114.GA31376@dcvr.yhbt.net>

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

```

## Eric Wong, 2011-01-07 18:02

Subject: Re: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <20110107180220.GA20031@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20110107180220.GA20031%40dcvr.yhbt.net
In-Reply-To: <AANLkTi=VpHtQ+x5hyfCei-=X=ry4X=+TSGg7EKa7zs4j@mail.gmail.com>

```
Steven Walter <stevenrwalter@gmail.com> wrote:
> 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(-)

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, 2011-01-07 18:19

Subject: Re: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <20110107181946.GB28980@burratino>
URL: https://gitlist.dev/e/20110107181946.GB28980%40burratino
In-Reply-To: <20110107180220.GA20031@dcvr.yhbt.net>

```
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

```

## Eric Wong, 2011-01-07 18:39

Subject: Re: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <20110107183931.GA5560@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20110107183931.GA5560%40dcvr.yhbt.net
In-Reply-To: <20110107181946.GB28980@burratino>

```
Jonathan Nieder <jrnieder@gmail.com> wrote:
> 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, 2011-01-07 22:22

Subject: Re: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <20110107222232.GA10624@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20110107222232.GA10624%40dcvr.yhbt.net
In-Reply-To: <AANLkTi=VpHtQ+x5hyfCei-=X=ry4X=+TSGg7EKa7zs4j@mail.gmail.com>

```
Steven Walter <stevenrwalter@gmail.com> wrote:
> 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

```

## Junio C Hamano, 2011-01-07 22:32

Subject: Re: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <7vy66w4a64.fsf@alter.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vy66w4a64.fsf%40alter.siamese.dyndns.org
In-Reply-To: <20110107222232.GA10624@dcvr.yhbt.net>

```
Thanks!

```

## Anders Kaseorg, 2011-01-08 09:19

Subject: Re: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <1294478342.2791.4.camel@fixed-disk>
URL: https://gitlist.dev/e/1294478342.2791.4.camel%40fixed-disk
In-Reply-To: <4D260A03.90903@ramsay1.demon.co.uk>

```
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, 2011-01-11 18:21

Subject: Re: [RFC/PATCH] t9157-*.sh: Add an svn version check
Message-ID: <4D2C9FBA.9080306@ramsay1.demon.co.uk>
URL: https://gitlist.dev/e/4D2C9FBA.9080306%40ramsay1.demon.co.uk
In-Reply-To: <1294478342.2791.4.camel@fixed-disk>

```
Anders Kaseorg wrote:
> 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(-)

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

```
