DokuWiki

It's better when it's simple

User Tools

Site Tools


tips:gource_analysis

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tips:gource_analysis [2010-05-17 13:50] – change script to split on tabs rather than space 193.9.13.134tips:gource_analysis [2010-05-17 18:39] andi
Line 1: Line 1:
-I am fond of the wonderful videos made with Gource. This tool makes a representation of changes made on a version control system like git or SVN. Then I remember that DokuWiki is also a version control system like any other ... Just have a look in the folder tree to find the directory **dokuwiki/data/meta** in which the files ***. changes** contain exactly the information needed. +====== Visualize Changes in Gource ====== 
 + 
 +I am fond of the wonderful videos made with [[http://code.google.com/p/gource/|Gource]]. This tool makes a representation of changes made on a version control system like git or SVN. Then I remember that DokuWiki is also a version control system like any other ... Just have a look in the folder tree to find the directory ''dokuwiki/data/meta'' in which the files ''*.changes'' contain exactly the information needed. 
  
  
Line 30: Line 32:
        read them and output them in gource's log syntax        read them and output them in gource's log syntax
     """     """
 +    WHITE = "FFFFFF"
 +    GREEN = "00F000"
 +    start_page_name = "start"
     for root, dirs, files in os.walk(path):     for root, dirs, files in os.walk(path):
         for i in files:         for i in files:
Line 37: Line 42:
                 for line in myfile.readlines():                 for line in myfile.readlines():
                     mots = line.split('\t')                     mots = line.split('\t')
-                    if len(mots)>=5:+                    if len(mots)>=6:
                         resultat = mots[0] + "|"                         resultat = mots[0] + "|"
                         if mots[4] == '':                         if mots[4] == '':
Line 43: Line 48:
                         resultat += mots[4] + "|"                         resultat += mots[4] + "|"
                         resultat += translate(mots[2]) + "|"                         resultat += translate(mots[2]) + "|"
-                        resultat += fichier+                        resultat += mots[3].replace(':', '/'
 +                        if mots[3].rfind(start_page_name) == len(mots[3])-len(start_page_name): 
 +     resultat += "|" + WHITE 
 +                        else: 
 +                            resultat += "|" + GREEN
                         print resultat                         print resultat
-                    elif len(mots)==4:+                    else:
                         resultat = mots[0] + "|Anonymous|"                         resultat = mots[0] + "|Anonymous|"
                         resultat += translate(mots[2]) + "|"                         resultat += translate(mots[2]) + "|"
                         resultat += fichier                         resultat += fichier
 +                        resultat += "|FFFFFF"
                         print resultat                         print resultat
                 myfile.close()                 myfile.close()
Line 54: Line 64:
 def translate(mot): def translate(mot):
     """translate the dokuwiki vocabulary to the gource one     """translate the dokuwiki vocabulary to the gource one
-       C -> A +       (also cc and sc from discussion plugin) ->A 
-       E -> M+       (also ec from discussion plugin) -> M 
 +       D (also dc and hc from discssion plugin) -> D
        other -> M         other -> M 
     """     """
-    if mot == "C":+    if mot.upper == "C" or mot == 'cc' or mot == 'sc':
         return "A"         return "A"
-    elif mot == "E":+    elif mot.upper == "E" or mot == 'ec':
         return "M"         return "M"
 +    elif mot.upper == "D" or mot == 'dc' or mot == 'hc':
 +        return "D"
     else:     else:
         return "M"         return "M"
Line 97: Line 110:
 if __name__ == "__main__": if __name__ == "__main__":
     main(sys.argv[1:])     main(sys.argv[1:])
- 
-</code> 
- 
-launch the script inside your dokuwiki directory : 
-<code bash> 
-python gourcedoku.py -d ~/Sites/MyDokuwiki/ | sort > dokusort.log 
 </code> </code>
 then you can use Gource to watch logs : then you can use Gource to watch logs :
tips/gource_analysis.txt · Last modified: 2010-05-20 15:53 by 193.9.13.135

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki