cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [14/35] cordova-coho git commit: small ref fixes. show master change confirmations before pushing. exit if confirmation fails.
Date Wed, 26 Apr 2017 01:04:09 GMT
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/50956137
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/50956137
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/50956137

Branch: refs/heads/master
Commit: 509561378becd72142384395b1c163f33a64761a
Parents: ba89433
Author: filmaj <maj.fil@gmail.com>
Authored: Wed Feb 8 15:46:52 2017 -0800
Committer: filmaj <maj.fil@gmail.com>
Committed: Tue Apr 25 17:28:07 2017 -0700

----------------------------------------------------------------------
 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/50956137/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/50956137/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


Mime
View raw message