Fossil SCM
Backout change on "login-group join" command which broke the usage of it outside an opened checkout (using -R flag). Change usage text to match the command behavior properly when using the -R flag.
Commit
edf03559615d4ce035caa65a5352742ef0ef1042aa919bd02ac89db64b622fa4
Parent
143f1db75fe1d89…
1 file changed
+13
-10
+13
-10
| --- src/login.c | ||
| +++ src/login.c | ||
| @@ -2631,18 +2631,21 @@ | ||
| 2631 | 2631 | ** > fossil login-group ?-R REPO? |
| 2632 | 2632 | ** |
| 2633 | 2633 | ** Show the login-group to which REPO, or if invoked from within a check-out |
| 2634 | 2634 | ** the repository on which the current check-out is based, belongs. |
| 2635 | 2635 | ** |
| 2636 | -** > fossil login-group join ?-R? REPO ?--name NAME? | |
| 2636 | +** > fossil login-group join ?-R REPO? ?--name NAME? REPO2 | |
| 2637 | 2637 | ** |
| 2638 | -** This subcommand must be invoked from within a check-out to either: add | |
| 2639 | -** the open repository to the login group that REPO is a member, in which | |
| 2640 | -** case the optional "--name" argument is not required; or create a new | |
| 2641 | -** login group between the open repository and REPO, in which case the new | |
| 2642 | -** group NAME is determined by the mandatory "--name" option. REPO may be | |
| 2643 | -** specified with or without the -R flag. | |
| 2638 | +** This command will either: (1) add the repository on which the current | |
| 2639 | +** check-out is based, or the repository REPO specified with -R, to the | |
| 2640 | +** login group where REPO2 is a member, in which case the optional --name | |
| 2641 | +** argument is not required; or (2) create a new login group between the | |
| 2642 | +** repository on which the current check-out is based, or the repository | |
| 2643 | +** REPO specified with -R, and REPO2, in which case the new group NAME is | |
| 2644 | +** determined by the mandatory --name option. In both cases, the specified | |
| 2645 | +** repositories will first leave any group in which they are currently a | |
| 2646 | +** member before joining the new login group. | |
| 2644 | 2647 | ** |
| 2645 | 2648 | ** > fossil login-group leave ?-R REPO? |
| 2646 | 2649 | ** |
| 2647 | 2650 | ** Take the repository REPO, or if invoked from within a check-out the |
| 2648 | 2651 | ** repository on which the current check-out is based, out of whatever |
| @@ -2666,17 +2669,17 @@ | ||
| 2666 | 2669 | if( g.argc>2 ){ |
| 2667 | 2670 | zCmd = g.argv[2]; |
| 2668 | 2671 | nCmd = (int)strlen(zCmd); |
| 2669 | 2672 | if( strncmp(zCmd,"join",nCmd)==0 && nCmd>=1 ){ |
| 2670 | 2673 | const char *zNewName = find_option("name",0,1); |
| 2671 | - const char *zOther = g.zRepositoryOption | |
| 2672 | - ? g.zRepositoryOption : (g.argc>3 ? g.argv[3] : 0); | |
| 2674 | + const char *zOther = 0; | |
| 2673 | 2675 | char *zErr = 0; |
| 2674 | 2676 | verify_all_options(); |
| 2675 | - if( g.zRepositoryOption ? g.argc!=3 : g.argc!=4 ){ | |
| 2677 | + if( g.argc!=4 ){ | |
| 2676 | 2678 | fossil_fatal("unexpected argument count for \"login-group join\""); |
| 2677 | 2679 | } |
| 2680 | + zOther = g.argv[3]; | |
| 2678 | 2681 | login_group_leave(&zErr); |
| 2679 | 2682 | sqlite3_free(zErr); |
| 2680 | 2683 | zErr = 0; |
| 2681 | 2684 | login_group_join(zOther,0,0,0,zNewName,&zErr); |
| 2682 | 2685 | if( zErr ){ |
| 2683 | 2686 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -2631,18 +2631,21 @@ | |
| 2631 | ** > fossil login-group ?-R REPO? |
| 2632 | ** |
| 2633 | ** Show the login-group to which REPO, or if invoked from within a check-out |
| 2634 | ** the repository on which the current check-out is based, belongs. |
| 2635 | ** |
| 2636 | ** > fossil login-group join ?-R? REPO ?--name NAME? |
| 2637 | ** |
| 2638 | ** This subcommand must be invoked from within a check-out to either: add |
| 2639 | ** the open repository to the login group that REPO is a member, in which |
| 2640 | ** case the optional "--name" argument is not required; or create a new |
| 2641 | ** login group between the open repository and REPO, in which case the new |
| 2642 | ** group NAME is determined by the mandatory "--name" option. REPO may be |
| 2643 | ** specified with or without the -R flag. |
| 2644 | ** |
| 2645 | ** > fossil login-group leave ?-R REPO? |
| 2646 | ** |
| 2647 | ** Take the repository REPO, or if invoked from within a check-out the |
| 2648 | ** repository on which the current check-out is based, out of whatever |
| @@ -2666,17 +2669,17 @@ | |
| 2666 | if( g.argc>2 ){ |
| 2667 | zCmd = g.argv[2]; |
| 2668 | nCmd = (int)strlen(zCmd); |
| 2669 | if( strncmp(zCmd,"join",nCmd)==0 && nCmd>=1 ){ |
| 2670 | const char *zNewName = find_option("name",0,1); |
| 2671 | const char *zOther = g.zRepositoryOption |
| 2672 | ? g.zRepositoryOption : (g.argc>3 ? g.argv[3] : 0); |
| 2673 | char *zErr = 0; |
| 2674 | verify_all_options(); |
| 2675 | if( g.zRepositoryOption ? g.argc!=3 : g.argc!=4 ){ |
| 2676 | fossil_fatal("unexpected argument count for \"login-group join\""); |
| 2677 | } |
| 2678 | login_group_leave(&zErr); |
| 2679 | sqlite3_free(zErr); |
| 2680 | zErr = 0; |
| 2681 | login_group_join(zOther,0,0,0,zNewName,&zErr); |
| 2682 | if( zErr ){ |
| 2683 |
| --- src/login.c | |
| +++ src/login.c | |
| @@ -2631,18 +2631,21 @@ | |
| 2631 | ** > fossil login-group ?-R REPO? |
| 2632 | ** |
| 2633 | ** Show the login-group to which REPO, or if invoked from within a check-out |
| 2634 | ** the repository on which the current check-out is based, belongs. |
| 2635 | ** |
| 2636 | ** > fossil login-group join ?-R REPO? ?--name NAME? REPO2 |
| 2637 | ** |
| 2638 | ** This command will either: (1) add the repository on which the current |
| 2639 | ** check-out is based, or the repository REPO specified with -R, to the |
| 2640 | ** login group where REPO2 is a member, in which case the optional --name |
| 2641 | ** argument is not required; or (2) create a new login group between the |
| 2642 | ** repository on which the current check-out is based, or the repository |
| 2643 | ** REPO specified with -R, and REPO2, in which case the new group NAME is |
| 2644 | ** determined by the mandatory --name option. In both cases, the specified |
| 2645 | ** repositories will first leave any group in which they are currently a |
| 2646 | ** member before joining the new login group. |
| 2647 | ** |
| 2648 | ** > fossil login-group leave ?-R REPO? |
| 2649 | ** |
| 2650 | ** Take the repository REPO, or if invoked from within a check-out the |
| 2651 | ** repository on which the current check-out is based, out of whatever |
| @@ -2666,17 +2669,17 @@ | |
| 2669 | if( g.argc>2 ){ |
| 2670 | zCmd = g.argv[2]; |
| 2671 | nCmd = (int)strlen(zCmd); |
| 2672 | if( strncmp(zCmd,"join",nCmd)==0 && nCmd>=1 ){ |
| 2673 | const char *zNewName = find_option("name",0,1); |
| 2674 | const char *zOther = 0; |
| 2675 | char *zErr = 0; |
| 2676 | verify_all_options(); |
| 2677 | if( g.argc!=4 ){ |
| 2678 | fossil_fatal("unexpected argument count for \"login-group join\""); |
| 2679 | } |
| 2680 | zOther = g.argv[3]; |
| 2681 | login_group_leave(&zErr); |
| 2682 | sqlite3_free(zErr); |
| 2683 | zErr = 0; |
| 2684 | login_group_join(zOther,0,0,0,zNewName,&zErr); |
| 2685 | if( zErr ){ |
| 2686 |