allow ctrl+c to interrupt any subcommand

Revert "allow ctrl+c to interrupt watch-lock without printing a python stack dump"
This reverts commit bbe6d71a0a8d196bdf7a5d96f483b4df7cd3cec4.
This commit is contained in:
Josh Holtrop 2012-06-18 15:55:25 -04:00
parent c60698cd04
commit 6fd5ad2615

55
jsvn
View File

@ -576,23 +576,23 @@ def watch_lock(argv, svn, out):
break
last_lock_owner = ''
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 == '':
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 != last_lock_owner:
out.write('Locked by: %s\n' % lock_owner)
last_lock_owner = lock_owner
time.sleep(60)
out.write('''
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('''
_ _ _ _ _ _
| | | |_ __ | | ___ ___| | _____ __| | |
| | | | '_ \| |/ _ \ / __| |/ / _ \/ _` | |
@ -600,8 +600,6 @@ def watch_lock(argv, svn, out):
\___/|_| |_|_|\___/ \___|_|\_\___|\__,_(_)
''')
except KeyboardInterrupt:
pass
return RET_OK
def users(argv, svn, out):
@ -1150,16 +1148,19 @@ def main(argv):
if config['svn']:
realsvn = config['svn']
# set up execution environment for user-defined function aliases
def do(cmd, expand=True):
if type(cmd) == types.StringType:
cmd = [cmd]
do_cmd(cmd, realsvn, config, expand)
config['do'] = do
config['Popen'] = Popen
config['PIPE'] = PIPE
try:
# set up execution environment for user-defined function aliases
def do(cmd, expand=True):
if type(cmd) == types.StringType:
cmd = [cmd]
do_cmd(cmd, realsvn, config, expand)
config['do'] = do
config['Popen'] = Popen
config['PIPE'] = PIPE
do_cmd(argv, realsvn, config)
do_cmd(argv, realsvn, config)
except KeyboardInterrupt:
pass
return 0