Fossil

Check-in [d252cfd6]
Login

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

Overview
Comment:Fix the "add" command so that it prints "SKIP" instead of "ADDED" for files that are already under management. Code to do this was already in place, but it did not work correctly due to a logic error.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d252cfd66d3c8f713c7f180def23931c67195539
User & Date: drh 2015-12-14 23:13:04
Context
2015-12-15
14:46
Add the --page option to the "fossil ui" command. check-in: f55f64e2 user: drh tags: trunk
2015-12-14
23:13
Fix the "add" command so that it prints "SKIP" instead of "ADDED" for files that are already under management. Code to do this was already in place, but it did not work correctly due to a logic error. check-in: d252cfd6 user: drh tags: trunk
2015-12-13
03:13
Fix one error and add an additional note to the article on the annotate algorithm. check-in: 9828493c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/add.c.

   166    166     if( !file_is_simple_pathname(zPath, 1) ){
   167    167       fossil_warning("filename contains illegal characters: %s", zPath);
   168    168       return 0;
   169    169     }
   170    170     if( db_exists("SELECT 1 FROM vfile"
   171    171                   " WHERE pathname=%Q %s", zPath, filename_collation()) ){
   172    172       db_multi_exec("UPDATE vfile SET deleted=0"
   173         -                  " WHERE pathname=%Q %s", zPath, filename_collation());
          173  +                  " WHERE pathname=%Q %s AND deleted",
          174  +                  zPath, filename_collation());
   174    175     }else{
   175    176       char *zFullname = mprintf("%s%s", g.zLocalRoot, zPath);
   176    177       int isExe = file_wd_isexe(zFullname);
   177    178       db_multi_exec(
   178    179         "INSERT INTO vfile(vid,deleted,rid,mrid,pathname,isexe,islink)"
   179    180         "VALUES(%d,0,0,0,%Q,%d,%d)",
   180    181         vid, zPath, isExe, file_wd_islink(0));