]> arthur.barton.de Git - bup.git/blobdiff - cmd/tag-cmd.py
bloom: end progress message with \r, not \n
[bup.git] / cmd / tag-cmd.py
index f33855ec7e293b8b98409464a6cb85edf2284e36..492c3baad833631f7248553be60d1e48ea427f16 100755 (executable)
@@ -1,10 +1,14 @@
-#!/usr/bin/env python
+#!/bin/sh
+"""": # -*-python-*-
+bup_python="$(dirname "$0")/bup-python" || exit $?
+exec "$bup_python" "$0" ${1+"$@"}
+"""
+# end of bup preamble
 
-import sys
-import os
+import os, sys
 
 from bup import git, options
-from bup.helpers import *
+from bup.helpers import debug1, handle_ctrl_c, log
 
 # FIXME: review for safe writes.
 
@@ -59,7 +63,7 @@ if tag_name.startswith('.'):
 
 try:
     hash = git.rev_parse(commit)
-except git.GitError, e:
+except git.GitError as e:
     log("bup: error: %s" % e)
     sys.exit(2)
 
@@ -75,7 +79,7 @@ if not pL.exists(hash):
 tag_file = git.repo('refs/tags/%s' % tag_name)
 try:
     tag = file(tag_file, 'w')
-except OSError, e:
+except OSError as e:
     log("bup: error: could not create tag '%s': %s" % (tag_name, e))
     sys.exit(3)