Fossil

Check-in [6c8c638225]
Login

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

Overview
Comment:Fix duplicate entries in the 'all' repository and checkout lists on file systems that are not case-sensitive (e.g. Windows).
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | caseInsensitiveAllLists
Files: files | file ages | folders
SHA1: 6c8c6382256514c68466f1c9c4c7d21e46207bfa
User & Date: mistachkin 2014-09-12 21:12:21.809
Context
2014-09-12
21:15
Minor correction to the previous check-in, use db_optional_sql() where appropriate. Closed-Leaf check-in: e2ff0cc248 user: mistachkin tags: caseInsensitiveAllLists
21:12
Fix duplicate entries in the 'all' repository and checkout lists on file systems that are not case-sensitive (e.g. Windows). check-in: 6c8c638225 user: mistachkin tags: caseInsensitiveAllLists
2014-09-11
17:25
char-vs-int fixes in the JSON API: caused underflow (and thus incorrect is-flag-set results) on platforms where char is unsigned (Linux/ARM). check-in: 57f0bb98c6 user: stephan tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/db.c.
1970
1971
1972
1973
1974
1975
1976



1977
1978
1979
1980
1981
1982

1983

1984




1985
1986
1987

1988

1989
1990
1991

1992




1993
1994
1995
1996
1997




1998
1999
2000
2001

2002

2003
2004
2005
2006
2007
2008
2009
** as follows:
**
**       ckout:%s
**
** Where %s is the checkout root.  The value is the repository file.
*/
void db_record_repository_filename(const char *zName){



  Blob full;
  if( zName==0 ){
    if( !g.localOpen ) return;
    zName = db_repository_filename();
  }
  file_canonical_name(zName, &full, 0);

  db_swap_connections();

  db_multi_exec(




     "INSERT OR IGNORE INTO global_config(name,value)"
     "VALUES('repo:%q',1)",
     blob_str(&full)

  );

  if( g.localOpen && g.zLocalRoot && g.zLocalRoot[0] ){
    Blob localRoot;
    file_canonical_name(g.zLocalRoot, &localRoot, 1);

    db_multi_exec(




      "REPLACE INTO global_config(name, value)"
      "VALUES('ckout:%q','%q');",
      blob_str(&localRoot), blob_str(&full)
    );
    db_swap_connections();




    db_optional_sql("repository",
        "REPLACE INTO config(name,value,mtime)"
        "VALUES('ckout:%q',1,now())",
        blob_str(&localRoot)

    );

    blob_reset(&localRoot);
  }else{
    db_swap_connections();
  }
  blob_reset(&full);
}








>
>
>






>

>

>
>
>
>

|
<
>

>



>

>
>
>
>

|
|


>
>
>
>


|
<
>

>







1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995

1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019

2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
** as follows:
**
**       ckout:%s
**
** Where %s is the checkout root.  The value is the repository file.
*/
void db_record_repository_filename(const char *zName){
  const char *zCollation;
  char *zRepoSetting;
  char *zCkoutSetting;
  Blob full;
  if( zName==0 ){
    if( !g.localOpen ) return;
    zName = db_repository_filename();
  }
  file_canonical_name(zName, &full, 0);
  zCollation = filename_collation();
  db_swap_connections();
  zRepoSetting = mprintf("repo:%q", blob_str(&full));
  db_multi_exec(
     "DELETE FROM global_config WHERE name %s = '%s';",
     zCollation, zRepoSetting
  );
  db_multi_exec(
     "INSERT OR IGNORE INTO global_config(name,value)"
     "VALUES('%s',1);",

     zRepoSetting
  );
  fossil_free(zRepoSetting);
  if( g.localOpen && g.zLocalRoot && g.zLocalRoot[0] ){
    Blob localRoot;
    file_canonical_name(g.zLocalRoot, &localRoot, 1);
    zCkoutSetting = mprintf("ckout:%q", blob_str(&localRoot));
    db_multi_exec(
       "DELETE FROM global_config WHERE name %s = '%s';",
       zCollation, zCkoutSetting
    );
    db_multi_exec(
      "REPLACE INTO global_config(name, value)"
      "VALUES('%s','%q');",
      zCkoutSetting, blob_str(&full)
    );
    db_swap_connections();
    db_multi_exec(
       "DELETE FROM config WHERE name %s = '%s';",
       zCollation, zCkoutSetting
    );
    db_optional_sql("repository",
        "REPLACE INTO config(name,value,mtime)"
        "VALUES('%s',1,now());",

        zCkoutSetting
    );
    fossil_free(zCkoutSetting);
    blob_reset(&localRoot);
  }else{
    db_swap_connections();
  }
  blob_reset(&full);
}