Beispiel #1
0
 public string GetTrackRoot(TrackItem trackItem)
 {
     if (trackItem.Branch != Name)
         throw new ArgumentException("invalid branch");
     string result = string.IsNullOrEmpty(trackItem.AdditionalOffset) ? Path.Combine(RepoRoot, trackItem.Path) : Path.Combine(RepoRoot, trackItem.AdditionalOffset, trackItem.Path);
     return result.Replace("\\", "/");
 }
Beispiel #2
0
 public string GetVcsPath(TrackItem trackItem, string path)
 {
     if (trackItem.IsFile)
     {
         return(GetTrackRoot(trackItem));
     }
     return($"{GetTrackRoot(trackItem)}/{path}");
 }
Beispiel #3
0
        public string GetTrackRoot(TrackItem trackItem)
        {
            if (trackItem.Branch.Name != Name)
            {
                throw new ArgumentException("invalid branch");
            }
            string result = string.IsNullOrEmpty(trackItem.AdditionalOffset) ? Path.Combine(RepoRoot, trackItem.Path) : Path.Combine(RepoRoot, trackItem.AdditionalOffset, trackItem.Path);

            return(result.Replace("\\", "/"));
        }
Beispiel #4
0
        public string GetRepoRoot(TrackItem trackItem)
        {
            if (trackItem.Branch.Name != Name)
            {
                throw new ArgumentException("invalid branch");
            }
            string result = string.IsNullOrEmpty(trackItem.AdditionalOffset) ? trackItem.ProjectPath : Path.Combine(trackItem.AdditionalOffset, trackItem.ProjectPath);

            return(result);
        }
Beispiel #5
0
 public string GetLocalRoot(TrackItem trackItem, string localPath)
 {
     return(Path.Combine(localPath, trackItem.ProjectPath));
 }
Beispiel #6
0
 static bool CheckItemForChangeSet(MergeRequestFileData x, TrackItem track) {
     var root = x.OldPath.Split(new[] { @"\", @"/" }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault();
     return root == track.ProjectPath;
 }
Beispiel #7
0
        public IList<TrackItem> GenerateTrackItems(TrackBranch trackBranch, TrackItem trackItem)
        {
            if (!trackItem.GoDeeper)
                return new List<TrackItem>() {trackItem};
            try {
                var repo = DXVcsConnectionHelper.Connect(server, user, password);
                string trackRoot = trackBranch.GetTrackRoot(trackItem);
                var projectData = repo.GetProjectData(trackRoot);
                if (projectData.IsNull || projectData.SubProjectsCount == 0)
                    return new List<TrackItem>() {trackItem};
                var innerProjects = repo.GetProjects(trackRoot);
                if (innerProjects == null || innerProjects.Length == 0)
                    return new List<TrackItem>() { trackItem };

                List<TrackItem> result = new List<TrackItem>(innerProjects.Length);
                foreach (var info in innerProjects) {
                    var newTrackItem = new TrackItem();
                    newTrackItem.Branch = trackBranch.Name;
                    newTrackItem.GoDeeper = false;
                    newTrackItem.Path = trackItem.Path + @"/" + info.Name;
                    newTrackItem.ProjectPath = Path.Combine(trackItem.ProjectPath, info.Name).Replace(@"\", @"/");
                    newTrackItem.AdditionalOffset = trackItem.AdditionalOffset;
                    result.Add(newTrackItem);
                }
                return result;
            }
            catch(Exception ex)  {
                Log.Error("Generating trackitems from config failed", ex);
                throw ex;
            }
        }
Beispiel #8
0
 protected bool Equals(TrackItem other)
 {
     return(GoDeeper == other.GoDeeper && string.Equals(Path, other.Path) && string.Equals(ProjectPath, other.ProjectPath) && string.Equals(AdditionalOffset, other.AdditionalOffset) && IsFile == other.IsFile);
 }