* [PATCH 2/4] git-svn: collect SVK source URL on mirror paths
@ 2006-12-04 9:35 Sam Vilain
2006-12-05 2:39 ` Sam Vilain
0 siblings, 1 reply; 2+ messages in thread
From: Sam Vilain @ 2006-12-04 9:35 UTC (permalink / raw)
To: git
If you use git-svn to import a mirror path within an SVK depot
directly (eg, file:///home/you/.svk/local/mirror/foo), then the URLs
and revisions in the generated commits will be of the wrong URL.
When we set up with git-svn multi-init, check whether the base URL is
(the root of) a mirror path, and store it for later. Set up a couple
of globals and helper functions for later use.
---
git-svn.perl | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 93cfcc4..c5f82be 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -5,6 +5,7 @@ use warnings;
use strict;
use vars qw/ $AUTHOR $VERSION
$SVN_URL $SVN_INFO $SVN_WC $SVN_UUID
+ $SVM_URL $SVM_UUID
$GIT_SVN_INDEX $GIT_SVN
$GIT_DIR $GIT_SVN_DIR $REVDB/;
$AUTHOR = 'Eric Wong <normalperson@yhbt.net>';
@@ -733,6 +734,21 @@ sub multi_init {
init($_trunk);
sys('git-repo-config', 'svn.trunk', $_trunk);
}
+ if ( $url ) {
+ # check for the case of SVK mirror path
+ my ($ents, $props) = libsvn_ls_fullurl($url, "1");
+ if ( my $src = $props->{'svm:source'} ) {
+ $src =~ s{!$}{}; # don't know wtf a ! is there for
+ $src =~ s{(^[a-z\+]*://)[^/@]*@}{$1}; # username of no interest
+
+ # store the source as a repo-config item
+ sys('git-repo-config', 'svn.svkmirrorpath', $src);
+ my $uuid = $props->{'svm:uuid'};
+ $uuid =~ m{^[0-9a-f\-]{41,}}
+ or croak "doesn't look right - svm:uuid is '$uuid'";
+ sys('git-repo-config', 'svn.svkuuid', $uuid);
+ }
+ }
complete_url_ls_init($url, $_branches, '--branches/-b', '');
complete_url_ls_init($url, $_tags, '--tags/-t', 'tags/');
}
@@ -2084,6 +2100,11 @@ sub check_repack {
}
}
+sub get_svm_url {
+ chomp($SVM_URL = `git-repo-config --get svn.svkmirrorpath`);
+ chomp($SVM_UUID = `git-repo-config --get svn.svkuuid`);
+}
+
sub set_commit_env {
my ($log_msg) = @_;
my $author = $log_msg->{author};
--
1.4.4.1.ge918e-dirty
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/4] git-svn: collect SVK source URL on mirror paths
2006-12-04 9:35 [PATCH 2/4] git-svn: collect SVK source URL on mirror paths Sam Vilain
@ 2006-12-05 2:39 ` Sam Vilain
0 siblings, 0 replies; 2+ messages in thread
From: Sam Vilain @ 2006-12-05 2:39 UTC (permalink / raw)
To: git
Sam Vilain wrote:
> + my $uuid = $props->{'svm:uuid'};
> + $uuid =~ m{^[0-9a-f\-]{41,}}
> + or croak "doesn't look right - svm:uuid is '$uuid'";
This joke back-fired. 41 is too long; UUIDs just *look* longer than
SHA1's :). "36" seems a more appropriate value...
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-12-05 2:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-04 9:35 [PATCH 2/4] git-svn: collect SVK source URL on mirror paths Sam Vilain
2006-12-05 2:39 ` Sam Vilain
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).