• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# NGit.AnyObjectId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中NGit.AnyObjectId的典型用法代码示例。如果您正苦于以下问题:C# AnyObjectId类的具体用法?C# AnyObjectId怎么用?C# AnyObjectId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



AnyObjectId类属于NGit命名空间,在下文中一共展示了AnyObjectId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: GetSize

		/// <exception cref="System.IO.IOException"></exception>
		internal static long GetSize(InputStream @in, AnyObjectId id, WindowCursor wc)
		{
			try
			{
				@in = Buffer(@in);
				@in.Mark(20);
				byte[] hdr = new byte[64];
				IOUtil.ReadFully(@in, hdr, 0, 2);
				if (IsStandardFormat(hdr))
				{
					@in.Reset();
					Inflater inf = wc.Inflater();
					InputStream zIn = Inflate(@in, inf);
					int avail = ReadSome(zIn, hdr, 0, 64);
					if (avail < 5)
					{
						throw new CorruptObjectException(id, JGitText.Get().corruptObjectNoHeader);
					}
					MutableInteger p = new MutableInteger();
					Constants.DecodeTypeString(id, hdr, unchecked((byte)' '), p);
					long size = RawParseUtils.ParseLongBase10(hdr, p.value, p);
					if (size < 0)
					{
						throw new CorruptObjectException(id, JGitText.Get().corruptObjectNegativeSize);
					}
					return size;
				}
				else
				{
					ReadSome(@in, hdr, 2, 18);
					int c = hdr[0] & unchecked((int)(0xff));
					long size = c & 15;
					int shift = 4;
					int p = 1;
					while ((c & unchecked((int)(0x80))) != 0)
					{
						c = hdr[p++] & unchecked((int)(0xff));
						size += (c & unchecked((int)(0x7f))) << shift;
						shift += 7;
					}
					return size;
				}
			}
			catch (SharpZipBaseException)
			{
				throw new CorruptObjectException(id, JGitText.Get().corruptObjectBadStream);
			}
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:49,代码来源:UnpackedObject.cs


示例17: CheckValidEndOfStream

		/// <exception cref="System.IO.IOException"></exception>
		/// <exception cref="NGit.Errors.CorruptObjectException"></exception>
		private static void CheckValidEndOfStream(InputStream @in, Inflater inf, AnyObjectId
			 id, byte[] buf)
		{
			for (; ; )
			{
				int r;
				try
				{
					r = inf.Inflate(buf);
				}
				catch (SharpZipBaseException)
				{
					throw new CorruptObjectException(id, JGitText.Get().corruptObjectBadStream);
				}
				if (r != 0)
				{
					throw new CorruptObjectException(id, JGitText.Get().corruptObjectIncorrectLength);
				}
				if (inf.IsFinished)
				{
					if (inf.RemainingInput != 0 || @in.Read() != -1)
					{
						throw new CorruptObjectException(id, JGitText.Get().corruptObjectBadStream);
					}
					break;
				}
				if (!inf.IsNeedingInput)
				{
					throw new CorruptObjectException(id, JGitText.Get().corruptObjectBadStream);
				}
				r = @in.Read(buf);
				if (r <= 0)
				{
					throw new CorruptObjectException(id, JGitText.Get().corruptObjectBadStream);
				}
				inf.SetInput(buf, 0, r);
			}
		}
开发者ID:nocache,项目名称:monodevelop,代码行数:40,代码来源:UnpackedObject.cs


示例18: RemoveBaseById

		private PackParser.UnresolvedDelta RemoveBaseById(AnyObjectId id)
		{
			PackParser.DeltaChain d = baseById.Get(id);
			return d != null ? d.Remove() : null;
		}
开发者ID:LunarLanding,项目名称:ngit,代码行数:5,代码来源:PackParser.cs


示例19: DeltaChain

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


示例20: OnBeginRefDelta

		/// <summary>Event notifying start of a delta referencing its base by ObjectId.</summary>
		/// <remarks>Event notifying start of a delta referencing its base by ObjectId.</remarks>
		/// <param name="deltaStreamPosition">position of this object in the incoming stream.
		/// 	</param>
		/// <param name="baseId">
		/// name of the base object. This object may be later in the
		/// stream, or might not appear at all in the stream (in the case
		/// of a thin-pack).
		/// </param>
		/// <param name="inflatedSize">
		/// size of the delta when fully inflated. The size stored within
		/// the pack may be larger or smaller, and is not yet known.
		/// </param>
		/// <exception cref="System.IO.IOException">the object cannot be recorded.</exception>
		protected internal abstract void OnBeginRefDelta(long deltaStreamPosition, AnyObjectId
			 baseId, long inflatedSize);
开发者ID:LunarLanding,项目名称:ngit,代码行数:16,代码来源:PackParser.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# NGit.ObjectId类代码示例发布时间:2022-05-26
下一篇:
C# Mathematical.VectorN类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap