Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Trac: Users

[PATCH] - Add Filename affected by a changeset to the TimeLine view (with color)

 

 

Trac users RSS feed   Index | Next | Previous | View Threaded


fharvey at securiweb

Jul 22, 2004, 10:36 PM

Post #1 of 1 (133 views)
Permalink
[PATCH] - Add Filename affected by a changeset to the TimeLine view (with color)

Hi trac team :)

My second patch for trac

This patch add Filename support to ChangeSet in the TimeLine view (With
color)

== Ascii Screenshot ==

11:28:06 : Changeset [65] by fharvey
src/goconv.bat: Lanceur de la conversion SIRTF/CFP
10:30:39 : Changeset [64] by fharvey
src/domaine_commun.php: Rajout du chargements des ?l?ments de structure
10:06:33 : Changeset [63] by fharvey
src/domaine_drs.php: Modification pour les lignes uniques des DRS
10:02:35 : Changeset [61] by fharvey
adodb/adodb-php4.inc.php, adodb/toexport.inc.php,
adodb/adodb-xmlschema.inc.php, ...: Mise a jour a la derniere version de
ADODB


Francois Harvey
SecuriWeb inc.


-------------- next part --------------
--- htdocs/css/timeline.css (revision 479)
+++ htdocs/css/timeline.css (working copy)
@@ -49,3 +49,7 @@
vertical-align: text-top;
margin: 0;
}
+.diff-unmod { color: #000 }
+.diff-rem { color: #e00; }
+.diff-add { color: #2e2; }
+.diff-mod { color: #e84; }
Index: trac/Timeline.py
===================================================================
--- trac/Timeline.py (revision 479)
+++ trac/Timeline.py (working copy)
@@ -101,14 +101,39 @@
'type': int(row['type']),
'message': row['message'] or '',
'author': escape(row['author'])
-}
-
+ }
+
if item['type'] == CHANGESET:
item['changeset_href'] = self.env.href.changeset(item['idata'])
item['shortmsg'] = wiki_to_oneliner(shorten_line(item['message']),
self.req.hdf, self.env)
item['message'] = wiki_to_oneliner(item['message'],
self.req.hdf, self.env)
+ cursor_node = self.db.cursor ()
+ cursor_node.execute("SELECT name, change "
+ "FROM node_change WHERE rev=%d" % (int(item['idata'])))
+
+ node_list = ''
+ node_data = ''
+ node_count = 0;
+ while 1:
+ row_node = cursor_node.fetchone()
+ if not row_node:
+ break
+ if node_count != 0:
+ node_list += ', '
+ if node_count >= 3:
+ node_list += '...'
+ break;
+ if row_node['change'] == 'A':
+ node_data = '<span class="diff-add">' + row_node['name'] + "</span>"
+ elif row_node['change'] == 'M':
+ node_data = '<span class="diff-mod">' + row_node['name'] + "</span>"
+ elif row_node['change'] == 'D':
+ node_data = '<span class="diff-rem">' + row_node['name'] + "</span>"
+ node_list += node_data
+ node_count += 1
+ item['node_list'] = node_list
elif item['type'] == WIKI:
item['wiki_href'] = self.env.href.wiki(row['tdata'])
item['message'] = wiki_to_oneliner(shorten_line(item['message']),
Index: templates/timeline.cs
===================================================================
--- templates/timeline.cs (revision 479)
+++ templates/timeline.cs (working copy)
@@ -63,7 +63,7 @@
<?cs if:item.type == #1 ?><!-- Changeset -->
<?cs call:tlitem(item.changeset_href, 'changeset.png',
'Changeset <b class="tl-item-link">['+$item.idata+']</b>
- by '+$item.author, item.message) ?>
+ by '+$item.author, $item.node_list+': '+$item.message) ?>
<?cs elif:item.type == #2 ?><!-- New ticket -->
<?cs call:tlitem(item.ticket_href, 'newticket.png',
'Ticket <b class="tl-item-link">#'+$item.idata+'</b>

Trac users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.