[Bps-public-commit] Prophet branch, master, updated. e3e7e0de986b0fc21f150af086abe7b2a0b539ac
jesse
jesse at bestpractical.com
Fri Apr 17 08:48:10 EDT 2009
The branch, master has been updated
via e3e7e0de986b0fc21f150af086abe7b2a0b539ac (commit)
via 74a9e14f214b673074c8a7e6973e7e8066d83adc (commit)
via a49091c4a7958adcd09c163e6d471937ddbb3fdb (commit)
via 79741fe1f15d4e2ab77ee09aef53fa996852b893 (commit)
via b5b7e894876f4126b4f7f56d862031fe8acb5fc1 (commit)
from 2716cc28b6d6be4b846abe792cb590178ea5b03c (commit)
Summary of changes:
lib/Prophet/CLI/Command/Merge.pm | 8 ++++----
lib/Prophet/CLI/Command/Publish.pm | 2 +-
lib/Prophet/CLI/Command/Settings.pm | 1 +
lib/Prophet/Replica/prophet_cache.pm | 6 +++++-
lib/Prophet/Replica/sqlite.pm | 21 +++++++++++++++++++++
5 files changed, 32 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit b5b7e894876f4126b4f7f56d862031fe8acb5fc1
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Apr 17 15:55:31 2009 +0800
added a read_changeset_index equivalence method for the sqlite replica
diff --git a/lib/Prophet/Replica/sqlite.pm b/lib/Prophet/Replica/sqlite.pm
index 3743ba8..f4d2712 100644
--- a/lib/Prophet/Replica/sqlite.pm
+++ b/lib/Prophet/Replica/sqlite.pm
@@ -436,6 +436,27 @@ sub traverse_changesets {
}
}
+
+sub read_changeset_index {
+ my $self =shift;
+ my $index = '';
+ $self->traverse_changesets(
+ after=> 0,
+ load_changesets => 0,
+ callback => sub {
+ my $data = shift;
+ my $changeset_index_line = pack( 'Na16NH40',
+ $data->[0],
+ Data::UUID->new->from_string( $data->[1]),
+ $data->[2],
+ $data->[3]);
+ $index .= $changeset_index_line;
+ }
+ );
+return \$index;
+
+}
+
=head2 changesets_for_record { uuid => $uuid, type => $type }
Returns an ordered set of changeset objects for all changesets containing
commit 79741fe1f15d4e2ab77ee09aef53fa996852b893
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Apr 17 15:56:24 2009 +0800
The pager shouldn't be running on merge
diff --git a/lib/Prophet/CLI/Command/Merge.pm b/lib/Prophet/CLI/Command/Merge.pm
index 4c93cad..f0d6ded 100644
--- a/lib/Prophet/CLI/Command/Merge.pm
+++ b/lib/Prophet/CLI/Command/Merge.pm
@@ -37,7 +37,7 @@ sub run {
my $changesets = $self->_do_merge();
- Prophet::CLI->start_pager();
+ #Prophet::CLI->start_pager();
$self->print_report($changesets)
}
commit a49091c4a7958adcd09c163e6d471937ddbb3fdb
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Apr 17 15:56:53 2009 +0800
Added more debugging to the prophet cache layer
diff --git a/lib/Prophet/Replica/prophet_cache.pm b/lib/Prophet/Replica/prophet_cache.pm
index bdafaf5..0e6c856 100644
--- a/lib/Prophet/Replica/prophet_cache.pm
+++ b/lib/Prophet/Replica/prophet_cache.pm
@@ -231,10 +231,14 @@ sub mirror_from {
if ( -e File::Spec->catdir( $self->fs_root, $self->changeset_cas->filename($key) ) ) {
return;
}
- my $content = $source->_read_file( $source->changeset_cas->filename($key) );
+ my $content = $source->fetch_serialized_changeset(sha1 => $key);
utf8::decode($content) if utf8::is_utf8($content);
my $newkey = $self->changeset_cas->write( $content );
if ($newkey ne $key) {
+ warn "Original key: $key";
+ warn "New key $newkey";
+ warn "Original content:\n".$content."\n";
+ warn "New content:\n".$self->_read_file($self->changeset_cas->filename($newkey))."\n";
Carp::confess "writing a mirrored changeset to the CAS resulted in an inconsistent hash. Corrupted upstream?";
}
}
commit 74a9e14f214b673074c8a7e6973e7e8066d83adc
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Apr 17 16:17:00 2009 +0800
Disable the mirroring code until I can write tests which expose the sha1 bug
diff --git a/lib/Prophet/CLI/Command/Merge.pm b/lib/Prophet/CLI/Command/Merge.pm
index f0d6ded..081f980 100644
--- a/lib/Prophet/CLI/Command/Merge.pm
+++ b/lib/Prophet/CLI/Command/Merge.pm
@@ -26,9 +26,9 @@ sub run {
return unless $self->validate_merge_replicas($self->source => $self->target);
if ( $self->source->can('read_changeset_index') && $self->target->url eq $self->app_handle->handle->url) {
- my $original_source = $self->source;
- $self->source($self->get_cache_for_source($original_source));
- $self->sync_cache_from_source( target=> $self->source, source => $original_source);
+ # my $original_source = $self->source;
+ # $self->source($self->get_cache_for_source($original_source));
+ # $self->sync_cache_from_source( target=> $self->source, source => $original_source);
}
$self->target->import_resolutions_from_remote_replica(
from => $self->source,
commit e3e7e0de986b0fc21f150af086abe7b2a0b539ac
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Apr 17 20:47:42 2009 +0800
Turn off the pager in a couple places we don't need it
diff --git a/lib/Prophet/CLI/Command/Publish.pm b/lib/Prophet/CLI/Command/Publish.pm
index 0149fc2..ede4817 100644
--- a/lib/Prophet/CLI/Command/Publish.pm
+++ b/lib/Prophet/CLI/Command/Publish.pm
@@ -9,7 +9,6 @@ use File::Spec;
sub run {
my $self = shift;
-
die "Please specify a --to.\n" unless $self->has_arg('to');
# set the temp directory where we will do all of our work, which will be
@@ -22,6 +21,7 @@ sub run {
# if the user specifies nothing, then publish the replica
$export_replica = 1 if !$export_html;
+ Prophet::CLI->end_pager();
# if we have the html argument, populate the tempdir with rendered templates
if ($export_html) {
print "Exporting a static HTML version of this replia\n";
diff --git a/lib/Prophet/CLI/Command/Settings.pm b/lib/Prophet/CLI/Command/Settings.pm
index bc35d3a..efc854a 100644
--- a/lib/Prophet/CLI/Command/Settings.pm
+++ b/lib/Prophet/CLI/Command/Settings.pm
@@ -46,6 +46,7 @@ sub run {
my $done = 0;
while ( !$done ) {
+ Prophet::CLI->end_pager();
$done = $self->try_to_edit( template => \$template );
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list