[Bps-public-commit] r11619 - in SVN-PropDB: .
jesse at bestpractical.com
jesse at bestpractical.com
Mon Apr 7 09:16:21 EDT 2008
Author: jesse
Date: Mon Apr 7 09:16:20 2008
New Revision: 11619
Modified:
SVN-PropDB/ (props changed)
SVN-PropDB/lib/Prophet/CLI.pm
SVN-PropDB/lib/Prophet/Replica.pm
Log:
r29433 at 68-247-45-239: jesse | 2008-04-07 04:59:41 -0500
docs, starting to look into exporting resolutions
Modified: SVN-PropDB/lib/Prophet/CLI.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/CLI.pm (original)
+++ SVN-PropDB/lib/Prophet/CLI.pm Mon Apr 7 09:16:20 2008
@@ -16,8 +16,13 @@
my $class = shift;
my $self = $class->SUPER::new(@_);
$self->record_class('Prophet::Record') unless $self->record_class;
+
+ # Initialize our handle and resolution db handle
+
$self->handle;
$self->resdb_handle;
+
+
return $self;
}
@@ -94,7 +99,6 @@
if ( $record_class->REFERENCES->{$cmd} ) {
return $self->_handle_reference_command( $record_class, $record_class->REFERENCES->{$cmd} );
}
-
$cmd = $CMD_MAP{$cmd} if exists $CMD_MAP{$cmd};
my $func = $self->can("do_$cmd") or Carp::confess "no such record command $cmd";
if ($record_class) {
@@ -272,7 +276,7 @@
my $self = shift;
my $source_me = Prophet::Replica->new( { url => "file://".$self->handle->repo_path } );
my $path = $self->args->{'path'};
- $source_me->export_to($path);
+ $source_me->export_to( path => $path);
}
sub do_pull {
Modified: SVN-PropDB/lib/Prophet/Replica.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica.pm Mon Apr 7 09:16:20 2008
@@ -475,15 +475,21 @@
Contains a single integer, the replica's most recent sequence number.
-=item C<cas>
+=item C<cas/records>
+
+=item C<cas/changesets>
The C<cas> directory holds changesets and records, each keyed by a
hex-encoded hash of the item's content. Inside the C<cas> directory, you'll find
a two-level deep directory tree of single-character hex digits.
-You'll find the content with the key C<f4b7489b21f8d107ad8df78750a410c028abbf6c>
-inside C<cas/f/4>
+You'll find the changeset with the sha1 digest C<f4b7489b21f8d107ad8df78750a410c028abbf6c>
+inside C<cas/changesets/f/4/f4b7489b21f8d107ad8df78750a410c028abbf6c>.
+
+You'll find the record with the sha1 digest C<dd6fb674de879a1a4762d690141cdfee138daf65> inside
+C<cas/records/d/d/dd6fb674de879a1a4762d690141cdfee138daf65>.
+TODO: define the format for changesets and records
=item C<records>
@@ -518,7 +524,7 @@
=item C<resolutions>
-=over
+=over TODO DOC RESOLUTIONS
=item
@@ -531,15 +537,19 @@
sub export_to {
my $self = shift;
- my $path = shift;
+ my %args = validate(
+ @_,
+ { path => 1,
+ }
+ );
- my $replica_root = dir( $path, $self->db_uuid );
- my $cas_dir = dir( $replica_root => 'cas' );
- my $record_cas_dir = dir( $cas_dir => 'records' );
- my $changeset_cas_dir = dir( $cas_dir => 'changesets' );
- my $record_dir = dir( $replica_root => 'records' );
+ my $replica_root = dir( $args{path}, $self->db_uuid );
+ my $cas_dir = dir( $replica_root => 'cas' );
+ my $record_cas_dir = dir( $cas_dir => 'records' );
+ my $changeset_cas_dir = dir( $cas_dir => 'changesets' );
+ my $record_dir = dir( $replica_root => 'records' );
- _mkdir($path);
+ _mkdir($args{path});
_mkdir($replica_root);
_mkdir($record_dir);
_mkdir($cas_dir);
@@ -557,8 +567,18 @@
}
$self->export_changesets( root => $replica_root, cas_dir => $changeset_cas_dir );
+ #$self->export_resolutions( path => dir( $replica_root, 'resolutions'), resdb_handle => $args{'resdb_handle'} );
+
+}
+
+sub export_resolutions {
+ my $self = shift;
+ my $replica = Prophet::Replica->new();
+ # ...
}
+
+
sub _init_export_metadata {
my $self = shift;
my %args = validate( @_, { root => 1 } );
@@ -569,6 +589,7 @@
}
+
sub export_records {
my $self = shift;
my %args = validate( @_, { root => 1, type => 1, cas_dir => 1 } );
More information about the Bps-public-commit
mailing list