本文整理汇总了C#中Area.GetBranchByPartialName方法的典型用法代码示例。如果您正苦于以下问题:C# Area.GetBranchByPartialName方法的具体用法?C# Area.GetBranchByPartialName怎么用?C# Area.GetBranchByPartialName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Area
的用法示例。
在下文中一共展示了Area.GetBranchByPartialName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RunInternal
protected override bool RunInternal(Area ws, Versionr.Status status, IList<Versionr.Status.StatusEntry> targets, FileBaseCommandVerbOptions options)
{
LogVerbOptions localOptions = options as LogVerbOptions;
if (JruntingMode)
localOptions.Detail = LogVerbOptions.DetailMode.Jrunting;
Printer.EnableDiagnostics = localOptions.Verbose;
bool targetedBranch = false;
Objects.Version version = null;
if (!string.IsNullOrEmpty(localOptions.Branch))
{
bool multipleBranches = false;
var branch = ws.GetBranchByPartialName(localOptions.Branch, out multipleBranches);
if (branch == null || multipleBranches)
{
Printer.PrintError("No unique branch found for {0}", localOptions.Branch);
return false;
}
version = ws.GetBranchHeadVersion(branch);
targetedBranch = true;
}
else if (!string.IsNullOrEmpty(localOptions.Version))
{
version = ws.GetPartialVersion(localOptions.Version);
if (version == null)
{
Printer.PrintError("Couldn't find matching version for {0}", localOptions.Version);
return false;
}
}
if (localOptions.Limit == -1)
localOptions.Limit = (version == null || targetedBranch) ? 10 : 1;
if (version == null)
version = ws.Version;
int? nullableLimit = localOptions.Limit;
if (nullableLimit.Value <= 0)
nullableLimit = null;
var history = (localOptions.ShowMerged ? ws.GetLogicalHistory(version, nullableLimit) : ws.GetHistory(version, nullableLimit)).AsEnumerable();
m_Tip = Workspace.Version;
Objects.Version last = null;
m_Branches = new Dictionary<Guid, Objects.Branch>();
foreach (var x in ApplyHistoryFilter(history, localOptions))
{
last = x.Item1;
FormatLog(x.Item1, x.Item2, localOptions);
}
if (!localOptions.Jrunting && last != null && last.ID == m_Tip.ID && version == null)
{
var branch = Workspace.CurrentBranch;
var heads = Workspace.GetBranchHeads(branch);
bool isHead = heads.Any(x => x.Version == last.ID);
bool isOnlyHead = heads.Count == 1;
if (!isHead)
Printer.PrintMessage("\nCurrent version #b#{0}## is #e#not the head## of branch #b#{1}## (#b#\"{2}\"##)", m_Tip.ShortName, branch.ShortID, branch.Name);
else if (!isOnlyHead)
Printer.PrintMessage("\nCurrent version #b#{0}## is #w#not only the head## of branch #b#{1}## (#b#\"{2}\"##)", m_Tip.ShortName, branch.ShortID, branch.Name);
}
return true;
}