Revision: 6386
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6386&view=rev
Author:   gerkey
Date:     2008-04-28 12:31:06 -0700 (Mon, 28 Apr 2008)

Log Message:
-----------
added tool to compile author lists for source files

Added Paths:
-----------
    code/player/trunk/server/codetools/authorcheck.py

Added: code/player/trunk/server/codetools/authorcheck.py
===================================================================
--- code/player/trunk/server/codetools/authorcheck.py                           
(rev 0)
+++ code/player/trunk/server/codetools/authorcheck.py   2008-04-28 19:31:06 UTC 
(rev 6386)
@@ -0,0 +1,62 @@
+#!/usr/bin/env python
+
+import sys
+import popen2
+
+USAGE = 'USAGE: authorcheck.py <path> > outfile'
+
+
+if len(sys.argv) < 2:
+  print USAGE
+  sys.exit(-1)
+
+prefix = '/code/player/trunk/'
+
+cmdline = 'svn log -v ' + sys.argv[1]
+
+outf, inf = popen2.popen2(cmdline)
+
+outp = outf.read()
+
+outl = outp.split('\n')
+
+db = dict()
+
+awaiting_dashes = -1
+awaiting_rev = 0
+awaiting_changed = 1
+reading_files = 2
+state = awaiting_dashes
+author = ''
+
+for line in outl:
+  lsplit = line.split()
+
+  if state == awaiting_dashes:
+    if line == 
'------------------------------------------------------------------------':
+      state = awaiting_rev
+  elif state == awaiting_rev:
+    if len(line) == 0:
+      continue
+    if line[0] == 'r':
+      author = lsplit[2]
+      state = awaiting_changed
+  elif state == awaiting_changed:
+    state = reading_files
+  else:
+    if len(line) == 0:
+      state = awaiting_dashes
+    else:
+      file = lsplit[1]
+      if file[len(prefix):len(prefix)+len(sys.argv[1])] == sys.argv[1] and 
file.find('.') != -1 and (file[-1] == 'c' or file[-1] == 'h' or file[-3:] == 
'cpp'):
+        file = file[len(prefix):]
+        if not db.has_key(author):
+          db[author] = set()
+        db[author].add(file)
+
+for f in db:
+  print '----------------\n'
+  print f + ':'
+  for a in db[f]:
+    print a
+  print ''


Property changes on: code/player/trunk/server/codetools/authorcheck.py
___________________________________________________________________
Name: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to