projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of http://darcs.haskell.org/ghc
[ghc-hetmet.git]
/
sync-all
diff --git
a/sync-all
b/sync-all
index
87e3698
..
d89e439
100755
(executable)
--- a/
sync-all
+++ b/
sync-all
@@
-116,12
+116,25
@@
sub warning {
}
sub scm {
}
sub scm {
+ my $dir = shift;
my $scm = shift;
my $scm = shift;
-
- message "== running $scm @_";
+ my $pwd;
+
+ if ($dir eq '.') {
+ message "== running $scm @_";
+ } else {
+ message "== $dir: running $scm @_";
+ $pwd = getcwd();
+ chdir($dir);
+ }
+
system ($scm, @_) == 0
or $ignore_failure
or die "$scm failed: $?";
system ($scm, @_) == 0
or $ignore_failure
or die "$scm failed: $?";
+
+ if ($dir ne '.') {
+ chdir($pwd);
+ }
}
sub repoexists {
}
sub repoexists {
@@
-150,6
+163,8
@@
sub scmall {
my @scm_args;
my @scm_args;
+ my $pwd;
+
my ($repo_base, $checked_out_tree) = getrepo();
parsePackages;
my ($repo_base, $checked_out_tree) = getrepo();
parsePackages;
@@
-223,6
+238,15
@@
sub scmall {
or ($scm eq "git" and "send-email"));
$want_remote_repo = 1;
}
or ($scm eq "git" and "send-email"));
$want_remote_repo = 1;
}
+ elsif ($command =~ /^set-origin$/) {
+ @scm_args = ("remote", "set-url", "origin", $path);
+ }
+ elsif ($command =~ /^fetch$/) {
+ @scm_args = ("fetch", "origin");
+ }
+ elsif ($command =~ /^new$/) {
+ @scm_args = ("log", "origin..");
+ }
else {
die "Unknown command: $command";
}
else {
die "Unknown command: $command";
}
@@
-231,19
+255,20
@@
sub scmall {
if (repoexists ($scm, $localpath)) {
if ($want_remote_repo) {
if ($scm eq "darcs") {
if (repoexists ($scm, $localpath)) {
if ($want_remote_repo) {
if ($scm eq "darcs") {
- scm ($scm, @scm_args, @_, "--repodir=$localpath", $path);
+ scm (".", $scm, @scm_args, @_, "--repodir=$localpath", $path);
} else {
# git pull doesn't like to be used with --work-dir
} else {
# git pull doesn't like to be used with --work-dir
- scm ($scm, "--git-dir=$localpath/.git", @scm_args, @_, $path, "master");
+ # I couldn't find an alternative to chdir() here
+ scm ($localpath, $scm, @scm_args, @_, $path, "master");
}
} else {
# git status *must* be used with --work-dir, if we don't chdir() to the dir
}
} else {
# git status *must* be used with --work-dir, if we don't chdir() to the dir
- scm ($scm, "--git-dir=$localpath/.git", "--work-tree=$localpath", @scm_args, @_);
+ scm ($localpath, $scm, @scm_args, @_);
}
}
elsif ($local_repo_unnecessary) {
# Don't bother to change directory in this case
}
}
elsif ($local_repo_unnecessary) {
# Don't bother to change directory in this case
- scm ($scm, @scm_args, @_);
+ scm (".", $scm, @scm_args, @_);
}
elsif ($tag eq "") {
message "== Required repo $localpath is missing! Skipping";
}
elsif ($tag eq "") {
message "== Required repo $localpath is missing! Skipping";
@@
-314,7
+339,10
@@
Supported commands:
* --<package-tag>
* --complete
* --partial
* --<package-tag>
* --complete
* --partial
+ * fetch
* send
* send
+ * set-origin
+ * new
Available package-tags are:
END
Available package-tags are:
END