git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 4/5] Add git svn proplist.

From
Benoit Sigoure <tsuna@lrde.epita.fr>
Date
Oct 15, 2007, 15:35 UTC
Message-ID
<1192462506-3783-4-git-send-email-tsuna@lrde.epita.fr>
In-Reply-To
<1192462506-3783-3-git-send-email-tsuna@lrde.epita.fr>
	* 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>
---
 git-svn.perl             |   17 +++++++++++++++++
 t/t9101-git-svn-props.sh |   21 +++++++++++++++++++++
 2 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index e58ff38..466fdd3 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -132,6 +132,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
 			} ],
@@ -583,6 +586,20 @@ 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) {
diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh
index 61c8799..3c83127 100755
--- a/t/t9101-git-svn-props.sh
+++ b/t/t9101-git-svn-props.sh
@@ -193,4 +193,25 @@ test_expect_success 'test propget' "
 	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
-- 
1.5.3.4.214.g6f43
Previous: Benoit SigoureNext: Benoit Sigoure
Message 4 of 8 in “Add a generic tree traversal to fetch SVN properties.”
  1. 1/5 Add a generic tree traversal to fetch SVN properties.Benoit Sigoure, Oct 15, 2007
  2. 2/5 Implement git svn create-ignore.Benoit Sigoure, Oct 15, 2007
  3. 3/5 Add git svn propget.Benoit Sigoure, Oct 15, 2007
  4. 4/5 Add git svn proplist.Benoit Sigoure, Oct 15, 2007
  5. 5/5 Simplify the handling of fatal errors.Benoit Sigoure, Oct 15, 2007
  6. Eric WongOct 16, 2007
  7. Benoit SIGOUREOct 16, 2007
  8. Eric WongOct 16, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.