1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
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
|
-
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
|
<h1>The f-tools</h1>
The source tree contains a few test/demo apps which are named <tt>f-something</tt> (the "f" is for "fossil", of course).
* <tt>[/finfo?name=f-tag.c|f-tag]</tt> can add tags to artifacts.
* <tt>[/finfo?name=f-timeline.c|f-timeline]</tt> provides a simple timeline
* <tt>[/finfo?name=f-resolve.c|f-resolve]</tt> resolves symbolic checkin names (like "trunk", "current", and "prev") and partial UUIDs to their full UUIDs and RIDs.
* <tt>[/finfo?name=f-wiki.c|f-wiki]</tt> does not do much yet aside from list or export the latest version of each wiki page.
* <tt>[/finfo?name=f-wiki.c|f-wiki]</tt> hopes to one day be a generic wiki manipulation tool.
* <tt>[/finfo?name=f-mfparse.c|f-mfparse]</tt> reads in Fossil control artifacts, converts them to its internal high-level form, and saves them back out to a file. This is used for testing both the manifest parsing and generation code, to ensure 100% round-trip fidelity. Manifests are never actually round-tripped that way in fossil, but this is a good way to test/ensure that this library generates the exact same thing which fossil(1) does for the same manifest data.
These applications provide demonstrations of using the library and give devs a place to test new features. <tt>[FossilApp]</tt> provides a mini-framework which takes care of bootstrapping fossil for these applications, making it pretty simple to create new ones. FossilApp handles the CLI parsing, global flags, opening of a repo/checkout, and other "getting started" bits. If you've ever hacked on fossil(1), adding a new f-* app is very similar to adding a new command to fossil, with only a few more lines of bootstrap code (because each "command" is in its own app to simplify testing).
These applications provide demonstrations of using the library and give devs a place to test new features. <tt>[/finfo?name=FossilApp.c|FossilApp.c]</tt> provides a mini-framework which takes care of bootstrapping fossil for these applications, making it pretty simple to create new ones. FossilApp handles the CLI parsing, global flags, opening of a repo/checkout, and other "getting started" bits. If you've ever hacked on fossil(1), adding a new f-* app is very similar to adding a new command to fossil, with only a few more lines of bootstrap code (because each "command" is in its own app to simplify testing).
<h2>Demos</h2>
<nowiki><pre>
[stephan@host:~/cvs/fossil/libfossil]$ ./f-wiki ls
Timestamp UUID Name
2013-08-22@22:26:59 86afdaa5 AmalgamationBuild
2013-08-23@18:37:26 e451926f building
2013-08-22@14:54:47 042b30df download
2013-08-24@11:29:34 0f083370 f-tools
2013-08-24@11:01:41 1024fcf8 FossilApp
2013-08-22@18:53:41 8ed8320c home
2013-08-23@17:26:34 327a3ca8 scratchpad
2013-08-01@22:29:49 bfa19f48 th1ish
[stephan@host:~/cvs/fossil/f2]$ ./f-tag -a tip -t demo-tag -v "demo for prosperity purposes" --trace-sql
SQL TRACE #1: SELECT '/home/stephan/cvs/fossil/f2' || '/' || value FROM vvar WHERE name='repository';
SQL TRACE #2: ATTACH DATABASE '/home/stephan/cvs/fossil/f2.fsl' AS repo;
SQL TRACE #3: SELECT julianday('now');
SQL TRACE #4: SELECT objid FROM event WHERE type='ci' ORDER BY event.mtime DESC LIMIT 1;
SQL TRACE #5: SELECT uuid FROM blob WHERE rid=1226;
SQL TRACE #6: SELECT strftime('%Y-%m-%dT%H:%M:%f',2456517.117559);
|
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
+
+
|
SQL TRACE #16: INSERT INTO tag(tagname) VALUES('demo-tag');
SQL TRACE #17: SELECT 1 FROM tagxref WHERE tagid=30 AND rid=1226 AND mtime>=2456517.11755911;
SQL TRACE #18: REPLACE INTO tagxref(tagid,tagtype,srcId,origid,value,mtime,rid) VALUES(30,1,1227,1226,<...SNIP...>);
SQL TRACE #19: SELECT <...SNIP...> WHERE pid=1226 AND isprim;
SQL TRACE #20: REPLACE INTO event(type,mtime,objid,user,comment)VALUES(<...SNIP...>);
SQL TRACE #21: COMMIT;
SQL TRACE #22: DETACH DATABASE repo;
[stephan@host:~/cvs/fossil/f2]$ ./f-timeline -n 1
g [daa063582c2c] @ 2013-08-12 16:49:17 by [stephan]
Edit [2a84ad39]: Add "demo-tag" with value "demo for prosperity purposes".
[stephan@host:~/cvs/fossil/f2]$ ./f-timeline -n 1 --trace-sql
SQL TRACE #1: SELECT '/home/stephan/cvs/fossil/f2' || '/' || value FROM vvar WHERE name='repository';
SQL TRACE #2: ATTACH DATABASE '/home/stephan/cvs/fossil/f2.fsl' AS repo;
SQL TRACE #3: SELECT substr(uuid,1,12) AS uuid, <...BIG SNIP...> ORDER BY event.mtime DESC LIMIT 1;
g [daa063582c2c] @ 2013-08-12 16:49:17 by [stephan]
Edit [2a84ad39]: Add "demo-tag" with value "demo for prosperity purposes".
|