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/17 17:11:28 UTC
[1/2] git commit: Tweak repo-status to give output sooner and use
more noticable headers.
Updated Branches:
refs/heads/master 7584a56d5 -> 3564f2818
Tweak repo-status to give output sooner and use more noticable headers.
Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/3564f281
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/3564f281
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/3564f281
Branch: refs/heads/master
Commit: 3564f2818168d3c7507706f3e0047dba759c5899
Parents: b3f54d9
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Sep 17 10:55:30 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Sep 17 11:10:35 2013 -0400
----------------------------------------------------------------------
coho | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/3564f281/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index aa9c6f6..46619c1 100755
--- a/coho
+++ b/coho
@@ -312,7 +312,7 @@ function reportGitPushResult(repos, branches) {
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 ' + flagsStr);
+ print(' ' + process.argv[1] + ' repo-status ' + flagsStr + ' | less');
print('To push changes:');
print(' ' + process.argv[1] + ' repo-push ' + flagsStr);
print('To revert all local commits:');
@@ -792,9 +792,6 @@ function repoStatusCommand(argv) {
fatal('Must specify the same number of --branch and --branch2 flags');
}
- var logs = '';
- var diffs = '';
-
forEachRepo(repos, function(repo) {
// Determine remote name.
updateRepos([repo], [], true);
@@ -806,22 +803,31 @@ function repoStatusCommand(argv) {
var targetBranch = branches2 ? branches2[i] : (remoteBranchExists(repo, branchName) ? repo.remoteName + '/' + branchName : 'master');
var changes = execHelper('git log --oneline ' + targetBranch + '..' + branchName, true);
if (changes) {
- logs += repo.repoName + ' on branch ' + branchName + ' (vs ' + targetBranch + '): Commits exist.\n';
- logs += changes + '\n';
- if (argv.diff) {
- diffs += 'Diff (truncated) for ' + repo.repoName + ' on branch ' + branchName + ' (vs ' + targetBranch + '):\n';
- diffs += execHelper('git diff ' + targetBranch + '...' + branchName, true).split('\n').slice(0, 30).join('\n');
- diffs += '\n\n';
- }
+ print(repo.repoName + ' on branch ' + branchName + ' (vs ' + targetBranch + '): Commits exist.');
+ console.log(changes);
} else {
- logs += repo.repoName + ' on branch ' + branchName + ' (vs ' + targetBranch + '): No changes\n';
+ print(repo.repoName + ' on branch ' + branchName + ' (vs ' + targetBranch + '): No changes');
}
});
});
- print('\n\n');
- print(logs);
if (argv.diff) {
- print(diffs);
+ forEachRepo(repos, function(repo) {
+ var actualBranches = branches ? branches : [/^plugin/.test(repo.id) ? 'dev' : 'master'];
+ actualBranches.forEach(function(branchName, i) {
+ if (!localBranchExists(branchName)) {
+ return;
+ }
+ var targetBranch = branches2 ? branches2[i] : (remoteBranchExists(repo, branchName) ? repo.remoteName + '/' + branchName : 'master');
+ var diff = execHelper('git diff ' + targetBranch + '...' + branchName, true);
+ if (diff) {
+ print('------------------------------------------------------------------------------');
+ print('Diff for ' + repo.repoName + ' on branch ' + branchName + ' (vs ' + targetBranch + ')');
+ print('------------------------------------------------------------------------------');
+ console.log(diff);
+ console.log('\n');
+ }
+ });
+ });
}
}
[2/2] git commit: Tweak JS updating so that it updates the JS on
master / release branch separately.
Posted by ag...@apache.org.
Tweak JS updating so that it updates the JS on master / release branch separately.
Now that we version master branch with "-dev", it doesn't make sense to
branch after updating the JS.
Project: http://git-wip-us.apache.org/repos/asf/cordova-coho/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-coho/commit/b3f54d90
Tree: http://git-wip-us.apache.org/repos/asf/cordova-coho/tree/b3f54d90
Diff: http://git-wip-us.apache.org/repos/asf/cordova-coho/diff/b3f54d90
Branch: refs/heads/master
Commit: b3f54d909ddfa916f861c81c3696bfb319350c4a
Parents: 7584a56
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Sep 17 10:42:54 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Sep 17 11:10:35 2013 -0400
----------------------------------------------------------------------
coho | 41 ++++++++++++++++++++++++-----------------
1 file changed, 24 insertions(+), 17 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-coho/blob/b3f54d90/coho
----------------------------------------------------------------------
diff --git a/coho b/coho
index ff0d93c..aa9c6f6 100755
--- a/coho
+++ b/coho
@@ -350,6 +350,9 @@ function createPlatformDevVersion(version) {
}
function getVersionBranchName(version) {
+ if (/-dev$/.test(version)) {
+ return 'master';
+ }
return version.replace(/\d+(-?rc\d)?$/, 'x');
}
@@ -418,9 +421,9 @@ function cpAndLog(src, dest) {
}
function gitCheckout(branchName) {
- var curBranch = retrieveCurrentBranchName();
+ var curBranch = retrieveCurrentBranchName(true);
if (curBranch != branchName) {
- execHelper('git checkout ' + branchName);
+ execHelper('git checkout -q ' + branchName);
}
}
@@ -661,9 +664,12 @@ function remoteBranchExists(repo, name) {
return !!execHelper('git branch -r --list ' + repo.remoteName + '/' + name, true);
}
-function retrieveCurrentBranchName() {
+function retrieveCurrentBranchName(allowDetached) {
var ref = execHelper('git symbolic-ref HEAD', true, true);
if (!ref) {
+ if (allowDetached) {
+ return null;
+ }
throw new Error('Aborted due to repo ' + shjs.pwd() + ' not being on a named branch');
}
var match = /refs\/heads\/(.*)/.exec(ref);
@@ -1086,20 +1092,22 @@ function configureReleaseCommandFlags(opt) {
return argv;
}
-var hasBuiltJs = false;
+var hasBuiltJs = '';
function updateJsSnapshot(repo, version) {
function ensureJsIsBuilt() {
var cordovaJsRepo = getRepoById('js');
- if (!hasBuiltJs) {
+ if (hasBuiltJs != version) {
forEachRepo([cordovaJsRepo], function() {
- gitCheckout(getVersionBranchName(version));
- var actualCurTag = retrieveCurrentTagName();
- if (actualCurTag != version) {
- fatal('Not preparing branches since cordova-js is not at the version tag. (it\'s at ' + actualCurTag + ')');
- }
- execHelper('grunt cordovajs');
- hasBuiltJs = true;
+ stashAndPop(cordovaJsRepo, function() {
+ if (getVersionBranchName(version) == 'master') {
+ gitCheckout('master');
+ } else {
+ gitCheckout(version);
+ }
+ execHelper('grunt cordovajs');
+ hasBuiltJs = version;
+ });
});
}
}
@@ -1186,9 +1194,6 @@ function prepareReleaseBranchCommand() {
stashAndPop(repo, function() {
// git fetch + update master
updateRepos([repo], ['master'], false);
- gitCheckout('master');
- // Update JS on master.
- updateJsSnapshot(repo, version);
// Either create or pull down the branch.
if (remoteBranchExists(repo, branchName)) {
@@ -1196,19 +1201,21 @@ function prepareReleaseBranchCommand() {
// Check out and rebase.
updateRepos([repo], [branchName], true);
gitCheckout(branchName);
- // Update JS on branch.
- updateJsSnapshot(repo, version);
} else if (localBranchExists(branchName)) {
execHelper('git checkout ' + branchName);
} else {
+ gitCheckout('master');
execHelper('git checkout -b ' + branchName);
}
+ updateJsSnapshot(repo, version);
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);
+ updateJsSnapshot(repo, devVersion);
gitCheckout(branchName);
});
});