Permalink
Browse files

Using clone_url instead of git_url.

  • Loading branch information...
Andre Rodrigues
Andre Rodrigues committed Oct 24, 2012
1 parent ccdd753 commit 25a69de9e46a69b1e87c513f4f04d42ef51b730a
Showing with 67 additions and 43 deletions.
  1. +42 −30 lib/cli/linkedrevisioncontrol.js
  2. +25 −13 lib/cli/linkedrevisioncontrol_.js
@@ -59,7 +59,20 @@ LinkedRevisionControlClient._getRepository = function(repositories, remoteFullNa
-LinkedRevisionControlClient.prototype.determineIfCurrentDirectoryIsGitWorkingTree = function LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1(context, _) { var isInsideWorkTree, lines, __this = this; var __frame = { name: "LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1", line: 62 }; return __func(_, this, arguments, LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1, 1, __frame, function __$LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1() {
+
+
+
+
+LinkedRevisionControlClient._getRepositoryCloneUrl = function(repositories, remoteUri) {
+ return repositories.filter(function(repository) {
+ return (repository.clone_url.toLowerCase() === remoteUri.toLowerCase());
+ })[0];};
+
+
+
+
+
+LinkedRevisionControlClient.prototype.determineIfCurrentDirectoryIsGitWorkingTree = function LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1(context, _) { var isInsideWorkTree, lines, __this = this; var __frame = { name: "LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1", line: 75 }; return __func(_, this, arguments, LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1, 1, __frame, function __$LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1() {
__this.log.silly("determineIfCurrentDirectoryIsGitWorkingTree"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1() {
@@ -80,7 +93,7 @@ LinkedRevisionControlClient.prototype.determineIfCurrentDirectoryIsGitWorkingTre
-LinkedRevisionControlClient.prototype.initGitOnCurrentDirectory = function LinkedRevisionControlClient_prototype_initGitOnCurrentDirectory__2(context, scaffold, _) { var __this = this; var __frame = { name: "LinkedRevisionControlClient_prototype_initGitOnCurrentDirectory__2", line: 83 }; return __func(_, this, arguments, LinkedRevisionControlClient_prototype_initGitOnCurrentDirectory__2, 2, __frame, function __$LinkedRevisionControlClient_prototype_initGitOnCurrentDirectory__2() {
+LinkedRevisionControlClient.prototype.initGitOnCurrentDirectory = function LinkedRevisionControlClient_prototype_initGitOnCurrentDirectory__2(context, scaffold, _) { var __this = this; var __frame = { name: "LinkedRevisionControlClient_prototype_initGitOnCurrentDirectory__2", line: 96 }; return __func(_, this, arguments, LinkedRevisionControlClient_prototype_initGitOnCurrentDirectory__2, 2, __frame, function __$LinkedRevisionControlClient_prototype_initGitOnCurrentDirectory__2() {
__this.log.silly("initGitOnCurrentDirectoryIfNeeded");
if (context.flags.isGitWorkingTree) { return _(null); } ;
@@ -112,12 +125,12 @@ function GitClient(cli) {
util.inherits(GitClient, LinkedRevisionControlClient);
-GitClient.prototype.init = function GitClient_prototype_init__3(context, _) { var __this = this; var __frame = { name: "GitClient_prototype_init__3", line: 115 }; return __func(_, this, arguments, GitClient_prototype_init__3, 1, __frame, function __$GitClient_prototype_init__3() {
+GitClient.prototype.init = function GitClient_prototype_init__3(context, _) { var __this = this; var __frame = { name: "GitClient_prototype_init__3", line: 128 }; return __func(_, this, arguments, GitClient_prototype_init__3, 1, __frame, function __$GitClient_prototype_init__3() {
return __this.determineIfCurrentDirectoryIsGitWorkingTree(context, __cb(_, __frame, 1, 2, function __$GitClient_prototype_init__3() {
return __this.initGitOnCurrentDirectory(context, true, __cb(_, __frame, 2, 2, _, true)); }, true)); });};
-GitClient.prototype.deploy = function GitClient_prototype_deploy__4(context, _) { var __frame = { name: "GitClient_prototype_deploy__4", line: 120 }; return __func(_, this, arguments, GitClient_prototype_deploy__4, 1, __frame, _);};
+GitClient.prototype.deploy = function GitClient_prototype_deploy__4(context, _) { var __frame = { name: "GitClient_prototype_deploy__4", line: 133 }; return __func(_, this, arguments, GitClient_prototype_deploy__4, 1, __frame, _);};
@@ -129,7 +142,7 @@ function GithubClient(cli) {
util.inherits(GithubClient, LinkedRevisionControlClient);
-GithubClient.prototype.authenticate = function GithubClient_prototype_authenticate__5(context, _) { var __this = this; var __frame = { name: "GithubClient_prototype_authenticate__5", line: 132 }; return __func(_, this, arguments, GithubClient_prototype_authenticate__5, 1, __frame, function __$GithubClient_prototype_authenticate__5() {
+GithubClient.prototype.authenticate = function GithubClient_prototype_authenticate__5(context, _) { var __this = this; var __frame = { name: "GithubClient_prototype_authenticate__5", line: 145 }; return __func(_, this, arguments, GithubClient_prototype_authenticate__5, 1, __frame, function __$GithubClient_prototype_authenticate__5() {
return __this.ensureCredentials(context, __cb(_, __frame, 1, 2, function __$GithubClient_prototype_authenticate__5() {
__this.client.authenticate({
@@ -139,7 +152,7 @@ GithubClient.prototype.authenticate = function GithubClient_prototype_authentica
-GithubClient.prototype.authenticateAuth = function GithubClient_prototype_authenticateAuth__6(context, _) { var oauthToken, __this = this; var __frame = { name: "GithubClient_prototype_authenticateAuth__6", line: 142 }; return __func(_, this, arguments, GithubClient_prototype_authenticateAuth__6, 1, __frame, function __$GithubClient_prototype_authenticateAuth__6() {
+GithubClient.prototype.authenticateAuth = function GithubClient_prototype_authenticateAuth__6(context, _) { var oauthToken, __this = this; var __frame = { name: "GithubClient_prototype_authenticateAuth__6", line: 155 }; return __func(_, this, arguments, GithubClient_prototype_authenticateAuth__6, 1, __frame, function __$GithubClient_prototype_authenticateAuth__6() {
return __this.ensureCredentials(context, __cb(_, __frame, 1, 2, function __$GithubClient_prototype_authenticateAuth__6() {
__this.client.authenticate({
@@ -156,7 +169,7 @@ GithubClient.prototype.authenticateAuth = function GithubClient_prototype_authen
-GithubClient.prototype.ensureCredentials = function GithubClient_prototype_ensureCredentials__7(context, _) { var __this = this; var __frame = { name: "GithubClient_prototype_ensureCredentials__7", line: 159 }; return __func(_, this, arguments, GithubClient_prototype_ensureCredentials__7, 1, __frame, function __$GithubClient_prototype_ensureCredentials__7() {
+GithubClient.prototype.ensureCredentials = function GithubClient_prototype_ensureCredentials__7(context, _) { var __this = this; var __frame = { name: "GithubClient_prototype_ensureCredentials__7", line: 172 }; return __func(_, this, arguments, GithubClient_prototype_ensureCredentials__7, 1, __frame, function __$GithubClient_prototype_ensureCredentials__7() {
if (!context.github) {
context.github = { }; } ;
@@ -174,7 +187,7 @@ GithubClient.prototype.ensureCredentials = function GithubClient_prototype_ensur
-GithubClient.prototype.init = function GithubClient_prototype_init__8(context, _) { var repositories, remoteUris, __this = this; var __frame = { name: "GithubClient_prototype_init__8", line: 177 }; return __func(_, this, arguments, GithubClient_prototype_init__8, 1, __frame, function __$GithubClient_prototype_init__8() {
+GithubClient.prototype.init = function GithubClient_prototype_init__8(context, _) { var repositories, remoteUris, __this = this; var __frame = { name: "GithubClient_prototype_init__8", line: 190 }; return __func(_, this, arguments, GithubClient_prototype_init__8, 1, __frame, function __$GithubClient_prototype_init__8() {
return __this.authenticate(context, __cb(_, __frame, 1, 2, function __$GithubClient_prototype_init__8() {
@@ -183,42 +196,41 @@ GithubClient.prototype.init = function GithubClient_prototype_init__8(context, _
return __this.getRepositories(context.github.username, __cb(_, __frame, 8, 21, function ___(__0, __1) { repositories = __1; return (function __$GithubClient_prototype_init__8(__then) {
- if ((!((context.flags && context.flags.forceRepositorySelection)) && !context.github.repositoryFullName)) {
-
+ if (context.github.repositoryFullName) {
- return __this._getRemoteUris(__cb(_, __frame, 12, 21, function ___(__0, __2) { remoteUris = __2;
- if ((remoteUris.length === 1)) {
- context.github.repositoryFullName = remoteUris[0]; }
- else {
+ context.github.repository = LinkedRevisionControlClient._getRepository(repositories, context.github.repositoryFullName);
+ if (!context.github.repository) {
+ __this.log.info(("Invalid repository " + context.github.repositoryFullName)); } ; __then(); } else { return (function __$GithubClient_prototype_init__8(__then) {
- repositories = repositories.filter(function(repository) {
- return remoteUris.some(function(remoteUri) {
- return (remoteUri === repository.git_url); }); }); } ; __then(); }, true)); } else { __then(); } ; })(function __$GithubClient_prototype_init__8() {
+ if (!((context.flags && context.flags.forceRepositorySelection))) {
+ return __this._getRemoteUris(__cb(_, __frame, 20, 21, function ___(__0, __2) { remoteUris = __2;
+ if ((remoteUris.length === 1)) {
+ context.github.repository = LinkedRevisionControlClient._getRepositoryCloneUrl(repositories, remoteUris[0]); }
+ else {
- if (context.github.repositoryFullName) {
+ repositories = repositories.filter(function(repository) {
+ return remoteUris.some(function(remoteUri) {
+ return (remoteUri === repository.clone_url); }); }); } ; __then(); }, true)); } else { __then(); } ; })(__then); } ; })(function __$GithubClient_prototype_init__8() { return (function __$GithubClient_prototype_init__8(__then) {
- context.github.repository = LinkedRevisionControlClient._getRepository(repositories, context.github.repositoryFullName);
- if (!context.github.repository) {
- __this.log.info(("Invalid repository " + context.github.repositoryFullName)); } ; } ; return (function __$GithubClient_prototype_init__8(__then) {
if (!context.github.repository) {
__this.log.help("Choose a repository");
return choose(__this.cli, repositories.map(function(repository) {
- return repository.full_name; }), __cb(_, __frame, 38, 45, function ___(__0, __3) { context.github.repository = repositories[__3]; __then(); }, true)); } else { __then(); } ; })(_); }); }, true)); }, true)); }, true)); }, true)); });};
+ return repository.full_name; }), __cb(_, __frame, 37, 45, function ___(__0, __3) { context.github.repository = repositories[__3]; __then(); }, true)); } else { __then(); } ; })(_); }); }, true)); }, true)); }, true)); }, true)); });};
-GithubClient.prototype.deploy = function GithubClient_prototype_deploy__9(context, _) { var __frame = { name: "GithubClient_prototype_deploy__9", line: 221 }; return __func(_, this, arguments, GithubClient_prototype_deploy__9, 1, __frame, function __$GithubClient_prototype_deploy__9() {
+GithubClient.prototype.deploy = function GithubClient_prototype_deploy__9(context, _) { var __frame = { name: "GithubClient_prototype_deploy__9", line: 233 }; return __func(_, this, arguments, GithubClient_prototype_deploy__9, 1, __frame, function __$GithubClient_prototype_deploy__9() {
return context.lvcClient.createOrUpdateHook(context.github.repository.owner.login, context.github.repository.name, context.repositoryUri, context.repositoryAuth, __cb(_, __frame, 2, 2, _, true)); });};
@@ -237,7 +249,7 @@ GithubClient.prototype.getRepositories = function GithubClient_prototype_getRepo
function filterPrivate(repository) {
- return (repository["private"] !== true); }; var __frame = { name: "GithubClient_prototype_getRepositories__10", line: 230 }; return __func(_, this, arguments, GithubClient_prototype_getRepositories__10, 1, __frame, function __$GithubClient_prototype_getRepositories__10() { progress = __this.cli.progress("Retrieving repositories"); userRepos = []; return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$GithubClient_prototype_getRepositories__10() {
+ return (repository["private"] !== true); }; var __frame = { name: "GithubClient_prototype_getRepositories__10", line: 242 }; return __func(_, this, arguments, GithubClient_prototype_getRepositories__10, 1, __frame, function __$GithubClient_prototype_getRepositories__10() { progress = __this.cli.progress("Retrieving repositories"); userRepos = []; return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$GithubClient_prototype_getRepositories__10() {
@@ -269,7 +281,7 @@ GithubClient.prototype.getRepositories = function GithubClient_prototype_getRepo
return _(null, userRepos); }); }); });};
-GithubClient.prototype.createOrUpdateHook = function GithubClient_prototype_createOrUpdateHook__11(username, repository, websitesRepositoryUri, websitesRepositoryAuth, _) { var parsedRepositoryUri, deployUri, hooks, existingHook, newHook, __this = this; var __frame = { name: "GithubClient_prototype_createOrUpdateHook__11", line: 272 }; return __func(_, this, arguments, GithubClient_prototype_createOrUpdateHook__11, 4, __frame, function __$GithubClient_prototype_createOrUpdateHook__11() {
+GithubClient.prototype.createOrUpdateHook = function GithubClient_prototype_createOrUpdateHook__11(username, repository, websitesRepositoryUri, websitesRepositoryAuth, _) { var parsedRepositoryUri, deployUri, hooks, existingHook, newHook, __this = this; var __frame = { name: "GithubClient_prototype_createOrUpdateHook__11", line: 284 }; return __func(_, this, arguments, GithubClient_prototype_createOrUpdateHook__11, 4, __frame, function __$GithubClient_prototype_createOrUpdateHook__11() {
parsedRepositoryUri = url.parse(websitesRepositoryUri);
parsedRepositoryUri.auth = websitesRepositoryAuth;
@@ -324,7 +336,7 @@ GithubClient.prototype.createOrUpdateHook = function GithubClient_prototype_crea
-GithubClient.prototype.createHook = function GithubClient_prototype_createHook__12(hook, _) { var progress, __this = this; var __frame = { name: "GithubClient_prototype_createHook__12", line: 327 }; return __func(_, this, arguments, GithubClient_prototype_createHook__12, 1, __frame, function __$GithubClient_prototype_createHook__12() {
+GithubClient.prototype.createHook = function GithubClient_prototype_createHook__12(hook, _) { var progress, __this = this; var __frame = { name: "GithubClient_prototype_createHook__12", line: 339 }; return __func(_, this, arguments, GithubClient_prototype_createHook__12, 1, __frame, function __$GithubClient_prototype_createHook__12() {
progress = __this.cli.progress("Creating new hook"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$GithubClient_prototype_createHook__12() {
@@ -334,7 +346,7 @@ GithubClient.prototype.createHook = function GithubClient_prototype_createHook__
-GithubClient.prototype.updateHook = function GithubClient_prototype_updateHook__13(hook, _) { var progress, __this = this; var __frame = { name: "GithubClient_prototype_updateHook__13", line: 337 }; return __func(_, this, arguments, GithubClient_prototype_updateHook__13, 1, __frame, function __$GithubClient_prototype_updateHook__13() {
+GithubClient.prototype.updateHook = function GithubClient_prototype_updateHook__13(hook, _) { var progress, __this = this; var __frame = { name: "GithubClient_prototype_updateHook__13", line: 349 }; return __func(_, this, arguments, GithubClient_prototype_updateHook__13, 1, __frame, function __$GithubClient_prototype_updateHook__13() {
progress = __this.cli.progress("Updating hook"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$GithubClient_prototype_updateHook__13() {
@@ -344,7 +356,7 @@ GithubClient.prototype.updateHook = function GithubClient_prototype_updateHook__
-GithubClient.prototype.testHook = function GithubClient_prototype_testHook__14(hook, _) { var progress, __this = this; var __frame = { name: "GithubClient_prototype_testHook__14", line: 347 }; return __func(_, this, arguments, GithubClient_prototype_testHook__14, 1, __frame, function __$GithubClient_prototype_testHook__14() {
+GithubClient.prototype.testHook = function GithubClient_prototype_testHook__14(hook, _) { var progress, __this = this; var __frame = { name: "GithubClient_prototype_testHook__14", line: 359 }; return __func(_, this, arguments, GithubClient_prototype_testHook__14, 1, __frame, function __$GithubClient_prototype_testHook__14() {
progress = __this.cli.progress("Testing hook"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$GithubClient_prototype_testHook__14() {
@@ -354,7 +366,7 @@ GithubClient.prototype.testHook = function GithubClient_prototype_testHook__14(h
-GithubClient.prototype.getHooks = function GithubClient_prototype_getHooks__15(username, repository, _) { var progress, __this = this; var __frame = { name: "GithubClient_prototype_getHooks__15", line: 357 }; return __func(_, this, arguments, GithubClient_prototype_getHooks__15, 2, __frame, function __$GithubClient_prototype_getHooks__15() {
+GithubClient.prototype.getHooks = function GithubClient_prototype_getHooks__15(username, repository, _) { var progress, __this = this; var __frame = { name: "GithubClient_prototype_getHooks__15", line: 369 }; return __func(_, this, arguments, GithubClient_prototype_getHooks__15, 2, __frame, function __$GithubClient_prototype_getHooks__15() {
progress = __this.cli.progress("Retrieving website hooks"); return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$GithubClient_prototype_getHooks__15() {
@@ -367,7 +379,7 @@ GithubClient.prototype.getHooks = function GithubClient_prototype_getHooks__15(u
-GithubClient.prototype._getRemoteUris = function GithubClient_prototype__getRemoteUris__16(_) { var progress, remoteUris, remotes, __this = this; var __frame = { name: "GithubClient_prototype__getRemoteUris__16", line: 370 }; return __func(_, this, arguments, GithubClient_prototype__getRemoteUris__16, 0, __frame, function __$GithubClient_prototype__getRemoteUris__16() {
+GithubClient.prototype._getRemoteUris = function GithubClient_prototype__getRemoteUris__16(_) { var progress, remoteUris, remotes, __this = this; var __frame = { name: "GithubClient_prototype__getRemoteUris__16", line: 382 }; return __func(_, this, arguments, GithubClient_prototype__getRemoteUris__16, 0, __frame, function __$GithubClient_prototype__getRemoteUris__16() {
progress = __this.cli.progress("Retrieving local git repositories");
remoteUris = []; return (function ___(__then) { (function ___(_) { __tryCatch(_, function __$GithubClient_prototype__getRemoteUris__16() {
Oops, something went wrong.

0 comments on commit 25a69de

Please sign in to comment.