Fossil

Check-in [34e0f6817a]
Login

Check-in [34e0f6817a]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Use verify_all_options() with fossil branch ls/lsh.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | filter-branch-ls-by-user
Files: files | file ages | folders
SHA3-256: 34e0f6817ab1682cd856dd26a76a08761d6b733de7ca4d47e9a90c6529c66c9c
User & Date: preben 2023-09-28 18:39:06.624
Context
2023-09-29
13:33
merge in filter-branch-ls-by-user ... (check-in: d6cdd955e1 user: preben tags: trunk)
2023-09-28
18:39
Use verify_all_options() with fossil branch ls/lsh. ... (Closed-Leaf check-in: 34e0f6817a user: preben tags: filter-branch-ls-by-user)
17:58
Fix find_option() error and badly type --users in argument test. ... (check-in: 119cc37ac5 user: preben tags: filter-branch-ls-by-user)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/branch.c.
736
737
738
739
740
741
742

743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
    if( find_option("self",0,0)!=0 ){
      if( zUser ){
        fossil_fatal("flags --username and --self are mutually exclusive");
      }
      user_select();
      zUser = login_name();
    }


    if ( (brFlags & BRL_MERGED) && (brFlags & BRL_UNMERGED) ){
      fossil_fatal("flags --merged and --unmerged are mutually exclusive");
    }
    if( zUsersOpt ){
      if( nUsers <= 0) fossil_fatal("With --users, N must be positive");
      brFlags |= BRL_LIST_USERS;
    }
    if( strcmp(zCmd, "lsh")==0 ){
      nLimit = 5;
      if( g.argc>4 || (g.argc==4 && (nLimit = atoi(g.argv[3]))==0) ){
        fossil_fatal("the lsh subcommand allows one optional numeric argument");
      }
      brFlags |= BRL_ORDERBY_MTIME;
    }else{
      if( (g.argc == 4 || g.argc == 5)
       && fossil_strcmp(g.argv[g.argc-1], "--users") == 0 ){
        fossil_fatal("Missing argument for --users");
      }
      if( g.argc >= 4 ) zBrNameGlob = g.argv[3];
    }

    if( g.localOpen ){
      vid = db_lget_int("checkout", 0);
      zCurrent = db_text(0, "SELECT value FROM tagxref"
                            " WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH);







>















<
<
<
<







736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758




759
760
761
762
763
764
765
    if( find_option("self",0,0)!=0 ){
      if( zUser ){
        fossil_fatal("flags --username and --self are mutually exclusive");
      }
      user_select();
      zUser = login_name();
    }
    verify_all_options();

    if ( (brFlags & BRL_MERGED) && (brFlags & BRL_UNMERGED) ){
      fossil_fatal("flags --merged and --unmerged are mutually exclusive");
    }
    if( zUsersOpt ){
      if( nUsers <= 0) fossil_fatal("With --users, N must be positive");
      brFlags |= BRL_LIST_USERS;
    }
    if( strcmp(zCmd, "lsh")==0 ){
      nLimit = 5;
      if( g.argc>4 || (g.argc==4 && (nLimit = atoi(g.argv[3]))==0) ){
        fossil_fatal("the lsh subcommand allows one optional numeric argument");
      }
      brFlags |= BRL_ORDERBY_MTIME;
    }else{




      if( g.argc >= 4 ) zBrNameGlob = g.argv[3];
    }

    if( g.localOpen ){
      vid = db_lget_int("checkout", 0);
      zCurrent = db_text(0, "SELECT value FROM tagxref"
                            " WHERE rid=%d AND tagid=%d", vid, TAG_BRANCH);