public Changeset[] UploadChangesets(IUploadChangesetArgs args) { var currentBranch = GetBranches(new GetBranchesArgs { Current = true, RepositoryPath = args.RepositoryPath }).FirstOrDefault(); var targetRev = args.TargetRev.WhenNullOrEmpty(currentBranch); var destination = args.Destination.WhenNullOrEmpty("origin"); var query = new RevisionQuery { FromRevisionId = targetRev, ToRevisionId = $"{destination}/{targetRev}" }; var changeSets = GetChangesets(new GetChangesetsArgs { RepositoryPath = args.RepositoryPath, Query = query }); if (!args.CheckOnly) { var ab = new ArgBuilder(); ab.Add("push"); ab.Add(args.Destination); ab.Add(args.TargetRev); } return(changeSets); }
public string FormatQuery(RevisionQuery query) { if (query == null) { return(""); } return($"{query.ToRevisionId}..{query.FromRevisionId}"); }
public string FormatQuery(RevisionQuery query) { if (!String.IsNullOrEmpty(query.ToRevisionId)) { return($"{query.FromRevisionId}:{query.ToRevisionId}"); } return(query.FromRevisionId); }