diff options
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 a3bd9192..b6a4a343 100644 --- a/git_command.py +++ b/git_command.py | |||
| @@ -17,18 +17,14 @@ import os | |||
| 17 | import sys | 17 | import sys |
| 18 | import subprocess | 18 | import subprocess |
| 19 | from error import GitError | 19 | from error import GitError |
| 20 | from trace import REPO_TRACE, IsTrace, Trace | ||
| 20 | 21 | ||
| 21 | GIT = 'git' | 22 | GIT = 'git' |
| 22 | MIN_GIT_VERSION = (1, 5, 4) | 23 | MIN_GIT_VERSION = (1, 5, 4) |
| 23 | GIT_DIR = 'GIT_DIR' | 24 | GIT_DIR = 'GIT_DIR' |
| 24 | REPO_TRACE = 'REPO_TRACE' | ||
| 25 | 25 | ||
| 26 | LAST_GITDIR = None | 26 | LAST_GITDIR = None |
| 27 | LAST_CWD = None | 27 | LAST_CWD = None |
| 28 | try: | ||
| 29 | TRACE = os.environ[REPO_TRACE] == '1' | ||
| 30 | except KeyError: | ||
| 31 | TRACE = False | ||
| 32 | 28 | ||
| 33 | 29 | ||
| 34 | class _GitCall(object): | 30 | class _GitCall(object): |
| @@ -101,7 +97,7 @@ class GitCommand(object): | |||
| 101 | else: | 97 | else: |
| 102 | stderr = None | 98 | stderr = None |
| 103 | 99 | ||
| 104 | if TRACE: | 100 | if IsTrace(): |
| 105 | global LAST_CWD | 101 | global LAST_CWD |
| 106 | global LAST_GITDIR | 102 | global LAST_GITDIR |
| 107 | 103 | ||
| @@ -127,7 +123,7 @@ class GitCommand(object): | |||
| 127 | dbg += ' 1>|' | 123 | dbg += ' 1>|' |
| 128 | if stderr == subprocess.PIPE: | 124 | if stderr == subprocess.PIPE: |
| 129 | dbg += ' 2>|' | 125 | dbg += ' 2>|' |
| 130 | print >>sys.stderr, dbg | 126 | Trace('%s', dbg) |
| 131 | 127 | ||
| 132 | try: | 128 | try: |
| 133 | p = subprocess.Popen(command, | 129 | p = subprocess.Popen(command, |
