diff options
author | Benoit Sigoure <tsuna@lrde.epita.fr> | 2007-10-16 16:36:51 +0200 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-10-17 02:47:37 -0400 |
commit | 51e057cf808eb1c277da08f42d0ccd611ea315cc (patch) | |
tree | 78dcb4c66baeede1cef1900eddb8a22ce753b93d /git-svn.perl | |
parent | 151534515682695348a8172f399f4bf025154a5f (diff) | |
download | git-51e057cf808eb1c277da08f42d0ccd611ea315cc.tar.gz |
git-svn: add git svn proplist
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>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-x | git-svn.perl | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl index e97eba21fd..22fca59469 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -135,6 +135,9 @@ my %cmd = ( '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 } ], @@ -536,7 +539,7 @@ sub cmd_create_ignore { # 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'); @@ -583,6 +586,19 @@ sub cmd_propget { 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) { |