Fossil SCM

The "open" command now automatically opens to the "trunk", or to some other branch designated by the new "main-branch" setting.

drh 2011-03-08 18:28 trunk
Commit e3e43bbec5360ded5b7d780665aa647043956f4c
1 file changed +7 -2
+7 -2
--- src/db.c
+++ src/db.c
@@ -1535,11 +1535,11 @@
15351535
void cmd_open(void){
15361536
Blob path;
15371537
int vid;
15381538
int keepFlag;
15391539
int allowNested;
1540
- static char *azNewArgv[] = { 0, "checkout", "--prompt", "--latest", 0, 0 };
1540
+ static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 };
15411541
15421542
url_proxy_options();
15431543
keepFlag = find_option("keep",0,0)!=0;
15441544
allowNested = find_option("nested",0,0)!=0;
15451545
if( g.argc!=3 && g.argc!=4 ){
@@ -1562,13 +1562,15 @@
15621562
char **oldArgv = g.argv;
15631563
int oldArgc = g.argc;
15641564
db_lset_int("checkout", vid);
15651565
azNewArgv[0] = g.argv[0];
15661566
g.argv = azNewArgv;
1567
- g.argc = 4;
1567
+ g.argc = 3;
15681568
if( oldArgc==4 ){
15691569
azNewArgv[g.argc-1] = oldArgv[3];
1570
+ }else{
1571
+ azNewArgv[g.argc-1] = db_get("main-branch", "trunk");
15701572
}
15711573
if( keepFlag ){
15721574
azNewArgv[g.argc++] = "--keep";
15731575
}
15741576
checkout_cmd();
@@ -1637,10 +1639,11 @@
16371639
{ "gdiff-command", 0, 16, "gdiff" },
16381640
{ "gmerge-command",0, 40, "" },
16391641
{ "ignore-glob", 0, 40, "" },
16401642
{ "http-port", 0, 16, "8080" },
16411643
{ "localauth", 0, 0, "off" },
1644
+ { "main-branch", 0, 40, "trunk" },
16421645
{ "manifest", 0, 0, "off" },
16431646
{ "max-upload", 0, 25, "250000" },
16441647
{ "mtime-changes", 0, 0, "on" },
16451648
{ "pgp-command", 0, 32, "gpg --clearsign -o " },
16461649
{ "proxy", 0, 32, "off" },
@@ -1719,10 +1722,12 @@
17191722
**
17201723
** localauth If enabled, require that HTTP connections from
17211724
** 127.0.0.1 be authenticated by password. If
17221725
** false, all HTTP requests from localhost have
17231726
** unrestricted access to the repository.
1727
+**
1728
+** main-branch The primary branch for the project. Default: trunk
17241729
**
17251730
** manifest If enabled, automatically create files "manifest" and
17261731
** "manifest.uuid" in every checkout. The SQLite and
17271732
** Fossil repositories both require this. Default: off.
17281733
**
17291734
--- 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

Keyboard Shortcuts

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