diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-04 15:39:28 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-04 15:39:28 +0100 |
commit | 6f55c17f48d7608072199496fbcefa33f2e97bf0 (patch) | |
tree | d6c69f667f3cce87d3fe5bf9baa62a081f4af7a8 /git/objects/submodule/base.py | |
parent | 1b9d3b961bdf79964b883d3179f085d8835e528d (diff) | |
download | gitpython-6f55c17f48d7608072199496fbcefa33f2e97bf0.tar.gz |
Replaced ordered dict with standard version; used logging module
All performance tests still print to stderr, but do so in a py3 compatible way
Diffstat (limited to 'git/objects/submodule/base.py')
-rw-r--r-- | git/objects/submodule/base.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/git/objects/submodule/base.py b/git/objects/submodule/base.py index 6951fd63..d6f8982b 100644 --- a/git/objects/submodule/base.py +++ b/git/objects/submodule/base.py @@ -27,11 +27,14 @@ import stat import git import os -import sys +import logging __all__ = ["Submodule", "UpdateProgress"] +log = logging.getLogger('git.objects.submodule.base') + + class UpdateProgress(RemoteProgress): """Class providing detailed progress information to the caller who should @@ -408,7 +411,7 @@ class Submodule(util.IndexObject, Iterable, Traversable): mrepo.head.set_reference(local_branch, logmsg="submodule: attaching head to %s" % local_branch) mrepo.head.ref.set_tracking_branch(remote_branch) except IndexError: - print >> sys.stderr, "Warning: Failed to checkout tracking branch %s" % self.branch_path + log.warn("Failed to checkout tracking branch %s", self.branch_path) # END handle tracking branch # NOTE: Have to write the repo config file as well, otherwise @@ -437,11 +440,10 @@ class Submodule(util.IndexObject, Iterable, Traversable): binsha = rcommit.binsha hexsha = rcommit.hexsha else: - print >> sys.stderr, "%s a tracking branch was not set for local branch '%s'" % ( - msg_base, mrepo.head.ref) + log.error("%s a tracking branch was not set for local branch '%s'", msg_base, mrepo.head.ref) # END handle remote ref else: - print >> sys.stderr, "%s there was no local tracking branch" % msg_base + log.error("%s there was no local tracking branch", msg_base) # END handle detached head # END handle to_latest_revision option |