diff options
| author | Shawn O. Pearce <sop@google.com> | 2009-04-18 09:54:51 -0700 |
|---|---|---|
| committer | Shawn O. Pearce <sop@google.com> | 2009-04-18 09:54:51 -0700 |
| commit | ad3193a0e587073dee0edef46bdf24f6c6e09779 (patch) | |
| tree | 84ed1894e6f590455ee361beb049c1c271c4e0e7 /git_command.py | |
| parent | b81ac9e65444d0f54d2b6dd24d20b74945c9a36a (diff) | |
| download | git-repo-ad3193a0e587073dee0edef46bdf24f6c6e09779.tar.gz git-repo-ad3193a0e587073dee0edef46bdf24f6c6e09779.zip | |
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>
Diffstat (limited to 'git_command.py')
| -rw-r--r-- | git_command.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/git_command.py b/git_command.py index a3bd9192e..b6a4a343e 100644 --- a/git_command.py +++ b/git_command.py @@ -17,18 +17,14 @@ import os import sys import subprocess from error import GitError +from trace import REPO_TRACE, IsTrace, Trace GIT = 'git' MIN_GIT_VERSION = (1, 5, 4) GIT_DIR = 'GIT_DIR' -REPO_TRACE = 'REPO_TRACE' LAST_GITDIR = None LAST_CWD = None -try: - TRACE = os.environ[REPO_TRACE] == '1' -except KeyError: - TRACE = False class _GitCall(object): @@ -101,7 +97,7 @@ class GitCommand(object): else: stderr = None - if TRACE: + if IsTrace(): global LAST_CWD global LAST_GITDIR @@ -127,7 +123,7 @@ class GitCommand(object): dbg += ' 1>|' if stderr == subprocess.PIPE: dbg += ' 2>|' - print >>sys.stderr, dbg + Trace('%s', dbg) try: p = subprocess.Popen(command, |
