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