Enable tracing of ref scans and config unpickling
These are not as expensive as spawning a git command, but they are
not free either. We want to keep track of how many times we wind
up calling them on any particular operation.
Signed-off-by: Shawn O. Pearce <sop@google.com>
diff --git a/git_config.py b/git_config.py
index c87d5be..f65a035 100644
--- a/git_config.py
+++ b/git_config.py
@@ -19,7 +19,7 @@
import sys
from urllib2 import urlopen, HTTPError
from error import GitError, UploadError
-from git_command import GitCommand
+from git_command import GitCommand, TRACE
R_HEADS = 'refs/heads/'
R_TAGS = 'refs/tags/'
@@ -189,6 +189,8 @@
except OSError:
return None
try:
+ if TRACE:
+ print >>sys.stderr, ': unpickle %s' % self.file
return cPickle.load(open(self._pickle, 'r'))
except IOError:
os.remove(self._pickle)