From c4d33b212288918c9e1b4c4e56dc8ddd07bc4089 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 3 Nov 2007 13:59:06 -0400 Subject: [PATCH 1/1] * Avoid creating parent directory for a checkout that will ultimately be skipped. --- debian/changelog | 7 +++++++ mr | 13 ++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/debian/changelog b/debian/changelog index 63d81bb..09aef68 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +mr (0.12) UNRELEASED; urgency=low + + * Avoid creating parent directory for a checkout that will ultimately be + skipped. + + -- Joey Hess Sat, 03 Nov 2007 13:58:39 -0400 + mr (0.11) unstable; urgency=low * Avoid using commands like git-config and instead use "git config". diff --git a/mr b/mr index 62c6be8..be7d283 100755 --- a/mr +++ b/mr @@ -388,11 +388,6 @@ sub action { #{{{ } $dir=~s/^(.*)\/[^\/]+\/?$/$1/; - - if (! -d $dir) { - print "mr $action: creating parent directory $dir\n" if $verbose; - system("mkdir", "-p", $dir); - } } elsif ($action =~ /update/) { if (! -d $dir) { @@ -401,7 +396,6 @@ sub action { #{{{ } $ENV{MR_REPO}=$dir; - my $skiptest=findcommand("skip", $dir, $topdir, $subdir); my $command=findcommand($action, $dir, $topdir, $subdir); @@ -425,7 +419,12 @@ sub action { #{{{ return SKIPPED; } } - + + if ($action eq 'checkout' && ! -d $dir) { + print "mr $action: creating parent directory $dir\n" if $verbose; + system("mkdir", "-p", $dir); + } + if (! $no_chdir && ! chdir($dir)) { print STDERR "mr $action: failed to chdir to $dir: $!\n"; return FAILED; -- 2.39.5