[Bps-public-commit] r11703 - in Prophet/trunk: . bin t
jesse at bestpractical.com
jesse at bestpractical.com
Fri Apr 11 22:45:11 EDT 2008
Author: jesse
Date: Fri Apr 11 22:45:10 2008
New Revision: 11703
Removed:
Prophet/trunk/bin/prophet-node-create
Prophet/trunk/bin/prophet-node-delete
Prophet/trunk/bin/prophet-node-history
Prophet/trunk/bin/prophet-node-search
Prophet/trunk/bin/prophet-node-show
Prophet/trunk/bin/prophet-node-update
Modified:
Prophet/trunk/ (props changed)
Prophet/trunk/bin/prophet
Prophet/trunk/lib/Prophet/CLI.pm
Prophet/trunk/t/export.t
Prophet/trunk/t/non-conflicting-merge.t
Prophet/trunk/t/real-conflicting-merge.t
Prophet/trunk/t/simple-conflicting-merge.t
Prophet/trunk/t/simple-push.t
Log:
r29603 at 31b: jesse | 2008-04-11 17:09:24 -0400
Removed old "bin" tools in favor of the single 'prophet' codepath
Modified: Prophet/trunk/bin/prophet
==============================================================================
--- Prophet/trunk/bin/prophet (original)
+++ Prophet/trunk/bin/prophet Fri Apr 11 22:45:10 2008
@@ -7,11 +7,9 @@
my $cmd = shift @ARGV;
$cli->parse_record_cmd_args();
-if (my $sub = $cli->can('do_'.$cmd)) {
+if ( my $sub = $cli->can( 'do_' . $cmd ) ) {
$sub->($cli);
- } else {
+} else {
die "I don't know how to do the $cmd";
- }
+}
-
-
Modified: Prophet/trunk/lib/Prophet/CLI.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI.pm (original)
+++ Prophet/trunk/lib/Prophet/CLI.pm Fri Apr 11 22:45:10 2008
@@ -47,7 +47,7 @@
return $self->_handle();
}
-=head2 hesdb_handle
+=head2 resdb_handle
=cut
@@ -231,7 +231,12 @@
);
for ( sort { $a->uuid cmp $b->uuid } @{ $records->as_array_ref } ) {
+ if($_->summary_props) {
print $_->format_summary . "\n";
+ } else {
+ # XXX OLD HACK TO MAKE TESTS PASS
+ printf ("%s %s %s \n", $_->uuid, $_->prop( 'summary')||"(no summary)", $_->prop('status')||'(no status)');
+ }
}
}
Modified: Prophet/trunk/t/export.t
==============================================================================
--- Prophet/trunk/t/export.t (original)
+++ Prophet/trunk/t/export.t Fri Apr 11 22:45:10 2008
@@ -8,8 +8,8 @@
use Test::Exception;
as_alice {
- run_ok( 'prophet-node-create', [qw(--type Bug --status new --from alice )], "Created a record as alice" );
- run_output_matches( 'prophet-node-search', [qw(--type Bug --regex .)], [qr/new/], " Found our record" );
+ run_ok( 'prophet', [qw(create --type Bug --status new --from alice )], "Created a record as alice" );
+ run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
};
diag('Bob syncs from alice');
@@ -20,22 +20,22 @@
as_bob {
- run_ok( 'prophet-node-create', [qw(--type Dummy --ignore yes)], "Created a dummy record" );
+ run_ok( 'prophet', [qw(create --type Dummy --ignore yes)], "Created a dummy record" );
run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice') ], "Sync ran ok!" );
# check our local replicas
- my ( $ret, $out, $err ) = run_script( 'prophet-node-search', [qw(--type Bug --regex .)] );
+ my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
like( $out, qr/new/, "We have the one node from alice" );
if ( $out =~ /^(.*?)\s./ ) {
$record_id = $1;
}
diag($record_id);
- run_ok( 'prophet-node-update', [ '--type', 'Bug', '--uuid', $record_id, '--status' => 'stalled' ] );
+ run_ok( 'prophet', [ 'update', '--type', 'Bug', '--uuid', $record_id, '--status' => 'stalled' ] );
run_output_matches(
- 'prophet-node-show',
- [ '--type', 'Bug', '--uuid', $record_id ],
+ 'prophet',
+ ['show', '--type', 'Bug', '--uuid', $record_id ],
[ 'id: ' . $record_id, 'status: stalled', 'from: alice' ],
'content is correct'
);
Modified: Prophet/trunk/t/non-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/non-conflicting-merge.t (original)
+++ Prophet/trunk/t/non-conflicting-merge.t Fri Apr 11 22:45:10 2008
@@ -6,8 +6,8 @@
use Prophet::Test tests => 25;
as_alice {
- run_ok( 'prophet-node-create', [qw(--type Bug --status new --from alice )], "Created a record as alice" );
- run_output_matches( 'prophet-node-search', [qw(--type Bug --regex .)], [qr/new/], " Found our record" );
+ run_ok( 'prophet', [qw(create --type Bug --status new --from alice )], "Created a record as alice" );
+ run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
# update the node
# show the node history
@@ -15,8 +15,8 @@
};
as_bob {
- run_ok( 'prophet-node-create', [qw(--type Bug --status open --from bob )], "Created a record as bob" );
- run_output_matches( 'prophet-node-search', [qw(--type Bug --regex .)], [qr/open/], " Found our record" );
+ run_ok( 'prophet', [qw(create --type Bug --status open --from bob )], "Created a record as bob" );
+ run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/open/], " Found our record" );
# update the node
# show the node history
@@ -31,7 +31,7 @@
run_ok( 'prophet', [ 'merge', '--from', repo_uri_for('bob'), '--to', repo_uri_for('alice') ], "Sync ran ok!" );
# check our local replicas
- my ( $ret, $out, $err ) = run_script( 'prophet-node-search', [qw(--type Bug --regex .)] );
+ my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
like( $out, qr/open/ );
like( $out, qr/new/ );
my @out = split( /\n/, $out );
@@ -45,7 +45,7 @@
run_ok( 'prophet', [ 'merge', '--from', repo_uri_for('bob'), '--to', repo_uri_for('alice') ], "Sync ran ok!" );
# check our local replicas
- ( $ret, $out, $err ) = run_script( 'prophet-node-search', [qw(--type Bug --regex .)] );
+ ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
like( $out, qr/open/ );
like( $out, qr/new/ );
@out = split( /\n/, $out );
@@ -61,7 +61,7 @@
as_bob {
my $last_rev = replica_last_rev();
- my ( $ret, $out, $err ) = run_script( 'prophet-node-search', [qw(--type Bug --regex .)] );
+ my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
unlike( $out, qr/new/, "bob doesn't have alice's yet" );
# sync from alice
@@ -69,7 +69,7 @@
run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice') ], "Sync ran ok!" );
# check our local replicas
- ( $ret, $out, $err ) = run_script( 'prophet-node-search', [qw(--type Bug --regex .)] );
+ ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
like( $out, qr/open/ );
like( $out, qr/new/ );
is( replica_last_rev, $last_rev + 1, "only one rev from alice is sycned" );
Modified: Prophet/trunk/t/real-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/real-conflicting-merge.t (original)
+++ Prophet/trunk/t/real-conflicting-merge.t Fri Apr 11 22:45:10 2008
@@ -7,8 +7,8 @@
use Prophet::Test tests => 19;
as_alice {
- run_ok( 'prophet-node-create', [qw(--type Bug --status new --from alice )], "Created a record as alice" );
- run_output_matches( 'prophet-node-search', [qw(--type Bug --regex .)], [qr/new/], " Found our record" );
+ run_ok( 'prophet', [qw(create --type Bug --status new --from alice )], "Created a record as alice" );
+ run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
};
diag('Bob syncs from alice');
@@ -17,31 +17,31 @@
as_bob {
- run_ok( 'prophet-node-create', [qw(--type Dummy --ignore yes)], "Created a dummy record" );
+ run_ok( 'prophet', [qw(create --type Dummy --ignore yes)], "Created a dummy record" );
run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice') ], "Sync ran ok!" );
# check our local replicas
- my ( $ret, $out, $err ) = run_script( 'prophet-node-search', [qw(--type Bug --regex .)] );
+ my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
like( $out, qr/new/, "We have the one node from alice" );
if ( $out =~ /^(.*?)\s./ ) {
$record_id = $1;
}
- run_ok( 'prophet-node-update', [ '--type', 'Bug', '--uuid', $record_id, '--status' => 'stalled' ] );
+ run_ok( 'prophet', [ 'update', '--type', 'Bug', '--uuid', $record_id, '--status' => 'stalled' ] );
run_output_matches(
- 'prophet-node-show',
- [ '--type', 'Bug', '--uuid', $record_id ],
+ 'prophet',
+ [ 'show', '--type', 'Bug', '--uuid', $record_id ],
[ 'id: ' . $record_id, 'status: stalled', 'from: alice' ],
'content is correct'
);
};
as_alice {
- run_ok( 'prophet-node-update', [ '--type', 'Bug', '--uuid', $record_id, '--status' => 'open' ] );
+ run_ok( 'prophet', [ 'update', '--type', 'Bug', '--uuid', $record_id, '--status' => 'open' ] );
run_output_matches(
- 'prophet-node-show',
- [ '--type', 'Bug', '--uuid', $record_id ],
+ 'prophet',
+ [ 'show', '--type', 'Bug', '--uuid', $record_id ],
[ 'id: ' . $record_id, 'status: open', 'from: alice' ],
'content is correct'
);
Modified: Prophet/trunk/t/simple-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/simple-conflicting-merge.t (original)
+++ Prophet/trunk/t/simple-conflicting-merge.t Fri Apr 11 22:45:10 2008
@@ -7,8 +7,8 @@
use Test::Exception;
as_alice {
- run_ok( 'prophet-node-create', [qw(--type Bug --status new --from alice )], "Created a record as alice" );
- run_output_matches( 'prophet-node-search', [qw(--type Bug --regex .)], [qr/new/], " Found our record" );
+ run_ok( 'prophet', [qw(create --type Bug --status new --from alice )], "Created a record as alice" );
+ run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
};
diag('Bob syncs from alice');
@@ -17,31 +17,31 @@
as_bob {
- run_ok( 'prophet-node-create', [qw(--type Dummy --ignore yes)], "Created a dummy record" );
+ run_ok( 'prophet', [qw(create --type Dummy --ignore yes)], "Created a dummy record" );
run_ok( 'prophet', [ 'merge', '--to', repo_uri_for('bob'), '--from', repo_uri_for('alice') ], "Sync ran ok!" );
# check our local replicas
- my ( $ret, $out, $err ) = run_script( 'prophet-node-search', [qw(--type Bug --regex .)] );
+ my ( $ret, $out, $err ) = run_script( 'prophet', [qw(search --type Bug --regex .)] );
like( $out, qr/new/, "We have the one node from alice" );
if ( $out =~ /^(.*?)\s./ ) {
$record_id = $1;
}
- run_ok( 'prophet-node-update', [ '--type', 'Bug', '--uuid', $record_id, '--status' => 'stalled' ] );
+ run_ok( 'prophet', [ 'update', '--type', 'Bug', '--uuid', $record_id, '--status' => 'stalled' ] );
run_output_matches(
- 'prophet-node-show',
- [ '--type', 'Bug', '--uuid', $record_id ],
+ 'prophet',
+ [ 'show','--type', 'Bug', '--uuid', $record_id ],
[ 'id: ' . $record_id, 'status: stalled', 'from: alice' ],
'content is correct'
);
};
as_alice {
- run_ok( 'prophet-node-update', [ '--type', 'Bug', '--uuid', $record_id, '--status' => 'stalled' ] );
+ run_ok( 'prophet', [ 'update', '--type', 'Bug', '--uuid', $record_id, '--status' => 'stalled' ] );
run_output_matches(
- 'prophet-node-show',
- [ '--type', 'Bug', '--uuid', $record_id ],
+ 'prophet',
+ ['show', '--type', 'Bug', '--uuid', $record_id ],
[ 'id: ' . $record_id, 'status: stalled', 'from: alice' ],
'content is correct'
);
Modified: Prophet/trunk/t/simple-push.t
==============================================================================
--- Prophet/trunk/t/simple-push.t (original)
+++ Prophet/trunk/t/simple-push.t Fri Apr 11 22:45:10 2008
@@ -6,8 +6,8 @@
use Prophet::Test tests => 9;
as_alice {
- run_ok( 'prophet-node-create', [qw(--type Bug --status new --from alice )], "Created a record as alice" );
- run_output_matches( 'prophet-node-search', [qw(--type Bug --regex .)], [qr/new/], " Found our record" );
+ run_ok( 'prophet', [qw(create --type Bug --status new --from alice )], "Created a record as alice" );
+ run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/new/], " Found our record" );
# update the node
# show the node history
@@ -15,8 +15,8 @@
};
as_bob {
- run_ok( 'prophet-node-create', [qw(--type Bug --status open --from bob )], "Created a record as bob" );
- run_output_matches( 'prophet-node-search', [qw(--type Bug --regex .)], [qr/open/], " Found our record" );
+ run_ok( 'prophet', [qw(create --type Bug --status open --from bob )], "Created a record as bob" );
+ run_output_matches( 'prophet', [qw(search --type Bug --regex .)], [qr/open/], " Found our record" );
# update the node
# show the node history
@@ -24,7 +24,6 @@
};
-
my $alice = Prophet::Replica->new( { url => repo_uri_for('alice') } );
my $bob = Prophet::Replica->new( { url => repo_uri_for('bob') } );
@@ -37,7 +36,7 @@
my $openbug = '';
as_bob {
- my ( $ret, $stdout, $stderr ) = run_script( 'prophet-node-search', [qw(--type Bug --regex open)] );
+ my ( $ret, $stdout, $stderr ) = run_script( 'prophet', [qw(search --type Bug --regex open)] );
if ( $stdout =~ /^(.*?)\s/ ) {
$openbug = $1;
}
@@ -100,8 +99,8 @@
my $last_id;
as_bob {
- run_ok( 'prophet-node-create', [qw(--type Bug --status new --from bob )], "Created a record as bob" );
- my ( $ret, $stdout, $stderr ) = run_script( 'prophet-node-search', [qw(--type Bug --regex new)] );
+ run_ok( 'prophet', [qw(create --type Bug --status new --from bob )], "Created a record as bob" );
+ my ( $ret, $stdout, $stderr ) = run_script( 'prophet', [qw(search --type Bug --regex new)] );
if ( $stdout =~ /^(.*?)\s/ ) {
$last_id = $1;
}
More information about the Bps-public-commit
mailing list