backup-log.h 960 Bytes
Newer Older
1 2 3
#ifndef __BACKUP_LOG_H__
#define __BACKUP_LOG_H__

4 5
#include "cache.h"

6
struct repository;
7
struct rev_info;
8 9
struct strbuf;

10 11 12 13 14 15 16 17 18 19
struct bkl_entry
{
	struct object_id old_oid;
	struct object_id new_oid;
	const char *email;
	timestamp_t timestamp;
	int tz;
	const char *path;
};

20 21 22 23 24 25
void bkl_append(struct strbuf *output, const char *path,
		const struct object_id *from,
		const struct object_id *to);

int bkl_write(const char *path, struct strbuf *new_log);

26 27 28 29 30 31 32 33
int bkl_parse_entry(struct strbuf *sb, struct bkl_entry *re);
int bkl_parse_file_reverse(const char *path,
			   int (*parse)(struct strbuf *line, void *data),
			   void *data);
int bkl_parse_file(const char *path,
		   int (*parse)(struct strbuf *line, void *data),
		   void *data);

34
void add_backup_logs_to_pending(struct rev_info *revs, unsigned flags);
35
int bkl_prune(struct repository *r, const char *id, timestamp_t expire);
Duy Nguyen's avatar
Duy Nguyen committed
36
void bkl_prune_all_or_die(struct repository *r, timestamp_t expire);
37

38
#endif