예제 #1
0
        private static ReplicationResult Replicate(Branch branch, string repository,
            string secondRepository)
        {
            Console.WriteLine("Replicating branch {0}", branch.Name);

            string cmdResult = CmdRunner.ExecuteCommandWithStringResult(
            string.Format("cm replicate \"br:{0}@{1}\" \"rep:{2}\"",
                branch.Name, repository, secondRepository),
            Environment.CurrentDirectory);

            return new ReplicationResult(SampleHelper.GetListResults(cmdResult, true), branch);
        }
예제 #2
0
 public ReplicationResult(ArrayList cmdResult, Branch branch)
 {
     Branch = branch;
     string buffer = (string)cmdResult[1];
     Items = long.Parse(buffer.Substring(buffer.LastIndexOf(' ')));
 }
예제 #3
0
        private bool HasChangesInBranch(Branch branch)
        {
            string srcResult = CmdRunner.ExecuteCommandWithStringResult(
                string.Format("cm find changeset where branch = 'br:{0}' on repositories '{1}' --format={{id}} --nototal",
                branch.Name, mSampleRep),
                Environment.CurrentDirectory);

            ArrayList srcResults = SampleHelper.GetListResults(srcResult, true);

            string dstResult = CmdRunner.ExecuteCommandWithStringResult(
                string.Format("cm find changeset where branch = 'br:{0}' on repositories '{1}' --format={{id}} --nototal",
                branch.Name, mSecondRep),
                Environment.CurrentDirectory);

            ArrayList dstResults = SampleHelper.GetListResults(dstResult, true);

            return srcResults.Count != dstResults.Count;
        }