Public » Mercurial » dirstate
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

show time stamps, verifying I'm parsing this right

Changeset 5749ed62725b

Parent 2c890815df33

by Profile picture of Benjamin PollackBenjamin Pollack

Changes to one file · Browse files at 5749ed62725b Showing diff from parent 2c890815df33 Diff from another changeset...

Change 1 of 2 Show Entire File dirstate.c Stacked
 
1
2
3
 
4
5
6
 
101
102
103
 
 
104
105
106
107
 
108
109
110
 
 
 
 
111
112
113
 
1
2
3
4
5
6
7
 
102
103
104
105
106
107
108
109
 
110
111
112
 
113
114
115
116
117
118
119
@@ -1,6 +1,7 @@
 #include <stdio.h>  #include <stdlib.h>  #include <strings.h> +#include <time.h>    #include <arpa/inet.h>   @@ -101,13 +102,18 @@
 int main(int argc, char *argv[])  {   dirstate *pd = dirstate_new(".hg/dirstate"); + time_t t; + char *s;   unsigned ix;   printf("parent1: %s\n", revhash_string(pd->parent1));   printf("parent2: %s\n", revhash_string(pd->parent2)); - printf("entries: %d\n", pd->num_entries); + printf("entries: %d\n\n", pd->num_entries);   for (ix = 0; ix < pd->num_entries; ++ix)   { - printf("entry: %s\n", pd->entries[ix].name); + t = pd->entries[ix].mtime; + s = ctime(&t); + s[strlen(s) - 1] = '\0'; + printf("%s %s\n", s, pd->entries[ix].name);   }   dirstate_free(pd);   return 0;