Fossil

Check-in [4b9455bf]
Login

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

Overview
Comment:On windows, do not allow the "add" command to add files that differ from existing files only in case. Only works for ASCII. Ticket [36cb6b45fd9d].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:4b9455bf03c38546c1adc49f5a03bd2eba096969
User & Date: drh 2010-01-20 18:35:46
References
2010-01-20
18:38 Ticket [36cb6b45] in windows, fossil allows addition of the same file twice status still Open with 1 other change artifact: 87ad4ebe user: drh
Context
2010-01-20
20:35
Make the mtime-changes setting the default. Avoid redundant calls to stat(). check-in: d7a583e6 user: drh tags: trunk
18:35
On windows, do not allow the "add" command to add files that differ from existing files only in case. Only works for ASCII. Ticket [36cb6b45fd9d]. check-in: 4b9455bf user: drh tags: trunk
16:25
Add the --cherrypick option to the trunk. I had intended to put the previous check-in on the truck but mistakenly left the local repository on the ssl branch. Fortunately, I was able to use to new --cherrypick option to pull the changes over into trunk without pulling all ssl changes. check-in: d2204a00 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/add.c.

50
51
52
53
54
55
56





57
58


59
60
61
62
63
64
65
66
...
140
141
142
143
144
145
146






147
148
149
150
151
152
153
   || blob_compare(&pathname, pOmit)==0
  ){
    fossil_warning("cannot add %s", zPath);
  }else{
    if( !file_is_simple_pathname(zPath) ){
      fossil_fatal("filename contains illegal characters: %s", zPath);
    }





    if( db_exists("SELECT 1 FROM vfile WHERE pathname=%Q", zPath) ){
      db_multi_exec("UPDATE vfile SET deleted=0 WHERE pathname=%Q", zPath);


    }else{
      db_multi_exec(
        "INSERT INTO vfile(vid,deleted,rid,mrid,pathname)"
        "VALUES(%d,0,0,0,%Q)", vid, zPath);
    }
    printf("ADDED  %s\n", zPath);
  }
  blob_reset(&pathname);
................................................................................
    fossil_panic("no checkout to add to");
  }
  db_begin_transaction();
  if( !file_tree_name(g.zRepositoryName, &repo, 0) ){
    blob_zero(&repo);
  }
  db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");






  for(i=2; i<g.argc; i++){
    char *zName;
    int isDir;

    zName = mprintf("%/", g.argv[i]);
    isDir = file_isdir(zName);
    if( isDir==1 ){







>
>
>
>
>


>
>
|







 







>
>
>
>
>
>







50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
...
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
   || blob_compare(&pathname, pOmit)==0
  ){
    fossil_warning("cannot add %s", zPath);
  }else{
    if( !file_is_simple_pathname(zPath) ){
      fossil_fatal("filename contains illegal characters: %s", zPath);
    }
#ifdef __MINGW32__
    if( db_exists("SELECT 1 FROM vfile WHERE pathname LIKE %Q", zPath) ){
      db_multi_exec("UPDATE vfile SET deleted=0 WHERE pathname LIKE %Q", zPath);
    }
#else
    if( db_exists("SELECT 1 FROM vfile WHERE pathname=%Q", zPath) ){
      db_multi_exec("UPDATE vfile SET deleted=0 WHERE pathname=%Q", zPath);
    }
#endif
    else{
      db_multi_exec(
        "INSERT INTO vfile(vid,deleted,rid,mrid,pathname)"
        "VALUES(%d,0,0,0,%Q)", vid, zPath);
    }
    printf("ADDED  %s\n", zPath);
  }
  blob_reset(&pathname);
................................................................................
    fossil_panic("no checkout to add to");
  }
  db_begin_transaction();
  if( !file_tree_name(g.zRepositoryName, &repo, 0) ){
    blob_zero(&repo);
  }
  db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY)");
#ifdef __MINGW32__
  db_multi_exec(
     "CREATE INDEX IF NOT EXISTS vfile_pathname "
     "  ON vfile(pathname COLLATE nocase)"
  );
#endif
  for(i=2; i<g.argc; i++){
    char *zName;
    int isDir;

    zName = mprintf("%/", g.argv[i]);
    isDir = file_isdir(zName);
    if( isDir==1 ){