Fossil SCM
Add the dont-push setting to help facilitate private branches.
Commit
d1b948b0c73f24c143b0cc2f395754fcb3ffd695
Parent
4b565c464498078…
2 files changed
+4
+3
M
src/db.c
+4
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1432,10 +1432,13 @@ | ||
| 1432 | 1432 | ** after commit or tag or branch creation. |
| 1433 | 1433 | ** |
| 1434 | 1434 | ** diff-command External command to run when performing a diff. |
| 1435 | 1435 | ** If undefined, the internal text diff will be used. |
| 1436 | 1436 | ** |
| 1437 | +** dont-push Prevent this repository from pushing from client to | |
| 1438 | +** server. Useful when setting up a private branch. | |
| 1439 | +** | |
| 1437 | 1440 | ** editor Text editor command used for check-in comments. |
| 1438 | 1441 | ** |
| 1439 | 1442 | ** http-port The TCP/IP port number to use by the "server" |
| 1440 | 1443 | ** and "ui" commands. Default: 8080 |
| 1441 | 1444 | ** |
| @@ -1469,10 +1472,11 @@ | ||
| 1469 | 1472 | */ |
| 1470 | 1473 | void setting_cmd(void){ |
| 1471 | 1474 | static const char *azName[] = { |
| 1472 | 1475 | "autosync", |
| 1473 | 1476 | "diff-command", |
| 1477 | + "dont-push", | |
| 1474 | 1478 | "editor", |
| 1475 | 1479 | "gdiff-command", |
| 1476 | 1480 | "http-port", |
| 1477 | 1481 | "localauth", |
| 1478 | 1482 | "clearsign", |
| 1479 | 1483 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1432,10 +1432,13 @@ | |
| 1432 | ** after commit or tag or branch creation. |
| 1433 | ** |
| 1434 | ** diff-command External command to run when performing a diff. |
| 1435 | ** If undefined, the internal text diff will be used. |
| 1436 | ** |
| 1437 | ** editor Text editor command used for check-in comments. |
| 1438 | ** |
| 1439 | ** http-port The TCP/IP port number to use by the "server" |
| 1440 | ** and "ui" commands. Default: 8080 |
| 1441 | ** |
| @@ -1469,10 +1472,11 @@ | |
| 1469 | */ |
| 1470 | void setting_cmd(void){ |
| 1471 | static const char *azName[] = { |
| 1472 | "autosync", |
| 1473 | "diff-command", |
| 1474 | "editor", |
| 1475 | "gdiff-command", |
| 1476 | "http-port", |
| 1477 | "localauth", |
| 1478 | "clearsign", |
| 1479 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1432,10 +1432,13 @@ | |
| 1432 | ** after commit or tag or branch creation. |
| 1433 | ** |
| 1434 | ** diff-command External command to run when performing a diff. |
| 1435 | ** If undefined, the internal text diff will be used. |
| 1436 | ** |
| 1437 | ** dont-push Prevent this repository from pushing from client to |
| 1438 | ** server. Useful when setting up a private branch. |
| 1439 | ** |
| 1440 | ** editor Text editor command used for check-in comments. |
| 1441 | ** |
| 1442 | ** http-port The TCP/IP port number to use by the "server" |
| 1443 | ** and "ui" commands. Default: 8080 |
| 1444 | ** |
| @@ -1469,10 +1472,11 @@ | |
| 1472 | */ |
| 1473 | void setting_cmd(void){ |
| 1474 | static const char *azName[] = { |
| 1475 | "autosync", |
| 1476 | "diff-command", |
| 1477 | "dont-push", |
| 1478 | "editor", |
| 1479 | "gdiff-command", |
| 1480 | "http-port", |
| 1481 | "localauth", |
| 1482 | "clearsign", |
| 1483 |
+3
| --- src/xfer.c | ||
| +++ src/xfer.c | ||
| @@ -894,10 +894,13 @@ | ||
| 894 | 894 | Blob send; /* Text we are sending to the server */ |
| 895 | 895 | Blob recv; /* Reply we got back from the server */ |
| 896 | 896 | Xfer xfer; /* Transfer data */ |
| 897 | 897 | const char *zSCode = db_get("server-code", "x"); |
| 898 | 898 | const char *zPCode = db_get("project-code", 0); |
| 899 | + | |
| 900 | + if( db_get_boolean("dont-push", 0) ) pushFlag = 0; | |
| 901 | + if( pushFlag + pullFlag + cloneFlag == 0 ) return; | |
| 899 | 902 | |
| 900 | 903 | transport_stats(0, 0, 1); |
| 901 | 904 | socket_global_init(); |
| 902 | 905 | memset(&xfer, 0, sizeof(xfer)); |
| 903 | 906 | xfer.pIn = &recv; |
| 904 | 907 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -894,10 +894,13 @@ | |
| 894 | Blob send; /* Text we are sending to the server */ |
| 895 | Blob recv; /* Reply we got back from the server */ |
| 896 | Xfer xfer; /* Transfer data */ |
| 897 | const char *zSCode = db_get("server-code", "x"); |
| 898 | const char *zPCode = db_get("project-code", 0); |
| 899 | |
| 900 | transport_stats(0, 0, 1); |
| 901 | socket_global_init(); |
| 902 | memset(&xfer, 0, sizeof(xfer)); |
| 903 | xfer.pIn = &recv; |
| 904 |
| --- src/xfer.c | |
| +++ src/xfer.c | |
| @@ -894,10 +894,13 @@ | |
| 894 | Blob send; /* Text we are sending to the server */ |
| 895 | Blob recv; /* Reply we got back from the server */ |
| 896 | Xfer xfer; /* Transfer data */ |
| 897 | const char *zSCode = db_get("server-code", "x"); |
| 898 | const char *zPCode = db_get("project-code", 0); |
| 899 | |
| 900 | if( db_get_boolean("dont-push", 0) ) pushFlag = 0; |
| 901 | if( pushFlag + pullFlag + cloneFlag == 0 ) return; |
| 902 | |
| 903 | transport_stats(0, 0, 1); |
| 904 | socket_global_init(); |
| 905 | memset(&xfer, 0, sizeof(xfer)); |
| 906 | xfer.pIn = &recv; |
| 907 |