summaryrefslogtreecommitdiff
path: root/release.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2013-08-17 15:48:00 -0400
committerJason R. Coombs <jaraco@jaraco.com>2013-08-17 15:48:00 -0400
commit5082d281dd7d438f0e915198e2fb7c13e7f84e6d (patch)
tree8ee4373f06d64b43a9f43e4feeee880f9ee6e67d /release.py
parent8c5920926f592fed6ea907fad6b544b89785ee86 (diff)
downloadpython-setuptools-bitbucket-5082d281dd7d438f0e915198e2fb7c13e7f84e6d.tar.gz
Encapsulate bootstrap bookmark functionality
Diffstat (limited to 'release.py')
-rw-r--r--release.py34
1 files changed, 18 insertions, 16 deletions
diff --git a/release.py b/release.py
index 4c9df8cc..edf6f4be 100644
--- a/release.py
+++ b/release.py
@@ -13,10 +13,10 @@ pkg_resources.require('jaraco.packaging>=2.0')
def before_upload():
_linkify('CHANGES.txt', 'CHANGES (links).txt')
- _add_bootstrap_bookmark()
+ BootstrapBookmark.add()
def after_push():
- _push_bootstrap_bookmark()
+ BootstrapBookmark.push()
files_with_versions = (
'ez_setup.py', 'setuptools/version.py',
@@ -61,17 +61,19 @@ def replacer(match):
url = issue_urls[key].format(**match_dict)
return "`{text} <{url}>`_".format(text=text, url=url)
-
-def _add_bootstrap_bookmark():
- cmd = ['hg', 'bookmark', '-i', 'bootstrap', '-f']
- subprocess.Popen(cmd)
-
-def _push_bootstrap_bookmark():
- """
- Push the bootstrap bookmark
- """
- push_command = ['hg', 'push', '-B', 'bootstrap']
- # don't use check_call here because mercurial will return a non-zero
- # code even if it succeeds at pushing the bookmark (because there are
- # no changesets to be pushed). !dm mercurial
- subprocess.call(push_command)
+class BootstrapBookmark:
+ @staticmethod
+ def add():
+ cmd = ['hg', 'bookmark', '-i', 'bootstrap', '-f']
+ subprocess.Popen(cmd)
+
+ @staticmethod
+ def push():
+ """
+ Push the bootstrap bookmark
+ """
+ push_command = ['hg', 'push', '-B', 'bootstrap']
+ # don't use check_call here because mercurial will return a non-zero
+ # code even if it succeeds at pushing the bookmark (because there are
+ # no changesets to be pushed). !dm mercurial
+ subprocess.call(push_command)