-
Notifications
You must be signed in to change notification settings - Fork 0
/
cvsps_types.h
208 lines (184 loc) · 4.95 KB
/
cvsps_types.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
/*
* Copyright 2001, 2002, 2003 David Mansfield and Cobite, Inc.
* See COPYING file for license information
*/
#ifndef CVSPS_TYPES_H
#define CVSPS_TYPES_H
#include <time.h>
#include <stdbool.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#define LOG_STR_MAX 65536
#define AUTH_STR_MAX 64
#define CID_STR_MAX 64
#define REV_STR_MAX BUFSIZ
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
typedef struct _CvsFile CvsFile;
typedef struct _PatchSet PatchSet;
typedef struct _PatchSetMember PatchSetMember;
typedef struct _PatchSetRange PatchSetRange;
typedef struct _CvsFileRevision CvsFileRevision;
typedef struct _GlobalSymbol GlobalSymbol;
typedef struct _Tag Tag;
typedef struct _TagName TagName;
typedef struct _Branch Branch;
typedef struct _MapEntry MapEntry;
struct _CvsFileRevision
{
char * rev;
bool dead;
CvsFile * file;
char * branch;
/*
* In the cvs cvs repository (ccvs project) there are tagged
* revisions that don't exist. track 'confirmed' revisions
* so as to not let them screw us up.
*/
bool present;
/*
* A revision can be part of many PatchSets because it may
* be the branch point of many branches (as a pre_rev).
* It should, however, be the 'post_rev' of only one
* PatchSetMember. The 'main line of inheritence' is
* kept in pre_psm, and all 'branch revisions' are kept
* in a list.
*/
PatchSetMember * pre_psm;
PatchSetMember * post_psm;
struct list_head branch_children;
/*
* for linking this 'first branch rev' into the parent branch_children
*/
struct list_head link;
/*
* A list of all Tag structures tagging this revision
*/
struct list_head tags;
};
struct _CvsFile
{
char *filename;
mode_t mode;
struct hash_table * revisions; /* rev_str to revision [CvsFileRevision*] */
struct hash_table * branches; /* branch to branch_sym [char*] */
struct hash_table * branches_sym; /* branch_sym to branch [char*] */
struct hash_table * symbols; /* tag to revision [CvsFileRevision*] */
/*
* this is a hack. when we initially create entries in the symbol hash
* we don't have the branch info, so the CvsFileRevisions get created
* with the branch attribute NULL. Later we need to resolve these.
*/
bool have_branches;
};
struct _PatchSetMember
{
CvsFileRevision * pre_rev;
CvsFileRevision * post_rev;
PatchSet * ps;
CvsFile * file;
/*
* bad_funk is only set w.r.t the -r tags
*/
bool bad_funk;
struct list_head link;
};
/*
* these are bit flags for tag flags
* they apply to any patchset that
* has an associated tag
*/
#define TAG_FUNKY 0x1
#define TAG_INVALID 0x2
/* values for funk_factor. they apply
* only to the -r tags, to patchsets
* that have an odd relationship to the
* tag
*/
#define FNK_SHOW_SOME 1
#define FNK_SHOW_ALL 2
#define FNK_HIDE_ALL 3
#define FNK_HIDE_SOME 4
struct _PatchSet
{
int psid;
time_t date;
time_t min_date;
time_t max_date;
char *descr;
char *author;
char *commitid;
struct list_head tags;
char *branch;
struct list_head members;
/*
* A 'branch add' patch set is a bogus patch set created automatically
* when a 'file xyz was initially added on branch abc'
* we want to ignore these. fortunately, there's a way to detect them
* without resorting to looking at the log message.
*/
bool branch_add;
/*
* If the '-r' option specifies a funky tag, we will need to detect the
* PatchSets that come chronologically before the tag, but are logically
* after, and vice-versa if a second -r option was specified
*/
int funk_factor;
/*
* In fast-export mode, this is the mark generated for this patchset
* at the moment we try to emit it. Has to be kept here because of
* the complications around first commits after branching.
*/
int mark;
/*
* a list of 'Branch' objects that branch from here
*/
struct list_head branches;
/* for putting onto a list */
struct list_head all_link;
struct list_head collision_link;
};
struct _PatchSetRange
{
int min_counter;
int max_counter;
struct list_head link;
};
struct _GlobalSymbol
{
char * tag;
PatchSet * ps;
struct list_head tags;
};
struct _Tag
{
GlobalSymbol * sym;
CvsFileRevision * rev;
char * tag;
struct list_head global_link;
struct list_head rev_link;
};
struct _TagName
{
char * name;
int flags;
struct list_head link;
};
struct _Branch
{
char * name;
PatchSet * ps;
bool vendor_branch;
bool realized;
/* every patchset will have a list of branches that branch from there */
struct list_head link;
};
struct _MapEntry
{
char * shortname;
char * longname;
char * timezone;
struct list_head link;
};
#endif /* CVSPS_TYPES_H */