[Bps-public-commit] SD branch, master, updated. f744573a696e658b08fb7a651c40fb3a207d5737

jesse jesse at bestpractical.com
Wed Aug 12 22:24:00 EDT 2009


The branch, master has been updated
       via  f744573a696e658b08fb7a651c40fb3a207d5737 (commit)
       via  fe241e27b7ef64b2dff0586c6ce287e18537807e (commit)
      from  d5f02b79c73b7f71d4cabdc9210bb37b05494c86 (commit)

Summary of changes:
 lib/App/SD/ForeignReplica/PullEncoder.pm  |   12 ++++++++++++
 lib/App/SD/Replica/gcode/PullEncoder.pm   |   11 ++---------
 lib/App/SD/Replica/github/PullEncoder.pm  |    9 +--------
 lib/App/SD/Replica/redmine/PullEncoder.pm |    6 +-----
 lib/App/SD/Replica/trac/PullEncoder.pm    |    8 +-------
 5 files changed, 17 insertions(+), 29 deletions(-)

- Log -----------------------------------------------------------------
commit fe241e27b7ef64b2dff0586c6ce287e18537807e
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 12 17:32:42 2009 -0400

    extract the "create a comment" bit out of all our foreign replicas

diff --git a/lib/App/SD/ForeignReplica/PullEncoder.pm b/lib/App/SD/ForeignReplica/PullEncoder.pm
index c44b8c0..127c71d 100644
--- a/lib/App/SD/ForeignReplica/PullEncoder.pm
+++ b/lib/App/SD/ForeignReplica/PullEncoder.pm
@@ -132,6 +132,18 @@ sub _only_pull_tickets_modified_after {
     return $before;
 }
 
+sub new_comment_creation_change {
+	my $self = shift;
+	return Prophet::Change->new(
+        {
+            record_type => 'comment',
+            record_uuid =>  $self->sync_source->uuid_generator->create_str()
+            ,    # comments are never edited, we can have a random uuid
+            change_type => 'add_file'
+        }
+    );
+}
+
 __PACKAGE__->meta->make_immutable;
 no Any::Moose;
 1;
diff --git a/lib/App/SD/Replica/gcode/PullEncoder.pm b/lib/App/SD/Replica/gcode/PullEncoder.pm
index ebd2bf1..3713dcc 100644
--- a/lib/App/SD/Replica/gcode/PullEncoder.pm
+++ b/lib/App/SD/Replica/gcode/PullEncoder.pm
@@ -322,15 +322,8 @@ sub _include_change_comment {
     my $ticket_uuid = shift;
     my $txn         = shift;
 
-    my $comment = Prophet::Change->new(
-        {
-            record_type => 'comment',
-            record_uuid => $self->sync_source->app_handle->uuid_generator->create_str(),
-            ,    # comments are never edited, we can have a random uuid
-            change_type => 'add_file'
-        }
-    );
-
+    my $comment = $self->new_comment_creation_change();
+   
     if ( my $content = $txn->content ) {
         if ( $content !~ /^\s*$/s ) {
             $comment->add_prop_change(
diff --git a/lib/App/SD/Replica/github/PullEncoder.pm b/lib/App/SD/Replica/github/PullEncoder.pm
index c7463c5..242816f 100644
--- a/lib/App/SD/Replica/github/PullEncoder.pm
+++ b/lib/App/SD/Replica/github/PullEncoder.pm
@@ -204,14 +204,7 @@ sub _include_change_comment {
     my $ticket_uuid = shift;
     my $txn         = shift;
 
-    my $comment = Prophet::Change->new(
-        {
-            record_type => 'comment',
-            record_uuid => $self->sync_source->app_handle->uuid_generator->create_str(),
-            ,    # comments are never edited, we can have a random uuid
-            change_type => 'add_file'
-        }
-    );
+    my $comment = $self->new_comment_creation_change();
 
     if ( my $content = $txn->{content} ) {
         if ( $content !~ /^\s*$/s ) {
diff --git a/lib/App/SD/Replica/redmine/PullEncoder.pm b/lib/App/SD/Replica/redmine/PullEncoder.pm
index 27dbf9d..b5ce37e 100644
--- a/lib/App/SD/Replica/redmine/PullEncoder.pm
+++ b/lib/App/SD/Replica/redmine/PullEncoder.pm
@@ -142,11 +142,7 @@ sub _include_change_comment {
     my $ticket_uuid = shift;
     my $txn         = shift;
 
-    my $comment = Prophet::Change->new({
-        record_type => 'comment',
-        record_uuid => $self->sync_source->app_handle->uuid_generator->create_str(),
-        change_type => 'add_file'
-    });
+    my $comment = $self->new_comment_creation_change();
 
     my $content = $txn->note || "";
 
diff --git a/lib/App/SD/Replica/trac/PullEncoder.pm b/lib/App/SD/Replica/trac/PullEncoder.pm
index e827775..a84ce2c 100644
--- a/lib/App/SD/Replica/trac/PullEncoder.pm
+++ b/lib/App/SD/Replica/trac/PullEncoder.pm
@@ -239,13 +239,7 @@ sub transcode_one_txn {
 
     $changeset->add_change( { change => $change } ) if $change->has_prop_changes;
 
-    my $comment = Prophet::Change->new(
-        {   record_type => 'comment',
-            record_uuid => $self->sync_source->app_handle->uuid_generator->create_str(),
-             # comments are never edited, we can have a random uuid
-            change_type => 'add_file'
-        }
-    );
+    my $comment = $self->new_comment_creation_change();
 
     if ( my $content = $txn->content ) {
         if ( $content !~ /^\s*$/s ) {

commit f744573a696e658b08fb7a651c40fb3a207d5737
Merge: fe241e2 d5f02b7
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed Aug 12 22:23:59 2009 -0400

    Merge branch 'master' of fsck.com:/git/sd
    
    * 'master' of fsck.com:/git/sd:
      Revert "Loosen usage tests to work around failure where a redefine warning leaks"
      Loosen usage tests to work around failure where a redefine warning leaks


-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list