Skip to content

Commit

Permalink
Merge commit 'notbenh/master'
Browse files Browse the repository at this point in the history
* commit 'notbenh/master':
  adding a bit more explination to the parts of the rt server string
  was throwing an undef error
  shortcut for bad data
  seems silly to set the username before asking for one
  • Loading branch information
bobtfish committed Oct 17, 2009
2 parents de663c2 + 47736e0 commit 85ab04b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
9 changes: 8 additions & 1 deletion lib/App/SD/CLI/Command/Help/Sync.pm
Expand Up @@ -61,7 +61,14 @@ If you're interested in building a replica type for your bug
tracker, you should get in touch with SD's developers (see
http://syncwith.us/contact).
The RT server is specified as as rt:serveraddress|Queue|Query
The RT server is specified as as rt:serveraddress|Queue|Query.
- serveraddress: the root of your rt install, ie http://rt.cpan.org
- Queue: the ticket queue that you would like to restrict to,
use 'Generic' as a safe catch all.
- Query: any further filtering you would like, leave empty to pull all
matching tickets.
Examples:
${cmd}clone --from "rt:http://rt3.fsck.com|rt3|Owner='jesse'"
Create a local replica and pull data from a foreign replica.
Expand Down
3 changes: 2 additions & 1 deletion lib/App/SD/Replica/hm.pm
Expand Up @@ -41,14 +41,15 @@ sub BUILD {
$uri->userinfo(undef);
}
$self->remote_url("$uri");
$self->foreign_username($username) if ($username);

( $username, $password )
= $self->prompt_for_login(
uri => $uri,
username => $username,
) unless $password;

$self->foreign_username($username) if ($username);

if ($props) {
my %props = split /=|;/, $props;
$self->props( \%props );
Expand Down
2 changes: 1 addition & 1 deletion lib/App/SD/Replica/hm/PullEncoder.pm
Expand Up @@ -125,7 +125,7 @@ sub add_prop_change {
my $old = $args{'history_entry'}{'old_value'} ||'';
my $new = $args{'history_entry'}{'new_value'} ||'';

if ( $args{'previous_state'}->{$field} eq $new ) {
if ( defined $args{'previous_state'}->{$field} && $args{'previous_state'}->{$field} eq $new ) {
$args{'previous_state'}->{$field} = $old;
} else {
$args{'previous_state'}->{$field} = $old;
Expand Down
1 change: 1 addition & 0 deletions lib/App/SD/Util.pm
Expand Up @@ -9,6 +9,7 @@ my %MONTHS = ( jan => 1, feb => 2, mar => 3, apr => 4, may => 5, jun => 6, jul =

sub string_to_datetime {
my ($date)= validate_pos(@_, { type => SCALAR | UNDEF} );
return undef unless defined $date && length $date;
if ($date =~ /^(\d{4})-(\d{2})-(\d{2})[T\s](\d{1,2}):(\d{2}):(\d{2})Z?$/ ){
my ($year,$month,$day, $hour,$min,$sec) = ($1,$2,$3,$4,$5,$6);
my $dt = DateTime->new( year => $year,
Expand Down

0 comments on commit 85ab04b

Please sign in to comment.