From ad3193a0e587073dee0edef46bdf24f6c6e09779 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 18 Apr 2009 09:54:51 -0700 Subject: 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 --- git_refs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'git_refs.py') diff --git a/git_refs.py b/git_refs.py index be8d271b..24760918 100644 --- a/git_refs.py +++ b/git_refs.py @@ -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 = {} -- cgit v1.2.3-54-g00ecf