Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Dec 2012 14:02:40 +0000 (UTC)
From:      Ulrich Spoerlein <uqs@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r244084 - user/uqs/git_conv
Message-ID:  <201212101402.qBAE2e12027894@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: uqs
Date: Mon Dec 10 14:02:39 2012
New Revision: 244084
URL: http://svnweb.freebsd.org/changeset/base/244084

Log:
  Really abort the whole run when pushing to the remote repos fails (only github currently)

Modified:
  user/uqs/git_conv/git_conv

Modified: user/uqs/git_conv/git_conv
==============================================================================
--- user/uqs/git_conv/git_conv	Mon Dec 10 14:01:41 2012	(r244083)
+++ user/uqs/git_conv/git_conv	Mon Dec 10 14:02:39 2012	(r244084)
@@ -42,7 +42,7 @@ fi
 
 svn2git()
 {
-    local rules source target dest
+    local rules source target dest d
     rules=$1; shift
     source=$1; shift
     dest="$@"
@@ -64,16 +64,14 @@ svn2git()
     fi
 
     echo "Pushing $target to $dest"
-    cd $target && for d in $dest; do git push $d || break; done
-    if [ $? != 0 ]; then
-	echo "Error in pushing to $dest" >&2
-	exit 1
-    fi
+    cd $target && for d in $dest; do
+	git push $d || { echo "Error in pushing to $dest" >&2; exit 1; }
+    done
 }
 
 gitsvn()
 {
-    local target dest
+    local target dest d
     target=$1; shift
     dest="$@"
 
@@ -87,11 +85,9 @@ gitsvn()
     fi
 
     echo "Pushing $target to $dest"
-    for d in $dest; do git push $d || break; done
-    if [ $? != 0 ]; then
-	echo "Error in pushing to $dest" >&2
-	exit 1
-    fi
+    for d in $dest; do
+	git push $d || { echo "Error in pushing to $dest" >&2; exit 1; }
+    done
 }
 
 gitsvn src-head.git github



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212101402.qBAE2e12027894>