Ejemplo n.º 1
0
 def get_merge_commit_msg(self, url, revisions):
     blocks = []
     for revision in revisions:
         lines = []
         io.cmd("svn log {} -r {}".format(url, revision), logger=lines.append)
         blocks.append("\n".join(lines[4:-1]))
     return "\n".join(["merged from {}@{}".format(url, ",".join(map(str,revisions)))] + blocks)
Ejemplo n.º 2
0
 def get_last_commit_info(self, branch, log_depth=10, verbose=False):
     lines = []
     cmd = "svn log {} -l {}".format(branch.svn_path, log_depth)
     if verbose:
         cmd += " -v"
     io.cmd(cmd, logger=lines.append)
     return self.find_usr_commit(lines)
Ejemplo n.º 3
0
def switch(srcdir):
    if os.path.exists(DEV_DIR):
        remove_junction(DEV_DIR)
    create_junction(DEV_DIR, srcdir)
    if os.path.exists(os.path.join(DEV_DIR, "Switch.cmd")):
        logging.info("Running Switch.cmd")
        io.cmd("Switch.cmd", cwd=DEV_DIR, logger=logging.getLogger("Switch.cmd").debug)
Ejemplo n.º 4
0
 def try_generate_custom_solution(self, vs_version):
     config_path = os.path.join(RSK_DIR, "vs{}.srcrsk.All.xml".format(vs_version))
     if not os.path.exists(config_path):
         return
     logging.info("Running ProjectConverter on {}".format(config_path))
     io.cmd(CONVERTER + ".exe " + os.path.join(RSK_DIR, "vs2008.srcrsk.All.xml"),
            cwd=CONVERTER_PATH,
            logger=logging.getLogger(CONVERTER).debug)
Ejemplo n.º 5
0
def get_current_target():
    regex = re.compile("<JUNCTION> +dev4\.1 \[(.*)\]")
    matches = []
    def get_match(line):
        m = regex.search(str(line))
        if m is None:
            return
        matches.append(m.group(1))
    io.cmd("dir", cwd="c:\\", logger=get_match)
    assert len(matches) == 1, "multiple junctions found: {}".format(matches)
    return matches[0]
Ejemplo n.º 6
0
 def compile(self, path):
     io.run_script(path, "build_rt.bat")
     io.run_script(path, "msbuild_RSK.bat")
     if os.path.exists(os.path.join(path, "msbuild_FrontCube.bat")):
         io.run_script(path, "msbuild_FrontCube.bat")
     self.try_generate_custom_solution("2008")
     self.try_generate_custom_solution("2012")
     logging.info("Generating vb model")
     frontAdminPath = os.path.join(DEV_DIR, "website", "bin")
     io.cmd("FrontAdmin.exe" + " /generatevbmodel /x",
            cwd=frontAdminPath,
            logger=logging.getLogger("FrontAdmin").debug)
Ejemplo n.º 7
0
 def cmd(self, cmd):
     io.cmd(cmd,
            dry_run=self.dry_run,
            logger=logging.getLogger("svn").debug)
Ejemplo n.º 8
0
def create_junction(dev_dir, srcdir):
    logging.info("creating a junction to the repository between {} and {}".format(dev_dir, srcdir))
    io.cmd("mklink /J {} {}".format(dev_dir, os.path.abspath(srcdir)), logger=logging.debug)
Ejemplo n.º 9
0
def remove_junction(junction_path):
    io.cmd("rmdir {}".format(junction_path), logger=logging.debug)