Support replaces.
Wed Sep 7 16:59:52 UTC 2005 Alberto Bertogli <albertogli@telpin.com.ar>
* Support replaces.
diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi
--- old-darcsweb/darcsweb.cgi 2014-04-26 19:11:09.000000000 +0000
+++ new-darcsweb/darcsweb.cgi 2014-04-26 19:11:09.000000000 +0000
@@ -381,6 +381,7 @@
self.modifies = {}
self.diradds = []
self.dirremoves = []
+ self.replaces = {}
self.moves = {}
def tostr(self):
@@ -485,6 +486,14 @@
dst = fixu8(attrs.get('to', None))
p = self.db[self.current]
p.moves[src] = dst
+ elif name == 'replaced_tokens':
+ if self.cur_val:
+ self.cur_file = fixu8(self.cur_val.strip())
+ cf = self.cur_file
+ p = self.db[self.current]
+ if not p.replaces.has_key(cf):
+ p.replaces[cf] = 0
+ p.replaces[cf] = int(attrs.get('num', None))
else:
self.cur_elem = None
@@ -501,6 +510,8 @@
return
if self.cur_elem == 'created_as':
return
+ if name == 'replaced_tokens':
+ return
if name == 'name':
p = self.db[self.current]
@@ -1079,7 +1090,7 @@
print '<div class="page_body">', c, '</div>'
changed = p.adds + p.removes + p.modifies.keys() + p.moves.keys() + \
- p.diradds + p.dirremoves
+ p.diradds + p.dirremoves + p.replaces.keys()
if changed or p.moves:
n = len(changed)
@@ -1132,6 +1143,10 @@
print '<td><span style="color:#800000">',
print '[removed dir]',
print '</span></td>'
+ elif p.replaces.has_key(f):
+ print '<td><span style="color:#800000">',
+ print '[replaced %d tokens]' % p.replaces[f],
+ print '</span></td>'
elif p.moves.has_key(f):
print '<td><span style="color:#000080">',
print '[moved to "%s"]' % p.moves[f]