Overview
SHA1 Hash: | 6607844a0162db6d51c360aaaeead96c84477376 |
---|---|
Date: | 2007-08-18 11:42:24 |
User: | drh |
Comment: | Added options to the "timeline" CLI command. Additional help comments. |
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 [13dcb9659a] to [f2c507419f].
@@ -578,13 +578,13 @@ g.repositoryOpen = 1; g.zRepositoryName = mprintf("%s", zDbName); } /* -** Try to find the repository and open it. If we are in a local -** tree, then use the repository of the local tree. Otherwise, -** fall back to the -R or --repository option. +** Try to find the repository and open it. Use the -R or --repository +** option to locate the repository. If no such option is available, then +** use the repository of the open checkout if there is one. ** ** Error out if the repository cannot be opened. */ void db_find_and_open_repository(void){ const char *zRep = find_option("repository", "R", 1); @@ -824,10 +824,11 @@ /* ** COMMAND: open ** ** Usage: open FILENAME +** ** Open a connection to the local repository in FILENAME. A checkout ** for the repository is created with its root at the working directory. ** See also the "close" command. */ void cmd_open(void){ @@ -847,11 +848,23 @@ } /* ** COMMAND: config ** -** List or change the global configuration settings. +** Usage: %fossil config NAME=VALUE ... +** +** List or change the global configuration settings. With no arguments, +** all settings are listed. Arguments of simply NAME cause that setting +** to be displayed. Arguments of the form NAME=VALUE change the value of +** a setting. Arguments of the form NAME= delete a setting. +** +** Recognized settings include: +** +** editor Text editor command used for check-in comments. +** +** clear-sign Command used to clear-sign manifests at check-in. +** The default is "gpg --clearsign -o ". */ void cmd_config(void){ db_open_config(); if( g.argc>2 ){ int i;
Modified src/info.c from [ee42d04161] to [9ae2ca06ed].
@@ -71,10 +71,12 @@ } /* ** COMMAND: info +** +** Usage: %fossil info ?UUID? ** ** With no arguments, provide information about the current tree. ** If an argument is given, provide information about the record ** that the argument refers to. */
Modified src/main.c from [69bfd961c8] to [b9c1d09428].
@@ -382,11 +382,11 @@ */ void help_cmd(void){ int rc, idx; const char *z; if( g.argc!=3 ){ - printf("Usage: %s help <command>.\nAvailable commands:\n", g.argv[0]); + printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]); cmd_cmd_list(); return; } rc = name_search(g.argv[2], aCommand, count(aCommand), &idx); if( rc==1 ){ @@ -519,24 +519,24 @@ } /* ** COMMAND: cgi ** -** The single argument is the name of a file that is the CGI script -** that is being run. This file should look something like this: +** Usage: %fossil ?cgi? SCRIPT +** +** The SCRIPT argument is the name of a file that is the CGI script +** that is being run. The command name, "cgi", may be omitted if +** the GATEWAY_INTERFACE environment variable is set to "CGI" (which +** should always be the case for CGI scripts run by a webserver.) The +** SCRIPT file should look something like this: ** ** #!/usr/bin/fossil ** repository: /home/somebody/project.db ** -** We are interested in the line that defines the name of the repository. -** Read the file, find the repository line. Then open the respository -** database. -** -** Also do the usual CGI initialization stuff in the cgi.c module. -** -** After all of the above setup, call process_one_web_page() to do the -** web page processing and return the result. +** The second line defines the name of the repository. After locating +** the repository, fossil will generate a webpage on stdout based on +** the values of standard CGI environment variables. */ void cmd_cgi(void){ const char *zFile; Blob config, line, key, value; if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){ @@ -574,15 +574,16 @@ } /* ** COMMAND: http ** -** Handle a single HTTP request appearing on standard input. This -** method is used to launch an HTTP request handler from INETD, for -** example. +** Usage: %fossil http REPOSITORY ** -** The argument is the name of the repository. +** Handle a single HTTP request appearing on stdin. The resulting webpage +** is delivered on stdout. This method is used to launch an HTTP request +** handler from inetd, for example. The argument is the name of the +** repository. */ void cmd_http(void){ if( g.argc!=2 && g.argc!=3 ){ cgi_panic("no repository specified"); } @@ -597,15 +598,17 @@ } /* ** COMMAND: server ** -** Open a socket and begin listening for incoming HTTP requests. -** As each connection is received, fork a new child process to handle -** the request. +** Usage: %fossil server ?-P|--port TCPPORT? ?REPOSITORY? ** -** The argument is the name of the repository. +** Open a socket and begin listening and responding to HTTP requests on +** TCP port 8080, or on any other TCP port defined by the -P or +** --port option. The optional argument is the name of the repository. +** The repository argument may be omitted if the working directory is +** within an open checkout. */ void cmd_webserver(void){ int iPort; const char *zPort;
Modified src/merge.c from [c88ea8508f] to [6daf84ba0a].
@@ -30,17 +30,18 @@ /* ** COMMAND: merge ** +** Usage: %fossil merge VERSION +** ** The argument is a version that should be merged into the current ** checkout. ** ** Only file content is merged. The result continues to use the ** file and directory names from the current check-out even if those ** names might have been changed in the branch being merged in. -** */ void merge_cmd(void){ int vid; /* Current version */ int mid; /* Version we are merging against */ int pid; /* The pivot version - most recent common ancestor */
Modified src/rebuild.c from [6b83ecc26a] to [3f04f9d6cb].
@@ -29,11 +29,13 @@ /* ** COMMAND: rebuild ** -** Reconstruct the entire repository database from the core +** Usage: %fossil rebuild REPOSITORY +** +** Reconstruct the named repository database from the core ** records. Run this command after updating the fossil ** executable in a way that changes the database schema. */ void rebuild_database(void){ Stmt s;
Modified src/sync.c from [c79d53c017] to [fc0e1584ee].
@@ -60,21 +60,41 @@ } /* ** COMMAND: pull ** -** Pull changes in a remote repository into the local repository +** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY? +** +** Pull changes in a remote repository into the local repository. +** The repository is identified by the -R or --repository option. +** If there is no such option then the open repository is used. +** The URL of the remote server is specified on the command line +** If no URL is specified then the URL used by the most recent +** "pull", "push", or "sync" command is used. +** +** The URL is of the following form: +** +** http://USER@HOST:PORT/PATH +** +** The "USER@" and ":PORT" substrings are optional. +** The "USER" substring specifies the login user. You will be +** prompted for the password on the command-line. The PORT +** specifies the TCP port of the server. The default port is +** 80. */ void pull_cmd(void){ process_sync_args(); client_sync(0,1,0); } /* ** COMMAND: push ** -** Push changes in the local repository over into a remote repository +** Usage: %fossil push ?URL? ?-R|--repository REPOSITORY? +** +** Push changes in the local repository over into a remote repository. +** See the "pull" command for additional information. */ void push_cmd(void){ process_sync_args(); client_sync(1,0,0); } @@ -81,11 +101,15 @@ /* ** COMMAND: sync ** -** Synchronize the local repository with a remote repository +** Usage: %fossil sync ?URL? ?-R|--repository REPOSITORY? +** +** Synchronize the local repository with a remote repository. This is +** the equivalent of running both "push" and "pull" at the same time. +** See the "pull" command for additional information. */ void sync_cmd(void){ process_sync_args(); client_sync(1,1,0); }
Modified src/timeline.c from [01eff99510] to [4792000fa7].
@@ -184,23 +184,46 @@ /* ** COMMAND: timeline ** -** The timeline command works very much like the timeline webpage, but -** shows much less data and has fewer configuration options. It is -** intended as a convenient shortcut for the common case of seeing -** recent changes. +** Usage: %fossil timeline ?DATETIME? ?-n|--count N? +** +** Print a summary of activity going backwards in date and time +** specified or from the current date and time if no arguments +** are given. Show as many as N (default 20) check-ins. +** +** The date and time should be in the ISO8601 format. For +** examples: "2007-08-18 07:21:21". The time may be omitted. +** Times are according to the local timezone. */ void timeline_cmd(void){ Stmt q; - db_must_be_within_tree(); + int n; + char *zCount; + char *zDate; + db_find_and_open_repository(); + zCount = find_option("n","count",1); + if( zCount ){ + n = atoi(zCount); + }else{ + n = 20; + } + if( g.argc!=2 && g.argc!=3 ){ + usage("YYYY-MM-DDtHH:MM:SS"); + } + if( g.argc==3 ){ + zDate = g.argv[2]; + }else{ + zDate = "now"; + } db_prepare(&q, "SELECT uuid, datetime(event.mtime,'localtime')," " comment || ' (by ' || user || ')'" " FROM event, blob" " WHERE event.type='ci' AND blob.rid=event.objid" - " ORDER BY event.mtime DESC" + " AND event.mtime<=(SELECT julianday(%Q,'utc'))" + " ORDER BY event.mtime DESC", zDate ); - print_timeline(&q, 20); + print_timeline(&q, n); db_finalize(&q); }
Modified src/update.c from [e7db94fb72] to [eb47b7b9da].
@@ -29,14 +29,19 @@ #include <assert.h> /* ** COMMAND: update ** +** Usage: %fossil update ?VERSION? +** ** The optional argument is a version that should become the current ** version. If the argument is omitted, then use the leaf of the -** version tree branch that begins with the current version, if there -** is only a single leaf. +** tree that begins with the current version, if there is only a +** single leaf. +** +** This command is different from the "checkout" in that edits are +** not overwritten. Edits are merged into the new version. ** */ void update_cmd(void){ int vid; /* Current version */ int tid; /* Target version - version we are changing to */
Modified src/user.c from [4ebd0dc282] to [7f6b214713].
@@ -107,11 +107,37 @@ /* ** COMMAND: user ** -** Dispatcher for various user subcommands. +** Usage: %fossil user SUBCOMMAND ... ?-R|--repository FILE? +** +** Run various subcommands on users of the open repository or of +** the repository identified by the -R or --repository option. +** +** %fossil user capabilities USERNAME ?STRING? +** +** Query or set the capabilities for user USERNAME +** +** %fossil user default ?USERNAME? +** +** Query or set the default user. The default user is the +** user for command-line interaction. +** +** %fossil user list +** +** List all users known to the repository +** +** %fossil user new +** +** Create a new user in the repository. Users can never be +** deleted. They can be denied all access but they must continue +** to exist in the database. +** +** %fossil user password USERNAME +** +** Change the web access password for a user. */ void user_cmd(void){ int n; db_find_and_open_repository(); if( g.argc<3 ){