Fossil SCM
Added options to the "timeline" CLI command. Additional help comments.
Commit
6607844a0162db6d51c360aaaeead96c84477376
Parent
c9fdb846fb169e3…
9 files changed
+17
-4
+2
+22
-19
+2
-1
+3
-1
+27
-3
+30
-7
+7
-2
+27
-1
M
src/db.c
+17
-4
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -578,13 +578,13 @@ | ||
| 578 | 578 | g.repositoryOpen = 1; |
| 579 | 579 | g.zRepositoryName = mprintf("%s", zDbName); |
| 580 | 580 | } |
| 581 | 581 | |
| 582 | 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. | |
| 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 | 586 | ** |
| 587 | 587 | ** Error out if the repository cannot be opened. |
| 588 | 588 | */ |
| 589 | 589 | void db_find_and_open_repository(void){ |
| 590 | 590 | const char *zRep = find_option("repository", "R", 1); |
| @@ -824,10 +824,11 @@ | ||
| 824 | 824 | |
| 825 | 825 | /* |
| 826 | 826 | ** COMMAND: open |
| 827 | 827 | ** |
| 828 | 828 | ** Usage: open FILENAME |
| 829 | +** | |
| 829 | 830 | ** Open a connection to the local repository in FILENAME. A checkout |
| 830 | 831 | ** for the repository is created with its root at the working directory. |
| 831 | 832 | ** See also the "close" command. |
| 832 | 833 | */ |
| 833 | 834 | void cmd_open(void){ |
| @@ -847,11 +848,23 @@ | ||
| 847 | 848 | } |
| 848 | 849 | |
| 849 | 850 | /* |
| 850 | 851 | ** COMMAND: config |
| 851 | 852 | ** |
| 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 ". | |
| 853 | 866 | */ |
| 854 | 867 | void cmd_config(void){ |
| 855 | 868 | db_open_config(); |
| 856 | 869 | if( g.argc>2 ){ |
| 857 | 870 | int i; |
| 858 | 871 |
| --- 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 @@ | ||
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | /* |
| 75 | 75 | ** COMMAND: info |
| 76 | +** | |
| 77 | +** Usage: %fossil info ?UUID? | |
| 76 | 78 | ** |
| 77 | 79 | ** With no arguments, provide information about the current tree. |
| 78 | 80 | ** If an argument is given, provide information about the record |
| 79 | 81 | ** that the argument refers to. |
| 80 | 82 | */ |
| 81 | 83 |
| --- 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 @@ | ||
| 382 | 382 | */ |
| 383 | 383 | void help_cmd(void){ |
| 384 | 384 | int rc, idx; |
| 385 | 385 | const char *z; |
| 386 | 386 | 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]); | |
| 388 | 388 | cmd_cmd_list(); |
| 389 | 389 | return; |
| 390 | 390 | } |
| 391 | 391 | rc = name_search(g.argv[2], aCommand, count(aCommand), &idx); |
| 392 | 392 | if( rc==1 ){ |
| @@ -519,24 +519,24 @@ | ||
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | /* |
| 522 | 522 | ** COMMAND: cgi |
| 523 | 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: | |
| 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: | |
| 526 | 531 | ** |
| 527 | 532 | ** #!/usr/bin/fossil |
| 528 | 533 | ** repository: /home/somebody/project.db |
| 529 | 534 | ** |
| 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. | |
| 538 | 538 | */ |
| 539 | 539 | void cmd_cgi(void){ |
| 540 | 540 | const char *zFile; |
| 541 | 541 | Blob config, line, key, value; |
| 542 | 542 | if( g.argc==3 && strcmp(g.argv[1],"cgi")==0 ){ |
| @@ -574,15 +574,16 @@ | ||
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | /* |
| 577 | 577 | ** COMMAND: http |
| 578 | 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. | |
| 579 | +** Usage: %fossil http REPOSITORY | |
| 582 | 580 | ** |
| 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. | |
| 584 | 585 | */ |
| 585 | 586 | void cmd_http(void){ |
| 586 | 587 | if( g.argc!=2 && g.argc!=3 ){ |
| 587 | 588 | cgi_panic("no repository specified"); |
| 588 | 589 | } |
| @@ -597,15 +598,17 @@ | ||
| 597 | 598 | } |
| 598 | 599 | |
| 599 | 600 | /* |
| 600 | 601 | ** COMMAND: server |
| 601 | 602 | ** |
| 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? | |
| 605 | 604 | ** |
| 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. | |
| 607 | 610 | */ |
| 608 | 611 | void cmd_webserver(void){ |
| 609 | 612 | int iPort; |
| 610 | 613 | const char *zPort; |
| 611 | 614 | |
| 612 | 615 |
| --- 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 @@ | ||
| 29 | 29 | #include <assert.h> |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | /* |
| 33 | 33 | ** COMMAND: merge |
| 34 | +** | |
| 35 | +** Usage: %fossil merge VERSION | |
| 34 | 36 | ** |
| 35 | 37 | ** The argument is a version that should be merged into the current |
| 36 | 38 | ** checkout. |
| 37 | 39 | ** |
| 38 | 40 | ** Only file content is merged. The result continues to use the |
| 39 | 41 | ** file and directory names from the current check-out even if those |
| 40 | 42 | ** names might have been changed in the branch being merged in. |
| 41 | -** | |
| 42 | 43 | */ |
| 43 | 44 | void merge_cmd(void){ |
| 44 | 45 | int vid; /* Current version */ |
| 45 | 46 | int mid; /* Version we are merging against */ |
| 46 | 47 | int pid; /* The pivot version - most recent common ancestor */ |
| 47 | 48 |
| --- 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 @@ | ||
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | /* |
| 32 | 32 | ** COMMAND: rebuild |
| 33 | 33 | ** |
| 34 | -** Reconstruct the entire repository database from the core | |
| 34 | +** Usage: %fossil rebuild REPOSITORY | |
| 35 | +** | |
| 36 | +** Reconstruct the named repository database from the core | |
| 35 | 37 | ** records. Run this command after updating the fossil |
| 36 | 38 | ** executable in a way that changes the database schema. |
| 37 | 39 | */ |
| 38 | 40 | void rebuild_database(void){ |
| 39 | 41 | Stmt s; |
| 40 | 42 |
| --- 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 @@ | ||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /* |
| 63 | 63 | ** COMMAND: pull |
| 64 | 64 | ** |
| 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. | |
| 66 | 83 | */ |
| 67 | 84 | void pull_cmd(void){ |
| 68 | 85 | process_sync_args(); |
| 69 | 86 | client_sync(0,1,0); |
| 70 | 87 | } |
| 71 | 88 | |
| 72 | 89 | /* |
| 73 | 90 | ** COMMAND: push |
| 74 | 91 | ** |
| 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. | |
| 76 | 96 | */ |
| 77 | 97 | void push_cmd(void){ |
| 78 | 98 | process_sync_args(); |
| 79 | 99 | client_sync(1,0,0); |
| 80 | 100 | } |
| @@ -81,11 +101,15 @@ | ||
| 81 | 101 | |
| 82 | 102 | |
| 83 | 103 | /* |
| 84 | 104 | ** COMMAND: sync |
| 85 | 105 | ** |
| 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. | |
| 87 | 111 | */ |
| 88 | 112 | void sync_cmd(void){ |
| 89 | 113 | process_sync_args(); |
| 90 | 114 | client_sync(1,1,0); |
| 91 | 115 | } |
| 92 | 116 |
| --- 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 @@ | ||
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | /* |
| 187 | 187 | ** COMMAND: timeline |
| 188 | 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. | |
| 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. | |
| 193 | 198 | */ |
| 194 | 199 | void timeline_cmd(void){ |
| 195 | 200 | 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 | + } | |
| 197 | 219 | db_prepare(&q, |
| 198 | 220 | "SELECT uuid, datetime(event.mtime,'localtime')," |
| 199 | 221 | " comment || ' (by ' || user || ')'" |
| 200 | 222 | " FROM event, blob" |
| 201 | 223 | " 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 | |
| 203 | 226 | ); |
| 204 | - print_timeline(&q, 20); | |
| 227 | + print_timeline(&q, n); | |
| 205 | 228 | db_finalize(&q); |
| 206 | 229 | } |
| 207 | 230 |
| --- 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 @@ | ||
| 28 | 28 | #include "update.h" |
| 29 | 29 | #include <assert.h> |
| 30 | 30 | |
| 31 | 31 | /* |
| 32 | 32 | ** COMMAND: update |
| 33 | +** | |
| 34 | +** Usage: %fossil update ?VERSION? | |
| 33 | 35 | ** |
| 34 | 36 | ** The optional argument is a version that should become the current |
| 35 | 37 | ** 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. | |
| 38 | 43 | ** |
| 39 | 44 | */ |
| 40 | 45 | void update_cmd(void){ |
| 41 | 46 | int vid; /* Current version */ |
| 42 | 47 | int tid; /* Target version - version we are changing to */ |
| 43 | 48 |
| --- 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 @@ | ||
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | /* |
| 110 | 110 | ** COMMAND: user |
| 111 | 111 | ** |
| 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. | |
| 113 | 139 | */ |
| 114 | 140 | void user_cmd(void){ |
| 115 | 141 | int n; |
| 116 | 142 | db_find_and_open_repository(); |
| 117 | 143 | if( g.argc<3 ){ |
| 118 | 144 |
| --- 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 |