cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shaz...@apache.org
Subject cordova-coho git commit: Added new --from-tag and --to-tag options to update-release-notes command
Date Sun, 11 Dec 2016 19:55:00 GMT
Repository: cordova-coho
Updated Branches:
  refs/heads/master 5d35171bd -> e75e7d90f


Added new --from-tag and --to-tag options to update-release-notes command


Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/e75e7d90
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/e75e7d90
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/e75e7d90

Branch: refs/heads/master
Commit: e75e7d90f4cee23e2be570e2e971b425b1f07c86
Parents: 5d35171
Author: Shazron Abdullah <shazron@apache.org>
Authored: Sun Dec 11 11:54:54 2016 -0800
Committer: Shazron Abdullah <shazron@apache.org>
Committed: Sun Dec 11 11:54:54 2016 -0800

----------------------------------------------------------------------
 src/update-release-notes.js | 30 +++++++++++++++++++++++++-----
 1 file changed, 25 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/e75e7d90/src/update-release-notes.js
----------------------------------------------------------------------
diff --git a/src/update-release-notes.js b/src/update-release-notes.js
index 1c4fd35..bb2de5b 100644
--- a/src/update-release-notes.js
+++ b/src/update-release-notes.js
@@ -32,7 +32,10 @@ module.exports = function*() {
     opt = flagutil.registerHelpFlag(opt)
         .usage('Updates release notes with commits since the most recent tag.\n' +
         '\n' +
-        'Usage: $0 update-release-notes [--repo=ios]');
+        'Usage: $0 update-release-notes [--repo=ios]'
+        )
+        .options('from-tag', {desc: 'Update since a specific tag instead of the "most recent"
tag'})
+        .options('to-tag', {desc: 'Update to a specific tag instead of "master"'});     
  
     argv = opt.argv;
 
     if (argv.h) {
@@ -45,16 +48,33 @@ module.exports = function*() {
     var cmd = executil.ARGS('git log --topo-order --no-merges');
     cmd.push(['--pretty=format:* %s']);
     yield repoutil.forEachRepo(repos, function*(repo) {
-        var tag = yield gitutil.findMostRecentTag(repo.versionPrefix);
-        cmd.push(tag + '..master');
+        var fromTag, toTag;
+        if (argv['from-tag']){
+            fromTag = argv['from-tag'];
+        } else {
+            fromTag = yield gitutil.findMostRecentTag(repo.versionPrefix);
+        }
+        if (argv['to-tag']){
+            toTag = argv['to-tag'];
+        } else {
+            toTag = 'master';
+        }
+
+        cmd.push(fromTag + '..' + toTag);
         var repoDesc = repo.repoName;
         if (repo.path) {
             repoDesc += '/' + repo.path;
         }
-        console.log('Finding commits in ' + repoDesc + ' since tag ' + tag);
+        console.log('Finding commits in ' + repoDesc + ' from tag ' + fromTag + ' to tag
' + toTag);
         var output = yield executil.execHelper(cmd.concat(repoutil.getRepoIncludePath(repo)),
true);
         if (output) {
-            var newVersion = require(path.join(process.cwd(), 'package.json')).version;
+            var newVersion;
+            if (toTag === 'master') {
+                newVersion = require(path.join(process.cwd(), 'package.json')).version;
+            } else {
+                newVersion = toTag;
+            }
+            
             var relNotesFile = 'RELEASENOTES.md';
             var data = fs.readFileSync(relNotesFile, {encoding: 'utf8'});
             var pos = data.indexOf('### ');


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message