Overview
SHA1 Hash: | ff4cc5fae2e88f97c536462ac5b63387b5a5605f |
---|---|
Date: | 2007-09-23 18:49:50 |
User: | drh |
Comment: | Fixes to the timeline webpage and the "open" and "update" commands. |
Timelines: | ancestors | descendants | both | trunk |
Other Links: | files | ZIP archive | manifest |
Tags And Properties
- branch=trunk inherited from [a28c83647d]
- sym-trunk inherited from [a28c83647d]
Changes
[hide diffs]Modified src/db.c from [b9655281e8] to [0660888f68].
@@ -872,10 +872,12 @@ ** for the repository is created with its root at the working directory. ** See also the "close" command. */ void cmd_open(void){ Blob path; + int vid; + static char *azNewArgv[] = { 0, "update", "--latest", 0 }; if( g.argc!=3 ){ usage("REPOSITORY-FILENAME"); } if( db_open_local() ){ fossil_panic("already within an open tree rooted at %s", g.zLocalRoot); @@ -883,11 +885,16 @@ file_canonical_name(g.argv[2], &path); db_open_repository(blob_str(&path)); db_init_database("./_FOSSIL_", zLocalSchema, (char*)0); db_open_local(); db_lset("repository", blob_str(&path)); - db_lset_int("checkout", 1); + vid = db_int(0, "SELECT pid FROM plink y" + " WHERE NOT EXISTS(SELECT 1 FROM plink x WHERE x.cid=y.pid)"); + db_lset_int("checkout", vid); + g.argv = azNewArgv; + g.argc = 3; + update_cmd(); } /* ** COMMAND: config **
Modified src/timeline.c from [a8be29736d] to [dc980b14e8].
@@ -364,13 +364,19 @@ @ Number Of Entries: @ <input type="text" size="4" value="%d(nEntry)" name="n"> @ <br><input type="submit" value="Submit"> @ </form> @ <form method="GET" action="%s(g.zBaseURL)/timeline"> - @ <input type="hidden" value="%h(zDate)" name="d"> + @ <input type="hidden" value="%d(lastEvent)" name="e"> @ <input type="hidden" value="%d(nEntry)" name="n"> @ <input type="submit" value="Next %d(nEntry) Rows"> + @ </form> + @ <form method="GET" action="%s(g.zBaseURL)/timeline"> + @ <input type="hidden" value="%d(firstEvent)" name="e"> + @ <input type="hidden" value="1" name="a"> + @ <input type="hidden" value="%d(nEntry)" name="n"> + @ <input type="submit" value="Previous %d(nEntry) Rows"> @ </form> style_footer(); } /*
Modified src/update.c from [7b1df8d7e1] to [c90f6451d9].
@@ -51,18 +51,20 @@ */ void update_cmd(void){ int vid; /* Current version */ int tid; /* Target version - version we are changing to */ Stmt q; + int latestFlag; /* Pick the latest version if true */ + latestFlag = find_option("latest",0, 0)!=0; if( g.argc!=3 && g.argc!=2 ){ usage("?VERSION?"); } db_must_be_within_tree(); vid = db_lget_int("checkout", 0); if( vid==0 ){ - vid = 1; + fossil_fatal("cannot find current version"); } if( db_exists("SELECT 1 FROM vmerge") ){ fossil_fatal("cannot update an uncommitted merge"); } if( g.argc==3 ){ @@ -73,11 +75,11 @@ if( !is_a_version(tid) ){ fossil_fatal("not a version: %s", g.argv[2]); } }else{ compute_leaves(vid); - if( db_int(0, "SELECT count(*) FROM leaves")>1 ){ + if( !latestFlag && db_int(0, "SELECT count(*) FROM leaves")>1 ){ db_prepare(&q, "%s " " AND event.objid IN leaves" " ORDER BY event.mtime DESC", timeline_query_for_tty() @@ -84,11 +86,13 @@ ); print_timeline(&q, 100); db_finalize(&q); fossil_fatal("Multiple descendents"); } - tid = db_int(0, "SELECT rid FROM leaves"); + tid = db_int(0, "SELECT rid FROM leaves, event" + " WHERE event.objid=leaves.rid" + " ORDER BY event.mtime DESC"); } db_begin_transaction(); vfile_check_signature(vid); undo_begin();