summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1515345)
raw | patch | inline | side by side (parent: 1515345)
author | Benoit Sigoure <tsuna@lrde.epita.fr> | |
Tue, 16 Oct 2007 14:36:51 +0000 (16:36 +0200) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 17 Oct 2007 06:47:37 +0000 (02:47 -0400) |
This allows one to easily retrieve a list of svn properties from within
git-svn without requiring svn or knowing the URL of a repository.
* git-svn.perl (%cmd): Add the command `proplist'.
(&cmd_proplist): New.
* t/t9101-git-svn-props.sh: Test git svn proplist.
Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-svn without requiring svn or knowing the URL of a repository.
* git-svn.perl (%cmd): Add the command `proplist'.
(&cmd_proplist): New.
* t/t9101-git-svn-props.sh: Test git svn proplist.
Signed-off-by: Benoit Sigoure <tsuna@lrde.epita.fr>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-svn.perl | patch | blob | history | |
t/t9101-git-svn-props.sh | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index e97eba21fda31a64a3a6a4009a2d875e8cfd7aaf..22fca59469dcc38d89c2721ecf7194efb03bdc58 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
'propget' => [ \&cmd_propget,
'Print the value of a property on a file or directory',
{ 'revision|r=i' => \$_revision } ],
+ 'proplist' => [ \&cmd_proplist,
+ 'List all properties of a file or directory',
+ { 'revision|r=i' => \$_revision } ],
'show-ignore' => [ \&cmd_show_ignore, "Show svn:ignore listings",
{ 'revision|r=i' => \$_revision
} ],
# get_svnprops(PATH)
# ------------------
-# Helper for cmd_propget below.
+# Helper for cmd_propget and cmd_proplist below.
sub get_svnprops {
my $path = shift;
my ($url, $rev, $uuid, $gs) = working_head_info('HEAD');
print $props->{$prop} . "\n";
}
+# cmd_proplist (PATH)
+# -------------------
+# Print the list of SVN properties for PATH.
+sub cmd_proplist {
+ my $path = shift;
+ $path = '.' if not defined $path;
+ my $props = get_svnprops($path);
+ print "Properties on '$path':\n";
+ foreach (sort keys %{$props}) {
+ print " $_\n";
+ }
+}
+
sub cmd_multi_init {
my $url = shift;
unless (defined $_trunk || defined $_branches || defined $_tags) {
index 61c879959ca50d44e55a9b82519b1c45825e700b..3c83127a0e862dd89837755103a97ed967c80e0b 100755 (executable)
--- a/t/t9101-git-svn-props.sh
+++ b/t/t9101-git-svn-props.sh
git-svn propget svn:ignore .././deeply/nested | cmp - ../prop.expect
"
+cat >prop.expect <<\EOF
+Properties on '.':
+ svn:entry:committed-date
+ svn:entry:committed-rev
+ svn:entry:last-author
+ svn:entry:uuid
+ svn:ignore
+EOF
+cat >prop2.expect <<\EOF
+Properties on 'nested/directory/.keep':
+ svn:entry:committed-date
+ svn:entry:committed-rev
+ svn:entry:last-author
+ svn:entry:uuid
+EOF
+
+test_expect_success 'test proplist' "
+ git-svn proplist . | cmp - prop.expect &&
+ git-svn proplist nested/directory/.keep | cmp - prop2.expect
+ "
+
test_done