From eb618608ceb061b4a06e6eceb6c589a7b6340822 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 13 Jan 2012 22:45:03 +0100 Subject: gbp-posttag-push: check if upstream is up to date per remote This isn't perfect since someone else might have already pushed that ref and we might not have pulled it yet. --- examples/gbp-posttag-push | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/gbp-posttag-push b/examples/gbp-posttag-push index 1203983..5b5b5bf 100755 --- a/examples/gbp-posttag-push +++ b/examples/gbp-posttag-push @@ -124,9 +124,7 @@ def main(argv): upstream_tag = get_upstream_tag(repo, env.tag, options.upstream_tag) if upstream_tag: - sha1 = repo.rev_parse("%s^{}" % upstream_tag) - if not repo.branch_contains(options.upstream_branch, sha1, remote=True): - upstream_sha1 = sha1 + upstream_sha1 = repo.rev_parse("%s^{}" % upstream_tag) if not repo.verify_tag(env.tag): print >>sys.stderr, "Not pushing unsigned tag $GBP_TAG." @@ -138,7 +136,8 @@ def main(argv): repo.push(dest, env.sha1, dests[dest]) if options.push_upstream and upstream_tag: repo.push_tag(dest, upstream_tag) - if upstream_sha1: + if not repo.branch_contains("%s/%s" % (dest, options.upstream_branch), + upstream_sha1, remote=True): repo.push(dest, upstream_sha1, options.upstream_branch) print "done." -- cgit v1.2.3