示例#1
0
        public static string GetDisplayBranchName(List<string> branches, BranchNameMatch[] aliases)
        {
            if (branches == null || branches.Count == 0)
                return string.Empty;

            if (branches.Count == 1)
            {
                return GetShortBranchName(branches[0], aliases);
            }
            return "multi";
        }
示例#2
0
        public static string GetShortBranchName(string branchFullName, BranchNameMatch[] aliases)
        {
            foreach (var branchNameMatch in (aliases ?? new BranchNameMatch[0])
                .Concat(new[] { new BranchNameMatch { match = "/([^/]+)$", alias = "$1" } })) // default match
            {
                var regex = new Regex(branchNameMatch.match);
                var match = regex.Match(branchFullName);
                if (match.Success)
                {
                    return match.Result(branchNameMatch.alias); //return first match
                }
            }

            return branchFullName; // return full name if nothing matched
        }
示例#3
0
 public CommentFormater(CommentFormat format, BranchNameMatch[] aliases)
 {
     _format = format;
     _aliases = aliases;
 }
示例#4
0
 public MergeInfoViewModel(IEventAggregator eventAggregator, BranchNameMatch[] aliases)
 {
     _eventAggregator = eventAggregator;
     _aliases = aliases;
 }