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].
Commit
769a7651e46a6425e9c9b69ac2e346b39bf55249022f3ed7d72a2b9148cca154
Parent
a27c908f5d89b30…
1 file changed
+7
-6
+7
-6
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -2127,16 +2127,17 @@ | ||
| 2127 | 2127 | ** |
| 2128 | 2128 | ** > fossil login-group |
| 2129 | 2129 | ** |
| 2130 | 2130 | ** Show the login-group to which the repository belongs. |
| 2131 | 2131 | ** |
| 2132 | -** > fossil login-group join ?--name NAME? | |
| 2132 | +** > fossil login-group join REPO ?--name NAME? | |
| 2133 | 2133 | ** |
| 2134 | 2134 | ** Add this repository to login group to which REPO belongs, or creates a |
| 2135 | 2135 | ** new login group between itself and REPO if REPO does not already belong |
| 2136 | 2136 | ** 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. | |
| 2138 | 2139 | ** |
| 2139 | 2140 | ** > fossil login-group leave |
| 2140 | 2141 | ** |
| 2141 | 2142 | ** Takes the repository out of whatever login group it is currently |
| 2142 | 2143 | ** a part of. |
| @@ -2163,17 +2164,17 @@ | ||
| 2163 | 2164 | if( g.argc>2 ){ |
| 2164 | 2165 | zCmd = g.argv[2]; |
| 2165 | 2166 | nCmd = (int)strlen(zCmd); |
| 2166 | 2167 | if( strncmp(zCmd,"join",nCmd)==0 && nCmd>=1 ){ |
| 2167 | 2168 | 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); | |
| 2169 | 2171 | char *zErr = 0; |
| 2170 | 2172 | 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\""); | |
| 2173 | 2175 | } |
| 2174 | - zOther = g.argv[3]; | |
| 2175 | 2176 | login_group_leave(&zErr); |
| 2176 | 2177 | sqlite3_free(zErr); |
| 2177 | 2178 | zErr = 0; |
| 2178 | 2179 | login_group_join(zOther,0,0,0,zNewName,&zErr); |
| 2179 | 2180 | if( zErr ){ |
| 2180 | 2181 |
| --- 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 |