Fossil

Check-in [7fca0075]
Login

Check-in [7fca0075]

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

Overview
Comment:Remove redundancy from the "fossil rm" command, as pointed out by Carles Pagès.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7fca007538fea65f96a57974228a24691c978a22
User & Date: drh 2011-03-24 02:08:40
Context
2011-03-24
03:22
Make the error message on schema version mismatch less confusing. ... (check-in: 4a2019dd user: joerg tags: trunk)
02:08
Remove redundancy from the "fossil rm" command, as pointed out by Carles Pagès. ... (check-in: 7fca0075 user: drh tags: trunk)
01:51
Update the built-in SQLite to the latest version from the SQLite trunk. ... (check-in: 3d2e8b2d user: drh tags: trunk)
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/add.c.

366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390

    zName = mprintf("%/", g.argv[i]);
    if( file_isdir(zName) == 1 ){
      int sz = strlen(zName);
      if( sz>0 && zName[sz-1]=='/' ){ zName[sz-1] = 0; }
      del_directory_content(zName);
    } else {
      char *zPath;
      Blob pathname;
      file_tree_name(zName, &pathname, 1);
      zPath = blob_str(&pathname);
      if( !db_exists(
               "SELECT 1 FROM vfile WHERE pathname=%Q AND NOT deleted", zPath) ){
        fossil_fatal("not in the repository: %s", zName);
      }else{
        delete_one_file(zPath);
      }
      blob_reset(&pathname);
    }
    free(zName);
  }
  db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0");
  db_end_transaction(0);
}








<
<
<
<
<
<
<
<
|
<
<







366
367
368
369
370
371
372








373


374
375
376
377
378
379
380

    zName = mprintf("%/", g.argv[i]);
    if( file_isdir(zName) == 1 ){
      int sz = strlen(zName);
      if( sz>0 && zName[sz-1]=='/' ){ zName[sz-1] = 0; }
      del_directory_content(zName);
    } else {








      delete_one_file(zName);


    }
    free(zName);
  }
  db_multi_exec("DELETE FROM vfile WHERE deleted AND rid=0");
  db_end_transaction(0);
}