public add ( RevFlag flag ) : void | ||
flag | RevFlag | /// The flag to mark on this object, for later testing. /// |
return | void |
private void AddCommonBase(RevObject o) { if (o.has(COMMON)) return; o.add(COMMON); _commonBase.Add(o); okToGiveUp = null; }
private void advertiseAny(RevObject obj, string refName) { obj.add(ADVERTISED); advertiseId(obj, refName); }
private void MarkCommon(RevObject obj) { obj.add(COMMON); RevCommit oComm = (obj as RevCommit); if (oComm != null) { oComm.carry(COMMON); } }
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); } }
private void ProcessTree(RevObject obj) { try { _treeWalk.reset(obj); while (_treeWalk.next()) { FileMode mode = _treeWalk.getFileMode(0); int sType = mode.Bits; switch (sType) { case Constants.OBJ_BLOB: case Constants.OBJ_TREE: _treeWalk.getObjectId(_idBuffer, 0); Needs(_revWalk.lookupAny(_idBuffer, sType)); continue; default: if (FileMode.GitLink.Equals(sType)) continue; _treeWalk.getObjectId(_idBuffer, 0); throw new CorruptObjectException("Invalid mode " + mode + " for " + _idBuffer.Name + " " + _treeWalk.getPathString() + " in " + obj.getId().Name + "."); } } } catch (IOException ioe) { throw new TransportException("Cannot Read tree " + obj.Name, ioe); } obj.add(COMPLETE); }
private void MarkCommon(RevObject obj) { obj.add(COMMON); if (obj is RevCommit) { ((RevCommit)obj).carry(COMMON); } }
private void ProcessCommit(RevObject obj) { var commit = (RevCommit)obj; MarkLocalCommitsComplete(commit.CommitTime); Needs(commit.Tree); foreach (RevCommit p in commit.Parents) { Needs(p); } obj.add(COMPLETE); }
private void ProcessTag(RevObject obj) { var tag = (RevTag)obj; Needs(tag.getObject()); obj.add(COMPLETE); }
private void ProcessBlob(RevObject obj) { if (!_local.HasObject(obj)) { throw new TransportException("Cannot Read blob " + obj.Name, new MissingObjectException(obj, Constants.TYPE_BLOB)); } obj.add(COMPLETE); }
private void Needs(RevObject obj) { if (obj.has(COMPLETE)) return; if (!obj.has(IN_WORK_QUEUE)) { obj.add(IN_WORK_QUEUE); _workQueue.AddLast(obj); } }
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); } } }
private void MarkLocalObjComplete(RevObject obj) { while (obj.Type == Constants.OBJ_TAG) { obj.add(COMPLETE); obj.DisposeBody(); obj = ((RevTag)obj).getObject(); _revWalk.parseHeaders(obj); } switch (obj.Type) { case Constants.OBJ_BLOB: obj.add(COMPLETE); break; case Constants.OBJ_COMMIT: PushLocalCommit((RevCommit)obj); break; case Constants.OBJ_TREE: MarkTreeComplete(obj); break; } }
private void Want(RevObject o) { if (o.has(WANT)) return; o.add(WANT); _wantAll.Add(o); RevTag oTag = (o as RevTag); while (oTag != null) { o = oTag.getObject(); oTag = (o as RevTag); } RevCommit oComm = (o as RevCommit); if (oComm != null) { _wantCommits.Add(oComm); } }