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:

committed by
Junio C Hamano

parent
6376cffaeb
commit
2553ede5a9
@ -106,7 +106,10 @@ if state:
|
|||||||
else:
|
else:
|
||||||
print 'State does not exist, first run'
|
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:
|
if verbose:
|
||||||
print 'tip is', tip
|
print 'tip is', tip
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user