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 2013/09/24 19:07:40 UTC

[01/50] git commit: [#6100] ticket:431 Remove commented code and expand test

Updated Branches:
  refs/heads/cj/6422 b081c5dda -> 05ff83e59 (forced update)


[#6100] ticket:431 Remove commented code and expand test


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

Branch: refs/heads/cj/6422
Commit: 671627eb5bd3838974014b14da84b3308ca43b39
Parents: e2f3e82
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Sep 12 15:32:00 2013 +0300
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Wed Sep 18 14:40:14 2013 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/model/ticket.py               | 2 --
 ForgeTracker/forgetracker/tests/functional/test_root.py | 3 ++-
 2 files changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/671627eb/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 03ee03f..0ef8cab 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -898,8 +898,6 @@ class Ticket(VersionedArtifact, ActivityObject, VotableArtifact):
             if old_val is None:
                 custom_fields[fn] = None if ft == 'user' else ''
             custom_fields[fn] = old_val
-        # custom_fields['moved_from_app'] = prior_app.config._id
-        # custom_fields['moved_from_id'] = self.ticket_num
         self.custom_fields = custom_fields
 
         # move ticket. ensure unique ticket_num

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/671627eb/ForgeTracker/forgetracker/tests/functional/test_root.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_root.py b/ForgeTracker/forgetracker/tests/functional/test_root.py
index 8632e29..823ec28 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_root.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_root.py
@@ -1769,7 +1769,8 @@ class TestFunctionalController(TrackerTestController):
 
         # remaining tickets in 'bugs' tracker should still be viewable
         self.app.get('/p/test/bugs/2/', status=200)  # shouldn't fail
-        self.app.get('/p/test/bugs/1/', status=301)  # ticket counts as moved
+        r = self.app.get('/p/test/bugs/1/', status=301)  # ticket counts as moved
+        r.follow(status=404)  # and not found 'cause already deleted
 
     @td.with_tool('test', 'Tickets', 'dummy')
     def test_move_ticket_email_notifications(self):


[47/50] git commit: [#6422] Cleaned up LICENSE and NOTICE files and fixed license issues

Posted by jo...@apache.org.
[#6422] Cleaned up LICENSE and NOTICE files and fixed license issues

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/80c45200
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/80c45200
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/80c45200

Branch: refs/heads/cj/6422
Commit: 80c45200f6a05457b8952897d8969c326753310e
Parents: 87e2f46
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Sep 18 19:14:49 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Sep 24 17:07:14 2013 +0000

----------------------------------------------------------------------
 Allura/LICENSE                                |  47 ++++++++++++---------
 Allura/NOTICE                                 |  21 ++-------
 Allura/allura/controllers/controller.template |  16 +++++++
 Allura/allura/public/nf/images/beta_sf.psd    | Bin 2027421 -> 0 bytes
 AlluraTest/LICENSE                            |  26 +-----------
 AlluraTest/jslint/LICENSE                     |  21 +++++++++
 ForgeDiscussion/NOTICE                        |   8 ++--
 ForgeGit/NOTICE                               |   8 ++--
 ForgeLink/NOTICE                              |   8 ++--
 ForgeSVN/NOTICE                               |   8 ++--
 ForgeTracker/NOTICE                           |   8 ++--
 ForgeWiki/NOTICE                              |   8 ++--
 LICENSE                                       |  28 ++++++++----
 NoWarnings/NOTICE                             |   8 ++--
 rat-excludes.txt                              |  21 ++++-----
 15 files changed, 127 insertions(+), 109 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/Allura/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/LICENSE b/Allura/LICENSE
index de4eeac..973fd44 100644
--- a/Allura/LICENSE
+++ b/Allura/LICENSE
@@ -208,27 +208,36 @@ separate copyright notices and license terms. Your use of the source code
 for the these subcomponents is subject to the terms and conditions of the
 following licenses.
 
+The file allura/etc/mime.types from the mime-support package,
+which is in the public domain.  For details, see
+http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright
+
+ASCII, Dammit, which is in the public domain.
+For details, see allura/lib/AsciiDammit.py
+
+jQuery, jQueryUI, and various related plugins, which are available
+under the MIT license.  For details, see the individual files:
+    allura/public/nf/js/jquery-base.js
+    allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
+    allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+    allura/public/nf/js/jquery.daterangepicker.js
+    allura/public/nf/css/forge/ui.daterangepicker.css
+    allura/lib/widgets/resources/css/autocomplete.css
+    allura/public/nf/css/forge/accordion.css
+    allura/lib/widgets/resources/js/jqfontselector.js
+    allura/lib/widgets/resources/js/jquery.autosize-min.js
+    allura/lib/widgets/resources/js/jquery.colorPicker.js
+    allura/lib/widgets/resources/js/jquery.tagsinput.js
+    allura/lib/widgets/resources/js/jquery.textarea.js
+    allura/lib/widgets/resources/js/jquery.tools.min.js
+    allura/public/nf/js/jquery.flot.js
+    allura/public/nf/js/jquery.maxlength.min.js
+
 Blueprint, which is available under the MIT license.
-For details, see Allura/allura/public/nf/css/blueprint/
+For details, see allura/public/nf/css/blueprint/
 
 Spin.js, which is available under the MIT license.
-For details, see Allura/allura/public/nf/js/spin.min.js
+For details, see allura/public/nf/js/spin.min.js
 
 Sylvester, which is available under the MIT license.
-For details, see Allura/allura/public/nf/js/sylvester.js
-
-jQuery, jQueryUI, and various related plugins, which are available
-under the MIT license.  For details, see the individual files:
-    Allura/allura/public/nf/js/jquery-base.js
-    Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
-    Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
-    Allura/allura/lib/widgets/resources/css/autocomplete.css
-    Allura/allura/public/nf/css/forge/accordion.css
-    Allura/allura/lib/widgets/resources/js/jqfontselector.js
-    Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
-    Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
-    Allura/allura/lib/widgets/resources/js/jquery.textarea.js
-    Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
-    Allura/allura/public/nf/js/jquery.daterangepicker.js
-    Allura/allura/public/nf/js/jquery.flot.js
-    Allura/allura/public/nf/js/jquery.maxlength.min.js
+For details, see allura/public/nf/js/sylvester.js

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/Allura/NOTICE
----------------------------------------------------------------------
diff --git a/Allura/NOTICE b/Allura/NOTICE
index 8157ed8..40b6969 100644
--- a/Allura/NOTICE
+++ b/Allura/NOTICE
@@ -1,18 +1,5 @@
-      Apache Allura (incubating)
-      Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
 
-      This product includes software developed at
-      The Apache Software Foundation (http://www.apache.org/).
-
-      This software contains library for converting various
-      characters to ASCII encoding, written by Leonard Richardson
-      and placed into public domain.
-      
-      This software contains library for checking maximum length
-      of text area's content, written by Keith Wood.
-      
-      This software contains lightbox plugin for jQuery, written by
-      Buck Wilson.
-      
-      Canvas functionality in Internet Explorer(r) is provided
-      by code developed at Google Inc.
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/Allura/allura/controllers/controller.template
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/controller.template b/Allura/allura/controllers/controller.template
index d7fd65b..f565369 100644
--- a/Allura/allura/controllers/controller.template
+++ b/Allura/allura/controllers/controller.template
@@ -1,4 +1,20 @@
 # -*- coding: utf-8 -*-
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
 """Sample controller module"""
 
 # turbogears imports

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/Allura/allura/public/nf/images/beta_sf.psd
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/images/beta_sf.psd b/Allura/allura/public/nf/images/beta_sf.psd
deleted file mode 100644
index 9e74297..0000000
Binary files a/Allura/allura/public/nf/images/beta_sf.psd and /dev/null differ

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/AlluraTest/LICENSE
----------------------------------------------------------------------
diff --git a/AlluraTest/LICENSE b/AlluraTest/LICENSE
index 15f71ee..8da34a3 100644
--- a/AlluraTest/LICENSE
+++ b/AlluraTest/LICENSE
@@ -208,27 +208,5 @@ separate copyright notices and license terms. Your use of the source code
 for the these subcomponents is subject to the terms and conditions of the
 following licenses.
 
-For jslint.js, in directory
-jslint/
-
-   Copyright (c) 2002 Douglas Crockford  (www.JSLint.com)
-
-   Permission is hereby granted, free of charge, to any person obtaining a copy of
-   this software and associated documentation files (the "Software"), to deal in
-   the Software without restriction, including without limitation the rights to
-   use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
-   of the Software, and to permit persons to whom the Software is furnished to do
-   so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included in all
-   copies or substantial portions of the Software.
-
-   The Software shall be used for Good, not Evil.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-   SOFTWARE.
+JSLint, which is available under the MIT license.
+For details, see jslint/

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/AlluraTest/jslint/LICENSE
----------------------------------------------------------------------
diff --git a/AlluraTest/jslint/LICENSE b/AlluraTest/jslint/LICENSE
new file mode 100644
index 0000000..9532d4e
--- /dev/null
+++ b/AlluraTest/jslint/LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) 2002 Douglas Crockford  (www.JSLint.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+The Software shall be used for Good, not Evil.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/ForgeDiscussion/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/NOTICE b/ForgeDiscussion/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeDiscussion/NOTICE
+++ b/ForgeDiscussion/NOTICE
@@ -1,5 +1,5 @@
-      Apache Allura (incubating)
-      Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
 
-      This product includes software developed at
-      The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/ForgeGit/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeGit/NOTICE b/ForgeGit/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeGit/NOTICE
+++ b/ForgeGit/NOTICE
@@ -1,5 +1,5 @@
-      Apache Allura (incubating)
-      Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
 
-      This product includes software developed at
-      The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/ForgeLink/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeLink/NOTICE b/ForgeLink/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeLink/NOTICE
+++ b/ForgeLink/NOTICE
@@ -1,5 +1,5 @@
-      Apache Allura (incubating)
-      Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
 
-      This product includes software developed at
-      The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/ForgeSVN/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeSVN/NOTICE b/ForgeSVN/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeSVN/NOTICE
+++ b/ForgeSVN/NOTICE
@@ -1,5 +1,5 @@
-      Apache Allura (incubating)
-      Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
 
-      This product includes software developed at
-      The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/ForgeTracker/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeTracker/NOTICE b/ForgeTracker/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeTracker/NOTICE
+++ b/ForgeTracker/NOTICE
@@ -1,5 +1,5 @@
-      Apache Allura (incubating)
-      Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
 
-      This product includes software developed at
-      The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/ForgeWiki/NOTICE
----------------------------------------------------------------------
diff --git a/ForgeWiki/NOTICE b/ForgeWiki/NOTICE
index e8ad3bb..40b6969 100644
--- a/ForgeWiki/NOTICE
+++ b/ForgeWiki/NOTICE
@@ -1,5 +1,5 @@
-      Apache Allura (incubating)
-      Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
 
-      This product includes software developed at
-      The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index b7967a4..8f47b97 100644
--- a/LICENSE
+++ b/LICENSE
@@ -209,27 +209,39 @@ notices and license terms. Your use of the source code for the these
 subcomponents is subject to the terms and conditions of the following
 licenses.
 
-Blueprint, which is available under the MIT license.
-For details, see Allura/allura/public/nf/css/blueprint/
-
-Spin.js, which is available under the MIT license.
-For details, see Allura/allura/public/nf/js/spin.min.js
+The file Allura/allura/etc/mime.types from the mime-support package,
+which is in the public domain.  For details, see
+http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright
 
-Sylvester, which is available under the MIT license.
-For details, see Allura/allura/public/nf/js/sylvester.js
+ASCII, Dammit, which is in the public domain.
+For details, see Allura/allura/lib/AsciiDammit.py
 
 jQuery, jQueryUI, and various related plugins, which are available
 under the MIT license.  For details, see the individual files:
     Allura/allura/public/nf/js/jquery-base.js
     Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
     Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+    Allura/allura/public/nf/js/jquery.daterangepicker.js
+    Allura/allura/public/nf/css/forge/ui.daterangepicker.css
     Allura/allura/lib/widgets/resources/css/autocomplete.css
     Allura/allura/public/nf/css/forge/accordion.css
     Allura/allura/lib/widgets/resources/js/jqfontselector.js
     Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
     Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
+    Allura/allura/lib/widgets/resources/js/jquery.tagsinput.js
     Allura/allura/lib/widgets/resources/js/jquery.textarea.js
     Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
-    Allura/allura/public/nf/js/jquery.daterangepicker.js
     Allura/allura/public/nf/js/jquery.flot.js
     Allura/allura/public/nf/js/jquery.maxlength.min.js
+
+Blueprint, which is available under the MIT license.
+For details, see Allura/allura/public/nf/css/blueprint/
+
+Spin.js, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/spin.min.js
+
+Sylvester, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/sylvester.js
+
+JSLint, which is available under the MIT license.
+For details, see AlluraTest/jslint/

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/NoWarnings/NOTICE
----------------------------------------------------------------------
diff --git a/NoWarnings/NOTICE b/NoWarnings/NOTICE
index e8ad3bb..40b6969 100644
--- a/NoWarnings/NOTICE
+++ b/NoWarnings/NOTICE
@@ -1,5 +1,5 @@
-      Apache Allura (incubating)
-      Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
 
-      This product includes software developed at
-      The Apache Software Foundation (http://www.apache.org/).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/80c45200/rat-excludes.txt
----------------------------------------------------------------------
diff --git a/rat-excludes.txt b/rat-excludes.txt
index 30ded2a..968c66f 100644
--- a/rat-excludes.txt
+++ b/rat-excludes.txt
@@ -8,38 +8,33 @@ requirements*
 **/*.log
 **/.coverage
 **/nosetests.xml
-Allura/allura/controllers/controller.template
 Allura/docs/_build/
 Allura/allura/etc/mime.types
 Allura/allura/lib/AsciiDammit.py
-Allura/allura/lib/widgets/resources/css/autocomplete.css
+Allura/allura/public/nf/js/jquery-base.js
+Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
 Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+Allura/allura/public/nf/js/jquery.daterangepicker.js
+Allura/allura/public/nf/css/forge/ui.daterangepicker.css
+Allura/allura/lib/widgets/resources/css/autocomplete.css
+Allura/allura/public/nf/css/forge/accordion.css
 Allura/allura/lib/widgets/resources/js/jqfontselector.js
 Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
 Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
 Allura/allura/lib/widgets/resources/js/jquery.tagsinput.js
 Allura/allura/lib/widgets/resources/js/jquery.textarea.js
 Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
-Allura/allura/public/nf/css/blueprint/
-Allura/allura/public/nf/css/forge/accordion.css
-Allura/allura/public/nf/css/forge/ui.daterangepicker.css
-Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
-Allura/allura/public/nf/images/beta_sf.psd
-Allura/allura/public/nf/js/jquery-base.js
-Allura/allura/public/nf/js/jquery.daterangepicker.js
 Allura/allura/public/nf/js/jquery.flot.js
 Allura/allura/public/nf/js/jquery.maxlength.min.js
+Allura/allura/public/nf/css/blueprint/
 Allura/allura/public/nf/js/spin.min.js
 Allura/allura/public/nf/js/sylvester.js
 Allura/allura/tests/data/genshi_hello_tmpl
 Allura/allura/tests/data/test_mime/text_file.txt
-Allura/run/dummy.txt
 AlluraTest/jslint/
 CHANGES
+Allura/run/dummy.txt
 ForgeGit/forgegit/data/post-receive_tmpl
 ForgeSVN/forgesvn/tests/data/
 ForgeImporters/forgeimporters/tests/data/google/empty-issue.html
 ForgeImporters/forgeimporters/tests/data/google/test-issue.html
-solr_config/core0/conf/spellings.txt
-solr_config/core1/conf/spellings.txt
-solr_config/solr.xml


[39/50] git commit: [#6695] Added logging for LCD timeout and loop detection

Posted by jo...@apache.org.
[#6695] Added logging for LCD timeout and loop detection

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/f236c143
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/f236c143
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/f236c143

Branch: refs/heads/cj/6422
Commit: f236c14395dee45086cc7c6375fdb7fd2c70b0c6
Parents: 9d029eb
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Sep 23 15:11:42 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 23 17:09:04 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/f236c143/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index b371295..f02f122 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -145,6 +145,7 @@ class RepositoryImplementation(object):
         Return a mapping {path: commit_id} of the _id of the last
         commit to touch each path, starting from the given commit.
         '''
+        orig_commit = commit
         timeout = asint(config.get('lcd_timeout', 60)) * 1000
         start_time = time()
         paths = set(paths)
@@ -152,9 +153,8 @@ class RepositoryImplementation(object):
         seen_commits = set()
         while paths and commit:
             if time() - start_time > timeout:
+                log.error('last_commit_ids timeout for %s on %s', orig_commit._id, ', '.join(paths))
                 return result
-            if commit._id in seen_commits:
-                return result  # sanity check for bad data (loops)
             seen_commits.add(commit._id)
             changed = paths & set(commit.changed_paths)
             result.update({path: commit._id for path in changed})
@@ -164,6 +164,9 @@ class RepositoryImplementation(object):
             # computed wrong (not including children of added trees).
             # Can be removed once all projects have had diffs / LCDs refreshed.
             parent = commit.get_parent()
+            if parent and parent._id in seen_commits:
+                log.error('last_commit_ids loop detected at %s for %s on %s', parent._id, orig_commit._id, ', '.join(paths))
+                return result  # sanity check for bad data (loops)
             if parent:
                 changed = set([path for path in paths if not parent.has_path(path)])
                 result.update({path: commit._id for path in changed})


[18/50] git commit: [#6535] ticket:417 milestone processing added

Posted by jo...@apache.org.
[#6535] ticket:417 milestone processing added


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

Branch: refs/heads/cj/6422
Commit: fedf201bc4e046a54f0476f2b8f0ae5f603def14
Parents: b766bdd
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Tue Aug 27 19:02:08 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:50 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 46 ++++++++++++--------
 1 file changed, 28 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fedf201b/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 3266cc8..8c402d0 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -25,6 +25,7 @@ class GitHubTrackerImporter(ToolImporter):
     controller = None
     tool_label = 'Issues'
     max_ticket_num = 0
+    open_milestones = set()
 
     def import_tool(self, project, user, project_name, mount_point=None,
             mount_label=None, **kw):
@@ -48,9 +49,10 @@ class GitHubTrackerImporter(ToolImporter):
                         ticket_num=ticket_num)
                     self.process_fields(ticket, issue)
                     self.process_comments(extractor, ticket, issue)
+                    self.process_milestones(ticket, issue)
                     session(ticket).flush(ticket)
                     session(ticket).expunge(ticket)
-                #app.globals.custom_fields = self.get_milestones()
+                app.globals.custom_fields = self.postprocess_milestones()
                 app.globals.last_ticket_num = self.max_ticket_num
                 ThreadLocalORMSession.flush_all()
             g.post_event('project_updated')
@@ -94,23 +96,31 @@ class GitHubTrackerImporter(ToolImporter):
                 )
             p.add_multiple_attachments(attachments)
 
-    def get_milestones(self):
-        custom_fields = []
-        milestones = []
-        for name, field in self.custom_fields.iteritems():
-            if field['name'] == '_milestone':
-                field['milestones'] = [{
-                        'name': milestone,
-                        'due_date': None,
-                        'complete': milestone not in self.open_milestones,
-                    } for milestone in sorted(field['options'])]
-                field['options'] = ''
-            elif field['type'] == 'select':
-                field['options'] = ' '.join(field['options'])
-            else:
-                field['options'] = ''
-            custom_fields.append(field)
-        return custom_fields
+    def process_milestones(self, ticket, issue):
+        if issue['milestone']:
+            title = issue['milestone']['title']
+            due = None
+            if issue['milestone']['due_on']:
+                due = datetime.strptime(issue['milestone']['due_on'], '%Y-%m-%dT%H:%M:%SZ')
+            ticket.custom_fields = {
+                '_milestone': title,
+            }
+            self.open_milestones.add((title, due,))
+
+    def postprocess_milestones(self):
+        global_milestones = {
+            'milestones': [],
+            'type': 'milestone',
+            'name': '_milestone',
+            'label': 'Milestone'
+        }
+        for milestone in self.open_milestones:
+            global_milestones['milestones'].append({
+                'name': milestone[0],
+                'due_date': unicode(milestone[1].date()),
+                'complete': False,
+            })
+        return [global_milestones]
 
     def _get_attachments(self, body):
         # at github, attachments are images only and are included into comment's body


[21/50] git commit: [#6535] ticket:417 tests for github tracker import

Posted by jo...@apache.org.
[#6535] ticket:417 tests for github tracker import


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

Branch: refs/heads/cj/6422
Commit: 30d40210d89a8434cf628b89c7edd8d6e925c193
Parents: fedf201
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Wed Aug 28 15:41:33 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:50 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py |   4 +-
 .../tests/github/test_extractor.py              |  50 ++++++-
 .../forgeimporters/tests/github/test_tracker.py | 133 +++++++++++++++++++
 3 files changed, 179 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/30d40210/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 8c402d0..fea18ed 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -31,8 +31,8 @@ class GitHubTrackerImporter(ToolImporter):
             mount_label=None, **kw):
         app = project.install_app('tickets', mount_point, mount_label,
                 EnableVoting=True,
-                open_status_names='New Accepted',
-                closed_status_names='Done',
+                open_status_names='New Accepted Started',
+                closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
             )
         ThreadLocalORMSession.flush_all()
         extractor = GitHubProjectExtractor(

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/30d40210/ForgeImporters/forgeimporters/tests/github/test_extractor.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_extractor.py b/ForgeImporters/forgeimporters/tests/github/test_extractor.py
index cffbf81..8eb5811 100644
--- a/ForgeImporters/forgeimporters/tests/github/test_extractor.py
+++ b/ForgeImporters/forgeimporters/tests/github/test_extractor.py
@@ -15,22 +15,60 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
+import json
 from unittest import TestCase
 
 from ... import github
 
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
+
+
+
 
 class TestGitHubProjectExtractor(TestCase):
+    PROJECT_INFO = {
+        'description': 'project description',
+        'homepage': 'http://example.com',
+    }
+    CLOSED_ISSUES_LIST = [
+        {u'number': 1},
+        {u'number': 2},
+    ]
+    OPENED_ISSUES_LIST = [
+        {u'number': 3},
+    ]
+    ISSUE_COMMENTS = [u'hello', u'mocked_comment']
+
+    def mocked_urlopen(self, url):
+        if url.endswith('/test_project'):
+            return StringIO(json.dumps(self.PROJECT_INFO))
+        elif url.endswith('/issues?state=closed'):
+            return StringIO(json.dumps(self.CLOSED_ISSUES_LIST))
+        elif url.endswith('/issues?state=opened'):
+            return StringIO(json.dumps(self.OPENED_ISSUES_LIST))
+        elif url.endswith('/comments'):
+            return StringIO(json.dumps(self.ISSUE_COMMENTS))
+
     def setUp(self):
-        import json
-        from StringIO import StringIO
-        self.extractor = github.GitHubProjectExtractor('testproject')
-        d = dict(description='project description',
-                homepage='http://example.com')
-        self.extractor.urlopen = lambda url: StringIO(json.dumps(d))
+        self.extractor = github.GitHubProjectExtractor('test_project')
+        self.extractor.urlopen = self.mocked_urlopen
 
     def test_get_summary(self):
         self.assertEqual(self.extractor.get_summary(), 'project description')
 
     def test_get_homepage(self):
         self.assertEqual(self.extractor.get_homepage(), 'http://example.com')
+
+    def test_iter_issues(self):
+        issues = list(self.extractor.iter_issues())
+        all_issues = zip((1,2), self.CLOSED_ISSUES_LIST)
+        all_issues.append((3, self.OPENED_ISSUES_LIST[0]))
+        self.assertEqual(issues, all_issues)
+
+    def test_iter_comments(self):
+        mock_issue = {'comments_url': '/issues/1/comments'}
+        comments = list(self.extractor.iter_comments(mock_issue))
+        self.assertEqual(comments, self.ISSUE_COMMENTS)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/30d40210/ForgeImporters/forgeimporters/tests/github/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_tracker.py b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
new file mode 100644
index 0000000..382be2b
--- /dev/null
+++ b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
@@ -0,0 +1,133 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+
+from datetime import datetime
+from operator import itemgetter
+from unittest import TestCase
+import mock
+
+from ...github import tracker
+
+
+class TestTrackerImporter(TestCase):
+    @mock.patch.object(tracker, 'g')
+    @mock.patch.object(tracker, 'c')
+    @mock.patch.object(tracker, 'ThreadLocalORMSession')
+    @mock.patch.object(tracker, 'session')
+    @mock.patch.object(tracker, 'M')
+    @mock.patch.object(tracker, 'TM')
+    @mock.patch.object(tracker, 'GitHubProjectExtractor')
+    def test_import_tool(self, gpe, TM, M, session, tlos, c, g):
+        importer = tracker.GitHubTrackerImporter()
+        importer.process_fields = mock.Mock()
+        importer.process_milestones = mock.Mock()
+        importer.process_comments = mock.Mock()
+        importer.postprocess_milestones= mock.Mock()
+        project, user = mock.Mock(), mock.Mock()
+        app = project.install_app.return_value
+        gpe.iter_issues.return_value = [(50, mock.Mock()), (100, mock.Mock())]
+
+        importer.import_tool(project, user, project_name='project_name',
+                mount_point='mount_point', mount_label='mount_label', user_name='me')
+
+        project.install_app.assert_called_once_with('tickets', 'mount_point', 'mount_label',
+                EnableVoting=True,
+                open_status_names='New Accepted Started',
+                closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
+            )
+        gpe.iter_issues.assert_called_once()
+        self.assertEqual(tlos.flush_all.call_args_list, [
+                mock.call(),
+                mock.call(),
+            ])
+        g.post_event.assert_called_once_with('project_updated')
+        app.globals.invalidate_bin_counts.assert_called_once_with()
+
+    def test_process_fields(self):
+        ticket = mock.Mock()
+        issue = {
+            'title': 'title',
+            'state': 'New',
+            'created_at': 'created_at',
+            'updated_at': 'updated_at',
+            'assignee': {'login': 'owner'},
+            'user': {'login': 'creator'},
+            'body': 'hello',
+            'labels': [{'name': 'first'}, {'name': 'second'}],
+        }
+        importer = tracker.GitHubTrackerImporter()
+        with mock.patch.object(tracker, 'datetime') as dt:
+            dt.strptime.side_effect = lambda s,f: s
+            importer.process_fields(ticket, issue)
+            self.assertEqual(ticket.summary, 'title')
+            self.assertEqual(ticket.description, '*Originally created by:* creator\n*Originally owned by:* owner\n\nhello')
+            self.assertEqual(ticket.status, 'New')
+            self.assertEqual(ticket.created_date, 'created_at')
+            self.assertEqual(ticket.mod_date, 'updated_at')
+            self.assertEqual(dt.strptime.call_args_list, [
+                    mock.call('created_at', '%Y-%m-%dT%H:%M:%SZ'),
+                    mock.call('updated_at', '%Y-%m-%dT%H:%M:%SZ'),
+                ])
+            self.assertEqual(ticket.labels, ['first', 'second'])
+
+    @mock.patch.object(tracker, 'c')
+    def test_postprocess_milestones(self, c):
+        importer = tracker.GitHubTrackerImporter()
+        importer.open_milestones = set([
+            ('first', datetime(day=23, month=4, year=2015)),
+            ('second',datetime(day=25, month=4, year=2015))
+        ])
+        milestones = importer.postprocess_milestones()
+        self.assertItemsEqual(milestones, [
+                {
+                    'name': '_milestone',
+                    'type': 'milestone',
+                    'label': 'Milestone',
+                    'milestones': [
+                        {'name': 'first', 'due_date': u'2015-04-23', 'complete': False},
+                        {'name': 'second', 'due_date': u'2015-04-25', 'complete': False},
+                    ],
+                },
+            ])
+
+    def test_get_attachments(self):
+        importer = tracker.GitHubTrackerImporter()
+        body = 'hello\n' \
+        '![cdbpzjc5ex4](https://f.cloud.github.com/assets/979771/1027411/a393ab5e-0e70-11e3-8a38-b93a3df904cf.jpg)\r\n'
+        new_body, attachments = importer._get_attachments(body)
+        self.assertEqual(new_body, 'hello\n')
+        self.assertEqual(len(attachments), 1)
+        self.assertEqual(attachments[0].url, 'https://f.cloud.github.com/assets/979771/1027411/a393ab5e-0e70-11e3-8a38-b93a3df904cf.jpg')
+
+    def test_process_comments(self):
+        ticket = mock.Mock()
+        extractor = mock.Mock()
+        issue = {'comments_url': '/comments'}
+        extractor.iter_comments.return_value = [
+                {
+                    'body': 'hello',
+                    'created_at': '2013-08-26T16:57:53Z',
+                    'user': {'login': 'me'},
+                }
+            ]
+        importer = tracker.GitHubTrackerImporter()
+        importer.process_comments(extractor, ticket, issue)
+        self.assertEqual(ticket.discussion_thread.add_post.call_args_list[0], mock.call(
+                text='hello\n*Originally posted by: me*',
+                timestamp=datetime(2013, 8, 26, 16, 57, 53),
+                ignore_security=True,
+            ))
\ No newline at end of file


[07/50] git commit: [#6608] Trac ticket import cleanups

Posted by jo...@apache.org.
[#6608] Trac ticket import cleanups

* Set default Trac open/closed statuses
* If a ticket urlopen call fails during import, let the import fail
  rather than trying to continue in an unknown state
* Add test for setting milestone status during import

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/ffb98428
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/ffb98428
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/ffb98428

Branch: refs/heads/cj/6422
Commit: ffb98428fbb18341a8d5f31c7d0c646cd6253992
Parents: 54c43fd
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Sep 17 19:32:06 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Sep 18 20:24:31 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/trac/tickets.py   |  4 ++-
 .../functional/data/milestone-tickets.json      | 31 ++++++++++++++++++
 .../tests/functional/test_import.py             | 33 ++++++++++++++++++++
 3 files changed, 67 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ffb98428/ForgeImporters/forgeimporters/trac/tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tickets.py b/ForgeImporters/forgeimporters/trac/tickets.py
index 88ee769..9b222b9 100644
--- a/ForgeImporters/forgeimporters/trac/tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tickets.py
@@ -120,6 +120,8 @@ class TracTicketImporter(ToolImporter):
                 'Tickets',
                 mount_point=mount_point,
                 mount_label=mount_label or 'Tickets',
+                open_status_names='new assigned accepted reopened',
+                closed_status_names='closed',
                 import_id={
                         'source': self.source,
                         'trac_url': trac_url,
@@ -135,7 +137,7 @@ class TracTicketImporter(ToolImporter):
                     expires=datetime.utcnow() + timedelta(minutes=60))
             session(api_ticket).flush(api_ticket)
             cli = AlluraImportApiClient(config['base_url'], api_ticket.api_key,
-                    api_ticket.secret_key, verbose=True)
+                    api_ticket.secret_key, verbose=True, retry=False)
             import_tracker(cli, project.shortname, mount_point,
                     {'user_map': json.loads(user_map) if user_map else {}},
                     export_string, validate=False)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ffb98428/ForgeTracker/forgetracker/tests/functional/data/milestone-tickets.json
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/data/milestone-tickets.json b/ForgeTracker/forgetracker/tests/functional/data/milestone-tickets.json
new file mode 100644
index 0000000..1961b22
--- /dev/null
+++ b/ForgeTracker/forgetracker/tests/functional/data/milestone-tickets.json
@@ -0,0 +1,31 @@
+{
+  "class": "PROJECT",
+  "trackers": {
+    "default": {
+      "artifacts": [
+        {
+          "class": "ARTIFACT",
+          "date": "2009-04-13T08:49:13Z",
+          "date_updated": "2009-07-20T15:44:32Z",
+          "id": 1,
+          "milestone": "open_milestone",
+          "status": "open",
+          "description": "",
+          "submitter": "",
+          "summary": "Ticket 1"
+        },
+        {
+          "class": "ARTIFACT",
+          "date": "2009-04-13T08:49:13Z",
+          "date_updated": "2009-07-20T15:44:32Z",
+          "id": 2,
+          "milestone": "closed_milestone",
+          "status": "closed",
+          "description": "",
+          "submitter": "",
+          "summary": "Ticket 2"
+        }
+      ]
+    }
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ffb98428/ForgeTracker/forgetracker/tests/functional/test_import.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_import.py b/ForgeTracker/forgetracker/tests/functional/test_import.py
index 8192115..5b1f5a3 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_import.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_import.py
@@ -27,11 +27,13 @@ from pylons import app_globals as g
 from pylons import tmpl_context as c
 
 from allura import model as M
+from allura.lib import helpers as h
 from alluratest.controller import TestRestApiBase
 from allura.tests import decorators as td
 from forgetracker import model as TM
 from forgetracker.import_support import ImportSupport
 
+
 class TestImportController(TestRestApiBase):
 
     def new_ticket(self, mount_point='/bugs/', **kw):
@@ -169,6 +171,37 @@ class TestImportController(TestRestApiBase):
         assert ticket_json['summary'] in r
 
     @td.with_tracker
+    def test_milestone_status(self):
+        """When importing, if all tickets in a milestone are closed, the
+        milestone itself should also be closed.
+
+        """
+        here_dir = os.path.dirname(__file__)
+        api_ticket = M.ApiTicket(user_id=self.user._id, capabilities={'import': ['Projects','test']},
+                                 expires=datetime.utcnow() + timedelta(days=1))
+        ming.orm.session(api_ticket).flush()
+        self.set_api_token(api_ticket)
+
+        doc_text = open(here_dir + '/data/milestone-tickets.json').read()
+        self.api_post('/rest/p/test/bugs/perform_import', doc=doc_text,
+            options='{"user_map": {"hinojosa4": "test-admin", "ma_boehm": "test-user"}}')
+
+        ming.orm.ThreadLocalORMSession.flush_all()
+        M.MonQTask.run_ready()
+        ming.orm.ThreadLocalORMSession.flush_all()
+
+        with h.push_context('test', mount_point='bugs', neighborhood='Projects'):
+            for milestone_fld in c.app.globals.milestone_fields:
+                milestone_names = [ms['name'] for ms in milestone_fld['milestones']]
+                assert 'open_milestone' in milestone_names, milestone_names
+                assert 'closed_milestone' in milestone_names, milestone_names
+                for milestone in milestone_fld['milestones']:
+                    if milestone['name'] == 'open_milestone':
+                        assert milestone['complete'] == False
+                    if milestone['name'] == 'closed_milestone':
+                        assert milestone['complete'] == True
+
+    @td.with_tracker
     def test_link_processing(self):
         import_support = ImportSupport()
         result = import_support.link_processing('''test link [[2496]](http://testlink.com)


[30/50] git commit: [#6535] ticket:424 Fix user link formatting

Posted by jo...@apache.org.
[#6535] ticket:424 Fix user link formatting


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

Branch: refs/heads/cj/6422
Commit: 42b6445e9e0893da5b44ff04ea3911dd4f7d205c
Parents: be9d119
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 15:18:04 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:52 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py            | 9 +++++----
 ForgeImporters/forgeimporters/tests/github/test_tracker.py | 8 ++++----
 2 files changed, 9 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/42b6445e/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index d068e47..655980a 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -130,7 +130,8 @@ class GitHubTrackerImporter(ToolImporter):
         ticket.created_date = self.parse_datetime(issue['created_at'])
         ticket.mod_date = self.parse_datetime(issue['updated_at'])
         if issue['assignee']:
-            owner_line = '*Originally owned by:* {}\n'.format(issue['assignee']['login'])
+            owner_line = '*Originally owned by:* {}\n'.format(
+                    self.get_user_link(issue['assignee']['login']))
         else:
             owner_line = ''
         # body processing happens here
@@ -141,7 +142,7 @@ class GitHubTrackerImporter(ToolImporter):
                 u'{owner}'
                 u'\n'
                 u'{body}').format(
-                    creator=issue['user']['login'],
+                    creator=self.get_user_link(issue['user']['login']),
                     owner=owner_line,
                     body=body,
                 )
@@ -151,7 +152,7 @@ class GitHubTrackerImporter(ToolImporter):
         for comment in extractor.iter_comments(issue):
             body, attachments = self._get_attachments(comment['body'])
             if comment['user']:
-                posted_by = u'*Originally posted by: {}*\n'.format(
+                posted_by = u'*Originally posted by:* {}\n'.format(
                     self.get_user_link(comment['user']['login']))
                 posted_by += body
                 body = posted_by
@@ -166,7 +167,7 @@ class GitHubTrackerImporter(ToolImporter):
         for event in extractor.iter_events(issue):
             prefix = text = ''
             if event['event'] in ('reopened', 'closed'):
-                prefix = '*Ticket changed by: {}*\n\n'.format(
+                prefix = '*Ticket changed by:* {}\n\n'.format(
                         self.get_user_link(event['actor']['login']))
             if event['event'] == 'reopened':
                 text = '- **status**: closed --> open'

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/42b6445e/ForgeImporters/forgeimporters/tests/github/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_tracker.py b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
index 7ff8c9b..876c71e 100644
--- a/ForgeImporters/forgeimporters/tests/github/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
@@ -74,7 +74,7 @@ class TestTrackerImporter(TestCase):
             dt.strptime.side_effect = lambda s,f: s
             importer.process_fields(ticket, issue)
             self.assertEqual(ticket.summary, 'title')
-            self.assertEqual(ticket.description, '*Originally created by:* creator\n*Originally owned by:* owner\n\nhello')
+            self.assertEqual(ticket.description, '*Originally created by:* [creator](https://github.com/creator)\n*Originally owned by:* [owner](https://github.com/owner)\n\nhello')
             self.assertEqual(ticket.status, 'New')
             self.assertEqual(ticket.created_date, 'created_at')
             self.assertEqual(ticket.mod_date, 'updated_at')
@@ -127,7 +127,7 @@ class TestTrackerImporter(TestCase):
         importer = tracker.GitHubTrackerImporter()
         importer.process_comments(extractor, ticket, issue)
         self.assertEqual(ticket.discussion_thread.add_post.call_args_list[0], mock.call(
-                text='*Originally posted by: [me](https://github.com/me)*\nhello',
+                text='*Originally posted by:* [me](https://github.com/me)\nhello',
                 timestamp=datetime(2013, 8, 26, 16, 57, 53),
                 ignore_security=True,
             ))
@@ -157,12 +157,12 @@ class TestTrackerImporter(TestCase):
         importer.process_events(extractor, ticket, issue)
         args = ticket.discussion_thread.add_post.call_args_list
         self.assertEqual(args[0], mock.call(
-            text='*Ticket changed by: [darth](https://github.com/darth)*\n\n'
+            text='*Ticket changed by:* [darth](https://github.com/darth)\n\n'
                  '- **status**: open --> closed',
             timestamp=datetime(2013, 9, 12, 9, 58, 49),
             ignore_security=True))
         self.assertEqual(args[1], mock.call(
-            text='*Ticket changed by: [yoda](https://github.com/yoda)*\n\n'
+            text='*Ticket changed by:* [yoda](https://github.com/yoda)\n\n'
                  '- **status**: closed --> open',
             timestamp=datetime(2013, 9, 12, 10, 13, 20),
             ignore_security=True))


[04/50] git commit: Merge branch 'cj/6638' of https://git-wip-us.apache.org/repos/asf/incubator-allura into cj/6638

Posted by jo...@apache.org.
Merge branch 'cj/6638' of https://git-wip-us.apache.org/repos/asf/incubator-allura into cj/6638


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

Branch: refs/heads/cj/6422
Commit: 16b64091d01c629e9a900d51b280fe33deb8f2d6
Parents: bb42107 886487c
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Sep 18 16:13:48 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Wed Sep 18 16:13:48 2013 +0000

----------------------------------------------------------------------

----------------------------------------------------------------------



[32/50] git commit: [#6535] minor code cleanup

Posted by jo...@apache.org.
[#6535] minor code cleanup


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

Branch: refs/heads/cj/6422
Commit: 871731e9422907711980024c6d65313c6879e0c4
Parents: 503c4f7
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu Sep 19 14:46:45 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:52 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/871731e9/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 655980a..e441516 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -154,8 +154,7 @@ class GitHubTrackerImporter(ToolImporter):
             if comment['user']:
                 posted_by = u'*Originally posted by:* {}\n'.format(
                     self.get_user_link(comment['user']['login']))
-                posted_by += body
-                body = posted_by
+                body = posted_by + body
             p = ticket.discussion_thread.add_post(
                     text = body,
                     ignore_security = True,


[42/50] git commit: [#6699] make instrumentation extensible; refine mongo instrumentation

Posted by jo...@apache.org.
[#6699] make instrumentation extensible; refine mongo instrumentation


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

Branch: refs/heads/cj/6422
Commit: d22e79832940794c04cd5e187442bb5e46dd7c4e
Parents: f236c14
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Mon Sep 23 17:00:37 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Tue Sep 24 04:01:56 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/custom_middleware.py | 51 +++++------------------------
 Allura/docs/extending.rst              |  1 +
 ForgeGit/forgegit/git_main.py          | 13 ++++++++
 ForgeGit/setup.py                      |  4 +++
 ForgeSVN/forgesvn/svn_main.py          | 11 ++++++-
 ForgeSVN/setup.py                      |  4 +++
 6 files changed, 41 insertions(+), 43 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d22e7983/Allura/allura/lib/custom_middleware.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/custom_middleware.py b/Allura/allura/lib/custom_middleware.py
index d4652ab..c942474 100644
--- a/Allura/allura/lib/custom_middleware.py
+++ b/Allura/allura/lib/custom_middleware.py
@@ -23,6 +23,7 @@ from contextlib import contextmanager
 import tg
 import pkg_resources
 from paste import fileapp
+from paste.deploy.converters import aslist
 from pylons import tmpl_context as c
 from pylons.util import call_wsgi_application
 from timermiddleware import Timer, TimerMiddleware
@@ -180,10 +181,10 @@ class AlluraTimerMiddleware(TimerMiddleware):
         import socket
         import urllib2
 
-        return self.scm_lib_timers() + self.repo_impl_timers() + [
+        return self.entry_point_timers() + [
             Timer('jinja', jinja2.Template, 'render', 'stream', 'generate'),
             Timer('markdown', markdown.Markdown, 'convert'),
-            Timer('ming', ming.odm.odmsession.ODMCursor, 'next'),
+            Timer('ming', ming.odm.odmsession.ODMCursor, 'next'),  # FIXME: this may captures timings ok, but is misleading for counts
             Timer('ming', ming.odm.odmsession.ODMSession, 'flush', 'find',
                 'get'),
             Timer('ming', ming.schema.Document, 'validate',
@@ -194,8 +195,7 @@ class AlluraTimerMiddleware(TimerMiddleware):
             Timer('mongo', pymongo.collection.Collection, 'count', 'find',
                 'find_one'),
             Timer('mongo', pymongo.cursor.Cursor, 'count', 'distinct',
-                'explain', 'hint', 'limit', 'next', 'rewind', 'skip',
-                'sort', 'where'),
+                '_refresh'),
             # urlopen and socket io may or may not overlap partially
             Timer('render', genshi.Stream, 'render'),
             Timer('repo.Blob.{method_name}', allura.model.repo.Blob, '*'),
@@ -210,6 +210,7 @@ class AlluraTimerMiddleware(TimerMiddleware):
             Timer('template', genshi.template.Template, '_prepare', '_parse',
                 'generate'),
             Timer('urlopen', urllib2, 'urlopen'),
+            Timer('base_repo_tool.{method_name}', allura.model.repository.RepositoryImplementation, 'last_commit_ids'),
             Timer('_diffs_copied', allura.model.repo.Commit, '_diffs_copied'),
             Timer('sequencematcher.{method_name}', allura.model.repo.SequenceMatcher, 'ratio', 'quick_ratio', 'real_quick_ratio'),
             Timer('unified_diff', allura.model.repo, 'unified_diff'),
@@ -220,43 +221,9 @@ class AlluraTimerMiddleware(TimerMiddleware):
             stat_record.add('request_category', c.app.config.tool_name.lower())
         return stat_record
 
-    def scm_lib_timers(self):
+    def entry_point_timers(self):
         timers = []
-        with pass_on_exc(ImportError):
-            import forgesvn
-            timers.append(Timer('svn_lib.{method_name}', forgesvn.model.svn.SVNLibWrapper, 'checkout', 'add',
-                        'checkin', 'info2', 'log', 'cat', 'list'))
-        with pass_on_exc(ImportError):
-            import git
-            import forgegit
-            timers.append(Timer('git_lib.{method_name}', git.Repo, 'rev_parse', 'iter_commits', 'commit'))
-            timers.append(Timer('git_lib.{method_name}', forgegit.model.git_repo.GitLibCmdWrapper, 'log'))
-        with pass_on_exc(ImportError):
-            import mercurial.hg
-            timers.append(Timer('hg_lib.{method_name}', mercurial.hg.localrepo.localrepository, 'heads',
-                'branchtags', 'tags'))
-            timers.append(Timer('hg_lib.{method_name}', mercurial.cmdutil, 'walkchangerevs'))
+        for ep in h.iter_entry_points('allura.timers'):
+            func = ep.load()
+            timers += aslist(func())
         return timers
-
-    def repo_impl_timers(self):
-        timers= []
-        from allura.model.repository import Repository, RepositoryImplementation
-        timers.append(Timer('base_tool.{method_name}', RepositoryImplementation, 'last_commit_ids'))
-        with pass_on_exc(ImportError):
-            from forgegit.model.git_repo import GitImplementation
-            timers.append(Timer('git_tool.{method_name}', GitImplementation, '*'))
-        with pass_on_exc(ImportError):
-            from forgesvn.model.svn import SVNImplementation
-            timers.append(Timer('svn_tool.{method_name}', SVNImplementation, '*'))
-        with pass_on_exc(ImportError):
-            from forgehg.model.hg import HgImplementation
-            timers.append(Timer('hg_tool.{method_name}', HgImplementation, '*'))
-        return timers
-
-
-@contextmanager
-def pass_on_exc(exc):
-    try:
-        yield
-    except exc:
-        pass

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d22e7983/Allura/docs/extending.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/extending.rst b/Allura/docs/extending.rst
index 5458b69..c241d5f 100644
--- a/Allura/docs/extending.rst
+++ b/Allura/docs/extending.rst
@@ -34,6 +34,7 @@ The available extension points for Allura are:
 * :class:`allura.lib.spam.SpamFilter`
 * ``site_stats`` in the root API data.  Docs in :class:`allura.controllers.rest.RestController`
 * :mod:`allura.lib.package_path_loader` (for overriding templates)
+* ``[allura.timers]`` functions which return a list or single :class:`timermiddleware.Timer` which will be included in stats.log timings
 
 A listing of available 3rd-party extensions is at https://forge-allura.apache.org/p/allura/wiki/Extensions/
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d22e7983/ForgeGit/forgegit/git_main.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/git_main.py b/ForgeGit/forgegit/git_main.py
index 2ba63bc..1d11e41 100644
--- a/ForgeGit/forgegit/git_main.py
+++ b/ForgeGit/forgegit/git_main.py
@@ -23,6 +23,8 @@ from pylons import tmpl_context as c
 
 from ming.utils import LazyProperty
 from ming.orm.ormsession import ThreadLocalORMSession
+from timermiddleware import Timer
+import git
 
 # Pyforge-specific imports
 import allura.tasks.repo_tasks
@@ -106,3 +108,14 @@ class ForgeGitApp(RepositoryApp):
                 cloned_from_url=init_from_url)
         else:
             allura.tasks.repo_tasks.init.post()
+
+
+def git_timers():
+    return [
+        Timer('git_lib.{method_name}', git.Repo, 'rev_parse', 'iter_commits', 'commit'),
+        Timer('git_lib.{method_name}', GM.git_repo.GitLibCmdWrapper, 'log'),
+    ]
+
+
+def forgegit_timers():
+    return Timer('git_tool.{method_name}', GM.git_repo.GitImplementation, '*')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d22e7983/ForgeGit/setup.py
----------------------------------------------------------------------
diff --git a/ForgeGit/setup.py b/ForgeGit/setup.py
index 0f6274d..3d14ef3 100644
--- a/ForgeGit/setup.py
+++ b/ForgeGit/setup.py
@@ -42,5 +42,9 @@ setup(name='ForgeGit',
       # -*- Entry points: -*-
       [allura]
       Git=forgegit.git_main:ForgeGitApp
+
+      [allura.timers]
+      git = forgegit.git_main:git_timers
+      forgegit = forgegit.git_main:forgegit_timers
       """,
       )

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d22e7983/ForgeSVN/forgesvn/svn_main.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/forgesvn/svn_main.py b/ForgeSVN/forgesvn/svn_main.py
index 03b1b7f..bee61b3 100644
--- a/ForgeSVN/forgesvn/svn_main.py
+++ b/ForgeSVN/forgesvn/svn_main.py
@@ -18,13 +18,13 @@
 #-*- python -*-
 import logging
 from pylons import tmpl_context as c
-from pylons import request
 
 # Non-stdlib imports
 from ming.utils import LazyProperty
 from ming.orm.ormsession import ThreadLocalORMSession
 from tg import expose, redirect, validate, flash
 from tg.decorators import with_trailing_slash, without_trailing_slash
+from timermiddleware import Timer
 
 # Pyforge-specific imports
 import allura.tasks.repo_tasks
@@ -169,3 +169,12 @@ class SVNImportController(BaseController):
                 c.user, self.app.repo, 'error',
                 text="Can't import into non empty repository.")
         redirect(c.project.url() + 'admin/tools')
+
+
+def svn_timers():
+    return Timer('svn_lib.{method_name}', SM.svn.SVNLibWrapper, 'checkout', 'add',
+                 'checkin', 'info2', 'log', 'cat', 'list')
+
+
+def forgesvn_timers():
+    return Timer('svn_tool.{method_name}', SM.svn.SVNImplementation, '*')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d22e7983/ForgeSVN/setup.py
----------------------------------------------------------------------
diff --git a/ForgeSVN/setup.py b/ForgeSVN/setup.py
index 2ee8d2e..d3b1154 100644
--- a/ForgeSVN/setup.py
+++ b/ForgeSVN/setup.py
@@ -51,5 +51,9 @@ setup(name='ForgeSVN',
       # -*- Entry points: -*-
       [allura]
       SVN=forgesvn.svn_main:ForgeSVNApp
+
+      [allura.timers]
+      svn = forgesvn.svn_main:svn_timers
+      forgesvn = forgesvn.svn_main:forgesvn_timers
       """,
       )


[48/50] git commit: [#6422] Removed unneccesary Apache 2.0 item from LICENSE

Posted by jo...@apache.org.
[#6422] Removed unneccesary Apache 2.0 item from LICENSE

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/05ff83e5
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/05ff83e5
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/05ff83e5

Branch: refs/heads/cj/6422
Commit: 05ff83e595b138710f4e920555f6dd96c56d3bec
Parents: 4366a30
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Sep 24 17:06:58 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Sep 24 17:07:14 2013 +0000

----------------------------------------------------------------------
 Allura/LICENSE | 6 +-----
 LICENSE        | 4 ----
 2 files changed, 1 insertion(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/05ff83e5/Allura/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/LICENSE b/Allura/LICENSE
index ffb5ecb..13b7b54 100644
--- a/Allura/LICENSE
+++ b/Allura/LICENSE
@@ -200,7 +200,7 @@
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-   
+
 ALLURA SUBCOMPONENTS:
 
 Apache Allura includes a number of subcomponents with
@@ -208,10 +208,6 @@ separate copyright notices and license terms. Your use of the source code
 for the these subcomponents is subject to the terms and conditions of the
 following licenses.
 
-HTML5 Canvas for Internet Explorer, which is available under the
-Apache License, Version 2.0.
-For details, see Allura/allura/public/nf/js/excanvas.compiled.js
-
 The file allura/etc/mime.types from the mime-support package,
 which is in the public domain.  For details, see
 http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/05ff83e5/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index e558325..c905853 100644
--- a/LICENSE
+++ b/LICENSE
@@ -209,10 +209,6 @@ separate copyright notices and license terms. Your use of the source code
 for the these dependencies is subject to the terms and conditions of the
 following licenses.
 
-HTML5 Canvas for Internet Explorer, which is available under the
-Apache License, Version 2.0.
-For details, see Allura/allura/public/nf/js/excanvas.compiled.js
-
 The file Allura/allura/etc/mime.types from the mime-support package,
 which is in the public domain.  For details, see
 http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright


[27/50] git commit: [#6535] ticket:424 Fix exception due to ImportErrorHandler changes in 3c0a7e0f5fd179096d48239e3db8c014960a2181

Posted by jo...@apache.org.
[#6535] ticket:424 Fix exception due to ImportErrorHandler changes in 3c0a7e0f5fd179096d48239e3db8c014960a2181


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

Branch: refs/heads/cj/6422
Commit: 961b1415d52190929b8a397fa83db92b1d550343
Parents: 3775165
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 12:54:54 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:51 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/961b1415/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 20ba465..36014be 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -36,7 +36,7 @@ from forgeimporters.base import ToolImportForm, ImportErrorHandler
 @task(notifications_disabled=True)
 def import_tool(**kw):
     importer = GitHubTrackerImporter()
-    with ImportErrorHandler(importer, kw.get('project_name')):
+    with ImportErrorHandler(importer, kw.get('project_name'), c.project):
         importer.import_tool(c.project, c.user, **kw)
 
 


[13/50] git commit: [#6535] ticket:417 controller for github import

Posted by jo...@apache.org.
[#6535] ticket:417 controller for github import

Conflicts:
	ForgeImporters/forgeimporters/base.py


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

Branch: refs/heads/cj/6422
Commit: 8a32af87366189a757d99109a933cd2b19f091fc
Parents: 8c07c39
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Mon Aug 26 16:44:34 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:49 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/base.py           | 1 +
 ForgeImporters/forgeimporters/github/project.py | 2 ++
 ForgeImporters/forgeimporters/github/tracker.py | 8 ++++++++
 ForgeImporters/setup.py                         | 1 +
 4 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8a32af87/ForgeImporters/forgeimporters/base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py
index ea01968..2f296a0 100644
--- a/ForgeImporters/forgeimporters/base.py
+++ b/ForgeImporters/forgeimporters/base.py
@@ -210,6 +210,7 @@ class ProjectImporter(BaseController):
         tools = {}
         for ep in h.iter_entry_points('allura.importers'):
             epv = ep.load()
+            print epv, epv.source, self.source
             if epv.source == self.source:
                 tools[ep.name] = epv()
         return tools

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8a32af87/ForgeImporters/forgeimporters/github/project.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/project.py b/ForgeImporters/forgeimporters/github/project.py
index 64a499e..1255933 100644
--- a/ForgeImporters/forgeimporters/github/project.py
+++ b/ForgeImporters/forgeimporters/github/project.py
@@ -57,6 +57,8 @@ class GitHubProjectImporter(base.ProjectImporter):
     @expose()
     @validate(process_validator)
     def process(self, **kw):
+        if not type(kw['tools']) == list:
+            kw['tools'] = [kw['tools']]
         return super(self.__class__, self).process(**kw)
 
     @expose('json:')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8a32af87/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
new file mode 100644
index 0000000..798da5c
--- /dev/null
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -0,0 +1,8 @@
+from ..base import ToolImporter
+from forgetracker.tracker_main import ForgeTrackerApp
+
+class GitHubTrackerImporter(ToolImporter):
+    source = 'GitHub'
+    target_app = ForgeTrackerApp
+    controller = None
+    tool_label = 'Issues'
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8a32af87/ForgeImporters/setup.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/setup.py b/ForgeImporters/setup.py
index eaeb7df..12811f2 100644
--- a/ForgeImporters/setup.py
+++ b/ForgeImporters/setup.py
@@ -39,6 +39,7 @@ setup(name='ForgeImporters',
       github = forgeimporters.github.project:GitHubProjectImporter
 
       [allura.importers]
+      github-tracker = forgeimporters.github.tracker:GitHubTrackerImporter
       google-code-tracker = forgeimporters.google.tracker:GoogleCodeTrackerImporter
       google-code-repo = forgeimporters.google.code:GoogleRepoImporter
       github-repo = forgeimporters.github.code:GitHubRepoImporter


[29/50] git commit: [#6535] ticket:424 Refactoring: use self.get_user_link everywhere

Posted by jo...@apache.org.
[#6535] ticket:424 Refactoring: use self.get_user_link everywhere


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

Branch: refs/heads/cj/6422
Commit: 2ca21ae5f50bc5214f823cb17c1126995c4cf7b8
Parents: 7861638
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 15:03:31 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:51 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2ca21ae5/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 96e8be6..1b37e5b 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -151,8 +151,8 @@ class GitHubTrackerImporter(ToolImporter):
         for comment in extractor.iter_comments(issue):
             body, attachments = self._get_attachments(comment['body'])
             if comment['user']:
-                posted_by = u'*Originally posted by: [{0}](https://github.com/{0})*\n'.format(
-                    comment['user']['login'])
+                posted_by = u'*Originally posted by: {}*\n'.format(
+                    self.get_user_link(comment['user']['login']))
                 posted_by += body
                 body = posted_by
             p = ticket.discussion_thread.add_post(


[06/50] git commit: [#6608] Close milestones on import if no open tickets

Posted by jo...@apache.org.
[#6608] Close milestones on import if no open tickets

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/54c43fd9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/54c43fd9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/54c43fd9

Branch: refs/heads/cj/6422
Commit: 54c43fd9018c7dc7a66ec54ea087825d44f32874
Parents: c6f4a9d
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Sep 11 14:25:16 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Sep 18 20:24:30 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/trac/tickets.py |  8 ++++----
 ForgeTracker/forgetracker/import_support.py   | 20 +++++++++-----------
 2 files changed, 13 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/54c43fd9/ForgeImporters/forgeimporters/trac/tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tickets.py b/ForgeImporters/forgeimporters/trac/tickets.py
index cafd403..88ee769 100644
--- a/ForgeImporters/forgeimporters/trac/tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tickets.py
@@ -141,11 +141,11 @@ class TracTicketImporter(ToolImporter):
                     export_string, validate=False)
             AuditLog.log(
                 'import tool %s from %s' % (
-                        app.config.options.mount_point, 
-                        trac_url, 
-                    ), 
+                        app.config.options.mount_point,
+                        trac_url,
+                    ),
                 project=project, user=user, url=app.url,
-            ) 
+            )
             g.post_event('project_updated')
             return app
         except Exception as e:

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/54c43fd9/ForgeTracker/forgetracker/import_support.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/import_support.py b/ForgeTracker/forgetracker/import_support.py
index 9637ebc..cfc7839 100644
--- a/ForgeTracker/forgetracker/import_support.py
+++ b/ForgeTracker/forgetracker/import_support.py
@@ -148,7 +148,7 @@ class ImportSupport(object):
         u = M.User.by_username(username)
         return u._id if u else None
 
-    def check_custom_field(self, field, value):
+    def check_custom_field(self, field, value, ticket_status):
         field = c.app.globals.get_custom_field(field)
         if (field['type'] == 'select') and value:
             field_options = h.split_select_field_options(h.really_unicode(field['options']))
@@ -156,20 +156,21 @@ class ImportSupport(object):
                 field['options'] = ' '.join([field['options'], value])
         elif (field['type'] == 'milestone') and value:
             milestones = field['milestones']
-            is_exists = False
             for milestone in milestones:
                 if milestone['name'] == value:
-                    is_exists = True
-            if not is_exists:
+                    if ticket_status in c.app.globals.open_status_names:
+                        milestone['complete'] = False
+                    break
+            else:
                 milestone = {'due_date': '',
-                             'complete': False,
+                             'complete': not ticket_status in c.app.globals.open_status_names,
                              'description': '',
                              'name': value,
                              'old_name': value}
                 field['milestones'].append(milestone)
         ThreadLocalORMSession.flush_all()
 
-    def custom(self, ticket, field, value):
+    def custom(self, ticket, field, value, ticket_status):
         field = '_' + field
         if not c.app.has_custom_field(field):
             log.warning('Custom field %s is not defined, defining as string', field)
@@ -177,12 +178,9 @@ class ImportSupport(object):
             ThreadLocalORMSession.flush_all()
         if 'custom_fields' not in ticket:
             ticket['custom_fields'] = {}
-        self.check_custom_field(field, value)
+        self.check_custom_field(field, value, ticket_status)
         ticket['custom_fields'][field] = value
 
-    #
-    # Object convertors
-    #
     def make_artifact(self, ticket_dict):
         remapped = {}
         for f, v in ticket_dict.iteritems():
@@ -194,7 +192,7 @@ class ImportSupport(object):
             elif callable(transform):
                 transform(remapped, f, v)
             elif transform is ():
-                self.custom(remapped, f, v)
+                self.custom(remapped, f, v, ticket_dict.get('status'))
             else:
                 new_f, conv = transform
                 remapped[new_f] = conv(v)


[34/50] git commit: [#6667] Fix bug in comment update parsing

Posted by jo...@apache.org.
[#6667] Fix bug in comment update parsing

- Instead of iterating through all text nodes, which can break if
  there are an odd number, find the labels (<b> tags) and their
  sibling nodes (descriptions) explicitly

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/d83c5c29
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d83c5c29
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d83c5c29

Branch: refs/heads/cj/6422
Commit: d83c5c29fcd80878f05b0eabe45f7daadbc4d2df
Parents: 1f712d5
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Sep 18 21:45:16 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 18:49:28 2013 +0000

----------------------------------------------------------------------
 .../forgeimporters/google/__init__.py           |  9 ++--
 .../tests/google/test_extractor.py              | 46 ++++++++++++++++++++
 2 files changed, 49 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d83c5c29/ForgeImporters/forgeimporters/google/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/__init__.py b/ForgeImporters/forgeimporters/google/__init__.py
index d4eb83d..1a2c5c1 100644
--- a/ForgeImporters/forgeimporters/google/__init__.py
+++ b/ForgeImporters/forgeimporters/google/__init__.py
@@ -234,12 +234,9 @@ class Comment(object):
 
     def _get_updates(self, tag):
         _updates = tag.find('div', 'updates')
-        if _updates:
-            _strings = _updates.findAll(text=True)
-            updates = (s.strip() for s in _strings if s.strip())
-            self.updates = {field: updates.next() for field in updates}
-        else:
-            self.updates = {}
+        self.updates = {
+                b.text: b.nextSibling.strip()
+                for b in _updates.findAll('b')} if _updates else {}
 
     @property
     def annotated_text(self):

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d83c5c29/ForgeImporters/forgeimporters/tests/google/test_extractor.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_extractor.py b/ForgeImporters/forgeimporters/tests/google/test_extractor.py
index 32b3049..4eff44f 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_extractor.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_extractor.py
@@ -284,3 +284,49 @@ class TestUserLink(TestCase):
         tag.get.return_value = '/p/project'
         link = google.UserLink(tag)
         self.assertEqual(str(link), '[name](http://code.google.com/p/project)')
+
+
+class TestComment(TestCase):
+    html = """
+    <div class="cursor_off vt issuecomment" id="hc2">
+     <div style="float:right; margin-right:.3em; text-align:right">
+     <span class="date" title="Tue Jun 25 03:20:09 2013">
+     Jun 25, 2013
+     </span>
+     </div>
+     <span class="author">
+     <span class="role_label">Project Member</span>
+     <a name="c2" href="/p/pychess/issues/detail?id=267#c2">#2</a>
+     <a class="userlink" href="/u/gbtami/">gbtami</a></span>
+    <pre><i>(No comment was entered for this change.)</i>
+    </pre>
+     <div class="updates">
+     <div class="round4"></div>
+     <div class="round2"></div>
+     <div class="round1"></div>
+     <div class="box-inner">
+     <b>Summary:</b>
+     Make PyChess keyboard accessible
+     <span class="oldvalue">
+     (was: Make PyChess keyboard accecible)
+     </span>
+     <br>
+     <b>Status:</b>
+     Accepted
+     <br>
+     </div>
+     <div class="round1"></div>
+     <div class="round2"></div>
+     <div class="round4"></div>
+     </div>
+    </div>
+    """
+
+    def test_init(self):
+        from BeautifulSoup import BeautifulSoup
+        html = BeautifulSoup(self.html)
+        comment = google.Comment(html.find('div', 'issuecomment'))
+        self.assertEqual(comment.updates, {
+            u'Summary:': u'Make PyChess keyboard accessible',
+            u'Status:': u'Accepted',
+            })


[08/50] git commit: [#6608] fix test for Trac install_app params

Posted by jo...@apache.org.
[#6608] fix test for Trac install_app params


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

Branch: refs/heads/cj/6422
Commit: a3ba16a13f915bd0f8b6e36d0bc01486a8dc22c0
Parents: ffb9842
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Sep 18 21:30:55 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Sep 18 21:31:23 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/trac/tests/test_tickets.py | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a3ba16a1/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
index b3d2fcb..770ae72 100644
--- a/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
+++ b/ForgeImporters/forgeimporters/trac/tests/test_tickets.py
@@ -64,6 +64,8 @@ class TestTracTicketImporter(TestCase):
         self.assertEqual(res, app)
         project.install_app.assert_called_once_with(
                 'Tickets', mount_point='bugs', mount_label='Bugs',
+                open_status_names='new assigned accepted reopened',
+                closed_status_names='closed',
                 import_id={
                         'source': 'Trac',
                         'trac_url': 'http://example.com/trac/url/',


[03/50] git commit: [#6638] Added importer for exported Allura JSON

Posted by jo...@apache.org.
[#6638] Added importer for exported Allura JSON

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/bb421077
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/bb421077
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/bb421077

Branch: refs/heads/cj/6422
Commit: bb42107768cdb5dadf031f0f6a2677dae947155e
Parents: 66cb620
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Sep 16 19:54:55 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Wed Sep 18 16:13:37 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/discuss.py                  |   7 +-
 Allura/development.ini                          |   2 +
 ForgeImporters/forgeimporters/base.py           |  50 +++
 ForgeImporters/forgeimporters/forge/__init__.py |  17 +
 .../forge/templates/tracker/index.html          |  29 ++
 ForgeImporters/forgeimporters/forge/tracker.py  | 208 ++++++++++++
 .../forgeimporters/google/__init__.py           |  19 +-
 .../forgeimporters/tests/forge/__init__.py      |  17 +
 .../forgeimporters/tests/forge/test_tracker.py  | 331 +++++++++++++++++++
 .../tests/google/test_extractor.py              |   4 +-
 .../forgeimporters/tests/test_base.py           |  44 ++-
 ForgeImporters/setup.py                         |   1 +
 ForgeTracker/forgetracker/tracker_main.py       |   6 +
 13 files changed, 711 insertions(+), 24 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 03c991e..6df982f 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -167,11 +167,14 @@ class Thread(Artifact, ActivityObject):
             posts=[dict(slug=p.slug,
                         text=p.text,
                         subject=p.subject,
+                        author=p.author().username,
+                        timestamp=p.timestamp,
                         attachments=[dict(bytes=attach.length,
                                           url=h.absurl(attach.url())) for attach in p.attachments])
                    for p in self.post_class().query.find(
-                   dict(discussion_id=self.discussion_id, thread_id=self._id, status='ok')
-                   )]
+                       dict(discussion_id=self.discussion_id, thread_id=self._id, status='ok')
+                   )
+                ]
         )
 
     @property

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index 9cb4b16..2a0b542 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -147,6 +147,8 @@ bulk_export_path = /tmp/bulk_export/{nbhd}/{project}
 bulk_export_filename = {project}-backup-{date:%Y-%m-%d-%H%M%S}.zip
 bulk_export_download_instructions = Sample instructions for {project}
 
+importer_upload_path = /tmp/importer_upload/{nbhd}/{project}
+
 # space-separated list of tool names that are valid options
 # for project admins to set for their 'support_page' field
 # this field is not used by default in Allura, so this option

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/forgeimporters/base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py
index 653a172..ea01968 100644
--- a/ForgeImporters/forgeimporters/base.py
+++ b/ForgeImporters/forgeimporters/base.py
@@ -15,11 +15,18 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
+import os
+import errno
 import logging
 import urllib
 import urllib2
 from collections import defaultdict
 import traceback
+from urlparse import urlparse, parse_qs
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
 
 from BeautifulSoup import BeautifulSoup
 from tg import expose, validate, flash, redirect, config
@@ -461,3 +468,46 @@ class ImportAdminExtension(AdminExtension):
         base_url = c.project.url() + 'admin/ext/'
         link = SitemapEntry('Import', base_url+'import/')
         sidebar_links.append(link)
+
+
+def stringio_parser(page):
+    return {
+            'content-type': page.info()['content-type'],
+            'data': StringIO(page.read()),
+        }
+
+class File(object):
+    def __init__(self, url, filename=None):
+        extractor = ProjectExtractor(None, url, parser=stringio_parser)
+        self.url = url
+        self.filename = filename or os.path.basename(urlparse(url).path)
+        self.type = extractor.page['content-type'].split(';')[0]
+        self.file = extractor.page['data']
+
+
+def get_importer_upload_path(project):
+    shortname = project.shortname
+    if project.is_nbhd_project:
+        shortname = project.url().strip('/')
+    elif project.is_user_project:
+        shortname = project.shortname.split('/')[1]
+    elif not project.is_root:
+        shortname = project.shortname.split('/')[0]
+    upload_path = config['importer_upload_path'].format(
+            nbhd=project.neighborhood.url_prefix.strip('/'),
+            project=shortname,
+            c=c,
+        )
+    return upload_path
+
+def save_importer_upload(project, filename, data):
+    dest_path = get_importer_upload_path(project)
+    dest_file = os.path.join(dest_path, filename)
+    try:
+        os.makedirs(dest_path)
+    except OSError as e:
+        if e.errno != errno.EEXIST:
+            raise
+    with open(dest_file, 'w') as fp:
+        fp.write(data)
+    return dest_file

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/forgeimporters/forge/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/forge/__init__.py b/ForgeImporters/forgeimporters/forge/__init__.py
new file mode 100644
index 0000000..77505f1
--- /dev/null
+++ b/ForgeImporters/forgeimporters/forge/__init__.py
@@ -0,0 +1,17 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/forgeimporters/forge/templates/tracker/index.html
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/forge/templates/tracker/index.html b/ForgeImporters/forgeimporters/forge/templates/tracker/index.html
new file mode 100644
index 0000000..6e3a1d0
--- /dev/null
+++ b/ForgeImporters/forgeimporters/forge/templates/tracker/index.html
@@ -0,0 +1,29 @@
+{#-
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+-#}
+{% extends 'forgeimporters:templates/importer_base.html' %}
+
+{% block importer_fields %}
+  <div>
+    <label for="json">Tickets JSON
+      <br><small>JSON file exported from Allura</small>
+    </label>
+    <input name="tickets_json" type="file" />
+    {{ error('json') }}
+  </div>
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/forgeimporters/forge/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/forge/tracker.py b/ForgeImporters/forgeimporters/forge/tracker.py
new file mode 100644
index 0000000..07efb0e
--- /dev/null
+++ b/ForgeImporters/forgeimporters/forge/tracker.py
@@ -0,0 +1,208 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+
+import os
+from collections import defaultdict
+from datetime import datetime
+import json
+
+import dateutil.parser
+from formencode import validators as fev
+from pylons import tmpl_context as c
+from pylons import app_globals as g
+from ming.orm import session, ThreadLocalORMSession
+
+from tg import (
+        expose,
+        flash,
+        redirect,
+        validate,
+        )
+from tg.decorators import (
+        with_trailing_slash,
+        without_trailing_slash,
+        )
+
+from allura.controllers import BaseController
+from allura.lib import helpers as h
+from allura.lib.plugin import ImportIdConverter
+from allura.lib.decorators import require_post, task
+from allura.lib import validators as v
+from allura import model as M
+
+from forgetracker.tracker_main import ForgeTrackerApp
+from forgetracker import model as TM
+from forgeimporters.base import (
+        ToolImporter,
+        ToolImportForm,
+        ImportErrorHandler,
+        File,
+        get_importer_upload_path,
+        save_importer_upload,
+        )
+
+
+@task(notifications_disabled=True)
+def import_tool(**kw):
+    importer = ForgeTrackerImporter()
+    with ImportErrorHandler(importer, kw.get('project_name'), c.project):
+        importer.import_tool(c.project, c.user, **kw)
+
+
+class ForgeTrackerImportForm(ToolImportForm):
+    tickets_json = v.JsonFile(required=True)
+
+
+class ForgeTrackerImportController(BaseController):
+    def __init__(self):
+        self.importer = ForgeTrackerImporter()
+
+    @property
+    def target_app(self):
+        return self.importer.target_app
+
+    @with_trailing_slash
+    @expose('jinja:forgeimporters.forge:templates/tracker/index.html')
+    def index(self, **kw):
+        return dict(importer=self.importer,
+                target_app=self.target_app)
+
+    @without_trailing_slash
+    @expose()
+    @require_post()
+    @validate(ForgeTrackerImportForm(ForgeTrackerApp), error_handler=index)
+    def create(self, tickets_json, mount_point, mount_label, **kw):
+        if ForgeTrackerImporter().enforce_limit(c.project):
+            save_importer_upload(c.project, 'tickets.json', json.dumps(tickets_json))
+            import_tool.post(
+                    mount_point=mount_point,
+                    mount_label=mount_label,
+                )
+            flash('Ticket import has begun. Your new tracker will be available '
+                    'when the import is complete.')
+            redirect(c.project.url() + 'admin/')
+        else:
+            flash('There are too many imports pending at this time.  Please wait and try again.', 'error')
+        redirect(c.project.url() + 'admin/')
+
+
+class ForgeTrackerImporter(ToolImporter):
+    source = 'Allura'
+    target_app = ForgeTrackerApp
+    controller = ForgeTrackerImportController
+    tool_label = 'Tickets'
+
+    def __init__(self, *args, **kwargs):
+        super(ForgeTrackerImporter, self).__init__(*args, **kwargs)
+        self.max_ticket_num = 0
+
+    def _load_json(self, project):
+        upload_path = get_importer_upload_path(project)
+        full_path = os.path.join(upload_path, 'tickets.json')
+        with open(full_path) as fp:
+            return json.load(fp)
+
+    def import_tool(self, project, user, mount_point=None,
+            mount_label=None, **kw):
+        import_id_converter = ImportIdConverter.get()
+        tracker_json = self._load_json(project)
+        tracker_json['tracker_config']['options'].pop('ordinal', None)
+        tracker_json['tracker_config']['options'].pop('mount_point', None)
+        tracker_json['tracker_config']['options'].pop('mount_label', None)
+        app = project.install_app('tickets', mount_point, mount_label,
+                import_id={
+                        'source': self.source,
+                        'app_config_id': tracker_json['tracker_config']['_id'],
+                    },
+                open_status_names=tracker_json['open_status_names'],
+                closed_status_names=tracker_json['closed_status_names'],
+                **tracker_json['tracker_config']['options']
+            )
+        ThreadLocalORMSession.flush_all()
+        try:
+            M.session.artifact_orm_session._get().skip_mod_date = True
+            for ticket_json in tracker_json['tickets']:
+                reporter = self.get_user(ticket_json['reported_by'])
+                with h.push_config(c, user=reporter, app=app):
+                    self.max_ticket_num = max(ticket_json['ticket_num'], self.max_ticket_num)
+                    ticket = TM.Ticket(
+                            app_config_id=app.config._id,
+                            import_id=import_id_converter.expand(ticket_json['ticket_num'], app),
+                            description=self.annotate(ticket_json['description'], reporter, ticket_json['reported_by']),
+                            created_date=dateutil.parser.parse(ticket_json['created_date']),
+                            mod_date=dateutil.parser.parse(ticket_json['mod_date']),
+                            ticket_num=ticket_json['ticket_num'],
+                            summary=ticket_json['summary'],
+                            custom_fields=ticket_json['custom_fields'],
+                            status=ticket_json['status'],
+                            labels=ticket_json['labels'],
+                            votes_down=ticket_json['votes_down'],
+                            votes_up=ticket_json['votes_up'],
+                            votes = ticket_json['votes_up'] - ticket_json['votes_down'],
+                        )
+                    ticket.private = ticket_json['private']  # trigger the private property
+                    self.process_comments(ticket, ticket_json['discussion_thread']['posts'])
+                    session(ticket).flush(ticket)
+                    session(ticket).expunge(ticket)
+            app.globals.custom_fields = tracker_json['custom_fields']
+            self.process_bins(app, tracker_json['saved_bins'])
+            app.globals.last_ticket_num = self.max_ticket_num
+            M.AuditLog.log(
+                    'import tool %s from exported Allura JSON' % (
+                            app.config.options.mount_point,
+                        ),
+                    project=project,
+                    user=user,
+                    url=app.url,
+                )
+            g.post_event('project_updated')
+            app.globals.invalidate_bin_counts()
+            ThreadLocalORMSession.flush_all()
+            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_user(self, username):
+        user = M.User.by_username(username)
+        if not user:
+            user = M.User.anonymous()
+        return user
+
+    def annotate(self, text, user, username):
+        if user._id is None:
+            return '*Originally by:* %s\n\n%s' % (username, text)
+        return text
+
+    def process_comments(self, ticket, comments):
+        for comment_json in comments:
+            user = self.get_user(comment_json['author'])
+            with h.push_config(c, user=user):
+                p = ticket.discussion_thread.add_post(
+                        text = self.annotate(comment_json['text'], user, comment_json['author']),
+                        ignore_security = True,
+                        timestamp = dateutil.parser.parse(comment_json['timestamp']),
+                    )
+                p.add_multiple_attachments([File(a['url']) for a in comment_json['attachments']])
+
+    def process_bins(self, app, bins):
+        TM.Bin.query.remove({'app_config_id': app.config._id})
+        for bin_json in bins:
+            bin_json.pop('_id', None)
+            TM.Bin(app_config_id=app.config._id, **bin_json)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/forgeimporters/google/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/google/__init__.py b/ForgeImporters/forgeimporters/google/__init__.py
index 10ddc86..d4eb83d 100644
--- a/ForgeImporters/forgeimporters/google/__init__.py
+++ b/ForgeImporters/forgeimporters/google/__init__.py
@@ -20,10 +20,6 @@ import urllib
 from urlparse import urlparse, urljoin, parse_qs
 from collections import defaultdict
 from contextlib import closing
-try:
-    from cStringIO import StringIO
-except ImportError:
-    from StringIO import StringIO
 import logging
 
 from BeautifulSoup import BeautifulSoup
@@ -31,6 +27,7 @@ from BeautifulSoup import BeautifulSoup
 from allura.lib import helpers as h
 from allura import model as M
 from forgeimporters.base import ProjectExtractor
+from forgeimporters.base import File
 
 
 log = logging.getLogger(__name__)
@@ -63,12 +60,6 @@ def csv_parser(page):
     # remove CSV wrapping (quotes, commas, newlines)
     return [line.strip('",\n') for line in lines]
 
-def stringio_parser(page):
-    return {
-            'content-type': page.info()['content-type'],
-            'data': StringIO(page.read()),
-        }
-
 
 class GoogleCodeProjectExtractor(ProjectExtractor):
     BASE_URL = 'http://code.google.com'
@@ -268,14 +259,6 @@ class Comment(object):
             )
         return text
 
-class File(object):
-    def __init__(self, url, filename):
-        extractor = GoogleCodeProjectExtractor(None, url, parser=stringio_parser)
-        self.url = url
-        self.filename = filename
-        self.type = extractor.page['content-type'].split(';')[0]
-        self.file = extractor.page['data']
-
 class Attachment(File):
     def __init__(self, url):
         url = urljoin(GoogleCodeProjectExtractor.BASE_URL, url)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/forgeimporters/tests/forge/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/forge/__init__.py b/ForgeImporters/forgeimporters/tests/forge/__init__.py
new file mode 100644
index 0000000..77505f1
--- /dev/null
+++ b/ForgeImporters/forgeimporters/tests/forge/__init__.py
@@ -0,0 +1,17 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/forgeimporters/tests/forge/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/forge/test_tracker.py b/ForgeImporters/forgeimporters/tests/forge/test_tracker.py
new file mode 100644
index 0000000..9eeaec4
--- /dev/null
+++ b/ForgeImporters/forgeimporters/tests/forge/test_tracker.py
@@ -0,0 +1,331 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+
+from datetime import datetime
+from unittest import TestCase
+
+import mock
+from ming.odm import ThreadLocalORMSession
+import webtest
+
+from allura.tests import TestController
+from allura.tests.decorators import with_tracker
+
+from allura import model as M
+from forgeimporters.forge import tracker
+
+
+class TestTrackerImporter(TestCase):
+    @mock.patch.object(tracker.h, 'make_app_admin_only')
+    @mock.patch.object(tracker, 'g')
+    @mock.patch.object(tracker, 'c')
+    @mock.patch.object(tracker, 'ThreadLocalORMSession')
+    @mock.patch.object(tracker, 'session')
+    @mock.patch.object(tracker, 'M')
+    @mock.patch.object(tracker, 'TM')
+    def test_import_tool(self, TM, M, session, tlos, c, g, mao):
+        importer = tracker.ForgeTrackerImporter()
+        importer._load_json = mock.Mock(return_value={
+                'tracker_config': {
+                        '_id': 'orig_id',
+                        'options': {
+                                'foo': 'bar',
+                            },
+                    },
+                'open_status_names': 'open statuses',
+                'closed_status_names': 'closed statuses',
+                'custom_fields': 'fields',
+                'saved_bins': 'bins',
+                'tickets': [
+                        {
+                                'reported_by': 'rb1',
+                                'ticket_num': 1,
+                                'description': 'd1',
+                                'created_date': '2013-09-01',
+                                'mod_date': '2013-09-02',
+                                'summary': 's1',
+                                'custom_fields': 'cf1',
+                                'status': 'st1',
+                                'labels': 'l1',
+                                'votes_down': 1,
+                                'votes_up': 2,
+                                'private': False,
+                                'discussion_thread': {'posts': 'comments1'},
+                            },
+                        {
+                                'reported_by': 'rb2',
+                                'ticket_num': 100,
+                                'description': 'd2',
+                                'created_date': '2013-09-03',
+                                'mod_date': '2013-09-04',
+                                'summary': 's2',
+                                'custom_fields': 'cf2',
+                                'status': 'st2',
+                                'labels': 'l2',
+                                'votes_down': 3,
+                                'votes_up': 5,
+                                'private': True,
+                                'discussion_thread': {'posts': 'comments2'},
+                            },
+                    ],
+            })
+        reporter = mock.Mock()
+        importer.get_user = mock.Mock(return_value=reporter)
+        importer.annotate = mock.Mock(side_effect=['ad1', 'ad2'])
+        importer.process_comments = mock.Mock()
+        importer.process_bins = mock.Mock()
+        project, user = mock.Mock(), mock.Mock()
+        app = project.install_app.return_value
+        app.config.options.mount_point = 'mount_point'
+        app.config.options.import_id = {
+                'source': 'Allura',
+                'app_config_id': 'orig_id',
+            }
+        app.config.options.get = lambda *a: getattr(app.config.options, *a)
+        app.url = 'foo'
+        tickets = TM.Ticket.side_effect = [mock.Mock(), mock.Mock()]
+
+        importer.import_tool(project, user,
+                mount_point='mount_point', mount_label='mount_label')
+
+        project.install_app.assert_called_once_with('tickets', 'mount_point', 'mount_label',
+                open_status_names='open statuses',
+                closed_status_names='closed statuses',
+                import_id={
+                        'source': 'Allura',
+                        'app_config_id': 'orig_id',
+                    },
+                foo='bar',
+            )
+        self.assertEqual(importer.annotate.call_args_list, [
+                mock.call('d1', reporter, 'rb1'),
+                mock.call('d2', reporter, 'rb2'),
+            ])
+        self.assertEqual(TM.Ticket.call_args_list, [
+                mock.call(
+                        app_config_id=app.config._id,
+                        import_id={
+                                'source': 'Allura',
+                                'app_config_id': 'orig_id',
+                                'source_id': 1,
+                            },
+                        description='ad1',
+                        created_date=datetime(2013, 9, 1),
+                        mod_date=datetime(2013, 9, 2),
+                        ticket_num=1,
+                        summary='s1',
+                        custom_fields='cf1',
+                        status='st1',
+                        labels='l1',
+                        votes_down=1,
+                        votes_up=2,
+                        votes=1,
+                    ),
+                mock.call(
+                        app_config_id=app.config._id,
+                        import_id={
+                                'source': 'Allura',
+                                'app_config_id': 'orig_id',
+                                'source_id': 100,
+                            },
+                        description='ad2',
+                        created_date=datetime(2013, 9, 3),
+                        mod_date=datetime(2013, 9, 4),
+                        ticket_num=100,
+                        summary='s2',
+                        custom_fields='cf2',
+                        status='st2',
+                        labels='l2',
+                        votes_down=3,
+                        votes_up=5,
+                        votes=2,
+                    ),
+            ])
+        self.assertEqual(tickets[0].private, False)
+        self.assertEqual(tickets[1].private, True)
+        self.assertEqual(importer.process_comments.call_args_list, [
+                mock.call(tickets[0], 'comments1'),
+                mock.call(tickets[1], 'comments2'),
+            ])
+        self.assertEqual(tlos.flush_all.call_args_list, [
+                mock.call(),
+                mock.call(),
+            ])
+        self.assertEqual(session.return_value.flush.call_args_list, [
+                mock.call(tickets[0]),
+                mock.call(tickets[1]),
+            ])
+        self.assertEqual(session.return_value.expunge.call_args_list, [
+                mock.call(tickets[0]),
+                mock.call(tickets[1]),
+            ])
+        self.assertEqual(app.globals.custom_fields, 'fields')
+        importer.process_bins.assert_called_once_with(app, 'bins')
+        self.assertEqual(app.globals.last_ticket_num, 100)
+        M.AuditLog.log.assert_called_once_with(
+                'import tool mount_point from exported Allura JSON',
+                project=project, user=user, url='foo')
+        g.post_event.assert_called_once_with('project_updated')
+        app.globals.invalidate_bin_counts.assert_called_once_with()
+
+    @mock.patch.object(tracker, 'ThreadLocalORMSession')
+    @mock.patch.object(tracker, 'M')
+    @mock.patch.object(tracker, 'h')
+    def test_import_tool_failure(self, h, M, ThreadLocalORMSession):
+        M.session.artifact_orm_session._get.side_effect = ValueError
+        project = mock.Mock()
+        user = mock.Mock()
+        tracker_json = {
+                'tracker_config': {'_id': 'orig_id', 'options': {}},
+                'open_status_names': 'os',
+                'closed_status_names': 'cs',
+            }
+
+        importer = tracker.ForgeTrackerImporter()
+        importer._load_json = mock.Mock(return_value=tracker_json)
+        self.assertRaises(ValueError, importer.import_tool, project, user, project_name='project_name',
+                mount_point='mount_point', mount_label='mount_label')
+
+        h.make_app_admin_only.assert_called_once_with(project.install_app.return_value)
+
+    @mock.patch.object(tracker, 'M')
+    def test_get_user(self, M):
+        importer = tracker.ForgeTrackerImporter()
+        M.User.anonymous.return_value = 'anon'
+
+        M.User.by_username.return_value = 'bar'
+        self.assertEqual(importer.get_user('foo'), 'bar')
+        self.assertEqual(M.User.anonymous.call_count, 0)
+
+        M.User.by_username.return_value = None
+        self.assertEqual(importer.get_user('foo'), 'anon')
+        self.assertEqual(M.User.anonymous.call_count, 1)
+
+    def test_annotate(self):
+        importer = tracker.ForgeTrackerImporter()
+        user = mock.Mock(_id=1)
+        self.assertEqual(importer.annotate('foo', user, 'bar'), 'foo')
+        user._id = None
+        self.assertEqual(importer.annotate('foo', user, 'bar'), '*Originally by:* bar\n\nfoo')
+
+    @mock.patch.object(tracker, 'File')
+    @mock.patch.object(tracker, 'c')
+    def test_process_comments(self, c, File):
+        importer = tracker.ForgeTrackerImporter()
+        author = mock.Mock()
+        importer.get_user = mock.Mock(return_value=author)
+        importer.annotate = mock.Mock(side_effect=['at1', 'at2'])
+        ticket = mock.Mock()
+        add_post = ticket.discussion_thread.add_post
+        ama = add_post.return_value.add_multiple_attachments
+        File.side_effect = ['f1', 'f2', 'f3', 'f4']
+        comments = [
+                {
+                    'author': 'a1',
+                    'text': 't1',
+                    'timestamp': '2013-09-01',
+                    'attachments': [{'url': 'u1'}, {'url': 'u2'}],
+                },
+                {
+                    'author': 'a2',
+                    'text': 't2',
+                    'timestamp': '2013-09-02',
+                    'attachments': [{'url': 'u3'}, {'url': 'u4'}],
+                },
+            ]
+
+        importer.process_comments(ticket, comments)
+
+        self.assertEqual(importer.get_user.call_args_list, [mock.call('a1'), mock.call('a2')])
+        self.assertEqual(importer.annotate.call_args_list, [
+                mock.call('t1', author, 'a1'),
+                mock.call('t2', author, 'a2'),
+            ])
+        self.assertEqual(add_post.call_args_list, [
+                mock.call(text='at1', ignore_security=True, timestamp=datetime(2013, 9, 1)),
+                mock.call(text='at2', ignore_security=True, timestamp=datetime(2013, 9, 2)),
+            ])
+        self.assertEqual(File.call_args_list, [
+                mock.call('u1'),
+                mock.call('u2'),
+                mock.call('u3'),
+                mock.call('u4'),
+            ])
+        self.assertEqual(ama.call_args_list, [
+                mock.call(['f1', 'f2']),
+                mock.call(['f3', 'f4']),
+            ])
+
+    @mock.patch.object(tracker, 'TM')
+    def test_process_bins(self, TM):
+        app = mock.Mock()
+        app.config._id = 1
+        importer = tracker.ForgeTrackerImporter()
+        importer.process_bins(app, [{'_id': 1, 'b': 1}, {'b': 2}])
+        TM.Bin.query.remove.assert_called_once_with({'app_config_id': 1})
+        self.assertEqual(TM.Bin.call_args_list, [
+                mock.call(app_config_id=1, b=1),
+                mock.call(app_config_id=1, b=2),
+            ])
+
+
+class TestForgeTrackerImportController(TestController, TestCase):
+    def setUp(self):
+        """Mount Allura importer on the Tracker admin controller"""
+        super(TestForgeTrackerImportController, self).setUp()
+        from forgetracker.tracker_main import TrackerAdminController
+        TrackerAdminController._importer = tracker.ForgeTrackerImportController()
+
+    @with_tracker
+    def test_index(self):
+        r = self.app.get('/p/test/admin/bugs/_importer/')
+        self.assertIsNotNone(r.html.find(attrs=dict(name="tickets_json")))
+        self.assertIsNotNone(r.html.find(attrs=dict(name="mount_label")))
+        self.assertIsNotNone(r.html.find(attrs=dict(name="mount_point")))
+
+    @with_tracker
+    @mock.patch('forgeimporters.forge.tracker.save_importer_upload')
+    @mock.patch('forgeimporters.forge.tracker.import_tool')
+    def test_create(self, import_tool, sui):
+        project = M.Project.query.get(shortname='test')
+        params = {
+                'tickets_json': webtest.Upload('tickets.json', '{"key": "val"}'),
+                'mount_label': 'mylabel',
+                'mount_point': 'mymount',
+            }
+        r = self.app.post('/p/test/admin/bugs/_importer/create', params,
+                status=302)
+        self.assertEqual(r.location, 'http://localhost/p/test/admin/')
+        sui.assert_called_once_with(project, 'tickets.json', '{"key": "val"}')
+        import_tool.post.assert_called_once_with(mount_point='mymount', mount_label='mylabel')
+
+    @with_tracker
+    @mock.patch('forgeimporters.forge.tracker.save_importer_upload')
+    @mock.patch('forgeimporters.forge.tracker.import_tool')
+    def test_create_limit(self, import_tool, sui):
+        project = M.Project.query.get(shortname='test')
+        project.set_tool_data('ForgeTrackerImporter', pending=1)
+        ThreadLocalORMSession.flush_all()
+        params = {
+                'tickets_json': webtest.Upload('tickets.json', '{"key": "val"}'),
+                'mount_label': 'mylabel',
+                'mount_point': 'mymount',
+            }
+        r = self.app.post('/p/test/admin/bugs/_importer/create', params,
+                status=302).follow()
+        self.assertIn('Please wait and try again', r)
+        self.assertEqual(import_tool.post.call_count, 0)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/forgeimporters/tests/google/test_extractor.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/google/test_extractor.py b/ForgeImporters/forgeimporters/tests/google/test_extractor.py
index a6c09be..32b3049 100644
--- a/ForgeImporters/forgeimporters/tests/google/test_extractor.py
+++ b/ForgeImporters/forgeimporters/tests/google/test_extractor.py
@@ -211,7 +211,7 @@ class TestGoogleCodeProjectExtractor(TestCase):
                 'OpSys-OSX',
             ])
 
-    @mock.patch.object(google, 'StringIO')
+    @mock.patch.object(base, 'StringIO')
     def test_get_issue_attachments(self, StringIO):
         self.urlopen.return_value.info.return_value = {'content-type': 'text/plain; foo'}
         test_issue = open(pkg_resources.resource_filename('forgeimporters', 'tests/data/google/test-issue.html')).read()
@@ -222,7 +222,7 @@ class TestGoogleCodeProjectExtractor(TestCase):
         self.assertEqual(attachments[0].url, 'http://allura-google-importer.googlecode.com/issues/attachment?aid=70000000&name=at1.txt&token=3REU1M3JUUMt0rJUg7ldcELt6LA%3A1376059941255')
         self.assertEqual(attachments[0].type, 'text/plain')
 
-    @mock.patch.object(google, 'StringIO')
+    @mock.patch.object(base, 'StringIO')
     def test_iter_comments(self, StringIO):
         test_issue = open(pkg_resources.resource_filename('forgeimporters', 'tests/data/google/test-issue.html')).read()
         gpe = self._make_extractor(test_issue)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/forgeimporters/tests/test_base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/test_base.py b/ForgeImporters/forgeimporters/tests/test_base.py
index ded4e37..f9a373b 100644
--- a/ForgeImporters/forgeimporters/tests/test_base.py
+++ b/ForgeImporters/forgeimporters/tests/test_base.py
@@ -16,17 +16,19 @@
 #       under the License.
 
 from unittest import TestCase
+import errno
 
 from formencode import Invalid
 import mock
-from tg import expose
+from tg import expose, config
 from nose.tools import assert_equal, assert_raises
 from webob.exc import HTTPUnauthorized
 
 from alluratest.controller import TestController
 from allura.tests import decorators as td
+from allura.lib import helpers as h
 
-from .. import base
+from forgeimporters import base
 
 
 class TestProjectExtractor(TestCase):
@@ -280,3 +282,41 @@ class TestProjectToolsImportController(TestController):
         url = import1_page.environ['PATH_INFO']
         assert url.endswith('/admin/ext/import/importer1'), url
         assert_equal(import1_page.body, 'test importer 1 controller webpage')
+
+
+def test_get_importer_upload_path():
+    project = mock.Mock(
+            shortname='prefix/shortname',
+            is_nbhd_project=False,
+            is_user_project=False,
+            is_root=False,
+            url=lambda: 'n_url/',
+            neighborhood=mock.Mock(url_prefix='p/'),
+        )
+    with h.push_config(config, importer_upload_path='path/{nbhd}/{project}'):
+        assert_equal(base.get_importer_upload_path(project), 'path/p/prefix')
+        project.is_nbhd_project = True
+        assert_equal(base.get_importer_upload_path(project), 'path/p/n_url')
+        project.is_nbhd_project = False
+        project.is_user_project = True
+        assert_equal(base.get_importer_upload_path(project), 'path/p/shortname')
+        project.is_user_project = False
+        project.is_root = True
+        assert_equal(base.get_importer_upload_path(project), 'path/p/prefix/shortname')
+
+@mock.patch.object(base, 'os')
+@mock.patch.object(base, 'get_importer_upload_path')
+def test_save_importer_upload(giup, os):
+    os.path.join = lambda *a: '/'.join(a)
+    giup.return_value = 'path'
+    os.makedirs.side_effect = OSError(errno.EEXIST, 'foo')
+    _open = mock.MagicMock()
+    fp = _open.return_value.__enter__.return_value
+    with mock.patch('__builtin__.open', _open):
+        base.save_importer_upload('project', 'file', 'data')
+    os.makedirs.assert_called_once_with('path')
+    _open.assert_called_once_with('path/file', 'w')
+    fp.write.assert_called_once_with('data')
+
+    os.makedirs.side_effect = OSError(errno.EACCES, 'foo')
+    assert_raises(OSError, base.save_importer_upload, 'project', 'file', 'data')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeImporters/setup.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/setup.py b/ForgeImporters/setup.py
index bb8148b..eaeb7df 100644
--- a/ForgeImporters/setup.py
+++ b/ForgeImporters/setup.py
@@ -43,6 +43,7 @@ setup(name='ForgeImporters',
       google-code-repo = forgeimporters.google.code:GoogleRepoImporter
       github-repo = forgeimporters.github.code:GitHubRepoImporter
       trac-tickets = forgeimporters.trac.tickets:TracTicketImporter
+      forge-tracker = forgeimporters.forge.tracker:ForgeTrackerImporter
 
       [allura.admin]
       importers = forgeimporters.base:ImportAdminExtension

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/bb421077/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 6c6c20d..ea075af 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -422,6 +422,12 @@ class ForgeTrackerApp(Application):
         f.write(',\n"milestones":')
         milestones = self.milestones
         json.dump(milestones, f, cls=jsonify.GenericJSON, indent=2)
+        f.write(',\n"custom_fields":')
+        json.dump(self.globals.custom_fields, f, cls=jsonify.GenericJSON, indent=2)
+        f.write(',\n"open_status_names":')
+        json.dump(self.globals.open_status_names, f, cls=jsonify.GenericJSON, indent=2)
+        f.write(',\n"closed_status_names":')
+        json.dump(self.globals.closed_status_names, f, cls=jsonify.GenericJSON, indent=2)
         f.write(',\n"saved_bins":')
         bins = self.bins
         json.dump(bins, f, cls=jsonify.GenericJSON, indent=2)


[24/50] git commit: [#6535] ticket:424 Handle pagination

Posted by jo...@apache.org.
[#6535] ticket:424 Handle pagination


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

Branch: refs/heads/cj/6422
Commit: 37751659315b4300b27bbd2be0e544991ab42954
Parents: a2833b3
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 12:35:11 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:51 2013 +0000

----------------------------------------------------------------------
 .../forgeimporters/github/__init__.py           | 25 ++++++++++-
 .../tests/github/test_extractor.py              | 47 +++++++++++++++-----
 2 files changed, 58 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/37751659/ForgeImporters/forgeimporters/github/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/__init__.py b/ForgeImporters/forgeimporters/github/__init__.py
index 438fc8a..35bbff7 100644
--- a/ForgeImporters/forgeimporters/github/__init__.py
+++ b/ForgeImporters/forgeimporters/github/__init__.py
@@ -15,6 +15,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
+import re
 import logging
 import json
 import urllib
@@ -31,9 +32,29 @@ class GitHubProjectExtractor(base.ProjectExtractor):
             'issues': 'https://api.github.com/repos/{project_name}/issues',
         }
     POSSIBLE_STATES = ('opened', 'closed')
+    NEXT_PAGE_URL_RE = re.compile(r'<([^>]*)>; rel="next"')
+
+    def get_next_page_url(self, link):
+        if not link:
+            return
+        m = self.NEXT_PAGE_URL_RE.match(link)
+        return m.group(1) if m else None
 
     def parse_page(self, page):
-        return json.loads(page.read().decode('utf8'))
+        # Look at link header to handle pagination
+        link = page.info().get('Link')
+        next_page_url = self.get_next_page_url(link)
+        return json.loads(page.read().decode('utf8')), next_page_url
+
+    def get_page(self, page_name_or_url, **kw):
+        page = super(GitHubProjectExtractor, self).get_page(page_name_or_url, **kw)
+        page, next_page_url = page
+        while next_page_url:
+            p = super(GitHubProjectExtractor, self).get_page(next_page_url, **kw)
+            p, next_page_url = p
+            page += p
+        self.page = page
+        return self.page
 
     def get_summary(self):
         return self.get_page('project_info').get('description')
@@ -52,7 +73,7 @@ class GitHubProjectExtractor(base.ProjectExtractor):
             issue_list_url = url.format(
                 state=state,
             )
-            issues += json.loads(self.urlopen(issue_list_url).read().decode('utf8'))
+            issues += self.get_page(issue_list_url)
         issues.sort(key=lambda x: x['number'])
         for issue in issues:
             yield (issue['number'], issue)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/37751659/ForgeImporters/forgeimporters/tests/github/test_extractor.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_extractor.py b/ForgeImporters/forgeimporters/tests/github/test_extractor.py
index 8eb5811..c7734fa 100644
--- a/ForgeImporters/forgeimporters/tests/github/test_extractor.py
+++ b/ForgeImporters/forgeimporters/tests/github/test_extractor.py
@@ -20,12 +20,9 @@ from unittest import TestCase
 
 from ... import github
 
-try:
-    from cStringIO import StringIO
-except ImportError:
-    from StringIO import StringIO
-
-
+# Can't use cStringIO here, because we cannot set attributes or subclass it,
+# and this is needed in mocked_urlopen below
+from StringIO import StringIO
 
 
 class TestGitHubProjectExtractor(TestCase):
@@ -39,23 +36,48 @@ class TestGitHubProjectExtractor(TestCase):
     ]
     OPENED_ISSUES_LIST = [
         {u'number': 3},
+        {u'number': 4},
+        {u'number': 5},
+    ]
+    OPENED_ISSUES_LIST_PAGE2 = [
+        {u'number': 6},
+        {u'number': 7},
+        {u'number': 8},
     ]
     ISSUE_COMMENTS = [u'hello', u'mocked_comment']
+    ISSUE_COMMENTS_PAGE2 = [u'hello2', u'mocked_comment2']
 
     def mocked_urlopen(self, url):
+        headers = {}
         if url.endswith('/test_project'):
-            return StringIO(json.dumps(self.PROJECT_INFO))
+            response = StringIO(json.dumps(self.PROJECT_INFO))
         elif url.endswith('/issues?state=closed'):
-            return StringIO(json.dumps(self.CLOSED_ISSUES_LIST))
+            response = StringIO(json.dumps(self.CLOSED_ISSUES_LIST))
         elif url.endswith('/issues?state=opened'):
-            return StringIO(json.dumps(self.OPENED_ISSUES_LIST))
+            response = StringIO(json.dumps(self.OPENED_ISSUES_LIST))
+            headers = {'Link': '</issues?state=opened&page=2>; rel="next"'}
+        elif url.endswith('/issues?state=opened&page=2'):
+            response = StringIO(json.dumps(self.OPENED_ISSUES_LIST_PAGE2))
         elif url.endswith('/comments'):
-            return StringIO(json.dumps(self.ISSUE_COMMENTS))
+            response = StringIO(json.dumps(self.ISSUE_COMMENTS))
+            headers = {'Link': '</comments?page=2>; rel="next"'}
+        elif url.endswith('/comments?page=2'):
+            response = StringIO(json.dumps(self.ISSUE_COMMENTS_PAGE2))
+
+        response.info = lambda: headers
+        return response
 
     def setUp(self):
         self.extractor = github.GitHubProjectExtractor('test_project')
         self.extractor.urlopen = self.mocked_urlopen
 
+    def test_get_next_page_url(self):
+        self.assertIsNone(self.extractor.get_next_page_url(None))
+        self.assertIsNone(self.extractor.get_next_page_url(''))
+        link = '<https://api.github.com/repositories/8560576/issues?state=open&page=2>; rel="next", <https://api.github.com/repositories/8560576/issues?state=open&page=2>; rel="last"'
+        self.assertEqual(self.extractor.get_next_page_url(link),
+                'https://api.github.com/repositories/8560576/issues?state=open&page=2')
+
     def test_get_summary(self):
         self.assertEqual(self.extractor.get_summary(), 'project description')
 
@@ -65,10 +87,11 @@ class TestGitHubProjectExtractor(TestCase):
     def test_iter_issues(self):
         issues = list(self.extractor.iter_issues())
         all_issues = zip((1,2), self.CLOSED_ISSUES_LIST)
-        all_issues.append((3, self.OPENED_ISSUES_LIST[0]))
+        all_issues += zip((3, 4, 5), self.OPENED_ISSUES_LIST)
+        all_issues += zip((6, 7, 8), self.OPENED_ISSUES_LIST_PAGE2)
         self.assertEqual(issues, all_issues)
 
     def test_iter_comments(self):
         mock_issue = {'comments_url': '/issues/1/comments'}
         comments = list(self.extractor.iter_comments(mock_issue))
-        self.assertEqual(comments, self.ISSUE_COMMENTS)
+        self.assertEqual(comments, self.ISSUE_COMMENTS + self.ISSUE_COMMENTS_PAGE2)


[31/50] git commit: [#6535] ticket:424 Improve test for get_next_page_url

Posted by jo...@apache.org.
[#6535] ticket:424 Improve test for get_next_page_url


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

Branch: refs/heads/cj/6422
Commit: 503c4f795de506f4bcade371ac3f8c6a220ea96a
Parents: 42b6445
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 15:29:04 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:52 2013 +0000

----------------------------------------------------------------------
 .../forgeimporters/tests/github/test_extractor.py           | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/503c4f79/ForgeImporters/forgeimporters/tests/github/test_extractor.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_extractor.py b/ForgeImporters/forgeimporters/tests/github/test_extractor.py
index e29a533..fbbdc3d 100644
--- a/ForgeImporters/forgeimporters/tests/github/test_extractor.py
+++ b/ForgeImporters/forgeimporters/tests/github/test_extractor.py
@@ -87,10 +87,17 @@ class TestGitHubProjectExtractor(TestCase):
     def test_get_next_page_url(self):
         self.assertIsNone(self.extractor.get_next_page_url(None))
         self.assertIsNone(self.extractor.get_next_page_url(''))
-        link = '<https://api.github.com/repositories/8560576/issues?state=open&page=2>; rel="next", <https://api.github.com/repositories/8560576/issues?state=open&page=2>; rel="last"'
+        link = '<https://api.github.com/repositories/8560576/issues?state=open&page=2>; rel="next", <https://api.github.com/repositories/8560576/issues?state=open&page=10>; rel="last"'
         self.assertEqual(self.extractor.get_next_page_url(link),
                 'https://api.github.com/repositories/8560576/issues?state=open&page=2')
 
+        link = '<https://api.github.com/repositories/8560576/issues?state=open&page=2>; rel="next"'
+        self.assertEqual(self.extractor.get_next_page_url(link),
+                'https://api.github.com/repositories/8560576/issues?state=open&page=2')
+
+        link = '<https://api.github.com/repositories/8560576/issues?state=open&page=1>; rel="prev"'
+        self.assertIsNone(self.extractor.get_next_page_url(link))
+
     def test_get_summary(self):
         self.assertEqual(self.extractor.get_summary(), 'project description')
 


[20/50] git commit: [#6535] ticket:423 added regexp for project name

Posted by jo...@apache.org.
[#6535] ticket:423 added regexp for project name


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

Branch: refs/heads/cj/6422
Commit: 30da04e347f358450c3e248973d1b1ac5febfa3e
Parents: 30d4021
Author: coldmind <so...@yandex.ru>
Authored: Wed Sep 11 12:41:26 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:50 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/project.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/30da04e3/ForgeImporters/forgeimporters/github/project.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/project.py b/ForgeImporters/forgeimporters/github/project.py
index 1255933..282fdcd 100644
--- a/ForgeImporters/forgeimporters/github/project.py
+++ b/ForgeImporters/forgeimporters/github/project.py
@@ -31,10 +31,10 @@ from . import tasks
 log = logging.getLogger(__name__)
 
 class GitHubProjectForm(base.ProjectImportForm):
-    project_name = fev.Regex(r'^[a-z0-9][a-z0-9-]{,61}$',
+    project_name = fev.Regex(r'^[a-z0-9][a-z0-9-_.]{,61}$',
             not_empty=True,
             messages={
-                'invalid': 'Please use only letters, numbers, and dashes.',
+                'invalid': 'Valid symbols are: letters, numbers, dashes underscores, periods',
             })
 
 class GitHubProjectImporter(base.ProjectImporter):


[33/50] git commit: [#6535] add apache header to new file

Posted by jo...@apache.org.
[#6535] add apache header to new file


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

Branch: refs/heads/cj/6422
Commit: 1f712d510808a42f63e0d7a42206bce78d4cc533
Parents: 871731e
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Thu Sep 19 16:20:16 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 16:20:16 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1f712d51/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index e441516..60543cc 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -1,3 +1,20 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+
 import re
 from datetime import datetime
 


[28/50] git commit: [#6535] ticket:424 Import events

Posted by jo...@apache.org.
[#6535] ticket:424 Import events


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

Branch: refs/heads/cj/6422
Commit: ae6b9e1f0811a0f21541cb1fd6d093c66f9b793c
Parents: 2c831e3
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 14:54:34 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:51 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 30 ++++++++++++++
 .../forgeimporters/tests/github/test_tracker.py | 41 +++++++++++++++++++-
 2 files changed, 70 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ae6b9e1f/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 36014be..6c7cf73 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -105,6 +105,7 @@ class GitHubTrackerImporter(ToolImporter):
                         ticket_num=ticket_num)
                     self.process_fields(ticket, issue)
                     self.process_comments(extractor, ticket, issue)
+                    self.process_events(extractor, ticket, issue)
                     self.process_milestones(ticket, issue)
                     session(ticket).flush(ticket)
                     session(ticket).expunge(ticket)
@@ -117,6 +118,12 @@ class GitHubTrackerImporter(ToolImporter):
         finally:
             M.session.artifact_orm_session._get().skip_mod_date = False
 
+    def parse_datetime(self, datetime_string):
+        return datetime.strptime(datetime_string, '%Y-%m-%dT%H:%M:%SZ')
+
+    def get_user_link(self, user):
+        return u'[{0}](https://github.com/{0})'.format(user)
+
     def process_fields(self, ticket, issue):
         ticket.summary = issue['title']
         ticket.status = issue['state']
@@ -155,6 +162,29 @@ class GitHubTrackerImporter(ToolImporter):
                 )
             p.add_multiple_attachments(attachments)
 
+    def process_events(self, extractor, ticket, issue):
+        for event in extractor.iter_events(issue):
+            prefix = text = ''
+            if event['event'] in ('reopened', 'closed'):
+                prefix = '*Ticket changed by: {}*\n\n'.format(
+                        self.get_user_link(event['actor']['login']))
+            if event['event'] == 'reopened':
+                text = '- **status**: closed --> open'
+            elif event['event'] == 'closed':
+                text = '- **status**: open --> closed'
+            elif event['event'] == 'assigned':
+                text = '- **assigned_to**: {}'.format(
+                        self.get_user_link(event['actor']['login']))
+
+            text = prefix + text
+            if not text:
+                continue
+            ticket.discussion_thread.add_post(
+                text = text,
+                ignore_security = True,
+                timestamp = self.parse_datetime(event['created_at'])
+            )
+
     def process_milestones(self, ticket, issue):
         if issue['milestone']:
             title = issue['milestone']['title']

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/ae6b9e1f/ForgeImporters/forgeimporters/tests/github/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_tracker.py b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
index 9059a99..1376e55 100644
--- a/ForgeImporters/forgeimporters/tests/github/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
@@ -130,4 +130,43 @@ class TestTrackerImporter(TestCase):
                 text='*Originally posted by: [me](https://github.com/me)*\nhello',
                 timestamp=datetime(2013, 8, 26, 16, 57, 53),
                 ignore_security=True,
-            ))
\ No newline at end of file
+            ))
+
+    def test_process_events(self):
+        ticket = mock.Mock()
+        extractor = mock.Mock()
+        issue = {'events_url': '/events'}
+        extractor.iter_events.return_value = [
+            {
+                'actor': {'login': 'darth'},
+                'created_at': '2013-09-12T09:58:49Z',
+                'event': 'closed',
+            },
+            {
+                'actor': {'login': 'yoda'},
+                'created_at': '2013-09-12T10:13:20Z',
+                'event': 'reopened',
+            },
+            {
+                'actor': {'login': 'luke'},
+                'created_at': '2013-09-12T10:14:00Z',
+                'event': 'assigned',
+            },
+        ]
+        importer = tracker.GitHubTrackerImporter()
+        importer.process_events(extractor, ticket, issue)
+        args = ticket.discussion_thread.add_post.call_args_list
+        self.assertEqual(args[0], mock.call(
+            text='*Ticket changed by: [darth](https://github.com/darth)*\n\n'
+                 '- **status**: open --> closed',
+            timestamp=datetime(2013, 9, 12, 9, 58, 49),
+            ignore_security=True))
+        self.assertEqual(args[1], mock.call(
+            text='*Ticket changed by: [yoda](https://github.com/yoda)*\n\n'
+                 '- **status**: closed --> open',
+            timestamp=datetime(2013, 9, 12, 10, 13, 20),
+            ignore_security=True))
+        self.assertEqual(args[2], mock.call(
+            text='- **assigned_to**: [luke](https://github.com/luke)',
+            timestamp=datetime(2013, 9, 12, 10, 14, 0),
+            ignore_security=True))


[37/50] git commit: [#5822] add generic task for installing an app

Posted by jo...@apache.org.
[#5822] add generic task for installing an app


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

Branch: refs/heads/cj/6422
Commit: 9f8788007445a2016454a4629864dbe065e60041
Parents: a897dc7
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Tue Sep 17 17:58:30 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Sep 23 16:27:12 2013 +0000

----------------------------------------------------------------------
 Allura/allura/tasks/admin_tasks.py | 37 +++++++++++++++++++++++++++++++++
 Allura/allura/tests/test_tasks.py  |  8 ++++++-
 Allura/docs/administration.rst     | 11 +++++++++-
 Allura/docs/api/tasks.rst          | 30 ++++++++++++++++++++++++++
 4 files changed, 84 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9f878800/Allura/allura/tasks/admin_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tasks/admin_tasks.py b/Allura/allura/tasks/admin_tasks.py
new file mode 100644
index 0000000..e8b67c0
--- /dev/null
+++ b/Allura/allura/tasks/admin_tasks.py
@@ -0,0 +1,37 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+
+import inspect
+
+from pylons import tmpl_context as c
+
+from allura import model as M
+from allura.lib.decorators import task
+
+
+@task
+def install_app(*args, **kwargs):
+    '''
+    Install an application directly onto c.project, bypassing the UI and any app
+    constraints like installable=False
+    '''
+    c.project.install_app(*args, **kwargs)
+
+install_app.__doc__ += '''
+    Arguments: ''' + inspect.formatargspec(*inspect.getargspec(
+        M.Project.install_app
+    )).replace('self, ','')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9f878800/Allura/allura/tests/test_tasks.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_tasks.py b/Allura/allura/tests/test_tasks.py
index af7898e..dcbde71 100644
--- a/Allura/allura/tests/test_tasks.py
+++ b/Allura/allura/tests/test_tasks.py
@@ -47,6 +47,7 @@ from allura.tasks import mail_tasks
 from allura.tasks import notification_tasks
 from allura.tasks import repo_tasks
 from allura.tasks import export_tasks
+from allura.tasks import admin_tasks
 from allura.tests import decorators as td
 from allura.lib.decorators import event_handler, task
 
@@ -372,7 +373,7 @@ class TestExportTasks(unittest.TestCase):
         project_json.assert_called_once()
         temp = '/tmp/bulk_export/p/test/test'
         zipfn = '/tmp/bulk_export/p/test/test.zip'
-        zipdir.assert_caled_with(temp, temp + '/test.zip')
+        zipdir.assert_called_with(temp, zipfn)
         shutil.rmtree.assert_called_once_with(temp)
         # check notification
         M.MonQTask.run_ready()
@@ -410,4 +411,9 @@ class TestExportTasks(unittest.TestCase):
         assert_equal(c.project.bulk_export_status(), 'busy')
 
 
+class TestAdminTasks(unittest.TestCase):
+
+    def test_install_app_docstring(self):
+        assert_in('ep_name, mount_point=None', admin_tasks.install_app.__doc__)
+
 Mapper.compile_all()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9f878800/Allura/docs/administration.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/administration.rst b/Allura/docs/administration.rst
index b58339f..3874179 100644
--- a/Allura/docs/administration.rst
+++ b/Allura/docs/administration.rst
@@ -49,8 +49,17 @@ Scripts are in the `scripts/` directory and run via `paster script`.  An extra
 
     (env-allura) Allura$ paster script development.ini ../scripts/create-allura-sitemap.py -- -u 100
 
+TODO:   explain important scripts, commands
 
-TODO: explain how to run tasks, explain important scripts, commands and tasks here
+Tasks can be run via the web interface at /nf/admin/task_manager  You must know
+the full task name, e.g. `allura.tasks.admin_tasks.install_app`  You can
+optionally provide a username and project and app which will get set on the
+current context (`c`).  You should specify what args and kwargs will be passed
+as parameters to the task.  They are specified in JSON format on the form.
+
+See the listing of :mod:`some available tasks <allura.tasks.admin_tasks>`.
+
+TODO: explain how to run scripttasks and commandtasks
 
 
 Client Scripts

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9f878800/Allura/docs/api/tasks.rst
----------------------------------------------------------------------
diff --git a/Allura/docs/api/tasks.rst b/Allura/docs/api/tasks.rst
new file mode 100644
index 0000000..d49b8af
--- /dev/null
+++ b/Allura/docs/api/tasks.rst
@@ -0,0 +1,30 @@
+..     Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+
+.. _tasks_module:
+
+:mod:`allura.tasks`
+--------------------------------
+
+.. automodule:: allura.tasks
+
+  .. automodule:: allura.tasks.admin_tasks
+        :members:
+
+  .. automodule:: allura.tasks.export_tasks
+
+        .. autofunction:: allura.tasks.export_tasks.bulk_export


[43/50] git commit: [#6661] Fixed mismatch between REST API and bulk export for discussion

Posted by jo...@apache.org.
[#6661] Fixed mismatch between REST API and bulk export for discussion

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/343fc17a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/343fc17a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/343fc17a

Branch: refs/heads/cj/6422
Commit: 343fc17a0b58ded568ea5f3de0841f3959cd8d7d
Parents: d22e798
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Mon Sep 23 21:44:25 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 15:36:57 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/discuss.py                      |  6 ++----
 ForgeDiscussion/forgediscussion/controllers/root.py | 16 +++++++---------
 .../forgediscussion/tests/functional/test_rest.py   |  3 ++-
 3 files changed, 11 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/343fc17a/Allura/allura/model/discuss.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/discuss.py b/Allura/allura/model/discuss.py
index 6df982f..7f17063 100644
--- a/Allura/allura/model/discuss.py
+++ b/Allura/allura/model/discuss.py
@@ -159,7 +159,7 @@ class Thread(Artifact, ActivityObject):
     first_post = RelationProperty('Post', via='first_post_id')
     ref = RelationProperty('ArtifactReference')
 
-    def __json__(self):
+    def __json__(self, limit=None, page=None):
         return dict(
             _id=self._id,
             discussion_id=str(self.discussion_id),
@@ -171,9 +171,7 @@ class Thread(Artifact, ActivityObject):
                         timestamp=p.timestamp,
                         attachments=[dict(bytes=attach.length,
                                           url=h.absurl(attach.url())) for attach in p.attachments])
-                   for p in self.post_class().query.find(
-                       dict(discussion_id=self.discussion_id, thread_id=self._id, status='ok')
-                   )
+                   for p in self.query_posts(status='ok', style='chronological', limit=limit, page=page)
                 ]
         )
 

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/343fc17a/ForgeDiscussion/forgediscussion/controllers/root.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/controllers/root.py b/ForgeDiscussion/forgediscussion/controllers/root.py
index aa1130e..ff74d63 100644
--- a/ForgeDiscussion/forgediscussion/controllers/root.py
+++ b/ForgeDiscussion/forgediscussion/controllers/root.py
@@ -23,7 +23,7 @@ import calendar
 from collections import OrderedDict
 
 
-from tg import expose, validate, redirect, flash, response
+from tg import expose, validate, redirect, flash, response, jsonify
 from tg.decorators import with_trailing_slash, without_trailing_slash
 from pylons import tmpl_context as c, app_globals as g
 from pylons import request
@@ -416,11 +416,9 @@ class ForumTopicRestController(BaseController):
     @expose('json:')
     def index(self, limit=100, page=0, **kw):
         limit, page, start = g.handle_paging(int(limit), int(page))
-        posts = self.topic.query_posts(page=page, limit=limit, style='', status='ok')
-        json = {}
-        json['topic'] = self.topic.__json__()
-        json['count'] = posts.count()
-        json['page'] = page
-        json['limit'] = limit
-        json['topic']['posts'] = posts.all()
-        return json
+        json_data = {}
+        json_data['topic'] = self.topic.__json__(limit=limit, page=page)
+        json_data['count'] = self.topic.query_posts(status='ok').count()
+        json_data['page'] = page
+        json_data['limit'] = limit
+        return json_data

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/343fc17a/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py
----------------------------------------------------------------------
diff --git a/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py b/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py
index d9f0c39..d78a7fb 100644
--- a/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py
+++ b/ForgeDiscussion/forgediscussion/tests/functional/test_rest.py
@@ -17,7 +17,7 @@
 #       specific language governing permissions and limitations
 #       under the License.
 
-from nose.tools import assert_equal
+from nose.tools import assert_equal, assert_in
 
 from allura.lib import helpers as h
 from allura.tests import decorators as td
@@ -134,6 +134,7 @@ class TestRootRestController(TestDiscussionApiBase):
         assert_equal(topic['subject'], 'Hi guys')
         assert_equal(topic['posts'][0]['text'], 'Hi boys and girls')
         assert_equal(topic['posts'][0]['subject'], 'Hi guys')
+        assert_in('timestamp', topic['posts'][0])
 
     def test_forum_list_pagination(self):
         resp = self.app.get('/rest/p/test/discussion/?limit=1')


[09/50] git commit: [#6608] fix test which didn't get [cd1be4] changes

Posted by jo...@apache.org.
[#6608] fix test which didn't get [cd1be4] changes


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

Branch: refs/heads/cj/6422
Commit: 8c07c39de68678c208ccc5fce749f51fd1491efd
Parents: a3ba16a
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Sep 18 21:58:52 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed Sep 18 21:58:52 2013 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/tests/functional/test_import.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/8c07c39d/ForgeTracker/forgetracker/tests/functional/test_import.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tests/functional/test_import.py b/ForgeTracker/forgetracker/tests/functional/test_import.py
index 5b1f5a3..c8ae9e4 100644
--- a/ForgeTracker/forgetracker/tests/functional/test_import.py
+++ b/ForgeTracker/forgetracker/tests/functional/test_import.py
@@ -177,7 +177,7 @@ class TestImportController(TestRestApiBase):
 
         """
         here_dir = os.path.dirname(__file__)
-        api_ticket = M.ApiTicket(user_id=self.user._id, capabilities={'import': ['Projects','test']},
+        api_ticket = M.ApiTicket(user_id=c.user._id, capabilities={'import': ['Projects','test']},
                                  expires=datetime.utcnow() + timedelta(days=1))
         ming.orm.session(api_ticket).flush()
         self.set_api_token(api_ticket)


[25/50] git commit: [#6535] ticket:425 Import tracker into existing project

Posted by jo...@apache.org.
[#6535] ticket:425 Import tracker into existing project


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

Branch: refs/heads/cj/6422
Commit: a2833b3ba8a4eb27cd13b29ac7672cbb1822d855
Parents: aefd7c9
Author: Igor Bondarenko <je...@gmail.com>
Authored: Mon Sep 16 15:37:50 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:51 2013 +0000

----------------------------------------------------------------------
 .../github/templates/tracker/index.html         | 36 ++++++++++++
 .../forgeimporters/github/tests/test_tracker.py | 54 ++++++++++++++++++
 ForgeImporters/forgeimporters/github/tracker.py | 58 +++++++++++++++++++-
 3 files changed, 147 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a2833b3b/ForgeImporters/forgeimporters/github/templates/tracker/index.html
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/templates/tracker/index.html b/ForgeImporters/forgeimporters/github/templates/tracker/index.html
new file mode 100644
index 0000000..6536628
--- /dev/null
+++ b/ForgeImporters/forgeimporters/github/templates/tracker/index.html
@@ -0,0 +1,36 @@
+{#-
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+-#}
+{% extends 'forgeimporters:templates/importer_base.html' %}
+
+{% block title %}
+{{c.project.name}} / Import your tickets from GitHub
+{% endblock %}
+
+{% block importer_fields %}
+<div>
+  <label for="gh_user_name">GitHub User Name</label>
+  <input name="gh_user_name" value="{{ c.form_values['gh_user_name'] }}" />
+  {{ error('gh_user_name') }}
+</div>
+<div>
+  <label for="gh_project_name">GitHub Project Name</label>
+  <input name="gh_project_name" value="{{ c.form_values['gh_project_name'] }}" />
+  {{ error('gh_project_name') }}
+</div>
+{% endblock %}

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a2833b3b/ForgeImporters/forgeimporters/github/tests/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tests/test_tracker.py b/ForgeImporters/forgeimporters/github/tests/test_tracker.py
new file mode 100644
index 0000000..ed20581
--- /dev/null
+++ b/ForgeImporters/forgeimporters/github/tests/test_tracker.py
@@ -0,0 +1,54 @@
+#       Licensed to the Apache Software Foundation (ASF) under one
+#       or more contributor license agreements.  See the NOTICE file
+#       distributed with this work for additional information
+#       regarding copyright ownership.  The ASF licenses this file
+#       to you under the Apache License, Version 2.0 (the
+#       "License"); you may not use this file except in compliance
+#       with the License.  You may obtain a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+#       Unless required by applicable law or agreed to in writing,
+#       software distributed under the License is distributed on an
+#       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#       KIND, either express or implied.  See the License for the
+#       specific language governing permissions and limitations
+#       under the License.
+
+from unittest import TestCase
+from mock import patch
+
+from allura.tests import TestController
+from allura.tests.decorators import with_tool
+
+# important to be distinct from 'test' which ForgeTracker uses, so that the tests can run in parallel and not clobber each other
+test_project_with_tracker = 'test2'
+with_tracker = with_tool(test_project_with_tracker, 'tickets', 'spooky-issues', 'tickets')
+
+
+class TestGitHubTrackerImportController(TestController, TestCase):
+
+    url = '/p/%s/admin/ext/import/github-tracker/' % test_project_with_tracker
+
+    @with_tracker
+    def test_index(self):
+        r = self.app.get(self.url)
+        self.assertIsNotNone(r.html.find(attrs=dict(name='gh_user_name')))
+        self.assertIsNotNone(r.html.find(attrs=dict(name='gh_project_name')))
+        self.assertIsNotNone(r.html.find(attrs=dict(name='mount_label')))
+        self.assertIsNotNone(r.html.find(attrs=dict(name='mount_point')))
+
+    @with_tracker
+    @patch('forgeimporters.github.tracker.import_tool')
+    def test_create(self, import_tool):
+        params = dict(
+            gh_user_name='spooky',
+            gh_project_name='mulder',
+            mount_point='issues',
+            mount_label='Issues')
+        r = self.app.post(self.url + 'create', params, status=302)
+        self.assertEqual(r.location, 'http://localhost/p/%s/admin/' % test_project_with_tracker)
+        self.assertEqual(u'Issues', import_tool.post.call_args[1]['mount_label'])
+        self.assertEqual(u'issues', import_tool.post.call_args[1]['mount_point'])
+        self.assertEqual(u'mulder', import_tool.post.call_args[1]['project_name'])
+        self.assertEqual(u'spooky', import_tool.post.call_args[1]['user_name'])

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a2833b3b/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index ec9729f..20ba465 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -6,8 +6,22 @@ try:
 except ImportError:
     from StringIO import StringIO
 
+from formencode import validators as fev
+from tg import (
+        expose,
+        validate,
+        flash,
+        redirect
+        )
+from tg.decorators import (
+        with_trailing_slash,
+        without_trailing_slash
+        )
+
 from allura import model as M
+from allura.controllers import BaseController
 from allura.lib import helpers as h
+from allura.lib.decorators import require_post, task
 from ming.orm import session, ThreadLocalORMSession
 from pylons import tmpl_context as c
 from pylons import app_globals as g
@@ -16,13 +30,55 @@ from . import GitHubProjectExtractor
 from ..base import ToolImporter
 from forgetracker.tracker_main import ForgeTrackerApp
 from forgetracker import model as TM
+from forgeimporters.base import ToolImportForm, ImportErrorHandler
+
+
+@task(notifications_disabled=True)
+def import_tool(**kw):
+    importer = GitHubTrackerImporter()
+    with ImportErrorHandler(importer, kw.get('project_name')):
+        importer.import_tool(c.project, c.user, **kw)
+
 
+class GitHubTrackerImportForm(ToolImportForm):
+    gh_project_name = fev.UnicodeString(not_empty=True)
+    gh_user_name = fev.UnicodeString(not_empty=True)
+
+
+class GitHubTrackerImportController(BaseController):
+
+    def __init__(self):
+        self.importer = GitHubTrackerImporter()
+
+    @property
+    def target_app(self):
+        return self.importer.target_app
+
+    @with_trailing_slash
+    @expose('jinja:forgeimporters.github:templates/tracker/index.html')
+    def index(self, **kw):
+        return dict(importer=self.importer,
+                    target_app=self.target_app)
+
+    @without_trailing_slash
+    @expose()
+    @require_post()
+    @validate(GitHubTrackerImportForm(ForgeTrackerApp), error_handler=index)
+    def create(self, gh_project_name, gh_user_name, mount_point, mount_label, **kw):
+        import_tool.post(
+                project_name=gh_project_name,
+                user_name=gh_user_name,
+                mount_point=mount_point,
+                mount_label=mount_label)
+        flash('Ticket import has begun. Your new tracker will be available '
+                'when the import is complete.')
+        redirect(c.project.url() + 'admin/')
 
 
 class GitHubTrackerImporter(ToolImporter):
     source = 'GitHub'
     target_app = ForgeTrackerApp
-    controller = None
+    controller = GitHubTrackerImportController
     tool_label = 'Issues'
     max_ticket_num = 0
     open_milestones = set()


[19/50] git commit: [#6535] ticket:317 github comments import

Posted by jo...@apache.org.
[#6535] ticket:317 github comments import

Conflicts:
	ForgeImporters/forgeimporters/github/__init__.py


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

Branch: refs/heads/cj/6422
Commit: b766bdd0712b5d511f8aeb90afa8cfffcd5c1a21
Parents: fd9404a
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Tue Aug 27 15:41:19 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:50 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/__init__.py |  6 ++++++
 ForgeImporters/forgeimporters/github/tracker.py  | 15 +++++++++------
 2 files changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b766bdd0/ForgeImporters/forgeimporters/github/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/__init__.py b/ForgeImporters/forgeimporters/github/__init__.py
index 13d32e4..438fc8a 100644
--- a/ForgeImporters/forgeimporters/github/__init__.py
+++ b/ForgeImporters/forgeimporters/github/__init__.py
@@ -56,3 +56,9 @@ class GitHubProjectExtractor(base.ProjectExtractor):
         issues.sort(key=lambda x: x['number'])
         for issue in issues:
             yield (issue['number'], issue)
+
+    def iter_comments(self, issue):
+        comments_url = issue['comments_url']
+        comments = self.get_page(comments_url)
+        for comment in comments:
+            yield comment

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b766bdd0/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index af5363d..3266cc8 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -47,7 +47,7 @@ class GitHubTrackerImporter(ToolImporter):
                         custom_fields=dict(),
                         ticket_num=ticket_num)
                     self.process_fields(ticket, issue)
-                    #self.process_comments(ticket, issue)
+                    self.process_comments(extractor, ticket, issue)
                     session(ticket).flush(ticket)
                     session(ticket).expunge(ticket)
                 #app.globals.custom_fields = self.get_milestones()
@@ -82,14 +82,17 @@ class GitHubTrackerImporter(ToolImporter):
                 )
         ticket.labels = [label['name'] for label in issue['labels']]
 
-    def process_comments(self, ticket, issue):
-        for comment in issue.iter_comments():
+    def process_comments(self, extractor, ticket, issue):
+        for comment in extractor.iter_comments(issue):
+            body, attachments = self._get_attachments(comment['body'])
+            if comment['user']:
+                body += u'\n*Originally posted by: {}*'.format(comment['user']['login'])
             p = ticket.discussion_thread.add_post(
-                    text = comment.annotated_text,
+                    text = body,
                     ignore_security = True,
-                    timestamp = datetime.strptime(comment.created_date, '%c'),
+                    timestamp = datetime.strptime(comment['created_at'], '%Y-%m-%dT%H:%M:%SZ'),
                 )
-            p.add_multiple_attachments(comment.attachments)
+            p.add_multiple_attachments(attachments)
 
     def get_milestones(self):
         custom_fields = []


[49/50] git commit: [#6422] Added LICENSE file for Blueprint and pointer in base LICENSE

Posted by jo...@apache.org.
[#6422] Added LICENSE file for Blueprint and pointer in base LICENSE

License file obtained from:
https://raw.github.com/joshuaclayton/blueprint-css/master/LICENSE

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/d858204e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/d858204e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/d858204e

Branch: refs/heads/cj/6422
Commit: d858204e64f5e6f3102ec9e24a906e5e783345e0
Parents: 4682f14
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Sep 17 20:54:31 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Sep 24 17:07:14 2013 +0000

----------------------------------------------------------------------
 Allura/allura/public/nf/css/blueprint/LICENSE | 22 ++++++++++++++++++++++
 LICENSE                                       | 12 ++++++++++++
 2 files changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d858204e/Allura/allura/public/nf/css/blueprint/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/css/blueprint/LICENSE b/Allura/allura/public/nf/css/blueprint/LICENSE
new file mode 100644
index 0000000..13076fb
--- /dev/null
+++ b/Allura/allura/public/nf/css/blueprint/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2007 - 2010 blueprintcss.org
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d858204e/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index d645695..5202aaa 100644
--- a/LICENSE
+++ b/LICENSE
@@ -200,3 +200,15 @@
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
+
+
+ALLURA SUBCOMPONENTS:
+
+Apache Allura includes a number of subcomponents with separate copyright
+notices and license terms. Your use of the source code for the these
+subcomponents is subject to the terms and conditions of the following
+licenses.
+
+
+Blueprint, which is available under the MIT license.
+For details, see Allura/allura/public/nf/css/blueprint/.


[46/50] git commit: [#6422] Bubbled up LICENSE items from Allura/LICENSE and condensed to pointers

Posted by jo...@apache.org.
[#6422] Bubbled up LICENSE items from Allura/LICENSE and condensed to pointers

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/87e2f463
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/87e2f463
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/87e2f463

Branch: refs/heads/cj/6422
Commit: 87e2f4636309784d76252c63453effa1dbb141e0
Parents: d858204
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Sep 17 21:25:48 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Sep 24 17:07:14 2013 +0000

----------------------------------------------------------------------
 Allura/LICENSE                         | 401 ++--------------------------
 Allura/allura/public/nf/js/spin.min.js |  25 +-
 LICENSE                                |  25 +-
 3 files changed, 71 insertions(+), 380 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/87e2f463/Allura/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/LICENSE b/Allura/LICENSE
index b38e207..de4eeac 100644
--- a/Allura/LICENSE
+++ b/Allura/LICENSE
@@ -208,380 +208,27 @@ separate copyright notices and license terms. Your use of the source code
 for the these subcomponents is subject to the terms and conditions of the
 following licenses.
 
-For jQueryUI, in files
-allura/lib/widgets/resources/css/autocomplete.css
-allura/lib/widgets/resources/css/jquery.ui.datepicker.css
-allura/public/nf/css/forge/accordion.css
-allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
-allura/public/nf/js/jquery-base.js
-
-   Copyright 2010 jQuery Foundation and other contributors,
-   http://jqueryui.com/
-
-   This software consists of voluntary contributions made by many
-   individuals (AUTHORS.txt, http://jqueryui.com/about) For exact
-   contribution history, see the revision history and logs, available
-   at http://jquery-ui.googlecode.com/svn/
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   "Software"), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be
-   included in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For jQuery Font selector plugin, in file
-allura/lib/widgets/resources/js/jqfontselector.js
-
-   Copyright (c) 2012 James Carmichael
-   
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the "Software"),
-   to deal in the Software without restriction, including without limitation
-   the rights to use, copy, modify, merge, publish, distribute, sublicense,
-   and/or sell copies of the Software, and to permit persons to whom the
-   Software is furnished to do so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-
-For Autosize, in file
-allura/lib/widgets/resources/js/jquery.autosize-min.js
-
-   Copyright (c) 2012 Jack Moore - jacklmoore.com
-   
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the "Software"),
-   to deal in the Software without restriction, including without limitation
-   the rights to use, copy, modify, merge, publish, distribute, sublicense,
-   and/or sell copies of the Software, and to permit persons to whom the
-   Software is furnished to do so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
-
-For Really Simple Color Picker in jQuery, in file
-allura/lib/widgets/resources/js/jquery.colorPicker.js
-
-   Copyright (c) 2008 Lakshan Perera (www.laktek.com)
-                      Daniel Lacy (daniellacy.com)
-  
-   Permission is hereby granted, free of charge, to any person obtaining a copy
-   of this software and associated documentation files (the "Software"), to
-   deal in the Software without restriction, including without limitation the
-   rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-   sell copies of the Software, and to permit persons to whom the Software is
-   furnished to do so, subject to the following conditions:
-  
-   The above copyright notice and this permission notice shall be included in
-   all copies or substantial portions of the Software.
-  
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-   IN THE SOFTWARE.
-
-For Tabby jQuery plugin, in file
-allura/lib/widgets/resources/js/jquery.textarea.js
-
-  	Copyright (c) 2009 Ted Devito
-  	 
-  	Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following 
-  	conditions are met:
-  	
-  		1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-  		2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer  
-  			in the documentation and/or other materials provided with the distribution.
-  		3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written 
-  			permission. 
-  	 
-  	THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
-  	IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE 
-  	LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 
-  	PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
-  	THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 
-  	OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-For jquery.tools, in file
-allura/lib/widgets/resources/js/jquery.tools.min.js
-
-   Copyright (c) 2009 Tero Piirainen
-   
-   Permission is hereby granted, free of charge, to any person obtaining a copy
-   of this software and associated documentation files (the "Software"), to
-   deal in the Software without restriction, including without limitation the
-   rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-   sell copies of the Software, and to permit persons to whom the Software is
-   furnished to do so, subject to the following conditions:
-  
-   The above copyright notice and this permission notice shall be included in
-   all copies or substantial portions of the Software.
-  
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
-   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-   IN THE SOFTWARE.
-
-For Blueprint CSS Framework, in directory
-allura/public/nf/css/blueprint/
-
-   Copyright (c) 2007 - 2010 blueprintcss.org
-
-   Permission is hereby granted, free of charge, to any person
-   obtaining a copy of this software and associated documentation
-   files (the "Software"), to deal in the Software without
-   restriction, including without limitation the rights to use,
-   copy, modify, merge, publish, distribute, sublicense, and/or sell
-   copies of the Software, and to permit persons to whom the
-   Software is furnished to do so, subject to the following
-   conditions:
-
-   The above copyright notice and this permission notice shall be
-   included in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-   OTHER DEALINGS IN THE SOFTWARE.
-
-For jQuery, in file
-allura/public/nf/js/jquery-base.js
-
-   Copyright 2013 jQuery Foundation and other contributors
-   http://jquery.com/
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   "Software"), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be
-   included in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For Cookie plugin, in file
-allura/public/nf/js/jquery-base.js
-
-   Copyright (c) 2006 Klaus Hartl (stilbuero.de)
-   
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   "Software"), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be
-   included in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For jQuery Tooltip plugin, in file
-allura/public/nf/js/jquery-base.js
-
-   Copyright (c) 2006 - 2008 Jörn Zaefferer
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   "Software"), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be
-   included in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For jQuery-Plugin "daterangepicker.jQuery.js", in file
-allura/public/nf/js/jquery.daterangepicker.js
-
-   The MIT License
-
-   Copyright (c) 2008, Filament Group, Inc
-
-   Permission is hereby granted, free of charge, to any person obtaining a copy
-   of this software and associated documentation files (the "Software"), to deal
-   in the Software without restriction, including without limitation the rights
-   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-   copies of the Software, and to permit persons to whom the Software is
-   furnished to do so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included in
-   all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-   THE SOFTWARE.
-
-   The end-user documentation included with the redistribution, if any, must 
-   include the following acknowledgment: "This product includes software 
-   developed by Filament Group, Inc (http://www.filamentgroup.com/) and its 
-   contributors", in the same place and form as other third-party acknowledgments. 
-   Alternately, this acknowledgment may appear in the software itself, in the same 
-   form and location as other such third-party acknowledgments.
-
-For Javascript plotting library for jQuery, in file
-allura/public/nf/js/jquery.flot.js
-
-   Copyright (c) 2007-2009 IOLA and Ole Laursen
-
-   Permission is hereby granted, free of charge, to any person
-   obtaining a copy of this software and associated documentation
-   files (the "Software"), to deal in the Software without
-   restriction, including without limitation the rights to use,
-   copy, modify, merge, publish, distribute, sublicense, and/or sell
-   copies of the Software, and to permit persons to whom the
-   Software is furnished to do so, subject to the following
-   conditions:
-
-   The above copyright notice and this permission notice shall be
-   included in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-   OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-   HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-   WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-   OTHER DEALINGS IN THE SOFTWARE.
-
-For Textarea Max Length for jQuery v1.1.0, in file
-allura/public/nf/js/jquery.maxlength.js
-
-   Copyright 2012 jQuery Foundation and other contributors
-   http://jquery.com/
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the
-   "Software"), to deal in the Software without restriction, including
-   without limitation the rights to use, copy, modify, merge, publish,
-   distribute, sublicense, and/or sell copies of the Software, and to
-   permit persons to whom the Software is furnished to do so, subject to
-   the following conditions:
-
-   The above copyright notice and this permission notice shall be
-   included in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-   NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-   LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-   OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-   WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-For spin.js, in file
-allura/public/nf/js/spin.min.js
-
-   The MIT License
-
-   Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
-
-   Permission is hereby granted, free of charge, to any person obtaining a copy
-   of this software and associated documentation files (the "Software"), to deal
-   in the Software without restriction, including without limitation the rights
-   to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-   copies of the Software, and to permit persons to whom the Software is
-   furnished to do so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included in
-   all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-   IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-   AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-   OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-   THE SOFTWARE.
-
-For Vector and Matrix mathematics modules for JavaScript, in file
-allura/public/nf/js/sylvester.js
-
-   Copyright (c) 2007 James Coglan
-
-   Permission is hereby granted, free of charge, to any person obtaining
-   a copy of this software and associated documentation files (the "Software"),
-   to deal in the Software without restriction, including without limitation
-   the rights to use, copy, modify, merge, publish, distribute, sublicense,
-   and/or sell copies of the Software, and to permit persons to whom the
-   Software is furnished to do so, subject to the following conditions:
-
-   The above copyright notice and this permission notice shall be included
-   in all copies or substantial portions of the Software.
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-   THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-   LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-   FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-   DEALINGS IN THE SOFTWARE.
+Blueprint, which is available under the MIT license.
+For details, see Allura/allura/public/nf/css/blueprint/
+
+Spin.js, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/spin.min.js
+
+Sylvester, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/sylvester.js
+
+jQuery, jQueryUI, and various related plugins, which are available
+under the MIT license.  For details, see the individual files:
+    Allura/allura/public/nf/js/jquery-base.js
+    Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
+    Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+    Allura/allura/lib/widgets/resources/css/autocomplete.css
+    Allura/allura/public/nf/css/forge/accordion.css
+    Allura/allura/lib/widgets/resources/js/jqfontselector.js
+    Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
+    Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
+    Allura/allura/lib/widgets/resources/js/jquery.textarea.js
+    Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
+    Allura/allura/public/nf/js/jquery.daterangepicker.js
+    Allura/allura/public/nf/js/jquery.flot.js
+    Allura/allura/public/nf/js/jquery.maxlength.min.js

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/87e2f463/Allura/allura/public/nf/js/spin.min.js
----------------------------------------------------------------------
diff --git a/Allura/allura/public/nf/js/spin.min.js b/Allura/allura/public/nf/js/spin.min.js
index c38b40e..21af822 100644
--- a/Allura/allura/public/nf/js/spin.min.js
+++ b/Allura/allura/public/nf/js/spin.min.js
@@ -1,2 +1,25 @@
+/*
+ * The MIT License
+ *
+ * Copyright (c) 2011 Felix Gnass [fgnass at neteye dot de]
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
 //fgnass.github.com/spin.js#v1.2.5
-(function(a,b,c){function g(a,c){var d=b.createElement(a||"div"),e;for(e in c)d[e]=c[e];return d}function h(a){for(var b=1,c=arguments.length;b<c;b++)a.appendChild(arguments[b]);return a}function j(a,b,c,d){var g=["opacity",b,~~(a*100),c,d].join("-"),h=.01+c/d*100,j=Math.max(1-(1-a)/b*(100-h),a),k=f.substring(0,f.indexOf("Animation")).toLowerCase(),l=k&&"-"+k+"-"||"";return e[g]||(i.insertRule("@"+l+"keyframes "+g+"{"+"0%{opacity:"+j+"}"+h+"%{opacity:"+a+"}"+(h+.01)+"%{opacity:1}"+(h+b)%100+"%{opacity:"+a+"}"+"100%{opacity:"+j+"}"+"}",0),e[g]=1),g}function k(a,b){var e=a.style,f,g;if(e[b]!==c)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(g=0;g<d.length;g++){f=d[g]+b;if(e[f]!==c)return f}}function l(a,b){for(var c in b)a.style[k(a,c)||c]=b[c];return a}function m(a){for(var b=1;b<arguments.length;b++){var d=arguments[b];for(var e in d)a[e]===c&&(a[e]=d[e])}return a}function n(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a=a.offsetParent)b.x+=a.offsetLeft,b.y+=a.offsetTop;return
  b}var d=["webkit","Moz","ms","O"],e={},f,i=function(){var a=g("style");return h(b.getElementsByTagName("head")[0],a),a.sheet||a.styleSheet}(),o={lines:12,length:7,width:5,radius:10,rotate:0,color:"#000",speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto"},p=function q(a){if(!this.spin)return new q(a);this.opts=m(a||{},q.defaults,o)};p.defaults={},m(p.prototype,{spin:function(a){this.stop();var b=this,c=b.opts,d=b.el=l(g(0,{className:c.className}),{position:"relative",zIndex:c.zIndex}),e=c.radius+c.length+c.width,h,i;a&&(a.insertBefore(d,a.firstChild||null),i=n(a),h=n(d),l(d,{left:(c.left=="auto"?i.x-h.x+(a.offsetWidth>>1):c.left+e)+"px",top:(c.top=="auto"?i.y-h.y+(a.offsetHeight>>1):c.top+e)+"px"})),d.setAttribute("aria-role","progressbar"),b.lines(d,b.opts);if(!f){var j=0,k=c.fps,m=k/c.speed,o=(1-c.opacity)/(m*c.trail/100),p=m/c.lines;!function q(){j++;for(var a=c.lines;a;a--){var e=Math.max(1-(j+a*p)%m*o,c.opacity);b.opacity(d,c.lines-a,e,c)
 }b.timeout=b.el&&setTimeout(q,~~(1e3/k))}()}return b},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=c),this},lines:function(a,b){function e(a,d){return l(g(),{position:"absolute",width:b.length+b.width+"px",height:b.width+"px",background:a,boxShadow:d,transformOrigin:"left",transform:"rotate("+~~(360/b.lines*c+b.rotate)+"deg) translate("+b.radius+"px"+",0)",borderRadius:(b.width>>1)+"px"})}var c=0,d;for(;c<b.lines;c++)d=l(g(),{position:"absolute",top:1+~(b.width/2)+"px",transform:b.hwaccel?"translate3d(0,0,0)":"",opacity:b.opacity,animation:f&&j(b.opacity,b.trail,c,b.lines)+" "+1/b.speed+"s linear infinite"}),b.shadow&&h(d,l(e("#000","0 0 4px #000"),{top:"2px"})),h(a,h(d,e(b.color,"0 0 1px rgba(0,0,0,.1)")));return a},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}}),!function(){function a(a,b){return g("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',b)}var b=l(
 g("group"),{behavior:"url(#default#VML)"});!k(b,"transform")&&b.adj?(i.addRule(".spin-vml","behavior:url(#default#VML)"),p.prototype.lines=function(b,c){function f(){return l(a("group",{coordsize:e+" "+e,coordorigin:-d+" "+ -d}),{width:e,height:e})}function k(b,e,g){h(i,h(l(f(),{rotation:360/c.lines*b+"deg",left:~~e}),h(l(a("roundrect",{arcsize:1}),{width:d,height:c.width,left:c.radius,top:-c.width>>1,filter:g}),a("fill",{color:c.color,opacity:c.opacity}),a("stroke",{opacity:0}))))}var d=c.length+c.width,e=2*d,g=-(c.width+c.length)*2+"px",i=l(f(),{position:"absolute",top:g,left:g}),j;if(c.shadow)for(j=1;j<=c.lines;j++)k(j,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(j=1;j<=c.lines;j++)k(j);return h(b,i)},p.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}):f=k(b,"animation")}(),a.Spinner=p})(window,docume
 nt);
\ No newline at end of file
+(function(a,b,c){function g(a,c){var d=b.createElement(a||"div"),e;for(e in c)d[e]=c[e];return d}function h(a){for(var b=1,c=arguments.length;b<c;b++)a.appendChild(arguments[b]);return a}function j(a,b,c,d){var g=["opacity",b,~~(a*100),c,d].join("-"),h=.01+c/d*100,j=Math.max(1-(1-a)/b*(100-h),a),k=f.substring(0,f.indexOf("Animation")).toLowerCase(),l=k&&"-"+k+"-"||"";return e[g]||(i.insertRule("@"+l+"keyframes "+g+"{"+"0%{opacity:"+j+"}"+h+"%{opacity:"+a+"}"+(h+.01)+"%{opacity:1}"+(h+b)%100+"%{opacity:"+a+"}"+"100%{opacity:"+j+"}"+"}",0),e[g]=1),g}function k(a,b){var e=a.style,f,g;if(e[b]!==c)return b;b=b.charAt(0).toUpperCase()+b.slice(1);for(g=0;g<d.length;g++){f=d[g]+b;if(e[f]!==c)return f}}function l(a,b){for(var c in b)a.style[k(a,c)||c]=b[c];return a}function m(a){for(var b=1;b<arguments.length;b++){var d=arguments[b];for(var e in d)a[e]===c&&(a[e]=d[e])}return a}function n(a){var b={x:a.offsetLeft,y:a.offsetTop};while(a=a.offsetParent)b.x+=a.offsetLeft,b.y+=a.offsetTop;return
  b}var d=["webkit","Moz","ms","O"],e={},f,i=function(){var a=g("style");return h(b.getElementsByTagName("head")[0],a),a.sheet||a.styleSheet}(),o={lines:12,length:7,width:5,radius:10,rotate:0,color:"#000",speed:1,trail:100,opacity:.25,fps:20,zIndex:2e9,className:"spinner",top:"auto",left:"auto"},p=function q(a){if(!this.spin)return new q(a);this.opts=m(a||{},q.defaults,o)};p.defaults={},m(p.prototype,{spin:function(a){this.stop();var b=this,c=b.opts,d=b.el=l(g(0,{className:c.className}),{position:"relative",zIndex:c.zIndex}),e=c.radius+c.length+c.width,h,i;a&&(a.insertBefore(d,a.firstChild||null),i=n(a),h=n(d),l(d,{left:(c.left=="auto"?i.x-h.x+(a.offsetWidth>>1):c.left+e)+"px",top:(c.top=="auto"?i.y-h.y+(a.offsetHeight>>1):c.top+e)+"px"})),d.setAttribute("aria-role","progressbar"),b.lines(d,b.opts);if(!f){var j=0,k=c.fps,m=k/c.speed,o=(1-c.opacity)/(m*c.trail/100),p=m/c.lines;!function q(){j++;for(var a=c.lines;a;a--){var e=Math.max(1-(j+a*p)%m*o,c.opacity);b.opacity(d,c.lines-a,e,c)
 }b.timeout=b.el&&setTimeout(q,~~(1e3/k))}()}return b},stop:function(){var a=this.el;return a&&(clearTimeout(this.timeout),a.parentNode&&a.parentNode.removeChild(a),this.el=c),this},lines:function(a,b){function e(a,d){return l(g(),{position:"absolute",width:b.length+b.width+"px",height:b.width+"px",background:a,boxShadow:d,transformOrigin:"left",transform:"rotate("+~~(360/b.lines*c+b.rotate)+"deg) translate("+b.radius+"px"+",0)",borderRadius:(b.width>>1)+"px"})}var c=0,d;for(;c<b.lines;c++)d=l(g(),{position:"absolute",top:1+~(b.width/2)+"px",transform:b.hwaccel?"translate3d(0,0,0)":"",opacity:b.opacity,animation:f&&j(b.opacity,b.trail,c,b.lines)+" "+1/b.speed+"s linear infinite"}),b.shadow&&h(d,l(e("#000","0 0 4px #000"),{top:"2px"})),h(a,h(d,e(b.color,"0 0 1px rgba(0,0,0,.1)")));return a},opacity:function(a,b,c){b<a.childNodes.length&&(a.childNodes[b].style.opacity=c)}}),!function(){function a(a,b){return g("<"+a+' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">',b)}var b=l(
 g("group"),{behavior:"url(#default#VML)"});!k(b,"transform")&&b.adj?(i.addRule(".spin-vml","behavior:url(#default#VML)"),p.prototype.lines=function(b,c){function f(){return l(a("group",{coordsize:e+" "+e,coordorigin:-d+" "+ -d}),{width:e,height:e})}function k(b,e,g){h(i,h(l(f(),{rotation:360/c.lines*b+"deg",left:~~e}),h(l(a("roundrect",{arcsize:1}),{width:d,height:c.width,left:c.radius,top:-c.width>>1,filter:g}),a("fill",{color:c.color,opacity:c.opacity}),a("stroke",{opacity:0}))))}var d=c.length+c.width,e=2*d,g=-(c.width+c.length)*2+"px",i=l(f(),{position:"absolute",top:g,left:g}),j;if(c.shadow)for(j=1;j<=c.lines;j++)k(j,-2,"progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)");for(j=1;j<=c.lines;j++)k(j);return h(b,i)},p.prototype.opacity=function(a,b,c,d){var e=a.firstChild;d=d.shadow&&d.lines||0,e&&b+d<e.childNodes.length&&(e=e.childNodes[b+d],e=e&&e.firstChild,e=e&&e.firstChild,e&&(e.opacity=c))}):f=k(b,"animation")}(),a.Spinner=p})(window,docume
 nt);

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/87e2f463/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 5202aaa..b7967a4 100644
--- a/LICENSE
+++ b/LICENSE
@@ -209,6 +209,27 @@ notices and license terms. Your use of the source code for the these
 subcomponents is subject to the terms and conditions of the following
 licenses.
 
-
 Blueprint, which is available under the MIT license.
-For details, see Allura/allura/public/nf/css/blueprint/.
+For details, see Allura/allura/public/nf/css/blueprint/
+
+Spin.js, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/spin.min.js
+
+Sylvester, which is available under the MIT license.
+For details, see Allura/allura/public/nf/js/sylvester.js
+
+jQuery, jQueryUI, and various related plugins, which are available
+under the MIT license.  For details, see the individual files:
+    Allura/allura/public/nf/js/jquery-base.js
+    Allura/allura/public/nf/css/smoothness/jquery-ui-1.8.4.custom.css
+    Allura/allura/lib/widgets/resources/css/jquery.ui.datepicker.css
+    Allura/allura/lib/widgets/resources/css/autocomplete.css
+    Allura/allura/public/nf/css/forge/accordion.css
+    Allura/allura/lib/widgets/resources/js/jqfontselector.js
+    Allura/allura/lib/widgets/resources/js/jquery.autosize-min.js
+    Allura/allura/lib/widgets/resources/js/jquery.colorPicker.js
+    Allura/allura/lib/widgets/resources/js/jquery.textarea.js
+    Allura/allura/lib/widgets/resources/js/jquery.tools.min.js
+    Allura/allura/public/nf/js/jquery.daterangepicker.js
+    Allura/allura/public/nf/js/jquery.flot.js
+    Allura/allura/public/nf/js/jquery.maxlength.min.js


[17/50] git commit: [#6535] ticket:423 fixed user link

Posted by jo...@apache.org.
[#6535] ticket:423 fixed user link


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

Branch: refs/heads/cj/6422
Commit: 51b90429bd3283b0049f9a9ad4029549a5a73ea1
Parents: 30da04e
Author: coldmind <so...@yandex.ru>
Authored: Wed Sep 11 14:07:23 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:50 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/51b90429/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index fea18ed..01a08e4 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -30,9 +30,9 @@ class GitHubTrackerImporter(ToolImporter):
     def import_tool(self, project, user, project_name, mount_point=None,
             mount_label=None, **kw):
         app = project.install_app('tickets', mount_point, mount_label,
-                EnableVoting=True,
-                open_status_names='New Accepted Started',
-                closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
+                EnableVoting=False,
+                open_status_names='Open',
+                closed_status_names='Closed',
             )
         ThreadLocalORMSession.flush_all()
         extractor = GitHubProjectExtractor(
@@ -88,7 +88,10 @@ class GitHubTrackerImporter(ToolImporter):
         for comment in extractor.iter_comments(issue):
             body, attachments = self._get_attachments(comment['body'])
             if comment['user']:
-                body += u'\n*Originally posted by: {}*'.format(comment['user']['login'])
+                posted_by = u'*Originally posted by: [{0}](https://github.com/{0})*\n'.format(
+                    comment['user']['login'])
+                posted_by += body
+                body = posted_by
             p = ticket.discussion_thread.add_post(
                     text = body,
                     ignore_security = True,


[16/50] git commit: [#6535] ticket:423 added exception handling

Posted by jo...@apache.org.
[#6535] ticket:423 added exception handling


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

Branch: refs/heads/cj/6422
Commit: da98a8048132b8203058e6545cbe165d72977fac
Parents: 51b9042
Author: coldmind <so...@yandex.ru>
Authored: Wed Sep 11 16:08:12 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:50 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/da98a804/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 01a08e4..ec9729f 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -132,7 +132,12 @@ class GitHubTrackerImporter(ToolImporter):
         REGEXP = r'!\[[\w0-9]+?\]\(((?:https?:\/\/)?[\da-z\.-]+\.[a-z\.]{2,6}'\
             '(?:[\/\w\.-]+)*.(jpg|jpeg|png|gif))\)\r\n'
         attachments = []
-        found_matches = re.finditer(REGEXP, body, re.IGNORECASE)
+
+        try:
+            found_matches = re.finditer(REGEXP, body, re.IGNORECASE)
+        except TypeError:
+            found_matches = re.finditer(REGEXP, str(body), re.IGNORECASE)
+
         for i, match in enumerate(found_matches):
             # removing attach text from comment
             body = body.replace(match.group(0), '')


[50/50] git commit: [#6422] Added missed 3rd-party lib to LICENSE and changed verbiage

Posted by jo...@apache.org.
[#6422] Added missed 3rd-party lib to LICENSE and changed verbiage

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/4366a308
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4366a308
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4366a308

Branch: refs/heads/cj/6422
Commit: 4366a3083bbc822e7924e26416cb8abc1e2d3167
Parents: 80c4520
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Wed Sep 18 19:30:24 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Sep 24 17:07:14 2013 +0000

----------------------------------------------------------------------
 Allura/LICENSE |  4 ++++
 LICENSE        | 14 +++++++++-----
 2 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4366a308/Allura/LICENSE
----------------------------------------------------------------------
diff --git a/Allura/LICENSE b/Allura/LICENSE
index 973fd44..ffb5ecb 100644
--- a/Allura/LICENSE
+++ b/Allura/LICENSE
@@ -208,6 +208,10 @@ separate copyright notices and license terms. Your use of the source code
 for the these subcomponents is subject to the terms and conditions of the
 following licenses.
 
+HTML5 Canvas for Internet Explorer, which is available under the
+Apache License, Version 2.0.
+For details, see Allura/allura/public/nf/js/excanvas.compiled.js
+
 The file allura/etc/mime.types from the mime-support package,
 which is in the public domain.  For details, see
 http://ftp-master.metadata.debian.org/changelogs//main/m/mime-support/mime-support_3.54_copyright

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4366a308/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 8f47b97..e558325 100644
--- a/LICENSE
+++ b/LICENSE
@@ -202,12 +202,16 @@
    limitations under the License.
 
 
-ALLURA SUBCOMPONENTS:
+THIRD-PARTY DEPENDENCIES:
 
-Apache Allura includes a number of subcomponents with separate copyright
-notices and license terms. Your use of the source code for the these
-subcomponents is subject to the terms and conditions of the following
-licenses.
+Apache Allura includes a number of third-party dependencies with
+separate copyright notices and license terms. Your use of the source code
+for the these dependencies is subject to the terms and conditions of the
+following licenses.
+
+HTML5 Canvas for Internet Explorer, which is available under the
+Apache License, Version 2.0.
+For details, see Allura/allura/public/nf/js/excanvas.compiled.js
 
 The file Allura/allura/etc/mime.types from the mime-support package,
 which is in the public domain.  For details, see


[35/50] git commit: [#5822] allow tasks with no arguments

Posted by jo...@apache.org.
[#5822] allow tasks with no arguments


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

Branch: refs/heads/cj/6422
Commit: 1531d7a1bdc47ceb5c5f3272ce4f5eb554bfb1fd
Parents: 740e392
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Sep 11 15:58:38 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Sep 23 16:27:12 2013 +0000

----------------------------------------------------------------------
 Allura/allura/scripts/scripttask.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1531d7a1/Allura/allura/scripts/scripttask.py
----------------------------------------------------------------------
diff --git a/Allura/allura/scripts/scripttask.py b/Allura/allura/scripts/scripttask.py
index b686838..229bbe6 100644
--- a/Allura/allura/scripts/scripttask.py
+++ b/Allura/allura/scripts/scripttask.py
@@ -66,7 +66,7 @@ class ScriptTask(object):
         def __new__(meta, classname, bases, classDict):
             return task(type.__new__(meta, classname, bases, classDict))
 
-    def __new__(cls, arg_string):
+    def __new__(cls, arg_string=''):
         cls._execute_task(arg_string)
 
     @classmethod


[11/50] git commit: [#6535] ticket:417 github tickets import labels and attaches

Posted by jo...@apache.org.
[#6535] ticket:417 github tickets import labels and attaches

Conflicts:
	ForgeImporters/forgeimporters/github/__init__.py


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

Branch: refs/heads/cj/6422
Commit: 6062bc73b3502f4e7ba2dbd9ebef506ec987638f
Parents: 5a82f13
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Mon Aug 26 21:24:38 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:49 2013 +0000

----------------------------------------------------------------------
 .../forgeimporters/github/__init__.py           |  3 +-
 ForgeImporters/forgeimporters/github/tracker.py | 66 +++++++++++++-------
 2 files changed, 47 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6062bc73/ForgeImporters/forgeimporters/github/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/__init__.py b/ForgeImporters/forgeimporters/github/__init__.py
index 35c5d03..8e1a802 100644
--- a/ForgeImporters/forgeimporters/github/__init__.py
+++ b/ForgeImporters/forgeimporters/github/__init__.py
@@ -17,6 +17,8 @@
 
 import logging
 import json
+import urllib
+import urllib2
 
 from forgeimporters import base
 
@@ -39,7 +41,6 @@ class GitHubProjectExtractor(base.ProjectExtractor):
         self.url = self.PAGE_MAP[page].format(
             project=urllib.quote(gh_project_name),
         )
-        self.page = json.loads(urllib2.urlopen(self.url).read().decode('utf8'))
 
     def get_summary(self):
         return self.get_page('project_info').get('description')

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6062bc73/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 4aa73a4..4cd433b 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -1,5 +1,11 @@
+import re
 from datetime import datetime
 
+try:
+    from cStringIO import StringIO
+except ImportError:
+    from StringIO import StringIO
+
 from allura import model as M
 from allura.lib import helpers as h
 from ming.orm import session, ThreadLocalORMSession
@@ -43,11 +49,10 @@ class GitHubTrackerImporter(ToolImporter):
                         custom_fields=dict(),
                         ticket_num=ticket_num)
                     self.process_fields(ticket, issue)
-                    #self.process_labels(ticket, issue)
                     #self.process_comments(ticket, issue)
                     session(ticket).flush(ticket)
                     session(ticket).expunge(ticket)
-                #app.globals.custom_fields = self.postprocess_custom_fields()
+                #app.globals.custom_fields = self.get_milestones()
                 app.globals.last_ticket_num = self.max_ticket_num
                 ThreadLocalORMSession.flush_all()
             g.post_event('project_updated')
@@ -65,6 +70,9 @@ class GitHubTrackerImporter(ToolImporter):
             owner_line = '*Originally owned by:* {}\n'.format(issue['assignee']['login'])
         else:
             owner_line = ''
+        # body processing happens here
+        body, attachments = self._get_attachments(issue['body'])
+        ticket.add_multiple_attachments(attachments)
         ticket.description = (
                 u'*Originally created by:* {creator}\n'
                 u'{owner}'
@@ -72,24 +80,9 @@ class GitHubTrackerImporter(ToolImporter):
                 u'{body}').format(
                     creator=issue['user']['login'],
                     owner=owner_line,
-                    body=issue['body'],
+                    body=body,
                 )
-
-    def process_labels(self, ticket, issue):
-        labels = set()
-        custom_fields = defaultdict(set)
-        for label in issue.get_issue_labels():
-            if u'-' in label:
-                name, value = label.split(u'-', 1)
-                cf = self.custom_field(name)
-                cf['options'].add(value)
-                custom_fields[cf['name']].add(value)
-                if cf['name'] == '_milestone' and ticket.status in c.app.globals.open_status_names:
-                    self.open_milestones.add(value)
-            else:
-                labels.add(label)
-        ticket.labels = list(labels)
-        ticket.custom_fields = {n: u', '.join(sorted(v)) for n,v in custom_fields.iteritems()}
+        ticket.labels = [label['name'] for label in issue['labels']]
 
     def process_comments(self, ticket, issue):
         for comment in issue.iter_comments():
@@ -100,8 +93,9 @@ class GitHubTrackerImporter(ToolImporter):
                 )
             p.add_multiple_attachments(comment.attachments)
 
-    def postprocess_custom_fields(self):
+    def get_milestones(self):
         custom_fields = []
+        milestones = []
         for name, field in self.custom_fields.iteritems():
             if field['name'] == '_milestone':
                 field['milestones'] = [{
@@ -115,4 +109,34 @@ class GitHubTrackerImporter(ToolImporter):
             else:
                 field['options'] = ''
             custom_fields.append(field)
-        return custom_fields
\ No newline at end of file
+        return custom_fields
+
+    def _get_attachments(self, body):
+        # at github, attachments are images only and are included into comment's body
+        # usual syntax is
+        # ![cdbpzjc5ex4](https://f.cloud.github.com/assets/979771/1027411/a393ab5e-0e70-11e3-8a38-b93a3df904cf.jpg)\r\n
+        REGEXP = r'!\[[\w0-9]+?\]\(((?:https?:\/\/)?[\da-z\.-]+\.[a-z\.]{2,6}'\
+            '(?:[\/\w\.-]+)*.(jpg|jpeg|png|gif))\)\r\n'
+        attachments = []
+        found_matches = re.finditer(REGEXP, body, re.IGNORECASE)
+        for i, match in enumerate(found_matches):
+            # removing attach text from comment
+            body = body.replace(match.group(0), '')
+            # stripping url and extension
+            attachments.append(Attachment(
+                match.group(1),  # url
+                'attach{}.{}'.format(i + 1, match.group(2)) # extension
+            ))
+        return (body, attachments)
+
+class Attachment(object):
+    def __init__(self, url, filename):
+        self.url = url
+        self.filename = filename
+        self.type = None
+
+    @property
+    def file(self):
+        fp_ish = GitHubProjectExtractor.urlopen(self.url)
+        fp = StringIO(fp_ish.read())
+        return fp


[36/50] git commit: [#5822] allow routing to nbhd tools if the tool mount point is not a vaild project name

Posted by jo...@apache.org.
[#5822] allow routing to nbhd tools if the tool mount point is not a vaild project name


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

Branch: refs/heads/cj/6422
Commit: a897dc77d0ab7762de00d67ae9852306689d98b7
Parents: 1531d7a
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Sep 11 15:59:19 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Sep 23 16:27:12 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/project.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/a897dc77/Allura/allura/controllers/project.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/project.py b/Allura/allura/controllers/project.py
index 9914dc9..e2c7ee8 100644
--- a/Allura/allura/controllers/project.py
+++ b/Allura/allura/controllers/project.py
@@ -85,9 +85,10 @@ class NeighborhoodController(object):
         provider = plugin.ProjectRegistrationProvider.get()
         try:
             provider.shortname_validator.to_python(pname, check_allowed=False, neighborhood=self.neighborhood)
-        except Invalid as e:
-            raise exc.HTTPNotFound, pname
-        project = M.Project.query.get(shortname=self.prefix + pname, neighborhood_id=self.neighborhood._id)
+        except Invalid:
+            project = None
+        else:
+            project = M.Project.query.get(shortname=self.prefix + pname, neighborhood_id=self.neighborhood._id)
         if project is None and self.prefix == 'u/':
             # create user-project if it is missing
             user = M.User.query.get(username=pname, disabled=False)


[15/50] git commit: [#6535] ticket:423 Fix validator message

Posted by jo...@apache.org.
[#6535] ticket:423 Fix validator message


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

Branch: refs/heads/cj/6422
Commit: aefd7c916de9f02f16b74a6f0bfd223851b38ef0
Parents: b2c864b
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Sep 12 13:24:59 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:50 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/project.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/aefd7c91/ForgeImporters/forgeimporters/github/project.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/project.py b/ForgeImporters/forgeimporters/github/project.py
index 282fdcd..c969294 100644
--- a/ForgeImporters/forgeimporters/github/project.py
+++ b/ForgeImporters/forgeimporters/github/project.py
@@ -34,7 +34,7 @@ class GitHubProjectForm(base.ProjectImportForm):
     project_name = fev.Regex(r'^[a-z0-9][a-z0-9-_.]{,61}$',
             not_empty=True,
             messages={
-                'invalid': 'Valid symbols are: letters, numbers, dashes underscores, periods',
+                'invalid': 'Valid symbols are: letters, numbers, dashes, underscores and periods',
             })
 
 class GitHubProjectImporter(base.ProjectImporter):


[23/50] git commit: [#6535] ticket:424 Refactoring: use self.parse_datetime everywhere

Posted by jo...@apache.org.
[#6535] ticket:424 Refactoring: use self.parse_datetime everywhere


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

Branch: refs/heads/cj/6422
Commit: 78616389fdf03b6ebac1f895708d3787dbc03a39
Parents: ae6b9e1
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 14:59:35 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:51 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/78616389/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 6c7cf73..96e8be6 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -127,8 +127,8 @@ class GitHubTrackerImporter(ToolImporter):
     def process_fields(self, ticket, issue):
         ticket.summary = issue['title']
         ticket.status = issue['state']
-        ticket.created_date = datetime.strptime(issue['created_at'], '%Y-%m-%dT%H:%M:%SZ')
-        ticket.mod_date = datetime.strptime(issue['updated_at'], '%Y-%m-%dT%H:%M:%SZ')
+        ticket.created_date = self.parse_datetime(issue['created_at'])
+        ticket.mod_date = self.parse_datetime(issue['updated_at'])
         if issue['assignee']:
             owner_line = '*Originally owned by:* {}\n'.format(issue['assignee']['login'])
         else:
@@ -158,7 +158,7 @@ class GitHubTrackerImporter(ToolImporter):
             p = ticket.discussion_thread.add_post(
                     text = body,
                     ignore_security = True,
-                    timestamp = datetime.strptime(comment['created_at'], '%Y-%m-%dT%H:%M:%SZ'),
+                    timestamp = self.parse_datetime(comment['created_at']),
                 )
             p.add_multiple_attachments(attachments)
 
@@ -190,7 +190,7 @@ class GitHubTrackerImporter(ToolImporter):
             title = issue['milestone']['title']
             due = None
             if issue['milestone']['due_on']:
-                due = datetime.strptime(issue['milestone']['due_on'], '%Y-%m-%dT%H:%M:%SZ')
+                due = self.parse_datetime(issue['milestone']['due_on'])
             ticket.custom_fields = {
                 '_milestone': title,
             }


[02/50] git commit: [#6100] Put MovedTicket in its own collection; add indexes

Posted by jo...@apache.org.
[#6100] Put MovedTicket in its own collection; add indexes

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/66cb620e
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/66cb620e
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/66cb620e

Branch: refs/heads/cj/6422
Commit: 66cb620e01ef3e81242b5a5c6fece0ba257b743d
Parents: 671627e
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Sep 18 15:12:30 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Wed Sep 18 15:12:30 2013 +0000

----------------------------------------------------------------------
 ForgeTracker/forgetracker/model/ticket.py | 33 ++++++++++++++++++++++----
 ForgeTracker/forgetracker/tracker_main.py |  7 ++----
 2 files changed, 31 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/66cb620e/ForgeTracker/forgetracker/model/ticket.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/model/ticket.py b/ForgeTracker/forgetracker/model/ticket.py
index 0ef8cab..d0b69c2 100644
--- a/ForgeTracker/forgetracker/model/ticket.py
+++ b/ForgeTracker/forgetracker/model/ticket.py
@@ -36,10 +36,27 @@ from ming.orm import FieldProperty, ForeignIdProperty, RelationProperty
 from ming.orm.declarative import MappedClass
 from ming.orm.ormsession import ThreadLocalORMSession
 
-from allura.model import (Artifact, MovedArtifact, VersionedArtifact, Snapshot,
-                          project_orm_session, BaseAttachment, VotableArtifact, AppConfig, Mailbox, User)
-from allura.model import User, Feed, Thread, Notification, ProjectRole
-from allura.model import ACE, ALL_PERMISSIONS, DENY_ALL
+from allura.model import (
+        ACE,
+        DENY_ALL,
+
+        AppConfig,
+        Artifact,
+        BaseAttachment,
+        Feed,
+        Mailbox,
+        MovedArtifact,
+        Notification,
+        ProjectRole,
+        Snapshot,
+        Thread,
+        User,
+        VersionedArtifact,
+        VotableArtifact,
+
+        artifact_orm_session,
+        project_orm_session,
+)
 from allura.model.timeline import ActivityObject
 from allura.model.notification import MailFooter
 
@@ -1088,6 +1105,14 @@ class TicketAttachment(BaseAttachment):
 
 
 class MovedTicket(MovedArtifact):
+
+    class __mongometa__:
+        session = artifact_orm_session
+        name='moved_ticket'
+        indexes = [
+            ('app_config_id', 'ticket_num'),
+        ]
+
     ticket_num = FieldProperty(int, required=True, allow_none=False)
 
 Mapper.compile_all()

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/66cb620e/ForgeTracker/forgetracker/tracker_main.py
----------------------------------------------------------------------
diff --git a/ForgeTracker/forgetracker/tracker_main.py b/ForgeTracker/forgetracker/tracker_main.py
index 968d16e..6c6c20d 100644
--- a/ForgeTracker/forgetracker/tracker_main.py
+++ b/ForgeTracker/forgetracker/tracker_main.py
@@ -1180,18 +1180,15 @@ class TicketController(BaseController, FeedController):
                 if self.ticket is not None:
                     utils.permanent_redirect(self.ticket.url())
                 else:
-                    # trying to check if ticket was moved from here
+                    # check if ticket was moved
                     moved_ticket = TM.MovedTicket.query.find({
                         'app_config_id': c.app.config._id,
                         'ticket_num': self.ticket_num,
                     }).first()
                     if moved_ticket:
-                        flash('Ticket #{} was moved to this app'.format(
-                            moved_ticket.ticket_num
-                        ))
+                        flash('Original ticket was moved to this location')
                         utils.permanent_redirect(moved_ticket.moved_to_url)
             self.attachment = AttachmentsController(self.ticket)
-            # self.comments = CommentController(self.ticket)
 
     def _check_security(self):
         if self.ticket is not None:


[44/50] git commit: [#6699] Bump ForgeHg version

Posted by jo...@apache.org.
[#6699] Bump ForgeHg version

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/fe5f148f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/fe5f148f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/fe5f148f

Branch: refs/heads/cj/6422
Commit: fe5f148fd88bf059b1a887bff1e7a0fdd6f338b6
Parents: 343fc17
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Tue Sep 24 15:38:42 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Sep 24 15:38:42 2013 +0000

----------------------------------------------------------------------
 requirements-sf.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fe5f148f/requirements-sf.txt
----------------------------------------------------------------------
diff --git a/requirements-sf.txt b/requirements-sf.txt
index 071e528..a23b4ec 100644
--- a/requirements-sf.txt
+++ b/requirements-sf.txt
@@ -4,7 +4,7 @@ akismet==0.2.0
 amqplib==0.6.1
 kombu==1.0.4
 coverage==3.5a1-20110413
-ForgeHg==0.1.16
+ForgeHg==0.1.17
 ForgePastebin==0.2.7
 GoogleCodeWikiImporter==0.4.3
 mechanize==0.2.4


[22/50] git commit: [#6535] ticket:424 Fix status names for tracker

Posted by jo...@apache.org.
[#6535] ticket:424 Fix status names for tracker

Fixes default saved searches for closed and open ticket.


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

Branch: refs/heads/cj/6422
Commit: be9d119704afb513ec764125ef8095e872b22f1f
Parents: 2ca21ae
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 15:06:57 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:51 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/tracker.py            | 4 ++--
 ForgeImporters/forgeimporters/tests/github/test_tracker.py | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/be9d1197/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 1b37e5b..d068e47 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -87,8 +87,8 @@ class GitHubTrackerImporter(ToolImporter):
             mount_label=None, **kw):
         app = project.install_app('tickets', mount_point, mount_label,
                 EnableVoting=False,
-                open_status_names='Open',
-                closed_status_names='Closed',
+                open_status_names='open',
+                closed_status_names='closed',
             )
         ThreadLocalORMSession.flush_all()
         extractor = GitHubProjectExtractor(

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/be9d1197/ForgeImporters/forgeimporters/tests/github/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_tracker.py b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
index 1376e55..7ff8c9b 100644
--- a/ForgeImporters/forgeimporters/tests/github/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
@@ -46,8 +46,8 @@ class TestTrackerImporter(TestCase):
 
         project.install_app.assert_called_once_with('tickets', 'mount_point', 'mount_label',
                 EnableVoting=False,
-                open_status_names='Open',
-                closed_status_names='Closed',
+                open_status_names='open',
+                closed_status_names='closed',
             )
         gpe.iter_issues.assert_called_once()
         self.assertEqual(tlos.flush_all.call_args_list, [


[41/50] git commit: [#6695] Added sanity check in LCD for loops in commit data

Posted by jo...@apache.org.
[#6695] Added sanity check in LCD for loops in commit data

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/9d029ebe
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/9d029ebe
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/9d029ebe

Branch: refs/heads/cj/6422
Commit: 9d029ebeb70f04d839138d3d4836cae87f96cab8
Parents: 4ed71de
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Sep 20 22:27:25 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 23 17:09:04 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py      |  4 ++++
 Allura/allura/tests/model/test_repo.py | 14 ++++++++++++++
 2 files changed, 18 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9d029ebe/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 32b9bf1..b371295 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -149,9 +149,13 @@ class RepositoryImplementation(object):
         start_time = time()
         paths = set(paths)
         result = {}
+        seen_commits = set()
         while paths and commit:
             if time() - start_time > timeout:
                 return result
+            if commit._id in seen_commits:
+                return result  # sanity check for bad data (loops)
+            seen_commits.add(commit._id)
             changed = paths & set(commit.changed_paths)
             result.update({path: commit._id for path in changed})
             paths = paths - changed

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/9d029ebe/Allura/allura/tests/model/test_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_repo.py b/Allura/allura/tests/model/test_repo.py
index b67be9f..ef39e4b 100644
--- a/Allura/allura/tests/model/test_repo.py
+++ b/Allura/allura/tests/model/test_repo.py
@@ -334,6 +334,20 @@ class TestLastCommit(unittest.TestCase):
         self.assertEqual(len(lcd.entries), 1)
         self.assertEqual(lcd.by_name['file2'], commit3._id)
 
+    def test_loop(self):
+        commit1 = self._add_commit('Commit 1', ['file1'])
+        commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
+        commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'file2'], ['file2'], [commit2])
+        commit2.parent_ids = [commit3._id]
+        session(commit2).flush(commit2)
+        lcd = M.repo.LastCommit.get(commit3.tree)
+        self.assertEqual(self.repo._commits[lcd.commit_id].message, commit3.message)
+        self.assertEqual(lcd.commit_id, commit3._id)
+        self.assertEqual(lcd.path, '')
+        self.assertEqual(len(lcd.entries), 2)
+        self.assertEqual(lcd.by_name['dir1'], commit2._id)
+        self.assertEqual(lcd.by_name['file2'], commit3._id)
+
 
 class TestModelCache(unittest.TestCase):
     def setUp(self):


[40/50] git commit: [#6695] Added timeout for computing LCDs to prevent hung requests

Posted by jo...@apache.org.
[#6695] Added timeout for computing LCDs to prevent hung requests

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/4ed71de8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4ed71de8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4ed71de8

Branch: refs/heads/cj/6422
Commit: 4ed71de8c041de612c87cc5868e76b94fe2a800c
Parents: 9f87880
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Fri Sep 20 21:23:44 2013 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Mon Sep 23 17:09:04 2013 +0000

----------------------------------------------------------------------
 Allura/allura/model/repo.py            |  5 +++--
 Allura/allura/model/repository.py      |  7 ++++++-
 Allura/allura/tests/model/test_repo.py | 15 +++++++++++++++
 3 files changed, 24 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4ed71de8/Allura/allura/model/repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repo.py b/Allura/allura/model/repo.py
index 06a0853..502961b 100644
--- a/Allura/allura/model/repo.py
+++ b/Allura/allura/model/repo.py
@@ -843,8 +843,9 @@ class LastCommit(RepoObject):
             # (but only ask for the ones that we know we need)
             entries = tree.commit.repo.last_commit_ids(tree.commit, unchanged)
             if entries is None:
-                # something strange went wrong; bail out and possibly try again later
-                return None
+                # something strange went wrong; still show the list of files
+                # and possibly try again later
+                entries = {}
             # paths are fully-qualified; shorten them back to just node names
             entries = {os.path.basename(path):commit_id for path,commit_id in entries.iteritems()}
         # update with the nodes changed in this tree's commit

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4ed71de8/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 3fe5a80..32b9bf1 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -27,13 +27,14 @@ from subprocess import Popen, PIPE
 from difflib import SequenceMatcher
 from hashlib import sha1
 from datetime import datetime
+from time import time
 from collections import defaultdict
 from itertools import izip
 from urlparse import urljoin
 from urllib import quote
 
 import tg
-from paste.deploy.converters import asbool
+from paste.deploy.converters import asbool, asint
 from pylons import tmpl_context as c
 from pylons import app_globals as g
 import pymongo.errors
@@ -144,9 +145,13 @@ class RepositoryImplementation(object):
         Return a mapping {path: commit_id} of the _id of the last
         commit to touch each path, starting from the given commit.
         '''
+        timeout = asint(config.get('lcd_timeout', 60)) * 1000
+        start_time = time()
         paths = set(paths)
         result = {}
         while paths and commit:
+            if time() - start_time > timeout:
+                return result
             changed = paths & set(commit.changed_paths)
             result.update({path: commit._id for path in changed})
             paths = paths - changed

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4ed71de8/Allura/allura/tests/model/test_repo.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/model/test_repo.py b/Allura/allura/tests/model/test_repo.py
index 5d9e95e..b67be9f 100644
--- a/Allura/allura/tests/model/test_repo.py
+++ b/Allura/allura/tests/model/test_repo.py
@@ -17,15 +17,18 @@
 
 from datetime import datetime
 from collections import defaultdict, OrderedDict
+
 import unittest
 import mock
 from nose.tools import assert_equal
 from pylons import tmpl_context as c
 from bson import ObjectId
 from ming.orm import session
+from tg import config
 
 from alluratest.controller import setup_basic_test, setup_global_objects
 from allura import model as M
+from allura.lib import helpers as h
 
 class TestGitLikeTree(object):
 
@@ -319,6 +322,18 @@ class TestLastCommit(unittest.TestCase):
         result = self.repo.last_commit_ids(commit1, ['file1'])
         assert_equal(result, {'file1': commit1._id})
 
+    def test_timeout(self):
+        commit1 = self._add_commit('Commit 1', ['file1'])
+        commit2 = self._add_commit('Commit 2', ['file1', 'dir1/file1'], ['dir1/file1'], [commit1])
+        commit3 = self._add_commit('Commit 3', ['file1', 'dir1/file1', 'file2'], ['file2'], [commit2])
+        with h.push_config(config, lcd_timeout=0):
+            lcd = M.repo.LastCommit.get(commit3.tree)
+        self.assertEqual(self.repo._commits[lcd.commit_id].message, commit3.message)
+        self.assertEqual(lcd.commit_id, commit3._id)
+        self.assertEqual(lcd.path, '')
+        self.assertEqual(len(lcd.entries), 1)
+        self.assertEqual(lcd.by_name['file2'], commit3._id)
+
 
 class TestModelCache(unittest.TestCase):
     def setUp(self):


[05/50] git commit: [#6638] Remove old import_id before creating app

Posted by jo...@apache.org.
[#6638] Remove old import_id before creating app

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/c6f4a9d0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/c6f4a9d0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/c6f4a9d0

Branch: refs/heads/cj/6422
Commit: c6f4a9d0ec97be74c70594e4cf7d015d35715939
Parents: 16b6409
Author: Tim Van Steenburgh <tv...@gmail.com>
Authored: Wed Sep 18 16:56:54 2013 +0000
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Wed Sep 18 16:56:54 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/forge/tracker.py | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/c6f4a9d0/ForgeImporters/forgeimporters/forge/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/forge/tracker.py b/ForgeImporters/forgeimporters/forge/tracker.py
index 07efb0e..f6fe907 100644
--- a/ForgeImporters/forgeimporters/forge/tracker.py
+++ b/ForgeImporters/forgeimporters/forge/tracker.py
@@ -123,6 +123,7 @@ class ForgeTrackerImporter(ToolImporter):
         tracker_json['tracker_config']['options'].pop('ordinal', None)
         tracker_json['tracker_config']['options'].pop('mount_point', None)
         tracker_json['tracker_config']['options'].pop('mount_label', None)
+        tracker_json['tracker_config']['options'].pop('import_id', None)
         app = project.install_app('tickets', mount_point, mount_label,
                 import_id={
                         'source': self.source,


[26/50] git commit: [#6535] ticket:424 Fetch issue events from github

Posted by jo...@apache.org.
[#6535] ticket:424 Fetch issue events from github


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

Branch: refs/heads/cj/6422
Commit: 2c831e3156c91d135156c4d219952d7af4757522
Parents: 961b141
Author: Igor Bondarenko <je...@gmail.com>
Authored: Tue Sep 17 14:03:52 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:51 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/__init__.py  |  8 ++++++++
 .../forgeimporters/tests/github/test_extractor.py | 18 ++++++++++++++++++
 2 files changed, 26 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2c831e31/ForgeImporters/forgeimporters/github/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/__init__.py b/ForgeImporters/forgeimporters/github/__init__.py
index 35bbff7..3d3caac 100644
--- a/ForgeImporters/forgeimporters/github/__init__.py
+++ b/ForgeImporters/forgeimporters/github/__init__.py
@@ -32,6 +32,7 @@ class GitHubProjectExtractor(base.ProjectExtractor):
             'issues': 'https://api.github.com/repos/{project_name}/issues',
         }
     POSSIBLE_STATES = ('opened', 'closed')
+    SUPPORTED_ISSUE_EVENTS = ('closed', 'reopened', 'assigned')
     NEXT_PAGE_URL_RE = re.compile(r'<([^>]*)>; rel="next"')
 
     def get_next_page_url(self, link):
@@ -83,3 +84,10 @@ class GitHubProjectExtractor(base.ProjectExtractor):
         comments = self.get_page(comments_url)
         for comment in comments:
             yield comment
+
+    def iter_events(self, issue):
+        events_url = issue['events_url']
+        events = self.get_page(events_url)
+        for event in events:
+            if event.get('event') in self.SUPPORTED_ISSUE_EVENTS:
+                yield event

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2c831e31/ForgeImporters/forgeimporters/tests/github/test_extractor.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_extractor.py b/ForgeImporters/forgeimporters/tests/github/test_extractor.py
index c7734fa..e29a533 100644
--- a/ForgeImporters/forgeimporters/tests/github/test_extractor.py
+++ b/ForgeImporters/forgeimporters/tests/github/test_extractor.py
@@ -46,6 +46,14 @@ class TestGitHubProjectExtractor(TestCase):
     ]
     ISSUE_COMMENTS = [u'hello', u'mocked_comment']
     ISSUE_COMMENTS_PAGE2 = [u'hello2', u'mocked_comment2']
+    ISSUE_EVENTS = [
+        {u'event': u'closed'},
+        {u'event': u'reopened'},
+    ]
+    ISSUE_EVENTS_PAGE2 = [
+        {u'event': u'assigned'},
+        {u'event': u'not-supported-event'},
+    ]
 
     def mocked_urlopen(self, url):
         headers = {}
@@ -63,6 +71,11 @@ class TestGitHubProjectExtractor(TestCase):
             headers = {'Link': '</comments?page=2>; rel="next"'}
         elif url.endswith('/comments?page=2'):
             response = StringIO(json.dumps(self.ISSUE_COMMENTS_PAGE2))
+        elif url.endswith('/events'):
+            response = StringIO(json.dumps(self.ISSUE_EVENTS))
+            headers = {'Link': '</events?page=2>; rel="next"'}
+        elif url.endswith('/events?page=2'):
+            response = StringIO(json.dumps(self.ISSUE_EVENTS_PAGE2))
 
         response.info = lambda: headers
         return response
@@ -95,3 +108,8 @@ class TestGitHubProjectExtractor(TestCase):
         mock_issue = {'comments_url': '/issues/1/comments'}
         comments = list(self.extractor.iter_comments(mock_issue))
         self.assertEqual(comments, self.ISSUE_COMMENTS + self.ISSUE_COMMENTS_PAGE2)
+
+    def test_iter_events(self):
+        mock_issue = {'events_url': '/issues/1/events'}
+        events = list(self.extractor.iter_events(mock_issue))
+        self.assertEqual(events, self.ISSUE_EVENTS + self.ISSUE_EVENTS_PAGE2[:1])


[38/50] git commit: [#5822] fix redirect after submitting the new task form

Posted by jo...@apache.org.
[#5822] fix redirect after submitting the new task form


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

Branch: refs/heads/cj/6422
Commit: 740e392f62f5b7026236294b35e7ab422cf8e7a0
Parents: d83c5c2
Author: Dave Brondsema <db...@slashdotmedia.com>
Authored: Wed Sep 11 15:58:13 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Mon Sep 23 16:27:12 2013 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/site_admin.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/740e392f/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index 0051a04..d7e7c0b 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -338,7 +338,7 @@ class TaskManagerController(object):
             config_dict['user'] = user
         with h.push_config(c, **config_dict):
             task = task.post(*args, **kw)
-        redirect('../view/%s' % task._id)
+        redirect('view/%s' % task._id)
 
     @expose()
     @require_post()


[12/50] git commit: [#6535] ticket:417 basic github tickets import

Posted by jo...@apache.org.
[#6535] ticket:417 basic github tickets import

Conflicts:
	ForgeImporters/forgeimporters/base.py


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

Branch: refs/heads/cj/6422
Commit: 5a82f13a32c497cf6d858a3c8155c5e274d34fc6
Parents: 8a32af8
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Mon Aug 26 18:56:42 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:49 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/base.py           |   1 -
 .../forgeimporters/github/__init__.py           |  25 ++++-
 ForgeImporters/forgeimporters/github/tracker.py | 112 ++++++++++++++++++-
 3 files changed, 135 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5a82f13a/ForgeImporters/forgeimporters/base.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/base.py b/ForgeImporters/forgeimporters/base.py
index 2f296a0..ea01968 100644
--- a/ForgeImporters/forgeimporters/base.py
+++ b/ForgeImporters/forgeimporters/base.py
@@ -210,7 +210,6 @@ class ProjectImporter(BaseController):
         tools = {}
         for ep in h.iter_entry_points('allura.importers'):
             epv = ep.load()
-            print epv, epv.source, self.source
             if epv.source == self.source:
                 tools[ep.name] = epv()
         return tools

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5a82f13a/ForgeImporters/forgeimporters/github/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/__init__.py b/ForgeImporters/forgeimporters/github/__init__.py
index 5cd6dc1..35c5d03 100644
--- a/ForgeImporters/forgeimporters/github/__init__.py
+++ b/ForgeImporters/forgeimporters/github/__init__.py
@@ -25,12 +25,22 @@ log = logging.getLogger(__name__)
 
 class GitHubProjectExtractor(base.ProjectExtractor):
     PAGE_MAP = {
-            'project_info': 'https://api.github.com/repos/{project_name}',
+            'project_info': 'https://api.github.com/repos/{project}',
+            'issues': 'https://api.github.com/repos/{project}/issues',
         }
+    POSSIBLE_STATES = ('opened', 'closed')
 
     def parse_page(self, page):
         return json.loads(page.read().decode('utf8'))
 
+    def __init__(self, allura_project, gh_project_name, page):
+        self.project = allura_project
+        self.gh_project_name = gh_project_name
+        self.url = self.PAGE_MAP[page].format(
+            project=urllib.quote(gh_project_name),
+        )
+        self.page = json.loads(urllib2.urlopen(self.url).read().decode('utf8'))
+
     def get_summary(self):
         return self.get_page('project_info').get('description')
 
@@ -39,3 +49,16 @@ class GitHubProjectExtractor(base.ProjectExtractor):
 
     def get_repo_url(self):
         return self.get_page('project_info').get('clone_url')
+
+    def iter_issues(self):
+        # github api doesn't allow getting closed and opened tickets in one query
+        issues = []
+        self.url += '?state={state}'
+        for state in self.POSSIBLE_STATES:
+            issue_list_url = self.url.format(
+                state=state,
+            )
+            issues += json.loads(urllib2.urlopen(issue_list_url).read().decode('utf8'))
+        issues.sort(key=lambda x: x['number'])
+        for issue in issues:
+            yield (issue['number'], issue)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/5a82f13a/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 798da5c..4aa73a4 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -1,8 +1,118 @@
+from datetime import datetime
+
+from allura import model as M
+from allura.lib import helpers as h
+from ming.orm import session, ThreadLocalORMSession
+from pylons import tmpl_context as c
+from pylons import app_globals as g
+
+from . import GitHubProjectExtractor
 from ..base import ToolImporter
 from forgetracker.tracker_main import ForgeTrackerApp
+from forgetracker import model as TM
+
+
 
 class GitHubTrackerImporter(ToolImporter):
     source = 'GitHub'
     target_app = ForgeTrackerApp
     controller = None
-    tool_label = 'Issues'
\ No newline at end of file
+    tool_label = 'Issues'
+    max_ticket_num = 0
+
+    def import_tool(self, project, user, project_name, mount_point=None,
+            mount_label=None, **kw):
+        app = project.install_app('tickets', mount_point, mount_label,
+                EnableVoting=True,
+                open_status_names='New Accepted',
+                closed_status_names='Done',
+            )
+        ThreadLocalORMSession.flush_all()
+        extractor = GitHubProjectExtractor(
+            project,
+            '{}/{}'.format(kw['user_name'],project_name),
+            'issues',
+        )
+        try:
+            M.session.artifact_orm_session._get().skip_mod_date = True
+            with h.push_config(c, user=M.User.anonymous(), app=app):
+                for ticket_num, issue in extractor.iter_issues():
+                    self.max_ticket_num = max(ticket_num, self.max_ticket_num)
+                    ticket = TM.Ticket(
+                        app_config_id=app.config._id,
+                        custom_fields=dict(),
+                        ticket_num=ticket_num)
+                    self.process_fields(ticket, issue)
+                    #self.process_labels(ticket, issue)
+                    #self.process_comments(ticket, issue)
+                    session(ticket).flush(ticket)
+                    session(ticket).expunge(ticket)
+                #app.globals.custom_fields = self.postprocess_custom_fields()
+                app.globals.last_ticket_num = self.max_ticket_num
+                ThreadLocalORMSession.flush_all()
+            g.post_event('project_updated')
+            app.globals.invalidate_bin_counts()
+            return app
+        finally:
+            M.session.artifact_orm_session._get().skip_mod_date = False
+
+    def process_fields(self, ticket, issue):
+        ticket.summary = issue['title']
+        ticket.status = issue['state']
+        ticket.created_date = datetime.strptime(issue['created_at'], '%Y-%m-%dT%H:%M:%SZ')
+        ticket.mod_date = datetime.strptime(issue['updated_at'], '%Y-%m-%dT%H:%M:%SZ')
+        if issue['assignee']:
+            owner_line = '*Originally owned by:* {}\n'.format(issue['assignee']['login'])
+        else:
+            owner_line = ''
+        ticket.description = (
+                u'*Originally created by:* {creator}\n'
+                u'{owner}'
+                u'\n'
+                u'{body}').format(
+                    creator=issue['user']['login'],
+                    owner=owner_line,
+                    body=issue['body'],
+                )
+
+    def process_labels(self, ticket, issue):
+        labels = set()
+        custom_fields = defaultdict(set)
+        for label in issue.get_issue_labels():
+            if u'-' in label:
+                name, value = label.split(u'-', 1)
+                cf = self.custom_field(name)
+                cf['options'].add(value)
+                custom_fields[cf['name']].add(value)
+                if cf['name'] == '_milestone' and ticket.status in c.app.globals.open_status_names:
+                    self.open_milestones.add(value)
+            else:
+                labels.add(label)
+        ticket.labels = list(labels)
+        ticket.custom_fields = {n: u', '.join(sorted(v)) for n,v in custom_fields.iteritems()}
+
+    def process_comments(self, ticket, issue):
+        for comment in issue.iter_comments():
+            p = ticket.discussion_thread.add_post(
+                    text = comment.annotated_text,
+                    ignore_security = True,
+                    timestamp = datetime.strptime(comment.created_date, '%c'),
+                )
+            p.add_multiple_attachments(comment.attachments)
+
+    def postprocess_custom_fields(self):
+        custom_fields = []
+        for name, field in self.custom_fields.iteritems():
+            if field['name'] == '_milestone':
+                field['milestones'] = [{
+                        'name': milestone,
+                        'due_date': None,
+                        'complete': milestone not in self.open_milestones,
+                    } for milestone in sorted(field['options'])]
+                field['options'] = ''
+            elif field['type'] == 'select':
+                field['options'] = ' '.join(field['options'])
+            else:
+                field['options'] = ''
+            custom_fields.append(field)
+        return custom_fields
\ No newline at end of file


[14/50] git commit: [#6535] ticket:423 fixed test

Posted by jo...@apache.org.
[#6535] ticket:423 fixed test


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

Branch: refs/heads/cj/6422
Commit: b2c864be4680fe92dcf2a574b97caed9f5b5cd7d
Parents: da98a80
Author: coldmind <so...@yandex.ru>
Authored: Wed Sep 11 16:44:49 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:50 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/tests/github/test_tracker.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/b2c864be/ForgeImporters/forgeimporters/tests/github/test_tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/tests/github/test_tracker.py b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
index 382be2b..9059a99 100644
--- a/ForgeImporters/forgeimporters/tests/github/test_tracker.py
+++ b/ForgeImporters/forgeimporters/tests/github/test_tracker.py
@@ -45,9 +45,9 @@ class TestTrackerImporter(TestCase):
                 mount_point='mount_point', mount_label='mount_label', user_name='me')
 
         project.install_app.assert_called_once_with('tickets', 'mount_point', 'mount_label',
-                EnableVoting=True,
-                open_status_names='New Accepted Started',
-                closed_status_names='Fixed Verified Invalid Duplicate WontFix Done',
+                EnableVoting=False,
+                open_status_names='Open',
+                closed_status_names='Closed',
             )
         gpe.iter_issues.assert_called_once()
         self.assertEqual(tlos.flush_all.call_args_list, [
@@ -127,7 +127,7 @@ class TestTrackerImporter(TestCase):
         importer = tracker.GitHubTrackerImporter()
         importer.process_comments(extractor, ticket, issue)
         self.assertEqual(ticket.discussion_thread.add_post.call_args_list[0], mock.call(
-                text='hello\n*Originally posted by: me*',
+                text='*Originally posted by: [me](https://github.com/me)*\nhello',
                 timestamp=datetime(2013, 8, 26, 16, 57, 53),
                 ignore_security=True,
             ))
\ No newline at end of file


[10/50] git commit: [#6535] ticket:417 rebased master and 42cc_6533

Posted by jo...@apache.org.
[#6535] ticket:417 rebased master and 42cc_6533


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

Branch: refs/heads/cj/6422
Commit: fd9404a699ac4ad6ac268836c32dabddbba6eb3e
Parents: 6062bc7
Author: Anton Kasyanov <mi...@gmail.com>
Authored: Tue Aug 27 14:03:32 2013 +0300
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Thu Sep 19 14:46:49 2013 +0000

----------------------------------------------------------------------
 ForgeImporters/forgeimporters/github/__init__.py | 17 +++++------------
 ForgeImporters/forgeimporters/github/tracker.py  |  2 --
 2 files changed, 5 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fd9404a6/ForgeImporters/forgeimporters/github/__init__.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/__init__.py b/ForgeImporters/forgeimporters/github/__init__.py
index 8e1a802..13d32e4 100644
--- a/ForgeImporters/forgeimporters/github/__init__.py
+++ b/ForgeImporters/forgeimporters/github/__init__.py
@@ -27,21 +27,14 @@ log = logging.getLogger(__name__)
 
 class GitHubProjectExtractor(base.ProjectExtractor):
     PAGE_MAP = {
-            'project_info': 'https://api.github.com/repos/{project}',
-            'issues': 'https://api.github.com/repos/{project}/issues',
+            'project_info': 'https://api.github.com/repos/{project_name}',
+            'issues': 'https://api.github.com/repos/{project_name}/issues',
         }
     POSSIBLE_STATES = ('opened', 'closed')
 
     def parse_page(self, page):
         return json.loads(page.read().decode('utf8'))
 
-    def __init__(self, allura_project, gh_project_name, page):
-        self.project = allura_project
-        self.gh_project_name = gh_project_name
-        self.url = self.PAGE_MAP[page].format(
-            project=urllib.quote(gh_project_name),
-        )
-
     def get_summary(self):
         return self.get_page('project_info').get('description')
 
@@ -54,12 +47,12 @@ class GitHubProjectExtractor(base.ProjectExtractor):
     def iter_issues(self):
         # github api doesn't allow getting closed and opened tickets in one query
         issues = []
-        self.url += '?state={state}'
+        url = self.get_page_url('issues') + '?state={state}'
         for state in self.POSSIBLE_STATES:
-            issue_list_url = self.url.format(
+            issue_list_url = url.format(
                 state=state,
             )
-            issues += json.loads(urllib2.urlopen(issue_list_url).read().decode('utf8'))
+            issues += json.loads(self.urlopen(issue_list_url).read().decode('utf8'))
         issues.sort(key=lambda x: x['number'])
         for issue in issues:
             yield (issue['number'], issue)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/fd9404a6/ForgeImporters/forgeimporters/github/tracker.py
----------------------------------------------------------------------
diff --git a/ForgeImporters/forgeimporters/github/tracker.py b/ForgeImporters/forgeimporters/github/tracker.py
index 4cd433b..af5363d 100644
--- a/ForgeImporters/forgeimporters/github/tracker.py
+++ b/ForgeImporters/forgeimporters/github/tracker.py
@@ -35,9 +35,7 @@ class GitHubTrackerImporter(ToolImporter):
             )
         ThreadLocalORMSession.flush_all()
         extractor = GitHubProjectExtractor(
-            project,
             '{}/{}'.format(kw['user_name'],project_name),
-            'issues',
         )
         try:
             M.session.artifact_orm_session._get().skip_mod_date = True


[45/50] git commit: [#6422] Removed unncessary info from NOTICE file

Posted by jo...@apache.org.
[#6422] Removed unncessary info from NOTICE file

All of the removed items are appropriately licensed and do not include
NOTICE files that need to be included.

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/4682f143
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4682f143
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4682f143

Branch: refs/heads/cj/6422
Commit: 4682f14373160a84749a919e69ee78aafb860012
Parents: fe5f148
Author: Cory Johns <cj...@slashdotmedia.com>
Authored: Tue Sep 17 20:40:44 2013 +0000
Committer: Cory Johns <cj...@slashdotmedia.com>
Committed: Tue Sep 24 17:07:13 2013 +0000

----------------------------------------------------------------------
 NOTICE | 21 ++++-----------------
 1 file changed, 4 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4682f143/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 8157ed8..40b6969 100644
--- a/NOTICE
+++ b/NOTICE
@@ -1,18 +1,5 @@
-      Apache Allura (incubating)
-      Copyright 2012-2013 The Apache Software Foundation
+Apache Allura (incubating)
+Copyright 2012-2013 The Apache Software Foundation
 
-      This product includes software developed at
-      The Apache Software Foundation (http://www.apache.org/).
-
-      This software contains library for converting various
-      characters to ASCII encoding, written by Leonard Richardson
-      and placed into public domain.
-      
-      This software contains library for checking maximum length
-      of text area's content, written by Keith Wood.
-      
-      This software contains lightbox plugin for jQuery, written by
-      Buck Wilson.
-      
-      Canvas functionality in Internet Explorer(r) is provided
-      by code developed at Google Inc.
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org/).