diff --git a/jsvn b/jsvn index aa66692..1669208 100755 --- a/jsvn +++ b/jsvn @@ -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