# Path: pybombs/utils/subproc.py
# READ_TIMEOUT = 0.1 # s
# def check_output(*args, **kwargs):
# def get_child_pids(pid):
# def kill_process_tree(process, pid=None):
# def run_with_output_processing(p, o_proc, event, cleanup=None):
#     def enqueue_output(stdout_data, stdout_queue, stderr_data, stderr_queue):
#     def poll_queue(q):
# def _process_thread(event, args, kwargs):
#     def elevate_command(args, elevate_pre_args):
#     def pretty_print_cmd(args):
# def monitor_process(args, **kwargs):
# def match_output(command, pattern, match_key=None, **kwargs):


import os
from pybombs.utils import subproc
from pybombs.fetchers.base import FetcherBase
        svn_cmd = ['svn', 'co']
        if args.get('svnrev') is not None:
            svn_cmd.append('-r')
            svn_cmd.append(args.get('svnrev'))
        svn_cmd.append(url)
        svn_cmd.append(dirname)
        subproc.monitor_process(
            args=svn_cmd,
            #o_proc=foo, # FIXME
            throw_ex=True,
        )
        return True

    def update_src(self, url, dest, dirname, args=None):
        """
        - src: URL, without the <type>+ prefix.
        - dest: Store the fetched stuff into here
        - dirname: Put the result into a dir with this name, it'll be a subdir of dest
        - args: Additional args to pass to the actual fetcher
        """
        args = args or {}
        self.log.debug("Using url {0}".format(url))
        cwd = os.getcwd()
        src_dir = os.path.join(dest, dirname)
        self.log.trace("Switching cwd to: {0}".format(src_dir))
        os.chdir(src_dir)
        svn_cmd = ['svn', 'up', '--force']
        if args.get('svnrev'):
            svn_cmd.append('--revision')
            svn_cmd.append(args.get('svnrev'))

# Path: pybombs/utils/subproc.py
# READ_TIMEOUT = 0.1 # s
# def check_output(*args, **kwargs):
# def get_child_pids(pid):
# def kill_process_tree(process, pid=None):
# def run_with_output_processing(p, o_proc, event, cleanup=None):
#     def enqueue_output(stdout_data, stdout_queue, stderr_data, stderr_queue):
#     def poll_queue(q):
# def _process_thread(event, args, kwargs):
#     def elevate_command(args, elevate_pre_args):
#     def pretty_print_cmd(args):
# def monitor_process(args, **kwargs):
# def match_output(command, pattern, match_key=None, **kwargs):


# Path: pybombs/fetchers/svn.py
import os
from pybombs.utils import subproc
from pybombs.fetchers.base import FetcherBase

        svn_cmd = ['svn', 'co']
        if args.get('svnrev') is not None:
            svn_cmd.append('-r')
            svn_cmd.append(args.get('svnrev'))
        svn_cmd.append(url)
        svn_cmd.append(dirname)
        subproc.monitor_process(
            args=svn_cmd,
            #o_proc=foo, # FIXME
            throw_ex=True,
        )
        return True

    def update_src(self, url, dest, dirname, args=None):
        """
        - src: URL, without the <type>+ prefix.
        - dest: Store the fetched stuff into here
        - dirname: Put the result into a dir with this name, it'll be a subdir of dest
        - args: Additional args to pass to the actual fetcher
        """
        args = args or {}
        self.log.debug("Using url {0}".format(url))
        cwd = os.getcwd()
        src_dir = os.path.join(dest, dirname)
        self.log.trace("Switching cwd to: {0}".format(src_dir))
        os.chdir(src_dir)
        svn_cmd = ['svn', 'up', '--force']
        if args.get('svnrev'):
            svn_cmd.append('--revision')
            svn_cmd.append(args.get('svnrev'))

        subproc.monitor_process(