def do_command(repo, queue): """ Execute the command in the given repository. """ try: chdir(repo) command = git(argv[1:]) if len(command) > 0: # Empty string prevents printing the tuple in python2 output = '' output += '\n' output += 'in repo {}:\n'.format(repo) for line in command: output += '{}\n'.format(wrap(line)) queue.put(output) except ErrorReturnCode as ex: error = '' error += "in repo {}:".format(repo) error += wrap('Command: "{}" failed!\n'.format(ex.full_cmd)) queue.put(error)
def main(): """Top level.""" try: if not svn_repo(): try: refresh() # Sometimes the server is overloaded, give it a little and # try again. except ErrorReturnCode: sleep(0.5) refresh() else: svn_rebase() except ErrorReturnCode as ex: full_cmd = ex.full_cmd.split() cmd = (full_cmd[0]).split('/')[-1] args = ' '.join(full_cmd[1:]) if 'no remote' not in ex.stderr.decode().lower(): print(wrap('Command "{} {}" failed!'.format(cmd, args))) print('') print(ex.stderr.decode())
def main(): """Top level.""" try: if not svn_repo(): try: refresh() # Sometimes the server is overloaded, give it a little and # try again. except ErrorReturnCode: sleep(0.5) refresh() else: svn_rebase() except ErrorReturnCode as ex: full_cmd = ex.full_cmd.split() cmd = (full_cmd[0]).split('/')[-1] args = ' '.join(full_cmd[1:]) if 'no remote' not in ex.stderr.lower(): print(wrap('Command "{} {}" failed!'.format(cmd, args))) print('') print(ex.stderr)