You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2013/04/22 23:17:41 UTC

git commit: [#6083] Bug fixes and update empty repo msg text

Updated Branches:
  refs/heads/cj/6083 936cb8323 -> 54cbaa692


[#6083] Bug fixes and update empty repo msg text

Signed-off-by: Tim Van Steenburgh <tv...@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/54cbaa69
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/54cbaa69
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/54cbaa69

Branch: refs/heads/cj/6083
Commit: 54cbaa6920c9c060633e8b0166ab3c1aadc4820e
Parents: 936cb83
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Mon Apr 22 21:17:13 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Mon Apr 22 21:17:13 2013 +0000

----------------------------------------------------------------------
 ForgeGit/forgegit/model/git_repo.py        |    2 +-
 ForgeGit/forgegit/templates/git/index.html |    2 +-
 ForgeSVN/forgesvn/controllers.py           |    2 +-
 ForgeSVN/forgesvn/model/svn.py             |    8 +++++++-
 ForgeSVN/forgesvn/templates/svn/index.html |    2 +-
 5 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/54cbaa69/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 296430f..5c79e34 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -356,7 +356,7 @@ class GitImplementation(M.RepositoryImplementation):
                 os.remove(tmpfilename)
 
     def is_empty(self):
-        return len(self._git.heads) == 0
+        return not self._git or len(self._git.heads) == 0
 
 
 class _OpenedGitBlob(object):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/54cbaa69/ForgeGit/forgegit/templates/git/index.html
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/templates/git/index.html b/ForgeGit/forgegit/templates/git/index.html
index 4276e65..f300d7a 100644
--- a/ForgeGit/forgegit/templates/git/index.html
+++ b/ForgeGit/forgegit/templates/git/index.html
@@ -86,7 +86,7 @@ git branch --set-upstream master origin/master  # so 'git pull' will work later<
     {% endif %}
   {% elif c.app.repo.status == 'ready' %}
     {% if h.has_access(c.app, 'write')() %}
-    <p>The metadata for this repository is to be missing.  Please try <a href="{{c.app.url}}refresh">refreshing</a> to correct this.</p>
+    <p>The metadata for this repository is missing.  To fix, please try a <a href="{{c.app.url}}refresh">refresh</a>.</p>
     {% else %}
     <p><b>No (more) commits</b></p>
     {% endif %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/54cbaa69/ForgeSVN/forgesvn/controllers.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/controllers.py b/ForgeSVN/forgesvn/controllers.py
index b14c134..83537a9 100644
--- a/ForgeSVN/forgesvn/controllers.py
+++ b/ForgeSVN/forgesvn/controllers.py
@@ -32,7 +32,7 @@ class BranchBrowser(repository.BranchBrowser):
     def index(self, limit=None, page=0, count=0, **kw):
         is_empty = c.app.repo.is_empty()
         latest = c.app.repo.latest(branch=self._branch)
-        if empty or not latest:
+        if is_empty or not latest:
             return dict(allow_fork=False, log=[], is_empty=is_empty)
         redirect(c.app.repo._impl.url_for_symbolic(latest._id) + 'tree/')
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/54cbaa69/ForgeSVN/forgesvn/model/svn.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/model/svn.py b/ForgeSVN/forgesvn/model/svn.py
index 1224f9c..fc9879c 100644
--- a/ForgeSVN/forgesvn/model/svn.py
+++ b/ForgeSVN/forgesvn/model/svn.py
@@ -667,7 +667,13 @@ class SVNImplementation(M.RepositoryImplementation):
                 os.remove(tmpfilename)
 
     def is_empty(self):
-        return self._svn.revpropget('revision', url=self._url)[0].number == 0
+        try:
+            return self._svn.revpropget('revision', url=self._url)[0].number == 0
+        except pysvn.ClientError as e:
+            if str(e).startswith("Unable to connect"):
+                return True
+            else:
+                raise
 
 
 Mapper.compile_all()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/54cbaa69/ForgeSVN/forgesvn/templates/svn/index.html
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/templates/svn/index.html b/ForgeSVN/forgesvn/templates/svn/index.html
index 47db43e..9b81fe3 100644
--- a/ForgeSVN/forgesvn/templates/svn/index.html
+++ b/ForgeSVN/forgesvn/templates/svn/index.html
@@ -95,7 +95,7 @@ svn import {{c.app.repo.clone_url('rw', c.user.username)}} -m "Initial commit"</
     {% endif %}
   {% elif c.app.repo.status == 'ready' %}
     {% if h.has_access(c.app, 'write')() %}
-    <p>The metadata for this repository is to be missing.  Please try <a href="{{c.app.url}}refresh">refreshing</a> to correct this.</p>
+    <p>The metadata for this repository is missing.  To fix, please try a <a href="{{c.app.url}}refresh">refresh</a>.</p>
     {% else %}
     <p><b>No (more) commits</b></p>
     {% endif %}