From ebaa8c99e67440522c619b2ee8c250191b5d1397 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Wed, 11 Nov 2009 11:32:01 +0000 Subject: [PATCH] Make "./darcs-all optimize --relink" do the right thing --- darcs-all | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/darcs-all b/darcs-all index 9defa0c..08fa8c5 100644 --- a/darcs-all +++ b/darcs-all @@ -125,6 +125,7 @@ sub darcsall { my $path; my $tag; my @repos; + my $command = $_[0]; my ($repo_base, $checked_out_tree) = getrepo(); @@ -148,7 +149,12 @@ sub darcsall { if (-d "$localpath/_darcs") { if ($want_remote_repo) { - darcs (@_, "--repodir", $localpath, $path); + if ($command =~ /^opt/) { + # Allows ./darcs-all optimize --relink + darcs (@_, "--repodir", $localpath, "--sibling=$path"); + } else { + darcs (@_, "--repodir", $localpath, $path); + } } else { darcs (@_, "--repodir", $localpath); } @@ -272,7 +278,7 @@ sub main { # Hack around whatsnew failing if there are no changes $ignore_failure = 1; } - if ($command =~ /^(pul|pus|sen|put)/) { + if ($command =~ /^(pul|pus|sen|put|opt)/) { $want_remote_repo = 1; } darcsall @_; -- 1.7.10.4