jenkins-bot has submitted this change and it was merged.

Change subject: Some refactoring in repocommit
......................................................................


Some refactoring in repocommit

Change-Id: I94ae136b43e7b2e61d47ddc9c1b15ec19a3f7095
---
M bin/repocommit
1 file changed, 32 insertions(+), 36 deletions(-)

Approvals:
  Siebrand: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/bin/repocommit b/bin/repocommit
index ff5566b..819bfa5 100755
--- a/bin/repocommit
+++ b/bin/repocommit
@@ -15,21 +15,21 @@
 
 COMMITMSG="Localisation updates from http://translatewiki.net.";
 
-gitcommit() {
-       local dir=$1
-       cd "$dir"
-       git add .
-       git commit -v -e -m "$COMMITMSG"
-       git push
-       cd ..
-}
-
-gitcommitNoCheck() {
+gitCommit() {
        local dir=$1
        cd "$dir"
        git add .
        git commit -m "$COMMITMSG"
        git push
+       cd ..
+}
+
+gitCommitGerrit() {
+       local dir=$1
+       cd $PROJECT
+       git add .
+       git commit -q -m "$COMMITMSG" && git fetch -q gerrit && git review -t 
l10n || :
+       mergeL10n-bot
        cd ..
 }
 
@@ -41,7 +41,8 @@
        done
 }
 
-GITCOMMITNOCHECKPROJECTS="\
+# TODO: Move to separate file?
+GITPROJECTS="\
 eol \
 etherpad-lite \
 freecol \
@@ -52,6 +53,7 @@
 mantis \
 mathjax \
 mifos \
+osm \
 pywikibot \
 shapado \
 vicuna \
@@ -64,21 +66,34 @@
 WiktionaryMobile \
 WLMMobile"
 
-for i in $GITCOMMITNOCHECKPROJECTS; do
+for i in $GITPROJECTS; do
        if [ "$i" = "$PROJECT" ]
        then
-               gitcommitNoCheck "$PROJECT"
+               gitCommit "$PROJECT"
 
-               if [ "$PROJECT" = "pywikibot" ]
+               if [ "$PROJECT" = "osm" ]
                then
-                       mergeL10n-bot
+                       gitCommit potlatch2
                fi
 
                exit 0
        fi
 done
 
-# This needs more work.
+# TODO: Move to separate file?
+GERRITPROJECTS="\
+commons-android \
+commons-ios \
+pywikibot"
+
+for i in $GERRITPROJECTS; do
+       if [ "$i" = "$PROJECT" ]
+       then
+               gitCommitGerrit "$PROJECT"
+               exit 0
+       fi
+done
+
 if [ "$PROJECT" = "blockly" ]
 then
        cd $PROJECT
@@ -88,20 +103,6 @@
                svn propset -q svn:mime-type text/plain $i
        done
        svn commit --message "$COMMITMSG"
-       cd ..
-
-elif [ "$PROJECT" = "commons-android" ]
-then
-       cd $PROJECT
-       git add .
-       git commit -a -m "$COMMITMSG" && git fetch gerrit && git review -t l10n 
|| :
-       cd ..
-
-elif [ "$PROJECT" = "commons-ios" ]
-then
-       cd $PROJECT
-       git add .
-       git commit -a -m "$COMMITMSG" && git fetch gerrit && git review -t l10n 
|| :
        cd ..
 
 elif [ "$PROJECT" = "fudforum" ]
@@ -160,7 +161,7 @@
 
 elif [ "$PROJECT" = "mwlib" ]
 then
-       gitcommitNoCheck "$PROJECT.rl"
+       gitCommit "$PROJECT.rl"
 
 elif [ "$PROJECT" = "okawix" ]
 then
@@ -182,11 +183,6 @@
        svn propset -q svn:eol-style native *.properties
        svn commit --message "$COMMITMSG"
        cd ..
-
-elif [ "$PROJECT" = "osm" ]
-then
-       gitcommitNoCheck $PROJECT
-       gitcommitNoCheck potlatch2
 
 elif [ "$PROJECT" = "wikiblame" ]
 then

-- 
To view, visit https://gerrit.wikimedia.org/r/92367
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I94ae136b43e7b2e61d47ddc9c1b15ec19a3f7095
Gerrit-PatchSet: 2
Gerrit-Project: translatewiki
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to