Add "darcs-all upstreampull"
authorIan Lynagh <igloo@earth.li>
Sun, 22 Aug 2010 16:34:19 +0000 (16:34 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 22 Aug 2010 16:34:19 +0000 (16:34 +0000)
This pulls from the upstream repos, for those packages which have
upstreams

darcs-all

index ff74616..4ad146a 100644 (file)
--- a/darcs-all
+++ b/darcs-all
@@ -268,6 +268,23 @@ sub darcsget {
     }
 }
 
+sub darcsupstreampull {
+    my $localpath;
+    my $upstream;
+    my $line;
+
+    for $line (@packages) {
+        $localpath  = $$line{"localpath"};
+        $upstream   = $$line{"upstream"};
+
+        if ($upstream ne "-") {
+            if (-d $localpath) {
+                darcs ("pull", @_, "--repodir", $localpath, $upstream);
+            }
+        }
+    }
+}
+
 sub main {
     if (! -d "compiler") {
         die "error: darcs-all must be run from the top level of the ghc tree."
@@ -324,6 +341,10 @@ sub main {
     if ($command eq "get") {
         darcsget @_;
     }
+    if ($command eq "upstreampull") {
+        shift;
+        darcsupstreampull @_;
+    }
     else {
         if ($command =~ /^(?:w|wh|wha|what|whats|whatsn|whatsne|whatsnew)$/) {
             # Hack around whatsnew failing if there are no changes