mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
rename local trace module
There is a standard Python "trace" module, so having a local trace.py prevents us being able to import that. Rename the module to avoid. Change-Id: I23e29ec95a2204bb168a641323d05e76968d9b57 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/234832 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
898f4e6217
commit
8a11f6f24c
@ -23,7 +23,7 @@ from signal import SIGTERM
|
||||
|
||||
from error import GitError
|
||||
import platform_utils
|
||||
from trace import REPO_TRACE, IsTrace, Trace
|
||||
from repo_trace import REPO_TRACE, IsTrace, Trace
|
||||
from wrapper import Wrapper
|
||||
|
||||
GIT = 'git'
|
||||
|
@ -44,7 +44,7 @@ else:
|
||||
from signal import SIGTERM
|
||||
from error import GitError, UploadError
|
||||
import platform_utils
|
||||
from trace import Trace
|
||||
from repo_trace import Trace
|
||||
if is_python3():
|
||||
from http.client import HTTPException
|
||||
else:
|
||||
|
@ -15,7 +15,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import os
|
||||
from trace import Trace
|
||||
from repo_trace import Trace
|
||||
import platform_utils
|
||||
|
||||
HEAD = 'HEAD'
|
||||
|
4
main.py
4
main.py
@ -45,7 +45,7 @@ except ImportError:
|
||||
|
||||
from color import SetDefaultColoring
|
||||
import event_log
|
||||
from trace import SetTrace
|
||||
from repo_trace import SetTrace
|
||||
from git_command import git, GitCommand
|
||||
from git_config import init_ssh, close_ssh
|
||||
from command import InteractiveCommand
|
||||
@ -84,7 +84,7 @@ global_options.add_option('--color',
|
||||
help='control color usage: auto, always, never')
|
||||
global_options.add_option('--trace',
|
||||
dest='trace', action='store_true',
|
||||
help='trace git command execution')
|
||||
help='trace git command execution (REPO_TRACE=1)')
|
||||
global_options.add_option('--time',
|
||||
dest='time', action='store_true',
|
||||
help='time repo command execution')
|
||||
|
@ -17,7 +17,7 @@
|
||||
import os
|
||||
import sys
|
||||
from time import time
|
||||
from trace import IsTrace
|
||||
from repo_trace import IsTrace
|
||||
|
||||
_NOT_TTY = not os.isatty(2)
|
||||
|
||||
|
@ -39,7 +39,7 @@ from error import GitError, HookError, UploadError, DownloadError
|
||||
from error import ManifestInvalidRevisionError
|
||||
from error import NoManifestException
|
||||
import platform_utils
|
||||
from trace import IsTrace, Trace
|
||||
from repo_trace import IsTrace, Trace
|
||||
|
||||
from git_refs import GitRefs, HEAD, R_HEADS, R_TAGS, R_PUB, R_M
|
||||
|
||||
|
@ -14,15 +14,19 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Logic for tracing repo interactions.
|
||||
|
||||
Activated via `repo --trace ...` or `REPO_TRACE=1 repo ...`.
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Env var to implicitly turn on tracing.
|
||||
REPO_TRACE = 'REPO_TRACE'
|
||||
|
||||
try:
|
||||
_TRACE = os.environ[REPO_TRACE] == '1'
|
||||
except KeyError:
|
||||
_TRACE = False
|
||||
_TRACE = os.environ.get(REPO_TRACE) == '1'
|
||||
|
||||
def IsTrace():
|
||||
return _TRACE
|
Loading…
Reference in New Issue
Block a user