From dd605e6061ac68255e7ae7b3e9863f28f5407680 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 13 Feb 2012 14:54:19 -0400 Subject: [PATCH] After checkout, run fixups chdired to the just checked out directory. --- debian/changelog | 1 + mr | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index f5a7318..51a1a32 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,7 @@ mr (1.11) UNRELEASED; urgency=low * Now supports the veracity vcs. Thanks, Jimmy Tang. * vcsh is now supported without including a plugin. + * After checkout, run fixups chdired to the just checked out directory. -- Joey Hess Mon, 09 Jan 2012 17:12:58 -0400 diff --git a/mr b/mr index 7147061..8408c61 100755 --- a/mr +++ b/mr @@ -684,6 +684,7 @@ sub fulldir { sub action { my ($action, $dir, $topdir, $subdir, $force_checkout) = @_; my $fulldir=fulldir($topdir, $subdir); + my $checkout_dir; $ENV{MR_CONFIG}=$configfiles{$topdir}; my $is_checkout=($action eq 'checkout'); @@ -725,6 +726,7 @@ sub action { } if ($is_checkout) { + $checkout_dir=$dir; if (! $force_checkout) { if (-d $dir) { print "mr $action: $dir already exists, skipping checkout\n" if $verbose; @@ -828,7 +830,13 @@ sub action { my $ret=hook("post_$action", $topdir, $subdir); return $ret if $ret != OK; - if (($is_checkout || $is_update)) { + if ($is_checkout || $is_update) { + if ($is_checkout && ! $no_chdir) { + if (! chdir($checkout_dir)) { + print STDERR "mr $action: failed to chdir to $checkout_dir: $!\n"; + return FAILED; + } + } my $ret=hook("fixups", $topdir, $subdir); return $ret if $ret != OK; } -- 2.39.2