Maintaining the Tycoon Trac

4/9/2007::

(klai) Experimented with Trac 0.11. Disastrous. Deal-breaker is need to convert custom templates from ClearSilver? to Genshi format.

1/9/2007::

(klai) Triggered an upgrade cycle up updating Mercurial.

5/23/2006::

(klai) Upgraded to trunk r3344 to try to fix hg changeset and self account registration problems

  • Had to patch Trac Mercurial plugin because hg looks for sys.argv, which doesn't exist in mod_python:
    Index: tracvc/hg/backend.py
    ===================================================================
    --- tracvc/hg/backend.py        (revision 3346)
    +++ tracvc/hg/backend.py        (working copy)
    @@ -24,6 +24,9 @@
     from trac.wiki import IWikiSyntaxProvider
     from trac.core import *
    
    +import sys
    +sys.argv = ()
    +
     try:
         from mercurial import hg
         from mercurial.ui import ui
    @@ -229,6 +232,17 @@
             log = self.repo.changelog
             return log.rev(self.hg_node(rev1)) < log.rev(self.hg_node(rev2))
    
    +    def get_changes(self, old_path, old_rev, new_path, new_rev,
    +                    ignore_ancestry=1):
    +        """
    +        Generator that yields change tuples (old_node, new_node, kind, change)
    +        for each node change between the two arbitrary (path,rev) pairs.
    +
    +        The old_node is assumed to be None when the change is an ADD,
    +        the new_node is assumed to be None when the change is a DELETE.
    +        """
    +        return ()
    +
    
  • The above patch also prevents an error when looking at arbitrary diffs, which seemed to cause unbounded CPU utilization in httpd.
  • Changeset links now work
  • Image attachments can now be referred to as just
    [Image(JeanLeonGeromeTheCarpetMarket.jpg, float:right)]]
    
  • Account manager was bugged. Fixed using the following patches:
    Index: acct_mgr/htfile.py
    ===================================================================
    --- acct_mgr/htfile.py  (revision 783)
    +++ acct_mgr/htfile.py  (working copy)
    @@ -73,20 +73,22 @@
         def _update_file(self, prefix, userline):
             filename = self._get_filename()
             written = False
    +        import tempfile, os, shutil
    +        new_file = tempfile.NamedTemporaryFile()
             if os.path.exists(filename):
    -            for line in fileinput.input(filename, inplace=True):
    +            for line in file(filename, "r").readlines():
                     if line.startswith(prefix):
                         if not written and userline:
    -                        print userline
    +                        print >>new_file, userline
                         written = True
                     else:
    -                    print line,
    -        if userline:
    -            f = open(filename, 'a')
    -            try:
    -                print >>f, userline
    -            finally:
    -                f.close()
    +                    print >>new_file, line,
    +        if userline and not written:
    +            print >>new_file, userline
    +        new_file.flush()
    +        #os.rename(new_file.name, filename)
    +        s = shutil.copyfile(new_file.name, filename)
    +        new_file.close()
             return written
    
    
    Index: trac/web/session.py
    ===================================================================
    --- trac/web/session.py (revision 3344)
    +++ trac/web/session.py (working copy)
    @@ -116,7 +116,11 @@
             cursor = db.cursor()
             cursor.execute("SELECT authenticated FROM session "
                            "WHERE sid=%s OR sid=%s ", (sid, self.req.authname))
    -        authenticated_flags = [row[0] for row in cursor.fetchall()]
    +        f = cursor.fetchall()
    +        if f:
    +            authenticated_flags = [row[0] for row in f]
    +        else:
    +            authenticated_flags = ()
    
             if len(authenticated_flags) == 2:
                 # There's already an authenticated session for the user, we
    
    
  • Bug: Cannot see diffs between versions
  • More documentation at http://projects.edgewall.com/trac/wiki/TracMercurial
  • Versions:
Programrevision
tracr3344
mercurial-pluginr3344
accountmanagerpluginr783
webadminr3344

3/16/2006::

(klai) Upgraded to 0.10dev because TracMercurial plugin was updated

2/2/2006::

(klai) Aborted upgrade from Trac 0.9 to 0.9.3 for security patches. This consisted of the following steps:

  • Install 0.9.3 RPM
  • Remove /etc/httpd/conf.d/trac.conf
  • Get new version of account management and webadmin plugins
  • Web admin still did not work. Forgot to remove .zip extension from egg. Works now.
  • Mercurial plugin is incompatible.
  • Abandon patch of Trac macro.py code in favor of fixing Image reference by changing
    [Image(JeanLeonGeromeTheCarpetMarket.jpg, float:right, width: 20em)]]
    
    to
    [Image(wiki:WikiStart:JeanLeonGeromeTheCarpetMarket.jpg, float:right, width: 20em)]]
    
  • Aborted because of Mercurial incompatibility. Will resume when Trac 0.10 is released.