@Michai R. and Martin G.: this is a slightly cleaned up version of the view
i linked to earlier. This post is primarily a reminder to me for later on,
but might also interest you in figuring out new ways to filter by filename
glob...

DROP VIEW IF EXISTS f;
CREATE TEMP VIEW f AS SELECT
    filename.name AS fname,
    bf.uuid AS fuuid,
    bf.size AS fsize,
    bm.uuid AS checkin,
    event.bgcolor AS bgcolor,
    cast(strftime('%s',event.mtime, 'utc') AS INT) AS mtime,
    strftime('%Y-%m-%d %H:%M:%S',event.mtime, 'utc') AS datetime,
    coalesce(event.ecomment,event.comment) AS comment,
    coalesce(event.euser,event.user) AS user,
    coalesce(
        (SELECT value FROM tagxref WHERE tagid=8 AND tagtype>0
               AND rid=mlink.mid),
        'trunk')
        AS branch
FROM mlink,
    filename,
    event,
    blob bf,
    blob bm
WHERE
    filename.fnid=mlink.fnid
AND event.objid=mlink.mid
AND bf.rid=mlink.fid -- FILE artifact
AND bm.rid=mlink.mid -- CHECKIN artifact
;

Now, using libfossil's repo as a playground...


sqlite> select * from f where checkin glob '5fe41b17fd*';
fname|fuuid|fsize|checkin|bgcolor|mtime|datetime|comment|user|branch
f-wiki.c|d600b8beb8de0c5d6d32b0be53219e7991ad1368|7885|5fe41b17fd15c176a7e3fdf4bc5ecc3d75737907||1389522385|2014-01-12
10:26:25|fixed f-wiki export to behave like the docs say it
does.|stephan|trunk

sqlite> select fname, substr(fuuid,0,8) as fuuid, fsize,
substr(checkin,0,8) as checkin, datetime, comment from f where fname glob
'f-*.c' order by datetime desc limit 3;
fname|fuuid|fsize|checkin|datetime|comment
f-wiki.c|d600b8b|7885|5fe41b1|2014-01-12 10:26:25|fixed f-wiki export to
behave like the docs say it does.
f-query.c|de8d0c8|4127|46964e3|2013-09-19 14:49:37|Added a transaction to
f-query.
f-query.c|fd2addc|3818|1d4a6c8|2013-09-19 14:28:07|Added f-query app to run
queries which can use the libfossil-added SQL UDFs.


i think that can be used as the basis for _something_ useful, just not yet
sure what. Ideas are welcomed.

Until tomorrow evening...

-- 
----- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
"Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do." -- Bigby Wolf
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to