Fix repo --trace to show ref and config loads

The value of the varible TRACE was copied during the import, which
happens before the --trace option can be processed.  So instead we
now use a function to determine if the value is set, as the function
can be safely copied early during import.

Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
Shawn O. Pearce
2009-04-18 09:54:51 -07:00
parent b81ac9e654
commit ad3193a0e5
5 changed files with 47 additions and 17 deletions

View File

@ -15,7 +15,7 @@
import os
import sys
from git_command import TRACE
from trace import Trace
HEAD = 'HEAD'
R_HEADS = 'refs/heads/'
@ -65,8 +65,8 @@ class GitRefs(object):
self._LoadAll()
def _NeedUpdate(self):
if TRACE:
print >>sys.stderr, ': scan refs %s' % self._gitdir
Trace(': scan refs %s', self._gitdir)
for name, mtime in self._mtime.iteritems():
try:
if mtime != os.path.getmtime(os.path.join(self._gitdir, name)):
@ -76,8 +76,8 @@ class GitRefs(object):
return False
def _LoadAll(self):
if TRACE:
print >>sys.stderr, ': load refs %s' % self._gitdir
Trace(': load refs %s', self._gitdir)
self._phyref = {}
self._symref = {}
self._mtime = {}