[svk-commit] r3136 - in branches/git-storage/lib/SVK: Command

nobody at bestpractical.com nobody at bestpractical.com
Thu Nov 6 03:18:34 EST 2008


Author: clsung
Date: Thu Nov  6 03:18:34 2008
New Revision: 3136

Modified:
   branches/git-storage/lib/SVK/Command/Update.pm
   branches/git-storage/lib/SVK/XD.pm

Log:
- to pass until 8th test (11checkout.t)

Modified: branches/git-storage/lib/SVK/Command/Update.pm
==============================================================================
--- branches/git-storage/lib/SVK/Command/Update.pm	(original)
+++ branches/git-storage/lib/SVK/Command/Update.pm	Thu Nov  6 03:18:34 2008
@@ -185,7 +185,7 @@
     unless (-e $cotarget->copath) {
 	die loc ("Checkout directory gone. Use 'checkout %1 %2' instead.\n",
 		 $update_target->depotpath, $cotarget->report)
-	    unless $base->path_anchor eq '/';
+	    unless $base->path_anchor eq '/' or $xdroot->isa('SVK::Root::Git');
 	mkdir ($cotarget->copath) or
 	    die loc ("Can't create directory %1 for checkout: %2.\n", $cotarget->report, $!);
     }

Modified: branches/git-storage/lib/SVK/XD.pm
==============================================================================
--- branches/git-storage/lib/SVK/XD.pm	(original)
+++ branches/git-storage/lib/SVK/XD.pm	Thu Nov  6 03:18:34 2008
@@ -991,7 +991,9 @@
     # XXX: basically the Git root delta
     $editor->open_root ('GIT');
 
-    my @files = grep { $_ =~ s/^\+\+\+ b\/(.+)$/$1/; } split /\n/,$textdiff;
+    my $src_parent_dir = $arg{oldpath}[0];
+    $src_parent_dir =~ s#^/##;
+    my @files = grep { $_ =~ s/^\+\+\+ b\/$src_parent_dir\/?(.+)$/$1/; } split /\n/,$textdiff;
     my %dirs;
     for my $file (@files) {
         my $dir = Path::Class::file($file)->dir();
@@ -1004,11 +1006,13 @@
         } while ( $dir ne '.' and $dir ne '..' );
     }
     for my $dir (sort keys %dirs) {
-        my $botan = $editor->add_directory ($dir, '', undef, undef);
+        my $botan = $dir eq '.' ?
+            $editor->open_directory ($dir, '', undef, undef) :
+            $editor->add_directory ($dir, '', undef, undef);
         for my $file (sort @{$dirs{$dir}}) {
             next unless $file;
             my $botan2 = $editor->add_file($file, $dir);
-            my $glob = $oldroot->file_contents($file);
+            my $glob = $oldroot->file_contents($src_parent_dir.'/'.$file);
             my $handle = $editor->apply_textdelta($file);
             if ($handle && $#{$handle} >= 0) {
                 SVN::TxDelta::send_stream ($glob, @$handle,undef);


More information about the svk-commit mailing list