Ejemplo n.º 1
0
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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())
Ejemplo n.º 4
0
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)