00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "testCopy.h"
00020 #include "cvsSourceDirectory.h"
00021
00022
00023
00024
00025
00026
00027 TestCopy::
00028 TestCopy() {
00029 set_program_description
00030 ("This program copies one or more files into a CVS source hierarchy. "
00031 "Rather than copying the named files immediately into the current "
00032 "directory, it first scans the entire source hierarchy, identifying all "
00033 "the already-existing files. If the named file to copy matches the "
00034 "name of an already-existing file in the current directory or elsewhere "
00035 "in the hierarchy, that file is overwritten.\n\n"
00036
00037 "This is primarily useful as a test program for libcvscopy.");
00038 }
00039
00040
00041
00042
00043
00044
00045 void TestCopy::
00046 run() {
00047 SourceFiles::iterator fi;
00048 for (fi = _source_files.begin(); fi != _source_files.end(); ++fi) {
00049 CVSSourceDirectory *dest = import(*fi, 0, _model_dir);
00050 if (dest == (CVSSourceDirectory *)NULL) {
00051 exit(1);
00052 }
00053 }
00054 }
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 bool TestCopy::
00065 copy_file(const Filename &source, const Filename &dest,
00066 CVSSourceDirectory *, void *, bool) {
00067 return copy_binary_file(source, dest);
00068 }
00069
00070
00071 int main(int argc, char *argv[]) {
00072 TestCopy prog;
00073 prog.parse_command_line(argc, argv);
00074 prog.run();
00075 return 0;
00076 }