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


C# AnyObjectId.Copy方法代码示例

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


在下文中一共展示了AnyObjectId.Copy方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TrackingRefUpdate

 public TrackingRefUpdate(Repository db, string localName, string remoteName, bool forceUpdate, AnyObjectId nv, string msg)
 {
     RemoteName = remoteName;
     update = db.UpdateRef(localName);
     update.IsForceUpdate = forceUpdate;
     update.NewObjectId = nv.Copy();
     update.SetRefLogMessage(msg, true);
 }
开发者ID:ArildF,项目名称:GitSharp,代码行数:8,代码来源:TrackingRefUpdate.cs

示例2: TrackingRefUpdate

 public TrackingRefUpdate(Repository db, string localName, string remoteName, bool forceUpdate, AnyObjectId nv, string msg)
 {
     if (db == null)
         throw new System.ArgumentNullException("db");
     if (nv == null)
         throw new System.ArgumentNullException("nv");
     RemoteName = remoteName;
     update = db.UpdateRef(localName);
     update.IsForceUpdate = forceUpdate;
     update.NewObjectId = nv.Copy();
     update.setRefLogMessage(msg, true);
 }
开发者ID:dev218,项目名称:GitSharp,代码行数:12,代码来源:TrackingRefUpdate.cs

示例3: FindCRC32

        public override long FindCRC32(AnyObjectId objId)
        {
            int levelOne = objId.GetFirstByte();
            int levelTwo = BinarySearchLevelTwo(objId, levelOne);
            if (levelTwo == -1)
            {
                throw new MissingObjectException(objId.Copy(), ObjectType.Unknown);
            }

            return NB.DecodeUInt32(_crc32[levelOne], levelTwo << 2);
        }
开发者ID:nestalk,项目名称:GitSharp,代码行数:11,代码来源:PackIndexV2.cs

示例4: RecordError

 private void RecordError(AnyObjectId id, Exception e)
 {
     ObjectId objId = id.Copy();
     if (_fetchErrors.ContainsKey(objId))
     {
         _fetchErrors[objId].Add(e);
     }
     else
     {
         _fetchErrors.Add(objId, new List<Exception>(2) { e });
     }
 }
开发者ID:HackerBaloo,项目名称:GitSharp,代码行数:12,代码来源:WalkFetchConnection.cs

示例5: DownloadObject

        private void DownloadObject(ProgressMonitor pm, AnyObjectId id)
        {
            if (_local.HasObject(id)) return;

            while (true)
            {
                if (DownloadPackedObject(pm, id))
                    return;

                string idStr = id.Name;
                string subdir = idStr.Slice(0, 2);
                string file = idStr.Substring(2);
                string looseName = subdir + "/" + file;

                for (int i = _lastRemoteIdx; i < _remotes.Count; i++)
                {
                    if (DownloadLooseObject(id, looseName, _remotes[i]))
                    {
                        _lastRemoteIdx = i;
                        return;
                    }
                }

                for (int i = 0; i < _lastRemoteIdx; i++)
                {
                    if (DownloadLooseObject(id, looseName, _remotes[i]))
                    {
                        _lastRemoteIdx = i;
                        return;
                    }
                }

                while (_noPacksYet.Count > 0)
                {
                    WalkRemoteObjectDatabase wrr = _noPacksYet.First.Value;
                    _noPacksYet.RemoveFirst();
                    List<string> packNameList;
                    try
                    {
                        pm.BeginTask("Listing packs", ProgressMonitor.UNKNOWN);
                        packNameList = wrr.getPackNames();
                    }
                    catch (IOException e)
                    {
                        RecordError(id, e);
                        continue;
                    }
                    finally
                    {
                        pm.EndTask();
                    }

                    if (packNameList == null || packNameList.Count == 0)
                        continue;
                    foreach (string packName in packNameList)
                    {
                        if (!_packsConsidered.Contains(packName))
                        {
                            _packsConsidered.Add(packName);
                            _unfetchedPacks.AddLast(new RemotePack(_lockMessage, _packLocks, _objCheck, _local, wrr, packName));
                        }
                    }
                    if (DownloadPackedObject(pm, id))
                        return;
                }

                List<WalkRemoteObjectDatabase> al = ExpandOneAlternate(id, pm);
                if (al != null && al.Count > 0)
                {
                    foreach (WalkRemoteObjectDatabase alt in al)
                    {
                        _remotes.Add(alt);
                        _noPacksYet.AddLast(alt);
                        _noAlternatesYet.AddLast(alt);
                    }
                    continue;
                }

                List<Exception> failures = null;
                if (_fetchErrors.ContainsKey(id.Copy()))
                {
                    failures = _fetchErrors[id.Copy()];
                }

                TransportException te = null;
                if (failures != null && failures.Count > 0)
                {
                    te = failures.Count == 1 ?
                        new TransportException("Cannot get " + id.Name + ".", failures[0]) :
                        new TransportException("Cannot get " + id.Name + ".", new CompoundException(failures));
                }

                if (te == null)
                {
                    te = new TransportException("Cannot get " + id.Name + ".");
                }

                throw te;
            }
        }
开发者ID:HackerBaloo,项目名称:GitSharp,代码行数:100,代码来源:WalkFetchConnection.cs

示例6: RecordError

 private void RecordError(AnyObjectId id, Exception what)
 {
     ObjectId objId = id.Copy();
     List<Exception> errors = _fetchErrors.get(objId);
     if (errors == null)
     {
         errors = new List<Exception>(2);
         _fetchErrors.put(objId, errors);
     }
     errors.Add(what);
 }
开发者ID:spraints,项目名称:GitSharp,代码行数:11,代码来源:WalkFetchConnection.cs

示例7: DownloadObject

        private void DownloadObject(ProgressMonitor pm, AnyObjectId id)
        {
            if (_local.HasObject(id)) return;

            while (true)
            {
                // Try a pack file we know about, but don't have yet. Odds are
                // that if it has this object, it has others related to it so
                // getting the pack is a good bet.
                //
                if (DownloadPackedObject(pm, id))
                    return;

                // Search for a loose object over all alternates, starting
                // from the one we last successfully located an object through.
                //
                string idStr = id.Name;
                string subdir = idStr.Slice(0, 2);
                string file = idStr.Substring(2);
                string looseName = subdir + "/" + file;

                for (int i = _lastRemoteIdx; i < _remotes.Count; i++)
                {
                    if (DownloadLooseObject(id, looseName, _remotes[i]))
                    {
                        _lastRemoteIdx = i;
                        return;
                    }
                }

                for (int i = 0; i < _lastRemoteIdx; i++)
                {
                    if (DownloadLooseObject(id, looseName, _remotes[i]))
                    {
                        _lastRemoteIdx = i;
                        return;
                    }
                }

                // Try to obtain more pack information and search those.
                //
                while (_noPacksYet.Count > 0)
                {
                    WalkRemoteObjectDatabase wrr = _noPacksYet.First.Value;
                    _noPacksYet.RemoveFirst();
                    ICollection<string> packNameList;
                    try
                    {
                        pm.BeginTask("Listing packs", ProgressMonitor.UNKNOWN);
                        packNameList = wrr.getPackNames();
                    }
                    catch (IOException e)
                    {
                        // Try another repository.
                        //
                        RecordError(id, e);
                        continue;
                    }
                    finally
                    {
                        pm.EndTask();
                    }

                    if (packNameList == null || packNameList.Count == 0)
                        continue;
                    foreach (string packName in packNameList)
                    {
                        bool contains = _packsConsidered.Contains(packName);
                        _packsConsidered.Add(packName);
                        if (!contains)
                        {
                            _unfetchedPacks.AddLast(new RemotePack(_lockMessage, _packLocks, _objCheck, _local, wrr, packName));
                        }
                    }
                    if (DownloadPackedObject(pm, id))
                        return;
                }

                // Try to expand the first alternate we haven't expanded yet.
                //
                ICollection<WalkRemoteObjectDatabase> al = ExpandOneAlternate(id, pm);
                if (al != null && al.Count > 0)
                {
                    foreach (WalkRemoteObjectDatabase alt in al)
                    {
                        _remotes.Add(alt);
                        _noPacksYet.AddLast(alt);
                        _noAlternatesYet.AddLast(alt);
                    }
                    continue;
                }

                // We could not obtain the object. There may be reasons why.
                //
                List<Exception> failures = _fetchErrors.get(id.Copy());

                var te = new TransportException("Cannot get " + id.Name + ".");

                if (failures != null && failures.Count > 0)
                {
//.........这里部分代码省略.........
开发者ID:spraints,项目名称:GitSharp,代码行数:101,代码来源:WalkFetchConnection.cs

示例8: setNewObjectId

 public static void setNewObjectId(this RefUpdate refUpdate, AnyObjectId id)
 {
     refUpdate.NewObjectId = id.Copy();
 }
开发者ID:cocytus,项目名称:Git-Source-Control-Provider,代码行数:4,代码来源:RefUpdate.cs


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