private IEnumerable<HgBundleFile> ReadBundleFiles(BigEndianBinaryReader binaryReader) { uint fileNameLength; while((fileNameLength = binaryReader.ReadUInt32()) != 0) { var fileNameBytes = binaryReader.ReadBytes((int)fileNameLength - 4 /* For "file name length" value itself */); var fileName = hgEncoder.DecodeAsLocal(fileNameBytes); var fileGroup = ReadBundleGroup(binaryReader); var file = new HgBundleFile(new HgPath(fileName), fileGroup); yield return file; } // while }
private HgBundleFile BuildBundleFile(HgRepository hgRepository, HgRevset hgRevset, string path) { // TODO: Do not bundle files without chunks log.Debug("bundling {0}", path); var hgPath = new HgPath(path); var hgFilelog = hgRepository.GetFilelog(hgPath); if(hgFilelog == null) return null; var filelogRevset = new HgRevset(hgFilelog.Revlog.Entries.Where(fre => hgRevset.Contains(fre.LinkRevision))); var hgBundleGroup = BuildBundleGroup(hgRepository, hgFilelog.Revlog, filelogRevset); var hgBundleFile = new HgBundleFile(hgPath, hgBundleGroup); return hgBundleFile; }