gnperumal / codeswarm

Automatically exported from code.google.com/p/codeswarm
GNU General Public License v3.0
0 stars 0 forks source link

Patch to allow svn xml log parsing #77

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We have used gource (which takes svn xml files) in the past to generate movies, 
and already have an xml cleaner script that weeds out various external and 
configuration files from the logs before making the movies.  The following 
patch allows convert_logs.py to handle xml logs:
--- convert_logs/convert_logs.py        2012-12-13 18:43:16.877498000 -0600
+++ codeswarm-0.1/convert_logs/convert_logs.py  2009-05-15 01:48:56.000000000 
-0500
@@ -128,26 +128,7 @@
                             ch_path = path[2:].replace("\n", "").replace("\"", "")
                         event_list.append(Event(ch_path, date, author))
                         path = file_handle.readline()
-               elif line.startswith('<logentry'):
-                       author_line = file_handle.readline()
-                       while not author_line.startswith('<author>'):
-                               author_line = file_handle.readline()
-                       author = author_line[8:-10]
-                       date_line = file_handle.readline()
-                       while not date_line.startswith('<date>'):
-                               date_line = file_handle.readline()
-                       date = date_line[6:-16]
-                       date = ' '.join(date.split('T'))
-                       date = time.strptime(date, '%Y-%m-%d %H:%M:%S')
-                       date = int(time.mktime(date))*1000
-                       while not line.startswith('</paths>'):
-                               line = file_handle.readline().strip()
-                               if line.endswith('</path>'):
-                                       line = line[: -7]
-                                       path = line[line.rfind('>') + 1:]
-                                       if path[0] == '"':
-                                               path = path.strip('"')
-                                       event_list.append(Event(path, date, 
author))
+                    
                 line = file_handle.readline()
             file_handle.close()

Original issue reported on code.google.com by jeffreym...@gmail.com on 14 Dec 2012 at 6:40