From 5f537c75774c5c0b45b74585ace4178738f251f0 Mon Sep 17 00:00:00 2001 From: martin f. krafft Date: Fri, 13 Jul 2007 11:09:46 +0200 Subject: [PATCH] Provide --stdlayout option for git-svn to set trunk,tags,branches to defaults The --stdlayout option to git-svn init initialises the default Subversion values of trunk,tags,branches: -T trunk -b branches -t tags. If any of the -T/-t/-b options are given in addition, they are given preference. Signed-off-by: martin f. krafft --- Documentation/git-svn.txt | 6 +++++- git-svn.perl | 8 +++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Documentation/git-svn.txt b/Documentation/git-svn.txt index 0a210e4..9e74b27 100644 --- a/Documentation/git-svn.txt +++ b/Documentation/git-svn.txt @@ -44,10 +44,14 @@ COMMANDS --tags=;; -b;; --branches=;; +--stdlayout;; These are optional command-line options for init. Each of these flags can point to a relative repository path (--tags=project/tags') or a full url - (--tags=https://foo.org/project/tags) + (--tags=https://foo.org/project/tags). The option --stdlayout is + a shorthand way of setting trunk,tags,branches as the relative paths, + which is the Subversion default. If any of the other options are given + as well, they take precedence. --no-metadata;; Set the 'noMetadata' option in the [svn-remote] config. --use-svm-props;; diff --git a/git-svn.perl b/git-svn.perl index b3dffcc..5b443ee 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -77,11 +77,12 @@ my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent, \$Git::SVN::_repack_flags, %remote_opts ); -my ($_trunk, $_tags, $_branches); +my ($_trunk, $_tags, $_branches, $_stdlayout); my %icv; my %init_opts = ( 'template=s' => \$_template, 'shared:s' => \$_shared, 'trunk|T=s' => \$_trunk, 'tags|t=s' => \$_tags, 'branches|b=s' => \$_branches, 'prefix=s' => \$_prefix, + 'stdlayout' => \$_stdlayout, 'minimize-url|m' => \$Git::SVN::_minimize_url, 'no-metadata' => sub { $icv{noMetadata} = 1 }, 'use-svm-props' => sub { $icv{useSvmProps} = 1 }, @@ -296,6 +297,11 @@ sub cmd_clone { $url !~ m#^[a-z\+]+://#) { $path = $url; } + if (defined $_stdlayout) { + $_trunk = 'trunk' if (!defined $_trunk); + $_tags = 'tags' if (!defined $_tags); + $_branches = 'branches' if (!defined $_branches); + } $path = basename($url) if !defined $path || !length $path; cmd_init($url, $path); Git::SVN::fetch_all($Git::SVN::default_repo_id); -- 1.5.3.rc1.7.gcae4