Permalink
Browse files

Support ssh and svn urls.

  • Loading branch information...
1 parent 2b96ad0 commit b62aac402f12e56f72e3c41edec19300a99b12bf Andre Rodrigues committed Nov 1, 2012
Showing with 21 additions and 17 deletions.
  1. +19 −17 lib/cli/linkedrevisioncontrol.js
  2. +2 −0 lib/cli/linkedrevisioncontrol_.js
@@ -75,15 +75,17 @@ function repositoryMatchUri(repository, remoteUri) {
delete cleanUri.auth;
cleanUri = url.format(cleanUri);
- return (((repository.clone_url.toLowerCase() === cleanUri.toLowerCase()) || (repository.html_url.toLowerCase() === cleanUri.toLowerCase())) || (repository.git_url.toLowerCase() === cleanUri.toLowerCase()));};
+ return (((((repository.clone_url.toLowerCase() === cleanUri.toLowerCase()) || (repository.html_url.toLowerCase() === cleanUri.toLowerCase())) || (repository.ssh_url.toLowerCase() === cleanUri.toLowerCase())) || (repository.svn_url.toLowerCase() === cleanUri.toLowerCase())) || (repository.git_url.toLowerCase() === cleanUri.toLowerCase()));};
-LinkedRevisionControlClient.prototype.determineIfCurrentDirectoryIsGitWorkingTree = function LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1(context, _) { var isInsideWorkTree, lines, __this = this; var __frame = { name: "LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1", line: 86 }; return __func(_, this, arguments, LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1, 1, __frame, function __$LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1() {
+
+
+LinkedRevisionControlClient.prototype.determineIfCurrentDirectoryIsGitWorkingTree = function LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1(context, _) { var isInsideWorkTree, lines, __this = this; var __frame = { name: "LinkedRevisionControlClient_prototype_determineIfCurrentDirectoryIsGitWorkingTree__1", line: 88 }; 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() {
@@ -104,7 +106,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: 107 }; 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: 109 }; 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); } ;
@@ -136,12 +138,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: 139 }; 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: 141 }; 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: 144 }; 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: 146 }; return __func(_, this, arguments, GitClient_prototype_deploy__4, 1, __frame, _);};
@@ -153,7 +155,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: 156 }; 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: 158 }; 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({
@@ -163,7 +165,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: 166 }; 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: 168 }; 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({
@@ -180,7 +182,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: 183 }; 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: 185 }; return __func(_, this, arguments, GithubClient_prototype_ensureCredentials__7, 1, __frame, function __$GithubClient_prototype_ensureCredentials__7() {
if (!context.github) {
context.github = { }; } ;
@@ -198,7 +200,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: 201 }; 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: 203 }; 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() {
@@ -241,7 +243,7 @@ GithubClient.prototype.init = function GithubClient_prototype_init__8(context, _
-GithubClient.prototype.deploy = function GithubClient_prototype_deploy__9(context, _) { var __frame = { name: "GithubClient_prototype_deploy__9", line: 244 }; 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: 246 }; 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)); });};
@@ -260,7 +262,7 @@ GithubClient.prototype.getRepositories = function GithubClient_prototype_getRepo
function filterPrivate(repository) {
- return (repository["private"] !== true); }; var __frame = { name: "GithubClient_prototype_getRepositories__10", line: 253 }; 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: 255 }; 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() {
@@ -292,7 +294,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: 295 }; 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: 297 }; return __func(_, this, arguments, GithubClient_prototype_createOrUpdateHook__11, 4, __frame, function __$GithubClient_prototype_createOrUpdateHook__11() {
parsedRepositoryUri = url.parse(websitesRepositoryUri);
parsedRepositoryUri.auth = websitesRepositoryAuth;
@@ -349,7 +351,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: 352 }; 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: 354 }; 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() {
@@ -359,7 +361,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: 362 }; 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: 364 }; 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() {
@@ -369,7 +371,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: 372 }; 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: 374 }; 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() {
@@ -379,7 +381,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: 382 }; 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: 384 }; 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() {
@@ -392,7 +394,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: 395 }; 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: 397 }; 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() {
@@ -77,6 +77,8 @@ function repositoryMatchUri (repository, remoteUri) {
return repository.clone_url.toLowerCase() === cleanUri.toLowerCase()
|| repository.html_url.toLowerCase() === cleanUri.toLowerCase()
+ || repository.ssh_url.toLowerCase() === cleanUri.toLowerCase()
+ || repository.svn_url.toLowerCase() === cleanUri.toLowerCase()
|| repository.git_url.toLowerCase() === cleanUri.toLowerCase();
}

0 comments on commit b62aac4

Please sign in to comment.