Fossil

Check-in [c3fee15bd4]
Login

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

Overview
Comment:prevent setting/unsetting property based on ambiguous prefix
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | pending-review
Files: files | file ages | folders
SHA1: c3fee15bd4ea15dac9ee2eaf6ca990a94e1ff340
User & Date: baruch 2014-09-14 11:17:20.446
Context
2014-09-14
21:05
Disallow "fossil set" and "fossil unset" on an ambiguous prefix. check-in: 3b990b5203 user: drh tags: trunk
11:17
prevent setting/unsetting property based on ambiguous prefix Closed-Leaf check-in: c3fee15bd4 user: baruch tags: pending-review
2014-09-13
16:10
Automatically remove "all" entries that differ only in case on case-insensitive filesystems. check-in: c6079d148e user: drh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/db.c.
2498
2499
2500
2501
2502
2503
2504















2505
2506
2507
2508


2509
2510



2511


2512
2513
2514
2515
2516
2517
2518
    if( !ctrlSettings[i].name ){
      fossil_fatal("no such setting: %s", zName);
    }
    isManifest = fossil_strcmp(ctrlSettings[i].name, "manifest")==0;
    if( isManifest && globalFlag ){
      fossil_fatal("cannot set 'manifest' globally");
    }















    if( unsetFlag ){
      db_unset(ctrlSettings[i].name, globalFlag);
    }else if( g.argc==4 ){
      db_set(ctrlSettings[i].name, g.argv[3], globalFlag);


    }else{
      isManifest = 0;



      print_setting(&ctrlSettings[i], db_open_local(0));


    }
    if( isManifest && g.localOpen ){
      manifest_to_disk(db_lget_int("checkout", 0));
    }
  }else{
    usage("?PROPERTY? ?VALUE? ?-global?");
  }







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
>
>


>
>
>
|
>
>







2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
    if( !ctrlSettings[i].name ){
      fossil_fatal("no such setting: %s", zName);
    }
    isManifest = fossil_strcmp(ctrlSettings[i].name, "manifest")==0;
    if( isManifest && globalFlag ){
      fossil_fatal("cannot set 'manifest' globally");
    }
    if( unsetFlag || g.argc==4 ){
      if( ctrlSettings[i+1].name
       && strncmp(ctrlSettings[i+1].name, zName, n)==0
       && n!=strlen(ctrlSettings[i].name)
      ){
        fossil_print("ambiguous property prefix: %s\nMatching properties:\n",
                     zName);
        while( ctrlSettings[i].name
            && strncmp(ctrlSettings[i].name, zName, n)==0
        ){
          fossil_print("%s\n", ctrlSettings[i].name);
          i++;
        }
        fossil_exit(1);
      }else{
        if( unsetFlag ){
          db_unset(ctrlSettings[i].name, globalFlag);
        }else{
          db_set(ctrlSettings[i].name, g.argv[3], globalFlag);
        }
      }
    }else{
      isManifest = 0;
      while( ctrlSettings[i].name
            && strncmp(ctrlSettings[i].name, zName, n)==0
      ){
        print_setting(&ctrlSettings[i], db_open_local(0));
        i++;
      }
    }
    if( isManifest && g.localOpen ){
      manifest_to_disk(db_lget_int("checkout", 0));
    }
  }else{
    usage("?PROPERTY? ?VALUE? ?-global?");
  }