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.

mgagnon 2023-01-13 18:38 trunk
Commit edf03559615d4ce035caa65a5352742ef0ef1042aa919bd02ac89db64b622fa4
1 file changed +13 -10
+13 -10
--- src/login.c
+++ src/login.c
@@ -2631,18 +2631,21 @@
26312631
** > fossil login-group ?-R REPO?
26322632
**
26332633
** Show the login-group to which REPO, or if invoked from within a check-out
26342634
** the repository on which the current check-out is based, belongs.
26352635
**
2636
-** > fossil login-group join ?-R? REPO ?--name NAME?
2636
+** > fossil login-group join ?-R REPO? ?--name NAME? REPO2
26372637
**
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.
26442647
**
26452648
** > fossil login-group leave ?-R REPO?
26462649
**
26472650
** Take the repository REPO, or if invoked from within a check-out the
26482651
** repository on which the current check-out is based, out of whatever
@@ -2666,17 +2669,17 @@
26662669
if( g.argc>2 ){
26672670
zCmd = g.argv[2];
26682671
nCmd = (int)strlen(zCmd);
26692672
if( strncmp(zCmd,"join",nCmd)==0 && nCmd>=1 ){
26702673
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;
26732675
char *zErr = 0;
26742676
verify_all_options();
2675
- if( g.zRepositoryOption ? g.argc!=3 : g.argc!=4 ){
2677
+ if( g.argc!=4 ){
26762678
fossil_fatal("unexpected argument count for \"login-group join\"");
26772679
}
2680
+ zOther = g.argv[3];
26782681
login_group_leave(&zErr);
26792682
sqlite3_free(zErr);
26802683
zErr = 0;
26812684
login_group_join(zOther,0,0,0,zNewName,&zErr);
26822685
if( zErr ){
26832686
--- 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

Keyboard Shortcuts

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