You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by fi...@apache.org on 2017/02/08 23:47:01 UTC
cordova-coho git commit: small ref fixes. show master change
confirmations before pushing. exit if confirmation fails.
Repository: cordova-coho
Updated Branches:
refs/heads/plugins-releaser 2eb3f1740 -> f8e749507
small ref fixes. show master change confirmations before pushing. exit if confirmation fails.
Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/f8e74950
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/f8e74950
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/f8e74950
Branch: refs/heads/plugins-releaser
Commit: f8e74950760a614ceed5c1b0c943c3d733f1b152
Parents: 2eb3f17
Author: filmaj <ma...@gmail.com>
Authored: Wed Feb 8 15:46:52 2017 -0800
Committer: filmaj <ma...@gmail.com>
Committed: Wed Feb 8 15:46:52 2017 -0800
----------------------------------------------------------------------
src/gitutil.js | 4 ++--
src/plugin-release.js | 25 ++++++++++++++++++-------
2 files changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/f8e74950/src/gitutil.js
----------------------------------------------------------------------
diff --git a/src/gitutil.js b/src/gitutil.js
index ad2da3d..c75ded9 100644
--- a/src/gitutil.js
+++ b/src/gitutil.js
@@ -183,6 +183,6 @@ exports.pushToOrigin = function*(ref) {
//return yield executil.execHelper(executil.ARGS('git push origin', ref));
}
-exports.diff = function(first, second) {
- return executil.execHelper(executil.ARGS('git diff', first + '..' + second));
+exports.diff = function*(first, second) {
+ return yield executil.execHelper(executil.ARGS('git diff', first + '..' + second), true, false);
}
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/f8e74950/src/plugin-release.js
----------------------------------------------------------------------
diff --git a/src/plugin-release.js b/src/plugin-release.js
index 26f4c65..d52efdf 100644
--- a/src/plugin-release.js
+++ b/src/plugin-release.js
@@ -425,7 +425,7 @@ function *interactive_plugins_release() {
var prompts = [];
repos_with_existing_release_branch.forEach(function(repo) {
var plugin_name = repo.repoName;
- var rb = versionutil.getReleaseBranchFromVersion(plugin_data[plugin_name].current_version)
+ var rb = versionutil.getReleaseBranchNameFromVersion(plugin_data[plugin_name].current_release)
prompts.push({
type: 'confirm',
name: 'rb_proceed_' + plugin_name,
@@ -449,7 +449,7 @@ function *interactive_plugins_release() {
})();
}).then(function() {
/* 12. Push tags, release branch, and master branch changes.
- * start with tag */
+ * start with pushing tag, then compile diffs for master branch push and ask user if they approve before pushing master */
return co.wrap(function *() {
var master_prompts = [];
yield repoutil.forEachRepo(plugin_repos, function*(repo) {
@@ -457,18 +457,29 @@ function *interactive_plugins_release() {
var tag = plugin_data[plugin_name].current_release;
console.log(plugin_name, ': pushing tag "', tag, '"');
yield gitutil.pushToOrigin(tag);
- // compile master diff for confirmation in next promise section
- var diff = gitutil.diff(plugin_data[plugin_name].previous_master_head, 'master');
+ /* - show diff of last master commit for user confirmation*/
+ var diff = yield gitutil.diff(plugin_data[plugin_name].previous_master_head, 'master');
master_prompts.push({
type: 'confirm',
name: 'master_' + plugin_name,
message: 'About to push the following changes to the master branch of ' + plugin_name + ': ' + diff + '\nDo you wish to continue?'
});
});
- return master_prompts;
+ return inquirer.prompt(master_prompts);
+ })();
+ }).then(function(answers) {
+ /*check confirmations and exit if RM bailed
+ * - push, git push origin master*/
+ return co.wrap(function *() {
+ yield repoutil.forEachRepo(plugin_repos, function*(repo) {
+ var plugin_name = repo.repoName;
+ if (!answers['master_' + plugin_name]) {
+ console.error('Aborting as master branch changes for ' + plugin_name + ' were not approved!');
+ process.exit(8);
+ } else {
+ }
+ });
})();
- }).then(function(master_prompts) {
- /* - show diff of last master commit, confirm, push, git push origin master*/
}).then(function() {
/* - show diff of release branch:
* - if release branch did not exist before, show diff (simple, just branch..master), confirm, then push
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org