Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9198C200D2E for ; Tue, 31 Oct 2017 23:46:19 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 901261609EF; Tue, 31 Oct 2017 22:46:19 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id AF0931609E6 for ; Tue, 31 Oct 2017 23:46:18 +0100 (CET) Received: (qmail 29059 invoked by uid 500); 31 Oct 2017 22:46:17 -0000 Mailing-List: contact commits-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list commits@cordova.apache.org Received: (qmail 29050 invoked by uid 99); 31 Oct 2017 22:46:17 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Oct 2017 22:46:17 +0000 From: GitBox To: commits@cordova.apache.org Subject: [GitHub] stevengill closed pull request #163: CB-13511: added github boolean to repos that have moved over to github Message-ID: <150948997735.20486.5323773387244736856.gitbox@gitbox.apache.org> archived-at: Tue, 31 Oct 2017 22:46:19 -0000 stevengill closed pull request #163: CB-13511: added github boolean to repos that have moved over to github URL: https://github.com/apache/cordova-coho/pull/163 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): diff --git a/.travis.yml b/.travis.yml index a112c14..5eb3d60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,11 @@ language: node_js sudo: false node_js: - - "0.10" + - "4" + - "6" + - "8" + install: - - npm install + - "npm install" +script: + - "npm test" diff --git a/appveyor.yml b/appveyor.yml index c9b8cf9..e3ddd70 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,14 @@ # appveyor file # http://www.appveyor.com/docs/appveyor-yml +environment: + matrix: + - nodejs_version: "4" + - nodejs_version: "6" + - nodejs_version: "8" + install: + - ps: Install-Product node $env:nodejs_version - npm install build: off diff --git a/package.json b/package.json index b9a6932..c3ea748 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ }, "scripts": { "oldtest": "node test/test.js | tap-spec", - "test": "npm run jasmine", + "test": "npm run eslint", "cover": "istanbul cover --root src --print detail jasmine", "jasmine": "jasmine --captureExceptions --color", "eslint": "eslint test && eslint src" diff --git a/src/main.js b/src/main.js index 958bca4..11b9a1b 100644 --- a/src/main.js +++ b/src/main.js @@ -64,6 +64,10 @@ module.exports = function () { name: 'list-repos', desc: 'Shows a list of valid values for the --repo flag.', entryPoint: lazyRequire('./list-repos') + }, { + name: 'remote-update', + desc: 'Update specified git remote to point to corresponding apache github repo', + entryPoint: lazyRequire('./remote-update') }]; var releaseCommands = [{ name: 'prepare-platform-release-branch', diff --git a/src/remote-update.js b/src/remote-update.js new file mode 100644 index 0000000..46f7bb9 --- /dev/null +++ b/src/remote-update.js @@ -0,0 +1,72 @@ +/* +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + +http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +*/ + +var optimist = require('optimist'); +var executil = require('./executil'); +var flagutil = require('./flagutil'); +var repoutil = require('./repoutil'); + +module.exports = function * (argv) { + console.log('here'); + var opt = flagutil.registerRepoFlag(optimist); + opt = flagutil.registerDepthFlag(opt); + + var opt = opt // eslint-disable-line no-redeclare + .options('remote', { + desc: 'The name of the remote you want to update. Example: origin', + default: ['origin'] + }); + + opt = flagutil.registerHelpFlag(opt); + var argv = opt // eslint-disable-line no-redeclare + .usage('Updates specified git remotes to apache github repos by performing the following command:\n' + + ' for each specified repo:\n' + + ' git remote set-url $REMOTE APACHE_GITHUB_URL' + + ' By default, it will set $REMOTE to origin and APACHE_GITHUB_URL to the corresponding apache github repo' + + '\n' + + 'Usage: $0 remote-update [--remote remoteName] [-r repos]') + .argv; + + if (argv.h) { + optimist.showHelp(); + process.exit(1); + } + + var remote = argv.remote; + var repos = flagutil.computeReposFromFlag(argv.r, true); + + // ensure that any missing repos are cloned + // yield require('./repo-clone').cloneRepos(repos, true, depth); + yield updateRemote(repos, remote); +}; + +function * updateRemote (repos, remote) { + + yield repoutil.forEachRepo(repos, function * (repo) { + + // don't update svn repos + if (repo.svn) { + return; + } + + yield executil.execHelper(executil.ARGS('git remote set-url ' + remote + ' https://github.com/apache/' + repo.repoName + '.git'), false, false); + + }); +} +module.exports.updateRemote = updateRemote; diff --git a/src/repo-clone.js b/src/repo-clone.js index 04e0957..9e59c51 100644 --- a/src/repo-clone.js +++ b/src/repo-clone.js @@ -45,11 +45,7 @@ module.exports = function * (argv) { }; function createRepoUrl (repo) { - if (repo.github) { - return 'https://github.com/apache/' + repo.repoName + '.git'; - } else { - return 'https://git-wip-us.apache.org/repos/asf/' + repo.repoName + '.git'; - } + return 'https://github.com/apache/' + repo.repoName + '.git'; } function * cloneRepos (repos, quiet, depth) { diff --git a/src/repo-update.js b/src/repo-update.js index 63ec4af..8527430 100644 --- a/src/repo-update.js +++ b/src/repo-update.js @@ -52,7 +52,7 @@ module.exports = function * (argv) { ' git checkout $SAVED_ACTIVE_BRANCH\n' + ' git stash pop\n' + '\n' + - 'Usage: $0 repo-update [--depth 10] [-b brranch] [--no-fetch] [-r repos]') + 'Usage: $0 repo-update [--depth 10] [-b branch] [--no-fetch] [-r repos]') .argv; if (argv.h) { diff --git a/src/repoutil.js b/src/repoutil.js index 22148a0..4277428 100644 --- a/src/repoutil.js +++ b/src/repoutil.js @@ -25,7 +25,6 @@ var apputil = require('./apputil'); var platformRepos = [ { title: 'Android', - github: true, versions: ['4.4', '5.0', '5.1', '6.0', '7.0', '7.1'], id: 'android', repoName: 'cordova-android', @@ -35,7 +34,6 @@ var platformRepos = [ title: 'iOS', versions: ['9.0', '9.1', '9.2', '9.3', '10.0', '10.1', '10.2', '10.3'], id: 'ios', - github: true, repoName: 'cordova-ios', jiraComponentName: 'cordova-ios', cordovaJsPaths: ['CordovaLib/cordova.js'], @@ -52,7 +50,6 @@ var platformRepos = [ }, { title: 'Windows', id: 'windows', - github: true, repoName: 'cordova-windows', jiraComponentName: 'cordova-windows', cordovaJsSrcName: 'cordova.windows.js', @@ -96,7 +93,6 @@ var platformRepos = [ }, { title: 'Browser', id: 'browser', - github: true, repoName: 'cordova-browser', jiraComponentName: 'cordova-browser', cordovaJsSrcName: 'cordova.browser.js', diff --git a/src/update-release-notes.js b/src/update-release-notes.js index 29de976..3b60b69 100644 --- a/src/update-release-notes.js +++ b/src/update-release-notes.js @@ -76,7 +76,7 @@ module.exports = function * () { fromTag = (yield gitutil.findMostRecentTag(repo.versionPrefix))[0]; } catch (e) { console.log(`no tags exist in ${repo.packageName}`); - throw 'update-release-notes will not work' + throw 'update-release-notes will not work'; } } if (argv['to-tag']) { ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: users@infra.apache.org With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org For additional commands, e-mail: commits-help@cordova.apache.org