138
139
140
141
142
143
144
145
146
147
148
149
150
151
|
**
** If the input string is of the form:
**
** tag:date
**
** Then return the UUID of the oldest check-in with that tag that is
** not older than 'date'.
**
** Memory to hold the returned string comes from malloc() and needs to
** be freed by the caller.
*/
char *tag_to_uuid(const char *zTag){
char *zUuid =
db_text(0,
|
>
>
|
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
**
** If the input string is of the form:
**
** tag:date
**
** Then return the UUID of the oldest check-in with that tag that is
** not older than 'date'.
**
** An input of "tip" returns the most recent check-in.
**
** Memory to hold the returned string comes from malloc() and needs to
** be freed by the caller.
*/
char *tag_to_uuid(const char *zTag){
char *zUuid =
db_text(0,
|
181
182
183
184
185
186
187
188
189
190
191
192
193
194
|
" AND blob.rid=event.objid "
" AND event.mtime<=julianday(%Q %s)"
" ORDER BY event.mtime DESC ",
zTagBase, zDate, (useUtc ? "" : ",'utc'")
);
break;
}
}
}
return zUuid;
}
/*
** Convert a date/time string into a UUID.
|
>
>
>
>
>
>
>
>
>
|
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
" AND blob.rid=event.objid "
" AND event.mtime<=julianday(%Q %s)"
" ORDER BY event.mtime DESC ",
zTagBase, zDate, (useUtc ? "" : ",'utc'")
);
break;
}
}
if( zUuid==0 && strcmp(zTag, "tip")==0 ){
zUuid = db_text(0,
"SELECT blob.uuid"
" FROM event, blob"
" WHERE event.type='ci'"
" AND blob.rid=event.objid"
" ORDER BY event.mtime DESC"
);
}
}
return zUuid;
}
/*
** Convert a date/time string into a UUID.
|