Module: check_mk
Branch: master
Commit: 01e24ea59fe8e602a7d1f6ecdba2a2a30e760f99
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=01e24ea59fe8e6…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Jan 16 11:10:47 2014 +0100
New command "werk url"
---
werk | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/werk b/werk
index f71463a..c002b9e 100755
--- a/werk
+++ b/werk
@@ -279,7 +279,7 @@ def add_comment(werk, title, comment):
werk["description"] += """
%s: %s
%s""" % (time.strftime("%F %T"), title, comment)
-
+
def usage():
@@ -298,6 +298,7 @@ where COMMAND is one of:
edit [#] - open werk # in editor (or newest werk)
blame [#] - show who worked on a werk
rewrite - rewrite changelog
+ url # - show the online URL of werk #
""")
sys.exit(1)
@@ -529,7 +530,7 @@ def main_new(args):
sys.stdout.write("Werk saved with id %d.\n" % werk["id"])
-def main_blame(args):
+def get_werk_arg(args):
if len(args) == 0:
if g_last_werk == None:
bail_out("No last werk, please specify id.")
@@ -543,9 +544,19 @@ def main_blame(args):
if not werk:
bail_out("No such werk.\n")
save_last_werkid(id)
+ return id
+
+def main_blame(args):
+ id = get_werk_arg(args)
os.system("git blame %d" % id)
+
+def main_url(args):
+ id = get_werk_arg(args)
+
sys.stdout.write("http://mathias-kettner.de/check_mk_werks.php?werk_id=%d\n" %
id)
+
+
def main_resolve(args):
if len(args) == 0:
if g_last_werk == None:
@@ -821,6 +832,7 @@ commands = {
"rewrite" : rewrite_changelog,
"pick" : main_pick,
"cherry-pick" : main_pick,
+ "url" : main_url,
}
hits = []