[svk-commit] r2615 - branches/bm/lib/SVK

nobody at bestpractical.com nobody at bestpractical.com
Tue Nov 27 05:05:05 EST 2007


Author: clkao
Date: Tue Nov 27 05:04:30 2007
New Revision: 2615

Modified:
   branches/bm/lib/SVK/Merge.pm

Log:
Make the base logic comply with the old rules where rebasible
dst-path base takes precedence.


Modified: branches/bm/lib/SVK/Merge.pm
==============================================================================
--- branches/bm/lib/SVK/Merge.pm	(original)
+++ branches/bm/lib/SVK/Merge.pm	Tue Nov 27 05:04:30 2007
@@ -255,14 +255,20 @@
                 $src->is_merged_from($dst->mclone(revision => $rev))) {
 
                 my ($base, $from) = $self->_mk_base_and_from( $src, $dstinfo, $basepath, $baserev );
-                $base = $self->_rebase2( $src, $dst, $base) || $base;
-                @preempt_result = ($base, $from);
+                # this takes precedence than other potential base or
+                # rebasable base that is on src.
+                if (my $rebased = $self->_rebase2( $src, $dst, $base)) {
+                    return ($rebased, $from);
+                }
             }
             elsif ($path eq $src->path && $dst->is_merged_from($src->mclone(revision => $rev))) {
                 my ($base, $from) = $self->_mk_base_and_from( $src, $dstinfo, $basepath, $baserev );
                 $base = $self->_rebase2( $dst, $src, $base) || $base;
                 @preempt_result = ($base, $from);
             }
+            else {
+                @preempt_result = ();
+            }
         }
     }
 
@@ -628,8 +634,7 @@
                 my $t = $src;
                 while (my ($toroot, $fromroot, $path) = $t->nearest_copy) {
                     if ($path eq $self->{base}->path_anchor) {
-                        Carp::cluck unless defined $boundry_rev;
-                        $boundry_rev = List::Util::max( $boundry_rev, $toroot->revision_root_revision );
+                        $boundry_rev = List::Util::max( grep { defined $_ } $boundry_rev, $toroot->revision_root_revision );
                     }
                     $t = $t->mclone( path => $path, revision => $fromroot->revision_root_revision );
                 }


More information about the svk-commit mailing list