You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/09/16 20:18:44 UTC

[1/3] git commit: Add ffos & app harness repos to coho

Updated Branches:
  refs/heads/master bc3b19f17 -> 5e21d4394


Add ffos & app harness repos to coho


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

Branch: refs/heads/master
Commit: 64bf08fc39567a540c6dc3e9f643256a1fe70c3c
Parents: bc3b19f
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Sep 13 11:05:33 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Sep 13 11:05:33 2013 -0400

----------------------------------------------------------------------
 coho | 12 ++++++++++++
 1 file changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/64bf08fc/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index 0d24868..d36b198 100755
--- a/coho
+++ b/coho
@@ -100,6 +100,13 @@ var platformRepos = [
         jiraComponentName: 'OSX',
         cordovaJsPaths: ['CordovaFramework/cordova.js']
     }, {
+        title: 'Firefox OS',
+        id: 'firefoxos',
+        repoName: 'cordova-firefoxos',
+        jiraComponentName: 'FirefoxOS',
+        cordovaJsPaths: ['cordova-lib/cordova.js'],
+        inactive: true
+    }, {
         title: 'Bada',
         id: 'bada',
         repoName: 'cordova-bada',
@@ -158,6 +165,11 @@ var nonPlatformRepos = [
         id: 'app-hello-world',
         repoName: 'cordova-app-hello-world',
         jiraComponentName: 'App Hello World'
+    }, {
+        title: 'App Harness',
+        id: 'app-harness',
+        repoName: 'cordova-app-harness',
+        jiraComponentName: 'AppHarness'
     }
 ];
 


[3/3] git commit: Make repo-update update dev branched by default.

Posted by ag...@apache.org.
Make repo-update update dev branched by default.

And make repo-clone checkout dev branches for plugins.


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

Branch: refs/heads/master
Commit: 5e21d4394752ba13e144b8a23fe0e060f8bcc648
Parents: e5ba6cb
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 16 14:18:11 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 16 14:18:11 2013 -0400

----------------------------------------------------------------------
 coho | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/5e21d439/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index 015fa92..bf85228 100755
--- a/coho
+++ b/coho
@@ -718,6 +718,13 @@ function repoCloneCommand(argv) {
     process.exit(0);
 }
 
+function checkoutDevBranch(repos) {
+    forEachRepo(repos, function(repo) {
+        var branchName = pluginRepos.indexOf(repo) == -1 ? 'master' : 'dev';
+        gitCheckout(branchName);
+    });
+}
+
 function cloneRepos(repos, quiet) {
     var failures = [];
     var numSkipped = 0;
@@ -730,6 +737,8 @@ function cloneRepos(repos, quiet) {
             var code = shjs.exec('git clone --progress ' + createRepoUrl(repo)).code;
             if (code) {
                 failures.push(repo.repoName);
+            } else {
+                checkoutDevBranch([repo]);
             }
         }
     });
@@ -950,7 +959,7 @@ function repoUpdateCommand(argv) {
         .options('b', {
             alias: 'branch',
             desc: 'The name of the branch to update. Can be specified multiple times to update multiple branches.',
-            default: 'master'
+            default: ['master', 'dev']
          })
         .options('fetch', {
             type: 'boolean',


[2/3] git commit: Make prepare-release-branch command set the version on master to FOO-dev.

Posted by ag...@apache.org.
Make prepare-release-branch command set the version on master to FOO-dev.

Also improved logic that undoes a prepare-release-branch (repo-reset).


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

Branch: refs/heads/master
Commit: e5ba6cb64f3cf77dd992108b7b9c4cca26dedfa5
Parents: 64bf08f
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Sep 16 14:12:50 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Sep 16 14:18:06 2013 -0400

----------------------------------------------------------------------
 coho | 127 ++++++++++++++++++++++++++++++++++++++++++--------------------
 1 file changed, 87 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/e5ba6cb6/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index d36b198..015fa92 100755
--- a/coho
+++ b/coho
@@ -306,16 +306,17 @@ var gitCommitCount = 0;
 var JIRA_API_URL = "https://issues.apache.org/jira/rest/api/latest/";
 var JIRA_PROJECT_KEY = "CB";
 
-function reportGitPushResult() {
+function reportGitPushResult(repos, branches) {
     print('');
     if (gitCommitCount) {
+        var flagsStr = repos.map(function(r) { return '-r ' + r.id; }).join('') + ' ' + branches.map(function(b) { return '-b ' + b; }).join('');
         print('All work complete. ' + gitCommitCount + ' commits were made locally.');
         print('To review changes:');
-        print('  ' + process.argv[1] + ' repo-status -r auto');
+        print('  ' + process.argv[1] + ' repo-status ' + flagsStr);
         print('To push changes:');
-        print('  ' + process.argv[1] + ' repo-push -r auto');
+        print('  ' + process.argv[1] + ' repo-push ' + flagsStr);
         print('To revert all local commits:');
-        print('  ' + process.argv[1] + ' repo-reset -r auto');
+        print('  ' + process.argv[1] + ' repo-reset ' + flagsStr);
     } else {
         print('All work complete. No commits were made.');
     }
@@ -336,6 +337,18 @@ function fatal() {
     process.exit(1);
 }
 
+function createPlatformDevVersion(version) {
+    // e.g. "3.1.0" -> "3.2.0-dev".
+    // e.g. "3.1.2-0.8.0-rc2" -> "3.2.0-0.8.0-dev".
+    version = version.replace(/-rc.*$/, '');
+    var parts = version.split('.');
+    parts[1] = String(+parts[1] + 1);
+    var cliSafeParts = parts[2].split('-');
+    cliSafeParts[0] = '0';
+    parts[2] = cliSafeParts.join('-');
+    return parts.join('.') + '-dev';
+}
+
 function getVersionBranchName(version) {
     return version.replace(/\d+(-?rc\d)?$/, 'x');
 }
@@ -810,6 +823,9 @@ function repoResetCommand(argv) {
         .usage('Resets repository branches to match their upstream state.\n' +
                'Performs the following commands on each:\n' +
                '    git reset --hard origin/$BRANCH_NAME\n' +
+               '    git clean -f -d\n' +
+               '    if ($BRANCH_NAME exists only locally) then\n' +
+               '        git branch -D $BRANCH_NAME\n' +
                '\n' +
                'Usage: $0 repo-reset -r auto -b master -b 2.9.x')
         .argv;
@@ -821,24 +837,42 @@ function repoResetCommand(argv) {
     var branches = Array.isArray(argv.b) ? argv.b : [argv.b];
     var repos = computeReposFromFlag(argv.r);
 
-    forEachRepo(repos, function(repo) {
-        // Determine remote name.
-        updateRepos([repo], [], true);
-        stashAndPop(repo, function() {
-            branches.forEach(function(branchName) {
-                if (!localBranchExists(branchName)) {
-                    return;
-                }
+    function cleanRepo(repo) {
+        branches.forEach(function(branchName) {
+            if (!localBranchExists(branchName)) {
+                return;
+            }
+            if (remoteBranchExists(repo, branchName)) {
                 gitCheckout(branchName);
                 var changes = execHelper('git log --oneline ' + repo.remoteName + '/' + branchName + '..' + branchName);
                 if (changes) {
-                    print(repo.repoName + ' on branch ' + branchName + ': Local commits exist. Resetting.\n');
+                    print(repo.repoName + ' on branch ' + branchName + ': Local commits exist. Resetting.');
                     execHelper('git reset --hard ' + repo.remoteName + '/' + branchName);
                 } else {
-                    print(repo.repoName + ' on branch ' + branchName + ': No local commits exist.\n');
+                    print(repo.repoName + ' on branch ' + branchName + ': No local commits to reset.');
                 }
+            } else {
+                if (retrieveCurrentBranchName() == branchName) {
+                    gitCheckout('master');
+                }
+                print(repo.repoName + ' deleting local-only branch ' + branchName + '.');
+                execHelper('git log --oneline -3 ' + branchName);
+                execHelper('git branch -D ' + branchName);
+            }
+        })
+    }
+    forEachRepo(repos, function(repo) {
+        // Determine remote name.
+        updateRepos([repo], [], true);
+        var branchName = retrieveCurrentBranchName();
+        if (branches.indexOf(branchName) == -1) {
+            stashAndPop(repo, function() {
+                cleanRepo(repo);
             });
-        });
+        } else {
+            execHelper('git clean -f -d');
+            cleanRepo(repo);
+        }
     });
 }
 
@@ -968,6 +1002,7 @@ function pendingChangesExist() {
 
 function stashAndPop(repo, func) {
     var requiresStash = pendingChangesExist();
+    var branchName = retrieveCurrentBranchName();
 
     if (requiresStash) {
         execHelper('git stash save --all --quiet "coho stash"');
@@ -975,6 +1010,7 @@ function stashAndPop(repo, func) {
 
     func();
 
+    gitCheckout(branchName);
     if (requiresStash) {
         execHelper('git stash pop');
     }
@@ -1082,6 +1118,31 @@ function updateJsSnapshot(repo, version) {
     }
 }
 
+function updateRepoVersion(repo, version) {
+    // Update the VERSION files.
+    var versionFilePaths = repo.versionFilePaths || ['VERSION'];
+    if (fs.existsSync(versionFilePaths[0])) {
+        versionFilePaths.forEach(function(versionFilePath) {
+            fs.writeFileSync(versionFilePath, version + '\n');
+        });
+        shjs.config.fatal = true;
+        if (repo.id == 'android') {
+            shjs.sed('-i', /CORDOVA_VERSION.*=.*;/, 'CORDOVA_VERSION = "' + version + '";', path.join('framework', 'src', 'org', 'apache', 'cordova', 'CordovaWebView.java'));
+            shjs.sed('-i', /VERSION.*=.*;/, 'VERSION = "' + version + '";', path.join('bin', 'templates', 'cordova', 'version'));
+        }
+        shjs.config.fatal = false;
+        if (!pendingChangesExist()) {
+            print('VERSION file was already up-to-date.');
+        }
+    } else {
+        console.warn('No VERSION file exists in repo ' + repo.repoName);
+    }
+
+    if (pendingChangesExist()) {
+        execHelper('git commit -am "Set VERSION to ' + version + ' (via coho)"');
+    }
+}
+
 function prepareReleaseBranchCommand() {
     var argv = configureReleaseCommandFlags(optimist
         .usage('Prepares release branches but does not create tags. This includes:\n' +
@@ -1128,36 +1189,22 @@ function prepareReleaseBranchCommand() {
                 gitCheckout(branchName);
                 // Update JS on branch.
                 updateJsSnapshot(repo, version);
+            } else if (localBranchExists(branchName)) {
+                execHelper('git checkout ' + branchName);
             } else {
                 execHelper('git checkout -b ' + branchName);
             }
-            // Update the VERSION files.
-            var versionFilePaths = repo.versionFilePaths || ['VERSION'];
-            if (fs.existsSync(versionFilePaths[0])) {
-                print(repo.repoName + ': ' + 'Updating VERSION file.');
-                versionFilePaths.forEach(function(versionFilePath) {
-                    fs.writeFileSync(versionFilePath, version + '\n');
-                });
-                shjs.config.fatal = true;
-                if (repo.id == 'android') {
-                    shjs.sed('-i', /CORDOVA_VERSION.*=.*;/, 'CORDOVA_VERSION = "' + version + '";', path.join('framework', 'src', 'org', 'apache', 'cordova', 'CordovaWebView.java'));
-                    shjs.sed('-i', /VERSION.*=.*;/, 'VERSION = "' + version + '";', path.join('bin', 'templates', 'cordova', 'version'));
-                }
-                shjs.config.fatal = false;
-                if (!pendingChangesExist()) {
-                    print('VERSION file was already up-to-date.');
-                }
-            } else {
-                console.warn('No VERSION file exists in repo ' + repo.repoName);
-            }
-
-            if (pendingChangesExist()) {
-                execHelper('git commit -am "Set VERSION to ' + version + ' (via coho)"');
-            }
+            print(repo.repoName + ': ' + 'Setting VERSION to "' + version + '" on branch + "' + branchName + '".');
+            updateRepoVersion(repo, version);
+            gitCheckout('master');
+            var devVersion = createPlatformDevVersion(version);
+            print(repo.repoName + ': ' + 'Setting VERSION to "' + devVersion + '" on branch + "master".');
+            updateRepoVersion(repo, devVersion);
+            gitCheckout(branchName);
         });
     });
 
-    reportGitPushResult();
+    reportGitPushResult(repos, ['master', branchName]);
 }
 
 function tagReleaseBranchCommand(argv) {
@@ -1466,7 +1513,7 @@ function main() {
             entryPoint: repoUpdateCommand
         }, {
             name: 'repo-reset',
-            desc: 'Performs git reset --hard origin/$BRANCH on all specified repositories.',
+            desc: 'Performs git reset --hard origin/$BRANCH and git clean -f -d on all specified repositories.',
             entryPoint: repoResetCommand
         }, {
             name: 'repo-status',