summaryrefslogtreecommitdiff
path: root/morphlib/git.py
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-01-23 12:18:37 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-01-23 12:18:37 +0000
commit74b41621814fb02576755aedd87350c833b8228e (patch)
tree0e3e59e104875ab01c2b714617ed36f1ffbc0b6a /morphlib/git.py
parentca1b2c21b64a1652556735857bf1197e4746facf (diff)
downloadmorph-74b41621814fb02576755aedd87350c833b8228e.tar.gz
Improve the logging output of SourceManager.
Diffstat (limited to 'morphlib/git.py')
-rw-r--r--morphlib/git.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/morphlib/git.py b/morphlib/git.py
index 36cb726d..f9d85c98 100644
--- a/morphlib/git.py
+++ b/morphlib/git.py
@@ -94,33 +94,33 @@ def export_sources(treeish, tar_filename):
ex.runv(['git', 'archive', '-o', tar_filename, '--remote',
'file://%s' % treeish.repo, treeish.sha1])
-def get_morph_text(treeish, filename):
+def get_morph_text(treeish, filename, msg=logging.debug):
'''Return a morphology from a git repository.'''
- ex = morphlib.execute.Execute(treeish.repo, msg=logging.debug)
+ ex = morphlib.execute.Execute(treeish.repo, msg=msg)
return ex.runv(['git', 'cat-file', 'blob', '%s:%s'
% (treeish.sha1, filename)])
-def extract_bundle(location, bundle):
+def extract_bundle(location, bundle, msg=logging.debug):
'''Extract a bundle into git at location'''
- ex = morphlib.execute.Execute(location, msg=logging.debug)
+ ex = morphlib.execute.Execute(location, msg=msg)
return ex.runv(['git', 'bundle', 'unbundle', bundle])
-def clone(location, repo):
+def clone(location, repo, msg=logging.debug):
'''clone at git repo into location'''
- ex = morphlib.execute.Execute('.', msg=logging.debug)
+ ex = morphlib.execute.Execute('.', msg=msg)
return ex.runv(['git', 'clone', repo, location])
-def init(location):
+def init(location, msg=logging.debug):
'''initialise git repo at location'''
os.mkdir(location)
- ex = morphlib.execute.Execute(location, msg=logging.debug)
+ ex = morphlib.execute.Execute(location, msg=msg)
return ex.runv(['git', 'init'])
-def add_remote(gitdir, name, url):
+def add_remote(gitdir, name, url, msg=logging.debug):
'''add remote with name 'name' for url at gitdir'''
- ex = morphlib.execute.Execute(gitdir, msg=logging.debug)
+ ex = morphlib.execute.Execute(gitdir, msg=msg)
return ex.runv(['git', 'remote', 'add', '-f', name, url])
-def update_remote(gitdir, name):
- ex = morphlib.execute.Execute(gitdir, msg=logging.debug)
+def update_remote(gitdir, name, msg=logging.debug):
+ ex = morphlib.execute.Execute(gitdir, msg=msg)
return ex.runv(['git', 'remote', 'update', name])