diff options
author | Guido Günther <agx@sigxcpu.org> | 2018-05-22 07:35:31 +0200 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2018-05-22 07:38:11 +0200 |
commit | 62e01023c927e7268ab7af37313196c3e2211dd1 (patch) | |
tree | ffe7c57f5ad850d84e7beb934d70788d2ba69511 /gbp/scripts/push.py | |
parent | 29b9f2ce26eeda9970bfa230520bf0f8cb412c35 (diff) |
push: Allow to skip upstream and debian branch and tag push
Push of tag and or branch can be skipped by setting
--{upstream,debian}-{branch,tag}='' .
Closes: #899234
Diffstat (limited to 'gbp/scripts/push.py')
-rwxr-xr-x | gbp/scripts/push.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/gbp/scripts/push.py b/gbp/scripts/push.py index e21a022f..209fd416 100755 --- a/gbp/scripts/push.py +++ b/gbp/scripts/push.py @@ -143,18 +143,23 @@ def main(argv): if not dest: dest = get_remote(repo, branch) - dtag = repo.version_to_tag(options.debian_tag, source.version) - if repo.has_tag(dtag): - to_push['tags'].append(dtag) - if source.is_releasable() and branch: - ref = 'refs/heads/%s' % branch - to_push['refs'][ref] = get_push_src(repo, ref, dtag) + if options.debian_tag != '': + dtag = repo.version_to_tag(options.debian_tag, source.version) + if repo.has_tag(dtag): + to_push['tags'].append(dtag) + + if source.is_releasable() and branch: + ref = 'refs/heads/%s' % branch + to_push['refs'][ref] = get_push_src(repo, ref, dtag) if not source.is_native(): - utag = repo.version_to_tag(options.upstream_tag, - source.upstream_version) - if repo.has_tag(utag): - to_push['tags'].append(utag) + if options.upstream_tag != '': + utag = repo.version_to_tag(options.upstream_tag, + source.upstream_version) + if repo.has_tag(utag): + to_push['tags'].append(utag) + + if options.upstream_branch != '': ref = 'refs/heads/%s' % options.upstream_branch to_push['refs'][ref] = get_push_src(repo, ref, utag) |