def tag(): """introduce a new tag and upload it to git. run fab changes first and add that to CHANGES.txt""" global version local("make clean") new_version = _next_version(version) _write_version(new_version) _git("add", ".") _git("tag", "%s" % new_version) _git("commit", "-m", "adding version %s" % new_version) _git("push") changes()
def changes(): """look at the changes in github since the last taged version""" gitversion = _git("describe", "--abbrev=0", "--tags").strip() tags = _git("tag").split("\n") tags = tags[:-1] versions = {'previous': tags[-1], 'head': 'HEAD', 'next': _next_version(tags[-1])} print versions headline = "CHANGES %(previous)s -> %(next)s" % versions print headline print len(headline) * "=" print change = _git("log", "%(previous)s...%(head)s" % versions, "--no-merges", "--format=* %B") change = change.replace("\n\n", "\n") print change
def git(): """upload the changes to git""" clean() _git("add", ".") os.system("git commit") _git("push")