summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--git_config.py4
-rw-r--r--git_refs.py6
2 files changed, 9 insertions, 1 deletions
diff --git a/git_config.py b/git_config.py
index c87d5bed..f65a0353 100644
--- a/git_config.py
+++ b/git_config.py
@@ -19,7 +19,7 @@ import re
19import sys 19import sys
20from urllib2 import urlopen, HTTPError 20from urllib2 import urlopen, HTTPError
21from error import GitError, UploadError 21from error import GitError, UploadError
22from git_command import GitCommand 22from git_command import GitCommand, TRACE
23 23
24R_HEADS = 'refs/heads/' 24R_HEADS = 'refs/heads/'
25R_TAGS = 'refs/tags/' 25R_TAGS = 'refs/tags/'
@@ -189,6 +189,8 @@ class GitConfig(object):
189 except OSError: 189 except OSError:
190 return None 190 return None
191 try: 191 try:
192 if TRACE:
193 print >>sys.stderr, ': unpickle %s' % self.file
192 return cPickle.load(open(self._pickle, 'r')) 194 return cPickle.load(open(self._pickle, 'r'))
193 except IOError: 195 except IOError:
194 os.remove(self._pickle) 196 os.remove(self._pickle)
diff --git a/git_refs.py b/git_refs.py
index b91abc28..be8d271b 100644
--- a/git_refs.py
+++ b/git_refs.py
@@ -14,6 +14,8 @@
14# limitations under the License. 14# limitations under the License.
15 15
16import os 16import os
17import sys
18from git_command import TRACE
17 19
18HEAD = 'HEAD' 20HEAD = 'HEAD'
19R_HEADS = 'refs/heads/' 21R_HEADS = 'refs/heads/'
@@ -63,6 +65,8 @@ class GitRefs(object):
63 self._LoadAll() 65 self._LoadAll()
64 66
65 def _NeedUpdate(self): 67 def _NeedUpdate(self):
68 if TRACE:
69 print >>sys.stderr, ': scan refs %s' % self._gitdir
66 for name, mtime in self._mtime.iteritems(): 70 for name, mtime in self._mtime.iteritems():
67 try: 71 try:
68 if mtime != os.path.getmtime(os.path.join(self._gitdir, name)): 72 if mtime != os.path.getmtime(os.path.join(self._gitdir, name)):
@@ -72,6 +76,8 @@ class GitRefs(object):
72 return False 76 return False
73 77
74 def _LoadAll(self): 78 def _LoadAll(self):
79 if TRACE:
80 print >>sys.stderr, ': load refs %s' % self._gitdir
75 self._phyref = {} 81 self._phyref = {}
76 self._symref = {} 82 self._symref = {}
77 self._mtime = {} 83 self._mtime = {}