Changeset 3177

Show
Ignore:
Timestamp:
02/05/08 08:23:36 (10 months ago)
Author:
hvr
Message:

added code to aid profiling expensive git operations

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gitplugin/0.11/gitplugin/PyGIT.py

    r3174 r3177  
    1313# GNU General Public License for more details. 
    1414 
    15 import os, re 
     15import os, re, sys, time 
    1616#from traceback import print_stack 
     17 
     18_profile_git_calls = False 
    1719 
    1820class GitError(Exception): 
     
    2931    def _git_call_f(self,cmd): 
    3032        #print "GIT: "+cmd 
     33        if _profile_git_calls: 
     34            t = time.time() 
     35            pass 
     36 
    3137        (input, output, error) = os.popen3('GIT_DIR="%s" %s' % (self.repo,cmd)) 
     38 
     39        if _profile_git_calls: 
     40            t = time.time() - t 
     41            print >>sys.stderr, "GIT: took %6.2fs for '%s'" % (t, cmd) 
     42            pass 
     43 
    3244        return output 
    3345