[svk-commit] r2546 - in branches/ticket-bug/lib/SVK: Command Editor

nobody at bestpractical.com nobody at bestpractical.com
Thu Oct 18 08:46:38 EDT 2007


Author: clsung
Date: Thu Oct 18 08:46:37 2007
New Revision: 2546

Modified:
   branches/ticket-bug/lib/SVK/Command/Patch.pm
   branches/ticket-bug/lib/SVK/Editor/Merge.pm
   branches/ticket-bug/lib/SVK/Merge.pm
   branches/ticket-bug/lib/SVK/Patch.pm

Log:
- these commit fix some tests
t/07smerge-incremental.t    2   512    15    2  1 4
t/13patch.t                 1   256    49    1  22
t/36push-pull-cross.t       1   256     3    1  2

- remaining failed tests
Failed Test           Stat Wstat Total Fail  List of Failed
-------------------------------------------------------------------------------
t/07smerge-bidi-inc.t    3   768     6    3  4-6
t/36push-pull.t          2   512    15    2  12 14
2 tests and 17 subtests skipped.
Failed 2/113 test scripts. 5/1973 subtests failed.
Files=113, Tests=1973, 512 wallclock secs (105.75 cusr + 32.77 csys = 138.52 CPU)
Failed 2/113 test programs. 5/1973 subtests failed.


Modified: branches/ticket-bug/lib/SVK/Command/Patch.pm
==============================================================================
--- branches/ticket-bug/lib/SVK/Command/Patch.pm	(original)
+++ branches/ticket-bug/lib/SVK/Command/Patch.pm	Thu Oct 18 08:46:37 2007
@@ -239,11 +239,13 @@
     $mergecmd->get_commit_message ($patch->{log})
 	unless $dst->isa('SVK::Path::Checkout');
     my $merge = SVK::Merge->new (%$mergecmd, dst => $dst, repos => $dst->repos);
-    $ticket = sub { $merge->get_new_ticket (SVK::Merge::Info->new ($patch->{ticket})) }
+    my $dstinfo = $merge->merge_info($dst);
+    $ticket = $merge->_get_new_ticket (SVK::Merge::Info->new ($patch->{ticket})) 
 	if $patch->{ticket} && $dst->universal->same_resource ($patch->{target});
     $patch->apply_to ($dst, $mergecmd->get_editor ($dst),
 		      resolve => $merge->resolver,
-		      ticket => $ticket);
+		      ticket => $ticket,
+		      dstinfo => $dstinfo);
     delete $mergecmd->{save_message};
     return;
 }

Modified: branches/ticket-bug/lib/SVK/Editor/Merge.pm
==============================================================================
--- branches/ticket-bug/lib/SVK/Editor/Merge.pm	(original)
+++ branches/ticket-bug/lib/SVK/Editor/Merge.pm	Thu Oct 18 08:46:37 2007
@@ -346,9 +346,9 @@
     $self->{cb_closed}->($path, $checksum, $pool)
         if $self->{cb_closed};
 
-    if ($path eq $self->{target} && $self->{changes} && $self->cb_merged) {
+    if ($path eq $self->{target} && $self->cb_merged) {
 	$self->ensure_open ($path);
-	$self->cb_merged->($self->{ticket});
+	$self->cb_merged->($self->{changes},'file', $self->{ticket});
     }
 
     if (my $baton = $self->{storage_baton}{$path}) {
@@ -693,8 +693,8 @@
     $self->{notify}->flush_dir ($path);
 
     my $baton = $self->{storage_baton}{$path};
-    $self->cb_merged->( $self->{ticket} )
-	if $path eq $self->{target} && $self->{changes} && $self->cb_merged;
+    $self->cb_merged->( $self->{changes}, 'dir', $self->{ticket})
+	if $path eq $self->{target} && $self->cb_merged;
 
 
     $self->{storage}->close_directory ($baton, $pool);

Modified: branches/ticket-bug/lib/SVK/Merge.pm
==============================================================================
--- branches/ticket-bug/lib/SVK/Merge.pm	(original)
+++ branches/ticket-bug/lib/SVK/Merge.pm	Thu Oct 18 08:46:37 2007
@@ -568,7 +568,13 @@
 	    ticket =>
 	    $self->_get_new_ticket($self->merge_info_with_copy($src)->add_target($src)),
 	    cb_merged => sub {
-		my ($ticket) = @_;
+		my ($changes, $type, $ticket) = @_;
+		if (!$changes) { # rollback all ticket
+		    my $func = "change_${type}_prop";
+		    my $baton = $storage->open_root ($cb{cb_rev}->($cb{target}||''));
+		    $storage->$func( $baton, 'svk:merge', undef );
+		    return;
+		}
 		$self->print_new_ticket( $dstinfo, $ticket ) unless $self->{quiet};
 	    }
 	  ) :

Modified: branches/ticket-bug/lib/SVK/Patch.pm
==============================================================================
--- branches/ticket-bug/lib/SVK/Patch.pm	(original)
+++ branches/ticket-bug/lib/SVK/Patch.pm	Thu Oct 18 08:46:37 2007
@@ -292,6 +292,16 @@
 	      : ()
 	  ),
 	  %cb,
+	  cb_merged => sub {
+	      my ($changes, $type, $ticket) = @_;
+	      if (!$changes) { # rollback all ticket
+		  my $func = "change_${type}_prop";
+		  my $baton = $storage->open_root ($cb{cb_rev}->($cb{target}||''));
+		  $storage->$func( $baton, 'svk:merge', undef );
+		  return;
+	      }
+	      SVK::Merge->print_new_ticket( $cb{dstinfo}, $ticket );
+	  }
 	);
     $self->{editor}->drive ($editor);
     return $editor->{conflicts};


More information about the svk-commit mailing list