[svk-commit] r3122 - in branches/delta-refactor/lib/SVK: Root

nobody at bestpractical.com nobody at bestpractical.com
Mon Nov 3 10:54:21 EST 2008


Author: clkao
Date: Mon Nov  3 10:54:21 2008
New Revision: 3122

Modified:
   branches/delta-refactor/lib/SVK/Delta.pm
   branches/delta-refactor/lib/SVK/Root/Checkout.pm

Log:
use dir_entries in delta_dir for new entries.

Modified: branches/delta-refactor/lib/SVK/Delta.pm
==============================================================================
--- branches/delta-refactor/lib/SVK/Delta.pm	(original)
+++ branches/delta-refactor/lib/SVK/Delta.pm	Mon Nov  3 10:54:21 2008
@@ -374,23 +374,8 @@
     my @direntries;
     # if we are at somewhere arg{copath} not exist, $arg{type} is empty
     if ($arg{type} && !(defined $targets && !keys %$targets)) {
-	opendir my ($dir), $target->copath or Carp::confess "$target->copath: $!";
-	for (readdir($dir)) {
-	    # Completely deny the existance of .svk; we shouldn't
-	    # show this even with e.g. --no-ignore.
-	    next if $_ eq '.svk' and $self->xd->{floating};
-
-	    if (eval {from_native($_, 'path', $arg{encoder}); 1}) {
-		push @direntries, $_;
-	    }
-	    elsif ($arg{auto_add}) { # fatal for auto_add
-		die "$_: $@";
-	    }
-	    else {
-		print "$_: $@";
-	    }
-	}
-	@direntries = sort grep { !m/^\.+$/ && !exists $entries->{$_} } @direntries;
+        my $new_entries = $target->root->dir_entries($target->path_anchor, $pool);
+        @direntries = sort grep { !exists $entries->{$_} } keys %$new_entries;
     }
 
     for my $entry (@direntries) {

Modified: branches/delta-refactor/lib/SVK/Root/Checkout.pm
==============================================================================
--- branches/delta-refactor/lib/SVK/Root/Checkout.pm	(original)
+++ branches/delta-refactor/lib/SVK/Root/Checkout.pm	Mon Nov  3 10:54:21 2008
@@ -50,7 +50,8 @@
 # END BPS TAGGED BLOCK }}}
 package SVK::Root::Checkout;
 use strict;
-use SVK::Util qw(abs2rel md5_fh is_symlink from_native to_native );
+use SVK::Util qw(abs2rel md5_fh is_symlink from_native to_native get_encoder );
+use SVK::Logger;
 
 use base qw{ Class::Accessor::Fast };
 
@@ -154,12 +155,20 @@
 sub dir_entries {
     my ($self, $path, $pool) = @_;
     my ($copath,$root) = $self->_get_copath($path, $pool);
-
-    my $entries = $root->dir_entries($path, $pool);
+    my $entries = $root->check_path($path, $pool) == $SVN::Node::dir
+        ? $root->dir_entries($path, $pool)  : {};
     my $coentries;
     opendir my ($dir), $copath or die "$copath: $!";
     for (readdir($dir)) {
 	next if m/^\.+$/;
+        next if $_ eq '.svk' and $self->path->xd->{floating};
+
+        unless (eval {from_native($_, 'path', get_encoder()); 1}) {
+            # XXX: warning etc, and make it possible to become fatal in some case
+            $logger->warn("$_: $@");
+            next;
+        }
+
 	lstat $_;
 	my $kind = -d _ ? $SVN::Node::dir : $SVN::Node::file;
 	if ($entries->{$_} && $kind == $entries->{$_}->kind) {


More information about the svk-commit mailing list