[Bps-public-commit] r11454 - SVN-PropDB/lib/Prophet/Sync/Source

clkao at bestpractical.com clkao at bestpractical.com
Thu Apr 3 20:28:19 EDT 2008


Author: clkao
Date: Thu Apr  3 20:28:19 2008
New Revision: 11454

Modified:
   SVN-PropDB/lib/Prophet/Sync/Source/RT.pm

Log:
generate uuid based on rt url.

Modified: SVN-PropDB/lib/Prophet/Sync/Source/RT.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Sync/Source/RT.pm	(original)
+++ SVN-PropDB/lib/Prophet/Sync/Source/RT.pm	Thu Apr  3 20:28:19 2008
@@ -71,8 +71,15 @@
 
 sub uuid {
     my $self = shift;
-    return 1234;
-    return Carp::cluck "need a uuid";
+    return $self->uuid_for_url( join('/', $self->rt_url, $self->rt_query ) );
+
+}
+
+use Data::UUID 'NameSpace_DNS';
+
+sub uuid_for_url {
+    my ($self, $url) = @_;
+    return Data::UUID->new->create_from_name_str( NameSpace_DNS, $url);
 }
 
 =head2 fetch_changesets { after => SEQUENCE_NO } 
@@ -93,9 +100,10 @@
       my   @changesets;
     my %tix;
     for my $id ($self->_find_matching_tickets) {
-        my @changesets = $self->_recode_transactions( ticket => $self->rt->show(type => 'ticket', id => $id), transactions => $self->_find_matching_transactions($id));  
+        push @changesets, @{ $self->_recode_transactions( ticket => $self->rt->show(type => 'ticket', id => $id), transactions => $self->_find_matching_transactions($id)) };
     }
-
+    warn Dumper(\@changesets); use Data::Dumper;
+    die 'not yet';
     my @results =  sort { $a->original_sequence_no <=> $b->original_sequence_no } @changesets;
     return \@results;
 }



More information about the Bps-public-commit mailing list