allow ctrl+c to interrupt watch-lock without printing a python stack dump

This commit is contained in:
Josh Holtrop 2012-05-23 15:36:09 -04:00
parent 55eee0d6ac
commit bbe6d71a0a

34
jsvn
View File

@ -568,23 +568,23 @@ def watch_lock(argv, svn, out):
break
last_lock_owner = ''
while True:
lock_owner = ''
p = Popen([svn, 'info', path], stdout=PIPE)
lines = p.communicate()[0].split('\n')
for line in lines:
m = re.match(r'Lock\sOwner:\s*(.*)', line)
if m is not None:
lock_owner = m.group(1)
try:
while True:
lock_owner = ''
p = Popen([svn, 'info', path], stdout=PIPE)
lines = p.communicate()[0].split('\n')
for line in lines:
m = re.match(r'Lock\sOwner:\s*(.*)', line)
if m is not None:
lock_owner = m.group(1)
break
if lock_owner == '':
break
if lock_owner == '':
break
if lock_owner != last_lock_owner:
out.write('Locked by: %s\n' % lock_owner)
last_lock_owner = lock_owner
time.sleep(60)
out.write('''
if lock_owner != last_lock_owner:
out.write('Locked by: %s\n' % lock_owner)
last_lock_owner = lock_owner
time.sleep(60)
out.write('''
_ _ _ _ _ _
| | | |_ __ | | ___ ___| | _____ __| | |
| | | | '_ \| |/ _ \ / __| |/ / _ \/ _` | |
@ -592,6 +592,8 @@ def watch_lock(argv, svn, out):
\___/|_| |_|_|\___/ \___|_|\_\___|\__,_(_)
''')
except KeyboardInterrupt:
pass
return RET_OK
def users(argv, svn, out):