Fossil

Check-in [a2cc6bc6]
Login

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

Overview
Comment:Versionable settings are only checked if the local _FOSSIL_ database is already opened. Versionable settings no longer attempts to open that database itself. This fixes an issue with the Admin/Settings page.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a2cc6bc6dc50a9d6aec8050d25d7ef0188a64f0f
User & Date: drh 2011-08-27 18:05:58.815
Original Comment: Versionable settings are only attempt is the local _FOSSIL_ database is already opened. Versionable settings no longer attempts to open that database itself. This fixes an issue with the Admin/Settings page.
Context
2011-08-29
13:24
Update the built-in SQLite to the latest 3.7.8 alpha version. ... (check-in: 35474aff user: drh tags: trunk)
2011-08-27
18:12
Fix a C89 error specific to the symlinks branch and also pull in the C89 fix and the versionable settings fix from trunk. ... (check-in: 4778edd3 user: drh tags: symlinks)
18:08
Merge fixes from trunk. ... (check-in: 9773d596 user: mistachkin tags: tcl-integration)
18:05
Versionable settings are only checked if the local _FOSSIL_ database is already opened. Versionable settings no longer attempts to open that database itself. This fixes an issue with the Admin/Settings page. ... (check-in: a2cc6bc6 user: drh tags: trunk)
17:53
Fix the timeline.c module to be C89-compliant. MSVC needs this. ... (check-in: 8a5f2a7a user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/db.c.
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
      zVersionedSetting = fossil_strdup(cacheEntry->zValue);
      break;
    }
    cacheEntry = cacheEntry->next;
  }
  /* Attempt to read value from file in checkout if there wasn't a cache hit
  ** and a checkout is open. */
  if( cacheEntry==0 && db_open_local() ){
    Blob versionedPathname;
    char *zVersionedPathname;
    blob_zero(&versionedPathname);
    blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
                 g.zLocalRoot, zName);
    zVersionedPathname = blob_str(&versionedPathname);
    if( file_size(zVersionedPathname)>=0 ){







|







1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
      zVersionedSetting = fossil_strdup(cacheEntry->zValue);
      break;
    }
    cacheEntry = cacheEntry->next;
  }
  /* Attempt to read value from file in checkout if there wasn't a cache hit
  ** and a checkout is open. */
  if( cacheEntry==0 ){
    Blob versionedPathname;
    char *zVersionedPathname;
    blob_zero(&versionedPathname);
    blob_appendf(&versionedPathname, "%s/.fossil-settings/%s",
                 g.zLocalRoot, zName);
    zVersionedPathname = blob_str(&versionedPathname);
    if( file_size(zVersionedPathname)>=0 ){
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
    z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
  }
  if( z==0 && g.configOpen ){
    db_swap_connections();
    z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
    db_swap_connections();
  }
  if( ctrlSetting!=0 && ctrlSetting->versionable ){
    /* This is a versionable setting, try and get the info from a checked out file */
    z = db_get_do_versionable(zName, z);
  }
  if( z==0 ){
    z = zDefault;
  }
  return z;







|







1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
    z = db_text(0, "SELECT value FROM config WHERE name=%Q", zName);
  }
  if( z==0 && g.configOpen ){
    db_swap_connections();
    z = db_text(0, "SELECT value FROM global_config WHERE name=%Q", zName);
    db_swap_connections();
  }
  if( ctrlSetting!=0 && ctrlSetting->versionable && g.localOpen ){
    /* This is a versionable setting, try and get the info from a checked out file */
    z = db_get_do_versionable(zName, z);
  }
  if( z==0 ){
    z = zDefault;
  }
  return z;
Changes to src/setup.c.
1048
1049
1050
1051
1052
1053
1054

1055
1056
1057
1058
1059
1060
1061

  login_check_credentials();
  if( !g.okSetup ){
    login_needed();
  }

  style_header("Settings");

  db_begin_transaction();
  @ <p>This page provides a simple interface to the "fossil setting" command.
  @ See the "fossil help setting" output below for further information on
  @ the meaning of each setting.</p><hr />
  @ <form action="%s(g.zTop)/setup_settings" method="post"><div>
  @ <table border="0"><tr><td valign="top">
  login_insert_csrf_secret();







>







1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062

  login_check_credentials();
  if( !g.okSetup ){
    login_needed();
  }

  style_header("Settings");
  db_open_local();
  db_begin_transaction();
  @ <p>This page provides a simple interface to the "fossil setting" command.
  @ See the "fossil help setting" output below for further information on
  @ the meaning of each setting.</p><hr />
  @ <form action="%s(g.zTop)/setup_settings" method="post"><div>
  @ <table border="0"><tr><td valign="top">
  login_insert_csrf_secret();