[Bps-public-commit] r10907 - SVN-PropDB/lib/SVN/PropDB

jesse at bestpractical.com jesse at bestpractical.com
Thu Feb 21 00:51:10 EST 2008


Author: jesse
Date: Thu Feb 21 00:51:10 2008
New Revision: 10907

Modified:
   SVN-PropDB/lib/SVN/PropDB/Record.pm

Log:
setting multiple props at once

Modified: SVN-PropDB/lib/SVN/PropDB/Record.pm
==============================================================================
--- SVN-PropDB/lib/SVN/PropDB/Record.pm	(original)
+++ SVN-PropDB/lib/SVN/PropDB/Record.pm	Thu Feb 21 00:51:10 2008
@@ -44,15 +44,25 @@
 
 sub set_prop {
     my $self = shift;
-    my %args = validate(@_, { name => 1, value => 1});
 
+    my %args = validate(@_, { name => 1, value => 1});
     my $props = { $args{'name'} => $args{'value'}};
+    $self->set_props(props => $props);
+}
+
+
+sub set_props {
+    my $self = shift;
+    my %args = validate(@_, { props => 1});
 
-    $self->_canonicalize_props($props);
-    $self->_validate_props($props) || return undef;
-    $self->handle->set_node_props(type => $self->type, uuid => $self->uuid, props => $props );
+    $self->_canonicalize_props($args{'props'});
+    $self->_validate_props($args{'props'}) || return undef;
+    $self->handle->set_node_props(type => $self->type, uuid => $self->uuid, props => $args{'props'} );
 }
 
+
+
+
 sub get_props {
     my $self = shift;
     return $self->handle->get_node_props(uuid => $self->uuid, type => $self->type);
@@ -102,5 +112,9 @@
     return 1;
 }
 
+sub storage_node {
+    my $self = shift;
+    return $self->handle->file_for(type => $self->type, uuid => $self->uuid);
+}
 
 1;



More information about the Bps-public-commit mailing list