X-Git-Url: https://git.madduck.net/code/myrepos.git/blobdiff_plain/d82be80725445a6f848c7207f77680a66a903311..511e30d827dbf773f8ea61d7bd1de79a6a1e7ba6:/mr diff --git a/mr b/mr index 7c4ff30..175c5f1 100755 --- a/mr +++ b/mr @@ -16,6 +16,8 @@ B [options] commit [-m "message"] B [options] diff +B [options] log + B [options] action [params ...] =head1 DESCRIPTION @@ -64,7 +66,11 @@ The optional -m parameter allows specifying a commit message. Show a diff of uncommitted changes. -=item list +=item log + +Show the commit log. + +=item list (or ls) List the repositories that mr will act on. @@ -94,7 +100,7 @@ the current working directory. =item -c mrconfig -Use the specified mrconfig file, instead of looking for on in your home +Use the specified mrconfig file, instead of looking for one in your home directory. =item -v @@ -219,8 +225,13 @@ if (! exists $knownactions{$action}) { if (@matches == 1) { $action=$matches[0]; } + elsif (@matches == 0) { + die "mr: unknown action \"$action\" (known actions: ". + join(", ", sort keys %knownactions).")\n"; + } else { - die "mr: ambiguous action \"$action\" (matches @matches)\n"; + die "mr: ambiguous action \"$action\" (matches: ". + join(", ", @matches).")\n"; } } } @@ -303,7 +314,12 @@ sub action { push @skipped, $dir; } else { - print "mr $action: $dir\n"; + if (! $nochdir) { + print "mr $action: $dir\n"; + } + else { + print "mr $action: $dir (in subdir $directory)\n"; + } my $command="set -e; ".$lib. "my_action(){ $config{$topdir}{$subdir}{$action} ; }; my_action ". join(" ", map { s/\//\/\//g; s/"/\"/g; '"'.$_.'"' } @ARGV); @@ -450,6 +466,7 @@ __DATA__ [alias] co = checkout ci = commit + ls = list [default] lib = \ error() { \ @@ -488,6 +505,14 @@ diff = \ else \ error "unknown repo type"; \ fi +log = \ + if [ -d "$MR_REPO"/.svn ]; then \ + svn log"$@"; \ + elif [ -d "$MR_REPO"/.git ]; then \ + git log "$@"; \ + else \ + error "unknown repo type"; \ + fi list = true help = \ if [ ! -e "$MR_PATH" ]; then \