Module: check_mk
Branch: master
Commit: 8eaf08a9f84ac56deab0f2f450437b6d2dcd4831
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8eaf08a9f84ac5…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Dec 10 10:42:16 2013 +0100
Disallow werk ids on branch other than master
---
werk | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/werk b/werk
index 6a06038..2488d3c 100755
--- a/werk
+++ b/werk
@@ -752,6 +752,9 @@ def store_werk_ids(l):
file('.my_ids', 'w').write(repr(l) + "\n")
+def current_branch():
+ return [ l for l in os.popen("git branch") if l.startswith("*")
][0].split()[-1]
+
def main_fetch_ids(args):
if not args:
sys.stdout.write('You have %d reserved IDs.\n' % (len(get_werk_ids())))
@@ -761,6 +764,9 @@ def main_fetch_ids(args):
else:
usage()
+ if current_branch() != "master":
+ bail_out("It is not allowed to reserver IDs on any other branch than the
master.\n")
+
# Get the start werk_id to reserve
try:
first_free = int(eval(file('first_free').read()))