diff options
author | Thomas Steur <thomas.steur@gmail.com> | 2016-09-30 02:03:13 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@gmail.com> | 2016-09-30 02:03:13 +0300 |
commit | 43bd151e711d5c719cf89d2746c23da5e29dd264 (patch) | |
tree | af3c4969a64f759811a08c026b739b3d8e716435 /plugins/LanguagesManager | |
parent | 68fea796ef5a81cf7c5f4fb17508968ac898bb7c (diff) | |
parent | 7d115b50ecb1660175e64e4e546c72546fd56d69 (diff) |
Merge branch '2.x-dev' into 3.0-m09
Diffstat (limited to 'plugins/LanguagesManager')
-rw-r--r-- | plugins/LanguagesManager/Commands/CreatePull.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/plugins/LanguagesManager/Commands/CreatePull.php b/plugins/LanguagesManager/Commands/CreatePull.php index af46dc7000..fca1fc76aa 100644 --- a/plugins/LanguagesManager/Commands/CreatePull.php +++ b/plugins/LanguagesManager/Commands/CreatePull.php @@ -19,6 +19,8 @@ use Symfony\Component\Console\Output\OutputInterface; */ class CreatePull extends TranslationBase { + const GIT_BASE_BRANCH = '2.x-dev'; + protected function configure() { $this->setName('translations:createpull') @@ -38,7 +40,7 @@ class CreatePull extends TranslationBase return; } - $unpushedCommits = shell_exec('git log origin/master..HEAD'); + $unpushedCommits = shell_exec('git log origin/' . self::GIT_BASE_BRANCH . '..HEAD'); if (!empty($unpushedCommits)) { @@ -49,7 +51,7 @@ class CreatePull extends TranslationBase chdir(PIWIK_DOCUMENT_ROOT); shell_exec(' - git checkout -f master > /dev/null 2>&1 + git checkout -f ' . self::GIT_BASE_BRANCH . ' > /dev/null 2>&1 git pull > /dev/null 2>&1 git submodule init > /dev/null 2>&1 git submodule update > /dev/null 2>&1 @@ -60,7 +62,7 @@ class CreatePull extends TranslationBase chdir(PIWIK_DOCUMENT_ROOT.DIRECTORY_SEPARATOR.'plugins'.DIRECTORY_SEPARATOR.$plugin); shell_exec(' - git checkout master > /dev/null 2>&1 + git checkout ' . self::GIT_BASE_BRANCH . ' > /dev/null 2>&1 git pull > /dev/null 2>&1 '); } @@ -73,10 +75,10 @@ class CreatePull extends TranslationBase shell_exec('git checkout -b translationupdates origin/translationupdates'); } - // switch to branch and update it to latest master + // switch to branch and update it to latest $GIT_BASE_BRANCH shell_exec(' git checkout -f translationupdates > /dev/null 2>&1 - git merge master > /dev/null 2>&1 + git reset --hard origin/' . self::GIT_BASE_BRANCH . ' > /dev/null 2>&1 git push origin translationupdates > /dev/null 2>&1 '); @@ -105,7 +107,7 @@ class CreatePull extends TranslationBase if (empty($changes)) { $output->writeln("Nothing changed. Everything is already up to date."); - shell_exec('git checkout master > /dev/null 2>&1'); + shell_exec('git checkout ' . self::GIT_BASE_BRANCH . ' > /dev/null 2>&1'); return; } @@ -163,7 +165,7 @@ class CreatePull extends TranslationBase shell_exec('git commit -m "language update ${pluginName}"'); shell_exec('git push'); - shell_exec('git checkout master > /dev/null 2>&1'); + shell_exec('git checkout ' . self::GIT_BASE_BRANCH . ' > /dev/null 2>&1'); $this->createPullRequest($output, $title, $message); } @@ -195,7 +197,7 @@ class CreatePull extends TranslationBase --stderr /dev/null \ -o /dev/null \ -u '.$username.' \ - --data "{\"title\":\"[automatic translation update] '.$title.'\",\"body\":\"'.$message.'\",\"head\":\"translationupdates\",\"base\":\"master\"}" \ + --data "{\"title\":\"[automatic translation update] '.$title.'\",\"body\":\"'.$message.'\",\"head\":\"translationupdates\",\"base\":\"' . self::GIT_BASE_BRANCH . '\"}" \ -H "Accept: application/json" \ https://api.github.com/repos/piwik/piwik/pulls'); |