예제 #1
0
def hg_main(progname, cmd_args):
    # Import late so cvs2{svn,git} do not depend on being able to import
    # the Mercurial API.
    from cvs2svn_lib.hg_run_options import HgRunOptions

    pass_manager = PassManager(passes)
    run_options = HgRunOptions(progname, cmd_args, pass_manager)
    main(progname, run_options, pass_manager)
예제 #2
0
파일: main.py 프로젝트: saminigod/cygwin
def main(progname, cmd_args):
    # Disable garbage collection, as we try not to create any circular
    # data structures:
    gc.disable()

    # Convenience var, so we don't have to keep instantiating this Borg.
    ctx = Ctx()

    pass_manager = PassManager(passes)

    run_options = RunOptions(progname, cmd_args, pass_manager)

    # Make sure the tmp directory exists.  Note that we don't check if
    # it's empty -- we want to be able to use, for example, "." to hold
    # tempfiles.  But if we *did* want check if it were empty, we'd do
    # something like os.stat(ctx.tmpdir)[stat.ST_NLINK], of course :-).
    if not os.path.exists(ctx.tmpdir):
        erase_tmpdir = True
        os.mkdir(ctx.tmpdir)
    elif not os.path.isdir(ctx.tmpdir):
        raise FatalError(
            "cvs2svn tried to use '%s' for temporary files, but that path\n"
            "  exists and is not a directory.  Please make it be a directory,\n"
            "  or specify some other directory for temporary files." %
            (ctx.tmpdir, ))
    else:
        erase_tmpdir = False

    # But do lock the tmpdir, to avoid process clash.
    try:
        os.mkdir(os.path.join(ctx.tmpdir, 'cvs2svn.lock'))
    except OSError, e:
        if e.errno == errno.EACCES:
            raise FatalError("Permission denied:" +
                             " No write access to directory '%s'." %
                             ctx.tmpdir)
        if e.errno == errno.EEXIST:
            raise FatalError(
                "cvs2svn is using directory '%s' for temporary files, but\n"
                "  subdirectory '%s/cvs2svn.lock' exists, indicating that another\n"
                "  cvs2svn process is currently using '%s' as its temporary\n"
                "  workspace.  If you are certain that is not the case,\n"
                "  then remove the '%s/cvs2svn.lock' subdirectory." % (
                    ctx.tmpdir,
                    ctx.tmpdir,
                    ctx.tmpdir,
                    ctx.tmpdir,
                ))
        raise
예제 #3
0
def bzr_main(progname, cmd_args):
    pass_manager = PassManager(passes)
    run_options = BzrRunOptions(progname, cmd_args, pass_manager)
    main(progname, run_options, pass_manager)
예제 #4
0
def git_main(progname, cmd_args):
    pass_manager = PassManager(passes)
    run_options = GitRunOptions(progname, cmd_args, pass_manager)
    main(progname, run_options, pass_manager)
예제 #5
0
def svn_main(progname, cmd_args):
    pass_manager = PassManager(passes)
    run_options = SVNRunOptions(progname, cmd_args, pass_manager)
    main(progname, run_options, pass_manager)