Any mix of revision control systems can be used with B<mr>, and you can
define arbitrary actions for commands like "update", "checkout", or "commit".
+B<mr> cds into and operates on all registered repsitories at or below your
+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
control system:
=back
Actions can be abbreviated to any unambiguous subsctring, so
-"mr st" is equivilant to "mr status".
-
-B<mr> operates on all registered repsitories at or below your working
-directory. Or, if you are in a subdirectory of a repository that contains
-no other registered repositories, it will act on only that repository.
+"mr st" is equivilant to "mr status", and "mr up" is equivilant to "mr
+update"
Additional parameters can be passed to other commands than "commit", they
will be passed on unchanged to the underlying revision control system.
my $nochdir=0;
foreach my $topdir (sort keys %config) {
foreach my $subdir (sort keys %{$config{$topdir}}) {
+ next if $subdir eq 'default';
my $dir=$topdir.$subdir;
next if $dir ne $directory && $dir !~ /^\Q$directory\E\//;
push @repos, [$dir, $topdir, $subdir];
}
if (! @repos) {
# fallback to find a leaf repo
- foreach my $topdir (sort keys %config) {
- foreach my $subdir (sort keys %{$config{$topdir}}) {
+ LEAF: foreach my $topdir (reverse sort keys %config) {
+ foreach my $subdir (reverse sort keys %{$config{$topdir}}) {
+ next if $subdir eq 'default';
my $dir=$topdir.$subdir;
my $d=$directory;
$dir.="/" unless $dir=~/\/$/;
$d.="/" unless $d=~/\/$/;
if ($d=~/^\Q$dir\E/) {
push @repos, [$dir, $topdir, $subdir];
+ last LEAF;
}
}
}
- if (@repos > 1) {
- die "mr: found multiple leaf repos (should never happen)";
- }
+ $nochdir=1;
}
my (@failed, @successful, @skipped);