本文整理汇总了C#中NGit.AnyObjectId类的典型用法代码示例。如果您正苦于以下问题:C# AnyObjectId类的具体用法?C# AnyObjectId怎么用?C# AnyObjectId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AnyObjectId类属于NGit命名空间,在下文中一共展示了AnyObjectId类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TrackingRefUpdate
internal TrackingRefUpdate(bool canForceUpdate, string remoteName, string localName
, AnyObjectId oldValue, AnyObjectId newValue)
{
this.remoteName = remoteName;
this.localName = localName;
this.forceUpdate = canForceUpdate;
this.oldObjectId = oldValue.Copy();
this.newObjectId = newValue.Copy();
}
示例2: TrackingRefUpdate
/// <exception cref="System.IO.IOException"></exception>
internal TrackingRefUpdate(Repository db, string localName, string remoteName, bool
forceUpdate, AnyObjectId nv, string msg)
{
this.remoteName = remoteName;
update = db.UpdateRef(localName);
update.SetForceUpdate(forceUpdate);
update.SetNewObjectId(nv);
update.SetRefLogMessage(msg, true);
}
示例3: SetBase
/// <summary>Set the common ancestor tree.</summary>
/// <remarks>Set the common ancestor tree.</remarks>
/// <param name="id">
/// common base treeish; null to automatically compute the common
/// base from the input commits during
/// <see cref="Merge(NGit.AnyObjectId[])">Merge(NGit.AnyObjectId[])</see>
/// .
/// </param>
/// <exception cref="NGit.Errors.IncorrectObjectTypeException">the object is not a treeish.
/// </exception>
/// <exception cref="NGit.Errors.MissingObjectException">the object does not exist.</exception>
/// <exception cref="System.IO.IOException">the object could not be read.</exception>
public virtual void SetBase(AnyObjectId id)
{
if (id != null)
{
baseTree = walk.ParseTree(id);
}
else
{
baseTree = null;
}
}
示例4: Parse
/// <summary>Parse an object from the unpacked object format.</summary>
/// <remarks>Parse an object from the unpacked object format.</remarks>
/// <param name="raw">complete contents of the compressed object.</param>
/// <param name="id">
/// expected ObjectId of the object, used only for error reporting
/// in exceptions.
/// </param>
/// <returns>loader to read the inflated contents.</returns>
/// <exception cref="System.IO.IOException">the object cannot be parsed.</exception>
public static ObjectLoader Parse(byte[] raw, AnyObjectId id)
{
WindowCursor wc = new WindowCursor(null);
try
{
return Open(new ByteArrayInputStream(raw), null, id, wc);
}
finally
{
wc.Release();
}
}
示例5: Equals
/// <summary>Compare to object identifier byte sequences for equality.</summary>
/// <remarks>Compare to object identifier byte sequences for equality.</remarks>
/// <param name="firstObjectId">the first identifier to compare. Must not be null.</param>
/// <param name="secondObjectId">the second identifier to compare. Must not be null.</param>
/// <returns>true if the two identifiers are the same.</returns>
public static bool Equals(AnyObjectId firstObjectId, AnyObjectId secondObjectId)
{
if (firstObjectId == secondObjectId)
{
return true;
}
// We test word 2 first as odds are someone already used our
// word 1 as a hash code, and applying that came up with these
// two instances we are comparing for equality. Therefore the
// first two words are very likely to be identical. We want to
// break away from collisions as quickly as possible.
//
return firstObjectId.w2 == secondObjectId.w2 && firstObjectId.w3 == secondObjectId
.w3 && firstObjectId.w4 == secondObjectId.w4 && firstObjectId.w5 == secondObjectId
.w5 && firstObjectId.w1 == secondObjectId.w1;
}
示例6: ForPath
/// <summary>
/// Create a generator and advance it to the submodule entry at the given
/// path
/// </summary>
/// <param name="repository"></param>
/// <param name="treeId"></param>
/// <param name="path"></param>
/// <returns>generator at given path, null if no submodule at given path</returns>
/// <exception cref="System.IO.IOException">System.IO.IOException</exception>
public static NGit.Submodule.SubmoduleWalk ForPath(Repository repository, AnyObjectId
treeId, string path)
{
NGit.Submodule.SubmoduleWalk generator = new NGit.Submodule.SubmoduleWalk(repository
);
generator.SetTree(treeId);
PathFilter filter = PathFilter.Create(path);
generator.SetFilter(filter);
while (generator.Next())
{
if (filter.IsDone(generator.walk))
{
return generator;
}
}
return null;
}
示例7: Add
internal virtual void Add(AnyObjectId objectId)
{
UnpackedObjectCache.Table t = table;
if (t.Add(objectId))
{
}
else
{
// The object either already exists in the table, or was
// successfully added. Either way leave the table alone.
//
// The object won't fit into the table. Implement a crude
// cache removal by just dropping the table away, but double
// it in size for the next incarnation.
//
UnpackedObjectCache.Table n = new UnpackedObjectCache.Table(Math.Min(t.bits + 1,
MAX_BITS));
n.Add(objectId);
table = n;
}
}
示例8: SetObjectId
/// <summary>Set the identity of the object, if its not already set.</summary>
/// <remarks>Set the identity of the object, if its not already set.</remarks>
/// <param name="id">the id of the object that is too large to process.</param>
public virtual void SetObjectId(AnyObjectId id)
{
if (objectId == null)
{
objectId = id.Copy();
}
}
示例9: AddTree
/// <summary>Recursively add an entire tree into this builder.</summary>
/// <remarks>
/// Recursively add an entire tree into this builder.
/// <p>
/// If pathPrefix is "a/b" and the tree contains file "c" then the resulting
/// DirCacheEntry will have the path "a/b/c".
/// <p>
/// All entries are inserted at stage 0, therefore assuming that the
/// application will not insert any other paths with the same pathPrefix.
/// </remarks>
/// <param name="pathPrefix">
/// UTF-8 encoded prefix to mount the tree's entries at. If the
/// path does not end with '/' one will be automatically inserted
/// as necessary.
/// </param>
/// <param name="stage">stage of the entries when adding them.</param>
/// <param name="reader">
/// reader the tree(s) will be read from during recursive
/// traversal. This must be the same repository that the resulting
/// DirCache would be written out to (or used in) otherwise the
/// caller is simply asking for deferred MissingObjectExceptions.
/// Caller is responsible for releasing this reader when done.
/// </param>
/// <param name="tree">
/// the tree to recursively add. This tree's contents will appear
/// under <code>pathPrefix</code>. The ObjectId must be that of a
/// tree; the caller is responsible for dereferencing a tag or
/// commit (if necessary).
/// </param>
/// <exception cref="System.IO.IOException">a tree cannot be read to iterate through its entries.
/// </exception>
public virtual void AddTree(byte[] pathPrefix, int stage, ObjectReader reader, AnyObjectId
tree)
{
TreeWalk tw = new TreeWalk(reader);
tw.AddTree(new CanonicalTreeParser(pathPrefix, reader, tree.ToObjectId()));
tw.Recursive = true;
if (tw.Next())
{
DirCacheEntry newEntry = ToEntry(stage, tw);
BeforeAdd(newEntry);
FastAdd(newEntry);
while (tw.Next())
{
FastAdd(ToEntry(stage, tw));
}
}
}
示例10: PackedObjectInfo
/// <summary>Create a new structure to remember information about an object.</summary>
/// <remarks>Create a new structure to remember information about an object.</remarks>
/// <param name="id">the identity of the object the new instance tracks.</param>
protected internal PackedObjectInfo(AnyObjectId id) : base(id)
{
}
示例11: LargeObjectException
/// <summary>Create a large object exception, naming the object that is too big.</summary>
/// <remarks>Create a large object exception, naming the object that is too big.</remarks>
/// <param name="id">
/// identity of the object that is too big to be loaded as a byte
/// array in this JVM.
/// </param>
public LargeObjectException(AnyObjectId id)
{
// Do nothing.
SetObjectId(id);
}
示例12: NewInfo
/// <summary>Construct a PackedObjectInfo instance for this parser.</summary>
/// <remarks>Construct a PackedObjectInfo instance for this parser.</remarks>
/// <param name="id">identity of the object to be tracked.</param>
/// <param name="delta">
/// if the object was previously an unresolved delta, this is the
/// delta object that was tracking it. Otherwise null.
/// </param>
/// <param name="deltaBase">
/// if the object was previously an unresolved delta, this is the
/// ObjectId of the base of the delta. The base may be outside of
/// the pack stream if the stream was a thin-pack.
/// </param>
/// <returns>info object containing this object's data.</returns>
protected internal virtual PackedObjectInfo NewInfo(AnyObjectId id, PackParser.UnresolvedDelta
delta, ObjectId deltaBase)
{
PackedObjectInfo oe = new PackedObjectInfo(id);
if (delta != null)
{
oe.SetCRC(delta.crc);
}
return oe;
}
示例13: SubclassedId
internal SubclassedId(AnyObjectId src) : base(src)
{
}
示例14: LargeObject
internal LargeObject(int type, long size, FilePath path, AnyObjectId id, FileObjectDatabase
db)
{
this.type = type;
this.size = size;
this.path = path;
this.id = id.Copy();
this.source = db;
}
示例15: PrefixCompare
/// <summary>Compares this abbreviation to a full object id.</summary>
/// <remarks>Compares this abbreviation to a full object id.</remarks>
/// <param name="other">the other object id.</param>
/// <returns>
/// <0 if this abbreviation names an object that is less than
/// <code>other</code>; 0 if this abbreviation exactly matches the
/// first
/// <see cref="Length()">Length()</see>
/// digits of <code>other.name()</code>;
/// >0 if this abbreviation names an object that is after
/// <code>other</code>.
/// </returns>
public int PrefixCompare(AnyObjectId other)
{
int cmp;
cmp = NB.CompareUInt32(w1, Mask(1, other.w1));
if (cmp != 0)
{
return cmp;
}
cmp = NB.CompareUInt32(w2, Mask(2, other.w2));
if (cmp != 0)
{
return cmp;
}
cmp = NB.CompareUInt32(w3, Mask(3, other.w3));
if (cmp != 0)
{
return cmp;
}
cmp = NB.CompareUInt32(w4, Mask(4, other.w4));
if (cmp != 0)
{
return cmp;
}
return NB.CompareUInt32(w5, Mask(5, other.w5));
}