本文整理汇总了C#中Chorus.VcsDrivers.Mercurial.FileInRevision.GetFileContents方法的典型用法代码示例。如果您正苦于以下问题:C# FileInRevision.GetFileContents方法的具体用法?C# FileInRevision.GetFileContents怎么用?C# FileInRevision.GetFileContents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Chorus.VcsDrivers.Mercurial.FileInRevision
的用法示例。
在下文中一共展示了FileInRevision.GetFileContents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Find2WayDifferences
public IEnumerable<IChangeReport> Find2WayDifferences(FileInRevision parent, FileInRevision child, HgRepository repository)
{
var diffReports = new List<IChangeReport>(1);
// The only relevant change to report is the version number.
var childData = child.GetFileContents(repository);
var splitData = SplitData(childData);
var childModelNumber = Int32.Parse(splitData[1]);
if (parent == null)
{
diffReports.Add(new FieldWorksModelVersionAdditionChangeReport(child, childModelNumber));
}
else
{
var parentData = parent.GetFileContents(repository);
splitData = SplitData(parentData);
var parentModelNumber = Int32.Parse(splitData[1]);
if (parentModelNumber != childModelNumber)
diffReports.Add(new FieldWorksModelVersionUpdatedReport(parent, child, parentModelNumber, childModelNumber));
else
throw new InvalidOperationException("The version number has downgraded");
}
return diffReports;
}
示例2: GetDataFromRevision
internal static Dictionary<string, byte[]> GetDataFromRevision(FileInRevision revision, HgRepository repository)
{
var doc = XDocument.Parse(revision.GetFileContents(repository));
var data = doc.Root.Elements("layout")
.ToDictionary(layoutElement =>
layoutElement.Attribute("class").Value + layoutElement.Attribute("type").Value + layoutElement.Attribute("name").Value,
layoutElement => SharedConstants.Utf8.GetBytes(layoutElement.ToString()));
var layoutTypeElement = doc.Root.Element("layoutType");
if (layoutTypeElement != null)
data.Add("layoutType", SharedConstants.Utf8.GetBytes(doc.Root.Element("layoutType").ToString()));
return data;
}
示例3: CreateFromFileInRevision
public static Lift2WayDiffer CreateFromFileInRevision(IMergeStrategy mergeStrategy, FileInRevision parent, FileInRevision child, IMergeEventListener eventListener, HgRepository repository)
{
return new Lift2WayDiffer(mergeStrategy, parent.GetFileContents(repository), child.GetFileContents(repository), eventListener, parent, child);
}
示例4: Find2WayDifferences
public IEnumerable<IChangeReport> Find2WayDifferences(FileInRevision parent, FileInRevision child, HgRepository repository)
{
yield return new TextEditChangeReport(parent, child, parent.GetFileContents(repository), child.GetFileContents(repository));
}