You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by js...@apache.org on 2014/08/22 21:29:48 UTC

[1/4] git commit: CB-5312 Support github.com/apache repositories

Repository: cordova-coho
Updated Branches:
  refs/heads/master 7449285da -> 4ef3e11ee


CB-5312 Support github.com/apache repositories


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

Branch: refs/heads/master
Commit: 3f644787dea610ab3b8608562af616398d202e56
Parents: 7449285
Author: Josh Soref <js...@blackberry.com>
Authored: Wed Aug 20 11:34:53 2014 -0400
Committer: Josh Soref <js...@blackberry.com>
Committed: Wed Aug 20 19:46:15 2014 -0400

----------------------------------------------------------------------
 src/repo-update.js | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/3f644787/src/repo-update.js
----------------------------------------------------------------------
diff --git a/src/repo-update.js b/src/repo-update.js
index 09a0bd3..7f06514 100644
--- a/src/repo-update.js
+++ b/src/repo-update.js
@@ -138,8 +138,12 @@ function *determineApacheRemote(repo) {
     var fields = (yield executil.execHelper(executil.ARGS('git remote -v'), true)).split(/\s+/);
     var ret = null;
     for (var i = 1; i < fields.length; i += 3) {
-        ['git-wip-us.apache.org/repos/asf/', 'git.apache.org/'].forEach(function(validRepo) {
-            if (fields[i].indexOf(validRepo + repo.repoName) != -1) {
+        [
+          'git-wip-us.apache.org/repos/asf/',
+          'git.apache.org/',
+          'github.com/apache/',
+        ].forEach(function(validRepo) {
+            if (!ret && fields[i].indexOf(validRepo + repo.repoName) != -1) {
                 ret = fields[i - 1];
             }
         });


[4/4] git commit: Support variable == width

Posted by js...@apache.org.
Support variable == width

+ support in repo-update


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

Branch: refs/heads/master
Commit: 4ef3e11ee72491110f7fa6d4d726ff4af12897e5
Parents: 228257c
Author: Josh Soref <js...@blackberry.com>
Authored: Thu Aug 21 14:05:52 2014 -0400
Committer: Josh Soref <js...@blackberry.com>
Committed: Fri Aug 22 15:29:19 2014 -0400

----------------------------------------------------------------------
 src/apputil.js     | 4 +++-
 src/repo-update.js | 4 ++++
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/4ef3e11e/src/apputil.js
----------------------------------------------------------------------
diff --git a/src/apputil.js b/src/apputil.js
index c729d81..dc640e6 100644
--- a/src/apputil.js
+++ b/src/apputil.js
@@ -42,6 +42,8 @@ exports.fatal = function() {
     process.exit(1);
 };
 
+exports.prefixLength = 30;
+
 exports.print = function() {
     var newArgs = Array.prototype.slice.call(arguments);
     // Prefix any prints() to distinguish them from command output.
@@ -49,7 +51,7 @@ exports.print = function() {
         var curDir = path.relative(baseWorkingDir, process.cwd());
         curDir = curDir ? curDir + '/' : './';
         var banner = ' =';
-        var PREFIX_LEN = 30;
+        var PREFIX_LEN = exports.prefixLength;
         if (curDir.length < PREFIX_LEN) {
             banner += new Array(PREFIX_LEN - curDir.length + 1).join('=');
         }

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/4ef3e11e/src/repo-update.js
----------------------------------------------------------------------
diff --git a/src/repo-update.js b/src/repo-update.js
index 7f06514..4e08a36 100644
--- a/src/repo-update.js
+++ b/src/repo-update.js
@@ -60,6 +60,10 @@ module.exports = function*(argv) {
     }
     var branches = Array.isArray(argv.b) ? argv.b : [argv.b];
     var repos = flagutil.computeReposFromFlag(argv.r);
+    apputil.prefixLength = Math.max.apply(null,
+        [apputil.prefixLength].concat(
+            repos.map(function (r) { return r.repoName.length + 2; }))
+        );
 
     // ensure that any missing repos are cloned
     yield require('./repo-clone').cloneRepos(repos,true);


[3/4] git commit: Handle: -r without a value

Posted by js...@apache.org.
Handle: -r without a value


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

Branch: refs/heads/master
Commit: 228257ca2b6c14eb3f37070745674070f531a784
Parents: 939b5e1
Author: Josh Soref <js...@blackberry.com>
Authored: Thu Aug 21 14:04:19 2014 -0400
Committer: Josh Soref <js...@blackberry.com>
Committed: Fri Aug 22 15:28:26 2014 -0400

----------------------------------------------------------------------
 src/flagutil.js | 2 +-
 src/main.js     | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/228257ca/src/flagutil.js
----------------------------------------------------------------------
diff --git a/src/flagutil.js b/src/flagutil.js
index 72bfb2e..2c9e4b2 100644
--- a/src/flagutil.js
+++ b/src/flagutil.js
@@ -36,7 +36,7 @@ exports.registerRepoFlag = function(opt) {
 }
 
 exports.computeReposFromFlag = function(flagValue) {
-    var values = Array.isArray(flagValue) ? flagValue : [flagValue];
+    var values = flagValue === true ? [] : Array.isArray(flagValue) ? flagValue : [flagValue];
     var ret = [];
     var addedIds = {};
     function addRepo(repo) {

http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/228257ca/src/main.js
----------------------------------------------------------------------
diff --git a/src/main.js b/src/main.js
index 81150e2..438fa47 100644
--- a/src/main.js
+++ b/src/main.js
@@ -164,6 +164,9 @@ module.exports = function() {
             if (!commandMap[command]) {
                 throw 'Unknown command: ' + command;
             }
+            if (argv.r === true) {
+                throw 'No repositories specified, see list-repos';
+            }
         }).argv;
 
     // Change directory to be a sibling of coho.


[2/4] git commit: Handle symlinks to non sibling directories

Posted by js...@apache.org.
Handle symlinks to non sibling directories


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

Branch: refs/heads/master
Commit: 939b5e150eb1e4f7399ac9919eb5b0ba44cba88a
Parents: 3f64478
Author: Josh Soref <js...@blackberry.com>
Authored: Thu Aug 21 12:14:09 2014 -0400
Committer: Josh Soref <js...@blackberry.com>
Committed: Fri Aug 22 15:28:23 2014 -0400

----------------------------------------------------------------------
 src/repoutil.js | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/939b5e15/src/repoutil.js
----------------------------------------------------------------------
diff --git a/src/repoutil.js b/src/repoutil.js
index c616962..615090d 100644
--- a/src/repoutil.js
+++ b/src/repoutil.js
@@ -415,23 +415,23 @@ function getRepoById(id, opt_repos) {
 }
 exports.getRepoById = getRepoById;
 
-var isInForEachRepoFunction = false;
+var isInForEachRepoFunction = '';
 
 exports.forEachRepo = function*(repos, func) {
     for (var i = 0; i < repos.length; ++i) {
         var repo = repos[i];
-        var origPath = isInForEachRepoFunction ? process.cwd() : '..';
-        var newPath = isInForEachRepoFunction ? path.join('..', repo.repoName) : repo.repoName;
+        var origPath = isInForEachRepoFunction || '..';
+        var newPath = path.join(isInForEachRepoFunction, repo.repoName);
 
-        isInForEachRepoFunction = true;
+        isInForEachRepoFunction = isInForEachRepoFunction || process.cwd();
         shelljs.cd(newPath);
         if (shelljs.error()) {
             apputil.fatal('Repo directory does not exist: ' + repo.repoName + '. First run coho repo-clone.');
         }
         yield func(repo);
-        shelljs.cd(origPath);
+        shelljs.cd(isInForEachRepoFunction);
 
-        isInForEachRepoFunction = origPath != '..';
+        isInForEachRepoFunction = origPath != '..' && isInForEachRepoFunction || '';
     }
 }