Fossil

Diff
Login

Differences From Artifact [7c8ec7f4a9]:

To Artifact [13061ee70f]:


4426
4427
4428
4429
4430
4431
4432
















4433
4434
4435
4436
4437
4438
4439
    if(vid!=0){
      vfile_check_signature(vid, CKSIG_SETMTIME);
    }
  }
  g.argc = 2;
  info_cmd();
}

















/*
** Print the current value of a setting identified by the pSetting
** pointer.
**
** Only show the value, not the setting name, if valueOnly is true.
**







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
    if(vid!=0){
      vfile_check_signature(vid, CKSIG_SETMTIME);
    }
  }
  g.argc = 2;
  info_cmd();
}

/*
** Return true if pSetting has its default value assuming its
** current value is zVal.
*/
int setting_has_default_value(const Setting *pSetting, const char *zVal){
  if( zVal==0 ) return 1;
  if( pSetting->def==0 ) return 0;
  if( pSetting->width==0 ){
    return is_false(pSetting->def)==is_false(zVal);
  }
  if( fossil_strcmp(pSetting->def, zVal)==0 ) return 1;
  if( is_false(zVal) && is_false(pSetting->def) ) return 1;
  if( is_truth(zVal) && is_truth(pSetting->def) ) return 1;
  return 0;
}

/*
** Print the current value of a setting identified by the pSetting
** pointer.
**
** Only show the value, not the setting name, if valueOnly is true.
**
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
    db_prepare(&q,
      "SELECT '(global)', value FROM global_config WHERE name=%Q",
      pSetting->name
    );
  }
  if( db_step(&q)==SQLITE_ROW ){
    const char *zVal = db_column_text(&q,1);
    int noShow = 0;
    if( bIfChng ){
      /* Don't display the value is equal to the default */
      if( zVal==0 ){
        noShow = 1;
      }else if( pSetting->def ){
        if( pSetting->width==0 ){
          if( is_false(zVal) && is_false(pSetting->def) ) noShow = 1;
        }else{
          if( fossil_strcmp(zVal, pSetting->def)==0 ) noShow = 1;
        }
      }
    }
    if( noShow ){
      if( versioned ){
        fossil_print("%-24s (versioned)\n", pSetting->name);
        versioned = 0;
      }
    }else if( valueOnly ){
      fossil_print("%s\n", db_column_text(&q, 1));
    }else{







<
|
<
<
<
<
<
<
<
<
<
<
<
<







4490
4491
4492
4493
4494
4495
4496

4497












4498
4499
4500
4501
4502
4503
4504
    db_prepare(&q,
      "SELECT '(global)', value FROM global_config WHERE name=%Q",
      pSetting->name
    );
  }
  if( db_step(&q)==SQLITE_ROW ){
    const char *zVal = db_column_text(&q,1);

    if( bIfChng && setting_has_default_value(pSetting,zVal) ){












      if( versioned ){
        fossil_print("%-24s (versioned)\n", pSetting->name);
        versioned = 0;
      }
    }else if( valueOnly ){
      fossil_print("%s\n", db_column_text(&q, 1));
    }else{