[Bps-public-commit] r11359 - in SVN-PropDB: t
clkao at bestpractical.com
clkao at bestpractical.com
Tue Apr 1 21:52:01 EDT 2008
Author: clkao
Date: Tue Apr 1 21:52:01 2008
New Revision: 11359
Added:
SVN-PropDB/t/sync-delete-conflict.t
Modified:
SVN-PropDB/lib/Prophet/Conflict.pm
Log:
- change_type is update_file, not update.
- failed test for updating a deleted node.
Modified: SVN-PropDB/lib/Prophet/Conflict.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Conflict.pm (original)
+++ SVN-PropDB/lib/Prophet/Conflict.pm Tue Apr 1 21:52:01 2008
@@ -87,11 +87,11 @@
my $file_op_conflict = '';
my $file_exists = $self->prophet_handle->node_exists(uuid => $change->node_uuid, type => $change->node_type);
-
+
# It's ok to delete a node that exists
if ( $change->change_type eq 'delete' && !$file_exists ) {
$file_op_conflict = "delete_missing_file";
- } elsif ( $change->change_type eq 'update' && !$file_exists) {
+ } elsif ( $change->change_type eq 'update_file' && !$file_exists) {
$file_op_conflict = "update_missing_file";
} elsif ( $change->change_type eq 'add_file' && $file_exists) {
$file_op_conflict = "create_existing_file";
@@ -100,8 +100,6 @@
$file_op_conflict = "create_existing_dir";
}
-
-
my $change_conflict = Prophet::ConflictingChange->new(
Added: SVN-PropDB/t/sync-delete-conflict.t
==============================================================================
--- (empty file)
+++ SVN-PropDB/t/sync-delete-conflict.t Tue Apr 1 21:52:01 2008
@@ -0,0 +1,47 @@
+#!/usr/bin/perl -w
+use strict;
+use Prophet::Test::Arena;
+
+Prophet::Test::Arena->run_from_yaml;
+
+__DATA__
+---
+chickens:
+ - DEC
+ - KAGENEKO
+recipe:
+ -
+ - DEC
+ - create_record
+ - props:
+ - --Sauron
+ - eee_yow
+ - --He
+ - crunch
+ - --the_Shadow
+ - kayo
+ - --the_Enemy
+ - aiieee
+ - --the_Lord_of_the_Rings
+ - thwacke
+ result: 4
+ -
+ - KAGENEKO
+ - sync_from_peer
+ - from: DEC
+ -
+ - DEC
+ - update_record
+ - props:
+ He: aiieee
+ the_Enemy: kayo
+ the_Shadow: eee_yow
+ record: 4
+ -
+ - KAGENEKO
+ - delete_record
+ - record: 4
+ -
+ - KAGENEKO
+ - sync_from_peer
+ - from: DEC
More information about the Bps-public-commit
mailing list