Mailing List Archive

[svn] r570 - in experiments/orange-elephant: . bin data doc
Author: jesse
Date: Mon Mar 15 00:33:30 2004
New Revision: 570

Added:
experiments/orange-elephant/bin/yamltest
experiments/orange-elephant/data/
experiments/orange-elephant/data/foo
experiments/orange-elephant/data/foo.old
experiments/orange-elephant/data/foo.txn.1079328077-963B305E-7640-11D8-AB46-98F4B98ECD07
experiments/orange-elephant/data/foo.txn.1079328080-98108EB0-7640-11D8-8E61-B68784B98442
experiments/orange-elephant/doc/arch
experiments/orange-elephant/doc/parts
Modified:
experiments/orange-elephant/ (props changed)
Log:
Checking in an experiment

Added: experiments/orange-elephant/bin/yamltest
==============================================================================
--- (empty file)
+++ experiments/orange-elephant/bin/yamltest Mon Mar 15 00:33:30 2004
@@ -0,0 +1,59 @@
+#!/usr/bin/perl
+
+use YAML;
+ use Data::UUID;
+
+ $ug = new Data::UUID;
+my $file = shift;
+
+$file = "../data/".$file;
+system($ENV{'EDITOR'}, $file);
+
+my $yaml = YAML::LoadFile($file);
+my $old_yaml = YAML::LoadFile($file.".old");
+
+my ($adds,$deletes) = diff($old_yaml, $yaml);
+use Data::Dumper;
+
+
+
+my $txn = { time => time,
+ author => 'jesse',
+ added => $adds,
+ deleted => $deletes,
+ record => $file,
+ uuid => $ug->create_str()
+
+
+} ;
+
+
+print scalar Dumper $txn;
+
+print YAML::Dump( $txn);
+YAML::DumpFile("../data/$file.txn.".$txn->{time}."-".$txn->{uuid}, $txn);
+
+
+sub diff {
+
+ my $old = shift;
+ my $new = shift;
+
+ my $deletes = {};
+ my $adds = {};
+ foreach my $key (keys %$old) {
+ if (!$new->{$key}) {
+ $deletes->{$key} = $old->{$key};
+ }
+ }
+
+ foreach my $key (keys %$new) {
+ if (!$old->{$key}) {
+ $adds->{$key} = $new->{$key};
+ }
+ }
+
+ return ($adds,$deletes);
+}
+
+

Added: experiments/orange-elephant/data/foo
==============================================================================
--- (empty file)
+++ experiments/orange-elephant/data/foo Mon Mar 15 00:33:30 2004
@@ -0,0 +1,7 @@
+foo: winky
+Bing: bohg
+Bing: lohg
+Blong:
+ - foo
+ - bar
+boo: far

Added: experiments/orange-elephant/data/foo.old
==============================================================================
--- (empty file)
+++ experiments/orange-elephant/data/foo.old Mon Mar 15 00:33:30 2004
@@ -0,0 +1,2 @@
+foo: bar
+boo: far

Added: experiments/orange-elephant/data/foo.txn.1079328077-963B305E-7640-11D8-AB46-98F4B98ECD07
==============================================================================
--- (empty file)
+++ experiments/orange-elephant/data/foo.txn.1079328077-963B305E-7640-11D8-AB46-98F4B98ECD07 Mon Mar 15 00:33:30 2004
@@ -0,0 +1,11 @@
+--- #YAML:1.0
+added:
+ Bing: bohg
+ Blong:
+ - foo
+ - bar
+author: jesse
+deleted: {}
+record: '../data/foo'
+time: 1079328077
+uuid: 963B305E-7640-11D8-AB46-98F4B98ECD07

Added: experiments/orange-elephant/data/foo.txn.1079328080-98108EB0-7640-11D8-8E61-B68784B98442
==============================================================================
--- (empty file)
+++ experiments/orange-elephant/data/foo.txn.1079328080-98108EB0-7640-11D8-8E61-B68784B98442 Mon Mar 15 00:33:30 2004
@@ -0,0 +1,11 @@
+--- #YAML:1.0
+added:
+ Bing: bohg
+ Blong:
+ - foo
+ - bar
+author: jesse
+deleted: {}
+record: '../data/foo'
+time: 1079328080
+uuid: 98108EB0-7640-11D8-8E61-B68784B98442

Added: experiments/orange-elephant/doc/arch
==============================================================================
--- (empty file)
+++ experiments/orange-elephant/doc/arch Mon Mar 15 00:33:30 2004
@@ -0,0 +1 @@
+

Added: experiments/orange-elephant/doc/parts
==============================================================================
--- (empty file)
+++ experiments/orange-elephant/doc/parts Mon Mar 15 00:33:30 2004
@@ -0,0 +1,11 @@
+Client to edit tables
+Client to edit rows
+
+Server to insert, update and delete rows
+
+
+Sync tool
+ Fetch all deltas since last change from our master and roll them in, prompting for conflict resolution
+ Send each delta we made to the server, in order.
+
+
_______________________________________________
Rt-commit mailing list
Rt-commit@lists.bestpractical.com
http://lists.bestpractical.com/mailman/listinfo/rt-commit