[Bps-public-commit] Prophet branch, master, updated. 0.69_01-51-g3d5a46b

jesse jesse at bestpractical.com
Thu Sep 3 18:55:16 EDT 2009


The branch, master has been updated
       via  3d5a46b5dd5f3f9daf4565e620660f47cd4091fa (commit)
       via  e635e92263b3f76c726b455299fa59de4aa86842 (commit)
       via  a11ae88c8e3d58e019cebe008cdbe9492addee15 (commit)
       via  f6b7de0a9fe149037d6edf00b464969464837e48 (commit)
      from  46232c4da447e61c03ff62970af3161971bab70c (commit)

Summary of changes:
 bin/dump_changesets.idx          |   16 ++++++++++++++++
 bin/dump_record.idx              |   10 ++++++++++
 lib/Prophet/CLI/RecordCommand.pm |    7 +++++--
 lib/Prophet/Record.pm            |   11 +++++++++++
 lib/Prophet/Replica.pm           |    2 +-
 5 files changed, 43 insertions(+), 3 deletions(-)
 create mode 100644 bin/dump_changesets.idx
 create mode 100644 bin/dump_record.idx

- Log -----------------------------------------------------------------
commit f6b7de0a9fe149037d6edf00b464969464837e48
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Thu Sep 3 18:24:17 2009 -0400

    fixing old docs that were out ofdate

diff --git a/lib/Prophet/Replica.pm b/lib/Prophet/Replica.pm
index b509631..6169f91 100644
--- a/lib/Prophet/Replica.pm
+++ b/lib/Prophet/Replica.pm
@@ -1045,7 +1045,7 @@ previous version of a record might look like:
         root => $self->repo_handle->fs->revision_root( $self->repo_handle->fs->youngest_rev - 1 )
     );
 
-=head3 record_exists {uuid => $UUID, type => $TYPE, root => $ROOT }
+=head3 record_exists {uuid => $UUID, type => $TYPE }
 
 Returns true if the record in question exists and false otherwise.
 

commit a11ae88c8e3d58e019cebe008cdbe9492addee15
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Thu Sep 3 18:25:18 2009 -0400

    Added a Prophet::Record API for "does this exist?"

diff --git a/lib/Prophet/Record.pm b/lib/Prophet/Record.pm
index 85dd505..4071824 100644
--- a/lib/Prophet/Record.pm
+++ b/lib/Prophet/Record.pm
@@ -349,6 +349,17 @@ sub get_props {
 
 }
 
+=head2 exists
+
+When called on a loaded record, returns true if the record exists and false if it does not.
+
+=cut
+
+sub exists {
+    my $self = shift;
+    return $self->handle->record_exists( uuid => $self->uuid, type => $self->type);
+}
+
 =head2 prop $name
 
 Returns the current value of the property C<$name> for this record.

commit e635e92263b3f76c726b455299fa59de4aa86842
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Thu Sep 3 18:25:37 2009 -0400

    Prophet::CLI::RecordCommand now checks to make sure you've asked it to operate on a record that actually exists.

diff --git a/lib/Prophet/CLI/RecordCommand.pm b/lib/Prophet/CLI/RecordCommand.pm
index 86a055b..6783c77 100644
--- a/lib/Prophet/CLI/RecordCommand.pm
+++ b/lib/Prophet/CLI/RecordCommand.pm
@@ -70,8 +70,11 @@ record can be found.
 sub _load_record {
     my $self = shift;
     my $record = $self->_get_record_object;
-    $record->load( uuid => $self->uuid )
-        || $self->fatal_error("I couldn't find the " . $self->type . ' ' . $self->uuid);
+    $record->load( uuid => $self->uuid );
+
+	if (! $record->exists) {
+         $self->fatal_error("I couldn't find a " . $self->type . ' with that id.');
+	}	
     return $record;
 }
 

commit 3d5a46b5dd5f3f9daf4565e620660f47cd4091fa
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Thu Sep 3 18:27:51 2009 -0400

    Added a couple debugging tools - dump_changesets.idx dump_record.idx
    
    for reading filesystem based replicas

diff --git a/bin/dump_changesets.idx b/bin/dump_changesets.idx
new file mode 100644
index 0000000..fcb8eb9
--- /dev/null
+++ b/bin/dump_changesets.idx
@@ -0,0 +1,16 @@
+use Prophet::CLI;
+use Prophet::FilesystemReplica;
+
+my $cli = Prophet::CLI->new();
+
+my $file = Prophet::Util->slurp(shift);
+my $fsr = Prophet::FilesystemReplica->new(app_handle => $cli->app_handle);
+
+
+for (1..(length($file)/Prophet::FilesystemReplica::CHG_RECORD_SIZE)) {
+
+my $result =	$fsr->_changeset_index_entry(sequence_no => $_, index_file => \$file);
+
+print join("\t",@$result)."\n";
+
+}
diff --git a/bin/dump_record.idx b/bin/dump_record.idx
new file mode 100644
index 0000000..c8db3ba
--- /dev/null
+++ b/bin/dump_record.idx
@@ -0,0 +1,10 @@
+use Prophet::CLI;
+use Prophet::FilesystemReplica;
+
+my $cli = Prophet::CLI->new();
+
+my $type = shift;
+my $uuid = shift;
+
+my @result = $cli->handle->_read_record_index(type => $type, uuid => $uuid);
+warn YAML::Dump(\@result); use YAML;

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list