]> git.madduck.net Git - code/myrepos.git/blob - 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:

add support for getting config settings
[code/myrepos.git] / mr
1 #!/usr/bin/perl
2
3 =head1 NAME
4
5 mr - a Multiple Repository management tool
6
7 =head1 SYNOPSIS
8
9 B<mr> [options] checkout
10
11 B<mr> [options] update
12
13 B<mr> [options] status
14
15 B<mr> [options] commit [-m "message"]
16
17 B<mr> [options] diff
18
19 B<mr> [options] log
20
21 B<mr> [options] register [repository]
22
23 B<mr> [options] config section [parameter=[value] ...]
24
25 B<mr> [options] action [params ...]
26
27 =head1 DESCRIPTION
28
29 B<mr> is a Multiple Repository management tool. It allows you to register a
30 set of repositories in a .mrconfig file, and then checkout, update, or
31 perform other actions on the repositories as if they were one big
32 respository.
33
34 Any mix of revision control systems can be used with B<mr>, and you can
35 define arbitrary actions for commands like "update", "checkout", or "commit".
36
37 B<mr> cds into and operates on all registered repsitories at or below your
38 working directory. Or, if you are in a subdirectory of a repository that
39 contains no other registered repositories, it will stay in that directory,
40 and work on only that repository,
41
42 The predefined commands should be fairly familiar to users of any revision
43 control system:
44
45 =over 4
46
47 =item checkout (or co)
48
49 Checks out any repositories that are not already checked out.
50
51 =item update
52
53 Updates each repository from its configured remote repository.
54
55 If a repository isn't checked out yet, it will first check it out.
56
57 =item status
58
59 Displays a status report for each repository, showing what
60 uncommitted changes are present in the repository.
61
62 =item commit (or ci)
63
64 Commits changes to each repository. (By default, changes are pushed to the
65 remote repository too, when using distributed systems like git.)
66
67 The optional -m parameter allows specifying a commit message.
68
69 =item diff
70
71 Show a diff of uncommitted changes.
72
73 =item log
74
75 Show the commit log.
76
77 =item list (or ls)
78
79 List the repositories that mr will act on.
80
81 =item register
82
83 Register an existing repository in the mrconfig file. By default, the
84 epository in the current directory is registered, or you can specify a
85 directory to register.
86
87 =item config
88
89 Adds, modifies, removed, or prints a value from the mrconfig file. The next
90 parameter is the name of the section the value is in. To add or modify a
91 value, follow it by one or more instances of "parameter=value". Use
92 "parameter=" to remove a parameter. Use just "parameter" to get the value
93 of a parameter.
94
95 For example, to add (or edit) a repository in src/foo:
96
97   mr config src/foo checkout="svn co svn://example.com/foo/trunk foo"
98
99 =item help
100
101 Displays this help.
102
103 =back
104
105 Actions can be abbreviated to any unambiguous subsctring, so
106 "mr st" is equivilant to "mr status", and "mr up" is equivilant to "mr
107 update"
108
109 Additional parameters can be passed to most commands, and are passed on
110 unchanged to the underlying revision control system. This is mostly useful
111 if the repositories mr will act on all use the same revision control
112 system.
113
114 =head1 OPTIONS
115
116 =over 4
117
118 =item -d directory
119
120 Specifies the topmost directory that B<mr> should work in. The default is
121 the current working directory.
122
123 =item -c mrconfig
124
125 Use the specified mrconfig file, instead of looking for one in your home
126 directory.
127
128 =item -v
129
130 Be verbose.
131
132 =back
133
134 =head1 FILES
135
136 B<mr> is configured by .mrconfig files. It starts by reading the .mrconfig
137 file in your home directory, and this can in turn chain load .mrconfig files
138 from repositories.
139
140 Here is an example .mrconfig file:
141
142   [src]
143   checkout = svn co svn://svn.example.com/src/trunk src
144   chain = true
145
146   [src/linux-2.6]
147   checkout = git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
148
149 The .mrconfig file uses a variant of the INI file format. Lines starting with
150 "#" are comments. Lines ending with "\" are continued on to the next line.
151
152 The "DEFAULT" section allows setting default values for the sections that
153 come after it.
154
155 The "ALIAS" section allows adding aliases for actions. Each parameter
156 is an alias, and its value is the action to use.
157
158 All other sections add repositories. The section header specifies the
159 directory where the repository is located. This is relative to the directory
160 that contains the mrconfig file, but you can also choose to use absolute
161 paths.
162
163 Within a section, each parameter defines a shell command to run to handle a
164 given action. mr contains default handlers for the "update", "status", and
165 "commit" actions, so normally you only need to specify what to do for
166 "checkout".
167
168 Note that these shell commands are run in a "set -e" shell
169 environment, where any additional parameters you pass are available in
170 "$@". The "checkout" command is run in the parent of the repository
171 directory, since the repository isn't checked out yet. All other commands
172 are run inside the repository, though not necessarily at the top of it.
173 The "MR_REPO" environment variable is set to the path to the top of the
174 repository.
175
176 A few parameters have special meanings:
177
178 =over 4
179
180 =item skip
181
182 If the "skip" parameter is set and its command returns nonzero, then B<mr>
183 will skip acting on that repository.
184
185 =item chain
186
187 If the "chain" parameter is set and its command returns nonzero, then B<mr>
188 will try to load a .mrconfig file from the root of the repository. (You
189 should avoid chaining from repositories with untrusted committers.)
190
191 =item deleted
192
193 If the "deleted" parameter is set and its command returns nonzero, then
194 B<mr> will treat the repository as deleted. It won't ever actually delete
195 the repository, but it will warn if it sees the repsoitory's directory.
196 This is useful when one mrconfig file is shared amoung multiple machines,
197 to keep track of and remember to delete old repositories.
198
199 =item lib
200
201 The "lib" parameter can specify some shell code that will be run before each
202 command, this can be a useful way to define shell functions for other commands
203 to use.
204
205 =back
206
207 =head1 AUTHOR
208
209 Copyright 2007 Joey Hess <joey@kitenet.net>
210
211 Licensed under the GNU GPL version 2 or higher.
212
213 http://kitenet.net/~joey/code/mr/
214
215 =cut
216
217 use warnings;
218 use strict;
219 use Getopt::Long;
220 use Cwd qw(getcwd abs_path);
221
222 my $directory=getcwd();
223 my $config="$ENV{HOME}/.mrconfig";
224 my $verbose=0;
225 my %config;
226 my %knownactions;
227 my %alias;
228
229 Getopt::Long::Configure("no_permute");
230 my $result=GetOptions(
231         "d|directory=s" => sub { $directory=abs_path($_[1]) },
232         "c|config=s" => \$config,
233         "verbose" => \$verbose,
234 );
235 if (! $result || @ARGV < 1) {
236         die("Usage: mr [-d directory] action [params ...]\n".
237             "(Use mr help for man page.)\n");
238
239 }
240
241 loadconfig(\*DATA);
242 loadconfig($config);
243 #use Data::Dumper;
244 #print Dumper(\%config);
245
246 eval {
247         use FindBin qw($Bin $Script);
248         $ENV{MR_PATH}=$Bin."/".$Script;
249 };
250
251 # alias expansion and command stemming
252 my $action=shift @ARGV;
253 if (exists $alias{$action}) {
254         $action=$alias{$action};
255 }
256 if (! exists $knownactions{$action}) {
257         my @matches = grep { /^\Q$action\E/ }
258                 keys %knownactions, keys %alias;
259         if (@matches == 1) {
260                 $action=$matches[0];
261         }
262         elsif (@matches == 0) {
263                 die "mr: unknown action \"$action\" (known actions: ".
264                         join(", ", sort keys %knownactions).")\n";
265         }
266         else {
267                 die "mr: ambiguous action \"$action\" (matches: ".
268                         join(", ", @matches).")\n";
269         }
270 }
271
272 if ($action eq 'help') {
273         exec($config{''}{DEFAULT}{$action}) || die "exec: $!";
274 }
275 elsif ($action eq 'config') {
276         if (@ARGV < 2) {
277                 die "mr config: not enough parameters\n";
278         }
279         my $section=shift;
280         if ($section=~/^\//) {
281                 # try to convert to a path relative to $config's dir
282                 my ($dir)=$config=~/^(.*\/)[^\/]+$/;
283                 if ($section=~/^\Q$dir\E(.*)/) {
284                         $section=$1;
285                 }
286         }
287         my %changefields;
288         foreach (@ARGV) {
289                 if (/^([^=]+)=(.*)$/) {
290                         $changefields{$1}=$2;
291                 }
292                 else {
293                         foreach my $topdir (sort keys %config) {
294                                 if (exists $config{$topdir}{$section} &&
295                                     exists $config{$topdir}{$section}{$_}) {
296                                         print $config{$topdir}{$section}{$_}."\n";
297                                 }
298                         }
299                 }
300         }
301         modifyconfig($config, $section, %changefields) if %changefields;
302         exit 0;
303 }
304 elsif ($action eq 'register') {
305         my $command="set -e; ".$config{''}{DEFAULT}{lib}."\n".
306                 "my_action(){ $config{''}{DEFAULT}{$action}\n }; my_action ".
307                 join(" ", map { s/\//\/\//g; s/"/\"/g; '"'.$_.'"' } @ARGV);
308         print STDERR "mr $action: running >>$command<<\n" if $verbose;
309         exec($command) || die "exec: $!";
310 }
311
312 # work out what repos to act on
313 my @repos;
314 my $nochdir=0;
315 foreach my $topdir (sort keys %config) {
316         foreach my $subdir (sort keys %{$config{$topdir}}) {
317                 next if $subdir eq 'DEFAULT';
318                 my $dir=($subdir =~/^\//) ? $subdir : $topdir.$subdir;
319                 my $d=$directory;
320                 $dir.="/" unless $dir=~/\/$/;
321                 $d.="/" unless $d=~/\/$/;
322                 next if $dir ne $directory && $dir !~ /^\Q$directory\E/;
323                 push @repos, [$dir, $topdir, $subdir];
324         }
325 }
326 if (! @repos) {
327         # fallback to find a leaf repo
328         LEAF: foreach my $topdir (reverse sort keys %config) {
329                 foreach my $subdir (reverse sort keys %{$config{$topdir}}) {
330                         next if $subdir eq 'DEFAULT';
331                         my $dir=($subdir =~/^\//) ? $subdir : $topdir.$subdir;
332                         my $d=$directory;
333                         $dir.="/" unless $dir=~/\/$/;
334                         $d.="/" unless $d=~/\/$/;
335                         if ($d=~/^\Q$dir\E/) {
336                                 push @repos, [$dir, $topdir, $subdir];
337                                 last LEAF;
338                         }
339                 }
340         }
341         $nochdir=1;
342 }
343
344 my (@failed, @successful, @skipped);
345 foreach my $repo (@repos) {
346         action($action, @$repo);
347 }
348
349 sub action {
350         my ($action, $dir, $topdir, $subdir) = @_;
351         
352         my $lib= exists $config{$topdir}{$subdir}{lib} ?
353                         $config{$topdir}{$subdir}{lib}."\n" : "";
354
355         if (exists $config{$topdir}{$subdir}{deleted}) {
356                 if (! -d $dir) {
357                         return;
358                 }
359                 else {
360                         my $test="set -e;".$lib.$config{$topdir}{$subdir}{deleted};
361                         print "mr $action: running deleted test >>$test<<\n" if $verbose;
362                         my $ret=system($test);
363                         if ($ret >> 8 == 0) {
364                                 print STDERR "mr error: $dir should be deleted yet still exists\n\n";
365                                 push @failed, $dir;
366                                 return;
367                         }
368                 }
369         }
370
371         if ($action eq 'checkout') {
372                 if (-d $dir) {
373                         print "mr $action: $dir already exists, skipping checkout\n" if $verbose;
374                         push @skipped, $dir;
375                         return;
376                 }
377                 $dir=~s/^(.*)\/[^\/]+\/?$/$1/;
378         }
379         elsif ($action eq 'update') {
380                 if (! -d $dir) {
381                         return action("checkout", $dir, $topdir, $subdir);
382                 }
383         }
384         
385         $ENV{MR_REPO}=$dir;
386
387         if (exists $config{$topdir}{$subdir}{skip}) {
388                 my $test="set -e;".$lib.$config{$topdir}{$subdir}{skip};
389                 print "mr $action: running skip test >>$test<<\n" if $verbose;
390                 my $ret=system($test);
391                 if ($ret >> 8 == 0) {
392                         print "mr $action: $dir skipped per config file\n" if $verbose;
393                         push @skipped, $dir;
394                         return;
395                 }
396         }
397         
398         if (! $nochdir && ! chdir($dir)) {
399                 print STDERR "mr $action: failed to chdir to $dir: $!\n";
400                 push @failed, $dir;
401         }
402         elsif (! exists $config{$topdir}{$subdir}{$action}) {
403                 print STDERR "mr $action: no defined $action command for $topdir$subdir, skipping\n";
404                 push @skipped, $dir;
405         }
406         else {
407                 if (! $nochdir) {
408                         print "mr $action: $topdir$subdir\n";
409                 }
410                 else {
411                         print "mr $action: $topdir$subdir (in subdir $directory)\n";
412                 }
413                 my $command="set -e; ".$lib.
414                         "my_action(){ $config{$topdir}{$subdir}{$action}\n }; my_action ".
415                         join(" ", map { s/\//\/\//g; s/"/\"/g; '"'.$_.'"' } @ARGV);
416                 print STDERR "mr $action: running >>$command<<\n" if $verbose;
417                 my $ret=system($command);
418                 if ($ret != 0) {
419                         print STDERR "mr $action: failed ($ret)\n" if $verbose;
420                         push @failed, $dir;
421                         if ($ret >> 8 != 0) {
422                                 print STDERR "mr $action: command failed\n";
423                         }
424                         elsif ($ret != 0) {
425                                 print STDERR "mr $action: command died ($ret)\n";
426                         }
427                 }
428                 else {
429                         push @successful, $dir;
430                 }
431
432                 print "\n";
433         }
434 }
435
436 sub showstat {
437         my $count=shift;
438         my $singular=shift;
439         my $plural=shift;
440         if ($count) {
441                 return "$count ".($count > 1 ? $plural : $singular);
442         }
443         return;
444 }
445 if (! @successful && ! @failed && ! @skipped) {
446         die "mr $action: no repositories found to work on\n";
447 }
448 print "mr $action: finished (".join("; ",
449         showstat($#successful+1, "successful", "successful"),
450         showstat($#failed+1, "failed", "failed"),
451         showstat($#skipped+1, "skipped", "skipped"),
452 ).")\n";
453 if (@failed) {
454         exit 1;
455 }
456 elsif (! @successful && @skipped) {
457         exit 1;
458 }
459 exit 0;
460
461 my %loaded;
462 sub loadconfig {
463         my $f=shift;
464
465         my @toload;
466
467         my $in;
468         my $dir;
469         if (ref $f eq 'GLOB') {
470                 $in=$f; 
471                 $dir="";
472         }
473         else {
474                 if (! -e $f) {
475                         return;
476                 }
477
478                 my $absf=abs_path($f);
479                 if ($loaded{$absf}) {
480                         return;
481                 }
482                 $loaded{$absf}=1;
483
484                 print "mr: loading config $f\n" if $verbose;
485                 open($in, "<", $f) || die "mr: open $f: $!\n";
486                 ($dir)=$f=~/^(.*\/)[^\/]+$/;
487                 if (! defined $dir) {
488                         $dir=".";
489                 }
490                 $dir=abs_path($dir)."/";
491
492                 # copy in defaults from first parent
493                 my $parent=$dir;
494                 while ($parent=~s/^(.*)\/[^\/]+\/?$/$1/) {
495                         if (exists $config{$parent} &&
496                             exists $config{$parent}{DEFAULT}) {
497                                 $config{$dir}{DEFAULT}={ %{$config{$parent}{DEFAULT}} };
498                                 last;
499                         }
500                 }
501         }
502
503         my $section;
504         while (<$in>) {
505                 chomp;
506                 next if /^\s*\#/ || /^\s*$/;
507                 if (/^\s*\[([^\]]*)\]\s*$/) {
508                         $section=$1;
509                 }
510                 elsif (/^\s*(\w+)\s*=\s*(.*)/) {
511                         my $parameter=$1;
512                         my $value=$2;
513
514                         # continuation line
515                         while ($value=~/(.*)\\$/s) {
516                                 $value=$1."\n".<$in>;
517                                 chomp $value;
518                         }
519
520                         if (! defined $section) {
521                                 die "$f line $.: parameter ($parameter) not in section\n";
522                         }
523                         if ($section ne 'ALIAS' &&
524                             ! exists $config{$dir}{$section} &&
525                             exists $config{$dir}{DEFAULT}) {
526                                 # copy in defaults
527                                 $config{$dir}{$section}={ %{$config{$dir}{DEFAULT}} };
528                         }
529                         if ($section eq 'ALIAS') {
530                                 $alias{$parameter}=$value;
531                         }
532                         elsif ($parameter eq 'lib') {
533                                 $config{$dir}{$section}{lib}.=$value."\n";
534                         }
535                         else {
536                                 $config{$dir}{$section}{$parameter}=$value;
537                                 $knownactions{$parameter}=1;
538                                 if ($parameter eq 'chain' &&
539                                     length $dir && $section ne "DEFAULT" &&
540                                     -e $dir.$section."/.mrconfig" &&
541                                     system($value) >> 8 == 0) {
542                                         push @toload, $dir.$section."/.mrconfig";
543                                 }
544                         }
545                 }
546                 else {
547                         die "$f line $.: parse error\n";
548                 }
549         }
550         close $in;
551
552         foreach (@toload) {
553                 loadconfig($_);
554         }
555 }
556
557 sub modifyconfig {
558         my $f=shift;
559         # the section to modify or add
560         my $targetsection=shift;
561         # fields to change in the section
562         # To remove a field, set its value to "".
563         my %changefields=@_;
564
565         my @lines;
566         my @out;
567
568         if (-e $f) {
569                 open(my $in, "<", $f) || die "mr: open $f: $!\n";
570                 @lines=<$in>;
571                 close $in;
572         }
573
574         my $addfields=sub {
575                 my @blanks;
576                 while ($out[$#out] =~ /^\s*$/) {
577                         unshift @blanks, pop @out;
578                 }
579                 foreach my $field (sort keys %changefields) {
580                         if (length $changefields{$field}) {
581                                 push @out, "$field = $changefields{$field}\n";
582                         }
583                 }
584                 push @out, @blanks;
585         };
586
587         my $section;
588         while (@lines) {
589                 $_=shift(@lines);
590
591                 if (/^\s*\#/ || /^\s*$/) {
592                         push @out, $_;
593                 }
594                 elsif (/^\s*\[([^\]]*)\]\s*$/) {
595                         if (defined $section && 
596                             $section eq $targetsection) {
597                                 $addfields->();
598                         }
599
600                         $section=$1;
601
602                         push @out, $_;
603                 }
604                 elsif (/^\s*(\w+)\s*=\s(.*)/) {
605                         my $parameter=$1;
606                         my $value=$2;
607
608                         # continuation line
609                         while ($value=~/(.*\\)$/s) {
610                                 $value=$1."\n".shift(@lines);
611                                 chomp $value;
612                         }
613
614                         if ($section eq $targetsection) {
615                                 if (exists $changefields{$parameter}) {
616                                         if (length $changefields{$parameter}) {
617                                                 $value=$changefields{$parameter};
618                                         }
619                                         delete $changefields{$parameter};
620                                 }
621                         }
622
623                         push @out, "$parameter = $value\n";
624                 }
625         }
626
627         if (defined $section && 
628             $section eq $targetsection) {
629                         $addfields->();
630         }
631         elsif (%changefields) {
632                 push @out, "\n[$targetsection]\n";
633                 foreach my $field (sort keys %changefields) {
634                         if (length $changefields{$field}) {
635                                 push @out, "$field = $changefields{$field}\n";
636                         }
637                 }
638         }
639
640         open(my $out, ">", $f) || die "mr: write $f: $!\n";
641         print $out @out;
642         close $out;     
643 }
644
645 # Finally, some useful actions that mr knows about by default.
646 # These can be overridden in ~/.mrconfig.
647 __DATA__
648 [ALIAS]
649         co = checkout
650         ci = commit
651         ls = list
652
653 [DEFAULT]
654 lib =                                                   \
655         error() {                                       \
656                 echo "mr: $@" >&2                       \
657                 exit 1                                  \
658         }
659
660 update =                                                \
661         if [ -d "$MR_REPO"/.svn ]; then                 \
662                 svn update "$@"                         \
663         elif [ -d "$MR_REPO"/.git ]; then               \
664                 git pull origin master "$@"             \
665         elif [ -d "$MR_REPO"/.bzr ]; then               \
666                 bzr merge "$@"                          \
667         elif [ -d "$MR_REPO"/CVS ]; then                \
668                 cvs update "$@"                         \
669         else                                            \
670                 error "unknown repo type"               \
671         fi
672 status =                                                \
673         if [ -d "$MR_REPO"/.svn ]; then                 \
674                 svn status "$@"                         \
675         elif [ -d "$MR_REPO"/.git ]; then               \
676                 git status "$@" || true                 \
677         elif [ -d "$MR_REPO"/.bzr ]; then               \
678                 bzr status "$@"                         \
679         elif [ -d "$MR_REPO"/CVS ]; then                \
680                 cvs status "$@"                         \
681         else                                            \
682                 error "unknown repo type"               \
683         fi
684 commit =                                                \
685         if [ -d "$MR_REPO"/.svn ]; then                 \
686                 svn commit "$@"                         \
687         elif [ -d "$MR_REPO"/.git ]; then               \
688                 git commit -a "$@" && git push --all    \
689         elif [ -d "$MR_REPO"/.bzr ]; then               \
690                 bzr commit "$@" && bzr push             \
691         elif [ -d "$MR_REPO"/CVS ]; then                \
692                 cvs commit "$@"                         \
693         else                                            \
694                 error "unknown repo type"               \
695         fi
696 diff =                                                  \
697         if [ -d "$MR_REPO"/.svn ]; then                 \
698                 svn diff "$@"                           \
699         elif [ -d "$MR_REPO"/.git ]; then               \
700                 git diff "$@"                           \
701         elif [ -d "$MR_REPO"/.bzr ]; then               \
702                 bzr diff "$@"                           \
703         elif [ -d "$MR_REPO"/CVS ]; then                \
704                 cvs diff "$@"                           \
705         else                                            \
706                 error "unknown repo type"               \
707         fi
708 log =                                                   \
709         if [ -d "$MR_REPO"/.svn ]; then                 \
710                 svn log"$@"                             \
711         elif [ -d "$MR_REPO"/.git ]; then               \
712                 git log "$@"                            \
713         elif [ -d "$MR_REPO"/.bzr ]; then               \
714                 bzr log "$@"                            \
715         elif [ -d "$MR_REPO"/CVS ]; then                \
716                 cvs log "$@"                            \
717         else                                            \
718                 error "unknown repo type"               \
719         fi
720 register =                                                              \
721         if [ -n "$1" ]; then                                            \
722                 cd "$1"                                                 \
723         fi                                                              \
724         basedir="$(basename $(pwd))"                                    \
725         if [ -d .svn ]; then                                            \
726                 url=$(LANG=C svn info . |                               \
727                       grep -i ^URL: | cut -d ' ' -f 2)                  \
728                 if [ -z "$url" ]; then                                  \
729                         error "cannot determine svn url"                \
730                 fi                                                      \
731                 echo "Registering svn url: $url"                        \
732                 mr config "$(pwd)" checkout="svn co $url $basedir"      \
733         elif [ -d .git ]; then                                          \
734                 url=$(LANG=C git-config --get remote.origin.url)        \
735                 if [ -z "$url" ]; then                                  \
736                         error "cannot determine git url"                \
737                 fi                                                      \
738                 echo "Registering git url: $url"                        \
739                 mr config "$(pwd)" checkout="git clone $url $basedir"   \
740         elif [ -d .bzr ]; then                                          \
741                 url=$(cat .bzr/branch/parent)                           \
742                 if [ -z "$url" ]; then                                  \
743                         error "cannot determine bzr url"                \
744                 fi                                                      \
745                 echo "Registering bzr url: $url"                        \
746                 mr config "$(pwd)" checkout="bzr clone $url $basedir"   \
747         else                                                            \
748                 error "unable to register this repo type"               \
749         fi
750 list = true
751 config = 
752 help =                                                  \
753         if [ ! -e "$MR_PATH" ]; then                    \
754                 error "cannot find program path"        \
755         fi                                              \
756         (pod2man -c mr "$MR_PATH" | man -l -) ||        \
757                 error "pod2man or man failed"
758
759 ed = echo "A horse is a horse, of course, of course.."
760 T = echo "I pity the fool."