예제 #1
0
func (store FolderStore) AddEntry(name data.ProjectName, entry data.Entry) error {
	db := store.db()
	err := db.Put(entry.Values(), name.Values()...)
	if err != nil {
		return errgo.Notef(err, "can not put entry into the database")
	}

	return nil
}
예제 #2
0
//Commit will add and commit the given entry into the repository that lays unter
//the given datadir.
func Commit(datadir string, project data.ProjectName, entry data.Entry) error {
	err := gitAdd(datadir, ".")
	if err != nil {
		return errgo.Notef(err, "can not add file to repository")
	}

	message := project.String() + " - " + entry.Type().String() + " - " +
		entry.GetTimeStamp().Format(data.TimeStampFormat)

	err = gitCommit(datadir, message)
	if err != nil {
		return errgo.Notef(err, "can not commit file to repository")
	}

	return nil
}