Fossil SCM
The "open" command now automatically opens to the "trunk", or to some other branch designated by the new "main-branch" setting.
Commit
e3e43bbec5360ded5b7d780665aa647043956f4c
Parent
ad39c28195ef657…
1 file changed
+7
-2
M
src/db.c
+7
-2
| --- src/db.c | ||
| +++ src/db.c | ||
| @@ -1535,11 +1535,11 @@ | ||
| 1535 | 1535 | void cmd_open(void){ |
| 1536 | 1536 | Blob path; |
| 1537 | 1537 | int vid; |
| 1538 | 1538 | int keepFlag; |
| 1539 | 1539 | int allowNested; |
| 1540 | - static char *azNewArgv[] = { 0, "checkout", "--prompt", "--latest", 0, 0 }; | |
| 1540 | + static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 }; | |
| 1541 | 1541 | |
| 1542 | 1542 | url_proxy_options(); |
| 1543 | 1543 | keepFlag = find_option("keep",0,0)!=0; |
| 1544 | 1544 | allowNested = find_option("nested",0,0)!=0; |
| 1545 | 1545 | if( g.argc!=3 && g.argc!=4 ){ |
| @@ -1562,13 +1562,15 @@ | ||
| 1562 | 1562 | char **oldArgv = g.argv; |
| 1563 | 1563 | int oldArgc = g.argc; |
| 1564 | 1564 | db_lset_int("checkout", vid); |
| 1565 | 1565 | azNewArgv[0] = g.argv[0]; |
| 1566 | 1566 | g.argv = azNewArgv; |
| 1567 | - g.argc = 4; | |
| 1567 | + g.argc = 3; | |
| 1568 | 1568 | if( oldArgc==4 ){ |
| 1569 | 1569 | azNewArgv[g.argc-1] = oldArgv[3]; |
| 1570 | + }else{ | |
| 1571 | + azNewArgv[g.argc-1] = db_get("main-branch", "trunk"); | |
| 1570 | 1572 | } |
| 1571 | 1573 | if( keepFlag ){ |
| 1572 | 1574 | azNewArgv[g.argc++] = "--keep"; |
| 1573 | 1575 | } |
| 1574 | 1576 | checkout_cmd(); |
| @@ -1637,10 +1639,11 @@ | ||
| 1637 | 1639 | { "gdiff-command", 0, 16, "gdiff" }, |
| 1638 | 1640 | { "gmerge-command",0, 40, "" }, |
| 1639 | 1641 | { "ignore-glob", 0, 40, "" }, |
| 1640 | 1642 | { "http-port", 0, 16, "8080" }, |
| 1641 | 1643 | { "localauth", 0, 0, "off" }, |
| 1644 | + { "main-branch", 0, 40, "trunk" }, | |
| 1642 | 1645 | { "manifest", 0, 0, "off" }, |
| 1643 | 1646 | { "max-upload", 0, 25, "250000" }, |
| 1644 | 1647 | { "mtime-changes", 0, 0, "on" }, |
| 1645 | 1648 | { "pgp-command", 0, 32, "gpg --clearsign -o " }, |
| 1646 | 1649 | { "proxy", 0, 32, "off" }, |
| @@ -1719,10 +1722,12 @@ | ||
| 1719 | 1722 | ** |
| 1720 | 1723 | ** localauth If enabled, require that HTTP connections from |
| 1721 | 1724 | ** 127.0.0.1 be authenticated by password. If |
| 1722 | 1725 | ** false, all HTTP requests from localhost have |
| 1723 | 1726 | ** unrestricted access to the repository. |
| 1727 | +** | |
| 1728 | +** main-branch The primary branch for the project. Default: trunk | |
| 1724 | 1729 | ** |
| 1725 | 1730 | ** manifest If enabled, automatically create files "manifest" and |
| 1726 | 1731 | ** "manifest.uuid" in every checkout. The SQLite and |
| 1727 | 1732 | ** Fossil repositories both require this. Default: off. |
| 1728 | 1733 | ** |
| 1729 | 1734 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1535,11 +1535,11 @@ | |
| 1535 | void cmd_open(void){ |
| 1536 | Blob path; |
| 1537 | int vid; |
| 1538 | int keepFlag; |
| 1539 | int allowNested; |
| 1540 | static char *azNewArgv[] = { 0, "checkout", "--prompt", "--latest", 0, 0 }; |
| 1541 | |
| 1542 | url_proxy_options(); |
| 1543 | keepFlag = find_option("keep",0,0)!=0; |
| 1544 | allowNested = find_option("nested",0,0)!=0; |
| 1545 | if( g.argc!=3 && g.argc!=4 ){ |
| @@ -1562,13 +1562,15 @@ | |
| 1562 | char **oldArgv = g.argv; |
| 1563 | int oldArgc = g.argc; |
| 1564 | db_lset_int("checkout", vid); |
| 1565 | azNewArgv[0] = g.argv[0]; |
| 1566 | g.argv = azNewArgv; |
| 1567 | g.argc = 4; |
| 1568 | if( oldArgc==4 ){ |
| 1569 | azNewArgv[g.argc-1] = oldArgv[3]; |
| 1570 | } |
| 1571 | if( keepFlag ){ |
| 1572 | azNewArgv[g.argc++] = "--keep"; |
| 1573 | } |
| 1574 | checkout_cmd(); |
| @@ -1637,10 +1639,11 @@ | |
| 1637 | { "gdiff-command", 0, 16, "gdiff" }, |
| 1638 | { "gmerge-command",0, 40, "" }, |
| 1639 | { "ignore-glob", 0, 40, "" }, |
| 1640 | { "http-port", 0, 16, "8080" }, |
| 1641 | { "localauth", 0, 0, "off" }, |
| 1642 | { "manifest", 0, 0, "off" }, |
| 1643 | { "max-upload", 0, 25, "250000" }, |
| 1644 | { "mtime-changes", 0, 0, "on" }, |
| 1645 | { "pgp-command", 0, 32, "gpg --clearsign -o " }, |
| 1646 | { "proxy", 0, 32, "off" }, |
| @@ -1719,10 +1722,12 @@ | |
| 1719 | ** |
| 1720 | ** localauth If enabled, require that HTTP connections from |
| 1721 | ** 127.0.0.1 be authenticated by password. If |
| 1722 | ** false, all HTTP requests from localhost have |
| 1723 | ** unrestricted access to the repository. |
| 1724 | ** |
| 1725 | ** manifest If enabled, automatically create files "manifest" and |
| 1726 | ** "manifest.uuid" in every checkout. The SQLite and |
| 1727 | ** Fossil repositories both require this. Default: off. |
| 1728 | ** |
| 1729 |
| --- src/db.c | |
| +++ src/db.c | |
| @@ -1535,11 +1535,11 @@ | |
| 1535 | void cmd_open(void){ |
| 1536 | Blob path; |
| 1537 | int vid; |
| 1538 | int keepFlag; |
| 1539 | int allowNested; |
| 1540 | static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 }; |
| 1541 | |
| 1542 | url_proxy_options(); |
| 1543 | keepFlag = find_option("keep",0,0)!=0; |
| 1544 | allowNested = find_option("nested",0,0)!=0; |
| 1545 | if( g.argc!=3 && g.argc!=4 ){ |
| @@ -1562,13 +1562,15 @@ | |
| 1562 | char **oldArgv = g.argv; |
| 1563 | int oldArgc = g.argc; |
| 1564 | db_lset_int("checkout", vid); |
| 1565 | azNewArgv[0] = g.argv[0]; |
| 1566 | g.argv = azNewArgv; |
| 1567 | g.argc = 3; |
| 1568 | if( oldArgc==4 ){ |
| 1569 | azNewArgv[g.argc-1] = oldArgv[3]; |
| 1570 | }else{ |
| 1571 | azNewArgv[g.argc-1] = db_get("main-branch", "trunk"); |
| 1572 | } |
| 1573 | if( keepFlag ){ |
| 1574 | azNewArgv[g.argc++] = "--keep"; |
| 1575 | } |
| 1576 | checkout_cmd(); |
| @@ -1637,10 +1639,11 @@ | |
| 1639 | { "gdiff-command", 0, 16, "gdiff" }, |
| 1640 | { "gmerge-command",0, 40, "" }, |
| 1641 | { "ignore-glob", 0, 40, "" }, |
| 1642 | { "http-port", 0, 16, "8080" }, |
| 1643 | { "localauth", 0, 0, "off" }, |
| 1644 | { "main-branch", 0, 40, "trunk" }, |
| 1645 | { "manifest", 0, 0, "off" }, |
| 1646 | { "max-upload", 0, 25, "250000" }, |
| 1647 | { "mtime-changes", 0, 0, "on" }, |
| 1648 | { "pgp-command", 0, 32, "gpg --clearsign -o " }, |
| 1649 | { "proxy", 0, 32, "off" }, |
| @@ -1719,10 +1722,12 @@ | |
| 1722 | ** |
| 1723 | ** localauth If enabled, require that HTTP connections from |
| 1724 | ** 127.0.0.1 be authenticated by password. If |
| 1725 | ** false, all HTTP requests from localhost have |
| 1726 | ** unrestricted access to the repository. |
| 1727 | ** |
| 1728 | ** main-branch The primary branch for the project. Default: trunk |
| 1729 | ** |
| 1730 | ** manifest If enabled, automatically create files "manifest" and |
| 1731 | ** "manifest.uuid" in every checkout. The SQLite and |
| 1732 | ** Fossil repositories both require this. Default: off. |
| 1733 | ** |
| 1734 |