]> git.madduck.net Git - code/myrepos.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

After checkout, run fixups chdired to the just checked out directory.
authorJoey Hess <joey@kitenet.net>
Mon, 13 Feb 2012 18:54:19 +0000 (14:54 -0400)
committerJoey Hess <joey@kitenet.net>
Mon, 13 Feb 2012 18:54:19 +0000 (14:54 -0400)
debian/changelog
mr

index f5a731840824830e25f1bdcf2a69b863b3e55d22..51a1a326d896f3f591a9dec77946488a07dcebd9 100644 (file)
@@ -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.
 
   * 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 <joeyh@debian.org>  Mon, 09 Jan 2012 17:12:58 -0400
 
 
  -- Joey Hess <joeyh@debian.org>  Mon, 09 Jan 2012 17:12:58 -0400
 
diff --git a/mr b/mr
index 7147061b2019a93d5e889c3b40ffa6f87d24c17a..8408c61d5407d56301f081e000b01bf02d0a547f 100755 (executable)
--- a/mr
+++ b/mr
@@ -684,6 +684,7 @@ sub fulldir {
 sub action {
        my ($action, $dir, $topdir, $subdir, $force_checkout) = @_;
        my $fulldir=fulldir($topdir, $subdir);
 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');
 
        $ENV{MR_CONFIG}=$configfiles{$topdir};
        my $is_checkout=($action eq 'checkout');
@@ -725,6 +726,7 @@ sub action {
        }
 
        if ($is_checkout) {
        }
 
        if ($is_checkout) {
+               $checkout_dir=$dir;
                if (! $force_checkout) {
                        if (-d $dir) {
                                print "mr $action: $dir already exists, skipping checkout\n" if $verbose;
                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;
                        
                        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;
                        }
                                my $ret=hook("fixups", $topdir, $subdir);
                                return $ret if $ret != OK;
                        }