1
0
mirror of https://github.com/git/git.git synced 2024-09-23 04:52:59 +02:00

hg-to-git: abort if the project directory is not a hg repo

Check the exit code of the first hg command, and abort to avoid a later
ValueError exception.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Miklos Vajna 2008-07-06 05:15:18 +02:00 committed by Junio C Hamano
parent 6376cffaeb
commit 2553ede5a9

View File

@ -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