Changeset 4058

Show
Ignore:
Timestamp:
07/24/08 07:16:22 (4 months ago)
Author:
e2jk
Message:

Implementing #3435 (Add date/time info to changeset list)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ticketmodifiedfilesplugin/0.11/setup.py

    r4057 r4058  
    44    name='TicketModifiedFiles', 
    55    description='Trac plugin that lists the files that have been modified while resolving a ticket.', 
    6     version='0.8.1', 
     6    version='0.9', 
    77    license='BSD-ish (see the COPYING.txt file)', 
    88    author='Emilien Klein', 
  • ticketmodifiedfilesplugin/0.11/ticketmodifiedfiles/templates/ticketmodifiedfiles.html

    r4057 r4058  
    9595            <h3 class="backtonormalflow"><a id="changesetslink" href="#" onclick="javascript:togglevisibility('listofchangesets'); return false;">Display the list of changesets relative to this ticket.</a></h3> 
    9696            <dl id="listofchangesets"> 
    97             <py:for each="rev, author in revisions"> 
     97            <py:for each="rev, author, date in revisions"> 
    9898                          <dt class="changeset"> 
    9999                            <a href="${href.changeset(rev)}"> 
     
    102102                                  by 
    103103                                  <span class="author">${author}</span> 
     104                  <span class="time">(${date})</span> 
    104105                            </a> 
    105106                          </dt> 
  • ticketmodifiedfilesplugin/0.11/ticketmodifiedfiles/ticketmodifiedfiles.py

    r4036 r4058  
    44 
    55import re 
     6from time import strftime, strptime 
    67 
    78import genshi.filters 
     
    112113        cursor = db.cursor() 
    113114        #Retrieve all the revisions which's messages contain "#<TICKETID>" 
    114         cursor.execute("SELECT rev, author, message FROM revision WHERE message LIKE '%#" + str(id) + "%'") 
    115         for rev, author, message, in cursor: 
     115        cursor.execute("SELECT rev, datetime(time, 'unixepoch', 'localtime') as date, author, message FROM revision WHERE message LIKE '%#" + str(id) + "%'") 
     116        for rev, date, author, message, in cursor: 
    116117            #Filter out non-related revisions. 
    117118            #for instance, you are lookink for #19, so you don't want #190, #191, #192, etc. to interfere 
     
    127128                 
    128129            if validrevision: 
     130                date = strftime("%d/%m/%Y %H:%M", strptime(date, "%Y-%m-%d %H:%M:%S")) 
    129131                cursor2 = db.cursor() 
    130132                cursor2.execute("SELECT path FROM node_change WHERE rev=" + rev) 
    131                 revisions.append((rev, author)) 
     133                revisions.append((rev, author, date)) 
    132134                for path, in cursor2: 
    133135                    files.append(path)