You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by gj...@apache.org on 2012/05/21 11:23:03 UTC

svn commit: r1340948 [1/6] - in /incubator/bloodhound/vendor/trac/current: ./ contrib/ trac/ trac/admin/tests/ trac/htdocs/ trac/htdocs/css/ trac/htdocs/js/ trac/locale/ trac/locale/en_GB/LC_MESSAGES/ trac/locale/fr/LC_MESSAGES/ trac/locale/hu/LC_MESSA...

Author: gjm
Date: Mon May 21 09:23:01 2012
New Revision: 1340948

URL: http://svn.apache.org/viewvc?rev=1340948&view=rev
Log:
trac vendor code - update current to trunk rev 11046

Added:
    incubator/bloodhound/vendor/trac/current/trac/htdocs/batchmodify.png   (with props)
    incubator/bloodhound/vendor/trac/current/trac/ticket/batch.py   (with props)
    incubator/bloodhound/vendor/trac/current/trac/ticket/templates/batch_modify.html   (with props)
    incubator/bloodhound/vendor/trac/current/trac/ticket/templates/batch_ticket_notify_email.txt   (with props)
    incubator/bloodhound/vendor/trac/current/trac/ticket/tests/batch.py   (with props)
    incubator/bloodhound/vendor/trac/current/trac/wiki/default-pages/TracBatchModify
Modified:
    incubator/bloodhound/vendor/trac/current/THANKS
    incubator/bloodhound/vendor/trac/current/contrib/checkwiki.py
    incubator/bloodhound/vendor/trac/current/setup.py
    incubator/bloodhound/vendor/trac/current/trac/admin/tests/console-tests.txt
    incubator/bloodhound/vendor/trac/current/trac/attachment.py
    incubator/bloodhound/vendor/trac/current/trac/htdocs/css/report.css
    incubator/bloodhound/vendor/trac/current/trac/htdocs/css/timeline.css
    incubator/bloodhound/vendor/trac/current/trac/htdocs/js/jquery.js
    incubator/bloodhound/vendor/trac/current/trac/htdocs/js/query.js
    incubator/bloodhound/vendor/trac/current/trac/htdocs/js/timeline_multirepos.js
    incubator/bloodhound/vendor/trac/current/trac/htdocs/js/workflow_graph.js
    incubator/bloodhound/vendor/trac/current/trac/locale/en_GB/LC_MESSAGES/tracini.po
    incubator/bloodhound/vendor/trac/current/trac/locale/fr/LC_MESSAGES/tracini.po
    incubator/bloodhound/vendor/trac/current/trac/locale/hu/LC_MESSAGES/messages-js.po
    incubator/bloodhound/vendor/trac/current/trac/locale/hu/LC_MESSAGES/messages.po
    incubator/bloodhound/vendor/trac/current/trac/locale/hu/LC_MESSAGES/tracini.po
    incubator/bloodhound/vendor/trac/current/trac/locale/ja/LC_MESSAGES/tracini.po
    incubator/bloodhound/vendor/trac/current/trac/locale/sv/LC_MESSAGES/messages-js.po
    incubator/bloodhound/vendor/trac/current/trac/locale/sv/LC_MESSAGES/messages.po
    incubator/bloodhound/vendor/trac/current/trac/locale/sv/LC_MESSAGES/tracini.po
    incubator/bloodhound/vendor/trac/current/trac/locale/tracini.pot
    incubator/bloodhound/vendor/trac/current/trac/perm.py
    incubator/bloodhound/vendor/trac/current/trac/templates/error.html
    incubator/bloodhound/vendor/trac/current/trac/templates/layout.html
    incubator/bloodhound/vendor/trac/current/trac/tests/attachment.py
    incubator/bloodhound/vendor/trac/current/trac/ticket/api.py
    incubator/bloodhound/vendor/trac/current/trac/ticket/default_workflow.py
    incubator/bloodhound/vendor/trac/current/trac/ticket/notification.py
    incubator/bloodhound/vendor/trac/current/trac/ticket/query.py
    incubator/bloodhound/vendor/trac/current/trac/ticket/templates/query.html
    incubator/bloodhound/vendor/trac/current/trac/ticket/tests/__init__.py
    incubator/bloodhound/vendor/trac/current/trac/ticket/tests/functional.py
    incubator/bloodhound/vendor/trac/current/trac/ticket/web_ui.py
    incubator/bloodhound/vendor/trac/current/trac/versioncontrol/web_ui/changeset.py
    incubator/bloodhound/vendor/trac/current/trac/web/api.py
    incubator/bloodhound/vendor/trac/current/trac/web/auth.py
    incubator/bloodhound/vendor/trac/current/trac/web/chrome.py
    incubator/bloodhound/vendor/trac/current/trac/web/main.py
    incubator/bloodhound/vendor/trac/current/trac/web/session.py
    incubator/bloodhound/vendor/trac/current/trac/wiki/default-pages/TracGuide
    incubator/bloodhound/vendor/trac/current/trac/wiki/default-pages/TracTicketsCustomFields
    incubator/bloodhound/vendor/trac/current/trac/wiki/macros.py
    incubator/bloodhound/vendor/trac/current/tracopt/versioncontrol/git/PyGIT.py
    incubator/bloodhound/vendor/trac/current/tracopt/versioncontrol/git/git_fs.py

Modified: incubator/bloodhound/vendor/trac/current/THANKS
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/THANKS?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/THANKS (original)
+++ incubator/bloodhound/vendor/trac/current/THANKS Mon May 21 09:23:01 2012
@@ -53,6 +53,7 @@
  * InterAct Trac-ja Team          trac-ja@i-act.co.jp
  * Paul Irish                     paul.irishEWWSPAM@gmail.com
  * Masaharu Iwai
+ * Ethan Jucovy                   ethan.jucovy@gmail.com
  * Noah Kantrowitz (coderanger)   coderanger@yahoo.com
  * Alexey Kinyov
  * Tomas Kopecek
@@ -70,6 +71,7 @@
  * Simon Martin
  * Narine Martirosyan             narine_martirosyan@instigatedesign.com
  * Mark Mc Mahon                  mark.m.mcmahon@gmail.com
+ * Brian Meeker                   meeker.brian@gmail.com
  * Aristotelis Mertis
  * Wojciech Michalski
  * Keir Mierle                    keir@cs.utoronto.ca

Modified: incubator/bloodhound/vendor/trac/current/contrib/checkwiki.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/contrib/checkwiki.py?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/contrib/checkwiki.py (original)
+++ incubator/bloodhound/vendor/trac/current/contrib/checkwiki.py Mon May 21 09:23:01 2012
@@ -24,6 +24,7 @@ wiki_pages = [
  "TracAccessibility",
  "TracAdmin",
  "TracBackup",
+ "TracBatchModify",
  "TracBrowser",
  "TracCgi",
  "TracChangeset",

Modified: incubator/bloodhound/vendor/trac/current/setup.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/setup.py?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/setup.py (original)
+++ incubator/bloodhound/vendor/trac/current/setup.py Mon May 21 09:23:01 2012
@@ -130,6 +130,7 @@ facilities.
         trac.prefs = trac.prefs.web_ui
         trac.search = trac.search.web_ui
         trac.ticket.admin = trac.ticket.admin
+        trac.ticket.batch = trac.ticket.batch
         trac.ticket.query = trac.ticket.query
         trac.ticket.report = trac.ticket.report
         trac.ticket.roadmap = trac.ticket.roadmap

Modified: incubator/bloodhound/vendor/trac/current/trac/admin/tests/console-tests.txt
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/admin/tests/console-tests.txt?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/trac/admin/tests/console-tests.txt (original)
+++ incubator/bloodhound/vendor/trac/current/trac/admin/tests/console-tests.txt Mon May 21 09:23:01 2012
@@ -119,11 +119,11 @@ Available actions:
  MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
  PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
  REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
- SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE,
- TICKET_EDIT_CC, TICKET_EDIT_COMMENT, TICKET_EDIT_DESCRIPTION,
- TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
- VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY,
- WIKI_RENAME, WIKI_VIEW
+ SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
+ TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
+ TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
+ TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
+ WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW
 
 ===== test_permission_add_one_action_ok =====
 
@@ -154,11 +154,11 @@ Available actions:
  MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
  PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
  REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
- SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE,
- TICKET_EDIT_CC, TICKET_EDIT_COMMENT, TICKET_EDIT_DESCRIPTION,
- TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
- VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY,
- WIKI_RENAME, WIKI_VIEW
+ SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
+ TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
+ TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
+ TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
+ WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW
 
 ===== test_permission_add_multiple_actions_ok =====
 
@@ -190,11 +190,11 @@ Available actions:
  MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
  PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
  REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
- SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE,
- TICKET_EDIT_CC, TICKET_EDIT_COMMENT, TICKET_EDIT_DESCRIPTION,
- TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
- VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY,
- WIKI_RENAME, WIKI_VIEW
+ SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
+ TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
+ TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
+ TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
+ WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW
 
 ===== test_permission_add_already_exists =====
 The user anonymous already has permission WIKI_VIEW.
@@ -227,11 +227,11 @@ Available actions:
  MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
  PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
  REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
- SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE,
- TICKET_EDIT_CC, TICKET_EDIT_COMMENT, TICKET_EDIT_DESCRIPTION,
- TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
- VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY,
- WIKI_RENAME, WIKI_VIEW
+ SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
+ TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
+ TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
+ TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
+ WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW
 
 ===== test_permission_remove_one_action_ok =====
 
@@ -261,11 +261,11 @@ Available actions:
  MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
  PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
  REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
- SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE,
- TICKET_EDIT_CC, TICKET_EDIT_COMMENT, TICKET_EDIT_DESCRIPTION,
- TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
- VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY,
- WIKI_RENAME, WIKI_VIEW
+ SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
+ TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
+ TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
+ TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
+ WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW
 
 ===== test_permission_remove_multiple_actions_ok =====
 
@@ -295,11 +295,11 @@ Available actions:
  MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
  PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
  REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
- SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE,
- TICKET_EDIT_CC, TICKET_EDIT_COMMENT, TICKET_EDIT_DESCRIPTION,
- TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
- VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY,
- WIKI_RENAME, WIKI_VIEW
+ SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
+ TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
+ TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
+ TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
+ WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW
 
 ===== test_permission_remove_all_actions_for_user =====
 
@@ -317,11 +317,11 @@ Available actions:
  MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
  PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
  REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
- SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE,
- TICKET_EDIT_CC, TICKET_EDIT_COMMENT, TICKET_EDIT_DESCRIPTION,
- TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
- VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY,
- WIKI_RENAME, WIKI_VIEW
+ SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
+ TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
+ TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
+ TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
+ WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW
 
 ===== test_permission_remove_action_for_all_users =====
 
@@ -350,11 +350,11 @@ Available actions:
  MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
  PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
  REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
- SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE,
- TICKET_EDIT_CC, TICKET_EDIT_COMMENT, TICKET_EDIT_DESCRIPTION,
- TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
- VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY,
- WIKI_RENAME, WIKI_VIEW
+ SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
+ TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
+ TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
+ TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
+ WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW
 
 ===== test_permission_remove_unknown_user =====
 Error: Cannot remove permission TICKET_VIEW for user joe.
@@ -393,11 +393,11 @@ Available actions:
  MILESTONE_MODIFY, MILESTONE_VIEW, PERMISSION_ADMIN, PERMISSION_GRANT,
  PERMISSION_REVOKE, REPORT_ADMIN, REPORT_CREATE, REPORT_DELETE,
  REPORT_MODIFY, REPORT_SQL_VIEW, REPORT_VIEW, ROADMAP_ADMIN, ROADMAP_VIEW,
- SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_CHGPROP, TICKET_CREATE,
- TICKET_EDIT_CC, TICKET_EDIT_COMMENT, TICKET_EDIT_DESCRIPTION,
- TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW, TRAC_ADMIN,
- VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE, WIKI_MODIFY,
- WIKI_RENAME, WIKI_VIEW
+ SEARCH_VIEW, TICKET_ADMIN, TICKET_APPEND, TICKET_BATCH_MODIFY,
+ TICKET_CHGPROP, TICKET_CREATE, TICKET_EDIT_CC, TICKET_EDIT_COMMENT,
+ TICKET_EDIT_DESCRIPTION, TICKET_MODIFY, TICKET_VIEW, TIMELINE_VIEW,
+ TRAC_ADMIN, VERSIONCONTROL_ADMIN, WIKI_ADMIN, WIKI_CREATE, WIKI_DELETE,
+ WIKI_MODIFY, WIKI_RENAME, WIKI_VIEW
 
 ===== test_component_list_ok =====
 

Modified: incubator/bloodhound/vendor/trac/current/trac/attachment.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/attachment.py?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/trac/attachment.py (original)
+++ incubator/bloodhound/vendor/trac/current/trac/attachment.py Mon May 21 09:23:01 2012
@@ -20,6 +20,7 @@ from __future__ import with_statement
 
 from cStringIO import StringIO
 from datetime import datetime
+import errno
 import os.path
 import re
 import shutil
@@ -37,12 +38,13 @@ from trac.mimeview import *
 from trac.perm import PermissionError, IPermissionPolicy
 from trac.resource import *
 from trac.search import search_to_sql, shorten_result
-from trac.util import content_disposition, create_unique_file, get_reporter_id
+from trac.util import content_disposition, get_reporter_id
+from trac.util.compat import sha1
 from trac.util.datefmt import format_datetime, from_utimestamp, \
                               to_datetime, to_utimestamp, utc
 from trac.util.text import exception_to_unicode, path_to_unicode, \
                            pretty_size, print_table, unicode_quote, \
-                           unicode_unquote
+                           unicode_unquote, printerr
 from trac.util.translation import _, tag_
 from trac.web import HTTPBadRequest, IRequestHandler, RequestDone
 from trac.web.chrome import (INavigationContributor, add_ctxtnav, add_link,
@@ -166,6 +168,22 @@ class Attachment(object):
                                    _('Invalid Attachment'))
 
     def _get_path(self, parent_realm, parent_id, filename):
+        path = os.path.join(self.env.path, 'files', 'attachments',
+                            parent_realm)
+        hash = sha1(parent_id.encode('utf-8')).hexdigest()
+        path = os.path.join(path, hash[0:3], hash)
+        if filename:
+            path = os.path.join(path, self._get_hashed_filename(filename))
+        return os.path.normpath(path)
+
+    _extension_re = re.compile(r'\.[A-Za-z0-9]+\Z')
+
+    def _get_hashed_filename(self, filename):
+        hash = sha1(filename.encode('utf-8')).hexdigest()
+        match = self._extension_re.search(filename)
+        return hash + match.group(0) if match else hash
+
+    def _get_path_old(self, parent_realm, parent_id, filename):
         path = os.path.join(self.env.path, 'attachments', parent_realm,
                             unicode_quote(parent_id))
         if filename:
@@ -194,13 +212,14 @@ class Attachment(object):
             db("""
                 DELETE FROM attachment WHERE type=%s AND id=%s AND filename=%s
                 """, (self.parent_realm, self.parent_id, self.filename))
-            if os.path.isfile(self.path):
+            path = self.path
+            if os.path.isfile(path):
                 try:
-                    os.unlink(self.path)
+                    os.unlink(path)
                 except OSError, e:
                     self.env.log.error("Failed to delete attachment "
                                        "file %s: %s",
-                                       self.path,
+                                       path,
                                        exception_to_unicode(e, traceback=True))
                     raise TracError(_("Could not delete attachment"))
 
@@ -217,7 +236,7 @@ class Attachment(object):
         # Make sure the path to the attachment is inside the environment
         # attachments directory
         attachments_dir = os.path.join(os.path.normpath(self.env.path),
-                                       'attachments')
+                                       'files', 'attachments')
         commonprefix = os.path.commonprefix([attachments_dir, new_path])
         if commonprefix != attachments_dir:
             raise TracError(_('Cannot reparent attachment "%(att)s" as '
@@ -236,12 +255,13 @@ class Attachment(object):
             dirname = os.path.dirname(new_path)
             if not os.path.exists(dirname):
                 os.makedirs(dirname)
-            if os.path.isfile(self.path):
+            path = self.path
+            if os.path.isfile(path):
                 try:
-                    os.rename(self.path, new_path)
+                    os.rename(path, new_path)
                 except OSError, e:
                     self.env.log.error("Failed to move attachment file %s: %s",
-                                       self.path,
+                                       path,
                                        exception_to_unicode(e, traceback=True))
                     raise TracError(_("Could not reparent attachment %(name)s",
                                       name=self.filename))
@@ -275,25 +295,19 @@ class Attachment(object):
         # Make sure the path to the attachment is inside the environment
         # attachments directory
         attachments_dir = os.path.join(os.path.normpath(self.env.path),
-                                       'attachments')
-        commonprefix = os.path.commonprefix([attachments_dir, self.path])
+                                       'files', 'attachments')
+        dir = self.path
+        commonprefix = os.path.commonprefix([attachments_dir, dir])
         if commonprefix != attachments_dir:
             raise TracError(_('Cannot create attachment "%(att)s" as '
                               '%(realm)s:%(id)s is invalid', 
                               att=filename, realm=self.parent_realm,
                               id=self.parent_id))
 
-        if not os.access(self.path, os.F_OK):
-            os.makedirs(self.path)
-        filename = unicode_quote(filename)
-        path, targetfile = create_unique_file(os.path.join(self.path,
-                                                           filename))
+        if not os.access(dir, os.F_OK):
+            os.makedirs(dir)
+        filename, targetfile = self._create_unique_file(dir, filename)
         with targetfile:
-            # Note: `path` is an unicode string because `self.path` was one.
-            # As it contains only quoted chars and numbers, we can use `ascii`
-            basename = os.path.basename(path).encode('ascii')
-            filename = unicode_unquote(basename)
-
             with self.env.db_transaction as db:
                 db("INSERT INTO attachment VALUES (%s,%s,%s,%s,%s,%s,%s,%s)",
                    (self.parent_realm, self.parent_id, filename, self.size,
@@ -363,19 +377,107 @@ class Attachment(object):
                     attachment_dir, exception_to_unicode(e, traceback=True))
             
     def open(self):
-        self.env.log.debug('Trying to open attachment at %s', self.path)
+        path = self.path
+        self.env.log.debug('Trying to open attachment at %s', path)
         try:
-            fd = open(self.path, 'rb')
+            fd = open(path, 'rb')
         except IOError:
             raise ResourceNotFound(_("Attachment '%(filename)s' not found",
                                      filename=self.filename))
         return fd
 
+    def _create_unique_file(self, dir, filename):
+        parts = os.path.splitext(filename)
+        flags = os.O_CREAT + os.O_WRONLY + os.O_EXCL
+        if hasattr(os, 'O_BINARY'):
+            flags += os.O_BINARY
+        idx = 1
+        while 1:
+            path = os.path.join(dir, self._get_hashed_filename(filename))
+            try:
+                return filename, os.fdopen(os.open(path, flags, 0666), 'w')
+            except OSError, e:
+                if e.errno != errno.EEXIST:
+                    raise
+                idx += 1
+                # A sanity check
+                if idx > 100:
+                    raise Exception('Failed to create unique name: ' + path)
+                filename = '%s.%d%s' % (parts[0], idx, parts[1])
+
+
+class AttachmentSetup(Component):
+
+    implements(IEnvironmentSetupParticipant)
+
+    required = True
+
+    # IEnvironmentSetupParticipant methods
+
+    def environment_created(self):
+        """Create the attachments directory."""
+        path = self.env.path
+        if path:
+            os.makedirs(os.path.join(path, 'files', 'attachments'))
+
+    def environment_needs_upgrade(self, db):
+        path = self.env.path
+        if path:
+            return os.path.exists(os.path.join(path, 'attachments'))
+
+    def upgrade_environment(self, db):
+        """Migrate attachments from old-style directory to new-style
+        directory.
+        """
+        path = self.env.path
+        old_dir = os.path.join(path, 'attachments')
+        old_stat = os.stat(old_dir)
+        new_dir = os.path.join(path, 'files', 'attachments')
+        if not os.path.exists(new_dir):
+            os.makedirs(new_dir)
+
+        for row in db("""
+                SELECT type, id, filename, description, size, time, author,
+                ipnr FROM attachment ORDER BY type, id"""):
+            attachment = Attachment(self.env, row[0], row[1])
+            attachment._from_database(*row[2:])
+            self._move_attachment_file(attachment)
+
+        # Try to preserve permissions and ownerships of the attachments
+        # directory for $ENV/files
+        for dir, dirs, files in os.walk(os.path.join(path, 'files')):
+            try:
+                if hasattr(os, 'chmod'):
+                    os.chmod(dir, old_stat.st_mode)
+                if hasattr(os, 'chflags') and hasattr(old_stat, 'st_flags'):
+                    os.chflags(dir, old_stat.st_flags)
+                if hasattr(os, 'chown'):
+                    os.chown(dir, old_stat.st_uid, old_stat.st_gid)
+            except OSError:
+                pass
+
+        try:
+            for dir, dirs, files in os.walk(old_dir, topdown=False):
+                os.rmdir(dir)
+        except OSError, e:
+            self.log.error("Can't delete old attachments directory %s: %s",
+                           old_dir, exception_to_unicode(e, traceback=True))
+            printerr(_("Error while deleting old attachments directory. "
+                       "Please move or remove files in\nthe directory and try "
+                       "again."))
+            raise
+
+    def _move_attachment_file(self, attachment):
+        old_path = attachment._get_path_old(attachment.parent_realm,
+                                            attachment.parent_id,
+                                            attachment.filename)
+        if os.path.isfile(old_path):
+            os.renames(old_path, attachment.path)
+
 
 class AttachmentModule(Component):
 
-    implements(IEnvironmentSetupParticipant, IRequestHandler,
-               INavigationContributor, IWikiSyntaxProvider,
+    implements(IRequestHandler, INavigationContributor, IWikiSyntaxProvider,
                IResourceManager)
 
     change_listeners = ExtensionPoint(IAttachmentChangeListener)
@@ -404,19 +506,6 @@ class AttachmentModule(Component):
         For public sites where anonymous users can create attachments it is
         recommended to leave this option disabled (which is the default).""")
 
-    # IEnvironmentSetupParticipant methods
-
-    def environment_created(self):
-        """Create the attachments directory."""
-        if self.env.path:
-            os.mkdir(os.path.join(self.env.path, 'attachments'))
-
-    def environment_needs_upgrade(self, db):
-        return False
-
-    def upgrade_environment(self, db):
-        pass
-
     # INavigationContributor methods
 
     def get_active_navigation_item(self, req):
@@ -771,6 +860,7 @@ class AttachmentModule(Component):
         for attachment in attachments:
             zipinfo = ZipInfo()
             zipinfo.filename = attachment.filename.encode('utf-8')
+            zipinfo.flag_bits |= 0x800 # filename is encoded with utf-8
             zipinfo.date_time = attachment.date.utctimetuple()[:6]
             zipinfo.compress_type = ZIP_DEFLATED
             if attachment.description:

Added: incubator/bloodhound/vendor/trac/current/trac/htdocs/batchmodify.png
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/htdocs/batchmodify.png?rev=1340948&view=auto
==============================================================================
Binary file - no diff available.

Propchange: incubator/bloodhound/vendor/trac/current/trac/htdocs/batchmodify.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Modified: incubator/bloodhound/vendor/trac/current/trac/htdocs/css/report.css
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/htdocs/css/report.css?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/trac/htdocs/css/report.css (original)
+++ incubator/bloodhound/vendor/trac/current/trac/htdocs/css/report.css Mon May 21 09:23:01 2012
@@ -212,3 +212,47 @@ table.tickets tbody tr.fullrow th { 
   text-align: center;
   font-size: 85%;
 }
+
+/* Batchmod Form */
+
+#batchmod_form fieldset input#batchmod_submit { font-size: 14px; }
+#batchmod_form fieldset input[type="button"]{ padding: 0.1em 0.5em; }
+#batchmod_form fieldset { margin-top: 1em }
+#batchmod_form fieldset.collapsed { 
+ border-width: 0;
+ margin-bottom: 0pt;
+ padding: 0pt .5em;
+}
+.batchmod_property { width: 100%; }
+.batchmod_required:before { content: " * "; }
+
+#batchmod_form fieldset input,
+#batchmod_form fieldset select,
+.batchmod_property,
+.batchmod_label {
+    font-size: 11px;
+}
+
+#batchmod_action { line-height: 2em }
+
+#batchmod_form th {
+    text-align: right;
+    white-space: nowrap;
+    font-size: 11px;
+}
+
+.batchmod_required {
+    color: red;
+    font-size: 11px;
+    font-weight: bold;
+    font-style: italic;
+    padding-left: .5em;
+}
+
+#batchmod_help {
+ clear: both;
+ color: #999;
+ margin: 1em;
+ text-align: right;
+}
+#batchmod_help :link, #batchmod_help :visited { cursor: help }
\ No newline at end of file

Modified: incubator/bloodhound/vendor/trac/current/trac/htdocs/css/timeline.css
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/htdocs/css/timeline.css?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/trac/htdocs/css/timeline.css (original)
+++ incubator/bloodhound/vendor/trac/current/trac/htdocs/css/timeline.css Mon May 21 09:23:01 2012
@@ -54,6 +54,7 @@ dt.newticket, dt.newticket a { backgroun
 dt.reopenedticket, dt.reopenedticket a { background-image: url(../newticket.png) !important }
 dt.editedticket, dt.editedticket a { background-image: url(../editedticket.png) !important }
 dt.closedticket, dt.closedticket a { background-image: url(../closedticket.png) !important }
+dt.batchmodify, dt.batchmodify a { background-image: url(../batchmodify.png) !important }
 dt.wiki, dt.wiki a { background-image: url(../wiki.png) !important }
 dt.milestone, dt.milestone a { background-image: url(../milestone.png) !important }
 dt.attachment, dt.attachment a { background-image: url(../attachment.png) !important }

Modified: incubator/bloodhound/vendor/trac/current/trac/htdocs/js/jquery.js
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/htdocs/js/jquery.js?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/bloodhound/vendor/trac/current/trac/htdocs/js/query.js
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/htdocs/js/query.js?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/bloodhound/vendor/trac/current/trac/htdocs/js/timeline_multirepos.js
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/htdocs/js/timeline_multirepos.js?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/bloodhound/vendor/trac/current/trac/htdocs/js/workflow_graph.js
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/htdocs/js/workflow_graph.js?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
Binary files - no diff available.

Modified: incubator/bloodhound/vendor/trac/current/trac/locale/en_GB/LC_MESSAGES/tracini.po
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/locale/en_GB/LC_MESSAGES/tracini.po?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/trac/locale/en_GB/LC_MESSAGES/tracini.po (original)
+++ incubator/bloodhound/vendor/trac/current/trac/locale/en_GB/LC_MESSAGES/tracini.po Mon May 21 09:23:01 2012
@@ -1781,25 +1781,25 @@ msgstr ""
 
 #: trac/web/chrome.py:368
 msgid ""
-"Location of the jQuery !JavaScript library (version 1.5.1).\n"
+"Location of the jQuery !JavaScript library (version 1.7.2).\n"
 "\n"
 "An empty value loads jQuery from the copy bundled with Trac.\n"
 "\n"
 "Alternatively, jQuery could be loaded from a CDN, for example:\n"
-"http://code.jquery.com/jquery-1.5.1.min.js,\n"
-"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js or\n"
-"https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js.\n"
+"http://code.jquery.com/jquery-1.7.2.min.js,\n"
+"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js or\n"
+"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js.\n"
 "\n"
 "(''since 0.13'')"
 msgstr ""
-"Location of the jQuery !JavaScript library (version 1.5.1).\n"
+"Location of the jQuery !JavaScript library (version 1.7.2).\n"
 "\n"
 "An empty value loads jQuery from the copy bundled with Trac.\n"
 "\n"
 "Alternatively, jQuery could be loaded from a CDN, for example:\n"
-"http://code.jquery.com/jquery-1.5.1.min.js,\n"
-"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js or\n"
-"https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js.\n"
+"http://code.jquery.com/jquery-1.7.2.min.js,\n"
+"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js or\n"
+"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js.\n"
 "\n"
 "(''since 0.13'')"
 

Modified: incubator/bloodhound/vendor/trac/current/trac/locale/fr/LC_MESSAGES/tracini.po
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/locale/fr/LC_MESSAGES/tracini.po?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/trac/locale/fr/LC_MESSAGES/tracini.po (original)
+++ incubator/bloodhound/vendor/trac/current/trac/locale/fr/LC_MESSAGES/tracini.po Mon May 21 09:23:01 2012
@@ -1190,14 +1190,14 @@ msgstr ""
 
 #: trac/web/chrome.py:368
 msgid ""
-"Location of the jQuery !JavaScript library (version 1.5.1).\n"
+"Location of the jQuery !JavaScript library (version 1.7.2).\n"
 "\n"
 "An empty value loads jQuery from the copy bundled with Trac.\n"
 "\n"
 "Alternatively, jQuery could be loaded from a CDN, for example:\n"
-"http://code.jquery.com/jquery-1.5.1.min.js,\n"
-"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js or\n"
-"https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js.\n"
+"http://code.jquery.com/jquery-1.7.2.min.js,\n"
+"http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.2.min.js or\n"
+"https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js.\n"
 "\n"
 "(''since 0.13'')"
 msgstr ""

Modified: incubator/bloodhound/vendor/trac/current/trac/locale/hu/LC_MESSAGES/messages-js.po
URL: http://svn.apache.org/viewvc/incubator/bloodhound/vendor/trac/current/trac/locale/hu/LC_MESSAGES/messages-js.po?rev=1340948&r1=1340947&r2=1340948&view=diff
==============================================================================
--- incubator/bloodhound/vendor/trac/current/trac/locale/hu/LC_MESSAGES/messages-js.po (original)
+++ incubator/bloodhound/vendor/trac/current/trac/locale/hu/LC_MESSAGES/messages-js.po Mon May 21 09:23:01 2012
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: Trac 0.12\n"
 "Report-Msgid-Bugs-To: trac-dev@googlegroups.com\n"
-"POT-Creation-Date: 2010-05-24 23:55+0200\n"
+"POT-Creation-Date: 2012-02-10 02:32+0100\n"
 "PO-Revision-Date: 2011-11-01 10:17+0100\n"
 "Last-Translator: Nagy Zoltán <nz...@freemail.hu>\n"
 "Language-Team: hu_HU <tr...@googlegroups.com>\n"
@@ -15,7 +15,7 @@ msgstr ""
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
-"Generated-By: Babel 0.9.5\n"
+"Generated-By: Babel 0.9.6\n"
 
 #: trac/htdocs/js/blame.js:84
 msgid "(no changeset information)"
@@ -41,20 +41,20 @@ msgstr "Alkönyvtár kibontása he
 msgid "Re-expand directory"
 msgstr "Könyvtár ismételt kibontása"
 
-#: trac/htdocs/js/expand_dir.js:120
+#: trac/htdocs/js/expand_dir.js:121
 #, python-format
 msgid "Loading %(entry)s..."
 msgstr "A(z) %(entry)s betöltése..."
 
-#: trac/htdocs/js/expand_dir.js:148
+#: trac/htdocs/js/expand_dir.js:149
 msgid "(empty)"
 msgstr "(üres)"
 
-#: trac/htdocs/js/expand_dir.js:156
+#: trac/htdocs/js/expand_dir.js:157
 msgid "(error)"
 msgstr "(hiba)"
 
-#: trac/htdocs/js/expand_dir.js:163
+#: trac/htdocs/js/expand_dir.js:164
 msgid "Fold directory"
 msgstr "Könyvtár összehajtása"
 
@@ -68,27 +68,27 @@ msgstr "A(z) %(title)s megjeleníté
 msgid "%(title)s (click to hide column)"
 msgstr "%(title)s (kattintson az oszlop elrejtéséhez)"
 
-#: trac/htdocs/js/query.js:118
+#: trac/htdocs/js/query.js:131
 msgid "A filter already exists for that property"
 msgstr "A jellemzőhöz már létezik szűrő"
 
-#: trac/htdocs/js/query.js:145
+#: trac/htdocs/js/query.js:158
 msgid "or"
 msgstr "vagy"
 
-#: trac/htdocs/js/query.js:164
+#: trac/htdocs/js/query.js:177
 msgid "yes"
 msgstr "igen"
 
-#: trac/htdocs/js/query.js:167
+#: trac/htdocs/js/query.js:180
 msgid "no"
 msgstr "nem"
 
-#: trac/htdocs/js/query.js:170
+#: trac/htdocs/js/query.js:183
 msgid "between"
 msgstr "között"
 
-#: trac/htdocs/js/query.js:172
+#: trac/htdocs/js/query.js:185
 msgid "and"
 msgstr "és"
 



Re: svn commit: r1340948 [1/6] - in /incubator/bloodhound/vendor/trac/current: ./ contrib/ trac/ trac/admin/tests/ trac/htdocs/ trac/htdocs/css/ trac/htdocs/js/ trac/locale/ trac/locale/en_GB/LC_MESSAGES/ trac/locale/fr/LC_MESSAGES/ trac/locale/hu/LC_MESSA...

Posted by Gary <ga...@wandisco.com>.
Hi,

Just in the process of updating our vendor copy of trac, in particular 
to see if we can take advantage of the built-in batch modify 
functionality. This is associated with ticket 
https://issues.apache.org/bloodhound/ticket/74 but may touch on other areas.

Cheers,
     Gary


On 05/21/2012 10:23 AM, gjm@apache.org wrote:
> Author: gjm
> Date: Mon May 21 09:23:01 2012
> New Revision: 1340948
>
> URL: http://svn.apache.org/viewvc?rev=1340948&view=rev
> Log:
> trac vendor code - update current to trunk rev 11046
>