Beispiel #1
0
func findPresentByNodeId(ent *store.ManifestEnt, rlist []*revlog.Rec) (index int, err error) {
	wantId, err := ent.Id()
	if err != nil {
		return
	}

	for i, r := range rlist {
		if wantId.Eq(r.Id()) {
			index = i
			return
		}
	}

	err = fmt.Errorf("internal error: none of the given records matches node id %v", wantId)
	return
}
Beispiel #2
0
func (fs *hgFSNative) fileInfo(ent *hg_store.ManifestEnt) *util.FileInfo {
	var mode os.FileMode

	mtime, err := fs.getModTime()
	if err != nil {
		return nil
	}

	if ent.IsExecutable() {
		mode |= 0111 // +x
	}
	if ent.IsLink() {
		mode |= os.ModeSymlink
	}

	return &util.FileInfo{
		Name_:    filepath.Base(ent.FileName),
		Mode_:    mode,
		ModTime_: mtime,
	}
}