]> git.madduck.net Git - code/myrepos.git/blobdiff - mr

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:

* Fix a bug in inheritance of default settings in chained .mrconfig files.
[code/myrepos.git] / mr
diff --git a/mr b/mr
index f725318b0dfea0f69f67d57a4ed25a8123245a8f..adc05464671b0644be5e04b2b8167c6b89202cb6 100755 (executable)
--- a/mr
+++ b/mr
@@ -39,7 +39,7 @@ working directory. Or, if you are in a subdirectory of a repository that
 contains no other registered repositories, it will stay in that directory,
 and work on only that repository,
 
-The predefined commands should be fairly familiar to users of any revision
+These predefined commands should be fairly familiar to users of any revision
 control system:
 
 =over 4
@@ -74,6 +74,12 @@ Show a diff of uncommitted changes.
 
 Show the commit log.
 
+=back
+
+These commands are also available:
+
+=over 4
+
 =item list (or ls)
 
 List the repositories that mr will act on.
@@ -512,7 +518,10 @@ sub loadconfig { #{{{
 
                # copy in defaults from first parent
                my $parent=$dir;
-               while ($parent=~s/^(.*)\/[^\/]+\/?$/$1/) {
+               while ($parent=~s/^(.*\/)[^\/]+\/?$/$1/) {
+                       if ($parent eq '/') {
+                               $parent="";
+                       }
                        if (exists $config{$parent} &&
                            exists $config{$parent}{DEFAULT}) {
                                $config{$dir}{DEFAULT}={ %{$config{$parent}{DEFAULT}} };
@@ -527,8 +536,10 @@ sub loadconfig { #{{{
        close $in;
 
        my $section;
+       my $line=0;
        while (@lines) {
                $_=shift @lines;
+               $line++;
                chomp;
                next if /^\s*\#/ || /^\s*$/;
                if (/^\[([^\]]*)\]\s*$/) {
@@ -541,6 +552,7 @@ sub loadconfig { #{{{
                        # continued value
                        while (@lines && $lines[0]=~/^\s(.+)/) {
                                shift(@lines);
+                               $line++;
                                $value.="\n$1";
                                chomp $value;
                        }
@@ -572,7 +584,7 @@ sub loadconfig { #{{{
                        }
                }
                else {
-                       die "$f line $.: parse error\n";
+                       die "$f line $line: parse error\n";
                }
        }
 
@@ -806,4 +818,5 @@ config =
 
 ed = echo "A horse is a horse, of course, of course.."
 T = echo "I pity the fool."
+right = echo "Not found."
 #}}}