diff options
author | Guido Günther <agx@sigxcpu.org> | 2012-01-13 22:45:03 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2012-01-13 22:46:13 +0100 |
commit | eb618608ceb061b4a06e6eceb6c589a7b6340822 (patch) | |
tree | 2cc66614751cca1f4011105f0af9db8864624b1f /examples | |
parent | be118deec89340480dc41d5ee74c9b99a394c16e (diff) |
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.
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/gbp-posttag-push | 7 |
1 files changed, 3 insertions, 4 deletions
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." |