mirror of
https://git.codelinaro.org/clo/tools/repo.git
synced 2025-05-20 22:06:22 +08:00
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:
10
git_refs.py
10
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 = {}
|
||||
|
Reference in New Issue
Block a user