spacepaste

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
====== log command ===== 

hg_log_iterator *log_iterator = hg_log(hg_handle *handle, const char *options[]);

hg_log_entry_t *le;

while(le = hg_fetch_log_entry(log_iterator)){
    printf("ID %s\n", le->id);
    printf("rev %s\n",le->rev);
    printf("user %s\n", le->user);
    printf("date %s\n", le->date);
    printf("description %s\n", le->description);
}


-----------------------
---hg_log---
hg_log command will receive a handle structure, and a command options list. 
hg_log command will call rawcommand and will return the log_iterator structure.
(When I will call rawcommand I will add a template to get some specific fields for
those revisions, ex: ID, rev, user, date, description)

The hg_log_iterator structure can have the following form:

structure hg_log_iterator{
      hg_handle *handle;
      char *option[];
}hg_log_iterator;


---hg_fetch_log_entry---
In this function I will get data from command server and I will parse this data in
hg_log_entry_t structure. The function will return a single revision for every call. 
When exitcode will be received, this function will return a NULL pointer.

The hg_log_entry_t structure can have the following form:

struct hg_log_entry_t{
     char *ID; /* probably int*/
     char *rev; 
     char *user;
     char *data;
     char *description;
     /*other fields*/
}hg_log_entry_t;