From: Joey Hess Date: Mon, 13 Feb 2012 18:54:19 +0000 (-0400) Subject: After checkout, run fixups chdired to the just checked out directory. X-Git-Url: https://git.madduck.net/code/myrepos.git/commitdiff_plain/dd605e6061ac68255e7ae7b3e9863f28f5407680 After checkout, run fixups chdired to the just checked out directory. --- 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; }