private int SearchRevision(string initRevision)
{
var exactIndex = Revisions.TryGetRevisionIndex(initRevision);
if (exactIndex.HasValue)
return exactIndex.Value;
foreach (var parentHash in GetAllParents(initRevision))
{
var parentIndex = Revisions.TryGetRevisionIndex(parentHash);
if (parentIndex.HasValue)
return parentIndex.Value;
}
return -1;
}