[Bps-public-commit] r11553 - in SVN-PropDB/lib/Prophet: .
clkao at bestpractical.com
clkao at bestpractical.com
Sat Apr 5 19:20:48 EDT 2008
Author: clkao
Date: Sat Apr 5 19:20:41 2008
New Revision: 11553
Modified:
SVN-PropDB/lib/Prophet/ForeignReplica.pm
SVN-PropDB/lib/Prophet/Replica.pm
SVN-PropDB/lib/Prophet/Replica/RT.pm
SVN-PropDB/lib/Prophet/Replica/SVN.pm
Log:
cleanup replica accessors & prompt_for_login.
Modified: SVN-PropDB/lib/Prophet/ForeignReplica.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/ForeignReplica.pm (original)
+++ SVN-PropDB/lib/Prophet/ForeignReplica.pm Sat Apr 5 19:20:41 2008
@@ -33,4 +33,28 @@
return Data::UUID->new->create_from_name_str( NameSpace_DNS, $url );
}
+sub prompt_for_login {
+ my ( $self, $uri, $username ) = @_;
+
+ my $password;
+ # XXX belongs to some CLI callback
+ use Term::ReadKey;
+ local $| = 1;
+ if ($username) {
+ print "Username for $uri: ";
+ ReadMode 1;
+ $username = ReadLine 0;
+ chomp $username;
+ }
+
+ print "Password for $username @ $uri: ";
+ ReadMode 2;
+ $password = ReadLine 0;
+ chomp $password;
+ ReadMode 1;
+ print "\n";
+ return ($username, $password);
+}
+
+
1;
Modified: SVN-PropDB/lib/Prophet/Replica.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica.pm Sat Apr 5 19:20:41 2008
@@ -6,7 +6,7 @@
use Params::Validate qw(:all);
use UNIVERSAL::require;
-__PACKAGE__->mk_accessors(qw(state_handle));
+__PACKAGE__->mk_accessors(qw(state_handle ressource is_resdb));
=head1 NAME
Modified: SVN-PropDB/lib/Prophet/Replica/RT.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica/RT.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica/RT.pm Sat Apr 5 19:20:41 2008
@@ -13,7 +13,7 @@
use Prophet::ChangeSet;
use Prophet::Replica::RT::PullEncoder;
-__PACKAGE__->mk_accessors(qw/prophet_handle ressource is_resdb rt rt_url rt_queue rt_query/);
+__PACKAGE__->mk_accessors(qw/rt rt_url rt_queue rt_query/);
our $DEBUG = $Prophet::Handle::DEBUG;
@@ -91,22 +91,9 @@
$self->rt_queue($type);
$self->rt_query( $query . " AND Queue = '$type'" );
$self->rt( RT::Client::REST->new( server => $server ) );
- unless ($username) {
- # XXX belongs to some CLI callback
- use Term::ReadKey;
- local $| = 1;
- print "Username for $uri: ";
- ReadMode 1;
- $username = ReadLine 0;
- chomp $username;
- print "Password for $username @ $uri: ";
- ReadMode 2;
- $password = ReadLine 0;
- chomp $password;
- ReadMode 1;
- print "\n";
- }
+ ( $username, $password ) = $self->prompt_for_login( $uri, $username ) unless $password;
+
$self->rt->login( username => $username, password => $password );
my $cli = Prophet::CLI->new();
Modified: SVN-PropDB/lib/Prophet/Replica/SVN.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Replica/SVN.pm (original)
+++ SVN-PropDB/lib/Prophet/Replica/SVN.pm Sat Apr 5 19:20:41 2008
@@ -16,7 +16,7 @@
use Prophet::ChangeSet;
use Prophet::Conflict;
-__PACKAGE__->mk_accessors(qw/url ra prophet_handle ressource is_resdb pool/);
+__PACKAGE__->mk_accessors(qw/url ra prophet_handle pool/);
our $DEBUG = $Prophet::Handle::DEBUG;
More information about the Bps-public-commit
mailing list