Skip to contentSkip to conversation

Use a relative path for SVN importing

PATCH In review Christian Biesinger 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Use a relative path for SVN importing

The absolute path (with the leading slash) breaks SVN importing, because it then looks for /trunk/... instead of /svn/trunk/... (in my case, the repository URL was https://servername/svn/)

---

 git-svnimport.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

7718b5a5fec01c0774f6b9cdc84f908e68b403ac

git-svnimport.perl +1 -1
index b6799d8..f17d5a2 100755
@@ -318,7 +318,7 @@ sub get_file($$$) {
 			die $res->status_line." at $url\n";
 		}
 	} else {
-		$name = $svn->file("/$svnpath",$rev);
+		$name = $svn->file("$svnpath",$rev);
 		return undef unless defined $name;
 	}
 
Signature · 1 line
1.1.6.g486a-dirty
#1 lore raw
Quoted 3 lines · Christian Biesinger

The absolute path (with the leading slash) breaks SVN importing, because it then looks for /trunk/... instead of /svn/trunk/... (in my case, the repository URL was https://servername/svn/)

I also tested a svn+ssh case and that works too (it also worked before, oddly enough).

#2 lore raw

git-svnimport -d and -D options (was Re: [PATCH] Use a relative path for SVN importing)

In reply to Christian Biesinger

Hi,

Quoted 3 lines · Christian Biesinger

The absolute path (with the leading slash) breaks SVN importing, because it then looks for /trunk/... instead of /svn/trunk/... (in my case, the repository URL was https://servername/svn/)

I've hit this bug today, and fortunately I've found the fix from Christian. Thanks! :)

I am wondering if this bug was the initial reason why the -d and -D options where added to git-svnimport.

Is there another real reason why the -d and -D options exist in git-svnimport?

The documentation for the options say that the "wrong" option will die with 40x, but the commit message[1] says something about "internal server error". I don't know which one is right.

Mathias, couldn't be the errors you described in the commit message related to this bug?

[1] http://www.kernel.org/git/?p=git/git.git;a=commit;h=25f6f325d7a8f7cb686a9ffd9fa2c00b3aa85a60

Signature · 1 line
Eduardo