incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [11/36] git commit: [#6534] ticket:438 Skip mod_date update while importing wiki
Date Fri, 27 Sep 2013 16:43: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/65ba5bcc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/65ba5bcc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/65ba5bcc

Branch: refs/heads/db/6534
Commit: 65ba5bccfab5cdcd8c2043487c2a4ef092008f9f
Parents: 66ec2e9
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Tue Sep 17 18:24:02 2013 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 27 16:39:34 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/65ba5bcc/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