incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [09/22] git commit: [#6464] Added skip_mod_date to GC tracker importer
Date Tue, 20 Aug 2013 17:45:39 GMT
[#6464] Added skip_mod_date to GC tracker importer

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

Branch: refs/heads/cj/6464
Commit: b9c9b5c3d86c1af43c9d79bd7436421df18982e9
Parents: 97102be
Author: Cory Johns <cjohns@slashdotmedia.com>
Authored: Thu Aug 8 21:10:24 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Tue Aug 20 17:34:13 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/google/tracker.py | 23 ++++++++++++--------
 1 file changed, 14 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b9c9b5c3/ForgeImporters/forgeimporters/google/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/tracker.py b/ForgeImporters/forgeimporters/google/tracker.py
index a997429..bd3a57f 100644
--- a/ForgeImporters/forgeimporters/google/tracker.py
+++ b/ForgeImporters/forgeimporters/google/tracker.py
@@ -21,6 +21,7 @@ from datetime import datetime
 from pylons import tmpl_context as c
 from ming.orm import session, ThreadLocalORMSession
 
+from allura import model as M
 from allura.lib import helpers as h
 
 from forgetracker.tracker_main import ForgeTrackerApp
@@ -48,15 +49,19 @@ class GoogleCodeTrackerImporter(ToolImporter):
         c.app.globals.open_status_names = 'New Accepted Started'
         c.app.globals.closed_status_names = 'Fixed Verified Invalid Duplicate WontFix Done'
         self.custom_fields = {}
-        for issue in GoogleCodeProjectExtractor.iter_issues(project_name):
-            ticket = TM.Ticket.new()
-            self.process_fields(ticket, issue)
-            self.process_labels(ticket, issue)
-            self.process_comments(ticket, issue)
-            session(ticket).flush(ticket)
-            session(ticket).expunge(ticket)
-        self.postprocess_custom_fields()
-        ThreadLocalORMSession.flush_all()
+        try:
+            M.session.artifact_orm_session._get().skip_mod_date = True
+            for issue in GoogleCodeProjectExtractor.iter_issues(project_name):
+                ticket = TM.Ticket.new()
+                self.process_fields(ticket, issue)
+                self.process_labels(ticket, issue)
+                self.process_comments(ticket, issue)
+                session(ticket).flush(ticket)
+                session(ticket).expunge(ticket)
+            self.postprocess_custom_fields()
+            ThreadLocalORMSession.flush_all()
+        finally:
+            M.session.artifact_orm_session._get().skip_mod_date = False
 
     def custom_field(self, name):
         if name not in self.custom_fields:


Mime
View raw message