aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--docs/manpages/gbp-push.xml6
-rwxr-xr-xgbp/scripts/push.py25
-rw-r--r--tests/component/deb/test_push.py9
3 files changed, 28 insertions, 12 deletions
diff --git a/docs/manpages/gbp-push.xml b/docs/manpages/gbp-push.xml
index 7123c6b2..5c8abc18 100644
--- a/docs/manpages/gbp-push.xml
+++ b/docs/manpages/gbp-push.xml
@@ -104,7 +104,7 @@
<listitem>
<para>
The branch in the Git repository the Debian package is being
- developed on.
+ developed on. If set to the empty value the branch will not be pushed.
</para>
</listitem>
</varlistentry>
@@ -114,6 +114,7 @@
<para>
Use this tag format when looking for tags corresponding to a &debian;
version. Default is <replaceable>debian/%(version)s</replaceable>.
+ If set to the empty value the tag will not be pushed.
</para>
</listitem>
</varlistentry>
@@ -122,7 +123,7 @@
<listitem>
<para>
The branch in the &git; repository the upstream sources are put
- onto.
+ onto. If set to the empty value the branch will not be pushed.
</para>
</listitem>
</varlistentry>
@@ -133,6 +134,7 @@
Use this tag format when looking for tags of upstream
versions. Default
is <replaceable>upstream/%(version)s</replaceable>.
+ If set to the empty value the tag will not be pushed.
</para>
</listitem>
</varlistentry>
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)
diff --git a/tests/component/deb/test_push.py b/tests/component/deb/test_push.py
index 13db27f1..0dd571cb 100644
--- a/tests/component/deb/test_push.py
+++ b/tests/component/deb/test_push.py
@@ -73,6 +73,15 @@ class TestPush(ComponentTestBase):
['upstream'],
tags=['debian/2.8-1', 'upstream/2.8'])
+ @RepoFixtures.quilt30()
+ def test_push_skip_upstream(self, repo):
+ repo.add_remote_repo('origin', self.target.path)
+ self.assertEquals(push(['argv0', '--upstream-branch=']), 0)
+ self._check_repo_state(self.target, 'master',
+ ['master'],
+ tags=['debian/2.8-1', 'upstream/2.8'])
+ self.assertEquals(repo.head, self.target.head)
+
@RepoFixtures.native()
def test_push_tag_ne_branch(self, repo):
repo.add_remote_repo('origin', self.target.path)