Fossil SCM

Add option --empty to the "[/help?cmd=open | fossil open]" command. See: [https://www.mail-archive.com/[email protected]/msg14359.html]

jan.nijtmans 2014-02-17 09:51 trunk
Commit 640626fdbfbb38b5be8418c8042ecf87b7410ae4
2 files changed +19 -12 +1
+19 -12
--- src/db.c
+++ src/db.c
@@ -1989,23 +1989,28 @@
19891989
** If VERSION is specified then that version is checked out. Otherwise
19901990
** the latest version is checked out. No files other than "manifest"
19911991
** and "manifest.uuid" are modified if the --keep option is present.
19921992
**
19931993
** Options:
1994
+** --empty Initialize checkout as being empty, but still connected
1995
+** with the local repository. If you commit this checkout,
1996
+** it will become a new "initial" commit in the repository.
19941997
** --keep Only modify the manifest and manifest.uuid files
19951998
** --nested Allow opening a repository inside an opened checkout
19961999
**
19972000
** See also: close
19982001
*/
19992002
void cmd_open(void){
2003
+ int emptyFlag;
20002004
int keepFlag;
20012005
int allowNested;
20022006
char **oldArgv;
20032007
int oldArgc;
20042008
static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 };
20052009
20062010
url_proxy_options();
2011
+ emptyFlag = find_option("empty",0,0)!=0;
20072012
keepFlag = find_option("keep",0,0)!=0;
20082013
allowNested = find_option("nested",0,0)!=0;
20092014
if( g.argc!=3 && g.argc!=4 ){
20102015
usage("REPOSITORY-FILENAME ?VERSION?");
20112016
}
@@ -2030,22 +2035,24 @@
20302035
db_lset_int("checkout", 0);
20312036
oldArgv = g.argv;
20322037
oldArgc = g.argc;
20332038
azNewArgv[0] = g.argv[0];
20342039
g.argv = azNewArgv;
2035
- g.argc = 3;
2036
- if( oldArgc==4 ){
2037
- azNewArgv[g.argc-1] = oldArgv[3];
2038
- }else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){
2039
- azNewArgv[g.argc-1] = "--latest";
2040
- }else{
2041
- azNewArgv[g.argc-1] = db_get("main-branch", "trunk");
2042
- }
2043
- if( keepFlag ){
2044
- azNewArgv[g.argc++] = "--keep";
2045
- }
2046
- checkout_cmd();
2040
+ if( !emptyFlag){
2041
+ g.argc = 3;
2042
+ if( oldArgc==4 ){
2043
+ azNewArgv[g.argc-1] = oldArgv[3];
2044
+ }else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){
2045
+ azNewArgv[g.argc-1] = "--latest";
2046
+ }else{
2047
+ azNewArgv[g.argc-1] = db_get("main-branch", "trunk");
2048
+ }
2049
+ if( keepFlag ){
2050
+ azNewArgv[g.argc++] = "--keep";
2051
+ }
2052
+ checkout_cmd();
2053
+ }
20472054
g.argc = 2;
20482055
info_cmd();
20492056
}
20502057
20512058
/*
20522059
--- src/db.c
+++ src/db.c
@@ -1989,23 +1989,28 @@
1989 ** If VERSION is specified then that version is checked out. Otherwise
1990 ** the latest version is checked out. No files other than "manifest"
1991 ** and "manifest.uuid" are modified if the --keep option is present.
1992 **
1993 ** Options:
 
 
 
1994 ** --keep Only modify the manifest and manifest.uuid files
1995 ** --nested Allow opening a repository inside an opened checkout
1996 **
1997 ** See also: close
1998 */
1999 void cmd_open(void){
 
2000 int keepFlag;
2001 int allowNested;
2002 char **oldArgv;
2003 int oldArgc;
2004 static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 };
2005
2006 url_proxy_options();
 
2007 keepFlag = find_option("keep",0,0)!=0;
2008 allowNested = find_option("nested",0,0)!=0;
2009 if( g.argc!=3 && g.argc!=4 ){
2010 usage("REPOSITORY-FILENAME ?VERSION?");
2011 }
@@ -2030,22 +2035,24 @@
2030 db_lset_int("checkout", 0);
2031 oldArgv = g.argv;
2032 oldArgc = g.argc;
2033 azNewArgv[0] = g.argv[0];
2034 g.argv = azNewArgv;
2035 g.argc = 3;
2036 if( oldArgc==4 ){
2037 azNewArgv[g.argc-1] = oldArgv[3];
2038 }else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){
2039 azNewArgv[g.argc-1] = "--latest";
2040 }else{
2041 azNewArgv[g.argc-1] = db_get("main-branch", "trunk");
2042 }
2043 if( keepFlag ){
2044 azNewArgv[g.argc++] = "--keep";
2045 }
2046 checkout_cmd();
 
 
2047 g.argc = 2;
2048 info_cmd();
2049 }
2050
2051 /*
2052
--- src/db.c
+++ src/db.c
@@ -1989,23 +1989,28 @@
1989 ** If VERSION is specified then that version is checked out. Otherwise
1990 ** the latest version is checked out. No files other than "manifest"
1991 ** and "manifest.uuid" are modified if the --keep option is present.
1992 **
1993 ** Options:
1994 ** --empty Initialize checkout as being empty, but still connected
1995 ** with the local repository. If you commit this checkout,
1996 ** it will become a new "initial" commit in the repository.
1997 ** --keep Only modify the manifest and manifest.uuid files
1998 ** --nested Allow opening a repository inside an opened checkout
1999 **
2000 ** See also: close
2001 */
2002 void cmd_open(void){
2003 int emptyFlag;
2004 int keepFlag;
2005 int allowNested;
2006 char **oldArgv;
2007 int oldArgc;
2008 static char *azNewArgv[] = { 0, "checkout", "--prompt", 0, 0, 0 };
2009
2010 url_proxy_options();
2011 emptyFlag = find_option("empty",0,0)!=0;
2012 keepFlag = find_option("keep",0,0)!=0;
2013 allowNested = find_option("nested",0,0)!=0;
2014 if( g.argc!=3 && g.argc!=4 ){
2015 usage("REPOSITORY-FILENAME ?VERSION?");
2016 }
@@ -2030,22 +2035,24 @@
2035 db_lset_int("checkout", 0);
2036 oldArgv = g.argv;
2037 oldArgc = g.argc;
2038 azNewArgv[0] = g.argv[0];
2039 g.argv = azNewArgv;
2040 if( !emptyFlag){
2041 g.argc = 3;
2042 if( oldArgc==4 ){
2043 azNewArgv[g.argc-1] = oldArgv[3];
2044 }else if( !db_exists("SELECT 1 FROM event WHERE type='ci'") ){
2045 azNewArgv[g.argc-1] = "--latest";
2046 }else{
2047 azNewArgv[g.argc-1] = db_get("main-branch", "trunk");
2048 }
2049 if( keepFlag ){
2050 azNewArgv[g.argc++] = "--keep";
2051 }
2052 checkout_cmd();
2053 }
2054 g.argc = 2;
2055 info_cmd();
2056 }
2057
2058 /*
2059
--- www/changes.wiki
+++ www/changes.wiki
@@ -7,10 +7,11 @@
77
* The [/reports] page now requires Read ("o") permissions. The "byweek"
88
report now properly propagates the selected year through the event type
99
filter links.
1010
* The [/help/info | info command] now shows leaf status of the checkout.
1111
* Add support for tunneling https through a http proxy (Ticket [e854101c4f]).
12
+ * Add option --empty to the "[/help?cmd=open | fossil open]" command.
1213
1314
<h2>Changes For Version 1.28 (2014-01-27)</h2>
1415
* Enhance [/help?cmd=/reports | /reports] to support event type filtering.
1516
* When cloning a repository, the user name passed via the URL (if any)
1617
is now used as the default local admin user's name.
1718
--- www/changes.wiki
+++ www/changes.wiki
@@ -7,10 +7,11 @@
7 * The [/reports] page now requires Read ("o") permissions. The "byweek"
8 report now properly propagates the selected year through the event type
9 filter links.
10 * The [/help/info | info command] now shows leaf status of the checkout.
11 * Add support for tunneling https through a http proxy (Ticket [e854101c4f]).
 
12
13 <h2>Changes For Version 1.28 (2014-01-27)</h2>
14 * Enhance [/help?cmd=/reports | /reports] to support event type filtering.
15 * When cloning a repository, the user name passed via the URL (if any)
16 is now used as the default local admin user's name.
17
--- www/changes.wiki
+++ www/changes.wiki
@@ -7,10 +7,11 @@
7 * The [/reports] page now requires Read ("o") permissions. The "byweek"
8 report now properly propagates the selected year through the event type
9 filter links.
10 * The [/help/info | info command] now shows leaf status of the checkout.
11 * Add support for tunneling https through a http proxy (Ticket [e854101c4f]).
12 * Add option --empty to the "[/help?cmd=open | fossil open]" command.
13
14 <h2>Changes For Version 1.28 (2014-01-27)</h2>
15 * Enhance [/help?cmd=/reports | /reports] to support event type filtering.
16 * When cloning a repository, the user name passed via the URL (if any)
17 is now used as the default local admin user's name.
18

Keyboard Shortcuts

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