You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2014/01/30 23:56:56 UTC

[2/2] git commit: [#7118] Better handling for GitHub wiki import errors

[#7118] Better handling for GitHub wiki import errors

Signed-off-by: Cory Johns <cj...@slashdotmedia.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/1d8f6c8a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/1d8f6c8a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/1d8f6c8a

Branch: refs/heads/cj/7118
Commit: 1d8f6c8a087d267ade34262445c9b06680267a46
Parents: 38c10a6
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Thu Jan 30 21:11:11 2014 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Thu Jan 30 22:55:56 2014 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/wiki.py | 22 +++++++++++++++++-----
 requirements-sf.txt                          |  4 ++--
 2 files changed, 19 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1d8f6c8a/ForgeImporters/forgeimporters/github/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/wiki.py b/ForgeImporters/forgeimporters/github/wiki.py
index 99333f7..1891da7 100644
--- a/ForgeImporters/forgeimporters/github/wiki.py
+++ b/ForgeImporters/forgeimporters/github/wiki.py
@@ -143,14 +143,15 @@ class GitHubWikiImporter(ToolImporter):
     available_pages = []
 
     def import_tool(
-            self, project, user, project_name=None, mount_point=None, mount_label=None, user_name=None,
-            tool_option=None, **kw):
+            self, project, user, project_name=None, mount_point=None,
+            mount_label=None, user_name=None, tool_option=None, **kw):
         """ Import a GitHub wiki into a new Wiki Allura tool.
 
         """
         project_name = "%s/%s" % (user_name, project_name)
         extractor = GitHubProjectExtractor(project_name, user=user)
-        if not extractor.has_wiki():
+        wiki_avail = extractor.has_wiki()
+        if not wiki_avail:
             return
 
         self.github_wiki_url = extractor.get_page_url(
@@ -171,8 +172,19 @@ class GitHubWikiImporter(ToolImporter):
         try:
             M.session.artifact_orm_session._get().skip_mod_date = True
             with h.push_config(c, app=self.app):
-                self.import_pages(
-                    extractor.get_page_url('wiki_url'), history=with_history)
+                try:
+                    wiki_url = extractor.get_page_url('wiki_url')
+                    self.import_pages(wiki_url, history=with_history)
+                except git.GitCommandError:
+                    log.error(
+                        'Unable to clone GitHub wiki: '
+                        'wiki_url=%s; '
+                        'wiki_avail=%s; '
+                        'avail_url=%s',
+                        wiki_url, wiki_avail,
+                        extractor.get_page_url('project_info'),
+                        exc_info=True)
+                    raise
             ThreadLocalORMSession.flush_all()
             M.AuditLog.log(
                 'import tool %s from %s on %s' % (

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1d8f6c8a/requirements-sf.txt
----------------------------------------------------------------------
diff --git a/requirements-sf.txt b/requirements-sf.txt
index 8c6c040..b54c0c0 100644
--- a/requirements-sf.txt
+++ b/requirements-sf.txt
@@ -24,9 +24,9 @@ TracWikiImporter==0.3.6
 MediawikiImporter==0.0.2
 Unidecode==0.04.14
 
-# use version built from https://github.com/johnsca/GitPython/commits/tv/6000
+# use version built from https://github.com/johnsca/GitPython/tree/sf-master
 # for unmerged fixes for [#5411], [#6000], and [#6078]
-GitPython==0.3.2.RC1-20131017
+GitPython==0.3.2.RC1-20140130
 
 WebError==0.10.3-20130423