i'll just leave this here...

(Source: http://fossil.wanderinghorse.net/r/libfossil)

(@Ross B: see the bottom)

[stephan@host:~/cvs/fossil/libfossil/s2]$ ./f-s2sh -v
verbose: Auto-loading script [./f-s2sh.s2].
s2 interactive shell. All commands run in the current scope. Use your
platform's EOF sequence on an empty line to exit. (Ctrl-D on Unix,
Ctrl-Z(?) on Windows.) Ctrl-C might work, too.

The 'g' object is at your service as a place to store things.

s2> var c = new Fossil.Context()
result: Context@0x1d4cbf0[scope=#1@0x7fff9a7cca60 ref#=1] ==>
Context@0x1d4cbf0

s2> c.openCheckout()
result: Context@0x1d4cbf0[scope=#1@0x7fff9a7cca60 ref#=1] ==>
Context@0x1d4cbf0

s2> var m = c.loadManifest('current');;

s2> foreach(m=>k) print(k)
U
P
F
D
C
uuid
rid
type
result: undefined@0x6b3c08[scope=#0@(nil) ref#=0] ==> undefined

s2> print(m.D,m.U,m.C)
2457436.97569 stephan fixed an assertion, improved an error message (just
now triggered by files with spaces in their names :/).
result: function@0x1d41120[scope=#1@0x7fff9a7cca60 ref#=1] ==>
function@0x1d41120

s2> print(Fossil.time.julianToHuman(m.D),m.U,m.C)
2016-02-18 11:24:59 stephan fixed an assertion, improved an error message
(just now triggered by files with spaces in their names :/).
result: function@0x1d41120[scope=#1@0x7fff9a7cca60 ref#=1] ==>
function@0x1d41120

s2> (new s2.Buffer()<<m.toJSONString(2)).writeFile('out.json')
result: buffer@0x25b3be0[scope=#1@0x7fff024b9470 ref#=0] ==>
buffer@0x25b3be0


s2> c = new Fossil.Context({traceSql:true})
SQL TRACE #1: PRAGMA foreign_keys=OFF;
SQL TRACE #2: CREATE VIRTUAL TABLE IF NOT EXISTS settingsmetadata USING
SETTINGS_METADATA();
SQL TRACE #3: PRAGMA temp_store=FILE;
result: Context@0x1d56be0[scope=#1@0x7fff9a7cca60 ref#=1] ==>
Context@0x1d56be0

s2> c.openCheckout()
SQL TRACE #4: ATTACH DATABASE '/home/stephan/cvs/fossil/libfossil/_FOSSIL_'
AS ckout;
SQL TRACE #5: DROP TABLE IF EXISTS versionedsettings;
SQL TRACE #6: CREATE VIRTUAL TABLE versionedsettings USING
VERSIONED_SETTINGS( '/home/stephan/cvs/fossil/libfossil//.fossil-settings',
MKDIR );
SQL TRACE #7: SELECT value FROM vvar WHERE name='repository';
SQL TRACE #8: ATTACH DATABASE '/home/stephan/cvs/fossil/libfossil.fsl' AS
repo;
SQL TRACE #9: SELECT login FROM user WHERE uid=1;
SQL TRACE #10: SELECT value FROM config WHERE name='allow-symlinks';
SQL TRACE #11: SELECT value FROM vvar WHERE name='checkout';
SQL TRACE #12: SELECT uuid FROM blob WHERE rid=7033;
result: Context@0x1d56be0[scope=#1@0x7fff9a7cca60 ref#=1] ==>
Context@0x1d56be0

...


s2> ^D
SQL TRACE #17: DETACH DATABASE repo;
SQL TRACE #18: DETACH DATABASE ckout;
SQL TRACE #19: DROP TABLE IF EXISTS settingsmetadata;
SQL TRACE #20:  DROP TABLE IF EXISTS versionedsettings;

[stephan@host:~/cvs/fossil/libfossil/s2]$ head out.json
{
  "U": "stephan",
  "P": ["56901c5b0afbe35283b19e1fbbcd2f6cbfd6527a"],
  "F": [
    {
      "perm": "f",
      "uuid": "ba75b11ef02066eaca5bd59e28362431745dec86",
      "name": ".fossil-settings/binary-glob"
    },
    {


...ad nauseam...



-- 
----- 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
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to