diff options
author | Guido Guenther <agx@sigxcpu.org> | 2007-11-04 15:28:51 +0100 |
---|---|---|
committer | Guido Guenther <agx@sigxcpu.org> | 2007-11-05 19:55:27 +0100 |
commit | d17637ea18415c56b0d91cfdacd1f0f451154beb (patch) | |
tree | 6c92e8597582359a8a5c07ea47466882c4ab7214 | |
parent | 55884f09968c469040b6e4fa8c4df6bb086a8658 (diff) |
don't print a commit summary when importing into empty repos (addresses parts of #449075)
-rw-r--r-- | gbp/command_wrappers.py | 7 | ||||
-rwxr-xr-x | git-import-orig | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/gbp/command_wrappers.py b/gbp/command_wrappers.py index 8a93ff4..2308660 100644 --- a/gbp/command_wrappers.py +++ b/gbp/command_wrappers.py @@ -181,12 +181,13 @@ class GitRm(GitCommand): class GitCommitAll(GitCommand): """Wrap git-commit to commit all changes""" - def __init__(self): - GitCommand.__init__(self, 'commit', ['-a']) + def __init__(self, verbose=False): + args = ['-a'] + [ ['-q'], [] ][verbose] + GitCommand.__init__(self, cmd='commit', args=args) def __call__(self, msg=''): args = [ [], ['-m', msg] ][len(msg) > 0] - self.run_error = "Couldn't commit -a %s" % " ".join(args) + self.run_error = "Couldn't %s %s" % (self.cmd, " ".join(self.args + args)) GitCommand.__call__(self, args) diff --git a/git-import-orig b/git-import-orig index 145bc34..284bf0d 100755 --- a/git-import-orig +++ b/git-import-orig @@ -50,7 +50,7 @@ def unpack_orig(archive, tmpdir): return unpackArchive.dir -def import_source_tree(repo, orig_dir, version, filter): +def import_source_tree(repo, orig_dir, version, filter, verbose): """import source tree to the current branch""" try: old = set(repo.index_files()) @@ -60,7 +60,7 @@ def import_source_tree(repo, orig_dir, version, filter): if files: gbpc.GitRm()(files) if not repo.is_clean()[0]: - gbpc.GitCommitAll()(msg="Imported upstream version %s" % version) + gbpc.GitCommitAll(verbose=verbose)(msg="Imported upstream version %s" % version) else: raise GbpError, "Nothing to commit, nothing imported." except gbpc.CommandExecFailed: @@ -178,7 +178,7 @@ create it otherwise use --upstream-branch to specify it. else: print "Initial import of '%s'..." % archive - import_source_tree(repo, orig_dir, version, options.filter) + import_source_tree(repo, orig_dir, version, options.filter, verbose=not is_empty) gbpc.GitTag(options.sign_tags, options.keyid)(build_tag(options.upstream_tag, version), msg="Upstream version %s" % version) |