Commit c3740c90 authored by Simon Marlow's avatar Simon Marlow

'fetch' and 'new' can take branch names as arguments (defaulting to 'origin')

e.g.

   ./sync-all -r ~/git/ghc-working remote add working
   ./sync-all fetch working
parent db485571
...@@ -238,6 +238,12 @@ sub scmall { ...@@ -238,6 +238,12 @@ sub scmall {
if ($subcommand ne 'add' && $subcommand ne 'rm') { if ($subcommand ne 'add' && $subcommand ne 'rm') {
help(); help();
} }
} elsif ($command eq 'new' || $command eq 'fetch') {
if (@_ < 1) {
$branch_name = 'origin';
} else {
$branch_name = shift;
}
} }
for $line (@packages) { for $line (@packages) {
...@@ -316,10 +322,10 @@ sub scmall { ...@@ -316,10 +322,10 @@ sub scmall {
@scm_args = ("remote", "set-url", "--push", "origin", $path); @scm_args = ("remote", "set-url", "--push", "origin", $path);
} }
elsif ($command =~ /^fetch$/) { elsif ($command =~ /^fetch$/) {
@scm_args = ("fetch", "origin"); @scm_args = ("fetch", "$branch_name");
} }
elsif ($command =~ /^new$/) { elsif ($command =~ /^new$/) {
@scm_args = ("log", "origin.."); @scm_args = ("log", "$branch_name..");
} }
elsif ($command =~ /^remote$/) { elsif ($command =~ /^remote$/) {
if ($subcommand eq 'add') { if ($subcommand eq 'add') {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment