git-svn init/clone --stdlayout option to default-init trunk/tags/branches
The --stdlayout option to git-svn init/clone 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. [ew: fixed whitespace and added "-s" shortcut] Signed-off-by: martin f. krafft <madduck@madduck.net> Signed-off-by: Eric Wong <normalperson@yhbt.net>
martin f. krafft committed
Jul 14, 2007 at 11:25 UTC
8f728fb96f00860cae58f4f2c5c9c96651e6a626
2 files changed
+15
-3
Documentation/git-svn.txt
+6
-1
@@ -44,10 +44,15 @@ COMMANDS
44
--tags=<tags_subdir>;;
45
-b<branches_subdir>;;
46
--branches=<branches_subdir>;;
47
+-s;;
48
+--stdlayout;;
49
These are optional command-line options for init. Each of
50
these flags can point to a relative repository path
51
(--tags=project/tags') or a full url
50
- (--tags=https://foo.org/project/tags)
52
+ (--tags=https://foo.org/project/tags). The option --stdlayout is
53
+ a shorthand way of setting trunk,tags,branches as the relative paths,
54
+ which is the Subversion default. If any of the other options are given
55
+ as well, they take precedence.
56
--no-metadata;;
57
Set the 'noMetadata' option in the [svn-remote] config.
58
--use-svm-props;;
git-svn.perl
+9
-2
@@ -77,11 +77,12 @@ my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent,
77
\$Git::SVN::_repack_flags,
78
%remote_opts );
79
80
-my ($_trunk, $_tags, $_branches);
80
+my ($_trunk, $_tags, $_branches, $_stdlayout);
81
my %icv;
82
my %init_opts = ( 'template=s' => \$_template, 'shared:s' => \$_shared,
83
'trunk|T=s' => \$_trunk, 'tags|t=s' => \$_tags,
84
'branches|b=s' => \$_branches, 'prefix=s' => \$_prefix,
85
+ 'stdlayout|s' => \$_stdlayout,
86
'minimize-url|m' => \$Git::SVN::_minimize_url,
87
'no-metadata' => sub { $icv{noMetadata} = 1 },
88
'use-svm-props' => sub { $icv{useSvmProps} = 1 },
@@ -292,7 +293,8 @@ sub init_subdir {
293
sub cmd_clone {
294
my ($url, $path) = @_;
295
if (!defined $path &&
295
- (defined $_trunk || defined $_branches || defined $_tags) &&
296
+ (defined $_trunk || defined $_branches || defined $_tags ||
297
+ defined $_stdlayout) &&
298
$url !~ m#^[a-z\+]+://#) {
299
$path = $url;
300
}
@@ -302,6 +304,11 @@ sub cmd_clone {
304
}
305
306
sub cmd_init {
307
+ if (defined $_stdlayout) {
308
+ $_trunk = 'trunk' if (!defined $_trunk);
309
+ $_tags = 'tags' if (!defined $_tags);
310
+ $_branches = 'branches' if (!defined $_branches);
311
+ }
312
if (defined $_trunk || defined $_branches || defined $_tags) {
313
return cmd_multi_init(@_);
314
}