From fb8e1022c2c524e5a3d135a84bfcabb4d14bb15d Mon Sep 17 00:00:00 2001 From: Szymon Brandys Date: Thu, 26 Jan 2012 14:25:37 +0100 Subject: [PATCH] Show outgoing commits when a repo is initialized and new remote is added --- .../web/orion/git/gitRepositoryExplorer.js | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js index 94d48c5665..dca379a14a 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js @@ -458,7 +458,7 @@ exports.GitRepositoryExplorer = (function() { ); }; - GitRepositoryExplorer.prototype.displayRemoteBranches2 = function(remotes, repository, deferred){ + GitRepositoryExplorer.prototype.displayRemoteBranches2 = function(remotes, repository, deferred, anyRemoteBranch){ var that = this; if (deferred == null) deferred = new dojo.Deferred(); @@ -471,12 +471,16 @@ exports.GitRepositoryExplorer = (function() { remoteBranches[i].Repository = repository; that.renderRemoteBranch(remoteBranches[i], i); } - that.displayRemoteBranches2(remotes.slice(1), repository, deferred); + that.displayRemoteBranches2(remotes.slice(1), repository, deferred, (anyRemoteBranch || (remoteBranches.length > 0))); }, function () { } ); } else { + if (!anyRemoteBranch){ + dojo.style(dojo.byId("remoteBranchSectionProgress"), "visibility", "hidden"); + dojo.byId("remoteBranchHeader").innerHTML = "No Remote Branches"; + } deferred.callback(); } @@ -585,6 +589,19 @@ exports.GitRepositoryExplorer = (function() { ); } ); + } else { + that.registry.getService("orion.git.provider").doGitLog(currentBranch.CommitLocation + "?page=1&pageSize=20", + function(resp){ + dojo.style(dojo.byId("commitSectionProgress"), "visibility", "hidden"); + + for (var i=0; i