Fossil

Check-in [d6605776]
Login

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

Overview
Comment:Add the undocumented --test option to "fossil clean", so that we can easily see what is being removed without actually removing it. This found a bug in the case-sensitivity logic, which was also fixed. Ticket [03fec0ab6021c776a4b3]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d66057762f7e570bc4266b98a78ed9150e97dbda
User & Date: drh 2012-11-02 22:32:39
Context
2012-11-02
23:52
Make the repeated-ticket suppressor output text ("N similar events omitted") appear at the end of the first line in the timeline, rather than on a separate line. Less obtrusive this way. check-in: dccb97fc user: drh tags: trunk
22:32
Add the undocumented --test option to "fossil clean", so that we can easily see what is being removed without actually removing it. This found a bug in the case-sensitivity logic, which was also fixed. Ticket [03fec0ab6021c776a4b3] check-in: d6605776 user: drh tags: trunk
21:53
Be aware of the filename case sensitivity of the underlying filesystem in the "fossil clean" command. Ticket [03fec0ab6021c77]. check-in: 640a4f49 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/checkin.c.

410
411
412
413
414
415
416

417
418
419
420
421

422
423
424
425
426
427
428
...
435
436
437
438
439
440
441

442


443
444
445
446
447
448
449
450
  int allFlag;
  unsigned scanFlags = 0;
  const char *zIgnoreFlag;
  Blob path, repo;
  Stmt q;
  int n;
  Glob *pIgnore;


  allFlag = find_option("force","f",0)!=0;
  if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
  if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
  zIgnoreFlag = find_option("ignore",0,1);

  db_must_be_within_tree();
  if( zIgnoreFlag==0 ){
    zIgnoreFlag = db_get("ignore-glob", 0);
  }
  db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
                filename_collation());
  n = strlen(g.zLocalRoot);
................................................................................
      " WHERE x NOT IN (%s)"
      " ORDER BY 1",
      g.zLocalRoot, fossil_all_reserved_names()
  );
  if( file_tree_name(g.zRepositoryName, &repo, 0) ){
    db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
  }

  while( db_step(&q)==SQLITE_ROW ){


    if( allFlag ){
      file_delete(db_column_text(&q, 0));
    }else{
      Blob ans;
      char cReply;
      char *prompt = mprintf("remove unmanaged file \"%s\" (y/N)? ",
                              db_column_text(&q, 0));
      blob_zero(&ans);







>





>







 







>

>
>
|







410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
...
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
  int allFlag;
  unsigned scanFlags = 0;
  const char *zIgnoreFlag;
  Blob path, repo;
  Stmt q;
  int n;
  Glob *pIgnore;
  int testFlag = 0;

  allFlag = find_option("force","f",0)!=0;
  if( find_option("dotfiles",0,0)!=0 ) scanFlags |= SCAN_ALL;
  if( find_option("temp",0,0)!=0 ) scanFlags |= SCAN_TEMP;
  zIgnoreFlag = find_option("ignore",0,1);
  testFlag = find_option("test",0,0)!=0;
  db_must_be_within_tree();
  if( zIgnoreFlag==0 ){
    zIgnoreFlag = db_get("ignore-glob", 0);
  }
  db_multi_exec("CREATE TEMP TABLE sfile(x TEXT PRIMARY KEY %s)",
                filename_collation());
  n = strlen(g.zLocalRoot);
................................................................................
      " WHERE x NOT IN (%s)"
      " ORDER BY 1",
      g.zLocalRoot, fossil_all_reserved_names()
  );
  if( file_tree_name(g.zRepositoryName, &repo, 0) ){
    db_multi_exec("DELETE FROM sfile WHERE x=%B", &repo);
  }
  db_multi_exec("DELETE FROM sfile WHERE x IN (SELECT pathname FROM vfile)");
  while( db_step(&q)==SQLITE_ROW ){
    if( testFlag ){
      fossil_print("%s\n", db_column_text(&q,0));
    }else if( allFlag ){
      file_delete(db_column_text(&q, 0));
    }else{
      Blob ans;
      char cReply;
      char *prompt = mprintf("remove unmanaged file \"%s\" (y/N)? ",
                              db_column_text(&q, 0));
      blob_zero(&ans);