当前位置: 首页>>代码示例>>C#>>正文


C# NGit.AnyObjectId类代码示例

本文整理汇总了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();
        }
开发者ID:stinos,项目名称:ngit,代码行数:9,代码来源:TrackingRefUpdate.cs

示例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);
        }
开发者ID:sharwell,项目名称:ngit,代码行数:10,代码来源:TrackingRefUpdate.cs

示例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;
			}
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:23,代码来源:ThreeWayMerger.cs

示例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();
			}
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:21,代码来源:UnpackedObject.cs

示例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;
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:21,代码来源:AnyObjectId.cs

示例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;
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:26,代码来源:SubmoduleWalk.cs

示例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;
			}
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:21,代码来源:UnpackedObjectCache.cs

示例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();
			}
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:10,代码来源:LargeObjectException.cs

示例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));
				}
			}
		}
开发者ID:yayanyang,项目名称:monodevelop,代码行数:48,代码来源:DirCacheBuilder.cs

示例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)
		{
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:6,代码来源:PackedObjectInfo.cs

示例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);
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:11,代码来源:LargeObjectException.cs

示例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;
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:23,代码来源:PackParser.cs

示例13: SubclassedId

			internal SubclassedId(AnyObjectId src) : base(src)
			{
			}
开发者ID:LunarLanding,项目名称:ngit,代码行数:3,代码来源:RefUpdateTest.cs

示例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;
			}
开发者ID:nocache,项目名称:monodevelop,代码行数:9,代码来源:UnpackedObject.cs

示例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>
		/// &lt;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>;
		/// &gt;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));
		}
开发者ID:nickname100,项目名称:monodevelop,代码行数:37,代码来源:AbbreviatedObjectId.cs


注:本文中的NGit.AnyObjectId类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。