Exemplo n.º 1
0
        private void want(RevObject o)
        {
            if (!o.has(WANT))
            {
                o.add(WANT);
                wantAll.Add(o);

                if (o is RevCommit)
                    wantCommits.Add((RevCommit) o);
                else if (o is RevTag)
                {
                    do
                    {
                        o = ((RevTag) o).getObject();
                    } while (o is RevTag);
                    if (o is RevCommit)
                        want(o);
                }
            }
        }
Exemplo n.º 2
0
        private void Needs(RevObject obj)
        {
            if (obj.has(COMPLETE)) return;

            if (!obj.has(IN_WORK_QUEUE))
            {
                obj.add(IN_WORK_QUEUE);
                _workQueue.AddLast(obj);
            }
        }
Exemplo n.º 3
0
        private void MarkTreeComplete(RevObject tree)
        {
            if (tree.has(COMPLETE)) return;

            tree.add(COMPLETE);
            _treeWalk.reset(tree);
            while (_treeWalk.next())
            {
                FileMode mode = _treeWalk.getFileMode(0);
                int sType = mode.Bits;

                switch (sType)
                {
                    case Constants.OBJ_BLOB:
                        _treeWalk.getObjectId(_idBuffer, 0);
                        _revWalk.lookupAny(_idBuffer, sType).add(COMPLETE);
                        continue;

                    case Constants.OBJ_TREE:
                        {
                            _treeWalk.getObjectId(_idBuffer, 0);
                            RevObject o = _revWalk.lookupAny(_idBuffer, sType);
                            if (!o.has(COMPLETE))
                            {
                                o.add(COMPLETE);
                                _treeWalk.enterSubtree();
                            }
                            continue;
                        }

                    default:
                        if (FileMode.GitLink.Equals(sType))
                            continue;
                        _treeWalk.getObjectId(_idBuffer, 0);
                        throw new CorruptObjectException("Invalid mode " + mode + " for " + _idBuffer.Name + " " +
                                                         _treeWalk.getPathString() + " in " + tree.Name);
                }
            }
        }
Exemplo n.º 4
0
 private void advertiseAnyOnce(RevObject obj, string refName)
 {
     if (!obj.has(ADVERTISED))
     {
         advertiseAny(obj, refName);
     }
 }
Exemplo n.º 5
0
        private void Want(RevObject o)
        {
            if (o.has(WANT)) return;

            o.add(WANT);
            _wantAll.Add(o);

            if (o is RevCommit)
            {
                _wantCommits.Add((RevCommit)o);
            }
            else if (o is RevTag)
            {
                do
                {
                    o = ((RevTag)o).getObject();
                } while (o is RevTag);

                if (o is RevCommit)
                {
                    Want(o);
                }
            }
        }
Exemplo n.º 6
0
 private void AddCommonBase(RevObject o)
 {
     if (o.has(COMMON)) return;
     o.add(COMMON);
     _commonBase.Add(o);
 }