]> git.ipfire.org Git - thirdparty/git.git/blobdiff - contrib/hg-to-git/hg-to-git.py
hg-to-git: abort if the project directory is not a hg repo
[thirdparty/git.git] / contrib / hg-to-git / hg-to-git.py
index 25d99411ca5d2ff8d7296cb9a70c6d0bdd0b934a..130b1c4bcda98354dd1b599bc2a4788985fa6beb 100755 (executable)
@@ -106,7 +106,10 @@ if state:
     else:
         print 'State does not exist, first run'
 
-tip = os.popen('hg tip --template "{rev}"').read()
+sock = os.popen('hg tip --template "{rev}"')
+tip = sock.read()
+if sock.close():
+    sys.exit(1)
 if verbose:
     print 'tip is', tip