Fossil SCM

login-group command: corrected help text for 'join' option to include REPO and extended code to allow REPO to optionally be passed on as -R REPO. Resolves issue reported in [forum:240b6d856a3dd4b5|forum post 240b6d856a3dd4b5].

stephan 2022-07-30 20:33 trunk
Commit 769a7651e46a6425e9c9b69ac2e346b39bf55249022f3ed7d72a2b9148cca154
1 file changed +7 -6
+7 -6
--- src/login.c
+++ src/login.c
@@ -2127,16 +2127,17 @@
21272127
**
21282128
** > fossil login-group
21292129
**
21302130
** Show the login-group to which the repository belongs.
21312131
**
2132
-** > fossil login-group join ?--name NAME?
2132
+** > fossil login-group join REPO ?--name NAME?
21332133
**
21342134
** Add this repository to login group to which REPO belongs, or creates a
21352135
** new login group between itself and REPO if REPO does not already belong
21362136
** to a login-group. When creating a new login-group, the name of the new
2137
-** group is determined by the "--name" option.
2137
+** group is determined by the "--name" option. REPO may optionally be
2138
+** specified using the -R REPO flag.
21382139
**
21392140
** > fossil login-group leave
21402141
**
21412142
** Takes the repository out of whatever login group it is currently
21422143
** a part of.
@@ -2163,17 +2164,17 @@
21632164
if( g.argc>2 ){
21642165
zCmd = g.argv[2];
21652166
nCmd = (int)strlen(zCmd);
21662167
if( strncmp(zCmd,"join",nCmd)==0 && nCmd>=1 ){
21672168
const char *zNewName = find_option("name",0,1);
2168
- const char *zOther;
2169
+ const char *zOther = g.zRepositoryOption
2170
+ ? g.zRepositoryOption : (g.argc>3 ? g.argv[3] : 0);
21692171
char *zErr = 0;
21702172
verify_all_options();
2171
- if( g.argc!=4 ){
2172
- fossil_fatal("unknown extra arguments to \"login-group join\"");
2173
+ if( g.zRepositoryOption ? g.argc!=3 : g.argc!=4 ){
2174
+ fossil_fatal("unexpected argument count for \"login-group join\"");
21732175
}
2174
- zOther = g.argv[3];
21752176
login_group_leave(&zErr);
21762177
sqlite3_free(zErr);
21772178
zErr = 0;
21782179
login_group_join(zOther,0,0,0,zNewName,&zErr);
21792180
if( zErr ){
21802181
--- src/login.c
+++ src/login.c
@@ -2127,16 +2127,17 @@
2127 **
2128 ** > fossil login-group
2129 **
2130 ** Show the login-group to which the repository belongs.
2131 **
2132 ** > fossil login-group join ?--name NAME?
2133 **
2134 ** Add this repository to login group to which REPO belongs, or creates a
2135 ** new login group between itself and REPO if REPO does not already belong
2136 ** to a login-group. When creating a new login-group, the name of the new
2137 ** group is determined by the "--name" option.
 
2138 **
2139 ** > fossil login-group leave
2140 **
2141 ** Takes the repository out of whatever login group it is currently
2142 ** a part of.
@@ -2163,17 +2164,17 @@
2163 if( g.argc>2 ){
2164 zCmd = g.argv[2];
2165 nCmd = (int)strlen(zCmd);
2166 if( strncmp(zCmd,"join",nCmd)==0 && nCmd>=1 ){
2167 const char *zNewName = find_option("name",0,1);
2168 const char *zOther;
 
2169 char *zErr = 0;
2170 verify_all_options();
2171 if( g.argc!=4 ){
2172 fossil_fatal("unknown extra arguments to \"login-group join\"");
2173 }
2174 zOther = g.argv[3];
2175 login_group_leave(&zErr);
2176 sqlite3_free(zErr);
2177 zErr = 0;
2178 login_group_join(zOther,0,0,0,zNewName,&zErr);
2179 if( zErr ){
2180
--- src/login.c
+++ src/login.c
@@ -2127,16 +2127,17 @@
2127 **
2128 ** > fossil login-group
2129 **
2130 ** Show the login-group to which the repository belongs.
2131 **
2132 ** > fossil login-group join REPO ?--name NAME?
2133 **
2134 ** Add this repository to login group to which REPO belongs, or creates a
2135 ** new login group between itself and REPO if REPO does not already belong
2136 ** to a login-group. When creating a new login-group, the name of the new
2137 ** group is determined by the "--name" option. REPO may optionally be
2138 ** specified using the -R REPO flag.
2139 **
2140 ** > fossil login-group leave
2141 **
2142 ** Takes the repository out of whatever login group it is currently
2143 ** a part of.
@@ -2163,17 +2164,17 @@
2164 if( g.argc>2 ){
2165 zCmd = g.argv[2];
2166 nCmd = (int)strlen(zCmd);
2167 if( strncmp(zCmd,"join",nCmd)==0 && nCmd>=1 ){
2168 const char *zNewName = find_option("name",0,1);
2169 const char *zOther = g.zRepositoryOption
2170 ? g.zRepositoryOption : (g.argc>3 ? g.argv[3] : 0);
2171 char *zErr = 0;
2172 verify_all_options();
2173 if( g.zRepositoryOption ? g.argc!=3 : g.argc!=4 ){
2174 fossil_fatal("unexpected argument count for \"login-group join\"");
2175 }
 
2176 login_group_leave(&zErr);
2177 sqlite3_free(zErr);
2178 zErr = 0;
2179 login_group_join(zOther,0,0,0,zNewName,&zErr);
2180 if( zErr ){
2181

Keyboard Shortcuts

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