incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tvansteenbu...@apache.org
Subject [10/50] git commit: [#6534] ticket:438 Skip mod_date update while importing wiki
Date Fri, 04 Oct 2013 23:23:16 GMT
[#6534] ticket:438 Skip mod_date update while importing wiki


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

Branch: refs/heads/tv/6670
Commit: 0f5a8ff4c8fa687389a63f3e253df9359e81528d
Parents: f7efd69
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Sep 17 18:24:02 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Oct 4 14:21:20 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/wiki.py | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/0f5a8ff4/ForgeImporters/forgeimporters/github/wiki.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/wiki.py b/ForgeImporters/forgeimporters/github/wiki.py
index 62ea5e1..3edf0c8 100644
--- a/ForgeImporters/forgeimporters/github/wiki.py
+++ b/ForgeImporters/forgeimporters/github/wiki.py
@@ -22,8 +22,10 @@ from shutil import rmtree
 import git
 from pylons import app_globals as g
 from pylons import tmpl_context as c
+from ming.orm import ThreadLocalORMSession
 
 from allura.lib import helpers as h
+from allura import model as M
 from forgeimporters.base import ToolImporter
 from forgeimporters.github import GitHubProjectExtractor
 from forgewiki import model as WM
@@ -82,10 +84,19 @@ class GitHubWikiImporter(ToolImporter):
             mount_point=mount_point or 'wiki',
             mount_label=mount_label or 'Wiki')
         with_history = tool_option == 'history_github_wiki'
-        with h.push_config(c, app=app):
-            self.get_wiki_pages(extractor.get_page_url('wiki_url'), history=with_history)
-        g.post_event('project_updated')
-        return app
+        ThreadLocalORMSession.flush_all()
+        try:
+            M.session.artifact_orm_session._get().skip_mod_date = True
+            with h.push_config(c, app=app):
+                self.get_wiki_pages(extractor.get_page_url('wiki_url'), history=with_history)
+            ThreadLocalORMSession.flush_all()
+            g.post_event('project_updated')
+            return app
+        except Exception as e:
+            h.make_app_admin_only(app)
+            raise
+        finally:
+            M.session.artifact_orm_session._get().skip_mod_date = False
 
     def get_blobs_without_history(self, commit):
         for page in commit.tree.blobs:


Mime
View raw message