140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
**
** 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,
"SELECT blob.uuid"
" FROM tag, tagxref, event, blob"
" WHERE tag.tagname='sym-'||%Q "
" AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 "
" AND event.objid=tagxref.rid "
|
>
|
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
|
**
** 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){
int vid;
char *zUuid =
db_text(0,
"SELECT blob.uuid"
" FROM tag, tagxref, event, blob"
" WHERE tag.tagname='sym-'||%Q "
" AND tagxref.tagid=tag.tagid AND tagxref.tagtype>0 "
" AND event.objid=tagxref.rid "
|
187
188
189
190
191
192
193
194
195
196
197
198
199
200
|
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.
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
|
zUuid = db_text(0,
"SELECT blob.uuid"
" FROM event, blob"
" WHERE event.type='ci'"
" AND blob.rid=event.objid"
" ORDER BY event.mtime DESC"
);
}
if( zUuid==0 && g.localOpen && (vid=db_lget_int("checkout",0))!=0 ){
if( strcmp(zTag, "ckout")==0 ){
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid=%d", vid);
}else if( strcmp(zTag, "prev")==0 ){
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid="
"(SELECT pid FROM plink WHERE cid=%d AND isprim)",
vid);
}else if( strcmp(zTag, "next")==0 ){
zUuid = db_text(0, "SELECT uuid FROM blob WHERE rid="
"(SELECT cid FROM plink WHERE pid=%d AND isprim"
" ORDER BY mtime DESC)",
vid);
}
}
}
return zUuid;
}
/*
** Convert a date/time string into a UUID.
|