Fossil SCM

Added options to the "timeline" CLI command. Additional help comments.

drh 2007-08-18 11:42 trunk
Commit 6607844a0162db6d51c360aaaeead96c84477376
+17 -4
--- src/db.c
+++ src/db.c
@@ -578,13 +578,13 @@
578578
g.repositoryOpen = 1;
579579
g.zRepositoryName = mprintf("%s", zDbName);
580580
}
581581
582582
/*
583
-** Try to find the repository and open it. If we are in a local
584
-** tree, then use the repository of the local tree. Otherwise,
585
-** fall back to the -R or --repository option.
583
+** Try to find the repository and open it. Use the -R or --repository
584
+** option to locate the repository. If no such option is available, then
585
+** use the repository of the open checkout if there is one.
586586
**
587587
** Error out if the repository cannot be opened.
588588
*/
589589
void db_find_and_open_repository(void){
590590
const char *zRep = find_option("repository", "R", 1);
@@ -824,10 +824,11 @@
824824
825825
/*
826826
** COMMAND: open
827827
**
828828
** Usage: open FILENAME
829
+**
829830
** Open a connection to the local repository in FILENAME. A checkout
830831
** for the repository is created with its root at the working directory.
831832
** See also the "close" command.
832833
*/
833834
void cmd_open(void){
@@ -847,11 +848,23 @@
847848
}
848849
849850
/*
850851
** COMMAND: config
851852
**
852
-** List or change the global configuration settings.
853
+** Usage: %fossil config NAME=VALUE ...
854
+**
855
+** List or change the global configuration settings. With no arguments,
856
+** all settings are listed. Arguments of simply NAME cause that setting
857
+** to be displayed. Arguments of the form NAME=VALUE change the value of
858
+** a setting. Arguments of the form NAME= delete a setting.
859
+**
860
+** Recognized settings include:
861
+**
862
+** editor Text editor command used for check-in comments.
863
+**
864
+** clear-sign Command used to clear-sign manifests at check-in.
865
+** The default is "gpg --clearsign -o ".
853866
*/
854867
void cmd_config(void){
855868
db_open_config();
856869
if( g.argc>2 ){
857870
int i;
858871
--- src/db.c
+++ src/db.c
@@ -578,13 +578,13 @@
578 g.repositoryOpen = 1;
579 g.zRepositoryName = mprintf("%s", zDbName);
580 }
581
582 /*
583 ** Try to find the repository and open it. If we are in a local
584 ** tree, then use the repository of the local tree. Otherwise,
585 ** fall back to the -R or --repository option.
586 **
587 ** Error out if the repository cannot be opened.
588 */
589 void db_find_and_open_repository(void){
590 const char *zRep = find_option("repository", "R", 1);
@@ -824,10 +824,11 @@
824
825 /*
826 ** COMMAND: open
827 **
828 ** Usage: open FILENAME
 
829 ** Open a connection to the local repository in FILENAME. A checkout
830 ** for the repository is created with its root at the working directory.
831 ** See also the "close" command.
832 */
833 void cmd_open(void){
@@ -847,11 +848,23 @@
847 }
848
849 /*
850 ** COMMAND: config
851 **
852 ** List or change the global configuration settings.
 
 
 
 
 
 
 
 
 
 
 
 
853 */
854 void cmd_config(void){
855 db_open_config();
856 if( g.argc>2 ){
857 int i;
858
--- src/db.c
+++ src/db.c
@@ -578,13 +578,13 @@
578 g.repositoryOpen = 1;
579 g.zRepositoryName = mprintf("%s", zDbName);
580 }
581
582 /*
583 ** Try to find the repository and open it. Use the -R or --repository
584 ** option to locate the repository. If no such option is available, then
585 ** use the repository of the open checkout if there is one.
586 **
587 ** Error out if the repository cannot be opened.
588 */
589 void db_find_and_open_repository(void){
590 const char *zRep = find_option("repository", "R", 1);
@@ -824,10 +824,11 @@
824
825 /*
826 ** COMMAND: open
827 **
828 ** Usage: open FILENAME
829 **
830 ** Open a connection to the local repository in FILENAME. A checkout
831 ** for the repository is created with its root at the working directory.
832 ** See also the "close" command.
833 */
834 void cmd_open(void){
@@ -847,11 +848,23 @@
848 }
849
850 /*
851 ** COMMAND: config
852 **
853 ** Usage: %fossil config NAME=VALUE ...
854 **
855 ** List or change the global configuration settings. With no arguments,
856 ** all settings are listed. Arguments of simply NAME cause that setting
857 ** to be displayed. Arguments of the form NAME=VALUE change the value of
858 ** a setting. Arguments of the form NAME= delete a setting.
859 **
860 ** Recognized settings include:
861 **
862 ** editor Text editor command used for check-in comments.
863 **
864 ** clear-sign Command used to clear-sign manifests at check-in.
865 ** The default is "gpg --clearsign -o ".
866 */
867 void cmd_config(void){
868 db_open_config();
869 if( g.argc>2 ){
870 int i;
871
+2
--- src/info.c
+++ src/info.c
@@ -71,10 +71,12 @@
7171
}
7272
7373
7474
/*
7575
** COMMAND: info
76
+**
77
+** Usage: %fossil info ?UUID?
7678
**
7779
** With no arguments, provide information about the current tree.
7880
** If an argument is given, provide information about the record
7981
** that the argument refers to.
8082
*/
8183
--- src/info.c
+++ src/info.c
@@ -71,10 +71,12 @@
71 }
72
73
74 /*
75 ** COMMAND: info
 
 
76 **
77 ** With no arguments, provide information about the current tree.
78 ** If an argument is given, provide information about the record
79 ** that the argument refers to.
80 */
81
--- src/info.c
+++ src/info.c
@@ -71,10 +71,12 @@
71 }
72
73
74 /*
75 ** COMMAND: info
76 **
77 ** Usage: %fossil info ?UUID?
78 **
79 ** With no arguments, provide information about the current tree.
80 ** If an argument is given, provide information about the record
81 ** that the argument refers to.
82 */
83
+22 -19
--- src/main.c
+++ src/main.c
@@ -382,11 +382,11 @@
382382
*/
383383
void help_cmd(void){
384384
int rc, idx;
385385
const char *z;
386386
if( g.argc!=3 ){
387
- printf("Usage: %s help <command>.\nAvailable commands:\n", g.argv[0]);
387
+ printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]);
388388
cmd_cmd_list();
389389
return;
390390
}
391391
rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
392392
if( rc==1 ){
@@ -519,24 +519,24 @@
519519
}
520520
521521
/*
522522
** COMMAND: cgi
523523
**
524
-** The single argument is the name of a file that is the CGI script
525
-** that is being run. This file should look something like this:
524
+** Usage: %fossil ?cgi? SCRIPT
525
+**
526
+** The SCRIPT argument is the name of a file that is the CGI script
527
+** that is being run. The command name, "cgi", may be omitted if
528
+** the GATEWAY_INTERFACE environment variable is set to "CGI" (which
529
+** should always be the case for CGI scripts run by a webserver.) The
530
+** SCRIPT file should look something like this:
526531
**
527532
** #!/usr/bin/fossil
528533
** repository: /home/somebody/project.db
529534
**
530
-** We are interested in the line that defines the name of the repository.
531
-** Read the file, find the repository line. Then open the respository
532
-** database.
533
-**
534
-** Also do the usual CGI initialization stuff in the cgi.c module.
535
-**
536
-** After all of the above setup, call process_one_web_page() to do the
537
-** web page processing and return the result.
535
+** The second line defines the name of the repository. After locating
536
+** the repository, fossil will generate a webpage on stdout based on
537
+** the values of standard CGI environment variables.
538538
*/
539539
void cmd_cgi(void){
540540
const char *zFile;
541541
Blob config, line, key, value;
542542
if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){
@@ -574,15 +574,16 @@
574574
}
575575
576576
/*
577577
** COMMAND: http
578578
**
579
-** Handle a single HTTP request appearing on standard input. This
580
-** method is used to launch an HTTP request handler from INETD, for
581
-** example.
579
+** Usage: %fossil http REPOSITORY
582580
**
583
-** The argument is the name of the repository.
581
+** Handle a single HTTP request appearing on stdin. The resulting webpage
582
+** is delivered on stdout. This method is used to launch an HTTP request
583
+** handler from inetd, for example. The argument is the name of the
584
+** repository.
584585
*/
585586
void cmd_http(void){
586587
if( g.argc!=2 && g.argc!=3 ){
587588
cgi_panic("no repository specified");
588589
}
@@ -597,15 +598,17 @@
597598
}
598599
599600
/*
600601
** COMMAND: server
601602
**
602
-** Open a socket and begin listening for incoming HTTP requests.
603
-** As each connection is received, fork a new child process to handle
604
-** the request.
603
+** Usage: %fossil server ?-P|--port TCPPORT? ?REPOSITORY?
605604
**
606
-** The argument is the name of the repository.
605
+** Open a socket and begin listening and responding to HTTP requests on
606
+** TCP port 8080, or on any other TCP port defined by the -P or
607
+** --port option. The optional argument is the name of the repository.
608
+** The repository argument may be omitted if the working directory is
609
+** within an open checkout.
607610
*/
608611
void cmd_webserver(void){
609612
int iPort;
610613
const char *zPort;
611614
612615
--- src/main.c
+++ src/main.c
@@ -382,11 +382,11 @@
382 */
383 void help_cmd(void){
384 int rc, idx;
385 const char *z;
386 if( g.argc!=3 ){
387 printf("Usage: %s help <command>.\nAvailable commands:\n", g.argv[0]);
388 cmd_cmd_list();
389 return;
390 }
391 rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
392 if( rc==1 ){
@@ -519,24 +519,24 @@
519 }
520
521 /*
522 ** COMMAND: cgi
523 **
524 ** The single argument is the name of a file that is the CGI script
525 ** that is being run. This file should look something like this:
 
 
 
 
 
526 **
527 ** #!/usr/bin/fossil
528 ** repository: /home/somebody/project.db
529 **
530 ** We are interested in the line that defines the name of the repository.
531 ** Read the file, find the repository line. Then open the respository
532 ** database.
533 **
534 ** Also do the usual CGI initialization stuff in the cgi.c module.
535 **
536 ** After all of the above setup, call process_one_web_page() to do the
537 ** web page processing and return the result.
538 */
539 void cmd_cgi(void){
540 const char *zFile;
541 Blob config, line, key, value;
542 if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){
@@ -574,15 +574,16 @@
574 }
575
576 /*
577 ** COMMAND: http
578 **
579 ** Handle a single HTTP request appearing on standard input. This
580 ** method is used to launch an HTTP request handler from INETD, for
581 ** example.
582 **
583 ** The argument is the name of the repository.
 
 
 
584 */
585 void cmd_http(void){
586 if( g.argc!=2 && g.argc!=3 ){
587 cgi_panic("no repository specified");
588 }
@@ -597,15 +598,17 @@
597 }
598
599 /*
600 ** COMMAND: server
601 **
602 ** Open a socket and begin listening for incoming HTTP requests.
603 ** As each connection is received, fork a new child process to handle
604 ** the request.
605 **
606 ** The argument is the name of the repository.
 
 
 
 
607 */
608 void cmd_webserver(void){
609 int iPort;
610 const char *zPort;
611
612
--- src/main.c
+++ src/main.c
@@ -382,11 +382,11 @@
382 */
383 void help_cmd(void){
384 int rc, idx;
385 const char *z;
386 if( g.argc!=3 ){
387 printf("Usage: %s help COMMAND.\nAvailable COMMANDs:\n", g.argv[0]);
388 cmd_cmd_list();
389 return;
390 }
391 rc = name_search(g.argv[2], aCommand, count(aCommand), &idx);
392 if( rc==1 ){
@@ -519,24 +519,24 @@
519 }
520
521 /*
522 ** COMMAND: cgi
523 **
524 ** Usage: %fossil ?cgi? SCRIPT
525 **
526 ** The SCRIPT argument is the name of a file that is the CGI script
527 ** that is being run. The command name, "cgi", may be omitted if
528 ** the GATEWAY_INTERFACE environment variable is set to "CGI" (which
529 ** should always be the case for CGI scripts run by a webserver.) The
530 ** SCRIPT file should look something like this:
531 **
532 ** #!/usr/bin/fossil
533 ** repository: /home/somebody/project.db
534 **
535 ** The second line defines the name of the repository. After locating
536 ** the repository, fossil will generate a webpage on stdout based on
537 ** the values of standard CGI environment variables.
 
 
 
 
 
538 */
539 void cmd_cgi(void){
540 const char *zFile;
541 Blob config, line, key, value;
542 if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){
@@ -574,15 +574,16 @@
574 }
575
576 /*
577 ** COMMAND: http
578 **
579 ** Usage: %fossil http REPOSITORY
 
 
580 **
581 ** Handle a single HTTP request appearing on stdin. The resulting webpage
582 ** is delivered on stdout. This method is used to launch an HTTP request
583 ** handler from inetd, for example. The argument is the name of the
584 ** repository.
585 */
586 void cmd_http(void){
587 if( g.argc!=2 && g.argc!=3 ){
588 cgi_panic("no repository specified");
589 }
@@ -597,15 +598,17 @@
598 }
599
600 /*
601 ** COMMAND: server
602 **
603 ** Usage: %fossil server ?-P|--port TCPPORT? ?REPOSITORY?
 
 
604 **
605 ** Open a socket and begin listening and responding to HTTP requests on
606 ** TCP port 8080, or on any other TCP port defined by the -P or
607 ** --port option. The optional argument is the name of the repository.
608 ** The repository argument may be omitted if the working directory is
609 ** within an open checkout.
610 */
611 void cmd_webserver(void){
612 int iPort;
613 const char *zPort;
614
615
+2 -1
--- src/merge.c
+++ src/merge.c
@@ -29,18 +29,19 @@
2929
#include <assert.h>
3030
3131
3232
/*
3333
** COMMAND: merge
34
+**
35
+** Usage: %fossil merge VERSION
3436
**
3537
** The argument is a version that should be merged into the current
3638
** checkout.
3739
**
3840
** Only file content is merged. The result continues to use the
3941
** file and directory names from the current check-out even if those
4042
** names might have been changed in the branch being merged in.
41
-**
4243
*/
4344
void merge_cmd(void){
4445
int vid; /* Current version */
4546
int mid; /* Version we are merging against */
4647
int pid; /* The pivot version - most recent common ancestor */
4748
--- src/merge.c
+++ src/merge.c
@@ -29,18 +29,19 @@
29 #include <assert.h>
30
31
32 /*
33 ** COMMAND: merge
 
 
34 **
35 ** The argument is a version that should be merged into the current
36 ** checkout.
37 **
38 ** Only file content is merged. The result continues to use the
39 ** file and directory names from the current check-out even if those
40 ** names might have been changed in the branch being merged in.
41 **
42 */
43 void merge_cmd(void){
44 int vid; /* Current version */
45 int mid; /* Version we are merging against */
46 int pid; /* The pivot version - most recent common ancestor */
47
--- src/merge.c
+++ src/merge.c
@@ -29,18 +29,19 @@
29 #include <assert.h>
30
31
32 /*
33 ** COMMAND: merge
34 **
35 ** Usage: %fossil merge VERSION
36 **
37 ** The argument is a version that should be merged into the current
38 ** checkout.
39 **
40 ** Only file content is merged. The result continues to use the
41 ** file and directory names from the current check-out even if those
42 ** names might have been changed in the branch being merged in.
 
43 */
44 void merge_cmd(void){
45 int vid; /* Current version */
46 int mid; /* Version we are merging against */
47 int pid; /* The pivot version - most recent common ancestor */
48
+3 -1
--- src/rebuild.c
+++ src/rebuild.c
@@ -29,11 +29,13 @@
2929
3030
3131
/*
3232
** COMMAND: rebuild
3333
**
34
-** Reconstruct the entire repository database from the core
34
+** Usage: %fossil rebuild REPOSITORY
35
+**
36
+** Reconstruct the named repository database from the core
3537
** records. Run this command after updating the fossil
3638
** executable in a way that changes the database schema.
3739
*/
3840
void rebuild_database(void){
3941
Stmt s;
4042
--- src/rebuild.c
+++ src/rebuild.c
@@ -29,11 +29,13 @@
29
30
31 /*
32 ** COMMAND: rebuild
33 **
34 ** Reconstruct the entire repository database from the core
 
 
35 ** records. Run this command after updating the fossil
36 ** executable in a way that changes the database schema.
37 */
38 void rebuild_database(void){
39 Stmt s;
40
--- src/rebuild.c
+++ src/rebuild.c
@@ -29,11 +29,13 @@
29
30
31 /*
32 ** COMMAND: rebuild
33 **
34 ** Usage: %fossil rebuild REPOSITORY
35 **
36 ** Reconstruct the named repository database from the core
37 ** records. Run this command after updating the fossil
38 ** executable in a way that changes the database schema.
39 */
40 void rebuild_database(void){
41 Stmt s;
42
+27 -3
--- src/sync.c
+++ src/sync.c
@@ -60,21 +60,41 @@
6060
}
6161
6262
/*
6363
** COMMAND: pull
6464
**
65
-** Pull changes in a remote repository into the local repository
65
+** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY?
66
+**
67
+** Pull changes in a remote repository into the local repository.
68
+** The repository is identified by the -R or --repository option.
69
+** If there is no such option then the open repository is used.
70
+** The URL of the remote server is specified on the command line
71
+** If no URL is specified then the URL used by the most recent
72
+** "pull", "push", or "sync" command is used.
73
+**
74
+** The URL is of the following form:
75
+**
76
+** http://USER@HOST:PORT/PATH
77
+**
78
+** The "USER@" and ":PORT" substrings are optional.
79
+** The "USER" substring specifies the login user. You will be
80
+** prompted for the password on the command-line. The PORT
81
+** specifies the TCP port of the server. The default port is
82
+** 80.
6683
*/
6784
void pull_cmd(void){
6885
process_sync_args();
6986
client_sync(0,1,0);
7087
}
7188
7289
/*
7390
** COMMAND: push
7491
**
75
-** Push changes in the local repository over into a remote repository
92
+** Usage: %fossil push ?URL? ?-R|--repository REPOSITORY?
93
+**
94
+** Push changes in the local repository over into a remote repository.
95
+** See the "pull" command for additional information.
7696
*/
7797
void push_cmd(void){
7898
process_sync_args();
7999
client_sync(1,0,0);
80100
}
@@ -81,11 +101,15 @@
81101
82102
83103
/*
84104
** COMMAND: sync
85105
**
86
-** Synchronize the local repository with a remote repository
106
+** Usage: %fossil sync ?URL? ?-R|--repository REPOSITORY?
107
+**
108
+** Synchronize the local repository with a remote repository. This is
109
+** the equivalent of running both "push" and "pull" at the same time.
110
+** See the "pull" command for additional information.
87111
*/
88112
void sync_cmd(void){
89113
process_sync_args();
90114
client_sync(1,1,0);
91115
}
92116
--- src/sync.c
+++ src/sync.c
@@ -60,21 +60,41 @@
60 }
61
62 /*
63 ** COMMAND: pull
64 **
65 ** Pull changes in a remote repository into the local repository
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66 */
67 void pull_cmd(void){
68 process_sync_args();
69 client_sync(0,1,0);
70 }
71
72 /*
73 ** COMMAND: push
74 **
75 ** Push changes in the local repository over into a remote repository
 
 
 
76 */
77 void push_cmd(void){
78 process_sync_args();
79 client_sync(1,0,0);
80 }
@@ -81,11 +101,15 @@
81
82
83 /*
84 ** COMMAND: sync
85 **
86 ** Synchronize the local repository with a remote repository
 
 
 
 
87 */
88 void sync_cmd(void){
89 process_sync_args();
90 client_sync(1,1,0);
91 }
92
--- src/sync.c
+++ src/sync.c
@@ -60,21 +60,41 @@
60 }
61
62 /*
63 ** COMMAND: pull
64 **
65 ** Usage: %fossil pull ?URL? ?-R|--respository REPOSITORY?
66 **
67 ** Pull changes in a remote repository into the local repository.
68 ** The repository is identified by the -R or --repository option.
69 ** If there is no such option then the open repository is used.
70 ** The URL of the remote server is specified on the command line
71 ** If no URL is specified then the URL used by the most recent
72 ** "pull", "push", or "sync" command is used.
73 **
74 ** The URL is of the following form:
75 **
76 ** http://USER@HOST:PORT/PATH
77 **
78 ** The "USER@" and ":PORT" substrings are optional.
79 ** The "USER" substring specifies the login user. You will be
80 ** prompted for the password on the command-line. The PORT
81 ** specifies the TCP port of the server. The default port is
82 ** 80.
83 */
84 void pull_cmd(void){
85 process_sync_args();
86 client_sync(0,1,0);
87 }
88
89 /*
90 ** COMMAND: push
91 **
92 ** Usage: %fossil push ?URL? ?-R|--repository REPOSITORY?
93 **
94 ** Push changes in the local repository over into a remote repository.
95 ** See the "pull" command for additional information.
96 */
97 void push_cmd(void){
98 process_sync_args();
99 client_sync(1,0,0);
100 }
@@ -81,11 +101,15 @@
101
102
103 /*
104 ** COMMAND: sync
105 **
106 ** Usage: %fossil sync ?URL? ?-R|--repository REPOSITORY?
107 **
108 ** Synchronize the local repository with a remote repository. This is
109 ** the equivalent of running both "push" and "pull" at the same time.
110 ** See the "pull" command for additional information.
111 */
112 void sync_cmd(void){
113 process_sync_args();
114 client_sync(1,1,0);
115 }
116
+30 -7
--- src/timeline.c
+++ src/timeline.c
@@ -184,23 +184,46 @@
184184
185185
186186
/*
187187
** COMMAND: timeline
188188
**
189
-** The timeline command works very much like the timeline webpage, but
190
-** shows much less data and has fewer configuration options. It is
191
-** intended as a convenient shortcut for the common case of seeing
192
-** recent changes.
189
+** Usage: %fossil timeline ?DATETIME? ?-n|--count N?
190
+**
191
+** Print a summary of activity going backwards in date and time
192
+** specified or from the current date and time if no arguments
193
+** are given. Show as many as N (default 20) check-ins.
194
+**
195
+** The date and time should be in the ISO8601 format. For
196
+** examples: "2007-08-18 07:21:21". The time may be omitted.
197
+** Times are according to the local timezone.
193198
*/
194199
void timeline_cmd(void){
195200
Stmt q;
196
- db_must_be_within_tree();
201
+ int n;
202
+ char *zCount;
203
+ char *zDate;
204
+ db_find_and_open_repository();
205
+ zCount = find_option("n","count",1);
206
+ if( zCount ){
207
+ n = atoi(zCount);
208
+ }else{
209
+ n = 20;
210
+ }
211
+ if( g.argc!=2 && g.argc!=3 ){
212
+ usage("YYYY-MM-DDtHH:MM:SS");
213
+ }
214
+ if( g.argc==3 ){
215
+ zDate = g.argv[2];
216
+ }else{
217
+ zDate = "now";
218
+ }
197219
db_prepare(&q,
198220
"SELECT uuid, datetime(event.mtime,'localtime'),"
199221
" comment || ' (by ' || user || ')'"
200222
" FROM event, blob"
201223
" WHERE event.type='ci' AND blob.rid=event.objid"
202
- " ORDER BY event.mtime DESC"
224
+ " AND event.mtime<=(SELECT julianday(%Q,'utc'))"
225
+ " ORDER BY event.mtime DESC", zDate
203226
);
204
- print_timeline(&q, 20);
227
+ print_timeline(&q, n);
205228
db_finalize(&q);
206229
}
207230
--- src/timeline.c
+++ src/timeline.c
@@ -184,23 +184,46 @@
184
185
186 /*
187 ** COMMAND: timeline
188 **
189 ** The timeline command works very much like the timeline webpage, but
190 ** shows much less data and has fewer configuration options. It is
191 ** intended as a convenient shortcut for the common case of seeing
192 ** recent changes.
 
 
 
 
 
193 */
194 void timeline_cmd(void){
195 Stmt q;
196 db_must_be_within_tree();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197 db_prepare(&q,
198 "SELECT uuid, datetime(event.mtime,'localtime'),"
199 " comment || ' (by ' || user || ')'"
200 " FROM event, blob"
201 " WHERE event.type='ci' AND blob.rid=event.objid"
202 " ORDER BY event.mtime DESC"
 
203 );
204 print_timeline(&q, 20);
205 db_finalize(&q);
206 }
207
--- src/timeline.c
+++ src/timeline.c
@@ -184,23 +184,46 @@
184
185
186 /*
187 ** COMMAND: timeline
188 **
189 ** Usage: %fossil timeline ?DATETIME? ?-n|--count N?
190 **
191 ** Print a summary of activity going backwards in date and time
192 ** specified or from the current date and time if no arguments
193 ** are given. Show as many as N (default 20) check-ins.
194 **
195 ** The date and time should be in the ISO8601 format. For
196 ** examples: "2007-08-18 07:21:21". The time may be omitted.
197 ** Times are according to the local timezone.
198 */
199 void timeline_cmd(void){
200 Stmt q;
201 int n;
202 char *zCount;
203 char *zDate;
204 db_find_and_open_repository();
205 zCount = find_option("n","count",1);
206 if( zCount ){
207 n = atoi(zCount);
208 }else{
209 n = 20;
210 }
211 if( g.argc!=2 && g.argc!=3 ){
212 usage("YYYY-MM-DDtHH:MM:SS");
213 }
214 if( g.argc==3 ){
215 zDate = g.argv[2];
216 }else{
217 zDate = "now";
218 }
219 db_prepare(&q,
220 "SELECT uuid, datetime(event.mtime,'localtime'),"
221 " comment || ' (by ' || user || ')'"
222 " FROM event, blob"
223 " WHERE event.type='ci' AND blob.rid=event.objid"
224 " AND event.mtime<=(SELECT julianday(%Q,'utc'))"
225 " ORDER BY event.mtime DESC", zDate
226 );
227 print_timeline(&q, n);
228 db_finalize(&q);
229 }
230
+7 -2
--- src/update.c
+++ src/update.c
@@ -28,15 +28,20 @@
2828
#include "update.h"
2929
#include <assert.h>
3030
3131
/*
3232
** COMMAND: update
33
+**
34
+** Usage: %fossil update ?VERSION?
3335
**
3436
** The optional argument is a version that should become the current
3537
** version. If the argument is omitted, then use the leaf of the
36
-** version tree branch that begins with the current version, if there
37
-** is only a single leaf.
38
+** tree that begins with the current version, if there is only a
39
+** single leaf.
40
+**
41
+** This command is different from the "checkout" in that edits are
42
+** not overwritten. Edits are merged into the new version.
3843
**
3944
*/
4045
void update_cmd(void){
4146
int vid; /* Current version */
4247
int tid; /* Target version - version we are changing to */
4348
--- src/update.c
+++ src/update.c
@@ -28,15 +28,20 @@
28 #include "update.h"
29 #include <assert.h>
30
31 /*
32 ** COMMAND: update
 
 
33 **
34 ** The optional argument is a version that should become the current
35 ** version. If the argument is omitted, then use the leaf of the
36 ** version tree branch that begins with the current version, if there
37 ** is only a single leaf.
 
 
 
38 **
39 */
40 void update_cmd(void){
41 int vid; /* Current version */
42 int tid; /* Target version - version we are changing to */
43
--- src/update.c
+++ src/update.c
@@ -28,15 +28,20 @@
28 #include "update.h"
29 #include <assert.h>
30
31 /*
32 ** COMMAND: update
33 **
34 ** Usage: %fossil update ?VERSION?
35 **
36 ** The optional argument is a version that should become the current
37 ** version. If the argument is omitted, then use the leaf of the
38 ** tree that begins with the current version, if there is only a
39 ** single leaf.
40 **
41 ** This command is different from the "checkout" in that edits are
42 ** not overwritten. Edits are merged into the new version.
43 **
44 */
45 void update_cmd(void){
46 int vid; /* Current version */
47 int tid; /* Target version - version we are changing to */
48
+27 -1
--- src/user.c
+++ src/user.c
@@ -107,11 +107,37 @@
107107
108108
109109
/*
110110
** COMMAND: user
111111
**
112
-** Dispatcher for various user subcommands.
112
+** Usage: %fossil user SUBCOMMAND ... ?-R|--repository FILE?
113
+**
114
+** Run various subcommands on users of the open repository or of
115
+** the repository identified by the -R or --repository option.
116
+**
117
+** %fossil user capabilities USERNAME ?STRING?
118
+**
119
+** Query or set the capabilities for user USERNAME
120
+**
121
+** %fossil user default ?USERNAME?
122
+**
123
+** Query or set the default user. The default user is the
124
+** user for command-line interaction.
125
+**
126
+** %fossil user list
127
+**
128
+** List all users known to the repository
129
+**
130
+** %fossil user new
131
+**
132
+** Create a new user in the repository. Users can never be
133
+** deleted. They can be denied all access but they must continue
134
+** to exist in the database.
135
+**
136
+** %fossil user password USERNAME
137
+**
138
+** Change the web access password for a user.
113139
*/
114140
void user_cmd(void){
115141
int n;
116142
db_find_and_open_repository();
117143
if( g.argc<3 ){
118144
--- src/user.c
+++ src/user.c
@@ -107,11 +107,37 @@
107
108
109 /*
110 ** COMMAND: user
111 **
112 ** Dispatcher for various user subcommands.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
113 */
114 void user_cmd(void){
115 int n;
116 db_find_and_open_repository();
117 if( g.argc<3 ){
118
--- src/user.c
+++ src/user.c
@@ -107,11 +107,37 @@
107
108
109 /*
110 ** COMMAND: user
111 **
112 ** Usage: %fossil user SUBCOMMAND ... ?-R|--repository FILE?
113 **
114 ** Run various subcommands on users of the open repository or of
115 ** the repository identified by the -R or --repository option.
116 **
117 ** %fossil user capabilities USERNAME ?STRING?
118 **
119 ** Query or set the capabilities for user USERNAME
120 **
121 ** %fossil user default ?USERNAME?
122 **
123 ** Query or set the default user. The default user is the
124 ** user for command-line interaction.
125 **
126 ** %fossil user list
127 **
128 ** List all users known to the repository
129 **
130 ** %fossil user new
131 **
132 ** Create a new user in the repository. Users can never be
133 ** deleted. They can be denied all access but they must continue
134 ** to exist in the database.
135 **
136 ** %fossil user password USERNAME
137 **
138 ** Change the web access password for a user.
139 */
140 void user_cmd(void){
141 int n;
142 db_find_and_open_repository();
143 if( g.argc<3 ){
144

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button