Check-in [46ea03734f]
Not logged in

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

Overview
Comment:start of "nop" no-operation command
Timelines: family | ancestors | descendants | both | nop
Files: files | file ages | folders
SHA1: 46ea03734f8471e0790f994e23386e6a3cc88cd0
User & Date: bharder 2010-09-22 02:58:01.000
Context
2010-09-22
03:03
typo check-in: cb14ab1809 user: bharder tags: nop
02:58
start of "nop" no-operation command check-in: 46ea03734f user: bharder tags: nop
2010-09-19
01:14
merge trunk Leaf check-in: 1dfb33e879 user: bharder tags: lang
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/add.c.
121
122
123
124
125
126
127







128
129
130
131
132
133
134
  while( db_step(&q)==SQLITE_ROW ){
    const char *zName = db_column_text(&q, 0);
    add_one_file(zName, vid, pOmit);
  }
  db_finalize(&q);
  db_multi_exec("DELETE FROM sfile");
}








/*
** COMMAND: add
**
** Usage: %fossil add FILE...
**
** Make arrangements to add one or more files to the current checkout







>
>
>
>
>
>
>







121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
  while( db_step(&q)==SQLITE_ROW ){
    const char *zName = db_column_text(&q, 0);
    add_one_file(zName, vid, pOmit);
  }
  db_finalize(&q);
  db_multi_exec("DELETE FROM sfile");
}








/*
** COMMAND: add
**
** Usage: %fossil add FILE...
**
** Make arrangements to add one or more files to the current checkout
222
223
224
225
226
227
228














































229
230
231
232
233
234
235
      }
      blob_resize(&path, origSize);
    }
  }
  closedir(d);
  blob_reset(&path);
}















































/*
** COMMAND: rm
** COMMAND: delete
** COMMAND: dismiss
**
** Usage: %fossil rm FILE...







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
      }
      blob_resize(&path, origSize);
    }
  }
  closedir(d);
  blob_reset(&path);
}

/*
** COMMAND: nop
**
** Usage: %fossil nop FILE...
**
** Do nothing to one or more files from the tree.
**
** This command does not remove the files from disk.  It just marks the
** files as no longer being part of the project.  In other words, future
** changes to the named files will not be versioned.
*/
void nop_cmd(void){
  int i;
  int vid;

  db_must_be_within_tree();
  vid = db_lget_int("checkout", 0);
  if( vid==0 ){
    fossil_panic("no checkout to remove from");
  }
  db_begin_transaction();
  for(i=2; i<g.argc; i++){
    char *zName;

    zName = mprintf("%/", g.argv[i]);
    if( file_isdir(zName) == 1 ){
      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{
        db_multi_exec("UPDATE vfile SET deleted=0, changed=0 WHERE pathname=%Q", zPath);
        printf("NOP        %s\n", zPath);
      }
      blob_reset(&pathname);
    }
    free(zName);
  }
  db_end_transaction(0);
}

/*
** COMMAND: rm
** COMMAND: delete
** COMMAND: dismiss
**
** Usage: %fossil rm FILE...