# sync-all will try to do the right thing for both git and darcs repositories.
#
# e.g.
-# ./sync-all -r http://darcs.haskell.org/ghc get
+# ./sync-all -r http://git.haskell.org/ghc get
# To get any repos which do not exist in the local tree
#
# ./sync-all pull
# otherwise sync-all works on repos of form
# $repo_base/<remote-path>
# This logic lets you say
-# both sync-all -r http://darcs.haskell.org/ghc-6.12 pull
+# both sync-all -r http://git.haskell.org/ghc-6.12 pull
# and sync-all -r ../HEAD pull
# The latter is called a "checked-out tree".
# Don't drop the last part of the path if specified with -r, as
# it expects repos of the form:
#
- # http://darcs.haskell.org
+ # http://git.haskell.org
#
# rather than
#
- # http://darcs.haskell.org/ghc
+ # http://git.haskell.org/ghc
#
if (!$defaultrepo) {
$repo_base =~ s#/[^/]+/?$##;
foreach (@repos) {
chomp;
$lineNum++;
- if (/^([^# ]+) +([^ ]+) +([^ ]+) +([^ ]+) +([^ ]+)$/) {
+ if (/^([^# ]+) +([^ ]+) +([^ ]+) +([^ ]+)$/) {
my %line;
$line{"localpath"} = $1;
$line{"tag"} = $2;
$line{"remotepath"} = $3;
$line{"vcs"} = $4;
- $line{"upstream"} = $5;
push @packages, \%line;
}
elsif (! /^(#.*)?$/) {
my $tag;
my $remotepath;
my $scm;
- my $upstream;
my $line;
my $branch_name;
my $subcommand;
$tag = $$line{"tag"};
$remotepath = $$line{"remotepath"};
$scm = $$line{"vcs"};
- $upstream = $$line{"upstream"};
# Check the SCM is OK as early as possible
die "Unknown SCM: $scm" if (($scm ne "darcs") and ($scm ne "git"));
my @scm_args = ("log", "$branch_name..");
scm ($localpath, $scm, @scm_args, @args);
}
+ elsif ($command =~ /^log$/) {
+ scm ($localpath, $scm, "log", @args);
+ }
elsif ($command =~ /^remote$/) {
my @scm_args;
if ($subcommand eq 'add') {
}
scm ($localpath, $scm, @scm_args, @args);
}
+ elsif ($command =~ /^checkout$/) {
+ # Not all repos are necessarily branched, so ignore failure
+ $ignore_failure = 1;
+ scm ($localpath, $scm, "checkout", @args)
+ unless $scm eq "darcs";
+ }
elsif ($command =~ /^grep$/) {
# Hack around 'git grep' failing if there are no matches
$ignore_failure = 1;
* remote add <branch-name>
* remote rm <branch-name>
* remote set-url [--push] <branch-name>
+ * checkout
* grep
* clean
* reset
* config
+ * log
Available package-tags are:
END