public void CreateBranch(INewBranchArgs args) { if (args.Permanent) { CreatePermanentBranch(args); } else { CreateBookmark(args); } }
private void CreateBookmark(INewBranchArgs args) { var ab = new ArgBuilder(); ab.Add("bookmarks"); if (!String.IsNullOrEmpty(args.TargetChangeset)) { ab.Add($"--rev \"{args.TargetChangeset}\""); } ab.AddIf(args.Force, "--force"); ab.Add(args.Name); RunCommand(ab, args); }
private void CreatePermanentBranch(INewBranchArgs args) { if (!String.IsNullOrEmpty(args.TargetChangeset)) { throw new NotSupportedException($"'{nameof(args.TargetChangeset)}' is not supported for permanent branches."); } var ab = new ArgBuilder(); ab.Add("branch"); ab.Add($"\"{args.Name}\""); ab.AddIf(args.Force, "--force"); RunCommand(ab, args); if (args.Commit) { Commit(new CommitScmFileArgs { RepositoryPath = args.RepositoryPath, Message = $"Opened branch '{args.Name}'" }); } }
public void CreateBranch(INewBranchArgs args) { throw new NotImplementedException(); }